aboutsummaryrefslogtreecommitdiff
path: root/plugins/funind/recdef.ml
diff options
context:
space:
mode:
authorgareuselesinge2013-08-08 18:51:35 +0000
committergareuselesinge2013-08-08 18:51:35 +0000
commitb2f2727670853183bfbcbafb9dc19f0f71494a7b (patch)
tree8d9cea5ed2713ab2bfe3b142816a48c5ba615758 /plugins/funind/recdef.ml
parent1f48326c7edf7f6e7062633494d25b254a6db82c (diff)
State Transaction Machine
The process_transaction function adds a new edge to the Dag without executing the transaction (when possible). The observe id function runs the transactions necessary to reach to the state id. Transaction being on a merged branch are not executed but stored into a future. The finish function calls observe on the tip of the current branch. Imperative modifications to the environment made by some tactics are now explicitly declared by the tactic and modeled as let-in/beta-redexes at the root of the proof term. An example is the abstract tactic. This is the work described in the Coq Workshop 2012 paper. Coq is compile with thread support from now on. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16674 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'plugins/funind/recdef.ml')
-rw-r--r--plugins/funind/recdef.ml15
1 files changed, 6 insertions, 9 deletions
diff --git a/plugins/funind/recdef.ml b/plugins/funind/recdef.ml
index 4b9704c2c9..68b291ff96 100644
--- a/plugins/funind/recdef.ml
+++ b/plugins/funind/recdef.ml
@@ -57,7 +57,8 @@ let find_reference sl s =
let (declare_fun : Id.t -> logical_kind -> constr -> global_reference) =
fun f_id kind value ->
- let ce = {const_entry_body = value;
+ let ce = {const_entry_body = Future.from_val
+ (value, Declareops.no_seff);
const_entry_secctx = None;
const_entry_type = None;
const_entry_opaque = false;
@@ -1261,7 +1262,7 @@ let open_new_goal (build_proof:tactic -> tactic -> unit) using_lemmas ref_ goal_
ref_ := Some lemma ;
let lid = ref [] in
let h_num = ref (-1) in
- ignore (Flags.silently Vernacentries.interp (Vernacexpr.VernacAbort None));
+ ignore (Flags.silently Vernacentries.interp (Loc.ghost,Vernacexpr.VernacAbort None));
build_proof
( fun gls ->
let hid = next_ident_away_in_goal h_id (pf_ids_of_hyps gls) in
@@ -1443,7 +1444,6 @@ let (com_eqn : int -> Id.t ->
let recursive_definition is_mes function_name rec_impls type_of_f r rec_arg_num eq
generate_induction_principle using_lemmas : unit =
- let previous_label = Lib.current_command_label () in
let function_type = interp_constr Evd.empty (Global.env()) type_of_f in
let env = push_named (function_name,None,function_type) (Global.env()) in
(* Pp.msgnl (str "function type := " ++ Printer.pr_lconstr function_type); *)
@@ -1513,7 +1513,7 @@ let recursive_definition is_mes function_name rec_impls type_of_f r rec_arg_num
spc () ++ str"is defined" )
)
in
- try
+ States.with_state_protection (fun () ->
com_terminate
tcc_lemma_name
tcc_lemma_constr
@@ -1523,9 +1523,6 @@ let recursive_definition is_mes function_name rec_impls type_of_f r rec_arg_num
term_id
using_lemmas
(List.length res_vars)
- hook
- with reraise ->
- ignore (Backtrack.backto previous_label);
- (* anomaly (Pp.str "Cannot create termination Lemma") *)
- raise reraise
+ hook)
+ ()