aboutsummaryrefslogtreecommitdiff
path: root/pretyping
AgeCommit message (Collapse)Author
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.
2014-10-16Move the handling of the principal evar from refine to evd.Arnaud Spiwack
See previous commit for more discussion. Changed the name from "main" to "principal" because I find "main" overused, and because the name was only introduced yesterday anyway.
2014-10-16Move the handling a new evars from the [Proofview.Refine] module to [Evd].Arnaud Spiwack
That way, everything in the code of pretying is made "refine"-aware. Making the abstraction stonger and integration of pretyping with interactive proof more direct. It might create goals in a slightly different goal order in the (user level) refine tactic. Because now, the [update] primitive which used to infer an order from an [evar_map] now has the order fixed by the successive declaration with [Evarutil.new_evar] (and similar). It probably coincides, though. Following a suggestion by Hugo.
2014-10-16Evd: a few comments to document the increasingly wide internal [evar_map] type.Arnaud Spiwack
2014-10-16Evd: remove/update obsolete comments.Arnaud Spiwack
2014-10-15To stay closer to non-primitive projections, only unfold primitiveMatthieu Sozeau
projections in cbv when delta _and_ beta flags are set. Add test-suite file for bug 3700 too.
2014-10-15Make use of unfolded primitive projections when elaborating match on aMatthieu Sozeau
primitive record.
2014-10-15Fix bug 3637.Matthieu Sozeau
2014-10-15Reenable FO unification of primitive projections and their eta-expandedMatthieu Sozeau
forms in evarconv and unification, as well as fallback to first-order unification when eta for constructors fail. Update test-suite file 3484 to test for the FO case in evarconv as well.
2014-10-15Modify the heuristic for unfolding lhs or rhs in evarconv, consideringMatthieu Sozeau
folded primitive projections in applicative stacks in rhs as named, hence prefering to unfold the lhs in these cases.
2014-10-15Implement a different strategy to expand primitive projections only whenMatthieu Sozeau
required, i.e. in first-order unification cases where the head of the other side is a hole or the eta-expanded constant.
2014-10-15Add an option to not print primitive projection parameters, which canMatthieu Sozeau
make printing exponentially slower. We would have to expand all projections at once before detyping to make this linear.
2014-10-14Oops, forgot a fix needed after the rebase.Matthieu Sozeau
2014-10-14Fix bug #3698: stack overflow due to eta+canonical structures inMatthieu Sozeau
unification.
2014-10-13Adding a tactic which fails if one of the goals under focus is dependent in ↵Hugo Herbelin
another one.
2014-10-13Moving function about locs in locusops.Hugo Herbelin
2014-10-13English typo in a function name of evarconv.Hugo Herbelin
2014-10-13Added support for several impossible cases in compilation of "match".Hugo Herbelin
2014-10-12Tentative fix for a badly used Option.get in Reductionops.Pierre-Marie Pédrot
2014-10-11Revert d0cd27e209be08ee51a2d609157367f053438a10: giving a different nameMatthieu Sozeau
for the record binder of classes. This name is no longer generated in the kernel but part of the declaration. Also cleanup the interface to recognize primitive records based on an option type instead of a dynamic check of the length of an array.
2014-10-10Do not expand primitive projections eagerly in evarconv, but onlyMatthieu Sozeau
in cases of unification with existentials requiring it.
2014-10-10Add debug printers for projections, fix printing of evar constraintsMatthieu Sozeau
and unsatisfiable constraints which were not done in the right environment.
2014-10-10Add a "Debug Tactic Unification" option and correct the first-orderMatthieu Sozeau
application case to expand primitive projections at the head of both applications.
2014-10-10Make constrMatching and detyping more robust with respect toMatthieu Sozeau
expand_projection failing if an innapropriate sigma is given.
2014-10-10Fix bug due to shadowing a variable name in tacredMatthieu Sozeau
2014-10-08fix make mlidocPierre Boutillier