aboutsummaryrefslogtreecommitdiff
path: root/plugins/funind/indfun_common.ml
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/funind/indfun_common.ml')
-rw-r--r--plugins/funind/indfun_common.ml41
1 files changed, 11 insertions, 30 deletions
diff --git a/plugins/funind/indfun_common.ml b/plugins/funind/indfun_common.ml
index cd2ea3ef88..f9938c0356 100644
--- a/plugins/funind/indfun_common.ml
+++ b/plugins/funind/indfun_common.ml
@@ -129,7 +129,7 @@ let get_locality = function
| Local -> true
| Global -> false
-let save with_clean id const (locality,_,kind) hook =
+let save with_clean id const ?hook (locality,_,kind) =
let fix_exn = Future.fix_exn_of const.const_entry_body in
let l,r = match locality with
| Discharge when Lib.sections_are_opened () ->
@@ -144,20 +144,9 @@ let save with_clean id const (locality,_,kind) hook =
(locality, ConstRef kn)
in
if with_clean then Proof_global.discard_current ();
- CEphemeron.iter_opt hook (fun f -> Lemmas.call_hook fix_exn f l r);
+ Lemmas.call_hook ?hook ~fix_exn l r;
definition_message id
-
-
-let cook_proof _ =
- let (id,(entry,_,strength)) = Pfedit.cook_proof () in
- (id,(entry,strength))
-
-let get_proof_clean do_reduce =
- let result = cook_proof do_reduce in
- Proof_global.discard_current ();
- result
-
let with_full_print f a =
let old_implicit_args = Impargs.is_implicit_args ()
and old_strict_implicit_args = Impargs.is_strict_implicit_args ()
@@ -248,7 +237,6 @@ let cache_Function (_,finfos) =
from_graph := Indmap.add finfos.graph_ind finfos !from_graph
-let load_Function _ = cache_Function
let subst_Function (subst,finfos) =
let do_subst_con c = Mod_subst.subst_constant subst c
and do_subst_ind i = Mod_subst.subst_ind subst i
@@ -282,9 +270,6 @@ let subst_Function (subst,finfos) =
is_general = finfos.is_general
}
-let classify_Function infos = Libobject.Substitute infos
-
-
let discharge_Function (_,finfos) = Some finfos
let pr_ocst c =
@@ -313,15 +298,11 @@ let pr_table tb =
Pp.prlist_with_sep fnl pr_info l
let in_Function : function_info -> Libobject.obj =
- Libobject.declare_object
- {(Libobject.default_object "FUNCTIONS_DB") with
- Libobject.cache_function = cache_Function;
- Libobject.load_function = load_Function;
- Libobject.classify_function = classify_Function;
- Libobject.subst_function = subst_Function;
- Libobject.discharge_function = discharge_Function
-(* Libobject.open_function = open_Function; *)
- }
+ let open Libobject in
+ declare_object @@ superglobal_object "FUNCTIONS_DB"
+ ~cache:cache_Function
+ ~subst:(Some subst_Function)
+ ~discharge:discharge_Function
let find_or_none id =
@@ -386,7 +367,7 @@ let functional_induction_rewrite_dependent_proofs_sig =
optread = (fun () -> !functional_induction_rewrite_dependent_proofs);
optwrite = (fun b -> functional_induction_rewrite_dependent_proofs := b)
}
-let _ = declare_bool_option functional_induction_rewrite_dependent_proofs_sig
+let () = declare_bool_option functional_induction_rewrite_dependent_proofs_sig
let do_rewrite_dependent () = !functional_induction_rewrite_dependent_proofs = true
@@ -399,7 +380,7 @@ let function_debug_sig =
optwrite = (fun b -> function_debug := b)
}
-let _ = declare_bool_option function_debug_sig
+let () = declare_bool_option function_debug_sig
let do_observe () = !function_debug
@@ -417,7 +398,7 @@ let strict_tcc_sig =
optwrite = (fun b -> strict_tcc := b)
}
-let _ = declare_bool_option strict_tcc_sig
+let () = declare_bool_option strict_tcc_sig
exception Building_graph of exn
@@ -511,7 +492,7 @@ type tcc_lemma_value =
(* We only "purify" on exceptions. XXX: What is this doing here? *)
let funind_purify f x =
- let st = Vernacstate.freeze_interp_state `No in
+ let st = Vernacstate.freeze_interp_state ~marshallable:false in
try f x
with e ->
let e = CErrors.push e in