aboutsummaryrefslogtreecommitdiff
path: root/kernel/cClosure.ml
AgeCommit message (Collapse)Author
2021-01-18Merge PR #13454: Remove unused retro_reflPierre-Marie Pédrot
Reviewed-by: ppedrot
2021-01-04Remove redundant univ and parameter info from CaseInvertGaëtan Gilbert
2021-01-04Change the representation of kernel case.Pierre-Marie Pédrot
We store bound variable names instead of functions for both branches and predicate, and we furthermore add the parameters in the node. Let bindings are not taken into account and require an environment lookup for retrieval.
2020-12-09Optimization: take advantage that we don't use arrays anymore in substitutions.Pierre-Marie Pédrot
2020-11-23Remove unused retro_reflGaëtan Gilbert
2020-11-21Rename the confusing neutral annotation in CClosure.Pierre-Marie Pédrot
The Norm name was confusing enough to have introduced a few kernel bugs, so it deserved to be changed as suggested in #13274. Contrarily to what it seemingly meant, it was actually standing for neutral terms rather than normal ones. I have kept the 4-letter naming scheme for simplicity and renamed it into Ntrl.
2020-11-13Remove unused CClosure.FNativeEntries.farrayGaëtan Gilbert
BTW it was incorrect (array needs an instance)
2020-11-03Add a fast path in CClosure stack zipping.Pierre-Marie Pédrot
No need to zip the stack if the machine has made no progress.
2020-10-26Yet another normal / neutral bug in primitive conversion.Pierre-Marie Pédrot
By no means a float is a neutral value. When put inside a Zprimitive context it can trigger computation.
2020-10-26Fix bug in conversion of primitive values.Pierre-Marie Pédrot
A partially applied primitive was considered CClosure.Norm, i.e. neutral. But this is not true, because substituting this term as the head of an application may trigger further reduction. In this respect, primitive functions behave like fixpoints.
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-07-01UIP in SPropGaëtan Gilbert
2020-04-06Use lists instead of arrays in evar instances.Pierre-Marie Pédrot
This corresponds more naturally to the use we make of them, as we don't need fast indexation but we instead keep pushing terms on top of them.
2020-04-03Be cleverer and do not hopelessly rezip a term when not needed.Pierre-Marie Pédrot
A quick analysis showed that most of the calls to whd do not lead to a term which further triggers reduction, so there is no point in refolding a potentiall huge term for no reason.
2020-03-18Update headers in the whole code base.Théo Zimmermann
Add headers to a few files which were missing them.
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-11-01Implement classify on primitive floatPierre Roux
2019-11-01Change return type of primitive float comparisonPierre Roux
Replace `option comparison` with `float_comparison` (:= `FEq | FLt | FGt | FNotComparable`) as suggested by Guillaume Melquiond to avoid boxing and an extra match when using primitive float comparison.
2019-11-01Add primitive float computation in Coq kernelGuillaume Bertholon
Beware of 0. = -0. issue for primitive floats The IEEE 754 declares that 0. and -0. are treated equal but we cannot say that this is true with Leibniz equality. Therefore we must patch the equality and the total comparison inside the kernel to prevent inconsistency.
2019-07-25Mark primitives integer as able to participate in reductions (fixes #10560).Guillaume Melquiond
The documentation states: - Norm means the term is fully normalized and cannot create a redex when substituted - Cstr means the term is in head normal form and that it can create a redex when substituted (i.e. constructor, fix, lambda)
2019-07-16Move unfold_side_flags CClosure -> Tacred internalsGaëtan Gilbert
2019-06-17Update ml-style headers to new year.Théo Zimmermann
2019-05-23Fixing typos - Part 2JPR
2019-05-19Make the type of constant bodies parametric on opaque proofs.Pierre-Marie Pédrot
2019-03-14Put [@inline] on CClosure.Mark functionsGaëtan Gilbert
2019-03-14mutable relevance marks in fconstrGaëtan Gilbert
2019-03-14Enable proof irrelevance for SProp.Gaëtan Gilbert
2019-03-14Add relevance marks on binders.Gaëtan Gilbert
Kernel should be mostly correct, higher levels do random stuff at times.
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-12-23Remove dead code from CClosure.Pierre-Marie Pédrot
It seems that it was a remnant of a time where Reductionops would share the same data types.
2018-11-20Use a closure for the domain argument of FProd.Pierre-Marie Pédrot
The use of a term is not needed for the fast typing algorithm of the application case, so this tweak brings the best of both worlds.
2018-11-20Do not wrap FProd return types in a closure.Pierre-Marie Pédrot
There is little point to this as the type is dependent on an open value and is never computed further.
2018-11-19Rename TranspState into TransparentState.Pierre-Marie Pédrot
2018-11-19Proper record type and accessors for transparent states.Pierre-Marie Pédrot
This is documented in dev/doc/changes.md.
2018-11-19Move transparent_state to its own module.Pierre-Marie Pédrot
2018-10-31Merge PR #8752: Enable fragile pattern warning in cclosureMaxime Dénès
2018-10-17Enable fragile pattern warning in cclosureGaëtan Gilbert
This file is already mostly in the required style so I wanted to see what it looks like. For a couple matches I locally disabled the warning as it was too annoying otherwise (`when` clauses are especially annoying). There are a couple places where I think it clearly looks better (eg assoc_defined at the beginning of the file) but overall I'm not all that convinced. What do other people think?
2018-10-11Clean up CClosure code.Pierre-Marie Pédrot
We take advantage of the separation of implementation from CBV to remove constant code.
2018-10-11The cbv reduction does not rely on the kernel info data structure anymore.Pierre-Marie Pédrot
2018-10-04Remove FCast from CClosure.fterm.Pierre-Marie Pédrot
Just like in the Sixth Sense, it turns out it was dead code all along.
2018-09-26Inline the definition of CClosure.mk_clos_deep.Pierre-Marie Pédrot
An important part of this function was dead code, due to the fact it was only used for whd evaluation of specific shapes of constr.
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-07-26Turn the kernel reduction sharing flag into an argument passed in the cache.Pierre-Marie Pédrot
We move the global declaration of that argument to the environment, and reuse the Global module to handle this flag. Note that the checker was not using this flag before this patch, and still doesn't use it. This should probably be fixed in a later patch.
2018-07-24Projections use index representationGaëtan Gilbert
The upper layers still need a mapping constant -> projection, which is provided by Recordops.
2018-06-27Swapping Context and Constr: defining declarations on constr in Constr.Hugo Herbelin
This shall eventually allow to use contexts of declarations in the definition of the "Case" constructor. Basically, this means that Constr now includes Context and that the "t" types of Context which were specialized on constr are not defined in Constr (unfortunately using a heavy boilerplate).
2018-06-23Using more general information for primitive records.Pierre-Marie Pédrot
This brings more compatibility with handling of mutual primitive records in the kernel.
2018-06-17Faster and cleaner fconstr-to-constr conversion function.Pierre-Marie Pédrot
We untangle the implementation in several ways. - No higher-order self argument function as there is only one caller. - Compute composition of lifts + substitution on terms using a dedicated function instead of mk_clos followed by to_constr. - Take more advantage of identity substitutions.
2018-06-04Merge PR #7418: Actually take advantage of the normalization status of ↵Maxime Dénès
kernel closures.
2018-05-28Unify pre_env and envMaxime Dénès
We now have only two notions of environments in the kernel: env and safe_env.
2018-05-23Exporting Fun1 within Array so that Array.Fun1 and not only CArray.Fun1 works.Hugo Herbelin