aboutsummaryrefslogtreecommitdiffhomepage
path: root/pretyping
Commit message (Collapse)AuthorAge
* Cosmetic changes in evarconv.ml: hopefully using better self-documenting names.Gravatar Hugo Herbelin2015-08-02
|
* Evarconv.ml: small cut-elimination, saving useless zip.Gravatar Hugo Herbelin2015-08-02
|
* Cosmetic in evarconv.ml: naming a local function for better readibility.Gravatar Hugo Herbelin2015-08-02
|
* Fixing #4221 (interpreting bound variables using ltac env was possiblyGravatar Hugo Herbelin2015-08-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | capturing bound names unexpectingly). We moved renaming to after finding bindings, i.e. in pretyping "fun x y => x + y" in an ltac environment where y is ltac-bound to x, we type the body in environment "x y |-" but build "fun y y => Rel 2 + Rel 1" (which later on is displayed into "fun y y0 => y + y0"). We renounced to renaming in "match" patterns, which was anyway not working well, as e.g. in let x := ipattern:y in (forall z, match z with S x => x | x => x end = 0). which was producing forall z : nat, match z with 0 => z | S y => y end = 0 because the names in default branches are treated specifically. It would be easy to support renaming in match again, by putting the ltac env in the Cases.pattern_matching_problem state and to rename the names in "typs" (from build_branch), just before returning them at the end of the function (and similarly in abstract_predicate for the names occurring in the return predicate). However, we rename binders in fix which were not interpreted. There are some difficulties with evar because we want them defined in the interpreted env (see comment to ltac_interp_name_env). fix ltac name
* Fixing bug #4303: Anomaly: Uncaught exception Invalid_argument.Gravatar Pierre-Marie Pédrot2015-07-21
|
* Refining 71def2f8 on too strong occur-check limiting evar-evarGravatar Hugo Herbelin2015-07-16
| | | | | | | | | | | | unification in tactics. The relaxing of occur-check was ok but was leading trivial problems of the form ?X[?Meta] = ?X[?Meta] to enter a complex Evar-ization into ?X[?Meta] = ?X[?Y], ?Meta:=?Y which consider_remaining_unif_problems was not any more able to deal with. Doing quick: treat the trivial cases ?X[args] = ?X[args] in an ad hoc way, so that it behaves as if the occur-check had not been restricted.
* Slight improvement in naming anonymous variables in error messages:Gravatar Hugo Herbelin2015-07-16
| | | | | | | | | | | | | | | | | | using closer naming strategies for naming variables in make_all_name_different and when contracting trivial letins. Not sure what the best policy is. Maybe the contraction process should not invent names at al and let make_all_name_different do the job. Maybe pretyping should name all rels which it pushes to environment (with cases.ml paying attention to avoid clash). The problem shows for instance with a PretypeError (... env, ... , ActualTypeNotCoercible (NotClean (... env ...)) message with two copies of env which we don't if they are the same but which have to share same names for similar rendering of the rels! This was revealed e.g. by the error message of #4177.
* Fixing #4177 (find_projectable was liable to ask to instantiate an evar twice).Gravatar Hugo Herbelin2015-07-16
| | | | This is a bug in a pretty old code, showing also in 8.3 and 8.4.
* Fixing bug #4240 (closure_of_filter was not ensuring refinement ofGravatar Hugo Herbelin2015-07-16
| | | | | former filter after 48509b61 and 3cd718c, because filtered let-ins were not any longer preserved).
* Fix universe instantiation with canonical structures.Gravatar Maxime Dénès2015-07-16
| | | | | | | Patch by Matthieu Sozeau. Fixes #3819: "Error: Unsatisfied constraints" due to canonical structure inference
* Continuing 93579407, spotting other potential sources of anomalyGravatar Hugo Herbelin2015-07-16
| | | | | because of the name of a bound variable lost when unifying under a binder in evarconv.
* Fixing anomaly #3743 while printing an error message involving evar constraints.Gravatar Hugo Herbelin2015-07-16
| | | | | | | | Indeed, the name of a bound variable was lost when unifying under a Prod in evarconv. The error message for "Unable to satisfy the following constraints" is still to be improved though.
* Continuing handling of NoCoercion after df6e64fd28 and 4944b5e72.Gravatar Hugo Herbelin2015-07-10
| | | | | | | | | | Commit df6e64fd28 let apply_coercion raise NoCoercion untrapped by inh_app_fun. Commit 4944b5e72 caught NoCoercion but missed re-attempting inserting a coercion after resolving instances of type classes. This fixes MathClasses (while preserving fix of part of from 4944b5e72 and fixes of HoTT_coq_014.v from df6e64fd28).
* Option -type-in-type: added support in checker and making it contaminatingGravatar Hugo Herbelin2015-07-10
| | | | | | | | | | in vo files (this was not done yet in 24d0027f0 and 090fffa57b). Reused field "engagement" to carry information about both impredicativity of set and type in type. For the record: maybe some further checks to do around the sort of the inductive types in coqchk?
* Make retyping of projections more resilient to wrong environment.Gravatar Maxime Dénès2015-07-09
| | | | | | Unfortunately, it seems that retyping can be called in ill-typed terms and/or in the wrong environment. This was broken for projections by my commit a51cce369b9c634a93120092d4c7685a242d55b1
* Univs: bug fix.Gravatar Matthieu Sozeau2015-07-07
| | | | | Missing universe substitutions of mind_params_ctxt when typechecking cases, which appeared only when let-ins were used.
* Fix handling of primitive projections in VM.Gravatar Maxime Dénès2015-07-05
| | | | | I'm pushing this patch now because the previous treatment of such projections in the VM was already unsound. It should however be carefully reviewed.
* Assumptions: more informative print for False axiom (Close: #4054)Gravatar Enrico Tassi2015-06-29
| | | | | | | | | | | | | | | | | | | | | | | | When an axiom of an empty type is matched in order to inhabit a type, do print that type (as if each use of that axiom was a distinct foo_subproof). E.g. Lemma w : True. Proof. case demon. Qed. Lemma x y : y = 0 /\ True /\ forall w, w = y. Proof. split. case demon. split; [ exact w | case demon ]. Qed. Print Assumptions x. Prints: Axioms: demon : False used in x to prove: forall w : nat, w = y used in w to prove: True used in x to prove: y = 0
* Fix incompleteness of conversion used by evarconvGravatar Matthieu Sozeau2015-06-28
| | | | | | In case we need to backtrack on universe inconsistencies when converting two (incompatible) instances of the same constant and unfold them. Bug reported by Amin Timany.
* Fix bug #4254 with the help of J.H. JourdanGravatar Matthieu Sozeau2015-06-26
| | | | | | | | | | | | | | | 1) We now _assign_ the smallest possible arities to mutual inductive types and eventually add leq constraints on the user given arities. Remove useless limitation on instantiating algebraic universe variables with their least upper bound if they have upper constraints as well. 2) Do not remove non-recursive variables when computing minimal levels of inductives. 3) Avoid modifying user-given arities if not necessary to compute the minimal level of an inductive. 4) We correctly solve the recursive equations taking into account the user-declared level.
* Make normalization of primitive projections in native_compute the same as ↵Gravatar Maxime Dénès2015-06-08
| | | | with other reduction machines.
* Fixup for 866c41bGravatar Enrico Tassi2015-05-28
|
* Fix bug #4159Gravatar Matthieu Sozeau2015-05-27
| | | | | | Some asynchronous constraints between initial universes and the ones at the end of a proof were forgotten. Also add a message to print universes indicating if all the constraints are processed already or not.
* Adding an extensible global state to evarmaps.Gravatar Pierre-Marie Pédrot2015-05-19
| | | | | | | Evars already had their own extensible state, but adding it globally allows to write out extensible state-passing code in e.g. plugins. The additional data is hopefully transparently preserved by the code out there. Trespassers ought to be prosecuted.
* Make Coercion.inh_app_fun respect its specification.Gravatar Pierre-Marie Pédrot2015-05-15
| | | | | It enhances bug #3527, as instead of raising an anomaly "Uncaught exception Coercion.NoCoercion(_)", it now fails with a typing error.
* Disable precompilation for native_compute by default.Gravatar Guillaume Melquiond2015-05-14
| | | | | | | | | | | | | | Note that this does not prevent using native_compute, but it will force on-the-fly recompilation of dependencies whenever it is used. Precompilation is enabled for the standard library, assuming native compilation was enabled at configuration time. If native compilation was disabled at configuration time, native_compute falls back to vm_compute. Failure to precompile is a hard error, since it is now explicitly required by the user.
* Safer typing primitives.Gravatar Pierre-Marie Pédrot2015-05-13
| | | | | | | | | | | | | | | | Some functions from pretyping/typing.ml and their derivatives were potential source of evarmap leaks, as they dropped their resulting evarmap. This commit clarifies the situation by renaming them according to a unsafe_* scheme. Their sound variant is likewise renamed to their old name. The following renamings were made. - Typing.type_of -> unsafe_type_of - Typing.e_type_of -> type_of - A new e_type_of function that matches the e_ prefix policy - Tacmach.pf_type_of -> pf_unsafe_type_of - A new safe pf_type_of function. All uses of unsafe_* functions should be eventually eliminated.
* Fix for a second avatar of bug #4234.Gravatar Pierre-Marie Pédrot2015-05-13
|
* Better fixing #4198 such that the term to match is looked for beforeGravatar Hugo Herbelin2015-05-13
| | | | | | | the predicate, thus respecting the visual left-to-right top-down order (see a45bd5981092). This fixes CFGV.
* Fixing bug #4234.Gravatar Pierre-Marie Pédrot2015-05-12
|
* Code factorization in Constr_matching.Gravatar Pierre-Marie Pédrot2015-05-10
|
* Remove almost all the uses of string concatenation when building error messages.Gravatar Guillaume Melquiond2015-04-23
| | | | | | Since error messages are ultimately passed to Format, which has its own buffers for concatenating strings, using concatenation for preparing error messages just doubles the workload and increases memory pressure.
* Tactical `progress` compares term up to potentially equalisable universes.Gravatar Arnaud Spiwack2015-04-22
| | | | | Followup of: f7b29094fe7cc13ea475447bd30d9a8b942f0fef . In particular, re-closes #3593. As a side effect, fixes an undiscovered bug of the `eq_constr` tactic which didn't consider terms up to evar instantiation.
* Fixing non exhaustive pattern-matching.Gravatar Hugo Herbelin2015-04-22
|
* Fixing #4198 (looking for subterms also in the return clause of match).Gravatar Hugo Herbelin2015-04-21
| | | | | This is actually not so perfect because of the lambdas in the return clause which we would not like to look in.
* Fixing #3383 (a "return" clause without an "in" clause is not enoughGravatar Hugo Herbelin2015-04-21
| | | | for being able to interpret a "match" as a constr pattern).
* Some dead code.Gravatar Hugo Herbelin2015-04-21
|
* Really fix constr_of_pattern and bugs #3590 and #4120 byGravatar Matthieu Sozeau2015-04-09
| | | | | removing all evars appearing in the constr (or their types, recursively) from the evar_map.
* Remove evars in the type of _unnammed_ metas in pattern_of_constr (fixes ↵Gravatar Matthieu Sozeau2015-04-09
| | | | QuicksortComplexity).
* Ensuring more invariants in Constr_matching.Gravatar Pierre-Marie Pédrot2015-03-29
|
* Fixing bug #4165.Gravatar Pierre-Marie Pédrot2015-03-29
| | | | | The context matching function was dropping the surrounding context in let-ins.
* use a more compact representation of non-constant constructorsGravatar Benjamin Gregoire2015-03-27
| | | | | | for which there corresponding tag are greater than max_variant_tag. The code is a merge with the patch proposed by Bruno on github barras/coq commit/504c753d7bb104ff4453fa0ede21c870ae2bb00c
* Fix bug 4157,Gravatar Benjamin Gregoire2015-03-26
| | | | | | | change the representation of inductive constructor when there is too many non constant constructors in the inductive type Conflicts: kernel/cbytegen.ml
* Fully fixing bug #3491 (anomaly when building _rect scheme in theGravatar Hugo Herbelin2015-03-25
| | | | | | | | | | | | presence of let-ins and recursively non-uniform parameters). The bug was in the List.chop of Inductiveops.get_arity which was wrong in the presence of let-ins and recursively non-uniform parameters. The bug #3491 showed up because, in addition to have let-ins, it was wrongly detected as having recursively non-uniform parameters. Also added some comments in declarations.mli.
* Use kernel names instead of user names when looking for coercions. (Fix for ↵Gravatar Guillaume Melquiond2015-03-25
| | | | | | | bug #4133) Note that, if someone was purposely modifying the user name of a type in order to disable a coercion, it no longer works. Hopefully, no one did.
* Fixing equality of notation_constrs. Fixes bug #4136.Gravatar Pierre-Marie Pédrot2015-03-24
|
* Add function to fix the non-substituted universe variables of an evar_map.Gravatar Matthieu Sozeau2015-03-17
|
* Fix bug #3532, providing universe inconsistency information when aGravatar Matthieu Sozeau2015-03-04
| | | | unification fails due to that, during a conversion step.
* Fix bug #3590, keeping evars that are not turned into named metas byGravatar Matthieu Sozeau2015-03-03
| | | | | | pattern_of_constr in an evar_map, as they can appear in the context of said named metas, which is used by change. Not sure what to do in the PEvar case, which never matches anyway according to Constr_matching.matches.
* Fix bug #4103: forgot to allow unfolding projections of cofixpoints likeGravatar Matthieu Sozeau2015-03-03
| | | | cases, in some cases.