aboutsummaryrefslogtreecommitdiff
path: root/kernel
AgeCommit message (Collapse)Author
2020-11-13Make the universe of primitive arrays irrelevantGaëtan Gilbert
Fix #13354 This change is very specific to array, but should not be a significant obstacle to generalization of the feature to eg axioms if we want to later.
2020-11-13Remove unused CClosure.FNativeEntries.farrayGaëtan Gilbert
BTW it was incorrect (array needs an instance)
2020-11-12Merge PR #13351: Fixes #13349: accept Search on subparts of an identifier, ↵coqbot-app[bot]
not only on subidentifiers of an identifier Reviewed-by: Zimmi48
2020-11-12Merge the Linked and LinkedInteractive constructors.Pierre-Marie Pédrot
There was not any difference between those after the cleanup patches that come before.
2020-11-12Statically ensure that the native interactive flag is always set to true.Pierre-Marie Pédrot
It was a hidden invariant of the code.
2020-11-12Statically ensure that native update locations are of form Linked*.Pierre-Marie Pédrot
2020-11-12Fix #13330: Kernel messes with polymorphic side-effects.Pierre-Marie Pédrot
Polymorphic side-effects generated in monomorphic mode would be counted towards trusted subcomponents. This would allow to make ill-typed terms pass as legitimate by mimicking the shape of the inlining of monomorphic side-effects in such a proof.
2020-11-11Addressing #13349: accept Search on subparts of ident, not only on subidents.Hugo Herbelin
2020-11-09Remove the native symbol registering from the safe environment.Pierre-Marie Pédrot
Instead we store that data in the native code that was generated in adapt the compilation scheme accordingly. Less indirections and less imperative tinkering makes the code safer. The global symbol table was originally introduced in #10359 as a way not to depend on the Global module in the generated code. By storing all the native-related information in the cmxs file itself, this PR also makes other changes easier, such as e.g. #13287.
2020-11-04Merge PR #13193: [build] [native] Don't assume installed native libraries ↵coqbot-app[bot]
are in custom output path Reviewed-by: maximedenes Reviewed-by: herbelin
2020-11-03Eagerly reduce rigid/flex conversion problems.Pierre-Marie Pédrot
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-11-02Merge PR #13274: Fix two bugs in conversion of primitive valuescoqbot-app[bot]
Reviewed-by: SkySkimmer
2020-11-02Merge PR #13273: universes_of_constr: don't ignore CaseInvert universesPierre-Marie Pédrot
Reviewed-by: ppedrot
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-10-26universes_of_constr: don't ignore CaseInvert universesGaëtan Gilbert
Not sure if we can get a bug from this omission.
2020-10-21Add missing deprecations in Projection API.Pierre-Marie Pédrot
2020-10-21Document the signatures of quotient names in the API.Pierre-Marie Pédrot
2020-10-21Introduce the missing dual name quotient modules in Environ.Pierre-Marie Pédrot
2020-10-21Code factorization in Names.Pierre-Marie Pédrot
We introduce a module type not to have to redeclare CanOrd, UserOrd and SyntacticOrd all over the place.
2020-10-21Similar introduction of a Construct module in the Names API.Pierre-Marie Pédrot
2020-10-21Introduce an Ind module in the Names API.Pierre-Marie Pédrot
This is similar to Constant and MutInd but for some reason this was was never done. Such a patch makes the whole API more regular. We also deprecate the legacy aliases.
2020-10-21Rename the GlobRef comparison modules following the standard pattern.Pierre-Marie Pédrot
2020-10-21Same little game with Projection.Pierre-Marie Pédrot
2020-10-21Deprecate the non-qualified equality functions on kerpairs.Pierre-Marie Pédrot
This allows to quickly spot the parts of the code that rely on the canonical ordering. When possible we directly introduce the quotient-aware versions.
2020-10-21Introduce a dummy name quotient API.Pierre-Marie Pédrot
For now it does not do anything but eventually it should be used to replace the reliance on canonical names for dual kerpairs such as e.g. constants and inductive types.
2020-10-21Merge PR #12955: Reroot primitive arrays on accesscoqbot-app[bot]
Reviewed-by: maximedenes
2020-10-19Merge PR #13151: Remove the compare_graph field from the conversion API.coqbot-app[bot]
Reviewed-by: SkySkimmer
2020-10-14[build] [native] Don't assume installed native libraries are in custom ↵Emilio Jesus Gallego Arias
output path In #11581 we introduced the `-native-output-dir` option to allow the build system to redirect the output of the native compiler. Unfortunately that patch also modified the default loadpath, which is now buggy if a library with native is installed. We thus revert the change to the loadpath handling, so for now additional native build paths have to be passed with `-nI`. Note that unfortunately in `link_library` we don't know if the required library is coming from the build dir or from an installed dir, as this information is generated from `Require` statements in `Library.get_used_load_paths`. We thus check and give priority to files in the build location. As to make the patch backportable I introduced an extra `stat` system call which should not be problematic as the cache will be hot for the second call. An alternative would be actually to modify loadpath compilation in `call_compiler` so both include paths would be added if `output_dir` is not the default, however that seems pretty noisy given the large path set returned by `!get_load_paths`.
2020-10-14Merge PR #13147: Use OCaml floating-point operations on 64 bits archcoqbot-app[bot]
Reviewed-by: erikmd Reviewed-by: silene
2020-10-12Merge PR #13156: Store the resolver of required modules as functor ↵coqbot-app[bot]
parameters in safe_env Reviewed-by: herbelin
2020-10-12Merge PR #12449: Minimize Prop <= i to i := Setcoqbot-app[bot]
Reviewed-by: mattam82 Ack-by: Janno Ack-by: gares
2020-10-11Similarly remove the explicit graph argument in the ~evar conversion API.Pierre-Marie Pédrot
2020-10-11Pick the universe graph out of the environment in conversion API.Pierre-Marie Pédrot
2020-10-11Remove the compare_graph field from the conversion API.Pierre-Marie Pédrot
We know statically that the first thing the conversion algorithm is going to do is to get it from the provided function, so we simply explicitly pass it around.
2020-10-09Merge PR #13143: Drop misleading argument of Pp.h boxcoqbot-app[bot]
Reviewed-by: ejgallego Reviewed-by: silene
2020-10-09No bidirectionality when expected type for lambda is an evar.Gaëtan Gilbert
This fixes #12623 (bidirectionality breaks impredicativity).
2020-10-09Merge PR #13087: Put type-in-type flag in ugraph.Pierre-Marie Pédrot
Reviewed-by: ppedrot
2020-10-09Store the resolver of required modules as functor parameters in safe_env.Pierre-Marie Pédrot
The safe environment features two different sets of delta resolvers, one for module parameters and one for the actual body of the module being built. The purpose of this separations seems to have been to reduce the number of name equations being added to the environment, since the one from the parameters would already be present at instanciation time. Semantically, required modules behave like parameters in this respect, i.e. delta resolvers that come from modules dependend upon are guaranteed to be added when that module is actually required. As such, there is no need to store the quotient coming from the dependencies inside the vo file of a given library. Yet, the previous code would precisely do that, leading to a potential quadratic blowup in vo file size, similarly to the issue with vio files storing the whole chain of dependency. This patch fixes the issue simply by segregating those redundant constraints in the dedicated field, thus dropping them from the vo.
2020-10-08Dropping the misleading int argument of Pp.h.Hugo Herbelin
An h-box inhibits the breaking semantics of any cut/spc/brk in the enclosed box. We tentatively replace its occurrence by an h or hv, assuming in particular that if the indentation is not 0, an hv box was intended.
2020-10-08Remove occurrences of Parray.reroot.Guillaume Melquiond
2020-10-08Reroot primitive arrays on access (fix #12947).Guillaume Melquiond
Semi-persistent arrays are supposed to have amortized O(1) complexity. This commit ensures it, without forcing the user to litter its functions with explicit calls to reroot. This commit also makes rerootk faster by carrying the array along the dependency chain rather than recomputing it at every step.
2020-10-06Use OCaml floating-point operations on 64 bits archPierre Roux
C functions were used for floating-point arithmetic operations, by fear of double rounding that could happen on old x87 on 32 bits architecture. This commit uses OCaml floating-point operations on 64 bits architectures. The following snippet is made 17% faster by this commit. From Coq Require Import Int63 BinPos PrimFloat. Definition foo n := let eps := sub (next_up one) one in Pos.iter (fun x => add x eps) two n. Time Eval native_compute in foo 1000000000.
2020-10-02{new,setoid_}ring -> ringMaxime Dénès
I believe this renaming makes it easier for new contributors to discover the code of `ring`.
2020-09-28Put type-in-type flag in ugraph.Gaëtan Gilbert
Fix #13086.
2020-09-22Use the closure tag for accumulators.Guillaume Melquiond
The first field of accumulators points out of the OCaml heap, so using closures instead of tag-0 objects is better for the GC. Accumulators are distinguished from closures because their code pointer necessarily is the "accumulate" address, which points to an ACCUMULATE instruction.
2020-09-22Use the same memory layout as closures for accumulators.Guillaume Melquiond
That way, accumulators again can be used directly as execution environments by the bytecode interpreter. This fixes the issue of the first argument of accumulators being dropped when strongly normalizing.
2020-09-22Modify bytecode representation of closures to please OCaml's GC (fix #12636).Guillaume Melquiond
The second field of a closure can no longer be the value of the first free variable (or another closure of a mutually recursive block) but must be an offset to the first free variable. This commit makes the bytecode compiler and interpreter agnostic to the actual representation of closures. To do so, the execution environment (variable coq_env) no longer points to the currently executed closure but to the last one. This has the following consequences: - OFFSETCLOSURE(n) now always loads the n-th closure of a recursive block (counted from last to first); - ENVACC(n) now always loads the value of the n-th free variable. These two changes make the bytecode compiler simpler, since it no longer has to track the relative position of closures and free variables. The last change makes the interpreter a bit slower, since it has to adjust coq_env when executing GRABREC. Hopefully, cache locality will make the overhead negligible.
2020-09-04Merge PR #12912: Fix algebraic comparison with sprop on one sidePierre-Marie Pédrot
Reviewed-by: mattam82 Reviewed-by: ppedrot