aboutsummaryrefslogtreecommitdiff
path: root/pretyping
AgeCommit message (Collapse)Author
2015-07-16Slight improvement in naming anonymous variables in error messages:Hugo Herbelin
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.
2015-07-16Fixing #4177 (find_projectable was liable to ask to instantiate an evar twice).Hugo Herbelin
This is a bug in a pretty old code, showing also in 8.3 and 8.4.
2015-07-16Fixing bug #4240 (closure_of_filter was not ensuring refinement ofHugo Herbelin
former filter after 48509b61 and 3cd718c, because filtered let-ins were not any longer preserved).
2015-07-16Fix universe instantiation with canonical structures.Maxime Dénès
Patch by Matthieu Sozeau. Fixes #3819: "Error: Unsatisfied constraints" due to canonical structure inference
2015-07-16Continuing 93579407, spotting other potential sources of anomalyHugo Herbelin
because of the name of a bound variable lost when unifying under a binder in evarconv.
2015-07-16Fixing anomaly #3743 while printing an error message involving evar constraints.Hugo Herbelin
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.
2015-07-10Continuing handling of NoCoercion after df6e64fd28 and 4944b5e72.Hugo Herbelin
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).
2015-07-10Option -type-in-type: added support in checker and making it contaminatingHugo Herbelin
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?
2015-07-09Make retyping of projections more resilient to wrong environment.Maxime Dénès
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
2015-07-07Univs: bug fix.Matthieu Sozeau
Missing universe substitutions of mind_params_ctxt when typechecking cases, which appeared only when let-ins were used.
2015-07-06Merge branch 'v8.5' into trunkMaxime Dénès
2015-07-05Fix handling of primitive projections in VM.Maxime Dénès
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.
2015-06-29Assumptions: more informative print for False axiom (Close: #4054)Enrico Tassi
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
2015-06-28Merge branch 'v8.5'Pierre-Marie Pédrot
2015-06-28Fix incompleteness of conversion used by evarconvMatthieu Sozeau
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.
2015-06-26Fix bug #4254 with the help of J.H. JourdanMatthieu Sozeau
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.
2015-06-26Add a flag to deactivate guard checking in the kernel.Arnaud Spiwack
2015-06-22Merge remote-tracking branch 'forge/v8.5'Pierre Boutillier
2015-06-08Make normalization of primitive projections in native_compute the same as ↵Maxime Dénès
with other reduction machines.
2015-06-01Merge branch 'v8.5'Pierre-Marie Pédrot
2015-05-28Fixup for 866c41bEnrico Tassi
2015-05-27Fix bug #4159Matthieu Sozeau
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.
2015-05-19Adding an extensible global state to evarmaps.Pierre-Marie Pédrot
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.
2015-05-15Make Coercion.inh_app_fun respect its specification.Pierre-Marie Pédrot
It enhances bug #3527, as instead of raising an anomaly "Uncaught exception Coercion.NoCoercion(_)", it now fails with a typing error.
2015-05-15Merge v8.5 into trunkHugo Herbelin
Conflicts: tactics/eauto.ml4 (merging eauto.ml4 and adapting coq_micromega.ml to new typing.ml API)
2015-05-14Disable precompilation for native_compute by default.Guillaume Melquiond
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.
2015-05-13Safer typing primitives.Pierre-Marie Pédrot
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.
2015-05-13Fix for a second avatar of bug #4234.Pierre-Marie Pédrot
2015-05-13Better fixing #4198 such that the term to match is looked for beforeHugo Herbelin
the predicate, thus respecting the visual left-to-right top-down order (see a45bd5981092). This fixes CFGV.
2015-05-12Fixing bug #4234.Pierre-Marie Pédrot
2015-05-10Code factorization in Constr_matching.Pierre-Marie Pédrot
2015-05-05Merge branch 'v8.5'Pierre-Marie Pédrot
2015-04-23Remove almost all the uses of string concatenation when building error messages.Guillaume Melquiond
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.
2015-04-22Tactical `progress` compares term up to potentially equalisable universes.Arnaud Spiwack
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.
2015-04-22Fixing non exhaustive pattern-matching.Hugo Herbelin
2015-04-21Fixing #4198 (looking for subterms also in the return clause of match).Hugo Herbelin
This is actually not so perfect because of the lambdas in the return clause which we would not like to look in.
2015-04-21Fixing #3383 (a "return" clause without an "in" clause is not enoughHugo Herbelin
for being able to interpret a "match" as a constr pattern).
2015-04-21Some dead code.Hugo Herbelin
2015-04-15Merge branch 'v8.5'Pierre-Marie Pédrot
2015-04-09Really fix constr_of_pattern and bugs #3590 and #4120 byMatthieu Sozeau
removing all evars appearing in the constr (or their types, recursively) from the evar_map.
2015-04-09Remove evars in the type of _unnammed_ metas in pattern_of_constr (fixes ↵Matthieu Sozeau
QuicksortComplexity).
2015-03-30Merge branch 'v8.5' into trunkEnrico Tassi
2015-03-29Ensuring more invariants in Constr_matching.Pierre-Marie Pédrot
2015-03-29Fixing bug #4165.Pierre-Marie Pédrot
The context matching function was dropping the surrounding context in let-ins.
2015-03-27use a more compact representation of non-constant constructorsBenjamin Gregoire
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
2015-03-26Fix bug 4157,Benjamin Gregoire
change the representation of inductive constructor when there is too many non constant constructors in the inductive type Conflicts: kernel/cbytegen.ml
2015-03-25Fully fixing bug #3491 (anomaly when building _rect scheme in theHugo Herbelin
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.
2015-03-25Use kernel names instead of user names when looking for coercions. (Fix for ↵Guillaume Melquiond
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.
2015-03-24Fixing equality of notation_constrs. Fixes bug #4136.Pierre-Marie Pédrot
2015-03-17Add function to fix the non-substituted universe variables of an evar_map.Matthieu Sozeau