diff options
| -rw-r--r-- | .github/PULL_REQUEST_TEMPLATE.md | 16 | ||||
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | .merlin | 14 | ||||
| -rw-r--r-- | API/API.ml | 286 | ||||
| -rw-r--r-- | API/API.mli | 6243 | ||||
| -rw-r--r-- | API/API.mllib | 1 | ||||
| -rw-r--r-- | API/PROPERTIES | 8 | ||||
| -rw-r--r-- | META.coq | 33 | ||||
| -rw-r--r-- | Makefile.build | 83 | ||||
| -rw-r--r-- | Makefile.checker | 2 | ||||
| -rw-r--r-- | Makefile.common | 8 | ||||
| -rw-r--r-- | Makefile.dev | 2 | ||||
| -rw-r--r-- | Makefile.doc | 2 | ||||
| -rw-r--r-- | Makefile.ide | 2 | ||||
| -rw-r--r-- | appveyor.yml | 20 | ||||
| -rw-r--r-- | clib/backtrace.ml (renamed from lib/backtrace.ml) | 0 | ||||
| -rw-r--r-- | clib/backtrace.mli (renamed from lib/backtrace.mli) | 0 | ||||
| -rw-r--r-- | clib/bigint.ml (renamed from lib/bigint.ml) | 0 | ||||
| -rw-r--r-- | clib/bigint.mli (renamed from lib/bigint.mli) | 0 | ||||
| -rw-r--r-- | clib/cArray.ml (renamed from lib/cArray.ml) | 0 | ||||
| -rw-r--r-- | clib/cArray.mli (renamed from lib/cArray.mli) | 0 | ||||
| -rw-r--r-- | clib/cEphemeron.ml (renamed from lib/cEphemeron.ml) | 0 | ||||
| -rw-r--r-- | clib/cEphemeron.mli (renamed from lib/cEphemeron.mli) | 0 | ||||
| -rw-r--r-- | clib/cList.ml (renamed from lib/cList.ml) | 0 | ||||
| -rw-r--r-- | clib/cList.mli (renamed from lib/cList.mli) | 0 | ||||
| -rw-r--r-- | clib/cMap.ml (renamed from lib/cMap.ml) | 0 | ||||
| -rw-r--r-- | clib/cMap.mli (renamed from lib/cMap.mli) | 0 | ||||
| -rw-r--r-- | clib/cObj.ml (renamed from lib/cObj.ml) | 0 | ||||
| -rw-r--r-- | clib/cObj.mli (renamed from lib/cObj.mli) | 0 | ||||
| -rw-r--r-- | clib/cSet.ml (renamed from lib/cSet.ml) | 0 | ||||
| -rw-r--r-- | clib/cSet.mli (renamed from lib/cSet.mli) | 0 | ||||
| -rw-r--r-- | clib/cSig.mli (renamed from lib/cSig.mli) | 0 | ||||
| -rw-r--r-- | clib/cStack.ml (renamed from lib/cStack.ml) | 0 | ||||
| -rw-r--r-- | clib/cStack.mli (renamed from lib/cStack.mli) | 0 | ||||
| -rw-r--r-- | clib/cString.ml (renamed from lib/cString.ml) | 0 | ||||
| -rw-r--r-- | clib/cString.mli (renamed from lib/cString.mli) | 0 | ||||
| -rw-r--r-- | clib/cThread.ml (renamed from lib/cThread.ml) | 0 | ||||
| -rw-r--r-- | clib/cThread.mli (renamed from lib/cThread.mli) | 0 | ||||
| -rw-r--r-- | clib/cUnix.ml (renamed from lib/cUnix.ml) | 0 | ||||
| -rw-r--r-- | clib/cUnix.mli (renamed from lib/cUnix.mli) | 0 | ||||
| -rw-r--r-- | clib/canary.ml (renamed from lib/canary.ml) | 0 | ||||
| -rw-r--r-- | clib/canary.mli (renamed from lib/canary.mli) | 0 | ||||
| -rw-r--r-- | clib/clib.mllib (renamed from lib/clib.mllib) | 49 | ||||
| -rw-r--r-- | clib/deque.ml (renamed from lib/deque.ml) | 0 | ||||
| -rw-r--r-- | clib/deque.mli (renamed from lib/deque.mli) | 0 | ||||
| -rw-r--r-- | clib/dyn.ml (renamed from lib/dyn.ml) | 0 | ||||
| -rw-r--r-- | clib/dyn.mli (renamed from lib/dyn.mli) | 0 | ||||
| -rw-r--r-- | clib/exninfo.ml (renamed from lib/exninfo.ml) | 0 | ||||
| -rw-r--r-- | clib/exninfo.mli (renamed from lib/exninfo.mli) | 0 | ||||
| -rw-r--r-- | clib/hMap.ml (renamed from lib/hMap.ml) | 0 | ||||
| -rw-r--r-- | clib/hMap.mli (renamed from lib/hMap.mli) | 0 | ||||
| -rw-r--r-- | clib/hashcons.ml (renamed from lib/hashcons.ml) | 0 | ||||
| -rw-r--r-- | clib/hashcons.mli (renamed from lib/hashcons.mli) | 0 | ||||
| -rw-r--r-- | clib/hashset.ml (renamed from lib/hashset.ml) | 0 | ||||
| -rw-r--r-- | clib/hashset.mli (renamed from lib/hashset.mli) | 0 | ||||
| -rw-r--r-- | clib/heap.ml (renamed from lib/heap.ml) | 0 | ||||
| -rw-r--r-- | clib/heap.mli (renamed from lib/heap.mli) | 0 | ||||
| -rw-r--r-- | clib/iStream.ml (renamed from lib/iStream.ml) | 0 | ||||
| -rw-r--r-- | clib/iStream.mli (renamed from lib/iStream.mli) | 0 | ||||
| -rw-r--r-- | clib/int.ml (renamed from lib/int.ml) | 0 | ||||
| -rw-r--r-- | clib/int.mli (renamed from lib/int.mli) | 0 | ||||
| -rw-r--r-- | clib/minisys.ml (renamed from lib/minisys.ml) | 0 | ||||
| -rw-r--r-- | clib/monad.ml (renamed from lib/monad.ml) | 0 | ||||
| -rw-r--r-- | clib/monad.mli (renamed from lib/monad.mli) | 0 | ||||
| -rw-r--r-- | clib/option.ml (renamed from lib/option.ml) | 0 | ||||
| -rw-r--r-- | clib/option.mli (renamed from lib/option.mli) | 0 | ||||
| -rw-r--r-- | clib/predicate.ml (renamed from lib/predicate.ml) | 0 | ||||
| -rw-r--r-- | clib/predicate.mli (renamed from lib/predicate.mli) | 0 | ||||
| -rw-r--r-- | clib/segmenttree.ml (renamed from lib/segmenttree.ml) | 0 | ||||
| -rw-r--r-- | clib/segmenttree.mli (renamed from lib/segmenttree.mli) | 0 | ||||
| -rw-r--r-- | clib/store.ml (renamed from lib/store.ml) | 0 | ||||
| -rw-r--r-- | clib/store.mli (renamed from lib/store.mli) | 0 | ||||
| -rw-r--r-- | clib/terminal.ml (renamed from lib/terminal.ml) | 0 | ||||
| -rw-r--r-- | clib/terminal.mli (renamed from lib/terminal.mli) | 0 | ||||
| -rw-r--r-- | clib/trie.ml (renamed from lib/trie.ml) | 0 | ||||
| -rw-r--r-- | clib/trie.mli (renamed from lib/trie.mli) | 0 | ||||
| -rw-r--r-- | clib/unicode.ml (renamed from lib/unicode.ml) | 0 | ||||
| -rw-r--r-- | clib/unicode.mli (renamed from lib/unicode.mli) | 0 | ||||
| -rw-r--r-- | clib/unicodetable.ml (renamed from lib/unicodetable.ml) | 0 | ||||
| -rw-r--r-- | clib/unionfind.ml (renamed from lib/unionfind.ml) | 0 | ||||
| -rw-r--r-- | clib/unionfind.mli (renamed from lib/unionfind.mli) | 0 | ||||
| -rw-r--r-- | config/coq_config.mli | 1 | ||||
| -rw-r--r-- | configure.ml | 7 | ||||
| -rw-r--r-- | default.nix | 1 | ||||
| -rw-r--r-- | dev/README | 30 | ||||
| -rw-r--r-- | dev/base_include | 4 | ||||
| -rw-r--r-- | dev/build/windows/makecoq_mingw.sh | 4 | ||||
| -rw-r--r-- | dev/ci/appveyor.bat | 2 | ||||
| -rw-r--r-- | dev/ci/ci-common.sh | 11 | ||||
| -rw-r--r-- | dev/ci/user-overlays/00669-maximedenes-ssr-merge.sh | 2 | ||||
| -rw-r--r-- | dev/ci/user-overlays/01033-SkySkimmer-restrict-harder.sh | 9 | ||||
| -rw-r--r-- | dev/ci/user-overlays/06158-herbelin-master+fix-pr6158-ltac-value-printer.sh | 4 | ||||
| -rw-r--r-- | dev/ci/user-overlays/06169-Zimmi48-clean-up-deprecated-options.sh | 4 | ||||
| -rw-r--r-- | dev/ci/user-overlays/06197-ejgallego-plugins+remove_locality_hack.sh | 4 | ||||
| -rw-r--r-- | dev/ci/user-overlays/06217-coqdep-at-once.sh | 3 | ||||
| -rw-r--r-- | dev/ci/user-overlays/06324-SkySkimmer-abstract-vs-restrict.sh | 4 | ||||
| -rw-r--r-- | dev/ci/user-overlays/06392-ejgallego-econstr+fix_class.sh | 4 | ||||
| -rw-r--r-- | dev/ci/user-overlays/06405-maximedenes-rm-local-polymorphic-flag.sh | 4 | ||||
| -rw-r--r-- | dev/ci/user-overlays/06413-ejgallego-interp+less_impstyle_p2.sh | 4 | ||||
| -rw-r--r-- | dev/ci/user-overlays/06493-gares-API-remove-big-file.sh | 8 | ||||
| -rw-r--r-- | dev/ci/user-overlays/README.md | 4 | ||||
| -rw-r--r-- | dev/core.dbg | 1 | ||||
| -rw-r--r-- | dev/doc/changes.md | 17 | ||||
| -rw-r--r-- | dev/doc/debugging.md | 27 | ||||
| -rw-r--r-- | dev/doc/xml-protocol.md | 6 | ||||
| -rw-r--r-- | dev/ocamldebug-coq.run | 1 | ||||
| -rw-r--r-- | dev/top_printers.ml | 2 | ||||
| -rw-r--r-- | doc/refman/RefMan-pre.tex | 10 | ||||
| -rw-r--r-- | grammar/tacextend.mlp | 14 | ||||
| -rw-r--r-- | ide/ide_slave.ml | 4 | ||||
| -rw-r--r-- | interp/declare.ml | 2 | ||||
| -rw-r--r-- | interp/dumpglob.ml | 3 | ||||
| -rw-r--r-- | interp/implicit_quantifiers.mli | 4 | ||||
| -rw-r--r-- | intf/decl_kinds.ml | 3 | ||||
| -rw-r--r-- | intf/vernacexpr.ml | 5 | ||||
| -rw-r--r-- | kernel/cClosure.ml | 2 | ||||
| -rw-r--r-- | kernel/indtypes.ml | 2 | ||||
| -rw-r--r-- | kernel/inductive.ml | 4 | ||||
| -rw-r--r-- | kernel/nativelambda.ml | 2 | ||||
| -rw-r--r-- | kernel/subtyping.ml | 2 | ||||
| -rw-r--r-- | lib/coqProject_file.ml4 | 17 | ||||
| -rw-r--r-- | lib/coqProject_file.mli | 1 | ||||
| -rw-r--r-- | lib/flags.ml | 10 | ||||
| -rw-r--r-- | lib/flags.mli | 7 | ||||
| -rw-r--r-- | lib/lib.mllib | 39 | ||||
| -rw-r--r-- | lib/system.ml | 10 | ||||
| -rw-r--r-- | lib/system.mli | 2 | ||||
| -rw-r--r-- | parsing/g_vernac.ml4 | 3 | ||||
| -rw-r--r-- | plugins/.merlin | 1 | ||||
| -rw-r--r-- | plugins/extraction/extraction.ml | 2 | ||||
| -rw-r--r-- | plugins/funind/glob_term_to_relation.ml | 6 | ||||
| -rw-r--r-- | plugins/funind/merge.ml | 8 | ||||
| -rw-r--r-- | plugins/funind/recdef.ml | 2 | ||||
| -rw-r--r-- | plugins/ltac/extratactics.ml4 | 70 | ||||
| -rw-r--r-- | plugins/ltac/rewrite.ml | 5 | ||||
| -rw-r--r-- | plugins/ltac/taccoerce.ml | 18 | ||||
| -rw-r--r-- | plugins/ltac/taccoerce.mli | 3 | ||||
| -rw-r--r-- | plugins/ltac/tacinterp.ml | 13 | ||||
| -rw-r--r-- | pretyping/evarconv.ml | 2 | ||||
| -rw-r--r-- | pretyping/inductiveops.ml | 6 | ||||
| -rw-r--r-- | pretyping/typeclasses.ml | 14 | ||||
| -rw-r--r-- | pretyping/typeclasses.mli | 7 | ||||
| -rw-r--r-- | pretyping/unification.ml | 2 | ||||
| -rw-r--r-- | printing/ppvernac.ml | 2 | ||||
| -rw-r--r-- | printing/prettyp.ml | 4 | ||||
| -rw-r--r-- | printing/printmod.ml | 6 | ||||
| -rw-r--r-- | stm/stm.ml | 15 | ||||
| -rw-r--r-- | stm/vernac_classifier.ml | 2 | ||||
| -rw-r--r-- | tactics/hipattern.ml | 2 | ||||
| -rw-r--r-- | tactics/leminv.ml | 7 | ||||
| -rw-r--r-- | tactics/leminv.mli | 2 | ||||
| -rw-r--r-- | tactics/tacticals.mli | 2 | ||||
| -rw-r--r-- | tactics/tactics.ml | 2 | ||||
| -rwxr-xr-x | test-suite/coq-makefile/plugin-reach-outside-API-and-fail/run.sh | 36 | ||||
| -rwxr-xr-x | test-suite/coq-makefile/plugin-reach-outside-API-and-succeed-by-bypassing-the-API/run.sh | 31 | ||||
| -rw-r--r-- | test-suite/coq-makefile/template/src/test.ml4 | 1 | ||||
| -rw-r--r-- | test-suite/coq-makefile/template/src/test_aux.ml | 2 | ||||
| -rw-r--r-- | test-suite/coq-makefile/template/src/test_aux.mli | 2 | ||||
| -rw-r--r-- | theories/Arith/Between.v | 4 | ||||
| -rw-r--r-- | theories/FSets/FSetCompat.v | 44 | ||||
| -rw-r--r-- | tools/CoqMakefile.in | 2 | ||||
| -rw-r--r-- | tools/coq_makefile.ml | 50 | ||||
| -rw-r--r-- | toplevel/coqinit.ml | 6 | ||||
| -rw-r--r-- | toplevel/coqinit.mli | 2 | ||||
| -rw-r--r-- | toplevel/coqloop.ml | 10 | ||||
| -rw-r--r-- | toplevel/coqloop.mli | 4 | ||||
| -rw-r--r-- | toplevel/coqtop.ml | 39 | ||||
| -rw-r--r-- | toplevel/vernac.ml | 17 | ||||
| -rw-r--r-- | toplevel/vernac.mli | 4 | ||||
| -rw-r--r-- | vernac/auto_ind_decl.ml | 2 | ||||
| -rw-r--r-- | vernac/classes.ml | 8 | ||||
| -rw-r--r-- | vernac/comDefinition.ml | 91 | ||||
| -rw-r--r-- | vernac/comInductive.ml | 3 | ||||
| -rw-r--r-- | vernac/indschemes.ml | 6 | ||||
| -rw-r--r-- | vernac/lemmas.ml | 4 | ||||
| -rw-r--r-- | vernac/record.ml | 6 | ||||
| -rw-r--r-- | vernac/vernacentries.ml | 19 | ||||
| -rw-r--r-- | vernac/vernacprop.ml | 17 | ||||
| -rw-r--r-- | vernac/vernacprop.mli | 2 |
179 files changed, 544 insertions, 7156 deletions
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..c7437c4a4a --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +<!-- Thank you for your contribution. + Make sure you read the contributing guide and fill this template. --> + + +<!-- Keep what applies --> +**Kind:** documentation / bug fix / feature / performance / infrastructure. + + +<!-- If this is a bug fix, make sure the bug was reported beforehand. --> +Fixes / closes #???? + + +<!-- If this is a feature pull request / breaks compatibility: --> +<!-- (Otherwise, remove these lines.) --> +- [ ] Corresponding documentation was added / updated. +- [ ] Entry added in [CHANGES](/CHANGES). diff --git a/.gitignore b/.gitignore index cec51986db..27ac0631a7 100644 --- a/.gitignore +++ b/.gitignore @@ -82,8 +82,6 @@ test-suite/coq-makefile/*/html test-suite/coq-makefile/*/mlihtml test-suite/coq-makefile/*/subdir/done test-suite/coq-makefile/merlin1/.merlin -test-suite/coq-makefile/plugin-reach-outside-API-and-fail/_CoqProject -test-suite/coq-makefile/plugin-reach-outside-API-and-succeed-by-bypassing-the-API/_CoqProject test-suite/coqdoc/Coqdoc.* test-suite/coqdoc/index.html test-suite/coqdoc/coqdoc.css @@ -1,17 +1,17 @@ FLG -rectypes -thread -safe-string -w +a-4-9-27-41-42-44-45-48-50 +S clib +B clib S config B config -S ide -B ide S lib B lib -S intf -B intf S kernel B kernel S kernel/byterun B kernel/byterun +S intf +B intf S library B library S engine @@ -30,14 +30,16 @@ S parsing B parsing S stm B stm -S toplevel -B toplevel S vernac B vernac +S toplevel +B toplevel S plugins/ltac B plugins/ltac S API B API +S ide +B ide S tools B tools diff --git a/API/API.ml b/API/API.ml deleted file mode 100644 index 081ac2bb28..0000000000 --- a/API/API.ml +++ /dev/null @@ -1,286 +0,0 @@ -(************************************************************************) -(* v * The Coq Proof Assistant / The Coq Development Team *) -(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *) -(* \VV/ **************************************************************) -(* // * This file is distributed under the terms of the *) -(* * GNU Lesser General Public License Version 2.1 *) -(************************************************************************) - -(* Warning, this file respects the dependency order established in Coq. - - To see such order issue the comand: - - ``` - bash -c 'for i in kernel intf library engine pretyping interp proofs parsing printing tactics vernac stm toplevel; do echo -e "\n## $i files" && cat ${i}/${i}.mllib; done > API/link - ``` - *) - -(******************************************************************************) -(* config *) -(******************************************************************************) -module Coq_config = Coq_config - -(******************************************************************************) -(* Kernel *) -(******************************************************************************) -(* "mli" files *) -module Declarations = Declarations -module Entries = Entries - -module Names = Names -(* module Uint31 *) -module Univ = Univ -module UGraph = UGraph -module Esubst = Esubst -module Sorts = Sorts -module Evar = Evar -module Constr = Constr -module Context = Context -module Vars = Vars -module Term = Term -module Mod_subst = Mod_subst -module Cbytecodes = Cbytecodes -(* module Copcodes *) -module Cemitcodes = Cemitcodes -(* module Nativevalues *) -(* module CPrimitives *) -module Opaqueproof = Opaqueproof -module Declareops = Declareops -module Retroknowledge = Retroknowledge -module Conv_oracle = Conv_oracle -(* module Pre_env *) -(* module Cbytegen *) -(* module Nativelambda *) -(* module Nativecode *) -(* module Nativelib *) -module Environ = Environ -module CClosure = CClosure -module Reduction = Reduction -(* module Nativeconv *) -module Type_errors = Type_errors -module Modops = Modops -module Inductive = Inductive -module Typeops = Typeops -(* module Indtypes *) -(* module Cooking *) -(* module Term_typing *) -(* module Subtyping *) -module Mod_typing = Mod_typing -(* module Nativelibrary *) -module Safe_typing = Safe_typing -(* module Vm *) -(* module Csymtable *) -(* module Vconv *) - -(******************************************************************************) -(* Intf *) -(******************************************************************************) -module Constrexpr = Constrexpr -module Locus = Locus -module Glob_term = Glob_term -module Extend = Extend -module Misctypes = Misctypes -module Pattern = Pattern -module Decl_kinds = Decl_kinds -module Vernacexpr = Vernacexpr -module Notation_term = Notation_term -module Evar_kinds = Evar_kinds -module Genredexpr = Genredexpr - -(******************************************************************************) -(* Library *) -(******************************************************************************) -module Univops = Univops -module Nameops = Nameops -module Libnames = Libnames -module Globnames = Globnames -module Libobject = Libobject -module Summary = Summary -module Nametab = Nametab -module Global = Global -module Lib = Lib -module Declaremods = Declaremods -(* module Loadpath *) -module Library = Library -module States = States -module Kindops = Kindops -(* module Dischargedhypsmap *) -module Goptions = Goptions -(* module Decls *) -(* module Heads *) -module Keys = Keys -module Coqlib = Coqlib - -(******************************************************************************) -(* Engine *) -(******************************************************************************) -(* module Logic_monad *) -module Universes = Universes -module UState = UState -module Evd = Evd -module EConstr = EConstr -module Namegen = Namegen -module Termops = Termops -module Proofview_monad = Proofview_monad -module Evarutil = Evarutil -module Proofview = Proofview -module Ftactic = Ftactic -module Geninterp = Geninterp - -(******************************************************************************) -(* Pretyping *) -(******************************************************************************) -module Ltac_pretype = Ltac_pretype -module Locusops = Locusops -module Pretype_errors = Pretype_errors -module Reductionops = Reductionops -module Inductiveops = Inductiveops -(* module Vnorm *) -(* module Arguments_renaming *) -module Impargs = Impargs -(* module Nativenorm *) -module Retyping = Retyping -(* module Cbv *) -module Find_subterm = Find_subterm -(* module Evardefine *) -module Evarsolve = Evarsolve -module Recordops = Recordops -module Evarconv = Evarconv -module Typing = Typing -module Miscops = Miscops -module Glob_ops = Glob_ops -module Redops = Redops -module Patternops = Patternops -module Constr_matching = Constr_matching -module Tacred = Tacred -module Typeclasses = Typeclasses -module Classops = Classops -(* module Program *) -(* module Coercion *) -module Detyping = Detyping -module Indrec = Indrec -(* module Cases *) -module Pretyping = Pretyping -module Unification = Unification -module Univdecls = Univdecls -(******************************************************************************) -(* interp *) -(******************************************************************************) -module Tactypes = Tactypes -module Stdarg = Stdarg -module Genintern = Genintern -module Constrexpr_ops = Constrexpr_ops -module Notation_ops = Notation_ops -module Notation = Notation -module Dumpglob = Dumpglob -(* module Syntax_def *) -module Smartlocate = Smartlocate -module Topconstr = Topconstr -(* module Reserve *) -(* module Implicit_quantifiers *) -module Constrintern = Constrintern -(* module Modintern *) -module Constrextern = Constrextern -(* module Discharge *) -module Declare = Declare - -(******************************************************************************) -(* Proofs *) -(******************************************************************************) -module Miscprint = Miscprint -module Goal = Goal -module Evar_refiner = Evar_refiner -(* module Proof_using *) -module Proof_type = Proof_type -module Logic = Logic -module Refine = Refine -module Proof = Proof -module Proof_bullet = Proof_bullet -module Proof_global = Proof_global -module Redexpr = Redexpr -module Refiner = Refiner -module Tacmach = Tacmach -module Pfedit = Pfedit -module Clenv = Clenv -(* module Clenvtac *) -(* "mli" file *) - -(******************************************************************************) -(* Printing *) -(******************************************************************************) -module Genprint = Genprint -module Pputils = Pputils -module Ppconstr = Ppconstr -module Printer = Printer -(* module Printmod *) -module Prettyp = Prettyp -module Ppvernac = Ppvernac - -(******************************************************************************) -(* Parsing *) -(******************************************************************************) -module Tok = Tok -module CLexer = CLexer -module Pcoq = Pcoq -module Egramml = Egramml -(* Egramcoq *) - -module G_vernac = G_vernac -module G_proofs = G_proofs - -(******************************************************************************) -(* Tactics *) -(******************************************************************************) -(* module Dnet *) -(* module Dn *) -(* module Btermdn *) -module Tacticals = Tacticals -module Hipattern = Hipattern -module Ind_tables = Ind_tables -(* module Eqschemes *) -module Elimschemes = Elimschemes -module Tactics = Tactics -module Elim = Elim -module Equality = Equality -module Contradiction = Contradiction -module Inv = Inv -module Leminv = Leminv -module Hints = Hints -module Auto = Auto -module Eauto = Eauto -module Class_tactics = Class_tactics -(* module Term_dnet *) -module Eqdecide = Eqdecide -module Autorewrite = Autorewrite - -(******************************************************************************) -(* Vernac *) -(******************************************************************************) -(* module Vernacprop *) -module Lemmas = Lemmas -module Himsg = Himsg -module ExplainErr = ExplainErr -(* module Class *) -module Locality = Locality -module Metasyntax = Metasyntax -(* module Auto_ind_decl *) -module Search = Search -(* module Indschemes *) -module Obligations = Obligations -module ComDefinition = ComDefinition -module ComInductive = ComInductive -module ComFixpoint = ComFixpoint -module Classes = Classes -(* module Record *) -(* module Assumptions *) -module Vernacstate = Vernacstate -module Vernacinterp = Vernacinterp -module Mltop = Mltop -module Topfmt = Topfmt -module Vernacentries = Vernacentries - -(******************************************************************************) -(* Stm *) -(******************************************************************************) -module Vernac_classifier = Vernac_classifier -module Stm = Stm diff --git a/API/API.mli b/API/API.mli deleted file mode 100644 index 24a99d57f6..0000000000 --- a/API/API.mli +++ /dev/null @@ -1,6243 +0,0 @@ -(************************************************************************) -(* v * The Coq Proof Assistant / The Coq Development Team *) -(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *) -(* \VV/ **************************************************************) -(* // * This file is distributed under the terms of the *) -(* * GNU Lesser General Public License Version 2.1 *) -(************************************************************************) - -(* Warning, this file should respect the dependency order established - in Coq. To see such order issue the comand: - - ``` - bash -c 'for i in kernel intf library engine pretyping interp proofs parsing printing tactics vernac stm toplevel; do echo -e "\n## $i files" && cat ${i}/${i}.mllib; done > API/link - ``` - - Note however that files in intf/ are located manually now as their - conceptual linking order in the Coq codebase is incorrect (but it - works due to these files being implementation-free. - - See below in the file for their concrete position. -*) - -(************************************************************************) -(* Modules from config/ *) -(************************************************************************) -module Coq_config : -sig - val exec_extension : string -end - -(************************************************************************) -(* Modules from kernel/ *) -(************************************************************************) -module Names : -sig - - open Util - - module Id : - sig - type t - val equal : t -> t -> bool - val compare : t -> t -> int - val hash : t -> int - val is_valid : string -> bool - val of_bytes : bytes -> t - val of_string : string -> t - val of_string_soft : string -> t - val to_string : t -> string - val print : t -> Pp.t - - module Set : Set.S with type elt = t - module Map : Map.ExtS with type key = t and module Set := Set - module Pred : Predicate.S with type elt = t - module List : List.MonoS with type elt = t - val hcons : t -> t - end - - module Name : - sig - type t = Anonymous (** anonymous identifier *) - | Name of Id.t (** non-anonymous identifier *) - val mk_name : Id.t -> t - val is_anonymous : t -> bool - val is_name : t -> bool - val compare : t -> t -> int - val equal : t -> t -> bool - val hash : t -> int - val hcons : t -> t - val print : t -> Pp.t - end - - type name = Name.t = - | Anonymous - | Name of Id.t - [@@ocaml.deprecated "alias of API.Name.t"] - - module DirPath : - sig - type t - val empty : t - val make : Id.t list -> t - val repr : t -> Id.t list - val equal : t -> t -> bool - val to_string : t -> string - val print : t -> Pp.t - end - - module MBId : sig - type t - val equal : t -> t -> bool - val to_id : t -> Id.t - val repr : t -> int * Id.t * DirPath.t - val debug_to_string : t -> string - end - - module Label : - sig - type t - val make : string -> t - val equal : t -> t -> bool - val compare : t -> t -> int - val of_id : Id.t -> t - val to_id : t -> Id.t - val to_string : t -> string - end - - module ModPath : - sig - type t = - | MPfile of DirPath.t - | MPbound of MBId.t - | MPdot of t * Label.t - val compare : t -> t -> int - val equal : t -> t -> bool - val hash : t -> int - val initial : t - val to_string : t -> string - val debug_to_string : t -> string - end - - module KerName : - sig - type t - val make : ModPath.t -> DirPath.t -> Label.t -> t - val make2 : ModPath.t -> Label.t -> t - val modpath : t -> ModPath.t - val equal : t -> t -> bool - val compare : t -> t -> int - val label : t -> Label.t - val repr : t -> ModPath.t * DirPath.t * Label.t - val print : t -> Pp.t - val to_string : t -> string - end - - type kernel_name = KerName.t - [@@ocaml.deprecated "alias of API.Names.KerName.t"] - - module Constant : - sig - type t - val equal : t -> t -> bool - val make1 : KerName.t -> t - val make2 : ModPath.t -> Label.t -> t - val make3 : ModPath.t -> DirPath.t -> Label.t -> t - val repr3 : t -> ModPath.t * DirPath.t * Label.t - val canonical : t -> KerName.t - val user : t -> KerName.t - val label : t -> Label.t - end - - module MutInd : - sig - type t - val make1 : KerName.t -> t - val make2 : ModPath.t -> Label.t -> t - val equal : t -> t -> bool - val repr3 : t -> ModPath.t * DirPath.t * Label.t - val canonical : t -> KerName.t - val modpath : t -> ModPath.t - val label : t -> Label.t - val user : t -> KerName.t - val print : t -> Pp.t - end - - module Projection : - sig - type t - val make : Constant.t -> bool -> t - val map : (Constant.t -> Constant.t) -> t -> t - val constant : t -> Constant.t - val equal : t -> t -> bool - val unfolded : t -> bool - val unfold : t -> t - end - - type evaluable_global_reference = - | EvalVarRef of Id.t - | EvalConstRef of Constant.t - - type inductive = MutInd.t * int - val eq_ind : inductive -> inductive -> bool - - type constructor = inductive * int - val eq_constructor : constructor -> constructor -> bool - val constructor_hash : constructor -> int - - module MPset : Set.S with type elt = ModPath.t - module MPmap : Map.ExtS with type key = ModPath.t and module Set := MPset - - module KNset : CSig.SetS with type elt = KerName.t - module KNpred : Predicate.S with type elt = KerName.t - module KNmap : Map.ExtS with type key = KerName.t and module Set := KNset - - module Cpred : Predicate.S with type elt = Constant.t - module Cset : CSig.SetS with type elt = Constant.t - module Cset_env : CSig.SetS with type elt = Constant.t - - module Cmap : Map.ExtS with type key = Constant.t and module Set := Cset - module Cmap_env : Map.ExtS with type key = Constant.t and module Set := Cset_env - - module Mindset : CSig.SetS with type elt = MutInd.t - module Mindmap : Map.ExtS with type key = MutInd.t and module Set := Mindset - module Mindmap_env : CSig.MapS with type key = MutInd.t - - module Indmap : CSig.MapS with type key = inductive - module Constrmap : CSig.MapS with type key = constructor - module Indmap_env : CSig.MapS with type key = inductive - module Constrmap_env : CSig.MapS with type key = constructor - - type transparent_state = Id.Pred.t * Cpred.t - - val empty_transparent_state : transparent_state - val full_transparent_state : transparent_state - val var_full_transparent_state : transparent_state - val cst_full_transparent_state : transparent_state - - val pr_kn : KerName.t -> Pp.t - [@@ocaml.deprecated "alias of API.Names.KerName.print"] - - val eq_constant : Constant.t -> Constant.t -> bool - [@@ocaml.deprecated "alias of API.Names.Constant.equal"] - - type module_path = ModPath.t = - | MPfile of DirPath.t - | MPbound of MBId.t - | MPdot of ModPath.t * Label.t - [@@ocaml.deprecated "alias of API.Names.ModPath.t"] - - type variable = Id.t - - type 'a tableKey = - | ConstKey of 'a - | VarKey of Id.t - | RelKey of Int.t - - val id_of_string : string -> Id.t - [@@ocaml.deprecated "alias of API.Names.Id.of_string"] - - val string_of_id : Id.t -> string - [@@ocaml.deprecated "alias of API.Names.Id.to_string"] - - type mutual_inductive = MutInd.t - [@@ocaml.deprecated "alias of API.Names.MutInd.t"] - - val eq_mind : MutInd.t -> MutInd.t -> bool - [@@ocaml.deprecated "alias of API.Names.MutInd.equal"] - - val repr_con : Constant.t -> ModPath.t * DirPath.t * Label.t - [@@ocaml.deprecated "alias of API.Names.Constant.repr3"] - - val repr_mind : MutInd.t -> ModPath.t * DirPath.t * Label.t - [@@ocaml.deprecated "alias of API.Names.MutInd.repr3"] - - val initial_path : ModPath.t - [@@ocaml.deprecated "alias of API.Names.ModPath.initial"] - - val con_label : Constant.t -> Label.t - [@@ocaml.deprecated "alias of API.Names.Constant.label"] - - val mind_label : MutInd.t -> Label.t - [@@ocaml.deprecated "alias of API.Names.MutInd.label"] - - val string_of_mp : ModPath.t -> string - [@@ocaml.deprecated "alias of API.Names.ModPath.to_string"] - - val mind_of_kn : KerName.t -> MutInd.t - [@@ocaml.deprecated "alias of API.Names.MutInd.make1"] - - type constant = Constant.t - [@@ocaml.deprecated "alias of API.Names.Constant.t"] - - val mind_modpath : MutInd.t -> ModPath.t - [@@ocaml.deprecated "alias of API.Names.MutInd.modpath"] - - val canonical_mind : MutInd.t -> KerName.t - [@@ocaml.deprecated "alias of API.Names.MutInd.canonical"] - - val user_mind : MutInd.t -> KerName.t - [@@ocaml.deprecated "alias of API.Names.MutInd.user"] - - val repr_kn : KerName.t -> ModPath.t * DirPath.t * Label.t - [@@ocaml.deprecated "alias of API.Names.KerName.repr"] - - val constant_of_kn : KerName.t -> Constant.t - [@@ocaml.deprecated "alias of API.Names.Constant.make1"] - - val user_con : Constant.t -> KerName.t - [@@ocaml.deprecated "alias of API.Names.Constant.user"] - - val modpath : KerName.t -> ModPath.t - [@@ocaml.deprecated "alias of API.Names.KerName.modpath"] - - val canonical_con : Constant.t -> KerName.t - [@@ocaml.deprecated "alias of API.Names.Constant.canonical"] - - val make_kn : ModPath.t -> DirPath.t -> Label.t -> KerName.t - [@@ocaml.deprecated "alias of API.Names.KerName.make"] - - val make_con : ModPath.t -> DirPath.t -> Label.t -> Constant.t - [@@ocaml.deprecated "alias of API.Names.Constant.make3"] - - val debug_pr_con : Constant.t -> Pp.t - [@@ocaml.deprecated "Alias of Names"] - - val debug_pr_mind : MutInd.t -> Pp.t - [@@ocaml.deprecated "Alias of Names"] - - val pr_con : Constant.t -> Pp.t - [@@ocaml.deprecated "Alias of Names"] - - val string_of_con : Constant.t -> string - [@@ocaml.deprecated "Alias of Names"] - - val string_of_mind : MutInd.t -> string - [@@ocaml.deprecated "Alias of Names"] - - val debug_string_of_mind : MutInd.t -> string - [@@ocaml.deprecated "Alias of Names"] - - val debug_string_of_con : Constant.t -> string - [@@ocaml.deprecated "Alias of Names"] - - type identifier = Id.t - [@@ocaml.deprecated "Alias of Names"] - - module Idset : Set.S with type elt = Id.t and type t = Id.Set.t - [@@ocaml.deprecated "Alias of Id.Set.t"] - -end - -module Univ : -sig - - module Level : - sig - type t - val set : t - val pr : t -> Pp.t - end - - type universe_level = Level.t - [@@ocaml.deprecated "Deprecated form, see univ.ml"] - - module LSet : - sig - include CSig.SetS with type elt = Level.t - val pr : (Level.t -> Pp.t) -> t -> Pp.t - end - - module Universe : - sig - type t - val pr : t -> Pp.t - end - - type universe = Universe.t - [@@ocaml.deprecated "Deprecated form, see univ.ml"] - - module Instance : - sig - type t - val empty : t - val of_array : Level.t array -> t - val to_array : t -> Level.t array - val pr : (Level.t -> Pp.t) -> t -> Pp.t - end - - type 'a puniverses = 'a * Instance.t - - val out_punivs : 'a puniverses -> 'a - - type constraint_type = Lt | Le | Eq - - type univ_constraint = Level.t * constraint_type * Level.t - - module Constraint : sig - include Set.S with type elt = univ_constraint - end - - type 'a constrained = 'a * Constraint.t - - module UContext : - sig - type t - val empty : t - end - - type universe_context = UContext.t - [@@ocaml.deprecated "Deprecated form, see univ.ml"] - - module AUContext : - sig - type t - val empty : t - end - - type abstract_universe_context = AUContext.t - [@@ocaml.deprecated "Deprecated form, see univ.ml"] - - module CumulativityInfo : - sig - type t - end - - type cumulativity_info = CumulativityInfo.t - [@@ocaml.deprecated "Deprecated form, see univ.ml"] - - module ACumulativityInfo : - sig - type t - end - type abstract_cumulativity_info = ACumulativityInfo.t - [@@ocaml.deprecated "Deprecated form, see univ.ml"] - - module ContextSet : - sig - type t - val empty : t - val of_context : UContext.t -> t - val to_context : t -> UContext.t - end - - type 'a in_universe_context_set = 'a * ContextSet.t - type 'a in_universe_context = 'a * UContext.t - - type universe_context_set = ContextSet.t - [@@ocaml.deprecated "Deprecated form, see univ.ml"] - - type universe_set = LSet.t - [@@ocaml.deprecated "Deprecated form, see univ.ml"] - - type 'a constraint_function = 'a -> 'a -> Constraint.t -> Constraint.t - - module LMap : - sig - include CMap.ExtS with type key = Level.t and module Set := LSet - - val union : 'a t -> 'a t -> 'a t - val diff : 'a t -> 'a t -> 'a t - val subst_union : 'a option t -> 'a option t -> 'a option t - val pr : ('a -> Pp.t) -> 'a t -> Pp.t - end - - type 'a universe_map = 'a LMap.t - type universe_subst = Universe.t universe_map - type universe_level_subst = Level.t universe_map - - val enforce_leq : Universe.t constraint_function - val pr_uni : Universe.t -> Pp.t - val pr_universe_context : (Level.t -> Pp.t) -> UContext.t -> Pp.t - val pr_universe_context_set : (Level.t -> Pp.t) -> ContextSet.t -> Pp.t - val pr_universe_subst : universe_subst -> Pp.t - val pr_universe_level_subst : universe_level_subst -> Pp.t - val pr_constraints : (Level.t -> Pp.t) -> Constraint.t -> Pp.t -end - -module UGraph : -sig - type t - val pr_universes : (Univ.Level.t -> Pp.t) -> t -> Pp.t -end - -module Esubst : -sig - type 'a subs - val subs_id : int -> 'a subs -end - -module Sorts : -sig - type contents = Pos | Null - type t = - | Prop of contents - | Type of Univ.Universe.t - val is_prop : t -> bool - val hash : t -> int - - type family = InProp | InSet | InType - val family : t -> family - val univ_of_sort : t -> Univ.Universe.t -end - -module Evar : -sig - (** Unique identifier of some {i evar} *) - type t - - (** Recover the underlying integer. *) - val repr : t -> int - - val equal : t -> t -> bool - - val print : t -> Pp.t - - (** a set of unique identifiers of some {i evars} *) - module Set : Set.S with type elt = t - module Map : CMap.ExtS with type key = t and module Set := Set - -end - -module Constr : -sig - - open Names - - type t - - type constr = t - type types = t - - type cast_kind = - | VMcast - | NATIVEcast - | DEFAULTcast - | REVERTcast - - type metavariable = int - - type existential_key = Evar.t - [@@ocaml.deprecated "use Evar.t"] - - type 'constr pexistential = Evar.t * 'constr array - - type 'a puniverses = 'a Univ.puniverses - [@@ocaml.deprecated "use Univ.puniverses"] - - type pconstant = Constant.t Univ.puniverses - type pinductive = inductive Univ.puniverses - type pconstructor = constructor Univ.puniverses - - type ('constr, 'types) prec_declaration = - Name.t array * 'types array * 'constr array - - type ('constr, 'types) pfixpoint = - (int array * int) * ('constr, 'types) prec_declaration - - type ('constr, 'types) pcofixpoint = - int * ('constr, 'types) prec_declaration - - type case_style = - LetStyle | IfStyle | LetPatternStyle | MatchStyle - | RegularStyle (** infer printing form from number of constructor *) - - type case_printing = - { ind_tags : bool list; (** tell whether letin or lambda in the arity of the inductive type *) - cstr_tags : bool list array; (** tell whether letin or lambda in the signature of each constructor *) - style : case_style } - - type case_info = - { ci_ind : inductive; (* inductive type to which belongs the value that is being matched *) - ci_npar : int; (* number of parameters of the above inductive type *) - ci_cstr_ndecls : int array; (* For each constructor, the corresponding integer determines - the number of values that can be bound in a match-construct. - NOTE: parameters of the inductive type are therefore excluded from the count *) - ci_cstr_nargs : int array; (* for each constructor, the corresponding integers determines - the number of values that can be applied to the constructor, - in addition to the parameters of the related inductive type - NOTE: "lets" are therefore excluded from the count - NOTE: parameters of the inductive type are also excluded from the count *) - ci_pp_info : case_printing (* not interpreted by the kernel *) - } - - type ('constr, 'types, 'sort, 'univs) kind_of_term = - | Rel of int - | Var of Id.t - | Meta of metavariable - | Evar of 'constr pexistential - | Sort of 'sort - | Cast of 'constr * cast_kind * 'types - | Prod of Name.t * 'types * 'types - | Lambda of Name.t * 'types * 'constr - | LetIn of Name.t * 'constr * 'types * 'constr - | App of 'constr * 'constr array - | Const of (Constant.t * 'univs) - | Ind of (inductive * 'univs) - | Construct of (constructor * 'univs) - | Case of case_info * 'constr * 'constr * 'constr array - | Fix of ('constr, 'types) pfixpoint - | CoFix of ('constr, 'types) pcofixpoint - | Proj of Projection.t * 'constr - - val kind : constr -> (constr, types, Sorts.t, Univ.Instance.t) kind_of_term - val of_kind : (constr, types, Sorts.t, Univ.Instance.t) kind_of_term -> constr - - val map_with_binders : - ('a -> 'a) -> ('a -> constr -> constr) -> 'a -> constr -> constr - val map : (constr -> constr) -> constr -> constr - - val fold : ('a -> constr -> 'a) -> 'a -> constr -> 'a - val iter : (constr -> unit) -> constr -> unit - val compare_head : (constr -> constr -> bool) -> constr -> constr -> bool - - val equal : t -> t -> bool - val eq_constr_nounivs : t -> t -> bool - val compare : t -> t -> int - - val hash : t -> int - - val mkRel : int -> t - val mkVar : Id.t -> t - val mkMeta : metavariable -> t - type existential = Evar.t * constr array - val mkEvar : existential -> t - val mkSort : Sorts.t -> t - val mkProp : t - val mkSet : t - val mkType : Univ.Universe.t -> t - val mkCast : t * cast_kind * t -> t - val mkProd : Name.t * types * types -> types - val mkLambda : Name.t * types * t -> t - val mkLetIn : Name.t * t * types * t -> t - val mkApp : t * t array -> t - val map_puniverses : ('a -> 'b) -> 'a Univ.puniverses -> 'b Univ.puniverses - - type rec_declaration = Name.t array * types array * constr array - type fixpoint = (int array * int) * rec_declaration - val mkFix : fixpoint -> constr - - val mkConst : Constant.t -> t - val mkConstU : pconstant -> t - - val mkProj : (Projection.t * t) -> t - - val mkInd : inductive -> t - val mkIndU : pinductive -> t - - val mkConstruct : constructor -> t - val mkConstructU : pconstructor -> t - val mkConstructUi : pinductive * int -> t - - val mkCase : case_info * t * t * t array -> t - - (** {6 Simple case analysis} *) - val isRel : constr -> bool - val isRelN : int -> constr -> bool - val isVar : constr -> bool - val isVarId : Id.t -> constr -> bool - val isInd : constr -> bool - val isEvar : constr -> bool - val isMeta : constr -> bool - val isEvar_or_Meta : constr -> bool - val isSort : constr -> bool - val isCast : constr -> bool - val isApp : constr -> bool - val isLambda : constr -> bool - val isLetIn : constr -> bool - val isProd : constr -> bool - val isConst : constr -> bool - val isConstruct : constr -> bool - val isFix : constr -> bool - val isCoFix : constr -> bool - val isCase : constr -> bool - val isProj : constr -> bool - - val is_Prop : constr -> bool - val is_Set : constr -> bool - val isprop : constr -> bool - val is_Type : constr -> bool - val iskind : constr -> bool - val is_small : Sorts.t -> bool - - (** {6 Term destructors } *) - (** Destructor operations are partial functions and - @raise DestKO if the term has not the expected form. *) - - exception DestKO - - (** Destructs a de Bruijn index *) - val destRel : constr -> int - - (** Destructs an existential variable *) - val destMeta : constr -> metavariable - - (** Destructs a variable *) - val destVar : constr -> Id.t - - (** Destructs a sort. [is_Prop] recognizes the sort {% \textsf{%}Prop{% }%}, whether - [isprop] recognizes both {% \textsf{%}Prop{% }%} and {% \textsf{%}Set{% }%}. *) - val destSort : constr -> Sorts.t - - (** Destructs a casted term *) - val destCast : constr -> constr * cast_kind * constr - - (** Destructs the product {% $ %}(x:t_1)t_2{% $ %} *) - val destProd : types -> Name.t * types * types - - (** Destructs the abstraction {% $ %}[x:t_1]t_2{% $ %} *) - val destLambda : constr -> Name.t * types * constr - - (** Destructs the let {% $ %}[x:=b:t_1]t_2{% $ %} *) - val destLetIn : constr -> Name.t * constr * types * constr - - (** Destructs an application *) - val destApp : constr -> constr * constr array - - (** Decompose any term as an applicative term; the list of args can be empty *) - val decompose_app : constr -> constr * constr list - - (** Same as [decompose_app], but returns an array. *) - val decompose_appvect : constr -> constr * constr array - - (** Destructs a constant *) - val destConst : constr -> Constant.t Univ.puniverses - - (** Destructs an existential variable *) - val destEvar : constr -> existential - - (** Destructs a (co)inductive type *) - val destInd : constr -> inductive Univ.puniverses - - (** Destructs a constructor *) - val destConstruct : constr -> constructor Univ.puniverses - - (** Destructs a [match c as x in I args return P with ... | - Ci(...yij...) => ti | ... end] (or [let (..y1i..) := c as x in I args - return P in t1], or [if c then t1 else t2]) - @return [(info,c,fun args x => P,[|...|fun yij => ti| ...|])] - where [info] is pretty-printing information *) - val destCase : constr -> case_info * constr * constr * constr array - - (** Destructs a projection *) - val destProj : constr -> Projection.t * constr - - (** Destructs the {% $ %}i{% $ %}th function of the block - [Fixpoint f{_ 1} ctx{_ 1} = b{_ 1} - with f{_ 2} ctx{_ 2} = b{_ 2} - ... - with f{_ n} ctx{_ n} = b{_ n}], - where the length of the {% $ %}j{% $ %}th context is {% $ %}ij{% $ %}. - *) - val destFix : constr -> fixpoint - - type cofixpoint = int * rec_declaration - val destCoFix : constr -> cofixpoint - -end - -module Context : -sig - module Rel : - sig - module Declaration : - sig - (* local declaration *) - (* local declaration *) - type ('constr, 'types) pt = - | LocalAssum of Names.Name.t * 'types (** name, type *) - | LocalDef of Names.Name.t * 'constr * 'types (** name, value, type *) - - type t = (Constr.constr, Constr.types) pt - - (** Return the name bound by a given declaration. *) - val get_name : ('c, 't) pt -> Names.Name.t - - (** Return the type of the name bound by a given declaration. *) - val get_type : ('c, 't) pt -> 't - - (** Set the name that is bound by a given declaration. *) - val set_name : Names.Name.t -> ('c, 't) pt -> ('c, 't) pt - - (** Set the type of the bound variable in a given declaration. *) - val set_type : 't -> ('c, 't) pt -> ('c, 't) pt - - (** Return [true] iff a given declaration is a local assumption. *) - val is_local_assum : ('c, 't) pt -> bool - - (** Return [true] iff a given declaration is a local definition. *) - val is_local_def : ('c, 't) pt -> bool - - (** Check whether the two given declarations are equal. *) - val equal : ('c -> 'c -> bool) -> ('c, 'c) pt -> ('c, 'c) pt -> bool - - (** Map the name bound by a given declaration. *) - val map_name : (Names.Name.t -> Names.Name.t) -> ('c, 't) pt -> ('c, 't) pt - - (** For local assumptions, this function returns the original local assumptions. - For local definitions, this function maps the value in the local definition. *) - val map_value : ('c -> 'c) -> ('c, 't) pt -> ('c, 't) pt - - (** Map the type of the name bound by a given declaration. *) - val map_type : ('t -> 't) -> ('c, 't) pt -> ('c, 't) pt - - (** Map all terms in a given declaration. *) - val map_constr : ('c -> 'c) -> ('c, 'c) pt -> ('c, 'c) pt - - (** Perform a given action on all terms in a given declaration. *) - val iter_constr : ('c -> unit) -> ('c, 'c) pt -> unit - - (** Reduce all terms in a given declaration to a single value. *) - val fold_constr : ('c -> 'a -> 'a) -> ('c, 'c) pt -> 'a -> 'a - end - - (** Rel-context is represented as a list of declarations. - Inner-most declarations are at the beginning of the list. - Outer-most declarations are at the end of the list. *) - type ('constr, 'types) pt = ('constr, 'types) Declaration.pt list - type t = Declaration.t list - - (** empty rel-context *) - val empty : ('c, 't) pt - - (** Return a new rel-context enriched by with a given inner-most declaration. *) - val add : ('c, 't) Declaration.pt -> ('c, 't) pt -> ('c, 't) pt - - (** Return the number of {e local declarations} in a given context. *) - val length : ('c, 't) pt -> int - - (** Check whether given two rel-contexts are equal. *) - val equal : ('c -> 'c -> bool) -> ('c, 'c) pt -> ('c, 'c) pt -> bool - - (** Return the number of {e local assumptions} in a given rel-context. *) - val nhyps : ('c, 't) pt -> int - - (** Return a declaration designated by a given de Bruijn index. - @raise Not_found if the designated de Bruijn index outside the range. *) - val lookup : int -> ('c, 't) pt -> ('c, 't) Declaration.pt - - (** Map all terms in a given rel-context. *) - val map : ('c -> 'c) -> ('c, 'c) pt -> ('c, 'c) pt - - (** Perform a given action on every declaration in a given rel-context. *) - val iter : ('c -> unit) -> ('c, 'c) pt -> unit - - (** Reduce all terms in a given rel-context to a single value. - Innermost declarations are processed first. *) - val fold_inside : ('a -> ('c, 't) Declaration.pt -> 'a) -> init:'a -> ('c, 't) pt -> 'a - - (** Reduce all terms in a given rel-context to a single value. - Outermost declarations are processed first. *) - val fold_outside : (('c, 't) Declaration.pt -> 'a -> 'a) -> ('c, 't) pt -> init:'a -> 'a - - (** [extended_vect n Γ] does the same, returning instead an array. *) - val to_extended_vect : (int -> 'r) -> int -> ('c, 't) pt -> 'r array - end - module Named : - sig - module Declaration : - sig - (** local declaration *) - type ('constr, 'types) pt = - | LocalAssum of Names.Id.t * 'types (** identifier, type *) - | LocalDef of Names.Id.t * 'constr * 'types (** identifier, value, type *) - - type t = (Constr.constr, Constr.types) pt - - (** Return the identifier bound by a given declaration. *) - val get_id : ('c, 't) pt -> Names.Id.t - - (** Return the type of the name bound by a given declaration. *) - val get_type : ('c, 't) pt -> 't - - (** Set the identifier that is bound by a given declaration. *) - val set_id : Names.Id.t -> ('c, 't) pt -> ('c, 't) pt - - (** Set the type of the bound variable in a given declaration. *) - val set_type : 't -> ('c, 't) pt -> ('c, 't) pt - - (** Return [true] iff a given declaration is a local assumption. *) - val is_local_assum : ('c, 't) pt -> bool - - (** Return [true] iff a given declaration is a local definition. *) - val is_local_def : ('c, 't) pt -> bool - - (** Check whether any term in a given declaration satisfies a given predicate. *) - val exists : ('c -> bool) -> ('c, 'c) pt -> bool - - (** Check whether all terms in a given declaration satisfy a given predicate. *) - val for_all : ('c -> bool) -> ('c, 'c) pt -> bool - - (** Check whether the two given declarations are equal. *) - val equal : ('c -> 'c -> bool) -> ('c, 'c) pt -> ('c, 'c) pt -> bool - - (** Map the identifier bound by a given declaration. *) - val map_id : (Names.Id.t -> Names.Id.t) -> ('c, 't) pt -> ('c, 't) pt - - (** For local assumptions, this function returns the original local assumptions. - For local definitions, this function maps the value in the local definition. *) - val map_value : ('c -> 'c) -> ('c, 't) pt -> ('c, 't) pt - - (** Map the type of the name bound by a given declaration. *) - val map_type : ('t -> 't) -> ('c, 't) pt -> ('c, 't) pt - - (** Map all terms in a given declaration. *) - val map_constr : ('c -> 'c) -> ('c, 'c) pt -> ('c, 'c) pt - - (** Perform a given action on all terms in a given declaration. *) - val iter_constr : ('c -> unit) -> ('c, 'c) pt -> unit - - (** Reduce all terms in a given declaration to a single value. *) - val fold_constr : ('c -> 'a -> 'a) -> ('c, 'c) pt -> 'a -> 'a - - val to_rel_decl : ('c, 't) pt -> ('c, 't) Rel.Declaration.pt - end - (** Named-context is represented as a list of declarations. - Inner-most declarations are at the beginning of the list. - Outer-most declarations are at the end of the list. *) - type ('constr, 'types) pt = ('constr, 'types) Declaration.pt list - type t = Declaration.t list - - (** empty named-context *) - val empty : ('c, 't) pt - - (** Return a new named-context enriched by with a given inner-most declaration. *) - val add : ('c, 't) Declaration.pt -> ('c, 't) pt -> ('c, 't) pt - - (** Return the number of {e local declarations} in a given named-context. *) - val length : ('c, 't) pt -> int - - (** Return a declaration designated by an identifier of the variable bound in that declaration. - @raise Not_found if the designated identifier is not bound in a given named-context. *) - val lookup : Names.Id.t -> ('c, 't) pt -> ('c, 't) Declaration.pt - - (** Check whether given two named-contexts are equal. *) - val equal : ('c -> 'c -> bool) -> ('c, 'c) pt -> ('c, 'c) pt -> bool - - (** Map all terms in a given named-context. *) - val map : ('c -> 'c) -> ('c, 'c) pt -> ('c, 'c) pt - - (** Perform a given action on every declaration in a given named-context. *) - val iter : ('c -> unit) -> ('c, 'c) pt -> unit - - (** Reduce all terms in a given named-context to a single value. - Innermost declarations are processed first. *) - val fold_inside : ('a -> ('c, 't) Declaration.pt -> 'a) -> init:'a -> ('c, 't) pt -> 'a - - (** Reduce all terms in a given named-context to a single value. - Outermost declarations are processed first. *) - val fold_outside : (('c, 't) Declaration.pt -> 'a -> 'a) -> ('c, 't) pt -> init:'a -> 'a - - (** Return the set of all identifiers bound in a given named-context. *) - val to_vars : ('c, 't) pt -> Names.Id.Set.t - - (** [to_instance Ω] builds an instance [args] such - that [Ω ⊢ args:Ω] where [Ω] is a named-context and with the local - definitions of [Ω] skipped. Example: for [id1:T,id2:=c,id3:U], it - gives [Var id1, Var id3]. All [idj] are supposed distinct. *) - val to_instance : (Names.Id.t -> 'r) -> ('c, 't) pt -> 'r list - end -end - -module Vars : -sig - type substl = Constr.t list - - val substl : substl -> Constr.t -> Constr.t - - val subst1 : Constr.t -> Constr.t -> Constr.t - - val lift : int -> Constr.t -> Constr.t - - val closed0 : Constr.t -> bool - - val closedn : int -> Constr.t -> bool - - val replace_vars : (Names.Id.t * Constr.t) list -> Constr.t -> Constr.t - - val noccurn : int -> Constr.t -> bool - val subst_var : Names.Id.t -> Constr.t -> Constr.t - val subst_vars : Names.Id.t list -> Constr.t -> Constr.t - val substnl : substl -> int -> Constr.t -> Constr.t -end - -module Term : -sig - - open Constr - type sorts_family = Sorts.family = InProp | InSet | InType - [@@ocaml.deprecated "Alias of Sorts.family"] - - type contents = Sorts.contents = Pos | Null - [@@ocaml.deprecated "Alias of Sorts.contents"] - - type sorts = Sorts.t = - | Prop of Sorts.contents - | Type of Univ.Universe.t - [@@ocaml.deprecated "alias of API.Sorts.t"] - - type metavariable = int - [@@ocaml.deprecated "Alias of Constr.metavariable"] - - type ('constr, 'types) prec_declaration = Names.Name.t array * 'types array * 'constr array - [@@ocaml.deprecated "Alias of Constr.prec_declaration"] - - type 'constr pexistential = 'constr Constr.pexistential - [@@ocaml.deprecated "Alias of Constr.pexistential"] - - type cast_kind = Constr.cast_kind = - | VMcast - | NATIVEcast - | DEFAULTcast - | REVERTcast - [@@ocaml.deprecated "Alias of Constr.cast_kind"] - - type 'a puniverses = 'a Univ.puniverses - [@@ocaml.deprecated "Alias of Constr.puniverses"] - type pconstant = Names.Constant.t Univ.puniverses - [@@ocaml.deprecated "Alias of Constr.pconstant"] - type pinductive = Names.inductive Univ.puniverses - [@@ocaml.deprecated "Alias of Constr.pinductive"] - type pconstructor = Names.constructor Univ.puniverses - [@@ocaml.deprecated "Alias of Constr.pconstructor"] - type case_style = Constr.case_style = - | LetStyle - | IfStyle - | LetPatternStyle - | MatchStyle - | RegularStyle - [@@ocaml.deprecated "Alias of Constr.case_style"] - - type case_printing = Constr.case_printing = - { ind_tags : bool list; - cstr_tags : bool list array; - style : Constr.case_style - } - [@@ocaml.deprecated "Alias of Constr.case_printing"] - - type case_info = Constr.case_info = - { ci_ind : Names.inductive; - ci_npar : int; - ci_cstr_ndecls: int array; - ci_cstr_nargs : int array; - ci_pp_info : Constr.case_printing - } - [@@ocaml.deprecated "Alias of Constr.case_info"] - - type ('constr, 'types) pfixpoint = - (int array * int) * ('constr, 'types) Constr.prec_declaration - [@@ocaml.deprecated "Alias of Constr.pfixpoint"] - - type ('constr, 'types) pcofixpoint = - int * ('constr, 'types) Constr.prec_declaration - [@@ocaml.deprecated "Alias of Constr.pcofixpoint"] - - type ('constr, 'types, 'sort, 'univs) kind_of_term = ('constr, 'types, 'sort, 'univs) Constr.kind_of_term = - | Rel of int - | Var of Names.Id.t - | Meta of Constr.metavariable - | Evar of 'constr Constr.pexistential - | Sort of 'sort - | Cast of 'constr * Constr.cast_kind * 'types - | Prod of Names.Name.t * 'types * 'types - | Lambda of Names.Name.t * 'types * 'constr - | LetIn of Names.Name.t * 'constr * 'types * 'constr - | App of 'constr * 'constr array - | Const of (Names.Constant.t * 'univs) - | Ind of (Names.inductive * 'univs) - | Construct of (Names.constructor * 'univs) - | Case of Constr.case_info * 'constr * 'constr * 'constr array - | Fix of ('constr, 'types) Constr.pfixpoint - | CoFix of ('constr, 'types) Constr.pcofixpoint - | Proj of Names.Projection.t * 'constr - [@@ocaml.deprecated "Alias of Constr.kind_of_term"] - type existential = Evar.t * Constr.constr array - [@@ocaml.deprecated "Alias of Constr.existential"] - type rec_declaration = Names.Name.t array * Constr.constr array * Constr.constr array - [@@ocaml.deprecated "Alias of Constr.rec_declaration"] - val kind_of_term : Constr.constr -> (Constr.constr, Constr.types, Sorts.t, Univ.Instance.t) Constr.kind_of_term - [@@ocaml.deprecated "Alias of Constr.kind"] - val applistc : Constr.constr -> Constr.constr list -> Constr.constr - - val applist : constr * constr list -> constr - [@@ocaml.deprecated "(sort of an) alias of API.Term.applistc"] - - val mkArrow : types -> types -> constr - val mkRel : int -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkVar : Names.Id.t -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - - val mkMeta : Constr.metavariable -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - - val mkEvar : Constr.existential -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkSort : Sorts.t -> types - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkProp : types - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkSet : types - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkType : Univ.Universe.t -> types - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkCast : constr * Constr.cast_kind * constr -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkProd : Names.Name.t * types * types -> types - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkLambda : Names.Name.t * types * constr -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkLetIn : Names.Name.t * constr * types * constr -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkApp : constr * constr array -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkConst : Names.Constant.t -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkProj : Names.Projection.t * constr -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkInd : Names.inductive -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkConstruct : Names.constructor -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkConstructU : Names.constructor Univ.puniverses -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkConstructUi : (Constr.pinductive * int) -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkCase : Constr.case_info * constr * constr * constr array -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkFix : fixpoint -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - val mkCoFix : cofixpoint -> constr - [@@ocaml.deprecated "Alias of similarly named Constr function"] - - val mkNamedLambda : Names.Id.t -> types -> constr -> constr - val mkNamedLetIn : Names.Id.t -> constr -> types -> constr -> constr - val mkNamedProd : Names.Id.t -> types -> types -> types - - val decompose_app : constr -> constr * constr list - [@@ocaml.deprecated "Alias for the function in [Constr]"] - - val decompose_prod : constr -> (Names.Name.t*constr) list * constr - val decompose_prod_n : int -> constr -> (Names.Name.t * constr) list * constr - val decompose_prod_assum : types -> Context.Rel.t * types - val decompose_lam : constr -> (Names.Name.t * constr) list * constr - val decompose_lam_n : int -> constr -> (Names.Name.t * constr) list * constr - val decompose_prod_n_assum : int -> types -> Context.Rel.t * types - - val compose_prod : (Names.Name.t * constr) list -> constr -> constr - val compose_lam : (Names.Name.t * constr) list -> constr -> constr - - val destSort : constr -> Sorts.t - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val destVar : constr -> Names.Id.t - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val destApp : constr -> constr * constr array - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val destProd : types -> Names.Name.t * types * types - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val destLetIn : constr -> Names.Name.t * constr * types * constr - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val destEvar : constr -> Constr.existential - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val destRel : constr -> int - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val destConst : constr -> Names.Constant.t Univ.puniverses - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val destCast : constr -> constr * Constr.cast_kind * constr - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val destLambda : constr -> Names.Name.t * types * constr - [@@ocaml.deprecated "Alias for the function in [Constr]"] - - val isRel : constr -> bool - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val isVar : constr -> bool - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val isEvar : constr -> bool - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val isLetIn : constr -> bool - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val isLambda : constr -> bool - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val isConst : constr -> bool - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val isEvar_or_Meta : constr -> bool - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val isCast : constr -> bool - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val isMeta : constr -> bool - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val isApp : constr -> bool - [@@ocaml.deprecated "Alias for the function in [Constr]"] - - val fold_constr : ('a -> constr -> 'a) -> 'a -> constr -> 'a - [@@ocaml.deprecated "Alias of Constr.fold"] - - val eq_constr : constr -> constr -> bool - [@@ocaml.deprecated "Alias of Constr.equal"] - - val hash_constr : constr -> int - [@@ocaml.deprecated "Alias of Constr.hash"] - - val it_mkLambda_or_LetIn : constr -> Context.Rel.t -> constr - val it_mkProd_or_LetIn : types -> Context.Rel.t -> types - val prod_applist : constr -> constr list -> constr - - val map_constr : (constr -> constr) -> constr -> constr - [@@ocaml.deprecated "Alias of Constr.map"] - - val mkIndU : Constr.pinductive -> constr - [@@ocaml.deprecated "Alias of Constr.mkIndU"] - val mkConstU : Constr.pconstant -> constr - [@@ocaml.deprecated "Alias of Constr.mkConstU"] - val map_constr_with_binders : - ('a -> 'a) -> ('a -> constr -> constr) -> 'a -> constr -> constr - [@@ocaml.deprecated "Alias of Constr.map_with_binders"] - - val iter_constr : (constr -> unit) -> constr -> unit - [@@ocaml.deprecated "Alias of Constr.iter."] - - (* Quotients away universes: really needed? - * Can't we just call eq_c_univs_infer and discard the inferred csts? - *) - val eq_constr_nounivs : constr -> constr -> bool - [@@ocaml.deprecated "Alias of Constr.qe_constr_nounivs."] - - type ('constr, 'types) kind_of_type = - | SortType of Sorts.t - | CastType of 'types * 'types - | ProdType of Names.Name.t * 'types * 'types - | LetInType of Names.Name.t * 'constr * 'types * 'types - | AtomicType of 'constr * 'constr array - - val kind_of_type : types -> (constr, types) kind_of_type - - val is_prop_sort : Sorts.t -> bool - [@@ocaml.deprecated "alias of API.Sorts.is_prop"] - - type existential_key = Evar.t - [@@ocaml.deprecated "Alias of Constr.existential_key"] - - val family_of_sort : Sorts.t -> Sorts.family - [@@ocaml.deprecated "Alias of Sorts.family"] - - val compare : constr -> constr -> int - [@@ocaml.deprecated "Alias of Constr.compare."] - - val constr_ord : constr -> constr -> int - [@@ocaml.deprecated "alias of Term.compare"] - - val destInd : constr -> Names.inductive Univ.puniverses - [@@ocaml.deprecated "Alias for the function in [Constr]"] - val univ_of_sort : Sorts.t -> Univ.Universe.t - [@@ocaml.deprecated "Alias for the function in [Constr]"] - - val strip_lam : constr -> constr - val strip_prod_assum : types -> types - - val decompose_lam_assum : constr -> Context.Rel.t * constr - val destFix : constr -> fixpoint - [@@ocaml.deprecated "Alias for the function in [Constr]"] - - val compare_constr : (constr -> constr -> bool) -> constr -> constr -> bool - [@@ocaml.deprecated "Alias of Constr.compare_head."] - - type constr = Constr.t - [@@ocaml.deprecated "Alias of Constr.t"] - type types = Constr.t - [@@ocaml.deprecated "Alias of Constr.types"] - - type fixpoint = (int array * int) * Constr.rec_declaration - [@@ocaml.deprecated "Alias of Constr.Constr.fixpoint"] - type cofixpoint = int * Constr.rec_declaration - [@@ocaml.deprecated "Alias of Constr.cofixpoint"] - -end - -module Mod_subst : -sig - type delta_resolver - type substitution - type 'a substituted - - val force_constr : Constr.t substituted -> Constr.t - - val empty_delta_resolver : delta_resolver - val constant_of_delta_kn : delta_resolver -> Names.KerName.t -> Names.Constant.t - val mind_of_delta_kn : delta_resolver -> Names.KerName.t -> Names.MutInd.t - val subst_kn : substitution -> Names.KerName.t -> Names.KerName.t - val subst_evaluable_reference : - substitution -> Names.evaluable_global_reference -> Names.evaluable_global_reference - val subst_mps : substitution -> Constr.t -> Constr.t - val subst_constant : substitution -> Names.Constant.t -> Names.Constant.t - val subst_ind : substitution -> Names.inductive -> Names.inductive - val debug_pr_subst : substitution -> Pp.t - val debug_pr_delta : delta_resolver -> Pp.t -end - -module Opaqueproof : -sig - type opaquetab - type opaque - val empty_opaquetab : opaquetab - val force_proof : opaquetab -> opaque -> Constr.t -end - -module Cbytecodes : -sig - type tag = int - type reloc_table = (tag * int) array -end - -module Cemitcodes : -sig - type to_patch_substituted -end - -module Retroknowledge : -sig - type action - type nat_field = - | NatType - | NatPlus - | NatTimes - type n_field = - | NPositive - | NType - | NTwice - | NTwicePlusOne - | NPhi - | NPhiInv - | NPlus - | NTimes - type int31_field = - | Int31Bits - | Int31Type - | Int31Constructor - | Int31Twice - | Int31TwicePlusOne - | Int31Phi - | Int31PhiInv - | Int31Plus - | Int31PlusC - | Int31PlusCarryC - | Int31Minus - | Int31MinusC - | Int31MinusCarryC - | Int31Times - | Int31TimesC - | Int31Div21 - | Int31Div - | Int31Diveucl - | Int31AddMulDiv - | Int31Compare - | Int31Head0 - | Int31Tail0 - | Int31Lor - | Int31Land - | Int31Lxor - type field = - | KInt31 of string * int31_field -end - -module Conv_oracle : -sig - type level -end - -module Declarations : -sig - - open Names - - type recarg = - | Norec - | Mrec of Names.inductive - | Imbr of Names.inductive - type wf_paths = recarg Rtree.t - type inline = int option - type constant_def = - | Undef of inline - | Def of Constr.t Mod_subst.substituted - | OpaqueDef of Opaqueproof.opaque - type template_arity = { - template_param_levels : Univ.Level.t option list; - template_level : Univ.Universe.t; - } - - type ('a, 'b) declaration_arity = - | RegularArity of 'a - | TemplateArity of 'b - - type constant_universes = - | Monomorphic_const of Univ.ContextSet.t - | Polymorphic_const of Univ.AUContext.t - - type projection_body = { - proj_ind : Names.MutInd.t; - proj_npars : int; - proj_arg : int; - proj_type : Constr.types; - proj_eta : Constr.t * Constr.types; - proj_body : Constr.t; - } - - type typing_flags = { - check_guarded : bool; - check_universes : bool; - } - - type constant_body = { - const_hyps : Context.Named.t; - const_body : constant_def; - const_type : Constr.types; - const_body_code : Cemitcodes.to_patch_substituted option; - const_universes : constant_universes; - const_proj : projection_body option; - const_inline_code : bool; - const_typing_flags : typing_flags; - } - - type regular_inductive_arity = { - mind_user_arity : Constr.types; - mind_sort : Sorts.t; - } - - type inductive_arity = (regular_inductive_arity, template_arity) declaration_arity - - type one_inductive_body = { - mind_typename : Names.Id.t; - mind_arity_ctxt : Context.Rel.t; - mind_arity : inductive_arity; - mind_consnames : Names.Id.t array; - mind_user_lc : Constr.types array; - mind_nrealargs : int; - mind_nrealdecls : int; - mind_kelim : Sorts.family list; - mind_nf_lc : Constr.types array; - mind_consnrealargs : int array; - mind_consnrealdecls : int array; - mind_recargs : wf_paths; - mind_nb_constant : int; - mind_nb_args : int; - mind_reloc_tbl : Cbytecodes.reloc_table; - } - - type ('ty,'a) functorize = - | NoFunctor of 'a - | MoreFunctor of Names.MBId.t * 'ty * ('ty,'a) functorize - - type with_declaration = - | WithMod of Names.Id.t list * Names.ModPath.t - | WithDef of Names.Id.t list * Constr.t Univ.in_universe_context - - type module_alg_expr = - | MEident of Names.ModPath.t - | MEapply of module_alg_expr * Names.ModPath.t - | MEwith of module_alg_expr * with_declaration - - type abstract_inductive_universes = - | Monomorphic_ind of Univ.ContextSet.t - | Polymorphic_ind of Univ.AUContext.t - | Cumulative_ind of Univ.ACumulativityInfo.t - - type record_body = (Id.t * Constant.t array * projection_body array) option - - type recursivity_kind = - | Finite - | CoFinite - | BiFinite - - type mutual_inductive_body = { - mind_packets : one_inductive_body array; - mind_record : record_body option; - mind_finite : recursivity_kind; - mind_ntypes : int; - mind_hyps : Context.Named.t; - mind_nparams : int; - mind_nparams_rec : int; - mind_params_ctxt : Context.Rel.t; - mind_universes : abstract_inductive_universes; - mind_private : bool option; - mind_typing_flags : typing_flags; - } - and module_expression = (module_type_body,module_alg_expr) functorize - and module_implementation = - | Abstract - | Algebraic of module_expression - | Struct of module_signature - | FullStruct - and 'a generic_module_body = - { mod_mp : Names.ModPath.t; - mod_expr : 'a; - mod_type : module_signature; - mod_type_alg : module_expression option; - mod_constraints : Univ.ContextSet.t; - mod_delta : Mod_subst.delta_resolver; - mod_retroknowledge : 'a module_retroknowledge; - } - and module_signature = (module_type_body,structure_body) functorize - and module_body = module_implementation generic_module_body - and module_type_body = unit generic_module_body - and structure_body = (Names.Label.t * structure_field_body) list - and structure_field_body = - | SFBconst of constant_body - | SFBmind of mutual_inductive_body - | SFBmodule of module_body - | SFBmodtype of module_type_body - and _ module_retroknowledge = - | ModBodyRK : - Retroknowledge.action list -> module_implementation module_retroknowledge - | ModTypeRK : unit module_retroknowledge -end - -module Declareops : -sig - val constant_has_body : Declarations.constant_body -> bool - val is_opaque : Declarations.constant_body -> bool - val eq_recarg : Declarations.recarg -> Declarations.recarg -> bool -end - -module Entries : -sig - - open Names - open Constr - - type local_entry = - | LocalDefEntry of constr - | LocalAssumEntry of constr - - type inductive_universes = - | Monomorphic_ind_entry of Univ.ContextSet.t - | Polymorphic_ind_entry of Univ.UContext.t - | Cumulative_ind_entry of Univ.CumulativityInfo.t - - type one_inductive_entry = { - mind_entry_typename : Id.t; - mind_entry_arity : constr; - mind_entry_template : bool; (* Use template polymorphism *) - mind_entry_consnames : Id.t list; - mind_entry_lc : constr list } - - type mutual_inductive_entry = { - mind_entry_record : (Names.Id.t option) option; - (** Some (Some id): primitive record with id the binder name of the record - in projections. - Some None: non-primitive record *) - mind_entry_finite : Declarations.recursivity_kind; - mind_entry_params : (Id.t * local_entry) list; - mind_entry_inds : one_inductive_entry list; - mind_entry_universes : inductive_universes; - (* universe constraints and the constraints for subtyping of - inductive types in the block. *) - mind_entry_private : bool option; - } - - type inline = int option - type 'a proof_output = Constr.t Univ.in_universe_context_set * 'a - type 'a const_entry_body = 'a proof_output Future.computation - type constant_universes_entry = - | Monomorphic_const_entry of Univ.ContextSet.t - | Polymorphic_const_entry of Univ.UContext.t - type 'a in_constant_universes_entry = 'a * constant_universes_entry - type 'a definition_entry = - { const_entry_body : 'a const_entry_body; - (* List of section variables *) - const_entry_secctx : Context.Named.t option; - (* State id on which the completion of type checking is reported *) - const_entry_feedback : Stateid.t option; - const_entry_type : Constr.types option; - const_entry_universes : constant_universes_entry; - const_entry_opaque : bool; - const_entry_inline_code : bool } - type parameter_entry = Context.Named.t option * Constr.types in_constant_universes_entry * inline - - type projection_entry = { - proj_entry_ind : MutInd.t; - proj_entry_arg : int } - - type 'a constant_entry = - | DefinitionEntry of 'a definition_entry - | ParameterEntry of parameter_entry - | ProjectionEntry of projection_entry - type module_struct_entry = Declarations.module_alg_expr - type module_params_entry = - (Names.MBId.t * module_struct_entry) list - type module_type_entry = module_params_entry * module_struct_entry -end - -module Environ : -sig - type env - type named_context_val - - type ('constr, 'types) punsafe_judgment = - { - uj_val : 'constr; - uj_type : 'types - } - type 'types punsafe_type_judgment = { - utj_val : 'types; - utj_type : Sorts.t } - - type unsafe_type_judgment = Constr.types punsafe_type_judgment - val empty_env : env - val lookup_mind : Names.MutInd.t -> env -> Declarations.mutual_inductive_body - val push_rel : Context.Rel.Declaration.t -> env -> env - val push_rel_context : Context.Rel.t -> env -> env - val push_rec_types : Constr.rec_declaration -> env -> env - val lookup_rel : int -> env -> Context.Rel.Declaration.t - val lookup_named : Names.Id.t -> env -> Context.Named.Declaration.t - val lookup_named_val : Names.Id.t -> named_context_val -> Context.Named.Declaration.t - val lookup_constant : Names.Constant.t -> env -> Declarations.constant_body - val opaque_tables : env -> Opaqueproof.opaquetab - val is_projection : Names.Constant.t -> env -> bool - val lookup_projection : Names.Projection.t -> env -> Declarations.projection_body - val named_context_of_val : named_context_val -> Context.Named.t - val push_named : Context.Named.Declaration.t -> env -> env - val named_context : env -> Context.Named.t - val named_context_val : env -> named_context_val - val push_named_context_val : Context.Named.Declaration.t -> named_context_val -> named_context_val - val reset_with_named_context : named_context_val -> env -> env - val rel_context : env -> Context.Rel.t - val constant_value_in : env -> Names.Constant.t Univ.puniverses -> Constr.t - val named_type : Names.Id.t -> env -> Constr.types - val constant_opt_value_in : env -> Names.Constant.t Univ.puniverses -> Constr.t option - val fold_named_context_reverse : - ('a -> Context.Named.Declaration.t -> 'a) -> init:'a -> env -> 'a - val evaluable_named : Names.Id.t -> env -> bool - val push_context_set : ?strict:bool -> Univ.ContextSet.t -> env -> env -end - -module CClosure : -sig - - type table_key = Names.Constant.t Univ.puniverses Names.tableKey - - type fconstr - - type fterm = - | FRel of int - | FAtom of Constr.t (** Metas and Sorts *) - | FCast of fconstr * Constr.cast_kind * fconstr - | FFlex of table_key - | FInd of Names.inductive Univ.puniverses - | FConstruct of Names.constructor Univ.puniverses - | FApp of fconstr * fconstr array - | FProj of Names.Projection.t * fconstr - | FFix of Constr.fixpoint * fconstr Esubst.subs - | FCoFix of Constr.cofixpoint * fconstr Esubst.subs - | FCaseT of Constr.case_info * Constr.t * fconstr * Constr.t array * fconstr Esubst.subs (* predicate and branches are closures *) - | FLambda of int * (Names.Name.t * Constr.t) list * Constr.t * fconstr Esubst.subs - | FProd of Names.Name.t * fconstr * fconstr - | FLetIn of Names.Name.t * fconstr * fconstr * Constr.t * fconstr Esubst.subs - | FEvar of Constr.existential * fconstr Esubst.subs - | FLIFT of int * fconstr - | FCLOS of Constr.t * fconstr Esubst.subs - | FLOCKED - - module RedFlags : sig - type reds - type red_kind - val mkflags : red_kind list -> reds - val fBETA : red_kind - val fCOFIX : red_kind - val fCONST : Names.Constant.t -> red_kind - val fFIX : red_kind - val fMATCH : red_kind - val fZETA : red_kind - val red_add_transparent : reds -> Names.transparent_state -> reds - end - - type 'a infos_cache - type 'a infos = { - i_flags : RedFlags.reds; - i_cache : 'a infos_cache } - - type clos_infos = fconstr infos - - val mk_clos : fconstr Esubst.subs -> Constr.t -> fconstr - val mk_atom : Constr.t -> fconstr - val mk_clos_deep : - (fconstr Esubst.subs -> Constr.t -> fconstr) -> - fconstr Esubst.subs -> Constr.t -> fconstr - val mk_red : fterm -> fconstr - val all : RedFlags.reds - val beta : RedFlags.reds - val betaiota : RedFlags.reds - val betaiotazeta : RedFlags.reds - - val create_clos_infos : ?evars:(Constr.existential -> Constr.t option) -> RedFlags.reds -> Environ.env -> clos_infos - - val whd_val : clos_infos -> fconstr -> Constr.t - - val inject : Constr.t -> fconstr - - val kl : clos_infos -> fconstr -> Constr.t - val term_of_fconstr : fconstr -> Constr.t -end - -module Reduction : -sig - exception NotConvertible - type conv_pb = - | CONV - | CUMUL - - val whd_all : Environ.env -> Constr.t -> Constr.t - - val whd_betaiotazeta : Environ.env -> Constr.t -> Constr.t - - val is_arity : Environ.env -> Constr.types -> bool - - val dest_prod : Environ.env -> Constr.types -> Context.Rel.t * Constr.types - - type 'a extended_conversion_function = - ?l2r:bool -> ?reds:Names.transparent_state -> Environ.env -> - ?evars:((Constr.existential->Constr.t option) * UGraph.t) -> - 'a -> 'a -> unit - val conv : Constr.t extended_conversion_function -end - -module Type_errors : -sig - - open Names - open Constr - open Environ - - type 'constr pguard_error = - (** Fixpoints *) - | NotEnoughAbstractionInFixBody - | RecursionNotOnInductiveType of 'constr - | RecursionOnIllegalTerm of int * (env * 'constr) * int list * int list - | NotEnoughArgumentsForFixCall of int - (** CoFixpoints *) - | CodomainNotInductiveType of 'constr - | NestedRecursiveOccurrences - | UnguardedRecursiveCall of 'constr - | RecCallInTypeOfAbstraction of 'constr - | RecCallInNonRecArgOfConstructor of 'constr - | RecCallInTypeOfDef of 'constr - | RecCallInCaseFun of 'constr - | RecCallInCaseArg of 'constr - | RecCallInCasePred of 'constr - | NotGuardedForm of 'constr - | ReturnPredicateNotCoInductive of 'constr - - type arity_error = - | NonInformativeToInformative - | StrongEliminationOnNonSmallType - | WrongArity - - type ('constr, 'types) ptype_error = - | UnboundRel of int - | UnboundVar of variable - | NotAType of ('constr, 'types) punsafe_judgment - | BadAssumption of ('constr, 'types) punsafe_judgment - | ReferenceVariables of Id.t * 'constr - | ElimArity of pinductive * Sorts.family list * 'constr * ('constr, 'types) punsafe_judgment - * (Sorts.family * Sorts.family * arity_error) option - | CaseNotInductive of ('constr, 'types) punsafe_judgment - | WrongCaseInfo of pinductive * case_info - | NumberBranches of ('constr, 'types) punsafe_judgment * int - | IllFormedBranch of 'constr * pconstructor * 'constr * 'constr - | Generalization of (Name.t * 'types) * ('constr, 'types) punsafe_judgment - | ActualType of ('constr, 'types) punsafe_judgment * 'types - | CantApplyBadType of - (int * 'constr * 'constr) * ('constr, 'types) punsafe_judgment * ('constr, 'types) punsafe_judgment array - | CantApplyNonFunctional of ('constr, 'types) punsafe_judgment * ('constr, 'types) punsafe_judgment array - | IllFormedRecBody of 'constr pguard_error * Name.t array * int * env * ('constr, 'types) punsafe_judgment array - | IllTypedRecBody of - int * Name.t array * ('constr, 'types) punsafe_judgment array * 'types array - | UnsatisfiedConstraints of Univ.Constraint.t - - type type_error = (constr, types) ptype_error - - exception TypeError of Environ.env * type_error -end - -module Modops : -sig - val destr_nofunctor : ('ty,'a) Declarations.functorize -> 'a - val add_structure : - Names.ModPath.t -> Declarations.structure_body -> Mod_subst.delta_resolver -> - Environ.env -> Environ.env - val add_module_type : Names.ModPath.t -> Declarations.module_type_body -> Environ.env -> Environ.env -end - -module Inductive : -sig - type mind_specif = Declarations.mutual_inductive_body * Declarations.one_inductive_body - val type_of_inductive : Environ.env -> mind_specif Univ.puniverses -> Constr.types - exception SingletonInductiveBecomesProp of Names.Id.t - val lookup_mind_specif : Environ.env -> Names.inductive -> mind_specif - val find_inductive : Environ.env -> Constr.types -> Constr.pinductive * Constr.t list -end - -module Typeops : -sig - val infer_type : Environ.env -> Constr.types -> Environ.unsafe_type_judgment - val type_of_constant_in : Environ.env -> Constr.pconstant -> Constr.types -end - -module Mod_typing : -sig - type 'alg translation = - Declarations.module_signature * 'alg * Mod_subst.delta_resolver * Univ.ContextSet.t - val translate_modtype : - Environ.env -> Names.ModPath.t -> Entries.inline -> - Entries.module_type_entry -> Declarations.module_type_body - val translate_mse : - Environ.env -> Names.ModPath.t option -> Entries.inline -> Declarations.module_alg_expr -> - Declarations.module_alg_expr translation -end - -module Safe_typing : -sig - type private_constants - val mk_pure_proof : Constr.t -> private_constants Entries.proof_output -end - -(************************************************************************) -(* End of modules from kernel/ *) -(************************************************************************) - -(************************************************************************) -(* Modules from intf/ *) -(************************************************************************) - -module Libnames : -sig - - open Util - open Names - - type full_path - val pr_path : full_path -> Pp.t - val make_path : Names.DirPath.t -> Names.Id.t -> full_path - val eq_full_path : full_path -> full_path -> bool - val repr_path : full_path -> Names.DirPath.t * Names.Id.t - val dirpath : full_path -> Names.DirPath.t - val path_of_string : string -> full_path - - type qualid - val make_qualid : Names.DirPath.t -> Names.Id.t -> qualid - val qualid_eq : qualid -> qualid -> bool - val repr_qualid : qualid -> Names.DirPath.t * Names.Id.t - val pr_qualid : qualid -> Pp.t - val string_of_qualid : qualid -> string - val qualid_of_string : string -> qualid - val qualid_of_path : full_path -> qualid - val qualid_of_dirpath : Names.DirPath.t -> qualid - val qualid_of_ident : Names.Id.t -> qualid - - type reference = - | Qualid of qualid Loc.located - | Ident of Names.Id.t Loc.located - val loc_of_reference : reference -> Loc.t option - val qualid_of_reference : reference -> qualid Loc.located - val pr_reference : reference -> Pp.t - - val is_dirpath_prefix_of : Names.DirPath.t -> Names.DirPath.t -> bool - val split_dirpath : Names.DirPath.t -> Names.DirPath.t * Names.Id.t - val dirpath_of_string : string -> Names.DirPath.t - val pr_dirpath : Names.DirPath.t -> Pp.t - [@@ocaml.deprecated "Alias for DirPath.print"] - - val string_of_path : full_path -> string - - val basename : full_path -> Names.Id.t - - type object_name = full_path * Names.KerName.t - type object_prefix = { - obj_dir : DirPath.t; - obj_mp : ModPath.t; - obj_sec : DirPath.t; - } - - module Dirset : Set.S with type elt = DirPath.t - module Dirmap : Map.ExtS with type key = DirPath.t and module Set := Dirset - module Spmap : CSig.MapS with type key = full_path -end - -module Misctypes : -sig - type evars_flag = bool - type clear_flag = bool option - type advanced_flag = bool - type rec_flag = bool - - type 'a or_by_notation = - | AN of 'a - | ByNotation of (string * string option) Loc.located - - type 'a or_var = - | ArgArg of 'a - | ArgVar of Names.Id.t Loc.located - - type 'a and_short_name = 'a * Names.Id.t Loc.located option - - type 'a glob_sort_gen = - | GProp (** representation of [Prop] literal *) - | GSet (** representation of [Set] literal *) - | GType of 'a (** representation of [Type] literal *) - - type 'a universe_kind = - | UAnonymous - | UUnknown - | UNamed of 'a - - type level_info = Libnames.reference universe_kind - type glob_level = level_info glob_sort_gen - - type sort_info = (Libnames.reference * int) option list - type glob_sort = sort_info glob_sort_gen - - type ('a, 'b) gen_universe_decl = { - univdecl_instance : 'a; (* Declared universes *) - univdecl_extensible_instance : bool; (* Can new universes be added *) - univdecl_constraints : 'b; (* Declared constraints *) - univdecl_extensible_constraints : bool (* Can new constraints be added *) } - - type glob_constraint = glob_level * Univ.constraint_type * glob_level - - type case_style = Constr.case_style = - | LetStyle - | IfStyle - | LetPatternStyle - | MatchStyle - | RegularStyle (** infer printing form from number of constructor *) - [@@ocaml.deprecated "Alias for Constr.case_style."] - - type 'a cast_type = - | CastConv of 'a - | CastVM of 'a - | CastCoerce - | CastNative of 'a - - type 'constr intro_pattern_expr = - | IntroForthcoming of bool - | IntroNaming of intro_pattern_naming_expr - | IntroAction of 'constr intro_pattern_action_expr - and intro_pattern_naming_expr = - | IntroIdentifier of Names.Id.t - | IntroFresh of Names.Id.t - | IntroAnonymous - and 'constr intro_pattern_action_expr = - | IntroWildcard - | IntroOrAndPattern of 'constr or_and_intro_pattern_expr - | IntroInjection of ('constr intro_pattern_expr) Loc.located list - | IntroApplyOn of 'constr Loc.located * 'constr intro_pattern_expr Loc.located - | IntroRewrite of bool - and 'constr or_and_intro_pattern_expr = - | IntroOrPattern of ('constr intro_pattern_expr) Loc.located list list - | IntroAndPattern of ('constr intro_pattern_expr) Loc.located list - - type quantified_hypothesis = - | AnonHyp of int - | NamedHyp of Names.Id.t - - type 'a explicit_bindings = (quantified_hypothesis * 'a) Loc.located list - - type 'a bindings = - | ImplicitBindings of 'a list - | ExplicitBindings of 'a explicit_bindings - | NoBindings - - type 'a with_bindings = 'a * 'a bindings - - type 'a core_destruction_arg = - | ElimOnConstr of 'a - | ElimOnIdent of Names.Id.t Loc.located - | ElimOnAnonHyp of int - - type inversion_kind = - | SimpleInversion - | FullInversion - | FullInversionClear - - type multi = - | Precisely of int - | UpTo of int - | RepeatStar - | RepeatPlus - type 'id move_location = - | MoveAfter of 'id - | MoveBefore of 'id - | MoveFirst - | MoveLast - - type 'a destruction_arg = clear_flag * 'a core_destruction_arg - -end - -module Locus : -sig - type 'a occurrences_gen = - | AllOccurrences - | AllOccurrencesBut of 'a list (** non-empty *) - | NoOccurrences - | OnlyOccurrences of 'a list (** non-empty *) - type occurrences = int occurrences_gen - type occurrences_expr = (int Misctypes.or_var) occurrences_gen - type 'a with_occurrences = occurrences_expr * 'a - type hyp_location_flag = - InHyp | InHypTypeOnly | InHypValueOnly - type 'a hyp_location_expr = 'a with_occurrences * hyp_location_flag - type 'id clause_expr = - { onhyps : 'id hyp_location_expr list option; - concl_occs : occurrences_expr } - type clause = Names.Id.t clause_expr - type hyp_location = Names.Id.t * hyp_location_flag - type goal_location = hyp_location option -end - -(************************************************************************) -(* End Modules from intf/ *) -(************************************************************************) - -(************************************************************************) -(* Modules from library/ *) -(************************************************************************) - -module Univops : -sig - val universes_of_constr : Environ.env -> Constr.constr -> Univ.LSet.t - val restrict_universe_context : Univ.ContextSet.t -> Univ.LSet.t -> Univ.ContextSet.t -end - -module Nameops : -sig - - open Names - - val atompart_of_id : Names.Id.t -> string - - val pr_id : Names.Id.t -> Pp.t - [@@ocaml.deprecated "alias of API.Names.Id.print"] - - val pr_name : Names.Name.t -> Pp.t - [@@ocaml.deprecated "alias of API.Names.Name.print"] - - module Name : sig - include module type of struct include Name end - - val map : (Id.t -> Id.t) -> Name.t -> t - val get_id : t -> Names.Id.t - val fold_right : (Names.Id.t -> 'a -> 'a) -> t -> 'a -> 'a - - end - - val name_fold : (Id.t -> 'a -> 'a) -> Name.t -> 'a -> 'a - [@@ocaml.deprecated "alias of API.Names"] - - val name_app : (Id.t -> Id.t) -> Name.t -> Name.t - [@@ocaml.deprecated "alias of API.Names"] - - val add_suffix : Id.t -> string -> Id.t - val increment_subscript : Id.t -> Id.t - val make_ident : string -> int option -> Id.t - val out_name : Name.t -> Id.t - [@@ocaml.deprecated "alias of API.Names"] - val pr_lab : Label.t -> Pp.t - [@@ocaml.deprecated "alias of API.Names"] -end - -module Globnames : -sig - - open Util - - type global_reference = - | VarRef of Names.Id.t - | ConstRef of Names.Constant.t - | IndRef of Names.inductive - | ConstructRef of Names.constructor - - type extended_global_reference = - | TrueGlobal of global_reference - | SynDef of Names.KerName.t - - (* Long term: change implementation so that only 1 kind of order is needed. - * Today: _env ones are fine grained, which one to pick depends. Eg. - * - conversion rule are implemented by the non_env ones - * - pretty printing (of user provided names/aliases) are implemented by - * the _env ones - *) - module Refset : CSig.SetS with type elt = global_reference - module Refmap : Map.ExtS - with type key = global_reference and module Set := Refset - - module Refset_env : CSig.SetS with type elt = global_reference - module Refmap_env : Map.ExtS - with type key = global_reference and module Set := Refset_env - - module RefOrdered : - sig - type t = global_reference - val compare : t -> t -> int - end - - val pop_global_reference : global_reference -> global_reference - val eq_gr : global_reference -> global_reference -> bool - val destIndRef : global_reference -> Names.inductive - - val encode_mind : Names.DirPath.t -> Names.Id.t -> Names.MutInd.t - val encode_con : Names.DirPath.t -> Names.Id.t -> Names.Constant.t - - val global_of_constr : Constr.t -> global_reference - - val subst_global : Mod_subst.substitution -> global_reference -> global_reference * Constr.t - val destConstructRef : global_reference -> Names.constructor - - val reference_of_constr : Constr.t -> global_reference - [@@ocaml.deprecated "alias of API.Globnames.global_of_constr"] - - val is_global : global_reference -> Constr.t -> bool -end - -(******************************************************************************) -(* XXX: Moved from intf *) -(******************************************************************************) -module Pattern : -sig - - type case_info_pattern = - { cip_style : Constr.case_style; - cip_ind : Names.inductive option; - cip_ind_tags : bool list option; (** indicates LetIn/Lambda in arity *) - cip_extensible : bool (** does this match end with _ => _ ? *) } - - type constr_pattern = - | PRef of Globnames.global_reference - | PVar of Names.Id.t - | PEvar of Evar.t * constr_pattern array - | PRel of int - | PApp of constr_pattern * constr_pattern array - | PSoApp of Names.Id.t * constr_pattern list - | PProj of Names.Projection.t * constr_pattern - | PLambda of Names.Name.t * constr_pattern * constr_pattern - | PProd of Names.Name.t * constr_pattern * constr_pattern - | PLetIn of Names.Name.t * constr_pattern * constr_pattern option * constr_pattern - | PSort of Misctypes.glob_sort - | PMeta of Names.Id.t option - | PIf of constr_pattern * constr_pattern * constr_pattern - | PCase of case_info_pattern * constr_pattern * constr_pattern * - (int * bool list * constr_pattern) list (** index of constructor, nb of args *) - | PFix of Constr.fixpoint - | PCoFix of Constr.cofixpoint - -end - -module Evar_kinds : -sig - type obligation_definition_status = - | Define of bool - | Expand - - type matching_var_kind = - | FirstOrderPatVar of Names.Id.t - | SecondOrderPatVar of Names.Id.t - - type t = - | ImplicitArg of Globnames.global_reference * (int * Names.Id.t option) - * bool (** Force inference *) - | BinderType of Names.Name.t - | NamedHole of Names.Id.t (* coming from some ?[id] syntax *) - | QuestionMark of obligation_definition_status * Names.Name.t - | CasesType of bool (* true = a subterm of the type *) - | InternalHole - | TomatchTypeParameter of Names.inductive * int - | GoalEvar - | ImpossibleCase - | MatchingVar of matching_var_kind - | VarInstance of Names.Id.t - | SubEvar of Evar.t -end - -module Decl_kinds : -sig - type polymorphic = bool - type cumulative_inductive_flag = bool - type recursivity_kind = Declarations.recursivity_kind = - | Finite - | CoFinite - | BiFinite - [@@ocaml.deprecated "Please use [Declarations.recursivity_kind"] - - type discharge = - | DoDischarge - | NoDischarge - - type locality = - | Discharge - | Local - | Global - - type definition_object_kind = - | Definition - | Coercion - | SubClass - | CanonicalStructure - | Example - | Fixpoint - | CoFixpoint - | Scheme - | StructureComponent - | IdentityCoercion - | Instance - | Method - | Let - type theorem_kind = - | Theorem - | Lemma - | Fact - | Remark - | Property - | Proposition - | Corollary - type goal_object_kind = - | DefinitionBody of definition_object_kind - | Proof of theorem_kind - type goal_kind = locality * polymorphic * goal_object_kind - type assumption_object_kind = - | Definitional - | Logical - | Conjectural - type logical_kind = - | IsAssumption of assumption_object_kind - | IsDefinition of definition_object_kind - | IsProof of theorem_kind - type binding_kind = - | Explicit - | Implicit - type private_flag = bool - type definition_kind = locality * polymorphic * definition_object_kind -end - -module Glob_term : -sig - type 'a cases_pattern_r = - | PatVar of Names.Name.t - | PatCstr of Names.constructor * 'a cases_pattern_g list * Names.Name.t - and 'a cases_pattern_g = ('a cases_pattern_r, 'a) DAst.t - type cases_pattern = [ `any ] cases_pattern_g - type existential_name = Names.Id.t - type 'a glob_constr_r = - | GRef of Globnames.global_reference * Misctypes.glob_level list option - (** An identifier that represents a reference to an object defined - either in the (global) environment or in the (local) context. *) - | GVar of Names.Id.t - (** An identifier that cannot be regarded as "GRef". - Bound variables are typically represented this way. *) - | GEvar of existential_name * (Names.Id.t * 'a glob_constr_g) list - | GPatVar of Evar_kinds.matching_var_kind - | GApp of 'a glob_constr_g * 'a glob_constr_g list - | GLambda of Names.Name.t * Decl_kinds.binding_kind * 'a glob_constr_g * 'a glob_constr_g - | GProd of Names.Name.t * Decl_kinds.binding_kind * 'a glob_constr_g * 'a glob_constr_g - | GLetIn of Names.Name.t * 'a glob_constr_g * 'a glob_constr_g option * 'a glob_constr_g - | GCases of Constr.case_style * 'a glob_constr_g option * 'a tomatch_tuples_g * 'a cases_clauses_g - | GLetTuple of Names.Name.t list * (Names.Name.t * 'a glob_constr_g option) * 'a glob_constr_g * 'a glob_constr_g - | GIf of 'a glob_constr_g * (Names.Name.t * 'a glob_constr_g option) * 'a glob_constr_g * 'a glob_constr_g - | GRec of 'a fix_kind_g * Names.Id.t array * 'a glob_decl_g list array * - 'a glob_constr_g array * 'a glob_constr_g array - | GSort of Misctypes.glob_sort - | GHole of Evar_kinds.t * Misctypes.intro_pattern_naming_expr * Genarg.glob_generic_argument option - | GCast of 'a glob_constr_g * 'a glob_constr_g Misctypes.cast_type - - and 'a glob_constr_g = ('a glob_constr_r, 'a) DAst.t - - and 'a glob_decl_g = Names.Name.t * Decl_kinds.binding_kind * 'a glob_constr_g option * 'a glob_constr_g - - and 'a fix_recursion_order_g = - | GStructRec - | GWfRec of 'a glob_constr_g - | GMeasureRec of 'a glob_constr_g * 'a glob_constr_g option - - and 'a fix_kind_g = - | GFix of ((int option * 'a fix_recursion_order_g) array * int) - | GCoFix of int - - and 'a predicate_pattern_g = - Names.Name.t * (Names.inductive * Names.Name.t list) Loc.located option - - and 'a tomatch_tuple_g = ('a glob_constr_g * 'a predicate_pattern_g) - - and 'a tomatch_tuples_g = 'a tomatch_tuple_g list - - and 'a cases_clause_g = (Names.Id.t list * 'a cases_pattern_g list * 'a glob_constr_g) Loc.located - and 'a cases_clauses_g = 'a cases_clause_g list - - type glob_constr = [ `any ] glob_constr_g - type tomatch_tuple = [ `any ] tomatch_tuple_g - type tomatch_tuples = [ `any ] tomatch_tuples_g - type cases_clause = [ `any ] cases_clause_g - type cases_clauses = [ `any ] cases_clauses_g - type glob_decl = [ `any ] glob_decl_g - type fix_kind = [ `any ] fix_kind_g - type predicate_pattern = [ `any ] predicate_pattern_g - type any_glob_constr = - | AnyGlobConstr : 'r glob_constr_g -> any_glob_constr - -end - -module Notation_term : -sig - type scope_name = string - type notation_var_instance_type = - | NtnTypeConstr | NtnTypeOnlyBinder | NtnTypeConstrList | NtnTypeBinderList - type tmp_scope_name = scope_name - - type subscopes = tmp_scope_name option * scope_name list - type notation_constr = - | NRef of Globnames.global_reference - | NVar of Names.Id.t - | NApp of notation_constr * notation_constr list - | NHole of Evar_kinds.t * Misctypes.intro_pattern_naming_expr * Genarg.glob_generic_argument option - | NList of Names.Id.t * Names.Id.t * notation_constr * notation_constr * bool - | NLambda of Names.Name.t * notation_constr * notation_constr - | NProd of Names.Name.t * notation_constr * notation_constr - | NBinderList of Names.Id.t * Names.Id.t * notation_constr * notation_constr - | NLetIn of Names.Name.t * notation_constr * notation_constr option * notation_constr - | NCases of Constr.case_style * notation_constr option * - (notation_constr * (Names.Name.t * (Names.inductive * Names.Name.t list) option)) list * - (Glob_term.cases_pattern list * notation_constr) list - | NLetTuple of Names.Name.t list * (Names.Name.t * notation_constr option) * - notation_constr * notation_constr - | NIf of notation_constr * (Names.Name.t * notation_constr option) * - notation_constr * notation_constr - | NRec of Glob_term.fix_kind * Names.Id.t array * - (Names.Name.t * notation_constr option * notation_constr) list array * - notation_constr array * notation_constr array - | NSort of Misctypes.glob_sort - | NCast of notation_constr * notation_constr Misctypes.cast_type - type interpretation = (Names.Id.t * (subscopes * notation_var_instance_type)) list * - notation_constr - type precedence = int - type parenRelation = - | L | E | Any | Prec of precedence - type tolerability = precedence * parenRelation -end - -module Constrexpr : -sig - - type binder_kind = - | Default of Decl_kinds.binding_kind - | Generalized of Decl_kinds.binding_kind * Decl_kinds.binding_kind * bool - - type explicitation = - | ExplByPos of int * Names.Id.t option - | ExplByName of Names.Id.t - type sign = bool - type raw_natural_number = string - type prim_token = - | Numeral of raw_natural_number * sign - | String of string - - type notation = string - type instance_expr = Misctypes.glob_level list - type proj_flag = int option - type abstraction_kind = - | AbsLambda - | AbsPi - - type cases_pattern_expr_r = - | CPatAlias of cases_pattern_expr * Names.Id.t - | CPatCstr of Libnames.reference - * cases_pattern_expr list option * cases_pattern_expr list - (** [CPatCstr (_, c, Some l1, l2)] represents (@c l1) l2 *) - | CPatAtom of Libnames.reference option - | CPatOr of cases_pattern_expr list - | CPatNotation of notation * cases_pattern_notation_substitution - * cases_pattern_expr list - | CPatPrim of prim_token - | CPatRecord of (Libnames.reference * cases_pattern_expr) list - | CPatDelimiters of string * cases_pattern_expr - | CPatCast of cases_pattern_expr * constr_expr - and cases_pattern_expr = cases_pattern_expr_r CAst.t - - and cases_pattern_notation_substitution = - cases_pattern_expr list * cases_pattern_expr list list - - and constr_expr_r = - | CRef of Libnames.reference * instance_expr option - | CFix of Names.Id.t Loc.located * fix_expr list - | CCoFix of Names.Id.t Loc.located * cofix_expr list - | CProdN of binder_expr list * constr_expr - | CLambdaN of binder_expr list * constr_expr - | CLetIn of Names.Name.t Loc.located * constr_expr * constr_expr option * constr_expr - | CAppExpl of (proj_flag * Libnames.reference * instance_expr option) * constr_expr list - | CApp of (proj_flag * constr_expr) * - (constr_expr * explicitation Loc.located option) list - | CRecord of (Libnames.reference * constr_expr) list - | CCases of Constr.case_style - * constr_expr option - * case_expr list - * branch_expr list - | CLetTuple of Names.Name.t Loc.located list * (Names.Name.t Loc.located option * constr_expr option) * - constr_expr * constr_expr - | CIf of constr_expr * (Names.Name.t Loc.located option * constr_expr option) - * constr_expr * constr_expr - | CHole of Evar_kinds.t option * Misctypes.intro_pattern_naming_expr * Genarg.raw_generic_argument option - | CPatVar of Names.Id.t - | CEvar of Names.Id.t * (Names.Id.t * constr_expr) list - | CSort of Misctypes.glob_sort - | CCast of constr_expr * constr_expr Misctypes.cast_type - | CNotation of notation * constr_notation_substitution - | CGeneralization of Decl_kinds.binding_kind * abstraction_kind option * constr_expr - | CPrim of prim_token - | CDelimiters of string * constr_expr - and constr_expr = constr_expr_r CAst.t - - and case_expr = constr_expr * Names.Name.t Loc.located option * cases_pattern_expr option - - and branch_expr = - (cases_pattern_expr list list * constr_expr) Loc.located - - and binder_expr = - Names.Name.t Loc.located list * binder_kind * constr_expr - - and fix_expr = - Names.Id.t Loc.located * (Names.Id.t Loc.located option * recursion_order_expr) * - local_binder_expr list * constr_expr * constr_expr - - and cofix_expr = - Names.Id.t Loc.located * local_binder_expr list * constr_expr * constr_expr - - and recursion_order_expr = - | CStructRec - | CWfRec of constr_expr - | CMeasureRec of constr_expr * constr_expr option - - and local_binder_expr = - | CLocalAssum of Names.Name.t Loc.located list * binder_kind * constr_expr - | CLocalDef of Names.Name.t Loc.located * constr_expr * constr_expr option - | CLocalPattern of (cases_pattern_expr * constr_expr option) Loc.located - - and constr_notation_substitution = - constr_expr list * - constr_expr list list * - local_binder_expr list list - - type constr_pattern_expr = constr_expr -end - -module Genredexpr : -sig - - (** The parsing produces initially a list of [red_atom] *) - type 'a red_atom = - | FBeta - | FMatch - | FFix - | FCofix - | FZeta - | FConst of 'a list - | FDeltaBut of 'a list - - (** This list of atoms is immediately converted to a [glob_red_flag] *) - type 'a glob_red_flag = { - rBeta : bool; - rMatch : bool; - rFix : bool; - rCofix : bool; - rZeta : bool; - rDelta : bool; (** true = delta all but rConst; false = delta only on rConst*) - rConst : 'a list - } - - (** Generic kinds of reductions *) - type ('a,'b,'c) red_expr_gen = - | Red of bool - | Hnf - | Simpl of 'b glob_red_flag*('b,'c) Util.union Locus.with_occurrences option - | Cbv of 'b glob_red_flag - | Cbn of 'b glob_red_flag - | Lazy of 'b glob_red_flag - | Unfold of 'b Locus.with_occurrences list - | Fold of 'a list - | Pattern of 'a Locus.with_occurrences list - | ExtraRedExpr of string - | CbvVm of ('b,'c) Util.union Locus.with_occurrences option - | CbvNative of ('b,'c) Util.union Locus.with_occurrences option - - type ('a,'b,'c) may_eval = - | ConstrTerm of 'a - | ConstrEval of ('a,'b,'c) red_expr_gen * 'a - | ConstrContext of Names.Id.t Loc.located * 'a - | ConstrTypeOf of 'a - - type r_trm = Constrexpr.constr_expr - type r_pat = Constrexpr.constr_pattern_expr - type r_cst = Libnames.reference Misctypes.or_by_notation - type raw_red_expr = (r_trm, r_cst, r_pat) red_expr_gen -end - -(******************************************************************************) -(* XXX: end of moved from intf *) -(******************************************************************************) - -module Libobject : -sig - type obj - type 'a substitutivity = - | Dispose - | Substitute of 'a - | Keep of 'a - | Anticipate of 'a - - type 'a object_declaration = { - object_name : string; - cache_function : Libnames.object_name * 'a -> unit; - load_function : int -> Libnames.object_name * 'a -> unit; - open_function : int -> Libnames.object_name * 'a -> unit; - classify_function : 'a -> 'a substitutivity; - subst_function : Mod_subst.substitution * 'a -> 'a; - discharge_function : Libnames.object_name * 'a -> 'a option; - rebuild_function : 'a -> 'a - } - val declare_object : 'a object_declaration -> ('a -> obj) - val default_object : string -> 'a object_declaration - val object_tag : obj -> string -end - -module Summary : -sig - - type frozen - - type marshallable = - [ `Yes (* Full data will be marshalled to disk *) - | `No (* Full data will be store in memory, e.g. for Undo *) - | `Shallow ] (* Only part of the data will be marshalled to a slave process *) - - type 'a summary_declaration = - { freeze_function : marshallable -> 'a; - unfreeze_function : 'a -> unit; - init_function : unit -> unit; } - - val ref : ?freeze:(marshallable -> 'a -> 'a) -> name:string -> 'a -> 'a ref - val declare_summary : string -> 'a summary_declaration -> unit - module Local : - sig - type 'a local_ref - val ref : ?freeze:('a -> 'a) -> name:string -> 'a -> 'a local_ref - val (:=) : 'a local_ref -> 'a -> unit - val (!) : 'a local_ref -> 'a - end -end - -module Nametab : -sig - exception GlobalizationError of Libnames.qualid - - val global : Libnames.reference -> Globnames.global_reference - val global_of_path : Libnames.full_path -> Globnames.global_reference - val shortest_qualid_of_global : Names.Id.Set.t -> Globnames.global_reference -> Libnames.qualid - val path_of_global : Globnames.global_reference -> Libnames.full_path - val locate_extended : Libnames.qualid -> Globnames.extended_global_reference - val full_name_module : Libnames.qualid -> Names.DirPath.t - val pr_global_env : Names.Id.Set.t -> Globnames.global_reference -> Pp.t - val basename_of_global : Globnames.global_reference -> Names.Id.t - - type visibility = - | Until of int - | Exactly of int - - val error_global_not_found : ?loc:Loc.t -> Libnames.qualid -> 'a - val shortest_qualid_of_module : Names.ModPath.t -> Libnames.qualid - val dirpath_of_module : Names.ModPath.t -> Names.DirPath.t - val locate_module : Libnames.qualid -> Names.ModPath.t - val dirpath_of_global : Globnames.global_reference -> Names.DirPath.t - val locate : Libnames.qualid -> Globnames.global_reference - val locate_constant : Libnames.qualid -> Names.Constant.t - - (** NOT FOR PUBLIC USE YET. Plugin writers, please do not rely on this API. *) - - module type UserName = sig - type t - val equal : t -> t -> bool - val to_string : t -> string - val repr : t -> Names.Id.t * Names.Id.t list - end - - module type EqualityType = - sig - type t - val equal : t -> t -> bool - end - - module type NAMETREE = sig - type elt - type t - type user_name - - val empty : t - val push : visibility -> user_name -> elt -> t -> t - val locate : Libnames.qualid -> t -> elt - val find : user_name -> t -> elt - val exists : user_name -> t -> bool - val user_name : Libnames.qualid -> t -> user_name - val shortest_qualid : Names.Id.Set.t -> user_name -> t -> Libnames.qualid - val find_prefixes : Libnames.qualid -> t -> elt list - end - - module Make (U : UserName) (E : EqualityType) : - NAMETREE with type user_name = U.t and type elt = E.t - -end - -module Global : -sig - val env : unit -> Environ.env - val lookup_mind : Names.MutInd.t -> Declarations.mutual_inductive_body - val lookup_constant : Names.Constant.t -> Declarations.constant_body - val lookup_module : Names.ModPath.t -> Declarations.module_body - val lookup_modtype : Names.ModPath.t -> Declarations.module_type_body - val lookup_inductive : Names.inductive -> Declarations.mutual_inductive_body * Declarations.one_inductive_body - val constant_of_delta_kn : Names.KerName.t -> Names.Constant.t - val register : - Retroknowledge.field -> Constr.t -> Constr.t -> unit - val env_of_context : Environ.named_context_val -> Environ.env - val is_polymorphic : Globnames.global_reference -> bool - - val constr_of_global_in_context : Environ.env -> - Globnames.global_reference -> Constr.types * Univ.AUContext.t - - val type_of_global_in_context : Environ.env -> - Globnames.global_reference -> Constr.types * Univ.AUContext.t - - val current_dirpath : unit -> Names.DirPath.t - val body_of_constant_body : Declarations.constant_body -> (Constr.t * Univ.AUContext.t) option - val body_of_constant : Names.Constant.t -> (Constr.t * Univ.AUContext.t) option - val add_constraints : Univ.Constraint.t -> unit -end - -module Lib : sig - type is_type = bool - type export = bool option - type node = - | Leaf of Libobject.obj (* FIX: horrible hack (wrt. Enrico) *) - | CompilingLibrary of Libnames.object_prefix - | OpenedModule of is_type * export * Libnames.object_prefix * Summary.frozen - | ClosedModule of library_segment - | OpenedSection of Libnames.object_prefix * Summary.frozen - | ClosedSection of library_segment - - and library_segment = (Libnames.object_name * node) list - - val current_mp : unit -> Names.ModPath.t - val is_modtype : unit -> bool - val is_module : unit -> bool - val sections_are_opened : unit -> bool - val add_anonymous_leaf : ?cache_first:bool -> Libobject.obj -> unit - val contents : unit -> library_segment - val cwd : unit -> Names.DirPath.t - val add_leaf : Names.Id.t -> Libobject.obj -> Libnames.object_name - val make_kn : Names.Id.t -> Names.KerName.t - val make_path : Names.Id.t -> Libnames.full_path - val discharge_con : Names.Constant.t -> Names.Constant.t - val discharge_inductive : Names.inductive -> Names.inductive -end - -module Declaremods : -sig - - val append_end_library_hook : (unit -> unit) -> unit - -end - -module Library : -sig - val library_is_loaded : Names.DirPath.t -> bool - val loaded_libraries : unit -> Names.DirPath.t list -end - -module States : -sig - type state - - val with_state_protection : ('a -> 'b) -> 'a -> 'b -end - -module Kindops : -sig - val logical_kind_of_goal_kind : Decl_kinds.goal_object_kind -> Decl_kinds.logical_kind -end - -module Goptions : -sig - type option_name = string list - type 'a option_sig = - { - optdepr : bool; - optname : string; - optkey : option_name; - optread : unit -> 'a; - optwrite : 'a -> unit - } - - type 'a write_function = 'a -> unit - - val declare_bool_option : ?preprocess:(bool -> bool) -> - bool option_sig -> bool write_function - val declare_int_option : ?preprocess:(int option -> int option) -> - int option option_sig -> int option write_function - val declare_string_option: ?preprocess:(string -> string) -> - string option_sig -> string write_function - val set_bool_option_value : option_name -> bool -> unit -end - -module Keys : -sig - type key - val constr_key : ('a -> ('a, 't, 'u, 'i) Constr.kind_of_term) -> 'a -> key option - val declare_equiv_keys : key -> key -> unit - val pr_keys : (Globnames.global_reference -> Pp.t) -> Pp.t -end - -module Coqlib : -sig - - type coq_eq_data = { eq : Globnames.global_reference; - ind : Globnames.global_reference; - refl : Globnames.global_reference; - sym : Globnames.global_reference; - trans: Globnames.global_reference; - congr: Globnames.global_reference; - } - - type coq_sigma_data = { - proj1 : Globnames.global_reference; - proj2 : Globnames.global_reference; - elim : Globnames.global_reference; - intro : Globnames.global_reference; - typ : Globnames.global_reference } - val find_reference : string -> string list -> string -> Globnames.global_reference - val check_required_library : string list -> unit - val logic_module_name : string list - val glob_true : Globnames.global_reference - val glob_false : Globnames.global_reference - val glob_O : Globnames.global_reference - val glob_S : Globnames.global_reference - val nat_path : Libnames.full_path - val datatypes_module_name : string list - val glob_eq : Globnames.global_reference - val build_coq_eq_sym : Globnames.global_reference Util.delayed - val build_coq_False : Globnames.global_reference Util.delayed - val build_coq_not : Globnames.global_reference Util.delayed - val build_coq_eq : Globnames.global_reference Util.delayed - val build_coq_eq_data : coq_eq_data Util.delayed - val path_of_O : Names.constructor - val path_of_S : Names.constructor - val build_prod : coq_sigma_data Util.delayed - val build_coq_True : Globnames.global_reference Util.delayed - val coq_iff_ref : Globnames.global_reference lazy_t - val build_coq_iff_left_proj : Globnames.global_reference Util.delayed - val build_coq_iff_right_proj : Globnames.global_reference Util.delayed - val init_modules : string list list - val build_coq_eq_refl : Globnames.global_reference Util.delayed - val arith_modules : string list list - val zarith_base_modules : string list list - val gen_reference_in_modules : string -> string list list-> string -> Globnames.global_reference - val jmeq_module_name : string list - val coq_eq_ref : Globnames.global_reference lazy_t - val coq_not_ref : Globnames.global_reference lazy_t - val coq_or_ref : Globnames.global_reference lazy_t - val build_coq_and : Globnames.global_reference Util.delayed - val build_coq_or : Globnames.global_reference Util.delayed - val build_coq_I : Globnames.global_reference Util.delayed - val coq_reference : string -> string list -> string -> Globnames.global_reference -end - -(************************************************************************) -(* End of modules from library/ *) -(************************************************************************) - -(************************************************************************) -(* Modules from engine/ *) -(************************************************************************) - -module Universes : -sig - type universe_binders - type universe_opt_subst - val fresh_inductive_instance : Environ.env -> Names.inductive -> Constr.pinductive Univ.in_universe_context_set - val new_Type : unit -> Constr.types - val type_of_global : Globnames.global_reference -> Constr.types Univ.in_universe_context_set - val constr_of_global : Globnames.global_reference -> Constr.t - val new_univ_level : unit -> Univ.Level.t - val new_sort_in_family : Sorts.family -> Sorts.t - val pr_with_global_universes : Univ.Level.t -> Pp.t - val pr_universe_opt_subst : universe_opt_subst -> Pp.t - type universe_constraint - - module Constraints : - sig - type t - val pr : t -> Pp.t - end - - type universe_constraints = Constraints.t - [@@ocaml.deprecated "Use Constraints.t"] - -end - -module UState : -sig - type t - val context : t -> Univ.UContext.t - val context_set : t -> Univ.ContextSet.t - val of_context_set : Univ.ContextSet.t -> t - - val const_univ_entry : poly:bool -> t -> Entries.constant_universes_entry - val ind_univ_entry : poly:bool -> t -> Entries.inductive_universes - - type rigid = - | UnivRigid - | UnivFlexible of bool - -end - -module Evd : -sig - - type evar = Evar.t - [@@ocaml.deprecated "use Evar.t"] - - val string_of_existential : Evar.t -> string - [@@ocaml.deprecated "use Evar.print"] - - type evar_constraint = Reduction.conv_pb * Environ.env * Constr.t * Constr.t - - (* --------------------------------- *) - - (* evar info *) - - module Store : - sig - type t - val empty : t - end - - module Filter : - sig - type t - val repr : t -> bool list option - end - - (** This value defines the refinement of a given {i evar} *) - type evar_body = - | Evar_empty (** given {i evar} was not yet refined *) - | Evar_defined of Constr.t (** given {i var} was refined to the indicated term *) - - (** all the information we have concerning some {i evar} *) - type evar_info = - { - evar_concl : Constr.t; - evar_hyps : Environ.named_context_val; - evar_body : evar_body; - evar_filter : Filter.t; - evar_source : Evar_kinds.t Loc.located; - evar_candidates : Constr.t list option; (* if not None, list of allowed instances *) - evar_extra : Store.t - } - - val evar_concl : evar_info -> Constr.t - val evar_body : evar_info -> evar_body - val evar_context : evar_info -> Context.Named.t - val instantiate_evar_array : evar_info -> Constr.t -> Constr.t array -> Constr.t - val evar_filtered_env : evar_info -> Environ.env - val evar_hyps : evar_info -> Environ.named_context_val - - (* ------------------------------------ *) - - (* evar map *) - - type evar_map - type open_constr = evar_map * Constr.t - - open Util - - module Metaset : Set.S with type elt = Constr.metavariable - - type rigid = UState.rigid = - | UnivRigid - | UnivFlexible of bool - - type 'a freelisted = { - rebus : 'a; - freemetas : Metaset.t - } - - type instance_constraint = IsSuperType | IsSubType | Conv - - type instance_typing_status = - CoerceToType | TypeNotProcessed | TypeProcessed - - type instance_status = instance_constraint * instance_typing_status - - type clbinding = - | Cltyp of Names.Name.t * Constr.t freelisted - | Clval of Names.Name.t * (Constr.t freelisted * instance_status) * Constr.t freelisted - - val empty : evar_map - val from_env : Environ.env -> evar_map - val find : evar_map -> Evar.t -> evar_info - val find_undefined : evar_map -> Evar.t -> evar_info - val is_defined : evar_map -> Evar.t -> bool - val mem : evar_map -> Evar.t -> bool - val add : evar_map -> Evar.t -> evar_info -> evar_map - val evar_universe_context : evar_map -> UState.t - val set_universe_context : evar_map -> UState.t -> evar_map - val universes : evar_map -> UGraph.t - val define : Evar.t -> Constr.t -> evar_map -> evar_map - val fold : (Evar.t -> evar_info -> 'a -> 'a) -> evar_map -> 'a -> 'a - val evar_key : Names.Id.t -> evar_map -> Evar.t - - val create_evar_defs : evar_map -> evar_map - - val meta_declare : Constr.metavariable -> Constr.types -> ?name:Names.Name.t -> evar_map -> evar_map - - val clear_metas : evar_map -> evar_map - - (** Allocates a new evar that represents a {i sort}. *) - val new_sort_variable : ?loc:Loc.t -> ?name:Names.Id.t -> rigid -> evar_map -> evar_map * Sorts.t - - val remove : evar_map -> Evar.t -> evar_map - val fresh_global : ?loc:Loc.t -> ?rigid:rigid -> ?names:Univ.Instance.t -> Environ.env -> - evar_map -> Globnames.global_reference -> evar_map * Constr.t - val evar_filtered_context : evar_info -> Context.Named.t - val fresh_inductive_instance : ?loc:Loc.t -> Environ.env -> evar_map -> Names.inductive -> evar_map * Constr.pinductive - val fold_undefined : (Evar.t -> evar_info -> 'a -> 'a) -> evar_map -> 'a -> 'a - - val universe_context_set : evar_map -> Univ.ContextSet.t - val evar_ident : Evar.t -> evar_map -> Names.Id.t option - val extract_all_conv_pbs : evar_map -> evar_map * evar_constraint list - val universe_binders : evar_map -> Universes.universe_binders - val nf_constraints : evar_map -> evar_map - val from_ctx : UState.t -> evar_map - - val to_universe_context : evar_map -> Univ.UContext.t - val const_univ_entry : poly:bool -> evar_map -> Entries.constant_universes_entry - val ind_univ_entry : poly:bool -> evar_map -> Entries.inductive_universes - - val meta_list : evar_map -> (Constr.metavariable * clbinding) list - - val meta_defined : evar_map -> Constr.metavariable -> bool - - val meta_name : evar_map -> Constr.metavariable -> Names.Name.t - - module MonadR : - sig - module List : - sig - val map_right : ('a -> evar_map -> evar_map * 'b) -> 'a list -> evar_map -> evar_map * 'b list - end - end - - type 'a sigma = { - it : 'a ; - sigma : evar_map - } - - val sig_sig : 'a sigma -> evar_map - - val sig_it : 'a sigma -> 'a - - type 'a in_evar_universe_context = 'a * UState.t - - val univ_flexible : rigid - val univ_flexible_alg : rigid - val empty_evar_universe_context : UState.t - val union_evar_universe_context : UState.t -> UState.t -> UState.t - val merge_universe_context : evar_map -> UState.t -> evar_map - - type unsolvability_explanation = - | SeveralInstancesFound of int - - (** Return {i ids} of all {i evars} that occur in a given term. *) - val evars_of_term : Constr.t -> Evar.Set.t - - val evar_universe_context_of : Univ.ContextSet.t -> UState.t - [@@ocaml.deprecated "alias of API.UState.of_context_set"] - - val evar_context_universe_context : UState.t -> Univ.UContext.t - [@@ocaml.deprecated "alias of API.UState.context"] - - type evar_universe_context = UState.t - [@@ocaml.deprecated "alias of API.UState.t"] - - val existential_opt_value : evar_map -> Constr.existential -> Constr.t option - val existential_value : evar_map -> Constr.existential -> Constr.t - - exception NotInstantiatedEvar - - val fresh_sort_in_family : ?loc:Loc.t -> ?rigid:rigid -> Environ.env -> evar_map -> Sorts.family -> evar_map * Sorts.t -end - -module EConstr : -sig - type t - type constr = t - type types = t - type unsafe_judgment = (constr, types) Environ.punsafe_judgment - type named_declaration = (constr, types) Context.Named.Declaration.pt - type named_context = (constr, types) Context.Named.pt - type rel_context = (constr, types) Context.Rel.pt - type rel_declaration = (constr, types) Context.Rel.Declaration.pt - type existential = constr Constr.pexistential - module ESorts : - sig - type t - (** Type of sorts up-to universe unification. Essentially a wrapper around - Sorts.t so that normalization is ensured statically. *) - - val make : Sorts.t -> t - (** Turn a sort into an up-to sort. *) - - val kind : Evd.evar_map -> t -> Sorts.t - (** Returns the view into the current sort. Note that the kind of a variable - may change if the unification state of the evar map changes. *) - - end - - module EInstance : - sig - type t - (** Type of universe instances up-to universe unification. Similar to - {ESorts.t} for {Univ.Instance.t}. *) - - val make : Univ.Instance.t -> t - val kind : Evd.evar_map -> t -> Univ.Instance.t - val empty : t - val is_empty : t -> bool - end - - val of_constr : Constr.t -> constr - - val kind : Evd.evar_map -> constr -> (constr, constr, ESorts.t, EInstance.t) Constr.kind_of_term - - val mkArrow : constr -> constr -> constr - val mkInd : Names.inductive -> t - val mkProp : constr - val mkProd : Names.Name.t * constr * constr -> constr - val mkRel : int -> constr - val mkSort : Sorts.t -> constr - val mkVar : Names.Id.t -> constr - val mkLambda : Names.Name.t * constr * constr -> constr - val mkLambda_or_LetIn : rel_declaration -> constr -> constr - val mkApp : constr * constr array -> constr - val mkEvar : constr Constr.pexistential -> constr - - val mkMeta : Constr.metavariable -> constr - - val mkConstructU : Names.constructor * EInstance.t -> constr - val mkLetIn : Names.Name.t * constr * constr * constr -> constr - val mkProd_or_LetIn : rel_declaration -> constr -> constr - val mkCast : constr * Constr.cast_kind * constr -> constr - val mkNamedLambda : Names.Id.t -> types -> constr -> constr - val mkNamedProd : Names.Id.t -> types -> types -> types - - val isCast : Evd.evar_map -> t -> bool - val isEvar : Evd.evar_map -> constr -> bool - val isInd : Evd.evar_map -> constr -> bool - val isRel : Evd.evar_map -> constr -> bool - val isSort : Evd.evar_map -> constr -> bool - val isVar : Evd.evar_map -> constr -> bool - val isConst : Evd.evar_map -> constr -> bool - val isConstruct : Evd.evar_map -> constr -> bool - - val destInd : Evd.evar_map -> constr -> Names.inductive * EInstance.t - val destVar : Evd.evar_map -> constr -> Names.Id.t - val destEvar : Evd.evar_map -> constr -> constr Constr.pexistential - val destRel : Evd.evar_map -> constr -> int - val destProd : Evd.evar_map -> constr -> Names.Name.t * types * types - val destLambda : Evd.evar_map -> constr -> Names.Name.t * types * constr - val destApp : Evd.evar_map -> constr -> constr * constr array - val destConst : Evd.evar_map -> constr -> Names.Constant.t * EInstance.t - val destConstruct : Evd.evar_map -> constr -> Names.constructor * EInstance.t - val destFix : Evd.evar_map -> t -> (t, t) Constr.pfixpoint - val destCast : Evd.evar_map -> t -> t * Constr.cast_kind * t - - val mkConstruct : Names.constructor -> constr - - val compose_lam : (Names.Name.t * constr) list -> constr -> constr - - val decompose_lam : Evd.evar_map -> constr -> (Names.Name.t * constr) list * constr - val decompose_lam_n_assum : Evd.evar_map -> int -> constr -> rel_context * constr - val decompose_app : Evd.evar_map -> constr -> constr * constr list - val decompose_prod : Evd.evar_map -> constr -> (Names.Name.t * constr) list * constr - val decompose_prod_assum : Evd.evar_map -> constr -> rel_context * constr - - val applist : constr * constr list -> constr - - val to_constr : Evd.evar_map -> constr -> Constr.t - - val push_rel : rel_declaration -> Environ.env -> Environ.env - - module Unsafe : - sig - val to_constr : constr -> Constr.t - - val to_rel_decl : (constr, types) Context.Rel.Declaration.pt -> (Constr.constr, Constr.types) Context.Rel.Declaration.pt - - (** Physical identity. Does not care for defined evars. *) - - val to_named_decl : (constr, types) Context.Named.Declaration.pt -> (Constr.constr, Constr.types) Context.Named.Declaration.pt - - val to_instance : EInstance.t -> Univ.Instance.t - end - - module Vars : - sig - val substnl : t list -> int -> t -> t - val noccurn : Evd.evar_map -> int -> constr -> bool - val closed0 : Evd.evar_map -> constr -> bool - val subst1 : constr -> constr -> constr - val substl : constr list -> constr -> constr - val lift : int -> constr -> constr - val liftn : int -> int -> t -> t - val subst_var : Names.Id.t -> t -> t - val subst_vars : Names.Id.t list -> t -> t - end - - val fresh_global : - ?loc:Loc.t -> ?rigid:UState.rigid -> ?names:Univ.Instance.t -> Environ.env -> - Evd.evar_map -> Globnames.global_reference -> Evd.evar_map * t - - val of_named_decl : (Constr.t, Constr.types) Context.Named.Declaration.pt -> (constr, types) Context.Named.Declaration.pt - val of_rel_decl : (Constr.t, Constr.types) Context.Rel.Declaration.pt -> (constr, types) Context.Rel.Declaration.pt - val kind_of_type : Evd.evar_map -> constr -> (constr, constr) Term.kind_of_type - val to_lambda : Evd.evar_map -> int -> constr -> constr - val it_mkLambda_or_LetIn : constr -> rel_context -> constr - val push_rel_context : rel_context -> Environ.env -> Environ.env - val eq_constr : Evd.evar_map -> constr -> constr -> bool - val iter_with_binders : Evd.evar_map -> ('a -> 'a) -> ('a -> constr -> unit) -> 'a -> constr -> unit - val fold : Evd.evar_map -> ('a -> constr -> 'a) -> 'a -> constr -> 'a - val existential_type : Evd.evar_map -> existential -> types - val iter : Evd.evar_map -> (constr -> unit) -> constr -> unit - val eq_constr_universes : Evd.evar_map -> constr -> constr -> Universes.Constraints.t option - val eq_constr_nounivs : Evd.evar_map -> constr -> constr -> bool - val compare_constr : Evd.evar_map -> (constr -> constr -> bool) -> constr -> constr -> bool - val isApp : Evd.evar_map -> constr -> bool - val it_mkProd_or_LetIn : constr -> rel_context -> constr - val push_named : named_declaration -> Environ.env -> Environ.env - val destCase : Evd.evar_map -> constr -> Constr.case_info * constr * constr * constr array - val decompose_lam_assum : Evd.evar_map -> constr -> rel_context * constr - val mkConst : Names.Constant.t -> constr - val mkCase : Constr.case_info * constr * constr * constr array -> constr - val named_context : Environ.env -> named_context - val val_of_named_context : named_context -> Environ.named_context_val - val mkFix : (t, t) Constr.pfixpoint -> t - val decompose_prod_n_assum : Evd.evar_map -> int -> t -> rel_context * t - val isMeta : Evd.evar_map -> t -> bool - - val destMeta : Evd.evar_map -> t -> Constr.metavariable - - val map_with_binders : Evd.evar_map -> ('a -> 'a) -> ('a -> t -> t) -> 'a -> t -> t - val mkNamedLetIn : Names.Id.t -> constr -> types -> constr -> constr - val map : Evd.evar_map -> (t -> t) -> t -> t - val mkConstU : Names.Constant.t * EInstance.t -> t - val isProd : Evd.evar_map -> t -> bool - val mkConstructUi : (Names.inductive * EInstance.t) * int -> t - val isLambda : Evd.evar_map -> t -> bool -end - -module Namegen : -sig - (** *) - - (** [next_ident_away original_id unwanted_ids] returns a new identifier as close as possible - to the [original_id] while avoiding all [unwanted_ids]. - - In particular: - {ul {- if [original_id] does not appear in the list of [unwanted_ids], then [original_id] is returned.} - {- if [original_id] appears in the list of [unwanted_ids], - then this function returns a new id that: - {ul {- has the same {i root} as the [original_id],} - {- does not occur in the list of [unwanted_ids],} - {- has the smallest possible {i subscript}.}}}} - - where by {i subscript} of some identifier we mean last part of it that is composed - only from (decimal) digits and by {i root} of some identifier we mean - the whole identifier except for the {i subscript}. - - E.g. if we take [foo42], then [42] is the {i subscript}, and [foo] is the root. *) - val next_ident_away : Names.Id.t -> Names.Id.Set.t -> Names.Id.t - - val hdchar : Environ.env -> Evd.evar_map -> EConstr.types -> string - val id_of_name_using_hdchar : Environ.env -> Evd.evar_map -> EConstr.types -> Names.Name.t -> Names.Id.t - val next_ident_away_in_goal : Names.Id.t -> Names.Id.Set.t -> Names.Id.t - val default_dependent_ident : Names.Id.t - val next_global_ident_away : Names.Id.t -> Names.Id.Set.t -> Names.Id.t - val rename_bound_vars_as_displayed : - Evd.evar_map -> Names.Id.Set.t -> Names.Name.t list -> EConstr.types -> EConstr.types -end - -module Termops : -sig - val it_mkLambda_or_LetIn : Constr.t -> Context.Rel.t -> Constr.t - val local_occur_var : Evd.evar_map -> Names.Id.t -> EConstr.constr -> bool - val occur_var : Environ.env -> Evd.evar_map -> Names.Id.t -> EConstr.constr -> bool - val pr_evar_info : Evd.evar_info -> Pp.t - - val print_constr : EConstr.constr -> Pp.t - val pr_sort_family : Sorts.family -> Pp.t - - (** [dependent m t] tests whether [m] is a subterm of [t] *) - val dependent : Evd.evar_map -> EConstr.constr -> EConstr.constr -> bool - - (** [pop c] returns a copy of [c] with decremented De Bruijn indexes *) - val pop : EConstr.constr -> EConstr.constr - - (** Does a given term contain an existential variable? *) - val occur_existential : Evd.evar_map -> EConstr.constr -> bool - - (** [map_constr_with_binders_left_to_right g f acc c] maps [f updated_acc] on all the immediate subterms of [c]. - {ul {- if a given immediate subterm of [c] is not below a binder, then [updated_acc] is the same as [acc].} - {- if a given immediate subterm of [c] is below a binder [b], then [updated_acc] is computed as [g b acc].}} *) - val map_constr_with_binders_left_to_right : - Evd.evar_map -> (EConstr.rel_declaration -> 'a -> 'a) -> ('a -> EConstr.constr -> EConstr.constr) -> 'a -> EConstr.constr -> EConstr.constr - - (** Remove the outer-most {!Constr.kind_of_term.Cast} from a given term. *) - val strip_outer_cast : Evd.evar_map -> EConstr.constr -> EConstr.constr - - (** [nb_lam] ⟦[fun (x1:t1)...(xn:tn) => c]⟧ where [c] is not an abstraction gives [n]. - Casts are ignored. *) - val nb_lam : Evd.evar_map -> EConstr.constr -> int - - (** [push_rel_assum env_assumtion env] adds a given {i env assumption} to the {i env context} of a given {i environment}. *) - val push_rel_assum : Names.Name.t * EConstr.types -> Environ.env -> Environ.env - - (** [push_rels_assum env_assumptions env] adds given {i env assumptions} to the {i env context} of a given {i environment}. *) - val push_rels_assum : (Names.Name.t * Constr.types) list -> Environ.env -> Environ.env - - type meta_value_map = (Constr.metavariable * Constr.t) list - - val last_arg : Evd.evar_map -> EConstr.constr -> EConstr.constr - val assums_of_rel_context : ('c, 't) Context.Rel.pt -> (Names.Name.t * 't) list - val prod_applist : Evd.evar_map -> EConstr.constr -> EConstr.constr list -> EConstr.constr - val nb_prod : Evd.evar_map -> EConstr.constr -> int - val is_section_variable : Names.Id.t -> bool - val ids_of_rel_context : ('c, 't) Context.Rel.pt -> Names.Id.t list - val subst_term : Evd.evar_map -> EConstr.constr -> EConstr.constr -> EConstr.constr - val global_vars_set_of_decl : Environ.env -> Evd.evar_map -> EConstr.named_declaration -> Names.Id.Set.t - val vars_of_env: Environ.env -> Names.Id.Set.t - val ids_of_named_context : ('c, 't) Context.Named.pt -> Names.Id.t list - val ids_of_context : Environ.env -> Names.Id.t list - val global_of_constr : Evd.evar_map -> EConstr.constr -> Globnames.global_reference * EConstr.EInstance.t - val print_named_context : Environ.env -> Pp.t - val print_constr_env : Environ.env -> Evd.evar_map -> EConstr.constr -> Pp.t - val clear_named_body : Names.Id.t -> Environ.env -> Environ.env - val is_Prop : Evd.evar_map -> EConstr.constr -> bool - val is_Set : Evd.evar_map -> EConstr.constr -> bool - val is_Type : Evd.evar_map -> EConstr.constr -> bool - val is_global : Evd.evar_map -> Globnames.global_reference -> EConstr.constr -> bool - - val eq_constr : Evd.evar_map -> EConstr.constr -> EConstr.constr -> bool - - val occur_var_in_decl : - Environ.env -> Evd.evar_map -> - Names.Id.t -> EConstr.named_declaration -> bool - - val subst_meta : meta_value_map -> Constr.t -> Constr.t - - val free_rels : Evd.evar_map -> EConstr.constr -> Int.Set.t - - val occur_term : Evd.evar_map -> EConstr.constr -> EConstr.constr -> bool - [@@ocaml.deprecated "alias of API.Termops.dependent"] - - val replace_term : Evd.evar_map -> EConstr.constr -> EConstr.constr -> EConstr.constr -> EConstr.constr - val map_named_decl : ('a -> 'b) -> ('a, 'a) Context.Named.Declaration.pt -> ('b, 'b) Context.Named.Declaration.pt - val map_rel_decl : ('a -> 'b) -> ('a, 'a) Context.Rel.Declaration.pt -> ('b, 'b) Context.Rel.Declaration.pt - val pr_metaset : Evd.Metaset.t -> Pp.t - val pr_evar_map : ?with_univs:bool -> int option -> Evd.evar_map -> Pp.t - val pr_evar_universe_context : UState.t -> Pp.t -end - -module Proofview_monad : -sig - type lazy_msg = unit -> Pp.t - module Info : - sig - type tree - end -end - -module Evarutil : -sig - val e_new_global : Evd.evar_map ref -> Globnames.global_reference -> EConstr.constr - - val nf_evars_and_universes : Evd.evar_map -> Evd.evar_map * (Constr.t -> Constr.t) - val nf_evar : Evd.evar_map -> EConstr.constr -> EConstr.constr - val nf_evar_info : Evd.evar_map -> Evd.evar_info -> Evd.evar_info - - val mk_new_meta : unit -> EConstr.constr - - (** [new_meta] is a generator of unique meta variables *) - val new_meta : unit -> Constr.metavariable - - val new_Type : ?rigid:Evd.rigid -> Environ.env -> Evd.evar_map -> Evd.evar_map * EConstr.constr - val new_global : Evd.evar_map -> Globnames.global_reference -> Evd.evar_map * EConstr.constr - - val new_evar : - Environ.env -> Evd.evar_map -> ?src:Evar_kinds.t Loc.located -> ?filter:Evd.Filter.t -> - ?candidates:EConstr.constr list -> ?store:Evd.Store.t -> - ?naming:Misctypes.intro_pattern_naming_expr -> - ?principal:bool -> EConstr.types -> Evd.evar_map * EConstr.constr - - val new_evar_instance : - Environ.named_context_val -> Evd.evar_map -> EConstr.types -> - ?src:Evar_kinds.t Loc.located -> ?filter:Evd.Filter.t -> ?candidates:EConstr.constr list -> - ?store:Evd.Store.t -> ?naming:Misctypes.intro_pattern_naming_expr -> - ?principal:bool -> - EConstr.constr list -> Evd.evar_map * EConstr.constr - - val clear_hyps_in_evi : Environ.env -> Evd.evar_map ref -> Environ.named_context_val -> - EConstr.types -> Names.Id.Set.t -> Environ.named_context_val * EConstr.types - - type clear_dependency_error = - | OccurHypInSimpleClause of Names.Id.t option - | EvarTypingBreak of Constr.existential - - exception ClearDependencyError of Names.Id.t * clear_dependency_error - val undefined_evars_of_term : Evd.evar_map -> EConstr.constr -> Evar.Set.t - val has_undefined_evars : Evd.evar_map -> EConstr.constr -> bool - val e_new_evar : - Environ.env -> Evd.evar_map ref -> ?src:Evar_kinds.t Loc.located -> ?filter:Evd.Filter.t -> - ?candidates:EConstr.constr list -> ?store:Evd.Store.t -> - ?naming:Misctypes.intro_pattern_naming_expr -> - ?principal:bool -> EConstr.types -> EConstr.constr - val new_type_evar : - Environ.env -> Evd.evar_map -> ?src:Evar_kinds.t Loc.located -> ?filter:Evd.Filter.t -> - ?naming:Misctypes.intro_pattern_naming_expr -> ?principal:bool -> Evd.rigid -> - Evd.evar_map * (EConstr.constr * Sorts.t) - val nf_evars_universes : Evd.evar_map -> Constr.t -> Constr.t - val safe_evar_value : Evd.evar_map -> Constr.existential -> Constr.t option - val evd_comb1 : (Evd.evar_map -> 'b -> Evd.evar_map * 'a) -> Evd.evar_map ref -> 'b -> 'a -end - -module Proofview : -sig - type proofview - type entry - type +'a tactic - type telescope = - | TNil of Evd.evar_map - | TCons of Environ.env * Evd.evar_map * EConstr.types * (Evd.evar_map -> EConstr.constr -> telescope) - - module NonLogical : - sig - type +'a t - val make : (unit -> 'a) -> 'a t - val return : 'a -> 'a t - val ( >> ) : unit t -> 'a t -> 'a t - val ( >>= ) : 'a t -> ('a -> 'b t) -> 'b t - val print_char : char -> unit t - val print_debug : Pp.t -> unit t - val print_warning : Pp.t -> unit t - val print_notice : Pp.t -> unit t - val print_info : Pp.t -> unit t - val run : 'a t -> 'a - type 'a ref - val ref : 'a -> 'a ref t - val ( := ) : 'a ref -> 'a -> unit t - val ( ! ) : 'a ref -> 'a t - val raise : ?info:Exninfo.info -> exn -> 'a t - val catch : 'a t -> (Exninfo.iexn -> 'a t) -> 'a t - val read_line : string t - end - val proofview : proofview -> Evar.t list * Evd.evar_map - val cycle : int -> unit tactic - val swap : int -> int -> unit tactic - val revgoals : unit tactic - val give_up : unit tactic - val init : Evd.evar_map -> (Environ.env * EConstr.types) list -> entry * proofview - val shelve : unit tactic - val tclZERO : ?info:Exninfo.info -> exn -> 'a tactic - val tclUNIT : 'a -> 'a tactic - val tclBIND : 'a tactic -> ('a -> 'b tactic) -> 'b tactic - val tclORELSE : 'a tactic -> (Util.iexn -> 'a tactic) -> 'a tactic - val tclFOCUS : int -> int -> 'a tactic -> 'a tactic - val tclEVARMAP : Evd.evar_map tactic - val tclTHEN : unit tactic -> 'a tactic -> 'a tactic - val tclLIFT : 'a NonLogical.t -> 'a tactic - val tclOR : 'a tactic -> (Exninfo.iexn -> 'a tactic) -> 'a tactic - val tclIFCATCH : 'a tactic -> ('a -> 'b tactic) -> (Exninfo.iexn -> 'b tactic) -> 'b tactic - val tclINDEPENDENT : unit tactic -> unit tactic - val tclDISPATCH : unit tactic list -> unit tactic - val tclEXTEND : unit tactic list -> unit tactic -> unit tactic list -> unit tactic - val tclBREAK : (Exninfo.iexn -> Exninfo.iexn option) -> 'a tactic -> 'a tactic - val tclENV : Environ.env tactic - val tclONCE : 'a tactic -> 'a tactic - val tclPROGRESS : 'a tactic -> 'a tactic - val shelve_unifiable : unit tactic - val apply : Environ.env -> 'a tactic -> proofview -> 'a - * proofview - * (bool * Evar.t list * Evar.t list) - * Proofview_monad.Info.tree - val numgoals : int tactic - val with_shelf : 'a tactic -> (Evar.t list * 'a) tactic - - module Unsafe : - sig - val tclEVARS : Evd.evar_map -> unit tactic - - val tclGETGOALS : Evar.t list tactic - - val tclSETGOALS : Evar.t list -> unit tactic - - val tclNEWGOALS : Evar.t list -> unit tactic - end - - module Goal : - sig - type 'a t - val enter : ([ `LZ ] t -> unit tactic) -> unit tactic - val hyps : 'a t -> EConstr.named_context - val nf_enter : ([ `NF ] t -> unit tactic) -> unit tactic - val enter_one : ([ `LZ ] t -> 'a tactic) -> 'a tactic - val concl : 'a t -> EConstr.constr - val sigma : 'a t -> Evd.evar_map - val goal : [ `NF ] t -> Evar.t - val env : 'a t -> Environ.env - val assume : 'a t -> [ `NF ] t - end - - module Notations : - sig - val (>>=) : 'a tactic -> ('a -> 'b tactic) -> 'b tactic - val (<*>) : unit tactic -> 'a tactic -> 'a tactic - val (<+>) : 'a tactic -> 'a tactic -> 'a tactic - end - module V82 : - sig - type tac = Evar.t Evd.sigma -> Evar.t list Evd.sigma - - val tactic : tac -> unit tactic - - val of_tactic : 'a tactic -> tac - - val nf_evar_goals : unit tactic - - val wrap_exceptions : (unit -> 'a tactic) -> 'a tactic - - val catchable_exception : exn -> bool - end - module Trace : - sig - val name_tactic : Proofview_monad.lazy_msg -> 'a tactic -> 'a tactic - val log : Proofview_monad.lazy_msg -> unit tactic - end -end - -module Ftactic : -sig - type +'a focus - type +'a t = 'a focus Proofview.tactic - val return : 'a -> 'a t - val run : 'a t -> ('a -> unit Proofview.tactic) -> unit Proofview.tactic - val enter : ([ `LZ ] Proofview.Goal.t -> 'a t) -> 'a t - val nf_enter : ([ `NF ] Proofview.Goal.t -> 'a t) -> 'a t - val bind : 'a t -> ('a -> 'b t) -> 'b t - val (>>=) : 'a t -> ('a -> 'b t) -> 'b t - val lift : 'a Proofview.tactic -> 'a t - val with_env : 'a t -> (Environ.env * 'a) t - module List : - sig - val map : ('a -> 'b t) -> 'a list -> 'b list t - val map_right : ('a -> 'b t) -> 'a list -> 'b list t - end - module Notations : - sig - val (>>=) : 'a t -> ('a -> 'b t) -> 'b t - val (<*>) : unit t -> 'a t -> 'a t - end -end - -module Geninterp : -sig - module Val : - sig - type 'a typ - type t = Dyn : 'a typ * 'a -> t - type 'a tag = - | Base : 'a typ -> 'a tag - | List : 'a tag -> 'a list tag - | Opt : 'a tag -> 'a option tag - | Pair : 'a tag * 'b tag -> ('a * 'b) tag - val create : string -> 'a typ - val pr : 'a typ -> Pp.t - val eq : 'a typ -> 'b typ -> ('a, 'b) CSig.eq option - val typ_list : t list typ - val typ_opt : t option typ - val typ_pair : (t * t) typ - val repr : 'a typ -> string - val inject : 'a tag -> 'a -> t - end - module TacStore : - sig - type t - type 'a field - val empty : t - val field : unit -> 'a field - val get : t -> 'a field -> 'a option - val set : t -> 'a field -> 'a -> t - val remove : t -> 'a field -> t - val merge : t -> t -> t - end - type interp_sign = { - lfun : Val.t Names.Id.Map.t; - extra : TacStore.t - } - type ('glb, 'top) interp_fun = interp_sign -> 'glb -> 'top Ftactic.t - val register_interp0 : - ('raw, 'glb, 'top) Genarg.genarg_type -> ('glb, Val.t) interp_fun -> unit - val register_val0 : ('raw, 'glb, 'top) Genarg.genarg_type -> 'top Val.tag option -> unit - val val_tag : 'a Genarg.typed_abstract_argument_type -> 'a Val.tag - val interp : ('raw, 'glb, 'top) Genarg.genarg_type -> ('glb, Val.t) interp_fun -end - -(************************************************************************) -(* End of modules from engine/ *) -(************************************************************************) - -(************************************************************************) -(* Modules from pretyping/ *) -(************************************************************************) - -module Ltac_pretype : -sig -open Names -open Glob_term - -(** {5 Maps of pattern variables} *) - -(** Type [constr_under_binders] is for representing the term resulting - of a matching. Matching can return terms defined in a some context - of named binders; in the context, variable names are ordered by - (<) and referred to by index in the term Thanks to the canonical - ordering, a matching problem like - - [match ... with [(fun x y => ?p,fun y x => ?p)] => [forall x y => p]] - - will be accepted. Thanks to the reference by index, a matching - problem like - - [match ... with [(fun x => ?p)] => [forall x => p]] - - will work even if [x] is also the name of an existing goal - variable. - - Note: we do not keep types in the signature. Besides simplicity, - the main reason is that it would force to close the signature over - binders that occur only in the types of effective binders but not - in the term itself (e.g. for a term [f x] with [f:A -> True] and - [x:A]). - - On the opposite side, by not keeping the types, we loose - opportunity to propagate type informations which otherwise would - not be inferable, as e.g. when matching [forall x, x = 0] with - pattern [forall x, ?h = 0] and using the solution "x|-h:=x" in - expression [forall x, h = x] where nothing tells how the type of x - could be inferred. We also loose the ability of typing ltac - variables before calling the right-hand-side of ltac matching clauses. *) - -type constr_under_binders = Id.t list * EConstr.constr - -(** Types of substitutions with or w/o bound variables *) - -type patvar_map = EConstr.constr Id.Map.t -type extended_patvar_map = constr_under_binders Id.Map.t - -(** A globalised term together with a closure representing the value - of its free variables. Intended for use when these variables are taken - from the Ltac environment. *) -type closure = { - idents:Id.t Id.Map.t; - typed: constr_under_binders Id.Map.t ; - untyped:closed_glob_constr Id.Map.t } -and closed_glob_constr = { - closure: closure; - term: glob_constr } - -(** Ltac variable maps *) -type var_map = constr_under_binders Id.Map.t -type uconstr_var_map = closed_glob_constr Id.Map.t -type unbound_ltac_var_map = Geninterp.Val.t Id.Map.t - -type ltac_var_map = { - ltac_constrs : var_map; - (** Ltac variables bound to constrs *) - ltac_uconstrs : uconstr_var_map; - (** Ltac variables bound to untyped constrs *) - ltac_idents: Id.t Id.Map.t; - (** Ltac variables bound to identifiers *) - ltac_genargs : unbound_ltac_var_map; - (** Ltac variables bound to other kinds of arguments *) -} - -end - -module Locusops : -sig - val clause_with_generic_occurrences : 'a Locus.clause_expr -> bool - val nowhere : 'a Locus.clause_expr - val allHypsAndConcl : 'a Locus.clause_expr - val is_nowhere : 'a Locus.clause_expr -> bool - val occurrences_map : - ('a list -> 'b list) -> 'a Locus.occurrences_gen -> 'b Locus.occurrences_gen - val convert_occs : Locus.occurrences -> bool * int list - val onConcl : 'a Locus.clause_expr - val onHyp : 'a -> 'a Locus.clause_expr -end - -module Pretype_errors : -sig - type unification_error - type subterm_unification_error - - type type_error = (EConstr.t, EConstr.types) Type_errors.ptype_error - - type pretype_error = - | CantFindCaseType of EConstr.constr - | ActualTypeNotCoercible of EConstr.unsafe_judgment * EConstr.types * unification_error - | UnifOccurCheck of Evar.t * EConstr.constr - | UnsolvableImplicit of Evar.t * Evd.unsolvability_explanation option - | CannotUnify of EConstr.constr * EConstr.constr * unification_error option - | CannotUnifyLocal of EConstr.constr * EConstr.constr * EConstr.constr - | CannotUnifyBindingType of EConstr.constr * EConstr.constr - | CannotGeneralize of EConstr.constr - | NoOccurrenceFound of EConstr.constr * Names.Id.t option - | CannotFindWellTypedAbstraction of EConstr.constr * EConstr.constr list * (Environ.env * type_error) option - | WrongAbstractionType of Names.Name.t * EConstr.constr * EConstr.types * EConstr.types - | AbstractionOverMeta of Names.Name.t * Names.Name.t - | NonLinearUnification of Names.Name.t * EConstr.constr - | VarNotFound of Names.Id.t - | UnexpectedType of EConstr.constr * EConstr.constr - | NotProduct of EConstr.constr - | TypingError of type_error - | CannotUnifyOccurrences of subterm_unification_error - | UnsatisfiableConstraints of - (Evar.t * Evar_kinds.t) option * Evar.Set.t option - - exception PretypeError of Environ.env * Evd.evar_map * pretype_error - val error_var_not_found : ?loc:Loc.t -> Names.Id.t -> 'b - val precatchable_exception : exn -> bool -end - -module Reductionops : -sig - type local_reduction_function = Evd.evar_map -> EConstr.constr -> EConstr.constr - - type reduction_function = Environ.env -> Evd.evar_map -> EConstr.constr -> EConstr.constr - - type local_stack_reduction_function = - Evd.evar_map -> EConstr.constr -> EConstr.constr * EConstr.constr list - - type e_reduction_function = Environ.env -> Evd.evar_map -> EConstr.constr -> Evd.evar_map * EConstr.constr - type state - - val clos_whd_flags : CClosure.RedFlags.reds -> reduction_function - val nf_beta : local_reduction_function - val nf_betaiota : local_reduction_function - val splay_prod : Environ.env -> Evd.evar_map -> EConstr.constr -> - (Names.Name.t * EConstr.constr) list * EConstr.constr - val splay_prod_n : Environ.env -> Evd.evar_map -> int -> EConstr.constr -> EConstr.rel_context * EConstr.constr - val whd_all : reduction_function - val whd_beta : local_reduction_function - - val whd_betaiotazeta : local_reduction_function - - val whd_betaiota_stack : local_stack_reduction_function - - val clos_norm_flags : CClosure.RedFlags.reds -> reduction_function - val is_conv : ?reds:Names.transparent_state -> Environ.env -> Evd.evar_map -> EConstr.constr -> EConstr.constr -> bool - val beta_applist : Evd.evar_map -> EConstr.constr * EConstr.constr list -> EConstr.constr - val sort_of_arity : Environ.env -> Evd.evar_map -> EConstr.constr -> EConstr.ESorts.t - val is_conv_leq : ?reds:Names.transparent_state -> Environ.env -> Evd.evar_map -> EConstr.constr -> EConstr.constr -> bool - val whd_betaiota : local_reduction_function - val is_arity : Environ.env -> Evd.evar_map -> EConstr.constr -> bool - val nf_evar : Evd.evar_map -> EConstr.constr -> EConstr.constr - val nf_meta : Evd.evar_map -> EConstr.constr -> EConstr.constr - val hnf_prod_appvect : Environ.env -> Evd.evar_map -> EConstr.constr -> EConstr.constr array -> EConstr.constr - val pr_state : state -> Pp.t - module Stack : - sig - type 'a t - val pr : ('a -> Pp.t) -> 'a t -> Pp.t - end - module Cst_stack : - sig - type t - val pr : t -> Pp.t - end -end - -module Inductiveops : -sig - type inductive_family - type inductive_type = - | IndType of inductive_family * EConstr.constr list - type constructor_summary = - { - cs_cstr : Constr.pconstructor; - cs_params : Constr.t list; - cs_nargs : int; - cs_args : Context.Rel.t; - cs_concl_realargs : Constr.t array; - } - - val arities_of_constructors : Environ.env -> Constr.pinductive -> Constr.types array - val constructors_nrealargs_env : Environ.env -> Names.inductive -> int array - val constructor_nallargs_env : Environ.env -> Names.constructor -> int - - val inductive_nparams : Names.inductive -> int - - val inductive_nparamdecls : Names.inductive -> int - - val type_of_constructors : Environ.env -> Constr.pinductive -> Constr.types array - val find_mrectype : Environ.env -> Evd.evar_map -> EConstr.types -> (Names.inductive * EConstr.EInstance.t) * EConstr.constr list - val mis_is_recursive : - Names.inductive * Declarations.mutual_inductive_body * Declarations.one_inductive_body -> bool - val nconstructors : Names.inductive -> int - val find_rectype : Environ.env -> Evd.evar_map -> EConstr.types -> inductive_type - val get_constructors : Environ.env -> inductive_family -> constructor_summary array - val dest_ind_family : inductive_family -> Names.inductive Univ.puniverses * Constr.t list - val find_inductive : Environ.env -> Evd.evar_map -> EConstr.types -> (Names.inductive * EConstr.EInstance.t) * Constr.t list - val type_of_inductive : Environ.env -> Constr.pinductive -> Constr.types -end - -module Impargs : -sig - type implicit_status - type implicit_side_condition - type implicits_list = implicit_side_condition * implicit_status list - type manual_explicitation = Constrexpr.explicitation * (bool * bool * bool) - type manual_implicits = manual_explicitation list - val is_status_implicit : implicit_status -> bool - val name_of_implicit : implicit_status -> Names.Id.t - val implicits_of_global : Globnames.global_reference -> implicits_list list - val declare_manual_implicits : bool -> Globnames.global_reference -> ?enriching:bool -> - manual_implicits list -> unit - val is_implicit_args : unit -> bool - val is_strict_implicit_args : unit -> bool - val is_contextual_implicit_args : unit -> bool - val make_implicit_args : bool -> unit - val make_strict_implicit_args : bool -> unit - val make_contextual_implicit_args : bool -> unit -end - -module Retyping : (* reconstruct the type of a term knowing that it was already typechecked *) -sig - val get_type_of : ?polyprop:bool -> ?lax:bool -> Environ.env -> Evd.evar_map -> EConstr.constr -> EConstr.types - val get_sort_family_of : ?truncation_style:bool -> ?polyprop:bool -> Environ.env -> Evd.evar_map -> EConstr.types -> Sorts.family - val expand_projection : Environ.env -> Evd.evar_map -> Names.Projection.t -> EConstr.constr -> EConstr.constr list -> EConstr.constr - val get_sort_of : - ?polyprop:bool -> Environ.env -> Evd.evar_map -> EConstr.types -> Sorts.t -end - -module Find_subterm : -sig - val error_invalid_occurrence : int list -> 'a -end - -module Evarsolve : -sig - val refresh_universes : - ?status:Evd.rigid -> ?onlyalg:bool -> ?refreshset:bool -> bool option -> - Environ.env -> Evd.evar_map -> EConstr.types -> Evd.evar_map * EConstr.types -end - -module Recordops : -sig - - type cs_pattern = - | Const_cs of Globnames.global_reference - | Prod_cs - | Sort_cs of Sorts.family - | Default_cs - - type obj_typ = { - o_DEF : Constr.t; - o_CTX : Univ.AUContext.t; - o_INJ : int option; (** position of trivial argument *) - o_TABS : Constr.t list; (** ordered *) - o_TPARAMS : Constr.t list; (** ordered *) - o_NPARAMS : int; - o_TCOMPS : Constr.t list } - - val lookup_projections : Names.inductive -> Names.Constant.t option list - val lookup_canonical_conversion : (Globnames.global_reference * cs_pattern) -> Constr.t * obj_typ - val find_projection_nparams : Globnames.global_reference -> int -end - -module Evarconv : -sig - val e_conv : Environ.env -> ?ts:Names.transparent_state -> Evd.evar_map ref -> EConstr.constr -> EConstr.constr -> bool - val the_conv_x : Environ.env -> ?ts:Names.transparent_state -> EConstr.constr -> EConstr.constr -> Evd.evar_map -> Evd.evar_map - val the_conv_x_leq : Environ.env -> ?ts:Names.transparent_state -> EConstr.constr -> EConstr.constr -> Evd.evar_map -> Evd.evar_map - val solve_unif_constraints_with_heuristics : Environ.env -> ?ts:Names.transparent_state -> Evd.evar_map -> Evd.evar_map -end - -module Typing : -sig - val e_sort_of : Environ.env -> Evd.evar_map ref -> EConstr.types -> Sorts.t - - val type_of : ?refresh:bool -> Environ.env -> Evd.evar_map -> EConstr.constr -> Evd.evar_map * EConstr.types - val e_solve_evars : Environ.env -> Evd.evar_map ref -> EConstr.constr -> EConstr.constr - - val unsafe_type_of : Environ.env -> Evd.evar_map -> EConstr.constr -> EConstr.types - - val e_check : Environ.env -> Evd.evar_map ref -> EConstr.constr -> EConstr.types -> unit - - val e_type_of : ?refresh:bool -> Environ.env -> Evd.evar_map ref -> EConstr.constr -> EConstr.types -end - -module Miscops : -sig - val map_red_expr_gen : ('a -> 'd) -> ('b -> 'e) -> ('c -> 'f) -> - ('a,'b,'c) Genredexpr.red_expr_gen -> ('d,'e,'f) Genredexpr.red_expr_gen - val map_cast_type : ('a -> 'b) -> 'a Misctypes.cast_type -> 'b Misctypes.cast_type -end - -module Glob_ops : -sig - val map_glob_constr_left_to_right : (Glob_term.glob_constr -> Glob_term.glob_constr) -> Glob_term.glob_constr -> Glob_term.glob_constr - val loc_of_glob_constr : Glob_term.glob_constr -> Loc.t option - val glob_constr_eq : Glob_term.glob_constr -> Glob_term.glob_constr -> bool - val bound_glob_vars : Glob_term.glob_constr -> Names.Id.Set.t - - (** Conversion from glob_constr to cases pattern, if possible - - Take the current alias as parameter, - @raise Not_found if translation is impossible *) - val cases_pattern_of_glob_constr : Names.Name.t -> Glob_term.glob_constr -> Glob_term.cases_pattern - val map_glob_constr : - (Glob_term.glob_constr -> Glob_term.glob_constr) -> Glob_term.glob_constr -> Glob_term.glob_constr - - val empty_lvar : Ltac_pretype.ltac_var_map - -end - -module Redops : -sig - val all_flags : 'a Genredexpr.glob_red_flag - val make_red_flag : 'a Genredexpr.red_atom list -> 'a Genredexpr.glob_red_flag -end - -module Patternops : -sig - val pattern_of_glob_constr : Glob_term.glob_constr -> Names.Id.t list * Pattern.constr_pattern - val subst_pattern : Mod_subst.substitution -> Pattern.constr_pattern -> Pattern.constr_pattern - val pattern_of_constr : Environ.env -> Evd.evar_map -> Constr.t -> Pattern.constr_pattern - val instantiate_pattern : Environ.env -> - Evd.evar_map -> Ltac_pretype.extended_patvar_map -> - Pattern.constr_pattern -> Pattern.constr_pattern -end - -module Constr_matching : -sig - val special_meta : Constr.metavariable - - type binding_bound_vars = Names.Id.Set.t - type bound_ident_map = Names.Id.t Names.Id.Map.t - val is_matching : Environ.env -> Evd.evar_map -> Pattern.constr_pattern -> EConstr.constr -> bool - val extended_matches : - Environ.env -> Evd.evar_map -> binding_bound_vars * Pattern.constr_pattern -> - EConstr.constr -> bound_ident_map * Ltac_pretype.extended_patvar_map - exception PatternMatchingFailure - type matching_result = - { m_sub : bound_ident_map * Ltac_pretype.patvar_map; - m_ctx : EConstr.constr } - val match_subterm : Environ.env -> Evd.evar_map -> - binding_bound_vars * Pattern.constr_pattern -> EConstr.constr -> - matching_result IStream.t - val matches : Environ.env -> Evd.evar_map -> Pattern.constr_pattern -> EConstr.constr -> Ltac_pretype.patvar_map -end - -module Tacred : -sig - val try_red_product : Reductionops.reduction_function - val simpl : Reductionops.reduction_function - val unfoldn : - (Locus.occurrences * Names.evaluable_global_reference) list -> Reductionops.reduction_function - val hnf_constr : Reductionops.reduction_function - val red_product : Reductionops.reduction_function - val is_evaluable : Environ.env -> Names.evaluable_global_reference -> bool - val evaluable_of_global_reference : - Environ.env -> Globnames.global_reference -> Names.evaluable_global_reference - val error_not_evaluable : Globnames.global_reference -> 'a - val reduce_to_quantified_ref : - Environ.env -> Evd.evar_map -> Globnames.global_reference -> EConstr.types -> EConstr.types - val pattern_occs : (Locus.occurrences * EConstr.constr) list -> Reductionops.e_reduction_function - val cbv_norm_flags : CClosure.RedFlags.reds -> Reductionops.reduction_function -end - -(* XXX: Located manually from intf *) -module Tok : -sig - - type t = - | KEYWORD of string - | PATTERNIDENT of string - | IDENT of string - | FIELD of string - | INT of string - | STRING of string - | LEFTQMARK - | BULLET of string - | EOI - -end - -module CLexer : -sig - val add_keyword : string -> unit - val remove_keyword : string -> unit - val is_keyword : string -> bool - val keywords : unit -> CString.Set.t - - type keyword_state - val set_keyword_state : keyword_state -> unit - val get_keyword_state : unit -> keyword_state - - val check_ident : string -> unit - val terminal : string -> Tok.t - - include Grammar.GLexerType with type te = Tok.t -end - -module Extend : -sig - - type gram_assoc = NonA | RightA | LeftA - - type gram_position = - | First - | Last - | Before of string - | After of string - | Level of string - - type production_level = - | NextLevel - | NumLevel of int - - type 'a entry = 'a Grammar.GMake(CLexer).Entry.e - - type 'a user_symbol = - | Ulist1 of 'a user_symbol - | Ulist1sep of 'a user_symbol * string - | Ulist0 of 'a user_symbol - | Ulist0sep of 'a user_symbol * string - | Uopt of 'a user_symbol - | Uentry of 'a - | Uentryl of 'a * int - - type ('self, 'a) symbol = - | Atoken : Tok.t -> ('self, string) symbol - | Alist1 : ('self, 'a) symbol -> ('self, 'a list) symbol - | Alist1sep : ('self, 'a) symbol * ('self, _) symbol -> ('self, 'a list) symbol - | Alist0 : ('self, 'a) symbol -> ('self, 'a list) symbol - | Alist0sep : ('self, 'a) symbol * ('self, _) symbol -> ('self, 'a list) symbol - | Aopt : ('self, 'a) symbol -> ('self, 'a option) symbol - | Aself : ('self, 'self) symbol - | Anext : ('self, 'self) symbol - | Aentry : 'a entry -> ('self, 'a) symbol - | Aentryl : 'a entry * int -> ('self, 'a) symbol - | Arules : 'a rules list -> ('self, 'a) symbol - - and ('self, _, 'r) rule = - | Stop : ('self, 'r, 'r) rule - | Next : ('self, 'a, 'r) rule * ('self, 'b) symbol -> ('self, 'b -> 'a, 'r) rule - - and ('a, 'r) norec_rule = { norec_rule : 's. ('s, 'a, 'r) rule } - - and 'a rules = - | Rules : ('act, Loc.t -> 'a) norec_rule * 'act -> 'a rules - - type ('lev,'pos) constr_entry_key_gen = - | ETName | ETReference | ETBigint - | ETBinder of bool - | ETConstr of ('lev * 'pos) - | ETPattern - | ETOther of string * string - | ETConstrList of ('lev * 'pos) * Tok.t list - | ETBinderList of bool * Tok.t list - - type side = Left | Right - - type production_position = - | BorderProd of side * gram_assoc option - | InternalProd - - type constr_prod_entry_key = - (production_level,production_position) constr_entry_key_gen - - type simple_constr_prod_entry_key = - (production_level,unit) constr_entry_key_gen - - type 'a production_rule = - | Rule : ('a, 'act, Loc.t -> 'a) rule * 'act -> 'a production_rule - - type 'a single_extend_statment = - string option * - (** Level *) - gram_assoc option * - (** Associativity *) - 'a production_rule list - (** Symbol list with the interpretation function *) - - type 'a extend_statment = - gram_position option * - 'a single_extend_statment list -end - -(* XXX: Located manually from intf *) -module Vernacexpr : -sig - open Misctypes - open Constrexpr - open Libnames - - type instance_flag = bool option - type coercion_flag = bool - type inductive_flag = Declarations.recursivity_kind - type lname = Names.Name.t Loc.located - type lident = Names.Id.t Loc.located - type opacity_flag = - | Opaque - | Transparent - type locality_flag = bool - type inductive_kind = - | Inductive_kw | CoInductive | Variant | Record | Structure | Class of bool - - type vernac_type = - | VtStartProof of vernac_start - | VtSideff of vernac_sideff_type - | VtQed of vernac_qed_type - | VtProofStep of proof_step - | VtProofMode of string - | VtQuery of vernac_part_of_script * Feedback.route_id - | VtMeta - | VtUnknown - and vernac_qed_type = - | VtKeep - | VtKeepAsAxiom - | VtDrop - and vernac_start = string * opacity_guarantee * Names.Id.t list - and vernac_sideff_type = Names.Id.t list - and vernac_part_of_script = bool - and opacity_guarantee = - | GuaranteesOpacity - | Doesn'tGuaranteeOpacity - and proof_step = { - parallel : [ `Yes of solving_tac * anon_abstracting_tac | `No ]; - proof_block_detection : proof_block_name option - } - and solving_tac = bool - and anon_abstracting_tac = bool - and proof_block_name = string - - type vernac_when = - | VtNow - | VtLater - - type verbose_flag = bool - - type universe_decl_expr = (lident list, Misctypes.glob_constraint list) gen_universe_decl - - type ident_decl = lident * universe_decl_expr option - - type lstring - type 'a with_coercion = coercion_flag * 'a - type scope_name = string - type decl_notation = lstring * Constrexpr.constr_expr * scope_name option - type constructor_expr = (lident * Constrexpr.constr_expr) with_coercion - type 'a with_notation = 'a * decl_notation list - - type local_decl_expr = - | AssumExpr of lname * Constrexpr.constr_expr - | DefExpr of lname * Constrexpr.constr_expr * Constrexpr.constr_expr option - - type 'a with_priority = 'a * int option - type 'a with_instance = instance_flag * 'a - type constructor_list_or_record_decl_expr = - | Constructors of constructor_expr list - | RecordDecl of lident option * local_decl_expr with_instance with_priority with_notation list - - type inductive_expr = ident_decl with_coercion * Constrexpr.local_binder_expr list * Constrexpr.constr_expr option * inductive_kind * constructor_list_or_record_decl_expr - - type syntax_modifier = - | SetItemLevel of string list * Extend.production_level - | SetLevel of int - | SetAssoc of Extend.gram_assoc - | SetEntryType of string * Extend.simple_constr_prod_entry_key - | SetOnlyParsing - | SetOnlyPrinting - | SetCompatVersion of Flags.compat_version - | SetFormat of string * string Loc.located - - type class_rawexpr = FunClass | SortClass | RefClass of reference or_by_notation - - type typeclass_constraint = (Names.Name.t Loc.located * universe_decl_expr option) * Decl_kinds.binding_kind * constr_expr - - type definition_expr = - | ProveBody of local_binder_expr list * constr_expr - | DefineBody of local_binder_expr list * Genredexpr.raw_red_expr option * constr_expr - * constr_expr option - type proof_expr = - ident_decl option * (local_binder_expr list * constr_expr) - - type proof_end = - | Admitted - | Proved of opacity_flag * lident option - - type fixpoint_expr = ident_decl * (Names.Id.t Loc.located option * Constrexpr.recursion_order_expr) * Constrexpr.local_binder_expr list * Constrexpr.constr_expr * Constrexpr.constr_expr option - - type cofixpoint_expr - - type scheme - - type section_subset_expr - - type module_binder - - type vernac_argument_status - type vernac_implicit_status - type module_ast_inl - type extend_name = string * int - type simple_binder - type option_value - type showable - type bullet - type comment - type register_kind - type locatable - type search_restriction - type searchable - type printable - type option_ref_value - type onlyparsing_flag - type reference_or_constr - - type hint_mode - - type 'a hint_info_gen = - { hint_priority : int option; - hint_pattern : 'a option } - - type hint_info_expr = Constrexpr.constr_pattern_expr hint_info_gen - - type hints_expr = - | HintsResolve of (hint_info_expr * bool * reference_or_constr) list - | HintsImmediate of reference_or_constr list - | HintsUnfold of Libnames.reference list - | HintsTransparency of Libnames.reference list * bool - | HintsMode of Libnames.reference * hint_mode list - | HintsConstructors of Libnames.reference list - | HintsExtern of int * Constrexpr.constr_expr option * Genarg.raw_generic_argument - - type 'a module_signature = - | Enforce of 'a (** ... : T *) - | Check of 'a list (** ... <: T1 <: T2, possibly empty *) - - type inline = - | NoInline - | DefaultInline - | InlineAt of int - - type cumulative_inductive_parsing_flag = - | GlobalCumulativity - | GlobalNonCumulativity - | LocalCumulativity - | LocalNonCumulativity - - type vernac_expr = - | VernacLoad of verbose_flag * string - | VernacSyntaxExtension of bool * (lstring * syntax_modifier list) - | VernacOpenCloseScope of bool * scope_name - | VernacDelimiters of scope_name * string option - | VernacBindScope of scope_name * class_rawexpr list - | VernacInfix of (lstring * syntax_modifier list) * - Constrexpr.constr_expr * scope_name option - | VernacNotation of - Constrexpr.constr_expr * (lstring * syntax_modifier list) * - scope_name option - | VernacNotationAddFormat of string * string * string - | VernacDefinition of (Decl_kinds.discharge * Decl_kinds.definition_object_kind) * ident_decl * definition_expr - | VernacStartTheoremProof of Decl_kinds.theorem_kind * proof_expr list - | VernacEndProof of proof_end - | VernacExactProof of Constrexpr.constr_expr - | VernacAssumption of (Decl_kinds.discharge * Decl_kinds.assumption_object_kind) * - inline * (ident_decl list * Constrexpr.constr_expr) with_coercion list - | VernacInductive of cumulative_inductive_parsing_flag * Decl_kinds.private_flag * inductive_flag * (inductive_expr * decl_notation list) list - | VernacFixpoint of - Decl_kinds.discharge * (fixpoint_expr * decl_notation list) list - | VernacCoFixpoint of - Decl_kinds.discharge * (cofixpoint_expr * decl_notation list) list - | VernacScheme of (lident option * scheme) list - | VernacCombinedScheme of lident * lident list - | VernacUniverse of lident list - | VernacConstraint of (Misctypes.glob_level * Univ.constraint_type * Misctypes.glob_level) list - | VernacBeginSection of lident - | VernacEndSegment of lident - | VernacRequire of - Libnames.reference option * bool option * Libnames.reference list - | VernacImport of bool * Libnames.reference list - | VernacCanonical of Libnames.reference Misctypes.or_by_notation - | VernacCoercion of Libnames.reference Misctypes.or_by_notation * - class_rawexpr * class_rawexpr - | VernacIdentityCoercion of lident * - class_rawexpr * class_rawexpr - | VernacNameSectionHypSet of lident * section_subset_expr - | VernacInstance of - bool * - Constrexpr.local_binder_expr list * - typeclass_constraint * - (bool * Constrexpr.constr_expr) option * - hint_info_expr - | VernacContext of Constrexpr.local_binder_expr list - | VernacDeclareInstances of - (Libnames.reference * hint_info_expr) list - | VernacDeclareClass of Libnames.reference - | VernacDeclareModule of bool option * lident * - module_binder list * module_ast_inl - | VernacDefineModule of bool option * lident * module_binder list * - module_ast_inl module_signature * module_ast_inl list - | VernacDeclareModuleType of lident * - module_binder list * module_ast_inl list * module_ast_inl list - | VernacInclude of module_ast_inl list - | VernacSolveExistential of int * Constrexpr.constr_expr - | VernacAddLoadPath of bool * string * Names.DirPath.t option - | VernacRemoveLoadPath of string - | VernacAddMLPath of bool * string - | VernacDeclareMLModule of string list - | VernacChdir of string option - | VernacWriteState of string - | VernacRestoreState of string - | VernacResetName of lident - | VernacResetInitial - | VernacBack of int - | VernacBackTo of int - | VernacCreateHintDb of string * bool - | VernacRemoveHints of string list * Libnames.reference list - | VernacHints of string list * hints_expr - | VernacSyntacticDefinition of Names.Id.t Loc.located * (Names.Id.t list * Constrexpr.constr_expr) * - onlyparsing_flag - | VernacDeclareImplicits of Libnames.reference Misctypes.or_by_notation * - (Constrexpr.explicitation * bool * bool) list list - | VernacArguments of Libnames.reference Misctypes.or_by_notation * - vernac_argument_status list * - (Names.Name.t * vernac_implicit_status) list list * - int option * - [ `ReductionDontExposeCase | `ReductionNeverUnfold | `Rename | - `ExtraScopes | `Assert | `ClearImplicits | `ClearScopes | - `DefaultImplicits ] list - | VernacArgumentsScope of Libnames.reference Misctypes.or_by_notation * - scope_name option list - | VernacReserve of simple_binder list - | VernacGeneralizable of (lident list) option - | VernacSetOpacity of (Conv_oracle.level * Libnames.reference Misctypes.or_by_notation list) - | VernacSetStrategy of - (Conv_oracle.level * Libnames.reference Misctypes.or_by_notation list) list - | VernacUnsetOption of Goptions.option_name - | VernacSetOption of Goptions.option_name * option_value - | VernacSetAppendOption of Goptions.option_name * string - | VernacAddOption of Goptions.option_name * option_ref_value list - | VernacRemoveOption of Goptions.option_name * option_ref_value list - | VernacMemOption of Goptions.option_name * option_ref_value list - | VernacPrintOption of Goptions.option_name - | VernacCheckMayEval of Genredexpr.raw_red_expr option * goal_selector option * Constrexpr.constr_expr - | VernacGlobalCheck of Constrexpr.constr_expr - | VernacDeclareReduction of string * Genredexpr.raw_red_expr - | VernacPrint of printable - | VernacSearch of searchable * goal_selector option * search_restriction - | VernacLocate of locatable - | VernacRegister of lident * register_kind - | VernacComments of comment list - | VernacGoal of Constrexpr.constr_expr - | VernacAbort of lident option - | VernacAbortAll - | VernacRestart - | VernacUndo of int - | VernacUndoTo of int - | VernacBacktrack of int*int*int - | VernacFocus of int option - | VernacUnfocus - | VernacUnfocused - | VernacBullet of bullet - | VernacSubproof of int option - | VernacEndSubproof - | VernacShow of showable - | VernacCheckGuard - | VernacProof of Genarg.raw_generic_argument option * section_subset_expr option - | VernacProofMode of string - | VernacToplevelControl of exn - | VernacExtend of extend_name * Genarg.raw_generic_argument list - | VernacProgram of vernac_expr - | VernacPolymorphic of bool * vernac_expr - | VernacLocal of bool * vernac_expr - and goal_selector = - | SelectNth of int - | SelectList of (int * int) list - | SelectId of Names.Id.t - | SelectAll - and vernac_classification = vernac_type * vernac_when - and one_inductive_expr = - ident_decl * Constrexpr.local_binder_expr list * Constrexpr.constr_expr option * constructor_expr list - -type vernac_control = - | VernacExpr of vernac_expr - (* Control *) - | VernacTime of vernac_control Loc.located - | VernacRedirect of string * vernac_control Loc.located - | VernacTimeout of int * vernac_control - | VernacFail of vernac_control - - -end -(* XXX: end of moved from intf *) - -module Typeclasses : -sig - type typeclass = { - cl_univs : Univ.AUContext.t; - cl_impl : Globnames.global_reference; - cl_context : (Globnames.global_reference * bool) option list * Context.Rel.t; - cl_props : Context.Rel.t; - cl_projs : (Names.Name.t * (direction * Vernacexpr.hint_info_expr) option - * Names.Constant.t option) list; - cl_strict : bool; - cl_unique : bool; - } - and direction - - type instance - type evar_filter = Evar.t -> Evar_kinds.t -> bool - - val resolve_typeclasses : ?fast_path:bool -> ?filter:evar_filter -> ?unique:bool -> - ?split:bool -> ?fail:bool -> Environ.env -> Evd.evar_map -> Evd.evar_map - val set_resolvable : Evd.Store.t -> bool -> Evd.Store.t - val resolve_one_typeclass : ?unique:bool -> Environ.env -> Evd.evar_map -> EConstr.types -> Evd.evar_map * EConstr.constr - val class_info : Globnames.global_reference -> typeclass - val mark_resolvables : ?filter:evar_filter -> Evd.evar_map -> Evd.evar_map - val add_instance : instance -> unit - val new_instance : typeclass -> Vernacexpr.hint_info_expr -> bool -> Decl_kinds.polymorphic -> - Globnames.global_reference -> instance -end - -module Classops : -sig - type coe_index - type inheritance_path = coe_index list - type cl_index - - val hide_coercion : Globnames.global_reference -> int option - val lookup_path_to_sort_from : Environ.env -> Evd.evar_map -> EConstr.types -> - EConstr.types * inheritance_path - val get_coercion_value : coe_index -> Constr.t - val coercions : unit -> coe_index list - val pr_cl_index : cl_index -> Pp.t -end - -module Detyping : -sig - type 'a delay = - | Now : 'a delay - | Later : [ `thunk ] delay - val print_universes : bool ref - val print_evar_arguments : bool ref - val print_allow_match_default_clause : bool ref - val detype : 'a delay -> ?lax:bool -> bool -> Names.Id.Set.t -> Environ.env -> Evd.evar_map -> EConstr.constr -> 'a Glob_term.glob_constr_g - val subst_glob_constr : Mod_subst.substitution -> Glob_term.glob_constr -> Glob_term.glob_constr - val set_detype_anonymous : (?loc:Loc.t -> int -> Names.Id.t) -> unit -end - -module Indrec : -sig - type dep_flag = bool - val lookup_eliminator : Names.inductive -> Sorts.family -> Globnames.global_reference - val build_case_analysis_scheme : Environ.env -> Evd.evar_map -> Constr.pinductive -> - dep_flag -> Sorts.family -> Evd.evar_map * Constr.t - val make_elimination_ident : Names.Id.t -> Sorts.family -> Names.Id.t - val build_mutual_induction_scheme : - Environ.env -> Evd.evar_map -> (Constr.pinductive * dep_flag * Sorts.family) list -> Evd.evar_map * Constr.t list - val build_case_analysis_scheme_default : Environ.env -> Evd.evar_map -> Constr.pinductive -> - Sorts.family -> Evd.evar_map * Constr.t -end - -module Pretyping : -sig - type typing_constraint = - | OfType of EConstr.types - | IsType - | WithoutTypeConstraint - - type inference_hook = Environ.env -> Evd.evar_map -> Evar.t -> Evd.evar_map * EConstr.constr - - type inference_flags = { - use_typeclasses : bool; - solve_unification_constraints : bool; - use_hook : inference_hook option; - fail_evar : bool; - expand_evars : bool - } - - val understand_ltac : inference_flags -> - Environ.env -> Evd.evar_map -> Ltac_pretype.ltac_var_map -> - typing_constraint -> Glob_term.glob_constr -> Evd.evar_map * EConstr.t - val understand_tcc : ?flags:inference_flags -> Environ.env -> Evd.evar_map -> - ?expected_type:typing_constraint -> Glob_term.glob_constr -> Evd.evar_map * EConstr.constr - val understand : ?flags:inference_flags -> ?expected_type:typing_constraint -> - Environ.env -> Evd.evar_map -> Glob_term.glob_constr -> Constr.t Evd.in_evar_universe_context - val check_evars : Environ.env -> Evd.evar_map -> Evd.evar_map -> EConstr.constr -> unit - val register_constr_interp0 : - ('r, 'g, 't) Genarg.genarg_type -> - (Ltac_pretype.unbound_ltac_var_map -> Environ.env -> Evd.evar_map -> EConstr.types -> 'g -> EConstr.constr * Evd.evar_map) -> unit - val all_and_fail_flags : inference_flags - val ise_pretype_gen : - inference_flags -> Environ.env -> Evd.evar_map -> - Ltac_pretype.ltac_var_map -> typing_constraint -> Glob_term.glob_constr -> Evd.evar_map * EConstr.constr -end - -module Unification : -sig - type core_unify_flags = { - modulo_conv_on_closed_terms : Names.transparent_state option; - use_metas_eagerly_in_conv_on_closed_terms : bool; - use_evars_eagerly_in_conv_on_closed_terms : bool; - modulo_delta : Names.transparent_state; - modulo_delta_types : Names.transparent_state; - check_applied_meta_types : bool; - use_pattern_unification : bool; - use_meta_bound_pattern_unification : bool; - frozen_evars : Evar.Set.t; - restrict_conv_on_strict_subterms : bool; - modulo_betaiota : bool; - modulo_eta : bool; - } - type unify_flags = - { - core_unify_flags : core_unify_flags; - merge_unify_flags : core_unify_flags; - subterm_unify_flags : core_unify_flags; - allow_K_in_toplevel_higher_order_unification : bool; - resolve_evars : bool - } - val default_no_delta_unify_flags : unit -> unify_flags - val w_unify : Environ.env -> Evd.evar_map -> Reduction.conv_pb -> ?flags:unify_flags -> EConstr.constr -> EConstr.constr -> Evd.evar_map - val elim_flags : unit -> unify_flags - val w_unify_to_subterm : - Environ.env -> Evd.evar_map -> ?flags:unify_flags -> EConstr.constr * EConstr.constr -> Evd.evar_map * EConstr.constr -end - -module Univdecls : -sig - type universe_decl = - (Names.Id.t Loc.located list, Univ.Constraint.t) Misctypes.gen_universe_decl - - val interp_univ_decl : Environ.env -> Vernacexpr.universe_decl_expr -> - Evd.evar_map * universe_decl - val interp_univ_decl_opt : Environ.env -> Vernacexpr.universe_decl_expr option -> - Evd.evar_map * universe_decl - val default_univ_decl : universe_decl -end - -(************************************************************************) -(* End of modules from pretyping/ *) -(************************************************************************) - -(************************************************************************) -(* Modules from interp/ *) -(************************************************************************) - -module Tactypes : -sig - type glob_constr_and_expr = Glob_term.glob_constr * Constrexpr.constr_expr option - type glob_constr_pattern_and_expr = Names.Id.Set.t * glob_constr_and_expr * Pattern.constr_pattern - type 'a delayed_open = Environ.env -> Evd.evar_map -> Evd.evar_map * 'a - type delayed_open_constr = EConstr.constr delayed_open - type delayed_open_constr_with_bindings = EConstr.constr Misctypes.with_bindings delayed_open - type intro_pattern = delayed_open_constr Misctypes.intro_pattern_expr Loc.located - type intro_patterns = delayed_open_constr Misctypes.intro_pattern_expr Loc.located list - type intro_pattern_naming = Misctypes.intro_pattern_naming_expr Loc.located - type or_and_intro_pattern = delayed_open_constr Misctypes.or_and_intro_pattern_expr Loc.located -end - -module Genintern : -sig - open Genarg - - module Store : Store.S - - type glob_sign = { - ltacvars : Names.Id.Set.t; - genv : Environ.env; - extra : Store.t; - } - - val empty_glob_sign : Environ.env -> glob_sign - - type ('raw, 'glb) intern_fun = glob_sign -> 'raw -> glob_sign * 'glb - - - val generic_intern : (raw_generic_argument, glob_generic_argument) intern_fun - - type 'glb subst_fun = Mod_subst.substitution -> 'glb -> 'glb - val generic_substitute : Genarg.glob_generic_argument subst_fun - - type 'glb ntn_subst_fun = Tactypes.glob_constr_and_expr Names.Id.Map.t -> 'glb -> 'glb - - val register_intern0 : ('raw, 'glb, 'top) genarg_type -> - ('raw, 'glb) intern_fun -> unit - - val register_subst0 : ('raw, 'glb, 'top) genarg_type -> - 'glb subst_fun -> unit - - val register_ntn_subst0 : ('raw, 'glb, 'top) genarg_type -> - 'glb ntn_subst_fun -> unit - -end - -module Stdarg : -sig - val loc_of_or_by_notation : ('a -> Loc.t option) -> 'a Misctypes.or_by_notation -> Loc.t option - val wit_unit : unit Genarg.uniform_genarg_type - val wit_int : int Genarg.uniform_genarg_type - val wit_var : (Names.Id.t Loc.located, Names.Id.t Loc.located, Names.Id.t) Genarg.genarg_type - val wit_bool : bool Genarg.uniform_genarg_type - val wit_string : string Genarg.uniform_genarg_type - val wit_pre_ident : string Genarg.uniform_genarg_type - val wit_global : (Libnames.reference, Globnames.global_reference Loc.located Misctypes.or_var, Globnames.global_reference) Genarg.genarg_type - val wit_ident : Names.Id.t Genarg.uniform_genarg_type - val wit_integer : int Genarg.uniform_genarg_type - val wit_sort_family : (Sorts.family, unit, unit) Genarg.genarg_type - val wit_constr : (Constrexpr.constr_expr, Tactypes.glob_constr_and_expr, EConstr.constr) Genarg.genarg_type - val wit_open_constr : (Constrexpr.constr_expr, Tactypes.glob_constr_and_expr, EConstr.constr) Genarg.genarg_type - val wit_intro_pattern : (Constrexpr.constr_expr Misctypes.intro_pattern_expr Loc.located, Tactypes.glob_constr_and_expr Misctypes.intro_pattern_expr Loc.located, Tactypes.intro_pattern) Genarg.genarg_type - val wit_int_or_var : (int Misctypes.or_var, int Misctypes.or_var, int) Genarg.genarg_type - val wit_ref : (Libnames.reference, Globnames.global_reference Loc.located Misctypes.or_var, Globnames.global_reference) Genarg.genarg_type - val wit_clause_dft_concl : (Names.Id.t Loc.located Locus.clause_expr,Names.Id.t Loc.located Locus.clause_expr,Names.Id.t Locus.clause_expr) Genarg.genarg_type - val wit_uconstr : (Constrexpr.constr_expr , Tactypes.glob_constr_and_expr, Ltac_pretype.closed_glob_constr) Genarg.genarg_type - val wit_red_expr : - ((Constrexpr.constr_expr,Libnames.reference Misctypes.or_by_notation,Constrexpr.constr_expr) Genredexpr.red_expr_gen, - (Tactypes.glob_constr_and_expr,Names.evaluable_global_reference Misctypes.and_short_name Misctypes.or_var,Tactypes.glob_constr_pattern_and_expr) Genredexpr.red_expr_gen, - (EConstr.constr,Names.evaluable_global_reference,Pattern.constr_pattern) Genredexpr.red_expr_gen) Genarg.genarg_type - val wit_quant_hyp : Misctypes.quantified_hypothesis Genarg.uniform_genarg_type - val wit_bindings : - (Constrexpr.constr_expr Misctypes.bindings, - Tactypes.glob_constr_and_expr Misctypes.bindings, - EConstr.constr Misctypes.bindings Tactypes.delayed_open) Genarg.genarg_type - val wit_constr_with_bindings : - (Constrexpr.constr_expr Misctypes.with_bindings, - Tactypes.glob_constr_and_expr Misctypes.with_bindings, - EConstr.constr Misctypes.with_bindings Tactypes.delayed_open) Genarg.genarg_type - val wit_intropattern : (Constrexpr.constr_expr Misctypes.intro_pattern_expr Loc.located, Tactypes.glob_constr_and_expr Misctypes.intro_pattern_expr Loc.located, Tactypes.intro_pattern) Genarg.genarg_type - val wit_quantified_hypothesis : Misctypes.quantified_hypothesis Genarg.uniform_genarg_type - val wit_clause : (Names.Id.t Loc.located Locus.clause_expr,Names.Id.t Loc.located Locus.clause_expr,Names.Id.t Locus.clause_expr) Genarg.genarg_type - val wit_preident : string Genarg.uniform_genarg_type - val wit_reference : (Libnames.reference, Globnames.global_reference Loc.located Misctypes.or_var, Globnames.global_reference) Genarg.genarg_type - val wit_open_constr_with_bindings : - (Constrexpr.constr_expr Misctypes.with_bindings, - Tactypes.glob_constr_and_expr Misctypes.with_bindings, - EConstr.constr Misctypes.with_bindings Tactypes.delayed_open) Genarg.genarg_type -end - -module Constrexpr_ops : -sig - val mkIdentC : Names.Id.t -> Constrexpr.constr_expr - val mkAppC : Constrexpr.constr_expr * Constrexpr.constr_expr list -> Constrexpr.constr_expr - val names_of_local_assums : Constrexpr.local_binder_expr list -> Names.Name.t Loc.located list - val coerce_reference_to_id : Libnames.reference -> Names.Id.t - val coerce_to_id : Constrexpr.constr_expr -> Names.Id.t Loc.located - val constr_loc : Constrexpr.constr_expr -> Loc.t option - val mkRefC : Libnames.reference -> Constrexpr.constr_expr - val mkLambdaC : Names.Name.t Loc.located list * Constrexpr.binder_kind * Constrexpr.constr_expr * Constrexpr.constr_expr -> Constrexpr.constr_expr - val default_binder_kind : Constrexpr.binder_kind - val mkLetInC : Names.Name.t Loc.located * Constrexpr.constr_expr * Constrexpr.constr_expr option * Constrexpr.constr_expr -> Constrexpr.constr_expr - val mkCProdN : ?loc:Loc.t -> Constrexpr.local_binder_expr list -> Constrexpr.constr_expr -> Constrexpr.constr_expr - val replace_vars_constr_expr : - Names.Id.t Names.Id.Map.t -> Constrexpr.constr_expr -> Constrexpr.constr_expr -end - -module Notation_ops : -sig - val glob_constr_of_notation_constr : ?loc:Loc.t -> Notation_term.notation_constr -> Glob_term.glob_constr - val glob_constr_of_notation_constr_with_binders : ?loc:Loc.t -> - ('a -> Names.Name.t -> 'a * Names.Name.t) -> - ('a -> Notation_term.notation_constr -> Glob_term.glob_constr) -> - 'a -> Notation_term.notation_constr -> Glob_term.glob_constr -end - -module Notation : -sig - type cases_pattern_status = bool - type required_module = Libnames.full_path * string list - type 'a prim_token_interpreter = ?loc:Loc.t -> 'a -> Glob_term.glob_constr - type 'a prim_token_uninterpreter = Glob_term.glob_constr list * (Glob_term.any_glob_constr -> 'a option) * cases_pattern_status - type delimiters = string - type local_scopes = Notation_term.tmp_scope_name option * Notation_term.scope_name list - type notation_location = (Names.DirPath.t * Names.DirPath.t) * string - val declare_string_interpreter : Notation_term.scope_name -> required_module -> - string prim_token_interpreter -> string prim_token_uninterpreter -> unit - val declare_numeral_interpreter : Notation_term.scope_name -> required_module -> - Bigint.bigint prim_token_interpreter -> Bigint.bigint prim_token_uninterpreter -> unit - val interp_notation_as_global_reference : ?loc:Loc.t -> (Globnames.global_reference -> bool) -> - Constrexpr.notation -> delimiters option -> Globnames.global_reference - val locate_notation : (Glob_term.glob_constr -> Pp.t) -> Constrexpr.notation -> - Notation_term.scope_name option -> Pp.t - val find_delimiters_scope : ?loc:Loc.t -> delimiters -> Notation_term.scope_name - val pr_scope : (Glob_term.glob_constr -> Pp.t) -> Notation_term.scope_name -> Pp.t - val pr_scopes : (Glob_term.glob_constr -> Pp.t) -> Pp.t - val interp_notation : ?loc:Loc.t -> Constrexpr.notation -> local_scopes -> - Notation_term.interpretation * (notation_location * Notation_term.scope_name option) - val uninterp_prim_token : Glob_term.glob_constr -> Notation_term.scope_name * Constrexpr.prim_token -end - -module Dumpglob : -sig - val add_glob : ?loc:Loc.t -> Globnames.global_reference -> unit - val pause : unit -> unit - val continue : unit -> unit -end - -module Smartlocate : -sig - val locate_global_with_alias : ?head:bool -> Libnames.qualid Loc.located -> Globnames.global_reference - val global_with_alias : ?head:bool -> Libnames.reference -> Globnames.global_reference - val global_of_extended_global : Globnames.extended_global_reference -> Globnames.global_reference - val loc_of_smart_reference : Libnames.reference Misctypes.or_by_notation -> Loc.t option - val smart_global : ?head:bool -> Libnames.reference Misctypes.or_by_notation -> Globnames.global_reference -end - -module Topconstr : -sig - - val replace_vars_constr_expr : - Names.Id.t Names.Id.Map.t -> Constrexpr.constr_expr -> Constrexpr.constr_expr - [@@ocaml.deprecated "use Constrexpr_ops.free_vars_of_constr_expr"] - -end - -module Constrintern : -sig - - open Evd - - type ltac_sign = { - ltac_vars : Names.Id.Set.t; - ltac_bound : Names.Id.Set.t; - ltac_extra : Genintern.Store.t; - } - - type var_internalization_data - - type var_internalization_type = - | Inductive of Names.Id.t list * bool - | Recursive - | Method - | Variable - type internalization_env = var_internalization_data Names.Id.Map.t - - val interp_constr_evars : Environ.env -> evar_map -> - ?impls:internalization_env -> Constrexpr.constr_expr -> evar_map * EConstr.constr - - val interp_type_evars : Environ.env -> Evd.evar_map -> - ?impls:internalization_env -> Constrexpr.constr_expr -> evar_map * EConstr.types - - val empty_ltac_sign : ltac_sign - val intern_gen : Pretyping.typing_constraint -> Environ.env -> - ?impls:internalization_env -> ?pattern_mode:bool -> ?ltacvars:ltac_sign -> - Constrexpr.constr_expr -> Glob_term.glob_constr - val intern_constr_pattern : - Environ.env -> ?as_type:bool -> ?ltacvars:ltac_sign -> - Constrexpr.constr_pattern_expr -> Names.Id.t list * Pattern.constr_pattern - val intern_constr : Environ.env -> Constrexpr.constr_expr -> Glob_term.glob_constr - val for_grammar : ('a -> 'b) -> 'a -> 'b - val interp_reference : ltac_sign -> Libnames.reference -> Glob_term.glob_constr - val interp_constr : Environ.env -> Evd.evar_map -> ?impls:internalization_env -> - Constrexpr.constr_expr -> Constr.t Evd.in_evar_universe_context - val interp_open_constr : Environ.env -> Evd.evar_map -> Constrexpr.constr_expr -> Evd.evar_map * EConstr.constr - val locate_reference : Libnames.qualid -> Globnames.global_reference - val interp_type : Environ.env -> Evd.evar_map -> ?impls:internalization_env -> - Constrexpr.constr_expr -> Constr.types Evd.in_evar_universe_context - - val interp_context_evars : - ?global_level:bool -> ?impl_env:internalization_env -> ?shift:int -> - Environ.env -> Evd.evar_map -> Constrexpr.local_binder_expr list -> - evar_map * (internalization_env * ((Environ.env * EConstr.rel_context) * Impargs.manual_implicits)) - - val compute_internalization_data : Environ.env -> var_internalization_type -> - Constr.types -> Impargs.manual_explicitation list -> var_internalization_data - val empty_internalization_env : internalization_env - val global_reference : Names.Id.t -> Globnames.global_reference -end - -module Constrextern : -sig - val extern_glob_constr : Names.Id.Set.t -> Glob_term.glob_constr -> Constrexpr.constr_expr - val extern_glob_type : Names.Id.Set.t -> Glob_term.glob_constr -> Constrexpr.constr_expr - val extern_constr : ?lax:bool -> bool -> Environ.env -> Evd.evar_map -> EConstr.t -> Constrexpr.constr_expr - val without_symbols : ('a -> 'b) -> 'a -> 'b - val print_universes : bool ref - val extern_type : bool -> Environ.env -> Evd.evar_map -> EConstr.t -> Constrexpr.constr_expr - val with_universes : ('a -> 'b) -> 'a -> 'b - val set_extern_reference : - (?loc:Loc.t -> Names.Id.Set.t -> Globnames.global_reference -> Libnames.reference) -> unit -end - -module Declare : -sig - type internal_flag = - | UserAutomaticRequest - | InternalTacticRequest - | UserIndividualRequest - - type constant_declaration = Safe_typing.private_constants Entries.constant_entry * Decl_kinds.logical_kind - - type section_variable_entry = - | SectionLocalDef of Safe_typing.private_constants Entries.definition_entry - | SectionLocalAssum of Constr.types Univ.in_universe_context_set * Decl_kinds.polymorphic * bool - - type variable_declaration = Names.DirPath.t * section_variable_entry * Decl_kinds.logical_kind - - val declare_constant : - ?internal:internal_flag -> ?local:bool -> Names.Id.t -> ?export_seff:bool -> constant_declaration -> Names.Constant.t - - val declare_universe_context : Decl_kinds.polymorphic -> Univ.ContextSet.t -> unit - - val declare_definition : - ?internal:internal_flag -> ?opaque:bool -> ?kind:Decl_kinds.definition_object_kind -> - ?local:bool -> Names.Id.t -> ?types:Constr.t -> - Constr.t Entries.in_constant_universes_entry -> Names.Constant.t - val definition_entry : ?fix_exn:Future.fix_exn -> - ?opaque:bool -> ?inline:bool -> ?types:Constr.types -> - ?univs:Entries.constant_universes_entry -> - ?eff:Safe_typing.private_constants -> Constr.t -> Safe_typing.private_constants Entries.definition_entry - val definition_message : Names.Id.t -> unit - val declare_variable : Names.Id.t -> variable_declaration -> Libnames.object_name -end - -(************************************************************************) -(* End of modules from interp/ *) -(************************************************************************) - -(************************************************************************) -(* Modules from proofs/ *) -(************************************************************************) - -module Miscprint : -sig - val pr_or_and_intro_pattern : - ('a -> Pp.t) -> 'a Misctypes.or_and_intro_pattern_expr -> Pp.t - val pr_intro_pattern_naming : Misctypes.intro_pattern_naming_expr -> Pp.t - val pr_intro_pattern : - ('a -> Pp.t) -> 'a Misctypes.intro_pattern_expr Loc.located -> Pp.t - val pr_bindings : - ('a -> Pp.t) -> - ('a -> Pp.t) -> 'a Misctypes.bindings -> Pp.t - val pr_bindings_no_with : - ('a -> Pp.t) -> - ('a -> Pp.t) -> 'a Misctypes.bindings -> Pp.t - val pr_with_bindings : - ('a -> Pp.t) -> - ('a -> Pp.t) -> 'a * 'a Misctypes.bindings -> Pp.t -end - -(* All items in the Goal modules are deprecated. *) -module Goal : -sig - type goal = Evar.t - - val pr_goal : goal -> Pp.t - - module V82 : - sig - val new_goal_with : Evd.evar_map -> goal -> Context.Named.t -> goal Evd.sigma - - val nf_hyps : Evd.evar_map -> goal -> Environ.named_context_val - - val env : Evd.evar_map -> goal -> Environ.env - - val concl : Evd.evar_map -> goal -> EConstr.constr - - val mk_goal : Evd.evar_map -> - Environ.named_context_val -> - EConstr.constr -> - Evd.Store.t -> - goal * EConstr.constr * Evd.evar_map - - val extra : Evd.evar_map -> goal -> Evd.Store.t - - val partial_solution_to : Evd.evar_map -> goal -> goal -> EConstr.constr -> Evd.evar_map - - val partial_solution : Evd.evar_map -> goal -> EConstr.constr -> Evd.evar_map - - val hyps : Evd.evar_map -> goal -> Environ.named_context_val - - val abstract_type : Evd.evar_map -> goal -> EConstr.types - end -end - -module Evar_refiner : -sig - type glob_constr_ltac_closure = Ltac_pretype.ltac_var_map * Glob_term.glob_constr - - val w_refine : Evar.t * Evd.evar_info -> - glob_constr_ltac_closure -> Evd.evar_map -> Evd.evar_map -end - - -module Proof_type : -sig - type prim_rule = Refine of Constr.t - - type tactic = Goal.goal Evd.sigma -> Goal.goal list Evd.sigma -end - -module Logic : -sig - type refiner_error = - | BadType of Constr.t * Constr.t * Constr.t - | UnresolvedBindings of Names.Name.t list - | CannotApply of Constr.t * Constr.t - | NotWellTyped of Constr.t - | NonLinearProof of Constr.t - | MetaInType of EConstr.constr - | IntroNeedsProduct - | DoesNotOccurIn of Constr.t * Names.Id.t - | NoSuchHyp of Names.Id.t - exception RefinerError of Environ.env * Evd.evar_map * refiner_error - val catchable_exception : exn -> bool -end - -module Refine : -sig - val refine : typecheck:bool -> (Evd.evar_map -> Evd.evar_map * EConstr.t) -> unit Proofview.tactic - val solve_constraints : unit Proofview.tactic -end - -module Proof : -sig - type t - type proof = t - [@@ocaml.deprecated "please use [Proof.t]"] - - type 'a focus_kind - val proof : t -> - Goal.goal list * (Goal.goal list * Goal.goal list) list * - Goal.goal list * Goal.goal list * Evd.evar_map - - val run_tactic : Environ.env -> - unit Proofview.tactic -> t -> t * (bool * Proofview_monad.Info.tree) - val unshelve : t -> t - val maximal_unfocus : 'a focus_kind -> t -> t - val pr_proof : t -> Pp.t - - module V82 : - sig - val grab_evars : t -> t - - val subgoals : t -> Goal.goal list Evd.sigma - [@@ocaml.deprecated "Use the first and fifth argument of [Proof.proof]"] - - end -end - -module Proof_bullet : -sig - val get_default_goal_selector : unit -> Vernacexpr.goal_selector -end - -module Proof_global : -sig - - type t - type state = t - [@@ocaml.deprecated "please use [Proof_global.t]"] - - type proof_mode = { - name : string; - set : unit -> unit ; - reset : unit -> unit - } - type proof_object = { - id : Names.Id.t; - entries : Safe_typing.private_constants Entries.definition_entry list; - persistence : Decl_kinds.goal_kind; - universes: UState.t; - } - - type proof_ending = - | Admitted of Names.Id.t * Decl_kinds.goal_kind * Entries.parameter_entry * - UState.t - | Proved of Vernacexpr.opacity_flag * - Vernacexpr.lident option * - proof_object - - type proof_terminator - type lemma_possible_guards - type closed_proof = proof_object * proof_terminator - - val make_terminator : (proof_ending -> unit) -> proof_terminator - val start_dependent_proof : - Names.Id.t -> ?pl:Univdecls.universe_decl -> Decl_kinds.goal_kind -> - Proofview.telescope -> proof_terminator -> unit - val with_current_proof : - (unit Proofview.tactic -> Proof.t -> Proof.t * 'a) -> 'a - val simple_with_current_proof : - (unit Proofview.tactic -> Proof.t -> Proof.t) -> unit - val compact_the_proof : unit -> unit - val register_proof_mode : proof_mode -> unit - - exception NoCurrentProof - val give_me_the_proof : unit -> Proof.t - (** @raise NoCurrentProof when outside proof mode. *) - - val discard_all : unit -> unit - val discard_current : unit -> unit - val get_current_proof_name : unit -> Names.Id.t -end - -module Redexpr : -sig - type red_expr = - (EConstr.constr, Names.evaluable_global_reference, Pattern.constr_pattern) Genredexpr.red_expr_gen - val reduction_of_red_expr : - Environ.env -> red_expr -> Reductionops.e_reduction_function * Constr.cast_kind - val declare_reduction : string -> Reductionops.reduction_function -> unit -end - -module Refiner : -sig - val project : 'a Evd.sigma -> Evd.evar_map - - val unpackage : 'a Evd.sigma -> Evd.evar_map ref * 'a - - val repackage : Evd.evar_map ref -> 'a -> 'a Evd.sigma - - val tclSHOWHYPS : Proof_type.tactic -> Proof_type.tactic - exception FailError of int * Pp.t Lazy.t - - val tclEVARS : Evd.evar_map -> Proof_type.tactic - val tclMAP : ('a -> Proof_type.tactic) -> 'a list -> Proof_type.tactic - val tclREPEAT : Proof_type.tactic -> Proof_type.tactic - val tclORELSE : Proof_type.tactic -> Proof_type.tactic -> Proof_type.tactic - val tclFAIL : int -> Pp.t -> Proof_type.tactic - val tclIDTAC : Proof_type.tactic - val tclTHEN : Proof_type.tactic -> Proof_type.tactic -> Proof_type.tactic - val tclTHENLIST : Proof_type.tactic list -> Proof_type.tactic - val tclTRY : Proof_type.tactic -> Proof_type.tactic - val tclAT_LEAST_ONCE : Proof_type.tactic -> Proof_type.tactic -end - -module Tacmach : -sig - - type tactic = Proof_type.tactic - - type 'a sigma = 'a Evd.sigma - [@@ocaml.deprecated "alias of API.Evd.sigma"] - - val re_sig : 'a -> Evd.evar_map -> 'a Evd.sigma - - val pf_reduction_of_red_expr : Goal.goal Evd.sigma -> Redexpr.red_expr -> EConstr.constr -> Evd.evar_map * EConstr.constr - - val pf_unsafe_type_of : Goal.goal Evd.sigma -> EConstr.constr -> EConstr.types - - val pf_get_new_id : Names.Id.t -> Goal.goal Evd.sigma -> Names.Id.t - - val pf_env : Goal.goal Evd.sigma -> Environ.env - - val pf_concl : Goal.goal Evd.sigma -> EConstr.types - - val pf_apply : (Environ.env -> Evd.evar_map -> 'a) -> Goal.goal Evd.sigma -> 'a - - val pf_get_hyp : Goal.goal Evd.sigma -> Names.Id.t -> EConstr.named_declaration - val pf_get_hyp_typ : Goal.goal Evd.sigma -> Names.Id.t -> EConstr.types - val project : Goal.goal Evd.sigma -> Evd.evar_map - val refine : EConstr.constr -> Proof_type.tactic - val refine_no_check : EConstr.constr -> Proof_type.tactic - val pf_type_of : Goal.goal Evd.sigma -> EConstr.constr -> Evd.evar_map * EConstr.types - - val pf_hyps : Goal.goal Evd.sigma -> EConstr.named_context - - val pf_ids_of_hyps : Goal.goal Evd.sigma -> Names.Id.t list - - val pf_reduce_to_atomic_ind : Goal.goal Evd.sigma -> EConstr.types -> (Names.inductive * EConstr.EInstance.t) * EConstr.types - - val pf_reduce_to_quantified_ind : Goal.goal Evd.sigma -> EConstr.types -> (Names.inductive * EConstr.EInstance.t) * EConstr.types - - val pf_eapply : (Environ.env -> Evd.evar_map -> 'a -> Evd.evar_map * 'b) -> - Evar.t Evd.sigma -> 'a -> Evar.t Evd.sigma * 'b - - val pf_unfoldn : (Locus.occurrences * Names.evaluable_global_reference) list - -> Goal.goal Evd.sigma -> EConstr.constr -> EConstr.constr - - val pf_reduce : (Environ.env -> Evd.evar_map -> EConstr.constr -> EConstr.constr) -> Goal.goal Evd.sigma -> EConstr.constr -> EConstr.constr - - val pf_conv_x : Goal.goal Evd.sigma -> EConstr.constr -> EConstr.constr -> bool - - val pf_hyps_types : Goal.goal Evd.sigma -> (Names.Id.t * EConstr.types) list - - val pr_gls : Goal.goal Evd.sigma -> Pp.t - - val pf_nf_betaiota : Goal.goal Evd.sigma -> EConstr.constr -> EConstr.constr - - val pf_last_hyp : Goal.goal Evd.sigma -> EConstr.named_declaration - - val pf_nth_hyp_id : Goal.goal Evd.sigma -> int -> Names.Id.t - - val sig_it : 'a Evd.sigma -> 'a - - module New : - sig - val pf_apply : (Environ.env -> Evd.evar_map -> 'a) -> 'b Proofview.Goal.t -> 'a - val project : 'a Proofview.Goal.t -> Evd.evar_map - val pf_unsafe_type_of : 'a Proofview.Goal.t -> EConstr.constr -> EConstr.types - val of_old : (Goal.goal Evd.sigma -> 'a) -> [ `NF ] Proofview.Goal.t -> 'a - - val pf_env : 'a Proofview.Goal.t -> Environ.env - val pf_ids_of_hyps : 'a Proofview.Goal.t -> Names.Id.t list - val pf_ids_set_of_hyps : 'a Proofview.Goal.t -> Names.Id.Set.t - val pf_concl : 'a Proofview.Goal.t -> EConstr.types - val pf_get_new_id : Names.Id.t -> 'a Proofview.Goal.t -> Names.Id.t - val pf_get_hyp : Names.Id.t -> 'a Proofview.Goal.t -> EConstr.named_declaration - val pf_get_hyp_typ : Names.Id.t -> 'a Proofview.Goal.t -> EConstr.types - val pf_get_type_of : 'a Proofview.Goal.t -> EConstr.constr -> EConstr.types - val pf_global : Names.Id.t -> 'a Proofview.Goal.t -> Globnames.global_reference - val pf_hyps_types : 'a Proofview.Goal.t -> (Names.Id.t * EConstr.types) list - end -end - -module Pfedit : -sig - val solve_by_implicit_tactic : unit -> Pretyping.inference_hook option - val refine_by_tactic : Environ.env -> Evd.evar_map -> EConstr.types -> unit Proofview.tactic -> - Constr.t * Evd.evar_map - val declare_implicit_tactic : unit Proofview.tactic -> unit - val clear_implicit_tactic : unit -> unit - val by : unit Proofview.tactic -> bool - val solve : ?with_end_tac:unit Proofview.tactic -> - Vernacexpr.goal_selector -> int option -> unit Proofview.tactic -> - Proof.t -> Proof.t * bool - val cook_proof : - unit -> (Names.Id.t * (Safe_typing.private_constants Entries.definition_entry * UState.t * Decl_kinds.goal_kind)) - - val get_current_context : unit -> Evd.evar_map * Environ.env - val current_proof_statement : unit -> Names.Id.t * Decl_kinds.goal_kind * EConstr.types -end - -module Clenv : -sig - - type hole = { - hole_evar : EConstr.constr; - hole_type : EConstr.types; - hole_deps : bool; - hole_name : Names.Name.t; - } - - type clause = { - cl_holes : hole list; - cl_concl : EConstr.types; - } - - val make_evar_clause : Environ.env -> Evd.evar_map -> ?len:int -> EConstr.types -> - (Evd.evar_map * clause) - val solve_evar_clause : Environ.env -> Evd.evar_map -> bool -> clause -> EConstr.constr Misctypes.bindings -> - Evd.evar_map - type clausenv - val pr_clenv : clausenv -> Pp.t -end - -(************************************************************************) -(* End of modules from proofs/ *) -(************************************************************************) - -(************************************************************************) -(* Modules from parsing/ *) -(************************************************************************) - -module Pcoq : -sig - - open Loc - open Names - open Extend - open Vernacexpr - open Genarg - open Constrexpr - open Libnames - open Misctypes - open Genredexpr - - module Gram : sig - include Grammar.S with type te = Tok.t - - type 'a entry = 'a Entry.e - type internal_entry = Tok.t Gramext.g_entry - type symbol = Tok.t Gramext.g_symbol - type action = Gramext.g_action - type production_rule = symbol list * action - type single_extend_statment = - string option * Gramext.g_assoc option * production_rule list - type extend_statment = - Gramext.position option * single_extend_statment list - - type coq_parsable - - val parsable : ?file:Loc.source -> char Stream.t -> coq_parsable - val action : 'a -> action - val entry_create : string -> 'a entry - val entry_parse : 'a entry -> coq_parsable -> 'a - val entry_print : Format.formatter -> 'a entry -> unit - val with_parsable : coq_parsable -> ('a -> 'b) -> 'a -> 'b - - (* Apparently not used *) - val srules' : production_rule list -> symbol - val parse_tokens_after_filter : 'a entry -> Tok.t Stream.t -> 'a - - end with type 'a Entry.e = 'a Grammar.GMake(CLexer).Entry.e - - val parse_string : 'a Gram.entry -> string -> 'a - val eoi_entry : 'a Gram.entry -> 'a Gram.entry - val map_entry : ('a -> 'b) -> 'a Gram.entry -> 'b Gram.entry - - type gram_universe - - val uprim : gram_universe - val uconstr : gram_universe - val utactic : gram_universe - val uvernac : gram_universe - - val register_grammar : ('raw, 'glb, 'top) genarg_type -> 'raw Gram.entry -> unit - - val genarg_grammar : ('raw, 'glb, 'top) genarg_type -> 'raw Gram.entry - - val create_generic_entry : gram_universe -> string -> - ('a, rlevel) abstract_argument_type -> 'a Gram.entry - - module Prim : - sig - open Names - open Libnames - val preident : string Gram.entry - val ident : Id.t Gram.entry - val name : Name.t located Gram.entry - val identref : Id.t located Gram.entry - val pattern_ident : Id.t Gram.entry - val pattern_identref : Id.t located Gram.entry - val base_ident : Id.t Gram.entry - val natural : int Gram.entry - val bigint : Constrexpr.raw_natural_number Gram.entry - val integer : int Gram.entry - val string : string Gram.entry - val lstring : string located Gram.entry - val qualid : qualid located Gram.entry - val fullyqualid : Id.t list located Gram.entry - val reference : reference Gram.entry - val by_notation : (string * string option) Loc.located Gram.entry - val smart_global : reference or_by_notation Gram.entry - val dirpath : DirPath.t Gram.entry - val ne_string : string Gram.entry - val ne_lstring : string located Gram.entry - val var : Id.t located Gram.entry - end - - module Constr : - sig - val constr : constr_expr Gram.entry - val constr_eoi : constr_expr Gram.entry - val lconstr : constr_expr Gram.entry - val binder_constr : constr_expr Gram.entry - val operconstr : constr_expr Gram.entry - val ident : Id.t Gram.entry - val global : reference Gram.entry - val universe_level : glob_level Gram.entry - val sort : glob_sort Gram.entry - val sort_family : Sorts.family Gram.entry - val pattern : cases_pattern_expr Gram.entry - val constr_pattern : constr_expr Gram.entry - val lconstr_pattern : constr_expr Gram.entry - val closed_binder : local_binder_expr list Gram.entry - val binder : local_binder_expr list Gram.entry (* closed_binder or variable *) - val binders : local_binder_expr list Gram.entry (* list of binder *) - val open_binders : local_binder_expr list Gram.entry - val binders_fixannot : (local_binder_expr list * (Id.t located option * recursion_order_expr)) Gram.entry - val typeclass_constraint : (Name.t located * bool * constr_expr) Gram.entry - val record_declaration : constr_expr Gram.entry - val appl_arg : (constr_expr * explicitation located option) Gram.entry - end - - module Vernac_ : - sig - val gallina : vernac_expr Gram.entry - val gallina_ext : vernac_expr Gram.entry - val command : vernac_expr Gram.entry - val syntax : vernac_expr Gram.entry - val rec_definition : (fixpoint_expr * decl_notation list) Gram.entry - val noedit_mode : vernac_expr Gram.entry - val command_entry : vernac_expr Gram.entry - val red_expr : raw_red_expr Gram.entry - val hint_info : Vernacexpr.hint_info_expr Gram.entry - end - - val epsilon_value : ('a -> 'self) -> ('self, 'a) Extend.symbol -> 'self option - - val get_command_entry : unit -> vernac_expr Gram.entry - val set_command_entry : vernac_expr Gram.entry -> unit - - type gram_reinit = gram_assoc * gram_position - val grammar_extend : 'a Gram.entry -> gram_reinit option -> - 'a Extend.extend_statment -> unit - - module GramState : Store.S - - type 'a grammar_command - - type extend_rule = - | ExtendRule : 'a Gram.entry * gram_reinit option * 'a extend_statment -> extend_rule - - type 'a grammar_extension = 'a -> GramState.t -> extend_rule list * GramState.t - - val create_grammar_command : string -> 'a grammar_extension -> 'a grammar_command - - val extend_grammar_command : 'a grammar_command -> 'a -> unit - val recover_grammar_command : 'a grammar_command -> 'a list - val with_grammar_rule_protection : ('a -> 'b) -> 'a -> 'b - - val to_coqloc : Ploc.t -> Loc.t - val (!@) : Ploc.t -> Loc.t - -end - -module Egramml : -sig - open Vernacexpr - - type 's grammar_prod_item = - | GramTerminal of string - | GramNonTerminal : ('a Genarg.raw_abstract_argument_type option * - ('s, 'a) Extend.symbol) Loc.located -> 's grammar_prod_item - - val extend_vernac_command_grammar : - extend_name -> vernac_expr Pcoq.Gram.entry option -> - vernac_expr grammar_prod_item list -> unit - - val make_rule : - (Loc.t -> Genarg.raw_generic_argument list -> 'a) -> - 'a grammar_prod_item list -> 'a Extend.production_rule - -end - -module G_vernac : -sig - - val def_body : Vernacexpr.definition_expr Pcoq.Gram.entry - val section_subset_expr : Vernacexpr.section_subset_expr Pcoq.Gram.entry - val query_command : (Vernacexpr.goal_selector option -> Vernacexpr.vernac_expr) Pcoq.Gram.entry - -end - -module G_proofs : -sig - - val hint : Vernacexpr.hints_expr Pcoq.Gram.entry - -end - -(************************************************************************) -(* End of modules from parsing/ *) -(************************************************************************) - -(************************************************************************) -(* Modules from printing/ *) -(************************************************************************) - -module Genprint : -sig - type 'a with_level = - { default_already_surrounded : Notation_term.tolerability; - default_ensure_surrounded : Notation_term.tolerability; - printer : 'a } - type printer_result = -| PrinterBasic of (unit -> Pp.t) -| PrinterNeedsLevel of (Notation_term.tolerability -> Pp.t) with_level - type printer_fun_with_level = Environ.env -> Evd.evar_map -> Notation_term.tolerability -> Pp.t - type top_printer_result = - | TopPrinterBasic of (unit -> Pp.t) - | TopPrinterNeedsContext of (Environ.env -> Evd.evar_map -> Pp.t) - | TopPrinterNeedsContextAndLevel of printer_fun_with_level with_level - type 'a printer = 'a -> printer_result - type 'a top_printer = 'a -> top_printer_result - val register_print0 : ('raw, 'glb, 'top) Genarg.genarg_type -> - 'raw printer -> 'glb printer -> 'top top_printer -> unit - val register_vernac_print0 : ('raw, 'glb, 'top) Genarg.genarg_type -> - 'raw printer -> unit - val register_val_print0 : 'top Geninterp.Val.typ -> 'top top_printer -> unit - val generic_top_print : Genarg.tlevel Genarg.generic_argument top_printer - val generic_val_print : Geninterp.Val.t top_printer -end - -module Pputils : -sig - val pr_with_occurrences : ('a -> Pp.t) -> (string -> Pp.t) -> 'a Locus.with_occurrences -> Pp.t - val pr_red_expr : - ('a -> Pp.t) * ('a -> Pp.t) * ('b -> Pp.t) * ('c -> Pp.t) -> - (string -> Pp.t) -> - ('a,'b,'c) Genredexpr.red_expr_gen -> Pp.t - val pr_raw_generic : Environ.env -> Genarg.rlevel Genarg.generic_argument -> Pp.t - val pr_glb_generic : Environ.env -> Genarg.glevel Genarg.generic_argument -> Pp.t - val pr_or_var : ('a -> Pp.t) -> 'a Misctypes.or_var -> Pp.t - val pr_or_by_notation : ('a -> Pp.t) -> 'a Misctypes.or_by_notation -> Pp.t -end - -module Ppconstr : -sig - val pr_name : Names.Name.t -> Pp.t - [@@ocaml.deprecated "alias of API.Names.Name.print"] - - val lsimpleconstr : Notation_term.tolerability - val ltop : Notation_term.tolerability - val pr_id : Names.Id.t -> Pp.t - val pr_or_var : ('a -> Pp.t) -> 'a Misctypes.or_var -> Pp.t - val pr_with_comments : ?loc:Loc.t -> Pp.t -> Pp.t - val pr_lident : Names.Id.t Loc.located -> Pp.t - val pr_lname : Names.Name.t Loc.located -> Pp.t - val prec_less : int -> int * Notation_term.parenRelation -> bool - val pr_constr_expr : Constrexpr.constr_expr -> Pp.t - val pr_lconstr_expr : Constrexpr.constr_expr -> Pp.t - val pr_constr_pattern_expr : Constrexpr.constr_pattern_expr -> Pp.t - val pr_lconstr_pattern_expr : Constrexpr.constr_pattern_expr -> Pp.t - val pr_binders : Constrexpr.local_binder_expr list -> Pp.t - val pr_glob_sort : Misctypes.glob_sort -> Pp.t -end - -module Printer : -sig - val pr_named_context : Environ.env -> Evd.evar_map -> Context.Named.t -> Pp.t - val pr_rel_context : Environ.env -> Evd.evar_map -> Context.Rel.t -> Pp.t - val pr_goal : Goal.goal Evd.sigma -> Pp.t - - val pr_constr_env : Environ.env -> Evd.evar_map -> Constr.t -> Pp.t - val pr_lconstr_env : Environ.env -> Evd.evar_map -> Constr.t -> Pp.t - - val pr_constr : Constr.t -> Pp.t - [@@ocaml.deprecated "The global printing API is deprecated, please use the _env functions"] - - val pr_lconstr : Constr.t -> Pp.t - [@@ocaml.deprecated "The global printing API is deprecated, please use the _env functions"] - - val pr_econstr : EConstr.constr -> Pp.t - [@@ocaml.deprecated "The global printing API is deprecated, please use the _env functions"] - - val pr_glob_constr : Glob_term.glob_constr -> Pp.t - [@@ocaml.deprecated "The global printing API is deprecated, please use the _env functions"] - - val pr_constr_pattern : Pattern.constr_pattern -> Pp.t - [@@ocaml.deprecated "The global printing API is deprecated, please use the _env functions"] - - val pr_glob_constr_env : Environ.env -> Glob_term.glob_constr -> Pp.t - val pr_lglob_constr_env : Environ.env -> Glob_term.glob_constr -> Pp.t - val pr_econstr_n_env : Environ.env -> Evd.evar_map -> Notation_term.tolerability -> EConstr.constr -> Pp.t - val pr_econstr_env : Environ.env -> Evd.evar_map -> EConstr.constr -> Pp.t - val pr_constr_pattern_env : Environ.env -> Evd.evar_map -> Pattern.constr_pattern -> Pp.t - val pr_lconstr_pattern_env : Environ.env -> Evd.evar_map -> Pattern.constr_pattern -> Pp.t - val pr_closed_glob : Ltac_pretype.closed_glob_constr -> Pp.t - [@@ocaml.deprecated "The global printing API is deprecated, please use the _env functions"] - val pr_lglob_constr : Glob_term.glob_constr -> Pp.t - [@@ocaml.deprecated "The global printing API is deprecated, please use the _env functions"] - val pr_leconstr_env : Environ.env -> Evd.evar_map -> EConstr.constr -> Pp.t - val pr_leconstr : EConstr.constr -> Pp.t - [@@ocaml.deprecated "The global printing API is deprecated, please use the _env functions"] - - val pr_global : Globnames.global_reference -> Pp.t - val pr_lconstr_under_binders : Ltac_pretype.constr_under_binders -> Pp.t - [@@ocaml.deprecated "The global printing API is deprecated, please use the _env functions"] - - val pr_lconstr_under_binders_env : Environ.env -> Evd.evar_map -> Ltac_pretype.constr_under_binders -> Pp.t - - val pr_constr_under_binders_env : Environ.env -> Evd.evar_map -> Ltac_pretype.constr_under_binders -> Pp.t - val pr_closed_glob_n_env : Environ.env -> Evd.evar_map -> Notation_term.tolerability -> Ltac_pretype.closed_glob_constr -> Pp.t - val pr_closed_glob_env : Environ.env -> Evd.evar_map -> Ltac_pretype.closed_glob_constr -> Pp.t - val pr_rel_context_of : Environ.env -> Evd.evar_map -> Pp.t - val pr_named_context_of : Environ.env -> Evd.evar_map -> Pp.t - val pr_ltype : Constr.types -> Pp.t - [@@ocaml.deprecated "The global printing API is deprecated, please use the _env functions"] - val pr_ljudge : EConstr.unsafe_judgment -> Pp.t * Pp.t - [@@ocaml.deprecated "The global printing API is deprecated, please use the _env functions"] - - val pr_idpred : Names.Id.Pred.t -> Pp.t - val pr_cpred : Names.Cpred.t -> Pp.t - val pr_transparent_state : Names.transparent_state -> Pp.t -end - -module Prettyp : -sig - type 'a locatable_info = { - locate : Libnames.qualid -> 'a option; - locate_all : Libnames.qualid -> 'a list; - shortest_qualid : 'a -> Libnames.qualid; - name : 'a -> Pp.t; - print : 'a -> Pp.t; - about : 'a -> Pp.t; - } - - val register_locatable : string -> 'a locatable_info -> unit - val print_located_other : string -> Libnames.reference -> Pp.t -end - -(************************************************************************) -(* End of modules from printing/ *) -(************************************************************************) - -(************************************************************************) -(* Modules from tactics/ *) -(************************************************************************) - -module Tacticals : -sig - open Proof_type - - val tclORELSE : tactic -> tactic -> tactic - val tclDO : int -> tactic -> tactic - val tclIDTAC : tactic - val tclFAIL : int -> Pp.t -> tactic - val tclTHEN : tactic -> tactic -> tactic - val tclTHENLIST : tactic list -> tactic - val pf_constr_of_global : - Globnames.global_reference -> (EConstr.constr -> Proof_type.tactic) -> Proof_type.tactic - val tclMAP : ('a -> tactic) -> 'a list -> tactic - val tclTRY : tactic -> tactic - val tclCOMPLETE : tactic -> tactic - val tclTHENS : tactic -> tactic list -> tactic - val tclFIRST : tactic list -> tactic - val tclTHENFIRST : tactic -> tactic -> tactic - val tclTHENLAST : tactic -> tactic -> tactic - val tclTHENSFIRSTn : tactic -> tactic array -> tactic -> tactic - val tclTHENSLASTn : tactic -> tactic -> tactic array -> tactic - val tclSOLVE : tactic list -> tactic - - val onClause : (Names.Id.t option -> tactic) -> Locus.clause -> tactic - val onAllHypsAndConcl : (Names.Id.t option -> tactic) -> tactic - val onLastHypId : (Names.Id.t -> tactic) -> tactic - val onNthHypId : int -> (Names.Id.t -> tactic) -> tactic - val onNLastHypsId : int -> (Names.Id.t list -> tactic) -> tactic - - val tclTHENSEQ : tactic list -> tactic - [@@ocaml.deprecated "alias of API.Tacticals.tclTHENLIST"] - - val nLastDecls : int -> Goal.goal Evd.sigma -> EConstr.named_context - - val tclTHEN_i : tactic -> (int -> tactic) -> tactic - - val tclPROGRESS : tactic -> tactic - - val elimination_sort_of_goal : Goal.goal Evd.sigma -> Sorts.family - - module New : - sig - open Proofview - val tclORELSE0 : unit tactic -> unit tactic -> unit tactic - val tclFAIL : int -> Pp.t -> 'a tactic - val pf_constr_of_global : Globnames.global_reference -> EConstr.constr tactic - val tclTHEN : unit tactic -> unit tactic -> unit tactic - val tclTHENS : unit tactic -> unit tactic list -> unit tactic - val tclFIRST : unit tactic list -> unit tactic - val tclZEROMSG : ?loc:Loc.t -> Pp.t -> 'a tactic - val tclORELSE : unit tactic -> unit tactic -> unit tactic - val tclREPEAT : unit tactic -> unit tactic - val tclTRY : unit tactic -> unit tactic - val tclTHENFIRST : unit tactic -> unit tactic -> unit tactic - val tclPROGRESS : unit Proofview.tactic -> unit Proofview.tactic - val tclTHENS3PARTS : unit tactic -> unit tactic array -> unit tactic -> unit tactic array -> unit tactic - val tclDO : int -> unit tactic -> unit tactic - val tclTIMEOUT : int -> unit tactic -> unit tactic - val tclTIME : string option -> 'a tactic -> 'a tactic - val tclOR : unit tactic -> unit tactic -> unit tactic - val tclONCE : unit tactic -> unit tactic - val tclEXACTLY_ONCE : unit tactic -> unit tactic - val tclIFCATCH : - unit tactic -> - (unit -> unit tactic) -> - (unit -> unit tactic) -> unit tactic - val tclSOLVE : unit tactic list -> unit tactic - val tclCOMPLETE : 'a tactic -> 'a tactic - val tclSELECT : Vernacexpr.goal_selector -> 'a tactic -> 'a tactic - val tclWITHHOLES : bool -> 'a tactic -> Evd.evar_map -> 'a tactic - val tclDELAYEDWITHHOLES : bool -> 'a Tactypes.delayed_open -> ('a -> unit tactic) -> unit tactic - val tclTHENLIST : unit tactic list -> unit tactic - val tclTHENLAST : unit tactic -> unit tactic -> unit tactic - val tclMAP : ('a -> unit tactic) -> 'a list -> unit tactic - val tclIDTAC : unit tactic - val tclIFTHENELSE : unit tactic -> unit tactic -> unit tactic -> unit tactic - val tclIFTHENSVELSE : unit tactic -> unit tactic array -> unit tactic -> unit tactic - end -end - -module Hipattern : -sig - exception NoEquationFound - type 'a matching_function = Evd.evar_map -> EConstr.constr -> 'a option - type testing_function = Evd.evar_map -> EConstr.constr -> bool - val is_disjunction : ?strict:bool -> ?onlybinary:bool -> testing_function - val match_with_disjunction : ?strict:bool -> ?onlybinary:bool -> (EConstr.constr * EConstr.constr list) matching_function - val match_with_equality_type : (EConstr.constr * EConstr.constr list) matching_function - val is_empty_type : testing_function - val is_unit_type : testing_function - val is_unit_or_eq_type : testing_function - val is_conjunction : ?strict:bool -> ?onlybinary:bool -> testing_function - val match_with_conjunction : ?strict:bool -> ?onlybinary:bool -> (EConstr.constr * EConstr.constr list) matching_function - val match_with_imp_term : (EConstr.constr * EConstr.constr) matching_function - val match_with_forall_term : (Names.Name.t * EConstr.constr * EConstr.constr) matching_function - val match_with_nodep_ind : (EConstr.constr * EConstr.constr list * int) matching_function - val match_with_sigma_type : (EConstr.constr * EConstr.constr list) matching_function -end - -module Ind_tables : -sig - type individual - type 'a scheme_kind - - val check_scheme : 'a scheme_kind -> Names.inductive -> bool - val find_scheme : ?mode:Declare.internal_flag -> 'a scheme_kind -> Names.inductive -> Names.Constant.t * Safe_typing.private_constants - val pr_scheme_kind : 'a scheme_kind -> Pp.t -end - -module Elimschemes : -sig - val case_scheme_kind_from_prop : Ind_tables.individual Ind_tables.scheme_kind - val case_dep_scheme_kind_from_type_in_prop : Ind_tables.individual Ind_tables.scheme_kind - val case_scheme_kind_from_type : Ind_tables.individual Ind_tables.scheme_kind - val case_dep_scheme_kind_from_type : Ind_tables.individual Ind_tables.scheme_kind - val case_dep_scheme_kind_from_prop : Ind_tables.individual Ind_tables.scheme_kind -end - -module Tactics : -sig - open Proofview - - type change_arg = Ltac_pretype.patvar_map -> Evd.evar_map -> Evd.evar_map * EConstr.constr - type tactic_reduction = Environ.env -> Evd.evar_map -> EConstr.constr -> EConstr.constr - - type elim_scheme = - { - elimc: EConstr.constr Misctypes.with_bindings option; - elimt: EConstr.types; - indref: Globnames.global_reference option; - params: EConstr.rel_context; - nparams: int; - predicates: EConstr.rel_context; - npredicates: int; - branches: EConstr.rel_context; - nbranches: int; - args: EConstr.rel_context; - nargs: int; - indarg: EConstr.rel_declaration option; - concl: EConstr.types; - indarg_in_concl: bool; - farg_in_concl: bool; - } - - val unify : ?state:Names.transparent_state -> EConstr.constr -> EConstr.constr -> unit Proofview.tactic - val intro_then : (Names.Id.t -> unit Proofview.tactic) -> unit Proofview.tactic - val reflexivity : unit tactic - val change_concl : EConstr.constr -> unit tactic - val apply : EConstr.constr -> unit tactic - val normalise_vm_in_concl : unit tactic - val assert_before : Names.Name.t -> EConstr.types -> unit tactic - val exact_check : EConstr.constr -> unit tactic - val simplest_elim : EConstr.constr -> unit tactic - val introf : unit tactic - val cut : EConstr.types -> unit tactic - val convert_concl : ?check:bool -> EConstr.types -> Constr.cast_kind -> unit tactic - val intro_using : Names.Id.t -> unit tactic - val intro : unit tactic - val fresh_id_in_env : Names.Id.Set.t -> Names.Id.t -> Environ.env -> Names.Id.t - val is_quantified_hypothesis : Names.Id.t -> 'a Goal.t -> bool - val tclABSTRACT : ?opaque:bool -> Names.Id.t option -> unit Proofview.tactic -> unit Proofview.tactic - val intro_patterns : bool -> Tactypes.intro_patterns -> unit Proofview.tactic - val apply_with_delayed_bindings_gen : - Misctypes.advanced_flag -> Misctypes.evars_flag -> (Misctypes.clear_flag * Tactypes.delayed_open_constr_with_bindings Loc.located) list -> unit Proofview.tactic - val apply_delayed_in : - Misctypes.advanced_flag -> Misctypes.evars_flag -> Names.Id.t -> - (Misctypes.clear_flag * Tactypes.delayed_open_constr_with_bindings Loc.located) list -> - Tactypes.intro_pattern option -> unit Proofview.tactic - val elim : - Misctypes.evars_flag -> Misctypes.clear_flag -> EConstr.constr Misctypes.with_bindings -> EConstr.constr Misctypes.with_bindings option -> unit Proofview.tactic - val general_case_analysis : Misctypes.evars_flag -> Misctypes.clear_flag -> EConstr.constr Misctypes.with_bindings -> unit Proofview.tactic - val mutual_fix : - Names.Id.t -> int -> (Names.Id.t * int * EConstr.constr) list -> int -> unit Proofview.tactic - val mutual_cofix : Names.Id.t -> (Names.Id.t * EConstr.constr) list -> int -> unit Proofview.tactic - val forward : bool -> unit Proofview.tactic option option -> - Tactypes.intro_pattern option -> EConstr.constr -> unit Proofview.tactic - val generalize_gen : (EConstr.constr Locus.with_occurrences * Names.Name.t) list -> unit Proofview.tactic - val letin_tac : (bool * Tactypes.intro_pattern_naming) option -> - Names.Name.t -> EConstr.constr -> EConstr.types option -> Locus.clause -> unit Proofview.tactic - val letin_pat_tac : Misctypes.evars_flag -> - (bool * Tactypes.intro_pattern_naming) option -> - Names.Name.t -> - Evd.evar_map * EConstr.constr -> - Locus.clause -> unit Proofview.tactic - val induction_destruct : Misctypes.rec_flag -> Misctypes.evars_flag -> - (Tactypes.delayed_open_constr_with_bindings Misctypes.destruction_arg - * (Tactypes.intro_pattern_naming option * Tactypes.or_and_intro_pattern option) - * Locus.clause option) list * - EConstr.constr Misctypes.with_bindings option -> unit Proofview.tactic - val reduce : Redexpr.red_expr -> Locus.clause -> unit Proofview.tactic - val change : Pattern.constr_pattern option -> change_arg -> Locus.clause -> unit Proofview.tactic - val intros_reflexivity : unit Proofview.tactic - val exact_no_check : EConstr.constr -> unit Proofview.tactic - val assumption : unit Proofview.tactic - val intros_transitivity : EConstr.constr option -> unit Proofview.tactic - val vm_cast_no_check : EConstr.constr -> unit Proofview.tactic - val native_cast_no_check : EConstr.constr -> unit Proofview.tactic - val case_type : EConstr.types -> unit Proofview.tactic - val elim_type : EConstr.types -> unit Proofview.tactic - val cut_and_apply : EConstr.constr -> unit Proofview.tactic - val left_with_bindings : Misctypes.evars_flag -> EConstr.constr Misctypes.bindings -> unit Proofview.tactic - val right_with_bindings : Misctypes.evars_flag -> EConstr.constr Misctypes.bindings -> unit Proofview.tactic - val any_constructor : Misctypes.evars_flag -> unit Proofview.tactic option -> unit Proofview.tactic - val constructor_tac : Misctypes.evars_flag -> int option -> int -> - EConstr.constr Misctypes.bindings -> unit Proofview.tactic - val specialize : EConstr.constr Misctypes.with_bindings -> Tactypes.intro_pattern option -> unit Proofview.tactic - val intros_symmetry : Locus.clause -> unit Proofview.tactic - val split_with_bindings : Misctypes.evars_flag -> EConstr.constr Misctypes.bindings list -> unit Proofview.tactic - val intros_until : Misctypes.quantified_hypothesis -> unit Proofview.tactic - val intro_move : Names.Id.t option -> Names.Id.t Misctypes.move_location -> unit Proofview.tactic - val move_hyp : Names.Id.t -> Names.Id.t Misctypes.move_location -> unit Proofview.tactic - val rename_hyp : (Names.Id.t * Names.Id.t) list -> unit Proofview.tactic - val revert : Names.Id.t list -> unit Proofview.tactic - val simple_induct : Misctypes.quantified_hypothesis -> unit Proofview.tactic - val simple_destruct : Misctypes.quantified_hypothesis -> unit Proofview.tactic - val fix : Names.Id.t option -> int -> unit Proofview.tactic - val cofix : Names.Id.t option -> unit Proofview.tactic - val keep : Names.Id.t list -> unit Proofview.tactic - val clear : Names.Id.t list -> unit Proofview.tactic - val clear_body : Names.Id.t list -> unit Proofview.tactic - val generalize_dep : ?with_let:bool (** Don't lose let bindings *) -> EConstr.constr -> unit Proofview.tactic - val force_destruction_arg : Misctypes.evars_flag -> Environ.env -> Evd.evar_map -> - Tactypes.delayed_open_constr_with_bindings Misctypes.destruction_arg -> - Evd.evar_map * EConstr.constr Misctypes.with_bindings Misctypes.destruction_arg - val apply_with_bindings : EConstr.constr Misctypes.with_bindings -> unit Proofview.tactic - val abstract_generalize : ?generalize_vars:bool -> ?force_dep:bool -> Names.Id.t -> unit Proofview.tactic - val specialize_eqs : Names.Id.t -> unit Proofview.tactic - val generalize : EConstr.constr list -> unit Proofview.tactic - val simplest_case : EConstr.constr -> unit Proofview.tactic - val introduction : ?check:bool -> Names.Id.t -> unit Proofview.tactic - val convert_concl_no_check : EConstr.types -> Constr.cast_kind -> unit Proofview.tactic - val reduct_in_concl : tactic_reduction * Constr.cast_kind -> unit Proofview.tactic - val reduct_in_hyp : ?check:bool -> tactic_reduction -> Locus.hyp_location -> unit Proofview.tactic - val convert_hyp_no_check : EConstr.named_declaration -> unit Proofview.tactic - val reflexivity_red : bool -> unit Proofview.tactic - val symmetry_red : bool -> unit Proofview.tactic - val eapply : EConstr.constr -> unit Proofview.tactic - val transitivity_red : bool -> EConstr.constr option -> unit Proofview.tactic - val assert_after_replacing : Names.Id.t -> EConstr.types -> unit Proofview.tactic - val intros : unit Proofview.tactic - val setoid_reflexivity : unit Proofview.tactic Hook.t - val setoid_symmetry : unit Proofview.tactic Hook.t - val setoid_symmetry_in : (Names.Id.t -> unit Proofview.tactic) Hook.t - val setoid_transitivity : (EConstr.constr option -> unit Proofview.tactic) Hook.t - val unfold_in_concl : - (Locus.occurrences * Names.evaluable_global_reference) list -> unit Proofview.tactic - val intros_using : Names.Id.t list -> unit Proofview.tactic - val simpl_in_concl : unit Proofview.tactic - val reduct_option : ?check:bool -> tactic_reduction * Constr.cast_kind -> Locus.goal_location -> unit Proofview.tactic - val simplest_split : unit Proofview.tactic - val unfold_in_hyp : - (Locus.occurrences * Names.evaluable_global_reference) list -> Locus.hyp_location -> unit Proofview.tactic - val split : EConstr.constr Misctypes.bindings -> unit Proofview.tactic - val red_in_concl : unit Proofview.tactic - val change_in_concl : (Locus.occurrences * Pattern.constr_pattern) option -> change_arg -> unit Proofview.tactic - val eapply_with_bindings : EConstr.constr Misctypes.with_bindings -> unit Proofview.tactic - val assert_by : Names.Name.t -> EConstr.types -> unit Proofview.tactic -> - unit Proofview.tactic - val intro_avoiding : Names.Id.Set.t -> unit Proofview.tactic - val pose_proof : Names.Name.t -> EConstr.constr -> unit Proofview.tactic - val pattern_option : (Locus.occurrences * EConstr.constr) list -> Locus.goal_location -> unit Proofview.tactic - val compute_elim_sig : Evd.evar_map -> ?elimc:EConstr.constr Misctypes.with_bindings -> EConstr.types -> elim_scheme - val try_intros_until : - (Names.Id.t -> unit Proofview.tactic) -> Misctypes.quantified_hypothesis -> unit Proofview.tactic - val cache_term_by_tactic_then : - opaque:bool -> ?goal_type:(EConstr.constr option) -> Names.Id.t -> - Decl_kinds.goal_kind -> unit Proofview.tactic -> (EConstr.constr -> EConstr.constr list -> unit Proofview.tactic) -> unit Proofview.tactic - val apply_type : EConstr.constr -> EConstr.constr list -> unit Proofview.tactic - val hnf_in_concl : unit Proofview.tactic - val intro_mustbe_force : Names.Id.t -> unit Proofview.tactic - - module New : - sig - val refine : typecheck:bool -> (Evd.evar_map -> Evd.evar_map * EConstr.constr) -> unit Proofview.tactic - val reduce_after_refine : unit Proofview.tactic - end - module Simple : - sig - val intro : Names.Id.t -> unit Proofview.tactic - val apply : EConstr.constr -> unit Proofview.tactic - val case : EConstr.constr -> unit Proofview.tactic - end -end - -module Elim : -sig - val h_decompose : Names.inductive list -> EConstr.constr -> unit Proofview.tactic - val h_double_induction : Misctypes.quantified_hypothesis -> Misctypes.quantified_hypothesis-> unit Proofview.tactic - val h_decompose_or : EConstr.constr -> unit Proofview.tactic - val h_decompose_and : EConstr.constr -> unit Proofview.tactic -end - -module Equality : -sig - type orientation = bool - type freeze_evars_flag = bool - type dep_proof_flag = bool - type conditions = - | Naive - | FirstSolved - | AllMatches - type inj_flags = { - keep_proof_equalities : bool; (* One may want it or not *) - injection_in_context : bool; (* For regularity; one may want it from ML code but not interactively *) - injection_pattern_l2r_order : bool; (* Compatibility option: no reason not to want it *) - } - - val build_selector : - Environ.env -> Evd.evar_map -> int -> EConstr.constr -> EConstr.types -> - EConstr.constr -> EConstr.constr -> EConstr.constr - val replace : EConstr.constr -> EConstr.constr -> unit Proofview.tactic - val general_rewrite : - orientation -> Locus.occurrences -> freeze_evars_flag -> dep_proof_flag -> - ?tac:(unit Proofview.tactic * conditions) -> EConstr.constr -> unit Proofview.tactic - val inj : inj_flags option -> Tactypes.intro_patterns option -> Misctypes.evars_flag -> - Misctypes.clear_flag -> EConstr.constr Misctypes.with_bindings -> unit Proofview.tactic - val general_multi_rewrite : - Misctypes.evars_flag -> (bool * Misctypes.multi * Misctypes.clear_flag * Tactypes.delayed_open_constr_with_bindings) list -> - Locus.clause -> (unit Proofview.tactic * conditions) option -> unit Proofview.tactic - val replace_in_clause_maybe_by : EConstr.constr -> EConstr.constr -> Locus.clause -> unit Proofview.tactic option -> unit Proofview.tactic - val replace_term : bool option -> EConstr.constr -> Locus.clause -> unit Proofview.tactic - val dEq : keep_proofs:bool option -> Misctypes.evars_flag -> EConstr.constr Misctypes.with_bindings Misctypes.destruction_arg option -> unit Proofview.tactic - val discr_tac : Misctypes.evars_flag -> - EConstr.constr Misctypes.with_bindings Misctypes.destruction_arg option -> unit Proofview.tactic - val injClause : inj_flags option -> Tactypes.intro_patterns option -> Misctypes.evars_flag -> - EConstr.constr Misctypes.with_bindings Misctypes.destruction_arg option -> unit Proofview.tactic - - val simpleInjClause : inj_flags option -> Misctypes.evars_flag -> - EConstr.constr Misctypes.with_bindings Misctypes.destruction_arg option -> - unit Proofview.tactic - val rewriteInConcl : bool -> EConstr.constr -> unit Proofview.tactic - val rewriteInHyp : bool -> EConstr.constr -> Names.Id.t -> unit Proofview.tactic - val cutRewriteInConcl : bool -> EConstr.constr -> unit Proofview.tactic - val cutRewriteInHyp : bool -> EConstr.types -> Names.Id.t -> unit Proofview.tactic - val general_rewrite_ebindings_clause : Names.Id.t option -> - orientation -> Locus.occurrences -> freeze_evars_flag -> dep_proof_flag -> - ?tac:(unit Proofview.tactic * conditions) -> EConstr.constr Misctypes.with_bindings -> Misctypes.evars_flag -> unit Proofview.tactic - val subst : Names.Id.t list -> unit Proofview.tactic - - type subst_tactic_flags = { - only_leibniz : bool; - rewrite_dependent_proof : bool - } - val subst_all : ?flags:subst_tactic_flags -> unit -> unit Proofview.tactic - - val general_rewrite_in : - orientation -> Locus.occurrences -> freeze_evars_flag -> dep_proof_flag -> - ?tac:(unit Proofview.tactic * conditions) -> Names.Id.t -> EConstr.constr -> Misctypes.evars_flag -> unit Proofview.tactic - - val general_setoid_rewrite_clause : - (Names.Id.t option -> orientation -> Locus.occurrences -> EConstr.constr Misctypes.with_bindings -> - new_goals:EConstr.constr list -> unit Proofview.tactic) Hook.t - - val discrConcl : unit Proofview.tactic - val rewriteLR : ?tac:(unit Proofview.tactic * conditions) -> EConstr.constr -> unit Proofview.tactic - val rewriteRL : ?tac:(unit Proofview.tactic * conditions) -> EConstr.constr -> unit Proofview.tactic - val general_rewrite_bindings : - orientation -> Locus.occurrences -> freeze_evars_flag -> dep_proof_flag -> - ?tac:(unit Proofview.tactic * conditions) -> EConstr.constr Misctypes.with_bindings -> Misctypes.evars_flag -> unit Proofview.tactic - val discriminable : Environ.env -> Evd.evar_map -> EConstr.constr -> EConstr.constr -> bool - val discrHyp : Names.Id.t -> unit Proofview.tactic - val injectable : Environ.env -> Evd.evar_map -> keep_proofs:(bool option) -> EConstr.constr -> EConstr.constr -> bool - val injHyp : inj_flags option -> Misctypes.clear_flag -> Names.Id.t -> unit Proofview.tactic - val subst_gen : bool -> Names.Id.t list -> unit Proofview.tactic -end - -module Contradiction : -sig - val contradiction : EConstr.constr Misctypes.with_bindings option -> unit Proofview.tactic - val absurd : EConstr.constr -> unit Proofview.tactic -end - -module Inv : -sig - val dinv : - Misctypes.inversion_kind -> EConstr.constr option -> - Tactypes.or_and_intro_pattern option -> Misctypes.quantified_hypothesis -> unit Proofview.tactic - val inv_clause : - Misctypes.inversion_kind -> Tactypes.or_and_intro_pattern option -> Names.Id.t list -> - Misctypes.quantified_hypothesis -> unit Proofview.tactic - val inv_clear_tac : Names.Id.t -> unit Proofview.tactic - val inv_tac : Names.Id.t -> unit Proofview.tactic - val dinv_tac : Names.Id.t -> unit Proofview.tactic - val dinv_clear_tac : Names.Id.t -> unit Proofview.tactic - val inv : Misctypes.inversion_kind -> Tactypes.or_and_intro_pattern option -> - Misctypes.quantified_hypothesis -> unit Proofview.tactic -end - -module Leminv : -sig - val lemInv_clause : - Misctypes.quantified_hypothesis -> EConstr.constr -> Names.Id.t list -> unit Proofview.tactic - val add_inversion_lemma_exn : - Names.Id.t -> Constrexpr.constr_expr -> Sorts.family -> bool -> (Names.Id.t -> unit Proofview.tactic) -> - unit -end - -module Hints : -sig - - type raw_hint = EConstr.t * EConstr.types * Univ.ContextSet.t - - type 'a hint_ast = - | Res_pf of 'a (* Hint Apply *) - | ERes_pf of 'a (* Hint EApply *) - | Give_exact of 'a - | Res_pf_THEN_trivial_fail of 'a (* Hint Immediate *) - | Unfold_nth of Names.evaluable_global_reference (* Hint Unfold *) - | Extern of Genarg.glob_generic_argument (* Hint Extern *) - - type hint - - type debug = - | Debug | Info | Off - - type 'a hints_path_atom_gen = - | PathHints of 'a list - | PathAny - - type hint_term = - | IsGlobRef of Globnames.global_reference - | IsConstr of EConstr.constr * Univ.ContextSet.t - - type hint_db_name = string - type hint_info = (Names.Id.t list * Pattern.constr_pattern) Vernacexpr.hint_info_gen - type hnf = bool - type hints_path_atom = Globnames.global_reference hints_path_atom_gen - - type 'a hints_path_gen = - | PathAtom of 'a hints_path_atom_gen - | PathStar of 'a hints_path_gen - | PathSeq of 'a hints_path_gen * 'a hints_path_gen - | PathOr of 'a hints_path_gen * 'a hints_path_gen - | PathEmpty - | PathEpsilon - - type hints_path = Globnames.global_reference hints_path_gen - - type hints_entry = - | HintsResolveEntry of (hint_info * Decl_kinds.polymorphic * hnf * hints_path_atom * hint_term) list - | HintsImmediateEntry of (hints_path_atom * Decl_kinds.polymorphic * hint_term) list - | HintsCutEntry of hints_path - | HintsUnfoldEntry of Names.evaluable_global_reference list - | HintsTransparencyEntry of Names.evaluable_global_reference list * bool - | HintsModeEntry of Globnames.global_reference * Vernacexpr.hint_mode list - | HintsExternEntry of hint_info * Genarg.glob_generic_argument - - type 'a with_metadata = private { - pri : int; - poly : Decl_kinds.polymorphic; - pat : Pattern.constr_pattern option; - name : hints_path_atom; - db : string option; - secvars : Names.Id.Pred.t; - code : 'a; - } - type full_hint = hint with_metadata - - module Hint_db : - sig - type t - val empty : ?name:hint_db_name -> Names.transparent_state -> bool -> t - val transparent_state : t -> Names.transparent_state - val iter : (Globnames.global_reference option -> - Vernacexpr.hint_mode array list -> full_hint list -> unit) -> t -> unit - end - type hint_db = Hint_db.t - - val add_hints : bool -> hint_db_name list -> hints_entry -> unit - val searchtable_map : hint_db_name -> hint_db - val pp_hints_path_atom : ('a -> Pp.t) -> 'a hints_path_atom_gen -> Pp.t - val pp_hints_path_gen : ('a -> Pp.t) -> 'a hints_path_gen -> Pp.t - val glob_hints_path_atom : - Libnames.reference hints_path_atom_gen -> Globnames.global_reference hints_path_atom_gen - val pp_hints_path : hints_path -> Pp.t - val glob_hints_path : - Libnames.reference hints_path_gen -> Globnames.global_reference hints_path_gen - val run_hint : hint -> - ((raw_hint * Clenv.clausenv) hint_ast -> 'r Proofview.tactic) -> 'r Proofview.tactic - val typeclasses_db : hint_db_name - val add_hints_init : (unit -> unit) -> unit - val create_hint_db : bool -> hint_db_name -> Names.transparent_state -> bool -> unit - val empty_hint_info : 'a Vernacexpr.hint_info_gen - val repr_hint : hint -> (raw_hint * Clenv.clausenv) hint_ast - val pr_hint_db_env : Environ.env -> Evd.evar_map -> Hint_db.t -> Pp.t - val pr_hint_db : Hint_db.t -> Pp.t - [@@ocaml.deprecated "please used pr_hint_db_env"] -end - -module Auto : -sig - val default_auto : unit Proofview.tactic - val full_trivial : ?debug:Hints.debug -> - Tactypes.delayed_open_constr list -> unit Proofview.tactic - val h_auto : ?debug:Hints.debug -> - int option -> Tactypes.delayed_open_constr list -> Hints.hint_db_name list option -> unit Proofview.tactic - val h_trivial : ?debug:Hints.debug -> - Tactypes.delayed_open_constr list -> Hints.hint_db_name list option -> unit Proofview.tactic - val new_full_auto : ?debug:Hints.debug -> - int -> Tactypes.delayed_open_constr list -> unit Proofview.tactic - val full_auto : ?debug:Hints.debug -> - int -> Tactypes.delayed_open_constr list -> unit Proofview.tactic - val new_auto : ?debug:Hints.debug -> - int -> Tactypes.delayed_open_constr list -> Hints.hint_db_name list -> unit Proofview.tactic - val default_full_auto : unit Proofview.tactic -end - -module Eauto : -sig - val e_assumption : unit Proofview.tactic - val e_give_exact : ?flags:Unification.unify_flags -> EConstr.constr -> unit Proofview.tactic - val prolog_tac : Tactypes.delayed_open_constr list -> int -> unit Proofview.tactic - val make_dimension : int option -> int option -> bool * int - val gen_eauto : ?debug:Hints.debug -> bool * int -> Tactypes.delayed_open_constr list -> - Hints.hint_db_name list option -> unit Proofview.tactic - val autounfold_tac : Hints.hint_db_name list option -> Locus.clause -> unit Proofview.tactic - val autounfold_one : Hints.hint_db_name list -> Locus.hyp_location option -> unit Proofview.tactic - val eauto_with_bases : - ?debug:Hints.debug -> bool * int -> Tactypes.delayed_open_constr list -> Hints.hint_db list -> Proof_type.tactic -end - -module Class_tactics : -sig - - type search_strategy = - | Dfs - | Bfs - - val set_typeclasses_debug : bool -> unit - val set_typeclasses_strategy : search_strategy -> unit - val set_typeclasses_depth : int option -> unit - val typeclasses_eauto : ?only_classes:bool -> ?st:Names.transparent_state -> ?strategy:search_strategy -> - depth:(Int.t option) -> - Hints.hint_db_name list -> unit Proofview.tactic - val head_of_constr : Names.Id.t -> EConstr.constr -> unit Proofview.tactic - val not_evar : EConstr.constr -> unit Proofview.tactic - val is_ground : EConstr.constr -> unit Proofview.tactic - val autoapply : EConstr.constr -> Hints.hint_db_name -> unit Proofview.tactic - val catchable : exn -> bool -end - -module Eqdecide : -sig - val compare : EConstr.constr -> EConstr.constr -> unit Proofview.tactic - val decideEqualityGoal : unit Proofview.tactic -end - -module Autorewrite : -sig - type rew_rule = { rew_lemma: Constr.t; - rew_type: Constr.types; - rew_pat: Constr.t; - rew_ctx: Univ.ContextSet.t; - rew_l2r: bool; - rew_tac: Genarg.glob_generic_argument option } - type raw_rew_rule = (Constr.t Univ.in_universe_context_set * bool * - Genarg.raw_generic_argument option) - Loc.located - val auto_multi_rewrite : ?conds:Equality.conditions -> string list -> Locus.clause -> unit Proofview.tactic - val auto_multi_rewrite_with : ?conds:Equality.conditions -> unit Proofview.tactic -> string list -> Locus.clause -> unit Proofview.tactic - val add_rew_rules : string -> raw_rew_rule list -> unit - val find_rewrites : string -> rew_rule list - val find_matches : string -> Constr.t -> rew_rule list - val print_rewrite_hintdb : Environ.env -> Evd.evar_map -> string -> Pp.t -end - -(************************************************************************) -(* End of modules from tactics/ *) -(************************************************************************) - -(************************************************************************) -(* Modules from vernac/ *) -(************************************************************************) - -module Ppvernac : -sig - val pr_vernac : Vernacexpr.vernac_control -> Pp.t - val pr_rec_definition : (Vernacexpr.fixpoint_expr * Vernacexpr.decl_notation list) -> Pp.t -end - -module Lemmas : -sig - - type 'a declaration_hook - - val mk_hook : - (Decl_kinds.locality -> Globnames.global_reference -> 'a) -> 'a declaration_hook - val start_proof : Names.Id.t -> ?pl:Univdecls.universe_decl -> Decl_kinds.goal_kind -> Evd.evar_map -> - ?terminator:(Proof_global.lemma_possible_guards -> unit declaration_hook -> Proof_global.proof_terminator) -> - ?sign:Environ.named_context_val -> EConstr.types -> - ?init_tac:unit Proofview.tactic -> ?compute_guard:Proof_global.lemma_possible_guards -> - unit declaration_hook -> unit - val call_hook : - Future.fix_exn -> 'a declaration_hook -> Decl_kinds.locality -> Globnames.global_reference -> 'a - val save_proof : ?proof:Proof_global.closed_proof -> Vernacexpr.proof_end -> unit - val get_current_context : unit -> Evd.evar_map * Environ.env - [@@ocaml.deprecated "please use [Pfedit.get_current_context]"] -end - -module Himsg : -sig - val explain_refiner_error : Environ.env -> Evd.evar_map -> Logic.refiner_error -> Pp.t - val explain_pretype_error : Environ.env -> Evd.evar_map -> Pretype_errors.pretype_error -> Pp.t -end - -module ExplainErr : -sig - val process_vernac_interp_error : ?allow_uncaught:bool -> Util.iexn -> Util.iexn - val register_additional_error_info : (Util.iexn -> Pp.t option Loc.located option) -> unit -end - -module Locality : -sig - val make_section_locality : bool option -> bool - val make_module_locality : bool option -> bool -end - -module Metasyntax : -sig - - val add_token_obj : string -> unit - - type any_entry = AnyEntry : 'a Pcoq.Gram.entry -> any_entry - val register_grammar : string -> any_entry list -> unit - -end - -module Search : -sig - type glob_search_about_item = - | GlobSearchSubPattern of Pattern.constr_pattern - | GlobSearchString of string - type filter_function = Globnames.global_reference -> Environ.env -> Constr.t -> bool - type display_function = Globnames.global_reference -> Environ.env -> Constr.t -> unit - val search_about_filter : glob_search_about_item -> filter_function - val module_filter : Names.DirPath.t list * bool -> filter_function - val generic_search : int option -> display_function -> unit -end - -module Obligations : -sig - val default_tactic : unit Proofview.tactic ref - val obligation : int * Names.Id.t option * Constrexpr.constr_expr option -> - Genarg.glob_generic_argument option -> unit - val next_obligation : Names.Id.t option -> Genarg.glob_generic_argument option -> unit - val try_solve_obligation : int -> Names.Id.t option -> unit Proofview.tactic option -> unit - val try_solve_obligations : Names.Id.t option -> unit Proofview.tactic option -> unit - val solve_all_obligations : unit Proofview.tactic option -> unit - val admit_obligations : Names.Id.t option -> unit - val show_obligations : ?msg:bool -> Names.Id.t option -> unit - val show_term : Names.Id.t option -> Pp.t -end - -module ComDefinition : -sig - val do_definition : - program_mode:bool -> - Names.Id.t -> Decl_kinds.definition_kind -> Vernacexpr.universe_decl_expr option -> - Constrexpr.local_binder_expr list -> Redexpr.red_expr option -> Constrexpr.constr_expr -> - Constrexpr.constr_expr option -> unit Lemmas.declaration_hook -> unit -end - -module ComFixpoint : -sig - - open Names - open Constrexpr - - type structured_fixpoint_expr = { - fix_name : Id.t; - fix_univs : Vernacexpr.universe_decl_expr option; - fix_annot : Id.t Loc.located option; - fix_binders : local_binder_expr list; - fix_body : constr_expr option; - fix_type : constr_expr - } - - type recursive_preentry = Names.Id.t list * Constr.t option list * Constr.types list - - val interp_fixpoint : - cofix:bool -> - structured_fixpoint_expr list -> Vernacexpr.decl_notation list -> - recursive_preentry * Univdecls.universe_decl * UState.t * - (EConstr.rel_context * Impargs.manual_implicits * int option) list - - val extract_fixpoint_components : bool -> - (Vernacexpr.fixpoint_expr * Vernacexpr.decl_notation list) list -> - structured_fixpoint_expr list * Vernacexpr.decl_notation list - - val do_fixpoint : - Decl_kinds.locality -> Decl_kinds.polymorphic -> (Vernacexpr.fixpoint_expr * Vernacexpr.decl_notation list) list -> unit - -end - -module ComInductive : -sig - open Names - open Constrexpr - open Vernacexpr - - type structured_one_inductive_expr = { - ind_name : Id.t; - ind_univs : universe_decl_expr option; - ind_arity : constr_expr; - ind_lc : (Id.t * constr_expr) list - } - - type structured_inductive_expr = - local_binder_expr list * structured_one_inductive_expr list - - type one_inductive_impls - - val do_mutual_inductive : - (Vernacexpr.one_inductive_expr * Vernacexpr.decl_notation list) list -> Decl_kinds.cumulative_inductive_flag -> Decl_kinds.polymorphic -> - Decl_kinds.private_flag -> Declarations.recursivity_kind -> unit - - val extract_mutual_inductive_declaration_components : - (Vernacexpr.one_inductive_expr * Vernacexpr.decl_notation list) list -> - structured_inductive_expr * Libnames.qualid list * Vernacexpr.decl_notation list - - val interp_mutual_inductive : - structured_inductive_expr -> Vernacexpr.decl_notation list -> - Decl_kinds.cumulative_inductive_flag -> - Decl_kinds.polymorphic -> - Decl_kinds.private_flag -> Declarations.recursivity_kind -> - Entries.mutual_inductive_entry * Universes.universe_binders * one_inductive_impls list - - val declare_mutual_inductive_with_eliminations : - Entries.mutual_inductive_entry -> Universes.universe_binders -> one_inductive_impls list -> - Names.MutInd.t -end - -module Classes : -sig - val set_typeclass_transparency : Names.evaluable_global_reference -> bool -> bool -> unit - val new_instance : - ?abstract:bool -> - ?global:bool -> - ?refine:bool -> - program_mode:bool -> - Decl_kinds.polymorphic -> - Constrexpr.local_binder_expr list -> - Vernacexpr.typeclass_constraint -> - (bool * Constrexpr.constr_expr) option -> - ?generalize:bool -> - ?tac:unit Proofview.tactic -> - ?hook:(Globnames.global_reference -> unit) -> - Vernacexpr.hint_info_expr -> - Names.Id.t -end - -module Vernacstate : -sig - - type t = { - system : States.state; (* summary + libstack *) - proof : Proof_global.t; (* proof state *) - shallow : bool (* is the state trimmed down (libstack) *) - } - - (* XXX: This should not be exported *) - val freeze_interp_state : Summary.marshallable -> t - val unfreeze_interp_state : t -> unit - -end - -module Vernacinterp : -sig - - type deprecation = bool - - type atts = { - loc : Loc.t option; - locality : bool option; - polymorphic : bool; - } - - type 'a vernac_command = 'a -> atts:atts -> st:Vernacstate.t -> Vernacstate.t - - type plugin_args = Genarg.raw_generic_argument list - - val vinterp_add : deprecation -> Vernacexpr.extend_name -> plugin_args vernac_command -> unit - -end - -module Mltop : -sig - val declare_cache_obj : (unit -> unit) -> string -> unit - val add_known_plugin : (unit -> unit) -> string -> unit - val add_known_module : string -> unit - val module_is_known : string -> bool -end - -module Topfmt : -sig - val std_ft : Format.formatter ref - val with_output_to : out_channel -> Format.formatter - val get_margin : unit -> int option -end - -module Vernacentries : -sig - - val dump_global : Libnames.reference Misctypes.or_by_notation -> unit - val interp_redexp_hook : (Environ.env -> Evd.evar_map -> Genredexpr.raw_red_expr -> - Evd.evar_map * Redexpr.red_expr) Hook.t - val command_focus : unit Proof.focus_kind -end - -(************************************************************************) -(* End of modules from vernac/ *) -(************************************************************************) - -(************************************************************************) -(* Modules from stm/ *) -(************************************************************************) - -module Vernac_classifier : -sig - val declare_vernac_classifier : - Vernacexpr.extend_name -> (Genarg.raw_generic_argument list -> unit -> Vernacexpr.vernac_classification) -> unit - val classify_as_proofstep : Vernacexpr.vernac_classification - val classify_as_query : Vernacexpr.vernac_classification - val classify_as_sideeff : Vernacexpr.vernac_classification - val classify_vernac : Vernacexpr.vernac_control -> Vernacexpr.vernac_classification -end - -module Stm : -sig - type doc - - val get_doc : Feedback.doc_id -> doc - - val state_of_id : doc:doc -> - Stateid.t -> [ `Valid of Vernacstate.t option | `Expired | `Error of exn ] -end - -(************************************************************************) -(* End of modules from stm/ *) -(************************************************************************) diff --git a/API/API.mllib b/API/API.mllib deleted file mode 100644 index 25275c7046..0000000000 --- a/API/API.mllib +++ /dev/null @@ -1 +0,0 @@ -API diff --git a/API/PROPERTIES b/API/PROPERTIES deleted file mode 100644 index cd942e2021..0000000000 --- a/API/PROPERTIES +++ /dev/null @@ -1,8 +0,0 @@ -0 : All API elements, i.e.: - - modules - - module types - - functions & values - - types - are present if and only if are needed for implementing Coq plugins. - -1 : Individual API elements are not aliased. @@ -23,19 +23,27 @@ package "config" ( ) +package "clib" ( + description = "Base General Coq Library" + version = "8.7" + + directory = "clib" + requires = "str, unix, threads" + + archive(byte) = "clib.cma" + archive(native) = "clib.cmxa" +) + package "lib" ( - description = "Base Coq Library" + description = "Base Coq-Specific Library" version = "8.7" directory = "lib" - requires = "str, unix, threads, coq.config" + requires = "coq.clib, coq.config" - archive(byte) = "clib.cma" archive(byte) += "lib.cma" - - archive(native) = "clib.cmxa" archive(native) += "lib.cmxa" ) @@ -232,25 +240,12 @@ package "stm" ( ) -package "API" ( - - description = "Coq API" - version = "8.7" - - requires = "coq.intf, coq.stm" - directory = "API" - - archive(byte) = "API.cma" - archive(native) = "API.cmxa" - -) - package "ltac" ( description = "Coq LTAC Plugin" version = "8.7" - requires = "coq.API" + requires = "coq.stm" directory = "plugins/ltac" archive(byte) = "ltac_plugin.cmo" diff --git a/Makefile.build b/Makefile.build index 2f7ce6ef35..d8474ae131 100644 --- a/Makefile.build +++ b/Makefile.build @@ -195,7 +195,7 @@ TIMER=$(if $(TIMED), $(STDTIME), $(TIMECMD)) COQOPTS=$(NATIVECOMPUTE) BOOTCOQC=$(TIMER) $(COQTOPBEST) -boot $(COQOPTS) -compile -LOCALINCLUDES=$(if $(filter plugins/%,$@),-I lib -I API -open API $(addprefix -I plugins/,$(PLUGINDIRS)),$(addprefix -I ,$(SRCDIRS))) +LOCALINCLUDES=$(addprefix -I ,$(SRCDIRS)) MLINCLUDES=$(LOCALINCLUDES) -I $(MYCAMLP4LIB) OCAMLC := $(OCAMLFIND) ocamlc $(CAMLFLAGS) @@ -417,7 +417,7 @@ $(COQTOPBYTE): $(LINKCMO) $(LIBCOQRUN) $(TOPLOOPCMA) $(COQTOP_BYTE_MLTOP) # coqc -COQCCMO:=lib/clib.cma lib/cErrors.cmo toplevel/usage.cmo tools/coqc.cmo +COQCCMO:=clib/clib.cma lib/lib.cma toplevel/usage.cmo tools/coqc.cmo $(COQC): $(call bestobj, $(COQCCMO)) $(SHOW)'OCAMLBEST -o $@' @@ -438,21 +438,21 @@ tools: $(TOOLS) $(OCAMLLIBDEP) $(COQDEPBOOT) # Remember to update the dependencies below when you add files! COQDEPBOOTSRC := \ - lib/segmenttree.cmo lib/unicodetable.cmo lib/unicode.cmo lib/minisys.cmo \ + clib/segmenttree.cmo clib/unicodetable.cmo clib/unicode.cmo clib/minisys.cmo \ tools/coqdep_lexer.cmo tools/coqdep_common.cmo tools/coqdep_boot.cmo -lib/segmenttree.cmo : lib/segmenttree.cmi -lib/segmenttree.cmx : lib/segmenttree.cmi -lib/unicodetable.cmo : lib/segmenttree.cmo -lib/unicodetable.cmx : lib/segmenttree.cmx -lib/unicode.cmo : lib/unicodetable.cmo lib/unicode.cmi -lib/unicode.cmx : lib/unicodetable.cmx lib/unicode.cmi -lib/minisys.cmo : lib/unicode.cmo -lib/minisys.cmx : lib/unicode.cmx -tools/coqdep_lexer.cmo : lib/unicode.cmi tools/coqdep_lexer.cmi -tools/coqdep_lexer.cmx : lib/unicode.cmx tools/coqdep_lexer.cmi -tools/coqdep_common.cmo : lib/minisys.cmo tools/coqdep_lexer.cmi tools/coqdep_common.cmi -tools/coqdep_common.cmx : lib/minisys.cmx tools/coqdep_lexer.cmx tools/coqdep_common.cmi +clib/segmenttree.cmo : clib/segmenttree.cmi +clib/segmenttree.cmx : clib/segmenttree.cmi +clib/unicodetable.cmo : clib/segmenttree.cmo +clib/unicodetable.cmx : clib/segmenttree.cmx +clib/unicode.cmo : clib/unicodetable.cmo clib/unicode.cmi +clib/unicode.cmx : clib/unicodetable.cmx clib/unicode.cmi +clib/minisys.cmo : clib/unicode.cmo +clib/minisys.cmx : clib/unicode.cmx +tools/coqdep_lexer.cmo : clib/unicode.cmi tools/coqdep_lexer.cmi +tools/coqdep_lexer.cmx : clib/unicode.cmx tools/coqdep_lexer.cmi +tools/coqdep_common.cmo : clib/minisys.cmo tools/coqdep_lexer.cmi tools/coqdep_common.cmi +tools/coqdep_common.cmx : clib/minisys.cmx tools/coqdep_lexer.cmx tools/coqdep_common.cmi tools/coqdep_boot.cmo : tools/coqdep_common.cmi tools/coqdep_boot.cmx : tools/coqdep_common.cmx @@ -466,10 +466,8 @@ $(OCAMLLIBDEP): $(call bestobj, tools/ocamllibdep.cmo) # The full coqdep (unused by this build, but distributed by make install) -COQDEPCMO:=lib/clib.cma lib/cErrors.cmo lib/cWarnings.cmo \ - lib/segmenttree.cmo lib/unicodetable.cmo lib/unicode.cmo lib/minisys.cmo \ - lib/system.cmo tools/coqdep_lexer.cmo tools/coqdep_common.cmo \ - tools/coqdep.cmo +COQDEPCMO:=clib/clib.cma lib/lib.cma tools/coqdep_lexer.cmo \ + tools/coqdep_common.cmo tools/coqdep.cmo $(COQDEP): $(call bestobj, $(COQDEPCMO)) $(SHOW)'OCAMLBEST -o $@' @@ -479,7 +477,7 @@ $(GALLINA): $(call bestobj, tools/gallina_lexer.cmo tools/gallina.cmo) $(SHOW)'OCAMLBEST -o $@' $(HIDE)$(call bestocaml,) -COQMAKEFILECMO:=lib/clib.cma tools/coq_makefile.cmo +COQMAKEFILECMO:=clib/clib.cma lib/lib.cma tools/coq_makefile.cmo $(COQMAKEFILE): $(call bestobj,$(COQMAKEFILECMO)) $(SHOW)'OCAMLBEST -o $@' @@ -493,23 +491,24 @@ $(COQWC): $(call bestobj, tools/coqwc.cmo) $(SHOW)'OCAMLBEST -o $@' $(HIDE)$(call bestocaml, -package str) -COQDOCCMO:=lib/clib.cma $(addprefix tools/coqdoc/, \ +COQDOCCMO:=clib/clib.cma lib/lib.cma $(addprefix tools/coqdoc/, \ cdglobals.cmo alpha.cmo index.cmo tokens.cmo output.cmo cpretty.cmo main.cmo ) $(COQDOC): $(call bestobj, $(COQDOCCMO)) $(SHOW)'OCAMLBEST -o $@' $(HIDE)$(call bestocaml, -package str,unix) -$(COQWORKMGR): $(call bestobj, lib/clib.cma lib/lib.cma stm/spawned.cmo stm/coqworkmgrApi.cmo tools/coqworkmgr.cmo) +$(COQWORKMGR): $(call bestobj, clib/clib.cma lib/lib.cma stm/spawned.cmo stm/coqworkmgrApi.cmo tools/coqworkmgr.cmo) $(SHOW)'OCAMLBEST -o $@' $(HIDE)$(call bestocaml, $(SYSMOD)) # fake_ide : for debugging or test-suite purpose, a fake ide simulating # a connection to coqtop -ideslave -FAKEIDECMO:= lib/clib.cma lib/cErrors.cmo lib/spawn.cmo ide/document.cmo \ - ide/serialize.cmo ide/xml_lexer.cmo ide/xml_parser.cmo ide/xml_printer.cmo \ - ide/richpp.cmo ide/xmlprotocol.cmo tools/fake_ide.cmo +FAKEIDECMO:=clib/clib.cma lib/lib.cma ide/document.cmo \ + ide/serialize.cmo ide/xml_lexer.cmo ide/xml_parser.cmo \ + ide/xml_printer.cmo ide/richpp.cmo ide/xmlprotocol.cmo \ + tools/fake_ide.cmo $(FAKEIDE): $(call bestobj, $(FAKEIDECMO)) | $(IDETOPLOOPCMA:.cma=$(BESTDYN)) $(SHOW)'OCAMLBEST -o $@' @@ -517,7 +516,7 @@ $(FAKEIDE): $(call bestobj, $(FAKEIDECMO)) | $(IDETOPLOOPCMA:.cma=$(BESTDYN)) # votour: a small vo explorer (based on the checker) -bin/votour: $(call bestobj, lib/cObj.cmo checker/analyze.cmo checker/values.cmo checker/votour.cmo) +bin/votour: $(call bestobj, clib/cObj.cmo checker/analyze.cmo checker/values.cmo checker/votour.cmo) $(SHOW)'OCAMLBEST -o $@' $(HIDE)$(call bestocaml, -I checker) @@ -525,7 +524,7 @@ bin/votour: $(call bestobj, lib/cObj.cmo checker/analyze.cmo checker/values.cmo # Csdp to micromega special targets ########################################################################### -CSDPCERTCMO:=lib/clib.cma $(addprefix plugins/micromega/, \ +CSDPCERTCMO:=clib/clib.cma $(addprefix plugins/micromega/, \ mutils.cmo micromega.cmo \ sos_types.cmo sos_lib.cmo sos.cmo csdpcert.cmo ) @@ -577,12 +576,6 @@ kernel/kernel.cma: kernel/kernel.mllib $(SHOW)'OCAMLC -a -o $@' $(HIDE)$(OCAMLC) $(MLINCLUDES) $(BYTEFLAGS) $(VMBYTEFLAGS) -a -o $@ $(filter-out %.mllib, $^) -# Specific rule for API/API.cmi -# Make sure that API/API.mli cannot leak types from the Coq codebase. -API/API.cmi : API/API.mli - $(SHOW)'OCAMLC $<' - $(HIDE)$(OCAMLC) -I lib -I $(MYCAMLP4LIB) -c $< - %.cma: %.mllib $(SHOW)'OCAMLC -a -o $@' $(HIDE)$(OCAMLC) $(MLINCLUDES) $(BYTEFLAGS) -a -o $@ $(filter-out %.mllib, $^) @@ -607,10 +600,26 @@ COND_BYTEFLAGS= \ COND_OPTFLAGS= \ $(if $(filter tools/fake_ide% tools/coq_makefile%,$<), -I ide,) $(MLINCLUDES) $(OPTFLAGS) +plugins/micromega/%.cmi: plugins/micromega/%.mli + $(SHOW)'OCAMLC $<' + $(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -package unix,num -c $< + +plugins/nsatz/%.cmi: plugins/nsatz/%.mli + $(SHOW)'OCAMLC $<' + $(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -package unix,num -c $< + %.cmi: %.mli $(SHOW)'OCAMLC $<' $(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -c $< +plugins/micromega/%.cmo: plugins/micromega/%.ml + $(SHOW)'OCAMLC $<' + $(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -package unix,num -c $< + +plugins/nsatz/%.cmo: plugins/nsatz/%.ml + $(SHOW)'OCAMLC $<' + $(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -package unix,num -c $< + %.cmo: %.ml $(SHOW)'OCAMLC $<' $(HIDE)$(OCAMLC) $(COND_BYTEFLAGS) -c $< @@ -644,6 +653,14 @@ plugins/micromega/sos_FORPACK:= plugins/micromega/sos_print_FORPACK:= plugins/micromega/csdpcert_FORPACK:= +plugins/micromega/%.cmx: plugins/micromega/%.ml + $(SHOW)'OCAMLOPT $<' + $(HIDE)$(OCAMLOPT) $(COND_OPTFLAGS) $(HACKMLI) $($(@:.cmx=_FORPACK)) -package unix,num -c $< + +plugins/nsatz/%.cmx: plugins/nsatz/%.ml + $(SHOW)'OCAMLOPT $<' + $(HIDE)$(OCAMLOPT) $(COND_OPTFLAGS) $(HACKMLI) $($(@:.cmx=_FORPACK)) -package unix,num -c $< + plugins/%.cmx: plugins/%.ml $(SHOW)'OCAMLOPT $<' $(HIDE)$(OCAMLOPT) $(COND_OPTFLAGS) $(HACKMLI) $($(@:.cmx=_FORPACK)) -c $< diff --git a/Makefile.checker b/Makefile.checker index 7e0f588759..5b5855782f 100644 --- a/Makefile.checker +++ b/Makefile.checker @@ -20,7 +20,7 @@ CHICKEN:=bin/coqchk$(EXE) # The sources -CHKLIBS:= -I config -I lib -I checker +CHKLIBS:= -I config -I clib -I lib -I checker ## NB: currently, both $(OPTFLAGS) and $(BYTEFLAGS) contain -thread diff --git a/Makefile.common b/Makefile.common index f436d3e8f1..d3a9b0b966 100644 --- a/Makefile.common +++ b/Makefile.common @@ -73,9 +73,9 @@ INSTALLSH:=./install.sh MKDIR:=install -d CORESRCDIRS:=\ - config lib kernel intf kernel/byterun library \ + config clib lib kernel intf kernel/byterun library \ engine pretyping interp proofs parsing printing \ - tactics vernac stm toplevel API + tactics vernac stm toplevel PLUGINDIRS:=\ omega romega micromega quote \ @@ -100,10 +100,10 @@ BYTERUN:=$(addprefix kernel/byterun/, \ # respecting this order is useful for developers that want to load or link # the libraries directly -CORECMA:=lib/clib.cma lib/lib.cma kernel/kernel.cma intf/intf.cma library/library.cma \ +CORECMA:=clib/clib.cma lib/lib.cma kernel/kernel.cma intf/intf.cma library/library.cma \ engine/engine.cma pretyping/pretyping.cma interp/interp.cma proofs/proofs.cma \ parsing/parsing.cma printing/printing.cma tactics/tactics.cma vernac/vernac.cma \ - stm/stm.cma toplevel/toplevel.cma API/API.cma + stm/stm.cma toplevel/toplevel.cma TOPLOOPCMA:=stm/proofworkertop.cma stm/tacworkertop.cma stm/queryworkertop.cma diff --git a/Makefile.dev b/Makefile.dev index d2a1e9235e..db83be3699 100644 --- a/Makefile.dev +++ b/Makefile.dev @@ -119,7 +119,7 @@ pretyping: pretyping/pretyping.cma stm: stm/stm.cma toplevel: toplevel/toplevel.cma -.PHONY: lib kernel byterun library proofs tactics interp parsing pretyping API +.PHONY: lib kernel byterun library proofs tactics interp parsing pretyping .PHONY: engine stm toplevel ###################### diff --git a/Makefile.doc b/Makefile.doc index 1b0803f199..8cb9c9f0fa 100644 --- a/Makefile.doc +++ b/Makefile.doc @@ -387,7 +387,7 @@ OCAMLDOCDIR=dev/ocamldoc DOCMLIS=$(wildcard ./lib/*.mli ./intf/*.mli ./kernel/*.mli ./library/*.mli \ ./engine/*.mli ./pretyping/*.mli ./interp/*.mli printing/*.mli \ - ./parsing/*.mli ./proofs/*.mli API/API.mli \ + ./parsing/*.mli ./proofs/*.mli \ ./tactics/*.mli ./stm/*.mli ./toplevel/*.mli ./ltac/*.mli) # Defining options to generate dependencies graphs diff --git a/Makefile.ide b/Makefile.ide index 7d809f67a5..08829b5544 100644 --- a/Makefile.ide +++ b/Makefile.ide @@ -41,7 +41,7 @@ IDESRCDIRS:= $(CORESRCDIRS) ide ide/utils COQIDEFLAGS=$(addprefix -I , $(IDESRCDIRS)) $(COQIDEINCLUDES) -IDEDEPS:=lib/clib.cma lib/cErrors.cmo lib/spawn.cmo +IDEDEPS:=clib/clib.cma lib/lib.cma IDECMA:=ide/ide.cma IDETOPLOOPCMA=ide/coqidetop.cma diff --git a/appveyor.yml b/appveyor.yml index 92fc629b30..64c1bedb54 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,22 +12,20 @@ environment: matrix: - USEOPAM: true ARCH: 64 -# Comment out until issue #5998 is fixed. -# - USEOPAM: false -# ARCH: 32 -# - USEOPAM: false -# ARCH: 64 + - USEOPAM: false + ARCH: 32 + - USEOPAM: false + ARCH: 64 build_script: - cmd: 'call %APPVEYOR_BUILD_FOLDER%\dev\ci\appveyor.bat' test: off -# Comment out until issue #5998 is fixed. -#artifacts: -# - path: 'dev\nsis\*.exe' -# name: installer +artifacts: + - path: 'dev\nsis\*.exe' + name: installer -# - path: 'coq-opensource-archive-*.zip' -# name: opensource-archive + - path: 'coq-opensource-archive-*.zip' + name: opensource-archive diff --git a/lib/backtrace.ml b/clib/backtrace.ml index be9f40c1fb..be9f40c1fb 100644 --- a/lib/backtrace.ml +++ b/clib/backtrace.ml diff --git a/lib/backtrace.mli b/clib/backtrace.mli index dd82165b6d..dd82165b6d 100644 --- a/lib/backtrace.mli +++ b/clib/backtrace.mli diff --git a/lib/bigint.ml b/clib/bigint.ml index 4f8b95d592..4f8b95d592 100644 --- a/lib/bigint.ml +++ b/clib/bigint.ml diff --git a/lib/bigint.mli b/clib/bigint.mli index 2a5a5f122d..2a5a5f122d 100644 --- a/lib/bigint.mli +++ b/clib/bigint.mli diff --git a/lib/cArray.ml b/clib/cArray.ml index 013585735c..013585735c 100644 --- a/lib/cArray.ml +++ b/clib/cArray.ml diff --git a/lib/cArray.mli b/clib/cArray.mli index 325ff8edcc..325ff8edcc 100644 --- a/lib/cArray.mli +++ b/clib/cArray.mli diff --git a/lib/cEphemeron.ml b/clib/cEphemeron.ml index 8b253a7901..8b253a7901 100644 --- a/lib/cEphemeron.ml +++ b/clib/cEphemeron.ml diff --git a/lib/cEphemeron.mli b/clib/cEphemeron.mli index d8a1f27573..d8a1f27573 100644 --- a/lib/cEphemeron.mli +++ b/clib/cEphemeron.mli diff --git a/lib/cList.ml b/clib/cList.ml index 0ef7c3d8ba..0ef7c3d8ba 100644 --- a/lib/cList.ml +++ b/clib/cList.ml diff --git a/lib/cList.mli b/clib/cList.mli index f87db04cf4..f87db04cf4 100644 --- a/lib/cList.mli +++ b/clib/cList.mli diff --git a/lib/cMap.ml b/clib/cMap.ml index b4c4aedd0e..b4c4aedd0e 100644 --- a/lib/cMap.ml +++ b/clib/cMap.ml diff --git a/lib/cMap.mli b/clib/cMap.mli index 5e65bd200a..5e65bd200a 100644 --- a/lib/cMap.mli +++ b/clib/cMap.mli diff --git a/lib/cObj.ml b/clib/cObj.ml index 7f3ee18553..7f3ee18553 100644 --- a/lib/cObj.ml +++ b/clib/cObj.ml diff --git a/lib/cObj.mli b/clib/cObj.mli index 16933a4aa4..16933a4aa4 100644 --- a/lib/cObj.mli +++ b/clib/cObj.mli diff --git a/lib/cSet.ml b/clib/cSet.ml index ed65edf16e..ed65edf16e 100644 --- a/lib/cSet.ml +++ b/clib/cSet.ml diff --git a/lib/cSet.mli b/clib/cSet.mli index 2eb9bce869..2eb9bce869 100644 --- a/lib/cSet.mli +++ b/clib/cSet.mli diff --git a/lib/cSig.mli b/clib/cSig.mli index 32e9d2af0c..32e9d2af0c 100644 --- a/lib/cSig.mli +++ b/clib/cSig.mli diff --git a/lib/cStack.ml b/clib/cStack.ml index 4acb2930c5..4acb2930c5 100644 --- a/lib/cStack.ml +++ b/clib/cStack.ml diff --git a/lib/cStack.mli b/clib/cStack.mli index 8dde1d1a1a..8dde1d1a1a 100644 --- a/lib/cStack.mli +++ b/clib/cStack.mli diff --git a/lib/cString.ml b/clib/cString.ml index f2242460e8..f2242460e8 100644 --- a/lib/cString.ml +++ b/clib/cString.ml diff --git a/lib/cString.mli b/clib/cString.mli index 29d3a44995..29d3a44995 100644 --- a/lib/cString.mli +++ b/clib/cString.mli diff --git a/lib/cThread.ml b/clib/cThread.ml index 0221e690e8..0221e690e8 100644 --- a/lib/cThread.ml +++ b/clib/cThread.ml diff --git a/lib/cThread.mli b/clib/cThread.mli index 66f039bb52..66f039bb52 100644 --- a/lib/cThread.mli +++ b/clib/cThread.mli diff --git a/lib/cUnix.ml b/clib/cUnix.ml index 34fb660db4..34fb660db4 100644 --- a/lib/cUnix.ml +++ b/clib/cUnix.ml diff --git a/lib/cUnix.mli b/clib/cUnix.mli index d08dc4c403..d08dc4c403 100644 --- a/lib/cUnix.mli +++ b/clib/cUnix.mli diff --git a/lib/canary.ml b/clib/canary.ml index 0ed1d28f37..0ed1d28f37 100644 --- a/lib/canary.ml +++ b/clib/canary.ml diff --git a/lib/canary.mli b/clib/canary.mli index 904b88213c..904b88213c 100644 --- a/lib/canary.mli +++ b/clib/canary.mli diff --git a/lib/clib.mllib b/clib/clib.mllib index 5c1f7d9af8..bd5ddb1525 100644 --- a/lib/clib.mllib +++ b/clib/clib.mllib @@ -1,37 +1,38 @@ -Coq_config - -Terminal Canary -Hook +CObj +CEphemeron + Hashset Hashcons + CSet CMap +CList +CString +CStack + Int -Dyn HMap +Bigint + +CArray Option +CUnix + +Segmenttree +Unicodetable +Unicode +Minisys +CThread +Trie +Predicate +Heap +Unionfind + +Dyn Store Exninfo Backtrace IStream -Flags -Control -Loc -CAst -DAst -CList -CString -Deque -CObj -CArray -CStack -Util -Stateid -Pp -Feedback -CUnix -Envars -Aux_file +Terminal Monad -CoqProject_file diff --git a/lib/deque.ml b/clib/deque.ml index 373269b4f5..373269b4f5 100644 --- a/lib/deque.ml +++ b/clib/deque.ml diff --git a/lib/deque.mli b/clib/deque.mli index 23cb1e4919..23cb1e4919 100644 --- a/lib/deque.mli +++ b/clib/deque.mli diff --git a/lib/dyn.ml b/clib/dyn.ml index 64535d35f6..64535d35f6 100644 --- a/lib/dyn.ml +++ b/clib/dyn.ml diff --git a/lib/dyn.mli b/clib/dyn.mli index 2206394e2d..2206394e2d 100644 --- a/lib/dyn.mli +++ b/clib/dyn.mli diff --git a/lib/exninfo.ml b/clib/exninfo.ml index 167d3d6dc8..167d3d6dc8 100644 --- a/lib/exninfo.ml +++ b/clib/exninfo.ml diff --git a/lib/exninfo.mli b/clib/exninfo.mli index c960ac7c08..c960ac7c08 100644 --- a/lib/exninfo.mli +++ b/clib/exninfo.mli diff --git a/lib/hMap.ml b/clib/hMap.ml index 37079af783..37079af783 100644 --- a/lib/hMap.ml +++ b/clib/hMap.ml diff --git a/lib/hMap.mli b/clib/hMap.mli index c77bfced88..c77bfced88 100644 --- a/lib/hMap.mli +++ b/clib/hMap.mli diff --git a/lib/hashcons.ml b/clib/hashcons.ml index ee22325811..ee22325811 100644 --- a/lib/hashcons.ml +++ b/clib/hashcons.ml diff --git a/lib/hashcons.mli b/clib/hashcons.mli index fbd2ebcf9a..fbd2ebcf9a 100644 --- a/lib/hashcons.mli +++ b/clib/hashcons.mli diff --git a/lib/hashset.ml b/clib/hashset.ml index 7f96627a68..7f96627a68 100644 --- a/lib/hashset.ml +++ b/clib/hashset.ml diff --git a/lib/hashset.mli b/clib/hashset.mli index ec79205a5c..ec79205a5c 100644 --- a/lib/hashset.mli +++ b/clib/hashset.mli diff --git a/lib/heap.ml b/clib/heap.ml index a6109972d7..a6109972d7 100644 --- a/lib/heap.ml +++ b/clib/heap.ml diff --git a/lib/heap.mli b/clib/heap.mli index 93d504c5ac..93d504c5ac 100644 --- a/lib/heap.mli +++ b/clib/heap.mli diff --git a/lib/iStream.ml b/clib/iStream.ml index d3a54332a1..d3a54332a1 100644 --- a/lib/iStream.ml +++ b/clib/iStream.ml diff --git a/lib/iStream.mli b/clib/iStream.mli index cd7940e8d3..cd7940e8d3 100644 --- a/lib/iStream.mli +++ b/clib/iStream.mli diff --git a/lib/int.ml b/clib/int.ml index 63f62154d8..63f62154d8 100644 --- a/lib/int.ml +++ b/clib/int.ml diff --git a/lib/int.mli b/clib/int.mli index b65367f7d4..b65367f7d4 100644 --- a/lib/int.mli +++ b/clib/int.mli diff --git a/lib/minisys.ml b/clib/minisys.ml index 389b18ad4e..389b18ad4e 100644 --- a/lib/minisys.ml +++ b/clib/minisys.ml diff --git a/lib/monad.ml b/clib/monad.ml index 2e55e9698c..2e55e9698c 100644 --- a/lib/monad.ml +++ b/clib/monad.ml diff --git a/lib/monad.mli b/clib/monad.mli index 7b0a3e600f..7b0a3e600f 100644 --- a/lib/monad.mli +++ b/clib/monad.mli diff --git a/lib/option.ml b/clib/option.ml index 98b1680354..98b1680354 100644 --- a/lib/option.ml +++ b/clib/option.ml diff --git a/lib/option.mli b/clib/option.mli index 66f05023f7..66f05023f7 100644 --- a/lib/option.mli +++ b/clib/option.mli diff --git a/lib/predicate.ml b/clib/predicate.ml index 1aa7db6af1..1aa7db6af1 100644 --- a/lib/predicate.ml +++ b/clib/predicate.ml diff --git a/lib/predicate.mli b/clib/predicate.mli index cee3b0bd39..cee3b0bd39 100644 --- a/lib/predicate.mli +++ b/clib/predicate.mli diff --git a/lib/segmenttree.ml b/clib/segmenttree.ml index d0ded4cb59..d0ded4cb59 100644 --- a/lib/segmenttree.ml +++ b/clib/segmenttree.ml diff --git a/lib/segmenttree.mli b/clib/segmenttree.mli index e274a6fdc8..e274a6fdc8 100644 --- a/lib/segmenttree.mli +++ b/clib/segmenttree.mli diff --git a/lib/store.ml b/clib/store.ml index 97a8fea085..97a8fea085 100644 --- a/lib/store.ml +++ b/clib/store.ml diff --git a/lib/store.mli b/clib/store.mli index 5cc5bb8593..5cc5bb8593 100644 --- a/lib/store.mli +++ b/clib/store.mli diff --git a/lib/terminal.ml b/clib/terminal.ml index 34efddfbca..34efddfbca 100644 --- a/lib/terminal.ml +++ b/clib/terminal.ml diff --git a/lib/terminal.mli b/clib/terminal.mli index b1b76e6e2a..b1b76e6e2a 100644 --- a/lib/terminal.mli +++ b/clib/terminal.mli diff --git a/lib/trie.ml b/clib/trie.ml index 0b0ba27613..0b0ba27613 100644 --- a/lib/trie.ml +++ b/clib/trie.ml diff --git a/lib/trie.mli b/clib/trie.mli index a87acc8a69..a87acc8a69 100644 --- a/lib/trie.mli +++ b/clib/trie.mli diff --git a/lib/unicode.ml b/clib/unicode.ml index f193c4e0f8..f193c4e0f8 100644 --- a/lib/unicode.ml +++ b/clib/unicode.ml diff --git a/lib/unicode.mli b/clib/unicode.mli index 32ffbb8e94..32ffbb8e94 100644 --- a/lib/unicode.mli +++ b/clib/unicode.mli diff --git a/lib/unicodetable.ml b/clib/unicodetable.ml index b607058c64..b607058c64 100644 --- a/lib/unicodetable.ml +++ b/clib/unicodetable.ml diff --git a/lib/unionfind.ml b/clib/unionfind.ml index f9c92d6a8e..f9c92d6a8e 100644 --- a/lib/unionfind.ml +++ b/clib/unionfind.ml diff --git a/lib/unionfind.mli b/clib/unionfind.mli index b242232edb..b242232edb 100644 --- a/lib/unionfind.mli +++ b/clib/unionfind.mli diff --git a/config/coq_config.mli b/config/coq_config.mli index 1666df0bde..e2d9d0d014 100644 --- a/config/coq_config.mli +++ b/config/coq_config.mli @@ -52,7 +52,6 @@ val vo_magic_number : int val state_magic_number : int val core_src_dirs : string list -val api_dirs : string list val plugins_dirs : string list val all_src_dirs : string list diff --git a/configure.ml b/configure.ml index 06aa5e7666..34fc78efd2 100644 --- a/configure.ml +++ b/configure.ml @@ -1056,7 +1056,7 @@ let _ = print_summary () let write_dbg_wrapper f = safe_remove f; - let o = open_out f in + let o = open_out_bin f in (* _bin to avoid adding \r on Cygwin/Windows *) let pr s = fprintf o s in pr "#!/bin/sh\n\n"; pr "###### ocamldebug-coq : a wrapper around ocamldebug for Coq ######\n\n"; @@ -1134,7 +1134,7 @@ let write_configml f = pr_b "bytecode_compiler" !Prefs.bytecodecompiler; pr_b "native_compiler" !Prefs.nativecompiler; - let core_src_dirs = [ "config"; "dev"; "kernel"; "library"; + let core_src_dirs = [ "config"; "dev"; "lib"; "clib"; "kernel"; "library"; "engine"; "pretyping"; "interp"; "parsing"; "proofs"; "tactics"; "toplevel"; "printing"; "intf"; "grammar"; "ide"; "stm"; "vernac" ] in @@ -1143,7 +1143,6 @@ let write_configml f = core_src_dirs in pr "\nlet core_src_dirs = [\n%s]\n" core_src_dirs; - pr "\nlet api_dirs = [\"API\"; \"lib\"]\n"; pr "\nlet plugins_dirs = [\n"; let plugins = Sys.readdir "plugins" in @@ -1155,7 +1154,7 @@ let write_configml f = plugins; pr "]\n"; - pr "\nlet all_src_dirs = core_src_dirs @ api_dirs @ plugins_dirs\n"; + pr "\nlet all_src_dirs = core_src_dirs @ plugins_dirs\n"; close_out o; Unix.chmod f 0o444 diff --git a/default.nix b/default.nix index 3dd24bac4d..af2a13a842 100644 --- a/default.nix +++ b/default.nix @@ -36,6 +36,7 @@ stdenv.mkDerivation rec { ocaml findlib camlp5_strict + num ]) ++ (if buildIde then [ diff --git a/dev/README b/dev/README index b446c3e974..6b83579def 100644 --- a/dev/README +++ b/dev/README @@ -1,4 +1,4 @@ -This directory contains informations and tools to help developing the +This directory contains information and tools to help develop the Coq system ====================== @@ -6,30 +6,30 @@ This directory contains informations and tools to help developing the Debugging and profiling (in current directory - see doc/debugging.txt) ----------------------- -ocamldebug-coq: to launch ocaml debugger +ocamldebug-coq: to launch ocaml debugger (generated by the configure script) -db: to install pretty-printers from ocaml debugger -base_db: to install raw pretty-printers from ocaml debugger +db: to install pretty-printers from ocaml debugger +base_db: to install raw pretty-printers from ocaml debugger -include: to install pretty-printers from ocaml toplevel +include: to install pretty-printers from ocaml toplevel (use with the coq Drop command) base_include: to install raw pretty-printers from ocaml toplevel -vm_printers.ml, dev_printers.ml: ML pretty-printers for debugging +vm_printers.ml, top_printers.ml: ML pretty-printers for debugging -Miscellaneous informations about the code (directory doc) +Miscellaneous information about the code (directory doc) ----------------------------------------- -changes.txt: (partial) per-version summary of the evolutions of Coq ML source -style.txt: a few style recommendations for writing Coq ML files -debugging.txt: help for debugging or profiling -universes.txt: help to debug universes -translate.txt: help to use coq translator +changes.md: (partial) per-version summary of the evolution of Coq ML source +style.txt: a few style recommendations for writing Coq ML files +debugging.md: help for debugging or profiling +universes.txt: help for debugging universes +translate.txt: help for using coq translator extensions.txt: some help about TACTIC EXTEND -header: standard header for Coq ML files -perf-analysis: analysis of perfs measured on the compilation of user contribs -cic.dtd: official dtd of the calc. of ind. constr. for im/ex-portation +header: standard header for Coq ML files +perf-analysis: analysis of perfs measured on the compilation of user contribs +cic.dtd: official dtd of the calc. of ind. constr. for im/ex-portation Documentation of ML interfaces using ocamldoc (directory ocamldoc/html) diff --git a/dev/base_include b/dev/base_include index 4dc9a0bee8..2a4ad4a157 100644 --- a/dev/base_include +++ b/dev/base_include @@ -18,12 +18,10 @@ #directory "intf";; #directory "stm";; #directory "vernac";; -#directory "../API";; #directory "+camlp4";; (* lazy solution: add both of camlp4/5 so that *) #directory "+camlp5";; (* Gramext is found in top_printers.ml *) -#load "API.cma";; #use "top_printers.ml";; #use "vm_printers.ml";; @@ -194,7 +192,7 @@ let qid = Libnames.qualid_of_string;; let parse_constr = Pcoq.parse_string Pcoq.Constr.constr;; let parse_vernac = Pcoq.parse_string Pcoq.Vernac_.vernac_control;; -let parse_tac = API.Pcoq.parse_string Ltac_plugin.Pltac.tactic;; +let parse_tac = Pcoq.parse_string Ltac_plugin.Pltac.tactic;; (* build a term of type glob_constr without type-checking or resolution of implicit syntax *) diff --git a/dev/build/windows/makecoq_mingw.sh b/dev/build/windows/makecoq_mingw.sh index f12cbe0a78..c467678215 100644 --- a/dev/build/windows/makecoq_mingw.sh +++ b/dev/build/windows/makecoq_mingw.sh @@ -1087,7 +1087,7 @@ function copy_coq_license { install -D README "$PREFIXCOQ/license_readme/coq/ReadMe.txt" || true install -D README.md "$PREFIXCOQ/license_readme/coq/ReadMe.md" || true install -D README.win "$PREFIXCOQ/license_readme/coq/ReadMeWindows.txt" || true - install -D README.doc "$PREFIXCOQ/license_readme/coq/ReadMeDoc.txt" + install -D README.doc "$PREFIXCOQ/license_readme/coq/ReadMeDoc.txt" || true install -D CHANGES "$PREFIXCOQ/license_readme/coq/Changes.txt" install -D INSTALL "$PREFIXCOQ/license_readme/coq/Install.txt" install -D INSTALL.doc "$PREFIXCOQ/license_readme/coq/InstallDoc.txt" @@ -1174,7 +1174,7 @@ function make_mingw_make { if build_prep http://ftp.gnu.org/gnu/make make-4.2 tar.bz2 ; then # The config.h.win32 file is fine - don't edit it # We need to copy the mingw gcc here as "gcc" - then the batch file will use it - cp /usr/bin/${ARCH}-w64-mingw32-gcc-5.4.0.exe ./gcc.exe + cp /usr/bin/${ARCH}-w64-mingw32-gcc-6.4.0.exe ./gcc.exe # By some magic cygwin bash can run batch files logn build ./build_w32.bat gcc # Copy make to Coq folder diff --git a/dev/ci/appveyor.bat b/dev/ci/appveyor.bat index e2fbf1f6d1..72ee89962c 100644 --- a/dev/ci/appveyor.bat +++ b/dev/ci/appveyor.bat @@ -37,5 +37,5 @@ if %USEOPAM% == true ( GOTO :EOF :ErrorExit - ECHO ERROR MakeCoq_MinGW.bat failed + ECHO ERROR %0 failed EXIT /b 1 diff --git a/dev/ci/ci-common.sh b/dev/ci/ci-common.sh index 23131c94c6..58c90ff11d 100644 --- a/dev/ci/ci-common.sh +++ b/dev/ci/ci-common.sh @@ -5,8 +5,17 @@ set -xe if [ -n "${GITLAB_CI}" ]; then export COQBIN=`pwd`/_install_ci/bin - export TRAVIS_BRANCH="$CI_COMMIT_REF_NAME" + export CI_BRANCH="$CI_COMMIT_REF_NAME" else + if [ -n "${TRAVIS}" ]; + then + export CI_PULL_REQUEST="$TRAVIS_PULL_REQUEST" + export CI_BRANCH="$TRAVIS_BRANCH" + elif [ -n "${CIRCLECI}" ]; + then + export CI_PULL_REQUEST="$CIRCLE_PR_NUMBER" + export CI_BRANCH="$CIRCLE_BRANCH" + fi export COQBIN=`pwd`/bin fi export PATH="$COQBIN:$PATH" diff --git a/dev/ci/user-overlays/00669-maximedenes-ssr-merge.sh b/dev/ci/user-overlays/00669-maximedenes-ssr-merge.sh index af4a96f4ae..7716bcb59a 100644 --- a/dev/ci/user-overlays/00669-maximedenes-ssr-merge.sh +++ b/dev/ci/user-overlays/00669-maximedenes-ssr-merge.sh @@ -1,4 +1,4 @@ -if [ "$TRAVIS_PULL_REQUEST" = "669" ] || [ "$TRAVIS_BRANCH" = "ssr-merge" ]; then +if [ "$CI_PULL_REQUEST" = "669" ] || [ "$CI_BRANCH" = "ssr-merge" ]; then mathcomp_CI_BRANCH=ssr-merge mathcomp_CI_GITURL=https://github.com/maximedenes/math-comp.git fi diff --git a/dev/ci/user-overlays/01033-SkySkimmer-restrict-harder.sh b/dev/ci/user-overlays/01033-SkySkimmer-restrict-harder.sh deleted file mode 100644 index 5c4dd1324f..0000000000 --- a/dev/ci/user-overlays/01033-SkySkimmer-restrict-harder.sh +++ /dev/null @@ -1,9 +0,0 @@ -if [ "$TRAVIS_PULL_REQUEST" = "1033" ] || [ "$TRAVIS_BRANCH" = "restrict-harder" ]; then - formal_topology_CI_BRANCH=ci - formal_topology_CI_GITURL=https://github.com/SkySkimmer/topology.git - - HoTT_CI_BRANCH=coq-pr-1033 - HoTT_CI_GITURL=https://github.com/SkySkimmer/HoTT.git - - Equations_CI_GITURL=https://github.com/SkySkimmer/Coq-Equations.git -fi diff --git a/dev/ci/user-overlays/06158-herbelin-master+fix-pr6158-ltac-value-printer.sh b/dev/ci/user-overlays/06158-herbelin-master+fix-pr6158-ltac-value-printer.sh deleted file mode 100644 index cdca8e525a..0000000000 --- a/dev/ci/user-overlays/06158-herbelin-master+fix-pr6158-ltac-value-printer.sh +++ /dev/null @@ -1,4 +0,0 @@ -if [ "$TRAVIS_PULL_REQUEST" = "6158" ] || [ "$TRAVIS_BRANCH" = "master+some-fix-ltac-printing+refined-printers" ]; then - ltac2_CI_BRANCH=master+fix-pr6158-ltac-value-printer - ltac2_CI_GITURL=https://github.com/herbelin/ltac2.git -fi diff --git a/dev/ci/user-overlays/06169-Zimmi48-clean-up-deprecated-options.sh b/dev/ci/user-overlays/06169-Zimmi48-clean-up-deprecated-options.sh deleted file mode 100644 index 6741cf26fb..0000000000 --- a/dev/ci/user-overlays/06169-Zimmi48-clean-up-deprecated-options.sh +++ /dev/null @@ -1,4 +0,0 @@ -if [ "$TRAVIS_PULL_REQUEST" = "6169" ] || [ "$TRAVIS_BRANCH" = "clean-up/deprecated-options" ]; then - ltac2_CI_BRANCH=master - ltac2_CI_GITURL=https://github.com/Zimmi48/ltac2 -fi diff --git a/dev/ci/user-overlays/06197-ejgallego-plugins+remove_locality_hack.sh b/dev/ci/user-overlays/06197-ejgallego-plugins+remove_locality_hack.sh deleted file mode 100644 index c9f1272bed..0000000000 --- a/dev/ci/user-overlays/06197-ejgallego-plugins+remove_locality_hack.sh +++ /dev/null @@ -1,4 +0,0 @@ -if [ "$TRAVIS_PULL_REQUEST" = "6197" ] || [ "$TRAVIS_BRANCH" = "plugins+remove_locality_hack" ]; then - ltac2_CI_BRANCH=localityfixyou - ltac2_CI_GITURL=https://github.com/ejgallego/ltac2.git -fi diff --git a/dev/ci/user-overlays/06217-coqdep-at-once.sh b/dev/ci/user-overlays/06217-coqdep-at-once.sh deleted file mode 100644 index 68e1901f7f..0000000000 --- a/dev/ci/user-overlays/06217-coqdep-at-once.sh +++ /dev/null @@ -1,3 +0,0 @@ -if [ "$TRAVIS_PULL_REQUEST" = "6217" ] || [ "$TRAVIS_BRANCH" = "coqdep-at-once" ]; then - UniMath_CI_GITURL=https://github.com/SkySkimmer/UniMath.git -fi diff --git a/dev/ci/user-overlays/06324-SkySkimmer-abstract-vs-restrict.sh b/dev/ci/user-overlays/06324-SkySkimmer-abstract-vs-restrict.sh deleted file mode 100644 index 7e9b5febdd..0000000000 --- a/dev/ci/user-overlays/06324-SkySkimmer-abstract-vs-restrict.sh +++ /dev/null @@ -1,4 +0,0 @@ -if [ "$TRAVIS_PULL_REQUEST" = "6324" ] || [ "$TRAVIS_BRANCH" = "fix-6323-restrict+abstract" ]; then - Equations_CI_BRANCH=fix-coq-6324 - Equations_CI_GITURL=https://github.com/SkySkimmer/Coq-Equations.git -fi diff --git a/dev/ci/user-overlays/06392-ejgallego-econstr+fix_class.sh b/dev/ci/user-overlays/06392-ejgallego-econstr+fix_class.sh deleted file mode 100644 index c0dcf79e1d..0000000000 --- a/dev/ci/user-overlays/06392-ejgallego-econstr+fix_class.sh +++ /dev/null @@ -1,4 +0,0 @@ -if [ "$TRAVIS_PULL_REQUEST" = "6392" ] || [ "$TRAVIS_BRANCH" = "econstr+fix_class" ]; then - Equations_CI_BRANCH=econstr+fix_class - Equations_CI_GITURL=https://github.com/ejgallego/Coq-Equations.git -fi diff --git a/dev/ci/user-overlays/06405-maximedenes-rm-local-polymorphic-flag.sh b/dev/ci/user-overlays/06405-maximedenes-rm-local-polymorphic-flag.sh new file mode 100644 index 0000000000..c2e3670380 --- /dev/null +++ b/dev/ci/user-overlays/06405-maximedenes-rm-local-polymorphic-flag.sh @@ -0,0 +1,4 @@ +if [ "$CI_PULL_REQUEST" = "6405" ] || [ "$CI_BRANCH" = "rm-local-polymorphic-flag" ]; then + Equations_CI_BRANCH=rm-local-polymorphic-flag + Equations_CI_GITURL=https://github.com/maximedenes/Coq-Equations +fi diff --git a/dev/ci/user-overlays/06413-ejgallego-interp+less_impstyle_p2.sh b/dev/ci/user-overlays/06413-ejgallego-interp+less_impstyle_p2.sh deleted file mode 100644 index 8aea7dee3a..0000000000 --- a/dev/ci/user-overlays/06413-ejgallego-interp+less_impstyle_p2.sh +++ /dev/null @@ -1,4 +0,0 @@ -if [ "$TRAVIS_PULL_REQUEST" = "6413" ] || [ "$TRAVIS_BRANCH" = "interp+less_impstyle_p2" ]; then - Equations_CI_BRANCH=interp+less_impstyle_p2 - Equations_CI_GITURL=https://github.com/ejgallego/Coq-Equations.git -fi diff --git a/dev/ci/user-overlays/06493-gares-API-remove-big-file.sh b/dev/ci/user-overlays/06493-gares-API-remove-big-file.sh new file mode 100644 index 0000000000..9677b35253 --- /dev/null +++ b/dev/ci/user-overlays/06493-gares-API-remove-big-file.sh @@ -0,0 +1,8 @@ +if [ "$CI_PULL_REQUEST" = "6493" ] || [ "$CI_BRANCH" = "API/remove-big-file" ]; then + Equations_CI_BRANCH=API-removal + Equations_CI_GITURL=https://github.com/gares/Coq-Equations.git + coq_dpdgraph_CI_BRANCH=API-removal + coq_dpdgraph_CI_GITURL=https://github.com/gares/coq-dpdgraph.git + ltac2_CI_BRANCH=API-removal + ltac2_CI_GITURL=https://github.com/gares/ltac2.git +fi diff --git a/dev/ci/user-overlays/README.md b/dev/ci/user-overlays/README.md index 9146d3d521..9f0377ceea 100644 --- a/dev/ci/user-overlays/README.md +++ b/dev/ci/user-overlays/README.md @@ -7,8 +7,10 @@ The name of your overlay file should be of the form `five_digit_PR_number-GitHub Example: `00669-maximedenes-ssr-merge.sh` containing ``` -if [ "$TRAVIS_PULL_REQUEST" = "669" ] || [ "$TRAVIS_BRANCH" = "ssr-merge" ]; then +if [ "$CI_PULL_REQUEST" = "669" ] || [ "$CI_BRANCH" = "ssr-merge" ]; then mathcomp_CI_BRANCH=ssr-merge mathcomp_CI_GITURL=https://github.com/maximedenes/math-comp.git fi ``` + +(`CI_PULL_REQUEST` and `CI_BRANCH` are set in [`ci-common.sh`](/dev/ci/ci-common.sh)) diff --git a/dev/core.dbg b/dev/core.dbg index 18e82c352c..00a4355a48 100644 --- a/dev/core.dbg +++ b/dev/core.dbg @@ -17,5 +17,4 @@ load_printer vernac.cma load_printer stm.cma load_printer toplevel.cma load_printer intf.cma -load_printer API.cma load_printer ltac_plugin.cmo diff --git a/dev/doc/changes.md b/dev/doc/changes.md index 01aa6b599b..e616bd5663 100644 --- a/dev/doc/changes.md +++ b/dev/doc/changes.md @@ -12,16 +12,6 @@ All the bugs with a number below 1154 had to be renumbered, you can find a correspondence table [here](/dev/bugzilla2github_stripped.csv). All the other bugs kept their number. -### Plugin API - -Coq 8.8 offers a new module overlay containing a proposed plugin API -in `API/API.ml`; this overlay is enabled by adding the `-open API` -flag to the OCaml compiler; this happens automatically for -developments in the `plugin` folder and `coq_makefile`. - -However, `coq_makefile` can be instructed not to enable this flag by -passing `-bypass-API`. - ### ML API General deprecation @@ -68,6 +58,13 @@ Declaration of printers for arguments used only in vernac command happen. An alternative is to register the corresponding argument as a value, using "Geninterp.register_val0 wit None". +### XML IDE Protocol + +- Before 8.8, `Query` only executed the first command present in the + `query` string; starting with 8.8, the caller may include several + statements. This is useful for instance for temporarily setting an + option and then executing a command. + ## Changes between Coq 8.6 and Coq 8.7 ### Ocaml diff --git a/dev/doc/debugging.md b/dev/doc/debugging.md index fa145d498a..fd3cbd1bc3 100644 --- a/dev/doc/debugging.md +++ b/dev/doc/debugging.md @@ -22,8 +22,8 @@ Debugging from Coq toplevel using Caml trace mechanism printers too. -Debugging from Caml debugger -============================ +Debugging with ocamldebug from Emacs +==================================== Requires [Tuareg mode](https://github.com/ocaml/tuareg) in Emacs.\ Coq must be configured with `-local` (`./configure -local`) and the @@ -59,6 +59,29 @@ Debugging from Caml debugger from the debugger. If this happens, unset the variable, re-start Emacs, and run the debugger again. +Debugging with ocamldebug from the command line +=============================================== + +In the `coq` directory: +1. (on Cygwin/Windows) Pass the `-no-custom` option to the `configure` script before building Coq. +2. Run `make` (to compile the .v files) +3. Run `make byte` +4. (on Cygwin/Windows) Add the full pathname of the directory `.../kernel/byterun` to your bash PATH. + Alternatively, copy the file `kernel/byterun/dllcoqrun.dll` to a directory that is in the PATH. (The + CAML_LD_LIBRARY_PATH mechanism described at the end of INSTALL isn't working.) +5. Run `dev/ocamldebug-coq bin/coqtop.byte` (on Cygwin/Windows, use `... bin/coqtop.byte.exe`) +6. Enter `source db` to load printers +7. Enter `set arguments -coqlib .` so Coq can find plugins, theories, etc. +8. See the ocamldebug manual for more information. A few points: + - use `break @ Printer 501` to set a breakpoint on line 501 in the Printer module (printer.ml). + `break` can be abbreviated as `b`. + - `backtrace` or `bt` to see the call stack + - `step` or `s` goes into called functions; `next` or `n` skips over them + - `list` or `li` shows the code just before and after the current stack frame + - `print <var>` or `p <var>` to see the value of a variable +Note that `make byte` doesn't recompile .v files. `make` recompiles all of them if there +are changes in any .ml file--safer but much slower. + Global gprof-based profiling ============================ diff --git a/dev/doc/xml-protocol.md b/dev/doc/xml-protocol.md index 18f6288f6f..b35571e9ca 100644 --- a/dev/doc/xml-protocol.md +++ b/dev/doc/xml-protocol.md @@ -330,6 +330,12 @@ the STM API, `force` triggers a `Join`. <string>${message}</string> </value> ``` + +Before 8.8, `Query` only executed the first command present in the +`query` string; starting with 8.8, the caller may include several +statements. This is useful for instance for temporarily setting an +option and then executing a command. + ------------------------------- diff --git a/dev/ocamldebug-coq.run b/dev/ocamldebug-coq.run index f4799f7b2c..3850c05fd9 100644 --- a/dev/ocamldebug-coq.run +++ b/dev/ocamldebug-coq.run @@ -23,7 +23,6 @@ exec $OCAMLDEBUG \ -I $COQTOP/pretyping -I $COQTOP/parsing -I $COQTOP/vernac \ -I $COQTOP/interp -I $COQTOP/proofs -I $COQTOP/tactics -I $COQTOP/stm \ -I $COQTOP/toplevel -I $COQTOP/dev -I $COQTOP/config -I $COQTOP/ltac \ - -I $COQTOP/API \ -I $COQTOP/plugins/cc -I $COQTOP/plugins/dp \ -I $COQTOP/plugins/extraction -I $COQTOP/plugins/field \ -I $COQTOP/plugins/firstorder -I $COQTOP/plugins/fourier \ diff --git a/dev/top_printers.ml b/dev/top_printers.ml index 832040ad2c..ff38257877 100644 --- a/dev/top_printers.ml +++ b/dev/top_printers.ml @@ -233,7 +233,7 @@ let ppenvwithcst e = pp str "[" ++ pr_rel_context e Evd.empty (rel_context e) ++ str "]" ++ spc() ++ str "{" ++ Cmap_env.fold (fun a _ s -> Constant.print a ++ spc () ++ s) (Obj.magic e).Pre_env.env_globals.Pre_env.env_constants (mt ()) ++ str "}") -let pptac = (fun x -> pp(Ltac_plugin.Pptactic.pr_glob_tactic (API.Global.env()) x)) +let pptac = (fun x -> pp(Ltac_plugin.Pptactic.pr_glob_tactic (Global.env()) x)) let ppobj obj = Format.print_string (Libobject.object_tag obj) diff --git a/doc/refman/RefMan-pre.tex b/doc/refman/RefMan-pre.tex index 991c9745e9..05775bfbe5 100644 --- a/doc/refman/RefMan-pre.tex +++ b/doc/refman/RefMan-pre.tex @@ -499,7 +499,7 @@ Claude Marché coordinated the edition of the Reference Manual for Pierre Letouzey and Jacek Chrz\k{a}szcz respectively maintained the extraction tool and module system of {\Coq}. -Jean-Christophe Filliâtre, Pierre Letouzey, Hugo Herbelin ando +Jean-Christophe Filliâtre, Pierre Letouzey, Hugo Herbelin and other contributors from Sophia-Antipolis and Nijmegen participated to the extension of the library. @@ -659,7 +659,7 @@ Matthieu Sozeau extended the \textsc{Russell} language, ending in an convenient way to write programs of given specifications, Pierre Corbineau extended the Mathematical Proof Language and the automatization tools that accompany it, Pierre Letouzey supervised and -extended various parts the standard library, Stéphane Glondu +extended various parts of the standard library, Stéphane Glondu contributed a few tactics and improvements, Jean-Marc Notin provided help in debugging, general maintenance and {\tt coqdoc} support, Vincent Siles contributed extensions of the {\tt Scheme} command and @@ -680,7 +680,7 @@ Nicolas Tabareau made the adaptation of the interface of the old the interaction between Coq and its external interfaces. With Samuel Mimram, he also helped making Coq compatible with recent software tools. Russell O'Connor, Cezary Kaliscyk, Milad Niqui contributed to -improved the libraries of integers, rational, and real numbers. We +improve the libraries of integers, rational, and real numbers. We also thank many users and partners for suggestions and feedback, in particular Pierre Castéran and Arthur Charguéraud, the INRIA Marelle team, Georges Gonthier and the INRIA-Microsoft Mathematical Components team, @@ -714,7 +714,7 @@ implementation of $\mathbb{N}$, $\mathbb{Z}$ or $\mathbb{Z}/n\mathbb{Z}$. The main other evolutions of the library are due to Hugo Herbelin who -made a revision of the sorting library (includingh a certified +made a revision of the sorting library (including a certified merge-sort) and to Guillaume Melquiond who slightly revised and cleaned up the library of reals. @@ -723,7 +723,7 @@ some efficiency issues and a more flexible construction of module types, Élie Soubiran brought a new model of name equivalence, the $\Delta$-equivalence, which respects as much as possible the names given by the users. He also designed with Pierre Letouzey a new -convenient operator \verb!<+! for nesting functor application, what +convenient operator \verb!<+! for nesting functor application, that provides a light notation for inheriting the properties of cascading modules. diff --git a/grammar/tacextend.mlp b/grammar/tacextend.mlp index 0b33dab051..c52a0040bf 100644 --- a/grammar/tacextend.mlp +++ b/grammar/tacextend.mlp @@ -45,7 +45,7 @@ let rec make_let raw e = function <:expr< let $lid:p$ = $v$ in $e$ >> | _::l -> make_let raw e l -let make_clause (pt,_,e) = +let make_clause (pt,e) = (make_patt pt, ploc_vala None, make_let false e pt) @@ -76,7 +76,7 @@ let make_prod_item = function <:expr< Tacentries.TacNonTerm (Loc.tag ( $mlexpr_of_symbol g$ , $mlexpr_of_option mlexpr_of_ident id$ ) ) >> let mlexpr_of_clause cl = - mlexpr_of_list (fun (a,_,_) -> mlexpr_of_list make_prod_item a) cl + mlexpr_of_list (fun (a,_) -> mlexpr_of_list make_prod_item a) cl (** Special treatment of constr entries *) let is_constr_gram = function @@ -88,8 +88,8 @@ let make_var = function | ExtNonTerminal (_, p) -> p | _ -> assert false -let declare_tactic loc tacname ~level classification clause = match clause with -| [(ExtTerminal name) :: rem, _, tac] when List.for_all is_constr_gram rem -> +let declare_tactic loc tacname ~level clause = match clause with +| [(ExtTerminal name) :: rem, tac] when List.for_all is_constr_gram rem -> (** The extension is only made of a name followed by constr entries: we do not add any grammar nor printing rule and add it as a true Ltac definition. *) let patt = make_patt rem in @@ -141,16 +141,14 @@ EXTEND str_item: [ [ "TACTIC"; "EXTEND"; s = tac_name; level = OPT [ "AT"; UIDENT "LEVEL"; level = INT -> level ]; - c = OPT [ "CLASSIFIED"; "BY"; c = LIDENT -> <:expr< $lid:c$ >> ]; OPT "|"; l = LIST1 tacrule SEP "|"; "END" -> let level = match level with Some i -> int_of_string i | None -> 0 in - declare_tactic loc s ~level c l ] ] + declare_tactic loc s ~level l ] ] ; tacrule: [ [ "["; l = LIST1 tacargs; "]"; - c = OPT [ "=>"; "["; c = Pcaml.expr; "]" -> c ]; - "->"; "["; e = Pcaml.expr; "]" -> (l,c,e) + "->"; "["; e = Pcaml.expr; "]" -> (l,e) ] ] ; tacargs: diff --git a/ide/ide_slave.ml b/ide/ide_slave.ml index aafc3fc59a..5f40a22423 100644 --- a/ide/ide_slave.ml +++ b/ide/ide_slave.ml @@ -69,9 +69,7 @@ let ide_cmd_checks ~id (loc,ast) = if is_known_option ast then warn "Set this option from the IDE menu instead"; if is_navigation_vernac ast || is_undo ast then - warn "Use IDE navigation instead"; - if is_query ast then - warn "Query commands should not be inserted in scripts" + warn "Use IDE navigation instead" (** Interpretation (cf. [Ide_intf.interp]) *) diff --git a/interp/declare.ml b/interp/declare.ml index 5be07e09ec..d1b79ffcdd 100644 --- a/interp/declare.ml +++ b/interp/declare.ml @@ -349,7 +349,7 @@ let dummy_one_inductive_entry mie = { let dummy_inductive_entry (_,m) = ([],{ mind_entry_params = []; mind_entry_record = None; - mind_entry_finite = Decl_kinds.BiFinite; + mind_entry_finite = Declarations.BiFinite; mind_entry_inds = List.map dummy_one_inductive_entry m.mind_entry_inds; mind_entry_universes = Monomorphic_ind_entry Univ.ContextSet.empty; mind_entry_private = None; diff --git a/interp/dumpglob.ml b/interp/dumpglob.ml index 0197cf9ae2..d7962e29a6 100644 --- a/interp/dumpglob.ml +++ b/interp/dumpglob.ml @@ -68,6 +68,7 @@ let pause () = previous_state := !glob_output; glob_output := NoGlob let continue () = glob_output := !previous_state open Decl_kinds +open Declarations let type_of_logical_kind = function | IsDefinition def -> @@ -111,14 +112,12 @@ let type_of_global_ref gr = | Globnames.IndRef ind -> let (mib,oib) = Inductive.lookup_mind_specif (Global.env ()) ind in if mib.Declarations.mind_record <> None then - let open Decl_kinds in begin match mib.Declarations.mind_finite with | Finite -> "indrec" | BiFinite -> "rec" | CoFinite -> "corec" end else - let open Decl_kinds in begin match mib.Declarations.mind_finite with | Finite -> "ind" | BiFinite -> "variant" diff --git a/interp/implicit_quantifiers.mli b/interp/implicit_quantifiers.mli index f7c36c4e5f..bfe73160bb 100644 --- a/interp/implicit_quantifiers.mli +++ b/interp/implicit_quantifiers.mli @@ -38,10 +38,10 @@ val make_fresh : Id.Set.t -> Environ.env -> Id.t -> Id.t val implicits_of_glob_constr : ?with_products:bool -> Glob_term.glob_constr -> Impargs.manual_implicits val combine_params_freevar : - Id.Set.t -> (global_reference * bool) option * Context.Rel.Declaration.t -> + Id.Set.t -> global_reference option * Context.Rel.Declaration.t -> Constrexpr.constr_expr * Id.Set.t val implicit_application : Id.Set.t -> ?allow_partial:bool -> - (Id.Set.t -> (global_reference * bool) option * Context.Rel.Declaration.t -> + (Id.Set.t -> global_reference option * Context.Rel.Declaration.t -> Constrexpr.constr_expr * Id.Set.t) -> constr_expr -> constr_expr * Id.Set.t diff --git a/intf/decl_kinds.ml b/intf/decl_kinds.ml index b0c1f66613..b9a3f0c212 100644 --- a/intf/decl_kinds.ml +++ b/intf/decl_kinds.ml @@ -77,6 +77,9 @@ type logical_kind = type recursivity_kind = Declarations.recursivity_kind = | Finite (** = inductive *) + [@ocaml.deprecated "Please use [Declarations.Finite"] | CoFinite (** = coinductive *) + [@ocaml.deprecated "Please use [Declarations.CoFinite"] | BiFinite (** = non-recursive, like in "Record" definitions *) + [@ocaml.deprecated "Please use [Declarations.BiFinite"] [@@ocaml.deprecated "Please use [Declarations.recursivity_kind"] diff --git a/intf/vernacexpr.ml b/intf/vernacexpr.ml index a90e5501a5..5106e513b9 100644 --- a/intf/vernacexpr.ml +++ b/intf/vernacexpr.ml @@ -479,8 +479,9 @@ and vernac_argument_status = { type vernac_control = | VernacExpr of vernac_expr - (* Control *) - | VernacTime of vernac_control located + (* boolean is true when the `-time` batch-mode command line flag was set. + the flag is used to print differently in `-time` vs `Time foo` *) + | VernacTime of bool * vernac_control located | VernacRedirect of string * vernac_control located | VernacTimeout of int * vernac_control | VernacFail of vernac_control diff --git a/kernel/cClosure.ml b/kernel/cClosure.ml index 31ded9129a..11616da7b3 100644 --- a/kernel/cClosure.ml +++ b/kernel/cClosure.ml @@ -810,7 +810,7 @@ let eta_expand_ind_stack env ind m s (f, s') = let mib = lookup_mind (fst ind) env in match mib.Declarations.mind_record with | Some (Some (_,projs,pbs)) when - mib.Declarations.mind_finite == Decl_kinds.BiFinite -> + mib.Declarations.mind_finite == Declarations.BiFinite -> (* (Construct, pars1 .. parsm :: arg1...argn :: []) ~= (f, s') -> arg1..argn ~= (proj1 t...projn t) where t = zip (f,s') *) let pars = mib.Declarations.mind_nparams in diff --git a/kernel/indtypes.ml b/kernel/indtypes.ml index 8e9b606a58..1f2ae0b6cc 100644 --- a/kernel/indtypes.ml +++ b/kernel/indtypes.ml @@ -710,7 +710,7 @@ let check_positivity_one ~chkpos recursive (env,_,ntypes,_ as ienv) paramsctxt ( best-effort fashion. *) let check_positivity ~chkpos kn env_ar_par paramsctxt finite inds = let ntypes = Array.length inds in - let recursive = finite != Decl_kinds.BiFinite in + let recursive = finite != BiFinite in let rc = Array.mapi (fun j t -> (Mrec (kn,j),t)) (Rtree.mk_rec_calls ntypes) in let ra_env_ar = Array.rev_to_list rc in let nparamsctxt = Context.Rel.length paramsctxt in diff --git a/kernel/inductive.ml b/kernel/inductive.ml index 2a629f00a9..28a09b81b0 100644 --- a/kernel/inductive.ml +++ b/kernel/inductive.ml @@ -38,14 +38,14 @@ let find_inductive env c = let (t, l) = decompose_app (whd_all env c) in match kind t with | Ind ind - when (fst (lookup_mind_specif env (out_punivs ind))).mind_finite <> Decl_kinds.CoFinite -> (ind, l) + when (fst (lookup_mind_specif env (out_punivs ind))).mind_finite <> CoFinite -> (ind, l) | _ -> raise Not_found let find_coinductive env c = let (t, l) = decompose_app (whd_all env c) in match kind t with | Ind ind - when (fst (lookup_mind_specif env (out_punivs ind))).mind_finite == Decl_kinds.CoFinite -> (ind, l) + when (fst (lookup_mind_specif env (out_punivs ind))).mind_finite == CoFinite -> (ind, l) | _ -> raise Not_found let inductive_params (mib,_) = mib.mind_nparams diff --git a/kernel/nativelambda.ml b/kernel/nativelambda.ml index de4dc21079..160a90dc2f 100644 --- a/kernel/nativelambda.ml +++ b/kernel/nativelambda.ml @@ -515,7 +515,7 @@ let rec lambda_of_constr env sigma c = { asw_ind = ind; asw_ci = ci; asw_reloc = tbl; - asw_finite = mib.mind_finite <> Decl_kinds.CoFinite; + asw_finite = mib.mind_finite <> CoFinite; asw_prefix = prefix} in (* translation of the argument *) diff --git a/kernel/subtyping.ml b/kernel/subtyping.ml index 2913c6dfad..d0d5cb1d56 100644 --- a/kernel/subtyping.ml +++ b/kernel/subtyping.ml @@ -193,7 +193,7 @@ let check_inductive cst env mp1 l info1 mp2 mib2 spec2 subst1 subst2 reso1 reso2 (arities_of_specif (mind, inst) (mib2, p2)) in let check f test why = if not (test (f mib1) (f mib2)) then error (why (f mib2)) in - check (fun mib -> mib.mind_finite<>Decl_kinds.CoFinite) (==) (fun x -> FiniteInductiveFieldExpected x); + check (fun mib -> mib.mind_finite<>CoFinite) (==) (fun x -> FiniteInductiveFieldExpected x); check (fun mib -> mib.mind_ntypes) Int.equal (fun x -> InductiveNumbersFieldExpected x); assert (List.is_empty mib1.mind_hyps && List.is_empty mib2.mind_hyps); assert (Array.length mib1.mind_packets >= 1 diff --git a/lib/coqProject_file.ml4 b/lib/coqProject_file.ml4 index 970666638c..1e52af0be7 100644 --- a/lib/coqProject_file.ml4 +++ b/lib/coqProject_file.ml4 @@ -11,7 +11,6 @@ type project = { makefile : string option; install_kind : install option; use_ocamlopt : bool; - bypass_API : bool; v_files : string list; mli_files : string list; @@ -43,12 +42,11 @@ and install = | UserInstall (* TODO generate with PPX *) -let mk_project project_file makefile install_kind use_ocamlopt bypass_API = { +let mk_project project_file makefile install_kind use_ocamlopt = { project_file; makefile; install_kind; use_ocamlopt; - bypass_API; v_files = []; mli_files = []; @@ -113,6 +111,7 @@ let exists_dir dir = let process_cmd_line orig_dir proj args = + let parsing_project_file = ref (proj.project_file <> None) in let orig_dir = (* avoids turning foo.v in ./foo.v *) if orig_dir = "." then "" else orig_dir in let error s = Feedback.msg_error (Pp.str (s^".")); exit 1 in @@ -155,16 +154,22 @@ let process_cmd_line orig_dir proj args = aux { proj with r_includes = proj.r_includes @ [mk_path d,lp] } r | "-f" :: file :: r -> + if !parsing_project_file then + raise (Parsing_error ("Invalid option -f in project file " ^ Option.get proj.project_file)); let file = CUnix.remove_path_dot (CUnix.correct_path file orig_dir) in let () = match proj.project_file with | None -> () | Some _ -> Feedback.msg_warning (Pp.str "Multiple project files are deprecated.") in + parsing_project_file := true; let proj = aux { proj with project_file = Some file } (parse file) in + parsing_project_file := false; aux proj r | "-o" :: file :: r -> + if !parsing_project_file then + raise (Parsing_error ("Invalid option -o in project file " ^ Option.get proj.project_file)); if String.contains file '/' then error "Output file must be in the current directory"; if proj.makefile <> None then @@ -174,8 +179,6 @@ let process_cmd_line orig_dir proj args = aux { proj with defs = proj.defs @ [v,def] } r | "-arg" :: a :: r -> aux { proj with extra_args = proj.extra_args @ [a] } r - | "-bypass-API" :: r -> - aux { proj with bypass_API = true } r | f :: r -> let f = CUnix.correct_path f orig_dir in let proj = @@ -195,11 +198,11 @@ let process_cmd_line orig_dir proj args = (******************************* API ************************************) let cmdline_args_to_project ~curdir args = - process_cmd_line curdir (mk_project None None None true false) args + process_cmd_line curdir (mk_project None None None true) args let read_project_file f = process_cmd_line (Filename.dirname f) - (mk_project (Some f) None (Some NoInstall) true false) (parse f) + (mk_project (Some f) None (Some NoInstall) true) (parse f) let rec find_project_file ~from ~projfile_name = let fname = Filename.concat from projfile_name in diff --git a/lib/coqProject_file.mli b/lib/coqProject_file.mli index 23a27a54ab..810189450f 100644 --- a/lib/coqProject_file.mli +++ b/lib/coqProject_file.mli @@ -13,7 +13,6 @@ type project = { makefile : string option; install_kind : install option; use_ocamlopt : bool; - bypass_API : bool; v_files : string list; mli_files : string list; diff --git a/lib/flags.ml b/lib/flags.ml index 644f66d02b..ee4c0734af 100644 --- a/lib/flags.ml +++ b/lib/flags.ml @@ -48,8 +48,6 @@ let profile = false let ide_slave = ref false let ideslave_coqtop_flags = ref None -let time = ref false - let raw_print = ref false let univ_print = ref false @@ -110,14 +108,6 @@ let universe_polymorphism = ref false let make_universe_polymorphism b = universe_polymorphism := b let is_universe_polymorphism () = !universe_polymorphism -let local_polymorphic_flag = ref None -let use_polymorphic_flag () = - match !local_polymorphic_flag with - | Some p -> local_polymorphic_flag := None; p - | None -> is_universe_polymorphism () -let make_polymorphic_flag b = - local_polymorphic_flag := Some b - let polymorphic_inductive_cumulativity = ref false let make_polymorphic_inductive_cumulativity b = polymorphic_inductive_cumulativity := b let is_polymorphic_inductive_cumulativity () = !polymorphic_inductive_cumulativity diff --git a/lib/flags.mli b/lib/flags.mli index 000862b2c6..33d281798f 100644 --- a/lib/flags.mli +++ b/lib/flags.mli @@ -35,9 +35,6 @@ val profile : bool val ide_slave : bool ref val ideslave_coqtop_flags : string option ref -(* -time option: every command will be wrapped with `Time` *) -val time : bool ref - (* development flag to detect race conditions, it should go away. *) val we_are_parsing : bool ref @@ -77,10 +74,6 @@ val is_program_mode : unit -> bool val make_universe_polymorphism : bool -> unit val is_universe_polymorphism : unit -> bool -(** Local universe polymorphism flag. *) -val make_polymorphic_flag : bool -> unit -val use_polymorphic_flag : unit -> bool - (** Global polymorphic inductive cumulativity flag. *) val make_polymorphic_inductive_cumulativity : bool -> unit val is_polymorphic_inductive_cumulativity : unit -> bool diff --git a/lib/lib.mllib b/lib/lib.mllib index 66f939a910..b2260ba097 100644 --- a/lib/lib.mllib +++ b/lib/lib.mllib @@ -1,21 +1,30 @@ +Coq_config + +Hook +Flags +Control +Util + +Pp +Stateid +Loc +Feedback CErrors CWarnings -Bigint -Segmenttree -Unicodetable -Unicode -Minisys + +Rtree System -CThread -Spawn -Trie -CProfile Explore -Predicate -Rtree -Heap -Unionfind -Genarg -CEphemeron +RTree +CProfile Future +Spawn + +CAst +DAst +Genarg + RemoteCounter +Aux_file +Envars +CoqProject_file diff --git a/lib/system.ml b/lib/system.ml index 2c8dbac7c0..e56736eb15 100644 --- a/lib/system.ml +++ b/lib/system.ml @@ -294,18 +294,18 @@ let fmt_time_difference (startreal,ustart,sstart) (stopreal,ustop,sstop) = real (round (sstop -. sstart)) ++ str "s" ++ str ")" -let with_time time f x = +let with_time ~batch f x = let tstart = get_time() in - let msg = if time then "" else "Finished transaction in " in + let msg = if batch then "" else "Finished transaction in " in try let y = f x in let tend = get_time() in - let msg2 = if time then "" else " (successful)" in + let msg2 = if batch then "" else " (successful)" in Feedback.msg_info (str msg ++ fmt_time_difference tstart tend ++ str msg2); y with e -> let tend = get_time() in - let msg = if time then "" else "Finished failing transaction in " in - let msg2 = if time then "" else " (failure)" in + let msg = if batch then "" else "Finished failing transaction in " in + let msg2 = if batch then "" else " (failure)" in Feedback.msg_info (str msg ++ fmt_time_difference tstart tend ++ str msg2); raise e diff --git a/lib/system.mli b/lib/system.mli index c02bc9c8ac..0c0cc9fae5 100644 --- a/lib/system.mli +++ b/lib/system.mli @@ -104,4 +104,4 @@ val get_time : unit -> time val time_difference : time -> time -> float (** in seconds *) val fmt_time_difference : time -> time -> Pp.t -val with_time : bool -> ('a -> 'b) -> 'a -> 'b +val with_time : batch:bool -> ('a -> 'b) -> 'a -> 'b diff --git a/parsing/g_vernac.ml4 b/parsing/g_vernac.ml4 index c18c6810f7..92e60f4656 100644 --- a/parsing/g_vernac.ml4 +++ b/parsing/g_vernac.ml4 @@ -15,6 +15,7 @@ open Constrexpr_ops open Extend open Vernacexpr open Decl_kinds +open Declarations open Misctypes open Tok (* necessary for camlp4 *) @@ -67,7 +68,7 @@ let parse_compat_version ?(allow_old = true) = let open Flags in function GEXTEND Gram GLOBAL: vernac_control gallina_ext noedit_mode subprf; vernac_control: FIRST - [ [ IDENT "Time"; c = located_vernac -> VernacTime c + [ [ IDENT "Time"; c = located_vernac -> VernacTime (false,c) | IDENT "Redirect"; s = ne_string; c = located_vernac -> VernacRedirect (s, c) | IDENT "Timeout"; n = natural; v = vernac_control -> VernacTimeout(n,v) | IDENT "Fail"; v = vernac_control -> VernacFail v diff --git a/plugins/.merlin b/plugins/.merlin index dd6678ba09..2ba6169622 100644 --- a/plugins/.merlin +++ b/plugins/.merlin @@ -1,2 +1 @@ REC -FLG -open API diff --git a/plugins/extraction/extraction.ml b/plugins/extraction/extraction.ml index 4ae875cd70..c169b7b50b 100644 --- a/plugins/extraction/extraction.ml +++ b/plugins/extraction/extraction.ml @@ -431,7 +431,7 @@ and extract_really_ind env kn mib = let ip = (kn, 0) in let r = IndRef ip in if is_custom r then raise (I Standard); - if mib.mind_finite == Decl_kinds.CoFinite then raise (I Coinductive); + if mib.mind_finite == CoFinite then raise (I Coinductive); if not (Int.equal mib.mind_ntypes 1) then raise (I Standard); let p,u = packets.(0) in if p.ip_logical then raise (I Standard); diff --git a/plugins/funind/glob_term_to_relation.ml b/plugins/funind/glob_term_to_relation.ml index 97066e5312..b4e17c5d1c 100644 --- a/plugins/funind/glob_term_to_relation.ml +++ b/plugins/funind/glob_term_to_relation.ml @@ -1498,7 +1498,7 @@ let do_build_inductive try with_full_print (Flags.silently (ComInductive.do_mutual_inductive rel_inds (Flags.is_universe_polymorphism ()) false false)) - Decl_kinds.Finite + Declarations.Finite with | UserError(s,msg) as e -> let _time3 = System.get_time () in @@ -1509,7 +1509,7 @@ let do_build_inductive in let msg = str "while trying to define"++ spc () ++ - Ppvernac.pr_vernac Vernacexpr.(VernacExpr(VernacInductive(GlobalNonCumulativity,false,Decl_kinds.Finite,repacked_rel_inds))) + Ppvernac.pr_vernac Vernacexpr.(VernacExpr(VernacInductive(GlobalNonCumulativity,false,Declarations.Finite,repacked_rel_inds))) ++ fnl () ++ msg in @@ -1524,7 +1524,7 @@ let do_build_inductive in let msg = str "while trying to define"++ spc () ++ - Ppvernac.pr_vernac Vernacexpr.(VernacExpr(VernacInductive(GlobalNonCumulativity,false,Decl_kinds.Finite,repacked_rel_inds))) + Ppvernac.pr_vernac Vernacexpr.(VernacExpr(VernacInductive(GlobalNonCumulativity,false,Declarations.Finite,repacked_rel_inds))) ++ fnl () ++ CErrors.print reraise in diff --git a/plugins/funind/merge.ml b/plugins/funind/merge.ml index 9fcb35f89e..8f5d3f22f4 100644 --- a/plugins/funind/merge.ml +++ b/plugins/funind/merge.ml @@ -20,10 +20,10 @@ open Names open Term open Constr open Vars -open Declarations open Glob_term open Glob_termops open Decl_kinds +open Declarations open Context.Rel.Declaration module RelDecl = Context.Rel.Declaration @@ -353,8 +353,8 @@ let ind2name = Id.of_string "__ind2" be co-inductive, and for the moment they must not be mutual either. *) let verify_inds mib1 mib2 = - if mib1.mind_finite == Decl_kinds.CoFinite then error "First argument is coinductive"; - if mib2.mind_finite == Decl_kinds.CoFinite then error "Second argument is coinductive"; + if mib1.mind_finite == CoFinite then error "First argument is coinductive"; + if mib2.mind_finite == CoFinite then error "Second argument is coinductive"; if not (Int.equal mib1.mind_ntypes 1) then error "First argument is mutual"; if not (Int.equal mib2.mind_ntypes 1) then error "Second argument is mutual"; () @@ -891,7 +891,7 @@ let merge_inductive (ind1: inductive) (ind2: inductive) (* Declare inductive *) let indl,_,_ = ComInductive.extract_mutual_inductive_declaration_components [(indexpr,[])] in let mie,pl,impls = ComInductive.interp_mutual_inductive indl [] - false (* non-cumulative *) false (*FIXMEnon-poly *) false (* means not private *) Decl_kinds.Finite (* means: not coinductive *) in + false (* non-cumulative *) false (*FIXMEnon-poly *) false (* means not private *) Finite (* means: not coinductive *) in (* Declare the mutual inductive block with its associated schemes *) ignore (ComInductive.declare_mutual_inductive_with_eliminations mie pl impls) diff --git a/plugins/funind/recdef.ml b/plugins/funind/recdef.ml index 363ad5dfc9..8fe05b4978 100644 --- a/plugins/funind/recdef.ml +++ b/plugins/funind/recdef.ml @@ -861,7 +861,7 @@ let rec prove_le g = | App (c, [| x0 ; _ |]) -> EConstr.isVar sigma x0 && Id.equal (destVar sigma x0) (destVar sigma x) && - is_global sigma (le ()) c + EConstr.is_global sigma (le ()) c | _ -> false in let (h,t) = List.find (fun (_,t) -> matching_fun t) (pf_hyps_types g) diff --git a/plugins/ltac/extratactics.ml4 b/plugins/ltac/extratactics.ml4 index 982fc7cc3c..cf51257571 100644 --- a/plugins/ltac/extratactics.ml4 +++ b/plugins/ltac/extratactics.ml4 @@ -25,6 +25,7 @@ open Termops open Equality open Misctypes open Proofview.Notations +open Vernacinterp DECLARE PLUGIN "ltac_plugin" @@ -249,11 +250,10 @@ TACTIC EXTEND rewrite_star (**********************************************************************) (* Hint Rewrite *) -let add_rewrite_hint bases ort t lcsr = +let add_rewrite_hint ~poly bases ort t lcsr = let env = Global.env() in let sigma = Evd.from_env env in - let poly = Flags.use_polymorphic_flag () in - let f ce = + let f ce = let c, ctx = Constrintern.interp_constr env sigma ce in let ctx = let ctx = UState.context_set ctx in @@ -270,16 +270,16 @@ let add_rewrite_hint bases ort t lcsr = let classify_hint _ = Vernacexpr.VtSideff [], Vernacexpr.VtLater -VERNAC COMMAND EXTEND HintRewrite CLASSIFIED BY classify_hint +VERNAC COMMAND FUNCTIONAL EXTEND HintRewrite CLASSIFIED BY classify_hint [ "Hint" "Rewrite" orient(o) ne_constr_list(l) ":" preident_list(bl) ] -> - [ add_rewrite_hint bl o None l ] + [ fun ~atts ~st -> add_rewrite_hint ~poly:atts.polymorphic bl o None l; st ] | [ "Hint" "Rewrite" orient(o) ne_constr_list(l) "using" tactic(t) ":" preident_list(bl) ] -> - [ add_rewrite_hint bl o (Some t) l ] + [ fun ~atts ~st -> add_rewrite_hint ~poly:atts.polymorphic bl o (Some t) l; st ] | [ "Hint" "Rewrite" orient(o) ne_constr_list(l) ] -> - [ add_rewrite_hint ["core"] o None l ] + [ fun ~atts ~st -> add_rewrite_hint ~poly:atts.polymorphic ["core"] o None l; st ] | [ "Hint" "Rewrite" orient(o) ne_constr_list(l) "using" tactic(t) ] -> - [ add_rewrite_hint ["core"] o (Some t) l ] + [ fun ~atts ~st -> add_rewrite_hint ~poly:atts.polymorphic ["core"] o (Some t) l; st ] END (**********************************************************************) @@ -290,7 +290,7 @@ open EConstr open Vars open Coqlib -let project_hint pri l2r r = +let project_hint ~poly pri l2r r = let gr = Smartlocate.global_with_alias r in let env = Global.env() in let sigma = Evd.from_env env in @@ -313,30 +313,28 @@ let project_hint pri l2r r = let id = Nameops.add_suffix (Nametab.basename_of_global gr) ("_proj_" ^ (if l2r then "l2r" else "r2l")) in - let poly = Flags.use_polymorphic_flag () in let ctx = Evd.const_univ_entry ~poly sigma in let c = EConstr.to_constr sigma c in let c = Declare.declare_definition ~internal:Declare.InternalTacticRequest id (c,ctx) in let info = {Vernacexpr.hint_priority = pri; hint_pattern = None} in (info,false,true,Hints.PathAny, Hints.IsGlobRef (Globnames.ConstRef c)) -let add_hints_iff ?locality l2r lc n bl = - Hints.add_hints (Locality.make_module_locality locality) bl - (Hints.HintsResolveEntry (List.map (project_hint n l2r) lc)) +let add_hints_iff ~atts l2r lc n bl = + let open Vernacinterp in + Hints.add_hints (Locality.make_module_locality atts.locality) bl + (Hints.HintsResolveEntry (List.map (project_hint ~poly:atts.polymorphic n l2r) lc)) VERNAC COMMAND FUNCTIONAL EXTEND HintResolveIffLR CLASSIFIED AS SIDEFF [ "Hint" "Resolve" "->" ne_global_list(lc) natural_opt(n) ":" preident_list(bl) ] -> [ fun ~atts ~st -> begin - let open Vernacinterp in - add_hints_iff ?locality:atts.locality true lc n bl; + add_hints_iff ~atts true lc n bl; st end ] | [ "Hint" "Resolve" "->" ne_global_list(lc) natural_opt(n) ] -> [ fun ~atts ~st -> begin - let open Vernacinterp in - add_hints_iff ?locality:atts.locality true lc n ["core"]; + add_hints_iff ~atts true lc n ["core"]; st end ] @@ -346,15 +344,13 @@ VERNAC COMMAND FUNCTIONAL EXTEND HintResolveIffRL CLASSIFIED AS SIDEFF [ "Hint" "Resolve" "<-" ne_global_list(lc) natural_opt(n) ":" preident_list(bl) ] -> [ fun ~atts ~st -> begin - let open Vernacinterp in - add_hints_iff ?locality:atts.locality false lc n bl; + add_hints_iff ~atts false lc n bl; st end ] | [ "Hint" "Resolve" "<-" ne_global_list(lc) natural_opt(n) ] -> [ fun ~atts ~st -> begin - let open Vernacinterp in - add_hints_iff ?locality:atts.locality false lc n ["core"]; + add_hints_iff ~atts false lc n ["core"]; st end ] @@ -430,34 +426,46 @@ let seff id = Vernacexpr.VtSideff [id], Vernacexpr.VtLater | [ "Type" ] -> [ InType ] END*) -VERNAC COMMAND EXTEND DeriveInversionClear +VERNAC COMMAND FUNCTIONAL EXTEND DeriveInversionClear | [ "Derive" "Inversion_clear" ident(na) "with" constr(c) "Sort" sort_family(s) ] => [ seff na ] - -> [ add_inversion_lemma_exn na c s false inv_clear_tac ] + -> [ fun ~atts ~st -> + let open Vernacinterp in + add_inversion_lemma_exn ~poly:atts.polymorphic na c s false inv_clear_tac; st ] | [ "Derive" "Inversion_clear" ident(na) "with" constr(c) ] => [ seff na ] - -> [ add_inversion_lemma_exn na c Sorts.InProp false inv_clear_tac ] + -> [ fun ~atts ~st -> + let open Vernacinterp in + add_inversion_lemma_exn ~poly:atts.polymorphic na c Sorts.InProp false inv_clear_tac; st ] END -VERNAC COMMAND EXTEND DeriveInversion +VERNAC COMMAND FUNCTIONAL EXTEND DeriveInversion | [ "Derive" "Inversion" ident(na) "with" constr(c) "Sort" sort_family(s) ] => [ seff na ] - -> [ add_inversion_lemma_exn na c s false inv_tac ] + -> [ fun ~atts ~st -> + let open Vernacinterp in + add_inversion_lemma_exn ~poly:atts.polymorphic na c s false inv_tac; st ] | [ "Derive" "Inversion" ident(na) "with" constr(c) ] => [ seff na ] - -> [ add_inversion_lemma_exn na c Sorts.InProp false inv_tac ] + -> [ fun ~atts ~st -> + let open Vernacinterp in + add_inversion_lemma_exn ~poly:atts.polymorphic na c Sorts.InProp false inv_tac; st ] END -VERNAC COMMAND EXTEND DeriveDependentInversion +VERNAC COMMAND FUNCTIONAL EXTEND DeriveDependentInversion | [ "Derive" "Dependent" "Inversion" ident(na) "with" constr(c) "Sort" sort_family(s) ] => [ seff na ] - -> [ add_inversion_lemma_exn na c s true dinv_tac ] + -> [ fun ~atts ~st -> + let open Vernacinterp in + add_inversion_lemma_exn ~poly:atts.polymorphic na c s true dinv_tac; st ] END -VERNAC COMMAND EXTEND DeriveDependentInversionClear +VERNAC COMMAND FUNCTIONAL EXTEND DeriveDependentInversionClear | [ "Derive" "Dependent" "Inversion_clear" ident(na) "with" constr(c) "Sort" sort_family(s) ] => [ seff na ] - -> [ add_inversion_lemma_exn na c s true dinv_clear_tac ] + -> [ fun ~atts ~st -> + let open Vernacinterp in + add_inversion_lemma_exn ~poly:atts.polymorphic na c s true dinv_clear_tac; st ] END (**********************************************************************) diff --git a/plugins/ltac/rewrite.ml b/plugins/ltac/rewrite.ml index a698b05dd7..3cbb110010 100644 --- a/plugins/ltac/rewrite.ml +++ b/plugins/ltac/rewrite.ml @@ -1981,8 +1981,7 @@ let add_morphism_infer glob m n = Decl_kinds.IsAssumption Decl_kinds.Logical) in add_instance (Typeclasses.new_instance - (Lazy.force PropGlobal.proper_class) Hints.empty_hint_info glob - poly (ConstRef cst)); + (Lazy.force PropGlobal.proper_class) Hints.empty_hint_info glob (ConstRef cst)); declare_projection n instance_id (ConstRef cst) else let kind = Decl_kinds.Global, poly, @@ -1993,7 +1992,7 @@ let add_morphism_infer glob m n = | Globnames.ConstRef cst -> add_instance (Typeclasses.new_instance (Lazy.force PropGlobal.proper_class) Hints.empty_hint_info - glob poly (ConstRef cst)); + glob (ConstRef cst)); declare_projection n instance_id (ConstRef cst) | _ -> assert false in diff --git a/plugins/ltac/taccoerce.ml b/plugins/ltac/taccoerce.ml index 9ae112d371..e5933de2a6 100644 --- a/plugins/ltac/taccoerce.ml +++ b/plugins/ltac/taccoerce.ml @@ -61,12 +61,9 @@ struct type t = Val.t -let normalize v = v - let of_constr c = in_gen (topwit wit_constr) c let to_constr v = - let v = normalize v in if has_type v (topwit wit_constr) then let c = out_gen (topwit wit_constr) v in Some c @@ -78,7 +75,6 @@ let to_constr v = let of_uconstr c = in_gen (topwit wit_uconstr) c let to_uconstr v = - let v = normalize v in if has_type v (topwit wit_uconstr) then Some (out_gen (topwit wit_uconstr) v) else None @@ -86,7 +82,6 @@ let to_uconstr v = let of_int i = in_gen (topwit wit_int) i let to_int v = - let v = normalize v in if has_type v (topwit wit_int) then Some (out_gen (topwit wit_int) v) else None @@ -108,14 +103,12 @@ let constr_of_id env id = (* Gives the constr corresponding to a Constr_context tactic_arg *) let coerce_to_constr_context v = - let v = Value.normalize v in if has_type v (topwit wit_constr_context) then out_gen (topwit wit_constr_context) v else raise (CannotCoerceTo "a term context") (* Interprets an identifier which must be fresh *) let coerce_var_to_ident fresh env sigma v = - let v = Value.normalize v in let fail () = raise (CannotCoerceTo "a fresh identifier") in if has_type v (topwit wit_intro_pattern) then match out_gen (topwit wit_intro_pattern) v with @@ -140,7 +133,6 @@ let g = sigma in let id_of_name = function | Name.Anonymous -> Id.of_string "x" | Name.Name x -> x in - let v = Value.normalize v in let fail () = raise (CannotCoerceTo "an identifier") in if has_type v (topwit wit_intro_pattern) then match out_gen (topwit wit_intro_pattern) v with @@ -179,7 +171,6 @@ let id_of_name = function let coerce_to_intro_pattern env sigma v = - let v = Value.normalize v in if has_type v (topwit wit_intro_pattern) then snd (out_gen (topwit wit_intro_pattern) v) else if has_type v (topwit wit_var) then @@ -198,7 +189,6 @@ let coerce_to_intro_pattern_naming env sigma v = | _ -> raise (CannotCoerceTo "a naming introduction pattern") let coerce_to_hint_base v = - let v = Value.normalize v in if has_type v (topwit wit_intro_pattern) then match out_gen (topwit wit_intro_pattern) v with | _, IntroNaming (IntroIdentifier id) -> Id.to_string id @@ -206,13 +196,11 @@ let coerce_to_hint_base v = else raise (CannotCoerceTo "a hint base name") let coerce_to_int v = - let v = Value.normalize v in if has_type v (topwit wit_int) then out_gen (topwit wit_int) v else raise (CannotCoerceTo "an integer") let coerce_to_constr env v = - let v = Value.normalize v in let fail () = raise (CannotCoerceTo "a term") in if has_type v (topwit wit_intro_pattern) then match out_gen (topwit wit_intro_pattern) v with @@ -230,7 +218,6 @@ let coerce_to_constr env v = else fail () let coerce_to_uconstr env v = - let v = Value.normalize v in if has_type v (topwit wit_uconstr) then out_gen (topwit wit_uconstr) v else @@ -243,7 +230,6 @@ let coerce_to_closed_constr env v = let coerce_to_evaluable_ref env sigma v = let fail () = raise (CannotCoerceTo "an evaluable reference") in - let v = Value.normalize v in let ev = if has_type v (topwit wit_intro_pattern) then match out_gen (topwit wit_intro_pattern) v with @@ -284,7 +270,6 @@ let coerce_to_intro_pattern_list ?loc env sigma v = let coerce_to_hyp env sigma v = let fail () = raise (CannotCoerceTo "a variable") in - let v = Value.normalize v in if has_type v (topwit wit_intro_pattern) then match out_gen (topwit wit_intro_pattern) v with | _, IntroNaming (IntroIdentifier id) when is_variable env id -> id @@ -306,7 +291,6 @@ let coerce_to_hyp_list env sigma v = (* Interprets a qualified name *) let coerce_to_reference env sigma v = - let v = Value.normalize v in match Value.to_constr v with | Some c -> begin @@ -318,7 +302,6 @@ let coerce_to_reference env sigma v = (* Quantified named or numbered hypothesis or hypothesis in context *) (* (as in Inversion) *) let coerce_to_quantified_hypothesis sigma v = - let v = Value.normalize v in if has_type v (topwit wit_intro_pattern) then let v = out_gen (topwit wit_intro_pattern) v in match v with @@ -336,7 +319,6 @@ let coerce_to_quantified_hypothesis sigma v = (* Quantified named or numbered hypothesis or hypothesis in context *) (* (as in Inversion) *) let coerce_to_decl_or_quant_hyp env sigma v = - let v = Value.normalize v in if has_type v (topwit wit_int) then AnonHyp (out_gen (topwit wit_int) v) else diff --git a/plugins/ltac/taccoerce.mli b/plugins/ltac/taccoerce.mli index d7b253a687..dce16b7333 100644 --- a/plugins/ltac/taccoerce.mli +++ b/plugins/ltac/taccoerce.mli @@ -31,9 +31,6 @@ module Value : sig type t = Val.t - val normalize : t -> t - (** Eliminated the leading dynamic type casts. *) - val of_constr : constr -> t val to_constr : t -> constr option val of_uconstr : Ltac_pretype.closed_glob_constr -> t diff --git a/plugins/ltac/tacinterp.ml b/plugins/ltac/tacinterp.ml index ccded44179..f2720954d0 100644 --- a/plugins/ltac/tacinterp.ml +++ b/plugins/ltac/tacinterp.ml @@ -136,7 +136,6 @@ let to_tacvalue v = out_gen (topwit wit_tacvalue) v (** More naming applications *) let name_vfun appl vle = - let vle = Value.normalize vle in if has_type vle (topwit wit_tacvalue) then match to_tacvalue vle with | VFun (appl0,trace,lfun,vars,t) -> of_tacvalue (VFun (combine_appl appl0 appl,trace,lfun,vars,t)) @@ -235,7 +234,6 @@ let curr_debug ist = match TacStore.get ist.extra f_debug with (* Displays a value *) let pr_value env v = - let v = Value.normalize v in let pr_with_env pr = match env with | Some (env,sigma) -> pr env sigma @@ -285,7 +283,6 @@ let push_trace call ist = match TacStore.get ist.extra f_trace with | Some trace -> Proofview.tclUNIT (call :: trace) let propagate_trace ist loc id v = - let v = Value.normalize v in if has_type v (topwit wit_tacvalue) then let tacv = to_tacvalue v in match tacv with @@ -298,7 +295,6 @@ let propagate_trace ist loc id v = else Proofview.tclUNIT v let append_trace trace v = - let v = Value.normalize v in if has_type v (topwit wit_tacvalue) then match to_tacvalue v with | VFun (appl,trace',lfun,it,b) -> of_tacvalue (VFun (appl,trace'@trace,lfun,it,b)) @@ -307,11 +303,9 @@ let append_trace trace v = (* Dynamically check that an argument is a tactic *) let coerce_to_tactic loc id v = - let v = Value.normalize v in let fail () = user_err ?loc (str "Variable " ++ Id.print id ++ str " should be bound to a tactic.") in - let v = Value.normalize v in if has_type v (topwit wit_tacvalue) then let tacv = to_tacvalue v in match tacv with @@ -514,7 +508,6 @@ let rec intropattern_ids accu (loc,pat) = match pat with let extract_ids ids lfun accu = let fold id v accu = - let v = Value.normalize v in if has_type v (topwit wit_intro_pattern) then let (_, ipat) = out_gen (topwit wit_intro_pattern) v in if Id.List.mem id ids then accu @@ -816,7 +809,6 @@ let interp_constr_may_eval ist env sigma c = (** TODO: should use dedicated printers *) let message_of_value v = - let v = Value.normalize v in let pr_with_env pr = Ftactic.enter begin fun gl -> Ftactic.return (pr (pf_env gl) (project gl)) end in let open Genprint in @@ -986,7 +978,6 @@ let interp_destruction_arg ist gl arg = try (** FIXME: should be moved to taccoerce *) let v = Id.Map.find id ist.lfun in - let v = Value.normalize v in if has_type v (topwit wit_intro_pattern) then let v = out_gen (topwit wit_intro_pattern) v in match v with @@ -1248,7 +1239,6 @@ and eval_tactic ist tac : unit Proofview.tactic = match tac with Ftactic.run args tac and force_vrec ist v : Val.t Ftactic.t = - let v = Value.normalize v in if has_type v (topwit wit_tacvalue) then let v = to_tacvalue v in match v with @@ -1324,7 +1314,6 @@ and interp_tacarg ist arg : Val.t Ftactic.t = and interp_app loc ist fv largs : Val.t Ftactic.t = let (>>=) = Ftactic.bind in let fail = Tacticals.New.tclZEROMSG (str "Illegal tactic application.") in - let fv = Value.normalize fv in if has_type fv (topwit wit_tacvalue) then match to_tacvalue fv with (* if var=[] and body has been delayed by val_interp, then body @@ -1377,7 +1366,6 @@ and interp_app loc ist fv largs : Val.t Ftactic.t = (* Gives the tactic corresponding to the tactic value *) and tactic_of_value ist vle = - let vle = Value.normalize vle in if has_type vle (topwit wit_tacvalue) then match to_tacvalue vle with | VFun (appl,trace,lfun,[],t) -> @@ -1604,7 +1592,6 @@ and interp_ltac_constr ist e : EConstr.t Ftactic.t = Ftactic.enter begin fun gl -> let env = Proofview.Goal.env gl in let sigma = project gl in - let result = Value.normalize result in try let cresult = coerce_to_closed_constr env result in Proofview.tclLIFT begin diff --git a/pretyping/evarconv.ml b/pretyping/evarconv.ml index f7a3789a21..788e4d268a 100644 --- a/pretyping/evarconv.ml +++ b/pretyping/evarconv.ml @@ -1044,7 +1044,7 @@ and conv_record trs env evd (ctx,(h,h2),c,bs,(params,params1),(us,us2),(sk1,sk2) and eta_constructor ts env evd sk1 ((ind, i), u) sk2 term2 = let mib = lookup_mind (fst ind) env in match mib.Declarations.mind_record with - | Some (Some (id, projs, pbs)) when mib.Declarations.mind_finite == Decl_kinds.BiFinite -> + | Some (Some (id, projs, pbs)) when mib.Declarations.mind_finite == Declarations.BiFinite -> let pars = mib.Declarations.mind_nparams in (try let l1' = Stack.tail pars sk1 in diff --git a/pretyping/inductiveops.ml b/pretyping/inductiveops.ml index 34df7d3d72..78e6bc6f14 100644 --- a/pretyping/inductiveops.ml +++ b/pretyping/inductiveops.ml @@ -275,7 +275,7 @@ let projection_nparams p = projection_nparams_env (Global.env ()) p let has_dependent_elim mib = match mib.mind_record with - | Some (Some _) -> mib.mind_finite == Decl_kinds.BiFinite + | Some (Some _) -> mib.mind_finite == BiFinite | _ -> true (* Annotation for cases *) @@ -486,7 +486,7 @@ let find_inductive env sigma c = let (t, l) = decompose_app sigma (whd_all env sigma c) in match EConstr.kind sigma t with | Ind ind - when (fst (Inductive.lookup_mind_specif env (fst ind))).mind_finite <> Decl_kinds.CoFinite -> + when (fst (Inductive.lookup_mind_specif env (fst ind))).mind_finite <> CoFinite -> let l = List.map EConstr.Unsafe.to_constr l in (ind, l) | _ -> raise Not_found @@ -496,7 +496,7 @@ let find_coinductive env sigma c = let (t, l) = decompose_app sigma (whd_all env sigma c) in match EConstr.kind sigma t with | Ind ind - when (fst (Inductive.lookup_mind_specif env (fst ind))).mind_finite == Decl_kinds.CoFinite -> + when (fst (Inductive.lookup_mind_specif env (fst ind))).mind_finite == CoFinite -> let l = List.map EConstr.Unsafe.to_constr l in (ind, l) | _ -> raise Not_found diff --git a/pretyping/typeclasses.ml b/pretyping/typeclasses.ml index bbb3a1bb2b..f153b63410 100644 --- a/pretyping/typeclasses.ml +++ b/pretyping/typeclasses.ml @@ -65,7 +65,7 @@ type typeclass = { cl_impl : global_reference; (* Context in which the definitions are typed. Includes both typeclass parameters and superclasses. *) - cl_context : (global_reference * bool) option list * Context.Rel.t; + cl_context : global_reference option list * Context.Rel.t; (* Context of definitions and properties on defs, will not be shared *) cl_props : Context.Rel.t; @@ -87,7 +87,6 @@ type instance = { (* Sections where the instance should be redeclared, None for discard, Some 0 for none. *) is_global: int option; - is_poly: bool; is_impl: global_reference; } @@ -97,7 +96,7 @@ let instance_impl is = is.is_impl let hint_priority is = is.is_info.Vernacexpr.hint_priority -let new_instance cl info glob poly impl = +let new_instance cl info glob impl = let global = if glob then Some (Lib.sections_depth ()) else None @@ -107,7 +106,6 @@ let new_instance cl info glob poly impl = { is_class = cl.cl_impl; is_info = info ; is_global = global ; - is_poly = poly; is_impl = impl } (* @@ -175,7 +173,7 @@ let subst_class (subst,cl) = and do_subst_gr gr = fst (subst_global subst gr) in let do_subst_ctx = List.smartmap (RelDecl.map_constr do_subst) in let do_subst_context (grs,ctx) = - List.smartmap (Option.smartmap (fun (gr,b) -> do_subst_gr gr, b)) grs, + List.smartmap (Option.smartmap do_subst_gr) grs, do_subst_ctx ctx in let do_subst_projs projs = List.smartmap (fun (x, y, z) -> (x, y, Option.smartmap do_subst_con z)) projs in @@ -213,10 +211,10 @@ let discharge_class (_,cl) = let newgrs = List.map (fun decl -> match decl |> RelDecl.get_type |> EConstr.of_constr |> class_of_constr Evd.empty with | None -> None - | Some (_, ((tc,_), _)) -> Some (tc.cl_impl, true)) + | Some (_, ((tc,_), _)) -> Some tc.cl_impl) ctx' in - List.smartmap (Option.smartmap (fun (gr, b) -> Lib.discharge_global gr, b)) grs + List.smartmap (Option.smartmap Lib.discharge_global) grs @ newgrs in grs', discharge_rel_context subst 1 ctx @ ctx' in let cl_impl' = Lib.discharge_global cl.cl_impl in @@ -420,7 +418,7 @@ let declare_instance info local glob = match class_of_constr Evd.empty (EConstr.of_constr ty) with | Some (rels, ((tc,_), args) as _cl) -> assert (not (isVarRef glob) || local); - add_instance (new_instance tc info (not local) (Flags.use_polymorphic_flag ()) glob) + add_instance (new_instance tc info (not local) glob) | None -> () let add_class cl = diff --git a/pretyping/typeclasses.mli b/pretyping/typeclasses.mli index 8ee061330a..ee28ec173b 100644 --- a/pretyping/typeclasses.mli +++ b/pretyping/typeclasses.mli @@ -25,9 +25,8 @@ type typeclass = { cl_impl : global_reference; (** Context in which the definitions are typed. Includes both typeclass parameters and superclasses. - The boolean indicates if the typeclass argument is a direct superclass and the global reference - gives a direct link to the class itself. *) - cl_context : (global_reference * bool) option list * Context.Rel.t; + The global reference gives a direct link to the class itself. *) + cl_context : global_reference option list * Context.Rel.t; (** Context of definitions and properties on defs, will not be shared *) cl_props : Context.Rel.t; @@ -54,7 +53,7 @@ val all_instances : unit -> instance list val add_class : typeclass -> unit -val new_instance : typeclass -> Vernacexpr.hint_info_expr -> bool -> Decl_kinds.polymorphic -> +val new_instance : typeclass -> Vernacexpr.hint_info_expr -> bool -> global_reference -> instance val add_instance : instance -> unit val remove_instance : instance -> unit diff --git a/pretyping/unification.ml b/pretyping/unification.ml index 30674fee27..b41fb4e4dd 100644 --- a/pretyping/unification.ml +++ b/pretyping/unification.ml @@ -666,7 +666,7 @@ let is_eta_constructor_app env sigma ts f l1 term = | Construct (((_, i as ind), j), u) when i == 0 && j == 1 -> let mib = lookup_mind (fst ind) env in (match mib.Declarations.mind_record with - | Some (Some (_,exp,projs)) when mib.Declarations.mind_finite == Decl_kinds.BiFinite && + | Some (Some (_,exp,projs)) when mib.Declarations.mind_finite == Declarations.BiFinite && Array.length projs == Array.length l1 - mib.Declarations.mind_nparams -> (** Check that the other term is neutral *) is_neutral env sigma ts term diff --git a/printing/ppvernac.ml b/printing/ppvernac.ml index 418d4a0b8f..e88284fb1c 100644 --- a/printing/ppvernac.ml +++ b/printing/ppvernac.ml @@ -1223,7 +1223,7 @@ open Decl_kinds let return = tag_vernac v in match v with | VernacExpr v' -> pr_vernac_expr v' ++ sep_end v' - | VernacTime (_,v) -> + | VernacTime (_,(_,v)) -> return (keyword "Time" ++ spc() ++ pr_vernac_control v) | VernacRedirect (s, (_,v)) -> return (keyword "Redirect" ++ spc() ++ qs s ++ spc() ++ pr_vernac_control v) diff --git a/printing/prettyp.ml b/printing/prettyp.ml index 647111bbe1..2b7886d115 100644 --- a/printing/prettyp.ml +++ b/printing/prettyp.ml @@ -235,8 +235,8 @@ let print_type_in_type ref = let print_primitive_record recflag mipv = function | Some (Some (_, ps,_)) -> let eta = match recflag with - | Decl_kinds.CoFinite | Decl_kinds.Finite -> str" without eta conversion" - | Decl_kinds.BiFinite -> str " with eta conversion" + | CoFinite | Finite -> str" without eta conversion" + | BiFinite -> str " with eta conversion" in [Id.print mipv.(0).mind_typename ++ str" has primitive projections" ++ eta ++ str"."] | _ -> [] diff --git a/printing/printmod.ml b/printing/printmod.ml index 05292b06ba..fb9d45a793 100644 --- a/printing/printmod.ml +++ b/printing/printmod.ml @@ -125,7 +125,7 @@ let print_mutual_inductive env mind mib udecl = let inds = List.init (Array.length mib.mind_packets) (fun x -> (mind, x)) in let keyword = - let open Decl_kinds in + let open Declarations in match mib.mind_finite with | Finite -> "Inductive" | BiFinite -> "Variant" @@ -184,7 +184,7 @@ let print_record env mind mib udecl = (Array.to_list (Univ.Instance.to_array u)) udecl in let sigma = Evd.from_ctx (Evd.evar_universe_context_of_binders bl) in let keyword = - let open Decl_kinds in + let open Declarations in match mib.mind_finite with | BiFinite -> "Record" | Finite -> "Inductive" @@ -346,7 +346,7 @@ let print_body is_impl env mp (l,body) = pr_mutual_inductive_body env (MutInd.make2 mp l) mib None with e when CErrors.noncritical e -> let keyword = - let open Decl_kinds in + let open Declarations in match mib.mind_finite with | Finite -> def "Inductive" | BiFinite -> def "Variant" diff --git a/stm/stm.ml b/stm/stm.ml index afb6fabcb1..7045df0ed2 100644 --- a/stm/stm.ml +++ b/stm/stm.ml @@ -1935,15 +1935,16 @@ end = struct (* {{{ *) let vernac_interp ~solve ~abstract ~cancel_switch nworkers safe_id id { indentation; verbose; loc; expr = e; strlen } = - let e, time, fail = - let rec find ~time ~fail = function - | VernacTime (_,e) -> find ~time:true ~fail e - | VernacRedirect (_,(_,e)) -> find ~time ~fail e - | VernacFail e -> find ~time ~fail:true e - | e -> e, time, fail in find ~time:false ~fail:false e in + let e, time, batch, fail = + let rec find ~time ~batch ~fail = function + | VernacTime (batch,(_,e)) -> find ~time:true ~batch ~fail e + | VernacRedirect (_,(_,e)) -> find ~time ~batch ~fail e + | VernacFail e -> find ~time ~batch ~fail:true e + | e -> e, time, batch, fail in + find ~time:false ~batch:false ~fail:false e in let st = Vernacstate.freeze_interp_state `No in Vernacentries.with_fail st fail (fun () -> - (if time then System.with_time !Flags.time else (fun x -> x)) (fun () -> + (if time then System.with_time ~batch else (fun x -> x)) (fun () -> ignore(TaskQueue.with_n_workers nworkers (fun queue -> Proof_global.with_current_proof (fun _ p -> let goals, _, _, _, _ = Proof.proof p in diff --git a/stm/vernac_classifier.ml b/stm/vernac_classifier.ml index 1291b76426..2fa47ba434 100644 --- a/stm/vernac_classifier.ml +++ b/stm/vernac_classifier.ml @@ -195,7 +195,7 @@ let classify_vernac e = let rec static_control_classifier ~poly = function | VernacExpr e -> static_classifier ~poly e | VernacTimeout (_,e) -> static_control_classifier ~poly e - | VernacTime (_,e) | VernacRedirect (_, (_,e)) -> + | VernacTime (_,(_,e)) | VernacRedirect (_, (_,e)) -> static_control_classifier ~poly e | VernacFail e -> (* Fail Qed or Fail Lemma must not join/fork the DAG *) (match static_control_classifier ~poly e with diff --git a/tactics/hipattern.ml b/tactics/hipattern.ml index 2c8ca19722..a3a3e0a9e9 100644 --- a/tactics/hipattern.ml +++ b/tactics/hipattern.ml @@ -48,7 +48,7 @@ let match_with_non_recursive_type sigma t = let (hdapp,args) = decompose_app sigma t in (match EConstr.kind sigma hdapp with | Ind (ind,u) -> - if (Global.lookup_mind (fst ind)).mind_finite == Decl_kinds.CoFinite then + if (Global.lookup_mind (fst ind)).mind_finite == CoFinite then Some (hdapp,args) else None diff --git a/tactics/leminv.ml b/tactics/leminv.ml index 01065868d4..197b3030d9 100644 --- a/tactics/leminv.ml +++ b/tactics/leminv.ml @@ -234,10 +234,9 @@ let inversion_scheme env sigma t sort dep_option inv_op = let p = Evarutil.nf_evars_universes sigma invProof in p, sigma -let add_inversion_lemma name env sigma t sort dep inv_op = +let add_inversion_lemma ~poly name env sigma t sort dep inv_op = let invProof, sigma = inversion_scheme env sigma t sort dep inv_op in let univs = - let poly = Flags.use_polymorphic_flag () in Evd.const_univ_entry ~poly sigma in let entry = definition_entry ~univs invProof in @@ -247,13 +246,13 @@ let add_inversion_lemma name env sigma t sort dep inv_op = (* inv_op = Inv (derives de complete inv. lemma) * inv_op = InvNoThining (derives de semi inversion lemma) *) -let add_inversion_lemma_exn na com comsort bool tac = +let add_inversion_lemma_exn ~poly na com comsort bool tac = let env = Global.env () in let sigma = Evd.from_env env in let sigma, c = Constrintern.interp_type_evars env sigma com in let sigma, sort = Evd.fresh_sort_in_family ~rigid:univ_rigid env sigma comsort in try - add_inversion_lemma na env sigma c sort bool tac + add_inversion_lemma ~poly na env sigma c sort bool tac with | UserError (Some "Case analysis",s) -> (* Reference to Indrec *) user_err ~hdr:"Inv needs Nodep Prop Set" s diff --git a/tactics/leminv.mli b/tactics/leminv.mli index 8745ad3979..f221b1fd9a 100644 --- a/tactics/leminv.mli +++ b/tactics/leminv.mli @@ -14,6 +14,6 @@ open Misctypes val lemInv_clause : quantified_hypothesis -> constr -> Id.t list -> unit Proofview.tactic -val add_inversion_lemma_exn : +val add_inversion_lemma_exn : poly:bool -> Id.t -> constr_expr -> Sorts.family -> bool -> (Id.t -> unit Proofview.tactic) -> unit diff --git a/tactics/tacticals.mli b/tactics/tacticals.mli index 169ac5c90d..55c519e24d 100644 --- a/tactics/tacticals.mli +++ b/tactics/tacticals.mli @@ -23,7 +23,7 @@ val tclORELSE0 : tactic -> tactic -> tactic val tclORELSE : tactic -> tactic -> tactic val tclTHEN : tactic -> tactic -> tactic val tclTHENSEQ : tactic list -> tactic -[@@ocaml.deprecated "alias of API.Tacticals.tclTHENLIST"] +[@@ocaml.deprecated "alias of Tacticals.tclTHENLIST"] val tclTHENLIST : tactic list -> tactic val tclTHEN_i : tactic -> (int -> tactic) -> tactic val tclTHENFIRST : tactic -> tactic -> tactic diff --git a/tactics/tactics.ml b/tactics/tactics.ml index 508040ec18..4ee0a8a7b2 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -1492,7 +1492,7 @@ let simplest_ecase c = general_case_analysis true None (c,NoBindings) exception IsNonrec -let is_nonrec mind = (Global.lookup_mind (fst mind)).mind_finite == Decl_kinds.BiFinite +let is_nonrec mind = (Global.lookup_mind (fst mind)).mind_finite == Declarations.BiFinite let find_ind_eliminator ind s gl = let gr = lookup_eliminator ind s in diff --git a/test-suite/coq-makefile/plugin-reach-outside-API-and-fail/run.sh b/test-suite/coq-makefile/plugin-reach-outside-API-and-fail/run.sh deleted file mode 100755 index e48f704a2d..0000000000 --- a/test-suite/coq-makefile/plugin-reach-outside-API-and-fail/run.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cat > _CoqProject <<EOT --I src/ - -./src/test_plugin.mllib -./src/test.ml4 -./src/test.mli -EOT - -mkdir -p src - -cat > src/test_plugin.mllib <<EOT -Test -EOT - -touch src/test.mli - -cat > src/test.ml4 <<EOT -DECLARE PLUGIN "test" - -let _ = Pre_env.empty_env -EOT - -${COQBIN}coq_makefile -f _CoqProject -o Makefile -cat Makefile.conf - -if make VERBOSE=1; then - # make command should have failed (but didn't) - exit 1 -else - # make command should have failed (and it indeed did) - exit 0 -fi diff --git a/test-suite/coq-makefile/plugin-reach-outside-API-and-succeed-by-bypassing-the-API/run.sh b/test-suite/coq-makefile/plugin-reach-outside-API-and-succeed-by-bypassing-the-API/run.sh deleted file mode 100755 index 4a8f58655a..0000000000 --- a/test-suite/coq-makefile/plugin-reach-outside-API-and-succeed-by-bypassing-the-API/run.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cat > _CoqProject <<EOT --bypass-API --I src/ - -./src/test_plugin.mllib -./src/test.ml4 -./src/test.mli -EOT - -mkdir -p src - -cat > src/test_plugin.mllib <<EOT -Test -EOT - -touch src/test.mli - -cat > src/test.ml4 <<EOT -DECLARE PLUGIN "test" - -let _ = Pre_env.empty_env -EOT - -${COQBIN}coq_makefile -f _CoqProject -o Makefile -cat Makefile.conf - -make VERBOSE=1 diff --git a/test-suite/coq-makefile/template/src/test.ml4 b/test-suite/coq-makefile/template/src/test.ml4 index e7d0bfe1f8..72765abe04 100644 --- a/test-suite/coq-makefile/template/src/test.ml4 +++ b/test-suite/coq-makefile/template/src/test.ml4 @@ -1,4 +1,3 @@ -open API open Ltac_plugin DECLARE PLUGIN "test_plugin" let () = Mltop.add_known_plugin (fun () -> ()) "test_plugin";; diff --git a/test-suite/coq-makefile/template/src/test_aux.ml b/test-suite/coq-makefile/template/src/test_aux.ml index e134abd840..a01d0865a8 100644 --- a/test-suite/coq-makefile/template/src/test_aux.ml +++ b/test-suite/coq-makefile/template/src/test_aux.ml @@ -1 +1 @@ -let tac = API.Proofview.tclUNIT () +let tac = Proofview.tclUNIT () diff --git a/test-suite/coq-makefile/template/src/test_aux.mli b/test-suite/coq-makefile/template/src/test_aux.mli index 2e7ad1529f..10020f27de 100644 --- a/test-suite/coq-makefile/template/src/test_aux.mli +++ b/test-suite/coq-makefile/template/src/test_aux.mli @@ -1 +1 @@ -val tac : unit API.Proofview.tactic +val tac : unit Proofview.tactic diff --git a/theories/Arith/Between.v b/theories/Arith/Between.v index 9b40710858..ead08b3ebb 100644 --- a/theories/Arith/Between.v +++ b/theories/Arith/Between.v @@ -16,6 +16,8 @@ Implicit Types k l p q r : nat. Section Between. Variables P Q : nat -> Prop. + (** The [between] type expresses the concept + [forall i: nat, k <= i < l -> P i.]. *) Inductive between k : nat -> Prop := | bet_emp : between k k | bet_S : forall l, between k l -> P l -> between k (S l). @@ -47,6 +49,8 @@ Section Between. induction 1; auto with arith. Qed. + (** The [exists_between] type expresses the concept + [exists i: nat, k <= i < l /\ Q i]. *) Inductive exists_between k : nat -> Prop := | exists_S : forall l, exists_between k l -> exists_between k (S l) | exists_le : forall l, k <= l -> Q l -> exists_between k (S l). diff --git a/theories/FSets/FSetCompat.v b/theories/FSets/FSetCompat.v index b1769da3d8..31bc1cc31d 100644 --- a/theories/FSets/FSetCompat.v +++ b/theories/FSets/FSetCompat.v @@ -165,13 +165,13 @@ End Backport_WSets. (** * From new Sets to new ones *) Module Backport_Sets - (E:OrderedType.OrderedType) - (M:MSetInterface.Sets with Definition E.t := E.t - with Definition E.eq := E.eq - with Definition E.lt := E.lt) - <: FSetInterface.S with Module E:=E. + (O:OrderedType.OrderedType) + (M:MSetInterface.Sets with Definition E.t := O.t + with Definition E.eq := O.eq + with Definition E.lt := O.lt) + <: FSetInterface.S with Module E:=O. - Include Backport_WSets E M. + Include Backport_WSets O M. Implicit Type s : t. Implicit Type x y : elt. @@ -182,21 +182,21 @@ Module Backport_Sets Definition min_elt_1 : forall s x, min_elt s = Some x -> In x s := M.min_elt_spec1. Definition min_elt_2 : forall s x y, - min_elt s = Some x -> In y s -> ~ E.lt y x + min_elt s = Some x -> In y s -> ~ O.lt y x := M.min_elt_spec2. Definition min_elt_3 : forall s, min_elt s = None -> Empty s := M.min_elt_spec3. Definition max_elt_1 : forall s x, max_elt s = Some x -> In x s := M.max_elt_spec1. Definition max_elt_2 : forall s x y, - max_elt s = Some x -> In y s -> ~ E.lt x y + max_elt s = Some x -> In y s -> ~ O.lt x y := M.max_elt_spec2. Definition max_elt_3 : forall s, max_elt s = None -> Empty s := M.max_elt_spec3. - Definition elements_3 : forall s, sort E.lt (elements s) + Definition elements_3 : forall s, sort O.lt (elements s) := M.elements_spec2. Definition choose_3 : forall s s' x y, - choose s = Some x -> choose s' = Some y -> Equal s s' -> E.eq x y + choose s = Some x -> choose s' = Some y -> Equal s s' -> O.eq x y := M.choose_spec3. Definition lt_trans : forall s s' s'', lt s s' -> lt s' s'' -> lt s s'' := @StrictOrder_Transitive _ _ M.lt_strorder. @@ -211,7 +211,7 @@ Module Backport_Sets [ apply EQ | apply LT | apply GT ]; auto. Defined. - Module E := E. + Module E := O. End Backport_Sets. @@ -342,13 +342,13 @@ End Update_WSets. (** * From old Sets to new ones. *) Module Update_Sets - (E:Orders.OrderedType) - (M:FSetInterface.S with Definition E.t := E.t - with Definition E.eq := E.eq - with Definition E.lt := E.lt) - <: MSetInterface.Sets with Module E:=E. + (O:Orders.OrderedType) + (M:FSetInterface.S with Definition E.t := O.t + with Definition E.eq := O.eq + with Definition E.lt := O.lt) + <: MSetInterface.Sets with Module E:=O. - Include Update_WSets E M. + Include Update_WSets O M. Implicit Type s : t. Implicit Type x y : elt. @@ -359,21 +359,21 @@ Module Update_Sets Definition min_elt_spec1 : forall s x, min_elt s = Some x -> In x s := M.min_elt_1. Definition min_elt_spec2 : forall s x y, - min_elt s = Some x -> In y s -> ~ E.lt y x + min_elt s = Some x -> In y s -> ~ O.lt y x := M.min_elt_2. Definition min_elt_spec3 : forall s, min_elt s = None -> Empty s := M.min_elt_3. Definition max_elt_spec1 : forall s x, max_elt s = Some x -> In x s := M.max_elt_1. Definition max_elt_spec2 : forall s x y, - max_elt s = Some x -> In y s -> ~ E.lt x y + max_elt s = Some x -> In y s -> ~ O.lt x y := M.max_elt_2. Definition max_elt_spec3 : forall s, max_elt s = None -> Empty s := M.max_elt_3. - Definition elements_spec2 : forall s, sort E.lt (elements s) + Definition elements_spec2 : forall s, sort O.lt (elements s) := M.elements_3. Definition choose_spec3 : forall s s' x y, - choose s = Some x -> choose s' = Some y -> Equal s s' -> E.eq x y + choose s = Some x -> choose s' = Some y -> Equal s s' -> O.eq x y := M.choose_3. Instance lt_strorder : StrictOrder lt. @@ -407,6 +407,6 @@ Module Update_Sets Lemma compare_spec : forall s s', CompSpec eq lt s s' (compare s s'). Proof. intros; unfold compare; destruct M.compare; auto. Qed. - Module E := E. + Module E := O. End Update_Sets. diff --git a/tools/CoqMakefile.in b/tools/CoqMakefile.in index 33a2f8593e..de113df6a5 100644 --- a/tools/CoqMakefile.in +++ b/tools/CoqMakefile.in @@ -176,7 +176,7 @@ COQMAKEFILE_VERSION:=@COQ_VERSION@ COQSRCLIBS?= $(foreach d,$(COQ_SRC_SUBDIRS), -I "$(COQLIB)$(d)") -CAMLFLAGS+=$(OCAMLLIBS) $(COQSRCLIBS) -I $(CAMLP4LIB) $(OCAML_API_FLAGS) +CAMLFLAGS+=$(OCAMLLIBS) $(COQSRCLIBS) -I $(CAMLP4LIB) # ocamldoc fails with unknown argument otherwise CAMLDOCFLAGS=$(filter-out -annot, $(filter-out -bin-annot, $(CAMLFLAGS))) diff --git a/tools/coq_makefile.ml b/tools/coq_makefile.ml index 2feaaa04cd..091869407e 100644 --- a/tools/coq_makefile.ml +++ b/tools/coq_makefile.ml @@ -27,16 +27,8 @@ let rec print_prefix_list sep = function | x :: l -> print sep; print x; print_prefix_list sep l | [] -> () -let usage () = - output_string stderr "Usage summary:\ -\n\ -\ncoq_makefile .... [file.v] ... [file.ml[i4]?] ... [file.ml{lib,pack}]\ -\n ... [any] ... [-extra[-phony] result dependencies command]\ -\n ... [-I dir] ... [-R physicalpath logicalpath]\ -\n ... [-Q physicalpath logicalpath] ... [VARIABLE = value]\ -\n ... [-arg opt] ... [-opt|-byte] [-no-install] [-f file] [-o file]\ -\n [-h] [--help]\ -\n\ +let usage_common () = + output_string stderr "\ \n[file.v]: Coq file to be compiled\ \n[file.ml[i4]?]: Objective Caml file to be compiled\ \n[file.ml{lib,pack}]: ocamlbuild file that describes a Objective Caml\ @@ -65,10 +57,28 @@ let usage () = \n[-install opt]: where opt is \"user\" to force install into user directory,\ \n \"none\" to build a makefile with no install target or\ \n \"global\" to force install in $COQLIB directory\ +\n" + +let usage_coq_project () = + output_string stderr "Available arguments:"; + usage_common (); + exit 1 + +let usage_coq_makefile () = + output_string stderr "Usage summary:\ +\n\ +\ncoq_makefile .... [file.v] ... [file.ml[i4]?] ... [file.ml{lib,pack}]\ +\n ... [any] ... [-extra[-phony] result dependencies command]\ +\n ... [-I dir] ... [-R physicalpath logicalpath]\ +\n ... [-Q physicalpath logicalpath] ... [VARIABLE = value]\ +\n ... [-arg opt] ... [-opt|-byte] [-no-install] [-f file] [-o file]\ +\n [-h] [--help]\ +\n"; + usage_common (); + output_string stderr "\ \n[-f file]: take the contents of file as arguments\ -\n[-o file]: output should go in file file\ +\n[-o file]: output should go in file file (recommended)\ \n Output file outside the current directory is forbidden.\ -\n[-bypass-API]: when compiling plugins, bypass Coq API\ \n[-h]: print this usage summary\ \n[--help]: equivalent to [-h]\n"; exit 1 @@ -199,16 +209,10 @@ let windrive s = else s ;; -let generate_conf_coq_config oc args bypass_API = +let generate_conf_coq_config oc args = section oc "Coq configuration."; - let src_dirs = if bypass_API - then Coq_config.all_src_dirs - else Coq_config.api_dirs @ Coq_config.plugins_dirs in + let src_dirs = Coq_config.all_src_dirs in Envars.print_config ~prefix_var_name:"COQMF_" oc src_dirs; - if bypass_API then - Printf.fprintf oc "OCAML_API_FLAGS=\n" - else - Printf.fprintf oc "OCAML_API_FLAGS=-open API\n"; fprintf oc "COQMF_WINDRIVE=%s\n" (windrive Coq_config.coqlib) ;; @@ -267,7 +271,7 @@ let generate_conf oc project args = fprintf oc "# %s\n\n" (String.concat " " (List.map quote args)); generate_conf_files oc project; generate_conf_includes oc project; - generate_conf_coq_config oc args project.bypass_API; + generate_conf_coq_config oc args; generate_conf_defs oc project; generate_conf_doc oc project; generate_conf_extra_target oc project.extra_targets; @@ -380,8 +384,8 @@ let share_prefix s1 s2 = | _ -> false let _ = + let _fhandle = Feedback.(add_feeder (console_feedback_listener Format.err_formatter)) in let prog, args = - if Array.length Sys.argv = 1 then usage (); let args = Array.to_list Sys.argv in let prog = List.hd args in prog, List.tl args in @@ -392,7 +396,7 @@ let _ = let project = try cmdline_args_to_project ~curdir:Filename.current_dir_name args - with Parsing_error s -> prerr_endline s; usage () in + with Parsing_error s -> prerr_endline s; usage_coq_project () in if only_destination <> None then begin destination_of project (Option.get only_destination); diff --git a/toplevel/coqinit.ml b/toplevel/coqinit.ml index 3a195c1df0..176dfb3c93 100644 --- a/toplevel/coqinit.ml +++ b/toplevel/coqinit.ml @@ -27,12 +27,12 @@ let set_rcfile s = rcfile := s; rcfile_specified := true let load_rc = ref true let no_load_rc () = load_rc := false -let load_rcfile doc sid = +let load_rcfile ~time doc sid = if !load_rc then try if !rcfile_specified then if CUnix.file_readable_p !rcfile then - Vernac.load_vernac ~verbosely:false ~interactive:false ~check:true doc sid !rcfile + Vernac.load_vernac ~time ~verbosely:false ~interactive:false ~check:true doc sid !rcfile else raise (Sys_error ("Cannot read rcfile: "^ !rcfile)) else try @@ -43,7 +43,7 @@ let load_rcfile doc sid = Envars.home ~warn / "."^rcdefaultname^"."^Coq_config.version; Envars.home ~warn / "."^rcdefaultname ] in - Vernac.load_vernac ~verbosely:false ~interactive:false ~check:true doc sid inferedrc + Vernac.load_vernac ~time ~verbosely:false ~interactive:false ~check:true doc sid inferedrc with Not_found -> doc, sid (* Flags.if_verbose diff --git a/toplevel/coqinit.mli b/toplevel/coqinit.mli index 60ed698b87..c3fd727541 100644 --- a/toplevel/coqinit.mli +++ b/toplevel/coqinit.mli @@ -13,7 +13,7 @@ val set_debug : unit -> unit val set_rcfile : string -> unit val no_load_rc : unit -> unit -val load_rcfile : Stm.doc -> Stateid.t -> Stm.doc * Stateid.t +val load_rcfile : time:bool -> Stm.doc -> Stateid.t -> Stm.doc * Stateid.t val push_include : string -> Names.DirPath.t -> bool -> unit (** [push_include phys_path log_path implicit] *) diff --git a/toplevel/coqloop.ml b/toplevel/coqloop.ml index 910c81381b..5c1b27c333 100644 --- a/toplevel/coqloop.ml +++ b/toplevel/coqloop.ml @@ -300,13 +300,13 @@ let coqloop_feed (fb : Feedback.feedback) = let open Feedback in is caught and handled (i.e. not re-raised). *) -let do_vernac doc sid = +let do_vernac ~time doc sid = top_stderr (fnl()); if !print_emacs then top_stderr (str (top_buffer.prompt doc)); resynch_buffer top_buffer; try let input = (top_buffer.tokens, None) in - Vernac.process_expr doc sid (read_sentence ~doc sid (fst input)) + Vernac.process_expr ~time doc sid (read_sentence ~doc sid (fst input)) with | Stm.End_of_input | CErrors.Quit -> top_stderr (fnl ()); raise CErrors.Quit @@ -337,13 +337,13 @@ let loop_flush_all () = Format.pp_print_flush !Topfmt.std_ft (); Format.pp_print_flush !Topfmt.err_ft () -let rec loop doc = +let rec loop ~time doc = Sys.catch_break true; try reset_input_buffer doc stdin top_buffer; (* Be careful to keep this loop tail-recursive *) let rec vernac_loop doc sid = - let ndoc, nsid = do_vernac doc sid in + let ndoc, nsid = do_vernac ~time doc sid in loop_flush_all (); vernac_loop ndoc nsid (* We recover the current stateid, threading from the caller is @@ -358,4 +358,4 @@ let rec loop doc = fnl() ++ str"Please report" ++ strbrk" at " ++ str Coq_config.wwwbugtracker ++ str "."); - loop doc + loop ~time doc diff --git a/toplevel/coqloop.mli b/toplevel/coqloop.mli index 46934f326a..09240ec82c 100644 --- a/toplevel/coqloop.mli +++ b/toplevel/coqloop.mli @@ -32,8 +32,8 @@ val coqloop_feed : Feedback.feedback -> unit (** Parse and execute one vernac command. *) -val do_vernac : Stm.doc -> Stateid.t -> Stm.doc * Stateid.t +val do_vernac : time:bool -> Stm.doc -> Stateid.t -> Stm.doc * Stateid.t (** Main entry point of Coq: read and execute vernac commands. *) -val loop : Stm.doc -> Stm.doc +val loop : time:bool -> Stm.doc -> Stm.doc diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml index 437b7b0ac2..a3a4e20af8 100644 --- a/toplevel/coqtop.ml +++ b/toplevel/coqtop.ml @@ -80,6 +80,7 @@ let toploop_init = ref begin fun x -> bogus. For now we just print to the console too *) let coqtop_init_feed = Coqloop.coqloop_feed let drop_last_doc = ref None +let measure_time = ref false (* Default toplevel loop *) let console_toploop_run doc = @@ -89,7 +90,7 @@ let console_toploop_run doc = Flags.if_verbose warning "Dumpglob cannot be used in interactive mode."; Dumpglob.noglob () end; - let doc = Coqloop.loop doc in + let doc = Coqloop.loop ~time:!measure_time doc in (* Initialise and launch the Ocaml toplevel *) drop_last_doc := Some doc; Coqinit.init_ocaml_path(); @@ -180,19 +181,19 @@ let load_vernacular_list = ref ([] : (string * bool) list) let add_load_vernacular verb s = load_vernacular_list := ((CUnix.make_suffix s ".v"),verb) :: !load_vernacular_list -let load_vernacular doc sid = +let load_vernacular ~time doc sid = List.fold_left (fun (doc,sid) (f_in, verbosely) -> let s = Loadpath.locate_file f_in in if !Flags.beautify then - Flags.with_option Flags.beautify_file (Vernac.load_vernac ~verbosely ~interactive:false ~check:true doc sid) f_in + Flags.with_option Flags.beautify_file (Vernac.load_vernac ~time ~verbosely ~interactive:false ~check:true doc sid) f_in else - Vernac.load_vernac ~verbosely ~interactive:false ~check:true doc sid s) + Vernac.load_vernac ~time ~verbosely ~interactive:false ~check:true doc sid s) (doc, sid) (List.rev !load_vernacular_list) -let load_init_vernaculars doc sid = - let doc, sid = Coqinit.load_rcfile doc sid in - load_vernacular doc sid +let load_init_vernaculars ~time doc sid = + let doc, sid = Coqinit.load_rcfile ~time doc sid in + load_vernacular ~time doc sid (******************************************************************************) (* Required Modules *) @@ -291,7 +292,7 @@ let ensure_exists f = compile_error (hov 0 (str "Can't find file" ++ spc () ++ str f)) (* Compile a vernac file *) -let compile ~verbosely ~f_in ~f_out = +let compile ~time ~verbosely ~f_in ~f_out = let check_pending_proofs () = let pfs = Proof_global.get_all_proof_names () in if not (CList.is_empty pfs) then @@ -316,7 +317,7 @@ let compile ~verbosely ~f_in ~f_out = require_libs = require_libs () }) in - let doc, sid = load_init_vernaculars doc sid in + let doc, sid = load_init_vernaculars ~time doc sid in let ldir = Stm.get_ldir ~doc in Aux_file.(start_aux_file ~aux_file:(aux_file_name_for long_f_dot_vo) @@ -324,7 +325,7 @@ let compile ~verbosely ~f_in ~f_out = Dumpglob.start_dump_glob ~vfile:long_f_dot_v ~vofile:long_f_dot_vo; Dumpglob.dump_string ("F" ^ Names.DirPath.to_string ldir ^ "\n"); let wall_clock1 = Unix.gettimeofday () in - let doc, _ = Vernac.load_vernac ~verbosely ~check:true ~interactive:false doc (Stm.get_current_state ~doc) long_f_dot_v in + let doc, _ = Vernac.load_vernac ~time ~verbosely ~check:true ~interactive:false doc (Stm.get_current_state ~doc) long_f_dot_v in let _doc = Stm.join ~doc in let wall_clock2 = Unix.gettimeofday () in check_pending_proofs (); @@ -351,10 +352,10 @@ let compile ~verbosely ~f_in ~f_out = require_libs = require_libs () }) in - let doc, sid = load_init_vernaculars doc sid in + let doc, sid = load_init_vernaculars ~time doc sid in let ldir = Stm.get_ldir ~doc in - let doc, _ = Vernac.load_vernac ~verbosely ~check:false ~interactive:false doc (Stm.get_current_state ~doc) long_f_dot_v in + let doc, _ = Vernac.load_vernac ~time ~verbosely ~check:false ~interactive:false doc (Stm.get_current_state ~doc) long_f_dot_v in let doc = Stm.finish ~doc in check_pending_proofs (); let _doc = Stm.snapshot_vio ~doc ldir long_f_dot_vio in @@ -369,9 +370,9 @@ let compile ~verbosely ~f_in ~f_out = let univs, proofs = Stm.finish_tasks lfdv univs disch proofs tasks in Library.save_library_raw lfdv sum lib univs proofs -let compile ~verbosely ~f_in ~f_out = +let compile ~time ~verbosely ~f_in ~f_out = ignore(CoqworkmgrApi.get 1); - compile ~verbosely ~f_in ~f_out; + compile ~time ~verbosely ~f_in ~f_out; CoqworkmgrApi.giveback 1 let compile_file (verbosely,f_in) = @@ -381,9 +382,9 @@ let compile_file (verbosely,f_in) = else compile ~verbosely ~f_in ~f_out:None -let compile_files doc = +let compile_files ~time = if !compile_list == [] then () - else List.iter compile_file (List.rev !compile_list) + else List.iter (compile_file ~time) (List.rev !compile_list) (******************************************************************************) (* VIO Dispatching *) @@ -736,7 +737,7 @@ let parse_args arglist = |"-quiet"|"-silent" -> Flags.quiet := true; Flags.make_warn false |"-quick" -> compilation_mode := BuildVio |"-list-tags" -> print_tags := true - |"-time" -> Flags.time := true + |"-time" -> measure_time := true |"-type-in-type" -> set_type_in_type () |"-unicode" -> add_require ("Utf8_core", None, Some false) |"-v"|"--version" -> Usage.version (exitcode ()) @@ -812,12 +813,12 @@ let init_toplevel arglist = { doc_type = Interactive !toplevel_name; require_libs = require_libs () }) in - Some (load_init_vernaculars doc sid) + Some (load_init_vernaculars ~time:!measure_time doc sid) with any -> flush_all(); fatal_error any (* Non interactive *) end else begin try - compile_files (); + compile_files ~time:!measure_time; schedule_vio_checking (); schedule_vio_compilation (); check_vio_tasks (); diff --git a/toplevel/vernac.ml b/toplevel/vernac.ml index 24d414c883..6b45a94bc4 100644 --- a/toplevel/vernac.ml +++ b/toplevel/vernac.ml @@ -110,16 +110,15 @@ let pr_open_cur_subgoals () = (* Stm.End_of_input -> true *) (* | _ -> false *) -let rec interp_vernac ~check ~interactive doc sid (loc,com) = +let rec interp_vernac ~time ~check ~interactive doc sid (loc,com) = let interp v = match under_control v with | VernacLoad (verbosely, fname) -> let fname = Envars.expand_path_macros ~warn:(fun x -> Feedback.msg_warning (str x)) fname in let fname = CUnix.make_suffix fname ".v" in let f = Loadpath.locate_file fname in - load_vernac ~verbosely ~check ~interactive doc sid f + load_vernac ~time ~verbosely ~check ~interactive doc sid f | _ -> - (* XXX: We need to run this before add as the classification is highly dynamic and depends on the structure of the document. Hopefully this is fixed when VtMeta can be removed @@ -158,8 +157,8 @@ let rec interp_vernac ~check ~interactive doc sid (loc,com) = try (* The -time option is only supported from console-based clients due to the way it prints. *) - if !Flags.time then print_cmd_header ?loc com; - let com = if !Flags.time then VernacTime (loc,com) else com in + if time then print_cmd_header ?loc com; + let com = if time then VernacTime(time,(loc,com)) else com in interp com with reraise -> (* XXX: In non-interactive mode edit_at seems to do very weird @@ -173,7 +172,7 @@ let rec interp_vernac ~check ~interactive doc sid (loc,com) = end in iraise (reraise, info) (* Load a vernac file. CErrors are annotated with file and location *) -and load_vernac ~verbosely ~check ~interactive doc sid file = +and load_vernac ~time ~verbosely ~check ~interactive doc sid file = let ft_beautify, close_beautify = if !Flags.beautify_file then let chan_beautify = open_out (file^beautify_suffix) in @@ -215,7 +214,7 @@ and load_vernac ~verbosely ~check ~interactive doc sid file = Option.iter (vernac_echo ?loc) in_echo; checknav_simple (loc, ast); - let ndoc, nsid = Flags.silently (interp_vernac ~check ~interactive !rdoc !rsid) (loc, ast) in + let ndoc, nsid = Flags.silently (interp_vernac ~time ~check ~interactive !rdoc !rsid) (loc, ast) in rsid := nsid; rdoc := ndoc done; @@ -242,6 +241,6 @@ and load_vernac ~verbosely ~check ~interactive doc sid file = of a new state label). An example of state-preserving command is one coming from the query panel of Coqide. *) -let process_expr doc sid loc_ast = +let process_expr ~time doc sid loc_ast = checknav_deep loc_ast; - interp_vernac ~interactive:true ~check:true doc sid loc_ast + interp_vernac ~time ~interactive:true ~check:true doc sid loc_ast diff --git a/toplevel/vernac.mli b/toplevel/vernac.mli index 8a798a98e9..b77b024faf 100644 --- a/toplevel/vernac.mli +++ b/toplevel/vernac.mli @@ -12,9 +12,9 @@ expected to handle and print errors in form of exceptions, however care is taken so the state machine is left in a consistent state. *) -val process_expr : Stm.doc -> Stateid.t -> Vernacexpr.vernac_control Loc.located -> Stm.doc * Stateid.t +val process_expr : time:bool -> Stm.doc -> Stateid.t -> Vernacexpr.vernac_control Loc.located -> Stm.doc * Stateid.t (** [load_vernac echo sid file] Loads [file] on top of [sid], will echo the commands if [echo] is set. Callers are expected to handle and print errors in form of exceptions. *) -val load_vernac : verbosely:bool -> check:bool -> interactive:bool -> Stm.doc -> Stateid.t -> string -> Stm.doc * Stateid.t +val load_vernac : time:bool -> verbosely:bool -> check:bool -> interactive:bool -> Stm.doc -> Stateid.t -> string -> Stm.doc * Stateid.t diff --git a/vernac/auto_ind_decl.ml b/vernac/auto_ind_decl.ml index 51dd5cd4f5..ec6b62ee27 100644 --- a/vernac/auto_ind_decl.ml +++ b/vernac/auto_ind_decl.ml @@ -317,7 +317,7 @@ let build_beq_scheme mode kn = let kelim = Inductive.elim_sorts (mib,mib.mind_packets.(i)) in if not (Sorts.List.mem InSet kelim) then raise (NonSingletonProp (kn,i)); - if mib.mind_finite = Decl_kinds.CoFinite then + if mib.mind_finite = CoFinite then raise NoDecidabilityCoInductive; let fix = mkFix (((Array.make nb_ind 0),i),(names,types,cores)) in create_input fix), diff --git a/vernac/classes.ml b/vernac/classes.ml index c2e9a5ab44..4a2dba859f 100644 --- a/vernac/classes.ml +++ b/vernac/classes.ml @@ -69,8 +69,7 @@ let existing_instance glob g info = let instance, _ = Global.type_of_global_in_context (Global.env ()) c in let _, r = Term.decompose_prod_assum instance in match class_of_constr Evd.empty (EConstr.of_constr r) with - | Some (_, ((tc,u), _)) -> add_instance (new_instance tc info glob - (*FIXME*) (Flags.use_polymorphic_flag ()) c) + | Some (_, ((tc,u), _)) -> add_instance (new_instance tc info glob c) | None -> user_err ?loc:(loc_of_reference g) ~hdr:"declare_instance" (Pp.str "Constant does not build instances of a declared type class.") @@ -141,7 +140,7 @@ let new_instance ?(abstract=false) ?(global=false) ?(refine= !refine_instance) Implicit_quantifiers.implicit_application Id.Set.empty ~allow_partial:false (fun avoid (clname, _) -> match clname with - | Some (cl, b) -> + | Some cl -> let t = CAst.make @@ CHole (None, Misctypes.IntroAnonymous, None) in t, avoid | None -> failwith ("new instance: under-applied typeclass")) @@ -393,8 +392,7 @@ let context poly l = let cst = Declare.declare_constant ~internal:Declare.InternalTacticRequest id decl in match class_of_constr sigma (of_constr t) with | Some (rels, ((tc,_), args) as _cl) -> - add_instance (Typeclasses.new_instance tc Hints.empty_hint_info false (*FIXME*) - poly (ConstRef cst)); + add_instance (Typeclasses.new_instance tc Hints.empty_hint_info false (ConstRef cst)); status (* declare_subclasses (ConstRef cst) cl *) | None -> status diff --git a/vernac/comDefinition.ml b/vernac/comDefinition.ml index 883121479f..d376696f76 100644 --- a/vernac/comDefinition.ml +++ b/vernac/comDefinition.ml @@ -11,7 +11,6 @@ open Util open Constr open Environ open Entries -open Termops open Redexpr open Declare open Constrintern @@ -49,55 +48,57 @@ let warn_implicits_in_term = strbrk "Implicit arguments declaration relies on type." ++ spc () ++ strbrk "The term declares more implicits than the type here.") +let check_imps ~impsty ~impsbody = + let b = + try + List.for_all (fun (key, (va:bool*bool*bool)) -> + (* Pervasives.(=) is OK for this type *) + Pervasives.(=) (List.assoc_f Impargs.explicitation_eq key impsty) va) + impsbody + with Not_found -> false + in + if not b then warn_implicits_in_term () + let interp_definition pl bl poly red_option c ctypopt = + let open EConstr in let env = Global.env() in + (* Explicitly bound universes and constraints *) let evd, decl = Univdecls.interp_univ_decl_opt env pl in + (* Build the parameters *) let evd, (impls, ((env_bl, ctx), imps1)) = interp_context_evars env evd bl in - let ctx = List.map (fun d -> map_rel_decl EConstr.Unsafe.to_constr d) ctx in - let nb_args = Context.Rel.nhyps ctx in - let evd,imps,ce = - match ctypopt with - None -> - let evd, subst = Evd.nf_univ_variables evd in - let ctx = Context.Rel.map (Vars.subst_univs_constr subst) ctx in - let env_bl = push_rel_context ctx env in - let evd, (c, imps2) = interp_constr_evars_impls ~impls env_bl evd c in - let c = EConstr.Unsafe.to_constr c in - let evd,nf = Evarutil.nf_evars_and_universes evd in - let body = nf (it_mkLambda_or_LetIn c ctx) in - let vars = EConstr.universes_of_constr env evd (EConstr.of_constr body) in - let evd = Evd.restrict_universe_context evd vars in - let uctx = Evd.check_univ_decl ~poly evd decl in - evd, imps1@(Impargs.lift_implicits nb_args imps2), - definition_entry ~univs:uctx body - | Some ctyp -> - let evd, (ty, impsty) = interp_type_evars_impls ~impls env_bl evd ctyp in - let evd, subst = Evd.nf_univ_variables evd in - let ctx = Context.Rel.map (Vars.subst_univs_constr subst) ctx in - let env_bl = push_rel_context ctx env in - let evd, (c, imps2) = interp_casted_constr_evars_impls ~impls env_bl evd c ty in - let c = EConstr.Unsafe.to_constr c in - let evd, nf = Evarutil.nf_evars_and_universes evd in - let body = nf (it_mkLambda_or_LetIn c ctx) in - let ty = EConstr.Unsafe.to_constr ty in - let typ = nf (Term.it_mkProd_or_LetIn ty ctx) in - let beq b1 b2 = if b1 then b2 else not b2 in - let impl_eq (x,y,z) (x',y',z') = beq x x' && beq y y' && beq z z' in - (* Check that all implicit arguments inferable from the term - are inferable from the type *) - let chk (key,va) = - impl_eq (List.assoc_f Pervasives.(=) key impsty) va (* FIXME *) - in - if not (try List.for_all chk imps2 with Not_found -> false) - then warn_implicits_in_term (); - let bodyvars = EConstr.universes_of_constr env evd (EConstr.of_constr body) in - let tyvars = EConstr.universes_of_constr env evd (EConstr.of_constr ty) in - let vars = Univ.LSet.union bodyvars tyvars in - let evd = Evd.restrict_universe_context evd vars in - let uctx = Evd.check_univ_decl ~poly evd decl in - evd, imps1@(Impargs.lift_implicits nb_args impsty), - definition_entry ~types:typ ~univs:uctx body + (* Build the type *) + let evd, tyopt = Option.fold_left_map + (interp_type_evars_impls ~impls env_bl) + evd ctypopt + in + (* Build the body, and merge implicits from parameters and from type/body *) + let evd, c, imps, tyopt = + match tyopt with + | None -> + let evd, (c, impsbody) = interp_constr_evars_impls ~impls env_bl evd c in + evd, c, imps1@Impargs.lift_implicits (Context.Rel.nhyps ctx) impsbody, None + | Some (ty, impsty) -> + let evd, (c, impsbody) = interp_casted_constr_evars_impls ~impls env_bl evd c ty in + check_imps ~impsty ~impsbody; + evd, c, imps1@Impargs.lift_implicits (Context.Rel.nhyps ctx) impsty, Some ty + in + (* universe minimization *) + let evd = Evd.nf_constraints evd in + (* Substitute evars and universes, and add parameters. + Note: in program mode some evars may remain. *) + let ctx = List.map (EConstr.to_rel_decl evd) ctx in + let c = Term.it_mkLambda_or_LetIn (EConstr.to_constr evd c) ctx in + let tyopt = Option.map (fun ty -> Term.it_mkProd_or_LetIn (EConstr.to_constr evd ty) ctx) tyopt in + (* Keep only useful universes. *) + let uvars_fold uvars c = + Univ.LSet.union uvars (universes_of_constr env evd (of_constr c)) in + let uvars = List.fold_left uvars_fold Univ.LSet.empty (Option.List.cons tyopt [c]) in + let evd = Evd.restrict_universe_context evd uvars in + (* Check we conform to declared universes *) + let uctx = Evd.check_univ_decl ~poly evd decl in + (* We're done! *) + let ce = definition_entry ?types:tyopt ~univs:uctx c in (red_constant_entry (Context.Rel.length ctx) ce evd red_option, evd, decl, imps) let check_definition (ce, evd, _, imps) = diff --git a/vernac/comInductive.ml b/vernac/comInductive.ml index f3f50f41dd..1c8677e9cd 100644 --- a/vernac/comInductive.ml +++ b/vernac/comInductive.ml @@ -25,7 +25,6 @@ open Nametab open Impargs open Reductionops open Indtypes -open Decl_kinds open Pretyping open Evarutil open Indschemes @@ -411,7 +410,7 @@ let declare_mutual_inductive_with_eliminations mie pl impls = (* spiwack: raises an error if the structure is supposed to be non-recursive, but isn't *) begin match mie.mind_entry_finite with - | BiFinite when is_recursive mie -> + | Declarations.BiFinite when is_recursive mie -> if Option.has_some mie.mind_entry_record then user_err Pp.(str "Records declared with the keywords Record or Structure cannot be recursive. You can, however, define recursive records using the Inductive or CoInductive command.") else diff --git a/vernac/indschemes.ml b/vernac/indschemes.ml index e4ca98749c..2f4c95affc 100644 --- a/vernac/indschemes.ml +++ b/vernac/indschemes.ml @@ -258,7 +258,7 @@ let declare_one_induction_scheme ind = let declare_induction_schemes kn = let mib = Global.lookup_mind kn in - if mib.mind_finite <> Decl_kinds.CoFinite then begin + if mib.mind_finite <> Declarations.CoFinite then begin for i = 0 to Array.length mib.mind_packets - 1 do declare_one_induction_scheme (kn,i); done; @@ -268,7 +268,7 @@ let declare_induction_schemes kn = let declare_eq_decidability_gen internal names kn = let mib = Global.lookup_mind kn in - if mib.mind_finite <> Decl_kinds.CoFinite then + if mib.mind_finite <> Declarations.CoFinite then ignore (define_mutual_scheme eq_dec_scheme_kind internal names kn) let eq_dec_scheme_msg ind = (* TODO: mutual inductive case *) @@ -512,7 +512,7 @@ let map_inductive_block f kn n = for i=0 to n-1 do f (kn,i) done let declare_default_schemes kn = let mib = Global.lookup_mind kn in let n = Array.length mib.mind_packets in - if !elim_flag && (mib.mind_finite <> BiFinite || !bifinite_elim_flag) + if !elim_flag && (mib.mind_finite <> Declarations.BiFinite || !bifinite_elim_flag) && mib.mind_typing_flags.check_guarded then declare_induction_schemes kn; if !case_flag then map_inductive_block declare_one_case_analysis_scheme kn n; diff --git a/vernac/lemmas.ml b/vernac/lemmas.ml index 27a680b9b6..6ef310837c 100644 --- a/vernac/lemmas.ml +++ b/vernac/lemmas.ml @@ -100,7 +100,7 @@ let find_mutually_recursive_statements sigma thms = match EConstr.kind sigma t with | Ind ((kn,_ as ind),u) when let mind = Global.lookup_mind kn in - mind.mind_finite <> Decl_kinds.CoFinite -> + mind.mind_finite <> Declarations.CoFinite -> [ind,x,i] | _ -> []) 0 (List.rev (List.filter Context.Rel.Declaration.is_local_assum whnf_hyp_hds))) in @@ -110,7 +110,7 @@ let find_mutually_recursive_statements sigma thms = match EConstr.kind sigma whnf_ccl with | Ind ((kn,_ as ind),u) when let mind = Global.lookup_mind kn in - Int.equal mind.mind_ntypes n && mind.mind_finite == Decl_kinds.CoFinite -> + Int.equal mind.mind_ntypes n && mind.mind_finite == Declarations.CoFinite -> [ind,x,0] | _ -> [] in diff --git a/vernac/record.ml b/vernac/record.ml index 114b55cb40..d9dc16d96e 100644 --- a/vernac/record.ml +++ b/vernac/record.ml @@ -143,7 +143,7 @@ let typecheck_params_and_fields finite def id poly pl t ps nots fs = let env_ar = EConstr.push_rel_context newps (EConstr.push_rel (LocalAssum (Name id,arity)) env0) in let assums = List.filter is_local_assum newps in let params = List.map (RelDecl.get_name %> Name.get_id) assums in - let ty = Inductive (params,(finite != BiFinite)) in + let ty = Inductive (params,(finite != Declarations.BiFinite)) in let impls_env = compute_internalization_env env0 ~impls:impls_env ty [id] [EConstr.to_constr sigma arity] [imps] in let env2,sigma,impls,newfs,data = interp_fields_evars env_ar sigma impls_env nots (binders_of_decls fs) @@ -507,7 +507,7 @@ let declare_class finite def cum ubinders univs id idbuild paramimpls params ari | Monomorphic_const_entry univs -> Monomorphic_ind_entry univs in - let ind = declare_structure BiFinite ubinders univs (snd id) idbuild paramimpls + let ind = declare_structure Declarations.BiFinite ubinders univs (snd id) idbuild paramimpls params arity template fieldimpls fields ~kind:Method ~name:binder_name false (List.map (fun _ -> false) fields) sign in @@ -523,7 +523,7 @@ let declare_class finite def cum ubinders univs id idbuild paramimpls params ari let ctx_context = List.map (fun decl -> match Typeclasses.class_of_constr Evd.empty (EConstr.of_constr (RelDecl.get_type decl)) with - | Some (_, ((cl,_), _)) -> Some (cl.cl_impl, true) + | Some (_, ((cl,_), _)) -> Some cl.cl_impl | None -> None) params, params in diff --git a/vernac/vernacentries.ml b/vernac/vernacentries.ml index aa6121c39a..ded0d97e64 100644 --- a/vernac/vernacentries.ml +++ b/vernac/vernacentries.ml @@ -2132,10 +2132,6 @@ let check_vernac_supports_polymorphism c p = | VernacExtend _ | VernacUniverse _ | VernacConstraint _) -> () | Some _, _ -> user_err Pp.(str "This command does not support Polymorphism") -let enforce_polymorphism = function - | None -> Flags.is_universe_polymorphism () - | Some b -> Flags.make_polymorphic_flag b; b - (** A global default timeout, controlled by option "Set Default Timeout n". Use "Unset Default Timeout" to deactivate it (or set it to 0). *) @@ -2202,6 +2198,7 @@ let with_fail st b f = end let interp ?(verbosely=true) ?proof ~st (loc,c) = + let orig_univ_poly = Flags.is_universe_polymorphism () in let orig_program_mode = Flags.is_program_mode () in let rec control = function | VernacExpr v -> @@ -2213,8 +2210,8 @@ let interp ?(verbosely=true) ?proof ~st (loc,c) = control v | VernacRedirect (s, (_,v)) -> Topfmt.with_output_to_file s control v - | VernacTime (_,v) -> - System.with_time !Flags.time control v; + | VernacTime (batch, (_loc,v)) -> + System.with_time ~batch control v; and aux ?polymorphism ~atts isprogcmd = function @@ -2241,7 +2238,8 @@ let interp ?(verbosely=true) ?proof ~st (loc,c) = | c -> check_vernac_supports_locality c atts.locality; check_vernac_supports_polymorphism c polymorphism; - let polymorphic = enforce_polymorphism polymorphism in + let polymorphic = Option.default (Flags.is_universe_polymorphism ()) polymorphism in + Flags.make_universe_polymorphism polymorphic; Obligations.set_program_mode isprogcmd; try vernac_timeout begin fun () -> @@ -2249,9 +2247,12 @@ let interp ?(verbosely=true) ?proof ~st (loc,c) = if verbosely then Flags.verbosely (interp ?proof ~atts ~st) c else Flags.silently (interp ?proof ~atts ~st) c; + (* If the command is `(Un)Set Program Mode` or `(Un)Set Universe Polymorphism`, + we should not restore the previous state of the flag... *) if orig_program_mode || not !Flags.program_mode || isprogcmd then Flags.program_mode := orig_program_mode; - ignore (Flags.use_polymorphic_flag ()) + if (Flags.is_universe_polymorphism() = polymorphic) then + Flags.make_universe_polymorphism orig_univ_poly; end with | reraise when @@ -2262,8 +2263,8 @@ let interp ?(verbosely=true) ?proof ~st (loc,c) = let e = CErrors.push reraise in let e = locate_if_not_already ?loc e in let () = restore_timeout () in + Flags.make_universe_polymorphism orig_univ_poly; Flags.program_mode := orig_program_mode; - ignore (Flags.use_polymorphic_flag ()); iraise e in if verbosely diff --git a/vernac/vernacprop.ml b/vernac/vernacprop.ml index 4a01ef2efa..4fdc78dd2a 100644 --- a/vernac/vernacprop.ml +++ b/vernac/vernacprop.ml @@ -14,14 +14,14 @@ open Vernacexpr let rec under_control = function | VernacExpr c -> c | VernacRedirect (_,(_,c)) - | VernacTime (_,c) + | VernacTime (_,(_,c)) | VernacFail c | VernacTimeout (_,c) -> under_control c let rec has_Fail = function | VernacExpr c -> false | VernacRedirect (_,(_,c)) - | VernacTime (_,c) + | VernacTime (_,(_,c)) | VernacTimeout (_,c) -> has_Fail c | VernacFail _ -> true @@ -38,7 +38,7 @@ let is_navigation_vernac c = is_navigation_vernac_expr (under_control c) let rec is_deep_navigation_vernac = function - | VernacTime (_,c) -> is_deep_navigation_vernac c + | VernacTime (_,(_,c)) -> is_deep_navigation_vernac c | VernacRedirect (_, (_,c)) | VernacTimeout (_,c) | VernacFail c -> is_navigation_vernac c | VernacExpr _ -> false @@ -53,17 +53,6 @@ let is_debug cmd = match under_control cmd with | VernacSetOption (["Ltac";"Debug"], _) -> true | _ -> false -let is_query cmd = match under_control cmd with - | VernacChdir None - | VernacMemOption _ - | VernacPrintOption _ - | VernacCheckMayEval _ - | VernacGlobalCheck _ - | VernacPrint _ - | VernacSearch _ - | VernacLocate _ -> true - | _ -> false - let is_undo cmd = match under_control cmd with | VernacUndo _ | VernacUndoTo _ -> true | _ -> false diff --git a/vernac/vernacprop.mli b/vernac/vernacprop.mli index eb7c7055ac..df739f96a9 100644 --- a/vernac/vernacprop.mli +++ b/vernac/vernacprop.mli @@ -21,6 +21,6 @@ val has_Fail : vernac_control -> bool val is_navigation_vernac : vernac_control -> bool val is_deep_navigation_vernac : vernac_control -> bool val is_reset : vernac_control -> bool -val is_query : vernac_control -> bool val is_debug : vernac_control -> bool val is_undo : vernac_control -> bool + |
