aboutsummaryrefslogtreecommitdiff
path: root/pretyping
AgeCommit message (Collapse)Author
2014-11-20Probably useless use of a global-environment reading function in Indrec.Pierre-Marie Pédrot
2014-11-19Making map_union a standard function of the ML library.Hugo Herbelin
2014-11-19Option -type-in-type continued (deactivate test for inferred sort ofHugo Herbelin
inductive types + deactivate test for equality of sort + deactivate the check that the constraints Prop/Set <= Type are declared).
2014-11-19Continuing fixing nested but convertible occurrences in find_subtermHugo Herbelin
(see 2e3ae20fe1e): test was only relevant in the case of explicitly given occurrence numbers.
2014-11-19Printing function for [uconstr].Arnaud Spiwack
The core is a "detyping" function for [closed_glob_constr]. Which interpretes the variable names according to the Ltac context, and apply the standard detyping procedure to typed terms in the closure.
2014-11-19uconstr: fix bug in interpretation of Ltac-bound name in let-tuple and ↵Arnaud Spiwack
pattern-matching. In the syntax [let (x1,…,xn) := b in e] the name [x1…xn] were not interpreted with respect to the Ltac context. Hence typeable term would raise type-errors. The same problem also existed in pattern-matching.
2014-11-19Glob-ops: a name-mapping operation for pattern-matching binders.Arnaud Spiwack
2014-11-18Fixing a little bug with nested but convertible occurrences in "destruct at".Hugo Herbelin
2014-11-18Fixing detection of occurrences in the presence of nested subterms forHugo Herbelin
"simpl at" and "change at".
2014-11-16Enforcing a stronger difference between the two syntaxes "simplHugo Herbelin
reference" and "simpl pattern" in the code (maybe we should have merged them instead, but I finally decided to enforce their difference, even if some compatibility is to be preversed - the idea is that at some time "simpl reference" would only call a weak-head simpl (or eventually cbn), leading e.g. to reduce 2+n into S(1+n) rather than S(S(n)) which could be useful for better using induction hypotheses. In the process we also implement the following: - 'simpl "+"' is accepted to reduce all applicative subterms whose head symbol is written "+" (in the toplevel scope); idem for vm_compute and native_compute - 'simpl reference' works even if reference has maximally inserted implicit arguments (this solves the "simpl fst" incompatibility) - compatibility of ltac expressions referring to vm_compute and native_compute with functor application should now work (i.e. vm_compute and native_compute are now taken into account in tacsubst.ml) - for compatibility, "simpl eq" (assuming no maximal implicit args in eq) or "simpl @eq" to mean "simpl (eq _ _)" are still allowed. By the way, is "mul" on nat defined optimally? "3*n" simplifies to "n+(n+(n+0))". Are there some advantages of this compared to have it simplified to "n+n+n" (i.e. to "(n+n)+n").
2014-11-14Get rif of exit codes 120, 121, 123, and 124.Xavier Clerc
2014-11-11Accepting conversion on inner closed subterms while looking forHugo Herbelin
matching subterm destruct/induction on a partially applied pattern. AFAICS, there is only such instance of destruct that needs this in the contrins (in EuclideanGeometry/G3_ParticularAngle.v), but while a more global decision is taken, I prefer at the current time to adopt this approximation of 8.4 semantics, even if the flags are not the same when the pattern is fully applied or not. Only so little cases are concerned because in most cases, destruct/induction on a partially applied pattern is of the form "destruct cst" (e.g. "destruct eq_dec") and no conversion is needed anyway. Not being uniform whether the pattern is fully applied or not is a bit unsatisfactory, but hopefully, this is temporary.
2014-11-10Evar normalization is now done eagerly.Pierre-Marie Pédrot
As witnessed in the ProjectiveGeometry contrib, some evar normalization were taking ages because of an exponential behaviour due to a call-by-name substitution: when normalizing an evar, its arguments were substituted right away and the resulting term was then normalized, leading to a potential duplication of normalizations. Now we normalize evar arguments before substituting them, in a call-by-value fashion. It makes examples from ProjectiveGeometry compile instanteanously when they were killing the machine due to excessive memory allocation before the patch. Note that there is a tension here: we may be normalizing evar arguments too eagerly, and try a call-by-need approach instead. To choose which particular strategy we use, we should do some benchmarks... On stdlib, call-by-value and call-by-need seem indistinguishable. To be continued?
2014-11-09Fixing bug #3792.Pierre-Marie Pédrot
Pretyping of [if] cases was missing a convertibility check with the ambient type constraint, and just dropped it. This was making the pretyper construct ill-typed terms.
2014-11-09new: Optimize Proof, Optimize HeapEnrico Tassi
- drops all Defined entries from the evar map (applying the subst to the initial evar and the undefined evars types). - call Gc.compact Now the question is: where should these two commands be documented?
2014-11-08Follow up to experimental eager evar unification in bcba6d1bc9:Hugo Herbelin
Observing that systematic eager evar unification makes unification works better, for instance in setoid rewrite (ATBR, SemiRing.v), we add a new flag use_evars_eagerly_in_conv_on_closed_terms which is put to true only in Rewrite.rewrite_core_unif_flags (empirically, this makes the "rewrite" from rewrite.ml working again on examples which were previously treated by use_metas_eagerly_in_conv_on_closed_terms).
2014-11-08Fixing a bug in change of subst_defined_metas in bcba6d1bc9f769da:Hugo Herbelin
One missing evar was making the whole substitution fail. The bug actually existed a priori also in the case where only metas are substituted (i.e. before bcba6d1bc9f769da), leading to limit the number of situations where it could be effectful. This fixes current failures of RelationAlgebra and CFGV.
2014-11-04Experimentally applying eager evar substitution at the same time asHugo Herbelin
eager meta substition in w_unify, so as to preserve compatibility after PMP's move of (setoid) rewrite clauses from metas to evars (fbbe491cfa). Hoping it is compatible for non-rewrite uses of the eager meta flag, and that it is not too costly.
2014-11-03Fixing confused code for interpretations of evar instances.Hugo Herbelin
2014-11-03Fixing inefficiency in typeclass resolution.Pierre-Marie Pédrot
Instead of keeping checking that evars are pending, we cache the pending evars in a proper set computed once and for all.
2014-11-02Fixing subterm matched for destruct when it is matched from prefix.Hugo Herbelin
2014-11-02Cosmetic changes.Hugo Herbelin
2014-11-02Fixing 1177da327 (reorganization of the test for generic selection ofHugo Herbelin
occurrences: some uniformisation was not appropriate for "change").
2014-10-31Reorganization of the test for generic selection of occurrences inHugo Herbelin
clause; extended it so that an induction over "x" is considered generic when the clause has the form "in H |-" (w/o the conclusion) and x does not occur in the conclusion.
2014-10-31Enlarge the cases where the like first selection is used in destruct.Hugo Herbelin
This is now a "like first" strategy iff there is no occurrences selected in either the goal or in one of the hypotheses possibly given in an "in" clause. Before, it was "like first" if and only if no "in" clause was given at all.
2014-10-27Removing dead code from Evd.Pierre-Marie Pédrot
2014-10-27Removing the Evd.diff function.Pierre-Marie Pédrot
2014-10-27Removing the Evd.merge function.Pierre-Marie Pédrot
Its semantics was dubious, and it was not used anymore anyway.
2014-10-27Dead codeHugo Herbelin
2014-10-26Applying like-first selection for destruct in hypotheses.Hugo Herbelin
2014-10-26Fixing destruct/induction with a using clause on a non-inductive type,Hugo Herbelin
that was broken by commit bf01856940 + use types from induction scheme to restrict selection of pattern + accept matching from partially applied term when using "using".
2014-10-26Dead code + typo.Hugo Herbelin
2014-10-25This commit introduces changes in induction and destruct.Hugo Herbelin
The main change is that selection of subterm is made similar whether the given term is fully applied or not. - The selection of subterm now works as follows depending on whether the "at" is given, of whether the subterm is fully applied or not, and whether there are incompatible subterms matching the pattern. In particular, we have: "at" given | subterm fully applied | | incompatible subterms | | | Y Y - it works like in 8.4 Y N - this was broken in 8.4 ("at" was ineffective and it was finding all subterms syntactically equal to the first one which matches) N Y Y it now finds all subterms like the first one which matches while in 8.4 it used to fail (I hope it is not a too risky in-draft for a semantics we would regret...) (e.g. "destruct (S _)" on goal "S x = S y + S x" now selects the two occurrences of "S x" while it was failing before) N Y N it works like in 8.4 N N - it works like in 8.4, selecting all subterms like the first one which matches - Note that the "historical" semantics, when looking for a subterm, to select all subterms that syntactically match the first subterm to match the pattern (looking from left to right) is now internally called "like first". - Selection of subterms can now find the type by pattern-matching (useful e.g. for "induction (nat_rect _ _ _ _)") - A version of Unification.w_unify w/o any conversion is used for finding the subterm: it could be easily replaced by an other matching algorithm. In particular, "destruct H" now works on a goal such as "H:True -> x<=y |- P y". Secondary change is in the interpretation of terms with existential variables: - When several arguments are given, interpretation is delayed at the time of execution - Because we aim at eventually accepting "edestruct c" with unresolved holes in c, we need the sigma obtained from c to be an extension of the sigma of the tactics, while before, we just type-checked c independently of the sigma of the tactic - Finishing the resolution of evars (using type classes, candidates, pending conversion problems) is made slightly cleaner: it now takes three states: a term is evaluated in state sigma, leading to state sigma' >= sigma, with evars finally solved in state sigma'' >= sigma'; we solve evars in the diff of sigma' and sigma and report the solution in sigma'' - We however renounce to give now a success semantics to "edestruct c" when "c" has unresolved holes, waiting instead for a decision on what to do in the case of a similar eapply (see mail to coqdev). An auxiliary change is that an "in" clause can be attached to each component of a "destruct t, u, v", etc. Incidentally, make_abstraction does not do evar resolution itself any longer.
2014-10-24Change reduction_of_red_expr to return an e_reduction_function returningMatthieu Sozeau
an updated evar_map, as pattern is working up to universe equalities that must be kept. Straightforward adaptation of the code depending on this.
2014-10-24Fixing order of hypothesis in goal hypotheses compaction for coqtop.Hugo Herbelin
2014-10-23Fixing order of declarations in the function which compacts variablesHugo Herbelin
of same type in a context.
2014-10-22Pushing Pierre's factorization of names in goal context printing fromHugo Herbelin
coqide to coqtop. (Joint work with Pierre)
2014-10-22Removing an unused variant of Context.fold_named_context_reverse.Hugo Herbelin
2014-10-22Fix missing lift in VM and native compiler (second part of #2729).Maxime Dénès
Was occurring in the parameters of constructors when reifying a dependent pattern matching return predicate. Note: this does not affect the kernel, only the pretyper.
2014-10-22Fixing an evar leak in pattern-matching compilation (#3758).Hugo Herbelin
2014-10-22Add more primitives to the [Monad.Make] arguments.Arnaud Spiwack
For optimisation purposes.
2014-10-21Porting Hugo's fix 98f3abb83a to native compiler.Maxime Dénès
2014-10-21Dead code.Hugo Herbelin
2014-10-20Fixing a (new) part of bug #2729.Hugo Herbelin
By moving convert_concl to new proof engine, re-typecheckeing was incidentally introduced. Re-typechecking revealed that vm bug #2729 was still open. Indeed, the vm was still producing an ill-typed term. This commit fixes ill-typedness of the vm in #2729 when reconstructing a "match" in an inductive type whose constructors have let-ins. Another part is still open (see test-suite).
2014-10-20A patch for printing "match" when constructors are defined with let-inHugo Herbelin
but the internal representation dropped let-in. Ideally, the internal representation of the "match" should use contexts for the predicate and the branches. This would however be a rather significant change. In the meantime, just a hack. To do, there is still an extra @ in the constructor name that does not need to be there.
2014-10-20Fixing a bug in the presence of let-in in inductive arity.Hugo Herbelin
2014-10-17When facing problem ?id = ?id' in resolution of return predicate,Hugo Herbelin
early call the standard resolution function which e.g. does restriction and maybe solve the problem if pattern-like, instead of postponing the problem.
2014-10-17New experimental heuristic printing strategy for evar instances: WeHugo Herbelin
don't print bindings of the form "x:=x" unless there is also a binding "x':=x". Otherwise said, if a variable occurs several time, the binding where it occurs under the form "x:=x" is printed anyway. This should help to understand where the instance is non trivial while still not obfuscating display in goals with very long list of uninteresting trivial instances.
2014-10-17Re-displaying evar instances in debugger.Hugo Herbelin
2014-10-16Refine: proper scoping of the future goals.Arnaud Spiwack
In my first attempt I just dropped all future goals before starting a refinement. This was done for simplicity but is incorrect in general. In this version the future goals which are not introduced by the particular instance of refine are kept for future use.