aboutsummaryrefslogtreecommitdiff
path: root/plugins/funind
diff options
context:
space:
mode:
authorHugo Herbelin2014-08-14 20:44:03 +0200
committerHugo Herbelin2014-08-18 18:56:38 +0200
commitd5fece25d8964d5d9fcd55b66164286aeef5fb9f (patch)
tree60d584831ef3574c8d07daaef85929bd81a12d88 /plugins/funind
parent4684ae383a6ee56b4717026479eceb3b41b45ab0 (diff)
Reorganization of tactics:
- made "apply" tactics of type Proofview.tactic, as well as other inner functions about elim and assert - used same hypothesis naming policy for intros and internal_cut (towards a reorganization of intro patterns) - "apply ... in H as pat" now supports any kind of introduction pattern (doc not changed)
Diffstat (limited to 'plugins/funind')
-rw-r--r--plugins/funind/functional_principles_proofs.ml6
-rw-r--r--plugins/funind/invfun.ml2
-rw-r--r--plugins/funind/recdef.ml40
3 files changed, 24 insertions, 24 deletions
diff --git a/plugins/funind/functional_principles_proofs.ml b/plugins/funind/functional_principles_proofs.ml
index 1981fb837b..7f0db547d3 100644
--- a/plugins/funind/functional_principles_proofs.ml
+++ b/plugins/funind/functional_principles_proofs.ml
@@ -1433,11 +1433,11 @@ let new_prove_with_tcc is_mes acc_inv hrec tcc_hyps eqs : tactic =
backtrack_eqs_until_hrec hrec eqs;
(* observe_tac ("new_prove_with_tcc ( applying "^(Id.to_string hrec)^" )" ) *)
(tclTHENS (* We must have exactly ONE subgoal !*)
- (apply (mkVar hrec))
+ (Proofview.V82.of_tactic (apply (mkVar hrec)))
[ tclTHENSEQ
[
keep (tcc_hyps@eqs);
- apply (Lazy.force acc_inv);
+ (Proofview.V82.of_tactic (apply (Lazy.force acc_inv)));
(fun g ->
if is_mes
then
@@ -1556,7 +1556,7 @@ let prove_principle_for_gen
(
(* observe_tac *)
(* "apply wf_thm" *)
- Tactics.Simple.apply (mkApp(mkVar wf_thm_id,[|mkVar rec_arg_id|]))
+ Proofview.V82.of_tactic (Tactics.Simple.apply (mkApp(mkVar wf_thm_id,[|mkVar rec_arg_id|])))
)
)
)
diff --git a/plugins/funind/invfun.ml b/plugins/funind/invfun.ml
index 5682c2aa47..4fcc65bda9 100644
--- a/plugins/funind/invfun.ml
+++ b/plugins/funind/invfun.ml
@@ -487,7 +487,7 @@ let prove_fun_correct functional_induction funs_constr graphs_constr schemes lem
(fun gl ->
let term = mkApp (mkVar principle_id,Array.of_list bindings) in
let gl', _ty = pf_eapply Typing.e_type_of gl term in
- apply term gl')
+ Proofview.V82.of_tactic (apply term) gl')
))
(fun i g -> observe_tac ("proving branche "^string_of_int i) (prove_branche i) g )
]
diff --git a/plugins/funind/recdef.ml b/plugins/funind/recdef.ml
index 1fa16a3015..ff35c98124 100644
--- a/plugins/funind/recdef.ml
+++ b/plugins/funind/recdef.ml
@@ -255,7 +255,7 @@ let tclUSER tac is_mes l g =
| None -> clear []
| Some l -> tclMAP (fun id -> tclTRY (clear [id])) (List.rev l)
in
- tclTHENSEQ
+ tclTHENLIST
[
clear_tac;
if is_mes
@@ -271,7 +271,7 @@ let tclUSER tac is_mes l g =
let tclUSER_if_not_mes concl_tac is_mes names_to_suppress =
if is_mes
- then tclCOMPLETE (Simple.apply (delayed_force well_founded_ltof))
+ then tclCOMPLETE (fun gl -> Proofview.V82.of_tactic (Simple.apply (delayed_force well_founded_ltof)) gl)
else (* tclTHEN (Simple.apply (delayed_force acc_intro_generator_function) ) *) (tclUSER concl_tac is_mes names_to_suppress)
@@ -377,12 +377,12 @@ let treat_case forbid_new_ids to_intros finalize_tac nb_lam e infos : tactic =
) [] rev_context in
let rev_ids = pf_get_new_ids (List.rev ids) g in
let new_b = substl (List.map mkVar rev_ids) b in
- tclTHENSEQ
+ tclTHENLIST
[
h_intros (List.rev rev_ids);
Proofview.V82.of_tactic (intro_using teq_id);
onLastHypId (fun heq ->
- tclTHENSEQ[
+ tclTHENLIST[
thin to_intros;
h_intros to_intros;
(fun g' ->
@@ -507,14 +507,14 @@ let rec prove_lt hyple g =
let y =
List.hd (List.tl (snd (decompose_app (pf_type_of g (mkVar h))))) in
tclTHENLIST[
- apply (mkApp(le_lt_trans (),[|varx;y;varz;mkVar h|]));
+ Proofview.V82.of_tactic (apply (mkApp(le_lt_trans (),[|varx;y;varz;mkVar h|])));
observe_tac (str "prove_lt") (prove_lt hyple)
]
with Not_found ->
(
(
tclTHENLIST[
- apply (delayed_force lt_S_n);
+ Proofview.V82.of_tactic (apply (delayed_force lt_S_n));
(observe_tac (str "assumption: " ++ Printer.pr_goal g) (Proofview.V82.of_tactic assumption))
])
)
@@ -764,7 +764,7 @@ let terminate_app_rec (f,args) expr_info continuation_tac _ =
];
observe_tac (str "proving decreasing") (
tclTHENS (* proof of args < formal args *)
- (apply (Lazy.force expr_info.acc_inv))
+ (Proofview.V82.of_tactic (apply (Lazy.force expr_info.acc_inv)))
[
observe_tac (str "assumption") (Proofview.V82.of_tactic assumption);
tclTHENLIST
@@ -812,7 +812,7 @@ let rec prove_le g =
in
tclFIRST[
Proofview.V82.of_tactic assumption;
- apply (delayed_force le_n);
+ Proofview.V82.of_tactic (apply (delayed_force le_n));
begin
try
let matching_fun =
@@ -825,7 +825,7 @@ let rec prove_le g =
List.hd (List.tl args)
in
tclTHENLIST[
- apply(mkApp(le_trans (),[|x;y;z;mkVar h|]));
+ Proofview.V82.of_tactic (apply(mkApp(le_trans (),[|x;y;z;mkVar h|])));
observe_tac (str "prove_le (rec)") (prove_le)
]
with Not_found -> tclFAIL 0 (mt())
@@ -855,7 +855,7 @@ let rec make_rewrite_list expr_info max = function
)
[make_rewrite_list expr_info max l;
tclTHENLIST[ (* x < S max proof *)
- apply (delayed_force le_lt_n_Sm);
+ Proofview.V82.of_tactic (apply (delayed_force le_lt_n_Sm));
observe_tac (str "prove_le(2)") prove_le
]
] )
@@ -892,7 +892,7 @@ let make_rewrite expr_info l hp max =
(observe_tac (str "h_reflexivity") (Proofview.V82.of_tactic intros_reflexivity))]))
;
tclTHENLIST[ (* x < S (S max) proof *)
- apply (delayed_force le_lt_SS);
+ Proofview.V82.of_tactic (apply (delayed_force le_lt_SS));
observe_tac (str "prove_le (3)") prove_le
]
])
@@ -1082,12 +1082,12 @@ let termination_proof_header is_mes input_type ids args_id relation
(* this gives the accessibility argument *)
observe_tac
(str "apply wf_thm")
- (Simple.apply (mkApp(mkVar wf_thm,[|mkVar rec_arg_id|]))
+ (Proofview.V82.of_tactic (Simple.apply (mkApp(mkVar wf_thm,[|mkVar rec_arg_id|])))
)
]
;
(* rest of the proof *)
- tclTHENSEQ
+ tclTHENLIST
[observe_tac (str "generalize")
(onNLastHypsId (nargs+1)
(tclMAP (fun id ->
@@ -1206,7 +1206,7 @@ let build_and_l l =
let c,tac,nb = f pl in
mk_and p1 c,
tclTHENS
- (apply (constr_of_global conj_constr))
+ (Proofview.V82.of_tactic (apply (constr_of_global conj_constr)))
[tclIDTAC;
tac
],nb+1
@@ -1278,7 +1278,7 @@ let open_new_goal build_proof ctx using_lemmas ref_ goal_name (gls_type,decompos
build_proof Evd.empty_evar_universe_context
( fun gls ->
let hid = next_ident_away_in_goal h_id (pf_ids_of_hyps gls) in
- tclTHENSEQ
+ tclTHENLIST
[
Simple.generalize [lemma];
Proofview.V82.of_tactic (Simple.intro hid);
@@ -1306,7 +1306,7 @@ let open_new_goal build_proof ctx using_lemmas ref_ goal_name (gls_type,decompos
tclCOMPLETE(
tclFIRST[
tclTHEN
- (eapply_with_bindings (mkVar (List.nth !lid !h_num), NoBindings))
+ (Proofview.V82.of_tactic (eapply_with_bindings (mkVar (List.nth !lid !h_num), NoBindings)))
e_assumption;
Eauto.eauto_with_bases
(true,5)
@@ -1338,11 +1338,11 @@ let open_new_goal build_proof ctx using_lemmas ref_ goal_name (gls_type,decompos
(tclFIRST
(List.map
(fun c ->
- tclTHENSEQ
- [Proofview.V82.of_tactic intros;
+ Proofview.V82.of_tactic (Tacticals.New.tclTHENLIST
+ [intros;
Simple.apply (fst (interp_constr Evd.empty (Global.env()) c)) (*FIXME*);
- tclCOMPLETE (Proofview.V82.of_tactic Auto.default_auto)
- ]
+ Tacticals.New.tclCOMPLETE Auto.default_auto
+ ])
)
using_lemmas)
) tclIDTAC)