aboutsummaryrefslogtreecommitdiff
path: root/library/universes.ml
AgeCommit message (Collapse)Author
2016-10-30Moving Universes to the engine/ folder.Pierre-Marie Pédrot
Before this patch, this module was a member of the library folder, which had little to do with its actual use. A tiny part relative to global registering of universe names has been effectively moved to the Global module.
2016-10-24Merge branch 'v8.6'Pierre-Marie Pédrot
2016-10-20Cleanup code according to comments.Matthieu Sozeau
2016-10-20Fix minimization to be insensitive to redundant arcs.Matthieu Sozeau
The new algorithm produces different sets of arcs than in 8.5, hence existing developments may fail to pass now because they relied on the (correct but more approximate) result of minimization in 8.5 which wasn't insensitive. The algorithm works bottom-up on the (well-founded) graph to find lower levels that an upper level can be minimized to. We filter said lower levels according to the lower sets of the other levels we consider. If they appear in any of them then we don't need their constraints. Does not seem to have a huge impact on performance in HoTT, but this should be evaluated further. Adapt test-suite files accordingly.
2016-08-19Make the user_err header an optional parameter.Emilio Jesus Gallego Arias
Suggested by @ppedrot
2016-08-19Remove errorlabstrm in favor of user_errEmilio Jesus Gallego Arias
As noted by @ppedrot, the first is redundant. The patch is basically a renaming. We didn't make the component optional yet, but this could happen in a future patch.
2016-07-03errors.ml renamed into cErrors.ml (avoid clash with an OCaml compiler-lib ↵Pierre Letouzey
module) For the moment, there is an Error module in compilers-lib/ocamlbytecomp.cm(x)a
2016-06-29universes.ml: Minor code cleanupMatthieu Sozeau
2016-06-13Univs: more robust Universe/Constraint decls #4816Matthieu Sozeau
This fixes the declarations of constraints, universes and assumptions: - global constraints can refer to global universes only, - polymorphic universes, constraints and assumptions can only be declared inside sections, when all the section's variables/universes are polymorphic as well. - monomorphic assumptions may only be declared in section contexts which are not parameterized by polymorphic universes/assumptions. Add fix for part 1 of bug #4816
2016-02-13Merge branch 'v8.5'Pierre-Marie Pédrot
2016-02-03Optimizing the universes_of_constr_function.Pierre-Marie Pédrot
Instead of relying on a costly set union, we take advantage of the fact that instances are small compared to the set of universes.
2016-01-21Merge branch 'v8.5'Pierre-Marie Pédrot
2016-01-20Update copyright headers.Maxime Dénès
2015-12-08Merge branch 'v8.5'Pierre-Marie Pédrot
2015-12-03Univs: fix bug #4443.Matthieu Sozeau
Do not substitute rigid variables during minimization, keeping their equality constraints instead.
2015-11-29Merge branch 'v8.5'Pierre-Marie Pédrot
2015-11-27Univs: entirely disallow instantiation of polymorphic constants withMatthieu Sozeau
Prop levels. As they are typed assuming all variables are >= Set now, and this was breaking an invariant in typing. Only one instance in the standard library was used in Hurkens, which can be avoided easily. This also avoids displaying unnecessary >= Set constraints everywhere.
2015-11-27Avoid recording spurious Set <= Top.i constraints which are alwaysMatthieu Sozeau
valid (when Top.i is global and hence > Set).
2015-11-26More efficient implementation of equality-up-to-universes in Universes.Pierre-Marie Pédrot
Instead of accumulating constraints which are not present in the original graph, we parametrize the equality function by a function actually merging those constraints in the current graph. This prevents doing the work twice.
2015-11-26More invariants in UState.Pierre-Marie Pédrot
2015-10-29Merge branch 'v8.5'Pierre-Marie Pédrot
2015-10-28Univs: local names handling.Matthieu Sozeau
Keep user-side information on the names used in instances of universe polymorphic references and use them for printing.
2015-10-27Fix bugs 4389, 4390 and 4391 due to wrong handling of universe namesMatthieu Sozeau
structure.
2015-10-09Merge branch 'v8.5'Pierre-Marie Pédrot
2015-10-08Univs: fix bug #3807Matthieu Sozeau
Add a flag to disallow minimization to set
2015-10-06Splitting kernel universe code in two modules.Pierre-Marie Pédrot
1. The Univ module now only cares about definitions about universes. 2. The UGraph module contains the algorithm responsible for aciclicity.
2015-10-02Univs: refined handling of assumptionsMatthieu Sozeau
According to their polymorphic/non-polymorphic status, which imply that universe variables introduced with it are assumed to be >= or > Set respectively in the following definitions.
2015-10-02Univs: fix minimization to allow lowering a universe to Set, not Prop.Matthieu Sozeau
2015-10-02Univs: minimization, adapt to graph invariants.Matthieu Sozeau
We are forced to declare universes that are global and appear in the local constraints as we start from an empty universe graph.
2015-10-02Forcing i > Set for global universes (incomplete)Matthieu Sozeau
2015-10-02Universes: enforce Set <= i for all Type occurrences.Matthieu Sozeau
2015-07-07Univs/minimization: Fix unused variable bug.Matthieu Sozeau
2015-06-26Fix bug #4254 with the help of J.H. JourdanMatthieu Sozeau
1) We now _assign_ the smallest possible arities to mutual inductive types and eventually add leq constraints on the user given arities. Remove useless limitation on instantiating algebraic universe variables with their least upper bound if they have upper constraints as well. 2) Do not remove non-recursive variables when computing minimal levels of inductives. 3) Avoid modifying user-given arities if not necessary to compute the minimal level of an inductive. 4) We correctly solve the recursive equations taking into account the user-declared level.
2015-06-11Fix bug #3446.Matthieu Sozeau
Wrong handling of algebraic universes that have upper bounds.
2015-05-27Fix bug #4159Matthieu Sozeau
Some asynchronous constraints between initial universes and the ones at the end of a proof were forgotten. Also add a message to print universes indicating if all the constraints are processed already or not.
2015-04-22Tactical `progress` compares term up to potentially equalisable universes.Arnaud Spiwack
Followup of: f7b29094fe7cc13ea475447bd30d9a8b942f0fef . In particular, re-closes #3593. As a side effect, fixes an undiscovered bug of the `eq_constr` tactic which didn't consider terms up to evar instantiation.
2015-04-09Strengthen minimization: it shouldn't set a universe u to a max if itMatthieu Sozeau
has a strict upper bound.
2015-02-24Refactoring in [Constr].Arnaud Spiwack
[compare_head_gen] defined in terms of [compare_head_gen_leq]. Remove an unused argument from [compare_head_gen_leq].
2015-01-17Univs: proper printing of global and local universe names (onlyMatthieu Sozeau
printing functions touched in the kernel).
2015-01-12Update headers.Maxime Dénès
2014-11-23Pass around information on the use of template polymorphism forMatthieu Sozeau
inductive types (i.e., ones declared with an explicit anonymous Type at the conclusion of their arity). With this change one can force inductives to live in higher universes even in the non-fully universe polymorphic case (e.g. bug #3821).
2014-11-10Universes.nf_evars_and_universes_opt_subst substitutes evars eagerly.Pierre-Marie Pédrot
This is a continuation of the previous patch.
2014-10-13library/opaqueTables: enable their use in interactive modeEnrico Tassi
Before this patch opaque tables were only growing, making them unusable in interactive mode (leak on Undo). With this patch the opaque tables are functional and part of the env. I.e. a constant_body can point to the proof term in 2 ways: 1) directly (before the constant is discharged) 2) indirectly, via an int, that is mapped by the opaque table to the proof term. This is now consistent in batch/interactive mode This is step 0 to make an interactive coqtop able to dump a .vo/.vi
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-24Make eq_pattern_test/eq_test work up to the equivalence of primitiveMatthieu Sozeau
projections with their eta-expanded constant form.
2014-08-25Fix computation of dangling constraints at the end of a proof (bug #3531).Matthieu Sozeau
2014-08-25instanciation is French, instantiation is EnglishJason Gross
2014-08-05Small code simplification.Pierre-Marie Pédrot
2014-08-03Move to a representation of universe polymorphic constants using indices for ↵Matthieu Sozeau
variables. Simplifies instantiation of constants/inductives, requiring less allocation and Map.find's. Abstraction by variables is handled mostly inside the kernel but could be moved outside.
2014-07-21More straightforward definition of Universes.add_list_map.Pierre-Marie Pédrot