diff options
author | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2014-10-23 23:35:02 +0200 |
---|---|---|
committer | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2014-10-25 18:36:19 +0200 |
commit | bf018569405c0ae1c5d08dfa27600102b9d77977 (patch) | |
tree | d8b4435ee65ceb8cd03977748711c13e028c131c /tactics/tactics.mli | |
parent | b39465da31bfd488dfad4ea4627186f9a1843e56 (diff) |
This commit introduces changes in induction and destruct.
The main change is that selection of subterm is made similar whether
the given term is fully applied or not.
- The selection of subterm now works as follows depending on whether
the "at" is given, of whether the subterm is fully applied or not,
and whether there are incompatible subterms matching the pattern. In
particular, we have:
"at" given
| subterm fully applied
| | incompatible subterms
| | |
Y Y - it works like in 8.4
Y N - this was broken in 8.4 ("at" was ineffective and it was finding
all subterms syntactically equal to the first one which matches)
N Y Y it now finds all subterms like the first one which matches
while in 8.4 it used to fail (I hope it is not a too risky in-draft
for a semantics we would regret...) (e.g. "destruct (S _)" on
goal "S x = S y + S x" now selects the two occurrences of "S x"
while it was failing before)
N Y N it works like in 8.4
N N - it works like in 8.4, selecting all subterms like the
first one which matches
- Note that the "historical" semantics, when looking for a subterm, to
select all subterms that syntactically match the first subterm to
match the pattern (looking from left to right) is now internally called
"like first".
- Selection of subterms can now find the type by pattern-matching (useful e.g.
for "induction (nat_rect _ _ _ _)")
- A version of Unification.w_unify w/o any conversion is used for
finding the subterm: it could be easily replaced by an other
matching algorithm.
In particular, "destruct H" now works on a goal such as "H:True -> x<=y |- P y".
Secondary change is in the interpretation of terms with existential
variables:
- When several arguments are given, interpretation is delayed at the
time of execution
- Because we aim at eventually accepting "edestruct c" with unresolved
holes in c, we need the sigma obtained from c to be an extension of
the sigma of the tactics, while before, we just type-checked c
independently of the sigma of the tactic
- Finishing the resolution of evars (using type classes, candidates,
pending conversion problems) is made slightly cleaner: it now takes
three states: a term is evaluated in state sigma, leading to state
sigma' >= sigma, with evars finally solved in state sigma'' >=
sigma'; we solve evars in the diff of sigma' and sigma and report
the solution in sigma''
- We however renounce to give now a success semantics to "edestruct c"
when "c" has unresolved holes, waiting instead for a decision on
what to do in the case of a similar eapply (see mail to coqdev).
An auxiliary change is that an "in" clause can be attached to each component
of a "destruct t, u, v", etc.
Incidentally, make_abstraction does not do evar resolution itself any longer.
Diffstat (limited to 'tactics/tactics.mli')
-rw-r--r-- | tactics/tactics.mli | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/tactics/tactics.mli b/tactics/tactics.mli index a4fb6dd88..5a78bff33 100644 --- a/tactics/tactics.mli +++ b/tactics/tactics.mli @@ -164,6 +164,7 @@ val unfold_constr : global_reference -> tactic val clear : Id.t list -> tactic val clear_body : Id.t list -> unit Proofview.tactic +val unfold_body : Id.t -> tactic val keep : Id.t list -> tactic val apply_clear_request : clear_flag -> bool -> constr -> unit Proofview.tactic @@ -274,11 +275,8 @@ val elim : val simple_induct : quantified_hypothesis -> unit Proofview.tactic -val induction : evars_flag -> - (evar_map * constr with_bindings) induction_arg list -> - constr with_bindings option -> - intro_pattern_naming option * or_and_intro_pattern option -> - clause option -> unit Proofview.tactic +val induction : evars_flag -> clear_flag -> constr -> or_and_intro_pattern option -> + constr with_bindings option -> unit Proofview.tactic (** {6 Case analysis tactics. } *) @@ -286,21 +284,18 @@ val general_case_analysis : evars_flag -> clear_flag -> constr with_bindings -> val simplest_case : constr -> unit Proofview.tactic val simple_destruct : quantified_hypothesis -> unit Proofview.tactic -val destruct : evars_flag -> - (evar_map * constr with_bindings) induction_arg list -> - constr with_bindings option -> - intro_pattern_naming option * or_and_intro_pattern option -> - clause option -> unit Proofview.tactic +val destruct : evars_flag -> clear_flag -> constr -> or_and_intro_pattern option -> + constr with_bindings option -> unit Proofview.tactic (** {6 Generic case analysis / induction tactics. } *) (** Implements user-level "destruct" and "induction" *) val induction_destruct : rec_flag -> evars_flag -> - ((evar_map * constr with_bindings) induction_arg * - (intro_pattern_naming option * or_and_intro_pattern option)) list * - constr with_bindings option * - clause option -> unit Proofview.tactic + (delayed_open_constr_with_bindings induction_arg + * (intro_pattern_naming option * or_and_intro_pattern option) + * clause option) list * + constr with_bindings option -> unit Proofview.tactic (** {6 Eliminations giving the type instead of the proof. } *) @@ -382,7 +377,7 @@ val letin_tac : (bool * intro_pattern_naming) option -> (** Common entry point for user-level "set", "pose" and "remember" *) val letin_pat_tac : (bool * intro_pattern_naming) option -> - Name.t -> evar_map * constr -> clause -> unit Proofview.tactic + Name.t -> pending_constr -> clause -> unit Proofview.tactic (** {6 Generalize tactics. } *) |