aboutsummaryrefslogtreecommitdiff
path: root/tactics
diff options
context:
space:
mode:
Diffstat (limited to 'tactics')
-rw-r--r--tactics/auto.ml38
-rw-r--r--tactics/autorewrite.ml13
-rw-r--r--tactics/ind_tables.ml10
3 files changed, 25 insertions, 36 deletions
diff --git a/tactics/auto.ml b/tactics/auto.ml
index c030c77d4d..f5c3619e64 100644
--- a/tactics/auto.ml
+++ b/tactics/auto.ml
@@ -211,30 +211,26 @@ let tclLOG (dbg,_,depth,trace) pp tac =
match dbg with
| Off -> tac
| Debug ->
- (* For "debug (trivial/auto)", we directly output messages *)
+ (* For "debug (trivial/auto)", we directly output messages *)
let s = String.make (depth+1) '*' in
- Proofview.V82.tactic begin fun gl ->
- try
- let out = Proofview.V82.of_tactic tac gl in
- Feedback.msg_debug (str s ++ spc () ++ pp () ++ str ". (*success*)");
- out
- with reraise ->
- let reraise = CErrors.push reraise in
- Feedback.msg_debug (str s ++ spc () ++ pp () ++ str ". (*fail*)");
- iraise reraise
- end
+ Proofview.(tclIFCATCH (
+ tac >>= fun v ->
+ Feedback.msg_debug (str s ++ spc () ++ pp () ++ str ". (*success*)");
+ tclUNIT v
+ ) Proofview.tclUNIT
+ (fun (exn, info) ->
+ Feedback.msg_debug (str s ++ spc () ++ pp () ++ str ". (*fail*)");
+ tclZERO ~info exn))
| Info ->
(* For "info (trivial/auto)", we store a log trace *)
- Proofview.V82.tactic begin fun gl ->
- try
- let out = Proofview.V82.of_tactic tac gl in
- trace := (depth, Some pp) :: !trace;
- out
- with reraise ->
- let reraise = CErrors.push reraise in
- trace := (depth, None) :: !trace;
- iraise reraise
- end
+ Proofview.(tclIFCATCH (
+ tac >>= fun v ->
+ trace := (depth, Some pp) :: !trace;
+ tclUNIT v
+ ) Proofview.tclUNIT
+ (fun (exn, info) ->
+ trace := (depth, None) :: !trace;
+ tclZERO ~info exn))
(** For info, from the linear trace information, we reconstitute the part
of the proof tree we're interested in. The last executed tactic
diff --git a/tactics/autorewrite.ml b/tactics/autorewrite.ml
index 76cbdee0d5..f824552705 100644
--- a/tactics/autorewrite.ml
+++ b/tactics/autorewrite.ml
@@ -196,17 +196,12 @@ let subst_hintrewrite (subst,(rbase,list as node)) =
if list' == list then node else
(rbase,list')
-let classify_hintrewrite x = Libobject.Substitute x
-
-
(* Declaration of the Hint Rewrite library object *)
let inHintRewrite : string * HintDN.t -> Libobject.obj =
- Libobject.declare_object {(Libobject.default_object "HINT_REWRITE") with
- Libobject.cache_function = cache_hintrewrite;
- Libobject.load_function = (fun _ -> cache_hintrewrite);
- Libobject.subst_function = subst_hintrewrite;
- Libobject.classify_function = classify_hintrewrite }
-
+ let open Libobject in
+ declare_object @@ superglobal_object_nodischarge "HINT_REWRITE"
+ ~cache:cache_hintrewrite
+ ~subst:(Some subst_hintrewrite)
open Clenv
diff --git a/tactics/ind_tables.ml b/tactics/ind_tables.ml
index a53e3bf20d..a67f5f6d6e 100644
--- a/tactics/ind_tables.ml
+++ b/tactics/ind_tables.ml
@@ -59,12 +59,10 @@ let discharge_scheme (_,(kind,l)) =
Some (kind, l)
let inScheme : string * (inductive * Constant.t) array -> obj =
- declare_object {(default_object "SCHEME") with
- cache_function = cache_scheme;
- load_function = (fun _ -> cache_scheme);
- subst_function = subst_scheme;
- classify_function = (fun obj -> Substitute obj);
- discharge_function = discharge_scheme}
+ declare_object @@ superglobal_object "SCHEME"
+ ~cache:cache_scheme
+ ~subst:(Some subst_scheme)
+ ~discharge:discharge_scheme
(**********************************************************************)
(* The table of scheme building functions *)