aboutsummaryrefslogtreecommitdiff
path: root/proofs/proofview.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2014-11-21 19:28:46 +0100
committerPierre-Marie Pédrot2014-11-22 13:23:28 +0100
commit34921bb2391e8ce8b0fa00c300d218d2ef6f27e2 (patch)
tree0ac55299bfc367aa55ffebf4cef0d3edbe5fd50b /proofs/proofview.ml
parent228a39aab291af446b9419673c05d224dfbd8a72 (diff)
Exporting a primitive allowing to run completely the tactic monad.
Diffstat (limited to 'proofs/proofview.ml')
-rw-r--r--proofs/proofview.ml17
1 files changed, 11 insertions, 6 deletions
diff --git a/proofs/proofview.ml b/proofs/proofview.ml
index e2b92f5649..c850211387 100644
--- a/proofs/proofview.ml
+++ b/proofs/proofview.ml
@@ -223,10 +223,13 @@ type +'a tactic = 'a Proof.t
(** Applies a tactic to the current proofview. *)
let apply env t sp =
- let (next_r,(next_state,_),status,info) =
- Logic_monad.NonLogical.run (Proof.run t false (sp,env))
- in
- next_r,next_state,status,Trace.to_tree info
+ let open Logic_monad in
+ let ans = Proof.repr (Proof.run t false (sp,env)) in
+ let ans = Logic_monad.NonLogical.run ans in
+ match ans with
+ | Nil e -> raise (TacticFailure e)
+ | Cons ((r, (state, _), status, info), _) ->
+ r, state, status, Trace.to_tree info
@@ -732,8 +735,10 @@ let tclTIMEOUT n t =
Logic_monad.NonLogical.catch
begin
let open Logic_monad.NonLogical in
- timeout n (Proof.run t envvar initial) >>= fun r ->
- return (Util.Inl r)
+ timeout n (Proof.repr (Proof.run t envvar initial)) >>= fun r ->
+ match r with
+ | Logic_monad.Nil e -> return (Util.Inr e)
+ | Logic_monad.Cons (r, _) -> return (Util.Inl r)
end
begin let open Logic_monad.NonLogical in function
| Logic_monad.Timeout -> return (Util.Inr Timeout)