aboutsummaryrefslogtreecommitdiff
path: root/kernel
AgeCommit message (Collapse)Author
2015-02-27Add support so that the type of a match in an inductive type with let-inHugo Herbelin
is reduced as if without let-in, when applied to arguments. This allows e.g. to have a head-betazeta-reduced goal in the following example. Inductive Foo : let X := Set in X := I : Foo. Definition foo (x : Foo) : x = x. destruct x. (* or case x, etc. *)
2015-02-24New function [Constr.equal_with] to compare terms up to variants of ↵Arnaud Spiwack
[kind_of_term]. To be able to write equality up to evar instantiation instantiation. Generalises the main function of [eq] constr over the variant of [kind_of_term] it uses. It prevents some optimisation of [Array.equal] where two physically equal arrays are considered (less or) equal. But it does not seem to have appreciable effects on efficiency.
2015-02-24Refactoring in [Constr].Arnaud Spiwack
[compare_head_gen] defined in terms of [compare_head_gen_leq]. Remove an unused argument from [compare_head_gen_leq].
2015-02-23Fix some typos in comments.Guillaume Melquiond
2015-02-21Import (module): Do not force constraints if not ready (Close #4066)Enrico Tassi
2015-02-14Univs: When computing the level of an inductive including indices, letsMatthieu Sozeau
do not contribute. Fixes bug #3808.
2015-02-12Univs: fix bug #3978: carry around the universe context used toMatthieu Sozeau
typecheck with definitions and thread it accordingly when typechecking module expressions.
2015-02-11Fixing bug #4019, and checker blow-up at once.Pierre-Marie Pédrot
2015-02-11Clarifying the implementation of universe hashconsing.Pierre-Marie Pédrot
2015-02-10Fix typeops ignoring results of check functions with let _, and oneMatthieu Sozeau
safety hole in judge_of_constant_knowing parameters which was not checking the result of the check correctly (the rest of the calls in that file and all of the checker have been checked).
2015-02-04Nativelib: catch Unix_error (like no ocamlopt found)Enrico Tassi
2015-02-02Removing dead code.Pierre-Marie Pédrot
2015-01-28Fixing bug #3931.Pierre-Marie Pédrot
2015-01-20Fix a critical bug in machine arithmetic for native compiler.Maxime Dénès
2015-01-17Fix #3379, now that Require inside modules is allowed again.Maxime Dénès
2015-01-17Univs: proper printing of global and local universe names (onlyMatthieu Sozeau
printing functions touched in the kernel).
2015-01-17Partially revert "Forbid Require inside interactive modules and module types."Maxime Dénès
This reverts commit 6d5b56d971506dfadcfc824bfbb09dc21718e42b but does not put back in place the Requires inside modules that were found in the std lib. Conflicts: kernel/safe_typing.ml
2015-01-17Univs: Fix alias computation for VMs, computation of normal form ofMatthieu Sozeau
match predicates for vm_compute and compile polymorphic definitions to constant code. Add univscompute test-suite file testing VM computations in presence of polymorphic universes.
2015-01-17Make native compiler handle universe polymorphic definitions.Maxime Dénès
One remaining issue: aliased constants raise an anomaly when some unsubstituted universe variables remain. VM may suffer from the same problem.
2015-01-15Correct restriction of vm_compute when handling universe polymorphicMatthieu Sozeau
definitions. Instead of failing with an anomaly when trying to do conversion or computation with the vm's, consider polymorphic constants as being opaque and keep instances around. This way the code is still correct but (obviously) incomplete for polymorphic definitions and we avoid introducing an anomaly. The patch does nothing clever, it only keeps around instances with constants/inductives and compile constant bodies only for non-polymorphic definitions.
2015-01-15Make -print-mod-uid accept a list of files.Maxime Dénès
Solves an efficiency problem in Makefiles generated by coq_makefile.
2015-01-13Native compiler: if debug flag not present, remove .native files.Maxime Dénès
2015-01-13Fix bug when discharging universe constraints coming from variablesMatthieu Sozeau
into monomorphic constants, which was still using the de Bruijn encoding Bug revealed by discharging of hidden internal monomorphic definition in otherwise polymorphic developments. Makes coqchk work on Hurkens again.
2015-01-13Fix issue in printing due to de Bruijn bug when constructing compatibilityMatthieu Sozeau
constr for primitive records (not used anywhere else than printing). Problem reported by P. LeFanu Lumsdaine on HoTT/HoTT. Also add some minor fixes in detyping and pretty printing related to universes.
2015-01-12Update headers.Maxime Dénès
2015-01-12Fix a few typos.Maxime Dénès
2015-01-11Declarations.mli refactoring: module_type_body = module_bodyPierre Letouzey
After this commit, module_type_body is a particular case of module_type. For a [module_type_body], the implementation field [mod_expr] is supposed to be always [Abstract]. This is verified by coqchk, even if this isn't so crucial, since [mod_expr] is never read in the case of a module type. Concretely, this amounts to the following rewrite on field names for module_type_body: - typ_expr --> mod_type - typ_expr_alg --> mod_type_alg - typ_* --> mod_* and adding two new fields to mtb: - mod_expr (always containing Abstract) - mod_retroknowledge (always containing []) This refactoring should be completely transparent for the user. Pros: code sharing, for instance subst_modtype = subst_module. Cons: a runtime invariant (mod_expr = Abstract) which isn't enforced by typing. I tried a polymorphic typing of mod_expr, to share field names while not having mtb = mb, but the OCaml typechecker isn't clever enough with polymorphic mutual fixpoints, and reject code sharing (e.g. between subst_modtype and subst_module). In the future (with ocaml>=4), some GADT could maybe help here, but for now the current solution seems good enough.
2015-01-07Aligning printing of universe constraints.Hugo Herbelin
2015-01-06Fix some documentation typos.Guillaume Melquiond
2015-01-06improve efficiency of the reduction interpreter of coqtopBruno Barras
Conflicts: kernel/closure.ml kernel/closure.mli kernel/reduction.ml
2015-01-06Rename ill-named "imports" field of safe_env into "required".Maxime Dénès
2015-01-05kernel/ind Change interface of declare_mind and declare_mutualMatthieu Sozeau
Removing unused argument and fixing bug #3899, now warning when a record cannot be made primitive in Set Primitive Projections mode because it has no projection or at least one undefinable projection.
2014-12-27universes_of_constant: do a proper set union of body and type univsEnrico Tassi
Before the union was performed as a UContext.t union, that concatenates the instances arrays, while one wants to avoid duplicates. We also assert that polymorphic constants have all constraints in the constant_body (field const_universes), since the extra body univs (stored in the opaque tables) are just for regular constants processed asynchronously.
2014-12-27Revert "Term: include a function to print terms"Enrico Tassi
Such printer is already in Termops This reverts commit 5d6106a075b79abbb92b03bbca7b13a517cf4925.
2014-12-26Term: include a function to print termsEnrico Tassi
I find it very odd not to have a pretty printer for terms than can be called from *everywhere*. This commit sticks in Term a long spaghetti to let Printer install a printing function.
2014-12-25Forbid Require inside interactive modules and module types.Maxime Dénès
Fixes #3379 and part of #3363. Also avoids fragile code propagating required libraries when closing an interactive module. Had to fix a few occurrences in std lib.
2014-12-21Dead code in Univ.Pierre-Marie Pédrot
2014-12-18Cleaning up universe list implementation in Univ.Pierre-Marie Pédrot
We use private types to ensure apriori hashconsing, and get rid of the use of recursive modules. The hash of the universe list is also inlined into each node instead of relying on a supplementary indirection.
2014-12-17Ensuring the good invariants of hashcons table generation in the API.Pierre-Marie Pédrot
2014-12-17Fix (actually, properly implement :) hashconsing of projections,Matthieu Sozeau
resulting in huge speedup at Qed/section closing in presence of primitive projections.
2014-12-16Getting rid of Exninfo hacks.Pierre-Marie Pédrot
Instead of modifying exceptions to wear additional information, we instead use a dedicated type now. All exception-using functions were modified to support this new type, in particular Future's fix_exn-s and the tactic monad. To solve the problem of enriching exceptions at raise time and recover this data in the try-with handler, we use a global datastructure recording the given piece of data imperatively that we retrieve in the try-with handler. We ensure that such instrumented try-with destroy the data so that there may not be confusion with another exception. To further harden the correction of this structure, we also check for pointer equality with the last raised exception. The global data structure is not thread-safe for now, which is incorrect as the STM uses threads and enriched exceptions. Yet, we splitted the patch in two parts, so that we do not introduce dependencies to the Thread library immediatly. This will allow to revert only the second patch if ever we switch to OCaml-coded lightweight threads.
2014-12-16Fix for #3154: use CUnix.sys_command to call native compiler.Maxime Dénès
Patch by CJ on bugzilla. CUnix.sys_command doesn't rely on a shell, so extra care with cmd.exe vs sh is no longer required.
2014-12-15Fix treatment of universe context in typecheck inductive (was addedMatthieu Sozeau
twice). Thanks to Marc Lasson for spotting this.
2014-12-14Fix merging of name maps in union of universe contexts.Matthieu Sozeau
2014-12-10Revert commit that inverted the preference for FFlex/FProj problems inMatthieu Sozeau
kernel reduction.
2014-12-09Switch the few remaining iso-latin-1 files to utf8Pierre Letouzey
2014-11-23Pass around information on the use of template polymorphism forMatthieu Sozeau
inductive types (i.e., ones declared with an explicit anonymous Type at the conclusion of their arity). With this change one can force inductives to live in higher universes even in the non-fully universe polymorphic case (e.g. bug #3821).
2014-11-23Fix #3824. de Bruijn error in normalization of fixpoints.Maxime Dénès
This bug was affecting the VM and the native compiler, but only in the pretyper (not the kernel). Types of arguments of fixpoints were incorrectly normalized due to a missing lift.
2014-11-21Fix bug #3804.Matthieu Sozeau
2014-11-20Exporting the function handling side-effects only applied to terms.Pierre-Marie Pédrot