aboutsummaryrefslogtreecommitdiff
path: root/engine
AgeCommit message (Collapse)Author
2018-11-27Fix #8364: making univ algebraic when already equal to another.Gaëtan Gilbert
When making a universe a variable we iterate through the universes we're equal to and if we find one we update the substitution accordingly. NB: The bug called make_flexible_variable on Top.15 and ~~~ {Top.15 Top.14} |= Top.11 < Top.6 Top.14 < Top.5 Top.11 = Top.15 ALGEBRAIC UNIVERSES:{Top.17 Top.16} UNDEFINED UNIVERSES:Top.17 := Top.14+1 Top.16 := Top.14+1 WEAK CONSTRAINTS: ~~~ so now we would add [Top.15 := Top.11].
2018-11-27Merge PR #8850: Private universes for opaque polymorphic constants.Matthieu Sozeau
2018-11-24Merge PR #8929: Fix fixpoint related lifting in open recursors + related ↵Pierre-Marie Pédrot
cleanups
2018-11-23Local universes for opaque polymorphic constants.Gaëtan Gilbert
2018-11-23s/let _ =/let () =/ in some places (mostly goptions related)Gaëtan Gilbert
2018-11-16Print universe names in subtyping error instead of Var(x).Gaëtan Gilbert
2018-11-16Termops.iter_constr_with_full_binders = EConstr.iter_with_full_bindersGaëtan Gilbert
2018-11-16Share open recursor code between econstr and constrGaëtan Gilbert
2018-11-16Fix lifting in foo_with_full_binders for (co)fixpointsGaëtan Gilbert
2018-11-13Merge PR #8760: Automatically generate names for universes.Pierre-Marie Pédrot
2018-11-12Automatically generate names for universes.Gaëtan Gilbert
The names are `uXXX` with `XXX` some number avoiding collision. Note that there may be some collisions with polymorphic binders, eg something like ~~~ Set Universe Polymorphism. Section foo. Universe u0. Definition bar := Type. (* bar@{u0} = Type@{u0} but this isn't the section u0 *) Definition baz := Type@{u0}. (* this one is the section u0 *) Definition foobar := Eval compute in baz -> Type. (* Type@{u0} -> Type@{u0} but these aren't the same u0 *) ~~~ So maybe we should do a nametab lookup too. This is strictly a printing issue (polymorphic binder names have no other use). In the monomorphic case names are qualified by the parent definition so it should be fine (barring module/definition collision but we already have those). Note that there are still unnamed universes as they didn't go through UState (eg schemes).
2018-11-12Fix #8908: incorrect refresh of algebraic universes.Gaëtan Gilbert
2018-11-09Use arrays of names instead of lists in abstract universe names.Pierre-Marie Pédrot
There is little point in having a list, as there is virtually no sharing nor expansion of bound universe names. This representation is thus more compact.
2018-11-09Remove remnants of polymorphic instance name registration.Pierre-Marie Pédrot
2018-11-09Actually store the bound name information in the abstract universe context.Pierre-Marie Pédrot
2018-11-09Adding universe names to polymorphic entry instances.Pierre-Marie Pédrot
2018-11-07Merge PR #8928: Fixes #8910: typo in nameops.mlPierre-Marie Pédrot
2018-11-06Fixes #8910 (typo in nameops.ml).Hugo Herbelin
[ci skip]
2018-11-06Move debug term printer to kernelMaxime Dénès
2018-11-05Merge PR #8842: Towards seeing Global purely as a wrapper on top of kernel ↵Maxime Dénès
functions
2018-11-03Merge PR #8852: Use the obligation evar flagPierre-Marie Pédrot
2018-11-02Merge PR #8834: [error printing] Fix improper grounding of open terms in ↵Hugo Herbelin
printing.
2018-10-31Renaming is_template_polymorphic -> is_template_polymorphic_ind.Hugo Herbelin
This emphasizes that it works only on inductive types. Also, the name is_template_polymorphic will be reused for a more general version.
2018-10-30Generalizing the various evar_map printers in Termops over an environment.Hugo Herbelin
This is a step towards limiting calls to the global environment. Incidentally unify naming evd -> sigma in Termops.
2018-10-30Switch to using the obligation_evar flag instead of the evar sourceMatthieu Sozeau
for the determination of evars that can be turned into obligations.
2018-10-28[error printing] Fix improper grounding of open terms in printing.Emilio Jesus Gallego Arias
Fixes #8224, fixes #8427 .
2018-10-26[typeclasses] functionalize typeclass evar handlingMatthieu Sozeau
This avoids all the side effects associated with the manipulation of an unresolvable flag. In the new design: - The evar_map stores a set of evars that are candidates for typeclass resolution, which can be retrieved and set. We maintain the invariant that it always contains only undefined evars. - At the creation time of an evar (new_evar), we classify it as a potential candidate of resolution. - This uses a hook to test if the conclusion ends in a typeclass application. (hook set in typeclasses.ml) - This is an approximation if the conclusion is an existential (i.e. not yet determined). In that case we register the evar as potentially a typeclass instance, and later phases must consider that case, dropping the evar if it is not a typeclass. - One can pass the ~typeclass_candidate:false flag to new_evar to prevent classification entirely. Typically this is for new goals which should not ever be considered to be typeclass resolution candidates. - One can mark a subset of evars unresolvable later if needed. Typically for clausenv, and marking future goals as unresolvable even if they are typeclass goals. For clausenv for example, after turing metas into evars we first (optionally) try a typeclass resolution on the newly created evars and only then mark the remaining newly created evars as subgoals. The intent of the code looks clearer now. This should prevent keeping testing if undefined evars are classes all the time and crawling large sets when no typeclasses are present. - Typeclass candidate evars stay candidates through restriction/evar-evar solutions. - Evd.add uses ~typeclass_candidate:false to avoid recomputing if the new evar is a candidate. There's a deficiency in the API, in most use cases of Evd.add we should rather use a: `Evd.update_evar_info : evar_map -> Evar.t -> (evar_info -> evar_info) -> evar_map` Usually it is only about nf_evar'ing the evar_info's contents, which doesn't change the evar candidate status. - Typeclass resolution can now handle the set of candidates functionally: it always starts from the set of candidates (and not the whole undefined_map) and a filter on it, potentially splitting it in connected components, does proof search for each component in an evar_map with an empty set of typeclass evars (allowing clean reentrancy), then reinstates the potential remaining unsolved components and filtered out typeclass evars at the end of resolution. This means no more marking of resolvability/unresolvability everywhere, and hopefully a more efficient implementation in general. - This is on top of the cleanup of evar_info's currently but can be made independent. [typeclasses] Fix cases.ml: none of the new_evars should be typeclass candidates Solve bug in inheritance of flags in evar-evar solutions. Renaming unresolvable to typeclass_candidate (positive) and fix maybe_typeclass_hook
2018-10-26Cleanup evar_extra: remove evar_info's store and add maps to evar_mapMatthieu Sozeau
2018-10-26Merge PR #8687: Mini reorganization type of global constr of globalPierre-Marie Pédrot
2018-10-26Merge PR #7186: Moving `fold_constr_with_full_binders` to a placeMaxime Dénès
2018-10-19Merge PR #8758: [api] Qualify access to `Nametab`Hugo Herbelin
2018-10-19Deprecating unused Engine.type_of_global.Hugo Herbelin
2018-10-18[universes] deprecate constr_of_globalMatthieu Sozeau
In favor of a constr_of_monomorphic_global function. When people move to the new Coqlib interface they will also see this deprecation message encouraging them to think about the best move. This commit changes a few references to constr_of_global and replaces them with a constr_of_monomorphic_global which makes it apparent that this is not the function to call to globalize polymorphic references. The remaining parts using constr_of_monomorphic_global are easily identifiable using this: omega, btauto, ring, funind and auto_ind_decl mainly (this fixes firstorder). What this means is that the symbols registered for these tactics have to be monomorphic for now.
2018-10-18[api] Qualify access to `Nametab`Emilio Jesus Gallego Arias
In general, `Nametab` is not a module you want to open globally as it exposes very generic identifiers such as `push` or `global`. Thus, we remove all global opens and qualify `Nametab` access. The patch is small and confirms the hypothesis that `Nametab` access happens in few places thus it doesn't need a global open. It is also very convenient to be able to use `grep` to see accesses to the namespace table.
2018-10-16{Univops->UState}.restrict_universe_contextGaëtan Gilbert
Thus the adhoc univops can be removed at the end of the deprecation period. Should we keep exposing restrict_universe_context or make people go through restrict? restrict_universe_context is used directly only by newring, where it's a choice between let univs = UState.restrict_universe_context univs vars in and let univs = UState.(context_set (restrict (of_context_set univs) vars)) in
2018-10-16{Univops -> Vars}.universes_of_constrGaëtan Gilbert
It's basically an occur check so it makes sense to put it in vars
2018-10-16UnivGen.extend_context -> Univ.extend_in_context_setGaëtan Gilbert
Such a basic function can live in Univ rather than the higher level UnivGen.
2018-10-16Deprecate UnivGen.new_{univ,Type,Type_sort}Gaëtan Gilbert
They are impractical since we need to get the level out to register it afterwards.
2018-10-16Clean UnivGen.fresh_instance APIGaëtan Gilbert
2018-10-16Deprecate univ-dropping UnivGen.new_sort_in_familyGaëtan Gilbert
2018-10-16Simplify UnivGen.type_of_referenceGaëtan Gilbert
2018-10-16UnivGen.constr_of_glob_univ -> Constr.mkRefGaëtan Gilbert
2018-10-16Simplify vars_of_global usageGaëtan Gilbert
2018-10-16Simplify fresh_foo_instance functions and pretyping of univ instanceGaëtan Gilbert
2018-10-16Deprecate Global.universes_of_global (replaced by environ version)Gaëtan Gilbert
2018-10-14A useless occurrence of Global.env.Hugo Herbelin
2018-10-14Removing useless call to Global.env in check_and_clear_in_constr.Hugo Herbelin
2018-10-12Moving local copy fold_constr_with_full_binders in assumptions.ml to constr.ml.Hugo Herbelin
This is to move a standard combinator to the place it belongs to. An alternative could have been to put it in termops.ml, but termops.ml is now about econstr, so, even if it makes the kernel "bigger", constr.ml seems to be the best place for this combinator. After all, this combinator is canonical.
2018-10-07[api] Deprecate `evar_map` ref combinators.Emilio Jesus Gallego Arias
All the `evar_map` APIs were deprecated in 8.9, thus we deprecate the combinators to discourage this style of programming. Still a few places do use imperative style, but they are pretty localized and should be cleaned up separately. As these are the last bits of `e_` API remaining this PR closes #6342.
2018-10-06[api] Remove (most) 8.9 deprecated objects.Emilio Jesus Gallego Arias
A few of them will be of help for future cleanups. We have spared the stuff in `Names` due to bad organization of this module following the split from `Term`, which really difficult things removing the constructors.