aboutsummaryrefslogtreecommitdiffhomepage
path: root/engine/universes.ml
Commit message (Collapse)AuthorAge
* Remove reference name type.Gravatar Maxime Dénès2018-06-18
| | | | | | | | reference was defined as Ident or Qualid, but the qualid type already permits empty paths. So we had effectively two representations for unqualified names, that were not seen as equal by eq_reference. We remove the reference type and replace its uses by qualid.
* Split off Universes functions for minimization.Gravatar Gaëtan Gilbert2018-05-17
| | | | This finishes the splitting of Universes.
* Make Universes.refresh_constraints internal to UStateGravatar Gaëtan Gilbert2018-05-17
|
* Split off Universes functions about substitutions and constraintsGravatar Gaëtan Gilbert2018-05-17
|
* Move solve_constraint_system near its only use site (comInductive)Gravatar Gaëtan Gilbert2018-05-17
|
* Split off Universes functions dealing with generating new universes.Gravatar Gaëtan Gilbert2018-05-17
|
* Split off Universes functions dealing with names.Gravatar Gaëtan Gilbert2018-05-17
| | | | This API is a bit strange, I expect it will change at some point.
* Make set minimization option internal to UniversesGravatar Gaëtan Gilbert2018-05-17
|
* Don't use ref universe_opt_substGravatar Gaëtan Gilbert2018-05-08
|
* [api] Rename `global_reference` to `GlobRef.t` to follow kernel style.Gravatar Emilio Jesus Gallego Arias2018-05-04
| | | | | | | | | | | | | In #6092, `global_reference` was moved to `kernel`. It makes sense to go further and use the current kernel style for names. This has a good effect on the dependency graph, as some core modules don't depend on library anymore. A question about providing equality for the GloRef module remains, as there are two different notions of equality for constants. In that sense, `KerPair` seems suspicious and at some point it should be looked at.
* Fix nf_evars_universes_opt_subst: recurse on univs, nf undef evarsGravatar Gaëtan Gilbert2018-04-28
|
* univ minimization: comment [enforce_uppers]Gravatar Gaëtan Gilbert2018-04-13
|
* univ minimization [enforce_upper]: replace Option.get with matchGravatar Gaëtan Gilbert2018-04-13
|
* univ minimization: Partially let-lift [enforce_uppers]Gravatar Gaëtan Gilbert2018-04-13
|
* univ minimization: rename acc' -> enforce_uppersGravatar Gaëtan Gilbert2018-04-13
|
* univ minimization: use shadowing moreGravatar Gaëtan Gilbert2018-04-13
| | | | | This avoids having multiple highly similar things in scope when we only want one of them.
* univ minimization: let-lift [not_lower]Gravatar Gaëtan Gilbert2018-04-13
|
* univ minimization: simplify try-with block around find_instsGravatar Gaëtan Gilbert2018-04-13
|
* univ minimization: s/[failwith ""]/[raise UpperBoundedAlg]/Gravatar Gaëtan Gilbert2018-04-13
|
* univ minimization: simplify try-with block around [find u left]Gravatar Gaëtan Gilbert2018-04-13
| | | | This makes it clear where the Not_found can come from.
* univ minimization: comment compare_constraint_typeGravatar Gaëtan Gilbert2018-04-13
|
* niv minimization: remove [remove_lower] abbreviationGravatar Gaëtan Gilbert2018-04-13
| | | | | It's not long, used only once and it's easier to understand what it does when it's inlined.
* minimize_univ_variables: bool*bool*univ*lowermap replaced by recordGravatar Gaëtan Gilbert2018-04-13
|
* minimize_univ_variables: remove [and right] abbreviation.Gravatar Gaëtan Gilbert2018-04-13
|
* universe normalisation: put equivalence class partition in UGraphGravatar Gaëtan Gilbert2018-04-13
| | | | ie don't go through having Eq constraints but directly to the unionfind.
* universe minimization: cleanup using standard combinators, open UnivGravatar Gaëtan Gilbert2018-04-13
| | | | eg Constraint.partition + filter instead of a complicated fold.
* [located] Push inner locations in `reference` to a CAst.t node.Gravatar Emilio Jesus Gallego Arias2018-03-09
| | | | | | | | | | | | | | The `reference` type contains some ad-hoc locations in its constructors, but there is no reason not to handle them with the standard attribute container provided by `CAst.t`. An orthogonal topic to this commit is whether the `reference` type should contain a location or not at all. It seems that many places would become a bit clearer by splitting `reference` into non-located `reference` and `lreference`, however some other places become messier so we maintain the current status-quo for now.
* Delayed weak constraints for cumulative inductive types.Gravatar Gaëtan Gilbert2018-03-09
| | | | | | | When comparing 2 irrelevant universes [u] and [v] we add a "weak constraint" [UWeak(u,v)] to the UState. Then at minimization time a weak constraint between unrelated universes where one is flexible causes them to be unified.
* Statically enforce that ULub is only between levels.Gravatar Gaëtan Gilbert2018-03-09
|
* Allow using cumulativity without forcing strict constraints.Gravatar Gaëtan Gilbert2018-03-09
| | | | | | | | | | | | | | | | | | | | | | | | Previously [fun x : Ind@{i} => x : Ind@{j}] with Ind some cumulative inductive would try to generate a constraint [i = j] and use cumulativity only if this resulted in an inconsistency. This is confusingly different from the behaviour with [Type] and means cumulativity can only be used to lift between universes related by strict inequalities. (This isn't a kernel restriction so there might be some workaround to send the kernel the right constraints, but not in a nice way.) See modified test for more details of what is now possible. Technical notes: When universe constraints were inferred by comparing the shape of terms without reduction, cumulativity was not used and so too-strict equality constraints were generated. Then in order to use cumulativity we had to make this comparison fail to fall back to full conversion. When unifiying 2 instances of a cumulative inductive type, if there are any Irrelevant universes we try to unify them if they are flexible.
* Update headers following #6543.Gravatar Théo Zimmermann2018-02-27
|
* [ast] Improve precision of Ast location recognition in serialization.Gravatar Emilio Jesus Gallego Arias2018-02-22
| | | | | | | | | We follow the suggestions in #402 and turn uses of `Loc.located` in `vernac` into `CAst.t`. The impact should be low as this change mostly affects top-level vernaculars. With this change, we are even closer to automatically map a text document to its AST in a programmatic way.
* Simplification: cumulativity information is variance information.Gravatar Gaëtan Gilbert2018-02-10
| | | | | | | | | | | | | | | | | | | | | | | | | Since cumulativity of an inductive type is the universe constraints which make a term convertible with its universe-renamed copy, the only constraints we can get are between a universe and its copy. As such we do not need to be able to represent arbitrary constraints between universes and copied universes in a double-sized ucontext, instead we can just keep around an array describing whether a bound universe is covariant, invariant or irrelevant (CIC has no contravariant conversion rule). Printing is fairly obtuse and should be improved: when we print the CumulativityInfo we add marks to the universes of the instance: = for invariant, + for covariant and * for irrelevant. ie Record Foo@{i j k} := { foo : Type@{i} -> Type@{j} }. Print Foo. gives Cumulative Record Foo : Type@{max(i+1, j+1)} := Build_Foo { foo : Type@{i} -> Type@{j} } (* =i +j *k |= *)
* Moving some universe substitution code out of the kernel.Gravatar Pierre-Marie Pédrot2017-12-30
| | | | | | This code was not used at all inside the kernel, it was related to universe unification that happens in the upper layer. It makes more sense to put it somewhere upper.
* [lib] Rename Profile to CProfileGravatar Emilio Jesus Gallego Arias2017-12-09
| | | | | New module introduced in OCaml 4.05 I think, can create problems when linking with the OCaml toplevel for `Drop`.
* Merge PR #6290: Rename update to set, Fixes #6196Gravatar Maxime Dénès2017-12-07
|\
| * Rename update to set, fixes #6196Gravatar Paul Steckler2017-12-05
| |
* | Proper nametab handling of global universe namesGravatar Matthieu Sozeau2017-12-01
|/ | | | | | | | They are now bound at the library + module level and can be qualified and shadowed according to the usual rules of qualified names. Parsing and printing of universes "u+n" done as well. In sections, global universes are discharged as well, checking that they can be defined globally when they are introduced
* Forbid repeated names in universe binders.Gravatar Gaëtan Gilbert2017-11-25
|
* Universe binders survive sections, modules and compilation.Gravatar Gaëtan Gilbert2017-11-25
|
* Allow local universe renaming in Print.Gravatar Gaëtan Gilbert2017-11-25
|
* Use Maps and ids for universe bindersGravatar Gaëtan Gilbert2017-11-24
| | | | Before sometimes there were lists and strings.
* [api] Another large deprecation, `Nameops`Gravatar Emilio Jesus Gallego Arias2017-11-13
|
* [api] Move structures deprecated in the API to the core.Gravatar Emilio Jesus Gallego Arias2017-11-06
| | | | We do up to `Term` which is the main bulk of the changes.
* [api] Deprecate all legacy uses of Names in core.Gravatar Emilio Jesus Gallego Arias2017-11-06
| | | | This will allow to merge back `Names` with `API.Names`
* Merge PR #688: Binding universe constraints in Definition/Inductive/etc...Gravatar Maxime Dénès2017-09-26
|\
| * Allow declaring universe constraints at definition level.Gravatar Matthieu Sozeau2017-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a "+" modifier for universe and constraint declarations to indicate that these can be extended in the final definition/proof. By default [Definition f] is equivalent to [Definition f@{+|+}], i.e universes can be introduced and constraints as well. For [f@{}] or [f@{i j}], the constraints can be extended, no universe introduced, to maintain compatibility with existing developments. Use [f@{i j | }] to indicate that no constraint (nor universe) can be introduced. These kind of definitions could benefit from asynchronous processing. Declarations of universe binders and constraints also works for monomorphic definitions.
* | Using EConstr equality check in unification.Gravatar Pierre-Marie Pédrot2017-09-08
|/ | | | | | | The code from Universes what essentially a duplicate of the one from EConstr, but they were copied for historical reasons. Now, this is not useful anymore, so that we remove the implementation from Universes and rely on the one from EConstr.
* Removing template polymorphism for definitions.Gravatar Pierre-Marie Pédrot2017-07-26
| | | | | | | | | | | | | The use of template polymorphism in constants was quite limited, as it only applied to definitions that were exactly inductive types without any parameter whatsoever. Furthermore, it seems that following the introduction of polymorphic definitions, the code path enforced regular polymorphism as soon as the type of a definition was given, which was in practice almost always. Removing this feature had no observable effect neither on the test-suite, nor on any development that we monitor on Travis. I believe it is safe to assume it was nowadays useless.
* Merge PR #781: Remove dead code [Universes.simplify_universe_context]Gravatar Maxime Dénès2017-07-17
|\