aboutsummaryrefslogtreecommitdiff
path: root/pretyping
AgeCommit message (Collapse)Author
2014-10-03Fixing #3634 (wrong env in "cannot instantiate because not in itsHugo Herbelin
scope" error message).
2014-10-02Fixing interpretation of constr under binders which was broken afterHugo Herbelin
it became possible to have binding names themselves bound to ltac variables (2fcc458af16b).
2014-10-02Completing fixing order of parameters when translating fromHugo Herbelin
glob_constr to constr_pattern. Was partially fixed to solve #3088 (8e88b7adab) in but the order of lambdas was still incorrect as the fix of the order of lambdas in second-order pattern-matching for #3136 showed (83159124ce22).
2014-10-02Work around issues with FO unification trying to unify terms ofMatthieu Sozeau
potentially different types, resulting in ill-typed terms due to eta. Projection expansion now fails gracefully on retyping errors. The proper fix to unification, checking that the heads for FO have unifiable types, is currently too strong, adding unnecessary universe constraints, so it is disabled for now. It might be quite expensive too also it's not noticeable on the stdlib.
2014-10-02Fix treatment of projections in Cst_stacks and unfolding behavior in evarconv.Matthieu Sozeau
2014-10-01Fix cbn behavior wrt simpl no matchPierre Boutillier
2014-10-01Fix the refolding by cbn of mutal constants defined in not included modulesPierre Boutillier
2014-10-01Fixing new failure of #3017 after 012fe1a96ba81ab (Referring to evarsHugo Herbelin
by names): VarInstance behaves like GoalEvar for type class resolution.
2014-10-01Fixing use of arguments renaming in apply which was broken afterHugo Herbelin
reorganization of apply in d5fece25d8964d5d9fcd55b66164286aeef5fb9f: using renaming also in retyping.
2014-09-30Seeing IntroWildcard as an action intro pattern rather than as a naming patternHugo Herbelin
(the action is "clear"). Added subst_intropattern which was missing since the introduction of ApplyOn intro patterns. Still to do: make "intros _ ?id" working without interferences when "id" is precisely the internal name used for hypotheses to discard.
2014-09-30Add syntax for naming new goals in refine: writing ?[id] instead of _Hugo Herbelin
will name the goal id; writing ?[?id] will use the first fresh name available based with prefix id. Tactics intro, rename, change, ... from logic.ml now preserve goal name; cut preserves goal name on its main premise.
2014-09-30Simplify evarconv thanks to new delta status of projections,Matthieu Sozeau
using whd_state_gen to handle unfolding. Add an isProj/destProj in term. Use the proper environment everywhere in unification.ml.
2014-09-29Merging some functions from evarutil.ml/evd.ml.Hugo Herbelin
- Removed collect_evars which does not consider instance (use evars_of_term instead). - Also removed evars_of_evar_info which did not filter context (use evars_of_filterered_evar_info instead). This is consistent with printing goal contexts in the filtered way. Anyway, as of today, afaics goals filters are trivial because (if I interpret evarutil.ml correctly), evars with non-trivial filter necessarily occur in a conv pb. Conversely, conv pbs being solved when tactics are called, there should not be an evar used as a goal with a non-trivial filter.
2014-09-29Restoring non-uniform delta on local and global constants in 2nd orderHugo Herbelin
unification for apply (compatibility reason). Waiting for another way to provide a more uniform scheme by default (keyed unification?).
2014-09-29In evarconv and unification, expand folded primitive projections toMatthieu Sozeau
their eta-expanded forms which can then unfold back to the unfolded primitive projection form. This removes all special code that was necessary to handle primitive projections before, while keeping compatibility. Also fix cbn which was not refolding primitive projections correctly in all cases. Update some test-suite files accordingly.
2014-09-27Keyed unification option, compiling the whole standard libraryMatthieu Sozeau
(but deactivated still). Set Keyed Unification to activate the option, which changes subterm selection to _always_ use full conversion _after_ finding a subterm whose head/key matches the key of the term we're looking for. This applies to rewrite and higher-order unification in apply/elim/destruct. Most proof scripts already abide by these semantics. For those that don't, it's usually only a matter of using: Declare Equivalent Keys f g. This make keyed unification consider f and g to match as keys. This takes care of most cases of abbreviations: typically Def foo := bar and rewriting with a bar-headed lhs in a goal mentioning foo works once they're set equivalent. For canonical structures, these hints should be automatically declared. For non-global-reference headed terms, the key is the constructor name (Sort, Prod...). Evars and metas are no keys. INCOMPATIBILITIES: In FMapFullAVL, a Function definition doesn't go through with keyed unification on.
2014-09-27Index keys instead of simply global references.Matthieu Sozeau
2014-09-27First version of keyed subterm selection in unification.Matthieu Sozeau
2014-09-27Fix bug #3664 by refolding projections that don't reduce in cbn.Matthieu Sozeau
2014-09-27Fix semantics of matching with folded/unfolded projections to definitelyMatthieu Sozeau
avoid looping and be compatible with unfold.
2014-09-27Fix bug #3672, application of primitive projections as coercions.Matthieu Sozeau
2014-09-27Fix bug 3662 by actually reducing primitive projections in cbv/compute.Matthieu Sozeau
2014-09-27Make pattern_of_constr typed so that we can infer the proper patternsMatthieu Sozeau
for primitive projections, fixing bug #3661. Also fix expand_projection so that it does enough reduction to find the inductive type of its argument.
2014-09-27Add a boolean to indicate the unfolding state of a primitive projection,Matthieu Sozeau
so as to reproduce correctly the reduction behavior of existing projections, i.e. delta + iota. Make [projection] an abstract datatype in Names.ml, most of the patch is about using that abstraction. Fix unification.ml which tried canonical projections too early in presence of primitive projections.
2014-09-26Fix canonical structure resolution which was launched on the results ofMatthieu Sozeau
eta-expansion, creating a loop. This is now deactivated. Fixes bugs #3665 and #3667.
2014-09-25Fix incorrect assert false in detyping.Matthieu Sozeau
2014-09-24Rename eq_constr functions in Evd to not break backward compatibilityMatthieu Sozeau
with existing ML code.
2014-09-24Return a Prop not an arbitrary Type, and correct a typo.Matthieu Sozeau
2014-09-24Make eq_pattern_test/eq_test work up to the equivalence of primitiveMatthieu Sozeau
projections with their eta-expanded constant form.
2014-09-23Fix bug #3656.Matthieu Sozeau
Maintain the user-level view of primitive projections, disallow manual unfolding and do not let hnf give the eta-expanded form.
2014-09-19Move the specific map_constr_with_binders_left_to_rightMatthieu Sozeau
for e_contextually where it is used. Bug #3648 is fixed.
2014-09-19Fixes in Ltac pattern-matching on primitive projectionsMatthieu Sozeau
and pretyping which was not contracting the eta-expanded forms in presence of coercions.
2014-09-19Use smart mapping in map_constr_with_binders_left_to_right.Matthieu Sozeau
2014-09-19Fixing #3641 (loop in e_contextually, introduced in r16525).Hugo Herbelin
2014-09-19Revert change of e_contextually as it needlessly expands all primitiveMatthieu Sozeau
projections in the term.
2014-09-18Fix constrMatching as well as change/e_contextually to allowMatthieu Sozeau
matching partial applications of primitive projections. Fixes bug #3637.
2014-09-18Fix debug printing with primitive projections.Matthieu Sozeau
Add a flag to indicate if we're in the toplevel or debuggger to not try to retype terms in the wrong environment (and making find_rectype, get_type_of untraceable). This fixes bug #3638 along with the previous commit.
2014-09-18Do not try to match on a subterm that is not closed in find_subterm.Matthieu Sozeau
2014-09-18For type classes, tell that VarInstance's behave like GoalEvar (avoid a loop ↵Hugo Herbelin
in Class_tactics).
2014-09-18Reductionops: (Co)Fixpoints are always refolded during iotaPierre Boutillier
2014-09-17Be more conservative and keep the use of eq_constr in pretyping/ functions.Matthieu Sozeau
2014-09-17Fix bug #3593, making constr_eq and progress work up toMatthieu Sozeau
equality of universes, along with a few other functions in evd.
2014-09-17Revert specific syntax for primitive projections, avoiding uglyMatthieu Sozeau
contortions in internalization/externalization. It uses a fully typed version of detyping, requiring the environment, to move from primitive projection applications to regular applications of the eta-expanded version. The kernel is unchanged, and only constrMatching needs compatibility code now.
2014-09-15Add a "Hint Mode ref (+ | -)*" hint for setting a global modeMatthieu Sozeau
of resulution for goals whose head is "ref". + means the argument is an input and shouldn't contain an evar, otherwise resolution fails. This generalizes the Typeclasses Strict Resolution option which prevents resolution to fire on underconstrained typeclass constraints, now the criterion can be applied to specific parameters. Also cleanup auto/eauto code, uncovering a potential backwards compatibility issue: in cases the goal contains existentials, we never use the discrimination net in auto/eauto. We should try to set this on once the contribs are stabilized (the stdlib goes through when the dnet is used in these cases).
2014-09-15Fix: when interpreting a identifier in pretying, use the Ltac identifier ↵Arnaud Spiwack
substitution at the right place. I used to change [id] to its interpretation before calling [pretype_id]. But it's incorrect: we need to use the Ltac interpretation only when looking up the rel context (where it has been interpreted previously). It would not be to use the interpreted identifier to look up the named context or the Ltac context.
2014-09-15Fix a bug in the naming of binders.Arnaud Spiwack
The ident closure was not propagated when pretying a [uconstr] coming from a [uconstr] closure. This bug had never been reported, as far as I'm aware.
2014-09-15Fix bug #3610, allowing betaiotadelta reduction while unifying types ofMatthieu Sozeau
records in unification.ml.
2014-09-15Fix bug #3621, using fold_left2 on arrays of the same size only.Matthieu Sozeau
2014-09-15Rework typeclass resolution and control of backtracking.Matthieu Sozeau
Add a global option to check for multiple solutions and fail in that case. Add another flag to declare classes as having unique instances (not checked but assumed correct, avoiding some backtracking).
2014-09-13Using "Evd.restrict" in tactic clear so as to keep evar names.Hugo Herbelin