aboutsummaryrefslogtreecommitdiff
path: root/kernel/term_typing.ml
AgeCommit message (Collapse)Author
2021-03-10Fix kernel incorrectly assuming the "using" hyps are transitively closedGaëtan Gilbert
Fix #13903
2020-08-18Rename VM-related kernel/cfoo files to kernel/vmfooGaëtan Gilbert
2020-07-21Turn various anomalies into regular errors in primitive declaration pathGaëtan Gilbert
2020-07-06Primitive persistent arraysMaxime Dénès
Persistent arrays expose a functional interface but are implemented using an imperative data structure. The OCaml implementation is based on Jean-Christophe Filliâtre's. Co-authored-by: Benjamin Grégoire <Benjamin.Gregoire@inria.fr> Co-authored-by: Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>
2020-03-18Rename Retypeops -> RelevanceopsGaëtan Gilbert
This module used to do retyping for the kernel in prototypes of SProp, but was switched to only relevance inference before the merge.
2020-03-18Update headers in the whole code base.Théo Zimmermann
Add headers to a few files which were missing them.
2020-02-24Do not perform a universe diff when typing opaque constants.Pierre-Marie Pédrot
Apart from being an ugly hack in the kernel, the universe-adding function is already robust to redundant universes anyways.
2019-11-21[coq] Untabify the whole ML codebase.Emilio Jesus Gallego Arias
We also remove trailing whitespace. Script used: ```bash for i in `find . -name '*.ml' -or -name '*.mli' -or -name '*.mlg'`; do expand -i "$i" | sponge "$i"; sed -e's/[[:space:]]*$//' -i.bak "$i"; done ```
2019-10-16Cleaning up the previous code by ensuring statically invariants on opaque ↵Pierre-Marie Pédrot
proofs. We return the typing context directly instead of hiding it into the opaque data, and we take advantage of this to remove a few assertions known to hold statically.
2019-10-16Make explicit the delayed computation of opaque bodies in Term_typing.Pierre-Marie Pédrot
We separate the Term_typing inference API into two functions, one to typecheck just the immediate part of an entry, and another one to check after the fact that a delayed term is indeed a correct proof for an opaque entry. This commit is mostly moving code around, this should be 1:1 semantically.
2019-10-04Remove redundancy in section hypotheses of kernel entries.Pierre-Marie Pédrot
We only do it for entries and not declarations because the upper layers rely on the kernel being able to quickly tell that a definition is improperly used inside a section. Typically, tactics can mess with the named context and thus make the use of section definitions illegal. This cannot happen in the kernel but we cannot remove it due to the code dependency. Probably fixing a soundness bug reachable via ML code only. We were doing fancy things w.r.t. computation of the transitive closure of the the variables, in particular lack of proper sanitization of the kernel input.
2019-07-08Similar purity invariants in the kernel.Pierre-Marie Pédrot
2019-06-27Kernel transparent definition entries have no body universes.Gaëtan Gilbert
2019-06-26Perform the opaque section variable inference outside of the kernel.Pierre-Marie Pédrot
It is not the role of the kernel to decide to force the body of an entry to infer the section variable it uses, but the one of the upper layers. We make this explicit in the type of entries so as to enforce that this inference is performed beforehand. Also removes auxilliary file stuff that doesn't look like it belongs in the kernel either.
2019-06-26Remove dead code for typing of section definitions in kernel.Pierre-Marie Pédrot
All section definitions are always defined as if they were transparent, all the additional checks were actually never triggered.
2019-06-24Remove the unused opaque_entry_inline_code field from opaque entries.Pierre-Marie Pédrot
2019-06-24Enforce that opaque entries carry their type.Pierre-Marie Pédrot
2019-06-24Dedicated type for opaque entries in the kernel.Pierre-Marie Pédrot
Even more invariants can be enforced this way.
2019-06-24Enforce that transparent entries are forced beforehand.Pierre-Marie Pédrot
2019-06-24Take advantage of the change of entry representation to split opacity status.Pierre-Marie Pédrot
Mere isomorphism for now, but will allow more invariants ultimately.
2019-06-17Merge PR #10362: Kernel-side delaying of polymorphic opaque constantsGaëtan Gilbert
Reviewed-by: SkySkimmer Reviewed-by: gares
2019-06-17Update ml-style headers to new year.Théo Zimmermann
2019-06-17Merge universe quantification and delayed constraints in opaque proofs.Pierre-Marie Pédrot
This enforces more invariants statically.
2019-06-17Allow to delay polymorphic opaque constants.Pierre-Marie Pédrot
We had to move the private opaque constraints out of the constant declaration into the opaque table. The API is not very pretty yet due to a pervasive confusion between monomorphic global constraints and polymorphic local ones, but once we get rid of futures in the kernel this should be magically solved.
2019-05-27Fix #10251: Type-checking of polymorphic opaque constr entry types is broken.Pierre-Marie Pédrot
We use the right environment.
2019-05-27Specific code path for opaque polymorphic constants.Pierre-Marie Pédrot
For now this is just a specialized version of the previous generic code. This simplifies tracking of the changes.
2019-05-27Ensure dynamically that non-opaque definitions are always side-effect free.Pierre-Marie Pédrot
It is guaranteed by Declare, but a little dynamic check does not hurt.
2019-05-27Ensure dynamically that opaque definitions come with their type.Pierre-Marie Pédrot
The only lawbreaker was the Add Ring command. We generate a type for the declaration to fix the code.
2019-05-25Centralize the hashconsing of constant declarations.Pierre-Marie Pédrot
Safe_typing is now responsible for hashconsing of all accessible structures, except for opaque terms which are handled by Opaqueproof.
2019-05-20Do not perform the section variable check on global recipes.Pierre-Marie Pédrot
By construction, we know that Cooking is returning the right set of used variables. This set has been checked already once at the time when the definition was performed inside the section.
2019-05-20Ensure statically that declarations built by Term_typing are direct.Pierre-Marie Pédrot
This removes a lot of cruft breaking the opaque proof abstraction in Safe_typing and similar.
2019-03-18Remove Term_typing.translate_mind indirectionGaëtan Gilbert
2019-03-14Repair relevance marks in-kernel.Gaëtan Gilbert
Prevent errors when under annotating binders.
2019-03-14Add relevance marks on binders.Gaëtan Gilbert
Kernel should be mostly correct, higher levels do random stuff at times.
2019-02-17Separate variance and universe fields in inductives.Gaëtan Gilbert
I think the usage looks cleaner this way.
2019-02-04Primitive integersMaxime Dénès
This work makes it possible to take advantage of a compact representation for integers in the entire system, as opposed to only in some reduction machines. It is useful for heavily computational applications, where even constructing terms is not possible without such a representation. Concretely, it replaces part of the retroknowledge machinery with a primitive construction for integers in terms, and introduces a kind of FFI which maps constants to operators (on integers). Properties of these operators are expressed as explicit axioms, whereas they were hidden in the retroknowledge-based approach. This has been presented at the Coq workshop and some Coq Working Groups, and has been used by various groups for STM trace checking, computational analysis, etc. Contributions by Guillaume Bertholon and Pierre Roux <Pierre.Roux@onera.fr> Co-authored-by: Benjamin Grégoire <Benjamin.Gregoire@inria.fr> Co-authored-by: Vincent Laporte <Vincent.Laporte@fondation-inria.fr>
2018-11-23Local universes for opaque polymorphic constants.Gaëtan Gilbert
2018-11-09Force the user to provide names when generating abstract universe contexts.Pierre-Marie Pédrot
For now this data is not stored, but the code checks that indeed the number of names provided coincide with the instance length. I had to reimplement the same kind of workaround hack in section handling as the one already performed in UnivNames because the name information is not present in the section data structure. This deserves a FIXME.
2018-11-09Adding universe names to polymorphic entry instances.Pierre-Marie Pédrot
2018-10-19Explicitly merge contexts in side-effect universe handling.Pierre-Marie Pédrot
Instead of threading the universe state and making it grow, we make clear in the signature that the differed side-effects generate constraints to be added.
2018-10-19Move side-effect typing into Safe_env.Pierre-Marie Pédrot
This reduces the attack surface of the API, as actually there is only a back and forth between the two modules, and side-effects validity certificates are intuitively nothing more than safe environments.
2018-10-05[kernel] Remove section paths from `KerName.t`Maxime Dénès
We remove sections paths from kernel names. This is a cleanup as most of the times this information was unused. This implies a change in the Kernel API and small user visible changes with regards to tactic qualification. In particular, the removal of "global discharge" implies a large cleanup of code. Additionally, the change implies that some machinery in `library` and `safe_typing` must now take an `~in_section` parameter, as to provide the information whether a section is open or not.
2018-09-26Merge PR #8534: Checking if low-level name printers are used on purpose or notMaxime Dénès
2018-09-24[kernel] Compile with almost all warnings enabled.Emilio Jesus Gallego Arias
This is a partial resurrection of #6423 but only for the kernel. IMHO, we pay a bit of price for this but it is a good safety measure. Only warning "4: fragile pattern matching" and "44: open hides a type" are disabled. We would like to enable 44 for sure once we do some alias cleanup.
2018-09-23Checking if low-level name printers are used on purpose or not.Hugo Herbelin
In particular we check if really used for internal debugging purpose or to display a message to the user. In the latter case, we replace it (when possible) by a higher-level printer (e.g. printing foo instead of Top.foo). In the former case, we clarify that the use is a debugging use. Still not perfect (see a few FIXME).
2018-09-13Avoid repeat universe declarations for constants with split univsGaëtan Gilbert
2018-09-03Merge PR #7912: Simplify effects APIMaxime Dénès
2018-07-03Term_typing: remove unused argument to internal function.Gaëtan Gilbert
The function is defined with a typo but called with the same env that is mistakenly not shadowed. An alternative to this commit would be to fix the typo.
2018-07-03Cooking.cook_constant: remove unused env argument.Gaëtan Gilbert
Unused since d95306323 (remove template polymorphic definitions).
2018-06-24Further cleaning of the side-effect API.Pierre-Marie Pédrot
We remove internal functions and types from the API.