aboutsummaryrefslogtreecommitdiff
path: root/proofs
diff options
context:
space:
mode:
authorppedrot2013-05-12 15:33:40 +0000
committerppedrot2013-05-12 15:33:40 +0000
commitde26e97cf37cafd37b83377d2df062a6e82676e7 (patch)
tree1f093c94b7cb8ab59f301b9c5ee7ca712aa9fa0f /proofs
parent9a9a8ab4c2a07aa8faa04f50d6250930220b5be5 (diff)
Use the Hook module here and there.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16510 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'proofs')
-rw-r--r--proofs/pfedit.ml3
-rw-r--r--proofs/pfedit.mli3
-rw-r--r--proofs/tactic_debug.ml15
-rw-r--r--proofs/tactic_debug.mli11
4 files changed, 11 insertions, 21 deletions
diff --git a/proofs/pfedit.ml b/proofs/pfedit.ml
index 90f20a7385..cab86721f2 100644
--- a/proofs/pfedit.ml
+++ b/proofs/pfedit.ml
@@ -69,9 +69,6 @@ let cook_proof hook =
| (i,([e],cg,str,h)) -> (i,(e,cg,str,h))
| _ -> Errors.anomaly ~label:"Pfedit.cook_proof" (Pp.str "more than one proof term.")
-let xml_cook_proof = ref (fun _ -> ())
-let set_xml_cook_proof f = xml_cook_proof := f
-
let get_pftreestate () =
Proof_global.give_me_the_proof ()
diff --git a/proofs/pfedit.mli b/proofs/pfedit.mli
index 73850c6f07..976ac276e9 100644
--- a/proofs/pfedit.mli
+++ b/proofs/pfedit.mli
@@ -95,9 +95,6 @@ val cook_proof : (Proof.proof -> unit) ->
(Entries.definition_entry * lemma_possible_guards * goal_kind *
unit declaration_hook)
-(** To export completed proofs to xml *)
-val set_xml_cook_proof : (goal_kind * Proof.proof -> unit) -> unit
-
(** {6 ... } *)
(** [get_pftreestate ()] returns the current focused pending proof.
@raise NoCurrentProof if there is no pending proof. *)
diff --git a/proofs/tactic_debug.ml b/proofs/tactic_debug.ml
index 8ad92910f3..d73561f37d 100644
--- a/proofs/tactic_debug.ml
+++ b/proofs/tactic_debug.ml
@@ -12,12 +12,9 @@ open Pp
open Tacexpr
open Termops
-let prtac = ref (fun _ -> assert false)
-let set_tactic_printer f = prtac := f
-let prmatchpatt = ref (fun _ _ -> assert false)
-let set_match_pattern_printer f = prmatchpatt := f
-let prmatchrl = ref (fun _ -> assert false)
-let set_match_rule_printer f = prmatchrl := f
+let (prtac, tactic_printer) = Hook.make ()
+let (prmatchpatt, match_pattern_printer) = Hook.make ()
+let (prmatchrl, match_rule_printer) = Hook.make ()
(* This module intends to be a beginning of debugger for tactic expressions.
Currently, it is quite simple and we can hope to have, in the future, a more
@@ -62,7 +59,7 @@ let help () =
let goal_com g tac =
begin
db_pr_goal g;
- msg_tac_debug (str "Going to execute:" ++ fnl () ++ !prtac tac)
+ msg_tac_debug (str "Going to execute:" ++ fnl () ++ Hook.get prtac tac)
end
let skipped = ref 0
@@ -164,7 +161,7 @@ let db_pattern_rule debug num r =
if is_debug debug then
begin
msg_tac_debug (str "Pattern rule " ++ int num ++ str ":" ++ fnl () ++
- str "|" ++ spc () ++ !prmatchrl r)
+ str "|" ++ spc () ++ Hook.get prmatchrl r)
end
(* Prints the hypothesis pattern identifier if it exists *)
@@ -195,7 +192,7 @@ let db_hyp_pattern_failure debug env (na,hyp) =
if is_debug debug then
msg_tac_debug (str ("The pattern hypothesis"^(hyp_bound na)^
" cannot match: ") ++
- !prmatchpatt env hyp)
+ Hook.get prmatchpatt env hyp)
(* Prints a matching failure message for a rule *)
let db_matching_failure debug =
diff --git a/proofs/tactic_debug.mli b/proofs/tactic_debug.mli
index 8afee3418d..a9cd025a7f 100644
--- a/proofs/tactic_debug.mli
+++ b/proofs/tactic_debug.mli
@@ -18,12 +18,11 @@ open Term
Currently, it is quite simple and we can hope to have, in the future, a more
complete panel of commands dedicated to a proof assistant framework *)
-val set_tactic_printer : (glob_tactic_expr -> Pp.std_ppcmds) -> unit
-val set_match_pattern_printer :
- (env -> constr_pattern match_pattern -> Pp.std_ppcmds) -> unit
-val set_match_rule_printer :
- ((Genarg.glob_constr_and_expr * constr_pattern,glob_tactic_expr) match_rule -> Pp.std_ppcmds) ->
- unit
+val tactic_printer : (glob_tactic_expr -> Pp.std_ppcmds) Hook.t
+val match_pattern_printer :
+ (env -> constr_pattern match_pattern -> Pp.std_ppcmds) Hook.t
+val match_rule_printer :
+ ((Genarg.glob_constr_and_expr * constr_pattern,glob_tactic_expr) match_rule -> Pp.std_ppcmds) Hook.t
(** Debug information *)
type debug_info =