aboutsummaryrefslogtreecommitdiff
path: root/pretyping
AgeCommit message (Collapse)Author
2015-01-06Propagating the relaxing of filtering started in 48509b6, fixed inHugo Herbelin
3cd718c, to the case of second_order_matching.
2015-01-06Fixing old filter bug in second_order_matching.Hugo Herbelin
2015-01-03Fixing 48509b61 which improved unification as expected but actuallyHugo Herbelin
not using the intended test. By fixing the intended test, the need for a delta-expansion resulting from this commit in PFsection6.v (line 1255) of ssreflect disappears.
2015-01-03Tentatively trying to restore the use of second-order typed-basedHugo Herbelin
unification algorithm in consider_remaining_unif_problems. If it happens to be problematic, one can backtrack to the "optimization" from 3bd9cb26b which has a restriction on rels/vars.
2015-01-03Fixing #3895 (thanks to PMP for diagnosis).Hugo Herbelin
2015-01-01An optimization in the use of unification candidates so as to get theHugo Herbelin
following working: Definition test {A B:Type} {H:A=B} (a:A) : B := rew H in a.
2014-12-30Simplifying second_order_matching: no need to invert the linearHugo Herbelin
initial segment of the context of the evar.
2014-12-19When pretyping [uconstr] closures, don't use the local Ltac variable ↵Arnaud Spiwack
environment. A closure is supposedly closed: all the relevant Ltac variables should be then. The last field [ltac_genargs], if I'm not mistaken, is there to represent the Ltac variables which are bound but not to something which makes sense in a term. They should be irrelevant at this point, since the uconstr has already been interpreted and these checks are supposed to have happened. (though I'm not entirely sure they do, it can be an interesting exercise to try and make [uconstr] behave weirdly) I'm not quite sure why it caused #3679, though. But it still seems to be solved.
2014-12-19Back to the preferred ?n1:=?n2 order of evar-evar unification which got ↵Hugo Herbelin
accidentally mixed up in 9aa416c0c6.
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-16Fix for #3154: use CUnix.sys_command to call native compiler.Maxime Dénès
Patch by CJ on bugzilla. CUnix.sys_command doesn't rely on a shell, so extra care with cmd.exe vs sh is no longer required.
2014-12-15Tentatively starting to use heuristics for evar-evar resolution: firstHugo Herbelin
step, prefer QuestionMark's to other evars, to comply with the filtering made on VarInstance, GoalEvar and QuestionMark for type class resolution. Maybe evars to be resolved by type class instances should eventually be marked with a specific tag. At least, this solves the current problem with compiling cancel2.v in LemmaOverloading.
2014-12-15New try on Fixing an evar_map bug revealed by commit 603b66f81 onHugo Herbelin
unification flags (see also temporary revert in d083200ae5b).
2014-12-15Documenting check_record + changing a possibly undefined int into int option.Hugo Herbelin
2014-12-14Fix merging of name maps in union of universe contexts.Matthieu Sozeau
2014-12-12Extend the syntax of simpl with a delta flag.Arnaud Spiwack
You can write 'simpl -[plus minus] div2'. Simpl does not use it for now.
2014-12-12Two fixes in unification (bugs #3782 and #3709)Matthieu Sozeau
- In evarconv, check_conv_record properly computes the parameters of primitive record projections for later unification, adding env and sigma as arguments. - In unification, backtrack on pattern-unification and not only application unification if eta for a record failed.
2014-12-11Commit not ready. Sorry.Hugo Herbelin
Revert "Fixing an evar_map bug revealed by commit 603b66f81 on unification flags." This reverts commit d083200ae5b391ceffaa0329a8e3a334036c7968.
2014-12-11Added a CannotSolveConstraint unification error and made experimentsHugo Herbelin
in reporting the chain of causes when unification fails.
2014-12-11Fine-tuning unification error (using OccurCheck in evarconv).Hugo Herbelin
2014-12-11Tentatively more informative report of failure when inferringHugo Herbelin
pattern-matching predicate.
2014-12-11Fixing an evar_map bug revealed by commit 603b66f81 on unification flags.Hugo Herbelin
This fixes current failure of RelationAlgebra.
2014-12-10Fixing orientation of postponed subtyping problems.Hugo Herbelin
In the case of conversion, postponing by preserving the initial orientation. Was wrong from its initial version in Jan 2014, but was not visible because evar-evar subtyping was approximated by evar-evar conversion. Thanks to Enrico for a very short example highlighting the problem. In particular, this fixes Ergo.
2014-12-10Using a more aggressive test for resolving pattern equations ?n = ?p:Hugo Herbelin
test pattern-unification after restriction of the evars so as to succeed earlier (no observational changes however in the examples at my disposal).
2014-12-09Setup hook to change the unification algorithm used by evarconv,Matthieu Sozeau
e.g. for MTac.
2014-12-09Switch the few remaining iso-latin-1 files to utf8Pierre Letouzey
2014-12-08Fixing wrong evar_map in return clause inference, revealed by 48509b611.Hugo Herbelin
2014-12-08Improved criterion for evar restriction in the configurationHugo Herbelin
?n[...] = ?p[...;x:=?n[...];...]. Indeed, x could be a solution for ?p.
2014-12-07Improving evar restriction (this is a risky change, as I remember aHugo Herbelin
similar optimization broke at some time some ssreflect code; we now treat the easy case of a let-in to a rel - a pattern common in pattern-matching compilation -; later on, we shall want to investigate whether any let-in found to refer to out of scope rels or vars can be filtered out).
2014-12-07Improved tracking of the origin of evars.Hugo Herbelin
2014-12-07Had forgotten some debugging printer.Hugo Herbelin
2014-12-05More consistent printing of evars in evar_map debugging printer.Hugo Herbelin
2014-12-05Fix debugger Tactic Unification.Hugo Herbelin
2014-12-05Small cleaning and uniformization in unification flags:Hugo Herbelin
- new function set_flags_for_type for setting flags when converting types of the terms to unify - it now sets all conversion flags, possibly restricting delta using modulo_delta_types - it is now used in w_unify_core_0 too - fixing/improving documentation of options - deprecating "Set Tactic Evars Pattern Unification"
2014-12-04New approach to deal with evar-evar unification problems in differentHugo Herbelin
types: we downcast the evar in the higher type to the lower type. Then, we have the freedom to choose the order of instantiation according to the instances of the evars (e.g. choosing the instantiation for which pattern-unification is possible, if ever it is possible in only one way - as shown by an example in contribution Paco). This still does not preserve compatibility because it happens that type classes resolution is crucially dependent on the order of presentation of the ?n=?p problems. Consider e.g. an example taken from Containers. Both now and before e2fa65fccb9, one has this asymmetry: Context `{Helt : OrderedType elt}. Check forall x y r l h, @Equivalence.equiv _ _ _ x y -> In x (Node l x r h). --> @Equivalence.equiv QArith_base.Q QArith_base.Qeq QArith_base.Q_Setoid x y Context `{Helt : OrderedType elt}. Check forall x y r l h, In x (Node l x r h) -> @Equivalence.equiv _ _ _ x y. --> @Equivalence.equiv elt (@_eq elt Helt) (@OT_Equivalence elt Helt) Then, embedding this example within a bigger one which relies on the ?n=?n' resolution order, one can get two incompatible resolution of the same problem. To be continued...
2014-12-04Occur-check in refine.Arnaud Spiwack
The occur check is done even if the flag [unsafe] is set to true. The rational is that a tactic cannot control where it takes pieces of terms from (and hence will not generally make terms which pass the occur-check), and it would be painful to ask every tactic which takes a term as an argument to do an occur check before [refine]. I reused the same error than used by unification. It gives a pretty nice error message. An alternative would be to have a dedicated error with pretty much the same error message. I'm not sure which is best, so I went for the simplest one. The same check is done in the compatibility layer. Fixes a reported bug which I cannot locate for some reason.
2014-12-04Reactivating option "Set Printing Existential Instances" for asking printing ↵Hugo Herbelin
full instances.
2014-12-03In solve_evar_evar, orient the heuristic over arities with differentHugo Herbelin
types as it was before commit 710bae2a8c81a44. There is still at least one problem with bug #3392 to solve.
2014-12-02When solving ?id{args} = ?id'{args'}, give preference to ?id:=?id' ifHugo Herbelin
possible, which is the "natural" way to orient an equation. At least it matters for matching subterms against patterns, so that it is the pattern variables which are substituted if ever the subterm has itself existential variables, as in: Goal exists x, S x = x. eexists. destruct (S _).
2014-12-02Postponing the "evar <= evar" problems instead of solving them in anHugo Herbelin
arbitrary direction as if it were an "evar = evar" problem.
2014-12-02Being more scrupulous on preserving subtyping in evar-evar problems.Hugo Herbelin
Incidentally, this allows to make earlier the collapse of CUMUL to CONV when force is true.
2014-12-02Being consistent in making arbitrary choices in recursive calls toHugo Herbelin
evar_define. Interestingly, the added choose in evarconv.ml allows solve_evar_evar to be observationally commutative, in the sense of not either fail or succeed in compiling the stdlib whether problems are given in the left-to-right or right-to-left order.
2014-12-02Resolution of evar/evar problems: removed a test which should beHugo Herbelin
subsumed by the call to project_evar_on_evar.
2014-11-27Reverting the following block of three commits:Hugo Herbelin
- Registering strict implicit arguments systematically (35fc7d728168) - Experimenting always forcing convertibility on strict implicit arguments (a1a6d7b99eef5e6) - Fixing Coq compilation (894a3d16471) Systematically computing strict implicit arguments can lead to big computations, so I suspend this attempt, waiting for improved computation of implicit arguments, or alternative heuristics going toward having more conversion in rewrite.
2014-11-26Fixing Coq compilation.Pierre-Marie Pédrot
2014-11-26Experimenting always forcing convertibility on strict implicit argumentsHugo Herbelin
in tactic unification.
2014-11-25A bit more information in debug tactic unification.Hugo Herbelin
2014-11-25Experimenting using unification when matching evar/meta free subtermsHugo Herbelin
while before these were supposed to consider only syntactically. Made the experiment to unify with all delta flags unset. Keeping the same flags as for non evar/meta free subterms would lead to too much successes, as e.g. "true && b" matching "b" when the modulo_conv_on_closed_terms flag is set, which is the case for rewrite. But maybe should we instead investigate to have the same flags but with the restrict_conv_on_strict_subterms flag set. This rules out examples like "true && b" unifying with "b" and this is another option which is ok for compiling the stdlib without any changes.
2014-11-23Fix #3824. de Bruijn error in normalization of fixpoints.Maxime Dénès
This bug was affecting the VM and the native compiler, but only in the pretyper (not the kernel). Types of arguments of fixpoints were incorrectly normalized due to a missing lift.
2014-11-21Avoid compilation warning.Matthieu Sozeau