aboutsummaryrefslogtreecommitdiff
path: root/kernel
AgeCommit message (Collapse)Author
2017-03-14[safe_string] kernel/cemitcodesEmilio Jesus Gallego Arias
The `emitcodes` string type was used in both a functional and an imperative way, so we have to handle it with care in order to preserve the previous optimizations and semantics.
2017-03-14[toplevel] Remove unusable option -notopEmilio Jesus Gallego Arias
Maxime points out that -notop cannot be used as the kernel requires all constants to belong into a module. Indeed: ``` $ rlwrap ./bin/coqtop -notop Coq < Definition foo := True. Toplevel input, characters 0-23: > Definition foo := True. > ^^^^^^^^^^^^^^^^^^^^^^^ Error: No session module started (use -top dir) Coq < Module M. Definition foo := True. End M. Module M is defined Coq < Locate foo. Constant If you see this, it's a bug.M.foo (shorter name to refer to it in current context is M.foo) ``` My rationale for the removal is that this kind of incomplete features are often confusing to newcomers ─ it has happened to me many times ─ as it can be seen for example in #397 .
2017-03-14[safe-string] kernel/nativevaluesEmilio Jesus Gallego Arias
No functional change.
2017-03-14[safe_string] kernel/term_typingEmilio Jesus Gallego Arias
No functional change, we create the new string beforehand and `id_of_string` will become a noop with `-safe-string`.
2017-03-14[future] Remove unused parameter greedy.Emilio Jesus Gallego Arias
It was always set to `greedy:true`.
2017-02-27Do not recompute twice the whnf of terms in conversion.Pierre-Marie Pédrot
This performance bug was introduced 9 years ago in a8b0345, where the responsibility of normalizing the term went from ccnv to eqappr in Reduction. As a result, all recursive calls to eqappr that were preemptively reducing the term ended up calling whd_stack twice, once by themselves, and once in the subsequent call to eqappr. This caused an important slowdown for conversion-intensive proofs, as the whd_stack calls CClosure.zip to perfom in-place term sharing, leading to useless huge re-allocations and repetitive write barriers. Now that eqappr always head-normalizes the term beforehand, we simply don't call whd_stack anymore when jumping to eqappr.
2017-02-20Merge PR#189: Remove tabulation support from pretty-printing.Maxime Dénès
2017-02-19Optimizing array mapping in the kernel.Pierre-Marie Pédrot
We unroll the map operation by hand in two performance-critical cases so as not to call the generic array allocation function in OCaml, and allocate directly on the minor heap instead. The generic array function is slow because it needs to discriminate between float and non-float arrays. The unrolling replaces this by a simple increment to the minor heap pointer and moves from the stack. The quantity of unrolling was determined by experimental measures on various Coq developments. It looks like most of the maps are for small arrays of size lesser or equal to 4, so this is what is implemented here. We could probably extend it to an even bigger number, but that would result in ugly code. From what I've seen, virtually all maps are of size less than 16, so that we could probably be almost optimal by going up to 16 unrollings, but the code tradeoffs are not obvious. Maybe when we have PPX?
2017-02-14Merge branch 'master'.Pierre-Marie Pédrot
2017-02-14Introducing contexts parameterized by the inner term type.Pierre-Marie Pédrot
This allows the decoupling of the notions of context containing kernel terms and context containing tactic-level terms.
2017-02-14Reductionops now return EConstrs.Pierre-Marie Pédrot
2017-02-14Making judgment type generic over the type of inner constrs.Pierre-Marie Pédrot
This allows to factorize code and prevents the unnecessary use of back and forth conversions between the various types of terms. Note that functions from typing may now raise errors as PretypeError rather than TypeError, because they call the proper wrapper. I think that they were wrongly calling the kernel because of an overlook of open modules.
2017-02-08Merge PR#393: Replace Typeops with Fast_typeopsMaxime Dénès
2017-02-01Merge branch 'v8.6'Pierre-Marie Pédrot
2017-02-01Merge branch 'v8.5' into v8.6Pierre-Marie Pédrot
2017-01-28Remove useless commentsGaetan Gilbert
2017-01-26[native comp] Improve error message on linking error.Emilio Jesus Gallego Arias
The native compiler doesn't support `Require` inside `Module` sections in some cases, we improve the error message. See: https://coq.inria.fr/bugs/show_bug.cgi?id=4335 This patch improves the error message and gives the user some feedback.
2017-01-20Do not add redundant side effects in tactic code.Pierre-Marie Pédrot
This was observable in long proofs, because side effects kept being duplicated, leading to an additional cost linear in the size of the proof. This commit touches kernel files, but the corresponding API is only used in tactic-facing code so that the side_effects type remains opaque. Thus it does not affect the kernel safety.
2017-01-19Merge branch 'v8.6'Pierre-Marie Pédrot
2017-01-17Mapping named_context_val preserves sharing when possible.Pierre-Marie Pédrot
This was deactivated by 27c9346 and made an optimization moot in eauto. This optimization was physically checking for equality, but as lists where rebuilt by the mapping, this was never true. Some contribs were thus quite slower, including persistent-union-find which was twice slower. This 2-line patch fixes it by trying to preserve sharing as much as possible. Note that we should still do something about eauto, because it does redo useless work a lot whenever the environment only changes a bit, while we could cache this computation.
2016-12-26Handle application of a primitive projection to a not yet evaluated ↵Guillaume Melquiond
cofixpoint (bug #5286).
2016-12-23Handle application of a primitive projection to a not yet evaluated ↵Guillaume Melquiond
cofixpoint (bug #5286).
2016-12-22Fixing injection in the presence of let-in in constructors.Hugo Herbelin
This also fixes decide equality, discriminate, ... (see e.g. #5279).
2016-12-12Replace Typeops by Fast_typeopsGaetan Gilbert
This is really [mv fast_typeops.ml{,i} typeops.ml{,i}] plus trivial changes in the other files, the real changes are in the parent commit.
2016-12-12Extend Fast_typeops to be a replacement for TypeopsGaetan Gilbert
This brings the fix in cad44fc for #2996 to the copy of Fast_typeops.check_hyps_inclusion. Fast_typeops.constant_type checks the universe constraints instead of outputting them. Since everyone who used Typeops.constant_type just discarded the constraints they've been switched to constant_type_in which should be the same in Fast_typeops and Typeops. There are some small differences in the interfaces: - Typeops.type_of_projection <-> Fast_typeops.type_of_projection_constant to avoid collision with the internally used type_of_projection (which gives the type of [Proj(p,c)]). - check_hyps_inclusion takes [('a -> constr)] and ['a] instead of [constr] for reporting errors.
2016-12-07Merge branch 'v8.6'Pierre-Marie Pédrot
2016-12-06Fix #5248 - test-suite fails in 8.6beta1Maxime Dénès
This was yet another bug in the VM long multiplication, that I unfortunately introduced in ebc509ed2. It was impacting only 32-bit architectures. In the future, I'll try to make sure that 1) we provide unit tests for integer arithmetic (my int63 branch ships with such tests) 2) our continuous testing infrastructure runs the test suite on a 32-bit architecture. I tried to set up such an instance, but failed. Waiting for support reply.
2016-12-04Merge remote-tracking branch 'github/pr/366' into v8.6Maxime Dénès
Was PR#366: Univs: fix bug 5208
2016-12-02Document changesMatthieu Sozeau
2016-12-02Merge remote-tracking branch 'github/pr/377' into v8.6Maxime Dénès
Was PR#377: Univs: fix bug #5180
2016-12-02Fix #5242 - Dubious unsilenceable warning on invalid identifierMaxime Dénès
We make this warning configurable and disabled by default.
2016-11-30Merge branch 'v8.6'Pierre-Marie Pédrot
2016-11-30Univs: fix bug #5180Matthieu Sozeau
In the kernel's generic conversion, backtrack on UniverseInconsistency for the unfolding heuristic (single backtracking point in reduction). This exception can be raised in the univ_compare structure to produce better error messages when the generic conversion function is called from higher level code in reductionops.ml, which itself is called during unification in evarconv.ml. Inside the kernel, the infer and check variants of conversion never raise UniverseInconsistency though, so this does not change the behavior of the kernel.
2016-11-30Fix UGraph.check_eq!Matthieu Sozeau
Universes are kept in normal form w.r.t. equality but not the <= relation, so the previous check worked almost always but was actually too strict! In cases like (max(Set,u) = u) when u is declared >= Set it was failing to find an equality. Applying the KISS principle: u = v <-> u <= v /\ v <= u. Fix invariant breakage that triggered the discovery of the check_eq bug as well. No algebraic universes should appear in a term position (on the left of a colon in a typing judgment), this was not the case when an algebraic universe instantiated an evar that appeared in the term. We force their universe variable status to change in refresh_universes to avoid this. Fix ind sort inference: Use syntactic universe equality for inductive sort inference instead of check_leq (which now correctly takes constraints into account) and simplify code
2016-11-30Slightly more efficient [Univ.super] implemMatthieu Sozeau
2016-11-24Fix incorrect long multiplication in the VM.Guillaume Melquiond
If the result had its 30th bit set, then all the high part of the result on a 64-bit architecture would end up being set, thus breaking subsequent computations. This patch also fixes the incorrectly parenthesized definition of uint32_of_value, which by luck was never misused.
2016-11-08Introducing a new EConstr.t type to perform the nf_evar operation on demand.Pierre-Marie Pédrot
2016-10-31Moving unused code out of the kernel into Termops.Pierre-Marie Pédrot
Strangely enough, the checker seems to rely on an outdated decompose_app function which is not the same as the kernel, as the latter is sensitive to casts. Cast-manipulating functions from the kernel are only used on upper layers, and thus was moved there.
2016-10-29Merge branch 'v8.6'Pierre-Marie Pédrot
2016-10-26Merge branch 'v8.5' into v8.6Pierre-Marie Pédrot
2016-10-26COMMENT: Declarations.constant_defMatej Kosik
2016-10-26COMMENT: Names.Cmap and Names.Cmap_envMatej Kosik
2016-10-26COMMENT: Constr.kind_of_termMatej Kosik
2016-10-24Merge branch 'v8.6'Pierre-Marie Pédrot
2016-10-24Fix #5127 Memory corruption with the VMMaxime Dénès
The bytecode interpreter ensures that the stack space available at some points is above a static threshold. However, arbitrary large stack space can be needed between two check points, leading to segmentation faults in some cases. We track the use of stack space at compilation time and add an instruction to ensure greater stack capacity when required. This is inspired from OCaml's PR#339 and PR#7168. Patch written with Benjamin Grégoire.
2016-10-19More comments in VM.Maxime Dénès
2016-10-17Merge branch 'v8.6'Pierre-Marie Pédrot
2016-10-12Remove dead code in Environ.Pierre-Marie Pédrot
2016-10-12Merge branch 'v8.6'Pierre-Marie Pédrot
2016-10-12Merge branch 'v8.5' into v8.6Pierre-Marie Pédrot