X-Git-Url: http://git.megacz.com/?p=coinductive-monad.git;a=blobdiff_plain;f=Computation%2FEval.v;h=28a00a03129f6c35e96ccac2541b8b184c90efb8;hp=07d79e4d104a8df9b9e0a364820dbd4b0f78f704;hb=9ce6a85d86cdc3a5bba1f5c3cd153cdc046f10b9;hpb=68eb561f71dd052a346319cd1b92dd077cb1c8bb diff --git a/Computation/Eval.v b/Computation/Eval.v index 07d79e4..28a00a0 100644 --- a/Computation/Eval.v +++ b/Computation/Eval.v @@ -17,6 +17,25 @@ Fixpoint bounded_eval (A:Set) (n:nat) (c:#A) {struct n} : option A := end. Inductive Unit : Set := unit : Unit. + +(* + * In theory we'd like to be able to do this (below), but it violates + * the Prop/Set separation: + * + * "Elimination of an inductive object of sort Prop is not allowed on a + * predicate in sort Set because proofs can be eliminated only to + * build proofs." + *) +(* +Definition eval (A:Set) (c:#A) (t:Terminates c) : A := + match t with + | (Terminates_intro t') => + match t' with + | (ex_intro x y) => x + end + end. +*) + Definition eval (A:Set) (c:#A) (t:Terminates c) : A := match eval' c Unit (Return unit) (termination_is_safe A c t) with | exist x pf => x