aboutsummaryrefslogtreecommitdiff
path: root/tactics/rewrite.ml
AgeCommit message (Collapse)Author
2015-02-16Fixing bug #3944.Pierre-Marie Pédrot
2015-02-14Fixing bug #4016.Pierre-Marie Pédrot
When setoid rewriting in a hypothesis, we push the newly introduced declaration after the last declaration it depends on.
2015-01-24Tentative workaround for bug #3798.Pierre-Marie Pédrot
Ultimately setoid rewrite should be written in the monad to fix it properly.
2015-01-12Update headers.Maxime Dénès
2015-01-06Fix setoid rewrite.Arnaud Spiwack
Because of f66b84de608830600e43f6d1a97c29226b6b58ea (Refine primitive: [unsafe] is now true by default), setoid rewrite could produce ill-typed term. Since setoid rewrite relies on the checks of refine to ensure well-typed, turned the check explicitely on with [~unsafe:false].
2014-12-16Getting rid of Exninfo hacks.Pierre-Marie Pédrot
Instead of modifying exceptions to wear additional information, we instead use a dedicated type now. All exception-using functions were modified to support this new type, in particular Future's fix_exn-s and the tactic monad. To solve the problem of enriching exceptions at raise time and recover this data in the try-with handler, we use a global datastructure recording the given piece of data imperatively that we retrieve in the try-with handler. We ensure that such instrumented try-with destroy the data so that there may not be confusion with another exception. To further harden the correction of this structure, we also check for pointer equality with the last raised exception. The global data structure is not thread-safe for now, which is incorrect as the STM uses threads and enriched exceptions. Yet, we splitted the patch in two parts, so that we do not introduce dependencies to the Thread library immediatly. This will allow to revert only the second patch if ever we switch to OCaml-coded lightweight threads.
2014-12-02For compatibility purpose, when setoid_rewriting a hypothesis, beta-iotaPierre-Marie Pédrot
normalize it afterwards.
2014-12-01More invariants in the code of Rewrite.Pierre-Marie Pédrot
In particular, the old hypinfo is made as a proper cache, preventing dynamic tricks to decide whether it was rightful to refresh it.
2014-11-30Set use_evars_eagerly_in_conv_on_closed_terms in rewrite_unif_flags too.Hugo Herbelin
This allows to have the example in test setoid_unif.v to work again.
2014-11-22Attempt to organize and document unification flags of setoid rewrite.Hugo Herbelin
2014-11-22In setoid_rewrite error messages:Hugo Herbelin
- removed the encapsulation in a Tactic Failure (I don't see why setoid_rewrite should specifically raise a Fail - do I miss something?) - avoid having twice a "Unable to satisfy ... constraints" message.
2014-11-22Fix resolve_morphism to build well-scoped terms in case some argumentsMatthieu Sozeau
of the function are dependent.
2014-11-18Tentative rephrasing of error message for rewrite.Hugo Herbelin
2014-11-10Replugging hints in rewriting strategies.Pierre-Marie Pédrot
2014-11-08Follow up to experimental eager evar unification in bcba6d1bc9:Hugo Herbelin
Observing that systematic eager evar unification makes unification works better, for instance in setoid rewrite (ATBR, SemiRing.v), we add a new flag use_evars_eagerly_in_conv_on_closed_terms which is put to true only in Rewrite.rewrite_core_unif_flags (empirically, this makes the "rewrite" from rewrite.ml working again on examples which were previously treated by use_metas_eagerly_in_conv_on_closed_terms).
2014-10-27Cleaning and documenting Clenv.make_evar_clausePierre-Marie Pédrot
2014-10-26Preventing potential evar leak in Rewrite.Pierre-Marie Pédrot
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-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-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-21Removing dead code in Rewrite.Pierre-Marie Pédrot
2014-10-21Small invariants in Rewrite code.Pierre-Marie Pédrot
2014-10-21Fixing decompose_app_rel in Rewrite.Pierre-Marie Pédrot
The old implementation did not beta-iota normalize before observing the head of the term, resulting in stange bugs.
2014-10-21Using new clausenv in rewrite.Pierre-Marie Pédrot
2014-10-16Proofview.Refine: remove the handle type, and simplify the API.Arnaud Spiwack
Now, usual function from Evarutil are used to define evars instead of the variants from Proofview.Refine. The [update] primitive which tried to patch the difference between pretyping functions and the refine primitive is now replaced by the identity function.
2014-10-09A version of convert_concl and convert_hyp in new proof engine.Hugo Herbelin
Not very optimized though (if we apply convert_hyp on any hyp, a new evar will be generated for every different hyp...).
2014-10-07Splitting out of auto.ml a file hints.ml dedicated to hints so as toHugo Herbelin
being able to export hints without tactics, vm, etc. to come with. Some functions moved to the new proof engine.
2014-10-05Semantic fix of a refine in Rewrite.Pierre-Marie Pédrot
This code was wrong but luckily unused. It instantiated an evar with an instance where the let-in bindings were removed.
2014-09-30Add syntax for naming new goals in refine: writing ?[id] instead of _Hugo Herbelin
will name the goal id; writing ?[?id] will use the first fresh name available based with prefix id. Tactics intro, rename, change, ... from logic.ml now preserve goal name; cut preserves goal name on its main premise.
2014-09-23ATBR can't compile without the fix, as it uses setoid_rewrite to rewriteMatthieu Sozeau
under binders. This might incur a significant time penalty.
2014-09-23Fix bug in setoid_rewrite introduced by PMP's commits, which was creatingMatthieu Sozeau
two versions of the rewriting lemma, keeping useless evars around. This can now happen only when the rewrite lemma is used under binders... Fix to do next.
2014-09-21Rewrite.apply_lemma is written in state passing style.Pierre-Marie Pédrot
This removes a use of Evd.merge.
2014-09-21More invariants in the code of Refine.Pierre-Marie Pédrot
The hypinfo state is now refreshed at a proper time, which should reduce the overall number of calls to [decompose_applied_relation]. The state passing nature of the program is also more explicit, removing a use of Evd.merge. This patch should preserve semantics and efficiency.
2014-09-21Removing a nonsensical Errors.push.Pierre-Marie Pédrot
2014-09-15A small pass of code cleaning and clenv removing in Rewrite.Pierre-Marie Pédrot
2014-09-15Rework typeclass resolution and control of backtracking.Matthieu Sozeau
Add a global option to check for multiple solutions and fail in that case. Add another flag to declare classes as having unique instances (not checked but assumed correct, avoiding some backtracking).
2014-09-15Removing one Evd.merge in Rewrite.Pierre-Marie Pédrot
2014-09-15More invariants in Rewrite unification.Pierre-Marie Pédrot
2014-09-15The unifying functions of Rewrite uses the return types of strategies.Pierre-Marie Pédrot
2014-09-15Splitting the uses of the unification function according to the status ofPierre-Marie Pédrot
the abs flag in rewrite.
2014-09-14Rewrite.apply_strategy uses the same return type as strategies.Pierre-Marie Pédrot
2014-09-14Proper type for rewrite strategy results.Pierre-Marie Pédrot
2014-09-12Uniformisation of the order of arguments env and sigma.Hugo Herbelin
2014-09-12Referring to evars by names. Added a parser for evars (but parsing ofHugo Herbelin
instances still to do). Using heuristics to name after the quantifier name it comes. Also added a "sigma" to almost all printing functions.
2014-09-11Use an AST for strategy names.Matthieu Sozeau
2014-09-10A step towards better differentiating when w_unify is used for subtermHugo Herbelin
selection (rewrite, destruct/induction, set or apply on scheme), for unification (apply on not a scheme, auto), the latter being separated into primary unification and unification for merging instances. No change of semantics from within Coq, if I did not mistake (but a function like secondOrderAbstraction does not set flags by itself anymore).
2014-09-06Renaming goal-entering functions.Pierre-Marie Pédrot
1. Proofview.Goal.enter into Proofview.Goal.nf_enter. 2. Proofview.Goal.raw_enter into Proofview.Goal.enter. 3. Proofview.Goal.goals -> Proofview.Goals.nf_goals 4. Proofview.Goal.raw_goals -> Proofview.Goals.goals 5. Ftactic.goals -> Ftactic.nf_goals 6. Ftactic.raw_goals -> Ftactic.goals This is more uniform with the other functions of Coq.
2014-09-05Fix parsing of "subterm(s)" strategy argument.Matthieu Sozeau
2014-09-04Typing.sort_of does not leak evarmaps anymore.Pierre-Marie Pédrot