aboutsummaryrefslogtreecommitdiff
path: root/pretyping
AgeCommit message (Collapse)Author
2015-01-19Making unification of LetIn's expressions more consistent (see #3920).Hugo Herbelin
Unifying two let-in's expresions syntactically is a heuristic (compared to performing the zeta-reduction). This heuristic was requiring unification of types which is too strong for the heuristic to work uniformly since the types might only be related modulo subtyping. The patch is to remove the unification of types, which allows then to have the heuristic work uniformly on the bodies. On the other side, I hope it does not loose (still heuristical) unifications compared to before (presumably, since instantiating the evars in the body will induce constraints for solving potential evars in the types of the let-in bodies, but this would need a proof). Anyway, it is not about correction, it is about a heuristic, which maybe done too early actually.
2015-01-17Univs: proper printing of global and local universe names (onlyMatthieu Sozeau
printing functions touched in the kernel).
2015-01-17Univs: Fix alias computation for VMs, computation of normal form ofMatthieu Sozeau
match predicates for vm_compute and compile polymorphic definitions to constant code. Add univscompute test-suite file testing VM computations in presence of polymorphic universes.
2015-01-17Make native compiler handle universe polymorphic definitions.Maxime Dénès
One remaining issue: aliased constants raise an anomaly when some unsubstituted universe variables remain. VM may suffer from the same problem.
2015-01-15Correct restriction of vm_compute when handling universe polymorphicMatthieu Sozeau
definitions. Instead of failing with an anomaly when trying to do conversion or computation with the vm's, consider polymorphic constants as being opaque and keep instances around. This way the code is still correct but (obviously) incomplete for polymorphic definitions and we avoid introducing an anomaly. The patch does nothing clever, it only keeps around instances with constants/inductives and compile constant bodies only for non-polymorphic definitions.
2015-01-13Fix issue in printing due to de Bruijn bug when constructing compatibilityMatthieu Sozeau
constr for primitive records (not used anywhere else than printing). Problem reported by P. LeFanu Lumsdaine on HoTT/HoTT. Also add some minor fixes in detyping and pretty printing related to universes.
2015-01-12Update headers.Maxime Dénès
2015-01-12Not "Setting ?n=?p order to ?p:=?n to see if it solves someHugo Herbelin
incompatibilities wrt 8.4.", as it creates other problems (in Ergo and Compcert). This reverts commit bf388dfec041ab0fa74ae5d484600f6fcf515e4f.
2015-01-08Setting ?n=?p order to ?p:=?n to see if it solves some incompatibilities wrt ↵Hugo Herbelin
8.4.
2015-01-08Avoiding introducing yet another convention in naming files.Hugo Herbelin
2015-01-07Reverting the tentative try to restore the use of second-orderHugo Herbelin
typed-based matching: it provokes a stack overflow in contrib ClassicalRealisability. To be investigated later on. (See 893a02f643858ba0b0172648e77af9ccb65f03df.)
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 _).