diff options
| author | Arnaud Spiwack | 2013-11-25 19:55:57 +0100 |
|---|---|---|
| committer | Arnaud Spiwack | 2013-12-04 14:14:32 +0100 |
| commit | eef907ed0a200e912ab2eddc0fcea41b5f61c145 (patch) | |
| tree | 9748713b4502fb7a5a020b834fee3d37f15644d2 /proofs/proofview.ml | |
| parent | 12a55370b525185858aed77af4ef1dc0d5cf4e7e (diff) | |
Allow proofs to start with dependent goals.
I use a telescope to represent to goals, and let proofview.ml generate the appropriate existential variables.
Diffstat (limited to 'proofs/proofview.ml')
| -rw-r--r-- | proofs/proofview.ml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/proofs/proofview.ml b/proofs/proofview.ml index 26a2985c68..1dff6203b4 100644 --- a/proofs/proofview.ml +++ b/proofs/proofview.ml @@ -53,6 +53,32 @@ let init sigma = (* Marks all the goal unresolvable for typeclasses. *) { v with solution = Typeclasses.mark_unresolvables v.solution } +type telescope = + | TNil + | TCons of Environ.env*Term.types*(Term.constr -> telescope) + +let dependent_init = + let rec aux sigma = function + | TNil -> { initial = [] ; + solution = sigma ; + comb = []; + } + | TCons (env,typ,t) -> let ( sigma , econstr ) = + Evarutil.new_evar sigma env typ + in + let { initial = ret ; solution = sol ; comb = comb } = + aux sigma (t econstr) + in + let (e,_) = Term.destEvar econstr in + let gl = Goal.build e in + { initial = (econstr,typ)::ret; + solution = sol ; + comb = gl::comb; } + in + fun sigma t -> let v = aux sigma t in + (* Marks all the goal unresolvable for typeclasses. *) + { v with solution = Typeclasses.mark_unresolvables v.solution } + let initial_goals { initial } = initial (* Returns whether this proofview is finished or not. That is, |
