aboutsummaryrefslogtreecommitdiff
path: root/plugins/firstorder
AgeCommit message (Collapse)Author
2019-04-10Remove calls to global env in InductiveopsMaxime Dénès
2019-03-20Stop accessing proof env via Pfedit in printersMaxime Dénès
This should make https://github.com/coq/coq/pull/9129 easier.
2019-03-14Add relevance marks on binders.Gaëtan Gilbert
Kernel should be mostly correct, higher levels do random stuff at times.
2019-02-28Constructor type information uses the expanded form.Pierre-Marie Pédrot
It used to simply remember the normal form of the type of the constructor. This is somewhat problematic as this is ambiguous in presence of let-bindings. Rather, we store this data in a fully expanded way, relying on rel_contexts. Probably fixes a crapload of bugs with inductive types containing let-bindings, but it seems that not many were reported in the bugtracker.
2018-12-11[api] Move reduction modules to `tactics`Emilio Jesus Gallego Arias
These modules do actually belong there. We have to slightly reorganize printers, removing a couple of duplicated ones in the way.
2018-11-23s/let _ =/let () =/ in some places (mostly goptions related)Gaëtan Gilbert
2018-11-20Merge PR #7925: Clean transparent stateMaxime Dénès
2018-11-19Rename TranspState into TransparentState.Pierre-Marie Pédrot
2018-11-19Proper record type and accessors for transparent states.Pierre-Marie Pédrot
This is documented in dev/doc/changes.md.
2018-11-17[ltac] Use CAst nodes in the tactic AST.Emilio Jesus Gallego Arias
This provides several advantages to people serializing tactic scripts. Appearance of the involved constructors is common enough as to bother to submit this PR.
2018-11-07[Firstorder plugin] Remove some dead codeVincent Laporte
2018-11-02coqpp VERNAC EXTEND uses #[ att = attribute; ] syntaxGaëtan Gilbert
I think for instance the new code in this diff is cleaner and more systematic: ~~~diff VERNAC COMMAND EXTEND VernacDeclareTacticDefinition -| [ "Ltac" ne_ltac_tacdef_body_list_sep(l, "with") ] => { +| #[ deprecation; locality; ] [ "Ltac" ne_ltac_tacdef_body_list_sep(l, "with") ] => { VtSideff (List.map (function | TacticDefinition ({CAst.v=r},_) -> r | TacticRedefinition (qid,_) -> qualid_basename qid) l), VtLater } -> { - let deprecation, locality = Attributes.(parse Notations.(deprecation ++ locality) atts) in Tacentries.register_ltac (Locality.make_module_locality locality) ?deprecation l; } END ~~~
2018-11-02Command driven attributes.Gaëtan Gilbert
Commands need to request the attributes they use, with the API encouraging them to error on unsupported attributes.
2018-11-02Move attributes out of vernacinterp to new attributes moduleGaëtan Gilbert
2018-10-18[universes] deprecate constr_of_globalMatthieu Sozeau
In favor of a constr_of_monomorphic_global function. When people move to the new Coqlib interface they will also see this deprecation message encouraging them to think about the best move. This commit changes a few references to constr_of_global and replaces them with a constr_of_monomorphic_global which makes it apparent that this is not the function to call to globalize polymorphic references. The remaining parts using constr_of_monomorphic_global are easily identifiable using this: omega, btauto, ring, funind and auto_ind_decl mainly (this fixes firstorder). What this means is that the symbols registered for these tactics have to be monomorphic for now.
2018-10-17[dune] [plugins] Fix plugin name ground -> firstorderEmilio Jesus Gallego Arias
This is needed for compatibility with directory-listing infrastructure.
2018-10-15Port remaining EXTEND ml4 files to coqpp.Pierre-Marie Pédrot
Almost all of ml4 were removed in the process. The only remaining files are in the test-suite and probably need a bit of fiddling with coq_makefile, and there only two really remaning ml4 files containing code.
2018-10-15Plug ARGUMENT EXTEND into the argument extension API.Pierre-Marie Pédrot
2018-10-15Deprecating the RAW_TYPED and GLOB_TYPED stanzas of the ARGUMENT EXTEND macro.Pierre-Marie Pédrot
Those optional arguments did not really make sense. It was pretty clear from our code base, as all instances where triplicating the same type for TYPED, RAW_TYPED and GLOB_TYPED.
2018-10-10[coqlib] Rebindable Coqlib namespace.Emilio Jesus Gallego Arias
We refactor the `Coqlib` API to locate objects over a namespace `module.object.property`. This introduces the vernacular command `Register g as n` to expose the Coq constant `g` under the name `n` (through the `register_ref` function). The constant can then be dynamically located using the `lib_ref` function. Co-authored-by: Emilio Jesús Gallego Arias <e+git@x80.org> Co-authored-by: Maxime Dénès <mail@maximedenes.fr> Co-authored-by: Vincent Laporte <Vincent.Laporte@fondation-inria.fr>
2018-09-24[engine] Remove and deprecate `nf_enter` et al.Emilio Jesus Gallego Arias
After the introduction of `EConstr`, "normalization" has become unnecessary, we thus deprecate the `nf_*` family of functions. Test-suite and CI pass after the fix for #8513.
2018-09-12Move maps & sets indexed by GlobRef.t into the kernelVincent Laporte
2018-09-05[build] Preliminary support for building Coq with `dune`.Emilio Jesus Gallego Arias
[Dune](https://github.com/ocaml/dune) is a compositional declarative build system for OCaml. It provides automatic generation of `version.ml`, `.merlin`, `META`, `opam`, API documentation; install management; easy integration with external libraries, test runners, and modular builds. In particular, Dune uniformly handles components regardless whether they live in, or out-of-tree. This greatly simplifies cases where a plugin [or CoqIde] is checked out in the current working copy but then distributed separately [and vice-versa]. Dune can thus be used as a more flexible `coq_makefile` replacement. For now we provide experimental support for a Dune build. In order to build Coq + the standard library with Dune type: ``` $ make -f Makefile.dune world ``` This PR includes a preliminary, developer-only preview of Dune for Coq. There is still ongoing work, see https://github.com/coq/coq/issues/8052 for tracking status towards full support. ## Technical description. Dune works out of the box with Coq, once we have fixed some modularity issues. The main remaining challenge was to support `.vo` files. As Dune doesn't support custom build rules yet, to properly build `.vo` files we provide a small helper script `tools/coq_dune.ml`. The script will scan the Coq library directories and generate the corresponding rules for `.v -> .vo` and `.ml4 -> .ml` builds. The script uses `coqdep` as to correctly output the dependencies of `.v` files. `coq_dune` is akin to `coq_makefile` and should be able to be used to build Coq projects in the future. Due to this pitfall, the build process has to proceed in three stages: 1) build `coqdep` and `coq_dune`; 2) generate `dune` files for `theories` and `plugins`; 3) perform a regular build with all targets are in scope. ## FAQ ### Why Dune? Coq has a moderately complex build system and it is not a secret that many developer-hours have been spent fighting with `make`. In particular, the current `make`-based system does offer poor support to verify that the current build rules and variables are coherent, and requires significant manual, error-prone. Many variables must be passed by hand, duplicated, etc... Additionally, our make system offers poor integration with now standard OCaml ecosystem tools such as `opam`, `ocamlfind` or `odoc`. Another critical point is build compositionality. Coq is rich in 3rd party contributions, and a big shortcoming of the current make system is that it cannot be used to build these projects; requiring us to maintain a custom tool, `coq_makefile`, with the corresponding cost. In the past, there has been some efforts to migrate Coq to more specialized build systems, however these stalled due to a variety of reasons. Dune, is a declarative, OCaml-specific build tool that is on the path to become the standard build system for the OCaml ecosystem. Dune seems to be a good fit for Coq well: it is well-supported, fast, compositional, and designed for large projects. ### Does Dune replace the make-based build system? The current, make-based build system is unmodified by this PR and kept as the default option. However, Dune has the potential ### Is this PR complete? What does it provide? This PR is ready for developer preview and feedback. The build system is functional, however, more work is necessary in order to make Dune the default for Coq. The main TODOs are tracked at https://github.com/coq/coq/issues/8052 This PR allows developers to use most of the features of Dune today: - Modular organization of the codebase; each component is built only against declared dependencies so components are checked for containment more strictly. - Hygienic builds; Dune places all artifacts under `_build`. - Automatic generation of `.install` files, simplified OPAM workflow. - `utop` support, `-opaque` in developer mode, etc... - `ml4` files are handled using `coqp5`, a native-code customized camlp5 executable which brings much faster `ml4 -> ml` processing. ### What dependencies does Dune require? Dune doesn't depend on any 3rd party package other than the OCaml compiler. ### Some Benchs: ``` $ /usr/bin/time make DUNEOPT="-j 1000" -f Makefile.dune states 59.50user 18.81system 0:29.83elapsed 262%CPU (0avgtext+0avgdata 302996maxresident)k 0inputs+646632outputs (0major+4893811minor)pagefaults 0swaps $ /usr/bin/time sh -c "./configure -local -native-compiler no && make -j states" 88.21user 23.65system 0:32.96elapsed 339%CPU (0avgtext+0avgdata 304992maxresident)k 0inputs+1051680outputs (0major+5300680minor)pagefaults 0swaps ```
2018-07-26Replace iter + ref by fold_leftMaxime Dénès
2018-07-26Coercions cleanup: use GlobRef.t instead of constrMaxime Dénès
2018-06-18Remove reference name type.Maxime Dénès
reference was defined as Ident or Qualid, but the qualid type already permits empty paths. So we had effectively two representations for unqualified names, that were not seen as equal by eq_reference. We remove the reference type and replace its uses by qualid.
2018-06-12[api] Misctypes removal: several moves:Emilio Jesus Gallego Arias
- move_location to proofs/logic. - intro_pattern_naming to Namegen.
2018-06-04Merge PR #7216: Replace uses of Termops.dependent by more specific functions.Matthieu Sozeau
2018-05-30[api] Remove deprecated object from `Term`Emilio Jesus Gallego Arias
We remove most of what was deprecated in `Term`. Now, `intf` and `kernel` are almost deprecation-free, tho I am not very convinced about the whole `Term -> Constr` renaming but I'm afraid there is no way back. Inconsistencies with the constructor policy (see #6440) remain along the code-base and I'm afraid I don't see a plan to reconcile them. The `Sorts` deprecation is hard to finalize, opening `Sorts` is not a good idea as someone added a `List` module inside it.
2018-05-25Remove some occurrences of Evd.emptyMaxime Dénès
We address the easy ones, but they should probably be all removed.
2018-05-17Split off Universes functions dealing with generating new universes.Gaëtan Gilbert
2018-05-04[api] Rename `global_reference` to `GlobRef.t` to follow kernel style.Emilio Jesus Gallego Arias
In #6092, `global_reference` was moved to `kernel`. It makes sense to go further and use the current kernel style for names. This has a good effect on the dependency graph, as some core modules don't depend on library anymore. A question about providing equality for the GloRef module remains, as there are two different notions of equality for constants. In that sense, `KerPair` seems suspicious and at some point it should be looked at.
2018-04-13Evar maps contain econstrs.Gaëtan Gilbert
We bootstrap the circular evar_map <-> econstr dependency by moving the internal EConstr.API module to Evd.MiniEConstr. Then we make the Evd functions use econstr.
2018-04-10Replace uses of Termops.dependent by more specific functions.Pierre-Marie Pédrot
This is more efficient in general, because Termops.dependent doesn't take advantage of the knowledge of its pattern argument.
2018-03-31[econstr] Forbid calling `to_constr` in open terms.Emilio Jesus Gallego Arias
We forbid calling `EConstr.to_constr` on terms that are not evar-free, as to progress towards enforcing the invariant that `Constr.t` is evar-free. [c.f. #6308] Due to compatibility constraints we provide an optional parameter to `to_constr`, `abort` which can be used to overcome this restriction until we fix all parts of the code. Now, grepping for `~abort:false` should return the questionable parts of the system. Not a lot of places had to be fixed, some comments: - problems with the interface due to `Evd/Constr` [`Evd.define` being the prime example] do seem real! - inductives also look bad with regards to `Constr/EConstr`. - code in plugins needs work. A notable user of this "feature" is `Obligations/Program` that seem to like to generate kernel-level entries with free evars, then to scan them and workaround this problem by generating constants.
2018-02-27Update headers following #6543.Théo Zimmermann
2018-02-19Merge PR #6771: [engine] Remove ghost parameter from `Proofview.Goal.t`Maxime Dénès
2018-02-17Change references to CAMLP4 to CAMLP5 to be more accurate since we noJim Fehrle
longer use camlp4.
2018-02-12[engine] Remove ghost parameter from `Proofview.Goal.t`Emilio Jesus Gallego Arias
In current code, `Proofview.Goal.t` uses a phantom type to indicate whether the goal was properly substituted wrt current `evar_map` or not. After the introduction of `EConstr`, this distinction should have become unnecessary, thus we remove the phantom parameter from `'a Proofview.Goal.t`. This may introduce some minor incompatibilities at the typing level. Code-wise, things should remain the same. We thus deprecate `assume`. In a next commit, we will remove normalization as much as possible from the code.
2018-01-17Use let-in aware prod_applist_assum in dtauto and firstorder.Jasper Hugunin
Fixes #6490. `prod_applist_assum` is copied from `kernel/term.ml` to `engine/termops.ml`, and adjusted to work with econstr. This change uncovered a bug in `Hipattern.match_with_nodep_ind`, where `has_nodep_prod_after` counts both products and let-ins, but was only being passed `mib.mind_nparams`, which does not count let-ins. Replaced with (Context.Rel.length mib.mind_params_ctxt).
2017-12-14Deprecate dead code option Congruence Depth.Gaëtan Gilbert
2017-11-24Merge PR #6197: [plugin] Remove LocalityFixme über hack.Maxime Dénès
2017-11-22[plugin] Remove LocalityFixme über hack.Emilio Jesus Gallego Arias
To that extent we introduce a new prototype vernacular extension macro `VERNAC COMMAND FUNCTIONAL EXTEND` that will take a function with the proper parameters and attributes. This of course needs more refinement, in particular we should move `vernac_command` to its own file and make `Vernacentries` consistent wrt it.
2017-11-22[api] Deprecate Term destructors, move to ConstrEmilio Jesus Gallego Arias
We mirror the structure of EConstr and move the destructors from `Term` to `Constr`. This is a step towards having a single module for `Constr`.
2017-11-06[api] Move structures deprecated in the API to the core.Emilio Jesus Gallego Arias
We do up to `Term` which is the main bulk of the changes.
2017-09-28Efficient fresh name generation relying on sets.Pierre-Marie Pédrot
The old algorithm was relying on list membership, which is O(n). This was nefarious for terms with many binders. We use instead sets in O(log n).
2017-08-01Detyping functions are now operating on EConstr.t.Pierre-Marie Pédrot
This was already the case, but the API was not exposing this.
2017-07-27deprecate Pp.std_ppcmds type aliasMatej Košík
2017-07-25[api] Remove type equalities from API.Emilio Jesus Gallego Arias
This ensures that the API is self-contained and is, well, an API. Before this patch, the contents of `API.mli` bore little relation with what was used by the plugins [example: `Metasyntax` in tacentries.ml]. Many missing types had to be added. A sanity check of the `API.mli` file can be done with: `ocamlfind ocamlc -rectypes -package camlp5 -I lib API/API.mli`
2017-07-17[API] Remove `open API` in ml files in favor of `-open API` flag.Emilio Jesus Gallego Arias