diff options
Diffstat (limited to 'proofs')
| -rw-r--r-- | proofs/proofview.ml | 8 | ||||
| -rw-r--r-- | proofs/proofview.mli | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/proofs/proofview.ml b/proofs/proofview.ml index 013b2f2047..49615a5f88 100644 --- a/proofs/proofview.ml +++ b/proofs/proofview.ml @@ -774,6 +774,11 @@ module V82 = struct Proof.put (b,([],[])) let catchable_exception = catchable_exception + + let wrap_exceptions f = + try f () + with e when catchable_exception e -> let e = Errors.push e in tclZERO e + end @@ -845,6 +850,9 @@ module Goal = struct (* compatibility *) let goal { self=self } = self + let refresh_sigma g = + tclEVARMAP >= fun sigma -> + tclUNIT { g with sigma } end diff --git a/proofs/proofview.mli b/proofs/proofview.mli index fed7c1dfd9..021155c425 100644 --- a/proofs/proofview.mli +++ b/proofs/proofview.mli @@ -333,6 +333,10 @@ module V82 : sig (* exception for which it is deemed to be safe to transmute into tactic failure. *) val catchable_exception : exn -> bool + + (* transforms every Ocaml (catchable) exception into a failure in + the monad. *) + val wrap_exceptions : (unit -> 'a tactic) -> 'a tactic end (* The module goal provides an interface for goal-dependent tactics. *) @@ -370,6 +374,10 @@ module Goal : sig (* compatibility: avoid if possible *) val goal : t -> Goal.goal + + (** [refresh g] updates the [sigma g] to the current value, may be + useful with compatibility functions like [Tacmach.New.of_old] *) + val refresh_sigma : t -> t tactic end (* The [NonLogical] module allows to execute side effects in tactics |
