(* CH 3: Untyped arithmetic expressions AUTHOR: Brigitte Pientka SMALL-STEP EVALUATION RULES AND DETERMINACY *) (* Load definitions of terms, values, step etc. *) sig use "tapl-ch3-arith-only.elf"; (* Declare that there are no parameters. By default Delphin assumes all type-level constants to be possible parameters. *) params = . ; (* Congruence lemmas about equality *) fun eq_succ: -> = (fn => ) ; fun eq_pred: -> = (fn => ) ; (* Values don't step Theorem: If step M M' and value M then impossible *) fun values_dont_step : -> -> = fn => values_dont_step ; fun step_zero_impossible : -> = (* From a contradiction, we can conclude anything. Theorem: For all M M', if empty the neq M' M. *) fun empty_implies_anything: -> = (fn . ) ; (* MAIN THEOREM: If step M M' and step M M'' then eq M' M''. *) fun det : -> -> = fn => eq_succ (det ) | => | => | => eq_pred (det ) | => empty_implies_anything (values_dont_step ) | => empty_implies_anything (values_dont_step ) ;