aboutsummaryrefslogtreecommitdiffhomepage
path: root/pretyping
Commit message (Collapse)AuthorAge
* Ensures that let-in's in arities of inductive types work well. Maybe notGravatar herbelin2009-08-11
| | | | | | | | | very useful in practice but as soon as let-in's were not forbidden in the internal data structure, better to do it. Moreover, this gets closer to the view were inductive definitions are uniformly built from "contexts". (checker not changed!) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12273 85f007b7-540e-0410-9357-904b9bb8a0f7
* Relatively ad hoc fix to an ill-typed instantiation bug in typeGravatar herbelin2009-08-11
| | | | | | | | | | | inference (see file failure/evar1.v) + fix of some CUMUL problems that were in the wrong direction. We assume for the fix that ill-typed unification problems come from subtyping where we don't know yet if a coercion has to be inserted or not, and hence are of the CUMUL form. More on suspending problems of the form ?n <= Type or Prop <= ?n has to be done yet. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12268 85f007b7-540e-0410-9357-904b9bb8a0f7
* Fixed incorrect optimization in Prettyp.pr_located_qualid introducedGravatar herbelin2009-08-07
| | | | | | | | | in commit r12265. Add a few synonyms back in Libnames/Nameops to maintain some minimal compatibility. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12267 85f007b7-540e-0410-9357-904b9bb8a0f7
* - Cleaning phase of the interfaces of libnames.ml and nametab.mlGravatar herbelin2009-08-06
| | | | | | | | | | | | | | | (uniformisation of function names, classification). One of the most visible change is the renaming of section_path into full_path (the use of name section was obsolete due to the module system, but I don't know if the new name is the best chosen one - especially it remains some "sp" here and there). - Simplification of the interface of classify_object (first argument dropped). - Simplification of the code for vernac keyword "End". - Other small cleaning or dead code removal. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12265 85f007b7-540e-0410-9357-904b9bb8a0f7
* Improved parameterization of Coq:Gravatar herbelin2009-08-02
| | | | | | | | | | | | | | | - add coqtop option "-compat X.Y" so as to provide compatibility with previous versions of Coq (of course, this requires to take care of providing flags for controlling changes of behaviors!), - add support for option names made of an arbitrary length of words (instead of one, two or three words only), - add options for recovering 8.2 behavior for discriminate, tauto, evar unification ("Set Tactic Evars Pattern Unification", "Set Discriminate Introduction", "Set Intuition Iff Unfolding"). Update of .gitignore git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12258 85f007b7-540e-0410-9357-904b9bb8a0f7
* - Fixing bug #2139 (kernel-based test of well-formation of eliminationGravatar herbelin2009-07-15
| | | | | | | | | | | | | | | | predicate called from proof refiner was failing because it was not aware of evars instantiation; I added a nf_evar in 8.2 branch but for the trunk, I propose to remove the elimination predicate well-formation test; we therefore assume that tactics build correct elimination predicates in Case, is it not too much demanding?). - Seized the opportunity to remove dead kernel code about non dependent elimination predicates (all predicates are stored dependent by default since a few years now). - Anecdotic complement to commit 12229 (removal of obsolete comment). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12241 85f007b7-540e-0410-9357-904b9bb8a0f7
* Use the proper unification flags in e_exact. This makes exact fail a bitGravatar msozeau2009-07-09
| | | | | | | | | | | more often but respects the spec better. The changes in the stdlib are reduced to adding a few explicit [unfold]s in FMapFacts (exact was doing conversion with delta on open terms in that case). Also fix a minor bug in typeclasses not seeing typeclass evars when their type was a (defined) evar itself. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12238 85f007b7-540e-0410-9357-904b9bb8a0f7
* Fixed bug #2116 ("simpl" created ill-typed term while acceptingGravatar herbelin2009-07-08
| | | | | | inverting a recursive constant with dependent K-parameters). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12233 85f007b7-540e-0410-9357-904b9bb8a0f7
* Don't use recent ocaml tolerance for pattern "ProjectVar _" whenGravatar herbelin2009-07-08
| | | | | | | ProjectVar is a constant constructor (anyway, use of _ for constant constructor was here by mistake). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12232 85f007b7-540e-0410-9357-904b9bb8a0f7
* Reactivation of pattern unification of evars in apply unification, inGravatar herbelin2009-07-08
| | | | | | | | | | | | agreement with wish #2117 (pattern unification of evars remained deactivated for 3 years because of incompatibilities with eauto [see commit 9234]; thanks to unification flags, it can be activated for apply w/o changing eauto). Also add test for bug #2123 (see commit 12228). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12229 85f007b7-540e-0410-9357-904b9bb8a0f7
* Add heuristic based on non-linearity of evars to determine whether anGravatar herbelin2009-07-08
| | | | | | | | evar is dependent or not (solve bug #2123). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12228 85f007b7-540e-0410-9357-904b9bb8a0f7
* Fixing bug 2129 (evar introduced to remember an ambiguous projectionGravatar herbelin2009-07-08
| | | | | | | | | had wrong type). At least two problems remain: - projection involving evar should check the type are compatible, - instances of filtered evars should not be shrinked as all values are needed to ensure the well-typedness of the instanciated restricted evars. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12226 85f007b7-540e-0410-9357-904b9bb8a0f7
* Jolification : tentative de supprimer les "( evd)" et associés quiGravatar aspiwack2009-07-07
| | | | | | | | | traînaient un peu partout dans le code depuis la fusion d'evar_map et evar_defs. Début du travail d'uniformisation des noms donnés aux evar_defs à travers le code. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12224 85f007b7-540e-0410-9357-904b9bb8a0f7
* change in the order of unification constraints solving (for canonical ↵Gravatar amahboub2009-07-06
| | | | | | structures) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12223 85f007b7-540e-0410-9357-904b9bb8a0f7
* Add new variants of [rewrite] and [autorewrite] which differ in theGravatar msozeau2009-06-30
| | | | | | | | | | | | | | | selection of occurrences. We use a new function [unify_to_subterm_all] to return all occurrences of a lemma and produce the rewrite depending on a new [conditions] option that controls if we must rewrite one or all occurrences and if the side conditions should be solved or not for a single rewrite to be successful. [rewrite*] will rewrite the first occurrence whose side-conditions are solved while [autorewrite*] will rewrite all occurrences whose side-conditions are solved. Not supported by [setoid_rewrite] yet. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12218 85f007b7-540e-0410-9357-904b9bb8a0f7
* Improve return predicate inference by making the return type dependentGravatar msozeau2009-06-28
| | | | | | | | on a matched variable when it is of dependent type, when its type allows it (no constructor in the real arguments). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12213 85f007b7-540e-0410-9357-904b9bb8a0f7
* Fixes for r12197, the refined evars were not returned in case fail_evarGravatar msozeau2009-06-22
| | | | | | | was true. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12206 85f007b7-540e-0410-9357-904b9bb8a0f7
* documented a bug of pattern unification with metasGravatar barras2009-06-22
| | | | git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12203 85f007b7-540e-0410-9357-904b9bb8a0f7
* Use more consistent resolution parameters in Program and regular typingGravatar msozeau2009-06-18
| | | | | | | | and add an optional fail_evar flag to control resolution better in interpretation functions. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12197 85f007b7-540e-0410-9357-904b9bb8a0f7
* Fix "unsatisfiable constraints" error messages to include all theGravatar msozeau2009-06-18
| | | | | | | | necessary information. Fix implementation of [split_evars] and use splitting more wisely as it has a big performance impact. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12196 85f007b7-540e-0410-9357-904b9bb8a0f7
* Try typeclass resolution in coercion if no solution can be found to aGravatar msozeau2009-06-18
| | | | | | | | conversion problem. TODO: The right fix is to use constraints and backtracking search when solving them. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12195 85f007b7-540e-0410-9357-904b9bb8a0f7
* Use a lazy value for the message in FailError, so that it won't beGravatar msozeau2009-06-11
| | | | | | | | | | unnecessarily computed when the user won't see it (avoids the costly nf_evar_defs in typeclass errors). Add hook support for mutual definitions in Program. Try to solve only the argument typeclasses when calling [refine]. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12185 85f007b7-540e-0410-9357-904b9bb8a0f7
* When typing a non-dependent arrow, do not put the (anonymous) variableGravatar msozeau2009-06-11
| | | | | | | | | | | in the context to avoid it being abstracted over in potential evars occuring in the codomain, which can prevent unifications. Add [intro] to the typeclasses eauto and fix [make_resolve_hyp] to properly normalize types w.r.t. evars before searching for a class in an hypothesis. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12182 85f007b7-540e-0410-9357-904b9bb8a0f7
* Fixing bug #2106 ("match" compilation with multi-dependent constructor).Gravatar herbelin2009-06-06
| | | | git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12167 85f007b7-540e-0410-9357-904b9bb8a0f7
* Adding a regression test about Bauer's example on coq-club ofGravatar herbelin2009-06-02
| | | | | | | rewriting using eta. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12161 85f007b7-540e-0410-9357-904b9bb8a0f7
* Backtrack on experimental unification with sort variables: it requires Gravatar msozeau2009-06-02
| | | | | | | | major changes in [w_unify] and the conversion functions used by it to handle the sort constraints correctly. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12159 85f007b7-540e-0410-9357-904b9bb8a0f7
* Change unification with sort constraints to not use the kernelGravatar msozeau2009-06-01
| | | | | | | | | conversion when sort variables are involved and always call it with an empty sort constraint set to avoid [whd_sort_variable] reducing a universe variable to an algebraic universe. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12156 85f007b7-540e-0410-9357-904b9bb8a0f7
* Properly catch sort constraint inconsistency exception inGravatar msozeau2009-05-28
| | | | | | | [base_sort_conv] and revert change in [unify_type]. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12153 85f007b7-540e-0410-9357-904b9bb8a0f7
* Populate the sort constraints set correctly during unification. Add aGravatar msozeau2009-05-27
| | | | | | | | | [set_eq_sort_variable] for cases where two universes should be equal, fix [evars_reset_evd] to keep sort constraints and use [whd_sort_var] directly in [whd_evar]. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12149 85f007b7-540e-0410-9357-904b9bb8a0f7
* Temporary fixes in unification:Gravatar msozeau2009-05-24
| | | | | | | | | | | | | | - Solve meta type equations in the order they appeared during unification: it's sensible because we do an [hnf_constr] on these types, introducing a bit of delta even when it's not allowed by the flags, and some code relies on it. A definite solution would involve an nf variant of hnf_constr or allowing delta-reduction of closed terms when unifying types. - Do a bit of betaiota reduction on types in [check_types] while we haven't got a sort-variable aware [is_trans_fconv] test. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12140 85f007b7-540e-0410-9357-904b9bb8a0f7
* A try at using sort variables during unification. Instead of refreshingGravatar msozeau2009-05-23
| | | | | | | | | | | | | universes as usual, we add the new universes to the sort constraints and do unification modulo those ([constr_unify_with_sorts]): this allows to instanciate Type i with Prop for example and keep track of it. The sort constraints are thrown away at the end of unification for the moment, but we can detect inconsistencies during unification. Make unification more symmetric as well w.r.t. substitution of defined metas. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12137 85f007b7-540e-0410-9357-904b9bb8a0f7
* Many fixes in unification:Gravatar msozeau2009-05-20
| | | | | | | | | | | | | | | | | - Restore failure when types don't unify in [unify_types] (undoing r12075) but try to be more clever about cumulativity using the meta's [instance_status] information. - Fix second-order abstraction when K is not allowed to ensure that we don't unify twice with the same subterm in [w_unify_to_subterm_list]. A more elaborate solution would be give the list to [w_unify_to_subterm] so that it keeps going when it finds an already-found instantiation. - Two "obvious" errors fixed: taking the wrong instance status when unifying with a meta on the right and forgoting type equations in [w_merge]. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12136 85f007b7-540e-0410-9357-904b9bb8a0f7
* Fix in canonical structure resolution: [check_conv_record] may returnGravatar msozeau2009-05-19
| | | | | | | non-matching lists. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12133 85f007b7-540e-0410-9357-904b9bb8a0f7
* Remove camlp4-specific exception handlingGravatar msozeau2009-05-19
| | | | git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12132 85f007b7-540e-0410-9357-904b9bb8a0f7
* Minor unification changes:Gravatar msozeau2009-05-18
| | | | | | | | | | | | | - Primitive setup for firing typeclass resolution on-demand: add a flag to control resolution of remaining evars (e.g. typeclasses) during unification. - Prevent canonical projection resolution when no delta is allowed during unification (fixes incompatibility found in ssreflect). - Correctly check types when the head is an evar _or_ a meta in w_unify. Move [isEvar_or_Meta] to kernel/term.ml, it's used in two places now. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12131 85f007b7-540e-0410-9357-904b9bb8a0f7
* (Tentative to) add Canonical Structure resolution to the regularGravatar msozeau2009-05-16
| | | | | | | | | | unification algorithm. Uses the same code to recognize projections (check_conv_record) and the same unification steps on the solution as evar_conv. This required to fold the sigma through unify_* along with the meta and evar substitutions as this can grow during unification. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12128 85f007b7-540e-0410-9357-904b9bb8a0f7
* - Addition of "Hint Resolve ->" and "Hint Resolve <-" continued: itGravatar herbelin2009-05-10
| | | | | | | | | | revealed a too strict test for detection of inferable metas in Clenv. Restored tolerance for unbound names in interactive tactic use. - Moral removals of some captures of Not_found in Environ.evaluable_* since kernel is assumed to deal with existing names. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12122 85f007b7-540e-0410-9357-904b9bb8a0f7
* - Adding "Hint Resolve ->" and "Hint Resolve <-" for declaration of equivalenceGravatar herbelin2009-05-09
| | | | | | | | | | | | | as hints (see wish #2104). - New type hint_entry for interpreted hint. - Better centralization of functions dealing with evaluable_global_reference. - Unfortunately, camlp4 does not factorize rules so that "Hint Resolve" had uglily to be factorized by hand. - Typography in RefMan-tac.tex. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12121 85f007b7-540e-0410-9357-904b9bb8a0f7
* fix a bug in canonical structures (bug found and fixed by Cyril)Gravatar barras2009-05-09
| | | | git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12120 85f007b7-540e-0410-9357-904b9bb8a0f7
* - Implementation of a new typeclasses eauto procedure based on successGravatar msozeau2009-04-27
| | | | | | | | | | | and failure continuations, allowing to do safe cuts correctly. - Fix bug #2097 by suppressing useless nf_evars calls. - Improve the proof search strategy used by rewrite for subrelations and fix some hints. Up to 20% speed improvement in setoid-intensive files. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12110 85f007b7-540e-0410-9357-904b9bb8a0f7
* - Fixing #2090 (occur check missing when trying to solve evar-evar equation).Gravatar herbelin2009-04-25
| | | | | | | | | | - Adding test file related to commit 12080 (bug #2091). - Cleaning old parsing stuff from 8.0. - Support for camlp5 in base_include. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12106 85f007b7-540e-0410-9357-904b9bb8a0f7
* - New cleaning phase for the entry points of pretyping.mlGravatar herbelin2009-04-24
| | | | | | | | | | | | | | | | | | | | | | | - Uniformisation of ML names between pretyping.ml and subtac_pretyping_F.ml so as to ease the comparison between these files. Application of a change that cannot do harm: j_nf_evar now called after getting evd from consider_remaining_unif_problems in Subtac_pretyping_F.understand_judgment. Four differences remain (is it the sign of a problem?): 1) understand_type fails in Pretyping if evars remain but does not fail in Subtac_pretyping_F 2) resolve_typeclasses (when called) is called with ~onlyargs:false and ~fail:true in Pretyping.understand, Pretyping.understand_gen and Pretyping.understand_type but with true and false in these same functions in Subtac_pretyping_F 3) understand_ltac does not call typeclasses in Pretyping but it does call it in Subtac_pretyping_F 4) understand_judgment does call typeclasses in Pretyping but not in Subtac_pretyping_F git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12099 85f007b7-540e-0410-9357-904b9bb8a0f7
* fixed CBV strategy: it was too eager on terms likeGravatar barras2009-04-21
| | | | | | | | | | Axiom f: (nat->nat)->Prop. Eval compute in let _ := f(fun _ => mult 1000 1000) in 0. function was strongly evaluated when applied to f (based on examples provided by Damien Pous) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12098 85f007b7-540e-0410-9357-904b9bb8a0f7
* - Fix handling of clauses in setoid_rewrite to rewrite under bindersGravatar msozeau2009-04-17
| | | | | | | | | | correctly. - Fix the new autorewrite to implement the (unstated) invariant that the last declared rules are applied first, which makes a difference for non-confluent rewrite rules. Some scripts in CoLoR rely on that. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12092 85f007b7-540e-0410-9357-904b9bb8a0f7
* Fix premature optimisation in dependent induction: even variable args needGravatar msozeau2009-04-10
| | | | | | | | | | | to be generalized as they may appear in other arguments or their types. Try to keep the original names around as well, using the ones found in the goal. This only requires that interning a pattern [forall x, _] properly declares [x] as a metavariable, binding instances are already part of the substitutions computed by [extended_matches]. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12079 85f007b7-540e-0410-9357-904b9bb8a0f7
* Backtrack on 12061 (type checking for bug #2084 too strong as soon as we useGravatar herbelin2009-04-09
| | | | | | | | Type instead of sort variables for unknown levels in unification). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12075 85f007b7-540e-0410-9357-904b9bb8a0f7
* Some dead code removal + cleanupsGravatar letouzey2009-04-08
| | | | | | | | | | | | | | This commit concerns about the first half of the useless code mentionned by Oug for coqtop (without plugins). For the moment, Oug is used in a mode where any elements mentionned in a .mli is considered to be precious. This already allows to detect and remove about 600 lines, and more is still to come. Among the interesting points, the type Entries.specification_entry and its constructors SPExxx were never used. Large parts of cases.ml (and hence subtac_cases.ml) were also useless. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12069 85f007b7-540e-0410-9357-904b9bb8a0f7
* - Fixing bug #2084 (unification not checking sort constraints), hopingGravatar herbelin2009-04-08
| | | | | | | | | | | | | it does not cause a time penalty. - Removing of get_type_of_with_meta made possible by the evar_defs/evar_map merge. - Adding unfolding of Meta in reductionops (this assumes that reduction does not move Metas across binders...) - Renaming newly created fold_map_rel_context into map_rel_context_in_env. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12061 85f007b7-540e-0410-9357-904b9bb8a0f7
* - Backport of 12053 (fixing parsing segfault bug #2087) and 12058 (fixingGravatar herbelin2009-04-08
| | | | | | | | | | | Not_found bug in Theorem with) from V8.2 to trunk. - Improving indentation in presence of tabulation and utf-8 when reporting error messages with "^^^^^^". - Updating a few svn:ignore properties. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12059 85f007b7-540e-0410-9357-904b9bb8a0f7
* Fix obvious bug in evars_of_named_context.Gravatar msozeau2009-04-03
| | | | git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12049 85f007b7-540e-0410-9357-904b9bb8a0f7