diff options
author | 2014-07-06 17:08:59 +0200 | |
---|---|---|
committer | 2014-07-08 00:06:02 +0200 | |
commit | eb7753109a849aaa7fe5c341f02e408c5fc49f85 (patch) | |
tree | 8a9db87dd947e85b9fb317fe11175f45e0229b8e /proofs/proofview.ml | |
parent | a3503c0aca07f5e7f5785faa7b76123a02ecc2af (diff) |
Exporting Proof.split in proofview.
Diffstat (limited to 'proofs/proofview.ml')
-rw-r--r-- | proofs/proofview.ml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/proofs/proofview.ml b/proofs/proofview.ml index c478bd663..0f118a7c6 100644 --- a/proofs/proofview.ml +++ b/proofs/proofview.ml @@ -210,6 +210,10 @@ let unfocus c sp = module Proof = Proofview_monad.Logical type +'a tactic = 'a Proof.t +type 'a case = +| Fail of exn +| Next of 'a * (exn -> 'a tactic) + (* Applies a tactic to the current proofview. *) let apply env t sp = let (((next_r,next_state),status)) = Proofview_monad.NonLogical.run (Proof.run t env sp) in @@ -247,6 +251,14 @@ let tclOR t1 t2 = (* [tclZERO e] always fails with error message [e]*) let tclZERO = Proof.zero +(* [tclCASE t] observes the head of the tactic and returns it as a value *) +let tclCASE t = + let map = function + | Nil e -> Fail e + | Cons (x, t) -> Next (x, t) + in + Proof.map map (Proof.split t) + (* [tclORELSE t1 t2] behaves like [t1] if [t1] succeeds at least once or [t2] if [t1] fails. *) let tclORELSE t1 t2 = |