aboutsummaryrefslogtreecommitdiff
path: root/pretyping
AgeCommit message (Collapse)Author
2020-12-21Move evaluable_global_reference from Names to Tacred.Pierre-Marie Pédrot
It is the only place where it starts making sense in the whole codebase. It also fits nicely there since there are other functions manipulating this type in that module. In any case this type does not belong to the kernel.
2020-12-21Remove the artificial dependency of Heads on evaluable_global_reference.Pierre-Marie Pédrot
2020-12-20Merge PR #13138: Towards a documentation / cleanup of evarconvcoqbot-app[bot]
Reviewed-by: gares
2020-12-18Merge PR #13628: Cache meta instances in Clenvcoqbot-app[bot]
Reviewed-by: mattam82 Reviewed-by: gares Ack-by: SkySkimmer
2020-12-16Merge PR #13568: Fix #13566: Add checks for invalid occurrences in several ↵Pierre-Marie Pédrot
tactics. Reviewed-by: ppedrot
2020-12-15Merge PR #13625: Tweak constr_matching so as to make it tail-rec on ↵coqbot-app[bot]
projection expansion. Reviewed-by: ejgallego
2020-12-14Add checks for invalid occurrences in setoid rewrite.Hugo Herbelin
We additionally check that occurrence 0 is invalid in simpl at, unfold at, etc.
2020-12-14Do not rely on Reductionops to recognize canonical projections.Pierre-Marie Pédrot
No need to call the whole whd_gen machinery when a simple matching over a term would suffice. Note that this changes a bit the semantics, but I suspect that the previous code was buggy. Indeed, whd_nored also pushes cases and fixpoints on the stack, so that an applied canonical projection inside such a context would also match. But the caller in unification performs an approximate check where the term needs to be an application or a projection, which would prevent such complex situations most of the time, e.g. it would work with a dummy commutative cut but not their corresponding vanilla match.
2020-12-14Remove most of Reductionops.*_state functions.Pierre-Marie Pédrot
There functions export the internal stack representation. The only real user is unification, which is suffering from major performance issues due to the naive representation of substitutions in processes.
2020-12-14Cache meta access in meta_instance.Pierre-Marie Pédrot
2020-12-12Tweak constr_matching so as to make it tail-rec on projection expansion.Pierre-Marie Pédrot
This was revealed on the rewriter contrib with the compact-case-repr branch.
2020-12-11Removing non relevant argument binding_kind of GLocalDef.Hugo Herbelin
2020-12-10Merge PR #12100: Fixing use of argument scopes in patterns + a further ↵coqbot-app[bot]
cleanup of constrintern.ml Reviewed-by: SkySkimmer Ack-by: ppedrot
2020-12-09Optimization: take advantage that we don't use arrays anymore in substitutions.Pierre-Marie Pédrot
2020-12-09Using self-documenting argument names in two exceptions of cases.ml.Hugo Herbelin
Namely, WrongNumargInductive and WrongNumargConstructor.
2020-12-09Fixing support for argument scopes and let-ins while interning cases patterns.Hugo Herbelin
We also simplify the whole process of interpretation of cases pattern on the way.
2020-12-09Adding functions to returning the def/decl status of an inductive arity.Hugo Herbelin
2020-11-28Merge PR #13479: extracting API for comparing universes of ↵coqbot-app[bot]
constants/inductives/constructors Reviewed-by: SkySkimmer
2020-11-26Merge PR #13415: Separate interning and pretyping of universescoqbot-app[bot]
Reviewed-by: mattam82
2020-11-26extracting API for comparing universes of constants/inductives/constructorsbeta
2020-11-25Separate interning and pretyping of universesGaëtan Gilbert
This allows proper treatment in notations, ie fixes #13303 The "glob" representation of universes (what pretyping sees) contains only fully interpreted (kernel) universes and unbound universe ids (for non Strict Universe Declaration). This means universes need to be understood at intern time, so intern now has a new "universe binders" argument. We cannot avoid this due to the following example: ~~~coq Module Import M. Universe i. End M. Definition foo@{i} := Type@{i}. ~~~ When interning `Type@{i}` we need to know that `i` is locally bound to avoid interning it as `M.i`. Extern has a symmetrical problem: ~~~coq Module Import M. Universe i. End M. Polymorphic Definition foo@{i} := Type@{M.i} -> Type@{i}. Print foo. (* must not print Type@{i} -> Type@{i} *) ~~~ (Polymorphic as otherwise the local `i` will be called `foo.i`) Therefore extern also takes a universe binders argument. Note that the current implementation actually replaces local universes with names at detype type. (Asymmetrical to pretyping which only gets names in glob terms for dynamically declared univs, although it's capable of understanding bound univs too) As such extern only really needs the domain of the universe binders (ie the set of bound universe ids), we just arbitrarily pass the whole universe binders to avoid putting `Id.Map.domain` at every entry point. Note that if we want to change so that detyping does not name locally bound univs we would need to pass the reverse universe binders (map from levels to ids, contained in the ustate ie in the evar map) to extern.
2020-11-25Reserve "sort_expr" for uninterned universesGaëtan Gilbert
2020-11-24Add a new evar source to refer to evars which are types of evars.Hugo Herbelin
To tie the knot (since the evar depends on the evar type and the source of the evar type of the evar), we use an "update_source" function. An alternative could be to provide a function to build both an evar with its evar type directly in evd.ml...
2020-11-23Merge PR #13377: Fix timeout by ensuring signal exceptions are not ↵Pierre-Marie Pédrot
erroneously caught Reviewed-by: ppedrot
2020-11-22Fix timeout by ensuring signal exceptions are not erroneously caughtLasse Blaauwbroek
Fixes #7430 and fixes #10968 This commit makes the following changes: - Add an exception `Signal` used to convert OCaml signals to exceptions. `Signal` is registered as critical in `CErrors` to avoid being caught in the wrong `with` clauses. - Make `Control.timeout` into a safer interface based on `option` instead of exceptions. - Modify `tclTIMEOUT` to fail with `CErrors.Timeout` instead of `Logic_monad.Tac_timeout`, as was already advertised in the ocamldoc documentation. - Removes `Logic_monad.Tac_timeout` altogether because it no longer has a use.
2020-11-21More documentation about the situation ?ev := C[?ev'] in solve_simple_eqn.Hugo Herbelin
2020-11-21Unification: renamings in ise_stack2 to get a more explicit idea of its ↵Hugo Herbelin
semantic.
2020-11-21Some partial documentation of evar_conv_x.Hugo Herbelin
2020-11-21Short documentation of solve_simple_eqn.Hugo Herbelin
2020-11-21Documenting module Reductionops.Stack.Hugo Herbelin
Also includes minor layout or code changes.
2020-11-21Unification: documenting eta for pi-types and record types.Hugo Herbelin
We also align their type on (more) standard invariants.
2020-11-21Deduce Stack.decomp from Stack.strip_n_app.Hugo Herbelin
2020-11-20Merge PR #13386: Fixes #9971: a useless situation where the type of a ↵coqbot-app[bot]
primitive projection was wrongly supposed to be already inferred Reviewed-by: gares
2020-11-20Merge PR #13371: Extend hack to use postponed constraints in retyping to ↵coqbot-app[bot]
template poly Reviewed-by: gares Reviewed-by: herbelin
2020-11-19Use a proper canonical structure entry for projections.Hugo Herbelin
This is to make more explicit that arguments of the projection are not kept. We seize this opportunity to use QGlobRef equality on GlobRef.
2020-11-19Fixes #9971: expand_projections failing on primitive projections of unknown ↵Hugo Herbelin
type. This was a case where expand_projections was calling find_mrectype which was expecting the argument of the projection to be an inductive. We could have ensured that this type is at least the appropriate inductive applied to fresh evars, but this expand_projections was in practice used for checking the applicability of canonical structures and the unifiability of the parameters of the projections is anyway a consequence of the unifiability of the principal argument of the projections. So, the latter is enough.
2020-11-16Merge PR #12873: Unification: A type-checking fix in imitation + an error ↵coqbot-app[bot]
locating fix Reviewed-by: gares
2020-11-16Merge PR #13380: Fixing the "IllTypedInstance" anomaly part of #5512coqbot-app[bot]
Reviewed-by: gares
2020-11-16Merge PR #13373: Fixes #13363: in pose_all_metas_as_evars, use the context ↵coqbot-app[bot]
of the definition of the metas Reviewed-by: mattam82
2020-11-16Merge PR #13387: Fixes #12348: de Bruijn indices bug in the imitation part ↵coqbot-app[bot]
of unification Reviewed-by: mattam82
2020-11-16Checking type in unification imitation: avoid raising a non-located error.Hugo Herbelin
2020-11-16Fixing a (known) "bugged" part of imitation in unification.Hugo Herbelin
We ensure that when imitation stops to be possible, we postpone an equation of the type of the subterm (and not of the arbitrary type of an evar possibly depending on this subterm).
2020-11-16Fixing the "IllTypedInstance" anomaly part of #5512.Hugo Herbelin
It remains to accept resolving Type(u)<=Prop for u arbitrary sort variable.
2020-11-16Extend hack to use postponed constraints in retyping to template polyGaëtan Gilbert
See 742ef62fe8050a6865d06bd644e30cbec0e7eb02 Fix #13366 Fix #9809
2020-11-16Merge PR #13290: Grant #13278: computation of return predicate takes care of ↵coqbot-app[bot]
sort elimination constraints Reviewed-by: gares
2020-11-15Fixes #12348: long-standing de Bruijn indices bug in imitation ↵Hugo Herbelin
(solve_simple_eqn). The bug was that an assumption could be interpreted as a local definition and wrongly expanded. It triggered rarely because it involved mixing let-ins and local assumptions + imitation under binders.
2020-11-15Locating the Ill-typed evar instance error.Hugo Herbelin
Even though it is not strongly supposed to be raised.
2020-11-15Merge PR #13376: Fixes #13266: Avoiding encapsulating exceptions w/o a ↵coqbot-app[bot]
handler in NotFoundInstance Reviewed-by: ejgallego
2020-11-14Avoiding encapsulating exceptions w/o a handler in NotFoundInstance.Hugo Herbelin
Fixes #13266 (see #12675, 8641cb7385).
2020-11-13Fixes #13363: case of a meta not paying attention to being under binders.Hugo Herbelin
In Evar := C[Meta] problems of unification.ml, and C[ ] contains binders, Meta was wrongly considered by pose_all_metas_as_evars as under these binders (while Metas are always defined in the initial context of the unification problem).