aboutsummaryrefslogtreecommitdiff
path: root/kernel
AgeCommit message (Collapse)Author
2020-01-07cleanup: do not use recargs when computing the reloc table for ctorsGaëtan Gilbert
This doesn't actually have anything to do with positivity AFAICT, we just want the number of non-parameter arguments.
2020-01-07minor cleanup template_polymorphic_univs: check_levels returns boolGaëtan Gilbert
2020-01-06Fix #11360: discharge of template inductive with param only use of varGaëtan Gilbert
2019-12-27Add critical-bugs entry, tests-suite file, and code comment.Guillaume Melquiond
2019-12-22Use the Alloc_small macro from the OCaml runtime rather than our own.Guillaume Melquiond
We cannot use caml_alloc_small because the macros Setup_for_gc and Restore_after_gc are still relevant (and critical). This means defining the CAML_INTERNALS macro, but it is a legit use and actually documented in the OCaml manual. This will help with forward compatibility with OCaml compilers, e.g., issue #10603. Unfortunately, it also means that we can no longer use #9914 to prevent memory corruption. The old macro is still used for OCaml versions prior to 4.10, as the upstream macro might process Ctrl+C when it is called.
2019-12-22Use a more straightforward algorithm for mulc on 32-bit architectures. ↵Guillaume Melquiond
(Fixes #11321) It has the added advantage of performing 6 less 64-bit operations per long multiplication.
2019-12-22Simplify equality of 63-bit integers.Guillaume Melquiond
The sign bit is supposed to be zero, so no need to mask it out. If it was not zero, most of the algorithms in this file would fail horribly.
2019-12-22Do not hide constants from the compiler.Guillaume Melquiond
2019-12-18Merge PR #10616: Fix push_universe_context* interfaces to use a consistent ↵Pierre-Marie Pédrot
~strict flag Ack-by: SkySkimmer Ack-by: ejgallego Reviewed-by: ppedrot
2019-12-18Merge PR #11027: Cleanup post #10647 (expose comind universe handling)Pierre-Marie Pédrot
Reviewed-by: ppedrot
2019-12-17failwith -> caml_failwithGuillaume Munch-Maccagnoni
2019-12-17Fatal error in VM if SIGINT was seen but no exception occured.Guillaume Munch-Maccagnoni
2019-12-17Fix signal polling for OCaml 4.10Guillaume Munch-Maccagnoni
Issue #10603
2019-12-17[VM] fix volatile declarationGuillaume Munch-Maccagnoni
2019-12-16Remove variance info from inductive entries, infer in indtypingGaëtan Gilbert
It gets thrown away if the inductive is declared in a section anyway, and there is no user syntax to specify it.
2019-12-13Use ~strict argument consistently in push_context/push_context_set intfsMatthieu Sozeau
One should generally push contexts with ~strict:true when the context is a monomorphic one (all univs > Set) except for template polymorphic inductives (>= Prop) and ~strict:false for universe polymorphic ones (>= Set). Includes fixes from Gaëtan's and Emilio's reviews
2019-12-12[vm] Untabify the VM C code.Emilio Jesus Gallego Arias
This is a follow up of #11010 ; I've realized that for example in #11123 a large part of the patch is detabification as indeed the files are mixed in tabs/space style so developers are forced to do the cleanup each time they work on them. Command used: ``` for i in `find . -name '*.c' -or -name '*.h'; do expand -i "$i" | sponge "$i"; sed -e's/[[:space:]]*$//' -i.bak "$i"; done ``` Checked empty diff with `git diff --ignore-all-space`
2019-12-07Section.t is never emptyGaëtan Gilbert
This approach using `type t = { sec_prev: t option; sec_... }` makes it easy to update sections using the record update syntax, but impossible to statically ensure that an operation only affects the current section. We may instead consider using `type t = section * section list` which needs some boilerplate to update.
2019-12-04[dune] Update to dune language version 2.0Emilio Jesus Gallego Arias
This is the minimal set of changes requires for Coq to build under 2.0 mode. We may likely take advantage of some more new features. Note that Dune 2.0 requires OCaml >= 4.06.0, OPAM allows to use Dune in older versions as it will install a secondary compiler.
2019-11-26indTyping: error instead of anomaly for ill-formed templateGaëtan Gilbert
and do not run template_candidate in the upper layers when the template attribute is given. This means we can use an over-approximation in the upper layer implementation of template_candidate (returning false even in cases which the kernel may accept) if we ever want to.
2019-11-26Fix #11039: proof of False with template poly and nonlinear universesGaëtan Gilbert
Using the parameter universes in the constructor causes implicit equality constraints, so those universes may not be template polymorphic. A couple types in the stdlib were erroneously marked template, which is now detected. Removing the marking doesn't actually change behaviour though. Also fixes #10504.
2019-11-22Use the relevance flag in CClosure rel contexts in an efficient way.Pierre-Marie Pédrot
Rels that exist inside the environment at the time of the closure creation are fetched in the global environment, while we only use the local list of relevance for FRels. All the infrastructure was implicitly relying on this kind of behaviour before the introduction of SProp. Fixes #11150: pattern is 10x slower in Coq 8.10.0
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-12Merge PR #11092: [dune] Have only one rule calling configureEmilio Jesus Gallego Arias
Ack-by: SkySkimmer Reviewed-by: ejgallego
2019-11-11Have only one dune rule calling configurePierre Roux
2019-11-10Merge PR #10980: Fix #10903: type-in-type allows fixpoints on sprop inductivesPierre-Marie Pédrot
Reviewed-by: ppedrot
2019-11-08Merge PR #11014: Fix #8459: anomaly not enough abstractions in fix bodyPierre-Marie Pédrot
Reviewed-by: ppedrot
2019-11-01Communicate CFLAGS to dunePierre Roux
2019-11-01Add a check for gradual underflowsPierre Roux
2019-11-01feat: Use SSE2_MATH if available & Die if missing on x87Erik Martin-Dorel
Co-authored-by: Pierre Roux <pierre.roux@onera.fr>
2019-11-01Fix ldshiftexpPierre Roux
* Fix the implementations and add tests * Change shift from int63 to Z (was always used as a Z) * Update FloatLemmas.v accordingly Co-authored-by: Erik Martin-Dorel <erik.martin-dorel@irit.fr>
2019-11-01Add "==", "<", "<=" in PrimFloat.vErik Martin-Dorel
* Add a related test-suite in compare.v (generated by a bash script) Co-authored-by: Pierre Roux <pierre.roux@onera.fr>
2019-11-01Make primitive float work on WindowsPierre Roux
2019-11-01Reimplement is_floatPierre Roux
is_float was relying on Obj.tag triggering a check that we are in the OCaml heap which is expensive. On extreme examples, this can lead to a global 2x speedup. Thanks to Maxime Dénès and Jacques-Henri Jourdan for their help in diagnosing this.
2019-11-01Make primitive float work on x86_32Pierre Roux
Flag -fexcess-precision=standard is not enough on x86_32 where -msse2 -mfpmath=sse is required (-msse is not enough) to avoid double rounding issues in the VM. Most floating-point operation are now implemented in C because OCaml is suffering double rounding issues on x86_32 with 80 bits extended precision registers used for floating-point values, causing double rounding making floating-point arithmetic incorrect with respect to its specification. Add a runtime test for double roundings.
2019-11-01Pretty-printing primitive float constantsErik Martin-Dorel
* map special floats to registered CRef's * kernel/float64.mli: add {is_infinity, is_neg_infinity} functions * kernel/float64.ml: Replace string_of_float with a safe pretty-printing function Namely: let to_string_raw f = Printf.sprintf "%.17g" f let to_string f = if is_nan f then "nan" else to_string_raw f Summary: * printing a binary64 float in 17 decimal places and parsing it again will yield the same float, e.g.: let f1 = 1. +. (0x1p-53 +. 0x1p-105) let f2 = float_of_string (to_string f1) f1 = f2 * OCaml's string_of_float gives a sign to nan values which shouldn't be displayed as all NaNs are considered equal here.
2019-11-01Add primitive floats to checkerPierre Roux
2019-11-01Add primitive floats to 'native_compute'Pierre Roux
* Float added to is_value/get_value to avoid stack overflows (cf. #7646) * beware of the use of Array.map with floats (cf. comment in the makeblock function) NB: From here one, the configure option "-native-compiler no" is no longer needed.
2019-11-01Add next_{up,down} primitive float functionsPierre Roux
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-01Put axioms on ldshiftexp and frshiftexpGuillaume Bertholon
Axioms on ldexp and frexp are replaced by proofs inside FloatLemmas. The shift value has been increased to 2 * emax + prec because in ldexp we want to be able to transform the smallest denormalized to the biggest float value in one call.
2019-11-01Add primitive floats to 'vm_compute'Guillaume Bertholon
* This commit add float instructions to the VM, their encoding in bytecode and the interpretation of primitive float values after the reduction. * The flag '-std=c99' could be added to the C compiler flags to ensure that float computation strictly follows the norm (ie. i387 80-bits format is not used as an optimization). Actually, we use '-fexcess-precision=standard' instead of '-std=c99' because the latter would disable GNU asm used in the VM.
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-11-01Declare type of primitives in CPrimitivesPierre Roux
Rather than in typeops
2019-10-31Fix #8459: anomaly not enough abstractions in fix bodyGaëtan Gilbert
We reach the anomaly because we call check_fix on a surrounding fixpoint from the pretyper, and the inner fix hasn't been checked. Using whd_all isn't useful in the specific reported case but a case where it's necessary can probably be crafted. See also #11013
2019-10-28Fix #10903: type-in-type allows fixpoints on sprop inductivesGaëtan Gilbert
I still don't know why it produces a Not_found instead of a regular error in coqtop but let's forget about it.
2019-10-24Raise an anomaly when looking up unknown constant/inductiveGaëtan Gilbert
If you have access to a kernel name you also should have the environment in which it is defined, barring hacks. In order to disfavor hacks we make the standard lookups raise anomalies so that people are forced to admit they rely on the internals of the environment. We find that hackers operated on the code for side effects, for finding inductive schemes, for simpl and for Print Assumptions. They attempted to operate on funind but the error handling code they wrote would have raised another Not_found instead of being useful. All these uses are indeed hacky so I am satisfied that we are not forcing new hacks on callers.
2019-10-23Merge PR #10884: Last stop before CEP 40Maxime Dénès
Reviewed-by: SkySkimmer Reviewed-by: ejgallego Reviewed-by: gares
2019-10-19universes_of_private: return set instead of list of setsGaëtan Gilbert