diff options
author | 2014-07-24 14:55:20 +0200 | |
---|---|---|
committer | 2014-07-24 17:58:38 +0200 | |
commit | 6b48993748998f0aaaa18ee65a7591d6a083c0f9 (patch) | |
tree | 3194d79e89b3c1ac429854361fa55f870b710e5c /proofs/proofview.ml | |
parent | 31c1280a000c03c3a48ee697032d67e3e06af3fa (diff) |
A handful of useful primitives in Proofview.Refine.
Diffstat (limited to 'proofs/proofview.ml')
-rw-r--r-- | proofs/proofview.ml | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/proofs/proofview.ml b/proofs/proofview.ml index 52d8b7d7c..e96e19015 100644 --- a/proofs/proofview.ml +++ b/proofs/proofview.ml @@ -910,19 +910,39 @@ struct let h = (evd, build_goal evk :: evs) in (h, ev) + let fresh_constructor_instance (evd,evs) env construct = + let (evd,pconstruct) = Evd.fresh_constructor_instance env evd construct in + (evd,evs) , pconstruct + + let with_type (evd,evs) env c t = + let my_type = Retyping.get_type_of env evd c in + let j = Environ.make_judge c my_type in + let (evd,j') = + Coercion.inh_conv_coerce_to true (Loc.ghost) env evd j t + in + (evd,evs) , j'.Environ.uj_val + let refine f = Goal.raw_enter begin fun gl -> let sigma = Goal.sigma gl in let handle = (sigma, []) in let ((sigma, evs), c) = f handle in let sigma = partial_solution sigma gl.Goal.self c in - let modify start = { solution = sigma; comb = List.rev evs; } in + let modify start = { solution = sigma; comb = undefined sigma (List.rev evs); } in Proof.modify modify end + let refine_casted f = Goal.raw_enter begin fun gl -> + let concl = Goal.concl gl in + let env = Goal.env gl in + let f h = + let (h,c) = f h in + with_type h env c concl + in + refine f + end + end module NonLogical = Proofview_monad.NonLogical let tclLIFT = Proofview_monad.Logical.lift - - |