aboutsummaryrefslogtreecommitdiff
path: root/library
AgeCommit message (Collapse)Author
2019-11-01Declare type of primitives in CPrimitivesPierre Roux
Rather than in typeops
2019-10-24[library] [nit] Remove unnecessary type alias.Emilio Jesus Gallego Arias
2019-10-16Split the function used to declare side-effects from the standard one.Pierre-Marie Pédrot
This ensures that side-effect declarations come with their body, in prevision of the decoupling of the Safe_typign API for CEP 40.
2019-10-14Remove obj_sec field of Nametab.obj_prefix record.Gaëtan Gilbert
There are no more users.
2019-10-14Use kernel info from Global for Lib.sections_{depth,are_opened}Gaëtan Gilbert
2019-10-14Remove [in_section] arguments to Safe_typing functionsGaëtan Gilbert
The information is already there. At some point we may want to clean up the Lib API to reduce redundancy wrt kernel functions like [sections_are_opened], but I'm not doing now as it would conflict with https://github.com/coq/coq/pull/10670
2019-10-05Remove "is_polymorphic_univ" checks in upper layers.Gaëtan Gilbert
There were 2: - when declaring a constraint to avoid monomorphic constraint referring to polymorphic univs, this check is redundant with the check in Section.ml - when declaring a universe context to avoid redeclaring universes, this is not necessary after recent commits.
2019-10-04Merge PR #10798: Loosen restrictions on mixing universe mono/polymorphism in ↵Pierre-Marie Pédrot
sections Reviewed-by: ppedrot
2019-10-03Merge PR #10727: [library] Move `Declaremods` to `vernac/`Pierre-Marie Pédrot
Ack-by: SkySkimmer Reviewed-by: herbelin Reviewed-by: ppedrot
2019-10-02Loosen restrictions on mixing universe mono/polymorphism in sectionsGaëtan Gilbert
We disallow adding univ constraints wich refer to polymorphic universes, and monomorphic constants and inductives when polymorphic universes or constraints are present. Every other combination is already correctly discharged by the kernel.
2019-09-26Implement section discharging inside kernel.Pierre-Marie Pédrot
This patch is minimalistic, insofar as it is only untying the dependency loop between Declare and Safe_typing. Nonetheless, it is already quite big, thus we will polish it afterwards.
2019-09-25Move the Lib section data into the kernel.Pierre-Marie Pédrot
Due to the redundancy with some other declaration-specific data from the kernel, we also seize the opportunity to clean it up. Note also that discharging is still performed outside of the kernel for now.
2019-09-25Stub code for handling sections in kernel.Pierre-Marie Pédrot
For now we only keep a count of the number of open sections, discriminating between polymorphic and monomorphic ones.
2019-09-25Refine the API to declare section-local universes.Pierre-Marie Pédrot
The section local universes are undoubtedly ordered, but the API was requiring an unordered ContextSet. We also move the naming one level up. Unfortunately, some callers are currently defining the same polymorphic universes in a section several times, notably the "Variable" command. I had to hack around this behaviour.
2019-09-18[library] Move `Declaremods` to `vernac/`Emilio Jesus Gallego Arias
We move `Declaremods` to the vernac layer as it implement vernac-specific logic to manipulate modules which moreover is highly imperative. This forces code [such as printing] to manipulate the _global imperative_ state which is a bit fishy. The key improvement in this PR is that now `Global` is not used anymore in `library`, so we can proceed to move it upwards. This move is a follow-up of #10562 and a step towards moving `Global` upper, likely to `interp` in the short term.
2019-09-16Optimize multiple importsMaxime Dénès
2019-09-16Optimize `Include`d `Export`sMaxime Dénès
2019-09-16Turn `module_objects` into a recordMaxime Dénès
2019-09-16Optimize module ExportsMaxime Dénès
This should compensate the removal of the library-level optimization, while maintaining correct behavior.
2019-09-16Do not cache objects when importing modulesMaxime Dénès
They have been already cached at loading time.
2019-09-16Specialize `ImportObject` to `Export`Maxime Dénès
`Import` does not actually need to register an object, only `Export` does. So we specialize and rename the object into `ExportObject`.
2019-09-16`do_modtype` -> `load_modtype`Maxime Dénès
2019-09-04Merge PR #10612: Fix feedback levelsEmilio Jesus Gallego Arias
Ack-by: ejgallego Reviewed-by: gares
2019-09-02Merge PR #10562: [library] Move library to vernacMaxime Dénès
Reviewed-by: maximedenes
2019-08-30[library] Move library to vernacEmilio Jesus Gallego Arias
This is step 1 on removing library state from the lower layers. Here we move library loading to the vernacular layer; few things depend on it: - printers: we add a parameter for those needing to access on-disk data, - coqlib: indeed a few tactics do try to check that a particular library is loaded; this is a tricky part. I've replaced that for a module name check, but indeed this is fully equivalent due to side-effects of `Require`. We may want to think what to do here. A few other minor code movements were needed, but there are self-explanatory.
2019-08-29Make sure that all query commands return a notice (not an info) feedbackMaxime Dénès
As documented in the feedback API.
2019-08-26Make kernel parametric on the lowest universe and fix #9294Matthieu Sozeau
This could be Prop (for compat with usual Coq), Set (for HoTT), or actually an arbitrary "i". Take lower bound of universes into account in pretyping/engine Reinstate proper elaboration of SProp <= l constraints: replacing is_small with equality with lbound is _not_ semantics preserving! lbound = Set Elaborate template polymorphic inductives with lower bound Prop This will make more constraints explicit Check univ constraints with Prop as lower bound for template inductives Restrict template polymorphic universes to those not bounded from below Fixes #9294 fix suggested by Matthieu Try second fix suggested by Matthieu Take care of modifying elaboration for record declarations as well. Rebase and export functions for debug Remove exported functions used while debugging Add a new typing flag "check_template" and option "-no-template-checl" This parameterizes the new criterion on template polymorphic inductives to allow bypassing it (necessary for backward compatibility). Update checker to the new typing flags structure Switch on the new template_check flag to allow old unsafe behavior in indTyping. This is the only change of code really impacting the kernel, together with the commit implementing unbounded from below and parameterization by the lower bound on universes. Add deprecated option `Unset Template Check` allowing to make proof scripts work with both 8.9 and 8.10 for a while Fix `Template Check` option name and test it Add `Unset Template Check` to Coq89.v Cooking of inductives and template-check tests Cleanup test-suite file for template check / universes(template) flags cookind tests Move test of `Unset Template Check` to the failure/ dir, but comment it for now Template test-suite test explanation Overlays for PR 9918 Overlay for paramcoq Add overlay for fiat_parsers (-no-template-check) Add overlay for fiat_crypto_legacy Update fiat-crypto legacy overlay Now it points at the version that I plan on merging; I am hoping that doing this will guard against mistakes by adding an extra check that the target tested by Coq's CI on this branch works with the change I made. Remove overlay that should no longer be necessary The setting in the compat file should handle it Remove now-merged fiat-crypto-legacy overlay Update `Print Assumptions` to reflect the typing flag for template checking Fix About and Print Assumptions for template poly, giving info on which variables are actually polymorphic Fix pretty printing to print global universe levels properly Fix printing of template polymorphic universes Fix pretty printing for template polymorphism on no universe Fix interaction of template check and universes(template) flag Fix indTyping to really check if there is any point in polymorphism: the conclusion sort should be parameterized over at least one local universe Indtyping fixes for template polymorphic Props Allow explicit template polymorphism again Adapt to new indTyping interface Handle the case of template-polymorphic on no universes correctly (morally Type0m univ represented as Prop). Fix check of meaningfullness of template polymorphism in the kernel. It is now done w.r.t the min_univ, the minimal universe inferred for the inductive/record type, independently of the user-written annotation which must only be larger than min_univ. This preserves compatibility with UniMath and template-polymorphism as it has been implemented up-to now. Comment on identity non-template-polymorphism Remove incorrect universes(template) attributes from ssr simpl_fun can be meaningfully template-poly, as well as pred_key (although the use is debatable: it could just as well be in Prop). Move `fun_of_simpl` coercion declaration out of section to respect uniform inheritance Remove incorrect uses of #[universes(template)] from the stdlib Extraction of micromega changes due to moving an ind decl out of a section Remove incorrect uses of #[universes(template)] from plugins Fix test-suite files, removing incorrect #[universes(template)] attributes Remove incorrect #[universes(template)] attributes in test-suite Fix test-suite Remove overlays as they have been merged upstream.
2019-08-23Merge PR #10665: [api] Move handling of variable implicit data to impargsGaëtan Gilbert
Reviewed-by: SkySkimmer
2019-08-21Merge PR #10666: [api] Move `Keys` to pretypingEnrico Tassi
Reviewed-by: gares Reviewed-by: ppedrot
2019-08-19[api] Move handling of variable implicit data to impargsEmilio Jesus Gallego Arias
We move `binder_kind` to the pretyping AST, removing the last data type in the now orphaned file `Decl_kinds`. This seems a better fit, as this data is not relevant to the lower layers but only used in `Impargs`. We also move state keeping to `Impargs`, so now implicit declaration must include the type. We also remove a duplicated function.
2019-08-18[api] Move `Keys` to pretypingEmilio Jesus Gallego Arias
This file is unrelated to library, but to pretyping/unification. This commit, along with others already submitted go towards the goal of `library` containing only the handling of library objects.
2019-08-16Set/Unset commands for typing flagsSimonBoulier
2019-07-31Specialize the section API.Pierre-Marie Pédrot
We split the function used to retrieve the local context from the one used to provide the implicit status of each binder. Most of the users only rely on the former indeed.
2019-07-31Remove the universe part from the section variable mechanism.Pierre-Marie Pédrot
It was factorized away with the universe declaration entry. Actually, pomlymorphic universes were declared twice in Declare, once as a context extension, once as part of the variable itself.
2019-07-31Code simplification in Lib section handling.Pierre-Marie Pédrot
Many invariants were implicit in the code, we make them explicit using dedicated datatypes.
2019-07-18Remove dead code in Lib.Pierre-Marie Pédrot
The polymorphic flag is now carried by the section rather than individual variables, no need to pass it along.
2019-07-18Attach the universe polymorphic status to sections.Pierre-Marie Pédrot
The previous implementation allowed to dynamically decide whether a section would be monomorphic or polymorphic at the first definition of a variable or a constraint. Instead of relying on this delayed decision, we set the universe polymorphic property directly at the time of the section definition.
2019-07-18Use a dedicated data structure for section representation in Lib.Pierre-Marie Pédrot
2019-07-11Merge PR #10498: [api] Deprecate GlobRef constructors.Gaëtan Gilbert
Reviewed-by: SkySkimmer Ack-by: ppedrot
2019-07-08[api] Deprecate GlobRef constructors.Emilio Jesus Gallego Arias
Not pretty, but it had to be done some day, as `Globnames` seems to be on the way out. I have taken the opportunity to reduce the number of `open` in the codebase. The qualified style would indeed allow us to use a bit nicer names `GlobRef.Inductive` instead of `IndRef`, etc... once we have the tooling to do large-scale refactoring that could be tried.
2019-07-08[core] [api] Support OCaml 4.08Emilio Jesus Gallego Arias
The changes are large due to `Pervasives` deprecation: - the `Pervasives` module has been deprecated in favor of `Stdlib`, we have opted for introducing a few wrapping functions in `Util` and just unqualified the rest of occurrences. We avoid the shims as in the previous attempt. - a bug regarding partial application have been fixed. - some formatting functions have been deprecated, but previous versions don't include a replacement, thus the warning has been disabled. We may want to clean up things a bit more, in particular w.r.t. modules once we can move to OCaml 4.07 as the minimum required version. Note that there is a clash between 4.08.0 modules `Option` and `Int` and Coq's ones. It is not clear if we should resolve that clash or not, see PR #10469 for more discussion. On the good side, OCaml 4.08.0 does provide a few interesting functionalities, including nice new warnings useful for devs.
2019-07-04Merge PR #10461: Simplify Declare.declare_variableEmilio Jesus Gallego Arias
Reviewed-by: ejgallego Reviewed-by: maximedenes Reviewed-by: ppedrot
2019-07-04Merge PR #10359: Remove dependency of native_compile on global env for symbolsMaxime Dénès
Reviewed-by: maximedenes Reviewed-by: ppedrot
2019-07-03Safe_typing.push_named_assum: don't take universesGaëtan Gilbert
The caller should push them first
2019-07-03Simplify (restrict_path 0 sp) -> (make_path DirPath.empty id)Gaëtan Gilbert
This is the only use of restrict_path so we just remove it. The name collision between Libnames.make_path (takes a dirpath) and Lib.make_path (uses current module+section path) is a bit awkward...
2019-07-03Merge PR #10442: Reify libobject containersEmilio Jesus Gallego Arias
Reviewed-by: ejgallego Reviewed-by: ppedrot
2019-07-01[api] Reduce declare_kinds even more.Emilio Jesus Gallego Arias
We remove two flags that were seldom used in favor of named parameters.
2019-07-01[api] Refactor most of `Decl_kinds`Emilio Jesus Gallego Arias
We move the bulk of `Decl_kinds` to a better place [namely `interp/decls`] and refactor the use of this information quite a bit. The information seems to be used almost only for `Dumpglob`, so it certainly should end there to achieve a cleaner core. Note the previous commits, as well as the annotations regarding the dubious use of the "variable" data managed by the `Decls` file. IMO this needs more work, but this should be a good start.
2019-06-28Reify libobject containersMaxime Dénès
We make a few libobject constructions (Module, Module Type, Include,...) first-class and rephrase their handling in direct style (removing the inversion of control). This makes it easier to define iterators over objects without hacks like inspecting the tags of dynamic objects.
2019-06-25Merge PR #10316: [lemmas] Reify info for implicits, universe decls, and rec ↵Pierre-Marie Pédrot
theorems. Reviewed-by: SkySkimmer Ack-by: ejgallego Reviewed-by: gares Reviewed-by: ppedrot