aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-08-31Make Numeral Notation follow Import, not RequireJason Gross
Because that's the sane thing to do. This will inevitably cause issues for projects which do not `Import Coq.Strings.Ascii` before trying to use ascii notations. We also move the syntax plugin for `int31` notations from `Cyclic31` to `Int31`, so that users (like CompCert) who merely `Require Import Coq.Numbers.Cyclic.Int31.Int31` get the `int31` numeral syntax. Since `Cyclic31` `Export`s `Int31`, this should not cause any additional incompatibilities.
2018-08-31[numeral notations] support aliasesJason Gross
Aliases of global references can now be used in numeral notations
2018-08-31Add Numeral Notation GlobRef printing/parsingJason Gross
Now we support using inductive constructors and section-local variables as numeral notation printing and parsing functions. I'm not sure that I got the econstr conversion right.
2018-08-31Add periods in response to PR commentsJason Gross
2018-08-31Move g_numeral.ml4 to numeral.mlJason Gross
As per https://github.com/coq/coq/pull/8064#pullrequestreview-145971522
2018-08-31Add a warning about abstract after being a no-opJason Gross
As per https://github.com/coq/coq/pull/8064#discussion_r209875616 I decided to make it a warning because it seems more flexible that way; users to are flipping back and forth between option types and not option types while designing won't have to update their `abstract after` directives to do so, and users who don't want to allow this can make it an actual error message.
2018-08-31Update CHANGESJason Gross
2018-08-31Update doc and test-suite after supporting univ polyJason Gross
Also make `Check S` no longer anomaly Add a couple more test cases for numeral notations Also add another possibly-confusing error message to the doc. Respond to Hugo's doc request with Zimmi48's suggestion From https://github.com/coq/coq/pull/8064/files#r204191608
2018-08-31Add support for polymorphic constants.Hugo Herbelin
2018-08-31Fix numeral notation for a rebase on top of masterJason Gross
Some of this code is cargo-culted or kludged to work. As I understand it, the situation is as follows: There are two sorts of use-cases that need to be supported: 1. A plugin registers an OCaml function as a numeral interpreter. In this case, the function registration must be synchronized with the document state, but the functions should not be marshelled / stored in the .vo. 2. A vernacular registers a Gallina function as a numeral interpreter. In this case, the registration must be synchronized, and the function should be marshelled / stored in the .vo. In case (1), we can compare functions by pointer equality, and we should be able to rely on globally unique keys, even across backtracking. In case (2), we cannot compare functions by pointer equality (because they must be regenerated on unmarshelling when `Require`ing a .vo file), and we also cannot rely on any sort of unique key being both unique and persistent across files. The solution we use here is that we ask clients to provide "unique" keys, and that clients tell us whether or not to overwrite existing registered functions, i.e., to tell us whether or not we should expect interpreter functions to be globally unique under pointer equality. For plugins, a simple string suffices, as long as the string does not clash between different plugins. In the case of vernacular-registered functions, use marshell a description of all of the data used to generate the function, and use that string as a unique key which is expected to persist across files. Because we cannot rely on function-pointer uniqueness here, we tell the interpretation-registration to allow overwriting. ---- Some of this code is response to comments on the PR ---- Some code is to fix an issue that bignums revealed: Both Int31 and bignums registered numeral notations in int31_scope. We now prepend a globally unique identifier when registering numeral notations from OCaml plugins. This is permissible because we don't store the uid information for such notations in .vo files (assuming I'm understanding the code correctly).
2018-08-31WIP: cleanup numeral_notation_obj + errorsPierre Letouzey
2018-08-31WIP: adapt Numeral Notation to synchronized prim notationsPierre Letouzey
2018-08-31Decimal: scope name changed dec_(u)int_scopePierre Letouzey
This avoid a clash with int_scope in ssreflect's ssrint.v
2018-08-31Numeral Notation + test-suite : fix 3 tests using Datatypes.v but not Prelude.vPierre Letouzey
Earlier, the nat_syntax_plugin was loaded as soon as Datatypes.v. This would now implies to make Datatypes.v depends on Decimal.v. Instead, we postpone the Numeral Notation for nat until Prelude.v, and we adapt those three tests that happen to live strictly between Datatypes and Prelude.
2018-08-31Numeral Notation: use the modern warning infrastructurePierre Letouzey
2018-08-31Numeral Notation: minor text improvements suggested by J. GrossPierre Letouzey
2018-08-31Error on polymorphic conversions for numeral notationsJason Gross
2018-08-31Fix grammarJason Gross
``` git grep --name-only 'should goes' | xargs sed s'/should goes/should go/g' -i ```
2018-08-31Numeral Notation: some documentation in the refmanPierre Letouzey
2018-08-31remove legacy syntax plugins subsumed by Numeral NotationPierre Letouzey
2018-08-31Numeral Notation for natPierre Letouzey
This parsing/printing method for nat should be just as fast as the previous dedicated code. Moreover, we could now parse large literals as nat numbers, by leaving them in a half-abstract form such as (Nat.of_uint 123456). This form is convertible to the closed (S (S (S ...))) form, so it shouldn't be a big deal for compatibility, except for if some Ltac stuff relies on (S ...) to be present after parsing. Of course, forcing the computation of a (Nat.of_uint ....) may take a while or raise a Stack Overflow.
2018-08-31Numeral Notation: allow parsing from/to Decimal.int or Decimal.uintPierre Letouzey
This way, we could fully bypass bigint.ml. The previous mechanism of parsing/printing Z is kept for now. Currently, the conversion functions accepted by Numeral Notation foo may have the following types. for parsing: int -> foo int -> option foo uint -> foo uint -> option foo Z -> foo Z -> option foo for printing: foo -> int foo -> option int foo -> uint foo -> option uint foo -> Z foo -> option Z Notes: - The Declare ML Module is directly done in Prelude - When doing a Numeral Notation, having the Z datatype around isn't mandatory anymore (but the error messages suggest that it can still be used). - An option (abstract after ...) allows to keep large numbers in an abstract form such as (Nat.of_uint 123456) instead of reducing to (S (S (S ...))) and ending immediately with Stack Overflow. - After checking with Matthieu, there is now a explicit check and an error message in case of polymorphic inductive types
2018-08-31remove test file NatSyntaxViaZ.vPierre Letouzey
2018-08-31Numeral Notation: misc code improvements (records, subfunctions, exceptions ...)Pierre Letouzey
2018-08-31Numeral Notation (for inductive types)Pierre Letouzey
This is a portion of roglo's PR#156 introducing a Numeral Notation command : we deal here with inductive types via conversion fonctions from/to Z written in Coq. For an example, see plugins/syntax/NatSyntaxViaZ.v This commit does not include the part about printing via some ltac. Using ltac was meant for dealing with real numbers, let's see first what become PR#415 about a compact representation for real literals.
2018-08-31prim notations backtrackable, their declarations now in two parts (API change)Pierre Letouzey
The first part (e.g. register_bignumeral_interpretation) deals only with the interp/uninterp closures. It should typically be done as a side effect during a syntax plugin loading. No prim notation are active yet after this phase. The second part (enable_prim_token_interpretation) activates the prim notation. It is now correctly talking to Summary and to the LibStack. To avoid "phantom" objects in libstack after a mere Require, this second part should be done inside a Mltop.declare_cache_obj The link between the two parts is a prim_token_uid (a string), which should be unique for each primitive notation. When this primitive notation is specific to a scope, the scope_name could be used as uid. Btw, the list of "patterns" for detecting when an uninterpreter should be considered is now restricted to a list of global_reference (inductive constructors, or injection functions such as IZR). The earlier API was accepting a glob_constr list, but was actually only working well for global_reference. A minimal compatibility is provided (declare_numeral_interpreter), but is discouraged, since it is known to store uncessary objects in the libstack.
2018-08-31Prelude : update the comment about ML plugins loaded by InitPierre Letouzey
2018-08-31Extraargs: avoid two token declarations to appear in all .voPierre Letouzey
Without this, the library segment of all .vo except Notations.vo starts with two TOKEN objects (declaration of tokens "->" and "<-"). This is due to side effects creating these objects during the dynlink of ltac_plugin.cmxs, more precisely the two Metasyntax.add_token_obj in Extraargs. It's quite cleaner to register these two side effects via Mltop.declare_cache_obj, so that the two objects only live in Notations.vo, and are loaded from there.
2018-08-31Tacenv: minor code cleanupPierre Letouzey
2018-08-31Notation: remove support for prim tokens denoting inductive types in "return"Pierre Letouzey
This is prim token notations for inductive *types*, not values. So we're speaking of a scope where 0 is the type nat, 1 is the type bool, etc. To my knowledge, this feature hasn't ever been used, and is very unlikely to be used ever, so let's clean the code a bit by removing it.
2018-08-31Notation: avoid one intermediate (unit -> ...)Pierre Letouzey
2018-08-31Notation: no more chains of prim_token_interpreterPierre Letouzey
This cleanup prepares for forthcoming synchronization of prim_token_interpreter wrt to Summary. These chains of prim_token_interpreter were anyway never used, only one interpreter was declared per numeral scope. After sync wrt Summary, we'll anyway be able to backtrack to a previous interpreter.
2018-09-01Merge PR #8348: Download tarball instead of cloning external projects.Emilio Jesus Gallego Arias
2018-08-31Merge PR #8346: Clean-up Travis folds.Gaëtan Gilbert
2018-08-31Merge PR #8351: [ci] [docker] Update base Dune version.Gaëtan Gilbert
2018-08-31Merge PR #8170: Don't index names starting with `_` in docsThéo Zimmermann
2018-08-31Merge PR #8219: Refman consistency checkThéo Zimmermann
2018-08-31Download tarball instead of cloning external projects (when $CI is set).Théo Zimmermann
This allows to use fixed commits and not just branches or tags. We keep using git clone when $FORCE_GIT is set (for projects on gforge.inria.fr and projects pulling dependencies through git submodules). fiat-parsers also calls git submodule, but inside its own Makefile.
2018-08-31Merge PR #8368: [ci] Fix QuickChick by adding new simple-io dependency.Gaëtan Gilbert
2018-08-31[ci] Fix QuickChick by adding new simple-io dependency.Théo Zimmermann
2018-08-31Fixed the seealso directive in a few places.Zeimer
2018-08-31Uniformized many spelling variants. Added .. warning:: and .. seealso:: ↵Zeimer
directives in many places. Disambiguated terminology: disequality now means <> while inequality means < <= > >=. Fixed some more grammar and spelling issues.
2018-08-30[ci] [docker] Update Dune and Elpi versions.Emilio Jesus Gallego Arias
We'd like to use `(lang 1.1)` features. Elpi needs update as recent `ppx_tools_versioned` changes broke it.
2018-08-30Merge PR #8354: Move CHANGES entry for #8167 to 8.8.2 sectionThéo Zimmermann
2018-08-30Merge PR #8349: Mention dev/doc/critical-bugs in CONTRIBUTINGThéo Zimmermann
2018-08-30Merge PR #8292: Create SPHINXWARNERROR variable to control Sphinx "warn as ↵Théo Zimmermann
error" argument in make
2018-08-29Merge PR #8353: [sphinx] Fix timeout issue by splitting imports.Clément Pit-Claudel
2018-08-29Merge PR #8345: Add index for focusing braces.Clément Pit-Claudel
2018-08-29Create SPHINXWARNERROR variable that controls whether the SphinxJim Fehrle
"treat errors as warnings" flag (-W) is applied. "1" or undefined includes the flag, other values or undefined omit it. Removed the "-warn-error" parameter to configure. "-profile XXX" will no longer cause these flags to be used.
2018-08-29Move CHANGES entry for #8167 to 8.8.2 sectionJason Gross
As per https://github.com/coq/coq/pull/8167#issuecomment-416929865