aboutsummaryrefslogtreecommitdiff
path: root/tactics
AgeCommit message (Collapse)Author
2014-11-08Compatibility with 8.4 in the heuristic used to build the inductionHugo Herbelin
hypothesis when indices also occur among parameters. This solves current failure of PersistentUnionFind.
2014-11-07Granting #3717 (more informative error message on missing arguments for ↵Hugo Herbelin
functional induction).
2014-11-07Fixing #3562 ("as" in "destruct" expects either a disjunctiveHugo Herbelin
intropattern or a bound ltac variable).
2014-11-07Removing the legacy intro tactic code.Pierre-Marie Pédrot
2014-11-07Print [rename] tactic properly in info trace.Arnaud Spiwack
Followup of d0a871374e3b3498c51d9d7b8e4510f7e1e7a3e1 (Writing rename_hyps in the new monad).
2014-11-06Restoring clear_flag (thanks a lot to jonikelee to notice it).Hugo Herbelin
2014-11-06Optimizing when to clear generalized hypotheses in destruct.Hugo Herbelin
Removing blocking of generalization on destructed hypothesis introduced on Nov 2. It was a bad idea as shown by bug #3790 on eliminating v:Vector n, keeping an equality.
2014-11-06Dependency bug in using eqn for destruct.Hugo Herbelin
2014-11-05Writing the raw introduction tactic in the new monad.Pierre-Marie Pédrot
2014-11-03Writing rename_hyps in the new monad.Pierre-Marie Pédrot
This new implementation now allows for simultaneous replacing of hypotheses, thus fixing bug #2149.
2014-11-03Subtle swap of lines to preserve VarInstance src field before checkingHugo Herbelin
for residual unifiable evars (otherwise "thin" from logic.ml, erases the src field) + typo.
2014-11-03Fix to 844431761 on improving elimination with indices, getting rid ofHugo Herbelin
intrusive residual local definitions + more conservative strategy for which variables are not generalized (point 2 of 4df1ddc6d6bd07073).
2014-11-02Saving some nf_evars in the code of destruct/induction.Hugo Herbelin
2014-11-02Improving elimination with indices, getting rid of intrusive residualHugo Herbelin
local definitions...
2014-11-02Some reorganization of the code for destruct/induction:Hugo Herbelin
- It removes some redundancies. - It fixes failures when destructing a term mentioning goal hypotheses x1, ..., xn or a term which is a section variable x when this term is in a type with indices, and the indices also occur in the type of one of x1, ..., xn, or of x. - It fixes non-respect of eliminator type when completing pattern possibly given by a prefix. - It fixes b2e1d4ea930c which was dealing with the case when the term was a section variable (it was unfortunately also breaking some compatibility about which variables variable were generalized in induction and which variables were automatically cleared because unselected).
2014-11-02Plural and singular forms in error messages.Hugo Herbelin
2014-11-02Fixing 1177da327 (reorganization of the test for generic selection ofHugo Herbelin
occurrences: some uniformisation was not appropriate for "change").
2014-11-01Info: the warning message of the defunct [info] tactic now points to the ↵Arnaud Spiwack
[Info] command.
2014-11-01Info: print name of calls to Ltac constants ([TacCall]).Arnaud Spiwack
Some particular care needed to be taken to print aliases properly. The printing of argument is just the generic printer for [genarg]. The trouble is that (apart from being incomplete), it does not know that it's printing Ltac arguments. As a consequence, the arguments are not properly quoted (e.g. if they are tactic expressions, they are not within [ltac:(...)].
2014-11-01Info: tactic notations (TacAlias) print their names.Arnaud Spiwack
Empirically it works better on some notations than on others and I have no idea why. I've seen notations not printing their arguments, for instance, and other printing perfectly.
2014-11-01Info: Tactics coming from [TACTIC EXTEND] print their names.Arnaud Spiwack
Since PMP's intervention, the [TACTIC EXTEND] tactics are not uniform: some are syntax, and some are just an internal name for an Ltac definition. The latter kind prints an internal name. It may be better to avoid printing them in the trace altogether. But I haven't figured out how to detect that properly yet.
2014-11-01Info: print the name of atomic tactics.Arnaud Spiwack
The printing uses the printer for interpreted tactics. It only works for tactics which are defined in the new style. There are still a few atomic tactics in tacinterp which are defined in [V82] style. Namely: exact, apply, clear, rename, reduce, change, (mutual variant of) fix, (mutual variant of) cofix These print placeholder names which are never reparsable and not as useful.
2014-11-01Info: Ltac's idtac logs its message in the info trace.Arnaud Spiwack
2014-10-31Reorganization of the test for generic selection of occurrences inHugo Herbelin
clause; extended it so that an induction over "x" is considered generic when the clause has the form "in H |-" (w/o the conclusion) and x does not occur in the conclusion.
2014-10-31Enlarge the cases where the like first selection is used in destruct.Hugo Herbelin
This is now a "like first" strategy iff there is no occurrences selected in either the goal or in one of the hypotheses possibly given in an "in" clause. Before, it was "like first" if and only if no "in" clause was given at all.
2014-10-31Avoid "destruct H" to apply on H itself when H is a section variable.Hugo Herbelin
Need some contorsion for not using the general scheme of naming based which uses the hypothesis name as base ident, and for instead keeping a name generated on the type of the section variable, as it was before for section variables (example of incompatibility in FMapPositive).
2014-10-27Cleaning and documenting Clenv.make_evar_clausePierre-Marie Pédrot
2014-10-27Removing the last Evd.diff from Hints.Pierre-Marie Pédrot
2014-10-27Making destruct on idents with maximal implicit arguments working, byHugo Herbelin
keeping them as open holes. When these arguments are class instances, this restores compatibility with the 8.4 search for subterms from non-fully applied patterns which was using conversion on the instances.
2014-10-27Ensuring compatibility when an hypothesis used for destruct isHugo Herbelin
dependent in the goal without being fully applied: it cannot be erased. This used to work in 8.4 when the hypothesis was in an empty type. I fixed this and (somehow arbitrarily) generalized the non-erasing to other inductive types instead of failing.
2014-10-27Fixing evars lost in interpretation of eliminator of destruct.Hugo Herbelin
2014-10-26Preventing potential evar leak in Rewrite.Pierre-Marie Pédrot
2014-10-26Fixing destruct/induction with a using clause on a non-inductive type,Hugo Herbelin
that was broken by commit bf01856940 + use types from induction scheme to restrict selection of pattern + accept matching from partially applied term when using "using".
2014-10-26Dead code + typo.Hugo Herbelin
2014-10-25This commit introduces changes in induction and destruct.Hugo Herbelin
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.
2014-10-24Change reduction_of_red_expr to return an e_reduction_function returningMatthieu Sozeau
an updated evar_map, as pattern is working up to universe equalities that must be kept. Straightforward adaptation of the code depending on this.
2014-10-24Apparently, the former refine was simplifying in hypotheses too.Hugo Herbelin
2014-10-24Addressing report #3279 (inconsistency of behavior of the -> and <-Hugo Herbelin
introduction patterns). Whether we call -> and <- from assert as or apply in as, or as a component of a larger introduction pattern, the new documented semantics is: - behave as subst if an equation rewriting a variable (rewrite in conclusion and hyps and erase variable and hyp). - rewrite in concl if an equation not rewrite a variable or a quantified equality, then erase the hypothesis. This is potential source of incompatibilities.
2014-10-22Specializing tclBREAK so that it can choose the return exception in casePierre-Marie Pédrot
of a break.
2014-10-22Refine tactic: simplify the conclusion only at the end of the tactic.Arnaud Spiwack
It was the intended semantics from the beginning. I just wrote it wrong. Spotted by Hugo, fix by Hugo.
2014-10-22Remove an unnecessary use of [Proofview.Unsafe.tclEVARS] in [convert_concl].Arnaud Spiwack
2014-10-22Split [Proofview] into a file where the basic operations on the state are ↵Arnaud Spiwack
defined and the file providing the primitives. The datatypes are defined in [Proofview_monad], previous [Proofview_monad] is now called [Logic_monad] since it is more generic since the refactoring.
2014-10-22Make names in [Proofview_monad] more uniform.Arnaud Spiwack
ret -> return, bind -> (>>=), etc… So that monads expose a [Monad.S] signature. Also Proofview now exposes the [Monad.S] signature directly rather than in a [Monad.S] subdirectory.
2014-10-22Add more primitives to the [Monad.Make] arguments.Arnaud Spiwack
For optimisation purposes.
2014-10-22Proofview: move more functions to the Unsafe module.Arnaud Spiwack
2014-10-22Proofview: split [V82] module into [Unsafe] and [V82].Arnaud Spiwack
The Unsafe module is for unsafe tactics which cannot be done without anytime soon. Whereas V82 indicates a function which we want to get rid of and that shouldn't be used in a new function.
2014-10-22Remove the deprecated open-constr based refine.Arnaud Spiwack
That is [Tactics.New.refine]. Replaced it with a wrapper around the primitive refine [Proofview.Refine.refine], but with extra reductions on the resulting goals. There was two used of this refine: one in the declarative mode, and one in type classes. The porting of the latter is likely to have introduced bugs. Factored code with Ltac's refine in Extratactics.
2014-10-22Lemmas/Pfedit: use full evar_map instead of universe contexts to start proofs.Arnaud Spiwack
As simple as this looks, there's been some quite subtle issues in doing this modification, there may be bugs left.
2014-10-22Remove duplicate code.Arnaud Spiwack
2014-10-21Removing dead code in Rewrite.Pierre-Marie Pédrot