aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel/obligations.ml
diff options
context:
space:
mode:
authorGravatar gareuselesinge <gareuselesinge@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-10-18 13:52:15 +0000
committerGravatar gareuselesinge <gareuselesinge@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-10-18 13:52:15 +0000
commit168424263f9c8510a4c51d59a2945babd20880f4 (patch)
tree8afc3396e03d0568506470b639d2a2d1ba897fa1 /toplevel/obligations.ml
parent020aa7a8e9bca88631e6d7fa68d1ff462f5af25a (diff)
declaration_hooks use Ephemeron
Ideally, any component of the global state that is a function or any other unmarshallable data should be stocked as an ephemeron to make the state always marshallable. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16893 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'toplevel/obligations.ml')
-rw-r--r--toplevel/obligations.ml12
1 files changed, 6 insertions, 6 deletions
diff --git a/toplevel/obligations.ml b/toplevel/obligations.ml
index 8c7414568..3c4b88f46 100644
--- a/toplevel/obligations.ml
+++ b/toplevel/obligations.ml
@@ -517,7 +517,7 @@ let declare_definition prg =
progmap_remove prg;
!declare_definition_ref prg.prg_name
prg.prg_kind ce prg.prg_implicits
- (Option.map (fun f l r -> f l r;r) prg.prg_hook)
+ (fun l r -> prg.prg_hook l r; r)
open Pp
@@ -585,7 +585,7 @@ let declare_mutual_definition l =
Declare.recursive_message (fixkind != IsCoFixpoint) indexes fixnames;
let gr = List.hd kns in
let kn = match gr with ConstRef kn -> kn | _ -> assert false in
- Option.iter (fun f -> f (fst first.prg_kind) gr) first.prg_hook;
+ first.prg_hook (fst first.prg_kind) gr;
List.iter progmap_remove l; kn
let shrink_body c =
@@ -777,7 +777,7 @@ let rec solve_obligation prg num tac =
| [] ->
let obl = subst_deps_obl obls obl in
Lemmas.start_proof obl.obl_name (kind_of_opacity obl.obl_status) obl.obl_type
- (Some (fun strength gr ->
+ (fun strength gr ->
let cst = match gr with ConstRef cst -> cst | _ -> assert false in
let obl =
let transparent = evaluable_constant cst (Global.env ()) in
@@ -807,7 +807,7 @@ let rec solve_obligation prg num tac =
let deps = dependencies obls num in
if not (Int.Set.is_empty deps) then
ignore(auto_solve_obligations (Some prg.prg_name) None ~oblset:deps)
- | _ -> ()));
+ | _ -> ());
trace (str "Started obligation " ++ int user_num ++ str " proof: " ++
Printer.pr_constr_env (Global.env ()) obl.obl_type);
Pfedit.by (snd (get_default_tactic ()));
@@ -929,7 +929,7 @@ let show_term n =
++ Printer.pr_constr_env (Global.env ()) prg.prg_body)
let add_definition n ?term t ?(implicits=[]) ?(kind=Global,Definition) ?tactic
- ?(reduce=reduce) ?(hook=None) obls =
+ ?(reduce=reduce) ?(hook=fun _ _ -> ()) obls =
let info = str (Id.to_string n) ++ str " has type-checked" in
let prg = init_prog_info n term t [] None [] obls implicits kind reduce hook in
let obls,_ = prg.prg_obligations in
@@ -947,7 +947,7 @@ let add_definition n ?term t ?(implicits=[]) ?(kind=Global,Definition) ?tactic
| _ -> res)
let add_mutual_definitions l ?tactic ?(kind=Global,Definition) ?(reduce=reduce)
- ?(hook=None) notations fixkind =
+ ?(hook=fun _ _ -> ()) notations fixkind =
let deps = List.map (fun (n, b, t, imps, obls) -> n) l in
List.iter
(fun (n, b, t, imps, obls) ->