aboutsummaryrefslogtreecommitdiff
path: root/kernel/univ.ml
AgeCommit message (Collapse)Author
2015-01-12Update headers.Maxime Dénès
2015-01-07Aligning printing of universe constraints.Hugo Herbelin
2014-12-21Dead code in Univ.Pierre-Marie Pédrot
2014-12-18Cleaning up universe list implementation in Univ.Pierre-Marie Pédrot
We use private types to ensure apriori hashconsing, and get rid of the use of recursive modules. The hash of the universe list is also inlined into each node instead of relying on a supplementary indirection.
2014-12-17Ensuring the good invariants of hashcons table generation in the API.Pierre-Marie Pédrot
2014-12-14Fix merging of name maps in union of universe contexts.Matthieu Sozeau
2014-10-02Implement module subtyping for polymorphic constants (errors onMatthieu Sozeau
inductives). The implementation constant should have the a universe instance of the same length, we assume the universes are in the same order and we check that the definition does not add any constraints to the expected ones. This fixes bug #3670.
2014-09-18Clean a bit of univ.ml, add credits.Matthieu Sozeau
2014-09-05Fix checker treatment of inductives using subst_instances instead of ↵Matthieu Sozeau
subst_univs_levels.
2014-09-04Fix bug #3559, ensuring a canonical order of universe level quantifications whenMatthieu Sozeau
introducing constants (e.g. Top.1 is always before Top.2), compatible with the one used before introduction of hMaps in LMap/LSet.
2014-08-30Simplify even further the declaration of primitive projections,Matthieu Sozeau
now done entirely using declare_mind, which declares the associated constants for primitive records. This avoids a hack related to elimination schemes and ensures that the forward references to constants in the mutual inductive entry are properly declared just after the inductive. This also clarifies (and simplifies) the code of term_typing for constants which does not have to deal with building or checking projections anymore. Also fix printing of universes showing the de Bruijn encoding in a few places.
2014-08-18Fix pretty-printing of the graph in Print Sorted Universes. Type.0 was ↵Matthieu Sozeau
larger than Type.1 etc...
2014-08-09Adding a primitive to merge ContextSets which is more efficient when onePierre-Marie Pédrot
of the argument is smaller than the other one.
2014-08-09Cleaning up interface of ContextSet.Pierre-Marie Pédrot
Names and arguments were uniformized, and some functions were redesigned to take their typical use-case into account.
2014-08-04Fixing semantics of Univ.Level.equal.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-31Useless export of Instance.eqeq. We hashcons everything before calling thisPierre-Marie Pédrot
function, so plain pointer equality is sufficient.
2014-07-30Avoid hconsing instances during appends and conversions from/to arrays.Matthieu Sozeau
2014-07-21Universe level maps use HMaps.Pierre-Marie Pédrot
2014-07-21Cleanup substitution inside universe instances, only done through subst_fn now,Matthieu Sozeau
and disable hashconsing of substituted instances which had a huge performance penalty in general. They are hashconsed when put in the environment only now.
2014-07-03Cleanup code related to the constraint solving, which sits now outside theMatthieu Sozeau
kernel in library/universes.ml.
2014-07-03Properly compute the transitive closure of the system of constraintsMatthieu Sozeau
generated by a mutual inductive definition (bug found in CFGV). Actually this code can move out of the kernel.
2014-07-01Add toplevel commands to declare global universes and constraints.Matthieu Sozeau
2014-06-25Fix type_of_inductive_knowing_conclusion, relying on an actually broken ↵Matthieu Sozeau
univ_depends. Also add a missing constraint when generating a fresh universe for a template polymorphic inductive in that case.
2014-06-18Code factorization in LMap.Pierre-Marie Pédrot
2014-06-12Code cleaning in Univ.Pierre-Marie Pédrot
2014-06-11In generalized rewrite, avoid retyping completely and constantly the ↵Matthieu Sozeau
conclusion, and results of unifying the lemma with subterms. Using Retyping.get_type_of instead results in 3x speedup in Ncring_polynom.
2014-06-10Fixing Sorting Universes in a world where le and lt constraints may bePierre-Marie Pédrot
redundant in canonical arcs.
2014-06-10Compute the trace of a universe inconsistency only when explicitly requiredPierre-Marie Pédrot
by the printing options (i.e. when "Print Universes" is set).
2014-06-10Made explanations for universe inconsistencies optional. They are only usedPierre-Marie Pédrot
by the printer anyway.
2014-06-10Specialize the type of [Univ.compare_neq] so that it is clear it is only usedPierre-Marie Pédrot
to recover the trace of a universe inconsistency. Changed its name too btw.
2014-06-10Imperatively check touched universes in compare_neq functions. This ensuresPierre-Marie Pédrot
a O(1) check, contrasting with the previous O(n) behaviour that rendered universe constraint checking prohibitive on big files. I expect a 20% speedup on such files.
2014-06-10- Fix substitution of universes which needlessly hashconsed existing universes.Matthieu Sozeau
- More cleanup. remove unneeded functions in universes
2014-06-10Oops, one refactoring was not compiled.Matthieu Sozeau
2014-06-10More cleanup/reorganizing of univ.ml to separate constraint/universe ↵Matthieu Sozeau
handling from the instance/contexts and substitution code.
2014-06-10Cleanup in Univ, moving code for UniverseConstraints outside the kernel in ↵Matthieu Sozeau
Universes. Needed to exponse compare_head_gen(_leq) so that it could be reused in Universes. Remove unused functions from univ as well and refactor a little bit. Changed the syntax to Type@{} for explicit universe level specs, following the WG decision.
2014-06-10Remove unused function in univMatthieu Sozeau
2014-06-09Flattening Level module structure in Univ.Pierre-Marie Pédrot
2014-06-08Function in Univ uselessly exported.Pierre-Marie Pédrot
2014-06-06Make kernel reduction code parametric over the handling of universes,Matthieu Sozeau
allowing fast conversion to be used during unification while respecting the semantics of unification w.r.t universes. - Inside kernel, checked_conv is used mainly, it just does checking, while infer_conv is used for module subtyping. - Outside, infer_conv is wrapped in Reductionops to register the right constraints in an evarmap. - In univ, add a flag to universes to cache the fact that they are >= Set, the most common constraints, resulting in an 4x speedup in some cases (e.g. HigmanS).
2014-06-05Dedicated map module for type universes. It uses hashmaps, which arePierre-Marie Pédrot
slightly more efficient than plain balanced maps.
2014-06-05Removing dead code from Univ.Pierre-Marie Pédrot
2014-06-04- Force every universe level to be >= Prop, so one cannot "go under" it anymore.Matthieu Sozeau
- Finish the change to level-to-level substitutions, in the checker.
2014-06-04- Fix hashing of levels to get the "right" order in universe contexts etc...Matthieu Sozeau
- Add a tentative syntax for specifying universes: Type{"i"} and foo@{Type{"i"},Type{"j"}}. These are always rigid. - Use level-to-level substitutions where the more general level-to-universe substitutions were previously used.
2014-05-28- Fix for commit 15999903f875f4b5dbb3d5240d2ca39acc3cd777 which disallowed someMatthieu Sozeau
cases of Type (* Prop *) <= Set. - Do check types of metavariables at the end of apply's unification, if it failed at the beginning (otherwise universe constraints can be incomplete).
2014-05-26- Fix in kernel conversion not folding the universe constraintsMatthieu Sozeau
correctly when comparing stacks. - Disallow Type i <= Prop/Set constraints, that would otherwise allow constraints that make a universe lower than Prop. - Fix stm/lemmas that was pushing constraints to the global context, it is done depending on the constant/variable polymorphic status now. - Adapt generalized rewriting in Type code to these fixes.
2014-05-26Update infer_conv to record trivial Prop <= Type i constraints that are ↵Matthieu Sozeau
needed during unification.
2014-05-16Another try at close_proof that should behave better w.r.t. exception handling.Matthieu Sozeau
2014-05-13Rewritten the sorting algorithm for universes with a better complexity.Pierre-Marie Pédrot
This should be now linear instead of the cubic Bellman-Ford algorithm. The new algorithm assumes that the universe graph is a DAG if we remove the {Le, Eq}-cycles, which is the case when the graph is consistent. Luckily we only use the sorting algorithm on such consistent graphs, in the Print Sorted Universes command.
2014-05-06Find a more efficient fix for dealing with template universes:Matthieu Sozeau
eagerly solve l <= k constraints as k := l when k is a fresh variable coming from a template type. This has the effect of fixing the variable at the first instantiation of the parameters of template polymorphic inductive and avoiding to generate useless <= constraints that need to be minimized afterwards.