aboutsummaryrefslogtreecommitdiff
path: root/tactics
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2013-09-06 22:01:36 +0200
committerPierre-Marie Pédrot2013-11-27 18:43:35 +0100
commit982c1ae49d200f782a5b82f53164d68418a77387 (patch)
treec0cd589357a3152fade6e19de76764d6ab634023 /tactics
parent144f2ac7c7394a701808daa503a0b6ded5663fcc (diff)
Adding the necessary hooks to handle tactics in terms.
Diffstat (limited to 'tactics')
-rw-r--r--tactics/tacinterp.ml19
1 files changed, 19 insertions, 0 deletions
diff --git a/tactics/tacinterp.ml b/tactics/tacinterp.ml
index 845b3ad9fb..0821423b5d 100644
--- a/tactics/tacinterp.ml
+++ b/tactics/tacinterp.ml
@@ -2188,6 +2188,25 @@ let tacticIn t =
(***************************************************************************)
(* Backwarding recursive needs of tactic glob/interp/eval functions *)
+let _ =
+ let eval ty env sigma lfun arg =
+ let ist = { lfun = lfun; extra = TacStore.empty; } in
+ if has_type arg (glbwit wit_tactic) then
+ let tac = out_gen (glbwit wit_tactic) arg in
+ let tac = interp_tactic ist tac in
+ let prf = Proof.start sigma [env, ty] in
+ let (prf, _) = Proof.run_tactic env tac prf in
+ let sigma = Proof.in_proof prf (fun sigma -> sigma) in
+ let ans = match Proof.initial_goals prf with
+ | [c, _] -> c
+ | _ -> assert false
+ in
+ ans, sigma
+ else
+ failwith "not a tactic"
+ in
+ Hook.set Pretyping.genarg_interp_hook eval
+
let _ = Hook.set Auto.extern_interp
(fun l ->
let lfun = Id.Map.map (fun c -> Value.of_constr c) l in