aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/CODEOWNERS2
-rw-r--r--.github/SUPPORT.md28
-rw-r--r--.gitlab-ci.yml22
-rw-r--r--CONTRIBUTING.md8
-rw-r--r--CREDITS26
-rw-r--r--INSTALL7
-rw-r--r--META.coq.in17
-rw-r--r--Makefile2
-rw-r--r--Makefile.build4
-rw-r--r--Makefile.checker2
-rw-r--r--Makefile.ci2
-rw-r--r--Makefile.common2
-rw-r--r--Makefile.dev2
-rw-r--r--Makefile.doc2
-rw-r--r--Makefile.ide2
-rw-r--r--Makefile.install2
-rw-r--r--README.md7
-rw-r--r--checker/check.ml35
-rw-r--r--checker/check.mli2
-rw-r--r--checker/checkInductive.ml5
-rw-r--r--checker/checkInductive.mli2
-rw-r--r--checker/checkTypes.ml2
-rw-r--r--checker/checkTypes.mli2
-rw-r--r--checker/check_stat.ml2
-rw-r--r--checker/check_stat.mli2
-rw-r--r--checker/checker.ml2
-rw-r--r--checker/checker.mli2
-rw-r--r--checker/coqchk.mli2
-rw-r--r--checker/mod_checking.ml32
-rw-r--r--checker/mod_checking.mli4
-rw-r--r--checker/safe_checking.ml2
-rw-r--r--checker/safe_checking.mli2
-rw-r--r--checker/validate.ml2
-rw-r--r--checker/validate.mli2
-rw-r--r--checker/values.ml38
-rw-r--r--checker/values.mli2
-rw-r--r--checker/votour.ml2
-rw-r--r--checker/votour.mli2
-rw-r--r--clib/backtrace.ml2
-rw-r--r--clib/backtrace.mli2
-rw-r--r--clib/bigint.ml2
-rw-r--r--clib/bigint.mli2
-rw-r--r--clib/cArray.ml2
-rw-r--r--clib/cArray.mli2
-rw-r--r--clib/cEphemeron.ml2
-rw-r--r--clib/cEphemeron.mli2
-rw-r--r--clib/cList.ml2
-rw-r--r--clib/cList.mli2
-rw-r--r--clib/cMap.ml2
-rw-r--r--clib/cMap.mli2
-rw-r--r--clib/cObj.ml2
-rw-r--r--clib/cObj.mli2
-rw-r--r--clib/cSet.ml2
-rw-r--r--clib/cSet.mli2
-rw-r--r--clib/cSig.mli2
-rw-r--r--clib/cStack.ml2
-rw-r--r--clib/cStack.mli2
-rw-r--r--clib/cString.ml2
-rw-r--r--clib/cString.mli2
-rw-r--r--clib/cThread.ml2
-rw-r--r--clib/cThread.mli2
-rw-r--r--clib/cUnix.ml2
-rw-r--r--clib/cUnix.mli2
-rw-r--r--clib/dyn.ml2
-rw-r--r--clib/dyn.mli2
-rw-r--r--clib/exninfo.ml2
-rw-r--r--clib/exninfo.mli2
-rw-r--r--clib/hMap.ml2
-rw-r--r--clib/hMap.mli2
-rw-r--r--clib/hashcons.ml2
-rw-r--r--clib/hashcons.mli2
-rw-r--r--clib/hashset.ml2
-rw-r--r--clib/hashset.mli2
-rw-r--r--clib/heap.ml2
-rw-r--r--clib/heap.mli2
-rw-r--r--clib/iStream.ml2
-rw-r--r--clib/iStream.mli2
-rw-r--r--clib/int.ml2
-rw-r--r--clib/int.mli2
-rw-r--r--clib/minisys.ml2
-rw-r--r--clib/monad.ml2
-rw-r--r--clib/monad.mli2
-rw-r--r--clib/option.ml2
-rw-r--r--clib/option.mli2
-rw-r--r--clib/orderedType.ml2
-rw-r--r--clib/orderedType.mli2
-rw-r--r--clib/range.ml2
-rw-r--r--clib/range.mli2
-rw-r--r--clib/segmenttree.ml2
-rw-r--r--clib/segmenttree.mli2
-rw-r--r--clib/store.ml2
-rw-r--r--clib/store.mli2
-rw-r--r--clib/terminal.ml2
-rw-r--r--clib/terminal.mli2
-rw-r--r--clib/trie.ml2
-rw-r--r--clib/trie.mli2
-rw-r--r--clib/unicode.ml2
-rw-r--r--clib/unicode.mli2
-rw-r--r--clib/unionfind.ml2
-rw-r--r--clib/unionfind.mli2
-rw-r--r--config/coq_config.mli2
-rw-r--r--coqpp/coqpp_ast.mli13
-rw-r--r--coqpp/coqpp_lex.mll11
-rw-r--r--coqpp/coqpp_main.ml61
-rw-r--r--coqpp/coqpp_parse.mly41
-rw-r--r--dev/base_include2
-rwxr-xr-xdev/build/windows/MakeCoq_MinGW.bat8
-rw-r--r--dev/build/windows/ReadMe.txt4
-rwxr-xr-xdev/build/windows/makecoq_mingw.sh87
-rwxr-xr-xdev/build/windows/patches_coq/ocaml-4.07.1.patch97
-rwxr-xr-xdev/ci/ci-basic-overlay.sh2
-rwxr-xr-xdev/ci/ci-fiat-crypto.sh2
-rwxr-xr-xdev/ci/ci-iris-lambda-rust.sh6
-rw-r--r--dev/ci/docker/bionic_coq/Dockerfile4
-rw-r--r--dev/ci/user-overlays/07819-mattam-ho-matching-occ-sel.sh13
-rw-r--r--dev/ci/user-overlays/08726-herbelin-master+more-stable-meaning-to-Discharge-flag.sh23
-rw-r--r--dev/ci/user-overlays/08764-validsdp-master-parsing-decimal.sh18
-rw-r--r--dev/ci/user-overlays/08817-sprop.sh34
-rw-r--r--dev/ci/user-overlays/08829-proj-syntax-check.sh5
-rw-r--r--dev/ci/user-overlays/08893-herbelin-master+moving-evars-of-term-on-econstr.sh7
-rw-r--r--dev/ci/user-overlays/08984-vbgl-rm-hardwired-hint-db.sh12
-rw-r--r--dev/ci/user-overlays/09129-ejgallego-proof+no_global_partial.sh30
-rw-r--r--dev/ci/user-overlays/09165-ejgallego-recarg-cleanup.sh9
-rw-r--r--dev/ci/user-overlays/09173-ejgallego-proofview+proof_info.sh9
-rw-r--r--dev/ci/user-overlays/09389-SkySkimmer-set-implicits.sh9
-rw-r--r--dev/ci/user-overlays/09439-sep-variance.sh14
-rw-r--r--dev/ci/user-overlays/09476-ppedrot-context-constructor.sh9
-rw-r--r--dev/ci/user-overlays/09566-ejgallego-proof_global+move_termination_routine_out.sh12
-rw-r--r--dev/ci/user-overlays/09567-ejgallego-hooks_unify.sh12
-rw-r--r--dev/ci/user-overlays/09602-gares-more-delta-in-termination-checking.sh6
-rw-r--r--dev/ci/user-overlays/09645-ejgallego-proof+sayonara_baby.sh12
-rw-r--r--dev/ci/user-overlays/09678-printed-by-env.sh14
-rw-r--r--dev/ci/user-overlays/09733-gares-quotations.sh6
-rw-r--r--dev/ci/user-overlays/09815-token-type.sh4
-rw-r--r--dev/ci/user-overlays/09870-vbgl-recordops.sh6
-rw-r--r--dev/ci/user-overlays/09909-maximedenes-pretyping-rm-global.sh21
-rw-r--r--dev/ci/user-overlays/09973-gares-elpi-2.1.sh6
-rw-r--r--dev/ci/user-overlays/10052-ppedrot-cleanup-logic-convert-hyp.sh6
-rw-r--r--dev/ci/user-overlays/10069-ppedrot-whd-for-evar-conv-no-stack.sh6
-rw-r--r--dev/ci/user-overlays/10076-vbgl-canonical-disable-hint.sh6
-rw-r--r--dev/ci/user-overlays/10125-SkySkimmer-run_tactic_gen.sh6
-rw-r--r--dev/ci/user-overlays/10135-maximedenes-detype-anonymous.sh6
-rw-r--r--dev/ci/user-overlays/10157-SkySkimmer-def-not-visible-generic-warning.sh6
-rw-r--r--dev/ci/user-overlays/10177-SkySkimmer-generalize.sh6
-rw-r--r--dev/ci/user-overlays/10185-SkySkimmer-instance-no-bang.sh6
-rw-r--r--dev/ci/user-overlays/10231-herbelin-master+locating-warning-different-implicit-term-type.sh9
-rw-r--r--dev/ci/user-overlays/10319-SkySkimmer-vernac-when-sideff.sh9
-rw-r--r--dev/ci/user-overlays/10334-ppedrot-rm-kernel-sideeff-role.sh6
-rw-r--r--dev/ci/user-overlays/10358-gares-elpi13.sh6
-rw-r--r--dev/ci/user-overlays/10362-ppedrot-delay-poly-opaque.sh15
-rw-r--r--dev/ci/user-overlays/10406-ppedrot-desync-entry-proof.sh9
-rw-r--r--dev/ci/user-overlays/10416-gares-elpi-14.sh6
-rw-r--r--dev/ci/user-overlays/README.md10
-rw-r--r--dev/doc/build-system.dev.txt4
-rw-r--r--dev/doc/build-system.dune.md6
-rw-r--r--dev/doc/changes.md28
-rw-r--r--dev/dune5
-rwxr-xr-xdev/dune-dbg.in10
-rw-r--r--dev/header.c2
-rw-r--r--dev/header.ml2
-rw-r--r--dev/header.py2
-rwxr-xr-xdev/lint-commits.sh31
-rwxr-xr-xdev/tools/change-header21
-rw-r--r--dev/tools/coqdev.el35
-rwxr-xr-xdev/tools/update-compat.py32
-rw-r--r--dev/top_printers.ml10
-rw-r--r--dev/top_printers.mli2
-rw-r--r--dev/v8-syntax/syntax-v8.tex1
-rw-r--r--doc/LICENSE30
-rw-r--r--doc/changelog/02-specification-language/10049-bidi-app.rst6
-rw-r--r--doc/changelog/02-specification-language/10167-orpat-mixfix.rst12
-rw-r--r--doc/changelog/02-specification-language/10215-rm-maybe-open-proof.rst11
-rw-r--r--doc/changelog/03-notations/10180-deprecate-notations.rst6
-rw-r--r--doc/changelog/04-tactics/09288-injection-as.rst4
-rw-r--r--doc/changelog/04-tactics/10318-select-only-error.rst4
-rw-r--r--doc/changelog/05-tactic-language/10002-ltac2.rst9
-rw-r--r--doc/changelog/05-tactic-language/10289-ltac2+delimited-constr-in-notations.rst5
-rw-r--r--doc/changelog/07-commands-and-options/10185-instance-no-bang.rst2
-rw-r--r--doc/changelog/07-commands-and-options/10277-no-show-script.rst2
-rw-r--r--doc/changelog/08-tools/10245-require-command-line.rst6
-rw-r--r--doc/common/styles/html/coqremote/cover.html2
-rw-r--r--doc/common/styles/html/simple/cover.html2
-rw-r--r--doc/common/title.tex4
-rw-r--r--doc/plugin_tutorial/README.md38
-rw-r--r--doc/plugin_tutorial/tuto0/src/g_tuto0.mlg56
-rw-r--r--doc/plugin_tutorial/tuto0/theories/Demo.v20
-rw-r--r--doc/plugin_tutorial/tuto1/_CoqProject3
-rw-r--r--doc/plugin_tutorial/tuto1/src/g_tuto1.mlg356
-rw-r--r--doc/plugin_tutorial/tuto1/src/inspector.ml8
-rw-r--r--doc/plugin_tutorial/tuto1/src/inspector.mli4
-rw-r--r--doc/plugin_tutorial/tuto1/src/simple_check.ml38
-rw-r--r--doc/plugin_tutorial/tuto1/src/simple_check.mli7
-rw-r--r--doc/plugin_tutorial/tuto1/src/simple_declare.ml8
-rw-r--r--doc/plugin_tutorial/tuto1/src/simple_declare.mli5
-rw-r--r--doc/plugin_tutorial/tuto1/src/simple_print.ml4
-rw-r--r--doc/plugin_tutorial/tuto1/src/simple_print.mli2
-rw-r--r--doc/plugin_tutorial/tuto1/src/tuto1_plugin.mlpack1
-rw-r--r--doc/plugin_tutorial/tuto1/theories/Demo.v95
-rw-r--r--doc/plugin_tutorial/tuto2/_CoqProject17
-rw-r--r--doc/plugin_tutorial/tuto2/src/counter.ml22
-rw-r--r--doc/plugin_tutorial/tuto2/src/counter.mli13
-rw-r--r--doc/plugin_tutorial/tuto2/src/custom.ml5
-rw-r--r--doc/plugin_tutorial/tuto2/src/custom.mli5
-rw-r--r--doc/plugin_tutorial/tuto2/src/demo.mlg375
-rw-r--r--doc/plugin_tutorial/tuto2/src/demo_plugin.mlpack1
-rw-r--r--doc/plugin_tutorial/tuto2/src/dune4
-rw-r--r--doc/plugin_tutorial/tuto2/src/g_tuto2.mlg618
-rw-r--r--doc/plugin_tutorial/tuto2/src/persistent_counter.ml56
-rw-r--r--doc/plugin_tutorial/tuto2/src/persistent_counter.mli14
-rw-r--r--doc/plugin_tutorial/tuto2/src/tuto2_plugin.mlpack4
-rw-r--r--doc/plugin_tutorial/tuto2/theories/Count.v19
-rw-r--r--doc/plugin_tutorial/tuto2/theories/Demo.v63
-rw-r--r--doc/plugin_tutorial/tuto2/theories/Loader.v1
-rw-r--r--doc/plugin_tutorial/tuto2/theories/Test.v19
-rw-r--r--doc/plugin_tutorial/tuto3/src/construction_game.ml160
-rw-r--r--doc/plugin_tutorial/tuto3/src/g_tuto3.mlg8
-rw-r--r--doc/plugin_tutorial/tuto3/src/tuto_tactic.ml22
-rw-r--r--doc/sphinx/_static/ansi-dark.css2
-rw-r--r--doc/sphinx/_static/ansi.css2
-rw-r--r--doc/sphinx/_static/coqdoc.css2
-rw-r--r--doc/sphinx/_static/notations.css2
-rw-r--r--doc/sphinx/_static/notations.js2
-rw-r--r--doc/sphinx/_static/pre-text.css2
-rw-r--r--doc/sphinx/addendum/extended-pattern-matching.rst7
-rw-r--r--doc/sphinx/addendum/generalized-rewriting.rst121
-rw-r--r--doc/sphinx/addendum/program.rst4
-rw-r--r--doc/sphinx/addendum/ring.rst24
-rw-r--r--doc/sphinx/addendum/universe-polymorphism.rst24
-rw-r--r--doc/sphinx/changes.rst75
-rwxr-xr-xdoc/sphinx/conf.py21
-rw-r--r--doc/sphinx/coqdoc.css2
-rw-r--r--doc/sphinx/language/gallina-extensions.rst98
-rw-r--r--doc/sphinx/language/gallina-specification-language.rst13
-rw-r--r--doc/sphinx/practical-tools/coq-commands.rst25
-rw-r--r--doc/sphinx/proof-engine/ltac.rst336
-rw-r--r--doc/sphinx/proof-engine/ltac2.rst33
-rw-r--r--doc/sphinx/proof-engine/proof-handling.rst30
-rw-r--r--doc/sphinx/proof-engine/ssreflect-proof-language.rst90
-rw-r--r--doc/sphinx/proof-engine/tactics.rst236
-rw-r--r--doc/sphinx/proof-engine/vernacular-commands.rst29
-rw-r--r--doc/sphinx/user-extensions/syntax-extensions.rst107
-rw-r--r--doc/tools/coqrst/__init__.py2
-rw-r--r--doc/tools/coqrst/checkdeps.py2
-rw-r--r--doc/tools/coqrst/coqdoc/__init__.py2
-rw-r--r--doc/tools/coqrst/coqdoc/main.py2
-rw-r--r--doc/tools/coqrst/coqdomain.py3
-rw-r--r--doc/tools/coqrst/notations/Makefile2
-rw-r--r--doc/tools/coqrst/notations/TacticNotations.g2
-rwxr-xr-xdoc/tools/coqrst/notations/fontsupport.py6
-rw-r--r--doc/tools/coqrst/notations/html.py2
-rw-r--r--doc/tools/coqrst/notations/parsing.py2
-rw-r--r--doc/tools/coqrst/notations/plain.py2
-rw-r--r--doc/tools/coqrst/notations/regexp.py2
-rw-r--r--doc/tools/coqrst/notations/sphinx.py2
-rw-r--r--doc/tools/coqrst/repl/ansicolors.py2
-rw-r--r--doc/tools/coqrst/repl/coqtop.py2
-rw-r--r--dune7
-rw-r--r--engine/eConstr.ml2
-rw-r--r--engine/eConstr.mli2
-rw-r--r--engine/evar_kinds.ml2
-rw-r--r--engine/evar_kinds.mli2
-rw-r--r--engine/evarutil.ml2
-rw-r--r--engine/evarutil.mli2
-rw-r--r--engine/evd.ml30
-rw-r--r--engine/evd.mli18
-rw-r--r--engine/ftactic.ml6
-rw-r--r--engine/ftactic.mli14
-rw-r--r--engine/logic_monad.ml2
-rw-r--r--engine/logic_monad.mli2
-rw-r--r--engine/namegen.ml2
-rw-r--r--engine/namegen.mli2
-rw-r--r--engine/nameops.ml2
-rw-r--r--engine/nameops.mli2
-rw-r--r--engine/proofview.ml44
-rw-r--r--engine/proofview.mli4
-rw-r--r--engine/proofview_monad.ml2
-rw-r--r--engine/proofview_monad.mli2
-rw-r--r--engine/termops.ml8
-rw-r--r--engine/termops.mli2
-rw-r--r--engine/uState.ml9
-rw-r--r--engine/uState.mli4
-rw-r--r--engine/univGen.ml2
-rw-r--r--engine/univGen.mli2
-rw-r--r--engine/univMinim.ml2
-rw-r--r--engine/univMinim.mli2
-rw-r--r--engine/univNames.ml2
-rw-r--r--engine/univNames.mli2
-rw-r--r--engine/univProblem.ml2
-rw-r--r--engine/univProblem.mli2
-rw-r--r--engine/univSubst.ml2
-rw-r--r--engine/univSubst.mli2
-rw-r--r--engine/univops.ml2
-rw-r--r--engine/univops.mli2
-rw-r--r--gramlib/grammar.ml2
-rw-r--r--ide/MacOS/Info.plist.template2
-rw-r--r--ide/config_lexer.mli2
-rw-r--r--ide/config_lexer.mll2
-rw-r--r--ide/configwin_types.ml2
-rw-r--r--ide/coq.ml2
-rw-r--r--ide/coq.mli2
-rw-r--r--ide/coqOps.ml2
-rw-r--r--ide/coqOps.mli2
-rw-r--r--ide/coq_commands.ml4
-rw-r--r--ide/coq_commands.mli2
-rw-r--r--ide/coq_lex.mli2
-rw-r--r--ide/coq_lex.mll49
-rw-r--r--ide/coqide.ml2
-rw-r--r--ide/coqide.mli2
-rw-r--r--ide/coqide_QUARTZ.ml.in2
-rw-r--r--ide/coqide_WIN32.ml.in2
-rw-r--r--ide/coqide_X11.ml.in2
-rw-r--r--ide/coqide_main.ml2
-rw-r--r--ide/coqide_main.mli2
-rw-r--r--ide/coqide_os_specific.mli2
-rw-r--r--ide/coqide_ui.mli2
-rw-r--r--ide/document.ml2
-rw-r--r--ide/document.mli2
-rw-r--r--ide/dune5
-rw-r--r--ide/fake_ide.ml2
-rw-r--r--ide/fileOps.ml2
-rw-r--r--ide/fileOps.mli2
-rw-r--r--ide/gtk_parsing.ml2
-rw-r--r--ide/gtk_parsing.mli2
-rw-r--r--ide/idetop.ml4
-rw-r--r--ide/ideutils.ml2
-rw-r--r--ide/ideutils.mli2
-rw-r--r--ide/macos_prehook.mli2
-rw-r--r--ide/microPG.ml2
-rw-r--r--ide/microPG.mli2
-rw-r--r--ide/minilib.ml2
-rw-r--r--ide/minilib.mli2
-rw-r--r--ide/preferences.ml2
-rw-r--r--ide/preferences.mli2
-rw-r--r--ide/protocol/interface.ml8
-rw-r--r--ide/protocol/richpp.ml2
-rw-r--r--ide/protocol/richpp.mli4
-rw-r--r--ide/protocol/serialize.ml2
-rw-r--r--ide/protocol/serialize.mli2
-rw-r--r--ide/protocol/xml_printer.ml2
-rw-r--r--ide/protocol/xml_printer.mli6
-rw-r--r--ide/protocol/xmlprotocol.ml4
-rw-r--r--ide/protocol/xmlprotocol.mli2
-rw-r--r--ide/sentence.ml2
-rw-r--r--ide/sentence.mli2
-rw-r--r--ide/session.ml32
-rw-r--r--ide/session.mli2
-rw-r--r--ide/tags.ml2
-rw-r--r--ide/tags.mli2
-rw-r--r--ide/unicode_bindings.ml2
-rw-r--r--ide/unicode_bindings.mli2
-rw-r--r--ide/utf8_convert.mli2
-rw-r--r--ide/utf8_convert.mll2
-rw-r--r--ide/wg_Command.ml2
-rw-r--r--ide/wg_Command.mli2
-rw-r--r--ide/wg_Completion.ml2
-rw-r--r--ide/wg_Completion.mli2
-rw-r--r--ide/wg_Detachable.ml2
-rw-r--r--ide/wg_Detachable.mli2
-rw-r--r--ide/wg_Find.ml2
-rw-r--r--ide/wg_Find.mli2
-rw-r--r--ide/wg_MessageView.ml2
-rw-r--r--ide/wg_MessageView.mli2
-rw-r--r--ide/wg_Notebook.ml2
-rw-r--r--ide/wg_Notebook.mli2
-rw-r--r--ide/wg_ProofView.ml2
-rw-r--r--ide/wg_ProofView.mli2
-rw-r--r--ide/wg_RoutedMessageViews.ml2
-rw-r--r--ide/wg_RoutedMessageViews.mli2
-rw-r--r--ide/wg_ScriptView.ml2
-rw-r--r--ide/wg_ScriptView.mli2
-rw-r--r--ide/wg_Segment.ml2
-rw-r--r--ide/wg_Segment.mli2
-rw-r--r--interp/constrexpr.ml2
-rw-r--r--interp/constrexpr_ops.ml2
-rw-r--r--interp/constrexpr_ops.mli2
-rw-r--r--interp/constrextern.ml21
-rw-r--r--interp/constrextern.mli2
-rw-r--r--interp/constrintern.ml110
-rw-r--r--interp/constrintern.mli10
-rw-r--r--interp/deprecation.ml21
-rw-r--r--interp/deprecation.mli (renamed from interp/discharge.mli)12
-rw-r--r--interp/discharge.ml118
-rw-r--r--interp/dumpglob.ml5
-rw-r--r--interp/dumpglob.mli2
-rw-r--r--interp/genintern.ml2
-rw-r--r--interp/genintern.mli2
-rw-r--r--interp/impargs.ml95
-rw-r--r--interp/impargs.mli18
-rw-r--r--interp/implicit_quantifiers.ml115
-rw-r--r--interp/implicit_quantifiers.mli23
-rw-r--r--interp/interp.mllib3
-rw-r--r--interp/modintern.ml2
-rw-r--r--interp/modintern.mli2
-rw-r--r--interp/notation.ml32
-rw-r--r--interp/notation.mli5
-rw-r--r--interp/notation_ops.ml8
-rw-r--r--interp/notation_ops.mli2
-rw-r--r--interp/notation_term.ml2
-rw-r--r--interp/reserve.ml2
-rw-r--r--interp/reserve.mli2
-rw-r--r--interp/smartlocate.ml2
-rw-r--r--interp/smartlocate.mli2
-rw-r--r--interp/stdarg.ml2
-rw-r--r--interp/stdarg.mli2
-rw-r--r--interp/syntax_def.ml82
-rw-r--r--interp/syntax_def.mli6
-rw-r--r--kernel/byterun/coq_memory.c2
-rw-r--r--kernel/cClosure.ml6
-rw-r--r--kernel/cClosure.mli4
-rw-r--r--kernel/cPrimitives.ml2
-rw-r--r--kernel/cPrimitives.mli2
-rw-r--r--kernel/cbytecodes.ml2
-rw-r--r--kernel/cbytecodes.mli2
-rw-r--r--kernel/cbytegen.ml4
-rw-r--r--kernel/cbytegen.mli2
-rw-r--r--kernel/cemitcodes.ml2
-rw-r--r--kernel/cemitcodes.mli10
-rw-r--r--kernel/constr.ml2
-rw-r--r--kernel/constr.mli4
-rw-r--r--kernel/context.ml2
-rw-r--r--kernel/context.mli2
-rw-r--r--kernel/conv_oracle.ml2
-rw-r--r--kernel/conv_oracle.mli2
-rw-r--r--kernel/cooking.ml220
-rw-r--r--kernel/cooking.mli11
-rw-r--r--kernel/csymtable.ml2
-rw-r--r--kernel/csymtable.mli2
-rw-r--r--kernel/declarations.ml9
-rw-r--r--kernel/declareops.ml8
-rw-r--r--kernel/declareops.mli2
-rw-r--r--kernel/dune11
-rw-r--r--kernel/entries.ml25
-rw-r--r--kernel/environ.ml12
-rw-r--r--kernel/environ.mli8
-rw-r--r--kernel/esubst.ml2
-rw-r--r--kernel/esubst.mli2
-rw-r--r--kernel/evar.ml2
-rw-r--r--kernel/evar.mli2
-rw-r--r--kernel/genOpcodeFiles.ml2
-rw-r--r--kernel/indTyping.ml15
-rw-r--r--kernel/indTyping.mli6
-rw-r--r--kernel/indtypes.ml2
-rw-r--r--kernel/indtypes.mli2
-rw-r--r--kernel/inductive.ml12
-rw-r--r--kernel/inductive.mli4
-rw-r--r--kernel/mod_subst.ml2
-rw-r--r--kernel/mod_subst.mli2
-rw-r--r--kernel/mod_typing.ml4
-rw-r--r--kernel/mod_typing.mli2
-rw-r--r--kernel/modops.ml5
-rw-r--r--kernel/modops.mli2
-rw-r--r--kernel/names.ml3
-rw-r--r--kernel/names.mli3
-rw-r--r--kernel/nativecode.ml2
-rw-r--r--kernel/nativecode.mli2
-rw-r--r--kernel/nativeconv.ml2
-rw-r--r--kernel/nativeconv.mli2
-rw-r--r--kernel/nativelambda.ml2
-rw-r--r--kernel/nativelambda.mli2
-rw-r--r--kernel/nativelib.ml2
-rw-r--r--kernel/nativelib.mli2
-rw-r--r--kernel/nativelibrary.ml2
-rw-r--r--kernel/nativelibrary.mli2
-rw-r--r--kernel/nativevalues.ml2
-rw-r--r--kernel/nativevalues.mli2
-rw-r--r--kernel/opaqueproof.ml158
-rw-r--r--kernel/opaqueproof.mli69
-rw-r--r--kernel/reduction.ml2
-rw-r--r--kernel/reduction.mli2
-rw-r--r--kernel/retroknowledge.ml2
-rw-r--r--kernel/retroknowledge.mli2
-rw-r--r--kernel/retypeops.ml10
-rw-r--r--kernel/retypeops.mli10
-rw-r--r--kernel/safe_typing.ml191
-rw-r--r--kernel/safe_typing.mli22
-rw-r--r--kernel/sorts.ml9
-rw-r--r--kernel/sorts.mli8
-rw-r--r--kernel/subtyping.ml2
-rw-r--r--kernel/subtyping.mli2
-rw-r--r--kernel/term.ml2
-rw-r--r--kernel/term.mli2
-rw-r--r--kernel/term_typing.ml124
-rw-r--r--kernel/term_typing.mli4
-rw-r--r--kernel/transparentState.ml2
-rw-r--r--kernel/transparentState.mli2
-rw-r--r--kernel/type_errors.ml4
-rw-r--r--kernel/type_errors.mli6
-rw-r--r--kernel/typeops.ml2
-rw-r--r--kernel/typeops.mli2
-rw-r--r--kernel/uGraph.ml2
-rw-r--r--kernel/uGraph.mli2
-rw-r--r--kernel/uint63.mli2
-rw-r--r--kernel/uint63_amd64_63.ml (renamed from kernel/uint63_amd64.ml)2
-rw-r--r--kernel/uint63_i386_31.ml (renamed from kernel/uint63_x86.ml)2
-rw-r--r--kernel/univ.ml4
-rw-r--r--kernel/univ.mli4
-rw-r--r--kernel/vars.ml2
-rw-r--r--kernel/vars.mli2
-rw-r--r--kernel/vconv.mli2
-rw-r--r--kernel/vm.ml2
-rw-r--r--kernel/vm.mli2
-rw-r--r--kernel/vmvalues.ml10
-rw-r--r--kernel/vmvalues.mli2
-rw-r--r--kernel/write_uint63.ml6
-rw-r--r--lib/acyclicGraph.ml2
-rw-r--r--lib/acyclicGraph.mli2
-rw-r--r--lib/aux_file.ml2
-rw-r--r--lib/aux_file.mli2
-rw-r--r--lib/cAst.ml2
-rw-r--r--lib/cAst.mli2
-rw-r--r--lib/cErrors.ml32
-rw-r--r--lib/cErrors.mli6
-rw-r--r--lib/cProfile.ml2
-rw-r--r--lib/cProfile.mli4
-rw-r--r--lib/cWarnings.ml2
-rw-r--r--lib/cWarnings.mli2
-rw-r--r--lib/control.ml2
-rw-r--r--lib/control.mli2
-rw-r--r--lib/coqProject_file.ml2
-rw-r--r--lib/coqProject_file.mli2
-rw-r--r--lib/dAst.ml2
-rw-r--r--lib/dAst.mli2
-rw-r--r--lib/envars.ml2
-rw-r--r--lib/envars.mli4
-rw-r--r--lib/explore.ml2
-rw-r--r--lib/explore.mli2
-rw-r--r--lib/feedback.ml2
-rw-r--r--lib/feedback.mli4
-rw-r--r--lib/flags.ml2
-rw-r--r--lib/flags.mli4
-rw-r--r--lib/future.ml2
-rw-r--r--lib/future.mli2
-rw-r--r--lib/genarg.ml2
-rw-r--r--lib/genarg.mli2
-rw-r--r--lib/hook.ml2
-rw-r--r--lib/hook.mli2
-rw-r--r--lib/loc.ml2
-rw-r--r--lib/loc.mli2
-rw-r--r--lib/pp.ml2
-rw-r--r--lib/pp.mli4
-rw-r--r--lib/pp_diff.ml2
-rw-r--r--lib/pp_diff.mli4
-rw-r--r--lib/remoteCounter.ml2
-rw-r--r--lib/remoteCounter.mli2
-rw-r--r--lib/rtree.ml2
-rw-r--r--lib/rtree.mli2
-rw-r--r--lib/spawn.ml2
-rw-r--r--lib/spawn.mli4
-rw-r--r--lib/stateid.ml2
-rw-r--r--lib/stateid.mli2
-rw-r--r--lib/system.ml2
-rw-r--r--lib/system.mli2
-rw-r--r--lib/util.ml4
-rw-r--r--lib/util.mli4
-rw-r--r--lib/xml_datatype.mli2
-rw-r--r--library/coqlib.ml2
-rw-r--r--library/coqlib.mli2
-rw-r--r--library/decl_kinds.ml8
-rw-r--r--library/declaremods.ml4
-rw-r--r--library/declaremods.mli2
-rw-r--r--library/decls.ml2
-rw-r--r--library/decls.mli2
-rw-r--r--library/global.ml26
-rw-r--r--library/global.mli15
-rw-r--r--library/globnames.ml2
-rw-r--r--library/globnames.mli2
-rw-r--r--library/goptions.ml21
-rw-r--r--library/goptions.mli30
-rw-r--r--library/keys.ml2
-rw-r--r--library/keys.mli2
-rw-r--r--library/kindops.ml2
-rw-r--r--library/kindops.mli2
-rw-r--r--library/lib.ml5
-rw-r--r--library/lib.mli3
-rw-r--r--library/libnames.ml2
-rw-r--r--library/libnames.mli2
-rw-r--r--library/libobject.ml2
-rw-r--r--library/libobject.mli2
-rw-r--r--library/library.ml174
-rw-r--r--library/library.mli39
-rw-r--r--library/library.mllib1
-rw-r--r--library/loadpath.ml119
-rw-r--r--library/nametab.ml2
-rw-r--r--library/nametab.mli4
-rw-r--r--library/states.ml2
-rw-r--r--library/states.mli2
-rw-r--r--library/summary.ml2
-rw-r--r--library/summary.mli4
-rw-r--r--man/coqdep.12
-rw-r--r--parsing/cLexer.ml78
-rw-r--r--parsing/cLexer.mli2
-rw-r--r--parsing/extend.ml2
-rw-r--r--parsing/g_constr.mlg85
-rw-r--r--parsing/g_prim.mlg15
-rw-r--r--parsing/notation_gram.ml2
-rw-r--r--parsing/notgram_ops.ml2
-rw-r--r--parsing/notgram_ops.mli2
-rw-r--r--parsing/pcoq.ml22
-rw-r--r--parsing/pcoq.mli8
-rw-r--r--parsing/ppextend.ml2
-rw-r--r--parsing/ppextend.mli2
-rw-r--r--parsing/tok.ml2
-rw-r--r--parsing/tok.mli2
-rw-r--r--plugins/btauto/g_btauto.mlg2
-rw-r--r--plugins/btauto/refl_btauto.ml2
-rw-r--r--plugins/btauto/refl_btauto.mli2
-rw-r--r--plugins/cc/ccalgo.ml2
-rw-r--r--plugins/cc/ccalgo.mli2
-rw-r--r--plugins/cc/ccproof.ml2
-rw-r--r--plugins/cc/ccproof.mli2
-rw-r--r--plugins/cc/cctac.ml2
-rw-r--r--plugins/cc/cctac.mli2
-rw-r--r--plugins/cc/g_congruence.mlg2
-rw-r--r--plugins/derive/derive.ml94
-rw-r--r--plugins/derive/derive.mli8
-rw-r--r--plugins/derive/g_derive.mlg10
-rw-r--r--plugins/extraction/CHANGES2
-rw-r--r--plugins/extraction/ExtrOcamlBasic.v6
-rw-r--r--plugins/extraction/ExtrOcamlBigIntConv.v2
-rw-r--r--plugins/extraction/ExtrOcamlIntConv.v2
-rw-r--r--plugins/extraction/ExtrOcamlNatBigInt.v2
-rw-r--r--plugins/extraction/ExtrOcamlNatInt.v2
-rw-r--r--plugins/extraction/ExtrOcamlString.v2
-rw-r--r--plugins/extraction/ExtrOcamlZBigInt.v2
-rw-r--r--plugins/extraction/ExtrOcamlZInt.v2
-rw-r--r--plugins/extraction/Extraction.v2
-rw-r--r--plugins/extraction/big.ml2
-rw-r--r--plugins/extraction/common.ml8
-rw-r--r--plugins/extraction/common.mli2
-rw-r--r--plugins/extraction/extract_env.ml10
-rw-r--r--plugins/extraction/extract_env.mli4
-rw-r--r--plugins/extraction/extraction.ml4
-rw-r--r--plugins/extraction/extraction.mli2
-rw-r--r--plugins/extraction/g_extraction.mlg10
-rw-r--r--plugins/extraction/haskell.ml2
-rw-r--r--plugins/extraction/haskell.mli2
-rw-r--r--plugins/extraction/miniml.ml2
-rw-r--r--plugins/extraction/miniml.mli2
-rw-r--r--plugins/extraction/mlutil.ml2
-rw-r--r--plugins/extraction/mlutil.mli2
-rw-r--r--plugins/extraction/modutil.ml2
-rw-r--r--plugins/extraction/modutil.mli2
-rw-r--r--plugins/extraction/ocaml.ml2
-rw-r--r--plugins/extraction/ocaml.mli2
-rw-r--r--plugins/extraction/scheme.ml2
-rw-r--r--plugins/extraction/scheme.mli2
-rw-r--r--plugins/extraction/table.ml6
-rw-r--r--plugins/extraction/table.mli2
-rw-r--r--plugins/firstorder/formula.ml2
-rw-r--r--plugins/firstorder/formula.mli2
-rw-r--r--plugins/firstorder/g_ground.mlg2
-rw-r--r--plugins/firstorder/ground.ml2
-rw-r--r--plugins/firstorder/ground.mli2
-rw-r--r--plugins/firstorder/instances.ml2
-rw-r--r--plugins/firstorder/instances.mli2
-rw-r--r--plugins/firstorder/rules.ml2
-rw-r--r--plugins/firstorder/rules.mli2
-rw-r--r--plugins/firstorder/sequent.ml2
-rw-r--r--plugins/firstorder/sequent.mli2
-rw-r--r--plugins/firstorder/unify.ml2
-rw-r--r--plugins/firstorder/unify.mli2
-rw-r--r--plugins/funind/FunInd.v2
-rw-r--r--plugins/funind/Recdef.v2
-rw-r--r--plugins/funind/functional_principles_proofs.ml1831
-rw-r--r--plugins/funind/functional_principles_types.ml451
-rw-r--r--plugins/funind/functional_principles_types.mli4
-rw-r--r--plugins/funind/g_indfun.mlg74
-rw-r--r--plugins/funind/glob_term_to_relation.ml8
-rw-r--r--plugins/funind/glob_termops.mli2
-rw-r--r--plugins/funind/indfun.ml844
-rw-r--r--plugins/funind/indfun.mli10
-rw-r--r--plugins/funind/indfun_common.ml81
-rw-r--r--plugins/funind/indfun_common.mli4
-rw-r--r--plugins/funind/invfun.ml878
-rw-r--r--plugins/funind/invfun.mli4
-rw-r--r--plugins/funind/recdef.ml1296
-rw-r--r--plugins/funind/recdef.mli30
-rw-r--r--plugins/ltac/coretactics.mlg4
-rw-r--r--plugins/ltac/evar_tactics.ml2
-rw-r--r--plugins/ltac/evar_tactics.mli2
-rw-r--r--plugins/ltac/extraargs.mlg6
-rw-r--r--plugins/ltac/extraargs.mli2
-rw-r--r--plugins/ltac/extratactics.mlg53
-rw-r--r--plugins/ltac/extratactics.mli2
-rw-r--r--plugins/ltac/g_auto.mlg2
-rw-r--r--plugins/ltac/g_class.mlg2
-rw-r--r--plugins/ltac/g_eqdecide.mlg2
-rw-r--r--plugins/ltac/g_ltac.mlg25
-rw-r--r--plugins/ltac/g_obligations.mlg22
-rw-r--r--plugins/ltac/g_rewrite.mlg78
-rw-r--r--plugins/ltac/g_tactic.mlg2
-rw-r--r--plugins/ltac/pltac.ml6
-rw-r--r--plugins/ltac/pltac.mli2
-rw-r--r--plugins/ltac/pptactic.ml15
-rw-r--r--plugins/ltac/pptactic.mli2
-rw-r--r--plugins/ltac/profile_ltac.ml2
-rw-r--r--plugins/ltac/profile_ltac.mli2
-rw-r--r--plugins/ltac/profile_ltac_tactics.mlg2
-rw-r--r--plugins/ltac/rewrite.ml209
-rw-r--r--plugins/ltac/rewrite.mli44
-rw-r--r--plugins/ltac/tacarg.ml12
-rw-r--r--plugins/ltac/tacarg.mli9
-rw-r--r--plugins/ltac/taccoerce.ml81
-rw-r--r--plugins/ltac/taccoerce.mli2
-rw-r--r--plugins/ltac/tacentries.ml2
-rw-r--r--plugins/ltac/tacentries.mli11
-rw-r--r--plugins/ltac/tacenv.ml8
-rw-r--r--plugins/ltac/tacenv.mli13
-rw-r--r--plugins/ltac/tacexpr.ml4
-rw-r--r--plugins/ltac/tacexpr.mli4
-rw-r--r--plugins/ltac/tacintern.ml20
-rw-r--r--plugins/ltac/tacintern.mli2
-rw-r--r--plugins/ltac/tacinterp.ml9
-rw-r--r--plugins/ltac/tacinterp.mli2
-rw-r--r--plugins/ltac/tacsubst.ml5
-rw-r--r--plugins/ltac/tacsubst.mli2
-rw-r--r--plugins/ltac/tactic_debug.ml2
-rw-r--r--plugins/ltac/tactic_debug.mli2
-rw-r--r--plugins/ltac/tactic_matching.ml4
-rw-r--r--plugins/ltac/tactic_matching.mli2
-rw-r--r--plugins/ltac/tactic_option.ml2
-rw-r--r--plugins/ltac/tactic_option.mli2
-rw-r--r--plugins/ltac/tauto.ml2
-rw-r--r--plugins/micromega/DeclConstant.v2
-rw-r--r--plugins/micromega/Env.v2
-rw-r--r--plugins/micromega/EnvRing.v4
-rw-r--r--plugins/micromega/Lia.v2
-rw-r--r--plugins/micromega/Lqa.v2
-rw-r--r--plugins/micromega/Lra.v2
-rw-r--r--plugins/micromega/MExtraction.v2
-rw-r--r--plugins/micromega/OrderedRing.v4
-rw-r--r--plugins/micromega/Psatz.v2
-rw-r--r--plugins/micromega/QMicromega.v2
-rw-r--r--plugins/micromega/RMicromega.v2
-rw-r--r--plugins/micromega/Refl.v2
-rw-r--r--plugins/micromega/RingMicromega.v4
-rw-r--r--plugins/micromega/Tauto.v2
-rw-r--r--plugins/micromega/VarMap.v10
-rw-r--r--plugins/micromega/ZCoeff.v2
-rw-r--r--plugins/micromega/ZMicromega.v2
-rw-r--r--plugins/micromega/certificate.ml2
-rw-r--r--plugins/micromega/certificate.mli2
-rw-r--r--plugins/micromega/coq_micromega.ml8
-rw-r--r--plugins/micromega/coq_micromega.mli2
-rw-r--r--plugins/micromega/csdpcert.ml2
-rw-r--r--plugins/micromega/csdpcert.mli2
-rw-r--r--plugins/micromega/g_micromega.mlg2
-rw-r--r--plugins/micromega/g_micromega.mli2
-rw-r--r--plugins/micromega/itv.ml2
-rw-r--r--plugins/micromega/itv.mli2
-rw-r--r--plugins/micromega/mfourier.ml2
-rw-r--r--plugins/micromega/mfourier.mli2
-rw-r--r--plugins/micromega/mutils.ml2
-rw-r--r--plugins/micromega/mutils.mli2
-rw-r--r--plugins/micromega/persistent_cache.ml4
-rw-r--r--plugins/micromega/persistent_cache.mli4
-rw-r--r--plugins/micromega/polynomial.ml2
-rw-r--r--plugins/micromega/polynomial.mli2
-rw-r--r--plugins/micromega/simplex.ml2
-rw-r--r--plugins/micromega/simplex.mli2
-rw-r--r--plugins/micromega/sos.mli2
-rw-r--r--plugins/micromega/sos_lib.ml2
-rw-r--r--plugins/micromega/sos_lib.mli2
-rw-r--r--plugins/micromega/sos_types.ml2
-rw-r--r--plugins/micromega/sos_types.mli2
-rw-r--r--plugins/micromega/vect.ml2
-rw-r--r--plugins/micromega/vect.mli2
-rw-r--r--plugins/nsatz/Nsatz.v2
-rw-r--r--plugins/nsatz/g_nsatz.mlg2
-rw-r--r--plugins/nsatz/ideal.ml2
-rw-r--r--plugins/nsatz/ideal.mli2
-rw-r--r--plugins/nsatz/nsatz.ml4
-rw-r--r--plugins/nsatz/nsatz.mli2
-rw-r--r--plugins/nsatz/polynom.ml6
-rw-r--r--plugins/nsatz/polynom.mli2
-rw-r--r--plugins/omega/Omega.v2
-rw-r--r--plugins/omega/OmegaLemmas.v2
-rw-r--r--plugins/omega/OmegaPlugin.v2
-rw-r--r--plugins/omega/OmegaTactic.v2
-rw-r--r--plugins/omega/PreOmega.v2
-rw-r--r--plugins/omega/coq_omega.ml2
-rw-r--r--plugins/omega/coq_omega.mli2
-rw-r--r--plugins/omega/g_omega.mlg2
-rw-r--r--plugins/omega/omega.ml2
-rw-r--r--plugins/rtauto/Bintree.v2
-rw-r--r--plugins/rtauto/Rtauto.v2
-rw-r--r--plugins/rtauto/g_rtauto.mlg2
-rw-r--r--plugins/rtauto/proof_search.ml2
-rw-r--r--plugins/rtauto/proof_search.mli2
-rw-r--r--plugins/rtauto/refl_tauto.ml2
-rw-r--r--plugins/rtauto/refl_tauto.mli2
-rw-r--r--plugins/setoid_ring/Algebra_syntax.v2
-rw-r--r--plugins/setoid_ring/ArithRing.v2
-rw-r--r--plugins/setoid_ring/BinList.v2
-rw-r--r--plugins/setoid_ring/Cring.v2
-rw-r--r--plugins/setoid_ring/Field.v2
-rw-r--r--plugins/setoid_ring/Field_tac.v2
-rw-r--r--plugins/setoid_ring/Field_theory.v2
-rw-r--r--plugins/setoid_ring/InitialRing.v4
-rw-r--r--plugins/setoid_ring/Integral_domain.v2
-rw-r--r--plugins/setoid_ring/NArithRing.v2
-rw-r--r--plugins/setoid_ring/Ncring.v2
-rw-r--r--plugins/setoid_ring/Ncring_initial.v2
-rw-r--r--plugins/setoid_ring/Ncring_polynom.v2
-rw-r--r--plugins/setoid_ring/Ncring_tac.v2
-rw-r--r--plugins/setoid_ring/RealField.v2
-rw-r--r--plugins/setoid_ring/Ring.v2
-rw-r--r--plugins/setoid_ring/Ring_base.v2
-rw-r--r--plugins/setoid_ring/Ring_polynom.v4
-rw-r--r--plugins/setoid_ring/Ring_tac.v2
-rw-r--r--plugins/setoid_ring/Ring_theory.v2
-rw-r--r--plugins/setoid_ring/Rings_Q.v2
-rw-r--r--plugins/setoid_ring/Rings_R.v2
-rw-r--r--plugins/setoid_ring/Rings_Z.v2
-rw-r--r--plugins/setoid_ring/ZArithRing.v2
-rw-r--r--plugins/setoid_ring/g_newring.mlg40
-rw-r--r--plugins/setoid_ring/newring.ml32
-rw-r--r--plugins/setoid_ring/newring.mli7
-rw-r--r--plugins/setoid_ring/newring_ast.ml2
-rw-r--r--plugins/setoid_ring/newring_ast.mli2
-rw-r--r--plugins/ssr/ssrast.mli2
-rw-r--r--plugins/ssr/ssrbool.v20
-rw-r--r--plugins/ssr/ssrbwd.ml2
-rw-r--r--plugins/ssr/ssrbwd.mli2
-rw-r--r--plugins/ssr/ssrcommon.ml13
-rw-r--r--plugins/ssr/ssrcommon.mli2
-rw-r--r--plugins/ssr/ssreflect.v18
-rw-r--r--plugins/ssr/ssrelim.ml17
-rw-r--r--plugins/ssr/ssrelim.mli2
-rw-r--r--plugins/ssr/ssrequality.ml14
-rw-r--r--plugins/ssr/ssrequality.mli2
-rw-r--r--plugins/ssr/ssrfun.v2
-rw-r--r--plugins/ssr/ssrfwd.ml2
-rw-r--r--plugins/ssr/ssrfwd.mli2
-rw-r--r--plugins/ssr/ssripats.ml2
-rw-r--r--plugins/ssr/ssripats.mli2
-rw-r--r--plugins/ssr/ssrparser.mlg30
-rw-r--r--plugins/ssr/ssrparser.mli2
-rw-r--r--plugins/ssr/ssrprinters.ml2
-rw-r--r--plugins/ssr/ssrprinters.mli2
-rw-r--r--plugins/ssr/ssrtacticals.ml2
-rw-r--r--plugins/ssr/ssrtacticals.mli2
-rw-r--r--plugins/ssr/ssrvernac.mlg13
-rw-r--r--plugins/ssr/ssrvernac.mli2
-rw-r--r--plugins/ssr/ssrview.ml2
-rw-r--r--plugins/ssr/ssrview.mli2
-rw-r--r--plugins/ssrmatching/g_ssrmatching.mlg2
-rw-r--r--plugins/ssrmatching/g_ssrmatching.mli2
-rw-r--r--plugins/ssrmatching/ssrmatching.ml2
-rw-r--r--plugins/ssrmatching/ssrmatching.mli4
-rw-r--r--plugins/ssrmatching/ssrmatching.v2
-rw-r--r--plugins/syntax/g_numeral.mlg21
-rw-r--r--plugins/syntax/g_string.mlg21
-rw-r--r--plugins/syntax/int63_syntax.ml10
-rw-r--r--plugins/syntax/numeral.ml6
-rw-r--r--plugins/syntax/numeral.mli4
-rw-r--r--plugins/syntax/r_syntax.ml2
-rw-r--r--plugins/syntax/r_syntax.mli2
-rw-r--r--plugins/syntax/string_notation.ml6
-rw-r--r--plugins/syntax/string_notation.mli4
-rw-r--r--pretyping/arguments_renaming.ml2
-rw-r--r--pretyping/arguments_renaming.mli2
-rw-r--r--pretyping/cases.ml10
-rw-r--r--pretyping/cases.mli2
-rw-r--r--pretyping/cbv.ml4
-rw-r--r--pretyping/cbv.mli2
-rw-r--r--pretyping/classops.ml4
-rw-r--r--pretyping/classops.mli2
-rw-r--r--pretyping/coercion.ml2
-rw-r--r--pretyping/coercion.mli2
-rw-r--r--pretyping/constr_matching.ml2
-rw-r--r--pretyping/constr_matching.mli2
-rw-r--r--pretyping/detyping.ml25
-rw-r--r--pretyping/detyping.mli4
-rw-r--r--pretyping/evarconv.ml2
-rw-r--r--pretyping/evarconv.mli4
-rw-r--r--pretyping/evardefine.ml2
-rw-r--r--pretyping/evardefine.mli2
-rw-r--r--pretyping/evarsolve.ml12
-rw-r--r--pretyping/evarsolve.mli2
-rw-r--r--pretyping/find_subterm.ml2
-rw-r--r--pretyping/find_subterm.mli2
-rw-r--r--pretyping/geninterp.ml2
-rw-r--r--pretyping/geninterp.mli2
-rw-r--r--pretyping/globEnv.ml2
-rw-r--r--pretyping/globEnv.mli4
-rw-r--r--pretyping/glob_ops.ml31
-rw-r--r--pretyping/glob_ops.mli9
-rw-r--r--pretyping/glob_term.ml26
-rw-r--r--pretyping/heads.ml2
-rw-r--r--pretyping/heads.mli2
-rw-r--r--pretyping/indrec.ml8
-rw-r--r--pretyping/indrec.mli2
-rw-r--r--pretyping/inductiveops.ml7
-rw-r--r--pretyping/inductiveops.mli6
-rw-r--r--pretyping/inferCumulativity.ml2
-rw-r--r--pretyping/inferCumulativity.mli2
-rw-r--r--pretyping/locus.ml2
-rw-r--r--pretyping/locusops.ml2
-rw-r--r--pretyping/locusops.mli2
-rw-r--r--pretyping/nativenorm.ml2
-rw-r--r--pretyping/nativenorm.mli2
-rw-r--r--pretyping/pattern.ml2
-rw-r--r--pretyping/patternops.ml6
-rw-r--r--pretyping/patternops.mli2
-rw-r--r--pretyping/pretype_errors.ml2
-rw-r--r--pretyping/pretype_errors.mli4
-rw-r--r--pretyping/pretyping.ml216
-rw-r--r--pretyping/pretyping.mli14
-rw-r--r--pretyping/program.ml2
-rw-r--r--pretyping/program.mli4
-rw-r--r--pretyping/recordops.ml2
-rw-r--r--pretyping/recordops.mli2
-rw-r--r--pretyping/reductionops.ml6
-rw-r--r--pretyping/reductionops.mli2
-rw-r--r--pretyping/retyping.ml2
-rw-r--r--pretyping/retyping.mli2
-rw-r--r--pretyping/tacred.ml2
-rw-r--r--pretyping/tacred.mli2
-rw-r--r--pretyping/typeclasses.ml4
-rw-r--r--pretyping/typeclasses.mli2
-rw-r--r--pretyping/typeclasses_errors.ml6
-rw-r--r--pretyping/typeclasses_errors.mli4
-rw-r--r--pretyping/typing.ml14
-rw-r--r--pretyping/typing.mli2
-rw-r--r--pretyping/unification.ml8
-rw-r--r--pretyping/unification.mli2
-rw-r--r--pretyping/vnorm.ml2
-rw-r--r--pretyping/vnorm.mli2
-rw-r--r--printing/genprint.ml2
-rw-r--r--printing/genprint.mli2
-rw-r--r--printing/ppconstr.ml59
-rw-r--r--printing/ppconstr.mli3
-rw-r--r--printing/pputils.ml2
-rw-r--r--printing/pputils.mli2
-rw-r--r--printing/prettyp.ml27
-rw-r--r--printing/prettyp.mli2
-rw-r--r--printing/printer.ml2
-rw-r--r--printing/printer.mli2
-rw-r--r--printing/printmod.ml4
-rw-r--r--printing/printmod.mli2
-rw-r--r--printing/proof_diffs.ml4
-rw-r--r--printing/proof_diffs.mli2
-rw-r--r--proofs/clenv.ml2
-rw-r--r--proofs/clenv.mli2
-rw-r--r--proofs/clenvtac.ml4
-rw-r--r--proofs/clenvtac.mli2
-rw-r--r--proofs/evar_refiner.ml2
-rw-r--r--proofs/evar_refiner.mli2
-rw-r--r--proofs/goal.ml2
-rw-r--r--proofs/goal.mli2
-rw-r--r--proofs/goal_select.ml2
-rw-r--r--proofs/goal_select.mli2
-rw-r--r--proofs/logic.ml2
-rw-r--r--proofs/logic.mli2
-rw-r--r--proofs/miscprint.ml2
-rw-r--r--proofs/miscprint.mli2
-rw-r--r--proofs/pfedit.ml36
-rw-r--r--proofs/pfedit.mli4
-rw-r--r--proofs/proof.ml2
-rw-r--r--proofs/proof.mli2
-rw-r--r--proofs/proof_bullet.ml2
-rw-r--r--proofs/proof_bullet.mli2
-rw-r--r--proofs/proof_global.ml216
-rw-r--r--proofs/proof_global.mli91
-rw-r--r--proofs/refine.ml7
-rw-r--r--proofs/refine.mli7
-rw-r--r--proofs/refiner.ml57
-rw-r--r--proofs/refiner.mli31
-rw-r--r--proofs/tacmach.ml11
-rw-r--r--proofs/tacmach.mli6
-rw-r--r--proofs/tactypes.ml2
-rw-r--r--stm/asyncTaskQueue.ml2
-rw-r--r--stm/asyncTaskQueue.mli2
-rw-r--r--stm/coqworkmgrApi.ml2
-rw-r--r--stm/coqworkmgrApi.mli2
-rw-r--r--stm/dag.ml2
-rw-r--r--stm/dag.mli2
-rw-r--r--stm/proofBlockDelimiter.ml10
-rw-r--r--stm/proofBlockDelimiter.mli2
-rw-r--r--stm/spawned.ml2
-rw-r--r--stm/spawned.mli2
-rw-r--r--stm/stm.ml274
-rw-r--r--stm/stm.mli25
-rw-r--r--stm/tQueue.ml2
-rw-r--r--stm/tQueue.mli2
-rw-r--r--stm/vcs.ml2
-rw-r--r--stm/vcs.mli2
-rw-r--r--stm/vernac_classifier.ml114
-rw-r--r--stm/vernac_classifier.mli2
-rw-r--r--stm/vio_checking.ml6
-rw-r--r--stm/vio_checking.mli2
-rw-r--r--stm/workerPool.ml2
-rw-r--r--stm/workerPool.mli2
-rw-r--r--tactics/abstract.ml35
-rw-r--r--tactics/abstract.mli10
-rw-r--r--tactics/auto.ml2
-rw-r--r--tactics/auto.mli2
-rw-r--r--tactics/autorewrite.ml6
-rw-r--r--tactics/autorewrite.mli4
-rw-r--r--tactics/btermdn.ml2
-rw-r--r--tactics/btermdn.mli2
-rw-r--r--tactics/class_tactics.ml2
-rw-r--r--tactics/class_tactics.mli2
-rw-r--r--tactics/contradiction.ml2
-rw-r--r--tactics/contradiction.mli2
-rw-r--r--tactics/declare.ml (renamed from interp/declare.ml)203
-rw-r--r--tactics/declare.mli (renamed from interp/declare.mli)28
-rw-r--r--tactics/dnet.ml2
-rw-r--r--tactics/dnet.mli2
-rw-r--r--tactics/eauto.ml2
-rw-r--r--tactics/eauto.mli2
-rw-r--r--tactics/elim.ml2
-rw-r--r--tactics/elim.mli2
-rw-r--r--tactics/elimschemes.ml44
-rw-r--r--tactics/elimschemes.mli5
-rw-r--r--tactics/eqdecide.ml4
-rw-r--r--tactics/eqdecide.mli2
-rw-r--r--tactics/eqschemes.ml18
-rw-r--r--tactics/eqschemes.mli6
-rw-r--r--tactics/equality.ml63
-rw-r--r--tactics/equality.mli4
-rw-r--r--tactics/genredexpr.ml2
-rw-r--r--tactics/hints.ml4
-rw-r--r--tactics/hints.mli2
-rw-r--r--tactics/hipattern.ml4
-rw-r--r--tactics/hipattern.mli4
-rw-r--r--tactics/ind_tables.ml33
-rw-r--r--tactics/ind_tables.mli12
-rw-r--r--tactics/inv.ml2
-rw-r--r--tactics/inv.mli2
-rw-r--r--tactics/leminv.ml5
-rw-r--r--tactics/leminv.mli2
-rw-r--r--tactics/redexpr.ml2
-rw-r--r--tactics/redexpr.mli2
-rw-r--r--tactics/redops.ml2
-rw-r--r--tactics/redops.mli2
-rw-r--r--tactics/tacticals.ml12
-rw-r--r--tactics/tacticals.mli11
-rw-r--r--tactics/tactics.ml8
-rw-r--r--tactics/tactics.mli2
-rw-r--r--tactics/tactics.mllib1
-rw-r--r--tactics/term_dnet.ml2
-rw-r--r--tactics/term_dnet.mli2
-rw-r--r--test-suite/Makefile57
-rw-r--r--test-suite/README.md4
-rw-r--r--test-suite/bugs/closed/bug_10161.v8
-rw-r--r--test-suite/bugs/closed/bug_10197.v16
-rw-r--r--test-suite/bugs/closed/bug_10225.v7
-rw-r--r--test-suite/bugs/closed/bug_10264.v10
-rw-r--r--test-suite/bugs/closed/bug_1618.v1
-rw-r--r--test-suite/bugs/closed/bug_2137.v2
-rw-r--r--test-suite/bugs/closed/bug_2603.v2
-rw-r--r--test-suite/bugs/closed/bug_3080.v2
-rw-r--r--test-suite/bugs/closed/bug_3810.v6
-rw-r--r--test-suite/bugs/closed/bug_4306.v2
-rw-r--r--test-suite/bugs/closed/bug_4503.v2
-rw-r--r--test-suite/bugs/closed/bug_4720.v2
-rw-r--r--test-suite/bugs/closed/bug_4798.v5
-rw-r--r--test-suite/bugs/closed/bug_4869.v2
-rw-r--r--test-suite/bugs/closed/bug_5123.v2
-rw-r--r--test-suite/bugs/closed/bug_5149.v2
-rw-r--r--test-suite/bugs/closed/bug_808_2411.v2
-rw-r--r--test-suite/bugs/closed/bug_8725.v2
-rw-r--r--test-suite/bugs/closed/bug_9166.v5
-rw-r--r--test-suite/dune1
-rw-r--r--test-suite/failure/Tauto.v2
-rw-r--r--test-suite/failure/clash_cons.v2
-rw-r--r--test-suite/failure/fixpoint1.v2
-rw-r--r--test-suite/failure/guard.v2
-rw-r--r--test-suite/failure/illtype1.v2
-rw-r--r--test-suite/failure/positivity.v2
-rw-r--r--test-suite/failure/redef.v2
-rw-r--r--test-suite/failure/search.v2
-rw-r--r--test-suite/ideal-features/Apply.v2
-rw-r--r--test-suite/interactive/ParalITP_smallproofs.v6
-rw-r--r--test-suite/ltac2/notations.v24
-rwxr-xr-xtest-suite/misc/changelog.sh5
-rw-r--r--test-suite/misc/poly-capture-global-univs/src/evilImpl.ml4
-rwxr-xr-xtest-suite/misc/printers.sh8
-rwxr-xr-xtest-suite/misc/quotation_token.sh31
-rw-r--r--test-suite/misc/quotation_token/.gitignore2
-rw-r--r--test-suite/misc/quotation_token/_CoqProject6
-rw-r--r--test-suite/misc/quotation_token/src/quotation.mlg12
-rw-r--r--test-suite/misc/quotation_token/src/quotation_plugin.mlpack1
-rw-r--r--test-suite/misc/quotation_token/theories/quotation.v13
-rw-r--r--test-suite/output/Notations3.v2
-rw-r--r--test-suite/output/injection.out4
-rw-r--r--test-suite/output/injection.v8
-rw-r--r--test-suite/output/ssr_explain_match.v2
-rw-r--r--test-suite/prerequisite/ssr_mini_mathcomp.v2
-rw-r--r--test-suite/prerequisite/ssr_ssrsyntax1.v2
-rw-r--r--test-suite/ssr/absevarprop.v2
-rw-r--r--test-suite/ssr/abstract_var2.v2
-rw-r--r--test-suite/ssr/binders.v2
-rw-r--r--test-suite/ssr/binders_of.v2
-rw-r--r--test-suite/ssr/case_polyuniv.v12
-rw-r--r--test-suite/ssr/caseview.v2
-rw-r--r--test-suite/ssr/congr.v2
-rw-r--r--test-suite/ssr/deferclear.v2
-rw-r--r--test-suite/ssr/dependent_type_err.v2
-rw-r--r--test-suite/ssr/derive_inversion.v2
-rw-r--r--test-suite/ssr/elim.v2
-rw-r--r--test-suite/ssr/elim2.v2
-rw-r--r--test-suite/ssr/elim_pattern.v2
-rw-r--r--test-suite/ssr/first_n.v2
-rw-r--r--test-suite/ssr/gen_have.v2
-rw-r--r--test-suite/ssr/gen_pattern.v2
-rw-r--r--test-suite/ssr/have_TC.v2
-rw-r--r--test-suite/ssr/have_transp.v2
-rw-r--r--test-suite/ssr/have_view_idiom.v2
-rw-r--r--test-suite/ssr/havesuff.v2
-rw-r--r--test-suite/ssr/if_isnt.v2
-rw-r--r--test-suite/ssr/intro_beta.v2
-rw-r--r--test-suite/ssr/intro_noop.v2
-rw-r--r--test-suite/ssr/ipatalternation.v2
-rw-r--r--test-suite/ssr/ltac_have.v2
-rw-r--r--test-suite/ssr/ltac_in.v2
-rw-r--r--test-suite/ssr/move_after.v2
-rw-r--r--test-suite/ssr/multiview.v2
-rw-r--r--test-suite/ssr/occarrow.v2
-rw-r--r--test-suite/ssr/patnoX.v2
-rw-r--r--test-suite/ssr/pattern.v2
-rw-r--r--test-suite/ssr/primproj.v2
-rw-r--r--test-suite/ssr/rewpatterns.v2
-rw-r--r--test-suite/ssr/set_lamda.v2
-rw-r--r--test-suite/ssr/set_pattern.v2
-rw-r--r--test-suite/ssr/ssrsyntax2.v2
-rw-r--r--test-suite/ssr/tc.v2
-rw-r--r--test-suite/ssr/typeof.v2
-rw-r--r--test-suite/ssr/unfold_Opaque.v2
-rw-r--r--test-suite/ssr/unfold_fold_polyuniv.v40
-rw-r--r--test-suite/ssr/unkeyed.v2
-rw-r--r--test-suite/ssr/view_case.v2
-rw-r--r--test-suite/ssr/wlog_suff.v2
-rw-r--r--test-suite/ssr/wlogletin.v2
-rw-r--r--test-suite/ssr/wlong_intro.v2
-rw-r--r--test-suite/stm/Nijmegen_QArithSternBrocot_Zaux.v6
-rw-r--r--test-suite/success/BidirectionalityHints.v114
-rw-r--r--test-suite/success/Case15.v2
-rw-r--r--test-suite/success/Case18.v5
-rw-r--r--test-suite/success/CasesDep.v4
-rw-r--r--test-suite/success/Check.v2
-rw-r--r--test-suite/success/Discriminate_HoTT.v89
-rw-r--r--test-suite/success/Field.v2
-rw-r--r--test-suite/success/Hints.v2
-rw-r--r--test-suite/success/Inversion.v2
-rw-r--r--test-suite/success/LocalDefinition.v53
-rw-r--r--test-suite/success/NotationDeprecation.v62
-rw-r--r--test-suite/success/Reordering.v2
-rw-r--r--test-suite/success/Tauto.v2
-rw-r--r--test-suite/success/TestRefine.v2
-rw-r--r--test-suite/success/eauto.v2
-rw-r--r--test-suite/success/eqdecide.v2
-rw-r--r--test-suite/success/extraction.v2
-rw-r--r--test-suite/success/extraction_dep.v2
-rw-r--r--test-suite/success/goal_selector.v8
-rw-r--r--test-suite/success/if.v2
-rw-r--r--test-suite/success/inds_type_sec.v2
-rw-r--r--test-suite/success/induct.v2
-rw-r--r--test-suite/success/mutual_ind.v2
-rw-r--r--test-suite/success/unfold.v2
-rw-r--r--test-suite/typeclasses/NewSetoid.v2
-rw-r--r--test-suite/unit-tests/ide/lex_tests.ml50
-rw-r--r--test-suite/vio/section.v12
-rw-r--r--theories/Arith/Arith.v2
-rw-r--r--theories/Arith/Arith_base.v2
-rw-r--r--theories/Arith/Between.v2
-rw-r--r--theories/Arith/Bool_nat.v2
-rw-r--r--theories/Arith/Compare.v2
-rw-r--r--theories/Arith/Compare_dec.v2
-rw-r--r--theories/Arith/Div2.v2
-rw-r--r--theories/Arith/EqNat.v2
-rw-r--r--theories/Arith/Euclid.v2
-rw-r--r--theories/Arith/Even.v2
-rw-r--r--theories/Arith/Factorial.v2
-rw-r--r--theories/Arith/Gt.v2
-rw-r--r--theories/Arith/Le.v2
-rw-r--r--theories/Arith/Lt.v2
-rw-r--r--theories/Arith/Max.v2
-rw-r--r--theories/Arith/Min.v2
-rw-r--r--theories/Arith/Minus.v2
-rw-r--r--theories/Arith/Mult.v2
-rw-r--r--theories/Arith/PeanoNat.v2
-rw-r--r--theories/Arith/Peano_dec.v4
-rw-r--r--theories/Arith/Plus.v2
-rw-r--r--theories/Arith/Wf_nat.v2
-rw-r--r--theories/Bool/Bool.v2
-rw-r--r--theories/Bool/BoolEq.v2
-rw-r--r--theories/Bool/Bvector.v2
-rw-r--r--theories/Bool/DecBool.v2
-rw-r--r--theories/Bool/IfProp.v2
-rw-r--r--theories/Bool/Sumbool.v2
-rw-r--r--theories/Bool/Zerob.v2
-rw-r--r--theories/Classes/CEquivalence.v2
-rw-r--r--theories/Classes/CMorphisms.v2
-rw-r--r--theories/Classes/CRelationClasses.v4
-rw-r--r--theories/Classes/DecidableClass.v2
-rw-r--r--theories/Classes/EquivDec.v10
-rw-r--r--theories/Classes/Equivalence.v2
-rw-r--r--theories/Classes/Init.v2
-rw-r--r--theories/Classes/Morphisms.v2
-rw-r--r--theories/Classes/Morphisms_Prop.v2
-rw-r--r--theories/Classes/Morphisms_Relations.v2
-rw-r--r--theories/Classes/RelationClasses.v6
-rw-r--r--theories/Classes/RelationPairs.v2
-rw-r--r--theories/Classes/SetoidClass.v2
-rw-r--r--theories/Classes/SetoidDec.v4
-rw-r--r--theories/Classes/SetoidTactics.v2
-rw-r--r--theories/Compat/AdmitAxiom.v2
-rw-r--r--theories/Compat/Coq810.v2
-rw-r--r--theories/Compat/Coq88.v2
-rw-r--r--theories/Compat/Coq89.v2
-rw-r--r--theories/FSets/FMapAVL.v2
-rw-r--r--theories/FSets/FMapFacts.v6
-rw-r--r--theories/FSets/FMapFullAVL.v2
-rw-r--r--theories/FSets/FMapInterface.v4
-rw-r--r--theories/FSets/FMapList.v2
-rw-r--r--theories/FSets/FMapPositive.v10
-rw-r--r--theories/FSets/FMapWeakList.v2
-rw-r--r--theories/FSets/FMaps.v2
-rw-r--r--theories/FSets/FSetAVL.v2
-rw-r--r--theories/FSets/FSetBridge.v2
-rw-r--r--theories/FSets/FSetCompat.v2
-rw-r--r--theories/FSets/FSetDecide.v4
-rw-r--r--theories/FSets/FSetEqProperties.v2
-rw-r--r--theories/FSets/FSetFacts.v2
-rw-r--r--theories/FSets/FSetInterface.v2
-rw-r--r--theories/FSets/FSetList.v2
-rw-r--r--theories/FSets/FSetPositive.v30
-rw-r--r--theories/FSets/FSetProperties.v2
-rw-r--r--theories/FSets/FSetToFiniteSet.v2
-rw-r--r--theories/FSets/FSetWeakList.v2
-rw-r--r--theories/FSets/FSets.v2
-rw-r--r--theories/Init/Byte.v2
-rw-r--r--theories/Init/Datatypes.v2
-rw-r--r--theories/Init/Decimal.v2
-rw-r--r--theories/Init/Logic.v4
-rw-r--r--theories/Init/Logic_Type.v2
-rw-r--r--theories/Init/Nat.v4
-rw-r--r--theories/Init/Notations.v2
-rw-r--r--theories/Init/Peano.v2
-rw-r--r--theories/Init/Prelude.v2
-rw-r--r--theories/Init/Specif.v2
-rw-r--r--theories/Init/Tactics.v4
-rw-r--r--theories/Init/Wf.v2
-rw-r--r--theories/Lists/List.v28
-rw-r--r--theories/Lists/ListDec.v2
-rw-r--r--theories/Lists/ListSet.v2
-rw-r--r--theories/Lists/ListTactics.v2
-rw-r--r--theories/Lists/SetoidList.v2
-rw-r--r--theories/Lists/SetoidPermutation.v2
-rw-r--r--theories/Lists/StreamMemo.v4
-rw-r--r--theories/Lists/Streams.v2
-rw-r--r--theories/Logic/Berardi.v5
-rw-r--r--theories/Logic/ChoiceFacts.v2
-rw-r--r--theories/Logic/Classical.v2
-rw-r--r--theories/Logic/ClassicalChoice.v2
-rw-r--r--theories/Logic/ClassicalDescription.v2
-rw-r--r--theories/Logic/ClassicalEpsilon.v2
-rw-r--r--theories/Logic/ClassicalFacts.v4
-rw-r--r--theories/Logic/ClassicalUniqueChoice.v2
-rw-r--r--theories/Logic/Classical_Pred_Type.v2
-rw-r--r--theories/Logic/Classical_Prop.v2
-rw-r--r--theories/Logic/ConstructiveEpsilon.v2
-rw-r--r--theories/Logic/Decidable.v2
-rw-r--r--theories/Logic/Description.v2
-rw-r--r--theories/Logic/Diaconescu.v2
-rw-r--r--theories/Logic/Epsilon.v2
-rw-r--r--theories/Logic/Eqdep.v2
-rw-r--r--theories/Logic/EqdepFacts.v2
-rw-r--r--theories/Logic/Eqdep_dec.v2
-rw-r--r--theories/Logic/ExtensionalFunctionRepresentative.v2
-rw-r--r--theories/Logic/ExtensionalityFacts.v2
-rw-r--r--theories/Logic/FinFun.v2
-rw-r--r--theories/Logic/FunctionalExtensionality.v2
-rw-r--r--theories/Logic/Hurkens.v2
-rw-r--r--theories/Logic/IndefiniteDescription.v2
-rw-r--r--theories/Logic/JMeq.v2
-rw-r--r--theories/Logic/ProofIrrelevance.v2
-rw-r--r--theories/Logic/ProofIrrelevanceFacts.v2
-rw-r--r--theories/Logic/PropExtensionality.v2
-rw-r--r--theories/Logic/PropExtensionalityFacts.v2
-rw-r--r--theories/Logic/PropFacts.v2
-rw-r--r--theories/Logic/RelationalChoice.v2
-rw-r--r--theories/Logic/SetIsType.v2
-rw-r--r--theories/Logic/SetoidChoice.v2
-rw-r--r--theories/Logic/StrictProp.v2
-rw-r--r--theories/Logic/WKL.v2
-rw-r--r--theories/Logic/WeakFan.v4
-rw-r--r--theories/MSets/MSetAVL.v2
-rw-r--r--theories/MSets/MSetDecide.v4
-rw-r--r--theories/MSets/MSetEqProperties.v2
-rw-r--r--theories/MSets/MSetFacts.v2
-rw-r--r--theories/MSets/MSetGenTree.v4
-rw-r--r--theories/MSets/MSetInterface.v4
-rw-r--r--theories/MSets/MSetList.v2
-rw-r--r--theories/MSets/MSetPositive.v30
-rw-r--r--theories/MSets/MSetProperties.v2
-rw-r--r--theories/MSets/MSetRBT.v4
-rw-r--r--theories/MSets/MSetToFiniteSet.v2
-rw-r--r--theories/MSets/MSetWeakList.v2
-rw-r--r--theories/MSets/MSets.v2
-rw-r--r--theories/NArith/BinNat.v2
-rw-r--r--theories/NArith/BinNatDef.v4
-rw-r--r--theories/NArith/NArith.v2
-rw-r--r--theories/NArith/Ndec.v2
-rw-r--r--theories/NArith/Ndigits.v2
-rw-r--r--theories/NArith/Ndist.v2
-rw-r--r--theories/NArith/Ndiv_def.v2
-rw-r--r--theories/NArith/Ngcd_def.v2
-rw-r--r--theories/NArith/Nnat.v2
-rw-r--r--theories/NArith/Nsqrt_def.v2
-rw-r--r--theories/Numbers/AltBinNotations.v4
-rw-r--r--theories/Numbers/BinNums.v2
-rw-r--r--theories/Numbers/Cyclic/Abstract/CyclicAxioms.v2
-rw-r--r--theories/Numbers/Cyclic/Abstract/DoubleType.v2
-rw-r--r--theories/Numbers/Cyclic/Abstract/NZCyclic.v2
-rw-r--r--theories/Numbers/Cyclic/Int31/Cyclic31.v4
-rw-r--r--theories/Numbers/Cyclic/Int31/Int31.v4
-rw-r--r--theories/Numbers/Cyclic/Int31/Ring31.v2
-rw-r--r--theories/Numbers/Cyclic/Int63/Cyclic63.v10
-rw-r--r--theories/Numbers/Cyclic/Int63/Int63.v2
-rw-r--r--theories/Numbers/Cyclic/Int63/Ring63.v10
-rw-r--r--theories/Numbers/Cyclic/ZModulo/ZModulo.v8
-rw-r--r--theories/Numbers/DecimalFacts.v2
-rw-r--r--theories/Numbers/DecimalN.v2
-rw-r--r--theories/Numbers/DecimalNat.v2
-rw-r--r--theories/Numbers/DecimalPos.v2
-rw-r--r--theories/Numbers/DecimalString.v2
-rw-r--r--theories/Numbers/DecimalZ.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZAdd.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZAddOrder.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZAxioms.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZBase.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZBits.v4
-rw-r--r--theories/Numbers/Integer/Abstract/ZDivEucl.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZDivFloor.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZDivTrunc.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZGcd.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZLcm.v4
-rw-r--r--theories/Numbers/Integer/Abstract/ZLt.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZMaxMin.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZMul.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZMulOrder.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZParity.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZPow.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZProperties.v2
-rw-r--r--theories/Numbers/Integer/Abstract/ZSgnAbs.v2
-rw-r--r--theories/Numbers/Integer/Binary/ZBinary.v2
-rw-r--r--theories/Numbers/Integer/NatPairs/ZNatPairs.v2
-rw-r--r--theories/Numbers/NaryFunctions.v2
-rw-r--r--theories/Numbers/NatInt/NZAdd.v2
-rw-r--r--theories/Numbers/NatInt/NZAddOrder.v4
-rw-r--r--theories/Numbers/NatInt/NZAxioms.v2
-rw-r--r--theories/Numbers/NatInt/NZBase.v2
-rw-r--r--theories/Numbers/NatInt/NZBits.v2
-rw-r--r--theories/Numbers/NatInt/NZDiv.v2
-rw-r--r--theories/Numbers/NatInt/NZDomain.v4
-rw-r--r--theories/Numbers/NatInt/NZGcd.v2
-rw-r--r--theories/Numbers/NatInt/NZLog.v2
-rw-r--r--theories/Numbers/NatInt/NZMul.v2
-rw-r--r--theories/Numbers/NatInt/NZMulOrder.v2
-rw-r--r--theories/Numbers/NatInt/NZOrder.v2
-rw-r--r--theories/Numbers/NatInt/NZParity.v2
-rw-r--r--theories/Numbers/NatInt/NZPow.v2
-rw-r--r--theories/Numbers/NatInt/NZProperties.v2
-rw-r--r--theories/Numbers/NatInt/NZSqrt.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NAdd.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NAddOrder.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NAxioms.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NBase.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NBits.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NDefOps.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NDiv.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NGcd.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NIso.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NLcm.v4
-rw-r--r--theories/Numbers/Natural/Abstract/NLog.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NMaxMin.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NMulOrder.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NOrder.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NParity.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NPow.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NProperties.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NSqrt.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NStrongRec.v2
-rw-r--r--theories/Numbers/Natural/Abstract/NSub.v2
-rw-r--r--theories/Numbers/Natural/Binary/NBinary.v2
-rw-r--r--theories/Numbers/Natural/Peano/NPeano.v2
-rw-r--r--theories/Numbers/NumPrelude.v2
-rw-r--r--theories/PArith/BinPos.v2
-rw-r--r--theories/PArith/BinPosDef.v4
-rw-r--r--theories/PArith/PArith.v2
-rw-r--r--theories/PArith/POrderedType.v2
-rw-r--r--theories/PArith/Pnat.v2
-rw-r--r--theories/Program/Basics.v2
-rw-r--r--theories/Program/Combinators.v2
-rw-r--r--theories/Program/Equality.v8
-rw-r--r--theories/Program/Program.v2
-rw-r--r--theories/Program/Subset.v2
-rw-r--r--theories/Program/Syntax.v2
-rw-r--r--theories/Program/Tactics.v2
-rw-r--r--theories/Program/Utils.v2
-rw-r--r--theories/Program/Wf.v2
-rw-r--r--theories/QArith/QArith.v2
-rw-r--r--theories/QArith/QArith_base.v2
-rw-r--r--theories/QArith/QOrderedType.v2
-rw-r--r--theories/QArith/Qabs.v2
-rw-r--r--theories/QArith/Qcabs.v2
-rw-r--r--theories/QArith/Qcanon.v10
-rw-r--r--theories/QArith/Qfield.v2
-rw-r--r--theories/QArith/Qminmax.v2
-rw-r--r--theories/QArith/Qpower.v2
-rw-r--r--theories/QArith/Qreals.v2
-rw-r--r--theories/QArith/Qreduction.v2
-rw-r--r--theories/QArith/Qring.v2
-rw-r--r--theories/QArith/Qround.v2
-rw-r--r--theories/Reals/Alembert.v2
-rw-r--r--theories/Reals/AltSeries.v2
-rw-r--r--theories/Reals/ArithProp.v2
-rw-r--r--theories/Reals/Binomial.v2
-rw-r--r--theories/Reals/Cauchy_prod.v2
-rw-r--r--theories/Reals/Cos_plus.v2
-rw-r--r--theories/Reals/Cos_rel.v2
-rw-r--r--theories/Reals/DiscrR.v2
-rw-r--r--theories/Reals/Exp_prop.v2
-rw-r--r--theories/Reals/Integration.v2
-rw-r--r--theories/Reals/MVT.v2
-rw-r--r--theories/Reals/Machin.v2
-rw-r--r--theories/Reals/NewtonInt.v2
-rw-r--r--theories/Reals/PSeries_reg.v2
-rw-r--r--theories/Reals/PartSum.v2
-rw-r--r--theories/Reals/RIneq.v8
-rw-r--r--theories/Reals/RList.v2
-rw-r--r--theories/Reals/ROrderedType.v2
-rw-r--r--theories/Reals/R_Ifp.v2
-rw-r--r--theories/Reals/R_sqr.v2
-rw-r--r--theories/Reals/R_sqrt.v2
-rw-r--r--theories/Reals/Ranalysis.v2
-rw-r--r--theories/Reals/Ranalysis1.v2
-rw-r--r--theories/Reals/Ranalysis2.v2
-rw-r--r--theories/Reals/Ranalysis3.v2
-rw-r--r--theories/Reals/Ranalysis4.v2
-rw-r--r--theories/Reals/Ranalysis5.v2
-rw-r--r--theories/Reals/Ranalysis_reg.v2
-rw-r--r--theories/Reals/Ratan.v2
-rw-r--r--theories/Reals/Raxioms.v2
-rw-r--r--theories/Reals/Rbase.v2
-rw-r--r--theories/Reals/Rbasic_fun.v2
-rw-r--r--theories/Reals/Rcomplete.v2
-rw-r--r--theories/Reals/Rdefinitions.v2
-rw-r--r--theories/Reals/Rderiv.v2
-rw-r--r--theories/Reals/Reals.v2
-rw-r--r--theories/Reals/Rfunctions.v2
-rw-r--r--theories/Reals/Rgeom.v2
-rw-r--r--theories/Reals/RiemannInt.v2
-rw-r--r--theories/Reals/RiemannInt_SF.v2
-rw-r--r--theories/Reals/Rlimit.v2
-rw-r--r--theories/Reals/Rlogic.v2
-rw-r--r--theories/Reals/Rminmax.v2
-rw-r--r--theories/Reals/Rpow_def.v2
-rw-r--r--theories/Reals/Rpower.v2
-rw-r--r--theories/Reals/Rprod.v2
-rw-r--r--theories/Reals/Rseries.v2
-rw-r--r--theories/Reals/Rsigma.v2
-rw-r--r--theories/Reals/Rsqrt_def.v2
-rw-r--r--theories/Reals/Rtopology.v2
-rw-r--r--theories/Reals/Rtrigo.v2
-rw-r--r--theories/Reals/Rtrigo1.v2
-rw-r--r--theories/Reals/Rtrigo_alt.v2
-rw-r--r--theories/Reals/Rtrigo_calc.v2
-rw-r--r--theories/Reals/Rtrigo_def.v2
-rw-r--r--theories/Reals/Rtrigo_fun.v2
-rw-r--r--theories/Reals/Rtrigo_reg.v2
-rw-r--r--theories/Reals/Runcountable.v2
-rw-r--r--theories/Reals/SeqProp.v2
-rw-r--r--theories/Reals/SeqSeries.v2
-rw-r--r--theories/Reals/SplitAbsolu.v2
-rw-r--r--theories/Reals/SplitRmult.v2
-rw-r--r--theories/Reals/Sqrt_reg.v2
-rw-r--r--theories/Relations/Operators_Properties.v2
-rw-r--r--theories/Relations/Relation_Definitions.v2
-rw-r--r--theories/Relations/Relation_Operators.v2
-rw-r--r--theories/Relations/Relations.v2
-rw-r--r--theories/Setoids/Setoid.v2
-rw-r--r--theories/Sets/Classical_sets.v2
-rw-r--r--theories/Sets/Constructive_sets.v2
-rw-r--r--theories/Sets/Cpo.v2
-rw-r--r--theories/Sets/Ensembles.v2
-rw-r--r--theories/Sets/Finite_sets.v2
-rw-r--r--theories/Sets/Finite_sets_facts.v2
-rw-r--r--theories/Sets/Image.v2
-rw-r--r--theories/Sets/Infinite_sets.v2
-rw-r--r--theories/Sets/Integers.v2
-rw-r--r--theories/Sets/Multiset.v2
-rw-r--r--theories/Sets/Partial_Order.v2
-rw-r--r--theories/Sets/Permut.v2
-rw-r--r--theories/Sets/Powerset.v2
-rw-r--r--theories/Sets/Powerset_Classical_facts.v2
-rw-r--r--theories/Sets/Powerset_facts.v2
-rw-r--r--theories/Sets/Relations_1.v2
-rw-r--r--theories/Sets/Relations_1_facts.v2
-rw-r--r--theories/Sets/Relations_2.v2
-rw-r--r--theories/Sets/Relations_2_facts.v2
-rw-r--r--theories/Sets/Relations_3.v2
-rw-r--r--theories/Sets/Relations_3_facts.v2
-rw-r--r--theories/Sets/Uniset.v2
-rw-r--r--theories/Sorting/Heap.v2
-rw-r--r--theories/Sorting/Mergesort.v2
-rw-r--r--theories/Sorting/PermutEq.v2
-rw-r--r--theories/Sorting/PermutSetoid.v4
-rw-r--r--theories/Sorting/Permutation.v10
-rw-r--r--theories/Sorting/Sorted.v2
-rw-r--r--theories/Sorting/Sorting.v2
-rw-r--r--theories/Strings/Ascii.v2
-rw-r--r--theories/Strings/BinaryString.v10
-rw-r--r--theories/Strings/Byte.v2
-rw-r--r--theories/Strings/ByteVector.v2
-rw-r--r--theories/Strings/HexString.v10
-rw-r--r--theories/Strings/OctalString.v10
-rw-r--r--theories/Strings/String.v12
-rw-r--r--theories/Structures/DecidableType.v2
-rw-r--r--theories/Structures/DecidableTypeEx.v2
-rw-r--r--theories/Structures/Equalities.v2
-rw-r--r--theories/Structures/EqualitiesFacts.v2
-rw-r--r--theories/Structures/GenericMinMax.v2
-rw-r--r--theories/Structures/OrderedType.v4
-rw-r--r--theories/Structures/OrderedTypeAlt.v2
-rw-r--r--theories/Structures/OrderedTypeEx.v2
-rw-r--r--theories/Structures/Orders.v2
-rw-r--r--theories/Structures/OrdersAlt.v2
-rw-r--r--theories/Structures/OrdersEx.v2
-rw-r--r--theories/Structures/OrdersFacts.v4
-rw-r--r--theories/Structures/OrdersLists.v2
-rw-r--r--theories/Structures/OrdersTac.v4
-rw-r--r--theories/Unicode/Utf8.v2
-rw-r--r--theories/Unicode/Utf8_core.v2
-rw-r--r--theories/Vectors/Fin.v4
-rw-r--r--theories/Vectors/Vector.v2
-rw-r--r--theories/Vectors/VectorDef.v5
-rw-r--r--theories/Vectors/VectorEq.v2
-rw-r--r--theories/Vectors/VectorSpec.v2
-rw-r--r--theories/Wellfounded/Disjoint_Union.v2
-rw-r--r--theories/Wellfounded/Inclusion.v2
-rw-r--r--theories/Wellfounded/Inverse_Image.v2
-rw-r--r--theories/Wellfounded/Lexicographic_Exponentiation.v2
-rw-r--r--theories/Wellfounded/Lexicographic_Product.v8
-rw-r--r--theories/Wellfounded/Transitive_Closure.v2
-rw-r--r--theories/Wellfounded/Union.v2
-rw-r--r--theories/Wellfounded/Well_Ordering.v2
-rw-r--r--theories/Wellfounded/Wellfounded.v2
-rw-r--r--theories/ZArith/BinInt.v4
-rw-r--r--theories/ZArith/BinIntDef.v4
-rw-r--r--theories/ZArith/Int.v4
-rw-r--r--theories/ZArith/Wf_Z.v2
-rw-r--r--theories/ZArith/ZArith.v2
-rw-r--r--theories/ZArith/ZArith_base.v2
-rw-r--r--theories/ZArith/ZArith_dec.v2
-rw-r--r--theories/ZArith/Zabs.v2
-rw-r--r--theories/ZArith/Zbool.v2
-rw-r--r--theories/ZArith/Zcompare.v2
-rw-r--r--theories/ZArith/Zcomplements.v2
-rw-r--r--theories/ZArith/Zdigits.v2
-rw-r--r--theories/ZArith/Zdiv.v2
-rw-r--r--theories/ZArith/Zeuclid.v2
-rw-r--r--theories/ZArith/Zeven.v2
-rw-r--r--theories/ZArith/Zgcd_alt.v2
-rw-r--r--theories/ZArith/Zhints.v2
-rw-r--r--theories/ZArith/Zlogarithm.v2
-rw-r--r--theories/ZArith/Zmax.v2
-rw-r--r--theories/ZArith/Zmin.v2
-rw-r--r--theories/ZArith/Zminmax.v2
-rw-r--r--theories/ZArith/Zmisc.v2
-rw-r--r--theories/ZArith/Znat.v2
-rw-r--r--theories/ZArith/Znumtheory.v2
-rw-r--r--theories/ZArith/Zorder.v2
-rw-r--r--theories/ZArith/Zpow_alt.v2
-rw-r--r--theories/ZArith/Zpow_def.v2
-rw-r--r--theories/ZArith/Zpow_facts.v2
-rw-r--r--theories/ZArith/Zpower.v2
-rw-r--r--theories/ZArith/Zquot.v4
-rw-r--r--theories/ZArith/Zsqrt_compat.v2
-rw-r--r--theories/ZArith/Zwf.v2
-rw-r--r--theories/ZArith/auxiliary.v2
-rw-r--r--tools/CoqMakefile.in2
-rw-r--r--tools/coq_dune.ml3
-rw-r--r--tools/coq_makefile.ml2
-rw-r--r--tools/coq_tex.ml2
-rw-r--r--tools/coqdep.ml4
-rw-r--r--tools/coqdep_boot.ml2
-rw-r--r--tools/coqdep_common.ml2
-rw-r--r--tools/coqdep_common.mli2
-rw-r--r--tools/coqdep_lexer.mli2
-rw-r--r--tools/coqdep_lexer.mll2
-rw-r--r--tools/coqdoc/alpha.ml2
-rw-r--r--tools/coqdoc/alpha.mli2
-rw-r--r--tools/coqdoc/cdglobals.ml2
-rw-r--r--tools/coqdoc/cpretty.mli2
-rw-r--r--tools/coqdoc/cpretty.mll2
-rw-r--r--tools/coqdoc/index.ml2
-rw-r--r--tools/coqdoc/index.mli2
-rw-r--r--tools/coqdoc/main.ml2
-rw-r--r--tools/coqdoc/output.ml4
-rw-r--r--tools/coqdoc/output.mli2
-rw-r--r--tools/coqdoc/tokens.ml2
-rw-r--r--tools/coqdoc/tokens.mli4
-rw-r--r--tools/coqwc.mll4
-rw-r--r--tools/coqworkmgr.ml2
-rw-r--r--tools/ocamllibdep.mll2
-rw-r--r--topbin/coqc_bin.ml2
-rw-r--r--topbin/coqproofworker_bin.ml2
-rw-r--r--topbin/coqqueryworker_bin.ml2
-rw-r--r--topbin/coqtacticworker_bin.ml2
-rw-r--r--topbin/coqtop_bin.ml2
-rw-r--r--topbin/coqtop_byte_bin.ml2
-rw-r--r--topbin/dune2
-rw-r--r--toplevel/ccompile.ml8
-rw-r--r--toplevel/ccompile.mli2
-rw-r--r--toplevel/coqargs.ml35
-rw-r--r--toplevel/coqargs.mli8
-rw-r--r--toplevel/coqc.ml6
-rw-r--r--toplevel/coqc.mli2
-rw-r--r--toplevel/coqcargs.ml7
-rw-r--r--toplevel/coqcargs.mli2
-rw-r--r--toplevel/coqinit.ml20
-rw-r--r--toplevel/coqinit.mli6
-rw-r--r--toplevel/coqloop.ml2
-rw-r--r--toplevel/coqloop.mli4
-rw-r--r--toplevel/coqtop.ml6
-rw-r--r--toplevel/coqtop.mli2
-rw-r--r--toplevel/g_toplevel.mlg2
-rw-r--r--toplevel/usage.ml19
-rw-r--r--toplevel/usage.mli2
-rw-r--r--toplevel/vernac.ml4
-rw-r--r--toplevel/vernac.mli2
-rw-r--r--toplevel/workerLoop.ml2
-rw-r--r--toplevel/workerLoop.mli2
-rw-r--r--user-contrib/Ltac2/Array.v10
-rw-r--r--user-contrib/Ltac2/Char.v10
-rw-r--r--user-contrib/Ltac2/Constr.v16
-rw-r--r--user-contrib/Ltac2/Control.v10
-rw-r--r--user-contrib/Ltac2/Env.v10
-rw-r--r--user-contrib/Ltac2/Fresh.v10
-rw-r--r--user-contrib/Ltac2/Ident.v10
-rwxr-xr-xuser-contrib/Ltac2/Init.v10
-rw-r--r--user-contrib/Ltac2/Int.v10
-rw-r--r--user-contrib/Ltac2/Ltac1.v10
-rw-r--r--user-contrib/Ltac2/Ltac2.v10
-rw-r--r--user-contrib/Ltac2/Message.v10
-rw-r--r--user-contrib/Ltac2/Notations.v10
-rw-r--r--user-contrib/Ltac2/Pattern.v12
-rw-r--r--user-contrib/Ltac2/Std.v12
-rw-r--r--user-contrib/Ltac2/String.v10
-rw-r--r--user-contrib/Ltac2/g_ltac2.mlg46
-rw-r--r--user-contrib/Ltac2/tac2core.ml21
-rw-r--r--user-contrib/Ltac2/tac2core.mli10
-rw-r--r--user-contrib/Ltac2/tac2dyn.ml10
-rw-r--r--user-contrib/Ltac2/tac2dyn.mli10
-rw-r--r--user-contrib/Ltac2/tac2entries.ml17
-rw-r--r--user-contrib/Ltac2/tac2entries.mli13
-rw-r--r--user-contrib/Ltac2/tac2env.ml10
-rw-r--r--user-contrib/Ltac2/tac2env.mli10
-rw-r--r--user-contrib/Ltac2/tac2expr.mli12
-rw-r--r--user-contrib/Ltac2/tac2extffi.ml10
-rw-r--r--user-contrib/Ltac2/tac2extffi.mli10
-rw-r--r--user-contrib/Ltac2/tac2ffi.ml10
-rw-r--r--user-contrib/Ltac2/tac2ffi.mli10
-rw-r--r--user-contrib/Ltac2/tac2intern.ml12
-rw-r--r--user-contrib/Ltac2/tac2intern.mli10
-rw-r--r--user-contrib/Ltac2/tac2interp.ml10
-rw-r--r--user-contrib/Ltac2/tac2interp.mli10
-rw-r--r--user-contrib/Ltac2/tac2match.ml10
-rw-r--r--user-contrib/Ltac2/tac2match.mli10
-rw-r--r--user-contrib/Ltac2/tac2print.ml12
-rw-r--r--user-contrib/Ltac2/tac2print.mli10
-rw-r--r--user-contrib/Ltac2/tac2qexpr.mli10
-rw-r--r--user-contrib/Ltac2/tac2quote.ml18
-rw-r--r--user-contrib/Ltac2/tac2quote.mli12
-rw-r--r--user-contrib/Ltac2/tac2stdlib.ml10
-rw-r--r--user-contrib/Ltac2/tac2stdlib.mli10
-rw-r--r--user-contrib/Ltac2/tac2tactics.ml10
-rw-r--r--user-contrib/Ltac2/tac2tactics.mli10
-rw-r--r--user-contrib/Ltac2/tac2types.mli10
-rw-r--r--vernac/assumptions.ml6
-rw-r--r--vernac/assumptions.mli2
-rw-r--r--vernac/attributes.ml18
-rw-r--r--vernac/attributes.mli8
-rw-r--r--vernac/auto_ind_decl.ml28
-rw-r--r--vernac/auto_ind_decl.mli2
-rw-r--r--vernac/canonical.ml2
-rw-r--r--vernac/canonical.mli2
-rw-r--r--vernac/class.ml19
-rw-r--r--vernac/class.mli6
-rw-r--r--vernac/classes.ml388
-rw-r--r--vernac/classes.mli90
-rw-r--r--vernac/comAssumption.ml32
-rw-r--r--vernac/comAssumption.mli2
-rw-r--r--vernac/comDefinition.ml34
-rw-r--r--vernac/comDefinition.mli19
-rw-r--r--vernac/comFixpoint.ml182
-rw-r--r--vernac/comFixpoint.mli27
-rw-r--r--vernac/comInductive.ml20
-rw-r--r--vernac/comInductive.mli2
-rw-r--r--vernac/comProgramFixpoint.ml15
-rw-r--r--vernac/declareDef.ml44
-rw-r--r--vernac/declareDef.mli40
-rw-r--r--vernac/declareObl.ml562
-rw-r--r--vernac/declareObl.mli114
-rw-r--r--vernac/egramcoq.ml20
-rw-r--r--vernac/egramcoq.mli2
-rw-r--r--vernac/egramml.ml2
-rw-r--r--vernac/egramml.mli2
-rw-r--r--vernac/explainErr.ml79
-rw-r--r--vernac/explainErr.mli4
-rw-r--r--vernac/g_proofs.mlg3
-rw-r--r--vernac/g_vernac.mlg29
-rw-r--r--vernac/himsg.ml16
-rw-r--r--vernac/himsg.mli4
-rw-r--r--vernac/indschemes.ml35
-rw-r--r--vernac/indschemes.mli2
-rw-r--r--vernac/lemmas.ml484
-rw-r--r--vernac/lemmas.mli160
-rw-r--r--vernac/loadpath.ml273
-rw-r--r--vernac/loadpath.mli (renamed from library/loadpath.mli)70
-rw-r--r--vernac/locality.ml25
-rw-r--r--vernac/locality.mli2
-rw-r--r--vernac/metasyntax.ml96
-rw-r--r--vernac/metasyntax.mli12
-rw-r--r--vernac/mltop.ml74
-rw-r--r--vernac/mltop.mli26
-rw-r--r--vernac/obligations.ml595
-rw-r--r--vernac/obligations.mli50
-rw-r--r--vernac/ppvernac.ml35
-rw-r--r--vernac/ppvernac.mli2
-rw-r--r--vernac/proof_using.ml2
-rw-r--r--vernac/proof_using.mli2
-rw-r--r--vernac/pvernac.ml2
-rw-r--r--vernac/pvernac.mli2
-rw-r--r--vernac/record.ml43
-rw-r--r--vernac/record.mli2
-rw-r--r--vernac/search.ml18
-rw-r--r--vernac/search.mli2
-rw-r--r--vernac/topfmt.ml2
-rw-r--r--vernac/topfmt.mli2
-rw-r--r--vernac/vernac.mllib10
-rw-r--r--vernac/vernacentries.ml1062
-rw-r--r--vernac/vernacentries.mli7
-rw-r--r--vernac/vernacexpr.ml22
-rw-r--r--vernac/vernacextend.ml41
-rw-r--r--vernac/vernacextend.mli32
-rw-r--r--vernac/vernacprop.ml2
-rw-r--r--vernac/vernacprop.mli2
-rw-r--r--vernac/vernacstate.ml82
-rw-r--r--vernac/vernacstate.mli52
1755 files changed, 13784 insertions, 11353 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 06a733be45..2a325f2d71 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -173,6 +173,8 @@ azure-pipelines.yml @coq/ci-maintainers
/plugins/rtauto/ @PierreCorbineau
# Secondary maintainer @herbelin
+/user-contrib/Ltac2 @ppedrot
+
########## Pretyper ##########
/pretyping/ @mattam82
diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md
new file mode 100644
index 0000000000..b6f2e942e9
--- /dev/null
+++ b/.github/SUPPORT.md
@@ -0,0 +1,28 @@
+# Support #
+
+Get in touch with the user community and ask questions about Coq on
+our [Discourse forum][]. Posts in other languages than English are
+explicitly welcome there. There is also a historic mailing list called
+the [Coq-Club][] which has lots of subscribers, and an IRC channel
+(`irc://irc.freenode.net/#coq`).
+
+In addition, you may also ask questions about Coq on [Stack
+Overflow][] (use the tag [coq][Stack Overflow tag]) or on the
+meta-theory of Coq on the [TCS Stack Exchange][] (which also has a
+[coq][TCS SE tag] tag).
+
+You can reach the Coq development team through the [development
+category][] of the above mentioned Discourse forum, the [Gitter
+channel][], and of course the bug tracker.
+
+See also [coq.inria.fr/community](https://coq.inria.fr/community.html).
+
+[Discourse forum]: https://coq.discourse.group
+[Coq-Club]: https://sympa.inria.fr/sympa/arc/coq-club
+[Stack Overflow]: https://stackoverflow.com
+[Stack Overflow tag]: https://stackoverflow.com/questions/tagged/coq
+[TCS Stack Exchange]: https://cstheory.stackexchange.com/
+[TCS SE tag]: https://cstheory.stackexchange.com/questions/tagged/coq
+[development category]: https://coq.discourse.group/c/coq-development
+[Gitter channel]: https://gitter.im/coq/coq
+[bug tracker]: https://github.com/coq/coq/issues
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 536bd0af76..48e6b37006 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,7 +10,7 @@ stages:
variables:
# Format: $IMAGE-V$DATE [Cache is not used as of today but kept here
# for reference]
- CACHEKEY: "bionic_coq-V2019-04-20-V1"
+ CACHEKEY: "bionic_coq-V2019-06-21-V1"
IMAGE: "$CI_REGISTRY_IMAGE:$CACHEKEY"
# By default, jobs run in the base switch; override to select another switch
OPAM_SWITCH: "base"
@@ -244,6 +244,9 @@ build:base+32bit:
variables:
OPAM_VARIANT: "+32bit"
COQ_EXTRA_CONF: "-native-compiler yes"
+ only: &full-ci
+ variables:
+ - $FULL_CI == "true"
build:edge+flambda:
extends: .build-template
@@ -292,16 +295,12 @@ windows32:
- /^pr-.*$/
lint:
- image: docker:git
stage: test
- script:
- - apk add bash
- - dev/lint-repository.sh
+ script: dev/lint-repository.sh
dependencies: []
- before_script: []
variables:
- # we need an unknown amount of history for per-commit linting
- GIT_DEPTH: ""
+ GIT_DEPTH: "" # we need an unknown amount of history for per-commit linting
+ OPAM_SWITCH: base
pkg:opam:
stage: test
@@ -317,6 +316,7 @@ pkg:opam:
COQ_VERSION: "8.10"
OPAM_SWITCH: "edge"
OPAM_VARIANT: "+flambda"
+ only: *full-ci
.nix-template:
image: nixorg/nix:latest # Minimal NixOS image which doesn't even contain git
@@ -448,6 +448,7 @@ test-suite:base+32bit:
- build:base+32bit
variables:
OPAM_VARIANT: "+32bit"
+ only: *full-ci
test-suite:edge+flambda:
extends: .test-suite-template
@@ -456,6 +457,7 @@ test-suite:edge+flambda:
variables:
OPAM_SWITCH: edge
OPAM_VARIANT: "+flambda"
+ only: *full-ci
test-suite:egde:dune:dev:
stage: test
@@ -498,6 +500,7 @@ test-suite:edge+trunk+make:
- test-suite/logs
expire_in: 1 week
allow_failure: true
+ only: *full-ci
test-suite:edge+trunk+dune:
stage: test
@@ -526,6 +529,7 @@ test-suite:edge+trunk+dune:
- _build/default/test-suite/logs
expire_in: 1 week
allow_failure: true
+ only: *full-ci
test-suite:base+async:
extends: .test-suite-template
@@ -550,6 +554,7 @@ validate:base+32bit:
- build:base+32bit
variables:
OPAM_VARIANT: "+32bit"
+ only: *full-ci
validate:edge+flambda:
extends: .validate-template
@@ -558,6 +563,7 @@ validate:edge+flambda:
variables:
OPAM_SWITCH: edge
OPAM_VARIANT: "+flambda"
+ only: *full-ci
validate:quick:
extends: .validate-template
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e811c116b6..0d11d092ba 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -105,6 +105,12 @@ files end with newlines) is checked by the `lint` job on GitLab CI (using
git hook which fixes these errors at commit time. `configure` automatically
sets you up to use it, unless you already have a hook at `.git/hooks/pre-commit`.
+Each commit in your pull request should compile (this makes bisecting
+easier). The `lint` job checks compilation of the OCaml files, please
+try to keep the rest of Coq in a functioning state as well.
+
+You may run the linter yourself with `dev/lint-repository.sh`.
+
Here are a few tags Coq developers may add to your PR and what they mean. In
general feedback and requests for you as the pull request author will be in
the comments and tags are only used to organize pull requests.
@@ -169,7 +175,7 @@ People are generally happy to help and very reactive.
["Watching" this repository](https://github.com/coq/coq/subscription)
can result in a very large number of notifications. We advise that if
-you do, either [confifure your mailbox](https://blog.github.com/2017-07-18-managing-large-numbers-of-github-notifications/#prioritize-the-notifications-you-receive)
+you do, either [configure your mailbox](https://blog.github.com/2017-07-18-managing-large-numbers-of-github-notifications/#prioritize-the-notifications-you-receive)
to handle incoming notifications efficiently, or you read your
notifications within a web browser. You can configure how you receive
notifications in [your GitHub settings](https://github.com/settings/notifications),
diff --git a/CREDITS b/CREDITS
index f871dba8b3..989e449cc5 100644
--- a/CREDITS
+++ b/CREDITS
@@ -11,17 +11,14 @@ The "Coq proof assistant" was jointly developed by
(Jan. 2009 - Dec. 2015 when it was merged into IRIF).
- Institut de Recherche en Informatique Fondamentale (IRIF),
associated to CNRS and University Paris Diderot (since Jan. 2016).
+- And many contributors from various institutions.
-All files of the "Coq proof assistant" in directories or sub-directories of
+All files but the material of the reference manual are distributed
+under the term of the GNU Lesser General Public License Version 2.1.
- config dev ide interp intf kernel lib library parsing pretyping proofs
- scripts states tactics test-suite theories tools toplevel
-
-are distributed under the terms of the GNU Lesser General Public License
-Version 2.1 (see file LICENSE). These files are COPYRIGHT 1999-2017,
-The Coq development team, INRIA, CNRS, LIX, LRI, PPS.
-
-Files from the directory doc are distributed as indicated in file doc/LICENCE.
+The material of the reference manual is distributed under the terms of
+the Open Publication License v1.0 or above, as indicated in file
+doc/LICENCE.
The following directories contain independent contributions supported
by the Coq development team. All of them are released under the terms of
@@ -30,9 +27,6 @@ the GNU Lesser General Public License Version 2.1.
plugins/cc
developed by Pierre Corbineau (ENS Cachan, 2001, LRI, 2001-2005, Radboud
University at Nijmegen, 2005-2008, Grenoble 1, 2010-2014)
-plugins/decl_mode
- developed by Pierre Corbineau (Radboud University at Nijmegen, 2005-2008,
- Grenoble 1, 2009-2011)
plugins/extraction
developed by Pierre Letouzey (LRI, 2000-2004, PPS, 2005-now)
plugins/firstorder
@@ -50,22 +44,18 @@ plugins/nsatz
developed by Loïc Pottier (INRIA-Marelle, 2009-2011)
plugins/omega
developed by Pierre Crégut (France Telecom R&D, 1996)
-plugins/romega
- developed by Pierre Crégut (France Telecom R&D, 2001-2004)
plugins/rtauto
developed by Pierre Corbineau (LRI, 2005)
plugins/setoid_ring
developed by Benjamin Grégoire (INRIA-Everest, 2005-2006),
Assia Mahboubi, Laurent Théry (INRIA-Marelle, 2006)
and Bruno Barras (INRIA LogiCal, 2005-2006),
-plugins/ssreflect
+plugins/ssr
developed by Georges Gonthier (Microsoft Research - Inria Joint Centre, 2007-2013, Inria, 2013-now),
Assia Mahboubi and Enrico Tassi (Inria, 2011-now).
plugins/ssrmatching
developed by Georges Gonthier (Microsoft Research - Inria Joint Centre, 2007-2011, Inria, 2013-now),
and Enrico Tassi (Inria-Marelle, 2011-now)
-plugins/subtac
- developed by Matthieu Sozeau (LRI, 2005-2008)
theories/ZArith
started by Pierre Crégut (France Telecom R&D, 1996)
theories/Strings
@@ -154,6 +144,8 @@ of the Coq Proof assistant during the indicated time:
Matthias Puech (INRIA-Bologna, 2008-2011)
Yann Régis-Gianas (INRIA-PPS then IRIF, 2009-now)
Clément Renard (INRIA, 2001-2004)
+ Talia Ringer (University of Washington, 2019)
+ Andreas Lynge (Aarhus University, 2019)
Claudio Sacerdoti Coen (INRIA, 2004-2005)
Amokrane Saïbi (INRIA, 1993-1998)
Vincent Semeria (2018)
diff --git a/INSTALL b/INSTALL
index e02439c54b..30f0938690 100644
--- a/INSTALL
+++ b/INSTALL
@@ -50,10 +50,15 @@ WHAT DO YOU NEED ?
findlib/ocamlfind as Coq's makefile will use it to locate the
libraries during the build.
+ Debian / Ubuntu users can get the necessary system packages for
+ CoqIDE with:
+
+ $ sudo apt-get install libgtksourceview-3.0-dev
+
Opam (https://opam.ocaml.org/) is recommended to install OCaml and
the corresponding packages.
- $ opam install num ocamlfind lablgtk conf-gtksourceview
+ $ opam install num ocamlfind lablgtk3-sourceview3
should get you a reasonable OCaml environment to compile Coq.
diff --git a/META.coq.in b/META.coq.in
index ef5de8da2b..f7922e0ac2 100644
--- a/META.coq.in
+++ b/META.coq.in
@@ -244,14 +244,12 @@ package "idetop" (
)
-# XXX Depends on way less than toplevel
package "ide" (
description = "Coq IDE Libraries"
version = "8.10"
-# XXX Add GTK
- requires = "coq.toplevel"
+ requires = "coq.lib, coq.ideprotocol, lablgtk3, lablgtk3-sourceview3"
directory = "ide"
archive(byte) = "ide.cma"
@@ -259,6 +257,19 @@ package "ide" (
)
+package "ideprotocol" (
+
+ description = "Coq IDE protocol"
+ version = "8.10"
+
+ requires = "coq.toplevel"
+ directory = "ide/protocol"
+
+ archive(byte) = "ideprotocol.cma"
+ archive(native) = "ideprotocol.cmxa"
+
+)
+
package "plugins" (
description = "Coq built-in plugins"
diff --git a/Makefile b/Makefile
index c4404d13c7..a1ffbac10d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/Makefile.build b/Makefile.build
index 147668187f..c6223a6dbd 100644
--- a/Makefile.build
+++ b/Makefile.build
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
@@ -365,7 +365,7 @@ $(COQPP): $(COQPPCMO) coqpp/coqpp_main.ml
###########################################################################
# Specific rules for Uint63
###########################################################################
-kernel/uint63.ml: kernel/write_uint63.ml kernel/uint63_x86.ml kernel/uint63_amd64.ml
+kernel/uint63.ml: kernel/write_uint63.ml kernel/uint63_i386_31.ml kernel/uint63_amd64_63.ml
$(SHOW)'WRITE $@'
$(HIDE)(cd kernel && ocaml unix.cma $(shell basename $<))
diff --git a/Makefile.checker b/Makefile.checker
index 7440c767e6..5c55ccf489 100644
--- a/Makefile.checker
+++ b/Makefile.checker
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/Makefile.ci b/Makefile.ci
index 95ebd64ba1..677fd734bf 100644
--- a/Makefile.ci
+++ b/Makefile.ci
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/Makefile.common b/Makefile.common
index ee3bfb43c5..b331484fb2 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/Makefile.dev b/Makefile.dev
index 6057696375..b1e142333a 100644
--- a/Makefile.dev
+++ b/Makefile.dev
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/Makefile.doc b/Makefile.doc
index 94642e702f..041f26f0b4 100644
--- a/Makefile.doc
+++ b/Makefile.doc
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/Makefile.ide b/Makefile.ide
index 89c1f246db..cb026cdf43 100644
--- a/Makefile.ide
+++ b/Makefile.ide
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/Makefile.install b/Makefile.install
index 5b5e548f9c..608e8a3c8e 100644
--- a/Makefile.install
+++ b/Makefile.install
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/README.md b/README.md
index 54e12b09d4..739bb5148e 100644
--- a/README.md
+++ b/README.md
@@ -27,8 +27,8 @@ environment for semi-interactive development of machine-checked proofs.
[![Arch package][arch-badge]][arch-link]
[![Chocolatey package][chocolatey-badge]][chocolatey-link]
+[![Conda package][conda-badge]][conda-link]
[![Homebrew package][homebrew-badge]][homebrew-link]
-[![MacPorts package][macports-badge]][macports-link]
[![nixpkgs unstable package][nixpkgs-badge]][nixpkgs-link]
[repology-badge]: https://repology.org/badge/latest-versions/coq.svg
@@ -40,6 +40,9 @@ environment for semi-interactive development of machine-checked proofs.
[chocolatey-badge]: https://repology.org/badge/version-for-repo/chocolatey/coq.svg
[chocolatey-link]: https://chocolatey.org/packages/Coq
+[conda-badge]: https://img.shields.io/conda/vn/conda-forge/coq.svg?label="Conda%20package"
+[conda-link]: https://github.com/conda-forge/coq-feedstock
+
[homebrew-badge]: https://repology.org/badge/version-for-repo/homebrew/coq.svg
[homebrew-link]: https://formulae.brew.sh/formula/coq
@@ -88,7 +91,7 @@ development team:
See also [coq.inria.fr/community](https://coq.inria.fr/community.html).
-## Bugs report
+## Bug reports
Please report any bug / feature request in [our issue tracker](https://github.com/coq/coq/issues).
diff --git a/checker/check.ml b/checker/check.ml
index a2c8a0f25d..2840fc9ad6 100644
--- a/checker/check.ml
+++ b/checker/check.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -50,7 +50,8 @@ let pr_path sp =
type compilation_unit_name = DirPath.t
-type seg_proofs = Constr.constr Future.computation array
+type seg_univ = Univ.ContextSet.t * bool
+type seg_proofs = Opaqueproof.opaque_proofterm array
type library_t = {
library_name : compilation_unit_name;
@@ -90,7 +91,6 @@ let register_loaded_library m =
(* Map from library names to table of opaque terms *)
let opaque_tables = ref LibraryMap.empty
-let opaque_univ_tables = ref LibraryMap.empty
let access_opaque_table dp i =
let t =
@@ -100,16 +100,14 @@ let access_opaque_table dp i =
assert (i < Array.length t);
t.(i)
-let access_opaque_univ_table dp i =
- try
- let t = LibraryMap.find dp !opaque_univ_tables in
- assert (i < Array.length t);
- Some t.(i)
- with Not_found -> None
+let access_discharge = Cooking.cook_constr
+
+let indirect_accessor = {
+ Opaqueproof.access_proof = access_opaque_table;
+ Opaqueproof.access_discharge = access_discharge;
+}
-let () =
- Opaqueproof.set_indirect_opaque_accessor access_opaque_table;
- Opaqueproof.set_indirect_univ_accessor access_opaque_univ_table
+let () = Mod_checking.set_indirect_accessor indirect_accessor
let check_one_lib admit senv (dir,m) =
let md = m.library_compiled in
@@ -335,8 +333,7 @@ let intern_from_file ~intern_mode (dir, f) =
let ch = System.with_magic_number_check raw_intern_library f in
let (sd:summary_disk), _, digest = marshal_in_segment f ch in
let (md:library_disk), _, digest = marshal_in_segment f ch in
- let (opaque_csts:'a option), _, udg = marshal_in_segment f ch in
- let (discharging:'a option), _, _ = marshal_in_segment f ch in
+ let (opaque_csts:seg_univ option), _, udg = marshal_in_segment f ch in
let (tasks:'a option), _, _ = marshal_in_segment f ch in
let (table:seg_proofs option), pos, checksum =
marshal_or_skip ~intern_mode f ch in
@@ -349,12 +346,12 @@ let intern_from_file ~intern_mode (dir, f) =
if dir <> sd.md_name then
user_err ~hdr:"intern_from_file"
(name_clash_message dir sd.md_name f);
- if tasks <> None || discharging <> None then
+ if tasks <> None then
user_err ~hdr:"intern_from_file"
(str "The file "++str f++str " contains unfinished tasks");
if opaque_csts <> None then begin
Flags.if_verbose chk_pp (str " (was a vio file) ");
- Option.iter (fun (_,_,b) -> if not b then
+ Option.iter (fun (_,b) -> if not b then
user_err ~hdr:"intern_from_file"
(str "The file "++str f++str " is still a .vio"))
opaque_csts;
@@ -372,13 +369,9 @@ let intern_from_file ~intern_mode (dir, f) =
with e -> Flags.if_verbose chk_pp (str" failed!]" ++ fnl ()); raise e in
depgraph := LibraryMap.add sd.md_name sd.md_deps !depgraph;
Option.iter (fun table -> opaque_tables := LibraryMap.add sd.md_name table !opaque_tables) table;
- Option.iter (fun (opaque_csts,_,_) ->
- opaque_univ_tables :=
- LibraryMap.add sd.md_name opaque_csts !opaque_univ_tables)
- opaque_csts;
let extra_cst =
Option.default Univ.ContextSet.empty
- (Option.map (fun (_,cs,_) -> cs) opaque_csts) in
+ (Option.map (fun (cs,_) -> cs) opaque_csts) in
mk_library sd md f table digest extra_cst
let get_deps (dir, f) =
diff --git a/checker/check.mli b/checker/check.mli
index 39cc93c060..7f0340b193 100644
--- a/checker/check.mli
+++ b/checker/check.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/checkInductive.ml b/checker/checkInductive.ml
index 4f4527ca12..f2df99dcd6 100644
--- a/checker/checkInductive.ml
+++ b/checker/checkInductive.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -75,8 +75,7 @@ let check_arity env ar1 ar2 = match ar1, ar2 with
(* template_level is inferred by indtypes, so functor application can produce a smaller one *)
| (RegularArity _ | TemplateArity _), _ -> false
-let check_kelim k1 k2 =
- List.for_all (fun x -> List.mem_f Sorts.family_equal x k2) k1
+let check_kelim k1 k2 = Sorts.family_leq k1 k2
(* Use [eq_ind_chk] because when we rebuild the recargs we have lost
the knowledge of who is the canonical version.
diff --git a/checker/checkInductive.mli b/checker/checkInductive.mli
index ab54190967..c5f8dec1a4 100644
--- a/checker/checkInductive.mli
+++ b/checker/checkInductive.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/checkTypes.ml b/checker/checkTypes.ml
index 7eaa5eedd5..2f1c690aca 100644
--- a/checker/checkTypes.ml
+++ b/checker/checkTypes.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/checkTypes.mli b/checker/checkTypes.mli
index 022f9bc603..ac9ea2fb31 100644
--- a/checker/checkTypes.mli
+++ b/checker/checkTypes.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/check_stat.ml b/checker/check_stat.ml
index 57adc79475..62f72c8edc 100644
--- a/checker/check_stat.ml
+++ b/checker/check_stat.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/check_stat.mli b/checker/check_stat.mli
index b094da1c44..c636327553 100644
--- a/checker/check_stat.mli
+++ b/checker/check_stat.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/checker.ml b/checker/checker.ml
index cbac9cb570..d08e9e698d 100644
--- a/checker/checker.ml
+++ b/checker/checker.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/checker.mli b/checker/checker.mli
index 582f42589c..bbfefb22c0 100644
--- a/checker/checker.mli
+++ b/checker/checker.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/coqchk.mli b/checker/coqchk.mli
index 9db9ecd12e..d0712f8075 100644
--- a/checker/coqchk.mli
+++ b/checker/coqchk.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/mod_checking.ml b/checker/mod_checking.ml
index 1dd16f1630..9b41fbcb7a 100644
--- a/checker/mod_checking.ml
+++ b/checker/mod_checking.ml
@@ -8,6 +8,13 @@ open Environ
(** {6 Checking constants } *)
+let indirect_accessor = ref {
+ Opaqueproof.access_proof = (fun _ _ -> assert false);
+ Opaqueproof.access_discharge = (fun _ _ -> assert false);
+}
+
+let set_indirect_accessor f = indirect_accessor := f
+
let check_constant_declaration env kn cb =
Flags.if_verbose Feedback.msg_notice (str " checking cst:" ++ Constant.print kn);
(* Locally set the oracle for further typechecking *)
@@ -16,23 +23,32 @@ let check_constant_declaration env kn cb =
(* [env'] contains De Bruijn universe variables *)
let poly, env' =
match cb.const_universes with
- | Monomorphic ctx -> false, push_context_set ~strict:true ctx env
+ | Monomorphic ctx -> false, env
| Polymorphic auctx ->
let ctx = Univ.AUContext.repr auctx in
let env = push_context ~strict:false ctx env in
true, env
in
- let env' = match cb.const_private_poly_univs, (cb.const_body, poly) with
- | None, _ -> env'
- | Some local, (OpaqueDef _, true) -> push_subgraph local env'
- | Some _, _ -> assert false
- in
let ty = cb.const_type in
let _ = infer_type env' ty in
+ let otab = Environ.opaque_tables env' in
+ let body, env' = match cb.const_body with
+ | Undef _ | Primitive _ -> None, env'
+ | Def c -> Some (Mod_subst.force_constr c), env'
+ | OpaqueDef o ->
+ let c, u = Opaqueproof.force_proof !indirect_accessor otab o in
+ let env' = match u, cb.const_universes with
+ | Opaqueproof.PrivateMonomorphic (), Monomorphic _ -> env'
+ | Opaqueproof.PrivatePolymorphic (_, local), Polymorphic _ ->
+ push_subgraph local env'
+ | _ -> assert false
+ in
+ Some c, env'
+ in
let () =
- match Environ.body_of_constant_body env cb with
+ match body with
| Some bd ->
- let j = infer env' (fst bd) in
+ let j = infer env' bd in
(try conv_leq env' j.uj_type ty
with NotConvertible -> Type_errors.error_actual_type env j ty)
| None -> ()
diff --git a/checker/mod_checking.mli b/checker/mod_checking.mli
index 6cff3e6b8c..d29d1861f4 100644
--- a/checker/mod_checking.mli
+++ b/checker/mod_checking.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -8,4 +8,6 @@
(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
+val set_indirect_accessor : Opaqueproof.indirect_accessor -> unit
+
val check_module : Environ.env -> Names.ModPath.t -> Declarations.module_body -> unit
diff --git a/checker/safe_checking.ml b/checker/safe_checking.ml
index 4a64039e30..a913d53bd6 100644
--- a/checker/safe_checking.ml
+++ b/checker/safe_checking.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/safe_checking.mli b/checker/safe_checking.mli
index 44cd2b3a2e..205777272d 100644
--- a/checker/safe_checking.mli
+++ b/checker/safe_checking.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/validate.ml b/checker/validate.ml
index 72cf38ebe6..178bb4c527 100644
--- a/checker/validate.ml
+++ b/checker/validate.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/validate.mli b/checker/validate.mli
index 6c2ab8d348..fbcea3121b 100644
--- a/checker/validate.mli
+++ b/checker/validate.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/values.ml b/checker/values.ml
index 5cbf0ff298..cde2db2721 100644
--- a/checker/values.ml
+++ b/checker/values.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -53,7 +53,6 @@ let v_enum name n = Sum(name,n,[||])
let v_pair v1 v2 = v_tuple "*" [|v1; v2|]
let v_bool = v_enum "bool" 2
let v_unit = v_enum "unit" 1
-let v_ref v = v_tuple "ref" [|v|]
let v_set v =
let rec s = Sum ("Set.t",1,
@@ -70,13 +69,6 @@ let v_hmap vk vd = v_map Int (v_map vk vd)
let v_pred v = v_pair v_bool (v_set v)
-(* lib/future *)
-let v_computation f =
- Annot ("Future.computation",
- v_ref
- (v_sum "Future.comput" 0
- [| [| Fail "Future.ongoing" |]; [| f |] |]))
-
(** kernel/names *)
let v_id = String
@@ -139,7 +131,7 @@ let v_proj = v_tuple "projection" [|v_proj_repr; v_bool|]
let rec v_constr =
Sum ("constr",0,[|
[|Int|]; (* Rel *)
- [|Fail "Var"|]; (* Var *)
+ [|v_id|]; (* Var *)
[|Fail "Meta"|]; (* Meta *)
[|Fail "Evar"|]; (* Evar *)
[|v_sort|]; (* Sort *)
@@ -238,7 +230,6 @@ let v_cb = v_tuple "constant_body"
v_relevance;
Any;
v_univs;
- Opt v_context_set;
v_bool;
v_typing_flags|]
@@ -265,7 +256,7 @@ let v_one_ind = v_tuple "one_inductive_body"
Array v_constr;
Int;
Int;
- List v_sortfam;
+ v_sortfam;
Array (v_pair v_rctxt v_constr);
Array Int;
Array Int;
@@ -391,6 +382,25 @@ let v_libsum =
let v_lib =
Tuple ("library",[|v_compiled_lib;v_libraryobjs|])
-let v_opaques = Array (v_computation v_constr)
+let v_ndecl = v_sum "named_declaration" 0
+ [| [|v_binder_annot v_id; v_constr|]; (* LocalAssum *)
+ [|v_binder_annot v_id; v_constr; v_constr|] |] (* LocalDef *)
+
+let v_nctxt = List v_ndecl
+
+let v_work_list =
+ let v_abstr = v_pair v_instance (Array v_id) in
+ Tuple ("work_list", [|v_hmap v_cst v_abstr; v_hmap v_cst v_abstr|])
+
+let v_abstract =
+ Tuple ("abstract", [| v_nctxt; v_instance; v_abs_context |])
+
+let v_cooking_info =
+ Tuple ("cooking_info", [|v_work_list; v_abstract|])
+
+let v_delayed_universes =
+ Sum ("delayed_universes", 0, [| [| v_unit |]; [| Int; v_context_set |] |])
+
+let v_opaques = Array (Tuple ("opaque", [| List v_cooking_info; Opt (v_pair v_constr v_delayed_universes) |]))
let v_univopaques =
- Opt (Tuple ("univopaques",[|Array (v_computation v_context_set);v_context_set;v_bool|]))
+ Opt (Tuple ("univopaques",[|v_context_set;v_bool|]))
diff --git a/checker/values.mli b/checker/values.mli
index 2ab8da1928..93983eb700 100644
--- a/checker/values.mli
+++ b/checker/values.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/votour.ml b/checker/votour.ml
index 36014cde73..f0e0cf22ab 100644
--- a/checker/votour.ml
+++ b/checker/votour.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/checker/votour.mli b/checker/votour.mli
index 9db9ecd12e..d0712f8075 100644
--- a/checker/votour.mli
+++ b/checker/votour.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/backtrace.ml b/clib/backtrace.ml
index 64faa5fd2e..81803a81a5 100644
--- a/clib/backtrace.ml
+++ b/clib/backtrace.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/backtrace.mli b/clib/backtrace.mli
index cd31511628..55c60e5483 100644
--- a/clib/backtrace.mli
+++ b/clib/backtrace.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/bigint.ml b/clib/bigint.ml
index 9e7b44ee9c..f8625c599e 100644
--- a/clib/bigint.ml
+++ b/clib/bigint.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/bigint.mli b/clib/bigint.mli
index 88297c353d..98b438e0a3 100644
--- a/clib/bigint.mli
+++ b/clib/bigint.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cArray.ml b/clib/cArray.ml
index 774e3a56a6..bff796ac33 100644
--- a/clib/cArray.ml
+++ b/clib/cArray.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cArray.mli b/clib/cArray.mli
index c1b29bb9d3..090d2bf627 100644
--- a/clib/cArray.mli
+++ b/clib/cArray.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cEphemeron.ml b/clib/cEphemeron.ml
index d7cc0a4dc2..a2a6933e36 100644
--- a/clib/cEphemeron.ml
+++ b/clib/cEphemeron.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cEphemeron.mli b/clib/cEphemeron.mli
index 96391e10fa..4c10a3d66f 100644
--- a/clib/cEphemeron.mli
+++ b/clib/cEphemeron.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cList.ml b/clib/cList.ml
index aa01f6e5b5..178916cd03 100644
--- a/clib/cList.ml
+++ b/clib/cList.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cList.mli b/clib/cList.mli
index a2fe0b759a..9125c3b68b 100644
--- a/clib/cList.mli
+++ b/clib/cList.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cMap.ml b/clib/cMap.ml
index 016d8bdeca..baac892b9e 100644
--- a/clib/cMap.ml
+++ b/clib/cMap.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cMap.mli b/clib/cMap.mli
index 9bbb8d50dd..bb2ee1d220 100644
--- a/clib/cMap.mli
+++ b/clib/cMap.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cObj.ml b/clib/cObj.ml
index e26f481155..edfd40baa9 100644
--- a/clib/cObj.ml
+++ b/clib/cObj.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cObj.mli b/clib/cObj.mli
index 27082f6857..fb931ab0d0 100644
--- a/clib/cObj.mli
+++ b/clib/cObj.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cSet.ml b/clib/cSet.ml
index b276df1abd..b111c43c0d 100644
--- a/clib/cSet.ml
+++ b/clib/cSet.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cSet.mli b/clib/cSet.mli
index ea99a79116..1924949133 100644
--- a/clib/cSet.mli
+++ b/clib/cSet.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cSig.mli b/clib/cSig.mli
index 0012bcef17..f83cffc628 100644
--- a/clib/cSig.mli
+++ b/clib/cSig.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cStack.ml b/clib/cStack.ml
index b86b0024dc..0432e29fad 100644
--- a/clib/cStack.ml
+++ b/clib/cStack.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cStack.mli b/clib/cStack.mli
index d6b8464e3f..de802160e7 100644
--- a/clib/cStack.mli
+++ b/clib/cStack.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cString.ml b/clib/cString.ml
index 423c08da13..60915efe86 100644
--- a/clib/cString.ml
+++ b/clib/cString.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cString.mli b/clib/cString.mli
index f68bd3bb65..8a4fe62a1c 100644
--- a/clib/cString.mli
+++ b/clib/cString.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cThread.ml b/clib/cThread.ml
index 5fa44b1eec..434b234ba1 100644
--- a/clib/cThread.ml
+++ b/clib/cThread.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cThread.mli b/clib/cThread.mli
index b090479c4c..63abf23945 100644
--- a/clib/cThread.mli
+++ b/clib/cThread.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cUnix.ml b/clib/cUnix.ml
index eedd878f93..c5f6bebb8e 100644
--- a/clib/cUnix.ml
+++ b/clib/cUnix.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/cUnix.mli b/clib/cUnix.mli
index 896ccd4ea7..17574b3c42 100644
--- a/clib/cUnix.mli
+++ b/clib/cUnix.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/dyn.ml b/clib/dyn.ml
index 22c49706be..ce87615fdd 100644
--- a/clib/dyn.ml
+++ b/clib/dyn.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/dyn.mli b/clib/dyn.mli
index 1bd78b2db8..4f823e58fb 100644
--- a/clib/dyn.mli
+++ b/clib/dyn.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/exninfo.ml b/clib/exninfo.ml
index 78ebd81f7e..34f76a2edd 100644
--- a/clib/exninfo.ml
+++ b/clib/exninfo.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/exninfo.mli b/clib/exninfo.mli
index 4a5a6095bb..30803e3e6a 100644
--- a/clib/exninfo.mli
+++ b/clib/exninfo.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/hMap.ml b/clib/hMap.ml
index db59ef47b0..f77068b477 100644
--- a/clib/hMap.ml
+++ b/clib/hMap.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/hMap.mli b/clib/hMap.mli
index ab2a6bbf15..c30019c2af 100644
--- a/clib/hMap.mli
+++ b/clib/hMap.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/hashcons.ml b/clib/hashcons.ml
index 4e5d6212a0..41419cf758 100644
--- a/clib/hashcons.ml
+++ b/clib/hashcons.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/hashcons.mli b/clib/hashcons.mli
index e97708cdf3..da45c006b8 100644
--- a/clib/hashcons.mli
+++ b/clib/hashcons.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/hashset.ml b/clib/hashset.ml
index 965cb67c72..debfc15c9a 100644
--- a/clib/hashset.ml
+++ b/clib/hashset.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/hashset.mli b/clib/hashset.mli
index 6ed93d5fe7..c93fa98fbd 100644
--- a/clib/hashset.mli
+++ b/clib/hashset.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/heap.ml b/clib/heap.ml
index 49034bbc2a..daade01cb7 100644
--- a/clib/heap.ml
+++ b/clib/heap.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/heap.mli b/clib/heap.mli
index ab0864c777..5bb6f83cec 100644
--- a/clib/heap.mli
+++ b/clib/heap.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/iStream.ml b/clib/iStream.ml
index 8daf2279c5..9555c46e24 100644
--- a/clib/iStream.ml
+++ b/clib/iStream.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/iStream.mli b/clib/iStream.mli
index e56f066c5e..9f88cd6b7a 100644
--- a/clib/iStream.mli
+++ b/clib/iStream.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/int.ml b/clib/int.ml
index 3924c152d6..ee4b3128d5 100644
--- a/clib/int.ml
+++ b/clib/int.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/int.mli b/clib/int.mli
index e02ca90916..fa35594d9b 100644
--- a/clib/int.mli
+++ b/clib/int.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/minisys.ml b/clib/minisys.ml
index bbcf46b97a..e5ee0e33b4 100644
--- a/clib/minisys.ml
+++ b/clib/minisys.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/monad.ml b/clib/monad.ml
index 8740cae053..82f1e358d7 100644
--- a/clib/monad.ml
+++ b/clib/monad.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/monad.mli b/clib/monad.mli
index d1d42eb81a..9d176259b1 100644
--- a/clib/monad.mli
+++ b/clib/monad.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/option.ml b/clib/option.ml
index 3e57fd5c85..fd88257238 100644
--- a/clib/option.ml
+++ b/clib/option.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/option.mli b/clib/option.mli
index e99c8015c4..27efc767f0 100644
--- a/clib/option.mli
+++ b/clib/option.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/orderedType.ml b/clib/orderedType.ml
index 922eb76ab9..b49ee1ebec 100644
--- a/clib/orderedType.ml
+++ b/clib/orderedType.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/orderedType.mli b/clib/orderedType.mli
index 3578ea0d83..9d084d65dc 100644
--- a/clib/orderedType.mli
+++ b/clib/orderedType.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/range.ml b/clib/range.ml
index 7271514fdc..f25e31ad8e 100644
--- a/clib/range.ml
+++ b/clib/range.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/range.mli b/clib/range.mli
index c14b0cf5c8..33b05a26ee 100644
--- a/clib/range.mli
+++ b/clib/range.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/segmenttree.ml b/clib/segmenttree.ml
index c3f1b44ef4..3518fc130d 100644
--- a/clib/segmenttree.ml
+++ b/clib/segmenttree.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/segmenttree.mli b/clib/segmenttree.mli
index 63c968f5d5..fa198f7ad6 100644
--- a/clib/segmenttree.mli
+++ b/clib/segmenttree.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/store.ml b/clib/store.ml
index 79e26908d7..bf26997287 100644
--- a/clib/store.ml
+++ b/clib/store.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/store.mli b/clib/store.mli
index 7cdd1d3bed..4834ee85c7 100644
--- a/clib/store.mli
+++ b/clib/store.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/terminal.ml b/clib/terminal.ml
index d243d6599e..e133911aa5 100644
--- a/clib/terminal.ml
+++ b/clib/terminal.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/terminal.mli b/clib/terminal.mli
index bc30b0016f..94df44f55f 100644
--- a/clib/terminal.mli
+++ b/clib/terminal.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/trie.ml b/clib/trie.ml
index 96de2b920c..0fc92c985d 100644
--- a/clib/trie.ml
+++ b/clib/trie.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/trie.mli b/clib/trie.mli
index dae346d3fb..ce02ce005a 100644
--- a/clib/trie.mli
+++ b/clib/trie.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/unicode.ml b/clib/unicode.ml
index a122e2c46a..e719309585 100644
--- a/clib/unicode.ml
+++ b/clib/unicode.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/unicode.mli b/clib/unicode.mli
index 23e168cdbe..ad6844f7b9 100644
--- a/clib/unicode.mli
+++ b/clib/unicode.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/unionfind.ml b/clib/unionfind.ml
index 980064a640..4de9fb8faa 100644
--- a/clib/unionfind.ml
+++ b/clib/unionfind.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/clib/unionfind.mli b/clib/unionfind.mli
index e5a3a43862..4e2f91f5b1 100644
--- a/clib/unionfind.mli
+++ b/clib/unionfind.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/config/coq_config.mli b/config/coq_config.mli
index 33acceb1f0..b419890025 100644
--- a/config/coq_config.mli
+++ b/config/coq_config.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/coqpp/coqpp_ast.mli b/coqpp/coqpp_ast.mli
index 81109887ba..fbef91f4f7 100644
--- a/coqpp/coqpp_ast.mli
+++ b/coqpp/coqpp_ast.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
type loc = {
@@ -103,7 +105,7 @@ type classification =
type vernac_rule = {
vernac_atts : (string * string) list option;
- vernac_state: string option;
+ vernac_state : string option;
vernac_toks : ext_token list;
vernac_class : code option;
vernac_depr : bool;
@@ -114,6 +116,7 @@ type vernac_ext = {
vernacext_name : string;
vernacext_entry : code option;
vernacext_class : classification;
+ vernacext_state : string option;
vernacext_rules : vernac_rule list;
}
diff --git a/coqpp/coqpp_lex.mll b/coqpp/coqpp_lex.mll
index 81ba8ad98c..040d5eee09 100644
--- a/coqpp/coqpp_lex.mll
+++ b/coqpp/coqpp_lex.mll
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
{
@@ -103,6 +105,7 @@ rule extend = parse
| "PLUGIN" { PLUGIN }
| "DEPRECATED" { DEPRECATED }
| "CLASSIFIED" { CLASSIFIED }
+| "STATE" { STATE }
| "PRINTED" { PRINTED }
| "TYPED" { TYPED }
| "INTERPRETED" { INTERPRETED }
diff --git a/coqpp/coqpp_main.ml b/coqpp/coqpp_main.ml
index 42fe13e4eb..7e869d6fe1 100644
--- a/coqpp/coqpp_main.ml
+++ b/coqpp/coqpp_main.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Lexing
@@ -357,22 +359,31 @@ let print_atts_right fmt = function
let nota = match atts with [_] -> "" | _ -> "Attributes.Notations." in
fprintf fmt "(Attributes.parse %s%a atts)" nota aux atts
-let print_body_wrapper fmt r =
- match r.vernac_state with
- | Some "proof" ->
- fprintf fmt "let proof = (%a) ~pstate:st.Vernacstate.proof in { st with Vernacstate.proof }" print_code r.vernac_body
- | None ->
- fprintf fmt "let () = %a in st" print_code r.vernac_body
- | Some x ->
- fatal ("unsupported state specifier: " ^ x)
-
-let print_body_fun fmt r =
- fprintf fmt "let coqpp_body %a%a ~st = @[%a@] in "
- print_binders r.vernac_toks print_atts_left r.vernac_atts print_body_wrapper r
-
-let print_body fmt r =
- fprintf fmt "@[(%afun %a~atts@ ~st@ -> coqpp_body %a%a ~st)@]"
- print_body_fun r print_binders r.vernac_toks
+let understand_state = function
+ | "close_proof" -> "VtCloseProof", false
+ | "open_proof" -> "VtOpenProof", true
+ | "proof" -> "VtModifyProof", false
+ | "proof_opt_query" -> "VtReadProofOpt", false
+ | "proof_query" -> "VtReadProof", false
+ | s -> fatal ("unsupported state specifier: " ^ s)
+
+let print_body_state state fmt r =
+ let state = match r.vernac_state with Some _ as s -> s | None -> state in
+ match state with
+ | None -> fprintf fmt "Vernacextend.VtDefault (fun () -> %a)" print_code r.vernac_body
+ | Some "CUSTOM" -> print_code fmt r.vernac_body
+ | Some state ->
+ let state, unit_wrap = understand_state state in
+ fprintf fmt "Vernacextend.%s (%s%a)" state (if unit_wrap then "fun () ->" else "")
+ print_code r.vernac_body
+
+let print_body_fun state fmt r =
+ fprintf fmt "let coqpp_body %a%a = @[%a@] in "
+ print_binders r.vernac_toks print_atts_left r.vernac_atts (print_body_state state) r
+
+let print_body state fmt r =
+ fprintf fmt "@[(%afun %a~atts@ -> coqpp_body %a%a)@]"
+ (print_body_fun state) r print_binders r.vernac_toks
print_binders r.vernac_toks print_atts_right r.vernac_atts
let rec print_sig fmt = function
@@ -383,12 +394,12 @@ let rec print_sig fmt = function
fprintf fmt "@[Vernacextend.TyNonTerminal (%a, %a)@]"
print_symbol symb print_sig rem
-let print_rule fmt r =
+let print_rule state fmt r =
fprintf fmt "Vernacextend.TyML (%b, %a, %a, %a)"
- r.vernac_depr print_sig r.vernac_toks print_body r print_rule_classifier r
+ r.vernac_depr print_sig r.vernac_toks (print_body state) r print_rule_classifier r
-let print_rules fmt rules =
- print_list fmt (fun fmt r -> fprintf fmt "(%a)" print_rule r) rules
+let print_rules state fmt rules =
+ print_list fmt (fun fmt r -> fprintf fmt "(%a)" (print_rule state) r) rules
let print_classifier fmt = function
| ClassifDefault -> fprintf fmt ""
@@ -407,7 +418,7 @@ let print_ast fmt ext =
let pr fmt () =
fprintf fmt "Vernacextend.vernac_extend ~command:\"%s\" %a ?entry:%a %a"
ext.vernacext_name print_classifier ext.vernacext_class
- print_entry ext.vernacext_entry print_rules ext.vernacext_rules
+ print_entry ext.vernacext_entry (print_rules ext.vernacext_state) ext.vernacext_rules
in
let () = fprintf fmt "let () = @[%a@]@\n" pr () in
()
diff --git a/coqpp/coqpp_parse.mly b/coqpp/coqpp_parse.mly
index 43ba990f6a..d1f09c2d0b 100644
--- a/coqpp/coqpp_parse.mly
+++ b/coqpp/coqpp_parse.mly
@@ -1,9 +1,11 @@
/************************************************************************/
-/* v * The Coq Proof Assistant / The Coq Development Team */
-/* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 */
+/* * The Coq Proof Assistant / The Coq Development Team */
+/* v * INRIA, CNRS and contributors - Copyright 1999-2019 */
+/* <O___,, * (see CREDITS file for the list of authors) */
/* \VV/ **************************************************************/
-/* // * This file is distributed under the terms of the */
-/* * GNU Lesser General Public License Version 2.1 */
+/* // * This file is distributed under the terms of the */
+/* * GNU Lesser General Public License Version 2.1 */
+/* * (see LICENSE file for the text of the license) */
/************************************************************************/
%{
@@ -64,7 +66,7 @@ let parse_user_entry s sep =
%token <int> INT
%token VERNAC TACTIC GRAMMAR EXTEND END DECLARE PLUGIN DEPRECATED ARGUMENT
%token RAW_PRINTED GLOB_PRINTED
-%token COMMAND CLASSIFIED PRINTED TYPED INTERPRETED GLOBALIZED SUBSTITUTED BY AS
+%token COMMAND CLASSIFIED STATE PRINTED TYPED INTERPRETED GLOBALIZED SUBSTITUTED BY AS
%token BANGBRACKET HASHBRACKET LBRACKET RBRACKET PIPE ARROW FUN COMMA EQUAL STAR
%token LPAREN RPAREN COLON SEMICOLON
%token GLOBAL FIRST LAST BEFORE AFTER LEVEL LEFTA RIGHTA NONA
@@ -183,12 +185,13 @@ argtype:
;
vernac_extend:
-| VERNAC vernac_entry EXTEND IDENT vernac_classifier vernac_rules END
+| VERNAC vernac_entry EXTEND IDENT vernac_classifier vernac_state vernac_rules END
{ VernacExt {
vernacext_name = $4;
vernacext_entry = $2;
vernacext_class = $5;
- vernacext_rules = $6;
+ vernacext_state = $6;
+ vernacext_rules = $7;
} }
;
@@ -203,16 +206,21 @@ vernac_classifier:
| CLASSIFIED AS IDENT { ClassifName $3 }
;
+vernac_state:
+| { None }
+| STATE IDENT { Some $2 }
+;
+
vernac_rules:
| vernac_rule { [$1] }
| vernac_rule vernac_rules { $1 :: $2 }
;
vernac_rule:
-| PIPE vernac_attributes_opt vernac_state_opt LBRACKET ext_tokens RBRACKET rule_deprecation rule_classifier ARROW CODE
+| PIPE vernac_attributes_opt rule_state LBRACKET ext_tokens RBRACKET rule_deprecation rule_classifier ARROW CODE
{ {
vernac_atts = $2;
- vernac_state= $3;
+ vernac_state = $3;
vernac_toks = $5;
vernac_depr = $7;
vernac_class= $8;
@@ -220,6 +228,11 @@ vernac_rule:
} }
;
+rule_state:
+| { None }
+| BANGBRACKET IDENT RBRACKET { Some $2 }
+;
+
vernac_attributes_opt:
| { None }
| HASHBRACKET vernac_attributes RBRACKET { Some $2 }
@@ -236,14 +249,6 @@ vernac_attribute:
| qualid_or_ident { ($1, $1) }
;
-vernac_state_opt:
-| { None }
-| BANGBRACKET vernac_state RBRACKET { Some $2 }
-;
-
-vernac_state:
-| qualid_or_ident { $1 }
-
rule_deprecation:
| { false }
| DEPRECATED { true }
@@ -270,7 +275,7 @@ tactic_level:
;
tactic_rules:
-| tactic_rule { [$1] }
+| { [] }
| tactic_rule tactic_rules { $1 :: $2 }
;
diff --git a/dev/base_include b/dev/base_include
index b214959bad..f764eaf4f5 100644
--- a/dev/base_include
+++ b/dev/base_include
@@ -185,7 +185,7 @@ open Declareops;;
let constbody_of_string s =
let b = Global.lookup_constant (Nametab.locate_constant (qualid_of_string s)) in
- Option.get (Global.body_of_constant_body b);;
+ Option.get (Global.body_of_constant_body Library.indirect_accessor b);;
(* Get the current goal *)
(*
diff --git a/dev/build/windows/MakeCoq_MinGW.bat b/dev/build/windows/MakeCoq_MinGW.bat
index 7c8f73c7e4..78ca5e830a 100755
--- a/dev/build/windows/MakeCoq_MinGW.bat
+++ b/dev/build/windows/MakeCoq_MinGW.bat
@@ -331,7 +331,9 @@ IF "%CYGWIN_QUIET%" == "Y" (
)
IF "%GTK_FROM_SOURCES%"=="N" (
- SET CYGWIN_OPT= %CYGWIN_OPT% -P mingw64-%ARCH%-gtk3,mingw64-%ARCH%-gtksourceview3.0
+ SET CYGWIN_OPT= %CYGWIN_OPT% -P mingw64-%ARCH%-gtk3,mingw64-%ARCH%-libxml2
+ REM gtksourceview3 is always built from sources until the bug in DLLMain is fixed in cygwin
+ REM SET CYGWIN_OPT= %CYGWIN_OPT% -P mingw64-%ARCH%-gtksourceview3.0
)
REM Cygwin setup sets proper ACLs (permissions) for folders it CREATES.
@@ -362,6 +364,9 @@ IF NOT "%APPVEYOR%" == "True" (
ECHO "========== INSTALL CYGWIN =========="
+REM If you need to add packages, see https://cygwin.com/packages/package_list.html for package names
+REM In the description of each package you also find the file list and maintainer there
+
IF "%RUNSETUP%"=="Y" (
%SETUP% ^
--proxy "%PROXY%" ^
@@ -376,6 +381,7 @@ IF "%RUNSETUP%"=="Y" (
-P pkg-config ^
-P mingw64-%ARCH%-binutils,mingw64-%ARCH%-gcc-core,mingw64-%ARCH%-gcc-g++,mingw64-%ARCH%-windows_default_manifest ^
-P mingw64-%ARCH%-headers,mingw64-%ARCH%-runtime,mingw64-%ARCH%-pthreads,mingw64-%ARCH%-zlib ^
+ -P adwaita-icon-theme ^
-P libiconv-devel,libunistring-devel,libncurses-devel ^
-P gettext-devel,libgettextpo-devel ^
-P libglib2.0-devel,libgdk_pixbuf2.0-devel ^
diff --git a/dev/build/windows/ReadMe.txt b/dev/build/windows/ReadMe.txt
index 55b46c616c..052014824f 100644
--- a/dev/build/windows/ReadMe.txt
+++ b/dev/build/windows/ReadMe.txt
@@ -131,7 +131,7 @@ mingwinCygwin: Install coq in the default Cygwin mingw sysroot folder.
Todo: The coq share folder should be configured to e.g. /share/coq.
As is, coqc scans the complete share folder, which slows it down 5x for short files.
-absoloute: Install coq in the absolute path given with -destcoq.
+absolute: Install coq in the absolute path given with -destcoq.
The resulting Coq will not be relocatable.
That is the root folder must not be renamed/moved.
@@ -299,7 +299,7 @@ The version of Coq to download and compile.
Possible values: 8.4pl6, 8.5pl2, 8.5pl3, 8.6
(download from https://coq.inria.fr/distrib/V$COQ_VERSION/files/coq-<version>.tar.gz)
Others versions might work, but are untested.
- 8.4 is only tested in mode=absoloute
+ 8.4 is only tested in mode=absolute
git-v8.6, git-trunk
(download from https://github.com/coq/coq/archive/<version without git->.zip)
diff --git a/dev/build/windows/makecoq_mingw.sh b/dev/build/windows/makecoq_mingw.sh
index 549f70e8fe..0699e2bd44 100755
--- a/dev/build/windows/makecoq_mingw.sh
+++ b/dev/build/windows/makecoq_mingw.sh
@@ -104,7 +104,8 @@ cd /build
mkdir -p "$SOURCE_LOCAL_CACHE_CFMT"
# sysroot prefix for the above /build/host/target combination
-PREFIX=$CYGWIN_INSTALLDIR_MFMT/usr/$TARGET_ARCH/sys-root/mingw
+# This must be in MFMT (C:/.../) because the OCaml library path is based on it and OCaml is a MinGW application.
+PREFIXMINGW=$CYGWIN_INSTALLDIR_MFMT/usr/$TARGET_ARCH/sys-root/mingw
# Install / Prefix folder for COQ
PREFIXCOQ=$RESULT_INSTALLDIR_MFMT
@@ -113,10 +114,10 @@ PREFIXCOQ=$RESULT_INSTALLDIR_MFMT
if [ "$INSTALLOCAML" == "Y" ]; then
PREFIXOCAML=$PREFIXCOQ
else
- PREFIXOCAML=$PREFIX
+ PREFIXOCAML=$PREFIXMINGW
fi
-mkdir -p "$PREFIX/bin"
+mkdir -p "$PREFIXMINGW/bin"
mkdir -p "$PREFIXCOQ/bin"
mkdir -p "$PREFIXOCAML/bin"
@@ -487,7 +488,7 @@ function build_post {
function build_conf_make_inst {
if build_prep "$1" "$2" "$3" ; then
$4
- logn configure ./configure --build="$BUILD" --host="$HOST" --target="$TARGET" --prefix="$PREFIX" "${@:5}"
+ logn configure ./configure --build="$BUILD" --host="$HOST" --target="$TARGET" --prefix="$PREFIXMINGW" "${@:5}"
# shellcheck disable=SC2086
log1 make $MAKE_OPT
log2 make install
@@ -895,9 +896,9 @@ function make_libxml2 {
# Note: latest release version 2.9.2 fails during configuring lzma, so using 2.9.1
# Note: python binding requires <sys/select.h> which doesn't exist on cygwin
if build_prep https://git.gnome.org/browse/libxml2/snapshot libxml2-2.9.1 tar.xz ; then
- # ./autogen.sh --build=$BUILD --host=$HOST --target=$TARGET --prefix="$PREFIX" --disable-shared --without-python
+ # ./autogen.sh --build=$BUILD --host=$HOST --target=$TARGET --prefix="$PREFIXMINGW" --disable-shared --without-python
# shared library required by gtksourceview
- ./autogen.sh --build="$BUILD" --host="$HOST" --target="$TARGET" --prefix="$PREFIX" --without-python
+ ./autogen.sh --build="$BUILD" --host="$HOST" --target="$TARGET" --prefix="$PREFIXMINGW" --without-python
# shellcheck disable=SC2086
log1 make $MAKE_OPT all
log2 make install
@@ -910,14 +911,13 @@ function make_libxml2 {
function make_gtk_sourceview3 {
# Cygwin packet dependencies: intltool
- # gtksourceview-2.11.2 requires GTK2
- # gtksourceview-2.91.9 requires GTK3
- # => We use gtksourceview-2.11.2 which seems to be the newest GTK2 based one
+ # Note: this is always built from sources cause of a bug in the cygwin delivery.
+ # Just dependencies are only built if we build from sources
if [ "$GTK_FROM_SOURCES" == "Y" ]; then
make_gtk3
make_libxml2
- build_conf_make_inst https://download.gnome.org/sources/gtksourceview/3.24 gtksourceview-3.24.9 tar.bz2 true
fi
+ build_conf_make_inst https://download.gnome.org/sources/gtksourceview/3.24 gtksourceview-3.24.11 tar.xz make_arch_pkg_config
}
##### FLEXDLL FLEXLINK #####
@@ -930,7 +930,7 @@ function make_gtk_sourceview3 {
# Install flexdll objects
function install_flexdll {
- cp flexdll.h "/usr/$TARGET_ARCH/sys-root/mingw/include"
+ cp flexdll.h "$PREFIXMINGW/include"
if [ "$TARGET_ARCH" == "i686-w64-mingw32" ]; then
cp flexdll*_mingw.o "/usr/$TARGET_ARCH/bin"
cp flexdll*_mingw.o "$PREFIXOCAML/bin"
@@ -1202,7 +1202,7 @@ function make_lablgtk {
function copy_coq_dll {
if [ "$INSTALLMODE" == "absolute" ] || [ "$INSTALLMODE" == "relocatable" ]; then
- cp "/usr/${ARCH}-w64-mingw32/sys-root/mingw/bin/$1" "$PREFIXCOQ/bin/$1"
+ cp "$PREFIXMINGW/bin/$1" "$PREFIXCOQ/bin/$1"
fi
}
@@ -1282,27 +1282,58 @@ function copy_coq_objects {
}
# Copy required GTK config and support files
+# This must be called from inside the coq build folder!
function copy_coq_gtk {
- echo 'gtk-theme-name = "Default"' > "$PREFIX/etc/gtk-3.0/gtkrc"
- echo 'gtk-fallback-icon-theme = "Tango"' >> "$PREFIX/etc/gtk-3.0/gtkrc"
+
+ glib-compile-schemas $PREFIXMINGW/share/glib-2.0/schemas/
+ echo 'gtk-theme-name = "Default"' > "$PREFIXMINGW/etc/gtk-3.0/gtkrc"
if [ "$INSTALLMODE" == "absolute" ] || [ "$INSTALLMODE" == "relocatable" ]; then
- install_glob "$PREFIX/etc/gtk-3.0" '*' "$PREFIXCOQ/gtk-3.0"
- install_glob "$PREFIX/share/gtksourceview-3.0/language-specs" '*' "$PREFIXCOQ/share/gtksourceview-3.0/language-specs"
- install_glob "$PREFIX/share/gtksourceview-3.0/styles" '*' "$PREFIXCOQ/share/gtksourceview-3.0/styles"
- install_rec "$PREFIX/share/themes" '*' "$PREFIXCOQ/share/themes"
+ install_glob "$PREFIXMINGW/etc/gtk-3.0" '*' "$PREFIXCOQ/gtk-3.0"
+ install -D -T "$PREFIXMINGW/share/glib-2.0/schemas/gschemas.compiled" "$PREFIXCOQ/share/glib-2.0/schemas/gschemas.compiled"
+
+ install_glob "$PREFIXMINGW/share/gtksourceview-3.0/language-specs" '*' "$PREFIXCOQ/share/gtksourceview-3.0/language-specs"
+ install -D -T "ide/coq.lang" "$PREFIXCOQ/share/gtksourceview-3.0/language-specs/coq.lang"
+ install -D -T "ide/coq-ssreflect.lang" "$PREFIXCOQ/share/gtksourceview-3.0/language-specs/coq-ssreflect.lang"
+
+ install_glob "$PREFIXMINGW/share/gtksourceview-3.0/styles" '*' "$PREFIXCOQ/share/gtksourceview-3.0/styles"
+ install -D -T "ide/coq_style.xml" "$PREFIXCOQ/share/gtksourceview-3.0/styles/coq_style.xml"
+
+ install_rec "$PREFIXMINGW/share/themes" '*' "$PREFIXCOQ/share/themes"
+
+ FOLDERS=""
+ # The sizes include all default sizes given in index.theme
+ # The types used haven been recorded with ProcMon in an installation with all icons present
+ for SIZE in 16x16 22x22 32x32 48x48; do
+ for TYPE in \
+ actions/bookmark actions/document devices/drive actions/format-text actions/go actions/list \
+ actions/media actions/pan actions/process actions/system actions/window \
+ mimetypes/text places/folder places/user status/dialog
+ do
+ CLASS=$(dirname $TYPE)
+ ICON=$(basename $TYPE)
+ if [[ ! "$FOLDERS" =~ "$SIZE/$CLASS" ]] ;then
+ FOLDERS="$FOLDERS$SIZE/$CLASS,"
+ fi
+ install_rec "/usr/share/icons/Adwaita/$SIZE/$CLASS" "$ICON*" "$PREFIXCOQ/share/icons/Adwaita/$SIZE/$CLASS"
+ done
+ done
+ echo Folders=$FOLDERS
+ install -D -T "/usr/share/icons/Adwaita/index.theme" "$PREFIXCOQ/share/icons/Adwaita/index.theme"
+ sed -i "s|^Directories=.*|Directories=$FOLDERS|" "$PREFIXCOQ/share/icons/Adwaita/index.theme"
+ gtk-update-icon-cache -f "$PREFIXCOQ/share/icons/Adwaita/"
# This below item look like a bug in make install
- if [ -d "$PREFIXCOQ/share/coq/" ] ; then
- COQSHARE="$PREFIXCOQ/share/coq/"
- else
- COQSHARE="$PREFIXCOQ/share/"
- fi
-
- mkdir -p "$PREFIXCOQ/ide"
- mv "$COQSHARE"*.png "$PREFIXCOQ/ide"
- rmdir "$PREFIXCOQ/share/coq" || true
+ # if [ -d "$PREFIXCOQ/share/coq/" ] ; then
+ # COQSHARE="$PREFIXCOQ/share/coq/"
+ # else
+ # COQSHARE="$PREFIXCOQ/share/"
+ # fi
+
+ # mkdir -p "$PREFIXCOQ/ide"
+ # mv "$COQSHARE"*.png "$PREFIXCOQ/ide"
+ # rmdir "$PREFIXCOQ/share/coq" || true
fi
}
@@ -1454,7 +1485,7 @@ function make_gcc {
--enable-languages=c --disable-nls \
--disable-libsanitizer --disable-libssp --disable-libquadmath --disable-libgomp --disable-libvtv --disable-lto
# --disable-decimal-float seems to be required
- # --with-sysroot="$PREFIX" results in configure error that this is not an absolute path
+ # --with-sysroot="$PREFIXMINGW" results in configure error that this is not an absolute path
# shellcheck disable=SC2086
log1 make $MAKE_OPT
log2 make install
diff --git a/dev/build/windows/patches_coq/ocaml-4.07.1.patch b/dev/build/windows/patches_coq/ocaml-4.07.1.patch
new file mode 100755
index 0000000000..2d61b5b838
--- /dev/null
+++ b/dev/build/windows/patches_coq/ocaml-4.07.1.patch
@@ -0,0 +1,97 @@
+diff/patch file created on Tue, Jun 11, 2019 10:15:38 AM with:
+difftar-folder.sh tarballs/ocaml-4.07.1.tar.gz ocaml-4.07.1 1
+TARFILE= tarballs/ocaml-4.07.1.tar.gz
+FOLDER= ocaml-4.07.1/
+TARSTRIP= 1
+TARPREFIX= ocaml-4.07.1/
+ORIGFOLDER= ocaml-4.07.1.orig
+--- ocaml-4.07.1.orig/byterun/caml/osdeps.h 2018-10-04 15:38:56.000000000 +0200
++++ ocaml-4.07.1/byterun/caml/osdeps.h 2019-06-11 10:13:50.766997600 +0200
+@@ -98,6 +98,11 @@
+ */
+ extern char_os *caml_secure_getenv(char_os const *var);
+
++/* Modify or delete environment variable.
++ Returns 0 on success or an error code.
++*/
++extern int caml_putenv(char_os const *var, char_os const *value);
++
+ /* If [fd] refers to a terminal or console, return the number of rows
+ (lines) that it displays. Otherwise, or if the number of rows
+ cannot be determined, return -1. */
+--- ocaml-4.07.1.orig/byterun/debugger.c 2018-10-04 15:38:56.000000000 +0200
++++ ocaml-4.07.1/byterun/debugger.c 2019-06-11 10:14:02.706013700 +0200
+@@ -180,6 +180,7 @@
+ if (address == NULL) return;
+ if (dbg_addr != NULL) caml_stat_free(dbg_addr);
+ dbg_addr = address;
++ caml_putenv(_T("CAML_DEBUG_SOCKET"),_T(""));
+
+ #ifdef _WIN32
+ winsock_startup();
+--- ocaml-4.07.1.orig/byterun/unix.c 2018-10-04 15:38:56.000000000 +0200
++++ ocaml-4.07.1/byterun/unix.c 2019-06-11 10:14:11.252438800 +0200
+@@ -430,6 +430,19 @@
+ #endif
+ }
+
++int caml_putenv(char_os const *var, char_os const *value)
++{
++ char_os * s;
++ int ret;
++
++ s = caml_stat_strconcat_os(3, var, _T("="), value);
++ ret = putenv_os(s);
++ if (ret == -1) {
++ caml_stat_free(s);
++ }
++ return ret;
++}
++
+ int caml_num_rows_fd(int fd)
+ {
+ #ifdef TIOCGWINSZ
+--- ocaml-4.07.1.orig/byterun/win32.c 2018-10-04 15:38:56.000000000 +0200
++++ ocaml-4.07.1/byterun/win32.c 2019-06-11 10:14:19.485640700 +0200
+@@ -727,6 +727,19 @@
+ return _wgetenv(var);
+ }
+
++int caml_putenv(char_os const *var, char_os const *value)
++{
++ char_os * s;
++ int ret;
++
++ s = caml_stat_strconcat_os(3, var, _T("="), value);
++ ret = putenv_os(s);
++ if (ret == -1) {
++ caml_stat_free(s);
++ }
++ return ret;
++}
++
+ /* caml_win32_getenv is used to implement Sys.getenv and Unix.getenv in such a
+ way that they get direct access to the Win32 environment rather than to the
+ copy that is cached by the C runtime system. The result of caml_win32_getenv
+--- ocaml-4.07.1.orig/config/Makefile.mingw 2018-10-04 15:38:56.000000000 +0200
++++ ocaml-4.07.1//config/Makefile.mingw 2019-06-11 10:14:44.492969800 +0200
+@@ -89,7 +89,7 @@
+ NATDYNLINK=true
+ NATDYNLINKOPTS=
+ CMXS=cmxs
+-RUNTIMED=false
++RUNTIMED=true
+ ASM_CFI_SUPPORTED=false
+ WITH_FRAME_POINTERS=false
+ UNIX_OR_WIN32=win32
+--- ocaml-4.07.1.orig/config/Makefile.mingw64 2018-10-04 15:38:56.000000000 +0200
++++ ocaml-4.07.1//config/Makefile.mingw64 2019-06-11 10:14:53.664784900 +0200
+@@ -89,7 +89,7 @@
+ NATDYNLINK=true
+ NATDYNLINKOPTS=
+ CMXS=cmxs
+-RUNTIMED=false
++RUNTIMED=true
+ ASM_CFI_SUPPORTED=false
+ WITH_FRAME_POINTERS=false
+ UNIX_OR_WIN32=win32
diff --git a/dev/ci/ci-basic-overlay.sh b/dev/ci/ci-basic-overlay.sh
index 95fceb773a..fa39b41565 100755
--- a/dev/ci/ci-basic-overlay.sh
+++ b/dev/ci/ci-basic-overlay.sh
@@ -215,7 +215,7 @@
########################################################################
# simple-io
########################################################################
-: "${simple_io_CI_REF:=dev}"
+: "${simple_io_CI_REF:=master}"
: "${simple_io_CI_GITURL:=https://github.com/Lysxia/coq-simple-io}"
: "${simple_io_CI_ARCHIVEURL:=${simple_io_CI_GITURL}/archive}"
diff --git a/dev/ci/ci-fiat-crypto.sh b/dev/ci/ci-fiat-crypto.sh
index bba17314f7..e8c8d22678 100755
--- a/dev/ci/ci-fiat-crypto.sh
+++ b/dev/ci/ci-fiat-crypto.sh
@@ -11,7 +11,7 @@ git_download fiat_crypto
# c.f. https://github.com/coq/coq/pull/8313#issuecomment-416650241
fiat_crypto_CI_TARGETS1="c-files printlite lite"
-fiat_crypto_CI_TARGETS2="print-nobigmem nobigmem"
+fiat_crypto_CI_TARGETS2="coq"
( cd "${CI_BUILD_DIR}/fiat_crypto" && git submodule update --init --recursive && \
ulimit -s 32768 && \
diff --git a/dev/ci/ci-iris-lambda-rust.sh b/dev/ci/ci-iris-lambda-rust.sh
index 95f143bb95..d99e140bce 100755
--- a/dev/ci/ci-iris-lambda-rust.sh
+++ b/dev/ci/ci-iris-lambda-rust.sh
@@ -8,14 +8,14 @@ install_ssreflect
# Setup lambdaRust first
git_download lambdaRust
-# Extract required version of Iris
-Iris_CI_REF=$(grep -F coq-iris < "${CI_BUILD_DIR}/lambdaRust/opam" | sed 's/.*"dev\.[0-9.-]\+\.\([0-9a-z]\+\)".*/\1/')
+# Extract required version of Iris (avoiding "+" which does not work on MacOS :( *)
+Iris_CI_REF=$(grep -F coq-iris < "${CI_BUILD_DIR}/lambdaRust/opam" | sed 's/.*"dev\.[0-9][0-9.-]*\.\([0-9a-z][0-9a-z]*\)".*/\1/')
# Setup Iris
git_download Iris
# Extract required version of std++
-stdpp_CI_REF=$(grep -F coq-stdpp < "${CI_BUILD_DIR}/Iris/opam" | sed 's/.*"dev\.[0-9.-]\+\.\([0-9a-z]\+\)".*/\1/')
+stdpp_CI_REF=$(grep -F coq-stdpp < "${CI_BUILD_DIR}/Iris/opam" | sed 's/.*"dev\.[0-9][0-9.-]*\.\([0-9a-z][0-9a-z]*\)".*/\1/')
# Setup std++
git_download stdpp
diff --git a/dev/ci/docker/bionic_coq/Dockerfile b/dev/ci/docker/bionic_coq/Dockerfile
index 8eebb3af64..f07a5cdb98 100644
--- a/dev/ci/docker/bionic_coq/Dockerfile
+++ b/dev/ci/docker/bionic_coq/Dockerfile
@@ -1,4 +1,4 @@
-# CACHEKEY: "bionic_coq-V2019-04-20-V1"
+# CACHEKEY: "bionic_coq-V2019-06-21-V1"
# ^^ Update when modifying this file.
FROM ubuntu:bionic
@@ -38,7 +38,7 @@ ENV COMPILER="4.05.0"
# `num` does not have a version number as the right version to install varies
# with the compiler version.
ENV BASE_OPAM="num ocamlfind.1.8.0 dune.1.6.2 ounit.2.0.8 odoc.1.4.0" \
- CI_OPAM="menhir.20181113 elpi.1.2.0 ocamlgraph.1.8.8"
+ CI_OPAM="menhir.20181113 elpi.1.4.0 ocamlgraph.1.8.8"
# BASE switch; CI_OPAM contains Coq's CI dependencies.
ENV COQIDE_OPAM="cairo2.0.6 lablgtk3-sourceview3.3.0.beta5"
diff --git a/dev/ci/user-overlays/07819-mattam-ho-matching-occ-sel.sh b/dev/ci/user-overlays/07819-mattam-ho-matching-occ-sel.sh
deleted file mode 100644
index 2b4c1489ad..0000000000
--- a/dev/ci/user-overlays/07819-mattam-ho-matching-occ-sel.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-_OVERLAY_BRANCH=ho-matching-occ-sel
-
-if [ "$CI_PULL_REQUEST" = "7819" ] || [ "$CI_BRANCH" = "$_OVERLAY_BRANCH" ]; then
-
- unicoq_CI_REF="PR7819-overlay"
-
- mtac2_CI_REF="PR7819-overlay"
- mtac2_CI_GITURL=https://github.com/mattam82/Mtac2
-
- equations_CI_GITURL=https://github.com/mattam82/Coq-Equations
- equations_CI_REF="PR7819-overlay"
-
-fi
diff --git a/dev/ci/user-overlays/08726-herbelin-master+more-stable-meaning-to-Discharge-flag.sh b/dev/ci/user-overlays/08726-herbelin-master+more-stable-meaning-to-Discharge-flag.sh
new file mode 100644
index 0000000000..242b177d71
--- /dev/null
+++ b/dev/ci/user-overlays/08726-herbelin-master+more-stable-meaning-to-Discharge-flag.sh
@@ -0,0 +1,23 @@
+if [ "$CI_PULL_REQUEST" = "8726" ] || [ "$CI_BRANCH" = "master+more-stable-meaning-to-Discharge-flag" ]; then
+
+ fiat_parsers_CI_BRANCH=master+change-for-coq-pr8726
+ fiat_parsers_CI_REF=master+change-for-coq-pr8726
+ fiat_parsers_CI_GITURL=https://github.com/herbelin/fiat
+
+ elpi_CI_BRANCH=coq-master+fix-global-pr8726
+ elpi_CI_REF=coq-master+fix-global-pr8726
+ elpi_CI_GITURL=https://github.com/herbelin/coq-elpi
+
+ equations_CI_BRANCH=master+fix-global-pr8726
+ equations_CI_REF=master+fix-global-pr8726
+ equations_CI_GITURL=https://github.com/herbelin/Coq-Equations
+
+ mtac2_CI_BRANCH=master+fix-global-pr8726
+ mtac2_CI_REF=master+fix-global-pr8726
+ mtac2_CI_GITURL=https://github.com/herbelin/Mtac2
+
+ paramcoq_CI_BRANCH=master+fix-global-pr8726
+ paramcoq_CI_REF=master+fix-global-pr8726
+ paramcoq_CI_GITURL=https://github.com/herbelin/paramcoq
+
+fi
diff --git a/dev/ci/user-overlays/08764-validsdp-master-parsing-decimal.sh b/dev/ci/user-overlays/08764-validsdp-master-parsing-decimal.sh
deleted file mode 100644
index 67f6f8610a..0000000000
--- a/dev/ci/user-overlays/08764-validsdp-master-parsing-decimal.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "8764" ] || [ "$CI_BRANCH" = "master-parsing-decimal" ]; then
-
- ltac2_CI_REF=master-parsing-decimal
- ltac2_CI_GITURL=https://github.com/proux01/ltac2
-
- quickchick_CI_REF=master-parsing-decimal
- quickchick_CI_GITURL=https://github.com/proux01/QuickChick
-
- Corn_CI_REF=master-parsing-decimal
- Corn_CI_GITURL=https://github.com/proux01/corn
-
- HoTT_CI_REF=master-parsing-decimal
- HoTT_CI_GITURL=https://github.com/proux01/HoTT
-
- stdlib2_CI_REF=master-parsing-decimal
- stdlib2_CI_GITURL=https://github.com/proux01/stdlib2
-
-fi
diff --git a/dev/ci/user-overlays/08817-sprop.sh b/dev/ci/user-overlays/08817-sprop.sh
deleted file mode 100644
index 81e18226ed..0000000000
--- a/dev/ci/user-overlays/08817-sprop.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "8817" ] || [ "$CI_BRANCH" = "sprop" ]; then
- aac_tactics_CI_REF=sprop
- aac_tactics_CI_GITURL=https://github.com/SkySkimmer/aac-tactics
-
- coq_dpdgraph_CI_REF=sprop
- coq_dpdgraph_CI_GITURL=https://github.com/SkySkimmer/coq-dpdgraph
-
- coqhammer_CI_REF=sprop
- coqhammer_CI_GITURL=https://github.com/SkySkimmer/coqhammer
-
- elpi_CI_REF=sprop
- elpi_CI_GITURL=https://github.com/SkySkimmer/coq-elpi
-
- equations_CI_REF=sprop
- equations_CI_GITURL=https://github.com/SkySkimmer/Coq-Equations
-
- ltac2_CI_REF=sprop
- ltac2_CI_GITURL=https://github.com/SkySkimmer/ltac2
-
- unicoq_CI_REF=sprop
- unicoq_CI_GITURL=https://github.com/SkySkimmer/unicoq
-
- mtac2_CI_REF=sprop
- mtac2_CI_GITURL=https://github.com/SkySkimmer/mtac2
-
- paramcoq_CI_REF=sprop
- paramcoq_CI_GITURL=https://github.com/SkySkimmer/paramcoq
-
- quickchick_CI_REF=sprop
- quickchick_CI_GITURL=https://github.com/SkySkimmer/QuickChick
-
- relation_algebra_CI_REF=sprop
- relation_algebra_CI_GITURL=https://github.com/SkySkimmer/relation-algebra
-fi
diff --git a/dev/ci/user-overlays/08829-proj-syntax-check.sh b/dev/ci/user-overlays/08829-proj-syntax-check.sh
deleted file mode 100644
index c04621114f..0000000000
--- a/dev/ci/user-overlays/08829-proj-syntax-check.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "8829" ] || [ "$CI_BRANCH" = "proj-syntax-check" ]; then
- lambdaRust_CI_REF=proj-syntax-check
- lambdaRust_CI_GITURL=https://github.com/SkySkimmer/lambda-rust
- lambdaRust_CI_ARCHIVEURL=$lambdaRust_CI_GITURL/archive
-fi
diff --git a/dev/ci/user-overlays/08893-herbelin-master+moving-evars-of-term-on-econstr.sh b/dev/ci/user-overlays/08893-herbelin-master+moving-evars-of-term-on-econstr.sh
deleted file mode 100644
index dc39ea5ef0..0000000000
--- a/dev/ci/user-overlays/08893-herbelin-master+moving-evars-of-term-on-econstr.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "8893" ] || [ "$CI_BRANCH" = "master+moving-evars-of-term-on-econstr" ]; then
-
- equations_CI_BRANCH=master+fix-evars_of_term-pr8893
- equations_CI_REF=master+fix-evars_of_term-pr8893
- equations_CI_GITURL=https://github.com/herbelin/Coq-Equations
-
-fi
diff --git a/dev/ci/user-overlays/08984-vbgl-rm-hardwired-hint-db.sh b/dev/ci/user-overlays/08984-vbgl-rm-hardwired-hint-db.sh
deleted file mode 100644
index 12be1b676a..0000000000
--- a/dev/ci/user-overlays/08984-vbgl-rm-hardwired-hint-db.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "8984" ] || [ "$CI_BRANCH" = "rm-hardwired-hint-db" ]; then
-
- HoTT_CI_REF=rm-hardwired-hint-db
- HoTT_CI_GITURL=https://github.com/vbgl/HoTT
-
- ltac2_CI_REF=rm-hardwired-hint-db
- ltac2_CI_GITURL=https://github.com/vbgl/ltac2
-
- UniMath_CI_REF=rm-hardwired-hint-db
- UniMath_CI_GITURL=https://github.com/vbgl/UniMath
-
-fi
diff --git a/dev/ci/user-overlays/09129-ejgallego-proof+no_global_partial.sh b/dev/ci/user-overlays/09129-ejgallego-proof+no_global_partial.sh
deleted file mode 100644
index c09d1b8929..0000000000
--- a/dev/ci/user-overlays/09129-ejgallego-proof+no_global_partial.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "9129" ] || [ "$CI_BRANCH" = "proof+no_global_partial" ]; then
-
- aac_tactics_CI_REF=proof+no_global_partial
- aac_tactics_CI_GITURL=https://github.com/ejgallego/aac-tactics
-
- # coqhammer_CI_REF=proof+no_global_partial
- # coqhammer_CI_GITURL=https://github.com/ejgallego/coqhammer
-
- elpi_CI_REF=proof+no_global_partial
- elpi_CI_GITURL=https://github.com/ejgallego/coq-elpi
-
- equations_CI_REF=proof+no_global_partial
- equations_CI_GITURL=https://github.com/ejgallego/Coq-Equations
-
- ltac2_CI_REF=proof+no_global_partial
- ltac2_CI_GITURL=https://github.com/ejgallego/ltac2
-
- # unicoq_CI_REF=proof+no_global_partial
- # unicoq_CI_GITURL=https://github.com/ejgallego/unicoq
-
- mtac2_CI_REF=proof+no_global_partial
- mtac2_CI_GITURL=https://github.com/ejgallego/Mtac2
-
- paramcoq_CI_REF=proof+no_global_partial
- paramcoq_CI_GITURL=https://github.com/ejgallego/paramcoq
-
- quickchick_CI_REF=proof+no_global_partial
- quickchick_CI_GITURL=https://github.com/ejgallego/QuickChick
-
-fi
diff --git a/dev/ci/user-overlays/09165-ejgallego-recarg-cleanup.sh b/dev/ci/user-overlays/09165-ejgallego-recarg-cleanup.sh
deleted file mode 100644
index 1e1d36d54a..0000000000
--- a/dev/ci/user-overlays/09165-ejgallego-recarg-cleanup.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "9165" ] || [ "$CI_BRANCH" = "recarg-cleanup" ]; then
-
- elpi_CI_REF=recarg-cleanup
- elpi_CI_GITURL=https://github.com/ejgallego/coq-elpi
-
- quickchick_CI_REF=recarg-cleanup
- quickchick_CI_GITURL=https://github.com/ejgallego/QuickChick
-
-fi
diff --git a/dev/ci/user-overlays/09173-ejgallego-proofview+proof_info.sh b/dev/ci/user-overlays/09173-ejgallego-proofview+proof_info.sh
deleted file mode 100644
index 23eb24c304..0000000000
--- a/dev/ci/user-overlays/09173-ejgallego-proofview+proof_info.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "9173" ] || [ "$CI_BRANCH" = "proofview+proof_info" ]; then
-
- ltac2_CI_REF=proofview+proof_info
- ltac2_CI_GITURL=https://github.com/ejgallego/ltac2
-
- fiat_parsers_CI_REF=proofview+proof_info
- fiat_parsers_CI_GITURL=https://github.com/ejgallego/fiat
-
-fi
diff --git a/dev/ci/user-overlays/09389-SkySkimmer-set-implicits.sh b/dev/ci/user-overlays/09389-SkySkimmer-set-implicits.sh
deleted file mode 100644
index 1110157069..0000000000
--- a/dev/ci/user-overlays/09389-SkySkimmer-set-implicits.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "9389" ] || [ "$CI_BRANCH" = "set-implicits" ]; then
-
- equations_CI_REF=set-implicits
- equations_CI_GITURL=https://github.com/SkySkimmer/Coq-Equations
-
- mtac2_CI_REF=set-implicits
- mtac2_CI_GITURL=https://github.com/SkySkimmer/Mtac2
-
-fi
diff --git a/dev/ci/user-overlays/09439-sep-variance.sh b/dev/ci/user-overlays/09439-sep-variance.sh
deleted file mode 100644
index cca85a2f68..0000000000
--- a/dev/ci/user-overlays/09439-sep-variance.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-
-if [ "$CI_PULL_REQUEST" = "9439" ] || [ "$CI_BRANCH" = "sep-variance" ]; then
- elpi_CI_REF=sep-variance
- elpi_CI_GITURL=https://github.com/SkySkimmer/coq-elpi
-
- equations_CI_REF=sep-variance
- equations_CI_GITURL=https://github.com/SkySkimmer/Coq-Equations
-
- mtac2_CI_REF=sep-variance
- mtac2_CI_GITURL=https://github.com/SkySkimmer/mtac2
-
- paramcoq_CI_REF=sep-variance
- paramcoq_CI_GITURL=https://github.com/SkySkimmer/paramcoq
-fi
diff --git a/dev/ci/user-overlays/09476-ppedrot-context-constructor.sh b/dev/ci/user-overlays/09476-ppedrot-context-constructor.sh
deleted file mode 100644
index 1af8b5430d..0000000000
--- a/dev/ci/user-overlays/09476-ppedrot-context-constructor.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "9476" ] || [ "$CI_BRANCH" = "context-constructor" ]; then
-
- quickchick_CI_REF=context-constructor
- quickchick_CI_GITURL=https://github.com/ppedrot/QuickChick
-
- equations_CI_REF=context-constructor
- equations_CI_GITURL=https://github.com/ppedrot/Coq-Equations
-
-fi
diff --git a/dev/ci/user-overlays/09566-ejgallego-proof_global+move_termination_routine_out.sh b/dev/ci/user-overlays/09566-ejgallego-proof_global+move_termination_routine_out.sh
new file mode 100644
index 0000000000..e4cf74aa51
--- /dev/null
+++ b/dev/ci/user-overlays/09566-ejgallego-proof_global+move_termination_routine_out.sh
@@ -0,0 +1,12 @@
+if [ "$CI_PULL_REQUEST" = "9566" ] || [ "$CI_BRANCH" = "proof_global+move_termination_routine_out" ]; then
+
+ aac_tactics_CI_REF=proof_global+move_termination_routine_out
+ aac_tactics_CI_GITURL=https://github.com/ejgallego/aac-tactics
+
+ equations_CI_REF=proof_global+move_termination_routine_out
+ equations_CI_GITURL=https://github.com/ejgallego/Coq-Equations
+
+ paramcoq_CI_REF=proof_global+move_termination_routine_out
+ paramcoq_CI_GITURL=https://github.com/ejgallego/paramcoq
+
+fi
diff --git a/dev/ci/user-overlays/09567-ejgallego-hooks_unify.sh b/dev/ci/user-overlays/09567-ejgallego-hooks_unify.sh
deleted file mode 100644
index 27ce9aca16..0000000000
--- a/dev/ci/user-overlays/09567-ejgallego-hooks_unify.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "9567" ] || [ "$CI_BRANCH" = "hooks_unify" ]; then
-
- equations_CI_REF=hooks_unify
- equations_CI_GITURL=https://github.com/ejgallego/Coq-Equations
-
- mtac2_CI_REF=hooks_unify
- mtac2_CI_GITURL=https://github.com/ejgallego/Mtac2
-
- paramcoq_CI_REF=hooks_unify
- paramcoq_CI_GITURL=https://github.com/ejgallego/paramcoq
-
-fi
diff --git a/dev/ci/user-overlays/09602-gares-more-delta-in-termination-checking.sh b/dev/ci/user-overlays/09602-gares-more-delta-in-termination-checking.sh
deleted file mode 100644
index 18a295cdbb..0000000000
--- a/dev/ci/user-overlays/09602-gares-more-delta-in-termination-checking.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "9602" ] || [ "$CI_BRANCH" = "more-delta-in-termination-checking" ]; then
-
- equations_CI_REF=more-delta-in-termination-checking
- equations_CI_GITURL=https://github.com/gares/Coq-Equations
-
-fi
diff --git a/dev/ci/user-overlays/09645-ejgallego-proof+sayonara_baby.sh b/dev/ci/user-overlays/09645-ejgallego-proof+sayonara_baby.sh
new file mode 100644
index 0000000000..3029f3019c
--- /dev/null
+++ b/dev/ci/user-overlays/09645-ejgallego-proof+sayonara_baby.sh
@@ -0,0 +1,12 @@
+if [ "$CI_PULL_REQUEST" = "9645" ] || [ "$CI_BRANCH" = "proof+sayonara_baby" ]; then
+
+ equations_CI_REF=proof+sayonara_baby
+ equations_CI_GITURL=https://github.com/ejgallego/Coq-Equations
+
+ mtac2_CI_REF=proof+sayonara_baby
+ mtac2_CI_GITURL=https://github.com/ejgallego/Mtac2
+
+ paramcoq_CI_REF=proof+sayonara_baby
+ paramcoq_CI_GITURL=https://github.com/ejgallego/paramcoq
+
+fi
diff --git a/dev/ci/user-overlays/09678-printed-by-env.sh b/dev/ci/user-overlays/09678-printed-by-env.sh
deleted file mode 100644
index ccb3498764..0000000000
--- a/dev/ci/user-overlays/09678-printed-by-env.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-
-if [ "$CI_PULL_REQUEST" = "9678" ] || [ "$CI_BRANCH" = "printed-by-env" ]; then
- elpi_CI_REF=printed-by-env
- elpi_CI_GITURL=https://github.com/maximedenes/coq-elpi
-
- equations_CI_REF=printed-by-env
- equations_CI_GITURL=https://github.com/maximedenes/Coq-Equations
-
- ltac2_CI_REF=printed-by-env
- ltac2_CI_GITURL=https://github.com/maximedenes/ltac2
-
- quickchick_CI_REF=printed-by-env
- quickchick_CI_GITURL=https://github.com/maximedenes/QuickChick
-fi
diff --git a/dev/ci/user-overlays/09733-gares-quotations.sh b/dev/ci/user-overlays/09733-gares-quotations.sh
deleted file mode 100644
index b17454fc4c..0000000000
--- a/dev/ci/user-overlays/09733-gares-quotations.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "9733" ] || [ "$CI_BRANCH" = "quotations" ]; then
-
- ltac2_CI_REF=quotations
- ltac2_CI_GITURL=https://github.com/gares/ltac2
-
-fi
diff --git a/dev/ci/user-overlays/09815-token-type.sh b/dev/ci/user-overlays/09815-token-type.sh
deleted file mode 100644
index 4b49011de3..0000000000
--- a/dev/ci/user-overlays/09815-token-type.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "9815" ] || [ "$CI_BRANCH" = "token-type" ]; then
- ltac2_CI_REF=token-type
- ltac2_CI_GITURL=https://github.com/proux01/ltac2
-fi
diff --git a/dev/ci/user-overlays/09870-vbgl-recordops.sh b/dev/ci/user-overlays/09870-vbgl-recordops.sh
deleted file mode 100644
index bb14a8c204..0000000000
--- a/dev/ci/user-overlays/09870-vbgl-recordops.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "9870" ] || [ "$CI_BRANCH" = "doc-canonical" ]; then
-
- elpi_CI_REF=pr-9870
- elpi_CI_GITURL=https://github.com/vbgl/coq-elpi
-
-fi
diff --git a/dev/ci/user-overlays/09909-maximedenes-pretyping-rm-global.sh b/dev/ci/user-overlays/09909-maximedenes-pretyping-rm-global.sh
deleted file mode 100644
index 01d3068591..0000000000
--- a/dev/ci/user-overlays/09909-maximedenes-pretyping-rm-global.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "9909" ] || [ "$CI_BRANCH" = "pretyping-rm-global" ]; then
-
- elpi_CI_REF=pretyping-rm-global
- elpi_CI_GITURL=https://github.com/maximedenes/coq-elpi
-
- coqhammer_CI_REF=pretyping-rm-global
- coqhammer_CI_GITURL=https://github.com/maximedenes/coqhammer
-
- equations_CI_REF=pretyping-rm-global
- equations_CI_GITURL=https://github.com/maximedenes/Coq-Equations
-
- ltac2_CI_REF=pretyping-rm-global
- ltac2_CI_GITURL=https://github.com/maximedenes/ltac2
-
- paramcoq_CI_REF=pretyping-rm-global
- paramcoq_CI_GITURL=https://github.com/maximedenes/paramcoq
-
- mtac2_CI_REF=pretyping-rm-global
- mtac2_CI_GITURL=https://github.com/maximedenes/Mtac2
-
-fi
diff --git a/dev/ci/user-overlays/09973-gares-elpi-2.1.sh b/dev/ci/user-overlays/09973-gares-elpi-2.1.sh
deleted file mode 100644
index 9a6e25d893..0000000000
--- a/dev/ci/user-overlays/09973-gares-elpi-2.1.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "9973" ] || [ "$CI_BRANCH" = "elpi-1.2" ]; then
-
- elpi_CI_REF=overlay-elpi1.2-coq-master
- elpi_CI_GITURL=https://github.com/LPCIC/coq-elpi
-
-fi
diff --git a/dev/ci/user-overlays/10052-ppedrot-cleanup-logic-convert-hyp.sh b/dev/ci/user-overlays/10052-ppedrot-cleanup-logic-convert-hyp.sh
deleted file mode 100644
index 9f9cc19e83..0000000000
--- a/dev/ci/user-overlays/10052-ppedrot-cleanup-logic-convert-hyp.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "10052" ] || [ "$CI_BRANCH" = "cleanup-logic-convert-hyp" ]; then
-
- relation_algebra_CI_REF=cleanup-logic-convert-hyp
- relation_algebra_CI_GITURL=https://github.com/ppedrot/relation-algebra
-
-fi
diff --git a/dev/ci/user-overlays/10069-ppedrot-whd-for-evar-conv-no-stack.sh b/dev/ci/user-overlays/10069-ppedrot-whd-for-evar-conv-no-stack.sh
deleted file mode 100644
index 0e1449f36c..0000000000
--- a/dev/ci/user-overlays/10069-ppedrot-whd-for-evar-conv-no-stack.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "10069" ] || [ "$CI_BRANCH" = "whd-for-evar-conv-no-stack" ]; then
-
- unicoq_CI_REF=whd-for-evar-conv-no-stack
- unicoq_CI_GITURL=https://github.com/ppedrot/unicoq
-
-fi
diff --git a/dev/ci/user-overlays/10076-vbgl-canonical-disable-hint.sh b/dev/ci/user-overlays/10076-vbgl-canonical-disable-hint.sh
deleted file mode 100644
index 2015935dd9..0000000000
--- a/dev/ci/user-overlays/10076-vbgl-canonical-disable-hint.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "10076" ] || [ "$CI_BRANCH" = "canonical-disable-hint" ]; then
-
- elpi_CI_REF=canonical-disable-hint
- elpi_CI_GITURL=https://github.com/vbgl/coq-elpi
-
-fi
diff --git a/dev/ci/user-overlays/10125-SkySkimmer-run_tactic_gen.sh b/dev/ci/user-overlays/10125-SkySkimmer-run_tactic_gen.sh
deleted file mode 100644
index 4032b1c6b5..0000000000
--- a/dev/ci/user-overlays/10125-SkySkimmer-run_tactic_gen.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "10125" ] || [ "$CI_BRANCH" = "run_tactic_gen" ]; then
-
- paramcoq_CI_REF=run_tactic_gen
- paramcoq_CI_GITURL=https://github.com/SkySkimmer/paramcoq
-
-fi
diff --git a/dev/ci/user-overlays/10135-maximedenes-detype-anonymous.sh b/dev/ci/user-overlays/10135-maximedenes-detype-anonymous.sh
deleted file mode 100644
index bc8aa33565..0000000000
--- a/dev/ci/user-overlays/10135-maximedenes-detype-anonymous.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "10135" ] || [ "$CI_BRANCH" = "detype-anonymous" ]; then
-
- unicoq_CI_REF=detype-anonymous
- unicoq_CI_GITURL=https://github.com/maximedenes/unicoq
-
-fi
diff --git a/dev/ci/user-overlays/10157-SkySkimmer-def-not-visible-generic-warning.sh b/dev/ci/user-overlays/10157-SkySkimmer-def-not-visible-generic-warning.sh
deleted file mode 100644
index fcbeb32a58..0000000000
--- a/dev/ci/user-overlays/10157-SkySkimmer-def-not-visible-generic-warning.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "10188" ] || [ "$CI_BRANCH" = "def-not-visible-remove-warning" ]; then
-
- elpi_CI_REF=def-not-visible-generic-warning
- elpi_CI_GITURL=https://github.com/SkySkimmer/coq-elpi
-
-fi
diff --git a/dev/ci/user-overlays/10177-SkySkimmer-generalize.sh b/dev/ci/user-overlays/10177-SkySkimmer-generalize.sh
deleted file mode 100644
index a89f6aca1b..0000000000
--- a/dev/ci/user-overlays/10177-SkySkimmer-generalize.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-if [ "$CI_PULL_REQUEST" = "10177" ] || [ "$CI_BRANCH" = "generalize" ]; then
-
- quickchick_CI_REF=generalize
- quickchick_CI_GITURL=https://github.com/SkySkimmer/QuickChick
-
-fi
diff --git a/dev/ci/user-overlays/10185-SkySkimmer-instance-no-bang.sh b/dev/ci/user-overlays/10185-SkySkimmer-instance-no-bang.sh
new file mode 100644
index 0000000000..c584438b21
--- /dev/null
+++ b/dev/ci/user-overlays/10185-SkySkimmer-instance-no-bang.sh
@@ -0,0 +1,6 @@
+if [ "$CI_PULL_REQUEST" = "10185" ] || [ "$CI_BRANCH" = "instance-no-bang" ]; then
+
+ quickchick_CI_REF=instance-no-bang
+ quickchick_CI_GITURL=https://github.com/SkySkimmer/QuickChick
+
+fi
diff --git a/dev/ci/user-overlays/10231-herbelin-master+locating-warning-different-implicit-term-type.sh b/dev/ci/user-overlays/10231-herbelin-master+locating-warning-different-implicit-term-type.sh
new file mode 100644
index 0000000000..c8cf85e73e
--- /dev/null
+++ b/dev/ci/user-overlays/10231-herbelin-master+locating-warning-different-implicit-term-type.sh
@@ -0,0 +1,9 @@
+if [ "$CI_PULL_REQUEST" = "10231" ] || [ "$CI_BRANCH" = "master+locating-warning-different-implicit-term-type" ]; then
+
+ equations_CI_REF=master+fix-manual-implicit-pr10231
+ equations_CI_GITURL=https://github.com/herbelin/Coq-Equations
+
+ mtac2_CI_REF=master+fix-manual-implicit-pr10231
+ mtac2_CI_GITURL=https://github.com/herbelin/Mtac2
+
+fi
diff --git a/dev/ci/user-overlays/10319-SkySkimmer-vernac-when-sideff.sh b/dev/ci/user-overlays/10319-SkySkimmer-vernac-when-sideff.sh
new file mode 100644
index 0000000000..c5f1510357
--- /dev/null
+++ b/dev/ci/user-overlays/10319-SkySkimmer-vernac-when-sideff.sh
@@ -0,0 +1,9 @@
+if [ "$CI_PULL_REQUEST" = "10319" ] || [ "$CI_BRANCH" = "vernac-when-sideff" ]; then
+
+ mtac2_CI_REF=vernac-when-sideff
+ mtac2_CI_GITURL=https://github.com/SkySkimmer/Mtac2
+
+ equations_CI_REF=vernac-when-sideff
+ equations_CI_GITURL=https://github.com/SkySkimmer/Coq-Equations
+
+fi
diff --git a/dev/ci/user-overlays/10334-ppedrot-rm-kernel-sideeff-role.sh b/dev/ci/user-overlays/10334-ppedrot-rm-kernel-sideeff-role.sh
new file mode 100644
index 0000000000..2c3f490c03
--- /dev/null
+++ b/dev/ci/user-overlays/10334-ppedrot-rm-kernel-sideeff-role.sh
@@ -0,0 +1,6 @@
+if [ "$CI_PULL_REQUEST" = "10334" ] || [ "$CI_BRANCH" = "rm-kernel-sideeff-role" ]; then
+
+ equations_CI_REF=rm-kernel-sideeff-role
+ equations_CI_GITURL=https://github.com/ppedrot/Coq-Equations
+
+fi
diff --git a/dev/ci/user-overlays/10358-gares-elpi13.sh b/dev/ci/user-overlays/10358-gares-elpi13.sh
new file mode 100644
index 0000000000..d2ba9b5ddf
--- /dev/null
+++ b/dev/ci/user-overlays/10358-gares-elpi13.sh
@@ -0,0 +1,6 @@
+if [ "$CI_PULL_REQUEST" = "10358" ] || [ "$CI_BRANCH" = "elpi-13-coq" ]; then
+
+ elpi_CI_REF="elpi-13-coq"
+ elpi_CI_GITURL=https://github.com/LPCIC/coq-elpi
+
+fi
diff --git a/dev/ci/user-overlays/10362-ppedrot-delay-poly-opaque.sh b/dev/ci/user-overlays/10362-ppedrot-delay-poly-opaque.sh
new file mode 100644
index 0000000000..735b2ebbc3
--- /dev/null
+++ b/dev/ci/user-overlays/10362-ppedrot-delay-poly-opaque.sh
@@ -0,0 +1,15 @@
+if [ "$CI_PULL_REQUEST" = "10362" ] || [ "$CI_BRANCH" = "delay-poly-opaque" ]; then
+
+ paramcoq_CI_REF=delay-poly-opaque
+ paramcoq_CI_GITURL=https://github.com/ppedrot/paramcoq
+
+ elpi_CI_REF=delay-poly-opaque
+ elpi_CI_GITURL=https://github.com/ppedrot/coq-elpi
+
+ coqhammer_CI_REF=delay-poly-opaque
+ coqhammer_CI_GITURL=https://github.com/ppedrot/coqhammer
+
+ coq_dpdgraph_CI_REF=delay-poly-opaque
+ coq_dpdgraph_CI_GITURL=https://github.com/ppedrot/coq-dpdgraph
+
+fi
diff --git a/dev/ci/user-overlays/10406-ppedrot-desync-entry-proof.sh b/dev/ci/user-overlays/10406-ppedrot-desync-entry-proof.sh
new file mode 100644
index 0000000000..3122f953de
--- /dev/null
+++ b/dev/ci/user-overlays/10406-ppedrot-desync-entry-proof.sh
@@ -0,0 +1,9 @@
+if [ "$CI_PULL_REQUEST" = "10406" ] || [ "$CI_BRANCH" = "desync-entry-proof" ]; then
+
+ equations_CI_REF=desync-entry-proof
+ equations_CI_GITURL=https://github.com/ppedrot/Coq-Equations
+
+ quickchick_CI_REF=desync-entry-proof
+ quickchick_CI_GITURL=https://github.com/ppedrot/QuickChick
+
+fi
diff --git a/dev/ci/user-overlays/10416-gares-elpi-14.sh b/dev/ci/user-overlays/10416-gares-elpi-14.sh
new file mode 100644
index 0000000000..52d1005a7d
--- /dev/null
+++ b/dev/ci/user-overlays/10416-gares-elpi-14.sh
@@ -0,0 +1,6 @@
+if [ "$CI_PULL_REQUEST" = "10416" ] || [ "$CI_BRANCH" = "elpi-14" ]; then
+
+ elpi_CI_REF="coq-master-elpi-14"
+ elpi_CI_GITURL=https://github.com/LPCIC/coq-elpi
+
+fi
diff --git a/dev/ci/user-overlays/README.md b/dev/ci/user-overlays/README.md
index 7fb73e447d..4c2f264a74 100644
--- a/dev/ci/user-overlays/README.md
+++ b/dev/ci/user-overlays/README.md
@@ -21,14 +21,14 @@ The name of your overlay file should start with a five-digit pull request
number, followed by a dash, anything (for instance your GitHub nickname
and the branch name), then a `.sh` extension (`[0-9]{5}-[a-zA-Z0-9-_]+.sh`).
-Example: `00669-maximedenes-ssr-merge.sh` containing
+Example: `10185-SkySkimmer-instance-no-bang.sh` containing
```
-#!/bin/sh
+if [ "$CI_PULL_REQUEST" = "10185" ] || [ "$CI_BRANCH" = "instance-no-bang" ]; then
+
+ quickchick_CI_REF=instance-no-bang
+ quickchick_CI_GITURL=https://github.com/SkySkimmer/QuickChick
-if [ "$CI_PULL_REQUEST" = "669" ] || [ "$CI_BRANCH" = "ssr-merge" ]; then
- mathcomp_CI_REF=ssr-merge
- mathcomp_CI_GITURL=https://github.com/maximedenes/math-comp
fi
```
diff --git a/dev/doc/build-system.dev.txt b/dev/doc/build-system.dev.txt
index 6efc8ec1fe..6bbf83aa7e 100644
--- a/dev/doc/build-system.dev.txt
+++ b/dev/doc/build-system.dev.txt
@@ -88,7 +88,7 @@ Cons:
Makefiles hierarchy
-------------------
+-------------------
The Makefile is separated in several files :
@@ -101,7 +101,7 @@ The Makefile is separated in several files :
FIND_SKIP_DIRS
----------------
+--------------
The recommended style of using FIND_SKIP_DIRS is for example
diff --git a/dev/doc/build-system.dune.md b/dev/doc/build-system.dune.md
index 49251d61a1..372e40a0b7 100644
--- a/dev/doc/build-system.dune.md
+++ b/dev/doc/build-system.dune.md
@@ -108,14 +108,14 @@ automatically.
You can use `ocamldebug` with Dune; after a build, do:
```
-dune exec dev/dune-dbg
+dune exec dev/dune-dbg /path/to/foo.v
(ocd) source dune_db
```
or
```
-dune exec dev/dune-dbg checker
+dune exec dev/dune-dbg checker Foo
(ocd) source dune_db
```
@@ -124,6 +124,8 @@ refined, so you need to build enough of Coq once to use this target
[it will then correctly compute the deps and rebuild if you call the
script again] This will be fixed in the future.
+For running in emacs, use `coqdev-ocamldebug` from `coqdev.el`.
+
## Dropping from coqtop:
After doing `make -f Makefile.dune voboot`, the following commands should work:
diff --git a/dev/doc/changes.md b/dev/doc/changes.md
index 339ac2d9b7..51d90df89f 100644
--- a/dev/doc/changes.md
+++ b/dev/doc/changes.md
@@ -5,6 +5,21 @@
- Functions and types deprecated in 8.10 have been removed in Coq
8.11.
+- Type Decl_kinds.locality has been restructured, see commit
+ message. Main change to do generally is to change the flag "Global"
+ to "Global ImportDefaultBehavior".
+
+Proof state:
+
+ Proofs that are attached to a top-level constant (such as lemmas)
+ are represented by `Lemmas.t`, as they do contain additional
+ information related to the constant declaration.
+
+ Plugins that require access to the information about currently
+ opened lemmas can add one of the `![proof]` attributes to their
+ `mlg` entry, which will refine the type accordingly. See
+ documentation in `vernacentries` for more information.
+
## Changes between Coq 8.9 and Coq 8.10
### ML4 Pre Processing
@@ -59,6 +74,19 @@ Coqlib:
command then enables to locate the registered constant through its name. The
name resolution is dynamic.
+Proof state:
+
+- Handling of proof state has been fully functionalized, thus it is
+ not possible to call global functions such as `get_current_context ()`.
+
+ The main type for functions that need to handle proof state is
+ `Proof_global.t`.
+
+ Unfortunately, this change was not possible to do in a
+ backwards-compatible way, but in most case the api changes are
+ straightforward, with functions taking and returning an extra
+ argument.
+
Macros:
- The RAW_TYPED AS and GLOB_TYPED AS stanzas of the ARGUMENT EXTEND macro are
diff --git a/dev/dune b/dev/dune
index 792da6254a..11e42f97f3 100644
--- a/dev/dune
+++ b/dev/dune
@@ -3,7 +3,7 @@
(public_name coq.top_printers)
(synopsis "Coq's Debug Printers")
(wrapped false)
- (modules :standard)
+ (modules top_printers)
(optional)
(libraries coq.toplevel coq.plugins.ltac))
@@ -11,7 +11,8 @@
(targets dune-dbg)
(deps dune-dbg.in
../checker/coqchk.bc
- ../topbin/coqtop_byte_bin.bc
+ ../topbin/coqc_bin.bc
+ ../ide/coqide_main.bc
; This is not enough as the call to `ocamlfind` will fail :/
top_printers.cma)
(action (copy dune-dbg.in dune-dbg)))
diff --git a/dev/dune-dbg.in b/dev/dune-dbg.in
index 80ad0500e0..1382f4d1b6 100755
--- a/dev/dune-dbg.in
+++ b/dev/dune-dbg.in
@@ -3,11 +3,17 @@
# Run in a proper install dune env.
case $1 in
checker)
+ shift
exe=_build/default/checker/coqchk.bc
;;
+ coqide)
+ exe=_build/default/ide/coqide_main.bc
+ ;;
*)
- exe=_build/default/topbin/coqtop_byte_bin.bc
+ exe=_build/default/topbin/coqc_bin.bc
;;
esac
-ocamldebug $(ocamlfind query -recursive -i-format coq.top_printers) -I +threads -I dev $exe
+emacs="${INSIDE_EMACS:+-emacs}"
+
+ocamldebug $emacs $(ocamlfind query -recursive -i-format coq.top_printers) -I +threads -I dev $exe "$@"
diff --git a/dev/header.c b/dev/header.c
index 663c43b3d6..6201cb3b73 100644
--- a/dev/header.c
+++ b/dev/header.c
@@ -1,6 +1,6 @@
/************************************************************************/
/* * The Coq Proof Assistant / The Coq Development Team */
-/* v * INRIA, CNRS and contributors - Copyright 1999-2018 */
+/* v * INRIA, CNRS and contributors - Copyright 1999-2019 */
/* <O___,, * (see CREDITS file for the list of authors) */
/* \VV/ **************************************************************/
/* // * This file is distributed under the terms of the */
diff --git a/dev/header.ml b/dev/header.ml
index 7c3ee60040..87553dcb56 100644
--- a/dev/header.ml
+++ b/dev/header.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/dev/header.py b/dev/header.py
index f81c8aa6a2..86114503d4 100644
--- a/dev/header.py
+++ b/dev/header.py
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/dev/lint-commits.sh b/dev/lint-commits.sh
index 96c92e3162..539bb5f1f9 100755
--- a/dev/lint-commits.sh
+++ b/dev/lint-commits.sh
@@ -19,21 +19,40 @@ fi
BASE_COMMIT="$1"
HEAD_COMMIT="$2"
-bad=()
+bad_ws=()
+bad_compile=()
while IFS= read -r commit; do
echo Checking "$commit"
# git diff --check
# uses .gitattributes to know what to check
if ! git diff --check "${commit}^" "$commit";
- then
- bad+=("$commit")
+ then bad_ws+=("$commit")
+ fi
+
+ if ! make -f Makefile.dune check
+ then bad_compile+=("$commit")
fi
done < <(git rev-list "$HEAD_COMMIT" --not "$BASE_COMMIT" --)
-if [ "${#bad[@]}" != 0 ]
+# report errors
+
+CODE=0
+
+if [ "${#bad_ws[@]}" != 0 ]
then
>&2 echo "Whitespace errors!"
- >&2 echo "In commits ${bad[*]}"
+ >&2 echo "In commits ${bad_ws[*]}"
>&2 echo "If you use emacs, you can prevent this kind of error from reoccurring by installing ws-butler and enabling ws-butler-convert-leading-tabs-or-spaces."
- exit 1
+ >&2 echo
+ CODE=1
fi
+
+if [ "${#bad_compile[@]}" != 0 ]
+then
+ >&2 echo "Compilation errors!"
+ >&2 echo "In commits ${bad_compile[*]}"
+ >&2 echo
+ CODE=1
+fi
+
+exit $CODE
diff --git a/dev/tools/change-header b/dev/tools/change-header
index 687c02f4f1..59c6f43958 100755
--- a/dev/tools/change-header
+++ b/dev/tools/change-header
@@ -13,22 +13,19 @@ newheader=$2
if [ ! -f $oldheader ]; then echo Cannot read file $oldheader; exit 1; fi
if [ ! -f $newheader ]; then echo Cannot read file $newheader; exit 1; fi
-n=`wc -l $oldheader | sed -e "s/ *\([0-9]*\).*/\1/g"`
-nsucc=`expr $n + 1`
-
-linea='(* -*- coding:utf-8 -*- *)'
-lineb='(* -*- compile-command: "make -C ../.. bin/coqdoc" -*- *)'
+n=$(wc -l $oldheader | sed -e "s/ *\([0-9]*\).*/\1/g")
+nsucc=$(expr $n + 1)
modified=0
kept=0
-for i in `find . -name \*.mli -o -name \*.ml -o -name \*.mlg -o -name \*.mll -o -name \*.mly -o -name \*.mlp -o -name \*.v`; do
- headline=`head -n 1 $i`
- if `echo $headline | grep "(\* -\*- .* \*)" > /dev/null`; then
- # Has emacs header
+for i in $(git grep --name-only --fixed-strings "$(head -1 $oldheader)"); do
+ headline=$(head -n 1 $i)
+ if $(echo $headline | grep "(\* -\*- .* \*)" > /dev/null) || $(echo $headline | grep "^#\!" > /dev/null); then
+ # Has header
head -n +$nsucc $i | tail -n $n > $i.head.tmp$$
hasheadline=1
- nnext=`expr $nsucc + 1`
+ nnext=$(expr $nsucc + 1)
else
head -n +$n $i > $i.head.tmp$$
hasheadline=0
@@ -44,9 +41,9 @@ for i in `find . -name \*.mli -o -name \*.ml -o -name \*.mlg -o -name \*.mll -o
cat $newheader >> $i.tmp$$
tail -n +$nnext $i >> $i.tmp$$
mv $i.tmp$$ $i
- modified=`expr $modified + 1`
+ modified=$(expr $modified + 1)
else
- kept=`expr $kept + 1`
+ kept=$(expr $kept + 1)
fi
rm $i.head.tmp$$
done
diff --git a/dev/tools/coqdev.el b/dev/tools/coqdev.el
index c6687b9731..5f9f326750 100644
--- a/dev/tools/coqdev.el
+++ b/dev/tools/coqdev.el
@@ -78,13 +78,38 @@ Specifically `camldebug-command-name' and `ocamldebug-command-name'."
Note that this function is executed before _Coqproject is read if it exists."
(let ((dir (coqdev-default-directory)))
(when dir
- (unless coq-prog-args
- (setq coq-prog-args
- `("-coqlib" ,dir
- "-topfile" ,buffer-file-name)))
- (setq-local coq-prog-name (concat dir "bin/coqtop")))))
+ (setq-local coq-prog-name (concat dir "_build/default/dev/shim/coqtop-prelude")))))
(add-hook 'hack-local-variables-hook #'coqdev-setup-proofgeneral)
+(defvar coqdev-ocamldebug-command "dune exec dev/dune-dbg"
+ "Command run by `coqdev-ocamldebug'")
+
+(defun coqdev-ocamldebug ()
+ "Runs a command in an ocamldebug buffer."
+ (interactive)
+ (let* ((dir (read-directory-name "Run from directory: "
+ (coqdev-default-directory)))
+ (name "ocamldebug-coq")
+ (buffer-name (concat "*" name "*")))
+ (pop-to-buffer buffer-name)
+ (unless (comint-check-proc buffer-name)
+ (setq default-directory dir)
+ (setq coqdev-ocamldebug-command
+ (read-from-minibuffer "Command to run: "
+ coqdev-ocamldebug-command))
+ (let* ((cmdlist (tuareg--split-args coqdev-ocamldebug-command))
+ (cmdlist (mapcar #'substitute-in-file-name cmdlist)))
+ (apply #'make-comint name
+ (car cmdlist)
+ nil
+ (cdr cmdlist))
+ (set-process-filter (get-buffer-process (current-buffer))
+ #'ocamldebug-filter)
+ (set-process-sentinel (get-buffer-process (current-buffer))
+ #'ocamldebug-sentinel)
+ (ocamldebug-mode)))
+ (ocamldebug-set-buffer)))
+
;; This Elisp snippet adds a regexp parser for the format of Anomaly
;; backtraces (coqc -bt ...), to the error parser of the Compilation
;; mode (C-c C-c: "Compile command: ..."). File locations in traces
diff --git a/dev/tools/update-compat.py b/dev/tools/update-compat.py
index ff9b32fe78..0338cd42c7 100755
--- a/dev/tools/update-compat.py
+++ b/dev/tools/update-compat.py
@@ -73,8 +73,6 @@ FLAGS_ML_PATH = os.path.join(ROOT_PATH, 'lib', 'flags.ml')
COQARGS_ML_PATH = os.path.join(ROOT_PATH, 'toplevel', 'coqargs.ml')
G_VERNAC_PATH = os.path.join(ROOT_PATH, 'vernac', 'g_vernac.mlg')
DOC_INDEX_PATH = os.path.join(ROOT_PATH, 'doc', 'stdlib', 'index-list.html.template')
-BUG_4798_PATH = os.path.join(ROOT_PATH, 'test-suite', 'bugs', 'closed', 'bug_4798.v')
-BUG_9166_PATH = os.path.join(ROOT_PATH, 'test-suite', 'bugs', 'closed', 'bug_9166.v')
TEST_SUITE_RUN_PATH = os.path.join(ROOT_PATH, 'test-suite', 'tools', 'update-compat', 'run.sh')
TEST_SUITE_PATHS = tuple(os.path.join(ROOT_PATH, 'test-suite', 'success', i)
for i in ('CompatOldOldFlag.v', 'CompatOldFlag.v', 'CompatPreviousFlag.v', 'CompatCurrentFlag.v'))
@@ -401,34 +399,6 @@ dev/tools/update-compat.py --assert-unchanged %s || exit $?
''' % ' '.join([('--master' if args['master'] else ''), ('--release' if args['release'] else '')]).strip()
update_if_changed(contents, new_contents, TEST_SUITE_RUN_PATH, pass_through_shebang=True, **args)
-def update_bug_4789(new_versions, **args):
- # we always update this compat notation to oldest
- # currently-supported compat version, which should never be the
- # current version
- with open(BUG_4798_PATH, 'r') as f: contents = f.read()
- new_contents = BUG_HEADER + r"""Check match 2 with 0 => 0 | S n => n end.
-Notation "|" := 1 (compat "%s").
-Check match 2 with 0 => 0 | S n => n end. (* fails *)
-""" % new_versions[0]
- update_if_changed(contents, new_contents, BUG_4798_PATH, **args)
-
-def update_bug_9166(new_versions, **args):
- # we always update this compat notation to oldest
- # currently-supported compat version, which should never be the
- # current version
- with open(BUG_9166_PATH, 'r') as f: contents = f.read()
- new_contents = BUG_HEADER + r"""Set Warnings "+deprecated".
-
-Notation bar := option (compat "%s").
-
-Definition foo (x: nat) : nat :=
- match x with
- | 0 => 0
- | S bar => bar
- end.
-""" % new_versions[0]
- update_if_changed(contents, new_contents, BUG_9166_PATH, **args)
-
def update_compat_notations_in(old_versions, new_versions, contents):
for v in old_versions:
if v not in new_versions:
@@ -508,7 +478,5 @@ if __name__ == '__main__':
update_test_suite(new_versions, **args)
update_test_suite_run(**args)
update_doc_index(new_versions, **args)
- update_bug_4789(new_versions, **args)
- update_bug_9166(new_versions, **args)
update_compat_notations(known_versions, new_versions, **args)
display_git_grep(known_versions, new_versions)
diff --git a/dev/top_printers.ml b/dev/top_printers.ml
index 2859b56cbe..8343853af5 100644
--- a/dev/top_printers.ml
+++ b/dev/top_printers.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -532,8 +532,8 @@ let _ =
let open Vernacextend in
let ty_constr = Extend.TUentry (get_arg_tag Stdarg.wit_constr) in
let cmd_sig = TyTerminal("PrintConstr", TyNonTerminal(ty_constr, TyNil)) in
- let cmd_fn c ~atts ~st = in_current_context econstr_display c; st in
- let cmd_class _ = VtQuery,VtNow in
+ let cmd_fn c ~atts = VtDefault (fun () -> in_current_context econstr_display c) in
+ let cmd_class _ = VtQuery in
let cmd : ty_ml = TyML (false, cmd_sig, cmd_fn, Some cmd_class) in
vernac_extend ~command:"PrintConstr" [cmd]
@@ -541,8 +541,8 @@ let _ =
let open Vernacextend in
let ty_constr = Extend.TUentry (get_arg_tag Stdarg.wit_constr) in
let cmd_sig = TyTerminal("PrintPureConstr", TyNonTerminal(ty_constr, TyNil)) in
- let cmd_fn c ~atts ~st = in_current_context print_pure_econstr c; st in
- let cmd_class _ = VtQuery,VtNow in
+ let cmd_fn c ~atts = VtDefault (fun () -> in_current_context print_pure_econstr c) in
+ let cmd_class _ = VtQuery in
let cmd : ty_ml = TyML (false, cmd_sig, cmd_fn, Some cmd_class) in
vernac_extend ~command:"PrintPureConstr" [cmd]
diff --git a/dev/top_printers.mli b/dev/top_printers.mli
index 2aa1808322..5a2144f996 100644
--- a/dev/top_printers.mli
+++ b/dev/top_printers.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/dev/v8-syntax/syntax-v8.tex b/dev/v8-syntax/syntax-v8.tex
index dd3908c25f..601d52ddda 100644
--- a/dev/v8-syntax/syntax-v8.tex
+++ b/dev/v8-syntax/syntax-v8.tex
@@ -1167,7 +1167,6 @@ $$
\nlsep \TERM{Show}~\OPT{\NT{num}}
\nlsep \TERM{Show}~\TERM{Implicit}~\TERM{Arguments}~\OPT{\NT{num}}
\nlsep \TERM{Show}~\TERM{Node}
-\nlsep \TERM{Show}~\TERM{Script}
\nlsep \TERM{Show}~\TERM{Existentials}
\nlsep \TERM{Show}~\TERM{Tree}
\nlsep \TERM{Show}~\TERM{Conjecture}
diff --git a/doc/LICENSE b/doc/LICENSE
index 3789d91040..9f3a6b3f4c 100644
--- a/doc/LICENSE
+++ b/doc/LICENSE
@@ -2,25 +2,25 @@ The Coq Reference Manual is a collective work from the Coq Development
Team whose members are listed in the file CREDITS of the Coq source
package. All related documents (the LaTeX and BibTeX sources, the
embedded png files, and the PostScript, PDF and html outputs) are
-copyright (c) INRIA 1999-2018, with the exception of the Ubuntu font
-file UbuntuMono-B.ttf, which is
-Copyright 2010,2011 Canonical Ltd and licensed under the Ubuntu font
-license, version 1.0
-(https://www.ubuntu.com/legal/terms-and-policies/font-licence), and its
-derivative CoqNotations.ttf distributed under the same license. The
-material connected to the Reference Manual may be distributed only
-subject to the terms and conditions set forth in the Open Publication
-License, v1.0 or later (the latest version is presently available at
-http://www.opencontent.org/openpub/). Options A and B are *not*
-elected.
+copyright (c) 1999-2019, Inria, CNRS and contributors, with the
+exception of the Ubuntu font file UbuntuMono-B.ttf, which is Copyright
+2010,2011 Canonical Ltd and licensed under the Ubuntu font license,
+version 1.0
+(https://www.ubuntu.com/legal/terms-and-policies/font-licence), and
+its derivative CoqNotations.ttf distributed under the same
+license. The material connected to the Reference Manual may be
+distributed only subject to the terms and conditions set forth in the
+Open Publication License, v1.0 or later (the latest version is
+presently available at http://www.opencontent.org/openpub/). Options
+A and B are *not* elected.
The Coq Standard Library is a collective work from the Coq Development
Team whose members are listed in the file CREDITS of the Coq source
package. All related documents (the Coq vernacular source files and
-the PostScript, PDF and html outputs) are copyright (c) INRIA
-1999-2018. The material connected to the Standard Library is
-distributed under the terms of the Lesser General Public License
-version 2.1 or later.
+the PostScript, PDF and html outputs) are copyright (c) 1999-2019,
+Inria, CNRS and contributors. The material connected to the Standard
+Library is distributed under the terms of the Lesser General Public
+License version 2.1 or later.
----------------------------------------------------------------------
diff --git a/doc/changelog/02-specification-language/10049-bidi-app.rst b/doc/changelog/02-specification-language/10049-bidi-app.rst
new file mode 100644
index 0000000000..79678c5242
--- /dev/null
+++ b/doc/changelog/02-specification-language/10049-bidi-app.rst
@@ -0,0 +1,6 @@
+- New annotation in `Arguments` for bidirectionality hints: it is now possible
+ to tell type inference to use type information from the context once the `n`
+ first arguments of an application are known. The syntax is:
+ `Arguments foo x y & z`.
+ `#10049 <https://github.com/coq/coq/pull/10049>`_, by Maxime Dénès with
+ help from Enrico Tassi
diff --git a/doc/changelog/02-specification-language/10167-orpat-mixfix.rst b/doc/changelog/02-specification-language/10167-orpat-mixfix.rst
new file mode 100644
index 0000000000..e3c3923348
--- /dev/null
+++ b/doc/changelog/02-specification-language/10167-orpat-mixfix.rst
@@ -0,0 +1,12 @@
+- Require parentheses around nested disjunctive patterns, so that pattern and
+ term syntax are consistent; match branch patterns no longer require
+ parentheses for notation at level 100 or more. Incompatibilities:
+
+ + in :g:`match p with (_, (0|1)) => ...` parentheses may no longer be
+ omitted around :n:`0|1`.
+ + notation :g:`(p | q)` now potentially clashes with core pattern syntax,
+ and should be avoided. ``-w disj-pattern-notation`` flags such :cmd:`Notation`.
+
+ see :ref:`extendedpatternmatching` for details
+ (`#10167 <https://github.com/coq/coq/pull/10167>`_,
+ by Georges Gonthier).
diff --git a/doc/changelog/02-specification-language/10215-rm-maybe-open-proof.rst b/doc/changelog/02-specification-language/10215-rm-maybe-open-proof.rst
new file mode 100644
index 0000000000..21ec7f8e5b
--- /dev/null
+++ b/doc/changelog/02-specification-language/10215-rm-maybe-open-proof.rst
@@ -0,0 +1,11 @@
+- Function always opens a proof when used with a ``measure`` or ``wf``
+ annotation, see :ref:`advanced-recursive-functions` for the updated
+ documentation (`#10215 <https://github.com/coq/coq/pull/10215>`_,
+ by Enrico Tassi).
+
+- The legacy command Add Morphism always opens a proof and cannot be used
+ inside a module type. In order to declare a module type parameter that
+ happens to be a morphism, use ``Parameter Morphism``. See
+ :ref:`deprecated_syntax_for_generalized_rewriting` for the updated
+ documentation (`#10215 <https://github.com/coq/coq/pull/10215>`_,
+ by Enrico Tassi).
diff --git a/doc/changelog/03-notations/10180-deprecate-notations.rst b/doc/changelog/03-notations/10180-deprecate-notations.rst
new file mode 100644
index 0000000000..01f2e893ed
--- /dev/null
+++ b/doc/changelog/03-notations/10180-deprecate-notations.rst
@@ -0,0 +1,6 @@
+- The :cmd:`Notation` and :cmd:`Infix` commands now support the `deprecated`
+ attribute. The former `compat` annotation for notations is
+ deprecated, and its semantics changed. It is now made equivalent to using
+ a `deprecated` attribute, and is no longer connected with the `-compat`
+ command-line flag.
+ (`#10180 <https://github.com/coq/coq/pull/10180>`_, by Maxime Dénès).
diff --git a/doc/changelog/04-tactics/09288-injection-as.rst b/doc/changelog/04-tactics/09288-injection-as.rst
new file mode 100644
index 0000000000..6a74551f06
--- /dev/null
+++ b/doc/changelog/04-tactics/09288-injection-as.rst
@@ -0,0 +1,4 @@
+- Documented syntax :n:`injection @term as [= {+ @intropattern} ]` as
+ an alternative to :n:`injection @term as {+ @simple_intropattern}` using
+ the standard :n:`@injection_intropattern` syntax (`#09288
+ <https://github.com/coq/coq/pull/09288>`_, by Hugo Herbelin).
diff --git a/doc/changelog/04-tactics/10318-select-only-error.rst b/doc/changelog/04-tactics/10318-select-only-error.rst
new file mode 100644
index 0000000000..03ed15d948
--- /dev/null
+++ b/doc/changelog/04-tactics/10318-select-only-error.rst
@@ -0,0 +1,4 @@
+- The goal selector tactical ``only`` now checks that the goal range
+ it is given is valid instead of ignoring goals out of the focus
+ range. (`#10318 <https://github.com/coq/coq/pull/10318>`_, by Gaëtan
+ Gilbert).
diff --git a/doc/changelog/05-tactic-language/10002-ltac2.rst b/doc/changelog/05-tactic-language/10002-ltac2.rst
new file mode 100644
index 0000000000..6d62f11eff
--- /dev/null
+++ b/doc/changelog/05-tactic-language/10002-ltac2.rst
@@ -0,0 +1,9 @@
+- Ltac2, a new version of the tactic language Ltac, that doesn't
+ preserve backward compatibility, has been integrated in the main Coq
+ distribution. It is still experimental, but we already recommend
+ users of advanced Ltac to start using it and report bugs or request
+ enhancements. See its documentation in the :ref:`dedicated chapter
+ <ltac2>` (`#10002 <https://github.com/coq/coq/pull/10002>`_, plugin
+ authored by Pierre-Marie Pédrot, with contributions by various
+ users, integration by Maxime Dénès, help on integrating / improving
+ the documentation by Théo Zimmermann and Jim Fehrle).
diff --git a/doc/changelog/05-tactic-language/10289-ltac2+delimited-constr-in-notations.rst b/doc/changelog/05-tactic-language/10289-ltac2+delimited-constr-in-notations.rst
new file mode 100644
index 0000000000..bd1c0c42e8
--- /dev/null
+++ b/doc/changelog/05-tactic-language/10289-ltac2+delimited-constr-in-notations.rst
@@ -0,0 +1,5 @@
+- Ltac2 tactic notations with “constr” arguments can specify the
+ interpretation scope for these arguments;
+ see :ref:`ltac2_notations` for details
+ (`#10289 <https://github.com/coq/coq/pull/10289>`_,
+ by Vincent Laporte).
diff --git a/doc/changelog/07-commands-and-options/10185-instance-no-bang.rst b/doc/changelog/07-commands-and-options/10185-instance-no-bang.rst
new file mode 100644
index 0000000000..c69cda9656
--- /dev/null
+++ b/doc/changelog/07-commands-and-options/10185-instance-no-bang.rst
@@ -0,0 +1,2 @@
+- Remove undocumented :n:`Instance : !@type` syntax
+ (`#10185 <https://github.com/coq/coq/pull/10185>`_, by Gaëtan Gilbert).
diff --git a/doc/changelog/07-commands-and-options/10277-no-show-script.rst b/doc/changelog/07-commands-and-options/10277-no-show-script.rst
new file mode 100644
index 0000000000..7fdeb632b4
--- /dev/null
+++ b/doc/changelog/07-commands-and-options/10277-no-show-script.rst
@@ -0,0 +1,2 @@
+- Remove ``Show Script`` command (deprecated since 8.10)
+ (`#10277 <https://github.com/coq/coq/pull/10277>`_, by Gaëtan Gilbert).
diff --git a/doc/changelog/08-tools/10245-require-command-line.rst b/doc/changelog/08-tools/10245-require-command-line.rst
new file mode 100644
index 0000000000..54417077f5
--- /dev/null
+++ b/doc/changelog/08-tools/10245-require-command-line.rst
@@ -0,0 +1,6 @@
+- Add command line options `-require-import`, `-require-export`,
+ `-require-import-from` and `-require-export-from`, as well as their
+ shorthand, `-ri`, `-re`, `-refrom` and -`rifrom`. Deprecate
+ confusing command line option `-require`
+ (`#10245 <https://github.com/coq/coq/pull/10245>`_
+ by Hugo Herbelin, review by Emilio Gallego).
diff --git a/doc/common/styles/html/coqremote/cover.html b/doc/common/styles/html/coqremote/cover.html
index 5d151381ff..b7c83bd2f9 100644
--- a/doc/common/styles/html/coqremote/cover.html
+++ b/doc/common/styles/html/coqremote/cover.html
@@ -52,7 +52,7 @@
<h2 style="text-align:center; font-size: 150%">The Coq Development Team</h2>
<br /><br /><br />
-<p style="text-indent:0pt">Copyright © INRIA 1999-2017</p>
+<p style="text-indent:0pt">Copyright © 1999-2019, Inria, CNRS and contributors</p>
<p style="text-indent:0pt">This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at <a href="http://www.opencontent.org/openpub">http://www.opencontent.org/openpub</a>). Options A and B are not elected.</p>
diff --git a/doc/common/styles/html/simple/cover.html b/doc/common/styles/html/simple/cover.html
index 6053131045..28ce2eb087 100644
--- a/doc/common/styles/html/simple/cover.html
+++ b/doc/common/styles/html/simple/cover.html
@@ -30,7 +30,7 @@
<br /><br /><br />
-<p style="text-indent:0pt">Copyright © INRIA 1999-2017</p>
+<p style="text-indent:0pt">Copyright © 1999-2019, Inria, CNRS and contributors</p>
<p style="text-indent: 0pt">This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at <a href="http://www.opencontent.org/openpub">http://www.opencontent.org/openpub</a>). Options A and B are not elected.</p>
diff --git a/doc/common/title.tex b/doc/common/title.tex
index 76e50f65d2..2a104a87e6 100644
--- a/doc/common/title.tex
+++ b/doc/common/title.tex
@@ -43,9 +43,7 @@ $\pi r^2$ Project (formerly LogiCal, then TypiCal)
V\coqversion, \today
\par\vspace{20pt}
%END LATEX
-\copyright INRIA 1999-2004 ({\Coq} versions 7.x)
-
-\copyright INRIA 2004-2017 ({\Coq} versions 8.x)
+\copyright 1999-2019, Inria, CNRS and contributors
#3
\end{flushleft}
diff --git a/doc/plugin_tutorial/README.md b/doc/plugin_tutorial/README.md
index f82edb2352..6d142a9af8 100644
--- a/doc/plugin_tutorial/README.md
+++ b/doc/plugin_tutorial/README.md
@@ -1,34 +1,20 @@
How to write plugins in Coq
===========================
- # Working environment : merlin, tuareg (open question)
+ # Working environment
+
+ In addition to installing OCaml and Coq, it can help to install several tools for development.
- ## OCaml & related tools
+ ## Merlin
These instructions use [OPAM](http://opam.ocaml.org/doc/Install.html)
```shell
-opam init --root=$PWD/CIW2018 --compiler=4.06.0 -j2
-eval `opam config env --root=$PWD/CIW2018`
-opam install camlp5 ocamlfind num # Coq's dependencies
-opam install lablgtk # Coqide's dependencies (optional)
opam install merlin # prints instructions for vim and emacs
```
- ## Coq
-
-```shell
-git clone git@github.com:coq/coq.git
-cd coq
-./configure -profile devel
-make -j2
-cd ..
-export PATH=$PWD/coq/bin:$PATH
-```
-
## This tutorial
```shell
-git clone git@github.com:ybertot/plugin_tutorials.git
cd plugin_tutorials/tuto0
make .merlin # run before opening .ml files in your editor
make # build
@@ -40,6 +26,8 @@ make # build
package a ml4 file in a plugin, organize a `Makefile`, `_CoqProject`
- Example of syntax to add a new toplevel command
- Example of function call to print a simple message
+ - Example of function call to print a simple warning
+ - Example of function call to raise a simple error to the user
- Example of syntax to add a simple tactic
(that does nothing and prints a message)
- To use it:
@@ -54,19 +42,23 @@ make # build
Require Import Tuto0.Loader. HelloWorld.
```
- # tuto1 : Ocaml to Coq communication
+ You can also modify and run `theories/Demo.v`.
+
+ # tuto1 : OCaml to Coq communication
Explore the memory of Coq, modify it
- - Commands that take arguments: strings, symbols, expressions of the calculus of constructions
+ - Commands that take arguments: strings, integers, symbols, expressions of the calculus of constructions
+ - Examples of using environments correctly
+ - Examples of using state (the evar_map) correctly
- Commands that interact with type-checking in Coq
+ - A command that checks convertibility between two terms
- A command that adds a new definition or theorem
- - A command that uses a name and exploits the existing definitions
- or theorems
+ - A command that uses a name and exploits the existing definitions or theorems
- A command that exploits an existing ongoing proof
- A command that defines a new tactic
Compilation and loading must be performed as for `tuto0`.
- # tuto2 : Ocaml to Coq communication
+ # tuto2 : OCaml to Coq communication
A more step by step introduction to writing commands
- Explanation of the syntax of entries
- Adding a new type to and parsing to the available choices
diff --git a/doc/plugin_tutorial/tuto0/src/g_tuto0.mlg b/doc/plugin_tutorial/tuto0/src/g_tuto0.mlg
index 5c633fe862..97689adfed 100644
--- a/doc/plugin_tutorial/tuto0/src/g_tuto0.mlg
+++ b/doc/plugin_tutorial/tuto0/src/g_tuto0.mlg
@@ -5,14 +5,70 @@ DECLARE PLUGIN "tuto0_plugin"
open Pp
open Ltac_plugin
+let tuto_warn = CWarnings.create ~name:"name" ~category:"category"
+ (fun _ -> strbrk Tuto0_main.message)
+
}
+(*** Printing messages ***)
+
+(*
+ * This defines a command that prints HelloWorld.
+ * Note that Feedback.msg_notice can be used to print messages.
+ *)
VERNAC COMMAND EXTEND HelloWorld CLASSIFIED AS QUERY
| [ "HelloWorld" ] -> { Feedback.msg_notice (strbrk Tuto0_main.message) }
END
+(*
+ * This is a tactic version of the same thing.
+ *)
TACTIC EXTEND hello_world_tactic
| [ "hello_world" ] ->
{ let _ = Feedback.msg_notice (str Tuto0_main.message) in
Tacticals.New.tclIDTAC }
END
+
+(*** Printing warnings ***)
+
+(*
+ * This defines a command that prints HelloWorld as a warning.
+ * tuto_warn is defined at the top-level, before the command runs,
+ * which is standard.
+ *)
+VERNAC COMMAND EXTEND HelloWarning CLASSIFIED AS QUERY
+| [ "HelloWarning" ] ->
+ {
+ tuto_warn ()
+ }
+END
+
+(*
+ * This is a tactic version of the same thing.
+ *)
+TACTIC EXTEND hello_warning_tactic
+| [ "hello_warning" ] ->
+ {
+ let _ = tuto_warn () in
+ Tacticals.New.tclIDTAC
+ }
+END
+
+(*** Printing errors ***)
+
+(*
+ * This defines a command that prints HelloWorld inside of an error.
+ * Note that CErrors.user_err can be used to raise errors to the user.
+ *)
+VERNAC COMMAND EXTEND HelloError CLASSIFIED AS QUERY
+| [ "HelloError" ] -> { CErrors.user_err (str Tuto0_main.message) }
+END
+
+(*
+ * This is a tactic version of the same thing.
+ *)
+TACTIC EXTEND hello_error_tactic
+| [ "hello_error" ] ->
+ { let _ = CErrors.user_err (str Tuto0_main.message) in
+ Tacticals.New.tclIDTAC }
+END
diff --git a/doc/plugin_tutorial/tuto0/theories/Demo.v b/doc/plugin_tutorial/tuto0/theories/Demo.v
index bdc61986af..54d5239421 100644
--- a/doc/plugin_tutorial/tuto0/theories/Demo.v
+++ b/doc/plugin_tutorial/tuto0/theories/Demo.v
@@ -1,8 +1,28 @@
From Tuto0 Require Import Loader.
+(*** Printing messages ***)
+
HelloWorld.
Lemma test : True.
Proof.
hello_world.
Abort.
+
+(*** Printing warnings ***)
+
+HelloWarning.
+
+Lemma test : True.
+Proof.
+hello_warning.
+Abort.
+
+(*** Signaling errors ***)
+
+Fail HelloError.
+
+Lemma test : True.
+Proof.
+Fail hello_error.
+Abort.
diff --git a/doc/plugin_tutorial/tuto1/_CoqProject b/doc/plugin_tutorial/tuto1/_CoqProject
index 585d1360be..60f9f0a0c7 100644
--- a/doc/plugin_tutorial/tuto1/_CoqProject
+++ b/doc/plugin_tutorial/tuto1/_CoqProject
@@ -2,7 +2,10 @@
-I src
theories/Loader.v
+theories/Demo.v
+src/inspector.mli
+src/inspector.ml
src/simple_check.mli
src/simple_check.ml
src/simple_declare.mli
diff --git a/doc/plugin_tutorial/tuto1/src/g_tuto1.mlg b/doc/plugin_tutorial/tuto1/src/g_tuto1.mlg
index 1d0aca1caf..73d94c2a51 100644
--- a/doc/plugin_tutorial/tuto1/src/g_tuto1.mlg
+++ b/doc/plugin_tutorial/tuto1/src/g_tuto1.mlg
@@ -8,7 +8,6 @@ DECLARE PLUGIN "tuto1_plugin"
theories/Loader.v
*)
open Ltac_plugin
-open Attributes
open Pp
(* This module defines the types of arguments to be used in the
EXTEND directives below, for example the string one. *)
@@ -16,141 +15,280 @@ open Stdarg
}
-VERNAC COMMAND EXTEND HelloWorld CLASSIFIED AS QUERY
-| [ "Hello" string(s) ] ->
- { Feedback.msg_notice (strbrk "Hello " ++ str s) }
-END
+(*** Printing inputs ***)
-(* reference is allowed as a syntactic entry, but so are all the entries
- found the signature of module Prim in file coq/parsing/pcoq.mli *)
+(*
+ * This command prints an input from the user.
+ *
+ * A list with allowable inputs can be found in interp/stdarg.mli,
+ * plugin/ltac/extraargs.mli, and plugin/ssr/ssrparser.mli
+ * (remove the wit_ prefix), but not all of these are allowable
+ * (unit and bool, for example, are not usable from within here).
+ *
+ * We include only some examples that are standard and useful for commands.
+ * Some of the omitted examples are useful for tactics.
+ *
+ * Inspector is our own file that defines a simple messaging function.
+ * The printing functions (pr_qualid and so on) are in printing.
+ *
+ * Some of these cases would be ambiguous if we used "What's" for each of
+ * these. For example, all of these are terms. We purposely disambiguate.
+ *)
+VERNAC COMMAND EXTEND WhatIsThis CLASSIFIED AS QUERY
+| [ "What's" constr(e) ] ->
+ {
+ let env = Global.env () in (* we'll explain later *)
+ let sigma = Evd.from_env env in (* we'll explain later *)
+ Inspector.print_input e (Ppconstr.pr_constr_expr env sigma) "term"
+ }
+| [ "What" "kind" "of" "term" "is" string(s) ] ->
+ { Inspector.print_input s strbrk "string" }
+| [ "What" "kind" "of" "term" "is" int(i) ] ->
+ { Inspector.print_input i Pp.int "int" }
+| [ "What" "kind" "of" "term" "is" ident(id) ] ->
+ { Inspector.print_input id Ppconstr.pr_id "identifier" }
+| [ "What" "kind" "of" "identifier" "is" reference(r) ] ->
+ { Inspector.print_input r Ppconstr.pr_qualid "reference" }
+END
-VERNAC COMMAND EXTEND HelloAgain CLASSIFIED AS QUERY
-| [ "HelloAgain" reference(r)] ->
-(* The function Ppconstr.pr_qualid was found by searching all mli files
- for a function of type qualid -> Pp.t *)
- { Feedback.msg_notice
- (strbrk "Hello again " ++ Ppconstr.pr_qualid r)}
+(*
+ * This command demonstrates basic combinators built into the DSL here.
+ * You can generalize this for constr_list, constr_opt, int_list, and so on.
+ *)
+VERNAC COMMAND EXTEND WhatAreThese CLASSIFIED AS QUERY
+| [ "What" "is" int_list(l) "a" "list" "of" ] ->
+ {
+ let print l = str "[" ++ Pp.prlist_with_sep (fun () -> str ";") Pp.int l ++ str "]" in
+ Inspector.print_input l print "int list"
+ }
+| [ "Is" ne_int_list(l) "nonempty" ] ->
+ {
+ let print l = str "[" ++ Pp.prlist_with_sep (fun () -> str ";") Pp.int l ++ str "]" in
+ Inspector.print_input l print "nonempty int list"
+ }
+| [ "And" "is" int_opt(o) "provided" ] ->
+ {
+ let print o = strbrk (if Option.has_some o then "Yes" else "No") in
+ Feedback.msg_notice (print o)
+ }
END
-(* According to parsing/pcoq.mli, e has type constr_expr *)
-(* this type is defined in pretyping/constrexpr.ml *)
-(* Question for the developers: why is the file constrexpr.ml and not
- constrexpr.mli --> Easier for packing the software in components. *)
-VERNAC COMMAND EXTEND TakingConstr CLASSIFIED AS QUERY
-| [ "Cmd1" constr(e) ] ->
- { let _ = e in Feedback.msg_notice (strbrk "Cmd1 parsed something") }
+
+(*** Interning terms ***)
+
+(*
+ * The next step is to make something of parsed expression.
+ * Interesting information in interp/constrintern.mli.
+ *
+ * When you read in constr(e), e will have type Constrexpr.constr_expr,
+ * which is defined in pretyping/constrexpr.ml. Your plugin
+ * will want a different representation.
+ *
+ * The important function is Constrintern.interp_constr_evars,
+ * which converts between a constr_expr and an
+ * (EConstr.constr, evar_map) pair. This essentially contains
+ * an internal representation of the term along with some state.
+ * For more on the state, read /dev/doc/econstr.md.
+ *
+ * NOTE ON INTERNING: Always prefer Constrintern.interp_constr_evars
+ * over Constrintern.interp_constr. The latter is an internal function
+ * not meant for external use.
+ *
+ * To get your initial environment, call Global.env ().
+ * To get state from that environment, call Evd.from_env on that environment.
+ * It is important to NEVER use the empty environment or Evd.empty;
+ * if you do, you will get confusing errors.
+ *
+ * NOTE ON STATE: It is important to use the evar_map that is returned to you.
+ * Otherwise, you may get cryptic errors later in your plugin.
+ * For example, you may get universe inconsistency errors.
+ * In general, if a function returns an evar_map to you, that's the one
+ * you want to thread through the rest of your command.
+ *
+ * NOTE ON STYLE: In general, it's better practice to move large
+ * chunks of OCaml code like this one into an .ml file. We include
+ * this here because it's really important to understand how to
+ * thread state in a plugin, and it's easier to see that if it's in the
+ * top-level file itself.
+ *)
+VERNAC COMMAND EXTEND Intern CLASSIFIED AS QUERY
+| [ "Intern" constr(e) ] ->
+ {
+ let env = Global.env () in (* use this; never use empty *)
+ let sigma = Evd.from_env env in (* use this; never use empty *)
+ let debug sigma = Termops.pr_evar_map ~with_univs:true None env sigma in
+ Feedback.msg_notice (strbrk "State before intern: " ++ debug sigma);
+ let (sigma, t) = Constrintern.interp_constr_evars env sigma e in
+ Feedback.msg_notice (strbrk "State after intern: " ++ debug sigma);
+ let print t = Printer.pr_econstr_env env sigma t in
+ Feedback.msg_notice (strbrk "Interned: " ++ print t)
+ }
END
-(* The next step is to make something of parsed expression.
- Interesting information in interp/constrintern.mli *)
-
-(* There are several phases of transforming a parsed expression into
- the final internal data-type (constr). There exists a collection of
- functions that combine all the phases *)
-
-VERNAC COMMAND EXTEND TakingConstr2 CLASSIFIED AS QUERY
-| [ "Cmd2" constr(e) ] ->
- { let _ = Constrintern.interp_constr
- (Global.env())
- (* Make sure you don't use Evd.empty here, as this does not
- check consistency with existing universe constraints. *)
- (Evd.from_env (Global.env())) e in
- Feedback.msg_notice (strbrk "Cmd2 parsed something legitimate") }
+(*** Defining terms ***)
+
+(*
+ * To define a term, we start similarly to our intern functionality,
+ * then we call another function. We define this function in
+ * the Simple_declare module.
+ *
+ * The line #[ poly = Attributes.polymorphic ] says that this command accepts
+ * polymorphic attributes.
+ * @SkySkimmer: Here, poly is what the result is bound to in the
+ * rule's code. Multiple attributes may be used separated by ;, and we have
+ * punning so foo is equivalent to foo = foo.
+ *
+ * The declare_definition function returns the reference
+ * that was defined. This reference will be present in the new environment.
+ * If you want to refer to it later in your plugin, you must use an
+ * updated environment and the constructed reference.
+ *
+ * Note since we are now defining a term, we must classify this
+ * as a side-effect (CLASSIFIED AS SIDEFF).
+ *)
+VERNAC COMMAND EXTEND MyDefine CLASSIFIED AS SIDEFF
+| #[ poly = Attributes.polymorphic ] [ "MyDefine" ident(i) ":=" constr(e) ] ->
+ {
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
+ let (sigma, t) = Constrintern.interp_constr_evars env sigma e in
+ let r = Simple_declare.declare_definition ~poly i sigma t in
+ let print r = strbrk "Defined " ++ Printer.pr_global r ++ strbrk "." in
+ Feedback.msg_notice (print r)
+ }
END
-(* This is to show what happens when typing in an empty environment
- with an empty evd.
- Question for the developers: why does "Cmd3 (fun x : nat => x)."
- raise an anomaly, not the same error as "Cmd3 (fun x : a => x)." *)
-
-VERNAC COMMAND EXTEND TakingConstr3 CLASSIFIED AS QUERY
-| [ "Cmd3" constr(e) ] ->
- { let _ = Constrintern.interp_constr Environ.empty_env
- Evd.empty e in
- Feedback.msg_notice
- (strbrk "Cmd3 accepted something in the empty context")}
+(*** Printing terms ***)
+
+(*
+ * This command takes a name and return its value. It does less
+ * than Print, because it fails on constructors, axioms, and inductive types.
+ * It signals an error to the user for unsupported terms.
+ *
+ * Simple_print contains simple_body_access, which shows how to look up
+ * a global reference.
+ *)
+VERNAC COMMAND EXTEND ExamplePrint CLASSIFIED AS QUERY
+| [ "MyPrint" reference(r) ] ->
+ {
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
+ try
+ let t = Simple_print.simple_body_access (Nametab.global r) in
+ Feedback.msg_notice (Printer.pr_econstr_env env sigma t)
+ with Failure s ->
+ CErrors.user_err (str s)
+ }
END
-(* When adding a definition, we have to be careful that just
- the operation of constructing a well-typed term may already change
- the environment, at the level of universe constraints (which
- are recorded in the evd component). The function
- Constrintern.interp_constr ignores this side-effect, so it should
- not be used here. *)
-
-(* Looking at the interface file interp/constrintern.ml4, I lost
- some time because I did not see that the "constr" type appearing
- there was "EConstr.constr" and not "Constr.constr". *)
-
-VERNAC COMMAND EXTEND Define1 CLASSIFIED AS SIDEFF
-| #[ poly = polymorphic ] [ "Cmd4" ident(i) constr(e) ] ->
- { let v = Constrintern.interp_constr (Global.env())
- (Evd.from_env (Global.env())) e in
- Simple_declare.packed_declare_definition ~poly i v }
+(*
+ * This command shows that after you define a new term,
+ * you can also look it up. But there's a catch! You need to actually
+ * refresh your environment. Otherwise, the defined term
+ * will not be in the environment.
+ *
+ * Using the global reference as opposed to the ID is generally
+ * a good idea, otherwise you might end up running into unforeseen
+ * problems inside of modules and sections and so on.
+ *
+ * Inside of simple_body_access, note that it uses Global.env (),
+ * which refreshes the environment before looking up the term.
+ *)
+VERNAC COMMAND EXTEND DefineLookup CLASSIFIED AS SIDEFF
+| #[ poly = Attributes.polymorphic ] [ "DefineLookup" ident(i) ":=" constr(e) ] ->
+ {
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
+ let (sigma, t) = Constrintern.interp_constr_evars env sigma e in
+ let r = Simple_declare.declare_definition ~poly i sigma t in
+ let print r = strbrk "Defined " ++ Printer.pr_global r ++ strbrk "." in
+ Feedback.msg_notice (print r);
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
+ let t = Simple_print.simple_body_access r in
+ let print t = strbrk "Found " ++ Printer.pr_econstr_env env sigma t in
+ Feedback.msg_notice (print t)
+ }
END
+(*** Checking terms ***)
+
+(*
+ * These are two commands for simple type-checking of terms.
+ * The bodies and explanations of the differences are in simple_check.ml.
+ *)
+
VERNAC COMMAND EXTEND Check1 CLASSIFIED AS QUERY
-| [ "Cmd5" constr(e) ] ->
- { let v = Constrintern.interp_constr (Global.env())
- (Evd.from_env (Global.env())) e in
- let (_, ctx) = v in
- let evd = Evd.from_ctx ctx in
- Feedback.msg_notice
- (Printer.pr_econstr_env (Global.env()) evd
- (Simple_check.simple_check1 v)) }
+| [ "Check1" constr(e) ] ->
+ {
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
+ let (sigma, t) = Constrintern.interp_constr_evars env sigma e in
+ let (sigma, typ) = Simple_check.simple_check1 env sigma t in
+ Feedback.msg_notice (Printer.pr_econstr_env env sigma typ)
+ }
END
VERNAC COMMAND EXTEND Check2 CLASSIFIED AS QUERY
-| [ "Cmd6" constr(e) ] ->
- { let v = Constrintern.interp_constr (Global.env())
- (Evd.from_env (Global.env())) e in
- let evd, ty = Simple_check.simple_check2 v in
- Feedback.msg_notice
- (Printer.pr_econstr_env (Global.env()) evd ty) }
+| [ "Check2" constr(e) ] ->
+ {
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
+ let (sigma, t) = Constrintern.interp_constr_evars env sigma e in
+ let typ = Simple_check.simple_check2 env sigma t in
+ Feedback.msg_notice (Printer.pr_econstr_env env sigma typ)
+ }
END
-VERNAC COMMAND EXTEND Check1 CLASSIFIED AS QUERY
-| [ "Cmd7" constr(e) ] ->
- { let v = Constrintern.interp_constr (Global.env())
- (Evd.from_env (Global.env())) e in
- let (a, ctx) = v in
- let evd = Evd.from_ctx ctx in
- Feedback.msg_notice
- (Printer.pr_econstr_env (Global.env()) evd
- (Simple_check.simple_check3 v)) }
-END
+(*** Convertibility ***)
-(* This command takes a name and return its value. It does less
- than Print, because it fails on constructors, axioms, and inductive types.
- This should be improved, because the error message is an anomaly.
- Anomalies should never appear even when using a command outside of its
- intended use. *)
-VERNAC COMMAND EXTEND ExamplePrint CLASSIFIED AS QUERY
-| [ "Cmd8" reference(r) ] ->
- { let env = Global.env() in
- let evd = Evd.from_env env in
- Feedback.msg_notice
- (Printer.pr_econstr_env env evd
- (EConstr.of_constr
- (Simple_print.simple_body_access (Nametab.global r)))) }
+(*
+ * This command checks if there is a possible assignment of
+ * constraints in the state under which the two terms are
+ * convertible.
+ *)
+VERNAC COMMAND EXTEND Convertible CLASSIFIED AS QUERY
+| [ "Convertible" constr(e1) constr(e2) ] ->
+ {
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
+ let (sigma, t1) = Constrintern.interp_constr_evars env sigma e1 in
+ let (sigma, t2) = Constrintern.interp_constr_evars env sigma e2 in
+ match Reductionops.infer_conv env sigma t1 t2 with
+ | Some _ ->
+ Feedback.msg_notice (strbrk "Yes :)")
+ | None ->
+ Feedback.msg_notice (strbrk "No :(")
+ }
END
+(*** Introducing terms ***)
+
+(*
+ * We can call the tactics defined in Tactics within our tactics.
+ * Here we call intros.
+ *)
TACTIC EXTEND my_intro
| [ "my_intro" ident(i) ] ->
{ Tactics.introduction i }
END
-(* if one write this:
- VERNAC COMMAND EXTEND exploreproof CLASSIFIED AS QUERY
- it gives an error message that is basically impossible to understand. *)
+(*** Exploring proof state ***)
+(*
+ * This command demonstrates exploring the proof state from within
+ * a command.
+ *
+ * Note that Pfedit.get_current_context gets us the environment
+ * and state within a proof, as opposed to the global environment
+ * and state. This is important within tactics.
+ *)
VERNAC COMMAND EXTEND ExploreProof CLASSIFIED AS QUERY
-| ![ proof ] [ "Cmd9" ] ->
+| ![ proof_query ] [ "ExploreProof" ] ->
{ fun ~pstate ->
- Option.iter (fun (pstate : Proof_global.t) ->
- let sigma, env = Pfedit.get_current_context pstate in
- let pprf = Proof.partial_proof Proof_global.(give_me_the_proof pstate) in
- Feedback.msg_notice
- (Pp.prlist_with_sep Pp.fnl (Printer.pr_econstr_env env sigma) pprf)) pstate;
- pstate }
+ let sigma, env = Pfedit.get_current_context pstate in
+ let pprf = Proof.partial_proof (Proof_global.get_proof pstate) in
+ Feedback.msg_notice
+ (Pp.prlist_with_sep Pp.fnl (Printer.pr_econstr_env env sigma) pprf)
+ }
END
diff --git a/doc/plugin_tutorial/tuto1/src/inspector.ml b/doc/plugin_tutorial/tuto1/src/inspector.ml
new file mode 100644
index 0000000000..d37cbdb74c
--- /dev/null
+++ b/doc/plugin_tutorial/tuto1/src/inspector.ml
@@ -0,0 +1,8 @@
+open Pp
+
+(*
+ * Inspect an input and print a feedback message explaining what it is
+ *)
+let print_input (a : 'a) (printer : 'a -> Pp.t) (type_str : string) : unit =
+ let msg = printer a ++ strbrk (Printf.sprintf " is a %s." type_str) in
+ Feedback.msg_notice msg
diff --git a/doc/plugin_tutorial/tuto1/src/inspector.mli b/doc/plugin_tutorial/tuto1/src/inspector.mli
new file mode 100644
index 0000000000..52b970bbe0
--- /dev/null
+++ b/doc/plugin_tutorial/tuto1/src/inspector.mli
@@ -0,0 +1,4 @@
+(*
+ * Inspect an input and print a feedback message explaining what it is
+ *)
+val print_input : 'a -> ('a -> Pp.t) -> string -> unit
diff --git a/doc/plugin_tutorial/tuto1/src/simple_check.ml b/doc/plugin_tutorial/tuto1/src/simple_check.ml
index 2949adde73..684864a056 100644
--- a/doc/plugin_tutorial/tuto1/src/simple_check.ml
+++ b/doc/plugin_tutorial/tuto1/src/simple_check.ml
@@ -1,32 +1,14 @@
-let simple_check1 value_with_constraints =
- begin
- let evalue, st = value_with_constraints in
- let evd = Evd.from_ctx st in
-(* This is reverse engineered from vernacentries.ml *)
-(* The point of renaming is to make sure the bound names printed by Check
- can be re-used in `apply with` tactics that use bound names to
- refer to arguments. *)
- let j = Environ.on_judgment EConstr.of_constr
- (Arguments_renaming.rename_typing (Global.env())
- (EConstr.to_constr evd evalue)) in
- let {Environ.uj_type=x}=j in x
- end
-
-let simple_check2 value_with_constraints =
- let evalue, st = value_with_constraints in
- let evd = Evd.from_ctx st in
-(* This version should be preferred if bound variable names are not so
- important, you want to really verify that the input is well-typed,
+let simple_check1 env sigma evalue =
+(* This version should be preferred if you want to really
+ verify that the input is well-typed,
and if you want to obtain the type. *)
(* Note that the output value is a pair containing a new evar_map:
typing will fill out blanks in the term by add evar bindings. *)
- Typing.type_of (Global.env()) evd evalue
+ Typing.type_of env sigma evalue
-let simple_check3 value_with_constraints =
- let evalue, st = value_with_constraints in
- let evd = Evd.from_ctx st in
-(* This version should be preferred if bound variable names are not so
- important and you already expect the input to have been type-checked
- before. Set ~lax to false if you want an anomaly to be raised in
- case of a type error. Otherwise a ReTypeError exception is raised. *)
- Retyping.get_type_of ~lax:true (Global.env()) evd evalue
+let simple_check2 env sigma evalue =
+(* This version should be preferred if you already expect the input to
+ have been type-checked before. Set ~lax to false if you want an anomaly
+ to be raised in case of a type error. Otherwise a ReTypeError exception
+ is raised. *)
+ Retyping.get_type_of ~lax:true env sigma evalue
diff --git a/doc/plugin_tutorial/tuto1/src/simple_check.mli b/doc/plugin_tutorial/tuto1/src/simple_check.mli
index bcf1bf56cf..4b28ac74fe 100644
--- a/doc/plugin_tutorial/tuto1/src/simple_check.mli
+++ b/doc/plugin_tutorial/tuto1/src/simple_check.mli
@@ -1,8 +1,5 @@
val simple_check1 :
- EConstr.constr Evd.in_evar_universe_context -> EConstr.constr
+ Environ.env -> Evd.evar_map -> EConstr.constr -> Evd.evar_map * EConstr.constr
val simple_check2 :
- EConstr.constr Evd.in_evar_universe_context -> Evd.evar_map * EConstr.constr
-
-val simple_check3 :
- EConstr.constr Evd.in_evar_universe_context -> EConstr.constr
+ Environ.env -> Evd.evar_map -> EConstr.constr -> EConstr.constr
diff --git a/doc/plugin_tutorial/tuto1/src/simple_declare.ml b/doc/plugin_tutorial/tuto1/src/simple_declare.ml
index e9b91d5a7e..eb8161c2bb 100644
--- a/doc/plugin_tutorial/tuto1/src/simple_declare.ml
+++ b/doc/plugin_tutorial/tuto1/src/simple_declare.ml
@@ -6,11 +6,9 @@ let edeclare ?hook ident (_, poly, _ as k) ~opaque sigma udecl body tyopt imps =
let hook_data = Option.map (fun hook -> hook, uctx, []) hook in
DeclareDef.declare_definition ident k ce ubinders imps ?hook_data
-let packed_declare_definition ~poly ident value_with_constraints =
- let body, ctx = value_with_constraints in
- let sigma = Evd.from_ctx ctx in
- let k = (Decl_kinds.Global, poly, Decl_kinds.Definition) in
+let declare_definition ~poly ident sigma body =
+ let k = Decl_kinds.(Global ImportDefaultBehavior, poly, Definition) in
let udecl = UState.default_univ_decl in
- ignore (edeclare ident k ~opaque:false sigma udecl body None [])
+ edeclare ident k ~opaque:false sigma udecl body None []
(* But this definition cannot be undone by Reset ident *)
diff --git a/doc/plugin_tutorial/tuto1/src/simple_declare.mli b/doc/plugin_tutorial/tuto1/src/simple_declare.mli
index fd74e81526..c55b36742f 100644
--- a/doc/plugin_tutorial/tuto1/src/simple_declare.mli
+++ b/doc/plugin_tutorial/tuto1/src/simple_declare.mli
@@ -1,5 +1,4 @@
open Names
-open EConstr
-val packed_declare_definition :
- poly:bool -> Id.t -> constr Evd.in_evar_universe_context -> unit
+val declare_definition :
+ poly:bool -> Id.t -> Evd.evar_map -> EConstr.t -> Names.GlobRef.t
diff --git a/doc/plugin_tutorial/tuto1/src/simple_print.ml b/doc/plugin_tutorial/tuto1/src/simple_print.ml
index cfc38ff9c9..ba989b1bac 100644
--- a/doc/plugin_tutorial/tuto1/src/simple_print.ml
+++ b/doc/plugin_tutorial/tuto1/src/simple_print.ml
@@ -11,7 +11,7 @@ let simple_body_access gref =
failwith "constructors are not covered in this example"
| Globnames.ConstRef cst ->
let cb = Environ.lookup_constant cst (Global.env()) in
- match Global.body_of_constant_body cb with
- | Some(e, _) -> e
+ match Global.body_of_constant_body Library.indirect_accessor cb with
+ | Some(e, _, _) -> EConstr.of_constr e
| None -> failwith "This term has no value"
diff --git a/doc/plugin_tutorial/tuto1/src/simple_print.mli b/doc/plugin_tutorial/tuto1/src/simple_print.mli
index 254b56ff79..943e26acb6 100644
--- a/doc/plugin_tutorial/tuto1/src/simple_print.mli
+++ b/doc/plugin_tutorial/tuto1/src/simple_print.mli
@@ -1 +1 @@
-val simple_body_access : Names.GlobRef.t -> Constr.constr
+val simple_body_access : Names.GlobRef.t -> EConstr.constr
diff --git a/doc/plugin_tutorial/tuto1/src/tuto1_plugin.mlpack b/doc/plugin_tutorial/tuto1/src/tuto1_plugin.mlpack
index a797a509e0..9309f78cd0 100644
--- a/doc/plugin_tutorial/tuto1/src/tuto1_plugin.mlpack
+++ b/doc/plugin_tutorial/tuto1/src/tuto1_plugin.mlpack
@@ -1,3 +1,4 @@
+Inspector
Simple_check
Simple_declare
Simple_print
diff --git a/doc/plugin_tutorial/tuto1/theories/Demo.v b/doc/plugin_tutorial/tuto1/theories/Demo.v
new file mode 100644
index 0000000000..5723e2f82e
--- /dev/null
+++ b/doc/plugin_tutorial/tuto1/theories/Demo.v
@@ -0,0 +1,95 @@
+From Tuto1 Require Import Loader.
+
+(*** Printing user inputs ***)
+
+Definition definition := 5.
+What's definition.
+What kind of term is definition.
+What kind of identifier is definition.
+
+What is 1 2 3 a list of.
+What is a list of. (* no arguments = empty list *)
+
+Is 1 2 3 nonempty.
+(* Is nonempty *) (* does not parse *)
+
+And is 1 provided.
+And is provided.
+
+(*** Interning terms ***)
+
+Intern 3.
+Intern definition.
+Intern (fun (x : Prop) => x).
+Intern (fun (x : Type) => x).
+Intern (forall (T : Type), T).
+Intern (fun (T : Type) (t : T) => t).
+Intern _.
+Intern (Type : Type).
+
+(*** Defining terms ***)
+
+MyDefine n := 1.
+Print n.
+
+MyDefine f := (fun (x : Type) => x).
+Print f.
+
+(*** Printing terms ***)
+
+MyPrint f.
+MyPrint n.
+Fail MyPrint nat.
+
+DefineLookup n' := 1.
+DefineLookup f' := (fun (x : Type) => x).
+
+(*** Checking terms ***)
+
+Check1 3.
+Check1 definition.
+Check1 (fun (x : Prop) => x).
+Check1 (fun (x : Type) => x).
+Check1 (forall (T : Type), T).
+Check1 (fun (T : Type) (t : T) => t).
+Check1 _.
+Check1 (Type : Type).
+
+Check2 3.
+Check2 definition.
+Check2 (fun (x : Prop) => x).
+Check2 (fun (x : Type) => x).
+Check2 (forall (T : Type), T).
+Check2 (fun (T : Type) (t : T) => t).
+Check2 _.
+Check2 (Type : Type).
+
+(*** Convertibility ***)
+
+Convertible 1 1.
+Convertible (fun (x : Type) => x) (fun (x : Type) => x).
+Convertible Type Type.
+Convertible 1 ((fun (x : nat) => x) 1).
+
+Convertible 1 2.
+Convertible (fun (x : Type) => x) (fun (x : Prop) => x).
+Convertible Type Prop.
+Convertible 1 ((fun (x : nat) => x) 2).
+
+(*** Introducing variables ***)
+
+Theorem foo:
+ forall (T : Set) (t : T), T.
+Proof.
+ my_intro T. my_intro t. apply t.
+Qed.
+
+(*** Exploring proof state ***)
+
+Fail ExploreProof. (* not in a proof *)
+
+Theorem bar:
+ forall (T : Set) (t : T), T.
+Proof.
+ ExploreProof. my_intro T. ExploreProof. my_intro t. ExploreProof. apply t.
+Qed.
diff --git a/doc/plugin_tutorial/tuto2/_CoqProject b/doc/plugin_tutorial/tuto2/_CoqProject
index cf9cb5cc26..0d7a644271 100644
--- a/doc/plugin_tutorial/tuto2/_CoqProject
+++ b/doc/plugin_tutorial/tuto2/_CoqProject
@@ -1,6 +1,15 @@
--R theories/ Tuto
+-R theories Tuto2
-I src
-theories/Test.v
-src/demo.mlg
-src/demo_plugin.mlpack
+theories/Loader.v
+theories/Demo.v
+theories/Count.v
+
+src/custom.ml
+src/custom.mli
+src/counter.ml
+src/counter.mli
+src/persistent_counter.ml
+src/persistent_counter.mli
+src/g_tuto2.mlg
+src/tuto2_plugin.mlpack
diff --git a/doc/plugin_tutorial/tuto2/src/counter.ml b/doc/plugin_tutorial/tuto2/src/counter.ml
new file mode 100644
index 0000000000..8721090d42
--- /dev/null
+++ b/doc/plugin_tutorial/tuto2/src/counter.ml
@@ -0,0 +1,22 @@
+(*
+ * This file defines our counter, which we use in the Count command.
+ *)
+
+(*
+ * Our counter is simply a reference called "counter" to an integer.
+ *
+ * Summary.ref behaves like ref, but also registers a summary to Coq.
+ *)
+let counter = Summary.ref ~name:"counter" 0
+
+(*
+ * We can increment our counter:
+ *)
+let increment () =
+ counter := succ !counter
+
+(*
+ * We can also read the value of our counter:
+ *)
+let value () =
+ !counter
diff --git a/doc/plugin_tutorial/tuto2/src/counter.mli b/doc/plugin_tutorial/tuto2/src/counter.mli
new file mode 100644
index 0000000000..984bc1d2cc
--- /dev/null
+++ b/doc/plugin_tutorial/tuto2/src/counter.mli
@@ -0,0 +1,13 @@
+(*
+ * This file defines our counter, which we use in the Count command.
+ *)
+
+(*
+ * Increment the counter
+ *)
+val increment : unit -> unit
+
+(*
+ * Determine the value of the counter
+ *)
+val value : unit -> int
diff --git a/doc/plugin_tutorial/tuto2/src/custom.ml b/doc/plugin_tutorial/tuto2/src/custom.ml
new file mode 100644
index 0000000000..648786d3bd
--- /dev/null
+++ b/doc/plugin_tutorial/tuto2/src/custom.ml
@@ -0,0 +1,5 @@
+(*
+ * This file defines a custom type for the PassCustom command.
+ *)
+
+type custom_type = Foo | Bar
diff --git a/doc/plugin_tutorial/tuto2/src/custom.mli b/doc/plugin_tutorial/tuto2/src/custom.mli
new file mode 100644
index 0000000000..648786d3bd
--- /dev/null
+++ b/doc/plugin_tutorial/tuto2/src/custom.mli
@@ -0,0 +1,5 @@
+(*
+ * This file defines a custom type for the PassCustom command.
+ *)
+
+type custom_type = Foo | Bar
diff --git a/doc/plugin_tutorial/tuto2/src/demo.mlg b/doc/plugin_tutorial/tuto2/src/demo.mlg
deleted file mode 100644
index 966c05acdc..0000000000
--- a/doc/plugin_tutorial/tuto2/src/demo.mlg
+++ /dev/null
@@ -1,375 +0,0 @@
-(* -------------------------------------------------------------------------- *)
-(* *)
-(* Initial ritual dance *)
-(* *)
-(* -------------------------------------------------------------------------- *)
-
-DECLARE PLUGIN "demo_plugin"
-
-(*
- Use this macro before any of the other OCaml macros.
-
- Each plugin has a unique name.
- We have decided to name this plugin as "demo_plugin".
- That means that:
-
- (1) If we want to load this particular plugin to Coq toplevel,
- we must use the following command.
-
- Declare ML Module "demo_plugin".
-
- (2) The above command will succeed only if there is "demo_plugin.cmxs"
- in some of the directories that Coq is supposed to look
- (i.e. the ones we specified via "-I ..." command line options).
-
- (3) The file "demo_plugin.mlpack" lists the OCaml modules to be linked in
- "demo_plugin.cmxs".
-
- (4) The file "demo_plugin.mlpack" as well as all .ml, .mli and .mlg files
- are listed in the "_CoqProject" file.
-*)
-
-(* -------------------------------------------------------------------------- *)
-(* *)
-(* How to define a new Vernacular command? *)
-(* *)
-(* -------------------------------------------------------------------------- *)
-
-VERNAC COMMAND EXTEND Cmd1 CLASSIFIED AS QUERY
-| [ "Cmd1" ] -> { () }
-END
-
-(*
- These:
-
- VERNAC COMMAND EXTEND
-
- and
-
- END
-
- mark the beginning and the end of the definition of a new Vernacular command.
-
- Cmd1 is a unique identifier (which must start with an upper-case letter)
- associated with the new Vernacular command we are defining.
-
- CLASSIFIED AS QUERY tells Coq that the new Vernacular command:
- - changes neither the global environment
- - nor does it modify the plugin's state.
-
- If the new command could:
- - change the global environment
- - or modify a plugin's state
- then one would have to use CLASSIFIED AS SIDEFF instead.
-
- This:
-
- [ "Cmd1" ] -> { () }
-
- defines:
- - the parsing rule
- - the interpretation rule
-
- The parsing rule and the interpretation rule are separated by -> token.
-
- The parsing rule, in this case, is:
-
- [ "Cmd1" ]
-
- By convention, all vernacular command start with an upper-case letter.
-
- The [ and ] characters mark the beginning and the end of the parsing rule.
- The parsing rule itself says that the syntax of the newly defined command
- is composed from a single terminal Cmd1.
-
- The interpretation rule, in this case, is:
-
- { () }
-
- Similarly to the case of the parsing rule,
- { and } characters mark the beginning and the end of the interpretation rule.
- In this case, the following Ocaml expression:
-
- ()
-
- defines the effect of the Vernacular command we have just defined.
- That is, it behaves is no-op.
-*)
-
-(* -------------------------------------------------------------------------- *)
-(* *)
-(* How to define a new Vernacular command with some terminal parameters? *)
-(* *)
-(* -------------------------------------------------------------------------- *)
-
-VERNAC COMMAND EXTEND Cmd2 CLASSIFIED AS QUERY
-| [ "Cmd2" "With" "Some" "Terminal" "Parameters" ] -> { () }
-END
-
-(*
- As shown above, the Vernacular command can be composed from
- any number of terminals.
-
- By convention, each of these terminals starts with an upper-case letter.
-*)
-
-(* -------------------------------------------------------------------------- *)
-(* *)
-(* How to define a new Vernacular command with some non-terminal parameter? *)
-(* *)
-(* -------------------------------------------------------------------------- *)
-
-{
-
-open Stdarg
-
-}
-
-VERNAC COMMAND EXTEND Cmd3 CLASSIFIED AS QUERY
-| [ "Cmd3" int(i) ] -> { () }
-END
-
-(*
- This:
-
- open Stdarg
-
- is needed as some identifiers in the Ocaml code generated by the
-
- VERNAC COMMAND EXTEND ... END
-
- macros are not fully qualified.
-
- This:
-
- int(i)
-
- means that the new command is expected to be followed by an integer.
- The integer is bound in the parsing rule to variable i.
- This variable i then can be used in the interpretation rule.
-
- To see value of which Ocaml types can be bound this way,
- look at the wit_* function declared in interp/stdarg.mli
- (in the Coq's codebase).
-
- If we drop the wit_ prefix, we will get the token
- that we can use in the parsing rule.
- That is, since there exists wit_int, we know that
- we can write:
-
- int(i)
-
- By looking at the signature of the wit_int function:
-
- val wit_int : int uniform_genarg_type
-
- we also know that variable i will have the type int.
-
- The types of wit_* functions are either:
-
- 'c uniform_genarg_type
-
- or
-
- ('a,'b,'c) genarg_type
-
- In both cases, the bound variable will have type 'c.
-*)
-
-(* -------------------------------------------------------------------------- *)
-(* *)
-(* How to define a new Vernacular command with variable number of arguments? *)
-(* *)
-(* -------------------------------------------------------------------------- *)
-
-VERNAC COMMAND EXTEND Cmd4 CLASSIFIED AS QUERY
-| [ "Cmd4" int_list(l) ] -> { () }
-END
-
-(*
- This:
-
- int_list(l)
-
- means that the new Vernacular command is expected to be followed
- by a (whitespace separated) list of integers.
- This list of integers is bound to the indicated l.
-
- In this case, as well as in the cases we point out below, instead of int
- in int_list we could use any other supported type, e.g. ident, bool, ...
-
- To see which other Ocaml type constructors (in addition to list)
- are supported, have a look at the parse_user_entry function defined
- in grammar/q_util.mlp file.
-
- E.g.:
- - ne_int_list(x) would represent a non-empty list of integers,
- - int_list(x) would represent a list of integers,
- - int_opt(x) would represent a value of type int option,
- - ···
-*)
-
-(* -------------------------------------------------------------------------- *)
-(* *)
-(* How to define a new Vernacular command that takes values of a custom type? *)
-(* *)
-(* -------------------------------------------------------------------------- *)
-
-{
-
-open Ltac_plugin
-
-}
-
-(*
- If we want to avoid a compilation failure
-
- "no implementation available for Tacenv"
-
- then we have to open the Ltac_plugin module.
-*)
-
-(*
- Pp module must be opened because some of the macros that are part of the API
- do not expand to fully qualified names.
-*)
-
-{
-
-type type_5 = Foo_5 | Bar_5
-
-}
-
-(*
- We define a type of values that we want to pass to our Vernacular command.
-*)
-
-(*
- By default, we are able to define new Vernacular commands that can take
- parameters of some of the supported types. Which types are supported,
- that was discussed earlier.
-
- If we want to be able to define Vernacular command that takes parameters
- of a type that is not supported by default, we must use the following macro:
-*)
-
-{
-
-open Pp
-
-}
-
-VERNAC ARGUMENT EXTEND custom5
-| [ "Foo_5" ] -> { Foo_5 }
-| [ "Bar_5" ] -> { Bar_5 }
-END
-
-(*
- where:
-
- custom5
-
- indicates that, from now on, in our parsing rules we can write:
-
- custom5(some_variable)
-
- in those places where we expect user to provide an input
- that can be parsed by the parsing rules above
- (and interpreted by the interpretations rules above).
-*)
-
-(* Here: *)
-
-VERNAC COMMAND EXTEND Cmd5 CLASSIFIED AS QUERY
-| [ "Cmd5" custom5(x) ] -> { () }
-END
-
-(*
- we define a new Vernacular command whose parameters, provided by the user,
- can be mapped to values of type_5.
-*)
-
-(* -------------------------------------------------------------------------- *)
-(* *)
-(* How to give a feedback to the user? *)
-(* *)
-(* -------------------------------------------------------------------------- *)
-
-VERNAC COMMAND EXTEND Cmd6 CLASSIFIED AS QUERY
-| [ "Cmd6" ] -> { Feedback.msg_notice (Pp.str "Everything is awesome!") }
-END
-
-(*
- The following functions:
-
- - Feedback.msg_info : Pp.t -> unit
- - Feedback.msg_notice : Pp.t -> unit
- - Feedback.msg_warning : Pp.t -> unit
- - Feedback.msg_error : Pp.t -> unit
- - Feedback.msg_debug : Pp.t -> unit
-
- enable us to give user a textual feedback.
-
- Pp module enable us to represent and construct pretty-printing instructions.
- The concepts defined and the services provided by the Pp module are in
- various respects related to the concepts and services provided
- by the Format module that is part of the Ocaml standard library.
-*)
-
-(* -------------------------------------------------------------------------- *)
-(* *)
-(* How to implement a Vernacular command with (undoable) side-effects? *)
-(* *)
-(* -------------------------------------------------------------------------- *)
-
-{
-
-open Summary.Local
-
-}
-
-(*
- By opening Summary.Local module we shadow the original functions
- that we traditionally use for implementing stateful behavior.
-
- ref
- !
- :=
-
- are now shadowed by their counterparts in Summary.Local. *)
-
-{
-
-let counter = ref ~name:"counter" 0
-
-}
-
-VERNAC COMMAND EXTEND Cmd7 CLASSIFIED AS SIDEFF
-| [ "Cmd7" ] -> { counter := succ !counter;
- Feedback.msg_notice (Pp.str "counter = " ++ Pp.str (string_of_int (!counter))) }
-END
-
-TACTIC EXTEND tactic1
-| [ "tactic1" ] -> { Proofview.tclUNIT () }
-END
-
-(* ---- *)
-
-{
-
-type custom = Foo_2 | Bar_2
-
-let pr_custom _ _ _ = function
- | Foo_2 -> Pp.str "Foo_2"
- | Bar_2 -> Pp.str "Bar_2"
-
-}
-
-ARGUMENT EXTEND custom2 PRINTED BY { pr_custom }
-| [ "Foo_2" ] -> { Foo_2 }
-| [ "Bar_2" ] -> { Bar_2 }
-END
-
-TACTIC EXTEND tactic2
-| [ "tactic2" custom2(x) ] -> { Proofview.tclUNIT () }
-END
diff --git a/doc/plugin_tutorial/tuto2/src/demo_plugin.mlpack b/doc/plugin_tutorial/tuto2/src/demo_plugin.mlpack
deleted file mode 100644
index 4f0b8480b5..0000000000
--- a/doc/plugin_tutorial/tuto2/src/demo_plugin.mlpack
+++ /dev/null
@@ -1 +0,0 @@
-Demo
diff --git a/doc/plugin_tutorial/tuto2/src/dune b/doc/plugin_tutorial/tuto2/src/dune
index f2bc405455..68ddd13947 100644
--- a/doc/plugin_tutorial/tuto2/src/dune
+++ b/doc/plugin_tutorial/tuto2/src/dune
@@ -4,6 +4,6 @@
(libraries coq.plugins.ltac))
(rule
- (targets demo.ml)
- (deps (:pp-file demo.mlg) )
+ (targets g_tuto2.ml)
+ (deps (:pp-file g_tuto2.mlg) )
(action (run coqpp %{pp-file})))
diff --git a/doc/plugin_tutorial/tuto2/src/g_tuto2.mlg b/doc/plugin_tutorial/tuto2/src/g_tuto2.mlg
new file mode 100644
index 0000000000..a3ce60d432
--- /dev/null
+++ b/doc/plugin_tutorial/tuto2/src/g_tuto2.mlg
@@ -0,0 +1,618 @@
+(* -------------------------------------------------------------------------- *)
+(* *)
+(* Initial ritual dance *)
+(* *)
+(* -------------------------------------------------------------------------- *)
+
+DECLARE PLUGIN "tuto2_plugin"
+
+(*
+ Use this macro before any of the other OCaml macros.
+
+ Each plugin has a unique name.
+ We have decided to name this plugin as "tuto2_plugin".
+ That means that:
+
+ (1) We write the following command in a file called Loader.v:
+
+ Declare ML Module "tuto2_plugin".
+
+ to load this command into the Coq top-level.
+
+ (2) Users can then load our plugin in other Coq files by writing:
+
+ From Tuto2 Require Import Loader.
+
+ where Loader is the name of the file that declares "tuto2_plugin",
+ and where Tuto2 is the name passed to the -R argument in our _CoqProject.
+
+ (3) The above commands will succeed only if there is "tuto2_plugin.cmxs"
+ in some of the directories where Coq is supposed to look
+ (i.e. the ones we specified via "-I ..." command line options in
+ _CoqProject). As long as this is listed in our _CoqProject, the
+ Makefile takes care of placing it in the right directory.
+
+ (4) The file "tuto2_plugin.mlpack" lists the OCaml modules to be linked in
+ "tuto2_plugin.cmxs".
+
+ (5) The file "tuto2_plugin.mlpack" as well as all .ml, .mli and .mlg files
+ are listed in the "_CoqProject" file.
+ *)
+
+(* -------------------------------------------------------------------------- *)
+(* *)
+(* Importing OCaml dependencies *)
+(* *)
+(* -------------------------------------------------------------------------- *)
+
+(*
+ * This .mlg file is parsed into a .ml file. You can put OCaml in this file
+ * inside of curly braces. It's best practice to use this only to import
+ * other modules, and include most of your functionality in those modules.
+ *
+ * Here we list all of the dependencies that these commands have, and explain
+ * why. We also refer to the first command that uses them, where further
+ * explanation can be found in context.
+ *)
+{
+ (*** Dependencies from Coq ***)
+
+ (*
+ * This lets us take non-terminal arguments to a command (for example,
+ * the PassInt command that takes an integer argument needs this
+ * this dependency).
+ *
+ * First used by: PassInt
+ *)
+ open Stdarg
+
+ (*
+ * This is Coq's pretty-printing module. Here, we need it to use some
+ * useful syntax for pretty-printing.
+ *
+ * First use by: Count
+ *)
+ open Pp
+}
+
+(* -------------------------------------------------------------------------- *)
+(* *)
+(* How to define a new Vernacular command? *)
+(* *)
+(* -------------------------------------------------------------------------- *)
+
+(*
+ This command does nothing:
+*)
+VERNAC COMMAND EXTEND NoOp CLASSIFIED AS QUERY
+| [ "Nothing" ] -> { () }
+END
+
+(*
+ --- Defining a Command ---
+
+ These:
+
+ VERNAC COMMAND EXTEND
+
+ and
+
+ END
+
+ mark the beginning and the end of the definition of a new Vernacular command.
+
+ --- Assigning a Command a Unique Identifier ---
+
+ NoOp is a unique identifier (which must start with an upper-case letter)
+ associated with the new Vernacular command we are defining. It is good
+ to make this identifier descriptive.
+
+ --- Classifying a Command ---
+
+ CLASSIFIED AS QUERY tells Coq that the new Vernacular command neither:
+ - changes the global environment, nor
+ - modifies the plugin's state.
+
+ If the new command could:
+ - change the global environment
+ - or modify a plugin's state
+ then one would have to use CLASSIFIED AS SIDEFF instead.
+
+ --- Defining Parsing and Interpretation Rules ---
+
+ This:
+
+ [ "Nothing" ] -> { () }
+
+ defines:
+ - the parsing rule (left)
+ - the interpretation rule (right)
+
+ The parsing rule and the interpretation rule are separated by -> token.
+
+ The parsing rule, in this case, is:
+
+ [ "Nothing" ]
+
+ By convention, all vernacular command start with an upper-case letter.
+
+ The '[' and ']' characters mark the beginning and the end of the parsing
+ rule, respectively. The parsing rule itself says that the syntax of the
+ newly defined command is composed from a single terminal Nothing.
+
+ The interpretation rule, in this case, is:
+
+ { () }
+
+ Similarly to the case of the parsing rule, the
+ '{' and '}' characters mark the beginning and the end of the interpretation
+ rule. In this case, the following Ocaml expression:
+
+ ()
+
+ defines the effect of the Vernacular command we have just defined.
+ That is, it behaves is no-op.
+
+ --- Calling a Command ---
+
+ In Demo.v, we call this command by writing:
+
+ Nothing.
+
+ since our parsing rule is "Nothing". This does nothing, since our
+ interpretation rule is ().
+*)
+
+(* -------------------------------------------------------------------------- *)
+(* *)
+(* How to define a new Vernacular command with some terminal parameters? *)
+(* *)
+(* -------------------------------------------------------------------------- *)
+
+(*
+ This command takes some terminal parameters and does nothing.
+*)
+VERNAC COMMAND EXTEND NoOpTerminal CLASSIFIED AS QUERY
+| [ "Command" "With" "Some" "Terminal" "Parameters" ] -> { () }
+END
+
+(*
+ --- Defining a Command with Terminal Parameters ---
+
+ As shown above, the Vernacular command can be composed from
+ any number of terminals.
+
+ By convention, each of these terminals starts with an upper-case letter.
+
+ --- Calling a Command with Terminal Parameters ---
+
+ In Demo.v, we call this command by writing:
+
+ Command With Some Terminal Parameters.
+
+ to match our parsing rule. As expected, this does nothing.
+
+ --- Recognizing Syntax Errors ---
+
+ Note that if we were to omit any of these terminals, for example by writing:
+
+ Command.
+
+ it would fail to parse (as expected), showing this error to the user:
+
+ Syntax error: illegal begin of vernac.
+*)
+
+(* -------------------------------------------------------------------------- *)
+(* *)
+(* How to define a new Vernacular command with some non-terminal parameter? *)
+(* *)
+(* -------------------------------------------------------------------------- *)
+
+(*
+ This command takes an integer argument and does nothing.
+*)
+VERNAC COMMAND EXTEND PassInt CLASSIFIED AS QUERY
+| [ "Pass" int(i) ] -> { () }
+END
+
+(*
+ --- Dependencies ---
+
+ Since this command takes a non-terminal argument, it is the first
+ to depend on Stdarg (opened at the top of this file).
+
+ --- Defining a Command with Non-Terminal Arguments ---
+
+ This:
+
+ int(i)
+
+ means that the new command is expected to be followed by an integer.
+ The integer is bound in the parsing rule to variable i.
+ This variable i then can be used in the interpretation rule.
+
+ To see value of which Ocaml types can be bound this way,
+ look at the wit_* function declared in interp/stdarg.mli
+ (in the Coq's codebase). There are more examples in tuto1.
+
+ If we drop the wit_ prefix, we will get the token
+ that we can use in the parsing rule.
+ That is, since there exists wit_int, we know that
+ we can write:
+
+ int(i)
+
+ By looking at the signature of the wit_int function:
+
+ val wit_int : int uniform_genarg_type
+
+ we also know that variable i will have the type int.
+
+ --- Recognizing Build Errors ---
+
+ The mapping from int(i) to wit_int is automatic.
+ This is why, if we forget to open Stdarg, we will get this error:
+
+ Unbound value wit_int
+
+ when we try to build our plugin. It is good to recognize this error,
+ since this is a common mistake in plugin development, and understand
+ that the fix is to open the file (Stdarg) where wit_int is defined.
+
+ --- Calling a Command with Terminal Arguments ---
+
+ We call this command in Demo.v by writing:
+
+ Pass 42.
+
+ We could just as well pass any other integer. As expected, this command
+ does nothing.
+
+ --- Recognizing Syntax Errors ---
+
+ As in our previous command, if we were to omit the arguments to the command,
+ for example by writing:
+
+ Pass.
+
+ it would fail to parse (as expected), showing this error to the user:
+
+ Syntax error: [prim:integer] expected after 'Pass' (in [vernac:command]).
+
+ The same thing would happen if we passed the wrong argument type:
+
+ Pass True.
+
+ If we pass too many arguments:
+
+ Pass 15 20.
+
+ we will get a different syntax error:
+
+ Syntax error: '.' expected after [vernac:command] (in [vernac_aux]).
+
+ It is good to recognize these errors, since doing so can help you
+ catch mistakes you make defining your parser rules during plugin
+ development.
+*)
+
+(* -------------------------------------------------------------------------- *)
+(* *)
+(* How to define a new Vernacular command with variable number of arguments? *)
+(* *)
+(* -------------------------------------------------------------------------- *)
+
+(*
+ This command takes a list of integers and does nothing:
+*)
+VERNAC COMMAND EXTEND AcceptIntList CLASSIFIED AS QUERY
+| [ "Accept" int_list(l) ] -> { () }
+END
+
+(*
+ --- Dependencies ---
+
+ Much like PassInt, this command depends on Stdarg.
+
+ --- Defining a Command that Takes a Variable Number of Arguments ---
+
+ This:
+
+ int_list(l)
+
+ means that the new Vernacular command is expected to be followed
+ by a (whitespace separated) list of integers.
+ This list of integers is bound to the indicated l.
+
+ In this case, as well as in the cases we point out below, instead of int
+ in int_list we could use any other supported type, e.g. ident, bool, ...
+
+ --- Other Ways to Take a Variable Number of Arguments ---
+
+ To see which other Ocaml type constructors (in addition to list)
+ are supported, have a look at the parse_user_entry function defined
+ in the coqpp/coqpp_parse.mly file.
+
+ E.g.:
+ - ne_int_list(x) would represent a non-empty list of integers,
+ - int_list(x) would represent a list of integers,
+ - int_opt(x) would represent a value of type int option,
+ - ···
+
+ Much like with int_list, we could use any other supported type here.
+ There are some more examples of this in tuto1.
+
+ --- Calling a Command with a Variable Number of Arguments ---
+
+ We call this command in Demo.v by writing:
+
+ Accept 100 200 300 400.
+
+ As expected, this does nothing.
+
+ Since our parser rule uses int_list, the arguments to Accept can be a
+ list of integers of any length. For example, we can pass the empty list:
+
+ Accept.
+
+ or just one argument:
+
+ Accept 2.
+
+ and so on.
+*)
+
+(* -------------------------------------------------------------------------- *)
+(* *)
+(* How to define a new Vernacular command that takes values of a custom type? *)
+(* *)
+(* -------------------------------------------------------------------------- *)
+
+(*
+ --- Defining Custom Types ---
+
+ Vernacular commands can take custom types in addition to the built-in
+ ones. The first step to taking these custom types as arguments is
+ to define them.
+
+
+ We define a type of values that we want to pass to our Vernacular command
+ in custom.ml/custom.mli. The type is very simple:
+
+ type custom_type : Foo | Bar.
+
+ --- Using our New Module ---
+
+ Now that we have a new OCaml module Custom, in order to use it, we must
+ do the following:
+
+ 1. Add src/custom.ml and src/custom.mli to our _CoqProject
+ 2. Add Custom to our tuto2_plugin.mlpack
+
+ This workflow will become very familiar to you when you add new modules
+ to your plugins, so it is worth getting used to.
+
+ --- Depending on our New Module ---
+
+ Now that our new module is listed in both _CoqProject and tuto2_plugin.mlpack,
+ we can use fully qualified names Custom.Foo and Custom.Bar.
+
+ Alternatively, we could add the dependency on our module:
+
+ open Custom.
+
+ to the top of the file, and then refer to Foo and Bar directly.
+
+ --- Telling Coq About our New Argument Type ---
+
+ By default, we are able to define new Vernacular commands that can take
+ parameters of some of the supported types. Which types are supported,
+ that was discussed earlier.
+
+ If we want to be able to define Vernacular command that takes parameters
+ of a type that is not supported by default, we must use the following macro:
+*)
+VERNAC ARGUMENT EXTEND custom
+| [ "Foo" ] -> { Custom.Foo }
+| [ "Bar" ] -> { Custom.Bar }
+END
+
+(*
+ where:
+
+ custom
+
+ indicates that, from now on, in our parsing rules we can write:
+
+ custom(some_variable)
+
+ in those places where we expect user to provide an input
+ that can be parsed by the parsing rules above
+ (and interpreted by the interpretations rules above).
+*)
+
+(*
+ --- Defining a Command that Takes an Argument of a Custom Type ---
+
+ Now that Coq is aware of our new argument type, we can define a command
+ that uses it. This command takes an argument Foo or Bar and does nothing:
+*)
+VERNAC COMMAND EXTEND PassCustom CLASSIFIED AS QUERY
+| [ "Foobar" custom(x) ] -> { () }
+END
+
+(*
+ --- Calling a Command that Takes an Argument of a Custom Type ---
+
+ We call this command in Demo.v by writing:
+
+ Foobar Foo.
+ Foobar Bar.
+
+ As expected, both of these do nothing. In the first case, x gets
+ the value Custom.Foo : Custom.custom_type, since our custom parsing
+ and interpretation rules (VERNAC ARGUMENT EXTEND custom ...) map
+ the input Foo to Custom.Foo. Similarly, in the second case, x gets
+ the value Custom.Bar : Custom.custom_type.
+*)
+
+(* -------------------------------------------------------------------------- *)
+(* *)
+(* How to give a feedback to the user? *)
+(* *)
+(* -------------------------------------------------------------------------- *)
+
+(*
+ So far we have defined commands that do nothing.
+ We can also signal feedback to the user.
+
+ This command tells the user that everything is awesome:
+*)
+VERNAC COMMAND EXTEND Awesome CLASSIFIED AS QUERY
+| [ "Is" "Everything" "Awesome" ] ->
+ {
+ Feedback.msg_notice (Pp.str "Everything is awesome!")
+ }
+END
+
+(*
+ --- Pretty Printing ---
+
+ User feedback functions like Feedback.msg_notice take a Pp.t as an argument.
+ Check the Pp module to see which functions are available to construct
+ a Pp.t.
+
+ The Pp module enable us to represent and construct pretty-printing
+ instructions. The concepts defined and the services provided by the
+ Pp module are in various respects related to the concepts and services
+ provided by the Format module that is part of the Ocaml standard library.
+
+ --- Giving Feedback ---
+
+ Once we have a Pp.t, we can use the following functions:
+
+ - Feedback.msg_info : Pp.t -> unit
+ - Feedback.msg_notice : Pp.t -> unit
+ - Feedback.msg_warning : Pp.t -> unit
+ - Feedback.msg_debug : Pp.t -> unit
+
+ to give user a textual feedback. Examples of some of these can be
+ found in tuto0.
+
+ --- Signaling Errors ---
+
+ While there is a Feedback.msg_error, when signaling an error,
+ it is currently better practice to use user_err. There is an example of
+ this in tuto0.
+*)
+
+(* -------------------------------------------------------------------------- *)
+(* *)
+(* How to implement a Vernacular command with (undoable) side-effects? *)
+(* *)
+(* -------------------------------------------------------------------------- *)
+
+(*
+ This command counts how many times it has been called since importing
+ our plugin, and signals that information to the user:
+ *)
+VERNAC COMMAND EXTEND Count CLASSIFIED AS SIDEFF
+| [ "Count" ] ->
+ {
+ Counter.increment ();
+ let v = Counter.value () in
+ Feedback.msg_notice (Pp.str "Times Count has been called: " ++ Pp.int v)
+ }
+END
+
+(*
+ --- Dependencies ---
+
+ If we want to use the ++ syntax, then we need to depend on Pp explicitly.
+ This is why, at the top, we write:
+
+ open Pp.
+
+ --- Defining the Counter ---
+
+ We define our counter in the Counter module. Please see counter.ml and
+ counter.mli for details.
+
+ As with Custom, we must modify our _CoqProject and tuto2_plugin.mlpack
+ so that we can use Counter in our code.
+
+ --- Classifying the Command ---
+
+ This command has undoable side-effects: When the plugin is first loaded,
+ the counter is instantiated to 0. After each time we call Count, the value of
+ the counter increases by 1.
+
+ Thus, we must write CLASSIFIED AS SIDEEFF for this command, rather than
+ CLASSIFIED AS QUERY. See the explanation from the NoOp command earlier if
+ you do not remember the distinction.
+
+ --- Calling the Command ---
+
+ We call our command three times in Demo.v by writing:
+
+ Count.
+ Count.
+ Count.
+
+ This gives us the following output:
+
+ Times Count has been called: 1
+ Times Count has been called: 2
+ Times Count has been called: 3
+
+ Note that when the plugin is first loaded, the counter is 0. It increases
+ each time Count is called.
+
+ --- Behavior with Imports ---
+
+ Count.v shows the behavior with imports. Note that if we import Demo.v,
+ the counter is set to 0 from the beginning, even though Demo.v calls
+ Count three times.
+
+ In other words, this is not persistent!
+*)
+
+(* -------------------------------------------------------------------------- *)
+(* *)
+(* How to implement a Vernacular command that uses persistent storage? *)
+(* *)
+(* -------------------------------------------------------------------------- *)
+
+(*
+ * This command is like Count, but it is persistent across modules:
+ *)
+VERNAC COMMAND EXTEND CountPersistent CLASSIFIED AS SIDEFF
+| [ "Count" "Persistent" ] ->
+ {
+ Persistent_counter.increment ();
+ let v = Persistent_counter.value () in
+ Feedback.msg_notice (Pp.str "Times Count Persistent has been called: " ++ Pp.int v)
+ }
+END
+
+(*
+ --- Persistent Storage ---
+
+ Everything is similar to the Count command, except that we use a counter
+ that is persistent. See persistent_counter.ml for details.
+
+ The key trick is that we must create a persistent object for our counter
+ to persist across modules. Coq has some useful APIs for this in Libobject.
+ We demonstrate these in persistent_counter.ml.
+
+ This is really, really useful if you want, for example, to cache some
+ results that your plugin computes across modules. A persistent object
+ can be a hashtable, for example, that maps inputs to outputs your command
+ has already computed, if you know the result will not change.
+
+ --- Calling the Command ---
+
+ We call the command in Demo.v and in Count.v, just like we did with Count.
+ Note that this time, the value of the counter from Demo.v persists in Count.v.
+*)
diff --git a/doc/plugin_tutorial/tuto2/src/persistent_counter.ml b/doc/plugin_tutorial/tuto2/src/persistent_counter.ml
new file mode 100644
index 0000000000..868f6ab99b
--- /dev/null
+++ b/doc/plugin_tutorial/tuto2/src/persistent_counter.ml
@@ -0,0 +1,56 @@
+(*
+ * This file defines our persistent counter, which we use in the
+ * CountPersistent command.
+ *)
+
+(*
+ * At its core, our persistent counter looks exactly the same as
+ * our non-persistent counter (with a different name to prevent collisions):
+ *)
+let counter = Summary.ref ~name:"persistent_counter" 0
+
+(*
+ * The difference is that we need to declare it as a persistent object
+ * using Libobject.declare_object. To do that, we define a function that
+ * saves the value that is passed to it into the reference we have just defined:
+ *)
+let cache_count (_, v) =
+ counter := v
+
+(*
+ * We then use declare_object to create a function that takes an integer value
+ * (the type our counter refers to) and creates a persistent object from that
+ * value:
+ *)
+let declare_counter : int -> Libobject.obj =
+ let open Libobject in
+ declare_object
+ {
+ (default_object "COUNTER") with
+ cache_function = cache_count;
+ load_function = (fun _ -> cache_count);
+ }
+(*
+ * See Libobject for more information on what other information you
+ * can pass here, and what all of these functions mean.
+ *
+ * For example, if we passed the same thing that we pass to load_function
+ * to open_function, then our last call to Count Persistent in Count.v
+ * would return 4 and not 6.
+ *)
+
+(*
+ * Incrementing our counter looks almost identical:
+ *)
+let increment () =
+ Lib.add_anonymous_leaf (declare_counter (succ !counter))
+(*
+ * except that we must call our declare_counter function to get a persistent
+ * object. We then pass this object to Lib.add_anonymous_leaf.
+ *)
+
+(*
+ * Reading a value does not change at all:
+ *)
+let value () =
+ !counter
diff --git a/doc/plugin_tutorial/tuto2/src/persistent_counter.mli b/doc/plugin_tutorial/tuto2/src/persistent_counter.mli
new file mode 100644
index 0000000000..d3c88e19a6
--- /dev/null
+++ b/doc/plugin_tutorial/tuto2/src/persistent_counter.mli
@@ -0,0 +1,14 @@
+(*
+ * This file defines our persistent counter, which we use in the
+ * CountPersistent command.
+ *)
+
+(*
+ * Increment the persistent counter
+ *)
+val increment : unit -> unit
+
+(*
+ * Determine the value of the persistent counter
+ *)
+val value : unit -> int
diff --git a/doc/plugin_tutorial/tuto2/src/tuto2_plugin.mlpack b/doc/plugin_tutorial/tuto2/src/tuto2_plugin.mlpack
new file mode 100644
index 0000000000..0bc7402978
--- /dev/null
+++ b/doc/plugin_tutorial/tuto2/src/tuto2_plugin.mlpack
@@ -0,0 +1,4 @@
+Custom
+Counter
+Persistent_counter
+G_tuto2
diff --git a/doc/plugin_tutorial/tuto2/theories/Count.v b/doc/plugin_tutorial/tuto2/theories/Count.v
new file mode 100644
index 0000000000..3287342b75
--- /dev/null
+++ b/doc/plugin_tutorial/tuto2/theories/Count.v
@@ -0,0 +1,19 @@
+Require Import Demo.
+
+(*** Local ***)
+
+Count.
+Count.
+
+Import Demo.
+
+Count.
+
+(*** Persistent ***)
+
+Count Persistent.
+Count Persistent.
+
+Import Demo.
+
+Count Persistent.
diff --git a/doc/plugin_tutorial/tuto2/theories/Demo.v b/doc/plugin_tutorial/tuto2/theories/Demo.v
new file mode 100644
index 0000000000..73b5fcca62
--- /dev/null
+++ b/doc/plugin_tutorial/tuto2/theories/Demo.v
@@ -0,0 +1,63 @@
+From Tuto2 Require Import Loader.
+
+(*** A no-op command ***)
+
+Nothing.
+
+(*** No-op commands with arguments ***)
+
+(*
+ * Terminal parameters:
+ *)
+Command With Some Terminal Parameters.
+(* Command. *) (* does not parse *)
+
+(*
+ * A single non-terminal argument:
+ *)
+Pass 42.
+(* Pass. *) (* does not parse *)
+(* Pass True. *) (* does not parse *)
+(* Pass 15 20. *) (* does not parse *)
+
+(*
+ * A list of non-terminal arguments:
+ *)
+Accept 100 200 300 400.
+Accept.
+Accept 2.
+
+(*
+ * A custom argument:
+ *)
+Foobar Foo.
+Foobar Bar.
+
+(*** Commands that give feedback ***)
+
+(*
+ * Simple feedback:
+ *)
+Is Everything Awesome.
+
+(*** Storage and side effects ***)
+
+(*
+ * Local side effects:
+ *)
+Count.
+Count.
+Count.
+(*
+ * See Count.v for behavior in modules that import this one.
+ *)
+
+(*
+ * Persistent side effects:
+ *)
+Count Persistent.
+Count Persistent.
+Count Persistent.
+(*
+ * See Count.v for behavior in modules that import this one.
+ *)
diff --git a/doc/plugin_tutorial/tuto2/theories/Loader.v b/doc/plugin_tutorial/tuto2/theories/Loader.v
new file mode 100644
index 0000000000..9ce9991c86
--- /dev/null
+++ b/doc/plugin_tutorial/tuto2/theories/Loader.v
@@ -0,0 +1 @@
+Declare ML Module "tuto2_plugin".
diff --git a/doc/plugin_tutorial/tuto2/theories/Test.v b/doc/plugin_tutorial/tuto2/theories/Test.v
deleted file mode 100644
index 38e83bfff1..0000000000
--- a/doc/plugin_tutorial/tuto2/theories/Test.v
+++ /dev/null
@@ -1,19 +0,0 @@
-Declare ML Module "demo_plugin".
-
-Cmd1.
-Cmd2 With Some Terminal Parameters.
-Cmd3 42.
-Cmd4 100 200 300 400.
-Cmd5 Foo_5.
-Cmd5 Bar_5.
-Cmd6.
-Cmd7.
-Cmd7.
-Cmd7.
-
-Goal True.
-Proof.
- tactic1.
- tactic2 Foo_2.
- tactic2 Bar_2.
-Abort.
diff --git a/doc/plugin_tutorial/tuto3/src/construction_game.ml b/doc/plugin_tutorial/tuto3/src/construction_game.ml
index 663113d012..2a2acb6001 100644
--- a/doc/plugin_tutorial/tuto3/src/construction_game.ml
+++ b/doc/plugin_tutorial/tuto3/src/construction_game.ml
@@ -3,15 +3,15 @@ open Context
let find_reference = Coqlib.find_reference [@ocaml.warning "-3"]
-let example_sort evd =
+let example_sort sigma =
(* creating a new sort requires that universes should be recorded
in the evd datastructure, so this datastructure also needs to be
passed around. *)
- let evd, s = Evd.new_sort_variable Evd.univ_rigid evd in
+ let sigma, s = Evd.new_sort_variable Evd.univ_rigid sigma in
let new_type = EConstr.mkSort s in
- evd, new_type
+ sigma, new_type
-let c_one evd =
+let c_one sigma =
(* In the general case, global references may refer to universe polymorphic
objects, and their universe has to be made afresh when creating an instance. *)
let gr_S =
@@ -19,129 +19,129 @@ let c_one evd =
(* the long name of "S" was found with the command "About S." *)
let gr_O =
find_reference "Tuto3" ["Coq"; "Init"; "Datatypes"] "O" in
- let evd, c_O = Evarutil.new_global evd gr_O in
- let evd, c_S = Evarutil.new_global evd gr_S in
+ let sigma, c_O = Evarutil.new_global sigma gr_O in
+ let sigma, c_S = Evarutil.new_global sigma gr_S in
(* Here is the construction of a new term by applying functions to argument. *)
- evd, EConstr.mkApp (c_S, [| c_O |])
+ sigma, EConstr.mkApp (c_S, [| c_O |])
-let dangling_identity env evd =
+let dangling_identity env sigma =
(* I call this a dangling identity, because it is not polymorph, but
the type on which it applies is left unspecified, as it is
represented by an existential variable. The declaration for this
existential variable needs to be added in the evd datastructure. *)
- let evd, type_type = example_sort evd in
- let evd, arg_type = Evarutil.new_evar env evd type_type in
+ let sigma, type_type = example_sort sigma in
+ let sigma, arg_type = Evarutil.new_evar env sigma type_type in
(* Notice the use of a De Bruijn index for the inner occurrence of the
bound variable. *)
- evd, EConstr.mkLambda(nameR (Names.Id.of_string "x"), arg_type,
+ sigma, EConstr.mkLambda(nameR (Names.Id.of_string "x"), arg_type,
EConstr.mkRel 1)
-let dangling_identity2 env evd =
+let dangling_identity2 env sigma =
(* This example uses directly a function that produces an evar that
is meant to be a type. *)
- let evd, (arg_type, type_type) =
- Evarutil.new_type_evar env evd Evd.univ_rigid in
- evd, EConstr.mkLambda(nameR (Names.Id.of_string "x"), arg_type,
+ let sigma, (arg_type, type_type) =
+ Evarutil.new_type_evar env sigma Evd.univ_rigid in
+ sigma, EConstr.mkLambda(nameR (Names.Id.of_string "x"), arg_type,
EConstr.mkRel 1)
let example_sort_app_lambda () =
let env = Global.env () in
- let evd = Evd.from_env env in
- let evd, c_v = c_one evd in
+ let sigma = Evd.from_env env in
+ let sigma, c_v = c_one sigma in
(* dangling_identity and dangling_identity2 can be used interchangeably here *)
- let evd, c_f = dangling_identity2 env evd in
+ let sigma, c_f = dangling_identity2 env sigma in
let c_1 = EConstr.mkApp (c_f, [| c_v |]) in
let _ = Feedback.msg_notice
- (Printer.pr_econstr_env env evd c_1) in
+ (Printer.pr_econstr_env env sigma c_1) in
(* type verification happens here. Type verification will update
existential variable information in the evd part. *)
- let evd, the_type = Typing.type_of env evd c_1 in
+ let sigma, the_type = Typing.type_of env sigma c_1 in
(* At display time, you will notice that the system knows about the
existential variable being instantiated to the "nat" type, even
though c_1 still contains the meta-variable. *)
Feedback.msg_notice
- ((Printer.pr_econstr_env env evd c_1) ++
+ ((Printer.pr_econstr_env env sigma c_1) ++
str " has type " ++
- (Printer.pr_econstr_env env evd the_type))
+ (Printer.pr_econstr_env env sigma the_type))
-let c_S evd =
+let c_S sigma =
let gr = find_reference "Tuto3" ["Coq"; "Init"; "Datatypes"] "S" in
- Evarutil.new_global evd gr
+ Evarutil.new_global sigma gr
-let c_O evd =
+let c_O sigma =
let gr = find_reference "Tuto3" ["Coq"; "Init"; "Datatypes"] "O" in
- Evarutil.new_global evd gr
+ Evarutil.new_global sigma gr
-let c_E evd =
+let c_E sigma =
let gr = find_reference "Tuto3" ["Tuto3"; "Data"] "EvenNat" in
- Evarutil.new_global evd gr
+ Evarutil.new_global sigma gr
-let c_D evd =
+let c_D sigma =
let gr = find_reference "Tuto3" ["Tuto3"; "Data"] "tuto_div2" in
- Evarutil.new_global evd gr
+ Evarutil.new_global sigma gr
-let c_Q evd =
+let c_Q sigma =
let gr = find_reference "Tuto3" ["Coq"; "Init"; "Logic"] "eq" in
- Evarutil.new_global evd gr
+ Evarutil.new_global sigma gr
-let c_R evd =
+let c_R sigma =
let gr = find_reference "Tuto3" ["Coq"; "Init"; "Logic"] "eq_refl" in
- Evarutil.new_global evd gr
+ Evarutil.new_global sigma gr
-let c_N evd =
+let c_N sigma =
let gr = find_reference "Tuto3" ["Coq"; "Init"; "Datatypes"] "nat" in
- Evarutil.new_global evd gr
+ Evarutil.new_global sigma gr
-let c_C evd =
+let c_C sigma =
let gr = find_reference "Tuto3" ["Tuto3"; "Data"] "C" in
- Evarutil.new_global evd gr
+ Evarutil.new_global sigma gr
-let c_F evd =
+let c_F sigma =
let gr = find_reference "Tuto3" ["Tuto3"; "Data"] "S_ev" in
- Evarutil.new_global evd gr
+ Evarutil.new_global sigma gr
-let c_P evd =
+let c_P sigma =
let gr = find_reference "Tuto3" ["Tuto3"; "Data"] "s_half_proof" in
- Evarutil.new_global evd gr
+ Evarutil.new_global sigma gr
(* If c_S was universe polymorphic, we should have created a new constant
at each iteration of buildup. *)
-let mk_nat evd n =
- let evd, c_S = c_S evd in
- let evd, c_O = c_O evd in
+let mk_nat sigma n =
+ let sigma, c_S = c_S sigma in
+ let sigma, c_O = c_O sigma in
let rec buildup = function
| 0 -> c_O
| n -> EConstr.mkApp (c_S, [| buildup (n - 1) |]) in
- if n <= 0 then evd, c_O else evd, buildup n
+ if n <= 0 then sigma, c_O else sigma, buildup n
let example_classes n =
let env = Global.env () in
- let evd = Evd.from_env env in
- let evd, c_n = mk_nat evd n in
- let evd, n_half = mk_nat evd (n / 2) in
- let evd, c_N = c_N evd in
- let evd, c_div = c_D evd in
- let evd, c_even = c_E evd in
- let evd, c_Q = c_Q evd in
- let evd, c_R = c_R evd in
+ let sigma = Evd.from_env env in
+ let sigma, c_n = mk_nat sigma n in
+ let sigma, n_half = mk_nat sigma (n / 2) in
+ let sigma, c_N = c_N sigma in
+ let sigma, c_div = c_D sigma in
+ let sigma, c_even = c_E sigma in
+ let sigma, c_Q = c_Q sigma in
+ let sigma, c_R = c_R sigma in
let arg_type = EConstr.mkApp (c_even, [| c_n |]) in
- let evd0 = evd in
- let evd, instance = Evarutil.new_evar env evd arg_type in
+ let sigma0 = sigma in
+ let sigma, instance = Evarutil.new_evar env sigma arg_type in
let c_half = EConstr.mkApp (c_div, [|c_n; instance|]) in
- let _ = Feedback.msg_notice (Printer.pr_econstr_env env evd c_half) in
- let evd, the_type = Typing.type_of env evd c_half in
- let _ = Feedback.msg_notice (Printer.pr_econstr_env env evd c_half) in
+ let _ = Feedback.msg_notice (Printer.pr_econstr_env env sigma c_half) in
+ let sigma, the_type = Typing.type_of env sigma c_half in
+ let _ = Feedback.msg_notice (Printer.pr_econstr_env env sigma c_half) in
let proved_equality =
EConstr.mkCast(EConstr.mkApp (c_R, [| c_N; c_half |]), Constr.DEFAULTcast,
EConstr.mkApp (c_Q, [| c_N; c_half; n_half|])) in
(* This is where we force the system to compute with type classes. *)
(* Question to coq developers: why do we pass two evd arguments to
- solve_remaining_evars? Is the choice of evd0 relevant here? *)
- let evd = Pretyping.solve_remaining_evars
- (Pretyping.default_inference_flags true) env evd ~initial:evd0 in
- let evd, final_type = Typing.type_of env evd proved_equality in
- Feedback.msg_notice (Printer.pr_econstr_env env evd proved_equality)
+ solve_remaining_evars? Is the choice of sigma0 relevant here? *)
+ let sigma = Pretyping.solve_remaining_evars
+ (Pretyping.default_inference_flags true) env sigma ~initial:sigma0 in
+ let sigma, final_type = Typing.type_of env sigma proved_equality in
+ Feedback.msg_notice (Printer.pr_econstr_env env sigma proved_equality)
(* This function, together with definitions in Data.v, shows how to
trigger automatic proofs at the time of typechecking, based on
@@ -152,36 +152,36 @@ let example_classes n =
*)
let example_canonical n =
let env = Global.env () in
- let evd = Evd.from_env env in
+ let sigma = Evd.from_env env in
(* Construct a natural representation of this integer. *)
- let evd, c_n = mk_nat evd n in
+ let sigma, c_n = mk_nat sigma n in
(* terms for "nat", "eq", "S_ev", "eq_refl", "C" *)
- let evd, c_N = c_N evd in
- let evd, c_F = c_F evd in
- let evd, c_R = c_R evd in
- let evd, c_C = c_C evd in
- let evd, c_P = c_P evd in
+ let sigma, c_N = c_N sigma in
+ let sigma, c_F = c_F sigma in
+ let sigma, c_R = c_R sigma in
+ let sigma, c_C = c_C sigma in
+ let sigma, c_P = c_P sigma in
(* the last argument of C *)
let refl_term = EConstr.mkApp (c_R, [|c_N; c_n |]) in
(* Now we build two existential variables, for the value of the half and for
the "S_ev" structure that triggers the proof search. *)
- let evd, ev1 = Evarutil.new_evar env evd c_N in
+ let sigma, ev1 = Evarutil.new_evar env sigma c_N in
(* This is the type for the second existential variable *)
let csev = EConstr.mkApp (c_F, [| ev1 |]) in
- let evd, ev2 = Evarutil.new_evar env evd csev in
+ let sigma, ev2 = Evarutil.new_evar env sigma csev in
(* Now we build the C structure. *)
let test_term = EConstr.mkApp (c_C, [| c_n; ev1; ev2; refl_term |]) in
(* Type-checking this term will compute values for the existential variables *)
- let evd, final_type = Typing.type_of env evd test_term in
+ let sigma, final_type = Typing.type_of env sigma test_term in
(* The computed type has two parameters, the second one is the proof. *)
- let value = match EConstr.kind evd final_type with
+ let value = match EConstr.kind sigma final_type with
| Constr.App(_, [| _; the_half |]) -> the_half
| _ -> failwith "expecting the whole type to be \"cmp _ the_half\"" in
- let _ = Feedback.msg_notice (Printer.pr_econstr_env env evd value) in
+ let _ = Feedback.msg_notice (Printer.pr_econstr_env env sigma value) in
(* I wish for a nicer way to get the value of ev2 in the evar_map *)
- let prf_struct = EConstr.of_constr (EConstr.to_constr evd ev2) in
+ let prf_struct = EConstr.of_constr (EConstr.to_constr sigma ev2) in
let the_prf = EConstr.mkApp (c_P, [| ev1; prf_struct |]) in
- let evd, the_statement = Typing.type_of env evd the_prf in
+ let sigma, the_statement = Typing.type_of env sigma the_prf in
Feedback.msg_notice
- (Printer.pr_econstr_env env evd the_prf ++ str " has type " ++
- Printer.pr_econstr_env env evd the_statement)
+ (Printer.pr_econstr_env env sigma the_prf ++ str " has type " ++
+ Printer.pr_econstr_env env sigma the_statement)
diff --git a/doc/plugin_tutorial/tuto3/src/g_tuto3.mlg b/doc/plugin_tutorial/tuto3/src/g_tuto3.mlg
index f4d9e7fd5b..14b8eb5f07 100644
--- a/doc/plugin_tutorial/tuto3/src/g_tuto3.mlg
+++ b/doc/plugin_tutorial/tuto3/src/g_tuto3.mlg
@@ -14,13 +14,13 @@ open Stdarg
VERNAC COMMAND EXTEND ShowTypeConstruction CLASSIFIED AS QUERY
| [ "Tuto3_1" ] ->
{ let env = Global.env () in
- let evd = Evd.from_env env in
- let evd, s = Evd.new_sort_variable Evd.univ_rigid evd in
+ let sigma = Evd.from_env env in
+ let sigma, s = Evd.new_sort_variable Evd.univ_rigid sigma in
let new_type_2 = EConstr.mkSort s in
- let evd, _ =
+ let sigma, _ =
Typing.type_of (Global.env()) (Evd.from_env (Global.env())) new_type_2 in
Feedback.msg_notice
- (Printer.pr_econstr_env env evd new_type_2) }
+ (Printer.pr_econstr_env env sigma new_type_2) }
END
VERNAC COMMAND EXTEND ShowOneConstruction CLASSIFIED AS QUERY
diff --git a/doc/plugin_tutorial/tuto3/src/tuto_tactic.ml b/doc/plugin_tutorial/tuto3/src/tuto_tactic.ml
index 2d541087ce..796a65f40d 100644
--- a/doc/plugin_tutorial/tuto3/src/tuto_tactic.ml
+++ b/doc/plugin_tutorial/tuto3/src/tuto_tactic.ml
@@ -65,10 +65,10 @@ let package i = Goal.enter begin fun gl ->
and return the value a. *)
(* Remark by Maxime: look for destApp combinator. *)
-let unpack_type evd term =
+let unpack_type sigma term =
let report () =
CErrors.user_err (Pp.str "expecting a packed type") in
- match EConstr.kind evd term with
+ match EConstr.kind sigma term with
| Constr.App (_, [| ty |]) -> ty
| _ -> report ()
@@ -76,19 +76,19 @@ let unpack_type evd term =
A -> pack B -> C and return A, B, C
but it is not used in the current version of our tactic.
It is kept as an example. *)
-let two_lambda_pattern evd term =
+let two_lambda_pattern sigma term =
let report () =
CErrors.user_err (Pp.str "expecting two nested implications") in
(* Note that pattern-matching is always done through the EConstr.kind function,
which only provides one-level deep patterns. *)
- match EConstr.kind evd term with
+ match EConstr.kind sigma term with
(* Here we recognize the outer implication *)
| Constr.Prod (_, ty1, l1) ->
(* Here we recognize the inner implication *)
- (match EConstr.kind evd l1 with
+ (match EConstr.kind sigma l1 with
| Constr.Prod (n2, packed_ty2, deep_conclusion) ->
(* Here we recognized that the second type is an application *)
- ty1, unpack_type evd packed_ty2, deep_conclusion
+ ty1, unpack_type sigma packed_ty2, deep_conclusion
| _ -> report ())
| _ -> report ()
@@ -104,22 +104,22 @@ let get_type_of_hyp env id =
let repackage i h_hyps_id = Goal.enter begin fun gl ->
let env = Goal.env gl in
- let evd = Tacmach.New.project gl in
+ let sigma = Tacmach.New.project gl in
let concl = Tacmach.New.pf_concl gl in
let (ty1 : EConstr.t) = get_type_of_hyp env i in
let (packed_ty2 : EConstr.t) = get_type_of_hyp env h_hyps_id in
- let ty2 = unpack_type evd packed_ty2 in
+ let ty2 = unpack_type sigma packed_ty2 in
let new_packed_type = EConstr.mkApp (c_P (), [| ty1; ty2 |]) in
let open EConstr in
let new_packed_value =
mkApp (c_R (), [| ty1; ty2; mkVar i;
mkApp (c_U (), [| ty2; mkVar h_hyps_id|]) |]) in
- Refine.refine ~typecheck:true begin fun evd ->
- let evd, new_goal = Evarutil.new_evar env evd
+ Refine.refine ~typecheck:true begin fun sigma ->
+ let sigma, new_goal = Evarutil.new_evar env sigma
(mkArrowR (mkApp(c_H (), [| new_packed_type |]))
(Vars.lift 1 concl))
in
- evd, mkApp (new_goal,
+ sigma, mkApp (new_goal,
[|mkApp(c_M (), [|new_packed_type; new_packed_value |]) |])
end
end
diff --git a/doc/sphinx/_static/ansi-dark.css b/doc/sphinx/_static/ansi-dark.css
index a564fd70bb..bbace7c553 100644
--- a/doc/sphinx/_static/ansi-dark.css
+++ b/doc/sphinx/_static/ansi-dark.css
@@ -1,6 +1,6 @@
/************************************************************************/
/* * The Coq Proof Assistant / The Coq Development Team */
-/* v * INRIA, CNRS and contributors - Copyright 1999-2018 */
+/* v * INRIA, CNRS and contributors - Copyright 1999-2019 */
/* <O___,, * (see CREDITS file for the list of authors) */
/* \VV/ **************************************************************/
/* // * This file is distributed under the terms of the */
diff --git a/doc/sphinx/_static/ansi.css b/doc/sphinx/_static/ansi.css
index 26bd797709..b3b5341166 100644
--- a/doc/sphinx/_static/ansi.css
+++ b/doc/sphinx/_static/ansi.css
@@ -1,6 +1,6 @@
/************************************************************************/
/* * The Coq Proof Assistant / The Coq Development Team */
-/* v * INRIA, CNRS and contributors - Copyright 1999-2018 */
+/* v * INRIA, CNRS and contributors - Copyright 1999-2019 */
/* <O___,, * (see CREDITS file for the list of authors) */
/* \VV/ **************************************************************/
/* // * This file is distributed under the terms of the */
diff --git a/doc/sphinx/_static/coqdoc.css b/doc/sphinx/_static/coqdoc.css
index bbcc044a20..7a3d59d4c0 100644
--- a/doc/sphinx/_static/coqdoc.css
+++ b/doc/sphinx/_static/coqdoc.css
@@ -1,6 +1,6 @@
/************************************************************************/
/* * The Coq Proof Assistant / The Coq Development Team */
-/* v * INRIA, CNRS and contributors - Copyright 1999-2018 */
+/* v * INRIA, CNRS and contributors - Copyright 1999-2019 */
/* <O___,, * (see CREDITS file for the list of authors) */
/* \VV/ **************************************************************/
/* // * This file is distributed under the terms of the */
diff --git a/doc/sphinx/_static/notations.css b/doc/sphinx/_static/notations.css
index 8322ab0137..4a5fa0b328 100644
--- a/doc/sphinx/_static/notations.css
+++ b/doc/sphinx/_static/notations.css
@@ -1,6 +1,6 @@
/************************************************************************/
/* * The Coq Proof Assistant / The Coq Development Team */
-/* v * INRIA, CNRS and contributors - Copyright 1999-2018 */
+/* v * INRIA, CNRS and contributors - Copyright 1999-2019 */
/* <O___,, * (see CREDITS file for the list of authors) */
/* \VV/ **************************************************************/
/* // * This file is distributed under the terms of the */
diff --git a/doc/sphinx/_static/notations.js b/doc/sphinx/_static/notations.js
index eb7f211e8b..63112312d0 100644
--- a/doc/sphinx/_static/notations.js
+++ b/doc/sphinx/_static/notations.js
@@ -1,6 +1,6 @@
/************************************************************************/
/* * The Coq Proof Assistant / The Coq Development Team */
-/* v * INRIA, CNRS and contributors - Copyright 1999-2018 */
+/* v * INRIA, CNRS and contributors - Copyright 1999-2019 */
/* <O___,, * (see CREDITS file for the list of authors) */
/* \VV/ **************************************************************/
/* // * This file is distributed under the terms of the */
diff --git a/doc/sphinx/_static/pre-text.css b/doc/sphinx/_static/pre-text.css
index 38d81abefe..9d133fb1aa 100644
--- a/doc/sphinx/_static/pre-text.css
+++ b/doc/sphinx/_static/pre-text.css
@@ -1,6 +1,6 @@
/************************************************************************/
/* * The Coq Proof Assistant / The Coq Development Team */
-/* v * INRIA, CNRS and contributors - Copyright 1999-2018 */
+/* v * INRIA, CNRS and contributors - Copyright 1999-2019 */
/* <O___,, * (see CREDITS file for the list of authors) */
/* \VV/ **************************************************************/
/* // * This file is distributed under the terms of the */
diff --git a/doc/sphinx/addendum/extended-pattern-matching.rst b/doc/sphinx/addendum/extended-pattern-matching.rst
index e882ce6e88..b568160356 100644
--- a/doc/sphinx/addendum/extended-pattern-matching.rst
+++ b/doc/sphinx/addendum/extended-pattern-matching.rst
@@ -21,10 +21,10 @@ type is considered to be a variable. A variable name cannot occur more
than once in a given pattern. It is recommended to start variable
names by a lowercase letter.
-If a pattern has the form ``(c x)`` where ``c`` is a constructor symbol and x
+If a pattern has the form ``c x`` where ``c`` is a constructor symbol and x
is a linear vector of (distinct) variables, it is called *simple*: it
is the kind of pattern recognized by the basic version of match. On
-the opposite, if it is a variable ``x`` or has the form ``(c p)`` with ``p`` not
+the opposite, if it is a variable ``x`` or has the form ``c p`` with ``p`` not
only made of variables, the pattern is called *nested*.
A variable pattern matches any value, and the identifier is bound to
@@ -216,7 +216,8 @@ Here is an example:
end.
-Here is another example using disjunctive subpatterns.
+Nested disjunctive patterns are allowed, inside parentheses, with the
+notation :n:`({+| @pattern})`, as in:
.. coqtop:: in
diff --git a/doc/sphinx/addendum/generalized-rewriting.rst b/doc/sphinx/addendum/generalized-rewriting.rst
index 68f6d4008a..2ea0861e47 100644
--- a/doc/sphinx/addendum/generalized-rewriting.rst
+++ b/doc/sphinx/addendum/generalized-rewriting.rst
@@ -528,7 +528,7 @@ pass additional arguments such as ``using relation``.
.. tacv:: setoid_reflexivity
setoid_symmetry {? in @ident}
setoid_transitivity
- setoid_rewrite {? @orientation} @term {? at @occs} {? in @ident}
+ setoid_rewrite {? @orientation} @term {? at @occurrences} {? in @ident}
setoid_replace @term with @term {? using relation @term} {? in @ident} {? by @tactic}
:name: setoid_reflexivity; setoid_symmetry; setoid_transitivity; setoid_rewrite; setoid_replace
@@ -563,17 +563,18 @@ Printing relations and morphisms
of morphisms, the :cmd:`Print Instances` command can be useful to understand
what additional morphisms should be registered.
+.. _deprecated_syntax_for_generalized_rewriting:
Deprecated syntax and backward incompatibilities
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. cmd:: Add Setoid @A @Aeq @ST as @ident
+.. cmd:: Add Setoid @qualid__1 @qualid__2 @qualid__3 as @ident
This command for declaring setoids and morphisms is also accepted due
to backward compatibility reasons.
- Here ``Aeq`` is a congruence relation without parameters, ``A`` is its carrier
- and ``ST`` is an object of type (``Setoid_Theory A Aeq``) (i.e. a record
+ Here :n:`@qualid__2` is a congruence relation without parameters, :n:`@qualid__1` is its carrier
+ and :n:`@qualid__3` is an object of type (:n:`Setoid_Theory @qualid__1 @qualid__2`) (i.e. a record
packing together the reflexivity, symmetry and transitivity lemmas).
Notice that the syntax is not completely backward compatible since the
identifier was not required.
@@ -589,6 +590,12 @@ Deprecated syntax and backward incompatibilities
bi-implication in place of a simple implication. In practice, porting
an old development to the new semantics is usually quite simple.
+.. cmd:: Declare Morphism @ident : @ident
+ :name: Declare Morphism
+
+ This commands is to be used in a module type to declare a parameter that
+ is a morphism.
+
Notice that several limitations of the old implementation have been
lifted. In particular, it is now possible to declare several relations
with the same carrier and several signatures for the same morphism.
@@ -708,91 +715,65 @@ Definitions
The generalized rewriting tactic is based on a set of strategies that can be
combined to obtain custom rewriting procedures. Its set of strategies is based
on Elan’s rewriting strategies :cite:`Luttik97specificationof`. Rewriting
-strategies are applied using the tactic ``rewrite_strat s`` where ``s`` is a
+strategies are applied using the tactic :n:`rewrite_strat @strategy` where :token:`strategy` is a
strategy expression. Strategies are defined inductively as described by the
following grammar:
-.. productionlist:: rewriting
- s, t, u : `strategy`
- : `lemma`
- : `lemma_right_to_left`
- : `failure`
- : `identity`
- : `reflexivity`
- : `progress`
- : `failure_catch`
- : `composition`
- : `left_biased_choice`
- : `iteration_one_or_more`
- : `iteration_zero_or_more`
- : `one_subterm`
- : `all_subterms`
- : `innermost_first`
- : `outermost_first`
- : `bottom_up`
- : `top_down`
- : `apply_hint`
- : `any_of_the_terms`
- : `apply_reduction`
- : `fold_expression`
-
-.. productionlist:: rewriting
- strategy : ( `s` )
- lemma : `c`
- lemma_right_to_left : <- `c`
- failure : fail
- identity : id
- reflexivity : refl
- progress : progress `s`
- failure_catch : try `s`
- composition : `s` ; `u`
- left_biased_choice : choice `s` `t`
- iteration_one_or_more : repeat `s`
- iteration_zero_or_more : any `s`
- one_subterm : subterm `s`
- all_subterms : subterms `s`
- innermost_first : innermost `s`
- outermost_first : outermost `s`
- bottom_up : bottomup `s`
- top_down : topdown `s`
- apply_hint : hints `hintdb`
- any_of_the_terms : terms (`c`)+
- apply_reduction : eval `redexpr`
- fold_expression : fold `c`
-
+.. productionlist:: coq
+ strategy : `qualid` (lemma, left to right)
+ : <- `qualid` (lemma, right to left)
+ : fail (failure)
+ : id (identity)
+ : refl (reflexivity)
+ : progress `strategy` (progress)
+ : try `strategy` (try catch)
+ : `strategy` ; `strategy` (composition)
+ : choice `strategy` `strategy` (left_biased_choice)
+ : repeat `strategy` (one or more)
+ : any `strategy` (zero or more)
+ : subterm `strategy` (one subterm)
+ : subterms `strategy` (all subterms)
+ : innermost `strategy` (innermost first)
+ : outermost `strategy` (outermost first)
+ : bottomup `strategy` (bottom-up)
+ : topdown `strategy` (top-down)
+ : hints `ident` (apply hints from hint database)
+ : terms `term` ... `term` (any of the terms)
+ : eval `redexpr` (apply reduction)
+ : fold `term` (unify)
+ : ( `strategy` )
Actually a few of these are defined in term of the others using a
primitive fixpoint operator:
-.. productionlist:: rewriting
- try `s` : choice `s` `id`
- any `s` : fix `u`. try (`s` ; `u`)
- repeat `s` : `s` ; any `s`
- bottomup s : fix `bu`. (choice (progress (subterms bu)) s) ; try bu
- topdown s : fix `td`. (choice s (progress (subterms td))) ; try td
- innermost s : fix `i`. (choice (subterm i) s)
- outermost s : fix `o`. (choice s (subterm o))
+- :n:`try @strategy := choice @strategy id`
+- :n:`any @strategy := fix @ident. try (@strategy ; @ident)`
+- :n:`repeat @strategy := @strategy; any @strategy`
+- :n:`bottomup @strategy := fix @ident. (choice (progress (subterms @ident)) @strategy) ; try @ident`
+- :n:`topdown @strategy := fix @ident. (choice @strategy (progress (subterms @ident))) ; try @ident`
+- :n:`innermost @strategy := fix @ident. (choice (subterm @ident) @strategy)`
+- :n:`outermost @strategy := fix @ident. (choice @strategy (subterm @ident))`
The basic control strategy semantics are straightforward: strategies
are applied to subterms of the term to rewrite, starting from the root
of the term. The lemma strategies unify the left-hand-side of the
lemma with the current subterm and on success rewrite it to the right-
hand-side. Composition can be used to continue rewriting on the
-current subterm. The fail strategy always fails while the identity
+current subterm. The ``fail`` strategy always fails while the identity
strategy succeeds without making progress. The reflexivity strategy
succeeds, making progress using a reflexivity proof of rewriting.
-Progress tests progress of the argument strategy and fails if no
+``progress`` tests progress of the argument :token:`strategy` and fails if no
progress was made, while ``try`` always succeeds, catching failures.
-Choice is left-biased: it will launch the first strategy and fall back
+``choice`` is left-biased: it will launch the first strategy and fall back
on the second one in case of failure. One can iterate a strategy at
least 1 time using ``repeat`` and at least 0 times using ``any``.
-The ``subterm`` and ``subterms`` strategies apply their argument strategy ``s`` to
+The ``subterm`` and ``subterms`` strategies apply their argument :token:`strategy` to
respectively one or all subterms of the current term under
consideration, left-to-right. ``subterm`` stops at the first subterm for
-which ``s`` made progress. The composite strategies ``innermost`` and ``outermost``
+which :token:`strategy` made progress. The composite strategies ``innermost`` and ``outermost``
perform a single innermost or outermost rewrite using their argument
-strategy. Their counterparts ``bottomup`` and ``topdown`` perform as many
+:token:`strategy`. Their counterparts ``bottomup`` and ``topdown`` perform as many
rewritings as possible, starting from the bottom or the top of the
term.
@@ -802,15 +783,15 @@ lemmas at the current subterm. The ``terms`` strategy takes the lemma
names directly as arguments. The ``eval`` strategy expects a reduction
expression (see :ref:`performingcomputations`) and succeeds
if it reduces the subterm under consideration. The ``fold`` strategy takes
-a term ``c`` and tries to *unify* it to the current subterm, converting it to ``c``
-on success, it is stronger than the tactic ``fold``.
+a :token:`term` and tries to *unify* it to the current subterm, converting it to :token:`term`
+on success. It is stronger than the tactic ``fold``.
Usage
~~~~~
-.. tacn:: rewrite_strat @s {? in @ident }
+.. tacn:: rewrite_strat @strategy {? in @ident }
:name: rewrite_strat
Rewrite using the strategy s in hypothesis ident or the conclusion.
diff --git a/doc/sphinx/addendum/program.rst b/doc/sphinx/addendum/program.rst
index 22ddcae584..45c74ab02a 100644
--- a/doc/sphinx/addendum/program.rst
+++ b/doc/sphinx/addendum/program.rst
@@ -299,9 +299,9 @@ optional tactic is replaced by the default one if not specified.
Displays all remaining obligations.
-.. cmd:: Obligation num {? of @ident}
+.. cmd:: Obligation @num {? of @ident}
- Start the proof of obligation num.
+ Start the proof of obligation :token:`num`.
.. cmd:: Next Obligation {? of @ident}
diff --git a/doc/sphinx/addendum/ring.rst b/doc/sphinx/addendum/ring.rst
index 3b350d5dc0..3f4d5cc784 100644
--- a/doc/sphinx/addendum/ring.rst
+++ b/doc/sphinx/addendum/ring.rst
@@ -310,10 +310,10 @@ The syntax for adding a new ring is
.. productionlist:: coq
ring_mod : abstract | decidable `term` | morphism `term`
: setoid `term` `term`
- : constants [`ltac`]
- : preprocess [`ltac`]
- : postprocess [`ltac`]
- : power_tac `term` [`ltac`]
+ : constants [ `tactic` ]
+ : preprocess [ `tactic` ]
+ : postprocess [ `tactic` ]
+ : power_tac `term` [ `tactic` ]
: sign `term`
: div `term`
@@ -341,31 +341,31 @@ The syntax for adding a new ring is
This modifier needs not be used if the setoid and morphisms have been
declared.
- constants [ :n:`@ltac` ]
- specifies a tactic expression :n:`@ltac` that, given a
+ constants [ :n:`@tactic` ]
+ specifies a tactic expression :n:`@tactic` that, given a
term, returns either an object of the coefficient set that is mapped
to the expression via the morphism, or returns
``InitialRing.NotConstant``. The default behavior is to map only 0 and 1
to their counterpart in the coefficient set. This is generally not
desirable for non trivial computational rings.
- preprocess [ :n:`@ltac` ]
- specifies a tactic :n:`@ltac` that is applied as a
+ preprocess [ :n:`@tactic` ]
+ specifies a tactic :n:`@tactic` that is applied as a
preliminary step for :tacn:`ring` and :tacn:`ring_simplify`. It can be used to
transform a goal so that it is better recognized. For instance, ``S n``
can be changed to ``plus 1 n``.
- postprocess [ :n:`@ltac` ]
- specifies a tactic :n:`@ltac` that is applied as a final
+ postprocess [ :n:`@tactic` ]
+ specifies a tactic :n:`@tactic` that is applied as a final
step for :tacn:`ring_simplify`. For instance, it can be used to undo
modifications of the preprocessor.
- power_tac :n:`@term` [ :n:`@ltac` ]
+ power_tac :n:`@term` [ :n:`@tactic` ]
allows :tacn:`ring` and :tacn:`ring_simplify` to recognize
power expressions with a constant positive integer exponent (example:
:math:`x^2` ). The term :n:`@term` is a proof that a given power function satisfies
the specification of a power function (term has to be a proof of
- ``Ring_theory.power_theory``) and :n:`@ltac` specifies a tactic expression
+ ``Ring_theory.power_theory``) and :n:`@tactic` specifies a tactic expression
that, given a term, “abstracts” it into an object of type |N| whose
interpretation via ``Cp_phi`` (the evaluation function of power
coefficient) is the original term, or returns ``InitialRing.NotConstant``
diff --git a/doc/sphinx/addendum/universe-polymorphism.rst b/doc/sphinx/addendum/universe-polymorphism.rst
index 1aa2111816..395b5ce2d3 100644
--- a/doc/sphinx/addendum/universe-polymorphism.rst
+++ b/doc/sphinx/addendum/universe-polymorphism.rst
@@ -366,24 +366,32 @@ The syntax has been extended to allow users to explicitly bind names
to universes and explicitly instantiate polymorphic definitions.
.. cmd:: Universe @ident
+ Polymorphic Universe @ident
In the monorphic case, this command declares a new global universe
named :g:`ident`, which can be referred to using its qualified name
as well. Global universe names live in a separate namespace. The
- command supports the polymorphic flag only in sections, meaning the
+ command supports the ``Polymorphic`` flag only in sections, meaning the
universe quantification will be discharged on each section definition
independently. One cannot mix polymorphic and monomorphic
declarations in the same section.
-.. cmd:: Constraint @ident @ord @ident
+.. cmd:: Constraint @universe_constraint
+ Polymorphic Constraint @universe_constraint
- This command declares a new constraint between named universes. The
- order relation :n:`@ord` can be one of :math:`<`, :math:`≤` or :math:`=`. If consistent, the constraint
- is then enforced in the global environment. Like ``Universe``, it can be
- used with the ``Polymorphic`` prefix in sections only to declare
- constraints discharged at section closing time. One cannot declare a
- global constraint on polymorphic universes.
+ This command declares a new constraint between named universes.
+
+ .. productionlist:: coq
+ universe_constraint : `qualid` < `qualid`
+ : `qualid` <= `qualid`
+ : `qualid` = `qualid`
+
+ If consistent, the constraint is then enforced in the global
+ environment. Like :cmd:`Universe`, it can be used with the
+ ``Polymorphic`` prefix in sections only to declare constraints
+ discharged at section closing time. One cannot declare a global
+ constraint on polymorphic universes.
.. exn:: Undeclared universe @ident.
:undocumented:
diff --git a/doc/sphinx/changes.rst b/doc/sphinx/changes.rst
index 701c62cdce..fd84868a1f 100644
--- a/doc/sphinx/changes.rst
+++ b/doc/sphinx/changes.rst
@@ -120,7 +120,9 @@ reference manual. Here are the most important user-visible changes:
- CoqIDE:
- - CoqIDE now depends on gtk+3 and lablgtk3 instead of gtk+2 and lablgtk2
+ - CoqIDE now depends on gtk+3 and lablgtk3 instead of gtk+2 and lablgtk2.
+ The INSTALL file available in the Coq sources has been updated to list
+ the new dependencies
(`#9279 <https://github.com/coq/coq/pull/9279>`_,
by Hugo Herbelin, with help from Jacques Garrigue,
Emilio Jesús Gallego Arias, Michael Sogetrop and Vincent Laporte).
@@ -525,7 +527,13 @@ Other changes in 8.10+beta1
(`#9829 <https://github.com/coq/coq/pull/9829>`_, by Vincent Laporte).
- :cmd:`Coercion` does not warn ambiguous paths which are obviously
- convertible with existing ones
+ convertible with existing ones. The ambiguous paths messages have been
+ turned to warnings, thus now they could appear in the output of ``coqc``.
+ The convertibility checking procedure for coercion paths is complete for
+ paths consisting of coercions satisfying the uniform inheritance condition,
+ but some coercion paths could be reported as ambiguous even if they are
+ convertible with existing ones when they have coercions that don't satisfy
+ the uniform inheritance condition
(`#9743 <https://github.com/coq/coq/pull/9743>`_,
closes `#3219 <https://github.com/coq/coq/issues/3219>`_,
by Kazuhiko Sakaguchi).
@@ -596,6 +604,52 @@ Other changes in 8.10+beta1
with help and ideas from Emilio Jesús Gallego Arias, Gaëtan
Gilbert, Clément Pit-Claudel, Matthieu Sozeau, and Enrico Tassi).
+Changes in 8.10+beta2
+~~~~~~~~~~~~~~~~~~~~~
+
+Many bug fixes and documentation improvements, in particular:
+
+**Tactics**
+
+- Make the :tacn:`discriminate` tactic work together with
+ :flag:`Universe Polymorphism` and equality in :g:`Type`. This,
+ in particular, makes :tacn:`discriminate` compatible with the HoTT
+ library https://github.com/HoTT/HoTT
+ (`#10205 <https://github.com/coq/coq/pull/10205>`_,
+ by Andreas Lynge, review by Pierre-Marie Pédrot and Matthieu Sozeau).
+
+**SSReflect**
+
+- Make the ``case E: t`` tactic work together with
+ :flag:`Universe Polymorphism` and equality in :g:`Type`.
+ This makes :tacn:`case <case (ssreflect)>` compatible with the HoTT
+ library https://github.com/HoTT/HoTT
+ (`#10302 <https://github.com/coq/coq/pull/10302>`_,
+ fixes `#10301 <https://github.com/coq/coq/issues/10301>`_,
+ by Andreas Lynge, review by Enrico Tassi)
+- Make the ``rewrite /t`` tactic work together with
+ :flag:`Universe Polymorphism`.
+ This makes :tacn:`rewrite <rewrite (ssreflect)>` compatible with the HoTT
+ library https://github.com/HoTT/HoTT
+ (`#10305 <https://github.com/coq/coq/pull/10305>`_,
+ fixes `#9336 <https://github.com/coq/coq/issues/9336>`_,
+ by Andreas Lynge, review by Enrico Tassi)
+
+**CoqIDE**
+
+- Fix CoqIDE instability on Windows after the update to gtk3
+ (`#10360 <https://github.com/coq/coq/pull/10360>`_, by Michael Soegtrop,
+ closes `#9885 <https://github.com/coq/coq/issues/9885>`_).
+
+**Miscellaneous**
+
+- Proof General can now display Coq-generated diffs between proof steps
+ in color
+ (`#10019 <https://github.com/coq/coq/pull/10019>`_ and
+ (in Proof General) `#421 <https://github.com/ProofGeneral/PG/pull/421>`_,
+ by Jim Fehrle).
+
+
Version 8.9
-----------
@@ -656,8 +710,8 @@ changes:
attribute.
- Removed deprecated commands ``Arguments Scope`` and ``Implicit
- Arguments`` in favor of :cmd:`Arguments`, with the help of Jasper
- Hugunin.
+ Arguments`` in favor of :cmd:`Arguments (scopes)` and
+ :cmd:`Arguments (implicits)`, with the help of Jasper Hugunin.
- New flag :flag:`Uniform Inductive Parameters` by Jasper Hugunin to
avoid repeating uniform parameters in constructor declarations.
@@ -957,6 +1011,19 @@ Notations
refer to `app`.
Solution: wrap `_ ++ _` in `(_ ++ _)%list` (or whichever scope you want).
+Changes in 8.8.0
+~~~~~~~~~~~~~~~~
+
+Various bug fixes.
+
+Changes in 8.8.1
+~~~~~~~~~~~~~~~~
+
+- Some quality-of-life fixes.
+- Numerous improvements to the documentation.
+- Fix a critical bug related to primitive projections and :tacn:`native_compute`.
+- Ship several additional Coq libraries with the Windows installer.
+
Version 8.8
-----------
diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py
index ec3343dac6..867a19efe5 100755
--- a/doc/sphinx/conf.py
+++ b/doc/sphinx/conf.py
@@ -1,8 +1,7 @@
#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
@@ -109,7 +108,7 @@ master_doc = "index"
# General information about the project.
project = 'Coq'
-copyright = '1999-2018, Inria'
+copyright = '1999-2019, Inria, CNRS and contributors'
author = 'The Coq Development Team'
# The version info for the project you're documenting, acts as replacement for
@@ -181,7 +180,21 @@ suppress_warnings = ["misc.highlighting_failure"]
todo_include_todos = False
# Extra warnings, including undefined references
-nitpicky = False
+nitpicky = True
+
+nitpick_ignore = [ ('token', token) for token in [
+ 'tactic',
+ # 142 occurrences currently sort of defined in the ltac chapter,
+ # but is it the right place?
+ 'module',
+ 'redexpr',
+ 'modpath',
+ 'dirpath',
+ 'collection',
+ 'term_pattern',
+ 'term_pattern_string',
+ 'command',
+ 'symbol' ]]
# -- Options for HTML output ----------------------------------------------
diff --git a/doc/sphinx/coqdoc.css b/doc/sphinx/coqdoc.css
index a34bb81ebd..2ac2af1c13 100644
--- a/doc/sphinx/coqdoc.css
+++ b/doc/sphinx/coqdoc.css
@@ -1,6 +1,6 @@
/************************************************************************/
/* * The Coq Proof Assistant / The Coq Development Team */
-/* v * INRIA, CNRS and contributors - Copyright 1999-2018 */
+/* v * INRIA, CNRS and contributors - Copyright 1999-2019 */
/* <O___,, * (see CREDITS file for the list of authors) */
/* \VV/ **************************************************************/
/* // * This file is distributed under the terms of the */
diff --git a/doc/sphinx/language/gallina-extensions.rst b/doc/sphinx/language/gallina-extensions.rst
index c48964d66c..c93984661e 100644
--- a/doc/sphinx/language/gallina-extensions.rst
+++ b/doc/sphinx/language/gallina-extensions.rst
@@ -603,11 +603,16 @@ The following experimental command is available when the ``FunInd`` library has
The meaning of this declaration is to define a function ident,
similarly to ``Fixpoint``. Like in ``Fixpoint``, the decreasing argument must
be given (unless the function is not recursive), but it might not
- necessarily be *structurally* decreasing. The point of the {} annotation
+ necessarily be *structurally* decreasing. The point of the :n:`{ @decrease_annot }` annotation
is to name the decreasing argument *and* to describe which kind of
decreasing criteria must be used to ensure termination of recursive
calls.
+ .. productionlist::
+ decrease_annot : struct `ident`
+ : measure `term` `ident`
+ : wf `term` `ident`
+
The ``Function`` construction also enjoys the ``with`` extension to define
mutually recursive definitions. However, this feature does not work
for non structurally recursive functions.
@@ -616,31 +621,33 @@ See the documentation of functional induction (:tacn:`function induction`)
and ``Functional Scheme`` (:ref:`functional-scheme`) for how to use
the induction principle to easily reason about the function.
-Remark: To obtain the right principle, it is better to put rigid
-parameters of the function as first arguments. For example it is
-better to define plus like this:
+.. note::
-.. coqtop:: reset none
+ To obtain the right principle, it is better to put rigid
+ parameters of the function as first arguments. For example it is
+ better to define plus like this:
- Require Import FunInd.
+ .. coqtop:: reset none
-.. coqtop:: all
+ Require Import FunInd.
- Function plus (m n : nat) {struct n} : nat :=
- match n with
- | 0 => m
- | S p => S (plus m p)
- end.
+ .. coqtop:: all
-than like this:
+ Function plus (m n : nat) {struct n} : nat :=
+ match n with
+ | 0 => m
+ | S p => S (plus m p)
+ end.
-.. coqtop:: reset all
+ than like this:
- Function plus (n m : nat) {struct n} : nat :=
- match n with
- | 0 => m
- | S p => S (plus p m)
- end.
+ .. coqtop:: reset all
+
+ Function plus (n m : nat) {struct n} : nat :=
+ match n with
+ | 0 => m
+ | S p => S (plus p m)
+ end.
*Limitations*
@@ -710,7 +717,7 @@ used by ``Function``. A more precise description is given below.
with :cmd:`Fixpoint`. Moreover the following are defined:
+ The same objects as above;
- + The fixpoint equation of :token:`ident`: :n:`@ident_equation`.
+ + The fixpoint equation of :token:`ident`: :token:`ident`\ ``_equation``.
.. cmdv:: Function @ident {* @binder } { measure @term @ident } : @type := @term
Function @ident {* @binder } { wf @term @ident } : @type := @term
@@ -730,7 +737,7 @@ used by ``Function``. A more precise description is given below.
decreases at each recursive call of :token:`term`. The order must be well-founded.
Parameters of the function are bound in :token:`term`.
- Depending on the annotation, the user is left with some proof
+ If the annotation is ``measure`` or ``fw``, the user is left with some proof
obligations that will be used to define the function. These proofs
are: proofs that each recursive call is actually decreasing with
respect to the given criteria, and (if the criteria is `wf`) a proof
@@ -1662,6 +1669,7 @@ Declaring Implicit Arguments
of :token:`qualid`.
.. cmd:: Arguments @qualid : clear implicits
+ :name: Arguments (clear implicits)
This command clears implicit arguments.
@@ -1738,6 +1746,7 @@ Automatic declaration of implicit arguments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. cmd:: Arguments @qualid : default implicits
+ :name: Arguments (default implicits)
This command tells |Coq| to automatically detect what are the implicit arguments of a
defined object.
@@ -1907,7 +1916,8 @@ This syntax extension is given in the following grammar:
Renaming implicit arguments
~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. cmd:: Arguments @qualid {* @name} : @rename
+.. cmd:: Arguments @qualid {* @name} : rename
+ :name: Arguments (rename)
This command is used to redefine the names of implicit arguments.
@@ -2293,7 +2303,7 @@ Printing universes
language, and can be processed by Graphviz tools. The format is
unspecified if `string` doesn’t end in ``.dot`` or ``.gv``.
-.. cmdv:: Print Universes Subgraph(@names)
+.. cmdv:: Print Universes Subgraph({+ @qualid })
:name: Print Universes Subgraph
Prints the graph restricted to the requested names (adjusting
@@ -2438,3 +2448,45 @@ types and functions of a :g:`Uint63` module. Said module is not produced by
extraction. Instead, it has to be provided by the user (if they want to compile
or execute the extracted code). For instance, an implementation of this module
can be taken from the kernel of Coq.
+
+Bidirectionality hints
+----------------------
+
+When type-checking an application, Coq normally does not use information from
+the context to infer the types of the arguments. It only checks after the fact
+that the type inferred for the application is coherent with the expected type.
+Bidirectionality hints make it possible to specify that after type-checking the
+first arguments of an application, typing information should be propagated from
+the context to help inferring the types of the remaining arguments.
+
+.. cmd:: Arguments @qualid {* @ident__1 } & {* @ident__2}
+ :name: Arguments (bidirectionality hints)
+
+ This commands tells the typechecking algorithm, when type-checking
+ applications of :n:`@qualid`, to first type-check the arguments in
+ :n:`@ident__1` and then propagate information from the typing context to
+ type-check the remaining arguments (in :n:`@ident__2`).
+
+.. example::
+
+ In a context where a coercion was declared from ``bool`` to ``nat``:
+
+ .. coqtop:: in reset
+
+ Definition b2n (b : bool) := if b then 1 else 0.
+ Coercion b2n : bool >-> nat.
+
+ Coq cannot automatically coerce existential statements over ``bool`` to
+ statements over ``nat``, because the need for inserting a coercion is known
+ only from the expected type of a subterm:
+
+ .. coqtop:: all
+
+ Fail Check (ex_intro _ true _ : exists n : nat, n > 0).
+
+ However, a suitable bidirectionality hint makes the example work:
+
+ .. coqtop:: all
+
+ Arguments ex_intro _ _ & _ _.
+ Check (ex_intro _ true _ : exists n : nat, n > 0).
diff --git a/doc/sphinx/language/gallina-specification-language.rst b/doc/sphinx/language/gallina-specification-language.rst
index 8acbcbec8f..38f6714f46 100644
--- a/doc/sphinx/language/gallina-specification-language.rst
+++ b/doc/sphinx/language/gallina-specification-language.rst
@@ -185,8 +185,7 @@ is described in Chapter :ref:`syntaxextensionsandinterpretationscopes`.
: `qualid`
: _
: `num`
- : ( `or_pattern` , … , `or_pattern` )
- or_pattern : `pattern` | … | `pattern`
+ : ( `pattern` | … | `pattern` )
Types
@@ -1509,7 +1508,10 @@ the following attributes names are recognized:
Takes as value the optional attributes ``since`` and ``note``;
both have a string value.
- This attribute can trigger the following warnings:
+ This attribute is supported by the following commands: :cmd:`Ltac`,
+ :cmd:`Tactic Notation`, :cmd:`Notation`, :cmd:`Infix`.
+
+ It can trigger the following warnings:
.. warn:: Tactic @qualid is deprecated since @string. @string.
:undocumented:
@@ -1517,6 +1519,11 @@ the following attributes names are recognized:
.. warn:: Tactic Notation @qualid is deprecated since @string. @string.
:undocumented:
+ .. warn:: Notation @string__1 is deprecated since @string__2. @string__3.
+
+ :n:`@string__1` is the actual notation, :n:`@string__2` is the version number,
+ :n:`@string__3` is the note.
+
.. example::
.. coqtop:: all reset warn
diff --git a/doc/sphinx/practical-tools/coq-commands.rst b/doc/sphinx/practical-tools/coq-commands.rst
index bdda35fcc0..48d5f4075e 100644
--- a/doc/sphinx/practical-tools/coq-commands.rst
+++ b/doc/sphinx/practical-tools/coq-commands.rst
@@ -124,11 +124,11 @@ and ``coqtop``, unless stated otherwise:
:ref:`names-of-libraries` and the
command Declare ML Module Section :ref:`compiled-files`.
-:-Q *directory* dirpath: Add physical path *directory* to the list of
+:-Q *directory* *dirpath*: Add physical path *directory* to the list of
directories where |Coq| looks for a file and bind it to the logical
directory *dirpath*. The subdirectory structure of *directory* is
recursively available from |Coq| using absolute names (extending the
- dirpath prefix) (see Section :ref:`qualified-names`).Note that only those
+ :n:`@dirpath` prefix) (see Section :ref:`qualified-names`). Note that only those
subdirectories and files which obey the lexical conventions of what is
an :n:`@ident` are taken into account. Conversely, the
underlying file systems or operating systems may be more restrictive
@@ -138,13 +138,13 @@ and ``coqtop``, unless stated otherwise:
disallow two files differing only in the case in the same directory.
.. seealso:: Section :ref:`names-of-libraries`.
-:-R *directory* dirpath: Do as -Q *directory* dirpath but make the
+:-R *directory* *dirpath*: Do as ``-Q`` *directory* *dirpath* but make the
subdirectory structure of *directory* recursively visible so that the
recursive contents of physical *directory* is available from |Coq| using
short or partially qualified names.
.. seealso:: Section :ref:`names-of-libraries`.
-:-top dirpath: Set the toplevel module name to dirpath instead of Top.
+:-top *dirpath*: Set the toplevel module name to :n:`@dirpath` instead of ``Top``.
Not valid for `coqc` as the toplevel module name is inferred from the
name of the output file.
:-exclude-dir *directory*: Exclude any subdirectory named *directory*
@@ -164,10 +164,17 @@ and ``coqtop``, unless stated otherwise:
:-lv *file*, -load-vernac-source-verbose *file*: Load and execute the
|Coq| script from *file.v*. Write its contents to the standard output as
it is executed.
-:-load-vernac-object dirpath: Load |Coq| compiled library dirpath. This
- is equivalent to runningRequire dirpath.
-:-require dirpath: Load |Coq| compiled library dirpath and import it.
- This is equivalent to running Require Import dirpath.
+:-load-vernac-object *qualid*: Load |Coq| compiled library :n:`@qualid`. This
+ is equivalent to running :cmd:`Require` :n:`qualid`.
+:-ri *qualid*, -require-import *qualid*: Load |Coq| compiled library :n:`@qualid` and import it.
+ This is equivalent to running :cmd:`Require Import` :n:`@qualid`.
+:-re *qualid*, -require-export *qualid*: Load |Coq| compiled library :n:`@qualid` and transitively import it.
+ This is equivalent to running :cmd:`Require Export` :n:`@qualid`.
+:-rifrom *dirpath* *qualid*, -require-import-from *dirpath* *qualid*: Load |Coq| compiled library :n:`@qualid` and import it.
+ This is equivalent to running :n:`From` :n:`@dirpath` :cmd:`Require Import` :n:`@qualid`.
+:-refrom *dirpath* *qualid*, -require-export-from *dirpath* *qualid*: Load |Coq| compiled library :n:`@qualid` and transitively import it.
+ This is equivalent to running :n:`From` :n:`@dirpath` :cmd:`Require Export` :n:`@qualid`.
+:-require *qualid*: Deprecated; use ``-ri`` *qualid*.
:-batch: Exit just after argument parsing. Available for ``coqtop`` only.
:-compile *file.v*: Deprecated; use ``coqc`` instead. Compile file *file.v* into *file.vo*. This option
implies -batch (exit just after argument parsing). It is available only
@@ -193,7 +200,7 @@ and ``coqtop``, unless stated otherwise:
:-emacs, -ide-slave: Start a special toplevel to communicate with a
specific IDE.
:-impredicative-set: Change the logical theory of |Coq| by declaring the
- sort Set impredicative.
+ sort :g:`Set` impredicative.
.. warning::
diff --git a/doc/sphinx/proof-engine/ltac.rst b/doc/sphinx/proof-engine/ltac.rst
index fed7111628..46f9826e41 100644
--- a/doc/sphinx/proof-engine/ltac.rst
+++ b/doc/sphinx/proof-engine/ltac.rst
@@ -32,24 +32,27 @@ The syntax of the tactic language is given below. See Chapter
:ref:`gallinaspecificationlanguage` for a description of the BNF metasyntax used
in these grammar rules. Various already defined entries will be used in this
chapter: entries :token:`natural`, :token:`integer`, :token:`ident`,
-:token:`qualid`, :token:`term`, :token:`cpattern` and :token:`atomic_tactic`
+:token:`qualid`, :token:`term`, :token:`cpattern` and :token:`tactic`
represent respectively the natural and integer numbers, the authorized
identificators and qualified names, Coq terms and patterns and all the atomic
-tactics described in Chapter :ref:`tactics`. The syntax of :token:`cpattern` is
+tactics described in Chapter :ref:`tactics`.
+
+The syntax of :production:`cpattern` is
the same as that of terms, but it is extended with pattern matching
metavariables. In :token:`cpattern`, a pattern matching metavariable is
-represented with the syntax :g:`?id` where :g:`id` is an :token:`ident`. The
+represented with the syntax :n:`?@ident`. The
notation :g:`_` can also be used to denote metavariable whose instance is
-irrelevant. In the notation :g:`?id`, the identifier allows us to keep
+irrelevant. In the notation :n:`?@ident`, the identifier allows us to keep
instantiations and to make constraints whereas :g:`_` shows that we are not
interested in what will be matched. On the right hand side of pattern matching
clauses, the named metavariables are used without the question mark prefix. There
is also a special notation for second-order pattern matching problems: in an
-applicative pattern of the form :g:`@?id id1 … idn`, the variable id matches any
-complex expression with (possible) dependencies in the variables :g:`id1 … idn`
-and returns a functional term of the form :g:`fun id1 … idn => term`.
+applicative pattern of the form :n:`%@?@ident @ident__1 … @ident__n`,
+the variable :token:`ident` matches any complex expression with (possible)
+dependencies in the variables :n:`@ident__i` and returns a functional term
+of the form :n:`fun @ident__1 … ident__n => @term`.
-The main entry of the grammar is :n:`@expr`. This language is used in proof
+The main entry of the grammar is :n:`@ltac_expr`. This language is used in proof
mode but it can also be used in toplevel definitions as shown below.
.. note::
@@ -86,41 +89,42 @@ mode but it can also be used in toplevel definitions as shown below.
:n:`((try (repeat (@tactic__1 || @tactic__2)); @tactic__3); [ {+| @tactic } ]); @tactic__4`
.. productionlist:: coq
- expr : `expr` ; `expr`
- : [> `expr` | ... | `expr` ]
- : `expr` ; [ `expr` | ... | `expr` ]
- : `tacexpr3`
- tacexpr3 : do (`natural` | `ident`) `tacexpr3`
- : progress `tacexpr3`
- : repeat `tacexpr3`
- : try `tacexpr3`
- : once `tacexpr3`
- : exactly_once `tacexpr3`
- : timeout (`natural` | `ident`) `tacexpr3`
- : time [`string`] `tacexpr3`
- : only `selector`: `tacexpr3`
- : `tacexpr2`
- tacexpr2 : `tacexpr1` || `tacexpr3`
- : `tacexpr1` + `tacexpr3`
- : tryif `tacexpr1` then `tacexpr1` else `tacexpr1`
- : `tacexpr1`
- tacexpr1 : fun `name` ... `name` => `atom`
+ ltac_expr : `ltac_expr` ; `ltac_expr`
+ : [> `ltac_expr` | ... | `ltac_expr` ]
+ : `ltac_expr` ; [ `ltac_expr` | ... | `ltac_expr` ]
+ : `ltac_expr3`
+ ltac_expr3 : do (`natural` | `ident`) `ltac_expr3`
+ : progress `ltac_expr3`
+ : repeat `ltac_expr3`
+ : try `ltac_expr3`
+ : once `ltac_expr3`
+ : exactly_once `ltac_expr3`
+ : timeout (`natural` | `ident`) `ltac_expr3`
+ : time [`string`] `ltac_expr3`
+ : only `selector`: `ltac_expr3`
+ : `ltac_expr2`
+ ltac_expr2 : `ltac_expr1` || `ltac_expr3`
+ : `ltac_expr1` + `ltac_expr3`
+ : tryif `ltac_expr1` then `ltac_expr1` else `ltac_expr1`
+ : `ltac_expr1`
+ ltac_expr1 : fun `name` ... `name` => `atom`
: let [rec] `let_clause` with ... with `let_clause` in `atom`
: match goal with `context_rule` | ... | `context_rule` end
: match reverse goal with `context_rule` | ... | `context_rule` end
- : match `expr` with `match_rule` | ... | `match_rule` end
+ : match `ltac_expr` with `match_rule` | ... | `match_rule` end
: lazymatch goal with `context_rule` | ... | `context_rule` end
: lazymatch reverse goal with `context_rule` | ... | `context_rule` end
- : lazymatch `expr` with `match_rule` | ... | `match_rule` end
+ : lazymatch `ltac_expr` with `match_rule` | ... | `match_rule` end
: multimatch goal with `context_rule` | ... | `context_rule` end
: multimatch reverse goal with `context_rule` | ... | `context_rule` end
- : multimatch `expr` with `match_rule` | ... | `match_rule` end
+ : multimatch `ltac_expr` with `match_rule` | ... | `match_rule` end
: abstract `atom`
: abstract `atom` using `ident`
- : first [ `expr` | ... | `expr` ]
- : solve [ `expr` | ... | `expr` ]
+ : first [ `ltac_expr` | ... | `ltac_expr` ]
+ : solve [ `ltac_expr` | ... | `ltac_expr` ]
: idtac [ `message_token` ... `message_token`]
: fail [`natural`] [`message_token` ... `message_token`]
+ : gfail [`natural`] [`message_token` ... `message_token`]
: fresh [ `component` … `component` ]
: context `ident` [`term`]
: eval `redexpr` in `term`
@@ -130,31 +134,31 @@ mode but it can also be used in toplevel definitions as shown below.
: type_term `term`
: numgoals
: guard `test`
- : assert_fails `tacexpr3`
- : assert_succeeds `tacexpr3`
- : `atomic_tactic`
+ : assert_fails `ltac_expr3`
+ : assert_succeeds `ltac_expr3`
+ : `tactic`
: `qualid` `tacarg` ... `tacarg`
: `atom`
atom : `qualid`
: ()
: `integer`
- : ( `expr` )
+ : ( `ltac_expr` )
component : `string` | `qualid`
message_token : `string` | `ident` | `integer`
tacarg : `qualid`
: ()
: ltac : `atom`
: `term`
- let_clause : `ident` [`name` ... `name`] := `expr`
- context_rule : `context_hyp`, ..., `context_hyp` |- `cpattern` => `expr`
- : `cpattern` => `expr`
- : |- `cpattern` => `expr`
- : _ => `expr`
+ let_clause : `ident` [`name` ... `name`] := `ltac_expr`
+ context_rule : `context_hyp`, ..., `context_hyp` |- `cpattern` => `ltac_expr`
+ : `cpattern` => `ltac_expr`
+ : |- `cpattern` => `ltac_expr`
+ : _ => `ltac_expr`
context_hyp : `name` : `cpattern`
: `name` := `cpattern` [: `cpattern`]
- match_rule : `cpattern` => `expr`
- : context [`ident`] [ `cpattern` ] => `expr`
- : _ => `expr`
+ match_rule : `cpattern` => `ltac_expr`
+ : context [`ident`] [ `cpattern` ] => `ltac_expr`
+ : _ => `ltac_expr`
test : `integer` = `integer`
: `integer` (< | <= | > | >=) `integer`
selector : [`ident`]
@@ -167,8 +171,8 @@ mode but it can also be used in toplevel definitions as shown below.
.. productionlist:: coq
top : [Local] Ltac `ltac_def` with ... with `ltac_def`
- ltac_def : `ident` [`ident` ... `ident`] := `expr`
- : `qualid` [`ident` ... `ident`] ::= `expr`
+ ltac_def : `ident` [`ident` ... `ident`] := `ltac_expr`
+ : `qualid` [`ident` ... `ident`] ::= `ltac_expr`
.. _ltac-semantics:
@@ -193,12 +197,12 @@ Sequence
A sequence is an expression of the following form:
-.. tacn:: @expr__1 ; @expr__2
+.. tacn:: @ltac_expr__1 ; @ltac_expr__2
:name: ltac-seq
- The expression :n:`@expr__1` is evaluated to :n:`v__1`, which must be
+ The expression :n:`@ltac_expr__1` is evaluated to :n:`v__1`, which must be
a tactic value. The tactic :n:`v__1` is applied to the current goal,
- possibly producing more goals. Then :n:`@expr__2` is evaluated to
+ possibly producing more goals. Then :n:`@ltac_expr__2` is evaluated to
produce :n:`v__2`, which must be a tactic value. The tactic
:n:`v__2` is applied to all the goals produced by the prior
application. Sequence is associative.
@@ -209,10 +213,10 @@ Local application of tactics
Different tactics can be applied to the different goals using the
following form:
-.. tacn:: [> {*| @expr }]
+.. tacn:: [> {*| @ltac_expr }]
:name: [> ... | ... | ... ] (dispatch)
- The expressions :n:`@expr__i` are evaluated to :n:`v__i`, for
+ The expressions :n:`@ltac_expr__i` are evaluated to :n:`v__i`, for
i = 1, ..., n and all have to be tactics. The :n:`v__i` is applied to the
i-th goal, for i = 1, ..., n. It fails if the number of focused goals is not
exactly n.
@@ -223,31 +227,31 @@ following form:
were given. For instance, ``[> | auto]`` is a shortcut for ``[> idtac | auto
]``.
- .. tacv:: [> {*| @expr__i} | @expr .. | {*| @expr__j}]
+ .. tacv:: [> {*| @ltac_expr__i} | @ltac_expr .. | {*| @ltac_expr__j}]
- In this variant, :n:`@expr` is used for each goal coming after those
- covered by the list of :n:`@expr__i` but before those covered by the
- list of :n:`@expr__j`.
+ In this variant, :n:`@ltac_expr` is used for each goal coming after those
+ covered by the list of :n:`@ltac_expr__i` but before those covered by the
+ list of :n:`@ltac_expr__j`.
- .. tacv:: [> {*| @expr} | .. | {*| @expr}]
+ .. tacv:: [> {*| @ltac_expr} | .. | {*| @ltac_expr}]
In this variant, idtac is used for the goals not covered by the two lists of
- :n:`@expr`.
+ :n:`@ltac_expr`.
- .. tacv:: [> @expr .. ]
+ .. tacv:: [> @ltac_expr .. ]
- In this variant, the tactic :n:`@expr` is applied independently to each of
+ In this variant, the tactic :n:`@ltac_expr` is applied independently to each of
the goals, rather than globally. In particular, if there are no goals, the
tactic is not run at all. A tactic which expects multiple goals, such as
``swap``, would act as if a single goal is focused.
- .. tacv:: @expr__0 ; [{*| @expr__i}]
+ .. tacv:: @ltac_expr__0 ; [{*| @ltac_expr__i}]
This variant of local tactic application is paired with a sequence. In this
- variant, there must be as many :n:`@expr__i` as goals generated
- by the application of :n:`@expr__0` to each of the individual goals
+ variant, there must be as many :n:`@ltac_expr__i` as goals generated
+ by the application of :n:`@ltac_expr__0` to each of the individual goals
independently. All the above variants work in this form too.
- Formally, :n:`@expr ; [ ... ]` is equivalent to :n:`[> @expr ; [> ... ] .. ]`.
+ Formally, :n:`@ltac_expr ; [ ... ]` is equivalent to :n:`[> @ltac_expr ; [> ... ] .. ]`.
.. _goal-selectors:
@@ -257,53 +261,53 @@ Goal selectors
We can restrict the application of a tactic to a subset of the currently
focused goals with:
-.. tacn:: @toplevel_selector : @expr
+.. tacn:: @toplevel_selector : @ltac_expr
:name: ... : ... (goal selector)
We can also use selectors as a tactical, which allows to use them nested
in a tactic expression, by using the keyword ``only``:
- .. tacv:: only @selector : @expr
+ .. tacv:: only @selector : @ltac_expr
:name: only ... : ...
- When selecting several goals, the tactic :token:`expr` is applied globally to all
+ When selecting several goals, the tactic :token:`ltac_expr` is applied globally to all
selected goals.
- .. tacv:: [@ident] : @expr
+ .. tacv:: [@ident] : @ltac_expr
- In this variant, :token:`expr` is applied locally to a goal previously named
+ In this variant, :token:`ltac_expr` is applied locally to a goal previously named
by the user (see :ref:`existential-variables`).
- .. tacv:: @num : @expr
+ .. tacv:: @num : @ltac_expr
- In this variant, :token:`expr` is applied locally to the :token:`num`-th goal.
+ In this variant, :token:`ltac_expr` is applied locally to the :token:`num`-th goal.
- .. tacv:: {+, @num-@num} : @expr
+ .. tacv:: {+, @num-@num} : @ltac_expr
- In this variant, :n:`@expr` is applied globally to the subset of goals
+ In this variant, :n:`@ltac_expr` is applied globally to the subset of goals
described by the given ranges. You can write a single ``n`` as a shortcut
for ``n-n`` when specifying multiple ranges.
- .. tacv:: all: @expr
+ .. tacv:: all: @ltac_expr
:name: all: ...
- In this variant, :token:`expr` is applied to all focused goals. ``all:`` can only
+ In this variant, :token:`ltac_expr` is applied to all focused goals. ``all:`` can only
be used at the toplevel of a tactic expression.
- .. tacv:: !: @expr
+ .. tacv:: !: @ltac_expr
- In this variant, if exactly one goal is focused, :token:`expr` is
+ In this variant, if exactly one goal is focused, :token:`ltac_expr` is
applied to it. Otherwise the tactic fails. ``!:`` can only be
used at the toplevel of a tactic expression.
- .. tacv:: par: @expr
+ .. tacv:: par: @ltac_expr
:name: par: ...
- In this variant, :n:`@expr` is applied to all focused goals in parallel.
+ In this variant, :n:`@ltac_expr` is applied to all focused goals in parallel.
The number of workers can be controlled via the command line option
``-async-proofs-tac-j`` taking as argument the desired number of workers.
Limitations: ``par:`` only works on goals containing no existential
- variables and :n:`@expr` must either solve the goal completely or do
+ variables and :n:`@ltac_expr` must either solve the goal completely or do
nothing (i.e. it cannot make some progress). ``par:`` can only be used at
the toplevel of a tactic expression.
@@ -318,10 +322,10 @@ For loop
There is a for loop that repeats a tactic :token:`num` times:
-.. tacn:: do @num @expr
+.. tacn:: do @num @ltac_expr
:name: do
- :n:`@expr` is evaluated to ``v`` which must be a tactic value. This tactic
+ :n:`@ltac_expr` is evaluated to ``v`` which must be a tactic value. This tactic
value ``v`` is applied :token:`num` times. Supposing :token:`num` > 1, after the
first application of ``v``, ``v`` is applied, at least once, to the generated
subgoals and so on. It fails if the application of ``v`` fails before the num
@@ -332,24 +336,24 @@ Repeat loop
We have a repeat loop with:
-.. tacn:: repeat @expr
+.. tacn:: repeat @ltac_expr
:name: repeat
- :n:`@expr` is evaluated to ``v``. If ``v`` denotes a tactic, this tactic is
+ :n:`@ltac_expr` is evaluated to ``v``. If ``v`` denotes a tactic, this tactic is
applied to each focused goal independently. If the application succeeds, the
tactic is applied recursively to all the generated subgoals until it eventually
fails. The recursion stops in a subgoal when the tactic has failed *to make
- progress*. The tactic :n:`repeat @expr` itself never fails.
+ progress*. The tactic :n:`repeat @ltac_expr` itself never fails.
Error catching
~~~~~~~~~~~~~~
We can catch the tactic errors with:
-.. tacn:: try @expr
+.. tacn:: try @ltac_expr
:name: try
- :n:`@expr` is evaluated to ``v`` which must be a tactic value. The tactic
+ :n:`@ltac_expr` is evaluated to ``v`` which must be a tactic value. The tactic
value ``v`` is applied to each focused goal independently. If the application of
``v`` fails in a goal, it catches the error and leaves the goal unchanged. If the
level of the exception is positive, then the exception is re-raised with its
@@ -360,10 +364,10 @@ Detecting progress
We can check if a tactic made progress with:
-.. tacn:: progress @expr
+.. tacn:: progress @ltac_expr
:name: progress
- :n:`@expr` is evaluated to v which must be a tactic value. The tactic value ``v``
+ :n:`@ltac_expr` is evaluated to v which must be a tactic value. The tactic value ``v``
is applied to each focued subgoal independently. If the application of ``v``
to one of the focused subgoal produced subgoals equal to the initial
goals (up to syntactical equality), then an error of level 0 is raised.
@@ -376,19 +380,19 @@ Backtracking branching
We can branch with the following structure:
-.. tacn:: @expr__1 + @expr__2
+.. tacn:: @ltac_expr__1 + @ltac_expr__2
:name: + (backtracking branching)
- :n:`@expr__1` and :n:`@expr__2` are evaluated respectively to :n:`v__1` and
+ :n:`@ltac_expr__1` and :n:`@ltac_expr__2` are evaluated respectively to :n:`v__1` and
:n:`v__2` which must be tactic values. The tactic value :n:`v__1` is applied to
each focused goal independently and if it fails or a later tactic fails, then
the proof backtracks to the current goal and :n:`v__2` is applied.
Tactics can be seen as having several successes. When a tactic fails it
asks for more successes of the prior tactics.
- :n:`@expr__1 + @expr__2` has all the successes of :n:`v__1` followed by all the
+ :n:`@ltac_expr__1 + @ltac_expr__2` has all the successes of :n:`v__1` followed by all the
successes of :n:`v__2`. Algebraically,
- :n:`(@expr__1 + @expr__2); @expr__3 = (@expr__1; @expr__3) + (@expr__2; @expr__3)`.
+ :n:`(@ltac_expr__1 + @ltac_expr__2); @ltac_expr__3 = (@ltac_expr__1; @ltac_expr__3) + (@ltac_expr__2; @ltac_expr__3)`.
Branching is left-associative.
@@ -399,22 +403,22 @@ Backtracking branching may be too expensive. In this case we may
restrict to a local, left biased, branching and consider the first
tactic to work (i.e. which does not fail) among a panel of tactics:
-.. tacn:: first [{*| @expr}]
+.. tacn:: first [{*| @ltac_expr}]
:name: first
- The :n:`@expr__i` are evaluated to :n:`v__i` and :n:`v__i` must be
+ The :n:`@ltac_expr__i` are evaluated to :n:`v__i` and :n:`v__i` must be
tactic values for i = 1, ..., n. Supposing n > 1,
- :n:`first [@expr__1 | ... | @expr__n]` applies :n:`v__1` in each
+ :n:`first [@ltac_expr__1 | ... | @ltac_expr__n]` applies :n:`v__1` in each
focused goal independently and stops if it succeeds; otherwise it
tries to apply :n:`v__2` and so on. It fails when there is no
applicable tactic. In other words,
- :n:`first [@expr__1 | ... | @expr__n]` behaves, in each goal, as the first
+ :n:`first [@ltac_expr__1 | ... | @ltac_expr__n]` behaves, in each goal, as the first
:n:`v__i` to have *at least* one success.
.. exn:: No applicable tactic.
:undocumented:
- .. tacv:: first @expr
+ .. tacv:: first @ltac_expr
This is an |Ltac| alias that gives a primitive access to the first
tactical as an |Ltac| definition without going through a parsing rule. It
@@ -433,14 +437,14 @@ Left-biased branching
Yet another way of branching without backtracking is the following
structure:
-.. tacn:: @expr__1 || @expr__2
+.. tacn:: @ltac_expr__1 || @ltac_expr__2
:name: || (left-biased branching)
- :n:`@expr__1` and :n:`@expr__2` are evaluated respectively to :n:`v__1` and
+ :n:`@ltac_expr__1` and :n:`@ltac_expr__2` are evaluated respectively to :n:`v__1` and
:n:`v__2` which must be tactic values. The tactic value :n:`v__1` is
applied in each subgoal independently and if it fails *to progress* then
- :n:`v__2` is applied. :n:`@expr__1 || @expr__2` is
- equivalent to :n:`first [ progress @expr__1 | @expr__2 ]` (except that
+ :n:`v__2` is applied. :n:`@ltac_expr__1 || @ltac_expr__2` is
+ equivalent to :n:`first [ progress @ltac_expr__1 | @ltac_expr__2 ]` (except that
if it fails, it fails like :n:`v__2`). Branching is left-associative.
Generalized biased branching
@@ -448,19 +452,19 @@ Generalized biased branching
The tactic
-.. tacn:: tryif @expr__1 then @expr__2 else @expr__3
+.. tacn:: tryif @ltac_expr__1 then @ltac_expr__2 else @ltac_expr__3
:name: tryif
is a generalization of the biased-branching tactics above. The
- expression :n:`@expr__1` is evaluated to :n:`v__1`, which is then
+ expression :n:`@ltac_expr__1` is evaluated to :n:`v__1`, which is then
applied to each subgoal independently. For each goal where :n:`v__1`
- succeeds at least once, :n:`@expr__2` is evaluated to :n:`v__2` which
+ succeeds at least once, :n:`@ltac_expr__2` is evaluated to :n:`v__2` which
is then applied collectively to the generated subgoals. The :n:`v__2`
tactic can trigger backtracking points in :n:`v__1`: where :n:`v__1`
succeeds at least once,
- :n:`tryif @expr__1 then @expr__2 else @expr__3` is equivalent to
+ :n:`tryif @ltac_expr__1 then @ltac_expr__2 else @ltac_expr__3` is equivalent to
:n:`v__1; v__2`. In each of the goals where :n:`v__1` does not succeed at least
- once, :n:`@expr__3` is evaluated in :n:`v__3` which is is then applied to the
+ once, :n:`@ltac_expr__3` is evaluated in :n:`v__3` which is is then applied to the
goal.
Soft cut
@@ -469,13 +473,13 @@ Soft cut
Another way of restricting backtracking is to restrict a tactic to a
single success *a posteriori*:
-.. tacn:: once @expr
+.. tacn:: once @ltac_expr
:name: once
- :n:`@expr` is evaluated to ``v`` which must be a tactic value. The tactic value
+ :n:`@ltac_expr` is evaluated to ``v`` which must be a tactic value. The tactic value
``v`` is applied but only its first success is used. If ``v`` fails,
- :n:`once @expr` fails like ``v``. If ``v`` has at least one success,
- :n:`once @expr` succeeds once, but cannot produce more successes.
+ :n:`once @ltac_expr` fails like ``v``. If ``v`` has at least one success,
+ :n:`once @ltac_expr` succeeds once, but cannot produce more successes.
Checking the successes
~~~~~~~~~~~~~~~~~~~~~~
@@ -483,14 +487,14 @@ Checking the successes
Coq provides an experimental way to check that a tactic has *exactly
one* success:
-.. tacn:: exactly_once @expr
+.. tacn:: exactly_once @ltac_expr
:name: exactly_once
- :n:`@expr` is evaluated to ``v`` which must be a tactic value. The tactic value
+ :n:`@ltac_expr` is evaluated to ``v`` which must be a tactic value. The tactic value
``v`` is applied if it has at most one success. If ``v`` fails,
- :n:`exactly_once @expr` fails like ``v``. If ``v`` has a exactly one success,
- :n:`exactly_once @expr` succeeds like ``v``. If ``v`` has two or more
- successes, exactly_once expr fails.
+ :n:`exactly_once @ltac_expr` fails like ``v``. If ``v`` has a exactly one success,
+ :n:`exactly_once @ltac_expr` succeeds like ``v``. If ``v`` has two or more
+ successes, :n:`exactly_once @ltac_expr` fails.
.. warning::
@@ -509,10 +513,10 @@ Checking the failure
Coq provides a derived tactic to check that a tactic *fails*:
-.. tacn:: assert_fails @expr
+.. tacn:: assert_fails @ltac_expr
:name: assert_fails
- This behaves like :n:`tryif @expr then fail 0 tac "succeeds" else idtac`.
+ This behaves like :n:`tryif @ltac_expr then fail 0 tac "succeeds" else idtac`.
Checking the success
~~~~~~~~~~~~~~~~~~~~
@@ -520,7 +524,7 @@ Checking the success
Coq provides a derived tactic to check that a tactic has *at least one*
success:
-.. tacn:: assert_succeeds @expr
+.. tacn:: assert_succeeds @ltac_expr
:name: assert_succeeds
This behaves like
@@ -532,19 +536,19 @@ Solving
We may consider the first to solve (i.e. which generates no subgoal)
among a panel of tactics:
-.. tacn:: solve [{*| @expr}]
+.. tacn:: solve [{*| @ltac_expr}]
:name: solve
- The :n:`@expr__i` are evaluated to :n:`v__i` and :n:`v__i` must be
+ The :n:`@ltac_expr__i` are evaluated to :n:`v__i` and :n:`v__i` must be
tactic values, for i = 1, ..., n. Supposing n > 1,
- :n:`solve [@expr__1 | ... | @expr__n]` applies :n:`v__1` to
+ :n:`solve [@ltac_expr__1 | ... | @ltac_expr__n]` applies :n:`v__1` to
each goal independently and stops if it succeeds; otherwise it tries to
apply :n:`v__2` and so on. It fails if there is no solving tactic.
.. exn:: Cannot solve the goal.
:undocumented:
- .. tacv:: solve @expr
+ .. tacv:: solve @ltac_expr
This is an |Ltac| alias that gives a primitive access to the :n:`solve:`
tactical. See the :n:`first` tactical for more information.
@@ -582,11 +586,11 @@ Failing
the call to :n:`fail @num` is not enclosed in a :n:`+` command,
respecting the algebraic identity.
- .. tacv:: fail {* message_token}
+ .. tacv:: fail {* @message_token}
The given tokens are used for printing the failure message.
- .. tacv:: fail @num {* message_token}
+ .. tacv:: fail @num {* @message_token}
This is a combination of the previous variants.
@@ -597,8 +601,8 @@ Failing
Similarly, ``gfail`` fails even when used after ``all:`` and there are no
goals left. See the example for clarification.
- .. tacv:: gfail {* message_token}
- gfail @num {* message_token}
+ .. tacv:: gfail {* @message_token}
+ gfail @num {* @message_token}
These variants fail with an error message or an error level even if
there are no goals left. Be careful however if Coq terms have to be
@@ -647,10 +651,10 @@ Timeout
We can force a tactic to stop if it has not finished after a certain
amount of time:
-.. tacn:: timeout @num @expr
+.. tacn:: timeout @num @ltac_expr
:name: timeout
- :n:`@expr` is evaluated to ``v`` which must be a tactic value. The tactic value
+ :n:`@ltac_expr` is evaluated to ``v`` which must be a tactic value. The tactic value
``v`` is applied normally, except that it is interrupted after :n:`@num` seconds
if it is still running. In this case the outcome is a failure.
@@ -669,10 +673,10 @@ Timing a tactic
A tactic execution can be timed:
-.. tacn:: time @string @expr
+.. tacn:: time @string @ltac_expr
:name: time
- evaluates :n:`@expr` and displays the running time of the tactic expression, whether it
+ evaluates :n:`@ltac_expr` and displays the running time of the tactic expression, whether it
fails or succeeds. In case of several successes, the time for each successive
run is displayed. Time is in seconds and is machine-dependent. The :n:`@string`
argument is optional. When provided, it is used to identify this particular
@@ -684,10 +688,10 @@ Timing a tactic that evaluates to a term
Tactic expressions that produce terms can be timed with the experimental
tactic
-.. tacn:: time_constr @expr
+.. tacn:: time_constr @ltac_expr
:name: time_constr
- which evaluates :n:`@expr ()` and displays the time the tactic expression
+ which evaluates :n:`@ltac_expr ()` and displays the time the tactic expression
evaluated, assuming successful evaluation. Time is in seconds and is
machine-dependent.
@@ -735,12 +739,12 @@ Local definitions
Local definitions can be done as follows:
-.. tacn:: let @ident__1 := @expr__1 {* with @ident__i := @expr__i} in @expr
+.. tacn:: let @ident__1 := @ltac_expr__1 {* with @ident__i := @ltac_expr__i} in @ltac_expr
:name: let ... := ...
- each :n:`@expr__i` is evaluated to :n:`v__i`, then, :n:`@expr` is evaluated
+ each :n:`@ltac_expr__i` is evaluated to :n:`v__i`, then, :n:`@ltac_expr` is evaluated
by substituting :n:`v__i` to each occurrence of :n:`@ident__i`, for
- i = 1, ..., n. There are no dependencies between the :n:`@expr__i` and the
+ i = 1, ..., n. There are no dependencies between the :n:`@ltac_expr__i` and the
:n:`@ident__i`.
Local definitions can be made recursive by using :n:`let rec` instead of :n:`let`.
@@ -759,7 +763,7 @@ An application is an expression of the following form:
The reference :n:`@qualid` must be bound to some defined tactic definition
expecting at least as many arguments as the provided :n:`tacarg`. The
- expressions :n:`@expr__i` are evaluated to :n:`v__i`, for i = 1, ..., n.
+ expressions :n:`@ltac_expr__i` are evaluated to :n:`v__i`, for i = 1, ..., n.
.. what expressions ??
@@ -769,7 +773,7 @@ Function construction
A parameterized tactic can be built anonymously (without resorting to
local definitions) with:
-.. tacn:: fun {+ @ident} => @expr
+.. tacn:: fun {+ @ident} => @ltac_expr
Indeed, local definitions of functions are a syntactic sugar for binding
a :n:`fun` tactic to an identifier.
@@ -779,9 +783,9 @@ Pattern matching on terms
We can carry out pattern matching on terms with:
-.. tacn:: match @expr with {+| @cpattern__i => @expr__i} end
+.. tacn:: match @ltac_expr with {+| @cpattern__i => @ltac_expr__i} end
- The expression :n:`@expr` is evaluated and should yield a term which is
+ The expression :n:`@ltac_expr` is evaluated and should yield a term which is
matched against :n:`cpattern__1`. The matching is non-linear: if a
metavariable occurs more than once, it should match the same expression
every time. It is first-order except on the variables of the form :n:`@?id`
@@ -795,20 +799,20 @@ We can carry out pattern matching on terms with:
same types. This provides with a primitive form of matching under
context which does not require manipulating a functional term.
- If the matching with :n:`@cpattern__1` succeeds, then :n:`@expr__1` is
+ If the matching with :n:`@cpattern__1` succeeds, then :n:`@ltac_expr__1` is
evaluated into some value by substituting the pattern matching
- instantiations to the metavariables. If :n:`@expr__1` evaluates to a
+ instantiations to the metavariables. If :n:`@ltac_expr__1` evaluates to a
tactic and the match expression is in position to be applied to a goal
(e.g. it is not bound to a variable by a :n:`let in`), then this tactic is
applied. If the tactic succeeds, the list of resulting subgoals is the
- result of the match expression. If :n:`@expr__1` does not evaluate to a
+ result of the match expression. If :n:`@ltac_expr__1` does not evaluate to a
tactic or if the match expression is not in position to be applied to a
- goal, then the result of the evaluation of :n:`@expr__1` is the result
+ goal, then the result of the evaluation of :n:`@ltac_expr__1` is the result
of the match expression.
If the matching with :n:`@cpattern__1` fails, or if it succeeds but the
- evaluation of :n:`@expr__1` fails, or if the evaluation of
- :n:`@expr__1` succeeds but returns a tactic in execution position whose
+ evaluation of :n:`@ltac_expr__1` fails, or if the evaluation of
+ :n:`@ltac_expr__1` succeeds but returns a tactic in execution position whose
execution fails, then :n:`cpattern__2` is used and so on. The pattern
:n:`_` matches any term and shadows all remaining patterns if any. If all
clauses fail (in particular, there is no pattern :n:`_`) then a
@@ -824,9 +828,9 @@ We can carry out pattern matching on terms with:
.. exn:: Argument of match does not evaluate to a term.
- This happens when :n:`@expr` does not denote a term.
+ This happens when :n:`@ltac_expr` does not denote a term.
- .. tacv:: multimatch @expr with {+| @cpattern__i => @expr__i} end
+ .. tacv:: multimatch @ltac_expr with {+| @cpattern__i => @ltac_expr__i} end
Using multimatch instead of match will allow subsequent tactics to
backtrack into a right-hand side tactic which has backtracking points
@@ -835,7 +839,7 @@ We can carry out pattern matching on terms with:
The syntax :n:`match …` is, in fact, a shorthand for :n:`once multimatch …`.
- .. tacv:: lazymatch @expr with {+| @cpattern__i => @expr__i} end
+ .. tacv:: lazymatch @ltac_expr with {+| @cpattern__i => @ltac_expr__i} end
Using lazymatch instead of match will perform the same pattern
matching procedure but will commit to the first matching branch
@@ -880,13 +884,13 @@ We can perform pattern matching on goals using the following expression:
.. we should provide the full grammar here
-.. tacn:: match goal with {+| {+, @context_hyp} |- @cpattern => @expr } | _ => @expr end
+.. tacn:: match goal with {+| {+, @context_hyp} |- @cpattern => @ltac_expr } | _ => @ltac_expr end
:name: match goal
If each hypothesis pattern :n:`hyp`\ :sub:`1,i`, with i = 1, ..., m\ :sub:`1` is
matched (non-linear first-order unification) by a hypothesis of the
goal and if :n:`cpattern_1` is matched by the conclusion of the goal,
- then :n:`@expr__1` is evaluated to :n:`v__1` by substituting the
+ then :n:`@ltac_expr__1` is evaluated to :n:`v__1` by substituting the
pattern matching to the metavariables and the real hypothesis names
bound to the possible hypothesis names occurring in the hypothesis
patterns. If :n:`v__1` is a tactic value, then it is applied to the
@@ -894,7 +898,7 @@ We can perform pattern matching on goals using the following expression:
is tried with the same proof context pattern. If there is no other
combination of hypotheses then the second proof context pattern is tried
and so on. If the next to last proof context pattern fails then
- the last :n:`@expr` is evaluated to :n:`v` and :n:`v` is
+ the last :n:`@ltac_expr` is evaluated to :n:`v` and :n:`v` is
applied. Note also that matching against subterms (using the :n:`context
@ident [ @cpattern ]`) is available and is also subject to yielding several
matchings.
@@ -918,7 +922,7 @@ We can perform pattern matching on goals using the following expression:
first), but it possible to reverse this order (oldest first)
with the :n:`match reverse goal with` variant.
- .. tacv:: multimatch goal with {+| {+, @context_hyp} |- @cpattern => @expr } | _ => @expr end
+ .. tacv:: multimatch goal with {+| {+, @context_hyp} |- @cpattern => @ltac_expr } | _ => @ltac_expr end
Using :n:`multimatch` instead of :n:`match` will allow subsequent tactics
to backtrack into a right-hand side tactic which has backtracking points
@@ -929,7 +933,7 @@ We can perform pattern matching on goals using the following expression:
The syntax :n:`match [reverse] goal …` is, in fact, a shorthand for
:n:`once multimatch [reverse] goal …`.
- .. tacv:: lazymatch goal with {+| {+, @context_hyp} |- @cpattern => @expr } | _ => @expr end
+ .. tacv:: lazymatch goal with {+| {+, @context_hyp} |- @cpattern => @ltac_expr } | _ => @ltac_expr end
Using lazymatch instead of match will perform the same pattern matching
procedure but will commit to the first matching branch with the first
@@ -944,11 +948,11 @@ Filling a term context
The following expression is not a tactic in the sense that it does not
produce subgoals but generates a term to be used in tactic expressions:
-.. tacn:: context @ident [@expr]
+.. tacn:: context @ident [@ltac_expr]
:n:`@ident` must denote a context variable bound by a context pattern of a
match expression. This expression evaluates replaces the hole of the
- value of :n:`@ident` by the value of :n:`@expr`.
+ value of :n:`@ident` by the value of :n:`@ltac_expr`.
.. exn:: Not a context variable.
:undocumented:
@@ -964,7 +968,7 @@ system decide a name with the intro tactic is not so good since it is
very awkward to retrieve the name the system gave. The following
expression returns an identifier:
-.. tacn:: fresh {* component}
+.. tacn:: fresh {* @component}
It evaluates to an identifier unbound in the goal. This fresh identifier
is obtained by concatenating the value of the :n:`@component`\ s (each of them
@@ -1068,10 +1072,10 @@ Testing boolean expressions
Proving a subgoal as a separate lemma
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. tacn:: abstract @expr
+.. tacn:: abstract @ltac_expr
:name: abstract
- From the outside, :n:`abstract @expr` is the same as :n:`solve @expr`.
+ From the outside, :n:`abstract @ltac_expr` is the same as :n:`solve @ltac_expr`.
Internally it saves an auxiliary lemma called ``ident_subproofn`` where
``ident`` is the name of the current goal and ``n`` is chosen so that this is
a fresh name. Such an auxiliary lemma is inlined in the final proof term.
@@ -1094,7 +1098,7 @@ Proving a subgoal as a separate lemma
if used as part of typeclass resolution, it may produce wrong
terms when in universe polymorphic mode.
- .. tacv:: abstract @expr using @ident
+ .. tacv:: abstract @ltac_expr using @ident
Give explicitly the name of the auxiliary lemma.
@@ -1103,7 +1107,7 @@ Proving a subgoal as a separate lemma
Use this feature at your own risk; explicitly named and reused subterms
don’t play well with asynchronous proofs.
- .. tacv:: transparent_abstract @expr
+ .. tacv:: transparent_abstract @ltac_expr
:name: transparent_abstract
Save the subproof in a transparent lemma rather than an opaque one.
@@ -1113,7 +1117,7 @@ Proving a subgoal as a separate lemma
Use this feature at your own risk; building computationally relevant
terms with tactics is fragile.
- .. tacv:: transparent_abstract @expr using @ident
+ .. tacv:: transparent_abstract @ltac_expr using @ident
Give explicitly the name of the auxiliary transparent lemma.
@@ -1135,7 +1139,7 @@ Defining |Ltac| functions
Basically, |Ltac| toplevel definitions are made as follows:
-.. cmd:: {? Local} Ltac @ident {* @ident} := @expr
+.. cmd:: {? Local} Ltac @ident {* @ident} := @ltac_expr
:name: Ltac
This defines a new |Ltac| function that can be used in any tactic
@@ -1148,13 +1152,13 @@ Basically, |Ltac| toplevel definitions are made as follows:
The preceding definition can equivalently be written:
- :n:`Ltac @ident := fun {+ @ident} => @expr`
+ :n:`Ltac @ident := fun {+ @ident} => @ltac_expr`
- .. cmdv:: Ltac @ident {* @ident} {* with @ident {* @ident}} := @expr
+ .. cmdv:: Ltac @ident {* @ident} {* with @ident {* @ident}} := @ltac_expr
This syntax allows recursive and mutual recursive function definitions.
- .. cmdv:: Ltac @qualid {* @ident} ::= @expr
+ .. cmdv:: Ltac @qualid {* @ident} ::= @ltac_expr
This syntax *redefines* an existing user-defined tactic.
@@ -1581,7 +1585,7 @@ Backtraces
Info trace
~~~~~~~~~~
-.. cmd:: Info @num @expr
+.. cmd:: Info @num @ltac_expr
:name: Info
This command can be used to print the trace of the path eventually taken by an
diff --git a/doc/sphinx/proof-engine/ltac2.rst b/doc/sphinx/proof-engine/ltac2.rst
index aa603fc966..36eeff6192 100644
--- a/doc/sphinx/proof-engine/ltac2.rst
+++ b/doc/sphinx/proof-engine/ltac2.rst
@@ -124,13 +124,13 @@ Type declarations
One can define new types by the following commands.
-.. cmd:: Ltac2 Type @ltac2_typeparams @lident
+.. cmd:: Ltac2 Type {? @ltac2_typeparams } @lident
:name: Ltac2 Type
This command defines an abstract type. It has no use for the end user and
is dedicated to types representing data coming from the OCaml world.
-.. cmdv:: Ltac2 Type {? rec} @ltac2_typeparams @lident := @ltac2_typedef
+.. cmdv:: Ltac2 Type {? rec} {? @ltac2_typeparams } @lident := @ltac2_typedef
This command defines a type with a manifest. There are four possible
kinds of such definitions: alias, variant, record and open variant types.
@@ -154,7 +154,7 @@ One can define new types by the following commands.
Records are product types with named fields and eliminated by projection.
Likewise they can be recursive if the `rec` flag is set.
- .. cmdv:: Ltac2 Type @ltac2_typeparams @ltac2_qualid := [ @ltac2_constructordef ]
+ .. cmdv:: Ltac2 Type {? @ltac2_typeparams } @ltac2_qualid ::= [ @ltac2_constructordef ]
Open variants are a special kind of variant types whose constructors are not
statically defined, but can instead be extended dynamically. A typical example
@@ -179,7 +179,7 @@ constructions from ML.
: let `ltac2_var` := `ltac2_term` in `ltac2_term`
: let rec `ltac2_var` := `ltac2_term` in `ltac2_term`
: match `ltac2_term` with `ltac2_branch` ... `ltac2_branch` end
- : `int`
+ : `integer`
: `string`
: `ltac2_term` ; `ltac2_term`
: [| `ltac2_term` ; ... ; `ltac2_term` |]
@@ -619,7 +619,7 @@ calls to term matching functions from the `Pattern` module. Internally, it is
implemented thanks to a specific scope accepting the :n:`@constrmatching` syntax.
Variables from the :n:`@constrpattern` are statically bound in the body of the branch, to
-values of type `constr` for the variables from the :n:`@constr` pattern and to a
+values of type `constr` for the variables from the :n:`@term` pattern and to a
value of type `Pattern.context` for the variable :n:`@lident`.
Note that unlike Ltac, only lowercase identifiers are valid as Ltac2
@@ -655,6 +655,8 @@ this features has the same semantics as in Ltac1. In particular, a ``reverse``
flag can be specified to match hypotheses from the more recently introduced to
the least recently introduced one.
+.. _ltac2_notations:
+
Notations
---------
@@ -679,6 +681,11 @@ The following scopes are built-in.
+ parses :n:`c = @term` and produces :n:`constr:(c)`
+ This scope can be parameterized by a list of delimiting keys of interpretation
+ scopes (as described in :ref:`LocalInterpretationRulesForNotations`),
+ describing how to interpret the parsed term. For instance, :n:`constr(A, B)`
+ parses :n:`c = @term` and produces :n:`constr:(c%A%B)`.
+
- :n:`ident`:
+ parses :n:`id = @ident` and produces :n:`ident:(id)`
@@ -686,20 +693,22 @@ The following scopes are built-in.
- :n:`list0(@ltac2_scope)`:
- + if :n:`@ltac2_scope` parses :production:`entry`, parses :n:`(@entry__0, ..., @entry__n)` and produces
- :n:`[@entry__0; ...; @entry__n]`.
+ + if :n:`@ltac2_scope` parses :n:`@quotentry`,
+ then it parses :n:`(@quotentry__0, ..., @quotentry__n)` and produces
+ :n:`[@quotentry__0; ...; @quotentry__n]`.
- :n:`list0(@ltac2_scope, sep = @string__sep)`:
- + if :n:`@ltac2_scope` parses :n:`@entry`, parses :n:`(@entry__0 @string__sep ... @string__sep @entry__n)`
- and produces :n:`[@entry__0; ...; @entry__n]`.
+ + if :n:`@ltac2_scope` parses :n:`@quotentry`,
+ then it parses :n:`(@quotentry__0 @string__sep ... @string__sep @quotentry__n)`
+ and produce :n:`[@quotentry__0; ...; @quotentry__n]`.
-- :n:`list1`: same as :n:`list0` (with or without separator) but parses :n:`{+ @entry}` instead
- of :n:`{* @entry}`.
+- :n:`list1`: same as :n:`list0` (with or without separator) but parses :n:`{+ @quotentry}` instead
+ of :n:`{* @quotentry}`.
- :n:`opt(@ltac2_scope)`
- + if :n:`@ltac2_scope` parses :n:`@entry`, parses :n:`{? @entry}` and produces either :n:`None` or
+ + if :n:`@ltac2_scope` parses :n:`@quotentry`, parses :n:`{? @quotentry}` and produces either :n:`None` or
:n:`Some x` where :n:`x` is the parsed expression.
- :n:`self`:
diff --git a/doc/sphinx/proof-engine/proof-handling.rst b/doc/sphinx/proof-engine/proof-handling.rst
index 4a2f9c0db3..0cff987a27 100644
--- a/doc/sphinx/proof-engine/proof-handling.rst
+++ b/doc/sphinx/proof-engine/proof-handling.rst
@@ -175,12 +175,12 @@ list of assertion commands is given in :ref:`Assertions`. The command
Use all section variables except the list of :token:`ident`.
- .. cmdv:: Proof using @collection1 + @collection2
+ .. cmdv:: Proof using @collection__1 + @collection__2
Use section variables from the union of both collections.
See :ref:`nameaset` to know how to form a named collection.
- .. cmdv:: Proof using @collection1 - @collection2
+ .. cmdv:: Proof using @collection__1 - @collection__2
Use section variables which are in the first collection but not in the
second one.
@@ -202,10 +202,10 @@ Proof using options
The following options modify the behavior of ``Proof using``.
-.. opt:: Default Proof Using "@expression"
+.. opt:: Default Proof Using "@collection"
:name: Default Proof Using
- Use :n:`@expression` as the default ``Proof using`` value. E.g. ``Set Default
+ Use :n:`@collection` as the default ``Proof using`` value. E.g. ``Set Default
Proof Using "a b"`` will complete all ``Proof`` commands not followed by a
``using`` part with ``using a b``.
@@ -220,7 +220,7 @@ The following options modify the behavior of ``Proof using``.
Name a set of section hypotheses for ``Proof using``
````````````````````````````````````````````````````
-.. cmd:: Collection @ident := @expression
+.. cmd:: Collection @ident := @collection
This can be used to name a set of section
hypotheses, with the purpose of making ``Proof using`` annotations more
@@ -535,19 +535,6 @@ Requesting information
eexists ?[n].
Show n.
- .. cmdv:: Show Script
- :name: Show Script
-
- Displays the whole list of tactics applied from the
- beginning of the current proof. This tactics script may contain some
- holes (subgoals not yet proved). They are printed under the form
-
- ``<Your Tactic Text here>``.
-
- .. deprecated:: 8.10
-
- Please use a text editor.
-
.. cmdv:: Show Proof
:name: Show Proof
@@ -705,9 +692,10 @@ command in CoqIDE. You can change the background colors shown for diffs from th
lets you control other attributes of the highlights, such as the foreground
color, bold, italic, underline and strikeout.
-Note: As of this writing (August 2018), Proof General will need minor changes
-to be able to show diffs correctly. We hope it will support this feature soon.
-See https://github.com/ProofGeneral/PG/issues/381 for the current status.
+As of June 2019, Proof General can also display Coq-generated proof diffs automatically.
+Please see the PG documentation section
+"`Showing Proof Diffs" <https://proofgeneral.github.io/doc/master/userman/Coq-Proof-General#Showing-Proof-Diffs>`_)
+for details.
How diffs are calculated
````````````````````````
diff --git a/doc/sphinx/proof-engine/ssreflect-proof-language.rst b/doc/sphinx/proof-engine/ssreflect-proof-language.rst
index b19b0742c1..cc4976587d 100644
--- a/doc/sphinx/proof-engine/ssreflect-proof-language.rst
+++ b/doc/sphinx/proof-engine/ssreflect-proof-language.rst
@@ -455,7 +455,7 @@ the latter can be replaced by the open syntax ``of term`` or
following extension of the binder syntax:
.. prodn::
- binder += & @term | of @term
+ binder += {| & @term | of @term }
Caveat: ``& T`` and ``of T`` abbreviations have to appear at the end
of a binder list. For instance, the usual two-constructor polymorphic
@@ -1340,7 +1340,7 @@ The general syntax of the discharging tactical ``:`` is:
:undocumented:
.. prodn::
- d_item ::= {? @occ_switch %| @clear_switch } @term
+ d_item ::= {? {| @occ_switch | @clear_switch } } @term
.. prodn::
clear_switch ::= { {+ @ident } }
@@ -1499,7 +1499,7 @@ side of an equation.
The abstract tactic
```````````````````
-.. tacn:: abstract: {+ d_item}
+.. tacn:: abstract: {+ @d_item}
:name: abstract (ssreflect)
This tactic assigns an abstract constant previously introduced with the
@@ -1556,19 +1556,19 @@ whose general syntax is
:undocumented:
.. prodn::
- i_item ::= @i_pattern %| @s_item %| @clear_switch %| @i_view %| @i_block
+ i_item ::= {| @i_pattern | @s_item | @clear_switch | @i_view | @i_block }
.. prodn::
- s_item ::= /= %| // %| //=
+ s_item ::= {| /= | // | //= }
.. prodn::
- i_view ::= {? %{%} } /@term %| /ltac:( @tactic )
+ i_view ::= {? %{%} } {| /@term | /ltac:( @tactic ) }
.. prodn::
- i_pattern ::= @ident %| > %| _ %| ? %| * %| + %| {? @occ_switch } -> %| {? @occ_switch }<- %| [ {?| @i_item } ] %| - %| [: {+ @ident } ]
+ i_pattern ::= {| @ident | > | _ | ? | * | + | {? @occ_switch } {| -> | <- } | [ {?| @i_item } ] | - | [: {+ @ident } ] }
.. prodn::
- i_block ::= [^ @ident ] %| [^~ @ident ] %| [^~ @num ]
+ i_block ::= {| [^ @ident ] | [^~ {| @ident | @num } ] }
The ``=>`` tactical first executes :token:`tactic`, then the :token:`i_item`\s,
left to right. An :token:`s_item` specifies a
@@ -2390,7 +2390,7 @@ of a local definition during the generalization phase, the name of the
local definition must be written between parentheses, like in
``rewrite H in H1 (def_n) H2.``
-.. tacv:: @tactic in {+ @clear_switch | {? @ } @ident | ( @ident ) | ( {? @ } @ident := @c_pattern ) } {? * }
+.. tacv:: @tactic in {+ {| @clear_switch | {? @}@ident | ( @ident ) | ( {? @}@ident := @c_pattern ) } } {? * }
This is the most general form of the ``in`` tactical.
In its simplest form the last option lets one rename hypotheses that
@@ -2492,7 +2492,7 @@ tactic:
The behavior of the defective have tactic makes it possible to
generalize it in the following general construction:
-.. tacn:: have {* @i_item } {? @i_pattern } {? @s_item | {+ @ssr_binder } } {? : @term } {? := @term | by @tactic }
+.. tacn:: have {* @i_item } {? @i_pattern } {? {| @s_item | {+ @ssr_binder } } } {? : @term } {? {| := @term | by @tactic } }
:undocumented:
Open syntax is supported for both :token:`term`. For the description
@@ -2920,7 +2920,7 @@ Advanced generalization
The complete syntax for the items on the left hand side of the ``/``
separator is the following one:
-.. tacv:: wlog … : {? @clear_switch | {? @ } @ident | ( {? @ } @ident := @c_pattern) } / @term
+.. tacv:: wlog … : {? {| @clear_switch | {? @}@ident | ( {? @}@ident := @c_pattern) } } / @term
:undocumented:
Clear operations are intertwined with generalization operations. This
@@ -3020,13 +3020,13 @@ A rewrite step :token:`rstep` has the general form:
rstep ::= {? @r_prefix } @r_item
.. prodn::
- r_prefix ::= {? - } {? @mult } {? @occ_switch %| @clear_switch } {? [ @r_pattern ] }
+ r_prefix ::= {? - } {? @mult } {? {| @occ_switch | @clear_switch } } {? [ @r_pattern ] }
.. prodn::
- r_pattern ::= @term %| in {? @ident in } @term %| %( @term in %| @term as %) @ident in @term
+ r_pattern ::= {| @term | in {? @ident in } @term | {| @term in | @term as } @ident in @term }
.. prodn::
- r_item ::= {? / } @term %| @s_item
+ r_item ::= {| {? / } @term | @s_item }
An :token:`r_prefix` contains annotations to qualify where and how the rewrite
operation should be performed:
@@ -3478,7 +3478,7 @@ efficient ones, e.g. for the purpose of a correctness proof.
Wildcards vs abstractions
`````````````````````````
-The rewrite tactic supports :token:`r_items` containing holes. For example, in
+The rewrite tactic supports :token:`r_item`\s containing holes. For example, in
the tactic ``rewrite (_ : _ * 0 = 0).``
the term ``_ * 0 = 0`` is interpreted as ``forall n : nat, n * 0 = 0.``
Anyway this tactic is *not* equivalent to
@@ -3702,7 +3702,7 @@ The under tactic
The convenience :tacn:`under` tactic supports the following syntax:
-.. tacn:: under {? @r_prefix } @term {? => {+ @i_item}} {? do ( @tactic | [ {*| @tactic } ] ) }
+.. tacn:: under {? @r_prefix } @term {? => {+ @i_item}} {? do {| @tactic | [ {*| @tactic } ] } }
:name: under
Operate under the context proved to be extensional by
@@ -3753,7 +3753,7 @@ involves the following steps:
3. If so :tacn:`under` puts these n goals in head normal form (using
the defective form of the tactic :tacn:`move`), then executes
- the corresponding intro pattern :n:`@ipat__i` in each goal.
+ the corresponding intro pattern :n:`@i_pattern__i` in each goal.
4. Then :tacn:`under` checks that the first n subgoals
are (quantified) equalities or double implications between a
@@ -3802,11 +3802,11 @@ One-liner mode
The Ltac expression:
-:n:`under @term => [ @i_item__1 | … | @i_item__n ] do [ @tac__1 | … | @tac__n ].`
+:n:`under @term => [ @i_item__1 | … | @i_item__n ] do [ @tactic__1 | … | @tactic__n ].`
can be seen as a shorter form for the following expression:
-:n:`(under @term) => [ @i_item__1 | … | @i_item__n | ]; [ @tac__1; over | … | @tac__n; over | cbv beta iota ].`
+:n:`(under @term) => [ @i_item__1 | … | @i_item__n | ]; [ @tactic__1; over | … | @tactic__n; over | cbv beta iota ].`
Notes:
@@ -3819,14 +3819,14 @@ Notes:
involving the `bigop` theory from the Mathematical Components library.
+ If there is only one tactic, the brackets can be omitted, e.g.:
- :n:`under @term => i do @tac.` and that shorter form should be
+ :n:`under @term => i do @tactic.` and that shorter form should be
preferred.
+ If the ``do`` clause is provided and the intro pattern is omitted,
then the default :token:`i_item` ``*`` is applied to each branch.
E.g., the Ltac expression:
- :n:`under @term do [ @tac__1 | … | @tac__n ]` is equivalent to:
- :n:`under @term => [ * | … | * ] do [ @tac__1 | … | @tac__n ]`
+ :n:`under @term do [ @tactic__1 | … | @tactic__n ]` is equivalent to:
+ :n:`under @term => [ * | … | * ] do [ @tactic__1 | … | @tactic__n ]`
(and it can be noted here that the :tacn:`under` tactic performs a
``move.`` before processing the intro patterns ``=> [ * | … | * ]``).
@@ -4237,7 +4237,7 @@ selecting a specific redex and has been described in the previous
sections. We have seen so far that the possibility of selecting a
redex using a term with holes is already a powerful means of redex
selection. Similarly, any terms provided by the user in the more
-complex forms of :token:`c_patterns`
+complex forms of :token:`c_pattern`\s
presented in the tables above can contain
holes.
@@ -5167,7 +5167,7 @@ Interpreting assumptions
The general form of an assumption view tactic is:
-.. tacv:: [move | case] / @term
+.. tacv:: {| move | case } / @term
:undocumented:
The term , called the *view lemma* can be:
@@ -5514,7 +5514,7 @@ Parameters
|SSR| tactics
.. prodn::
- d_tactic ::= elim %| case %| congr %| apply %| exact %| move
+ d_tactic ::= {| elim | case | congr | apply | exact | move }
Notation scope
@@ -5526,7 +5526,7 @@ Module name
Natural number
-.. prodn:: natural ::= @num %| @ident
+.. prodn:: natural ::= {| @num | @ident }
where :token:`ident` is an Ltac variable denoting a standard |Coq| numeral
(should not be the name of a tactic which can be followed by a
@@ -5535,7 +5535,7 @@ bracket ``[``, like ``do``, ``have``,…)
Items and switches
~~~~~~~~~~~~~~~~~~
-.. prodn:: ssr_binder ::= @ident %| ( @ident {? : @term } )
+.. prodn:: ssr_binder ::= {| @ident | ( @ident {? : @term } ) }
binder see :ref:`abbreviations_ssr`.
@@ -5543,33 +5543,33 @@ binder see :ref:`abbreviations_ssr`.
clear switch see :ref:`discharge_ssr`
-.. prodn:: c_pattern ::= {? @term in %| @term as } @ident in @term
+.. prodn:: c_pattern ::= {? {| @term in | @term as } } @ident in @term
context pattern see :ref:`contextual_patterns_ssr`
-.. prodn:: d_item ::= {? @occ_switch %| @clear_switch } {? @term %| ( @c_pattern ) }
+.. prodn:: d_item ::= {? {| @occ_switch | @clear_switch } } {? {| @term | ( @c_pattern ) } }
discharge item see :ref:`discharge_ssr`
-.. prodn:: gen_item ::= {? @ } @ident %| ( @ident ) %| ( {? @ } @ident := @c_pattern )
+.. prodn:: gen_item ::= {| {? @ } @ident | ( @ident ) | ( {? @ } @ident := @c_pattern ) }
generalization item see :ref:`structure_ssr`
-.. prodn:: i_pattern ::= @ident %| > %| _ %| ? %| * %| + %| {? @occ_switch } -> %| {? @occ_switch } <- %| [ {?| @i_item } ] %| - %| [: {+ @ident } ]
+.. prodn:: i_pattern ::= {| @ident | > | _ | ? | * | + | {? @occ_switch } {| -> | <- } | [ {?| @i_item } ] | - | [: {+ @ident } ] }
intro pattern :ref:`introduction_ssr`
-.. prodn:: i_item ::= @clear_switch %| @s_item %| @i_pattern %| @i_view %| @i_block
+.. prodn:: i_item ::= {| @clear_switch | @s_item | @i_pattern | @i_view | @i_block }
view :ref:`introduction_ssr`
.. prodn::
- i_view ::= {? %{%} } /@term %| /ltac:( @tactic )
+ i_view ::= {? %{%} } {| /@term | /ltac:( @tactic ) }
intro block :ref:`introduction_ssr`
.. prodn::
- i_block ::= [^ @ident ] %| [^~ @ident ] %| [^~ @num ]
+ i_block ::= {| [^ @ident ] | [^~ {| @ident | @num } ] }
intro item see :ref:`introduction_ssr`
@@ -5577,7 +5577,7 @@ intro item see :ref:`introduction_ssr`
multiplier see :ref:`iteration_ssr`
-.. prodn:: occ_switch ::= { {? + %| - } {* @num } }
+.. prodn:: occ_switch ::= { {? {| + | - } } {* @num } }
occur. switch see :ref:`occurrence_selection_ssr`
@@ -5585,19 +5585,19 @@ occur. switch see :ref:`occurrence_selection_ssr`
multiplier see :ref:`iteration_ssr`
-.. prodn:: mult_mark ::= ? %| !
+.. prodn:: mult_mark ::= {| ? | ! }
multiplier mark see :ref:`iteration_ssr`
-.. prodn:: r_item ::= {? / } @term %| @s_item
+.. prodn:: r_item ::= {| {? / } @term | @s_item }
rewrite item see :ref:`rewriting_ssr`
-.. prodn:: r_prefix ::= {? - } {? @int_mult } {? @occ_switch %| @clear_switch } {? [ @r_pattern ] }
+.. prodn:: r_prefix ::= {? - } {? @int_mult } {? {| @occ_switch | @clear_switch } } {? [ @r_pattern ] }
rewrite prefix see :ref:`rewriting_ssr`
-.. prodn:: r_pattern ::= @term %| @c_pattern %| in {? @ident in } @term
+.. prodn:: r_pattern ::= {| @term | @c_pattern | in {? @ident in } @term }
rewrite pattern see :ref:`rewriting_ssr`
@@ -5605,7 +5605,7 @@ rewrite pattern see :ref:`rewriting_ssr`
rewrite step see :ref:`rewriting_ssr`
-.. prodn:: s_item ::= /= %| // %| //=
+.. prodn:: s_item ::= {| /= | // | //= }
simplify switch see :ref:`introduction_ssr`
@@ -5640,7 +5640,7 @@ respectively.
rewrite (see :ref:`rewriting_ssr`)
-.. tacn:: under {? @r_prefix } @term {? => {+ @i_item}} {? do ( @tactic | [ {*| @tactic } ] )}
+.. tacn:: under {? @r_prefix } @term {? => {+ @i_item}} {? do {| @tactic | [ {*| @tactic } ] } }
under (see :ref:`under_ssr`)
@@ -5648,8 +5648,8 @@ respectively.
over (see :ref:`over_ssr`)
-.. tacn:: have {* @i_item } {? @i_pattern } {? @s_item %| {+ @ssr_binder } } {? : @term } := @term
- have {* @i_item } {? @i_pattern } {? @s_item %| {+ @ssr_binder } } : @term {? by @tactic }
+.. tacn:: have {* @i_item } {? @i_pattern } {? {| @s_item | {+ @ssr_binder } } } {? : @term } := @term
+ have {* @i_item } {? @i_pattern } {? {| @s_item | {+ @ssr_binder } } } : @term {? by @tactic }
have suff {? @clear_switch } {? @i_pattern } {? : @term } := @term
have suff {? @clear_switch } {? @i_pattern } : @term {? by @tactic }
gen have {? @ident , } {? @i_pattern } : {+ @gen_item } / @term {? by @tactic }
@@ -5658,7 +5658,7 @@ respectively.
forward chaining (see :ref:`structure_ssr`)
-.. tacn:: wlog {? suff } {? @i_item } : {* @gen_item %| @clear_switch } / @term
+.. tacn:: wlog {? suff } {? @i_item } : {* {| @gen_item | @clear_switch } } / @term
specializing (see :ref:`structure_ssr`)
@@ -5710,7 +5710,7 @@ discharge :ref:`discharge_ssr`
introduction see :ref:`introduction_ssr`
-.. prodn:: tactic += @tactic in {+ @gen_item %| @clear_switch } {? * }
+.. prodn:: tactic += @tactic in {+ {| @gen_item | @clear_switch } } {? * }
localization see :ref:`localization_ssr`
diff --git a/doc/sphinx/proof-engine/tactics.rst b/doc/sphinx/proof-engine/tactics.rst
index 2ee23df019..fa6d62ffa2 100644
--- a/doc/sphinx/proof-engine/tactics.rst
+++ b/doc/sphinx/proof-engine/tactics.rst
@@ -131,16 +131,17 @@ include :tacn:`assert`, :tacn:`intros` and :tacn:`destruct`.
simple_intropattern_closed : `naming_intropattern`
: _
: `or_and_intropattern`
- : `equality_intropattern`
+ : `rewriting_intropattern`
+ : `injection_intropattern`
naming_intropattern : `ident`
: ?
: ?`ident`
or_and_intropattern : [ `intropattern_list` | ... | `intropattern_list` ]
: ( `simple_intropattern` , ... , `simple_intropattern` )
: ( `simple_intropattern` & ... & `simple_intropattern` )
- equality_intropattern : ->
+ rewriting_intropattern : ->
: <-
- : [= `intropattern_list` ]
+ injection_intropattern : [= `intropattern_list` ]
or_and_intropattern_loc : `or_and_intropattern`
: `ident`
@@ -462,7 +463,7 @@ Occurrence sets and occurrence clauses
An occurrence clause is a modifier to some tactics that obeys the
following syntax:
- .. productionlist:: sentence
+ .. productionlist:: coq
occurrence_clause : in `goal_occurrences`
goal_occurrences : [`ident` [`at_occurrences`], ... , `ident` [`at_occurrences`] [|- [* [`at_occurrences`]]]]
: * |- [* [`at_occurrences`]]
@@ -2127,7 +2128,7 @@ and an explanation of the underlying technique.
:name: discriminate
This tactic proves any goal from an assumption stating that two
- structurally different :n:`@terms` of an inductive set are equal. For
+ structurally different :n:`@term`\s of an inductive set are equal. For
example, from :g:`(S (S O))=(S O)` we can derive by absurdity any
proposition.
@@ -2285,6 +2286,18 @@ and an explanation of the underlying technique.
to the number of new equalities. The original equality is erased if it
corresponds to a hypothesis.
+ .. tacv:: injection @term {? with @bindings_list} as @injection_intropattern
+ injection @num as @injection_intropattern
+ injection as @injection_intropattern
+ einjection @term {? with @bindings_list} as @injection_intropattern
+ einjection @num as @injection_intropattern
+ einjection as @injection_intropattern
+
+ These are equivalent to the previous variants but using instead the
+ syntax :token:`injection_intropattern` which :tacn:`intros`
+ uses. In particular :n:`as [= {+ @simple_intropattern}]` behaves
+ the same as :n:`as {+ @simple_intropattern}`.
+
.. flag:: Structural Injection
This option ensure that :n:`injection @term` erases the original hypothesis
@@ -2294,7 +2307,7 @@ and an explanation of the underlying technique.
.. flag:: Keep Proof Equalities
- By default, :tacn:`injection` only creates new equalities between :n:`@terms`
+ By default, :tacn:`injection` only creates new equalities between :n:`@term`\s
whose type is in sort :g:`Type` or :g:`Set`, thus implementing a special
behavior for objects that are proofs of a statement in :g:`Prop`. This option
controls this behavior.
@@ -2703,42 +2716,42 @@ simply :g:`t=u` dropping the implicit type of :g:`t` and :g:`u`.
Uses the equality :n:`@term`:sub:`1` :n:`= @term` :sub:`2` from right to left
- .. tacv:: rewrite @term in clause
+ .. tacv:: rewrite @term in @goal_occurrences
- Analogous to :n:`rewrite @term` but rewriting is done following clause
- (similarly to :ref:`performing computations <performingcomputations>`). For instance:
+ Analogous to :n:`rewrite @term` but rewriting is done following
+ the clause :token:`goal_occurrences`. For instance:
- + :n:`rewrite H in H`:sub:`1` will rewrite `H` in the hypothesis
- `H`:sub:`1` instead of the current goal.
- + :n:`rewrite H in H`:sub:`1` :g:`at 1, H`:sub:`2` :g:`at - 2 |- *` means
- :n:`rewrite H; rewrite H in H`:sub:`1` :g:`at 1; rewrite H in H`:sub:`2` :g:`at - 2.`
+ + :n:`rewrite H in H'` will rewrite `H` in the hypothesis
+ ``H'`` instead of the current goal.
+ + :n:`rewrite H in H' at 1, H'' at - 2 |- *` means
+ :n:`rewrite H; rewrite H in H' at 1; rewrite H in H'' at - 2.`
In particular a failure will happen if any of these three simpler tactics
fails.
- + :n:`rewrite H in * |-` will do :n:`rewrite H in H`:sub:`i` for all hypotheses
- :g:`H`:sub:`i` different from :g:`H`.
+ + :n:`rewrite H in * |-` will do :n:`rewrite H in H'` for all hypotheses
+ :g:`H'` different from :g:`H`.
A success will happen as soon as at least one of these simpler tactics succeeds.
+ :n:`rewrite H in *` is a combination of :n:`rewrite H` and :n:`rewrite H in * |-`
that succeeds if at least one of these two tactics succeeds.
Orientation :g:`->` or :g:`<-` can be inserted before the :token:`term` to rewrite.
- .. tacv:: rewrite @term at occurrences
+ .. tacv:: rewrite @term at @occurrences
- Rewrite only the given occurrences of :token:`term`. Occurrences are
+ Rewrite only the given :token:`occurrences` of :token:`term`. Occurrences are
specified from left to right as for pattern (:tacn:`pattern`). The rewrite is
always performed using setoid rewriting, even for Leibniz’s equality, so one
has to ``Import Setoid`` to use this variant.
- .. tacv:: rewrite @term by tactic
+ .. tacv:: rewrite @term by @tactic
Use tactic to completely solve the side-conditions arising from the
:tacn:`rewrite`.
- .. tacv:: rewrite {+, @term}
+ .. tacv:: rewrite {+, @orientation @term} {? in @ident }
Is equivalent to the `n` successive tactics :n:`{+; rewrite @term}`, each one
- working on the first subgoal generated by the previous one. Orientation
- :g:`->` or :g:`<-` can be inserted before each :token:`term` to rewrite. One
+ working on the first subgoal generated by the previous one. An :production:`orientation`
+ ``->`` or ``<-`` can be inserted before each :token:`term` to rewrite. One
unique clause can be added at the end after the keyword in; it will then
affect all rewrite operations.
@@ -2799,13 +2812,14 @@ simply :g:`t=u` dropping the implicit type of :g:`t` and :g:`u`.
Replaces :n:`@term` with :n:`@term’` using the first assumption whose type has
the form :n:`@term’ = @term`
- .. tacv:: replace @term {? with @term} in clause {? by @tactic}
- replace -> @term in clause
- replace <- @term in clause
+ .. tacv:: replace @term {? with @term} in @goal_occurrences {? by @tactic}
+ replace -> @term in @goal_occurrences
+ replace <- @term in @goal_occurrences
- Acts as before but the replacements take place in the specified clause (see
- :ref:`performingcomputations`) and not only in the conclusion of the goal. The
- clause argument must not contain any ``type of`` nor ``value of``.
+ Acts as before but the replacements take place in the specified clauses
+ (:token:`goal_occurrences`) (see :ref:`performingcomputations`) and not
+ only in the conclusion of the goal. The clause argument must not contain
+ any ``type of`` nor ``value of``.
.. tacv:: cutrewrite <- (@term = @term’)
:name: cutrewrite
@@ -2893,7 +2907,7 @@ simply :g:`t=u` dropping the implicit type of :g:`t` and :g:`u`.
This applies :n:`stepl @term` then applies :token:`tactic` to the second goal.
- .. tacv:: stepr @term stepr @term by tactic
+ .. tacv:: stepr @term by @tactic
:name: stepr
This behaves as :tacn:`stepl` but on the right-hand-side of the binary
@@ -3064,7 +3078,7 @@ the conversion in hypotheses :n:`{+ @ident}`.
.. tacv:: native_compute
:name: native_compute
- This tactic evaluates the goal by compilation to Objective Caml as described
+ This tactic evaluates the goal by compilation to OCaml as described
in :cite:`FullReduction`. If Coq is running in native code, it can be
typically two to five times faster than ``vm_compute``. Note however that the
compilation cost is higher, so it is worth using only for intensive
@@ -3159,7 +3173,7 @@ the conversion in hypotheses :n:`{+ @ident}`.
+ A constant can be marked to be unfolded only if applied to enough
arguments. The number of arguments required can be specified using the
- ``/`` symbol in the argument list of the :cmd:`Arguments` vernacular command.
+ ``/`` symbol in the argument list of the :cmd:`Arguments <Arguments (implicits)>` vernacular command.
.. example::
@@ -3230,8 +3244,8 @@ the conversion in hypotheses :n:`{+ @ident}`.
.. tacv:: simpl @pattern
- This applies ``simpl`` only to the subterms matching :n:`@pattern` in the
- current goal.
+ This applies :tacn:`simpl` only to the subterms matching
+ :n:`@pattern` in the current goal.
.. tacv:: simpl @pattern at {+ @num}
@@ -3264,50 +3278,77 @@ the conversion in hypotheses :n:`{+ @ident}`.
This tactic applies to any goal. The argument qualid must denote a
defined transparent constant or local definition (see
- :ref:`gallina-definitions` and :ref:`vernac-controlling-the-reduction-strategies`). The tactic
- ``unfold`` applies the :math:`\delta` rule to each occurrence of the constant to which
- :n:`@qualid` refers in the current goal and then replaces it with its
- :math:`\beta`:math:`\iota`-normal form.
+ :ref:`gallina-definitions` and
+ :ref:`vernac-controlling-the-reduction-strategies`). The tactic
+ :tacn:`unfold` applies the :math:`\delta` rule to each occurrence of
+ the constant to which :n:`@qualid` refers in the current goal and
+ then replaces it with its :math:`\beta`:math:`\iota`-normal form.
-.. exn:: @qualid does not denote an evaluable constant.
- :undocumented:
+ .. exn:: @qualid does not denote an evaluable constant.
-.. tacv:: unfold @qualid in @ident
+ This error is frequent when trying to unfold something that has
+ defined as an inductive type (or constructor) and not as a
+ definition.
- Replaces :n:`@qualid` in hypothesis :n:`@ident` with its definition
- and replaces the hypothesis with its :math:`\beta`:math:`\iota` normal form.
+ .. example::
-.. tacv:: unfold {+, @qualid}
+ .. coqtop:: abort all fail
- Replaces *simultaneously* :n:`{+, @qualid}` with their definitions and
- replaces the current goal with its :math:`\beta`:math:`\iota` normal form.
+ Goal 0 <= 1.
+ unfold le.
-.. tacv:: unfold {+, @qualid at {+, @num }}
+ This error can also be raised if you are trying to unfold
+ something that has been marked as opaque.
- The lists :n:`{+, @num}` specify the occurrences of :n:`@qualid` to be
- unfolded. Occurrences are located from left to right.
+ .. example::
- .. exn:: Bad occurrence number of @qualid.
- :undocumented:
+ .. coqtop:: abort all fail
- .. exn:: @qualid does not occur.
- :undocumented:
+ Opaque Nat.add.
+ Goal 1 + 0 = 1.
+ unfold Nat.add.
+
+ .. tacv:: unfold @qualid in @goal_occurrences
-.. tacv:: unfold @string
+ Replaces :n:`@qualid` in hypothesis (or hypotheses) designated
+ by :token:`goal_occurrences` with its definition and replaces
+ the hypothesis with its :math:`\beta`:math:`\iota` normal form.
- If :n:`@string` denotes the discriminating symbol of a notation (e.g. "+") or
- an expression defining a notation (e.g. `"_ + _"`), and this notation refers to an unfoldable constant, then the
- tactic unfolds it.
+ .. tacv:: unfold {+, @qualid}
-.. tacv:: unfold @string%key
+ Replaces :n:`{+, @qualid}` with their definitions and replaces
+ the current goal with its :math:`\beta`:math:`\iota` normal
+ form.
- This is variant of :n:`unfold @string` where :n:`@string` gets its
- interpretation from the scope bound to the delimiting key :n:`key`
- instead of its default interpretation (see :ref:`Localinterpretationrulesfornotations`).
-.. tacv:: unfold {+, qualid_or_string at {+, @num}}
+ .. tacv:: unfold {+, @qualid at @occurrences }
- This is the most general form, where :n:`qualid_or_string` is either a
- :n:`@qualid` or a :n:`@string` referring to a notation.
+ The list :token:`occurrences` specify the occurrences of
+ :n:`@qualid` to be unfolded. Occurrences are located from left
+ to right.
+
+ .. exn:: Bad occurrence number of @qualid.
+ :undocumented:
+
+ .. exn:: @qualid does not occur.
+ :undocumented:
+
+ .. tacv:: unfold @string
+
+ If :n:`@string` denotes the discriminating symbol of a notation
+ (e.g. "+") or an expression defining a notation (e.g. `"_ +
+ _"`), and this notation denotes an application whose head symbol
+ is an unfoldable constant, then the tactic unfolds it.
+
+ .. tacv:: unfold @string%@ident
+
+ This is variant of :n:`unfold @string` where :n:`@string` gets
+ its interpretation from the scope bound to the delimiting key
+ :token:`ident` instead of its default interpretation (see
+ :ref:`Localinterpretationrulesfornotations`).
+
+ .. tacv:: unfold {+, {| @qualid | @string{? %@ident } } {? at @occurrences } } {? in @goal_occurrences }
+
+ This is the most general form.
.. tacn:: fold @term
:name: fold
@@ -3382,14 +3423,13 @@ the conversion in hypotheses :n:`{+ @ident}`.
Conversion tactics applied to hypotheses
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. tacn:: conv_tactic in {+, @ident}
+.. tacn:: @tactic in {+, @ident}
- Applies the conversion tactic :n:`conv_tactic` to the hypotheses
- :n:`{+ @ident}`. The tactic :n:`conv_tactic` is any of the conversion tactics
- listed in this section.
+ Applies :token:`tactic` (any of the conversion tactics listed in this
+ section) to the hypotheses :n:`{+ @ident}`.
- If :n:`@ident` is a local definition, then :n:`@ident` can be replaced by
- (type of :n:`@ident`) to address not the body but the type of the local
+ If :token:`ident` is a local definition, then :token:`ident` can be replaced by
+ :n:`type of @ident` to address not the body but the type of the local
definition.
Example: :n:`unfold not in (type of H1) (type of H3)`.
@@ -3447,9 +3487,9 @@ Automation
:ref:`The Hints Databases for auto and eauto <thehintsdatabasesforautoandeauto>` for the list of
pre-defined databases and the way to create or extend a database.
- .. tacv:: auto using {+ @ident__i} {? with {+ @ident } }
+ .. tacv:: auto using {+ @qualid__i} {? with {+ @ident } }
- Uses lemmas :n:`@ident__i` in addition to hints. If :n:`@ident` is an
+ Uses lemmas :n:`@qualid__i` in addition to hints. If :n:`@qualid` is an
inductive type, it is the collection of its constructors which are added
as hints.
@@ -3457,8 +3497,8 @@ Automation
The hints passed through the `using` clause are used in the same
way as if they were passed through a hint database. Consequently,
- they use a weaker version of :tacn:`apply` and :n:`auto using @ident`
- may fail where :n:`apply @ident` succeeds.
+ they use a weaker version of :tacn:`apply` and :n:`auto using @qualid`
+ may fail where :n:`apply @qualid` succeeds.
Given that this can be seen as counter-intuitive, it could be useful
to have an option to use full-blown :tacn:`apply` for lemmas passed
@@ -3476,7 +3516,7 @@ Automation
Behaves like :tacn:`auto` but shows the tactics it tries to solve the goal,
including failing paths.
- .. tacv:: {? info_}auto {? @num} {? using {+ @lemma}} {? with {+ @ident}}
+ .. tacv:: {? info_}auto {? @num} {? using {+ @qualid}} {? with {+ @ident}}
This is the most general form, combining the various options.
@@ -3489,10 +3529,10 @@ Automation
.. tacv:: trivial with {+ @ident}
trivial with *
- trivial using {+ @lemma}
+ trivial using {+ @qualid}
debug trivial
info_trivial
- {? info_}trivial {? using {+ @lemma}} {? with {+ @ident}}
+ {? info_}trivial {? using {+ @qualid}} {? with {+ @ident}}
:name: _; _; _; debug trivial; info_trivial; _
:undocumented:
@@ -3531,7 +3571,7 @@ Automation
Note that ``ex_intro`` should be declared as a hint.
- .. tacv:: {? info_}eauto {? @num} {? using {+ @lemma}} {? with {+ @ident}}
+ .. tacv:: {? info_}eauto {? @num} {? using {+ @qualid}} {? with {+ @ident}}
The various options for :tacn:`eauto` are the same as for :tacn:`auto`.
@@ -3550,9 +3590,9 @@ Automation
This tactic unfolds constants that were declared through a :cmd:`Hint Unfold`
in the given databases.
-.. tacv:: autounfold with {+ @ident} in clause
+.. tacv:: autounfold with {+ @ident} in @goal_occurrences
- Performs the unfolding in the given clause.
+ Performs the unfolding in the given clause (:token:`goal_occurrences`).
.. tacv:: autounfold with *
@@ -3592,10 +3632,9 @@ Automation
Performs all the rewritings in hypothesis :n:`@qualid` applying :n:`@tactic`
to the main subgoal after each rewriting step.
-.. tacv:: autorewrite with {+ @ident} in @clause
+.. tacv:: autorewrite with {+ @ident} in @goal_occurrences
- Performs all the rewriting in the clause :n:`@clause`. The clause argument
- must not contain any ``type of`` nor ``value of``.
+ Performs all the rewriting in the clause :n:`@goal_occurrences`.
.. seealso::
@@ -3666,10 +3705,11 @@ automatically created.
from the order in which they were inserted, making this implementation
observationally different from the legacy one.
-The general command to add a hint to some databases :n:`{+ @ident}` is
-
.. cmd:: Hint @hint_definition : {+ @ident}
+ The general command to add a hint to some databases :n:`{+ @ident}`.
+ The various possible :production:`hint_definition`\s are given below.
+
.. cmdv:: Hint @hint_definition
No database name is given: the hint is registered in the ``core`` database.
@@ -3718,7 +3758,7 @@ The general command to add a hint to some databases :n:`{+ @ident}` is
before, the tactic actually used is a restricted version of
:tacn:`apply`).
- .. cmdv:: Resolve <- @term
+ .. cmdv:: Hint Resolve <- @term
Adds the right-to-left implication of an equivalence as a hint.
@@ -3738,7 +3778,7 @@ The general command to add a hint to some databases :n:`{+ @ident}` is
.. exn:: @term cannot be used as a hint
:undocumented:
- .. cmdv:: Immediate {+ @term} : @ident
+ .. cmdv:: Hint Immediate {+ @term} : @ident
Adds each :n:`Hint Immediate @term`.
@@ -3981,7 +4021,7 @@ use one or several databases specific to your development.
Adds the rewriting rules :n:`{+ @term}` with a right-to-left orientation in
the bases :n:`{+ @ident}`.
-.. cmd:: Hint Rewrite {+ @term} using tactic : {+ @ident}
+.. cmd:: Hint Rewrite {+ @term} using @tactic : {+ @ident}
When the rewriting rules :n:`{+ @term}` in :n:`{+ @ident}` will be used, the
tactic ``tactic`` will be applied to the generated subgoals, the main subgoal
@@ -4202,7 +4242,7 @@ some incompatibilities.
Adds lemmas from :tacn:`auto` hint bases :n:`{+ @ident}` to the proof-search
environment.
-.. tacv:: firstorder tactic using {+ @qualid} with {+ @ident}
+.. tacv:: firstorder @tactic using {+ @qualid} with {+ @ident}
This combines the effects of the different variants of :tacn:`firstorder`.
@@ -4243,10 +4283,10 @@ some incompatibilities.
congruence.
Qed.
-.. tacv:: congruence n
+.. tacv:: congruence @num
- Tries to add at most `n` instances of hypotheses stating quantified equalities
- to the problem in order to solve it. A bigger value of `n` does not make
+ Tries to add at most :token:`num` instances of hypotheses stating quantified equalities
+ to the problem in order to solve it. A bigger value of :token:`num` does not make
success slower, only failure. You might consider adding some lemmas as
hypotheses using assert in order for :tacn:`congruence` to use them.
@@ -4556,14 +4596,14 @@ Automating
.. _btauto_grammar:
.. productionlist:: sentence
- t : `x`
- : true
- : false
- : orb `t` `t`
- : andb `t` `t`
- : xorb `t` `t`
- : negb `t`
- : if `t` then `t` else `t`
+ btauto_term : `ident`
+ : true
+ : false
+ : orb `btauto_term` `btauto_term`
+ : andb `btauto_term` `btauto_term`
+ : xorb `btauto_term` `btauto_term`
+ : negb `btauto_term`
+ : if `btauto_term` then `btauto_term` else `btauto_term`
Whenever the formula supplied is not a tautology, it also provides a
counter-example.
diff --git a/doc/sphinx/proof-engine/vernacular-commands.rst b/doc/sphinx/proof-engine/vernacular-commands.rst
index 26dc4e02cf..5f3e82938d 100644
--- a/doc/sphinx/proof-engine/vernacular-commands.rst
+++ b/doc/sphinx/proof-engine/vernacular-commands.rst
@@ -189,18 +189,13 @@ Requests to the environment
This command displays the type of :n:`@term`. When called in proof mode, the
term is checked in the local context of the current subgoal.
-
- .. TODO : selector is not a syntax entry
-
.. cmdv:: @selector: Check @term
This variant specifies on which subgoal to perform typing
(see Section :ref:`invocation-of-tactics`).
-.. TODO : convtactic is not a syntax entry
-
-.. cmd:: Eval @convtactic in @term
+.. cmd:: Eval @redexpr in @term
This command performs the specified reduction on :n:`@term`, and displays
the resulting term with its type. The term to be reduced may depend on
@@ -264,11 +259,11 @@ Requests to the environment
main symbol as in `"+"` or by its notation’s string as in `"_ + _"` or
`"_ 'U' _"`, see Section :ref:`notations`), the command works like ``Search`` :n:`@qualid`.
- .. cmdv:: Search @string%@key
+ .. cmdv:: Search @string%@ident
The string string must be a notation or the main
symbol of a notation which is then interpreted in the scope bound to
- the delimiting key :n:`@key` (see Section :ref:`LocalInterpretationRulesForNotations`).
+ the delimiting key :token:`ident` (see Section :ref:`LocalInterpretationRulesForNotations`).
.. cmdv:: Search @term_pattern
@@ -1132,6 +1127,8 @@ described first.
with lower level is expanded first. In case of a tie, the second one
(appearing in the cast type) is expanded.
+ .. prodn:: level ::= {| opaque | @num | expand }
+
Levels can be one of the following (higher to lower):
+ ``opaque`` : level of opaque constants. They cannot be expanded by
@@ -1167,19 +1164,19 @@ described first.
Print all the currently non-transparent strategies.
-.. cmd:: Declare Reduction @ident := @convtactic
+.. cmd:: Declare Reduction @ident := @redexpr
This command allows giving a short name to a reduction expression, for
- instance lazy beta delta [foo bar]. This short name can then be used
+ instance ``lazy beta delta [foo bar]``. This short name can then be used
in :n:`Eval @ident in` or ``eval`` directives. This command
accepts the
- Local modifier, for discarding this reduction name at the end of the
- file or module. For the moment the name cannot be qualified. In
+ ``Local`` modifier, for discarding this reduction name at the end of the
+ file or module. For the moment, the name is not qualified. In
particular declaring the same name in several modules or in several
- functor applications will be refused if these declarations are not
+ functor applications will be rejected if these declarations are not
local. The name :n:`@ident` cannot be used directly as an Ltac tactic, but
- nothing prevents the user to also perform a
- :n:`Ltac @ident := @convtactic`.
+ nothing prevents the user from also performing a
+ :n:`Ltac @ident := @redexpr`.
.. seealso:: :ref:`performingcomputations`
@@ -1208,7 +1205,7 @@ Controlling the locality of commands
effect of the command to the current module if the command does not occur in a
section and the Global modifier extends the effect outside the current
sections and current module if the command occurs in a section. As an example,
- the :cmd:`Arguments`, :cmd:`Ltac` or :cmd:`Notation` commands belong
+ the :cmd:`Arguments <Arguments (implicits)>`, :cmd:`Ltac` or :cmd:`Notation` commands belong
to this category. Notice that a subclass of these commands do not support
extension of their scope outside sections at all and the Global modifier is not
applicable to them.
diff --git a/doc/sphinx/user-extensions/syntax-extensions.rst b/doc/sphinx/user-extensions/syntax-extensions.rst
index 6da42f4a48..fd315c097d 100644
--- a/doc/sphinx/user-extensions/syntax-extensions.rst
+++ b/doc/sphinx/user-extensions/syntax-extensions.rst
@@ -109,7 +109,7 @@ the associativity of disjunction and conjunction, so let us apply for instance a
right associativity (which is the choice of Coq).
Precedence levels and associativity rules of notations have to be
-given between parentheses in a list of modifiers that the :cmd:`Notation`
+given between parentheses in a list of :token:`modifiers` that the :cmd:`Notation`
command understands. Here is how the previous examples refine.
.. coqtop:: in
@@ -249,7 +249,7 @@ bar of the notation.
Check (sig (fun x : nat => x=x)).
The second, more powerful control on printing is by using the format
-modifier. Here is an example
+:token:`modifier`. Here is an example
.. coqtop:: all
@@ -298,8 +298,8 @@ expression is performed at definition time. Type checking is done only
at the time of use of the notation.
.. note:: Sometimes, a notation is expected only for the parser. To do
- so, the option ``only parsing`` is allowed in the list of modifiers
- of :cmd:`Notation`. Conversely, the ``only printing`` modifier can be
+ so, the option ``only parsing`` is allowed in the list of :token:`modifiers`
+ of :cmd:`Notation`. Conversely, the ``only printing`` :token:`modifier` can be
used to declare that a notation should only be used for printing and
should not declare a parsing rule. In particular, such notations do
not modify the parser.
@@ -310,11 +310,11 @@ The Infix command
The :cmd:`Infix` command is a shortening for declaring notations of infix
symbols.
-.. cmd:: Infix "@symbol" := @term ({+, @modifier}).
+.. cmd:: Infix "@symbol" := @term {? (@modifiers) }.
This command is equivalent to
- :n:`Notation "x @symbol y" := (@term x y) ({+, @modifier}).`
+ :n:`Notation "x @symbol y" := (@term x y) {? (@modifiers) }.`
where ``x`` and ``y`` are fresh names. Here is an example.
@@ -437,7 +437,7 @@ application of the notation:
Check sigma z : nat, z = 0.
-Notice the modifier ``x ident`` in the declaration of the
+Notice the :token:`modifier` ``x ident`` in the declaration of the
notation. It tells to parse :g:`x` as a single identifier.
Binders bound in the notation and parsed as patterns
@@ -457,7 +457,7 @@ binder. Here is an example:
Check subset '(x,y), x+y=0.
-The modifier ``p pattern`` in the declaration of the notation tells to parse
+The :token:`modifier` ``p pattern`` in the declaration of the notation tells to parse
:g:`p` as a pattern. Note that a single variable is both an identifier and a
pattern, so, e.g., the following also works:
@@ -467,7 +467,7 @@ pattern, so, e.g., the following also works:
If one wants to prevent such a notation to be used for printing when the
pattern is reduced to a single identifier, one has to use instead
-the modifier ``p strict pattern``. For parsing, however, a
+the :token:`modifier` ``p strict pattern``. For parsing, however, a
``strict pattern`` will continue to include the case of a
variable. Here is an example showing the difference:
@@ -507,7 +507,7 @@ that ``x`` is parsed as a term at level 99 (as done in the notation for
:g:`sumbool`), but that this term has actually to be an identifier.
The notation :g:`{ x | P }` is already defined in the standard
-library with the ``as ident`` modifier. We cannot redefine it but
+library with the ``as ident`` :token:`modifier`. We cannot redefine it but
one can define an alternative notation, say :g:`{ p such that P }`,
using instead ``as pattern``.
@@ -527,7 +527,7 @@ is just an identifier, one could have said
``p at level 99 as strict pattern``.
Note also that in the absence of a ``as ident``, ``as strict pattern`` or
-``as pattern`` modifiers, the default is to consider sub-expressions occurring
+``as pattern`` :token:`modifier`\s, the default is to consider sub-expressions occurring
in binding position and parsed as terms to be ``as ident``.
.. _NotationsWithBinders:
@@ -628,7 +628,7 @@ except that in the iterator
position of the binding variable of a ``fun`` or a ``forall``.
To specify that the part “``x .. y``” of the notation parses a sequence of
-binders, ``x`` and ``y`` must be marked as ``binder`` in the list of modifiers
+binders, ``x`` and ``y`` must be marked as ``binder`` in the list of :token:`modifiers`
of the notation. The binders of the parsed sequence are used to fill the
occurrences of the first placeholder of the iterating pattern which is
repeatedly nested as many times as the number of binders generated. If ever the
@@ -678,7 +678,7 @@ Predefined entries
~~~~~~~~~~~~~~~~~~
By default, sub-expressions are parsed as terms and the corresponding
-grammar entry is called :n:`@constr`. However, one may sometimes want
+grammar entry is called ``constr``. However, one may sometimes want
to restrict the syntax of terms in a notation. For instance, the
following notation will accept to parse only global reference in
position of :g:`x`:
@@ -866,16 +866,17 @@ notations are given below. The optional :production:`scope` is described in
:ref:`Scopes`.
.. productionlist:: coq
- notation : [Local] Notation `string` := `term` [`modifiers`] [: `scope`].
- : [Local] Infix `string` := `qualid` [`modifiers`] [: `scope`].
- : [Local] Reserved Notation `string` [`modifiers`] .
+ notation : [Local] Notation `string` := `term` [(`modifiers`)] [: `scope`].
+ : [Local] Infix `string` := `qualid` [(`modifiers`)] [: `scope`].
+ : [Local] Reserved Notation `string` [(`modifiers`)] .
: Inductive `ind_body` [`decl_notation`] with … with `ind_body` [`decl_notation`].
: CoInductive `ind_body` [`decl_notation`] with … with `ind_body` [`decl_notation`].
: Fixpoint `fix_body` [`decl_notation`] with … with `fix_body` [`decl_notation`].
: CoFixpoint `cofix_body` [`decl_notation`] with … with `cofix_body` [`decl_notation`].
: [Local] Declare Custom Entry `ident`.
decl_notation : [where `string` := `term` [: `scope`] and … and `string` := `term` [: `scope`]].
- modifiers : at level `num`
+ modifiers : `modifier`, … , `modifier`
+ modifier : at level `num`
: in custom `ident`
: in custom `ident` at level `num`
: `ident` , … , `ident` at level `num` [`binderinterp`]
@@ -924,6 +925,17 @@ notations are given below. The optional :production:`scope` is described in
given to some notation, say ``"{ y } & { z }"`` in fact applies to the
underlying ``"{ x }"``\-free rule which is ``"y & z"``).
+.. note:: Notations such as ``"( p | q )"`` (or starting with ``"( x | "``,
+ more generally) are deprecated as they conflict with the syntax for
+ nested disjunctive patterns (see :ref:`extendedpatternmatching`),
+ and are not honored in pattern expressions.
+
+ .. warn:: Use of @string Notation is deprecated as it is inconsistent with pattern syntax.
+
+ This warning is disabled by default to avoid spurious diagnostics
+ due to legacy notation in the Coq standard library.
+ It can be turned on with the ``-w disj-pattern-notation`` flag.
+
Persistence of notations
++++++++++++++++++++++++
@@ -1032,11 +1044,11 @@ Local opening of an interpretation scope
+++++++++++++++++++++++++++++++++++++++++
It is possible to locally extend the interpretation scope stack using the syntax
-:g:`(term)%key` (or simply :g:`term%key` for atomic terms), where key is a
+:n:`(@term)%@ident` (or simply :n:`@term%@ident` for atomic terms), where :token:`ident` is a
special identifier called *delimiting key* and bound to a given scope.
In such a situation, the term term, and all its subterms, are
-interpreted in the scope stack extended with the scope bound tokey.
+interpreted in the scope stack extended with the scope bound to :token:`ident`.
.. cmd:: Delimit Scope @scope with @ident
@@ -1051,15 +1063,15 @@ interpreted in the scope stack extended with the scope bound tokey.
Binding arguments of a constant to an interpretation scope
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.. cmd:: Arguments @qualid {+ @name%@scope}
+.. cmd:: Arguments @qualid {+ @name%@ident}
:name: Arguments (scopes)
It is possible to set in advance that some arguments of a given constant have
to be interpreted in a given scope. The command is
- :n:`Arguments @qualid {+ @name%@scope}` where the list is a prefix of the
- arguments of ``qualid`` eventually annotated with their ``scope``. Grouping
+ :n:`Arguments @qualid {+ @name%@ident}` where the list is a prefix of the
+ arguments of ``qualid`` optionally annotated with their scope :token:`ident`. Grouping
round parentheses can be used to decorate multiple arguments with the same
- scope. ``scope`` can be either a scope name or its delimiting key. For
+ scope. :token:`ident` can be either a scope name or its delimiting key. For
example the following command puts the first two arguments of :g:`plus_fct`
in the scope delimited by the key ``F`` (``Rfun_scope``) and the last
argument in the scope delimited by the key ``R`` (``R_scope``).
@@ -1070,13 +1082,13 @@ Binding arguments of a constant to an interpretation scope
The ``Arguments`` command accepts scopes decoration to all grouping
parentheses. In the following example arguments A and B are marked as
- maximally inserted implicit arguments and are put into the type_scope scope.
+ maximally inserted implicit arguments and are put into the ``type_scope`` scope.
.. coqdoc::
Arguments respectful {A B}%type (R R')%signature _ _.
- When interpreting a term, if some of the arguments of qualid are built
+ When interpreting a term, if some of the arguments of :token:`qualid` are built
from a notation, then this notation is interpreted in the scope stack
extended by the scope bound (if any) to this argument. The effect of
the scope is limited to the argument itself. It does not propagate to
@@ -1088,21 +1100,21 @@ Binding arguments of a constant to an interpretation scope
This command can be used to clear argument scopes of :token:`qualid`.
- .. cmdv:: Arguments @qualid {+ @name%scope} : extra scopes
+ .. cmdv:: Arguments @qualid {+ @name%@ident} : extra scopes
Defines extra argument scopes, to be used in case of coercion to ``Funclass``
(see the :ref:`implicitcoercions` chapter) or with a computed type.
- .. cmdv:: Global Arguments @qualid {+ @name%@scope}
+ .. cmdv:: Global Arguments @qualid {+ @name%@ident}
- This behaves like :n:`Arguments qualid {+ @name%@scope}` but survives when a
+ This behaves like :n:`Arguments qualid {+ @name%@ident}` but survives when a
section is closed instead of stopping working at section closing. Without the
``Global`` modifier, the effect of the command stops when the section it belongs
to ends.
- .. cmdv:: Local Arguments @qualid {+ @name%@scope}
+ .. cmdv:: Local Arguments @qualid {+ @name%@ident}
- This behaves like :n:`Arguments @qualid {+ @name%@scope}` but does not
+ This behaves like :n:`Arguments @qualid {+ @name%@ident}` but does not
survive modules and files. Without the ``Local`` modifier, the effect of the
command is visible from within other modules or files.
@@ -1141,10 +1153,10 @@ Binding types of arguments to an interpretation scope
When an interpretation scope is naturally associated to a type (e.g. the
scope of operations on the natural numbers), it may be convenient to bind it
- to this type. When a scope ``scope`` is bound to a type ``type``, any new function
- defined later on gets its arguments of type ``type`` interpreted by default in
- scope scope (this default behavior can however be overwritten by explicitly
- using the command :cmd:`Arguments`).
+ to this type. When a scope :token:`scope` is bound to a type :token:`type`, any function
+ gets its arguments of type :token:`type` interpreted by default in scope :token:`scope`
+ (this default behavior can however be overwritten by explicitly using the
+ command :cmd:`Arguments <Arguments (scopes)>`).
Whether the argument of a function has some type ``type`` is determined
statically. For instance, if ``f`` is a polymorphic function of type
@@ -1172,6 +1184,11 @@ Binding types of arguments to an interpretation scope
Check (fun x y1 y2 z t => P _ (x + t) ((f _ (y1 + y2) + z))).
+ .. note:: When active, a bound scope has effect on all defined functions
+ (even if they are defined after the :cmd:`Bind Scope` directive), except
+ if argument scopes were assigned explicitly using the
+ :cmd:`Arguments <Arguments (scopes)>` command.
+
.. note:: The scopes ``type_scope`` and ``function_scope`` also have a local
effect on interpretation. See the next section.
@@ -1657,15 +1674,15 @@ Tactic notations allow to customize the syntax of tactics. They have the followi
tacn : Tactic Notation [`tactic_level`] [`prod_item` … `prod_item`] := `tactic`.
prod_item : `string` | `tactic_argument_type`(`ident`)
tactic_level : (at level `num`)
- tactic_argument_type : `ident` | `simple_intropattern` | `reference`
- : `hyp` | `hyp_list` | `ne_hyp_list`
- : `constr` | `uconstr` | `constr_list` | `ne_constr_list`
- : `integer` | `integer_list` | `ne_integer_list`
- : `int_or_var` | `int_or_var_list` | `ne_int_or_var_list`
- : `tactic` | `tactic0` | `tactic1` | `tactic2` | `tactic3`
- : `tactic4` | `tactic5`
+ tactic_argument_type : ident | simple_intropattern | reference
+ : hyp | hyp_list | ne_hyp_list
+ : constr | uconstr | constr_list | ne_constr_list
+ : integer | integer_list | ne_integer_list
+ : int_or_var | int_or_var_list | ne_int_or_var_list
+ : tactic | tactic0 | tactic1 | tactic2 | tactic3
+ : tactic4 | tactic5
-.. cmd:: Tactic Notation {? (at level @level)} {+ @prod_item} := @tactic.
+.. cmd:: Tactic Notation {? (at level @num)} {+ @prod_item} := @tactic.
A tactic notation extends the parser and pretty-printer of tactics with a new
rule made of the list of production items. It then evaluates into the
@@ -1699,9 +1716,9 @@ Tactic notations allow to customize the syntax of tactics. They have the followi
- intro
* - ``simple_intropattern``
- - intro_pattern
- - an intro pattern
- - intros
+ - simple_intropattern
+ - an introduction pattern
+ - assert as
* - ``hyp``
- identifier
diff --git a/doc/tools/coqrst/__init__.py b/doc/tools/coqrst/__init__.py
index 2dda7d9216..710a90a6f1 100644
--- a/doc/tools/coqrst/__init__.py
+++ b/doc/tools/coqrst/__init__.py
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/doc/tools/coqrst/checkdeps.py b/doc/tools/coqrst/checkdeps.py
index 11f95c4e94..91f0a7cb1b 100644
--- a/doc/tools/coqrst/checkdeps.py
+++ b/doc/tools/coqrst/checkdeps.py
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/doc/tools/coqrst/coqdoc/__init__.py b/doc/tools/coqrst/coqdoc/__init__.py
index a89a548e2c..8d19924df1 100644
--- a/doc/tools/coqrst/coqdoc/__init__.py
+++ b/doc/tools/coqrst/coqdoc/__init__.py
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/doc/tools/coqrst/coqdoc/main.py b/doc/tools/coqrst/coqdoc/main.py
index ba58ff0084..adacba97cc 100644
--- a/doc/tools/coqrst/coqdoc/main.py
+++ b/doc/tools/coqrst/coqdoc/main.py
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/doc/tools/coqrst/coqdomain.py b/doc/tools/coqrst/coqdomain.py
index 4bdfac7c42..6c32a4968c 100644
--- a/doc/tools/coqrst/coqdomain.py
+++ b/doc/tools/coqrst/coqdomain.py
@@ -1,7 +1,6 @@
-# -*- coding: utf-8 -*-
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/doc/tools/coqrst/notations/Makefile b/doc/tools/coqrst/notations/Makefile
index c017aed951..29132f1cd7 100644
--- a/doc/tools/coqrst/notations/Makefile
+++ b/doc/tools/coqrst/notations/Makefile
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/doc/tools/coqrst/notations/TacticNotations.g b/doc/tools/coqrst/notations/TacticNotations.g
index 01c656eb23..905b52525a 100644
--- a/doc/tools/coqrst/notations/TacticNotations.g
+++ b/doc/tools/coqrst/notations/TacticNotations.g
@@ -1,6 +1,6 @@
/************************************************************************/
/* * The Coq Proof Assistant / The Coq Development Team */
-/* v * INRIA, CNRS and contributors - Copyright 1999-2018 */
+/* v * INRIA, CNRS and contributors - Copyright 1999-2019 */
/* <O___,, * (see CREDITS file for the list of authors) */
/* \VV/ **************************************************************/
/* // * This file is distributed under the terms of the */
diff --git a/doc/tools/coqrst/notations/fontsupport.py b/doc/tools/coqrst/notations/fontsupport.py
index a3efd97f5b..f0df7f1c01 100755
--- a/doc/tools/coqrst/notations/fontsupport.py
+++ b/doc/tools/coqrst/notations/fontsupport.py
@@ -1,8 +1,7 @@
#!/usr/bin/env python2
-# -*- coding: utf-8 -*-
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
@@ -12,6 +11,9 @@
"""Transform a font to center each of its characters in square bounding boxes.
See https://stackoverflow.com/questions/37377476/ for background information.
+
+This script is here for reference. It was used to generate the modified
+font CoqNotations.ttf from UbuntuMono-B.ttf.
"""
from collections import Counter
diff --git a/doc/tools/coqrst/notations/html.py b/doc/tools/coqrst/notations/html.py
index d2b5d86b37..d9c5383774 100644
--- a/doc/tools/coqrst/notations/html.py
+++ b/doc/tools/coqrst/notations/html.py
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/doc/tools/coqrst/notations/parsing.py b/doc/tools/coqrst/notations/parsing.py
index 2312e09090..7b7febe668 100644
--- a/doc/tools/coqrst/notations/parsing.py
+++ b/doc/tools/coqrst/notations/parsing.py
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/doc/tools/coqrst/notations/plain.py b/doc/tools/coqrst/notations/plain.py
index 2180c8e6a5..93a7ec4683 100644
--- a/doc/tools/coqrst/notations/plain.py
+++ b/doc/tools/coqrst/notations/plain.py
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/doc/tools/coqrst/notations/regexp.py b/doc/tools/coqrst/notations/regexp.py
index ea820c719e..697201a5d5 100644
--- a/doc/tools/coqrst/notations/regexp.py
+++ b/doc/tools/coqrst/notations/regexp.py
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/doc/tools/coqrst/notations/sphinx.py b/doc/tools/coqrst/notations/sphinx.py
index 4ed09e04a9..4ca0a2ef83 100644
--- a/doc/tools/coqrst/notations/sphinx.py
+++ b/doc/tools/coqrst/notations/sphinx.py
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/doc/tools/coqrst/repl/ansicolors.py b/doc/tools/coqrst/repl/ansicolors.py
index 495eea9107..6d9c79d16c 100644
--- a/doc/tools/coqrst/repl/ansicolors.py
+++ b/doc/tools/coqrst/repl/ansicolors.py
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/doc/tools/coqrst/repl/coqtop.py b/doc/tools/coqrst/repl/coqtop.py
index 2b124ee5c1..3dc20db82b 100644
--- a/doc/tools/coqrst/repl/coqtop.py
+++ b/doc/tools/coqrst/repl/coqtop.py
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
diff --git a/dune b/dune
index 4beba1c14f..6fb0612e4e 100644
--- a/dune
+++ b/dune
@@ -8,6 +8,13 @@
(ocaml409
(flags :standard -strict-sequence -strict-formats -keep-locs -rectypes -w -9-27+40+60 -warn-error -5 -alert --deprecated)))
+; Information about flags for release mode:
+;
+; In #9665 we tried to add (c_flags -O3) to the release setup,
+; unfortunately the resulting VM seems to be slower [5% slower on
+; fourcolor, thus we keep the default C flags for now, which seem to
+; be -O2.
+
; The _ profile could help factoring the above, however it doesn't
; seem to work like we'd expect/like:
;
diff --git a/engine/eConstr.ml b/engine/eConstr.ml
index 981f9454e4..23d066df58 100644
--- a/engine/eConstr.ml
+++ b/engine/eConstr.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/eConstr.mli b/engine/eConstr.mli
index 25ceffbd04..2afce38db7 100644
--- a/engine/eConstr.mli
+++ b/engine/eConstr.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/evar_kinds.ml b/engine/evar_kinds.ml
index ea1e572548..bfe0aa3544 100644
--- a/engine/evar_kinds.ml
+++ b/engine/evar_kinds.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/evar_kinds.mli b/engine/evar_kinds.mli
index 4facdb2005..008633d754 100644
--- a/engine/evar_kinds.mli
+++ b/engine/evar_kinds.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/evarutil.ml b/engine/evarutil.ml
index 7c2ecca89e..911b189deb 100644
--- a/engine/evarutil.ml
+++ b/engine/evarutil.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/evarutil.mli b/engine/evarutil.mli
index 907be8eba2..e9d579af32 100644
--- a/engine/evarutil.mli
+++ b/engine/evarutil.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/evd.ml b/engine/evd.ml
index 15b4c31851..b621a3fe2f 100644
--- a/engine/evd.ml
+++ b/engine/evd.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -430,6 +430,14 @@ type evar_flags =
restricted_evars : Evar.t Evar.Map.t;
typeclass_evars : Evar.Set.t }
+type side_effect_role =
+| Schema of inductive * string
+
+type side_effects = {
+ seff_private : Safe_typing.private_constants;
+ seff_roles : side_effect_role Cmap.t;
+}
+
type evar_map = {
(* Existential variables *)
defn_evars : evar_info EvMap.t;
@@ -444,7 +452,7 @@ type evar_map = {
metas : clbinding Metamap.t;
evar_flags : evar_flags;
(** Interactive proofs *)
- effects : Safe_typing.private_constants;
+ effects : side_effects;
future_goals : Evar.t list; (** list of newly created evars, to be
eventually turned into goals if not solved.*)
principal_future_goal : Evar.t option; (** if [Some e], [e] must be
@@ -672,6 +680,11 @@ let empty_evar_flags =
restricted_evars = Evar.Map.empty;
typeclass_evars = Evar.Set.empty }
+let empty_side_effects = {
+ seff_private = Safe_typing.empty_private_constants;
+ seff_roles = Cmap.empty;
+}
+
let empty = {
defn_evars = EvMap.empty;
undf_evars = EvMap.empty;
@@ -680,7 +693,7 @@ let empty = {
last_mods = Evar.Set.empty;
evar_flags = empty_evar_flags;
metas = Metamap.empty;
- effects = Safe_typing.empty_private_constants;
+ effects = empty_side_effects;
evar_names = EvNames.empty; (* id<->key for undefined evars *)
future_goals = [];
principal_future_goal = None;
@@ -1011,12 +1024,17 @@ exception UniversesDiffer = UState.UniversesDiffer
(**********************************************************)
(* Side effects *)
+let concat_side_effects eff eff' = {
+ seff_private = Safe_typing.concat_private eff.seff_private eff'.seff_private;
+ seff_roles = Cmap.fold Cmap.add eff.seff_roles eff'.seff_roles;
+}
+
let emit_side_effects eff evd =
- { evd with effects = Safe_typing.concat_private eff evd.effects;
- universes = UState.emit_side_effects eff evd.universes }
+ let effects = concat_side_effects eff evd.effects in
+ { evd with effects; universes = UState.emit_side_effects eff.seff_private evd.universes }
let drop_side_effects evd =
- { evd with effects = Safe_typing.empty_private_constants; }
+ { evd with effects = empty_side_effects; }
let eval_side_effects evd = evd.effects
diff --git a/engine/evd.mli b/engine/evd.mli
index 587a1de044..132f7bc745 100644
--- a/engine/evd.mli
+++ b/engine/evd.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -307,10 +307,22 @@ val dependent_evar_ident : Evar.t -> evar_map -> Id.t
(** {5 Side-effects} *)
-val emit_side_effects : Safe_typing.private_constants -> evar_map -> evar_map
+type side_effect_role =
+| Schema of inductive * string
+
+type side_effects = {
+ seff_private : Safe_typing.private_constants;
+ seff_roles : side_effect_role Cmap.t;
+}
+
+val empty_side_effects : side_effects
+
+val concat_side_effects : side_effects -> side_effects -> side_effects
+
+val emit_side_effects : side_effects -> evar_map -> evar_map
(** Push a side-effect into the evar map. *)
-val eval_side_effects : evar_map -> Safe_typing.private_constants
+val eval_side_effects : evar_map -> side_effects
(** Return the effects contained in the evar map. *)
val drop_side_effects : evar_map -> evar_map
diff --git a/engine/ftactic.ml b/engine/ftactic.ml
index dab2e7d5ef..a727375c8d 100644
--- a/engine/ftactic.ml
+++ b/engine/ftactic.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -18,8 +18,8 @@ type 'a focus =
(** Type of tactics potentially goal-dependent. If it contains a [Depends],
then the length of the inner list is guaranteed to be the number of
- currently focussed goals. Otherwise it means the tactic does not depend
- on the current set of focussed goals. *)
+ currently focused goals. Otherwise it means the tactic does not depend
+ on the current set of focused goals. *)
type 'a t = 'a focus Proofview.tactic
let return (x : 'a) : 'a t = Proofview.tclUNIT (Uniform x)
diff --git a/engine/ftactic.mli b/engine/ftactic.mli
index ed95d62bc6..666a74d283 100644
--- a/engine/ftactic.mli
+++ b/engine/ftactic.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -18,7 +18,7 @@ type +'a t = 'a focus Proofview.tactic
(** The type of focussing tactics. A focussing tactic is like a normal tactic,
except that it is able to remember it have entered a goal. Whenever this is
the case, each subsequent effect of the tactic is dispatched on the
- focussed goals. This is a monad. *)
+ focused goals. This is a monad. *)
(** {5 Monadic interface} *)
@@ -32,20 +32,20 @@ val bind : 'a t -> ('a -> 'b t) -> 'b t
val lift : 'a Proofview.tactic -> 'a t
(** Transform a tactic into a focussing tactic. The resulting tactic is not
- focussed. *)
+ focused. *)
val run : 'a t -> ('a -> unit Proofview.tactic) -> unit Proofview.tactic
(** Given a continuation producing a tactic, evaluates the focussing tactic. If
- the tactic has not focussed, then the continuation is evaluated once.
- Otherwise it is called in each of the currently focussed goals. *)
+ the tactic has not focused, then the continuation is evaluated once.
+ Otherwise it is called in each of the currently focused goals. *)
(** {5 Focussing} *)
-(** Enter a goal. The resulting tactic is focussed. *)
+(** Enter a goal. The resulting tactic is focused. *)
val enter : (Proofview.Goal.t -> 'a t) -> 'a t
(** Enter a goal, without evar normalization. The resulting tactic is
- focussed. *)
+ focused. *)
val with_env : 'a t -> (Environ.env*'a) t
(** [with_env t] returns, in addition to the return type of [t], an
diff --git a/engine/logic_monad.ml b/engine/logic_monad.ml
index a504ee28e2..2354d2c5e8 100644
--- a/engine/logic_monad.ml
+++ b/engine/logic_monad.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/logic_monad.mli b/engine/logic_monad.mli
index 3e57baab26..90c920439a 100644
--- a/engine/logic_monad.mli
+++ b/engine/logic_monad.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/namegen.ml b/engine/namegen.ml
index 10ece55a63..77d45ce1e4 100644
--- a/engine/namegen.ml
+++ b/engine/namegen.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/namegen.mli b/engine/namegen.mli
index 240fd8fa81..7a8544f2d6 100644
--- a/engine/namegen.mli
+++ b/engine/namegen.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/nameops.ml b/engine/nameops.ml
index 31914f9cfa..baa19050d7 100644
--- a/engine/nameops.ml
+++ b/engine/nameops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/nameops.mli b/engine/nameops.mli
index 222573450b..a0f3a72233 100644
--- a/engine/nameops.mli
+++ b/engine/nameops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/proofview.ml b/engine/proofview.ml
index c00c90e5e9..c4a624e462 100644
--- a/engine/proofview.ml
+++ b/engine/proofview.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -373,32 +373,24 @@ let tclTRYFOCUS i j t = tclFOCUS ~nosuchgoal:(tclUNIT ()) i j t
let tclFOCUSLIST ?(nosuchgoal=tclZERO (NoSuchGoals 0)) l t =
let open Proof in
Comb.get >>= fun comb ->
- let n = CList.length comb in
- (* First, remove empty intervals, and bound the intervals to the number
- of goals. *)
- let sanitize (i, j) =
- if i > j then None
- else if i > n then None
- else if j < 1 then None
- else Some ((max i 1), (min j n))
- in
- let l = CList.map_filter sanitize l in
+ let n = CList.length comb in
+ let ok (i, j) = 1 <= i && i <= j && j <= n in
+ if not (CList.for_all ok l) then nosuchgoal
+ else
match l with
- | [] -> nosuchgoal
- | (mi, _) :: _ ->
- (* Get the left-most goal to focus. This goal won't move, and we
- will then place all the other goals to focus to the right. *)
- let mi = CList.fold_left (fun m (i, _) -> min m i) mi l in
- (* [CList.goto] returns a zipper, so that
- [(rev left) @ sub_right = comb]. *)
- let left, sub_right = CList.goto (mi-1) comb in
- let p x _ = CList.exists (fun (i, j) -> i <= x + mi && x + mi <= j) l in
- let sub, right = CList.partitioni p sub_right in
- let mj = mi - 1 + CList.length sub in
- Comb.set (CList.rev_append left (sub @ right)) >>
- tclFOCUS mi mj t
-
-
+ | [] -> nosuchgoal
+ | (mi, _) :: _ ->
+ (* Get the left-most goal to focus. This goal won't move, and we
+ will then place all the other goals to focus to the right. *)
+ let mi = CList.fold_left (fun m (i, _) -> min m i) mi l in
+ (* [CList.goto] returns a zipper, so that
+ [(rev left) @ sub_right = comb]. *)
+ let left, sub_right = CList.goto (mi-1) comb in
+ let p x _ = CList.exists (fun (i, j) -> i <= x + mi && x + mi <= j) l in
+ let sub, right = CList.partitioni p sub_right in
+ let mj = mi - 1 + CList.length sub in
+ Comb.set (CList.rev_append left (sub @ right)) >>
+ tclFOCUS mi mj t
(** Like {!tclFOCUS} but selects a single goal by name. *)
let tclFOCUSID ?(nosuchgoal=tclZERO (NoSuchGoals 1)) id t =
diff --git a/engine/proofview.mli b/engine/proofview.mli
index 60697c1611..f90f02f3e1 100644
--- a/engine/proofview.mli
+++ b/engine/proofview.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -381,7 +381,7 @@ val tclENV : Environ.env tactic
(** {7 Put-like primitives} *)
(** [tclEFFECTS eff] add the effects [eff] to the current state. *)
-val tclEFFECTS : Safe_typing.private_constants -> unit tactic
+val tclEFFECTS : Evd.side_effects -> unit tactic
(** [mark_as_unsafe] declares the current tactic is unsafe. *)
val mark_as_unsafe : unit tactic
diff --git a/engine/proofview_monad.ml b/engine/proofview_monad.ml
index 8ed75a8d00..37f6b5e352 100644
--- a/engine/proofview_monad.ml
+++ b/engine/proofview_monad.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/proofview_monad.mli b/engine/proofview_monad.mli
index f0c9fdb589..342bfa2806 100644
--- a/engine/proofview_monad.mli
+++ b/engine/proofview_monad.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/termops.ml b/engine/termops.ml
index fcacb53ac4..1ed2d93b3c 100644
--- a/engine/termops.ml
+++ b/engine/termops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -306,9 +306,15 @@ let pr_evar_map_gen with_univs pr_evars env sigma =
let pr_evar_list env sigma l =
let open Evd in
+ let pr_restrict ev =
+ match is_restricted_evar sigma ev with
+ | None -> mt ()
+ | Some ev' -> str " (restricted to " ++ Evar.print ev' ++ str ")"
+ in
let pr (ev, evi) =
h 0 (Evar.print ev ++
str "==" ++ pr_evar_info env sigma evi ++
+ pr_restrict ev ++
(if evi.evar_body == Evar_empty
then str " {" ++ pr_existential_key sigma ev ++ str "}"
else mt ()))
diff --git a/engine/termops.mli b/engine/termops.mli
index a9217b3586..f970b9ece0 100644
--- a/engine/termops.mli
+++ b/engine/termops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/uState.ml b/engine/uState.ml
index adea78d4c9..5ed016e0d0 100644
--- a/engine/uState.ml
+++ b/engine/uState.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -214,7 +214,8 @@ let process_universe_constraints ctx cstrs =
| Inr l, Inl r | Inl r, Inr l ->
let alg = LSet.mem l ctx.uctx_univ_algebraic in
let inst = univ_level_rem l r r in
- if alg then (instantiate_variable l inst vars; local)
+ if alg && not (LSet.mem l (Universe.levels inst)) then
+ (instantiate_variable l inst vars; local)
else
let lu = Universe.make l in
if univ_level_mem l r then
@@ -452,9 +453,9 @@ let restrict ctx vars =
let uctx' = restrict_universe_context ctx.uctx_local vars in
{ ctx with uctx_local = uctx' }
-let demote_seff_univs entry uctx =
+let demote_seff_univs universes uctx =
let open Entries in
- match entry.const_entry_universes with
+ match universes with
| Polymorphic_entry _ -> uctx
| Monomorphic_entry (univs, _) ->
let seff = LSet.union uctx.uctx_seff_univs univs in
diff --git a/engine/uState.mli b/engine/uState.mli
index 3df7f9e8e9..9689f2e961 100644
--- a/engine/uState.mli
+++ b/engine/uState.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -100,7 +100,7 @@ val restrict_universe_context : ContextSet.t -> LSet.t -> ContextSet.t
universes are preserved. *)
val restrict : t -> Univ.LSet.t -> t
-val demote_seff_univs : Safe_typing.private_constants Entries.definition_entry -> t -> t
+val demote_seff_univs : Entries.universes_entry -> t -> t
type rigid =
| UnivRigid
diff --git a/engine/univGen.ml b/engine/univGen.ml
index f1deb1bfaf..a347bba188 100644
--- a/engine/univGen.ml
+++ b/engine/univGen.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/univGen.mli b/engine/univGen.mli
index 34920e5620..1c8735bfa8 100644
--- a/engine/univGen.mli
+++ b/engine/univGen.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/univMinim.ml b/engine/univMinim.ml
index 4f9f9ce6a5..1b7c33b9c1 100644
--- a/engine/univMinim.ml
+++ b/engine/univMinim.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/univMinim.mli b/engine/univMinim.mli
index 9f80b7acbc..21f6efe86a 100644
--- a/engine/univMinim.mli
+++ b/engine/univMinim.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/univNames.ml b/engine/univNames.ml
index 7e6ed5e4c0..887191f9b7 100644
--- a/engine/univNames.ml
+++ b/engine/univNames.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/univNames.mli b/engine/univNames.mli
index e9c517babf..ebb665c4fd 100644
--- a/engine/univNames.mli
+++ b/engine/univNames.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/univProblem.ml b/engine/univProblem.ml
index bc2edc13de..07cde25564 100644
--- a/engine/univProblem.ml
+++ b/engine/univProblem.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/univProblem.mli b/engine/univProblem.mli
index ffaebe15ab..68c5d4cd5e 100644
--- a/engine/univProblem.mli
+++ b/engine/univProblem.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/univSubst.ml b/engine/univSubst.ml
index 2f59a3fa85..737eb83a3d 100644
--- a/engine/univSubst.ml
+++ b/engine/univSubst.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/univSubst.mli b/engine/univSubst.mli
index e76d253336..fc10a694e9 100644
--- a/engine/univSubst.mli
+++ b/engine/univSubst.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/univops.ml b/engine/univops.ml
index 53c42023ad..92f69317fd 100644
--- a/engine/univops.ml
+++ b/engine/univops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/engine/univops.mli b/engine/univops.mli
index 597d2d6785..6cc7868a38 100644
--- a/engine/univops.mli
+++ b/engine/univops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/gramlib/grammar.ml b/gramlib/grammar.ml
index c452c7b307..f9d18e7190 100644
--- a/gramlib/grammar.ml
+++ b/gramlib/grammar.ml
@@ -222,7 +222,7 @@ let is_before : type s1 s2 r1 r2 a1 a2. (s1, r1, a1) ty_symbol -> (s2, r2, a2) t
| Stoken _, _ -> true
| _ -> false
-(** Ancilliary datatypes *)
+(** Ancillary datatypes *)
type 'a ty_rec = MayRec : ty_mayrec ty_rec | NoRec : ty_norec ty_rec
diff --git a/ide/MacOS/Info.plist.template b/ide/MacOS/Info.plist.template
index fbe7773dd4..e4fb0e5980 100644
--- a/ide/MacOS/Info.plist.template
+++ b/ide/MacOS/Info.plist.template
@@ -66,7 +66,7 @@
<key>CFBundleGetInfoString</key>
<string>Coq_vVERSION</string>
<key>NSHumanReadableCopyright</key>
- <string>Copyright 1999-2016, The Coq Development Team INRIA - CNRS - LIX - LRI - PPS</string>
+ <string>Copyright 1999-2019, Inria, CNRS and contributors</string>
<key>CFBundleHelpBookFolder</key>
<string>share/doc/coq/html/</string>
<key>CFAppleHelpAnchor</key>
diff --git a/ide/config_lexer.mli b/ide/config_lexer.mli
index 4719612cda..462c921230 100644
--- a/ide/config_lexer.mli
+++ b/ide/config_lexer.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/config_lexer.mll b/ide/config_lexer.mll
index 55d8d96980..c5fbd15ce1 100644
--- a/ide/config_lexer.mll
+++ b/ide/config_lexer.mll
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/configwin_types.ml b/ide/configwin_types.ml
index 251e3dded3..4c66a6944e 100644
--- a/ide/configwin_types.ml
+++ b/ide/configwin_types.ml
@@ -87,7 +87,7 @@ type modifiers_param = {
(** The value, as a list of modifiers and a key code *)
md_editable : bool ; (** indicates if the value can be changed *)
md_f_apply : Gdk.Tags.modifier list -> unit ;
- (** the function to call to apply the new value of the paramter *)
+ (** the function to call to apply the new value of the parameter *)
md_help : string option ; (** optional help string *)
md_expand : bool ; (** expand or not *)
md_allow : Gdk.Tags.modifier list
diff --git a/ide/coq.ml b/ide/coq.ml
index a420a3cbf5..92c24b3b85 100644
--- a/ide/coq.ml
+++ b/ide/coq.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coq.mli b/ide/coq.mli
index 3af0aa697e..3f0848aae9 100644
--- a/ide/coq.mli
+++ b/ide/coq.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coqOps.ml b/ide/coqOps.ml
index 8da9900724..566654218d 100644
--- a/ide/coqOps.ml
+++ b/ide/coqOps.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coqOps.mli b/ide/coqOps.mli
index 3685fea92e..83ad8c15dc 100644
--- a/ide/coqOps.mli
+++ b/ide/coqOps.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coq_commands.ml b/ide/coq_commands.ml
index b0bafb7930..bfd99e7ce3 100644
--- a/ide/coq_commands.ml
+++ b/ide/coq_commands.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -126,7 +126,6 @@ let commands = [
"Show Intros";
"Show Programs";
"Show Proof";
- "Show Script";
"Show Tree";*)
"Structure";
"Syntactic Definition";
@@ -221,7 +220,6 @@ let state_preserving = [
"Show Intro";
"Show Intros";
"Show Proof";
- "Show Script";
"Show Tree";
"Test Printing If";
diff --git a/ide/coq_commands.mli b/ide/coq_commands.mli
index 259d790e0c..5f8ce30901 100644
--- a/ide/coq_commands.mli
+++ b/ide/coq_commands.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coq_lex.mli b/ide/coq_lex.mli
index 100411933a..fbb70be3ab 100644
--- a/ide/coq_lex.mli
+++ b/ide/coq_lex.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coq_lex.mll b/ide/coq_lex.mll
index b6654f6d7a..b46ab49771 100644
--- a/ide/coq_lex.mll
+++ b/ide/coq_lex.mll
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -50,6 +50,41 @@ and comment = parse
| utf8_extra_byte { incr utf8_adjust; comment lexbuf }
| _ { comment lexbuf }
+and quotation o c n l = parse | eof { raise Unterminated } | _ {
+ let x = Lexing.lexeme lexbuf in
+ if x = o then quotation_nesting o c n l 1 lexbuf
+ else if x = c then
+ if n = 1 && l = 1 then ()
+ else quotation_closing o c n l 1 lexbuf
+ else quotation o c n l lexbuf
+}
+
+and quotation_nesting o c n l v = parse | eof { raise Unterminated } | _ {
+ let x = Lexing.lexeme lexbuf in
+ if x = o then
+ if n = v+1 then quotation o c n (l+1) lexbuf
+ else quotation_nesting o c n l (v+1) lexbuf
+ else if x = c then quotation_closing o c n l 1 lexbuf
+ else quotation o c n l lexbuf
+}
+
+and quotation_closing o c n l v = parse | eof { raise Unterminated } | _ {
+ let x = Lexing.lexeme lexbuf in
+ if x = c then
+ if n = v+1 then
+ if l = 1 then ()
+ else quotation o c n (l-1) lexbuf
+ else quotation_closing o c n l (v+1) lexbuf
+ else if x = o then quotation_nesting o c n l 1 lexbuf
+ else quotation o c n l lexbuf
+}
+
+and quotation_start o c n = parse | eof { raise Unterminated } | _ {
+ let x = Lexing.lexeme lexbuf in
+ if x = o then quotation_start o c (n+1) lexbuf
+ else quotation o c n 1 lexbuf
+}
+
(** NB : [mkiter] should be called on increasing offsets *)
and sentence initial stamp = parse
@@ -83,6 +118,18 @@ and sentence initial stamp = parse
if initial then stamp (utf8_lexeme_start lexbuf + String.length (Lexing.lexeme lexbuf) - 1) Tags.Script.sentence;
sentence initial stamp lexbuf
}
+ | ['a'-'z' 'A'-'Z'] ":{" {
+ quotation_start "{" "}" 1 lexbuf;
+ sentence false stamp lexbuf
+ }
+ | ['a'-'z' 'A'-'Z'] ":[" {
+ quotation_start "[" "]" 1 lexbuf;
+ sentence false stamp lexbuf
+ }
+ | ['a'-'z' 'A'-'Z'] ":(" {
+ quotation_start "(" ")" 1 lexbuf;
+ sentence false stamp lexbuf
+ }
| space+ {
(* Parsing spaces is the only situation preserving initiality *)
sentence initial stamp lexbuf
diff --git a/ide/coqide.ml b/ide/coqide.ml
index 4f00be27a1..8d95dcee27 100644
--- a/ide/coqide.ml
+++ b/ide/coqide.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coqide.mli b/ide/coqide.mli
index 1d438ec381..7abd3a1f68 100644
--- a/ide/coqide.mli
+++ b/ide/coqide.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coqide_QUARTZ.ml.in b/ide/coqide_QUARTZ.ml.in
index a08bac5772..64f0ca76e8 100644
--- a/ide/coqide_QUARTZ.ml.in
+++ b/ide/coqide_QUARTZ.ml.in
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coqide_WIN32.ml.in b/ide/coqide_WIN32.ml.in
index 0793a1cc1c..a075b0ddba 100644
--- a/ide/coqide_WIN32.ml.in
+++ b/ide/coqide_WIN32.ml.in
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coqide_X11.ml.in b/ide/coqide_X11.ml.in
index 6a5784eac3..454f3a71d6 100644
--- a/ide/coqide_X11.ml.in
+++ b/ide/coqide_X11.ml.in
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coqide_main.ml b/ide/coqide_main.ml
index 79420b3857..f2ce2e8bd9 100644
--- a/ide/coqide_main.ml
+++ b/ide/coqide_main.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coqide_main.mli b/ide/coqide_main.mli
index 9db9ecd12e..d0712f8075 100644
--- a/ide/coqide_main.mli
+++ b/ide/coqide_main.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coqide_os_specific.mli b/ide/coqide_os_specific.mli
index ebd09099f0..038b41acac 100644
--- a/ide/coqide_os_specific.mli
+++ b/ide/coqide_os_specific.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/coqide_ui.mli b/ide/coqide_ui.mli
index afc5447aba..4f8bae59ae 100644
--- a/ide/coqide_ui.mli
+++ b/ide/coqide_ui.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/document.ml b/ide/document.ml
index 0d3b36a7fd..cee490861d 100644
--- a/ide/document.ml
+++ b/ide/document.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/document.mli b/ide/document.mli
index 2f460e6d8c..eea250bd50 100644
--- a/ide/document.mli
+++ b/ide/document.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/dune b/ide/dune
index 5710fcbec7..7200915593 100644
--- a/ide/dune
+++ b/ide/dune
@@ -23,6 +23,11 @@
(libraries coq.toplevel coqide-server.protocol)
(link_flags -linkall))
+(install
+ (section bin)
+ (package coqide-server)
+ (files (idetop.bc as coqidetop.byte)))
+
; IDE Client
(library
(name coqide_gui)
diff --git a/ide/fake_ide.ml b/ide/fake_ide.ml
index 4e26cb6095..dfc16d39f3 100644
--- a/ide/fake_ide.ml
+++ b/ide/fake_ide.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/fileOps.ml b/ide/fileOps.ml
index e4c8942cf1..07f4ea565e 100644
--- a/ide/fileOps.ml
+++ b/ide/fileOps.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/fileOps.mli b/ide/fileOps.mli
index 44a19f9981..3317639346 100644
--- a/ide/fileOps.mli
+++ b/ide/fileOps.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/gtk_parsing.ml b/ide/gtk_parsing.ml
index 82a5e9cdf6..a84c161a84 100644
--- a/ide/gtk_parsing.ml
+++ b/ide/gtk_parsing.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/gtk_parsing.mli b/ide/gtk_parsing.mli
index a9f3e1222d..80171370c2 100644
--- a/ide/gtk_parsing.mli
+++ b/ide/gtk_parsing.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/idetop.ml b/ide/idetop.ml
index 970d7cf650..c38b8fa820 100644
--- a/ide/idetop.ml
+++ b/ide/idetop.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -339,7 +339,7 @@ let import_search_constraint = function
| Interface.Include_Blacklist -> Search.Include_Blacklist
let search flags =
- let pstate = Vernacstate.Proof_global.get () in
+ let pstate = Vernacstate.Proof_global.get_pstate () in
List.map export_coq_object (Search.interface_search ?pstate (
List.map (fun (c, b) -> (import_search_constraint c, b)) flags)
)
diff --git a/ide/ideutils.ml b/ide/ideutils.ml
index 8c5b3fcc5b..246254c6a5 100644
--- a/ide/ideutils.ml
+++ b/ide/ideutils.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/ideutils.mli b/ide/ideutils.mli
index 57f59d19fe..bacb273657 100644
--- a/ide/ideutils.mli
+++ b/ide/ideutils.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/macos_prehook.mli b/ide/macos_prehook.mli
index 9db9ecd12e..d0712f8075 100644
--- a/ide/macos_prehook.mli
+++ b/ide/macos_prehook.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/microPG.ml b/ide/microPG.ml
index 25cab4638c..7d8fd44a75 100644
--- a/ide/microPG.ml
+++ b/ide/microPG.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/microPG.mli b/ide/microPG.mli
index bc9b39d823..db8f156f48 100644
--- a/ide/microPG.mli
+++ b/ide/microPG.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/minilib.ml b/ide/minilib.ml
index 39183e000f..09a7112098 100644
--- a/ide/minilib.ml
+++ b/ide/minilib.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/minilib.mli b/ide/minilib.mli
index 6cc36f5f2a..c5849cc2c9 100644
--- a/ide/minilib.mli
+++ b/ide/minilib.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/preferences.ml b/ide/preferences.ml
index 4e2e3f31e6..ea0495bb19 100644
--- a/ide/preferences.ml
+++ b/ide/preferences.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/preferences.mli b/ide/preferences.mli
index b01c4598d8..490756d4f2 100644
--- a/ide/preferences.mli
+++ b/ide/preferences.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/protocol/interface.ml b/ide/protocol/interface.ml
index ccb6bedaf6..362833743e 100644
--- a/ide/protocol/interface.ml
+++ b/ide/protocol/interface.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -34,7 +34,7 @@ type status = {
status_path : string list;
(** Module path of the current proof *)
status_proofname : string option;
- (** Current proof name. [None] if no focussed proof is in progress *)
+ (** Current proof name. [None] if no focused proof is in progress *)
status_allproofs : string list;
(** List of all pending proofs. Order is not significant *)
status_proofnum : int;
@@ -43,7 +43,7 @@ type status = {
type 'a pre_goals = {
fg_goals : 'a list;
- (** List of the focussed goals *)
+ (** List of the focused goals *)
bg_goals : ('a list * 'a list) list;
(** Zipper representing the unfocused background goals *)
shelved_goals : 'a list;
@@ -70,7 +70,7 @@ type option_state = {
opt_sync : bool;
(** Whether an option is synchronous *)
opt_depr : bool;
- (** Wheter an option is deprecated *)
+ (** Whether an option is deprecated *)
opt_name : string;
(** A short string that is displayed when using [Test] *)
opt_value : option_value;
diff --git a/ide/protocol/richpp.ml b/ide/protocol/richpp.ml
index b2ce55e89a..507b985d2f 100644
--- a/ide/protocol/richpp.ml
+++ b/ide/protocol/richpp.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/protocol/richpp.mli b/ide/protocol/richpp.mli
index 31fc7b56f1..970efc2c1e 100644
--- a/ide/protocol/richpp.mli
+++ b/ide/protocol/richpp.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -25,7 +25,7 @@ type 'annotation located = {
of [ppcmds] as a semi-structured document
that represents (located) annotations of this string.
The [get_annotations] function is used to convert tags into the desired
- annotation. [width] sets the printing witdh of the formatter. *)
+ annotation. [width] sets the printing width of the formatter. *)
val rich_pp : int -> Pp.t -> Pp.pp_tag located Xml_datatype.gxml
(** [annotations_positions ssdoc] returns a list associating each
diff --git a/ide/protocol/serialize.ml b/ide/protocol/serialize.ml
index 86074d44d5..815c190381 100644
--- a/ide/protocol/serialize.ml
+++ b/ide/protocol/serialize.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/protocol/serialize.mli b/ide/protocol/serialize.mli
index af082f25b1..9b16adda67 100644
--- a/ide/protocol/serialize.mli
+++ b/ide/protocol/serialize.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/protocol/xml_printer.ml b/ide/protocol/xml_printer.ml
index 488ef7bf57..9719fe747e 100644
--- a/ide/protocol/xml_printer.ml
+++ b/ide/protocol/xml_printer.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/protocol/xml_printer.mli b/ide/protocol/xml_printer.mli
index 178f7c808f..dd3f308147 100644
--- a/ide/protocol/xml_printer.mli
+++ b/ide/protocol/xml_printer.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -16,11 +16,11 @@ type target = TChannel of out_channel | TBuffer of Buffer.t
val make : target -> t
(** Print the xml data structure to a source into a compact xml string (without
- any user-readable formating ). *)
+ any user-readable formatting ). *)
val print : t -> xml -> unit
(** Print the xml data structure into a compact xml string (without
- any user-readable formating ). *)
+ any user-readable formatting ). *)
val to_string : xml -> string
(** Print the xml data structure into an user-readable string with
diff --git a/ide/protocol/xmlprotocol.ml b/ide/protocol/xmlprotocol.ml
index e18219210f..cad65cc5d6 100644
--- a/ide/protocol/xmlprotocol.ml
+++ b/ide/protocol/xmlprotocol.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -405,7 +405,7 @@ end = struct
| (lg, rg) :: l ->
Printf.sprintf "%i:%a"
(List.length lg + List.length rg) pr_focus l in
- Printf.sprintf "Still focussed: [%a]." pr_focus g.bg_goals
+ Printf.sprintf "Still focused: [%a]." pr_focus g.bg_goals
else
let pr_goal { goal_hyp = hyps; goal_ccl = goal } =
"[" ^ String.concat "; " (List.map Pp.string_of_ppcmds hyps) ^ " |- " ^
diff --git a/ide/protocol/xmlprotocol.mli b/ide/protocol/xmlprotocol.mli
index ba6000f0a0..133cdd9220 100644
--- a/ide/protocol/xmlprotocol.mli
+++ b/ide/protocol/xmlprotocol.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/sentence.ml b/ide/sentence.ml
index 2e508969aa..f9034e210c 100644
--- a/ide/sentence.ml
+++ b/ide/sentence.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/sentence.mli b/ide/sentence.mli
index 75c815c508..978d178175 100644
--- a/ide/sentence.mli
+++ b/ide/sentence.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/session.ml b/ide/session.ml
index 90412f53f0..3792730455 100644
--- a/ide/session.ml
+++ b/ide/session.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -447,7 +447,7 @@ let build_layout (sn:session) =
let script_scroll = GBin.scrolled_window
~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing:script_frame#add () in
let state_paned = GPack.paned `VERTICAL
- ~packing:(eval_paned#pack2 ~shrink:false) () in
+ ~packing:(eval_paned#pack2 ~shrink:true) () in
(* Proof buffer. *)
@@ -455,19 +455,21 @@ let build_layout (sn:session) =
let proof_detachable = Wg_Detachable.detachable ~title () in
let () = proof_detachable#button#misc#hide () in
let () = proof_detachable#frame#set_shadow_type `IN in
- let () = state_paned#add1 proof_detachable#coerce in
- let callback _ = proof_detachable#show in
+ let () = state_paned#pack1 ~shrink:true proof_detachable#coerce in
+ let proof_scroll = GBin.scrolled_window
+ ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing:proof_detachable#pack () in
+ let callback _ = proof_detachable#show;
+ proof_scroll#coerce#misc#set_size_request ~width:0 ~height:0 ()
+ in
let () = proof_detachable#connect#attached ~callback in
let callback _ =
- sn.proof#coerce#misc#set_size_request ~width:500 ~height:400 ()
+ proof_scroll#coerce#misc#set_size_request ~width:500 ~height:400 ()
in
let () = proof_detachable#connect#detached ~callback in
- let proof_scroll = GBin.scrolled_window
- ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing:proof_detachable#pack () in
(* Message buffer. *)
- let message_frame = GPack.notebook ~packing:state_paned#add () in
+ let message_frame = GPack.notebook ~packing:(state_paned#pack2 ~shrink:true) () in
let add_msg_page pos name text (w : GObj.widget) =
let detachable =
Wg_Detachable.detachable ~title:(text^" ("^name^")") () in
@@ -503,18 +505,14 @@ let build_layout (sn:session) =
let _ =
eval_paned#misc#connect#size_allocate
~callback:
- (let old_paned_width = ref 2 in
- let old_paned_height = ref 2 in
+ (let b = ref true in
fun {Gtk.width=paned_width;Gtk.height=paned_height} ->
- if !old_paned_width <> paned_width ||
- !old_paned_height <> paned_height
- then begin
+ if !b then begin
eval_paned#set_position
- (eval_paned#position * paned_width / !old_paned_width);
+ (paned_width / 2);
state_paned#set_position
- (state_paned#position * paned_height / !old_paned_height);
- old_paned_width := paned_width;
- old_paned_height := paned_height;
+ (paned_height / 2);
+ b := false
end)
in
session_box#pack sn.finder#coerce;
diff --git a/ide/session.mli b/ide/session.mli
index bb38169001..f5d8d7c991 100644
--- a/ide/session.mli
+++ b/ide/session.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/tags.ml b/ide/tags.ml
index e9dbcb9e67..9e46152c39 100644
--- a/ide/tags.ml
+++ b/ide/tags.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/tags.mli b/ide/tags.mli
index 1df934fddf..82ee632698 100644
--- a/ide/tags.mli
+++ b/ide/tags.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/unicode_bindings.ml b/ide/unicode_bindings.ml
index e2f98302ea..2731f355bf 100644
--- a/ide/unicode_bindings.ml
+++ b/ide/unicode_bindings.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/unicode_bindings.mli b/ide/unicode_bindings.mli
index 5b38eeb920..a526dbd441 100644
--- a/ide/unicode_bindings.mli
+++ b/ide/unicode_bindings.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/utf8_convert.mli b/ide/utf8_convert.mli
index 9b3db5fdd9..81f9f56361 100644
--- a/ide/utf8_convert.mli
+++ b/ide/utf8_convert.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/utf8_convert.mll b/ide/utf8_convert.mll
index 6e36ae1c8a..d034ab87b8 100644
--- a/ide/utf8_convert.mll
+++ b/ide/utf8_convert.mll
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_Command.ml b/ide/wg_Command.ml
index 2cadd7ffbf..f1a2fa4f2a 100644
--- a/ide/wg_Command.ml
+++ b/ide/wg_Command.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_Command.mli b/ide/wg_Command.mli
index 1e0eb675c6..26ef3a87ee 100644
--- a/ide/wg_Command.mli
+++ b/ide/wg_Command.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_Completion.ml b/ide/wg_Completion.ml
index c39d6d0563..7758d89ed8 100644
--- a/ide/wg_Completion.ml
+++ b/ide/wg_Completion.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_Completion.mli b/ide/wg_Completion.mli
index aa2f36a5d8..ac9e6cd94f 100644
--- a/ide/wg_Completion.mli
+++ b/ide/wg_Completion.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_Detachable.ml b/ide/wg_Detachable.ml
index 755a42eadd..e5947cfcd0 100644
--- a/ide/wg_Detachable.ml
+++ b/ide/wg_Detachable.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_Detachable.mli b/ide/wg_Detachable.mli
index 9588cf18fa..84803c2158 100644
--- a/ide/wg_Detachable.mli
+++ b/ide/wg_Detachable.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_Find.ml b/ide/wg_Find.ml
index fe079e8a9e..db99bc0439 100644
--- a/ide/wg_Find.ml
+++ b/ide/wg_Find.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_Find.mli b/ide/wg_Find.mli
index b4c1a40ead..e3fa75a2c0 100644
--- a/ide/wg_Find.mli
+++ b/ide/wg_Find.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_MessageView.ml b/ide/wg_MessageView.ml
index 53e004c4e3..0d434398fb 100644
--- a/ide/wg_MessageView.ml
+++ b/ide/wg_MessageView.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_MessageView.mli b/ide/wg_MessageView.mli
index 613f1b4190..a7614fac74 100644
--- a/ide/wg_MessageView.mli
+++ b/ide/wg_MessageView.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_Notebook.ml b/ide/wg_Notebook.ml
index 424979d846..8fa0259c32 100644
--- a/ide/wg_Notebook.ml
+++ b/ide/wg_Notebook.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_Notebook.mli b/ide/wg_Notebook.mli
index 9447b21c0b..ce3143dfcc 100644
--- a/ide/wg_Notebook.mli
+++ b/ide/wg_Notebook.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_ProofView.ml b/ide/wg_ProofView.ml
index 7bf73b5ebe..0bf1d18185 100644
--- a/ide/wg_ProofView.ml
+++ b/ide/wg_ProofView.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_ProofView.mli b/ide/wg_ProofView.mli
index 922f5a69e0..2ed42d7b5c 100644
--- a/ide/wg_ProofView.mli
+++ b/ide/wg_ProofView.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_RoutedMessageViews.ml b/ide/wg_RoutedMessageViews.ml
index 4bd3035244..30cd2a0824 100644
--- a/ide/wg_RoutedMessageViews.ml
+++ b/ide/wg_RoutedMessageViews.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_RoutedMessageViews.mli b/ide/wg_RoutedMessageViews.mli
index cca43d55ba..fcfbfffea1 100644
--- a/ide/wg_RoutedMessageViews.mli
+++ b/ide/wg_RoutedMessageViews.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_ScriptView.ml b/ide/wg_ScriptView.ml
index c1ed9b7506..279815d671 100644
--- a/ide/wg_ScriptView.ml
+++ b/ide/wg_ScriptView.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_ScriptView.mli b/ide/wg_ScriptView.mli
index a2e341c128..91c8e758a5 100644
--- a/ide/wg_ScriptView.mli
+++ b/ide/wg_ScriptView.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_Segment.ml b/ide/wg_Segment.ml
index b62c0a2190..0537c1ac6b 100644
--- a/ide/wg_Segment.ml
+++ b/ide/wg_Segment.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/ide/wg_Segment.mli b/ide/wg_Segment.mli
index 07f545fee7..1a9d634689 100644
--- a/ide/wg_Segment.mli
+++ b/ide/wg_Segment.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/constrexpr.ml b/interp/constrexpr.ml
index 3ebbbdfb88..e4af0fcee0 100644
--- a/interp/constrexpr.ml
+++ b/interp/constrexpr.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/constrexpr_ops.ml b/interp/constrexpr_ops.ml
index bcb2f34377..8fce24249c 100644
--- a/interp/constrexpr_ops.ml
+++ b/interp/constrexpr_ops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/constrexpr_ops.mli b/interp/constrexpr_ops.mli
index f1a8ed202f..3ed240d356 100644
--- a/interp/constrexpr_ops.mli
+++ b/interp/constrexpr_ops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/constrextern.ml b/interp/constrextern.ml
index bb66658a37..8573dccdf9 100644
--- a/interp/constrextern.ml
+++ b/interp/constrextern.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -107,7 +107,7 @@ let _show_inactive_notations () =
let deactivate_notation nr =
match nr with
| SynDefRule kn ->
- (* shouldn't we check wether it is well defined? *)
+ (* shouldn't we check whether it is well defined? *)
inactive_notations_table := IRuleSet.add nr !inactive_notations_table
| NotationRule (scopt, ntn) ->
match availability_of_notation (scopt, ntn) (scopt, []) with
@@ -757,11 +757,10 @@ let extended_glob_local_binder_of_decl ?loc u = DAst.make ?loc (extended_glob_lo
(* mapping glob_constr to constr_expr *)
let extern_glob_sort = function
- | GSProp -> GSProp
- | GProp -> GProp
- | GSet -> GSet
- | GType _ as s when !print_universes -> s
- | GType _ -> GType []
+ (* In case we print a glob_constr w/o having passed through detyping *)
+ | UNamed [(GSProp,0) | (GProp,0) | (GSet,0)] as u -> u
+ | UNamed _ when not !print_universes -> UAnonymous {rigid=true}
+ | UNamed _ | UAnonymous _ as u -> u
let extern_universes = function
| Some _ as l when !print_universes -> l
@@ -1312,10 +1311,10 @@ let rec glob_of_pat avoid env sigma pat = DAst.make @@ match pat with
Array.map (fun (bl,_,_) -> bl) v,
Array.map (fun (_,_,ty) -> ty) v,
Array.map (fun (_,bd,_) -> bd) v)
- | PSort Sorts.InSProp -> GSort GSProp
- | PSort Sorts.InProp -> GSort GProp
- | PSort Sorts.InSet -> GSort GSet
- | PSort Sorts.InType -> GSort (GType [])
+ | PSort Sorts.InSProp -> GSort (UNamed [GSProp,0])
+ | PSort Sorts.InProp -> GSort (UNamed [GProp,0])
+ | PSort Sorts.InSet -> GSort (UNamed [GSet,0])
+ | PSort Sorts.InType -> GSort (UAnonymous {rigid=true})
| PInt i -> GInt i
let extern_constr_pattern env sigma pat =
diff --git a/interp/constrextern.mli b/interp/constrextern.mli
index f09b316cd6..7b8b93377b 100644
--- a/interp/constrextern.mli
+++ b/interp/constrextern.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/constrintern.ml b/interp/constrintern.ml
index 753065b7dd..be8f99028c 100644
--- a/interp/constrintern.ml
+++ b/interp/constrintern.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -372,6 +372,9 @@ let check_hidden_implicit_parameters ?loc id impls =
strbrk "a parameter of the inductive type; bound variables in " ++
strbrk "the type of a constructor shall use a different name.")
+let pure_push_name_env (id,implargs) env =
+ {env with ids = Id.Set.add id env.ids; impls = Id.Map.add id implargs env.impls}
+
let push_name_env ?(global_level=false) ntnvars implargs env =
let open CAst in
function
@@ -386,15 +389,23 @@ let push_name_env ?(global_level=false) ntnvars implargs env =
set_var_scope ?loc id false (env.tmp_scope,env.scopes) ntnvars;
if global_level then Dumpglob.dump_definition CAst.(make ?loc id) true "var"
else Dumpglob.dump_binding ?loc id;
- {env with ids = Id.Set.add id env.ids; impls = Id.Map.add id implargs env.impls}
+ pure_push_name_env (id,implargs) env
+
+let remember_binders_impargs env bl =
+ List.map_filter (fun (na,_,_,_) ->
+ match na with
+ | Anonymous -> None
+ | Name id -> Some (id,Id.Map.find id env.impls)) bl
+
+let restore_binders_impargs env l =
+ List.fold_right pure_push_name_env l env
let intern_generalized_binder ?(global_level=false) intern_type ntnvars
env {loc;v=na} b' t ty =
let ids = (match na with Anonymous -> fun x -> x | Name na -> Id.Set.add na) env.ids in
let ty, ids' =
- if t then ty, ids else
- Implicit_quantifiers.implicit_application ids
- Implicit_quantifiers.combine_params_freevar ty
+ if t then ty, ids
+ else Implicit_quantifiers.implicit_application ids ty
in
let ty' = intern_type {env with ids = ids; unb = true} ty in
let fvs = Implicit_quantifiers.generalizable_vars_of_glob_constr ~bound:ids ~allowed:ids' ty' in
@@ -998,18 +1009,10 @@ let intern_reference qid =
in
Smartlocate.global_of_extended_global r
-let sort_info_of_level_info (info: level_info) : (Libnames.qualid * int) option =
- match info with
- | UAnonymous -> None
- | UUnknown -> None
- | UNamed id -> Some (id, 0)
-
let glob_sort_of_level (level: glob_level) : glob_sort =
match level with
- | GSProp -> GSProp
- | GProp -> GProp
- | GSet -> GSet
- | GType info -> GType [sort_info_of_level_info info]
+ | UAnonymous {rigid} -> UAnonymous {rigid}
+ | UNamed id -> UNamed [id,0]
(* Is it a global reference or a syntactic definition? *)
let intern_qualid ?(no_secvar=false) qid intern env ntnvars us args =
@@ -1045,7 +1048,7 @@ let intern_qualid ?(no_secvar=false) qid intern env ntnvars us args =
DAst.make ?loc @@ GApp (DAst.make ?loc:loc' @@ GRef (ref, us), arg)
| _ -> err ()
end
- | Some [s], GSort (GType []) -> DAst.make ?loc @@ GSort (glob_sort_of_level s)
+ | Some [s], GSort (UAnonymous {rigid=true}) -> DAst.make ?loc @@ GSort (glob_sort_of_level s)
| Some [_old_level], GSort _new_sort ->
(* TODO: add old_level and new_sort to the error message *)
user_err ?loc (str "Cannot change universe level of notation " ++ pr_qualid qid)
@@ -1229,7 +1232,7 @@ let add_local_defs_and_check_length loc env g pl args = match g with
let maxargs = Inductiveops.constructor_nalldecls env cstr in
if List.length pl' + List.length args > maxargs then
error_wrong_numarg_constructor ?loc env cstr (Inductiveops.constructor_nrealargs env cstr);
- (* Two possibilities: either the args are given with explict
+ (* Two possibilities: either the args are given with explicit
variables for local definitions, then we give the explicit args
extended with local defs, so that there is nothing more to be
added later on; or the args are not enough to have all arguments,
@@ -1308,7 +1311,7 @@ let find_pattern_variable qid =
if qualid_is_ident qid then qualid_basename qid
else raise (InternalizationError(qid.CAst.loc,NotAConstructor qid))
-let check_duplicate loc fields =
+let check_duplicate ?loc fields =
let eq (ref1, _) (ref2, _) = qualid_eq ref1 ref2 in
let dups = List.duplicates eq fields in
match dups with
@@ -1353,7 +1356,7 @@ let sort_fields ~complete loc fields completer =
try Nametab.shortest_qualid_of_global ?loc Id.Set.empty global_record_id
with Not_found ->
anomaly (str "Environment corruption for records.") in
- let () = check_duplicate loc fields in
+ let () = check_duplicate ?loc fields in
let (end_index, (* one past the last field index *)
first_field_index, (* index of the first field of the record *)
proj_list) (* list of projections *)
@@ -1467,7 +1470,7 @@ let alias_of als = match als.alias_ids with
@returns a raw_case_pattern_expr :
- no notations and syntactic definition
- - global reference and identifeir instead of reference
+ - global reference and identifier instead of reference
*)
@@ -1642,15 +1645,13 @@ let drop_notations_pattern looked_for genv =
| CPatCast (_,_) ->
(* We raise an error if the pattern contains a cast, due to
current restrictions on casts in patterns. Cast in patterns
- are supportted only in local binders and only at top
- level. In fact, they are currently eliminated by the
- parser. The only reason why they are in the
- [cases_pattern_expr] type is that the parser needs to factor
- the "(c : t)" notation with user defined notations (such as
- the pair). In the long term, we will try to support such
- casts everywhere, and use them to print the domains of
- lambdas in the encoding of match in constr. This check is
- here and not in the parser because it would require
+ are supported only in local binders and only at top level.
+ The only reason they are in the [cases_pattern_expr] type
+ is that the parser needs to factor the "c : t" notation
+ with user defined notations. In the long term, we will try to
+ support such casts everywhere, and perhaps use them to print
+ the domains of lambdas in the encoding of match in constr.
+ This check is here and not in the parser because it would require
duplicating the levels of the [pattern] rule. *)
CErrors.user_err ?loc ~hdr:"drop_notations_pattern"
(Pp.strbrk "Casts are not supported in this pattern.")
@@ -1845,7 +1846,7 @@ let internalize globalenv env pattern_mode (_, ntnvars as lvar) c =
in
apply_impargs c env imp subscopes l loc
- | CFix ({ CAst.loc = locid; v = iddef}, dl) ->
+ | CFix ({ CAst.loc = locid; v = iddef}, dl) ->
let lf = List.map (fun ({CAst.v = id},_,_,_,_) -> id) dl in
let dl = Array.of_list dl in
let n =
@@ -1867,14 +1868,18 @@ let internalize globalenv env pattern_mode (_, ntnvars as lvar) c =
rbefore) recarg in
let (env',rbl) = List.fold_left intern_local_binder (env',rbefore) after in
let bl = List.rev (List.map glob_local_binder_of_extended rbl) in
- (n, bl, intern_type env' ty, env')) dl in
- let idl = Array.map2 (fun (_,_,_,_,bd) (a,b,c,env') ->
- let env'' = List.fold_left_i (fun i en name ->
- let (_,bli,tyi,_) = idl_temp.(i) in
- let fix_args = (List.map (fun (na, bk, _, _) -> (build_impls bk na)) bli) in
- push_name_env ntnvars (impls_type_list ~args:fix_args tyi)
- en (CAst.make @@ Name name)) 0 env' lf in
- (a,b,c,intern {env'' with tmp_scope = None} bd)) dl idl_temp in
+ let bl_impls = remember_binders_impargs env' bl in
+ (n, bl, intern_type env' ty, bl_impls)) dl in
+ (* We add the recursive functions to the environment *)
+ let env_rec = List.fold_left_i (fun i en name ->
+ let (_,bli,tyi,_) = idl_temp.(i) in
+ let fix_args = (List.map (fun (na, bk, _, _) -> build_impls bk na) bli) in
+ push_name_env ntnvars (impls_type_list ~args:fix_args tyi)
+ en (CAst.make @@ Name name)) 0 env lf in
+ let idl = Array.map2 (fun (_,_,_,_,bd) (n,bl,ty,before_impls) ->
+ (* We add the binders common to body and type to the environment *)
+ let env_body = restore_binders_impargs env_rec before_impls in
+ (n,bl,ty,intern {env_body with tmp_scope = None} bd)) dl idl_temp in
DAst.make ?loc @@
GRec (GFix
(Array.map (fun (ro,_,_,_) -> ro) idl,n),
@@ -1894,15 +1899,18 @@ let internalize globalenv env pattern_mode (_, ntnvars as lvar) c =
let idl_tmp = Array.map
(fun ({ CAst.loc; v = id },bl,ty,_) ->
let (env',rbl) = List.fold_left intern_local_binder (env,[]) bl in
- (List.rev (List.map glob_local_binder_of_extended rbl),
- intern_type env' ty,env')) dl in
- let idl = Array.map2 (fun (_,_,_,bd) (b,c,env') ->
- let env'' = List.fold_left_i (fun i en name ->
- let (bli,tyi,_) = idl_tmp.(i) in
- let cofix_args = List.map (fun (na, bk, _, _) -> (build_impls bk na)) bli in
- push_name_env ntnvars (impls_type_list ~args:cofix_args tyi)
- en (CAst.make @@ Name name)) 0 env' lf in
- (b,c,intern {env'' with tmp_scope = None} bd)) dl idl_tmp in
+ let bl = List.rev (List.map glob_local_binder_of_extended rbl) in
+ let bl_impls = remember_binders_impargs env' bl in
+ (bl,intern_type env' ty,bl_impls)) dl in
+ let env_rec = List.fold_left_i (fun i en name ->
+ let (bli,tyi,_) = idl_tmp.(i) in
+ let cofix_args = List.map (fun (na, bk, _, _) -> build_impls bk na) bli in
+ push_name_env ntnvars (impls_type_list ~args:cofix_args tyi)
+ en (CAst.make @@ Name name)) 0 env lf in
+ let idl = Array.map2 (fun (_,_,_,bd) (b,c,bl_impls) ->
+ (* We add the binders common to body and type to the environment *)
+ let env_body = restore_binders_impargs env_rec bl_impls in
+ (b,c,intern {env_body with tmp_scope = None} bd)) dl idl_tmp in
DAst.make ?loc @@
GRec (GCoFix n,
Array.of_list lf,
@@ -2445,10 +2453,8 @@ let interp_glob_context_evars ?(program_mode=false) env sigma k bl =
let r = Retyping.relevance_of_type env sigma t in
let d = LocalAssum (make_annot na r,t) in
let impls =
- if k == Implicit then
- let na = match na with Name n -> Some n | Anonymous -> None in
- (ExplByPos (n, na), (true, true, true)) :: impls
- else impls
+ if k == Implicit then CAst.make (Some (na,true)) :: impls
+ else CAst.make None :: impls
in
(push_rel d env, sigma, d::params, succ n, impls)
| Some b ->
@@ -2457,7 +2463,7 @@ let interp_glob_context_evars ?(program_mode=false) env sigma k bl =
let d = LocalDef (make_annot na r, c, t) in
(push_rel d env, sigma, d::params, n, impls))
(env,sigma,[],k+1,[]) (List.rev bl)
- in sigma, ((env, par), impls)
+ in sigma, ((env, par), List.rev impls)
let interp_context_evars ?program_mode ?(global_level=false) ?(impl_env=empty_internalization_env) ?(shift=0) env sigma params =
let int_env,bl = intern_context global_level env impl_env params in
diff --git a/interp/constrintern.mli b/interp/constrintern.mli
index 0d4bc91f57..6c1f4898d9 100644
--- a/interp/constrintern.mli
+++ b/interp/constrintern.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -61,10 +61,10 @@ type internalization_env = var_internalization_data Id.Map.t
val empty_internalization_env : internalization_env
val compute_internalization_data : env -> evar_map -> var_internalization_type ->
- types -> Impargs.manual_explicitation list -> var_internalization_data
+ types -> Impargs.manual_implicits -> var_internalization_data
val compute_internalization_env : env -> evar_map -> ?impls:internalization_env -> var_internalization_type ->
- Id.t list -> types list -> Impargs.manual_explicitation list list ->
+ Id.t list -> types list -> Impargs.manual_implicits list ->
internalization_env
type ltac_sign = {
@@ -189,3 +189,7 @@ val for_grammar : ('a -> 'b) -> 'a -> 'b
(** Placeholder for global option, should be moved to a parameter *)
val get_asymmetric_patterns : unit -> bool
+
+val check_duplicate : ?loc:Loc.t -> (qualid * constr_expr) list -> unit
+(** Check that a list of record field definitions doesn't contain
+ duplicates. *)
diff --git a/interp/deprecation.ml b/interp/deprecation.ml
new file mode 100644
index 0000000000..3b02ba4664
--- /dev/null
+++ b/interp/deprecation.ml
@@ -0,0 +1,21 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+
+type t = { since : string option ; note : string option }
+
+let make ?since ?note () = { since ; note }
+
+let create_warning ~object_name ~warning_name name_printer =
+ let open Pp in
+ CWarnings.create ~name:warning_name ~category:"deprecated"
+ (fun (qid,depr) -> str object_name ++ spc () ++ name_printer qid ++
+ strbrk " is deprecated" ++
+ pr_opt (fun since -> str "since " ++ str since) depr.since ++
+ str "." ++ pr_opt (fun note -> str note) depr.note)
diff --git a/interp/discharge.mli b/interp/deprecation.mli
index f7408937cf..f8083c2a5b 100644
--- a/interp/discharge.mli
+++ b/interp/deprecation.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -8,9 +8,9 @@
(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
-open Declarations
-open Entries
-open Opaqueproof
+type t = { since : string option ; note : string option }
-val process_inductive :
- Lib.abstr_info -> work_list -> mutual_inductive_body -> mutual_inductive_entry
+val make : ?since:string -> ?note:string -> unit -> t
+
+val create_warning : object_name:string -> warning_name:string ->
+ ('b -> Pp.t) -> ?loc:Loc.t -> 'b * t -> unit
diff --git a/interp/discharge.ml b/interp/discharge.ml
deleted file mode 100644
index 1efd13adb1..0000000000
--- a/interp/discharge.ml
+++ /dev/null
@@ -1,118 +0,0 @@
-(************************************************************************)
-(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
-(* <O___,, * (see CREDITS file for the list of authors) *)
-(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
-(* * (see LICENSE file for the text of the license) *)
-(************************************************************************)
-
-open Util
-open Term
-open Constr
-open Vars
-open Declarations
-open Cooking
-open Entries
-
-(********************************)
-(* Discharging mutual inductive *)
-
-(* Replace
-
- Var(y1)..Var(yq):C1..Cq |- Ij:Bj
- Var(y1)..Var(yq):C1..Cq; I1..Ip:B1..Bp |- ci : Ti
-
- by
-
- |- Ij: (y1..yq:C1..Cq)Bj
- I1..Ip:(B1 y1..yq)..(Bp y1..yq) |- ci : (y1..yq:C1..Cq)Ti[Ij:=(Ij y1..yq)]
-*)
-
-let abstract_inductive decls nparamdecls inds =
- let ntyp = List.length inds in
- let ndecls = Context.Named.length decls in
- let args = Context.Named.to_instance mkVar (List.rev decls) in
- let args = Array.of_list args in
- let subs = List.init ntyp (fun k -> lift ndecls (mkApp(mkRel (k+1),args))) in
- let inds' =
- List.map
- (function (tname,arity,template,cnames,lc) ->
- let lc' = List.map (substl subs) lc in
- let lc'' = List.map (fun b -> Termops.it_mkNamedProd_wo_LetIn b decls) lc' in
- let arity' = Termops.it_mkNamedProd_wo_LetIn arity decls in
- (tname,arity',template,cnames,lc''))
- inds in
- let nparamdecls' = nparamdecls + Array.length args in
-(* To be sure to be the same as before, should probably be moved to process_inductive *)
- let params' = let (_,arity,_,_,_) = List.hd inds' in
- let (params,_) = decompose_prod_n_assum nparamdecls' arity in
- params
- in
- let ind'' =
- List.map
- (fun (a,arity,template,c,lc) ->
- let _, short_arity = decompose_prod_n_assum nparamdecls' arity in
- let shortlc =
- List.map (fun c -> snd (decompose_prod_n_assum nparamdecls' c)) lc in
- { mind_entry_typename = a;
- mind_entry_arity = short_arity;
- mind_entry_template = template;
- mind_entry_consnames = c;
- mind_entry_lc = shortlc })
- inds'
- in (params',ind'')
-
-let refresh_polymorphic_type_of_inductive (_,mip) =
- match mip.mind_arity with
- | RegularArity s -> s.mind_user_arity, false
- | TemplateArity ar ->
- let ctx = List.rev mip.mind_arity_ctxt in
- mkArity (List.rev ctx, Sorts.sort_of_univ ar.template_level), true
-
-let process_inductive info modlist mib =
- let section_decls = Lib.named_of_variable_context info.Lib.abstr_ctx in
- let nparamdecls = Context.Rel.length mib.mind_params_ctxt in
- let subst, ind_univs =
- match mib.mind_universes with
- | Monomorphic ctx -> Univ.empty_level_subst, Monomorphic_entry ctx
- | Polymorphic auctx ->
- let subst, auctx = Lib.discharge_abstract_universe_context info auctx in
- let nas = Univ.AUContext.names auctx in
- let auctx = Univ.AUContext.repr auctx in
- subst, Polymorphic_entry (nas, auctx)
- in
- let variance = match mib.mind_variance with
- | None -> None
- | Some _ -> Some (InferCumulativity.dummy_variance ind_univs)
- in
- let discharge c = Vars.subst_univs_level_constr subst (expmod_constr modlist c) in
- let inds =
- Array.map_to_list
- (fun mip ->
- let ty, template = refresh_polymorphic_type_of_inductive (mib,mip) in
- let arity = discharge ty in
- let lc = Array.map discharge mip.mind_user_lc in
- (mip.mind_typename,
- arity, template,
- Array.to_list mip.mind_consnames,
- Array.to_list lc))
- mib.mind_packets in
- let section_decls' = Context.Named.map discharge section_decls in
- let (params',inds') = abstract_inductive section_decls' nparamdecls inds in
- let record = match mib.mind_record with
- | PrimRecord info ->
- Some (Some (Array.map (fun (x,_,_,_) -> x) info))
- | FakeRecord -> Some None
- | NotRecord -> None
- in
- { mind_entry_record = record;
- mind_entry_finite = mib.mind_finite;
- mind_entry_params = params';
- mind_entry_inds = inds';
- mind_entry_private = mib.mind_private;
- mind_entry_variance = variance;
- mind_entry_universes = ind_univs
- }
-
diff --git a/interp/dumpglob.ml b/interp/dumpglob.ml
index a537b4848c..e1269025a4 100644
--- a/interp/dumpglob.ml
+++ b/interp/dumpglob.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -91,7 +91,8 @@ let type_of_logical_kind = function
(match a with
| Definitional -> "defax"
| Logical -> "prfax"
- | Conjectural -> "prfax")
+ | Conjectural -> "prfax"
+ | Context -> "prfax")
| IsProof th ->
(match th with
| Theorem
diff --git a/interp/dumpglob.mli b/interp/dumpglob.mli
index 554da7603f..18955985a0 100644
--- a/interp/dumpglob.mli
+++ b/interp/dumpglob.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/genintern.ml b/interp/genintern.ml
index 1b736b7977..e74f8d5f10 100644
--- a/interp/genintern.ml
+++ b/interp/genintern.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/genintern.mli b/interp/genintern.mli
index 4100f39029..5619a7b648 100644
--- a/interp/genintern.mli
+++ b/interp/genintern.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/impargs.ml b/interp/impargs.ml
index 806fe93297..9977b29310 100644
--- a/interp/impargs.ml
+++ b/interp/impargs.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -20,7 +20,6 @@ open Lib
open Libobject
open EConstr
open Reductionops
-open Constrexpr
open Namegen
module NamedDecl = Context.Named.Declaration
@@ -96,11 +95,11 @@ let set_maximality imps b =
this kind if there is enough arguments to infer them)
- [DepFlex] means that the implicit argument can be found by unification
- along a collapsable path only (e.g. as x in (P x) where P is another
+ along a collapsible path only (e.g. as x in (P x) where P is another
argument) (we do (defensively) print the arguments of this kind)
- [DepFlexAndRigid] means that the least argument from which the
- implicit argument can be inferred is following a collapsable path
+ implicit argument can be inferred is following a collapsible path
but there is a greater argument from where the implicit argument is
inferable following a rigid path (useful to know how to print a
partial application)
@@ -341,77 +340,30 @@ let rec prepare_implicits f = function
Some (id,imp,(set_maximality imps' f.maximal,true)) :: imps'
| _::imps -> None :: prepare_implicits f imps
-(*
-If found, returns Some (x,(b,fi,fo)) and l with the entry removed,
-otherwise returns None and l unchanged.
- *)
-let assoc_by_pos k l =
- let rec aux = function
- (ExplByPos (k', x), b) :: tl when Int.equal k k' -> Some (x,b), tl
- | hd :: tl -> let (x, tl) = aux tl in x, hd :: tl
- | [] -> raise Not_found
- in try aux l with Not_found -> None, l
-
-let check_correct_manual_implicits autoimps l =
- List.iter (function
- | ExplByName id,(b,fi,forced) ->
- if not forced then
- user_err
- (str "Wrong or non-dependent implicit argument name: " ++ Id.print id ++ str ".")
- | ExplByPos (i,_id),_t ->
- if i<1 || i>List.length autoimps then
- user_err
- (str "Bad implicit argument number: " ++ int i ++ str ".")
- else
- user_err
- (str "Cannot set implicit argument number " ++ int i ++
- str ": it has no name.")) l
-
-(* Take a list l of explicitations, and map them to positions. *)
-let flatten_explicitations l autoimps =
- let rec aux k l = function
- | (Name id,_)::imps ->
- let value, l' =
- try
- let eq = Constrexpr_ops.explicitation_eq in
- let flags = List.assoc_f eq (ExplByName id) l in
- Some (Some id, flags), List.remove_assoc_f eq (ExplByName id) l
- with Not_found -> assoc_by_pos k l
- in value :: aux (k+1) l' imps
- | (Anonymous,_)::imps ->
- let value, l' = assoc_by_pos k l
- in value :: aux (k+1) l' imps
- | [] when List.is_empty l -> []
- | [] ->
- check_correct_manual_implicits autoimps l;
- []
- in aux 1 l autoimps
-
let set_manual_implicits flags enriching autoimps l =
- if not (List.distinct l) then
- user_err Pp.(str "Some parameters are referred more than once.");
(* Compare with automatic implicits to recover printing data and names *)
let rec merge k autoimps explimps = match autoimps, explimps with
| autoimp::autoimps, explimp::explimps ->
let imps' = merge (k+1) autoimps explimps in
- begin match autoimp, explimp with
- | (Name id,_), Some (_, (b, fi, _)) ->
- Some (id, Manual, (set_maximality imps' b, fi))
+ begin match autoimp, explimp.CAst.v with
+ | (Name id,_), Some (_,max) ->
+ Some (id, Manual, (set_maximality imps' max, true))
| (Name id,Some exp), None when enriching ->
Some (id, exp, (set_maximality imps' flags.maximal, true))
| (Name _,_), None -> None
- | (Anonymous,_), Some (Some id, (b, fi, true)) ->
- Some (id,Manual,(b,fi))
- | (Anonymous,_), Some (None, (b, fi, true)) ->
+ | (Anonymous,_), Some (Name id,max) ->
+ Some (id,Manual,(max,true))
+ | (Anonymous,_), Some (Anonymous,max) ->
let id = Id.of_string ("arg_" ^ string_of_int k) in
- Some (id,Manual,(b,fi))
- | (Anonymous,_), Some (_, (_, _, false)) -> None
+ Some (id,Manual,(max,true))
| (Anonymous,_), None -> None
end :: imps'
| [], [] -> []
- (* flatten_explicitations returns a list of the same length as autoimps *)
- | _ -> assert false
- in merge 1 autoimps (flatten_explicitations l autoimps)
+ | [], _ -> assert false
+ (* possibly more automatic than manual implicit arguments n
+ when the conclusion is an unfoldable constant *)
+ | autoimps, [] -> merge k autoimps [CAst.make None]
+ in merge 1 autoimps l
let compute_semi_auto_implicits env sigma f t =
if not f.auto then [DefaultImpArgs, []]
@@ -642,9 +594,7 @@ let declare_mib_implicits kn =
(inImplicits (ImplMutualInductive (kn,flags),List.flatten imps))
(* Declare manual implicits *)
-type manual_explicitation = Constrexpr.explicitation * (bool * bool * bool)
-
-type manual_implicits = manual_explicitation list
+type manual_implicits = (Name.t * bool) option CAst.t list
let compute_implicits_with_manual env sigma typ enriching l =
let autoimpls = compute_auto_implicits env sigma !implicit_args enriching typ in
@@ -669,8 +619,6 @@ let projection_implicits env p impls =
CList.skipn_at_least npars impls
let declare_manual_implicits local ref ?enriching l =
- assert (List.for_all (fun (_, (max, fi, fu)) -> fi && fu) l);
- assert (List.for_all (fun (ex, _) -> match ex with ExplByPos (_,_) -> true | _ -> false) l);
let flags = !implicit_args in
let env = Global.env () in
let sigma = Evd.from_env env in
@@ -685,9 +633,8 @@ let declare_manual_implicits local ref ?enriching l =
in add_anonymous_leaf (inImplicits (req,[ref,l]))
let maybe_declare_manual_implicits local ref ?enriching l =
- match l with
- | [] -> ()
- | _ -> declare_manual_implicits local ref ?enriching l
+ if List.exists (fun x -> x.CAst.v <> None) l then
+ declare_manual_implicits local ref ?enriching l
(* TODO: either turn these warnings on and document them, or handle these cases sensibly *)
@@ -750,12 +697,6 @@ let extract_impargs_data impls =
| [] -> [] in
aux 0 impls
-let lift_implicits n =
- List.map (fun x ->
- match fst x with
- ExplByPos (k, id) -> ExplByPos (k + n, id), snd x
- | _ -> x)
-
let make_implicits_list l = [DefaultImpArgs, l]
let rec drop_first_implicits p l =
diff --git a/interp/impargs.mli b/interp/impargs.mli
index ccdd448460..90a7944642 100644
--- a/interp/impargs.mli
+++ b/interp/impargs.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -34,7 +34,7 @@ val with_implicit_protection : ('a -> 'b) -> 'a -> 'b
(** {6 ... } *)
(** An [implicits_list] is a list of positions telling which arguments
- of a reference can be automatically infered *)
+ of a reference can be automatically inferred *)
type argument_position =
@@ -50,11 +50,11 @@ type implicit_explanation =
this kind if there is enough arguments to infer them) *)
| DepFlex of argument_position
(** means that the implicit argument can be found by unification
- along a collapsable path only (e.g. as x in (P x) where P is another
+ along a collapsible path only (e.g. as x in (P x) where P is another
argument) (we do (defensively) print the arguments of this kind) *)
| DepFlexAndRigid of (*flex*) argument_position * (*rig*) argument_position
(** means that the least argument from which the
- implicit argument can be inferred is following a collapsable path
+ implicit argument can be inferred is following a collapsible path
but there is a greater argument from where the implicit argument is
inferable following a rigid path (useful to know how to print a
partial application) *)
@@ -84,13 +84,7 @@ val force_inference_of : implicit_status -> bool
val positions_of_implicits : implicits_list -> int list
-(** A [manual_explicitation] is a tuple of a positional or named explicitation with
- maximal insertion, force inference and force usage flags. Forcing usage makes
- the argument implicit even if the automatic inference considers it not inferable. *)
-type manual_explicitation = Constrexpr.explicitation *
- (maximal_insertion * force_inference * bool)
-
-type manual_implicits = manual_explicitation list
+type manual_implicits = (Name.t * bool) option CAst.t list
val compute_implicits_with_manual : env -> Evd.evar_map -> types -> bool ->
manual_implicits -> implicit_status list
@@ -131,8 +125,6 @@ val implicits_of_global : GlobRef.t -> implicits_list list
val extract_impargs_data :
implicits_list list -> ((int * int) option * implicit_status list) list
-val lift_implicits : int -> manual_implicits -> manual_implicits
-
val make_implicits_list : implicit_status list -> implicits_list list
val drop_first_implicits : int -> implicits_list -> implicits_list
diff --git a/interp/implicit_quantifiers.ml b/interp/implicit_quantifiers.ml
index bac46c2d2f..9f6281ae15 100644
--- a/interp/implicit_quantifiers.ml
+++ b/interp/implicit_quantifiers.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -23,9 +23,6 @@ open Libobject
open Nameops
open Context.Rel.Declaration
-exception MismatchedContextInstance of Environ.env * Typeclasses_errors.contexts * constr_expr list * Constr.rel_context (* found, expected *)
-let mismatched_ctx_inst_err env c n m = raise (MismatchedContextInstance (env, c, n, m))
-
module RelDecl = Context.Rel.Declaration
(*i*)
@@ -66,9 +63,6 @@ let declare_generalizable ~local gen =
let find_generalizable_ident id = Id.Pred.mem (root_of_id id) !generalizable_table
-let ids_of_list l =
- List.fold_right Id.Set.add l Id.Set.empty
-
let is_global id =
try ignore (Nametab.locate_extended (qualid_of_ident id)); true
with Not_found -> false
@@ -105,26 +99,6 @@ let free_vars_of_constr_expr c ?(bound=Id.Set.empty) l =
| _ -> Constrexpr_ops.fold_constr_expr_with_binders (fun a l -> Id.Set.add a l) aux bdvars l c
in aux bound l c
-let ids_of_names l =
- List.fold_left (fun acc x -> match x.CAst.v with Name na -> na :: acc | Anonymous -> acc) [] l
-
-let free_vars_of_binders ?(bound=Id.Set.empty) l (binders : local_binder_expr list) =
- let rec aux bdvars l c = match c with
- ((CLocalAssum (n, _, c)) :: tl) ->
- let bound = ids_of_names n in
- let l' = free_vars_of_constr_expr c ~bound:bdvars l in
- aux (Id.Set.union (ids_of_list bound) bdvars) l' tl
-
- | ((CLocalDef (n, c, t)) :: tl) ->
- let bound = match n.CAst.v with Anonymous -> [] | Name n -> [n] in
- let l' = free_vars_of_constr_expr c ~bound:bdvars l in
- let l'' = Option.fold_left (fun l t -> free_vars_of_constr_expr t ~bound:bdvars l) l' t in
- aux (Id.Set.union (ids_of_list bound) bdvars) l'' tl
-
- | CLocalPattern _ :: tl -> assert false
- | [] -> bdvars, l
- in aux bound l binders
-
let generalizable_vars_of_glob_constr ?(bound=Id.Set.empty) ?(allowed=Id.Set.empty) =
let rec vars bound vs c = match DAst.get c with
| GVar id ->
@@ -149,7 +123,7 @@ let next_name_away_from na avoid =
| Anonymous -> make_fresh avoid (Global.env ()) (Id.of_string "anon")
| Name id -> make_fresh avoid (Global.env ()) id
-let combine_params avoid fn applied needed =
+let combine_params avoid applied needed =
let named, applied =
List.partition
(function
@@ -167,47 +141,30 @@ let combine_params avoid fn applied needed =
(fun x -> match x with (t, Some {CAst.loc;v=ExplByName id}) -> id, t | _ -> assert false)
named
in
- let is_unset (_, decl) = match decl with
- | LocalAssum _ -> true
- | LocalDef _ -> false
- in
- let needed = List.filter is_unset needed in
let rec aux ids avoid app need =
match app, need with
- [], [] -> List.rev ids, avoid
- | app, (_, (LocalAssum ({binder_name=Name id}, _) | LocalDef ({binder_name=Name id}, _, _))) :: need when Id.List.mem_assoc id named ->
+ | _, (_, LocalDef _) :: need -> aux ids avoid app need
+
+ | [], [] -> List.rev ids, avoid
+
+ | app, (_, (LocalAssum ({binder_name=Name id}, _))) :: need when Id.List.mem_assoc id named ->
aux (Id.List.assoc id named :: ids) avoid app need
- | (x, None) :: app, (None, (LocalAssum ({binder_name=Name id}, _) | LocalDef ({binder_name=Name id}, _, _))) :: need ->
+ | (x, None) :: app, (None, (LocalAssum ({binder_name=Name id}, _))) :: need ->
aux (x :: ids) avoid app need
- | _, (Some cl, _ as d) :: need ->
- let t', avoid' = fn avoid d in
- aux (t' :: ids) avoid' app need
-
| x :: app, (None, _) :: need -> aux (fst x :: ids) avoid app need
- | [], (None, _ as decl) :: need ->
- let t', avoid' = fn avoid decl in
- aux (t' :: ids) avoid' app need
+ | _, (Some _, decl) :: need | [], (None, decl) :: need ->
+ let id' = next_name_away_from (RelDecl.get_name decl) avoid in
+ let t' = CAst.make @@ CRef (qualid_of_ident id',None) in
+ aux (t' :: ids) (Id.Set.add id' avoid) app need
| (x,_) :: _, [] ->
user_err ?loc:(Constrexpr_ops.constr_loc x) (str "Typeclass does not expect more arguments")
- in aux [] avoid applied needed
-
-let combine_params_freevar avoid (_, decl) =
- let id' = next_name_away_from (RelDecl.get_name decl) avoid in
- (CAst.make @@ CRef (qualid_of_ident id',None), Id.Set.add id' avoid)
-
-let destClassApp cl =
- let open CAst in
- let loc = cl.loc in
- match cl.v with
- | CApp ((None, { v = CRef (ref, inst) }), l) -> CAst.make ?loc (ref, List.map fst l, inst)
- | CAppExpl ((None, ref, inst), l) -> CAst.make ?loc (ref, l, inst)
- | CRef (ref, inst) -> CAst.make ?loc:cl.loc (ref, [], inst)
- | _ -> raise Not_found
+ in
+ aux [] avoid applied needed
let destClassAppExpl cl =
let open CAst in
@@ -217,7 +174,7 @@ let destClassAppExpl cl =
| CRef (ref, inst) -> CAst.make ?loc:cl.loc (ref, [], inst)
| _ -> raise Not_found
-let implicit_application env ?(allow_partial=true) f ty =
+let implicit_application env ty =
let is_class =
try
let ({CAst.v=(qid, _, _)} as clapp) = destClassAppExpl ty in
@@ -230,24 +187,13 @@ let implicit_application env ?(allow_partial=true) f ty =
match is_class with
| None -> ty, env
| Some ({CAst.loc;v=(id, par, inst)}, gr) ->
- let avoid = Id.Set.union env (ids_of_list (free_vars_of_constr_expr ty ~bound:env [])) in
+ let avoid = Id.Set.union env (Id.Set.of_list (free_vars_of_constr_expr ty ~bound:env [])) in
let env = Global.env () in
let sigma = Evd.from_env env in
let c = class_info env sigma gr in
let (ci, rd) = c.cl_context in
- if not allow_partial then
- begin
- let opt_succ x n = match x with
- | None -> succ n
- | Some _ -> n
- in
- let applen = List.fold_left (fun acc (x, y) -> opt_succ y acc) 0 par in
- let needlen = List.fold_left (fun acc x -> opt_succ x acc) 0 ci in
- if not (Int.equal needlen applen) then
- mismatched_ctx_inst_err (Global.env ()) Typeclasses_errors.Parameters (List.map fst par) rd
- end;
let pars = List.rev (List.combine ci rd) in
- let args, avoid = combine_params avoid f par pars in
+ let args, avoid = combine_params avoid par pars in
CAst.make ?loc @@ CAppExpl ((None, id, inst), args), avoid
let warn_ignoring_implicit_status =
@@ -257,32 +203,23 @@ let warn_ignoring_implicit_status =
Name.print na ++ strbrk " and following binders")
let implicits_of_glob_constr ?(with_products=true) l =
- let add_impl i na bk l = match bk with
- | Implicit ->
- let name =
- match na with
- | Name id -> Some id
- | Anonymous -> None
- in
- (ExplByPos (i, name), (true, true, true)) :: l
- | _ -> l
+ let add_impl ?loc na bk l = match bk with
+ | Implicit -> CAst.make ?loc (Some (na,true)) :: l
+ | _ -> CAst.make ?loc None :: l
in
- let rec aux i c =
- let abs na bk b =
- add_impl i na bk (aux (succ i) b)
- in
+ let rec aux c =
match DAst.get c with
| GProd (na, bk, t, b) ->
- if with_products then abs na bk b
+ if with_products then add_impl na bk (aux b)
else
let () = match bk with
| Implicit -> warn_ignoring_implicit_status na ?loc:c.CAst.loc
| _ -> ()
in []
- | GLambda (na, bk, t, b) -> abs na bk b
- | GLetIn (na, b, t, c) -> aux i c
+ | GLambda (na, bk, t, b) -> add_impl ?loc:t.CAst.loc na bk (aux b)
+ | GLetIn (na, b, t, c) -> aux c
| GRec (fix_kind, nas, args, tys, bds) ->
let nb = match fix_kind with |GFix (_, n) -> n | GCoFix n -> n in
- List.fold_left_i (fun i l (na,bk,_,_) -> add_impl i na bk l) i (aux (List.length args.(nb) + i) bds.(nb)) args.(nb)
+ List.fold_right (fun (na,bk,t,_) l -> add_impl ?loc:c.CAst.loc na bk l) args.(nb) (aux bds.(nb))
| _ -> []
- in aux 1 l
+ in aux l
diff --git a/interp/implicit_quantifiers.mli b/interp/implicit_quantifiers.mli
index 437fef1753..4f9c47ec36 100644
--- a/interp/implicit_quantifiers.mli
+++ b/interp/implicit_quantifiers.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -11,22 +11,14 @@
open Names
open Glob_term
open Constrexpr
-open Libnames
val declare_generalizable : local:bool -> lident list option -> unit
-val ids_of_list : Id.t list -> Id.Set.t
-val destClassApp : constr_expr -> (qualid * constr_expr list * instance_expr option) CAst.t
-val destClassAppExpl : constr_expr -> (qualid * (constr_expr * explicitation CAst.t option) list * instance_expr option) CAst.t
-
(** Fragile, should be used only for construction a set of identifiers to avoid *)
val free_vars_of_constr_expr : constr_expr -> ?bound:Id.Set.t ->
Id.t list -> Id.t list
-val free_vars_of_binders :
- ?bound:Id.Set.t -> Id.t list -> local_binder_expr list -> Id.Set.t * Id.t list
-
(** Returns the generalizable free ids in left-to-right
order with the location of their first occurrence *)
@@ -37,15 +29,4 @@ 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 -> GlobRef.t option * Constr.rel_declaration ->
- Constrexpr.constr_expr * Id.Set.t
-
-val implicit_application : Id.Set.t -> ?allow_partial:bool ->
- (Id.Set.t -> GlobRef.t option * Constr.rel_declaration ->
- Constrexpr.constr_expr * Id.Set.t) ->
- constr_expr -> constr_expr * Id.Set.t
-
-(* Should be likely located elsewhere *)
-exception MismatchedContextInstance of Environ.env * Typeclasses_errors.contexts * constr_expr list * Constr.rel_context (* found, expected *)
-val mismatched_ctx_inst_err : Environ.env -> Typeclasses_errors.contexts -> constr_expr list -> Constr.rel_context -> 'a
+val implicit_application : Id.Set.t -> constr_expr -> constr_expr * Id.Set.t
diff --git a/interp/interp.mllib b/interp/interp.mllib
index 1262dbb181..33573edcce 100644
--- a/interp/interp.mllib
+++ b/interp/interp.mllib
@@ -1,3 +1,4 @@
+Deprecation
NumTok
Constrexpr
Tactypes
@@ -16,5 +17,3 @@ Implicit_quantifiers
Constrintern
Modintern
Constrextern
-Discharge
-Declare
diff --git a/interp/modintern.ml b/interp/modintern.ml
index 2f516f4f3c..955288244e 100644
--- a/interp/modintern.ml
+++ b/interp/modintern.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/modintern.mli b/interp/modintern.mli
index 529c438c1a..75ab38c64a 100644
--- a/interp/modintern.mli
+++ b/interp/modintern.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/notation.ml b/interp/notation.ml
index a7bac96d31..d58125e29b 100644
--- a/interp/notation.ml
+++ b/interp/notation.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -72,6 +72,7 @@ type notation_location = (DirPath.t * DirPath.t) * string
type notation_data = {
not_interp : interpretation;
not_location : notation_location;
+ not_deprecation : Deprecation.t option;
}
type scope = {
@@ -1095,7 +1096,7 @@ let warn_notation_overridden =
str "Notation" ++ spc () ++ pr_notation ntn ++ spc ()
++ strbrk "was already used" ++ which_scope ++ str ".")
-let declare_notation_interpretation ntn scopt pat df ~onlyprint =
+let declare_notation_interpretation ntn scopt pat df ~onlyprint deprecation =
let scope = match scopt with Some s -> s | None -> default_scope in
let sc = find_scope scope in
if not onlyprint then begin
@@ -1109,6 +1110,7 @@ let declare_notation_interpretation ntn scopt pat df ~onlyprint =
let notdata = {
not_interp = pat;
not_location = df;
+ not_deprecation = deprecation;
} in
let sc = { sc with notations = NotationMap.add ntn notdata sc.notations } in
scope_map := String.Map.add scope sc !scope_map
@@ -1125,10 +1127,10 @@ let declare_uninterpretation rule (metas,c as pat) =
let rec find_interpretation ntn find = function
| [] -> raise Not_found
| Scope scope :: scopes ->
- (try let (pat,df) = find scope in pat,(df,Some scope)
+ (try let n = find scope in (n,Some scope)
with Not_found -> find_interpretation ntn find scopes)
| SingleNotation ntn'::scopes when notation_eq ntn' ntn ->
- (try let (pat,df) = find default_scope in pat,(df,None)
+ (try let n = find default_scope in (n,None)
with Not_found ->
(* e.g. because single notation only for constr, not cases_pattern *)
find_interpretation ntn find scopes)
@@ -1136,8 +1138,7 @@ let rec find_interpretation ntn find = function
find_interpretation ntn find scopes
let find_notation ntn sc =
- let n = NotationMap.find ntn (find_scope sc).notations in
- (n.not_interp, n.not_location)
+ NotationMap.find ntn (find_scope sc).notations
let notation_of_prim_token = function
| Numeral (SPlus,n) -> InConstrEntrySomeLevel, NumTok.to_string n
@@ -1147,7 +1148,9 @@ let notation_of_prim_token = function
let find_prim_token check_allowed ?loc p sc =
(* Try for a user-defined numerical notation *)
try
- let (_,c),df = find_notation (notation_of_prim_token p) sc in
+ let n = find_notation (notation_of_prim_token p) sc in
+ let (_,c) = n.not_interp in
+ let df = n.not_location in
let pat = Notation_ops.glob_constr_of_notation_constr ?loc c in
check_allowed pat;
pat, df
@@ -1167,7 +1170,9 @@ let find_prim_token check_allowed ?loc p sc =
let interp_prim_token_gen ?loc g p local_scopes =
let scopes = make_current_scopes local_scopes in
let p_as_ntn = try notation_of_prim_token p with Not_found -> InConstrEntrySomeLevel,"" in
- try find_interpretation p_as_ntn (find_prim_token ?loc g p) scopes
+ try
+ let (pat,loc), sc = find_interpretation p_as_ntn (find_prim_token ?loc g p) scopes in
+ pat, (loc,sc)
with Not_found ->
user_err ?loc ~hdr:"interp_prim_token"
((match p with
@@ -1192,11 +1197,18 @@ let rec check_allowed_ref_in_pat looked_for = DAst.(with_val (function
let interp_prim_token_cases_pattern_expr ?loc looked_for p =
interp_prim_token_gen ?loc (check_allowed_ref_in_pat looked_for) p
+let warn_deprecated_notation =
+ Deprecation.create_warning ~object_name:"Notation" ~warning_name:"deprecated-notation"
+ pr_notation
+
let interp_notation ?loc ntn local_scopes =
let scopes = make_current_scopes local_scopes in
- try find_interpretation ntn (find_notation ntn) scopes
+ try
+ let (n,sc) = find_interpretation ntn (find_notation ntn) scopes in
+ Option.iter (fun d -> warn_deprecated_notation (ntn,d)) n.not_deprecation;
+ n.not_interp, (n.not_location, sc)
with Not_found ->
- user_err ?loc
+ user_err ?loc
(str "Unknown interpretation for notation " ++ pr_notation ntn ++ str ".")
let uninterp_notations c =
diff --git a/interp/notation.mli b/interp/notation.mli
index a67948a778..bd9b50977b 100644
--- a/interp/notation.mli
+++ b/interp/notation.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -217,7 +217,8 @@ type interp_rule =
| SynDefRule of KerName.t
val declare_notation_interpretation : notation -> scope_name option ->
- interpretation -> notation_location -> onlyprint:bool -> unit
+ interpretation -> notation_location -> onlyprint:bool ->
+ Deprecation.t option -> unit
val declare_uninterpretation : interp_rule -> interpretation -> unit
diff --git a/interp/notation_ops.ml b/interp/notation_ops.ml
index 7f084fffdd..fdf12faa04 100644
--- a/interp/notation_ops.ml
+++ b/interp/notation_ops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -1190,7 +1190,11 @@ let rec match_ inner u alp metas sigma a1 a2 =
Array.fold_left2 (match_in u alp metas) sigma bl1 bl2
| GCast(t1, c1), NCast(t2, c2) ->
match_cast (match_in u alp metas) (match_in u alp metas sigma t1 t2) c1 c2
- | GSort (GType _), NSort (GType _) when not u -> sigma
+
+ (* Next pair of lines useful only if not coming from detyping *)
+ | GSort (UNamed [(GProp|GSet),0]), NSort (UAnonymous _) -> raise No_match
+ | GSort _, NSort (UAnonymous _) when not u -> sigma
+
| GSort s1, NSort s2 when glob_sort_eq s1 s2 -> sigma
| GInt i1, NInt i2 when Uint63.equal i1 i2 -> sigma
| GPatVar _, NHole _ -> (*Don't hide Metas, they bind in ltac*) raise No_match
diff --git a/interp/notation_ops.mli b/interp/notation_ops.mli
index 58fa221b16..7919d0061f 100644
--- a/interp/notation_ops.mli
+++ b/interp/notation_ops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/notation_term.ml b/interp/notation_term.ml
index 5024f5c26f..908455bd05 100644
--- a/interp/notation_term.ml
+++ b/interp/notation_term.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/reserve.ml b/interp/reserve.ml
index edbdf1dbba..e81439c3d5 100644
--- a/interp/reserve.ml
+++ b/interp/reserve.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/reserve.mli b/interp/reserve.mli
index a10858e71f..e180fc8071 100644
--- a/interp/reserve.mli
+++ b/interp/reserve.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/smartlocate.ml b/interp/smartlocate.ml
index 91491bdf8d..74fe5d1c80 100644
--- a/interp/smartlocate.ml
+++ b/interp/smartlocate.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/smartlocate.mli b/interp/smartlocate.mli
index e41ef78913..d2770a2e73 100644
--- a/interp/smartlocate.mli
+++ b/interp/smartlocate.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/stdarg.ml b/interp/stdarg.ml
index bf3a8fe215..555eb34aed 100644
--- a/interp/stdarg.ml
+++ b/interp/stdarg.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/stdarg.mli b/interp/stdarg.mli
index c974a4403c..dffbca0054 100644
--- a/interp/stdarg.mli
+++ b/interp/stdarg.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/syntax_def.ml b/interp/syntax_def.ml
index 49273c4146..302bb6ece2 100644
--- a/interp/syntax_def.ml
+++ b/interp/syntax_def.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -19,20 +19,24 @@ open Notation_term
(* Syntactic definitions. *)
-type version = Flags.compat_version option
+type syndef =
+ { syndef_pattern : interpretation;
+ syndef_onlyparsing : bool;
+ syndef_deprecation : Deprecation.t option;
+ }
let syntax_table =
- Summary.ref (KNmap.empty : (interpretation*version) KNmap.t)
- ~name:"SYNTAXCONSTANT"
+ Summary.ref (KNmap.empty : syndef KNmap.t)
+ ~name:"SYNDEFS"
-let add_syntax_constant kn c onlyparse =
- syntax_table := KNmap.add kn (c,onlyparse) !syntax_table
+let add_syntax_constant kn syndef =
+ syntax_table := KNmap.add kn syndef !syntax_table
-let load_syntax_constant i ((sp,kn),(_,pat,onlyparse)) =
+let load_syntax_constant i ((sp,kn),(_local,syndef)) =
if Nametab.exists_cci sp then
user_err ~hdr:"cache_syntax_constant"
(Id.print (basename sp) ++ str " already exists");
- add_syntax_constant kn pat onlyparse;
+ add_syntax_constant kn syndef;
Nametab.push_syndef (Nametab.Until i) sp kn
let is_alias_of_already_visible_name sp = function
@@ -42,30 +46,29 @@ let is_alias_of_already_visible_name sp = function
| _ ->
false
-let open_syntax_constant i ((sp,kn),(_,pat,onlyparse)) =
+let open_syntax_constant i ((sp,kn),(_local,syndef)) =
+ let pat = syndef.syndef_pattern in
if not (Int.equal i 1 && is_alias_of_already_visible_name sp pat) then begin
Nametab.push_syndef (Nametab.Exactly i) sp kn;
- match onlyparse with
- | None ->
+ if not syndef.syndef_onlyparsing then
(* Redeclare it to be used as (short) name in case an other (distfix)
- notation was declared inbetween *)
+ notation was declared in between *)
Notation.declare_uninterpretation (Notation.SynDefRule kn) pat
- | _ -> ()
end
let cache_syntax_constant d =
load_syntax_constant 1 d;
open_syntax_constant 1 d
-let subst_syntax_constant (subst,(local,pat,onlyparse)) =
- (local,Notation_ops.subst_interpretation subst pat,onlyparse)
+let subst_syntax_constant (subst,(local,syndef)) =
+ let syndef_pattern = Notation_ops.subst_interpretation subst syndef.syndef_pattern in
+ (local, { syndef with syndef_pattern })
-let classify_syntax_constant (local,_,_ as o) =
+let classify_syntax_constant (local,_ as o) =
if local then Dispose else Substitute o
-let in_syntax_constant
- : bool * interpretation * Flags.compat_version option -> obj =
- declare_object {(default_object "SYNTAXCONSTANT") with
+let in_syntax_constant : (bool * syndef) -> obj =
+ declare_object {(default_object "SYNDEF") with
cache_function = cache_syntax_constant;
load_function = load_syntax_constant;
open_function = open_syntax_constant;
@@ -79,36 +82,31 @@ type syndef_interpretation = (Id.t * subscopes) list * notation_constr
let in_pat (ids,ac) = (List.map (fun (id,sc) -> (id,((Constrexpr.InConstrEntrySomeLevel,sc),NtnTypeConstr))) ids,ac)
let out_pat (ids,ac) = (List.map (fun (id,((_,sc),typ)) -> (id,sc)) ids,ac)
-let declare_syntactic_definition local id onlyparse pat =
- let _ = add_leaf id (in_syntax_constant (local,in_pat pat,onlyparse)) in ()
-
-let pr_syndef kn = pr_qualid (Nametab.shortest_qualid_of_syndef Id.Set.empty kn)
-
-let pr_compat_warning (kn, def, v) =
- let pp_def = match def with
- | [], NRef r -> spc () ++ str "is" ++ spc () ++ Nametab.pr_global_env Id.Set.empty r
- | _ -> strbrk " is a compatibility notation"
+let declare_syntactic_definition ~local deprecation id ~onlyparsing pat =
+ let syndef =
+ { syndef_pattern = in_pat pat;
+ syndef_onlyparsing = onlyparsing;
+ syndef_deprecation = deprecation;
+ }
in
- pr_syndef kn ++ pp_def
+ let _ = add_leaf id (in_syntax_constant (local,syndef)) in ()
-let warn_compatibility_notation =
- CWarnings.(create ~name:"compatibility-notation"
- ~category:"deprecated" ~default:Enabled pr_compat_warning)
+let pr_syndef kn = pr_qualid (Nametab.shortest_qualid_of_syndef Id.Set.empty kn)
-let verbose_compat ?loc kn def = function
- | Some v when Flags.version_strictly_greater v ->
- warn_compatibility_notation ?loc (kn, def, v)
- | _ -> ()
+let warn_deprecated_syntactic_definition =
+ Deprecation.create_warning ~object_name:"Notation" ~warning_name:"deprecated-syntactic-definition"
+ pr_syndef
let search_syntactic_definition ?loc kn =
- let pat,v = KNmap.find kn !syntax_table in
- let def = out_pat pat in
- verbose_compat ?loc kn def v;
+ let syndef = KNmap.find kn !syntax_table in
+ let def = out_pat syndef.syndef_pattern in
+ Option.iter (fun d -> warn_deprecated_syntactic_definition (kn,d)) syndef.syndef_deprecation;
def
let search_filtered_syntactic_definition ?loc filter kn =
- let pat,v = KNmap.find kn !syntax_table in
- let def = out_pat pat in
+ let syndef = KNmap.find kn !syntax_table in
+ let def = out_pat syndef.syndef_pattern in
let res = filter def in
- (match res with Some _ -> verbose_compat ?loc kn def v | None -> ());
+ if Option.has_some res then
+ Option.iter (fun d -> warn_deprecated_syntactic_definition (kn,d)) syndef.syndef_deprecation;
res
diff --git a/interp/syntax_def.mli b/interp/syntax_def.mli
index 77873f8f67..0065b45b14 100644
--- a/interp/syntax_def.mli
+++ b/interp/syntax_def.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -15,8 +15,8 @@ open Notation_term
type syndef_interpretation = (Id.t * subscopes) list * notation_constr
-val declare_syntactic_definition : bool -> Id.t ->
- Flags.compat_version option -> syndef_interpretation -> unit
+val declare_syntactic_definition : local:bool -> Deprecation.t option -> Id.t ->
+ onlyparsing:bool -> syndef_interpretation -> unit
val search_syntactic_definition : ?loc:Loc.t -> KerName.t -> syndef_interpretation
diff --git a/kernel/byterun/coq_memory.c b/kernel/byterun/coq_memory.c
index 542a05fd25..a1c49bee95 100644
--- a/kernel/byterun/coq_memory.c
+++ b/kernel/byterun/coq_memory.c
@@ -105,7 +105,7 @@ value init_coq_vm(value unit) /* ML */
init_coq_interpreter();
/* Some predefined pointer code.
- * It is typically contained in accumlator blocks whose tag is 0 and thus
+ * It is typically contained in accumulator blocks whose tag is 0 and thus
* scanned by the GC, so make it look like an OCaml block. */
value accu_block = (value) coq_stat_alloc(2 * sizeof(value));
Hd_hp (accu_block) = Make_header (1, Abstract_tag, Caml_black); \
diff --git a/kernel/cClosure.ml b/kernel/cClosure.ml
index 95f88c0306..6be8a59aeb 100644
--- a/kernel/cClosure.ml
+++ b/kernel/cClosure.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -226,7 +226,7 @@ let unfold_red kn =
* this constant or abstraction.
* * i_tab is the cache table of the results
*
- * ref_value_cache searchs in the tab, otherwise uses i_repr to
+ * ref_value_cache searches in the tab, otherwise uses i_repr to
* compute the result and store it in the table. If the constant can't
* be unfolded, returns None, but does not store this failure. * This
* doesn't take the RESET into account. You mustn't keep such a table
@@ -645,7 +645,7 @@ and subst_constr subst c = match [@ocaml.warning "-4"] Constr.kind c with
and comp_subs el s =
Esubst.lift_subst (fun el c -> lazy (to_constr el c)) el s
-(* This function defines the correspondance between constr and
+(* This function defines the correspondence between constr and
fconstr. When we find a closure whose substitution is the identity,
then we directly return the constr to avoid possibly huge
reallocation. *)
diff --git a/kernel/cClosure.mli b/kernel/cClosure.mli
index 1a790eaed6..027d5245c9 100644
--- a/kernel/cClosure.mli
+++ b/kernel/cClosure.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -200,7 +200,7 @@ val whd_val : clos_infos -> clos_tab -> fconstr -> constr
val whd_stack :
clos_infos -> clos_tab -> fconstr -> stack -> fconstr * stack
-(** [eta_expand_ind_stack env ind c s t] computes stacks correspoding
+(** [eta_expand_ind_stack env ind c s t] computes stacks corresponding
to the conversion of the eta expansion of t, considered as an inhabitant
of ind, and the Constructor c of this inductive type applied to arguments
s.
diff --git a/kernel/cPrimitives.ml b/kernel/cPrimitives.ml
index fdc93cfa89..d854cadd15 100644
--- a/kernel/cPrimitives.ml
+++ b/kernel/cPrimitives.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/cPrimitives.mli b/kernel/cPrimitives.mli
index 3f8174bd7b..6913371caf 100644
--- a/kernel/cPrimitives.mli
+++ b/kernel/cPrimitives.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/cbytecodes.ml b/kernel/cbytecodes.ml
index 7570004fe5..009db05ea2 100644
--- a/kernel/cbytecodes.ml
+++ b/kernel/cbytecodes.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/cbytecodes.mli b/kernel/cbytecodes.mli
index 423e7bbe65..06b380ef89 100644
--- a/kernel/cbytecodes.mli
+++ b/kernel/cbytecodes.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/cbytegen.ml b/kernel/cbytegen.ml
index 69f004307d..83d2a58d83 100644
--- a/kernel/cbytegen.ml
+++ b/kernel/cbytegen.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -386,7 +386,7 @@ let rec is_tailcall = function
| Klabel _ :: c -> is_tailcall c
| _ -> None
-(* Extention of the continuation *)
+(* Extension of the continuation *)
(* Add a Kpop n instruction in front of a continuation *)
let rec add_pop n = function
diff --git a/kernel/cbytegen.mli b/kernel/cbytegen.mli
index bdaf5fe422..814902a554 100644
--- a/kernel/cbytegen.mli
+++ b/kernel/cbytegen.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/cemitcodes.ml b/kernel/cemitcodes.ml
index a84a7c0cf9..76e2515ea7 100644
--- a/kernel/cemitcodes.ml
+++ b/kernel/cemitcodes.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/cemitcodes.mli b/kernel/cemitcodes.mli
index 41cc641dc8..9184164504 100644
--- a/kernel/cemitcodes.mli
+++ b/kernel/cemitcodes.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Names
open Vmvalues
diff --git a/kernel/constr.ml b/kernel/constr.ml
index d74c96af84..8375316003 100644
--- a/kernel/constr.ml
+++ b/kernel/constr.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/constr.mli b/kernel/constr.mli
index 7fc57cdb8a..45ec8a7e64 100644
--- a/kernel/constr.mli
+++ b/kernel/constr.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -141,7 +141,7 @@ val mkRef : GlobRef.t Univ.puniverses -> constr
[mkCase ci p c ac] stand for match [c] as [x] in [I args] return [p] with [ac]
presented as describe in [ci].
- [p] stucture is [fun args x -> "return clause"]
+ [p] structure is [fun args x -> "return clause"]
[ac]{^ ith} element is ith constructor case presented as
{e lambda construct_args (without params). case_term } *)
diff --git a/kernel/context.ml b/kernel/context.ml
index 290e85294b..2ef750ad69 100644
--- a/kernel/context.ml
+++ b/kernel/context.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/context.mli b/kernel/context.mli
index 7b67e54ba4..8f233613da 100644
--- a/kernel/context.mli
+++ b/kernel/context.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/conv_oracle.ml b/kernel/conv_oracle.ml
index fe82353b70..7ce320381c 100644
--- a/kernel/conv_oracle.ml
+++ b/kernel/conv_oracle.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/conv_oracle.mli b/kernel/conv_oracle.mli
index bc06cc21b6..918dc8c928 100644
--- a/kernel/conv_oracle.mli
+++ b/kernel/conv_oracle.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/cooking.ml b/kernel/cooking.ml
index 9b6e37251f..0951b07d49 100644
--- a/kernel/cooking.ml
+++ b/kernel/cooking.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -159,31 +159,38 @@ type 'opaque result = {
cook_body : (constr Mod_subst.substituted, 'opaque) constant_def;
cook_type : types;
cook_universes : universes;
- cook_private_univs : Univ.ContextSet.t option;
cook_relevance : Sorts.relevance;
cook_inline : inline;
cook_context : Constr.named_context option;
}
-let on_body ml hy f = function
- | Undef _ as x -> x
- | Def cs -> Def (Mod_subst.from_val (f (Mod_subst.force_constr cs)))
- | OpaqueDef o ->
- OpaqueDef (Opaqueproof.discharge_direct_opaque ~cook_constr:f
- { Opaqueproof.modlist = ml; abstract = hy } o)
- | Primitive _ -> CErrors.anomaly (Pp.str "Primitives cannot be cooked")
-
let expmod_constr_subst cache modlist subst c =
let subst = Univ.make_instance_subst subst in
let c = expmod_constr cache modlist c in
Vars.subst_univs_level_constr subst c
-let cook_constr { Opaqueproof.modlist ; abstract = (vars, subst, _) } c =
- let cache = RefTable.create 13 in
- let expmod = expmod_constr_subst cache modlist subst in
- let hyps = Context.Named.map expmod vars in
- let hyps = abstract_context hyps in
- abstract_constant_body (expmod c) hyps
+let discharge_abstract_universe_context subst abs_ctx auctx =
+ (** Given a named instance [subst := u₀ ... uₙ₋₁] together with an abstract
+ context [auctx0 := 0 ... n - 1 |= C{0, ..., n - 1}] of the same length,
+ and another abstract context relative to the former context
+ [auctx := 0 ... m - 1 |= C'{u₀, ..., uₙ₋₁, 0, ..., m - 1}],
+ construct the lifted abstract universe context
+ [0 ... n - 1 n ... n + m - 1 |=
+ C{0, ... n - 1} ∪
+ C'{0, ..., n - 1, n, ..., n + m - 1} ]
+ together with the instance
+ [u₀ ... uₙ₋₁ Var(0) ... Var (m - 1)].
+ *)
+ if (Univ.Instance.is_empty subst) then
+ (** Still need to take the union for the constraints between globals *)
+ subst, (AUContext.union abs_ctx auctx)
+ else
+ let open Univ in
+ let ainst = make_abstract_instance auctx in
+ let subst = Instance.append subst ainst in
+ let substf = make_instance_subst subst in
+ let auctx = Univ.subst_univs_level_abstract_universe_context substf auctx in
+ subst, (AUContext.union abs_ctx auctx)
let lift_univs cb subst auctx0 =
match cb.const_universes with
@@ -191,28 +198,35 @@ let lift_univs cb subst auctx0 =
assert (AUContext.is_empty auctx0);
subst, (Monomorphic ctx)
| Polymorphic auctx ->
- (** Given a named instance [subst := u₀ ... uₙ₋₁] together with an abstract
- context [auctx0 := 0 ... n - 1 |= C{0, ..., n - 1}] of the same length,
- and another abstract context relative to the former context
- [auctx := 0 ... m - 1 |= C'{u₀, ..., uₙ₋₁, 0, ..., m - 1}],
- construct the lifted abstract universe context
- [0 ... n - 1 n ... n + m - 1 |=
- C{0, ... n - 1} ∪
- C'{0, ..., n - 1, n, ..., n + m - 1} ]
- together with the instance
- [u₀ ... uₙ₋₁ Var(0) ... Var (m - 1)].
- *)
- if (Univ.Instance.is_empty subst) then
- (** Still need to take the union for the constraints between globals *)
- subst, (Polymorphic (AUContext.union auctx0 auctx))
- else
- let ainst = Univ.make_abstract_instance auctx in
- let subst = Instance.append subst ainst in
- let substf = Univ.make_instance_subst subst in
- let auctx' = Univ.subst_univs_level_abstract_universe_context substf auctx in
- subst, (Polymorphic (AUContext.union auctx0 auctx'))
-
-let cook_constant ~hcons { from = cb; info } =
+ let subst, auctx = discharge_abstract_universe_context subst auctx0 auctx in
+ subst, (Polymorphic auctx)
+
+let cook_constr { Opaqueproof.modlist ; abstract } (c, priv) =
+ let cache = RefTable.create 13 in
+ let abstract, usubst, abs_ctx = abstract in
+ let usubst, priv = match priv with
+ | Opaqueproof.PrivateMonomorphic () ->
+ let () = assert (AUContext.is_empty abs_ctx) in
+ let () = assert (Instance.is_empty usubst) in
+ usubst, priv
+ | Opaqueproof.PrivatePolymorphic (univs, ctx) ->
+ let ainst = Instance.of_array (Array.init univs Level.var) in
+ let usubst = Instance.append usubst ainst in
+ let ctx = on_snd (Univ.subst_univs_level_constraints (Univ.make_instance_subst usubst)) ctx in
+ let univs = univs + AUContext.size abs_ctx in
+ usubst, Opaqueproof.PrivatePolymorphic (univs, ctx)
+ in
+ let expmod = expmod_constr_subst cache modlist usubst in
+ let hyps = Context.Named.map expmod abstract in
+ let hyps = abstract_context hyps in
+ let c = abstract_constant_body (expmod c) hyps in
+ (c, priv)
+
+let cook_constr infos c =
+ let fold info c = cook_constr info c in
+ List.fold_right fold infos c
+
+let cook_constant { from = cb; info } =
let { Opaqueproof.modlist; abstract } = info in
let cache = RefTable.create 13 in
let abstract, usubst, abs_ctx = abstract in
@@ -220,13 +234,13 @@ let cook_constant ~hcons { from = cb; info } =
let expmod = expmod_constr_subst cache modlist usubst in
let hyps0 = Context.Named.map expmod abstract in
let hyps = abstract_context hyps0 in
- let map c =
- let c = abstract_constant_body (expmod c) hyps in
- if hcons then Constr.hcons c else c
- in
- let body = on_body modlist (hyps0, usubst, abs_ctx)
- map
- cb.const_body
+ let map c = abstract_constant_body (expmod c) hyps in
+ let body = match cb.const_body with
+ | Undef _ as x -> x
+ | Def cs -> Def (Mod_subst.from_val (map (Mod_subst.force_constr cs)))
+ | OpaqueDef o ->
+ OpaqueDef (Opaqueproof.discharge_direct_opaque info o)
+ | Primitive _ -> CErrors.anomaly (Pp.str "Primitives cannot be cooked")
in
let const_hyps =
Context.Named.fold_outside (fun decl hyps ->
@@ -234,15 +248,10 @@ let cook_constant ~hcons { from = cb; info } =
hyps)
hyps0 ~init:cb.const_hyps in
let typ = abstract_constant_type (expmod cb.const_type) hyps in
- let private_univs = Option.map (on_snd (Univ.subst_univs_level_constraints
- (Univ.make_instance_subst usubst)))
- cb.const_private_poly_univs
- in
{
cook_body = body;
cook_type = typ;
cook_universes = univs;
- cook_private_univs = private_univs;
cook_relevance = cb.const_relevance;
cook_inline = cb.const_inline_code;
cook_context = Some const_hyps;
@@ -251,4 +260,115 @@ let cook_constant ~hcons { from = cb; info } =
(* let cook_constant_key = CProfile.declare_profile "cook_constant" *)
(* let cook_constant = CProfile.profile2 cook_constant_key cook_constant *)
+(********************************)
+(* Discharging mutual inductive *)
+
+(* Replace
+
+ Var(y1)..Var(yq):C1..Cq |- Ij:Bj
+ Var(y1)..Var(yq):C1..Cq; I1..Ip:B1..Bp |- ci : Ti
+
+ by
+
+ |- Ij: (y1..yq:C1..Cq)Bj
+ I1..Ip:(B1 y1..yq)..(Bp y1..yq) |- ci : (y1..yq:C1..Cq)Ti[Ij:=(Ij y1..yq)]
+*)
+
+let it_mkNamedProd_wo_LetIn b d =
+ List.fold_left (fun c d -> mkNamedProd_wo_LetIn d c) b d
+
+let abstract_inductive decls nparamdecls inds =
+ let open Entries in
+ let ntyp = List.length inds in
+ let ndecls = Context.Named.length decls in
+ let args = Context.Named.to_instance mkVar (List.rev decls) in
+ let args = Array.of_list args in
+ let subs = List.init ntyp (fun k -> lift ndecls (mkApp(mkRel (k+1),args))) in
+ let inds' =
+ List.map
+ (function (tname,arity,template,cnames,lc) ->
+ let lc' = List.map (Vars.substl subs) lc in
+ let lc'' = List.map (fun b -> it_mkNamedProd_wo_LetIn b decls) lc' in
+ let arity' = it_mkNamedProd_wo_LetIn arity decls in
+ (tname,arity',template,cnames,lc''))
+ inds in
+ let nparamdecls' = nparamdecls + Array.length args in
+(* To be sure to be the same as before, should probably be moved to cook_inductive *)
+ let params' = let (_,arity,_,_,_) = List.hd inds' in
+ let (params,_) = decompose_prod_n_assum nparamdecls' arity in
+ params
+ in
+ let ind'' =
+ List.map
+ (fun (a,arity,template,c,lc) ->
+ let _, short_arity = decompose_prod_n_assum nparamdecls' arity in
+ let shortlc =
+ List.map (fun c -> snd (decompose_prod_n_assum nparamdecls' c)) lc in
+ { mind_entry_typename = a;
+ mind_entry_arity = short_arity;
+ mind_entry_template = template;
+ mind_entry_consnames = c;
+ mind_entry_lc = shortlc })
+ inds'
+ in (params',ind'')
+
+let refresh_polymorphic_type_of_inductive (_,mip) =
+ match mip.mind_arity with
+ | RegularArity s -> s.mind_user_arity, false
+ | TemplateArity ar ->
+ let ctx = List.rev mip.mind_arity_ctxt in
+ mkArity (List.rev ctx, Sorts.sort_of_univ ar.template_level), true
+
+let dummy_variance = let open Entries in function
+ | Monomorphic_entry _ -> assert false
+ | Polymorphic_entry (_,uctx) -> Array.make (Univ.UContext.size uctx) Univ.Variance.Irrelevant
+
+let cook_inductive { Opaqueproof.modlist; abstract } mib =
+ let open Entries in
+ let (section_decls, subst, abs_uctx) = abstract in
+ let nparamdecls = Context.Rel.length mib.mind_params_ctxt in
+ let subst, ind_univs =
+ match mib.mind_universes with
+ | Monomorphic ctx -> Univ.empty_level_subst, Monomorphic_entry ctx
+ | Polymorphic auctx ->
+ let subst, auctx = discharge_abstract_universe_context subst abs_uctx auctx in
+ let subst = Univ.make_instance_subst subst in
+ let nas = Univ.AUContext.names auctx in
+ let auctx = Univ.AUContext.repr auctx in
+ subst, Polymorphic_entry (nas, auctx)
+ in
+ let variance = match mib.mind_variance with
+ | None -> None
+ | Some _ -> Some (dummy_variance ind_univs)
+ in
+ let cache = RefTable.create 13 in
+ let discharge c = Vars.subst_univs_level_constr subst (expmod_constr cache modlist c) in
+ let inds =
+ Array.map_to_list
+ (fun mip ->
+ let ty, template = refresh_polymorphic_type_of_inductive (mib,mip) in
+ let arity = discharge ty in
+ let lc = Array.map discharge mip.mind_user_lc in
+ (mip.mind_typename,
+ arity, template,
+ Array.to_list mip.mind_consnames,
+ Array.to_list lc))
+ mib.mind_packets in
+ let section_decls' = Context.Named.map discharge section_decls in
+ let (params',inds') = abstract_inductive section_decls' nparamdecls inds in
+ let record = match mib.mind_record with
+ | PrimRecord info ->
+ Some (Some (Array.map (fun (x,_,_,_) -> x) info))
+ | FakeRecord -> Some None
+ | NotRecord -> None
+ in
+ { mind_entry_record = record;
+ mind_entry_finite = mib.mind_finite;
+ mind_entry_params = params';
+ mind_entry_inds = inds';
+ mind_entry_private = mib.mind_private;
+ mind_entry_variance = variance;
+ mind_entry_universes = ind_univs
+ }
+
let expmod_constr modlist c = expmod_constr (RefTable.create 13) modlist c
diff --git a/kernel/cooking.mli b/kernel/cooking.mli
index b022e2ac09..671cdf51fe 100644
--- a/kernel/cooking.mli
+++ b/kernel/cooking.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -21,14 +21,17 @@ type 'opaque result = {
cook_body : (constr Mod_subst.substituted, 'opaque) constant_def;
cook_type : types;
cook_universes : universes;
- cook_private_univs : Univ.ContextSet.t option;
cook_relevance : Sorts.relevance;
cook_inline : inline;
cook_context : Constr.named_context option;
}
-val cook_constant : hcons:bool -> recipe -> Opaqueproof.opaque result
-val cook_constr : Opaqueproof.cooking_info -> constr -> constr
+val cook_constant : recipe -> Opaqueproof.opaque result
+val cook_constr : Opaqueproof.cooking_info list ->
+ (constr * unit Opaqueproof.delayed_universes) -> (constr * unit Opaqueproof.delayed_universes)
+
+val cook_inductive :
+ Opaqueproof.cooking_info -> mutual_inductive_body -> Entries.mutual_inductive_entry
(** {6 Utility functions used in module [Discharge]. } *)
diff --git a/kernel/csymtable.ml b/kernel/csymtable.ml
index 8bef6aec42..6c9e73b50d 100644
--- a/kernel/csymtable.ml
+++ b/kernel/csymtable.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/csymtable.mli b/kernel/csymtable.mli
index 72c96b0b9f..3322c89aa9 100644
--- a/kernel/csymtable.mli
+++ b/kernel/csymtable.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/declarations.ml b/kernel/declarations.ml
index 36ee952099..dff19dee5e 100644
--- a/kernel/declarations.ml
+++ b/kernel/declarations.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -22,11 +22,11 @@ type engagement = set_predicativity
(** {6 Representation of constants (Definition/Axiom) } *)
(** Non-universe polymorphic mode polymorphism (Coq 8.2+): inductives
- and constants hiding inductives are implicitely polymorphic when
+ and constants hiding inductives are implicitly polymorphic when
applied to parameters, on the universes appearing in the whnf of
their parameters and their conclusion, in a template style.
- In truely universe polymorphic mode, we always use RegularArity.
+ In truly universe polymorphic mode, we always use RegularArity.
*)
type template_arity = {
@@ -94,7 +94,6 @@ type 'opaque constant_body = {
const_relevance : Sorts.relevance;
const_body_code : Cemitcodes.to_patch_substituted option;
const_universes : universes;
- const_private_poly_univs : Univ.ContextSet.t option;
const_inline_code : bool;
const_typing_flags : typing_flags; (** The typing options which
were used for
@@ -165,7 +164,7 @@ type one_inductive_body = {
mind_nrealdecls : int; (** Length of realargs context (with let, no params) *)
- mind_kelim : Sorts.family list; (** List of allowed elimination sorts *)
+ mind_kelim : Sorts.family; (** Highest allowed elimination sort *)
mind_nf_lc : (rel_context * types) array; (** Head normalized constructor types so that their conclusion exposes the inductive type *)
diff --git a/kernel/declareops.ml b/kernel/declareops.ml
index de9a052096..7a553700e8 100644
--- a/kernel/declareops.ml
+++ b/kernel/declareops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -113,7 +113,6 @@ let subst_const_body sub cb =
const_body_code =
Option.map (Cemitcodes.subst_to_patch_subst sub) cb.const_body_code;
const_universes = cb.const_universes;
- const_private_poly_univs = cb.const_private_poly_univs;
const_relevance = cb.const_relevance;
const_inline_code = cb.const_inline_code;
const_typing_flags = cb.const_typing_flags }
@@ -144,16 +143,11 @@ let hcons_universes cbu =
| Polymorphic ctx ->
Polymorphic (Univ.hcons_abstract_universe_context ctx)
-let hcons_const_private_univs = function
- | None -> None
- | Some univs -> Some (Univ.hcons_universe_context_set univs)
-
let hcons_const_body cb =
{ cb with
const_body = hcons_const_def cb.const_body;
const_type = Constr.hcons cb.const_type;
const_universes = hcons_universes cb.const_universes;
- const_private_poly_univs = hcons_const_private_univs cb.const_private_poly_univs;
}
(** {6 Inductive types } *)
diff --git a/kernel/declareops.mli b/kernel/declareops.mli
index fb02c6a029..5a1331afa9 100644
--- a/kernel/declareops.mli
+++ b/kernel/declareops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/dune b/kernel/dune
index 5b23a705ae..4038bf5638 100644
--- a/kernel/dune
+++ b/kernel/dune
@@ -3,7 +3,7 @@
(synopsis "The Coq Kernel")
(public_name coq.kernel)
(wrapped false)
- (modules (:standard \ genOpcodeFiles uint63_x86 uint63_amd64 write_uint63))
+ (modules (:standard \ genOpcodeFiles uint63_i386_31 uint63_amd64_63 write_uint63))
(libraries lib byterun dynlink))
(executable
@@ -14,15 +14,10 @@
(targets copcodes.ml)
(action (with-stdout-to %{targets} (run ./genOpcodeFiles.exe copml))))
-(executable
- (name write_uint63)
- (modules write_uint63)
- (libraries unix))
-
(rule
(targets uint63.ml)
- (deps (:gen ./write_uint63.exe) uint63_x86.ml uint63_amd64.ml)
- (action (run %{gen})))
+ (deps (:gen-file uint63_%{ocaml-config:architecture}_%{ocaml-config:int_size}.ml))
+ (action (copy# %{gen-file} %{targets})))
(documentation
(package coq))
diff --git a/kernel/entries.ml b/kernel/entries.ml
index adb3f6bd29..2d29c3ee19 100644
--- a/kernel/entries.ml
+++ b/kernel/entries.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -60,15 +60,14 @@ type mutual_inductive_entry = {
type 'a proof_output = constr Univ.in_universe_context_set * 'a
type 'a const_entry_body = 'a proof_output Future.computation
-type 'a definition_entry = {
- const_entry_body : 'a const_entry_body;
+type definition_entry = {
+ const_entry_body : constr Univ.in_universe_context_set;
(* List of section variables *)
const_entry_secctx : Constr.named_context option;
(* State id on which the completion of type checking is reported *)
const_entry_feedback : Stateid.t option;
const_entry_type : types option;
const_entry_universes : universes_entry;
- const_entry_opaque : bool;
const_entry_inline_code : bool }
type section_def_entry = {
@@ -78,6 +77,16 @@ type section_def_entry = {
secdef_type : types option;
}
+type 'a opaque_entry = {
+ opaque_entry_body : 'a;
+ (* List of section variables *)
+ opaque_entry_secctx : Constr.named_context option;
+ (* State id on which the completion of type checking is reported *)
+ opaque_entry_feedback : Stateid.t option;
+ opaque_entry_type : types;
+ opaque_entry_universes : universes_entry;
+}
+
type inline = int option (* inlining level, None for no inlining *)
type parameter_entry =
@@ -90,7 +99,8 @@ type primitive_entry = {
}
type 'a constant_entry =
- | DefinitionEntry of 'a definition_entry
+ | DefinitionEntry of definition_entry
+ | OpaqueEntry of 'a const_entry_body opaque_entry
| ParameterEntry of parameter_entry
| PrimitiveEntry of primitive_entry
@@ -107,8 +117,3 @@ type module_entry =
| MType of module_params_entry * module_struct_entry
| MExpr of
module_params_entry * module_struct_entry * module_struct_entry option
-
-(** Not used by the kernel. *)
-type side_effect_role =
- | Subproof
- | Schema of inductive * string
diff --git a/kernel/environ.ml b/kernel/environ.ml
index 05f342a82a..32f9069747 100644
--- a/kernel/environ.ml
+++ b/kernel/environ.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -483,16 +483,6 @@ let constant_value_and_type env (kn, u) =
in
b', subst_instance_constr u cb.const_type, cst
-let body_of_constant_body env cb =
- let otab = opaque_tables env in
- match cb.const_body with
- | Undef _ | Primitive _ ->
- None
- | Def c ->
- Some (Mod_subst.force_constr c, Declareops.constant_polymorphic_context cb)
- | OpaqueDef o ->
- Some (Opaqueproof.force_proof otab o, Declareops.constant_polymorphic_context cb)
-
(* These functions should be called under the invariant that [env]
already contains the constraints corresponding to the constant
application. *)
diff --git a/kernel/environ.mli b/kernel/environ.mli
index f6cd41861e..a4cd576bcc 100644
--- a/kernel/environ.mli
+++ b/kernel/environ.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -215,12 +215,6 @@ val constant_value_and_type : env -> Constant.t puniverses ->
polymorphic *)
val constant_context : env -> Constant.t -> Univ.AUContext.t
-(** Returns the body of the constant if it has any, and the polymorphic context
- it lives in. For monomorphic constant, the latter is empty, and for
- polymorphic constants, the term contains De Bruijn universe variables that
- need to be instantiated. *)
-val body_of_constant_body : env -> Opaqueproof.opaque constant_body -> (Constr.constr * Univ.AUContext.t) option
-
(* These functions should be called under the invariant that [env]
already contains the constraints corresponding to the constant
application. *)
diff --git a/kernel/esubst.ml b/kernel/esubst.ml
index 9fc3b11d78..f10cf20b42 100644
--- a/kernel/esubst.ml
+++ b/kernel/esubst.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/esubst.mli b/kernel/esubst.mli
index 475b64f472..400f91d302 100644
--- a/kernel/esubst.mli
+++ b/kernel/esubst.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/evar.ml b/kernel/evar.ml
index bbe143092b..a0bed31f68 100644
--- a/kernel/evar.ml
+++ b/kernel/evar.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/evar.mli b/kernel/evar.mli
index d14cdce27a..25a92d3e1d 100644
--- a/kernel/evar.mli
+++ b/kernel/evar.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/genOpcodeFiles.ml b/kernel/genOpcodeFiles.ml
index 6564954dfd..a8a4ffce9c 100644
--- a/kernel/genOpcodeFiles.ml
+++ b/kernel/genOpcodeFiles.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/indTyping.ml b/kernel/indTyping.ml
index 4e6e595331..c8e04b9fee 100644
--- a/kernel/indTyping.ml
+++ b/kernel/indTyping.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -232,18 +232,9 @@ let check_record data =
(* - all_sorts in case of small, unitary Prop (not smashed) *)
(* - logical_sorts in case of large, unitary Prop (smashed) *)
-let all_sorts = [InSProp;InProp;InSet;InType]
-let small_sorts = [InSProp;InProp;InSet]
-let logical_sorts = [InSProp;InProp]
-let sprop_sorts = [InSProp]
-
let allowed_sorts {ind_squashed;ind_univ;ind_min_univ=_;ind_has_relevant_arg=_} =
- if not ind_squashed then all_sorts
- else match Sorts.family (Sorts.sort_of_univ ind_univ) with
- | InType -> assert false
- | InSet -> small_sorts
- | InProp -> logical_sorts
- | InSProp -> sprop_sorts
+ if not ind_squashed then InType
+ else Sorts.family (Sorts.sort_of_univ ind_univ)
(* Returns the list [x_1, ..., x_n] of levels contributing to template
polymorphism. The elements x_k is None if the k-th parameter (starting
diff --git a/kernel/indTyping.mli b/kernel/indTyping.mli
index ad51af66a2..aaa0d6a149 100644
--- a/kernel/indTyping.mli
+++ b/kernel/indTyping.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -22,7 +22,7 @@ open Declarations
- for each inductive,
(arity * constructors) (with params)
* (indices * splayed constructor types) (both without params)
- * allowed eliminations
+ * top allowed elimination
*)
val typecheck_inductive : env -> mutual_inductive_entry ->
env
@@ -31,5 +31,5 @@ val typecheck_inductive : env -> mutual_inductive_entry ->
* Constr.rel_context
* ((inductive_arity * Constr.types array) *
(Constr.rel_context * (Constr.rel_context * Constr.types) array) *
- Sorts.family list)
+ Sorts.family)
array
diff --git a/kernel/indtypes.ml b/kernel/indtypes.ml
index bb3b0a538e..b0366d6ec0 100644
--- a/kernel/indtypes.ml
+++ b/kernel/indtypes.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/indtypes.mli b/kernel/indtypes.mli
index 1b8e4208ff..240ba4e2bb 100644
--- a/kernel/indtypes.mli
+++ b/kernel/indtypes.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/inductive.ml b/kernel/inductive.ml
index d9335d39b5..cd969ea457 100644
--- a/kernel/inductive.ml
+++ b/kernel/inductive.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -166,7 +166,7 @@ let make_subst env =
(* template, it is identity substitution otherwise (ie. when u is *)
(* already in the domain of the substitution) [remember_subst] will *)
(* update its image [x] by [sup x u] in order not to forget the *)
- (* dependency in [u] that remains to be fullfilled. *)
+ (* dependency in [u] that remains to be fulfilled. *)
make (remember_subst u subst) (sign, exp, [])
| _sign, [], _ ->
(* Uniform parameters are exhausted *)
@@ -289,7 +289,7 @@ let get_instantiated_arity (_ind,u) (mib,mip) params =
let sign, s = mind_arity mip in
full_inductive_instantiate mib u params sign, s
-let elim_sorts (_,mip) = mip.mind_kelim
+let elim_sort (_,mip) = mip.mind_kelim
let is_private (mib,_) = mib.mind_private = Some true
let is_primitive_record (mib,_) =
@@ -305,12 +305,12 @@ let build_dependent_inductive ind (_,mip) params =
@ Context.Rel.to_extended_list mkRel 0 realargs)
(* This exception is local *)
-exception LocalArity of (Sorts.family list * Sorts.family * Sorts.family * arity_error) option
+exception LocalArity of (Sorts.family * Sorts.family * Sorts.family * arity_error) option
let check_allowed_sort ksort specif =
- if not (CList.exists (Sorts.family_equal ksort) (elim_sorts specif)) then
+ if not (Sorts.family_leq ksort (elim_sort specif)) then
let s = inductive_sort_family (snd specif) in
- raise (LocalArity (Some(elim_sorts specif, ksort,s,error_elim_explain ksort s)))
+ raise (LocalArity (Some(elim_sort specif, ksort,s,error_elim_explain ksort s)))
let is_correct_arity env c pj ind specif params =
let arsign,_ = get_instantiated_arity ind specif params in
diff --git a/kernel/inductive.mli b/kernel/inductive.mli
index 997a620742..8c40c318c5 100644
--- a/kernel/inductive.mli
+++ b/kernel/inductive.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -52,7 +52,7 @@ val type_of_inductive : env -> mind_specif puniverses -> types
val type_of_inductive_knowing_parameters :
env -> ?polyprop:bool -> mind_specif puniverses -> types Lazy.t array -> types
-val elim_sorts : mind_specif -> Sorts.family list
+val elim_sort : mind_specif -> Sorts.family
val is_private : mind_specif -> bool
val is_primitive_record : mind_specif -> bool
diff --git a/kernel/mod_subst.ml b/kernel/mod_subst.ml
index 9397772415..c5ea32e157 100644
--- a/kernel/mod_subst.ml
+++ b/kernel/mod_subst.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/mod_subst.mli b/kernel/mod_subst.mli
index 8ab3d04402..b69e62b8a6 100644
--- a/kernel/mod_subst.mli
+++ b/kernel/mod_subst.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/mod_typing.ml b/kernel/mod_typing.ml
index 2de5faa6df..9305a91731 100644
--- a/kernel/mod_typing.ml
+++ b/kernel/mod_typing.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -188,7 +188,7 @@ let rec check_with_mod env struc (idl,mp1) mp equiv =
in
let new_equiv = add_delta_resolver equiv new_mb.mod_delta in
(* we propagate the new equality in the rest of the signature
- with the identity substitution accompagned by the new resolver*)
+ with the identity substitution accompanied by the new resolver*)
let id_subst = map_mp mp' mp' new_mb.mod_delta in
let new_after = subst_structure id_subst after in
before@(lab,SFBmodule new_mb')::new_after, new_equiv, cst
diff --git a/kernel/mod_typing.mli b/kernel/mod_typing.mli
index e74f455efe..aa8aa96746 100644
--- a/kernel/mod_typing.mli
+++ b/kernel/mod_typing.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/modops.ml b/kernel/modops.ml
index 4fdd7ab334..4808ed14e4 100644
--- a/kernel/modops.ml
+++ b/kernel/modops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -329,7 +329,6 @@ let strengthen_const mp_from l cb resolver =
let u = Univ.make_abstract_instance (Declareops.constant_polymorphic_context cb) in
{ cb with
const_body = Def (Mod_subst.from_val (mkConstU (con,u)));
- const_private_poly_univs = None;
const_body_code = Some (Cemitcodes.from_val (Cbytegen.compile_alias con)) }
let rec strengthen_mod mp_from mp_to mb =
@@ -515,7 +514,7 @@ and strengthen_and_subst_struct str subst mp_from mp_to alias incl reso =
"Module M:=P." or "Module M. Include P. End M."
We need to perform two operations to compute the body of M.
- The first one is applying the substitution {P <- M} on the type of P
- - The second one is strenghtening. *)
+ - The second one is strengthening. *)
let strengthen_and_subst_mb mb mp include_b = match mb.mod_type with
|NoFunctor struc ->
diff --git a/kernel/modops.mli b/kernel/modops.mli
index 119ce2b359..badbd973ae 100644
--- a/kernel/modops.mli
+++ b/kernel/modops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/names.ml b/kernel/names.ml
index 047a1d6525..85dc8267bb 100644
--- a/kernel/names.ml
+++ b/kernel/names.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -671,6 +671,7 @@ module InductiveOrdered_env = struct
let compare = ind_user_ord
end
+module Indset = Set.Make(InductiveOrdered)
module Indmap = Map.Make(InductiveOrdered)
module Indmap_env = Map.Make(InductiveOrdered_env)
diff --git a/kernel/names.mli b/kernel/names.mli
index 2238e932b0..65c5d6c139 100644
--- a/kernel/names.mli
+++ b/kernel/names.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -481,6 +481,7 @@ type constructor = inductive (* designates the inductive type *)
* int (* the index of the constructor
BEWARE: indexing starts from 1. *)
+module Indset : CSig.SetS with type elt = inductive
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
diff --git a/kernel/nativecode.ml b/kernel/nativecode.ml
index 3f791dfc22..fc9e69d9e3 100644
--- a/kernel/nativecode.ml
+++ b/kernel/nativecode.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/nativecode.mli b/kernel/nativecode.mli
index b5c03b6ca3..955c4ad899 100644
--- a/kernel/nativecode.mli
+++ b/kernel/nativecode.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/nativeconv.ml b/kernel/nativeconv.ml
index d153f84e9c..a98523ba66 100644
--- a/kernel/nativeconv.ml
+++ b/kernel/nativeconv.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/nativeconv.mli b/kernel/nativeconv.mli
index 2111739d5e..9cacf0f4ef 100644
--- a/kernel/nativeconv.mli
+++ b/kernel/nativeconv.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/nativelambda.ml b/kernel/nativelambda.ml
index 62afd9df68..70b3beb2dc 100644
--- a/kernel/nativelambda.ml
+++ b/kernel/nativelambda.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/nativelambda.mli b/kernel/nativelambda.mli
index 446df1a1ea..f17339f84d 100644
--- a/kernel/nativelambda.mli
+++ b/kernel/nativelambda.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/nativelib.ml b/kernel/nativelib.ml
index 43c9676f05..94a8b1310a 100644
--- a/kernel/nativelib.ml
+++ b/kernel/nativelib.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/nativelib.mli b/kernel/nativelib.mli
index e113350368..194efecd9a 100644
--- a/kernel/nativelib.mli
+++ b/kernel/nativelib.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/nativelibrary.ml b/kernel/nativelibrary.ml
index 5d1b882361..1dbab6c690 100644
--- a/kernel/nativelibrary.ml
+++ b/kernel/nativelibrary.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/nativelibrary.mli b/kernel/nativelibrary.mli
index 31e5255fc4..168bf646af 100644
--- a/kernel/nativelibrary.mli
+++ b/kernel/nativelibrary.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/nativevalues.ml b/kernel/nativevalues.ml
index 3eb51ffc59..b3ad3949dc 100644
--- a/kernel/nativevalues.ml
+++ b/kernel/nativevalues.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/nativevalues.mli b/kernel/nativevalues.mli
index 58cb6e2c30..b5b4569a24 100644
--- a/kernel/nativevalues.mli
+++ b/kernel/nativevalues.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/opaqueproof.ml b/kernel/opaqueproof.ml
index 18c1bcc0f8..e256466112 100644
--- a/kernel/opaqueproof.ml
+++ b/kernel/opaqueproof.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -16,10 +16,27 @@ open Mod_subst
type work_list = (Instance.t * Id.t array) Cmap.t *
(Instance.t * Id.t array) Mindmap.t
-type cooking_info = {
- modlist : work_list;
+type cooking_info = {
+ modlist : work_list;
abstract : Constr.named_context * Univ.Instance.t * Univ.AUContext.t }
-type proofterm = (constr * Univ.ContextSet.t) Future.computation
+
+type 'a delayed_universes =
+| PrivateMonomorphic of 'a
+| PrivatePolymorphic of int * Univ.ContextSet.t
+
+type opaque_proofterm = cooking_info list * (Constr.t * unit delayed_universes) option
+
+type indirect_accessor = {
+ access_proof : DirPath.t -> int -> opaque_proofterm;
+ access_discharge : cooking_info list -> (Constr.t * unit delayed_universes) -> (Constr.t * unit delayed_universes);
+}
+
+let drop_mono = function
+| PrivateMonomorphic _ -> PrivateMonomorphic ()
+| PrivatePolymorphic _ as ctx -> ctx
+
+type proofterm = (constr * Univ.ContextSet.t delayed_universes) Future.computation
+
type opaque =
| Indirect of substitution list * DirPath.t * int (* subst, lib, index *)
| Direct of cooking_info list * proofterm
@@ -36,20 +53,8 @@ let empty_opaquetab = {
opaque_dir = DirPath.initial;
}
-(* hooks *)
-let default_get_opaque dp _ =
- CErrors.user_err Pp.(pr_sequence str ["Cannot access opaque proofs in library"; DirPath.to_string dp])
-let default_get_univ dp _ =
- CErrors.user_err (Pp.pr_sequence Pp.str [
- "Cannot access universe constraints of opaque proofs in library ";
- DirPath.to_string dp])
-
-let get_opaque = ref default_get_opaque
-let get_univ = ref default_get_univ
-
-let set_indirect_opaque_accessor f = (get_opaque := f)
-let set_indirect_univ_accessor f = (get_univ := f)
-(* /hooks *)
+let not_here () =
+ CErrors.user_err Pp.(str "Cannot access opaque delayed proof")
let create cu = Direct ([],cu)
@@ -58,11 +63,19 @@ let turn_indirect dp o tab = match o with
if not (Int.Map.mem i tab.opaque_val)
then CErrors.anomaly (Pp.str "Indirect in a different table.")
else CErrors.anomaly (Pp.str "Already an indirect opaque.")
- | Direct (d,cu) ->
- (** Uncomment to check dynamically that all terms turned into
- indirections are hashconsed. *)
-(* let check_hcons c = let c' = hcons_constr c in assert (c' == c); c in *)
-(* let cu = Future.chain ~pure:true cu (fun (c, u) -> check_hcons c; c, u) in *)
+ | Direct (d, cu) ->
+ (* Invariant: direct opaques only exist inside sections, we turn them
+ indirect as soon as we are at toplevel. At this moment, we perform
+ hashconsing of their contents, potentially as a future. *)
+ let hcons (c, u) =
+ let c = Constr.hcons c in
+ let u = match u with
+ | PrivateMonomorphic u -> PrivateMonomorphic (Univ.hcons_universe_context_set u)
+ | PrivatePolymorphic (n, u) -> PrivatePolymorphic (n, Univ.hcons_universe_context_set u)
+ in
+ (c, u)
+ in
+ let cu = Future.chain cu hcons in
let id = tab.opaque_len in
let opaque_val = Int.Map.add id (d,cu) tab.opaque_val in
let opaque_dir =
@@ -77,10 +90,10 @@ let subst_opaque sub = function
| Indirect (s,dp,i) -> Indirect (sub::s,dp,i)
| Direct _ -> CErrors.anomaly (Pp.str "Substituting a Direct opaque.")
-let discharge_direct_opaque ~cook_constr ci = function
+let discharge_direct_opaque ci = function
| Indirect _ -> CErrors.anomaly (Pp.str "Not a direct opaque.")
- | Direct (d,cu) ->
- Direct (ci::d,Future.chain cu (fun (c, u) -> cook_constr c, u))
+ | Direct (d, cu) ->
+ Direct (ci :: d, cu)
let join except cu = match except with
| None -> ignore (Future.join cu)
@@ -92,54 +105,67 @@ let join_opaque ?except { opaque_val = prfs; opaque_dir = odp; _ } = function
| Direct (_,cu) -> join except cu
| Indirect (_,dp,i) ->
if DirPath.equal dp odp then
- let fp = snd (Int.Map.find i prfs) in
+ let (_, fp) = Int.Map.find i prfs in
join except fp
-let force_proof { opaque_val = prfs; opaque_dir = odp; _ } = function
- | Direct (_,cu) ->
- fst(Future.force cu)
+let force_proof access { opaque_val = prfs; opaque_dir = odp; _ } = function
+ | Direct (d, cu) ->
+ let (c, u) = Future.force cu in
+ access.access_discharge d (c, drop_mono u)
| Indirect (l,dp,i) ->
- let pt =
+ let c, u =
if DirPath.equal dp odp
- then Future.chain (snd (Int.Map.find i prfs)) fst
- else !get_opaque dp i in
- let c = Future.force pt in
- force_constr (List.fold_right subst_substituted l (from_val c))
-
-let force_constraints { opaque_val = prfs; opaque_dir = odp; _ } = function
- | Direct (_,cu) -> snd(Future.force cu)
+ then
+ let (d, cu) = Int.Map.find i prfs in
+ let (c, u) = Future.force cu in
+ access.access_discharge d (c, drop_mono u)
+ else
+ let (d, cu) = access.access_proof dp i in
+ match cu with
+ | None -> not_here ()
+ | Some (c, u) -> access.access_discharge d (c, u)
+ in
+ let c = force_constr (List.fold_right subst_substituted l (from_val c)) in
+ (c, u)
+
+let get_mono (_, u) = match u with
+| PrivateMonomorphic ctx -> ctx
+| PrivatePolymorphic _ -> Univ.ContextSet.empty
+
+let force_constraints _access { opaque_val = prfs; opaque_dir = odp; _ } = function
+ | Direct (_,cu) ->
+ get_mono (Future.force cu)
| Indirect (_,dp,i) ->
if DirPath.equal dp odp
- then snd (Future.force (snd (Int.Map.find i prfs)))
- else match !get_univ dp i with
- | None -> Univ.ContextSet.empty
- | Some u -> Future.force u
+ then
+ let ( _, cu) = Int.Map.find i prfs in
+ get_mono (Future.force cu)
+ else Univ.ContextSet.empty
-let get_constraints { opaque_val = prfs; opaque_dir = odp; _ } = function
- | Direct (_,cu) -> Some(Future.chain cu snd)
- | Indirect (_,dp,i) ->
- if DirPath.equal dp odp
- then Some(Future.chain (snd (Int.Map.find i prfs)) snd)
- else !get_univ dp i
+let get_direct_constraints = function
+| Indirect _ -> CErrors.anomaly (Pp.str "Not a direct opaque.")
+| Direct (_, cu) ->
+ Future.chain cu get_mono
module FMap = Future.UUIDMap
-let a_constr = Future.from_val (mkRel 1)
-let a_univ = Future.from_val Univ.ContextSet.empty
-let a_discharge : cooking_info list = []
-
-let dump { opaque_val = otab; opaque_len = n; _ } =
- let opaque_table = Array.make n a_constr in
- let univ_table = Array.make n a_univ in
- let disch_table = Array.make n a_discharge in
+let dump ?(except = Future.UUIDSet.empty) { opaque_val = otab; opaque_len = n; _ } =
+ let opaque_table = Array.make n ([], None) in
let f2t_map = ref FMap.empty in
- Int.Map.iter (fun n (d,cu) ->
- let c, u = Future.split2 cu in
- Future.sink u;
- Future.sink c;
- opaque_table.(n) <- c;
- univ_table.(n) <- u;
- disch_table.(n) <- d;
- f2t_map := FMap.add (Future.uuid cu) n !f2t_map)
- otab;
- opaque_table, univ_table, disch_table, !f2t_map
+ let iter n (d, cu) =
+ let uid = Future.uuid cu in
+ let () = f2t_map := FMap.add (Future.uuid cu) n !f2t_map in
+ let c =
+ if Future.is_val cu then
+ let (c, priv) = Future.force cu in
+ let priv = drop_mono priv in
+ Some (c, priv)
+ else if Future.UUIDSet.mem uid except then None
+ else
+ CErrors.anomaly
+ Pp.(str"Proof object "++int n++str" is not checked nor to be checked")
+ in
+ opaque_table.(n) <- (d, c)
+ in
+ let () = Int.Map.iter iter otab in
+ opaque_table, !f2t_map
diff --git a/kernel/opaqueproof.mli b/kernel/opaqueproof.mli
index 4e8956af06..7c53656c3c 100644
--- a/kernel/opaqueproof.mli
+++ b/kernel/opaqueproof.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -21,7 +21,12 @@ open Mod_subst
When it is [turn_indirect] the data is relocated to an opaque table
and the [opaque] is turned into an index. *)
-type proofterm = (constr * Univ.ContextSet.t) Future.computation
+type 'a delayed_universes =
+| PrivateMonomorphic of 'a
+| PrivatePolymorphic of int * Univ.ContextSet.t
+ (** Number of surrounding bound universes + local constraints *)
+
+type proofterm = (constr * Univ.ContextSet.t delayed_universes) Future.computation
type opaquetab
type opaque
@@ -35,46 +40,38 @@ val create : proofterm -> opaque
used so far *)
val turn_indirect : DirPath.t -> opaque -> opaquetab -> opaque * opaquetab
-(** From a [opaque] back to a [constr]. This might use the
- indirect opaque accessor configured below. *)
-val force_proof : opaquetab -> opaque -> constr
-val force_constraints : opaquetab -> opaque -> Univ.ContextSet.t
-val get_constraints :
- opaquetab -> opaque -> Univ.ContextSet.t Future.computation option
-
-val subst_opaque : substitution -> opaque -> opaque
-
-type work_list = (Univ.Instance.t * Id.t array) Cmap.t *
+type work_list = (Univ.Instance.t * Id.t array) Cmap.t *
(Univ.Instance.t * Id.t array) Mindmap.t
-type cooking_info = {
- modlist : work_list;
+type cooking_info = {
+ modlist : work_list;
abstract : Constr.named_context * Univ.Instance.t * Univ.AUContext.t }
-(* The type has two caveats:
- 1) cook_constr is defined after
- 2) we have to store the input in the [opaque] in order to be able to
- discharge it when turning a .vi into a .vo *)
-val discharge_direct_opaque :
- cook_constr:(constr -> constr) -> cooking_info -> opaque -> opaque
-
-val join_opaque : ?except:Future.UUIDSet.t -> opaquetab -> opaque -> unit
-
-val dump : opaquetab ->
- Constr.t Future.computation array *
- Univ.ContextSet.t Future.computation array *
- cooking_info list array *
- int Future.UUIDMap.t
+type opaque_proofterm = cooking_info list * (Constr.t * unit delayed_universes) option
+type indirect_accessor = {
+ access_proof : DirPath.t -> int -> opaque_proofterm;
+ access_discharge : cooking_info list ->
+ (Constr.t * unit delayed_universes) -> (Constr.t * unit delayed_universes);
+}
(** When stored indirectly, opaque terms are indexed by their library
- dirpath and an integer index. The following two functions activate
- this indirect storage, by telling how to store and retrieve terms.
- Default creator always returns [None], preventing the creation of
- any indirect link, and default accessor always raises an error.
+ dirpath and an integer index. The two functions above activate
+ this indirect storage, by telling how to retrieve terms.
*)
-val set_indirect_opaque_accessor :
- (DirPath.t -> int -> constr Future.computation) -> unit
-val set_indirect_univ_accessor :
- (DirPath.t -> int -> Univ.ContextSet.t Future.computation option) -> unit
+(** From a [opaque] back to a [constr]. This might use the
+ indirect opaque accessor given as an argument. *)
+val force_proof : indirect_accessor -> opaquetab -> opaque -> constr * unit delayed_universes
+val force_constraints : indirect_accessor -> opaquetab -> opaque -> Univ.ContextSet.t
+val get_direct_constraints : opaque -> Univ.ContextSet.t Future.computation
+val subst_opaque : substitution -> opaque -> opaque
+
+val discharge_direct_opaque :
+ cooking_info -> opaque -> opaque
+
+val join_opaque : ?except:Future.UUIDSet.t -> opaquetab -> opaque -> unit
+
+val dump : ?except:Future.UUIDSet.t -> opaquetab ->
+ opaque_proofterm array *
+ int Future.UUIDMap.t
diff --git a/kernel/reduction.ml b/kernel/reduction.ml
index 11ece78fe0..53f228c618 100644
--- a/kernel/reduction.ml
+++ b/kernel/reduction.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/reduction.mli b/kernel/reduction.mli
index 7dcafb7d7b..ab34d3a6dc 100644
--- a/kernel/reduction.mli
+++ b/kernel/reduction.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/retroknowledge.ml b/kernel/retroknowledge.ml
index e1c4cec5b5..873c6af93d 100644
--- a/kernel/retroknowledge.ml
+++ b/kernel/retroknowledge.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/retroknowledge.mli b/kernel/retroknowledge.mli
index 09e8140308..2a7b390951 100644
--- a/kernel/retroknowledge.mli
+++ b/kernel/retroknowledge.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/retypeops.ml b/kernel/retypeops.ml
index 204dec3eda..a51b762f95 100644
--- a/kernel/retypeops.ml
+++ b/kernel/retypeops.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Util
diff --git a/kernel/retypeops.mli b/kernel/retypeops.mli
index f30c541c3f..f4497be44b 100644
--- a/kernel/retypeops.mli
+++ b/kernel/retypeops.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
(** We can take advantage of non-cumulativity of SProp to avoid fully
diff --git a/kernel/safe_typing.ml b/kernel/safe_typing.ml
index a5d8a480ee..a0cc2974d9 100644
--- a/kernel/safe_typing.ml
+++ b/kernel/safe_typing.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -231,8 +231,7 @@ let check_engagement env expected_impredicative_set =
type side_effect = {
from_env : Declarations.structure_body CEphemeron.key;
seff_constant : Constant.t;
- seff_body : (Constr.t * Univ.ContextSet.t) Declarations.constant_body;
- seff_role : Entries.side_effect_role;
+ seff_body : Constr.t Declarations.constant_body;
}
module SideEffects :
@@ -299,11 +298,6 @@ let concat_private = SideEffects.concat
let universes_of_private eff =
let fold acc eff =
- let acc = match eff.seff_body.const_body with
- | Def _ -> acc
- | OpaqueDef (_, ctx) -> ctx :: acc
- | Primitive _ | Undef _ -> assert false
- in
match eff.seff_body.const_universes with
| Monomorphic ctx -> ctx :: acc
| Polymorphic _ -> acc
@@ -314,23 +308,24 @@ let env_of_safe_env senv = senv.env
let env_of_senv = env_of_safe_env
type constraints_addition =
- | Now of bool * Univ.ContextSet.t
+ | Now of Univ.ContextSet.t
| Later of Univ.ContextSet.t Future.computation
+let push_context_set poly cst senv =
+ { senv with
+ env = Environ.push_context_set ~strict:(not poly) cst senv.env;
+ univ = Univ.ContextSet.union cst senv.univ }
+
let add_constraints cst senv =
match cst with
| Later fc ->
{senv with future_cst = fc :: senv.future_cst}
- | Now (poly,cst) ->
- { senv with
- env = Environ.push_context_set ~strict:(not poly) cst senv.env;
- univ = Univ.ContextSet.union cst senv.univ }
+ | Now cst ->
+ push_context_set false cst senv
let add_constraints_list cst senv =
List.fold_left (fun acc c -> add_constraints c acc) senv cst
-let push_context_set poly ctx = add_constraints (Now (poly,ctx))
-
let is_curmod_library senv =
match senv.modvariant with LIBRARY -> true | _ -> false
@@ -339,7 +334,7 @@ let join_safe_environment ?(except=Future.UUIDSet.empty) e =
List.fold_left
(fun e fc ->
if Future.UUIDSet.mem (Future.uuid fc) except then e
- else add_constraints (Now (false, Future.join fc)) e)
+ else add_constraints (Now (Future.join fc)) e)
{e with future_cst = []} e.future_cst
let is_joined_environment e = List.is_empty e.future_cst
@@ -458,34 +453,26 @@ let labels_of_mib mib =
Array.iter visit_mip mib.mind_packets;
get ()
-let globalize_constant_universes env cb =
+let globalize_constant_universes cb =
match cb.const_universes with
| Monomorphic cstrs ->
- Now (false, cstrs) ::
- (match cb.const_body with
- | (Undef _ | Def _ | Primitive _) -> []
- | OpaqueDef lc ->
- match Opaqueproof.get_constraints (Environ.opaque_tables env) lc with
- | None -> []
- | Some fc ->
- match Future.peek_val fc with
- | None -> [Later fc]
- | Some c -> [Now (false, c)])
+ (* Constraints hidden in the opaque body are added by [add_constant_aux] *)
+ [cstrs]
| Polymorphic _ ->
- [Now (true, Univ.ContextSet.empty)]
+ []
let globalize_mind_universes mb =
match mb.mind_universes with
| Monomorphic ctx ->
- [Now (false, ctx)]
- | Polymorphic _ -> [Now (true, Univ.ContextSet.empty)]
+ [ctx]
+ | Polymorphic _ -> []
-let constraints_of_sfb env sfb =
+let constraints_of_sfb sfb =
match sfb with
- | SFBconst cb -> globalize_constant_universes env cb
+ | SFBconst cb -> globalize_constant_universes cb
| SFBmind mib -> globalize_mind_universes mib
- | SFBmodtype mtb -> [Now (false, mtb.mod_constraints)]
- | SFBmodule mb -> [Now (false, mb.mod_constraints)]
+ | SFBmodtype mtb -> [mtb.mod_constraints]
+ | SFBmodule mb -> [mb.mod_constraints]
let add_retroknowledge pttc senv =
{ senv with
@@ -520,8 +507,9 @@ let add_field ?(is_include=false) ((l,sfb) as field) gn senv =
separately. *)
senv
else
- let cst = constraints_of_sfb senv.env sfb in
- add_constraints_list cst senv
+ (* Delayed constraints from opaque body are added by [add_constant_aux] *)
+ let cst = constraints_of_sfb sfb in
+ List.fold_left (fun senv cst -> push_context_set false cst senv) senv cst
in
let env' = match sfb, gn with
| SFBconst cb, C con -> Environ.add_constant con cb senv.env
@@ -548,11 +536,21 @@ type 'a effect_entry =
type global_declaration =
| ConstantEntry : 'a effect_entry * 'a Entries.constant_entry -> global_declaration
-type exported_private_constant =
- Constant.t * Entries.side_effect_role
+type exported_private_constant = Constant.t
let add_constant_aux ~in_section senv (kn, cb) =
let l = Constant.label kn in
+ let delayed_cst = match cb.const_body with
+ | OpaqueDef o when not (Declareops.constant_is_polymorphic cb) ->
+ let fc = Opaqueproof.get_direct_constraints o in
+ begin match Future.peek_val fc with
+ | None -> [Later fc]
+ | Some c -> [Now c]
+ end
+ | Undef _ | Def _ | Primitive _ | OpaqueDef _ -> []
+ in
+ (* This is the only place where we hashcons the contents of a constant body *)
+ let cb = if in_section then cb else Declareops.hcons_const_body cb in
let cb, otab = match cb.const_body with
| OpaqueDef lc when not in_section ->
(* In coqc, opaque constants outside sections will be stored
@@ -565,6 +563,7 @@ let add_constant_aux ~in_section senv (kn, cb) =
in
let senv = { senv with env = Environ.set_opaque_tables senv.env otab } in
let senv' = add_field (l,SFBconst cb) (C kn) senv in
+ let senv' = add_constraints_list delayed_cst senv' in
let senv'' = match cb.const_body with
| Undef (Some lev) ->
update_resolver
@@ -596,7 +595,7 @@ let inline_side_effects env body side_eff =
let fold (subst, var, ctx, args) (c, cb) =
let (b, opaque) = match cb.const_body with
| Def b -> (Mod_subst.force_constr b, false)
- | OpaqueDef (b, _) -> (b, true)
+ | OpaqueDef b -> (b, true)
| _ -> assert false
in
match cb.const_universes with
@@ -645,18 +644,10 @@ let inline_side_effects env body side_eff =
let body = List.fold_right fold_arg args body in
(body, ctx, sigs)
-let inline_private_constants_in_definition_entry env ce =
- let open Entries in
- { ce with
- const_entry_body = Future.chain
- ce.const_entry_body (fun ((body, ctx), side_eff) ->
- let body, ctx',_ = inline_side_effects env body side_eff in
- let ctx' = Univ.ContextSet.union ctx ctx' in
- (body, ctx'), ());
- }
-
-let inline_private_constants_in_constr env body side_eff =
- pi1 (inline_side_effects env body side_eff)
+let inline_private_constants env ((body, ctx), side_eff) =
+ let body, ctx',_ = inline_side_effects env body side_eff in
+ let ctx' = Univ.ContextSet.union ctx ctx' in
+ (body, ctx')
let is_suffix l suf = match l with
| [] -> false
@@ -692,30 +683,32 @@ let constant_entry_of_side_effect eff =
| Polymorphic auctx ->
Polymorphic_entry (Univ.AUContext.names auctx, Univ.AUContext.repr auctx)
in
- let pt =
+ let p =
match cb.const_body with
- | OpaqueDef (b, c) -> b, c
- | Def b -> Mod_subst.force_constr b, Univ.ContextSet.empty
+ | OpaqueDef b -> b
+ | Def b -> Mod_subst.force_constr b
| _ -> assert false in
+ if Declareops.is_opaque cb then
+ OpaqueEntry {
+ opaque_entry_body = Future.from_val ((p, Univ.ContextSet.empty), ());
+ opaque_entry_secctx = None;
+ opaque_entry_feedback = None;
+ opaque_entry_type = cb.const_type;
+ opaque_entry_universes = univs;
+ }
+ else
DefinitionEntry {
- const_entry_body = Future.from_val (pt, ());
+ const_entry_body = (p, Univ.ContextSet.empty);
const_entry_secctx = None;
const_entry_feedback = None;
const_entry_type = Some cb.const_type;
const_entry_universes = univs;
- const_entry_opaque = Declareops.is_opaque cb;
const_entry_inline_code = cb.const_inline_code }
let export_eff eff =
- (eff.seff_constant, eff.seff_body, eff.seff_role)
+ (eff.seff_constant, eff.seff_body)
-let export_side_effects mb env c =
- let open Entries in
- let body = c.const_entry_body in
- let _, eff = Future.force body in
- let ce = { c with
- Entries.const_entry_body = Future.chain body
- (fun (b_ctx, _) -> b_ctx, ()) } in
+let export_side_effects mb env (b_ctx, eff) =
let not_exists e =
try ignore(Environ.lookup_constant e.seff_constant env); false
with Not_found -> true in
@@ -730,23 +723,27 @@ let export_side_effects mb env c =
match cb.const_universes with
| Polymorphic _ -> env
| Monomorphic ctx ->
- let ctx = match eff.seff_body.const_body with
- | Def _ -> ctx
- | OpaqueDef (_, ctx') -> Univ.ContextSet.union ctx' ctx
- | Undef _ | Primitive _ -> assert false
- in
Environ.push_context_set ~strict:true ctx env
in
let rec translate_seff sl seff acc env =
match seff with
- | [] -> List.rev acc, ce
+ | [] -> List.rev acc, b_ctx
| eff :: rest ->
if Int.equal sl 0 then
let env, cb =
let kn = eff.seff_constant in
let ce = constant_entry_of_side_effect eff in
let cb = Term_typing.translate_constant Term_typing.Pure env kn ce in
- let cb = map_constant Future.force cb in
+ let map cu =
+ let (c, u) = Future.force cu in
+ let () = match u with
+ | Opaqueproof.PrivateMonomorphic ctx
+ | Opaqueproof.PrivatePolymorphic (_, ctx) ->
+ assert (Univ.ContextSet.is_empty ctx)
+ in
+ c
+ in
+ let cb = map_constant map cb in
let eff = { eff with seff_body = cb } in
(push_seff env eff, export_eff eff)
in
@@ -760,20 +757,26 @@ let export_side_effects mb env c =
let export_private_constants ~in_section ce senv =
let exported, ce = export_side_effects senv.revstruct senv.env ce in
- let map (kn, cb, _) = (kn, map_constant (fun p -> Opaqueproof.create (Future.from_val p)) cb) in
+ let map univs p =
+ let local = match univs with
+ | Monomorphic _ -> Opaqueproof.PrivateMonomorphic Univ.ContextSet.empty
+ | Polymorphic auctx -> Opaqueproof.PrivatePolymorphic (Univ.AUContext.size auctx, Univ.ContextSet.empty)
+ in
+ Opaqueproof.create (Future.from_val (p, local))
+ in
+ let map (kn, cb) = (kn, map_constant (fun c -> map cb.const_universes c) cb) in
let bodies = List.map map exported in
- let exported = List.map (fun (kn, _, r) -> (kn, r)) exported in
+ let exported = List.map (fun (kn, _) -> kn) exported in
let senv = List.fold_left (add_constant_aux ~in_section) senv bodies in
(ce, exported), senv
let add_recipe ~in_section l r senv =
let kn = Constant.make2 senv.modpath l in
- let cb = Term_typing.translate_recipe ~hcons:(not in_section) senv.env kn r in
- let cb = if in_section then cb else Declareops.hcons_const_body cb in
+ let cb = Term_typing.translate_recipe senv.env kn r in
let senv = add_constant_aux ~in_section senv (kn, cb) in
kn, senv
-let add_constant ?role ~in_section l decl senv =
+let add_constant (type a) ~(side_effect : a effect_entry) ~in_section l decl senv : (Constant.t * a) * safe_environment =
let kn = Constant.make2 senv.modpath l in
let cb =
match decl with
@@ -788,7 +791,7 @@ let add_constant ?role ~in_section l decl senv =
Term_typing.translate_constant Term_typing.Pure senv.env kn ce
in
let senv =
- let cb = map_constant Opaqueproof.create cb in
+ let cb = map_constant (fun c -> Opaqueproof.create c) cb in
add_constant_aux ~in_section senv (kn, cb) in
let senv =
match decl with
@@ -797,16 +800,30 @@ let add_constant ?role ~in_section l decl senv =
add_retroknowledge (Retroknowledge.Register_type(t,kn)) senv
| _ -> senv
in
- let eff = match role with
- | None -> empty_private_constants
- | Some role ->
- let cb = map_constant Future.force cb in
+ let eff : a = match side_effect with
+ | PureEntry -> ()
+ | EffectEntry ->
+ let body, univs = match cb.const_body with
+ | (Primitive _ | Undef _) -> assert false
+ | Def c -> (Def c, cb.const_universes)
+ | OpaqueDef o ->
+ let (b, delayed) = Future.force o in
+ match cb.const_universes, delayed with
+ | Monomorphic ctx', Opaqueproof.PrivateMonomorphic ctx ->
+ OpaqueDef b, Monomorphic (Univ.ContextSet.union ctx ctx')
+ | Polymorphic auctx, Opaqueproof.PrivatePolymorphic (_, ctx) ->
+ (* Upper layers enforce that there are no internal constraints *)
+ let () = assert (Univ.ContextSet.is_empty ctx) in
+ OpaqueDef b, Polymorphic auctx
+ | (Monomorphic _ | Polymorphic _), (Opaqueproof.PrivateMonomorphic _ | Opaqueproof.PrivatePolymorphic _) ->
+ assert false
+ in
+ let cb = { cb with const_body = body; const_universes = univs } in
let from_env = CEphemeron.create senv.revstruct in
let eff = {
from_env = from_env;
seff_constant = kn;
seff_body = cb;
- seff_role = role;
} in
SideEffects.add eff empty_private_constants
in
@@ -843,13 +860,13 @@ let add_modtype l params_mte inl senv =
(** full_add_module adds module with universes and constraints *)
let full_add_module mb senv =
- let senv = add_constraints (Now (false, mb.mod_constraints)) senv in
+ let senv = add_constraints (Now mb.mod_constraints) senv in
let dp = ModPath.dp mb.mod_mp in
let linkinfo = Nativecode.link_info_of_dirpath dp in
{ senv with env = Modops.add_linked_module mb linkinfo senv.env }
let full_add_module_type mp mt senv =
- let senv = add_constraints (Now (false, mt.mod_constraints)) senv in
+ let senv = add_constraints (Now mt.mod_constraints) senv in
{ senv with env = Modops.add_module_type mp mt senv.env }
(** Insertion of modules *)
@@ -1029,7 +1046,7 @@ let add_include me is_module inl senv =
let sign,(),resolver,cst =
translate_mse_incl is_module senv.env mp_sup inl me
in
- let senv = add_constraints (Now (false, cst)) senv in
+ let senv = add_constraints (Now cst) senv in
(* Include Self support *)
let rec compute_sign sign mb resolver senv =
match sign with
@@ -1037,7 +1054,7 @@ let add_include me is_module inl senv =
let cst_sub = Subtyping.check_subtypes senv.env mb mtb in
let senv =
add_constraints
- (Now (false, Univ.ContextSet.add_constraints cst_sub Univ.ContextSet.empty))
+ (Now (Univ.ContextSet.add_constraints cst_sub Univ.ContextSet.empty))
senv in
let mpsup_delta =
Modops.inline_delta_resolver senv.env inl mp_sup mbid mtb mb.mod_delta
@@ -1267,7 +1284,7 @@ let register_inductive ind prim senv =
let add_constraints c =
add_constraints
- (Now (false, Univ.ContextSet.add_constraints c Univ.ContextSet.empty))
+ (Now (Univ.ContextSet.add_constraints c Univ.ContextSet.empty))
(* NB: The next old comment probably refers to [propagate_loads] above.
diff --git a/kernel/safe_typing.mli b/kernel/safe_typing.mli
index 36ca3d8c47..885becc40a 100644
--- a/kernel/safe_typing.mli
+++ b/kernel/safe_typing.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -49,10 +49,8 @@ val concat_private : private_constants -> private_constants -> private_constants
[e1] must be more recent than those of [e2]. *)
val mk_pure_proof : Constr.constr -> private_constants Entries.proof_output
-val inline_private_constants_in_constr :
- Environ.env -> Constr.constr -> private_constants -> Constr.constr
-val inline_private_constants_in_definition_entry :
- Environ.env -> private_constants Entries.definition_entry -> unit Entries.definition_entry
+val inline_private_constants :
+ Environ.env -> private_constants Entries.proof_output -> Constr.constr Univ.in_universe_context_set
val push_private_constants : Environ.env -> private_constants -> Environ.env
(** Push the constants in the environment if not already there. *)
@@ -89,18 +87,16 @@ type 'a effect_entry =
type global_declaration =
| ConstantEntry : 'a effect_entry * 'a Entries.constant_entry -> global_declaration
-type exported_private_constant =
- Constant.t * Entries.side_effect_role
+type exported_private_constant = Constant.t
val export_private_constants : in_section:bool ->
- private_constants Entries.definition_entry ->
- (unit Entries.definition_entry * exported_private_constant list) safe_transformer
+ private_constants Entries.proof_output ->
+ (Constr.constr Univ.in_universe_context_set * exported_private_constant list) safe_transformer
-(** returns the main constant plus a list of auxiliary constants (empty
- unless one requires the side effects to be exported) *)
+(** returns the main constant plus a certificate of its validity *)
val add_constant :
- ?role:Entries.side_effect_role -> in_section:bool -> Label.t -> global_declaration ->
- (Constant.t * private_constants) safe_transformer
+ side_effect:'a effect_entry -> in_section:bool -> Label.t -> global_declaration ->
+ (Constant.t * 'a) safe_transformer
val add_recipe :
in_section:bool -> Label.t -> Cooking.recipe -> Constant.t safe_transformer
diff --git a/kernel/sorts.ml b/kernel/sorts.ml
index 09c98ca1bc..b8bebb659b 100644
--- a/kernel/sorts.ml
+++ b/kernel/sorts.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -91,6 +91,8 @@ let family_compare a b = match a,b with
let family_equal = (==)
+let family_leq a b = family_compare a b <= 0
+
open Hashset.Combine
let hash = function
@@ -101,11 +103,6 @@ let hash = function
let h = Univ.Universe.hash u in
combinesmall 2 h
-module List = struct
- let mem = List.memq
- let intersect l l' = CList.intersect family_equal l l'
-end
-
module Hsorts =
Hashcons.Make(
struct
diff --git a/kernel/sorts.mli b/kernel/sorts.mli
index c49728b146..fa129d10fb 100644
--- a/kernel/sorts.mli
+++ b/kernel/sorts.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -37,11 +37,7 @@ val hcons : t -> t
val family_compare : family -> family -> int
val family_equal : family -> family -> bool
-
-module List : sig
- val mem : family -> family list -> bool
- val intersect : family list -> family list -> family list
-end
+val family_leq : family -> family -> bool
val univ_of_sort : t -> Univ.Universe.t
val sort_of_univ : Univ.Universe.t -> t
diff --git a/kernel/subtyping.ml b/kernel/subtyping.ml
index 24845ce459..d47dc0c6e1 100644
--- a/kernel/subtyping.ml
+++ b/kernel/subtyping.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/subtyping.mli b/kernel/subtyping.mli
index 4e755e42ff..9aa48bf6b4 100644
--- a/kernel/subtyping.mli
+++ b/kernel/subtyping.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/term.ml b/kernel/term.ml
index f09c45715f..38c0d043cf 100644
--- a/kernel/term.ml
+++ b/kernel/term.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/term.mli b/kernel/term.mli
index 4265324693..d2de4177ce 100644
--- a/kernel/term.mli
+++ b/kernel/term.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/term_typing.ml b/kernel/term_typing.ml
index 74c6189a65..eca22869d2 100644
--- a/kernel/term_typing.ml
+++ b/kernel/term_typing.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -74,12 +74,11 @@ let infer_declaration (type a) ~(trust : a trust) env (dcl : a constant_entry) =
let j = Typeops.infer env t in
let usubst, univs = Declareops.abstract_universes uctx in
let r = Typeops.assumption_of_judgment env j in
- let t = Constr.hcons (Vars.subst_univs_level_constr usubst j.uj_val) in
+ let t = Vars.subst_univs_level_constr usubst j.uj_val in
{
Cooking.cook_body = Undef nl;
cook_type = t;
cook_universes = univs;
- cook_private_univs = None;
cook_relevance = r;
cook_inline = false;
cook_context = ctx;
@@ -95,7 +94,7 @@ let infer_declaration (type a) ~(trust : a trust) env (dcl : a constant_entry) =
| Some typ ->
let typ = Typeops.infer_type env typ in
Typeops.check_primitive_type env op_t typ.utj_val;
- Constr.hcons typ.utj_val
+ typ.utj_val
| None ->
match op_t with
| CPrimitives.OT_op op -> Typeops.type_of_prim env op
@@ -108,31 +107,21 @@ let infer_declaration (type a) ~(trust : a trust) env (dcl : a constant_entry) =
{ Cooking.cook_body = cd;
cook_type = ty;
cook_universes = Monomorphic uctxt;
- cook_private_univs = None;
cook_inline = false;
cook_context = None;
cook_relevance = Sorts.Relevant;
}
(** Definition [c] is opaque (Qed), non polymorphic and with a specified type,
- so we delay the typing and hash consing of its body.
- Remark: when the universe quantification is given explicitly, we could
- delay even in the polymorphic case. *)
+ so we delay the typing and hash consing of its body. *)
-(** Definition is opaque (Qed) and non polymorphic with known type, so we delay
-the typing and hash consing of its body.
-
-TODO: if the universe quantification is given explicitly, we could delay even in
-the polymorphic case
- *)
- | DefinitionEntry ({ const_entry_type = Some typ;
- const_entry_opaque = true;
- const_entry_universes = Monomorphic_entry univs; _ } as c) ->
+ | OpaqueEntry ({ opaque_entry_type = typ;
+ opaque_entry_universes = Monomorphic_entry univs; _ } as c) ->
let env = push_context_set ~strict:true univs env in
- let { const_entry_body = body; const_entry_feedback = feedback_id; _ } = c in
+ let { opaque_entry_body = body; opaque_entry_feedback = feedback_id; _ } = c in
let tyj = Typeops.infer_type env typ in
let proofterm =
- Future.chain body (fun ((body,uctx),side_eff) ->
+ Future.chain body begin fun ((body,uctx),side_eff) ->
(* don't redeclare universes which are declared for the type *)
let uctx = Univ.ContextSet.diff uctx univs in
let j, uctx = match trust with
@@ -151,50 +140,81 @@ the polymorphic case
let _ = Typeops.judge_of_cast env j DEFAULTcast tyj in
j, uctx
in
- let c = Constr.hcons j.uj_val in
+ let c = j.uj_val in
feedback_completion_typecheck feedback_id;
- c, uctx) in
+ c, Opaqueproof.PrivateMonomorphic uctx
+ end in
let def = OpaqueDef proofterm in
{
Cooking.cook_body = def;
cook_type = tyj.utj_val;
cook_universes = Monomorphic univs;
- cook_private_univs = None;
cook_relevance = Sorts.relevance_of_sort tyj.utj_type;
- cook_inline = c.const_entry_inline_code;
- cook_context = c.const_entry_secctx;
+ cook_inline = false;
+ cook_context = c.opaque_entry_secctx;
+ }
+
+ (** Similar case for polymorphic entries. *)
+
+ | OpaqueEntry ({ opaque_entry_type = typ;
+ opaque_entry_universes = Polymorphic_entry (nas, uctx); _ } as c) ->
+ let { opaque_entry_body = body; opaque_entry_feedback = feedback_id; _ } = c in
+ let env = push_context ~strict:false uctx env in
+ let tj = Typeops.infer_type env typ in
+ let sbst, auctx = Univ.abstract_universes nas uctx in
+ let usubst = Univ.make_instance_subst sbst in
+ let proofterm = Future.chain body begin fun ((body, ctx), side_eff) ->
+ let body, ctx = match trust with
+ | Pure -> body, ctx
+ | SideEffects handle ->
+ let body, ctx', _ = handle env body side_eff in
+ body, Univ.ContextSet.union ctx ctx'
+ in
+ (** [ctx] must contain local universes, such that it has no impact
+ on the rest of the graph (up to transitivity). *)
+ let env = push_subgraph ctx env in
+ let private_univs = on_snd (Univ.subst_univs_level_constraints usubst) ctx in
+ let j = Typeops.infer env body in
+ let _ = Typeops.judge_of_cast env j DEFAULTcast tj in
+ let def = Vars.subst_univs_level_constr usubst j.uj_val in
+ let () = feedback_completion_typecheck feedback_id in
+ def, Opaqueproof.PrivatePolymorphic (Univ.AUContext.size auctx, private_univs)
+ end in
+ let def = OpaqueDef proofterm in
+ let typ = Vars.subst_univs_level_constr usubst tj.utj_val in
+ {
+ Cooking.cook_body = def;
+ cook_type = typ;
+ cook_universes = Polymorphic auctx;
+ cook_relevance = Sorts.relevance_of_sort tj.utj_type;
+ cook_inline = false;
+ cook_context = c.opaque_entry_secctx;
}
(** Other definitions have to be processed immediately. *)
| DefinitionEntry c ->
- let { const_entry_type = typ; const_entry_opaque = opaque ; _ } = c in
- let { const_entry_body = body; const_entry_feedback = feedback_id; _ } = c in
- let (body, ctx), side_eff = Future.join body in
- let body, ctx = match trust with
- | Pure -> body, ctx
- | SideEffects handle ->
- let body, ctx', _ = handle env body side_eff in
- body, Univ.ContextSet.union ctx ctx'
+ let { const_entry_type = typ; _ } = c in
+ let { const_entry_body = (body, ctx); const_entry_feedback = feedback_id; _ } = c in
+ let () = match trust with
+ | Pure -> ()
+ | SideEffects _ -> assert false
in
- let env, usubst, univs, private_univs = match c.const_entry_universes with
+ let env, usubst, univs = match c.const_entry_universes with
| Monomorphic_entry univs ->
let ctx = Univ.ContextSet.union univs ctx in
let env = push_context_set ~strict:true ctx env in
- env, Univ.empty_level_subst, Monomorphic ctx, None
+ env, Univ.empty_level_subst, Monomorphic ctx
| Polymorphic_entry (nas, uctx) ->
(** [ctx] must contain local universes, such that it has no impact
on the rest of the graph (up to transitivity). *)
let env = push_context ~strict:false uctx env in
let sbst, auctx = Univ.abstract_universes nas uctx in
let sbst = Univ.make_instance_subst sbst in
- let env, local =
- if opaque then
- push_subgraph ctx env, Some (on_snd (Univ.subst_univs_level_constraints sbst) ctx)
- else
- if Univ.ContextSet.is_empty ctx then env, None
- else CErrors.anomaly Pp.(str "Local universes in non-opaque polymorphic definition.")
+ let () =
+ if not (Univ.ContextSet.is_empty ctx) then
+ CErrors.anomaly Pp.(str "Local universes in non-opaque polymorphic definition.")
in
- env, sbst, Polymorphic auctx, local
+ env, sbst, Polymorphic auctx
in
let j = Typeops.infer env body in
let typ = match typ with
@@ -205,17 +225,13 @@ the polymorphic case
let _ = Typeops.judge_of_cast env j DEFAULTcast tj in
Vars.subst_univs_level_constr usubst tj.utj_val
in
- let def = Constr.hcons (Vars.subst_univs_level_constr usubst j.uj_val) in
- let def =
- if opaque then OpaqueDef (Future.from_val (def, Univ.ContextSet.empty))
- else Def (Mod_subst.from_val def)
- in
+ let def = Vars.subst_univs_level_constr usubst j.uj_val in
+ let def = Def (Mod_subst.from_val def) in
feedback_completion_typecheck feedback_id;
{
Cooking.cook_body = def;
cook_type = typ;
cook_universes = univs;
- cook_private_univs = private_univs;
cook_relevance = Retypeops.relevance_of_term env j.uj_val;
cook_inline = c.const_entry_inline_code;
cook_context = c.const_entry_secctx;
@@ -312,7 +328,6 @@ let build_constant_declaration env result =
const_type = typ;
const_body_code = tps;
const_universes = univs;
- const_private_poly_univs = result.cook_private_univs;
const_relevance = result.cook_relevance;
const_inline_code = result.cook_inline;
const_typing_flags = Environ.typing_flags env }
@@ -328,9 +343,9 @@ let translate_local_assum env t =
let t = Typeops.assumption_of_judgment env j in
j.uj_val, t
-let translate_recipe ~hcons env _kn r =
+let translate_recipe env _kn r =
let open Cooking in
- let result = Cooking.cook_constant ~hcons r in
+ let result = Cooking.cook_constant r in
let univs = result.cook_universes in
let res = Cbytegen.compile_constant_body ~fail_on_error:false env univs result.cook_body in
let tps = Option.map Cemitcodes.from_val res in
@@ -339,21 +354,19 @@ let translate_recipe ~hcons env _kn r =
const_type = result.cook_type;
const_body_code = tps;
const_universes = univs;
- const_private_poly_univs = result.cook_private_univs;
const_relevance = result.cook_relevance;
const_inline_code = result.cook_inline;
const_typing_flags = Environ.typing_flags env }
let translate_local_def env _id centry =
let open Cooking in
- let body = Future.from_val ((centry.secdef_body, Univ.ContextSet.empty), ()) in
+ let body = (centry.secdef_body, Univ.ContextSet.empty) in
let centry = {
const_entry_body = body;
const_entry_secctx = centry.secdef_secctx;
const_entry_feedback = centry.secdef_feedback;
const_entry_type = centry.secdef_type;
const_entry_universes = Monomorphic_entry Univ.ContextSet.empty;
- const_entry_opaque = false;
const_entry_inline_code = false;
} in
let decl = infer_declaration ~trust:Pure env (DefinitionEntry centry) in
@@ -378,7 +391,10 @@ let translate_local_def env _id centry =
let (p, cst) = Future.force o in
(** Let definitions are ensured to have no extra constraints coming from
the body by virtue of the typing of [Entries.section_def_entry]. *)
- let () = assert (Univ.ContextSet.is_empty cst) in
+ let () = match cst with
+ | Opaqueproof.PrivateMonomorphic ctx -> assert (Univ.ContextSet.is_empty ctx)
+ | Opaqueproof.PrivatePolymorphic (_, ctx) -> assert (Univ.ContextSet.is_empty ctx)
+ in
p
| Undef _ | Primitive _ -> assert false
in
diff --git a/kernel/term_typing.mli b/kernel/term_typing.mli
index 592a97e132..225abd60f8 100644
--- a/kernel/term_typing.mli
+++ b/kernel/term_typing.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -35,7 +35,7 @@ val translate_constant :
'a trust -> env -> Constant.t -> 'a constant_entry ->
Opaqueproof.proofterm constant_body
-val translate_recipe : hcons:bool -> env -> Constant.t -> Cooking.recipe -> Opaqueproof.opaque constant_body
+val translate_recipe : env -> Constant.t -> Cooking.recipe -> Opaqueproof.opaque constant_body
(** Internal functions, mentioned here for debug purpose only *)
diff --git a/kernel/transparentState.ml b/kernel/transparentState.ml
index 9661dace6a..372e021c39 100644
--- a/kernel/transparentState.ml
+++ b/kernel/transparentState.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/transparentState.mli b/kernel/transparentState.mli
index f2999c6869..db6d147280 100644
--- a/kernel/transparentState.mli
+++ b/kernel/transparentState.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/type_errors.ml b/kernel/type_errors.ml
index c45fe1cf00..f221ac7a4f 100644
--- a/kernel/type_errors.ml
+++ b/kernel/type_errors.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -49,7 +49,7 @@ type ('constr, 'types) ptype_error =
| BadAssumption of ('constr, 'types) punsafe_judgment
| ReferenceVariables of Id.t * 'constr
| ElimArity of pinductive * 'constr * ('constr, 'types) punsafe_judgment
- * (Sorts.family list * Sorts.family * Sorts.family * arity_error) option
+ * (Sorts.family * 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
diff --git a/kernel/type_errors.mli b/kernel/type_errors.mli
index 88165a4f07..ae6fd31762 100644
--- a/kernel/type_errors.mli
+++ b/kernel/type_errors.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -50,7 +50,7 @@ type ('constr, 'types) ptype_error =
| BadAssumption of ('constr, 'types) punsafe_judgment
| ReferenceVariables of Id.t * 'constr
| ElimArity of pinductive * 'constr * ('constr, 'types) punsafe_judgment
- * (Sorts.family list * Sorts.family * Sorts.family * arity_error) option
+ * (Sorts.family * 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
@@ -104,7 +104,7 @@ val error_reference_variables : env -> Id.t -> constr -> 'a
val error_elim_arity :
env -> pinductive -> constr -> unsafe_judgment ->
- (Sorts.family list * Sorts.family * Sorts.family * arity_error) option -> 'a
+ (Sorts.family * Sorts.family * Sorts.family * arity_error) option -> 'a
val error_case_not_inductive : env -> unsafe_judgment -> 'a
diff --git a/kernel/typeops.ml b/kernel/typeops.ml
index af710e7822..b87384d228 100644
--- a/kernel/typeops.ml
+++ b/kernel/typeops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/typeops.mli b/kernel/typeops.mli
index c8f3e506e6..c71a0e0ca4 100644
--- a/kernel/typeops.mli
+++ b/kernel/typeops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/uGraph.ml b/kernel/uGraph.ml
index 0d5b55ca1b..6fde6e9c5f 100644
--- a/kernel/uGraph.ml
+++ b/kernel/uGraph.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/uGraph.mli b/kernel/uGraph.mli
index 17d6c6e6d3..e1b5868d55 100644
--- a/kernel/uGraph.mli
+++ b/kernel/uGraph.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/uint63.mli b/kernel/uint63.mli
index f25f24512d..93632da110 100644
--- a/kernel/uint63.mli
+++ b/kernel/uint63.mli
@@ -13,7 +13,7 @@ val of_uint : int -> t
val hash : t -> int
- (* convertion to a string *)
+ (* conversion to a string *)
val to_string : t -> string
val of_string : string -> t
diff --git a/kernel/uint63_amd64.ml b/kernel/uint63_amd64_63.ml
index 2d4d685775..20b2f58496 100644
--- a/kernel/uint63_amd64.ml
+++ b/kernel/uint63_amd64_63.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/uint63_x86.ml b/kernel/uint63_i386_31.ml
index fa45c90241..c3279779e1 100644
--- a/kernel/uint63_x86.ml
+++ b/kernel/uint63_i386_31.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/univ.ml b/kernel/univ.ml
index b1bbc25fe6..14d6bfabf1 100644
--- a/kernel/univ.ml
+++ b/kernel/univ.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -726,7 +726,7 @@ let univ_level_rem u v min =
| Some u' -> if Level.equal u u' then min else v
| None -> List.filter (fun (l, n) -> not (Int.equal n 0 && Level.equal u l)) v
-(* Is u mentionned in v (or equals to v) ? *)
+(* Is u mentioned in v (or equals to v) ? *)
(**********************************************************************)
diff --git a/kernel/univ.mli b/kernel/univ.mli
index db178c4bb0..ccb5c80cbf 100644
--- a/kernel/univ.mli
+++ b/kernel/univ.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -163,7 +163,7 @@ val super : Universe.t -> Universe.t
val universe_level : Universe.t -> Level.t option
-(** [univ_level_mem l u] Is l is mentionned in u ? *)
+(** [univ_level_mem l u] Is l is mentioned in u ? *)
val univ_level_mem : Level.t -> Universe.t -> bool
diff --git a/kernel/vars.ml b/kernel/vars.ml
index bd56d60053..dd187387d4 100644
--- a/kernel/vars.ml
+++ b/kernel/vars.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/vars.mli b/kernel/vars.mli
index f2c32b3625..6a1815619f 100644
--- a/kernel/vars.mli
+++ b/kernel/vars.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/vconv.mli b/kernel/vconv.mli
index 1a31848989..0a85498c40 100644
--- a/kernel/vconv.mli
+++ b/kernel/vconv.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/vm.ml b/kernel/vm.ml
index 83312a8530..319a26d824 100644
--- a/kernel/vm.ml
+++ b/kernel/vm.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/vm.mli b/kernel/vm.mli
index 50ebc90626..5637f7e1cd 100644
--- a/kernel/vm.mli
+++ b/kernel/vm.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/vmvalues.ml b/kernel/vmvalues.ml
index 777a207013..c8f5020d71 100644
--- a/kernel/vmvalues.ml
+++ b/kernel/vmvalues.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -11,10 +11,10 @@ open Names
open Univ
open Constr
-(*******************************************)
-(* Initalization of the abstract machine ***)
-(* Necessary for [relaccu_tbl] *)
-(*******************************************)
+(********************************************)
+(* Initialization of the abstract machine ***)
+(* Necessary for [relaccu_tbl] *)
+(********************************************)
external init_vm : unit -> unit = "init_coq_vm"
diff --git a/kernel/vmvalues.mli b/kernel/vmvalues.mli
index 6d984d5f49..d289e7db9a 100644
--- a/kernel/vmvalues.mli
+++ b/kernel/vmvalues.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/kernel/write_uint63.ml b/kernel/write_uint63.ml
index beb59ce205..57a170c8f5 100644
--- a/kernel/write_uint63.ml
+++ b/kernel/write_uint63.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -31,8 +31,8 @@ let ml_file_copy input output =
let write_uint63 () =
ml_file_copy
- (if max_int = 1073741823 (* 32-bits *) then "uint63_x86.ml"
- else (* 64 bits *) "uint63_amd64.ml")
+ (if max_int = 1073741823 (* 32-bits *) then "uint63_i386_31.ml"
+ else (* 64 bits *) "uint63_amd64_63.ml")
"uint63.ml"
let () = write_uint63 ()
diff --git a/lib/acyclicGraph.ml b/lib/acyclicGraph.ml
index e1dcfcc6ce..669605dec7 100644
--- a/lib/acyclicGraph.ml
+++ b/lib/acyclicGraph.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/acyclicGraph.mli b/lib/acyclicGraph.mli
index b53a4c018f..fc648e63e9 100644
--- a/lib/acyclicGraph.mli
+++ b/lib/acyclicGraph.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/aux_file.ml b/lib/aux_file.ml
index 0f9476605b..1aeca57fc1 100644
--- a/lib/aux_file.ml
+++ b/lib/aux_file.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/aux_file.mli b/lib/aux_file.mli
index efdd75fd39..60c8fb4449 100644
--- a/lib/aux_file.mli
+++ b/lib/aux_file.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/cAst.ml b/lib/cAst.ml
index e1da072db2..b077567faf 100644
--- a/lib/cAst.ml
+++ b/lib/cAst.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/cAst.mli b/lib/cAst.mli
index 8443b1af34..0a0b07f51b 100644
--- a/lib/cAst.mli
+++ b/lib/cAst.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/cErrors.ml b/lib/cErrors.ml
index 79f0a806a7..a42504701f 100644
--- a/lib/cErrors.ml
+++ b/lib/cErrors.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -31,10 +31,6 @@ let make_anomaly ?label pp =
let anomaly ?loc ?label pp =
Loc.raise ?loc (Anomaly (label, pp))
-let is_anomaly = function
-| Anomaly _ -> true
-| _ -> false
-
exception UserError of string option * Pp.t (* User errors *)
let todo s = prerr_string ("TODO: "^s^"\n")
@@ -54,6 +50,14 @@ exception Unhandled
let register_handler h = handle_stack := h::!handle_stack
+let is_handled e =
+ let is_handled_by h = (try let _ = h e in true with | Unhandled -> false) in
+ List.exists is_handled_by !handle_stack
+
+let is_anomaly = function
+| Anomaly _ -> true
+| exn -> not (is_handled exn)
+
(** [print_gen] is a general exception printer which tries successively
all the handlers of a list, and finally a [bottom] handler if all
others have failed *)
@@ -77,9 +81,12 @@ let where = function
if !Flags.debug then str "in " ++ str s ++ str ":" ++ spc () else mt ()
let raw_anomaly e = match e with
- | Anomaly (s, pps) -> where s ++ pps
- | Assert_failure _ | Match_failure _ -> str (Printexc.to_string e) ++ str "."
- | _ -> str "Uncaught exception " ++ str (Printexc.to_string e) ++ str "."
+ | Anomaly (s, pps) ->
+ where s ++ pps
+ | Assert_failure _ | Match_failure _ ->
+ str (Printexc.to_string e) ++ str "."
+ | _ ->
+ str "Uncaught exception " ++ str (Printexc.to_string e) ++ str "."
let print_backtrace e = match Backtrace.get_backtrace e with
| None -> mt ()
@@ -128,12 +135,3 @@ let noncritical = function
| Invalid_argument "equal: functional value" -> false
| _ -> true
[@@@ocaml.warning "+52"]
-
-(** Check whether an exception is handled *)
-
-exception Bottom
-
-let handled e =
- let bottom _ = raise Bottom in
- try let _ = print_gen bottom !handle_stack e in true
- with Bottom -> false
diff --git a/lib/cErrors.mli b/lib/cErrors.mli
index 4e2fe7621d..51ec5c907a 100644
--- a/lib/cErrors.mli
+++ b/lib/cErrors.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -89,7 +89,3 @@ val iprint_no_report : Exninfo.iexn -> Pp.t
Typical example: [Sys.Break], [Assert_failure], [Anomaly] ...
*)
val noncritical : exn -> bool
-
-(** Check whether an exception is handled by some toplevel printer. The
- [Anomaly] exception is never handled. *)
-val handled : exn -> bool
diff --git a/lib/cProfile.ml b/lib/cProfile.ml
index 07a1145021..323a14c6f0 100644
--- a/lib/cProfile.ml
+++ b/lib/cProfile.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/cProfile.mli b/lib/cProfile.mli
index 764faf8d1a..6f8639226d 100644
--- a/lib/cProfile.mli
+++ b/lib/cProfile.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -18,7 +18,7 @@ To trace a function "f" you first need to get a key for it by using :
let fkey = declare_profile "f";;
-(the string is used to print the profile infomation). Warning: this
+(the string is used to print the profile information). Warning: this
function does a side effect. Choose the ident you want instead "fkey".
Then if the function has ONE argument add the following just after
diff --git a/lib/cWarnings.ml b/lib/cWarnings.ml
index f199e2e608..7612e8c340 100644
--- a/lib/cWarnings.ml
+++ b/lib/cWarnings.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/cWarnings.mli b/lib/cWarnings.mli
index f97a53c4d7..1938cab4d7 100644
--- a/lib/cWarnings.mli
+++ b/lib/cWarnings.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/control.ml b/lib/control.ml
index 9054507e46..7d54838df8 100644
--- a/lib/control.ml
+++ b/lib/control.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/control.mli b/lib/control.mli
index 640d41a4f7..18a84e698f 100644
--- a/lib/control.mli
+++ b/lib/control.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/coqProject_file.ml b/lib/coqProject_file.ml
index d908baa1e8..4c670f6abe 100644
--- a/lib/coqProject_file.ml
+++ b/lib/coqProject_file.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/coqProject_file.mli b/lib/coqProject_file.mli
index 39c5d019d0..bd8952b8fc 100644
--- a/lib/coqProject_file.mli
+++ b/lib/coqProject_file.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/dAst.ml b/lib/dAst.ml
index 803b2a0cff..a9a92b3ed7 100644
--- a/lib/dAst.ml
+++ b/lib/dAst.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/dAst.mli b/lib/dAst.mli
index 2f58cfc41f..599ad0219b 100644
--- a/lib/dAst.mli
+++ b/lib/dAst.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/envars.ml b/lib/envars.ml
index af8e45b137..440df08782 100644
--- a/lib/envars.ml
+++ b/lib/envars.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/envars.mli b/lib/envars.mli
index ebf86d0650..db904d419d 100644
--- a/lib/envars.mli
+++ b/lib/envars.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -38,7 +38,7 @@ val datadir : unit -> string
(** [configdir] is the path to the installed config directory. *)
val configdir : unit -> string
-(** [set_coqlib] must be runned once before any access to [coqlib] *)
+(** [set_coqlib] must be run once before any access to [coqlib] *)
val set_coqlib : fail:(string -> string) -> unit
(** [set_user_coqlib path] sets the coqlib directory explicitedly. *)
diff --git a/lib/explore.ml b/lib/explore.ml
index 4dc48ab668..e30dd7e809 100644
--- a/lib/explore.ml
+++ b/lib/explore.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/explore.mli b/lib/explore.mli
index 528a1b97c9..6dc2e358d2 100644
--- a/lib/explore.mli
+++ b/lib/explore.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/feedback.ml b/lib/feedback.ml
index 9654711ebb..8ba6489dc5 100644
--- a/lib/feedback.ml
+++ b/lib/feedback.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/feedback.mli b/lib/feedback.mli
index f407e2fd5b..dc8449ed71 100644
--- a/lib/feedback.mli
+++ b/lib/feedback.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -56,7 +56,7 @@ type feedback = {
(** {6 Feedback sent, even asynchronously, to the user interface} *)
-(* The interpreter assignes an state_id to the ast, and feedbacks happening
+(* The interpreter assigns a state_id to the ast, and feedbacks happening
* during interpretation are attached to it.
*)
diff --git a/lib/flags.ml b/lib/flags.ml
index 452433d271..190de5853d 100644
--- a/lib/flags.ml
+++ b/lib/flags.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/flags.mli b/lib/flags.mli
index a70a23b902..1c96796220 100644
--- a/lib/flags.mli
+++ b/lib/flags.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -64,7 +64,7 @@ val beautify : bool ref
val beautify_file : bool ref
(* Coq quiet mode. Note that normal mode is called "verbose" here,
- whereas [quiet] supresses normal output such as goals in coqtop *)
+ whereas [quiet] suppresses normal output such as goals in coqtop *)
val quiet : bool ref
val silently : ('a -> 'b) -> 'a -> 'b
val verbosely : ('a -> 'b) -> 'a -> 'b
diff --git a/lib/future.ml b/lib/future.ml
index 6e7c6fd9e3..f6e9cee140 100644
--- a/lib/future.ml
+++ b/lib/future.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/future.mli b/lib/future.mli
index 55f05518b0..8e5f704837 100644
--- a/lib/future.mli
+++ b/lib/future.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/genarg.ml b/lib/genarg.ml
index 209d1b271e..152d00bf7c 100644
--- a/lib/genarg.ml
+++ b/lib/genarg.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/genarg.mli b/lib/genarg.mli
index 52db3df088..3e681ad2b9 100644
--- a/lib/genarg.mli
+++ b/lib/genarg.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/hook.ml b/lib/hook.ml
index 1e2a2f279d..76da1071b8 100644
--- a/lib/hook.ml
+++ b/lib/hook.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/hook.mli b/lib/hook.mli
index 67abd34dd6..e3eb370ecb 100644
--- a/lib/hook.mli
+++ b/lib/hook.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/loc.ml b/lib/loc.ml
index 6bcdcc0341..13a7fdea3e 100644
--- a/lib/loc.ml
+++ b/lib/loc.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/loc.mli b/lib/loc.mli
index 1eb3cc49e8..6a86005c7b 100644
--- a/lib/loc.mli
+++ b/lib/loc.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/pp.ml b/lib/pp.ml
index cdde60f051..542e5f6ecd 100644
--- a/lib/pp.ml
+++ b/lib/pp.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/pp.mli b/lib/pp.mli
index 4ce6a535c8..b97e74132c 100644
--- a/lib/pp.mli
+++ b/lib/pp.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -18,7 +18,7 @@
(* to interpret. *)
(* *)
(* The datatype has a public view to allow serialization or advanced *)
-(* uses, however regular users are _strongly_ warned againt its use, *)
+(* uses, however regular users are _strongly_ warned against its use, *)
(* they should instead rely on the available functions below. *)
(* *)
(* Box order and number is indeed an important factor. Try to create *)
diff --git a/lib/pp_diff.ml b/lib/pp_diff.ml
index a485bf31c0..8a7934d552 100644
--- a/lib/pp_diff.ml
+++ b/lib/pp_diff.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/pp_diff.mli b/lib/pp_diff.mli
index 03468271d2..24f2eace93 100644
--- a/lib/pp_diff.mli
+++ b/lib/pp_diff.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -88,7 +88,7 @@ Ppcmd_strings will be split into multiple Ppcmd_strings if a diff starts or ends
in the middle of the string. Whitespace just before or just after a diff will
not be part of the highlight.
-Prexisting tags in pp may contain only a single Ppcmd_string. Those tags will be
+Preexisting tags in pp may contain only a single Ppcmd_string. Those tags will be
placed inside the diff tags to ensure proper nesting of tags within spans of
"start.diff.*" ... "end.diff.*".
diff --git a/lib/remoteCounter.ml b/lib/remoteCounter.ml
index 978b8b7384..d7c08957b9 100644
--- a/lib/remoteCounter.ml
+++ b/lib/remoteCounter.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/remoteCounter.mli b/lib/remoteCounter.mli
index ae0605cfb7..ef6f34c525 100644
--- a/lib/remoteCounter.mli
+++ b/lib/remoteCounter.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/rtree.ml b/lib/rtree.ml
index 66d9eba3f7..9709540059 100644
--- a/lib/rtree.ml
+++ b/lib/rtree.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/rtree.mli b/lib/rtree.mli
index 67519aa387..9887580e7a 100644
--- a/lib/rtree.mli
+++ b/lib/rtree.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/spawn.ml b/lib/spawn.ml
index 0652623b74..ea0cef54f6 100644
--- a/lib/spawn.ml
+++ b/lib/spawn.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/spawn.mli b/lib/spawn.mli
index 944aa27a7f..5321436ab0 100644
--- a/lib/spawn.mli
+++ b/lib/spawn.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -9,7 +9,7 @@
(************************************************************************)
(* This module implements spawning/killing managed processes with a
- * synchronous or asynchronous comunication channel that works with
+ * synchronous or asynchronous communication channel that works with
* threads or with a glib like main loop model.
*
* This module requires no threads and no main loop model. It takes care
diff --git a/lib/stateid.ml b/lib/stateid.ml
index 8f45f3605d..023d782325 100644
--- a/lib/stateid.ml
+++ b/lib/stateid.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/stateid.mli b/lib/stateid.mli
index f6ce7ddc40..f73a210249 100644
--- a/lib/stateid.mli
+++ b/lib/stateid.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/system.ml b/lib/system.ml
index c408061852..46b358f825 100644
--- a/lib/system.ml
+++ b/lib/system.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/system.mli b/lib/system.mli
index 6dd1eb5a84..a56479e3b4 100644
--- a/lib/system.mli
+++ b/lib/system.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/lib/util.ml b/lib/util.ml
index 38d73d3453..bac06b5701 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -14,7 +14,7 @@ let on_fst f (a,b) = (f a,b)
let on_snd f (a,b) = (a,f b)
let map_pair f (a,b) = (f a,f b)
-(* Mapping under pairs *)
+(* Mapping under triplets *)
let on_pi1 f (a,b,c) = (f a,b,c)
let on_pi2 f (a,b,c) = (a,f b,c)
diff --git a/lib/util.mli b/lib/util.mli
index 1eb60f509a..8ccb4b3f08 100644
--- a/lib/util.mli
+++ b/lib/util.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -17,7 +17,7 @@ val on_fst : ('a -> 'b) -> 'a * 'c -> 'b * 'c
val on_snd : ('a -> 'b) -> 'c * 'a -> 'c * 'b
val map_pair : ('a -> 'b) -> 'a * 'a -> 'b * 'b
-(** Mapping under triple *)
+(** Mapping under triplets *)
val on_pi1 : ('a -> 'b) -> 'a * 'c * 'd -> 'b * 'c * 'd
val on_pi2 : ('a -> 'b) -> 'c * 'a * 'd -> 'c * 'b * 'd
diff --git a/lib/xml_datatype.mli b/lib/xml_datatype.mli
index 19c046e95c..8f14100d6b 100644
--- a/lib/xml_datatype.mli
+++ b/lib/xml_datatype.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/coqlib.ml b/library/coqlib.ml
index 784360dc8a..7cd2e50274 100644
--- a/library/coqlib.ml
+++ b/library/coqlib.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/coqlib.mli b/library/coqlib.mli
index f6779dbbde..ab8b18c4fb 100644
--- a/library/coqlib.mli
+++ b/library/coqlib.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/decl_kinds.ml b/library/decl_kinds.ml
index 8d5c2fb687..0e2ef95739 100644
--- a/library/decl_kinds.ml
+++ b/library/decl_kinds.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -12,7 +12,9 @@
type discharge = DoDischarge | NoDischarge
-type locality = Discharge | Local | Global
+type import_status = ImportDefaultBehavior | ImportNeedQualified
+
+type locality = Discharge | Global of import_status
type binding_kind = Explicit | Implicit
@@ -46,7 +48,7 @@ type definition_object_kind =
| Method
| Let
-type assumption_object_kind = Definitional | Logical | Conjectural
+type assumption_object_kind = Definitional | Logical | Conjectural | Context
(* [assumption_kind]
diff --git a/library/declaremods.ml b/library/declaremods.ml
index 5fd11e187a..fc3e667c20 100644
--- a/library/declaremods.ml
+++ b/library/declaremods.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -51,7 +51,7 @@ let inl2intopt = function
- Then comes either the object segment itself (for interactive
modules), or a compact way to store derived objects (path to
- a earlier module + subtitution).
+ a earlier module + substitution).
*)
type algebraic_objects =
diff --git a/library/declaremods.mli b/library/declaremods.mli
index 2b28ba908e..93aadd25de 100644
--- a/library/declaremods.mli
+++ b/library/declaremods.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/decls.ml b/library/decls.ml
index b766b6e2cb..ef60a44ac7 100644
--- a/library/decls.ml
+++ b/library/decls.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/decls.mli b/library/decls.mli
index c0db537427..0d09499b51 100644
--- a/library/decls.mli
+++ b/library/decls.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/global.ml b/library/global.ml
index 58e2380440..ca774dbd74 100644
--- a/library/global.ml
+++ b/library/global.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -94,7 +94,7 @@ let make_sprop_cumulative () = globalize0 Safe_typing.make_sprop_cumulative
let set_allow_sprop b = globalize0 (Safe_typing.set_allow_sprop b)
let sprop_allowed () = Environ.sprop_allowed (env())
let export_private_constants ~in_section cd = globalize (Safe_typing.export_private_constants ~in_section cd)
-let add_constant ?role ~in_section id d = globalize (Safe_typing.add_constant ?role ~in_section (i2l id) d)
+let add_constant ~side_effect ~in_section id d = globalize (Safe_typing.add_constant ~side_effect ~in_section (i2l id) d)
let add_recipe ~in_section id d = globalize (Safe_typing.add_recipe ~in_section (i2l id) d)
let add_mind id mie = globalize (Safe_typing.add_mind (i2l id) mie)
let add_modtype id me inl = globalize (Safe_typing.add_modtype (i2l id) me inl)
@@ -132,9 +132,25 @@ let exists_objlabel id = Safe_typing.exists_objlabel id (safe_env ())
let opaque_tables () = Environ.opaque_tables (env ())
-let body_of_constant_body ce = body_of_constant_body (env ()) ce
-
-let body_of_constant cst = body_of_constant_body (lookup_constant cst)
+let body_of_constant_body access env cb =
+ let open Declarations in
+ let otab = Environ.opaque_tables env in
+ match cb.const_body with
+ | Undef _ | Primitive _ ->
+ None
+ | Def c ->
+ let u = match cb.const_universes with
+ | Monomorphic _ -> Opaqueproof.PrivateMonomorphic ()
+ | Polymorphic auctx -> Opaqueproof.PrivatePolymorphic (Univ.AUContext.size auctx, Univ.ContextSet.empty)
+ in
+ Some (Mod_subst.force_constr c, u, Declareops.constant_polymorphic_context cb)
+ | OpaqueDef o ->
+ let c, u = Opaqueproof.force_proof access otab o in
+ Some (c, u, Declareops.constant_polymorphic_context cb)
+
+let body_of_constant_body access ce = body_of_constant_body access (env ()) ce
+
+let body_of_constant access cst = body_of_constant_body access (lookup_constant cst)
(** Operations on kernel names *)
diff --git a/library/global.mli b/library/global.mli
index 984d8c666c..51307b3604 100644
--- a/library/global.mli
+++ b/library/global.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -42,11 +42,11 @@ val push_named_assum : (Id.t * Constr.types * bool) Univ.in_universe_context_set
val push_named_def : (Id.t * Entries.section_def_entry) -> unit
val export_private_constants : in_section:bool ->
- Safe_typing.private_constants Entries.definition_entry ->
- unit Entries.definition_entry * Safe_typing.exported_private_constant list
+ Safe_typing.private_constants Entries.proof_output ->
+ Constr.constr Univ.in_universe_context_set * Safe_typing.exported_private_constant list
val add_constant :
- ?role:Entries.side_effect_role -> in_section:bool -> Id.t -> Safe_typing.global_declaration -> Constant.t * Safe_typing.private_constants
+ side_effect:'a Safe_typing.effect_entry -> in_section:bool -> Id.t -> Safe_typing.global_declaration -> Constant.t * 'a
val add_recipe : in_section:bool -> Id.t -> Cooking.recipe -> Constant.t
val add_mind :
Id.t -> Entries.mutual_inductive_entry -> MutInd.t
@@ -100,13 +100,16 @@ val mind_of_delta_kn : KerName.t -> MutInd.t
val opaque_tables : unit -> Opaqueproof.opaquetab
-val body_of_constant : Constant.t -> (Constr.constr * Univ.AUContext.t) option
+val body_of_constant : Opaqueproof.indirect_accessor -> Constant.t ->
+ (Constr.constr * unit Opaqueproof.delayed_universes * Univ.AUContext.t) option
(** Returns the body of the constant if it has any, and the polymorphic context
it lives in. For monomorphic constant, the latter is empty, and for
polymorphic constants, the term contains De Bruijn universe variables that
need to be instantiated. *)
-val body_of_constant_body : Opaqueproof.opaque Declarations.constant_body -> (Constr.constr * Univ.AUContext.t) option
+val body_of_constant_body : Opaqueproof.indirect_accessor ->
+ Opaqueproof.opaque Declarations.constant_body ->
+ (Constr.constr * unit Opaqueproof.delayed_universes * Univ.AUContext.t) option
(** Same as {!body_of_constant} but on {!Declarations.constant_body}. *)
(** {6 Compiled libraries } *)
diff --git a/library/globnames.ml b/library/globnames.ml
index 99dcc43ad1..71447c4b81 100644
--- a/library/globnames.ml
+++ b/library/globnames.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/globnames.mli b/library/globnames.mli
index 14e422b743..547755b088 100644
--- a/library/globnames.mli
+++ b/library/globnames.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/goptions.ml b/library/goptions.ml
index f4b8ce9465..c7024ca81d 100644
--- a/library/goptions.ml
+++ b/library/goptions.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -53,9 +53,9 @@ module MakeTable =
functor
(A : sig
type t
- type key
- val compare : t -> t -> int
- val table : (string * key table_of_A) list ref
+ type key
+ module Set : CSig.SetS with type elt = t
+ val table : (string * key table_of_A) list ref
val encode : Environ.env -> key -> t
val subst : substitution -> t -> t
val printer : t -> Pp.t
@@ -74,7 +74,7 @@ module MakeTable =
if String.List.mem_assoc nick !A.table then
user_err Pp.(str "Sorry, this table name (" ++ str nick ++ str ") is already used.")
- module MySet = Set.Make (struct type t = A.t let compare = A.compare end)
+ module MySet = A.Set
let t = Summary.ref MySet.empty ~name:nick
@@ -119,8 +119,9 @@ module MakeTable =
}
let _ = A.table := (nick, table_of_A)::!A.table
- let active c = MySet.mem c !t
- let elements () = MySet.elements !t
+
+ let v () = !t
+ let active x = A.Set.mem x !t
end
let string_table = ref []
@@ -138,7 +139,7 @@ module StringConvert = functor (A : StringConvertArg) ->
struct
type t = string
type key = string
- let compare = String.compare
+ module Set = CString.Set
let table = string_table
let encode _env x = x
let subst _ x = x
@@ -158,7 +159,7 @@ let get_ref_table k = String.List.assoc (nickname k) !ref_table
module type RefConvertArg =
sig
type t
- val compare : t -> t -> int
+ module Set : CSig.SetS with type elt = t
val encode : Environ.env -> qualid -> t
val subst : substitution -> t -> t
val printer : t -> Pp.t
@@ -171,7 +172,7 @@ module RefConvert = functor (A : RefConvertArg) ->
struct
type t = A.t
type key = qualid
- let compare = A.compare
+ module Set = A.Set
let table = ref_table
let encode = A.encode
let subst = A.subst
diff --git a/library/goptions.mli b/library/goptions.mli
index 381ba4d34a..29af196654 100644
--- a/library/goptions.mli
+++ b/library/goptions.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -70,8 +70,8 @@ module MakeStringTable :
val member_message : string -> bool -> Pp.t
end) ->
sig
+ val v : unit -> CString.Set.t
val active : string -> bool
- val elements : unit -> string list
end
(** The functor [MakeRefTable] declares a new table of objects of type
@@ -87,19 +87,19 @@ end
module MakeRefTable :
functor
(A : sig
- type t
- val compare : t -> t -> int
- val encode : Environ.env -> qualid -> t
- val subst : substitution -> t -> t
- val printer : t -> Pp.t
- val key : option_name
- val title : string
- val member_message : t -> bool -> Pp.t
- end) ->
- sig
- val active : A.t -> bool
- val elements : unit -> A.t list
- end
+ type t
+ module Set : CSig.SetS with type elt = t
+ val encode : Environ.env -> qualid -> t
+ val subst : substitution -> t -> t
+ val printer : t -> Pp.t
+ val key : option_name
+ val title : string
+ val member_message : t -> bool -> Pp.t
+ end) ->
+sig
+ val v : unit -> A.Set.t
+ val active : A.t -> bool
+end
(** {6 Options. } *)
diff --git a/library/keys.ml b/library/keys.ml
index 45b6fae2f0..30ecc9dfdb 100644
--- a/library/keys.ml
+++ b/library/keys.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/keys.mli b/library/keys.mli
index 198383650a..a7adf7791b 100644
--- a/library/keys.mli
+++ b/library/keys.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/kindops.ml b/library/kindops.ml
index 247319fa2f..0bf55c62a9 100644
--- a/library/kindops.ml
+++ b/library/kindops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/kindops.mli b/library/kindops.mli
index df39019da4..3c9f2bb7c3 100644
--- a/library/kindops.mli
+++ b/library/kindops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/lib.ml b/library/lib.ml
index 4be288ed20..ae657dbd70 100644
--- a/library/lib.ml
+++ b/library/lib.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -474,9 +474,6 @@ let extract_hyps (secs,ohyps) =
let instance_from_variable_context =
List.map fst %> List.filter is_local_assum %> List.map NamedDecl.get_id %> Array.of_list
-let named_of_variable_context =
- List.map fst
-
let name_instance inst =
(* FIXME: this should probably be done at an upper level, by storing the
name information in the section data structure. *)
diff --git a/library/lib.mli b/library/lib.mli
index 5da76961a6..f6bd61e2da 100644
--- a/library/lib.mli
+++ b/library/lib.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -168,7 +168,6 @@ type abstr_info = private {
}
val instance_from_variable_context : variable_context -> Id.t array
-val named_of_variable_context : variable_context -> Constr.named_context
val section_segment_of_constant : Constant.t -> abstr_info
val section_segment_of_mutual_inductive: MutInd.t -> abstr_info
diff --git a/library/libnames.ml b/library/libnames.ml
index 41b38e0378..18af216e46 100644
--- a/library/libnames.ml
+++ b/library/libnames.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/libnames.mli b/library/libnames.mli
index 7d77d95991..4455e29818 100644
--- a/library/libnames.mli
+++ b/library/libnames.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/libobject.ml b/library/libobject.ml
index 3d17b4a605..72791661bc 100644
--- a/library/libobject.ml
+++ b/library/libobject.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/libobject.mli b/library/libobject.mli
index 00515bd273..a7151d3bf2 100644
--- a/library/libobject.mli
+++ b/library/libobject.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/library.ml b/library/library.ml
index 500e77f89b..0d4148d7e4 100644
--- a/library/library.ml
+++ b/library/library.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -208,7 +208,7 @@ let register_open_library export m =
let open_library export explicit_libs m =
if
(* Only libraries indirectly to open are not reopen *)
- (* Libraries explicitly mentionned by the user are always reopen *)
+ (* Libraries explicitly mentioned by the user are always reopen *)
List.exists (fun m' -> DirPath.equal m m') explicit_libs
|| not (library_is_opened m)
then begin
@@ -264,90 +264,11 @@ let in_import_library : DirPath.t list * bool -> obj =
subst_function = subst_import_library;
classify_function = classify_import_library }
-
-(************************************************************************)
-(*s Locate absolute or partially qualified library names in the path *)
-
-exception LibUnmappedDir
-exception LibNotFound
-type library_location = LibLoaded | LibInPath
-
-let warn_several_object_files =
- CWarnings.create ~name:"several-object-files" ~category:"require"
- (fun (vi, vo) -> str"Loading" ++ spc () ++ str vi ++
- strbrk " instead of " ++ str vo ++
- strbrk " because it is more recent")
-
-let locate_absolute_library dir =
- (* Search in loadpath *)
- let pref, base = split_dirpath dir in
- let loadpath = Loadpath.filter_path (fun dir -> DirPath.equal dir pref) in
- let () = match loadpath with [] -> raise LibUnmappedDir | _ -> () in
- let loadpath = List.map fst loadpath in
- let find ext =
- try
- let name = Id.to_string base ^ ext in
- let _, file = System.where_in_path ~warn:false loadpath name in
- Some file
- with Not_found -> None in
- match find ".vo", find ".vio" with
- | None, None -> raise LibNotFound
- | Some file, None | None, Some file -> file
- | Some vo, Some vi when Unix.((stat vo).st_mtime < (stat vi).st_mtime) ->
- warn_several_object_files (vi, vo);
- vi
- | Some vo, Some _ -> vo
-
-let locate_qualified_library ?root ?(warn = true) qid =
- (* Search library in loadpath *)
- let dir, base = repr_qualid qid in
- let loadpath = Loadpath.expand_path ?root dir in
- let () = match loadpath with [] -> raise LibUnmappedDir | _ -> () in
- let find ext =
- try
- let name = Id.to_string base ^ ext in
- let lpath, file =
- System.where_in_path ~warn (List.map fst loadpath) name in
- Some (lpath, file)
- with Not_found -> None in
- let lpath, file =
- match find ".vo", find ".vio" with
- | None, None -> raise LibNotFound
- | Some res, None | None, Some res -> res
- | Some (_, vo), Some (_, vi as resvi)
- when Unix.((stat vo).st_mtime < (stat vi).st_mtime) ->
- warn_several_object_files (vi, vo);
- resvi
- | Some resvo, Some _ -> resvo
- in
- let dir = add_dirpath_suffix (String.List.assoc lpath loadpath) base in
- (* Look if loaded *)
- if library_is_loaded dir then (LibLoaded, dir,library_full_filename dir)
- (* Otherwise, look for it in the file system *)
- else (LibInPath, dir, file)
-
-let error_unmapped_dir qid =
- let prefix, _ = repr_qualid qid in
- user_err ~hdr:"load_absolute_library_from"
- (str "Cannot load " ++ pr_qualid qid ++ str ":" ++ spc () ++
- str "no physical path bound to" ++ spc () ++ DirPath.print prefix ++ fnl ())
-
-let error_lib_not_found qid =
- user_err ~hdr:"load_absolute_library_from"
- (str"Cannot find library " ++ pr_qualid qid ++ str" in loadpath")
-
-let try_locate_absolute_library dir =
- try
- locate_absolute_library dir
- with
- | LibUnmappedDir -> error_unmapped_dir (qualid_of_dirpath dir)
- | LibNotFound -> error_lib_not_found (qualid_of_dirpath dir)
-
(************************************************************************)
(** {6 Tables of opaque proof terms} *)
(** We now store opaque proof terms apart from the rest of the environment.
- See the [Indirect] contructor in [Lazyconstr.lazy_constr]. This way,
+ See the [Indirect] constructor in [Lazyconstr.lazy_constr]. This way,
we can quickly load a first half of a .vo file without these opaque
terms, and access them only when a specific command (e.g. Print or
Print Assumptions) needs it. *)
@@ -355,18 +276,14 @@ let try_locate_absolute_library dir =
(** Delayed / available tables of opaque terms *)
type 'a table_status =
- | ToFetch of 'a Future.computation array delayed
- | Fetched of 'a Future.computation array
+ | ToFetch of 'a array delayed
+ | Fetched of 'a array
let opaque_tables =
- ref (LibraryMap.empty : (Constr.constr table_status) LibraryMap.t)
-let univ_tables =
- ref (LibraryMap.empty : (Univ.ContextSet.t table_status) LibraryMap.t)
+ ref (LibraryMap.empty : (Opaqueproof.opaque_proofterm table_status) LibraryMap.t)
let add_opaque_table dp st =
opaque_tables := LibraryMap.add dp st !opaque_tables
-let add_univ_table dp st =
- univ_tables := LibraryMap.add dp st !univ_tables
let access_table what tables dp i =
let t = match LibraryMap.find dp !tables with
@@ -391,15 +308,10 @@ let access_opaque_table dp i =
let what = "opaque proofs" in
access_table what opaque_tables dp i
-let access_univ_table dp i =
- try
- let what = "universe contexts of opaque proofs" in
- Some (access_table what univ_tables dp i)
- with Not_found -> None
-
-let () =
- Opaqueproof.set_indirect_opaque_accessor access_opaque_table;
- Opaqueproof.set_indirect_univ_accessor access_univ_table
+let indirect_accessor = {
+ Opaqueproof.access_proof = access_opaque_table;
+ Opaqueproof.access_discharge = Cooking.cook_constr;
+}
(************************************************************************)
(* Internalise libraries *)
@@ -407,9 +319,8 @@ let () =
type seg_sum = summary_disk
type seg_lib = library_disk
type seg_univ = (* true = vivo, false = vi *)
- Univ.ContextSet.t Future.computation array * Univ.ContextSet.t * bool
-type seg_discharge = Opaqueproof.cooking_info list array
-type seg_proofs = Constr.constr Future.computation array
+ Univ.ContextSet.t * bool
+type seg_proofs = Opaqueproof.opaque_proofterm array
let mk_library sd md digests univs =
{
@@ -433,7 +344,6 @@ let intern_from_file f =
let ((lmd : seg_lib delayed), digest_lmd) = in_delayed f ch in
let (univs : seg_univ option), _, digest_u = System.marshal_in_segment f ch in
let _ = System.skip_in_segment f ch in
- let _ = System.skip_in_segment f ch in
let ((del_opaque : seg_proofs delayed),_) = in_delayed f ch in
close_in ch;
register_library_filename lsd.md_name f;
@@ -441,16 +351,14 @@ let intern_from_file f =
let open Safe_typing in
match univs with
| None -> mk_library lsd lmd (Dvo_or_vi digest_lmd) Univ.ContextSet.empty
- | Some (utab,uall,true) ->
- add_univ_table lsd.md_name (Fetched utab);
+ | Some (uall,true) ->
mk_library lsd lmd (Dvivo (digest_lmd,digest_u)) uall
- | Some (utab,_,false) ->
- add_univ_table lsd.md_name (Fetched utab);
+ | Some (_,false) ->
mk_library lsd lmd (Dvo_or_vi digest_lmd) Univ.ContextSet.empty
module DPMap = Map.Make(DirPath)
-let rec intern_library (needed, contents) (dir, f) from =
+let rec intern_library ~lib_resolver (needed, contents) (dir, f) from =
(* Look if in the current logical environment *)
try (find_library dir).libsum_digests, (needed, contents)
with Not_found ->
@@ -459,7 +367,7 @@ let rec intern_library (needed, contents) (dir, f) from =
with Not_found ->
Feedback.feedback(Feedback.FileDependency (from, DirPath.to_string dir));
(* [dir] is an absolute name which matches [f] which must be in loadpath *)
- let f = match f with Some f -> f | None -> try_locate_absolute_library dir in
+ let f = match f with Some f -> f | None -> lib_resolver dir in
let m = intern_from_file f in
if not (DirPath.equal dir m.library_name) then
user_err ~hdr:"load_physical_library"
@@ -467,22 +375,24 @@ let rec intern_library (needed, contents) (dir, f) from =
DirPath.print m.library_name ++ spc () ++ str "and not library" ++
spc() ++ DirPath.print dir);
Feedback.feedback (Feedback.FileLoaded(DirPath.to_string dir, f));
- m.library_digests, intern_library_deps (needed, contents) dir m f
+ m.library_digests, intern_library_deps ~lib_resolver (needed, contents) dir m f
-and intern_library_deps libs dir m from =
- let needed, contents = Array.fold_left (intern_mandatory_library dir from) libs m.library_deps in
+and intern_library_deps ~lib_resolver libs dir m from =
+ let needed, contents =
+ Array.fold_left (intern_mandatory_library ~lib_resolver dir from)
+ libs m.library_deps in
(dir :: needed, DPMap.add dir m contents )
-and intern_mandatory_library caller from libs (dir,d) =
- let digest, libs = intern_library libs (dir, None) (Some from) in
+and intern_mandatory_library ~lib_resolver caller from libs (dir,d) =
+ let digest, libs = intern_library ~lib_resolver libs (dir, None) (Some from) in
if not (Safe_typing.digest_match ~actual:digest ~required:d) then
user_err (str "Compiled library " ++ DirPath.print caller ++
str " (in file " ++ str from ++ str ") makes inconsistent assumptions \
over library " ++ DirPath.print dir);
libs
-let rec_intern_library libs (dir, f) =
- let _, libs = intern_library libs (dir, Some f) None in
+let rec_intern_library ~lib_resolver libs (dir, f) =
+ let _, libs = intern_library ~lib_resolver libs (dir, Some f) None in
libs
let native_name_from_filename f =
@@ -557,8 +467,8 @@ let warn_require_in_module =
strbrk "You can Require a module at toplevel " ++
strbrk "and optionally Import it inside another one.")
-let require_library_from_dirpath modrefl export =
- let needed, contents = List.fold_left rec_intern_library ([], DPMap.empty) modrefl in
+let require_library_from_dirpath ~lib_resolver modrefl export =
+ let needed, contents = List.fold_left (rec_intern_library ~lib_resolver) ([], DPMap.empty) modrefl in
let needed = List.rev_map (fun dir -> DPMap.find dir contents) needed in
let modrefl = List.map fst modrefl in
if Lib.is_module_or_modtype () then
@@ -616,15 +526,13 @@ let load_library_todo f =
let (s0 : seg_sum), _, _ = System.marshal_in_segment f ch in
let (s1 : seg_lib), _, _ = System.marshal_in_segment f ch in
let (s2 : seg_univ option), _, _ = System.marshal_in_segment f ch in
- let (s3 : seg_discharge option), _, _ = System.marshal_in_segment f ch in
let tasks, _, _ = System.marshal_in_segment f ch in
- let (s5 : seg_proofs), _, _ = System.marshal_in_segment f ch in
+ let (s4 : seg_proofs), _, _ = System.marshal_in_segment f ch in
close_in ch;
if tasks = None then user_err ~hdr:"restart" (str"not a .vio file");
if s2 = None then user_err ~hdr:"restart" (str"not a .vio file");
- if s3 = None then user_err ~hdr:"restart" (str"not a .vio file");
- if pi3 (Option.get s2) then user_err ~hdr:"restart" (str"not a .vio file");
- s0, s1, Option.get s2, Option.get s3, Option.get tasks, s5
+ if snd (Option.get s2) then user_err ~hdr:"restart" (str"not a .vio file");
+ s0, s1, Option.get s2, Option.get tasks, s4
(************************************************************************)
(*s [save_library dir] ends library [dir] and save it to the disk. *)
@@ -667,10 +575,10 @@ let save_library_to ?todo ~output_native_objects dir f otab =
List.fold_left (fun e (r,_) -> Future.UUIDSet.add r.Stateid.uuid e)
Future.UUIDSet.empty l in
let cenv, seg, ast = Declaremods.end_library ~output_native_objects ~except dir in
- let opaque_table, univ_table, disch_table, f2t_map = Opaqueproof.dump otab in
- let tasks, utab, dtab =
+ let opaque_table, f2t_map = Opaqueproof.dump ~except otab in
+ let tasks, utab =
match todo with
- | None -> None, None, None
+ | None -> None, None
| Some (tasks, rcbackup) ->
let tasks =
List.map Stateid.(fun (r,b) ->
@@ -678,18 +586,8 @@ let save_library_to ?todo ~output_native_objects dir f otab =
with Not_found -> assert b; { r with uuid = -1 }, b)
tasks in
Some (tasks,rcbackup),
- Some (univ_table,Univ.ContextSet.empty,false),
- Some disch_table in
- let except =
- Future.UUIDSet.fold (fun uuid acc ->
- try Int.Set.add (Future.UUIDMap.find uuid f2t_map) acc
- with Not_found -> acc)
- except Int.Set.empty in
- let is_done_or_todo i x = Future.is_val x || Int.Set.mem i except in
- Array.iteri (fun i x ->
- if not(is_done_or_todo i x) then CErrors.user_err ~hdr:"library"
- Pp.(str"Proof object "++int i++str" is not checked nor to be checked"))
- opaque_table;
+ Some (Univ.ContextSet.empty,false)
+ in
let sd = {
md_name = dir;
md_deps = Array.of_list (current_deps ());
@@ -709,7 +607,6 @@ let save_library_to ?todo ~output_native_objects dir f otab =
System.marshal_out_segment f' ch (sd : seg_sum);
System.marshal_out_segment f' ch (md : seg_lib);
System.marshal_out_segment f' ch (utab : seg_univ option);
- System.marshal_out_segment f' ch (dtab : seg_discharge option);
System.marshal_out_segment f' ch (tasks : 'tasks option);
System.marshal_out_segment f' ch (opaque_table : seg_proofs);
close_out ch;
@@ -729,7 +626,6 @@ let save_library_raw f sum lib univs proofs =
System.marshal_out_segment f ch (sum : seg_sum);
System.marshal_out_segment f ch (lib : seg_lib);
System.marshal_out_segment f ch (Some univs : seg_univ option);
- System.marshal_out_segment f ch (None : seg_discharge option);
System.marshal_out_segment f ch (None : 'tasks option);
System.marshal_out_segment f ch (proofs : seg_proofs);
close_out ch
diff --git a/library/library.mli b/library/library.mli
index 390299bf56..bb6c42e393 100644
--- a/library/library.mli
+++ b/library/library.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -22,17 +22,20 @@ open Libnames
(** {6 ... }
Require = load in the environment + open (if the optional boolean
is not [None]); mark also for export if the boolean is [Some true] *)
-val require_library_from_dirpath : (DirPath.t * string) list -> bool option -> unit
+val require_library_from_dirpath
+ : lib_resolver:(DirPath.t -> CUnix.physical_path)
+ -> (DirPath.t * string) list
+ -> bool option
+ -> unit
(** {6 Start the compilation of a library } *)
(** Segments of a library *)
type seg_sum
type seg_lib
-type seg_univ = (* cst, all_cst, finished? *)
- Univ.ContextSet.t Future.computation array * Univ.ContextSet.t * bool
-type seg_discharge = Opaqueproof.cooking_info list array
-type seg_proofs = Constr.constr Future.computation array
+type seg_univ = (* all_cst, finished? *)
+ Univ.ContextSet.t * bool
+type seg_proofs = Opaqueproof.opaque_proofterm array
(** Open a module (or a library); if the boolean is true then it's also
an export otherwise just a simple import *)
@@ -45,8 +48,10 @@ val save_library_to :
output_native_objects:bool ->
DirPath.t -> string -> Opaqueproof.opaquetab -> unit
-val load_library_todo :
- string -> seg_sum * seg_lib * seg_univ * seg_discharge * 'tasks * seg_proofs
+val load_library_todo
+ : CUnix.physical_path
+ -> seg_sum * seg_lib * seg_univ * 'tasks * seg_proofs
+
val save_library_raw : string -> seg_sum -> seg_lib -> seg_univ -> seg_proofs -> unit
(** {6 Interrogate the status of libraries } *)
@@ -65,20 +70,8 @@ val library_full_filename : DirPath.t -> string
(** - Overwrite the filename of all libraries (used when restoring a state) *)
val overwrite_library_filenames : string -> unit
-(** {6 Locate a library in the load paths } *)
-exception LibUnmappedDir
-exception LibNotFound
-type library_location = LibLoaded | LibInPath
-
-val locate_qualified_library :
- ?root:DirPath.t -> ?warn:bool -> qualid ->
- library_location * DirPath.t * CUnix.physical_path
-(** Locates a library by implicit name.
-
- @raise LibUnmappedDir if the library is not in the path
- @raise LibNotFound if there is no corresponding file in the path
-
-*)
-
(** {6 Native compiler. } *)
val native_name_from_filename : string -> string
+
+(** {6 Opaque accessors} *)
+val indirect_accessor : Opaqueproof.indirect_accessor
diff --git a/library/library.mllib b/library/library.mllib
index 8f694f4a31..ef53471377 100644
--- a/library/library.mllib
+++ b/library/library.mllib
@@ -7,7 +7,6 @@ Global
Decl_kinds
Lib
Declaremods
-Loadpath
Library
States
Kindops
diff --git a/library/loadpath.ml b/library/loadpath.ml
deleted file mode 100644
index fc13c864d0..0000000000
--- a/library/loadpath.ml
+++ /dev/null
@@ -1,119 +0,0 @@
-(************************************************************************)
-(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
-(* <O___,, * (see CREDITS file for the list of authors) *)
-(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
-(* * (see LICENSE file for the text of the license) *)
-(************************************************************************)
-
-open Pp
-open Util
-open CErrors
-open Names
-open Libnames
-
-(** Load paths. Mapping from physical to logical paths. *)
-
-type t = {
- path_physical : CUnix.physical_path;
- path_logical : DirPath.t;
- path_implicit : bool;
-}
-
-let load_paths = Summary.ref ([] : t list) ~name:"LOADPATHS"
-
-let logical p = p.path_logical
-
-let physical p = p.path_physical
-
-let get_load_paths () = !load_paths
-
-let anomaly_too_many_paths path =
- anomaly (str "Several logical paths are associated to" ++ spc () ++ str path ++ str ".")
-
-let find_load_path phys_dir =
- let phys_dir = CUnix.canonical_path_name phys_dir in
- let filter p = String.equal p.path_physical phys_dir in
- let paths = List.filter filter !load_paths in
- match paths with
- | [] -> raise Not_found
- | [p] -> p
- | _ -> anomaly_too_many_paths phys_dir
-
-let is_in_load_paths phys_dir =
- let dir = CUnix.canonical_path_name phys_dir in
- let lp = get_load_paths () in
- let check_p p = String.equal dir p.path_physical in
- List.exists check_p lp
-
-let remove_load_path dir =
- let filter p = not (String.equal p.path_physical dir) in
- load_paths := List.filter filter !load_paths
-
-let warn_overriding_logical_loadpath =
- CWarnings.create ~name:"overriding-logical-loadpath" ~category:"loadpath"
- (fun (phys_path, old_path, coq_path) ->
- str phys_path ++ strbrk " was previously bound to " ++
- DirPath.print old_path ++ strbrk "; it is remapped to " ++
- DirPath.print coq_path)
-
-let add_load_path phys_path coq_path ~implicit =
- let phys_path = CUnix.canonical_path_name phys_path in
- let filter p = String.equal p.path_physical phys_path in
- let binding = {
- path_logical = coq_path;
- path_physical = phys_path;
- path_implicit = implicit;
- } in
- match List.filter filter !load_paths with
- | [] ->
- load_paths := binding :: !load_paths
- | [{ path_logical = old_path; path_implicit = old_implicit }] ->
- let replace =
- if DirPath.equal coq_path old_path then
- implicit <> old_implicit
- else
- let () =
- (* Do not warn when overriding the default "-I ." path *)
- if not (DirPath.equal old_path Libnames.default_root_prefix) then
- warn_overriding_logical_loadpath (phys_path, old_path, coq_path)
- in
- true in
- if replace then
- begin
- remove_load_path phys_path;
- load_paths := binding :: !load_paths;
- end
- | _ -> anomaly_too_many_paths phys_path
-
-let filter_path f =
- let rec aux = function
- | [] -> []
- | p :: l ->
- if f p.path_logical then (p.path_physical, p.path_logical) :: aux l
- else aux l
- in
- aux !load_paths
-
-let expand_path ?root dir =
- let rec aux = function
- | [] -> []
- | { path_physical = ph; path_logical = lg; path_implicit = implicit } :: l ->
- let success =
- match root with
- | None ->
- if implicit then is_dirpath_suffix_of dir lg
- else DirPath.equal dir lg
- | Some root ->
- is_dirpath_prefix_of root lg &&
- is_dirpath_suffix_of dir (drop_dirpath_prefix root lg) in
- if success then (ph, lg) :: aux l else aux l in
- aux !load_paths
-
-let locate_file fname =
- let paths = List.map physical !load_paths in
- let _,longfname =
- System.find_file_in_path ~warn:(not !Flags.quiet) paths fname in
- longfname
diff --git a/library/nametab.ml b/library/nametab.ml
index bd0ea5f04f..71ee7a6d5a 100644
--- a/library/nametab.ml
+++ b/library/nametab.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/nametab.mli b/library/nametab.mli
index a4f177aad0..6ee22fc283 100644
--- a/library/nametab.mli
+++ b/library/nametab.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -38,7 +38,7 @@ open Globnames
}
{- [exists : full_user_name -> bool]
- Is the [full_user_name] already atributed as an absolute user name
+ Is the [full_user_name] already attributed as an absolute user name
of some object?
}
{- [locate : qualid -> object_reference]
diff --git a/library/states.ml b/library/states.ml
index 92bdc410a3..a73f16957d 100644
--- a/library/states.ml
+++ b/library/states.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/states.mli b/library/states.mli
index 52feb95222..c4f3eae49d 100644
--- a/library/states.mli
+++ b/library/states.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/summary.ml b/library/summary.ml
index 8fbca44353..b3ec4c2db2 100644
--- a/library/summary.ml
+++ b/library/summary.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/library/summary.mli b/library/summary.mli
index 0d77d725ac..3a122edf3d 100644
--- a/library/summary.mli
+++ b/library/summary.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -28,7 +28,7 @@ type 'a summary_declaration = {
Beware: for tables registered dynamically after the initialization
of Coq, their init functions may not be run immediately. It is hence
- the responsability of plugins to initialize themselves properly.
+ the responsibility of plugins to initialize themselves properly.
*)
val declare_summary : string -> 'a summary_declaration -> unit
diff --git a/man/coqdep.1 b/man/coqdep.1
index c417402c25..4639a75677 100644
--- a/man/coqdep.1
+++ b/man/coqdep.1
@@ -106,7 +106,7 @@ Skips subdirectory
Output the given file name ordered by dependencies.
.TP
.B \-boot
-For coq developpers, prints dependencies over coq library files
+For coq developers, prints dependencies over coq library files
(omitted by default).
diff --git a/parsing/cLexer.ml b/parsing/cLexer.ml
index 42ca5f8c05..a27d6450b7 100644
--- a/parsing/cLexer.ml
+++ b/parsing/cLexer.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -548,7 +548,7 @@ let peek_marker s =
| ('a'..'z' | 'A'..'Z' | '_') -> ImmediateAsciiIdent
| _ -> raise Stream.Failure
-let parse_quotation loc s =
+let parse_quotation loc bp s =
match peek_marker s with
| ImmediateAsciiIdent ->
let c = Stream.next s in
@@ -556,34 +556,42 @@ let parse_quotation loc s =
try ident_tail loc (store 0 c) s with
Stream.Failure -> raise (Stream.Error "")
in
- get_buff len
+ get_buff len, set_loc_pos loc bp (Stream.count s)
| Delimited (lenmarker, bmarker, emarker) ->
let b = Buffer.create 80 in
let commit1 c = Buffer.add_char b c; Stream.junk s in
let commit l = List.iter commit1 l in
- let rec quotation depth =
+ let rec quotation loc depth =
match Stream.npeek lenmarker s with
| l when l = bmarker ->
commit l;
- quotation (depth + 1)
+ quotation loc (depth + 1)
| l when l = emarker ->
commit l;
- if depth > 1 then quotation (depth - 1)
+ if depth > 1 then quotation loc (depth - 1) else loc
+ | '\n' :: cs ->
+ commit1 '\n';
+ let loc = bump_loc_line_last loc (Stream.count s) in
+ quotation loc depth
| c :: cs ->
commit1 c;
- quotation depth
+ quotation loc depth
| [] -> raise Stream.Failure
in
- quotation 0;
- Buffer.contents b
+ let loc = quotation loc 0 in
+ Buffer.contents b, set_loc_pos loc bp (Stream.count s)
-let find_keyword loc id s =
+let find_keyword loc id bp s =
let tt = ttree_find !token_tree id in
match progress_further loc tt.node 0 tt s with
| None -> raise Not_found
- | Some (c,NoQuotation) -> KEYWORD c
- | Some (c,Quotation) -> QUOTATION(c, parse_quotation loc s)
+ | Some (c,NoQuotation) ->
+ let ep = Stream.count s in
+ KEYWORD c, set_loc_pos loc bp ep
+ | Some (c,Quotation) ->
+ let txt, loc = parse_quotation loc bp s in
+ QUOTATION(c, txt), loc
let process_sequence loc bp c cs =
let rec aux n cs =
@@ -599,7 +607,9 @@ let process_chars ~diff_mode loc bp c cs =
let ep = Stream.count cs in
match t with
| Some (t,NoQuotation) -> (KEYWORD t, set_loc_pos loc bp ep)
- | Some (c,Quotation) -> (QUOTATION(c, parse_quotation loc cs), set_loc_pos loc bp ep)
+ | Some (c,Quotation) ->
+ let txt, loc = parse_quotation loc bp cs in
+ QUOTATION(c, txt), loc
| None ->
let ep' = bp + utf8_char_size loc cs c in
if diff_mode then begin
@@ -623,14 +633,21 @@ let parse_after_dot ~diff_mode loc c bp s = match Stream.peek s with
Stream.Failure -> raise (Stream.Error "")
in
let field = get_buff len in
- (try find_keyword loc ("."^field) s with Not_found -> FIELD field)
+ begin try find_keyword loc ("."^field) bp s
+ with Not_found ->
+ let ep = Stream.count s in
+ FIELD field, set_loc_pos loc bp ep end
| _ ->
match lookup_utf8 loc s with
| Utf8Token (st, n) when Unicode.is_valid_ident_initial st ->
let len = ident_tail loc (nstore n 0 s) s in
let field = get_buff len in
- (try find_keyword loc ("."^field) s with Not_found -> FIELD field)
- | AsciiChar | Utf8Token _ | EmptyStream -> fst (process_chars ~diff_mode loc bp c s)
+ begin try find_keyword loc ("."^field) bp s
+ with Not_found ->
+ let ep = Stream.count s in
+ FIELD field, set_loc_pos loc bp ep end
+ | AsciiChar | Utf8Token _ | EmptyStream ->
+ process_chars ~diff_mode loc bp c s
(* Parse what follows a question mark *)
@@ -664,22 +681,23 @@ let rec next_token ~diff_mode loc s =
comm_loc bp; push_char c; next_token ~diff_mode loc s
| Some ('.' as c) ->
Stream.junk s;
- let t =
+ let t, newloc =
try parse_after_dot ~diff_mode loc c bp s with
Stream.Failure -> raise (Stream.Error "")
in
- let ep = Stream.count s in
comment_stop bp;
(* We enforce that "." should either be part of a larger keyword,
for instance ".(", or followed by a blank or eof. *)
let () = match t with
- | KEYWORD ("." | "...") ->
- if not (blank_or_eof s) then
- err (set_loc_pos loc bp (ep+1)) Undefined_token;
- between_commands := true;
- | _ -> ()
+ | KEYWORD ("." | "...") ->
+ if not (blank_or_eof s) then begin
+ let ep = Stream.count s in
+ err (set_loc_pos loc bp (ep+1)) Undefined_token
+ end;
+ between_commands := true;
+ | _ -> ()
in
- t, set_loc_pos loc bp ep
+ t, newloc
| Some ('-' | '+' | '*' as c) ->
Stream.junk s;
let t,new_between_commands =
@@ -698,10 +716,12 @@ let rec next_token ~diff_mode loc s =
try ident_tail loc (store 0 c) s with
Stream.Failure -> raise (Stream.Error "")
in
- let ep = Stream.count s in
let id = get_buff len in
comment_stop bp;
- (try find_keyword loc id s with Not_found -> IDENT id), set_loc_pos loc bp ep
+ begin try find_keyword loc id bp s
+ with Not_found ->
+ let ep = Stream.count s in
+ IDENT id, set_loc_pos loc bp ep end
| Some ('0'..'9') ->
let n = NumTok.parse s in
let ep = Stream.count s in
@@ -745,9 +765,11 @@ let rec next_token ~diff_mode loc s =
| Utf8Token (st, n) when Unicode.is_valid_ident_initial st ->
let len = ident_tail loc (nstore n 0 s) s in
let id = get_buff len in
- let ep = Stream.count s in
comment_stop bp;
- (try find_keyword loc id s with Not_found -> IDENT id), set_loc_pos loc bp ep
+ begin try find_keyword loc id bp s
+ with Not_found ->
+ let ep = Stream.count s in
+ IDENT id, set_loc_pos loc bp ep end
| AsciiChar | Utf8Token _ ->
let t = process_chars ~diff_mode loc bp (Stream.next s) s in
comment_stop bp; t
diff --git a/parsing/cLexer.mli b/parsing/cLexer.mli
index 464bcf614d..964689f5f5 100644
--- a/parsing/cLexer.mli
+++ b/parsing/cLexer.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/parsing/extend.ml b/parsing/extend.ml
index dd7c301dfb..63e121c0d1 100644
--- a/parsing/extend.ml
+++ b/parsing/extend.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/parsing/g_constr.mlg b/parsing/g_constr.mlg
index 6df97609f5..8fdec7d1a8 100644
--- a/parsing/g_constr.mlg
+++ b/parsing/g_constr.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -31,8 +31,10 @@ let ldots_var = Id.of_string ".."
let constr_kw =
[ "forall"; "fun"; "match"; "fix"; "cofix"; "with"; "in"; "for";
"end"; "as"; "let"; "if"; "then"; "else"; "return";
- "SProp"; "Prop"; "Set"; "Type"; ".("; "_"; "..";
- "`{"; "`("; "{|"; "|}" ]
+ "SProp"; "Prop"; "Set"; "Type";
+ ":="; "=>"; "->"; ".."; "<:"; "<<:"; ":>";
+ ".("; "()"; "`{"; "`("; "@{"; "{|";
+ "_"; "@"; "+"; "!"; "?"; ";"; ","; ":" ]
let _ = List.iter CLexer.add_keyword constr_kw
@@ -131,7 +133,8 @@ let aliasvar = function { CAst.v = CPatAlias (_, na) } -> Some na | _ -> None
}
GRAMMAR EXTEND Gram
- GLOBAL: binder_constr lconstr constr operconstr universe_level sort sort_family
+ GLOBAL: binder_constr lconstr constr operconstr
+ universe_level universe_name sort sort_family
global constr_pattern lconstr_pattern Constr.ident
closed_binder open_binders binder binders binders_fixannot
record_declaration typeclass_constraint pattern appl_arg;
@@ -151,11 +154,12 @@ GRAMMAR EXTEND Gram
[ [ c = lconstr -> { c } ] ]
;
sort:
- [ [ "Set" -> { GSet }
- | "Prop" -> { GProp }
- | "SProp" -> { GSProp }
- | "Type" -> { GType [] }
- | "Type"; "@{"; u = universe; "}" -> { GType u }
+ [ [ "Set" -> { UNamed [GSet,0] }
+ | "Prop" -> { UNamed [GProp,0] }
+ | "SProp" -> { UNamed [GSProp,0] }
+ | "Type" -> { UAnonymous {rigid=true} }
+ | "Type"; "@{"; "_"; "}" -> { UAnonymous {rigid=false} }
+ | "Type"; "@{"; u = universe; "}" -> { UNamed u }
] ]
;
sort_family:
@@ -165,11 +169,17 @@ GRAMMAR EXTEND Gram
| "Type" -> { Sorts.InType }
] ]
;
+ universe_increment:
+ [ [ "+"; n = natural -> { n }
+ | -> { 0 } ] ]
+ ;
+ universe_name:
+ [ [ id = global -> { GType id }
+ | "Set" -> { GSet }
+ | "Prop" -> { GProp } ] ]
+ ;
universe_expr:
- [ [ id = global; "+"; n = natural -> { Some (id,n) }
- | id = global -> { Some (id,0) }
- | "_" -> { None }
- ] ]
+ [ [ id = universe_name; n = universe_increment -> { (id,n) } ] ]
;
universe:
[ [ IDENT "max"; "("; ids = LIST1 universe_expr SEP ","; ")" -> { ids }
@@ -225,11 +235,13 @@ GRAMMAR EXTEND Gram
[ c=atomic_constr -> { c }
| c=match_constr -> { c }
| "("; c = operconstr LEVEL "200"; ")" ->
- { (match c.CAst.v with
+ { (* Preserve parentheses around numerals so that constrintern does not
+ collapse -(3) into the numeral -3. *)
+ (match c.CAst.v with
| CPrim (Numeral (SPlus,n)) ->
CAst.make ~loc @@ CNotation((InConstrEntrySomeLevel,"( _ )"),([c],[],[],[]))
| _ -> c) }
- | "{|"; c = record_declaration; "|}" -> { c }
+ | "{|"; c = record_declaration; bar_cbrace -> { c }
| "{"; c = binder_constr ; "}" ->
{ CAst.make ~loc @@ CNotation((InConstrEntrySomeLevel,"{ _ }"),([c],[],[],[])) }
| "`{"; c = operconstr LEVEL "200"; "}" ->
@@ -277,16 +289,16 @@ GRAMMAR EXTEND Gram
":="; c1 = operconstr LEVEL "200"; "in";
c2 = operconstr LEVEL "200" ->
{ CAst.make ~loc @@ CLetTuple (lb,po,c1,c2) }
- | "let"; "'"; p=pattern; ":="; c1 = operconstr LEVEL "200";
+ | "let"; "'"; p = pattern LEVEL "200"; ":="; c1 = operconstr LEVEL "200";
"in"; c2 = operconstr LEVEL "200" ->
{ CAst.make ~loc @@
CCases (LetPatternStyle, None, [c1, None, None], [CAst.make ~loc ([[p]], c2)]) }
- | "let"; "'"; p=pattern; ":="; c1 = operconstr LEVEL "200";
+ | "let"; "'"; p = pattern LEVEL "200"; ":="; c1 = operconstr LEVEL "200";
rt = case_type; "in"; c2 = operconstr LEVEL "200" ->
{ CAst.make ~loc @@
CCases (LetPatternStyle, Some rt, [c1, aliasvar p, None], [CAst.make ~loc ([[p]], c2)]) }
- | "let"; "'"; p=pattern; "in"; t = pattern LEVEL "200";
+ | "let"; "'"; p = pattern LEVEL "200"; "in"; t = pattern LEVEL "200";
":="; c1 = operconstr LEVEL "200"; rt = case_type;
"in"; c2 = operconstr LEVEL "200" ->
{ CAst.make ~loc @@
@@ -324,12 +336,12 @@ GRAMMAR EXTEND Gram
| -> { None } ] ]
;
universe_level:
- [ [ "Set" -> { GSet }
+ [ [ "Set" -> { UNamed GSet }
(* no parsing SProp as a level *)
- | "Prop" -> { GProp }
- | "Type" -> { GType UUnknown }
- | "_" -> { GType UAnonymous }
- | id = global -> { GType (UNamed id) }
+ | "Prop" -> { UNamed GProp }
+ | "Type" -> { UAnonymous {rigid=true} }
+ | "_" -> { UAnonymous {rigid=false} }
+ | id = global -> { UNamed (GType id) }
] ]
;
fix_constr:
@@ -359,7 +371,7 @@ GRAMMAR EXTEND Gram
case_item:
[ [ c=operconstr LEVEL "100";
ona = OPT ["as"; id=name -> { id } ];
- ty = OPT ["in"; t=pattern -> { t } ] ->
+ ty = OPT ["in"; t = pattern LEVEL "200" -> { t } ] ->
{ (c,ona,ty) } ] ]
;
case_type:
@@ -377,14 +389,14 @@ GRAMMAR EXTEND Gram
[ [ OPT"|"; br=LIST0 eqn SEP "|" -> { br } ] ]
;
mult_pattern:
- [ [ pl = LIST1 pattern LEVEL "99" SEP "," -> { pl } ] ]
+ [ [ pl = LIST1 pattern LEVEL "200" SEP "," -> { pl } ] ]
;
eqn:
[ [ pll = LIST1 mult_pattern SEP "|";
"=>"; rhs = lconstr -> { (CAst.make ~loc (pll,rhs)) } ] ]
;
record_pattern:
- [ [ id = global; ":="; pat = pattern -> { (id, pat) } ] ]
+ [ [ id = global; ":="; pat = pattern LEVEL "200" -> { (id, pat) } ] ]
;
record_patterns:
[ [ p = record_pattern; ";"; ps = record_patterns -> { p :: ps }
@@ -396,7 +408,10 @@ GRAMMAR EXTEND Gram
pattern:
[ "200" RIGHTA [ ]
| "100" RIGHTA
- [ p = pattern; "|"; pl = LIST1 pattern SEP "|" -> { CAst.make ~loc @@ CPatOr (p::pl) } ]
+ [ p = pattern; ":"; ty = binder_constr ->
+ {CAst.make ~loc @@ CPatCast (p, ty) }
+ | p = pattern; ":"; ty = operconstr LEVEL "100" ->
+ {CAst.make ~loc @@ CPatCast (p, ty) } ]
| "99" RIGHTA [ ]
| "90" RIGHTA [ ]
| "10" LEFTA
@@ -409,21 +424,17 @@ GRAMMAR EXTEND Gram
[ c = pattern; "%"; key=IDENT -> { CAst.make ~loc @@ CPatDelimiters (key,c) } ]
| "0"
[ r = Prim.reference -> { CAst.make ~loc @@ CPatAtom (Some r) }
- | "{|"; pat = record_patterns; "|}" -> { CAst.make ~loc @@ CPatRecord pat }
+ | "{|"; pat = record_patterns; bar_cbrace -> { CAst.make ~loc @@ CPatRecord pat }
| "_" -> { CAst.make ~loc @@ CPatAtom None }
| "("; p = pattern LEVEL "200"; ")" ->
- { (match p.CAst.v with
+ { (* Preserve parentheses around numerals so that constrintern does not
+ collapse -(3) into the numeral -3. *)
+ (match p.CAst.v with
| CPatPrim (Numeral (SPlus,n)) ->
CAst.make ~loc @@ CPatNotation((InConstrEntrySomeLevel,"( _ )"),([p],[]),[])
| _ -> p) }
- | "("; p = pattern LEVEL "200"; ":"; ty = lconstr; ")" ->
- { let p =
- match p with
- | { CAst.v = CPatPrim (Numeral (SPlus,n)) } ->
- CAst.make ~loc @@ CPatNotation((InConstrEntrySomeLevel,"( _ )"),([p],[]),[])
- | _ -> p
- in
- CAst.make ~loc @@ CPatCast (p, ty) }
+ | "("; p = pattern LEVEL "200"; "|" ; pl = LIST1 pattern LEVEL "200" SEP "|"; ")" ->
+ { CAst.make ~loc @@ CPatOr (p::pl) }
| n = NUMERAL-> { CAst.make ~loc @@ CPatPrim (Numeral (SPlus,n)) }
| s = string -> { CAst.make ~loc @@ CPatPrim (String s) } ] ]
;
diff --git a/parsing/g_prim.mlg b/parsing/g_prim.mlg
index 80dd997860..c1f52c5b39 100644
--- a/parsing/g_prim.mlg
+++ b/parsing/g_prim.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -15,7 +15,7 @@ open Libnames
open Pcoq.Prim
-let prim_kw = ["{"; "}"; "["; "]"; "("; ")"; "'"]
+let prim_kw = ["{"; "}"; "["; "]"; "("; ")"; "'"; "%"; "|"]
let _ = List.iter CLexer.add_keyword prim_kw
@@ -31,13 +31,19 @@ let my_int_of_string loc s =
with Failure _ ->
CErrors.user_err ~loc (Pp.str "This number is too large.")
+let check_nospace loc expected =
+ let (bp, ep) = Loc.unloc loc in
+ if ep = bp + String.length expected then () else
+ Gramlib.Ploc.raise loc (Stream.Error ("'" ^ expected ^ "' expected"))
+
}
GRAMMAR EXTEND Gram
GLOBAL:
bigint natural integer identref name ident var preident
fullyqualid qualid reference dirpath ne_lstring
- ne_string string lstring pattern_ident pattern_identref by_notation smart_global;
+ ne_string string lstring pattern_ident pattern_identref by_notation
+ smart_global bar_cbrace;
preident:
[ [ s = IDENT -> { s } ] ]
;
@@ -123,4 +129,7 @@ GRAMMAR EXTEND Gram
bigint: (* Negative numbers are dealt with elsewhere *)
[ [ i = NUMERAL -> { check_int loc i } ] ]
;
+ bar_cbrace:
+ [ [ "|"; "}" -> { check_nospace loc "|}" } ] ]
+ ;
END
diff --git a/parsing/notation_gram.ml b/parsing/notation_gram.ml
index 6df0d6f21a..9f133ca9d4 100644
--- a/parsing/notation_gram.ml
+++ b/parsing/notation_gram.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/parsing/notgram_ops.ml b/parsing/notgram_ops.ml
index 5cc1292c92..009dafdb13 100644
--- a/parsing/notgram_ops.ml
+++ b/parsing/notgram_ops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/parsing/notgram_ops.mli b/parsing/notgram_ops.mli
index f427a607b7..c31f4505e7 100644
--- a/parsing/notgram_ops.mli
+++ b/parsing/notgram_ops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/parsing/pcoq.ml b/parsing/pcoq.ml
index 8f38e437b4..3aaba27579 100644
--- a/parsing/pcoq.ml
+++ b/parsing/pcoq.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -363,8 +363,21 @@ end
module Grammar = Register(GrammarObj)
+let warn_deprecated_intropattern =
+ let open CWarnings in
+ create ~name:"deprecated-intropattern-entry" ~category:"deprecated"
+ (fun () -> Pp.strbrk "Entry name intropattern has been renamed in order \
+ to be consistent with the documented grammar of tactics. Use \
+ \"simple_intropattern\" instead.")
+
+let check_compatibility = function
+ | Genarg.ExtraArg s when ArgT.repr s = "intropattern" -> warn_deprecated_intropattern ()
+ | _ -> ()
+
let register_grammar = Grammar.register0
-let genarg_grammar = Grammar.obj
+let genarg_grammar x =
+ check_compatibility x;
+ Grammar.obj x
let create_generic_entry (type a) u s (etyp : a raw_abstract_argument_type) : a Entry.t =
let e = new_entry u s in
@@ -411,6 +424,8 @@ module Prim =
let ne_string = Entry.create "Prim.ne_string"
let ne_lstring = Entry.create "Prim.ne_lstring"
+ let bar_cbrace = Entry.create "'|}'"
+
end
module Constr =
@@ -425,6 +440,7 @@ module Constr =
let binder_constr = gec_constr "binder_constr"
let ident = make_gen_entry uconstr "ident"
let global = make_gen_entry uconstr "global"
+ let universe_name = make_gen_entry uconstr "universe_name"
let universe_level = make_gen_entry uconstr "universe_level"
let sort = make_gen_entry uconstr "sort"
let sort_family = make_gen_entry uconstr "sort_family"
@@ -585,7 +601,7 @@ let unfreeze (grams, lex) =
(** No need to provide an init function : the grammar state is
statically available, and already empty initially, while
- the lexer state should not be resetted, since it contains
+ the lexer state should not be reset, since it contains
keywords declared in g_*.ml4 *)
let parser_summary_tag =
diff --git a/parsing/pcoq.mli b/parsing/pcoq.mli
index 3a57c14a3b..cde867d2ef 100644
--- a/parsing/pcoq.mli
+++ b/parsing/pcoq.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -38,9 +38,9 @@ end
- dynamic rules declared at the evaluation of Coq files (using
e.g. Notation, Infix, or Tactic Notation)
- - static rules explicitly defined in files g_*.ml4
+ - static rules explicitly defined in files g_*.mlg
- static rules macro-generated by ARGUMENT EXTEND, TACTIC EXTEND and
- VERNAC EXTEND (see e.g. file extratactics.ml4)
+ VERNAC EXTEND (see e.g. file extratactics.mlg)
Note that parsing a Coq document is in essence stateful: the parser
needs to recognize commands that start proofs and use a different
@@ -170,6 +170,7 @@ module Prim :
val ne_string : string Entry.t
val ne_lstring : lstring Entry.t
val var : lident Entry.t
+ val bar_cbrace : unit Entry.t
end
module Constr :
@@ -181,6 +182,7 @@ module Constr :
val operconstr : constr_expr Entry.t
val ident : Id.t Entry.t
val global : qualid Entry.t
+ val universe_name : Glob_term.glob_sort_name Entry.t
val universe_level : Glob_term.glob_level Entry.t
val sort : Glob_term.glob_sort Entry.t
val sort_family : Sorts.family Entry.t
diff --git a/parsing/ppextend.ml b/parsing/ppextend.ml
index e1f5e20117..7368f4109e 100644
--- a/parsing/ppextend.ml
+++ b/parsing/ppextend.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/parsing/ppextend.mli b/parsing/ppextend.mli
index 7eb5967a3e..be5af75e72 100644
--- a/parsing/ppextend.mli
+++ b/parsing/ppextend.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/parsing/tok.ml b/parsing/tok.ml
index 71e2d4aa80..419b5a3d7f 100644
--- a/parsing/tok.ml
+++ b/parsing/tok.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/parsing/tok.mli b/parsing/tok.mli
index a5fb5ad9cd..a6cb4f8506 100644
--- a/parsing/tok.mli
+++ b/parsing/tok.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/btauto/g_btauto.mlg b/plugins/btauto/g_btauto.mlg
index 312ef1e555..cbed6e7b96 100644
--- a/plugins/btauto/g_btauto.mlg
+++ b/plugins/btauto/g_btauto.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/btauto/refl_btauto.ml b/plugins/btauto/refl_btauto.ml
index 1bdedcaf26..615e9cd140 100644
--- a/plugins/btauto/refl_btauto.ml
+++ b/plugins/btauto/refl_btauto.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/btauto/refl_btauto.mli b/plugins/btauto/refl_btauto.mli
index 5478fddba5..c36f8c2126 100644
--- a/plugins/btauto/refl_btauto.mli
+++ b/plugins/btauto/refl_btauto.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/cc/ccalgo.ml b/plugins/cc/ccalgo.ml
index 048ec56dee..6f8fe8959c 100644
--- a/plugins/cc/ccalgo.ml
+++ b/plugins/cc/ccalgo.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/cc/ccalgo.mli b/plugins/cc/ccalgo.mli
index 5066c3931d..3dc934b426 100644
--- a/plugins/cc/ccalgo.mli
+++ b/plugins/cc/ccalgo.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/cc/ccproof.ml b/plugins/cc/ccproof.ml
index 4f46f8327a..ef012e5092 100644
--- a/plugins/cc/ccproof.ml
+++ b/plugins/cc/ccproof.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/cc/ccproof.mli b/plugins/cc/ccproof.mli
index 9ea31259c1..88c45afc2f 100644
--- a/plugins/cc/ccproof.mli
+++ b/plugins/cc/ccproof.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/cc/cctac.ml b/plugins/cc/cctac.ml
index 0e3b9fc2b6..3ed843649e 100644
--- a/plugins/cc/cctac.ml
+++ b/plugins/cc/cctac.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/cc/cctac.mli b/plugins/cc/cctac.mli
index a1bbcbc0d6..5648b45a9e 100644
--- a/plugins/cc/cctac.mli
+++ b/plugins/cc/cctac.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/cc/g_congruence.mlg b/plugins/cc/g_congruence.mlg
index 685059294f..66a5c16a90 100644
--- a/plugins/cc/g_congruence.mlg
+++ b/plugins/cc/g_congruence.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/derive/derive.ml b/plugins/derive/derive.ml
index 4769c2dc53..72ca5dc8c4 100644
--- a/plugins/derive/derive.ml
+++ b/plugins/derive/derive.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -8,25 +8,18 @@
(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
-open Constr
open Context
open Context.Named.Declaration
-let map_const_entry_body (f:constr->constr) (x:Safe_typing.private_constants Entries.const_entry_body)
- : Safe_typing.private_constants Entries.const_entry_body =
- Future.chain x begin fun ((b,ctx),fx) ->
- (f b , ctx) , fx
- end
-
(** [start_deriving f suchthat lemma] starts a proof of [suchthat]
(which can contain references to [f]) in the context extended by
[f:=?x]. When the proof ends, [f] is defined as the value of [?x]
and [lemma] as the proof. *)
-let start_deriving f suchthat lemma =
+let start_deriving f suchthat name : Lemmas.t =
let env = Global.env () in
let sigma = Evd.from_env env in
- let kind = Decl_kinds.(Global,false,DefinitionBody Definition) in
+ let kind = Decl_kinds.(Global ImportDefaultBehavior,false,DefinitionBody Definition) in
(* create a sort variable for the type of [f] *)
(* spiwack: I don't know what the rigidity flag does, picked the one
@@ -36,73 +29,18 @@ let start_deriving f suchthat lemma =
(* create the initial goals for the proof: |- Type ; |- ?1 ; f:=?2 |- suchthat *)
let goals =
let open Proofview in
- TCons ( env , sigma , f_type_type , (fun sigma f_type ->
+ TCons ( env , sigma , f_type_type , (fun sigma f_type ->
TCons ( env , sigma , f_type , (fun sigma ef ->
- let f_type = EConstr.Unsafe.to_constr f_type in
- let ef = EConstr.Unsafe.to_constr ef in
- let env' = Environ.push_named (LocalDef (annotR f, ef, f_type)) env in
- let sigma, suchthat = Constrintern.interp_type_evars ~program_mode:false env' sigma suchthat in
- TCons ( env' , sigma , suchthat , (fun sigma _ ->
- TNil sigma))))))
- in
-
- (* The terminator handles the registering of constants when the proof is closed. *)
- let terminator com =
- let open Proof_global in
- (* Extracts the relevant information from the proof. [Admitted]
- and [Save] result in user errors. [opaque] is [true] if the
- proof was concluded by [Qed], and [false] if [Defined]. [f_def]
- and [lemma_def] correspond to the proof of [f] and of
- [suchthat], respectively. *)
- let (opaque,f_def,lemma_def) =
- match com with
- | Admitted _ -> CErrors.user_err Pp.(str "Admitted isn't supported in Derive.")
- | Proved (_,Some _,_) ->
- CErrors.user_err Pp.(str "Cannot save a proof of Derive with an explicit name.")
- | Proved (opaque, None, obj) ->
- match Proof_global.(obj.entries) with
- | [_;f_def;lemma_def] ->
- opaque <> Proof_global.Transparent , f_def , lemma_def
- | _ -> assert false
- in
- (* The opacity of [f_def] is adjusted to be [false], as it
- must. Then [f] is declared in the global environment. *)
- let f_def = { f_def with Entries.const_entry_opaque = false } in
- let f_def = Entries.DefinitionEntry f_def , Decl_kinds.(IsDefinition Definition) in
- let f_kn = Declare.declare_constant f f_def in
- let f_kn_term = mkConst f_kn in
- (* In the type and body of the proof of [suchthat] there can be
- references to the variable [f]. It needs to be replaced by
- references to the constant [f] declared above. This substitution
- performs this precise action. *)
- let substf c = Vars.replace_vars [f,f_kn_term] c in
- (* Extracts the type of the proof of [suchthat]. *)
- let lemma_pretype =
- match Entries.(lemma_def.const_entry_type) with
- | Some t -> t
- | None -> assert false (* Proof_global always sets type here. *)
- in
- (* The references of [f] are subsituted appropriately. *)
- let lemma_type = substf lemma_pretype in
- (* The same is done in the body of the proof. *)
- let lemma_body =
- map_const_entry_body substf Entries.(lemma_def.const_entry_body)
- in
- let lemma_def = let open Entries in { lemma_def with
- const_entry_body = lemma_body ;
- const_entry_type = Some lemma_type ;
- const_entry_opaque = opaque ; }
- in
- let lemma_def =
- Entries.DefinitionEntry lemma_def ,
- Decl_kinds.(IsProof Proposition)
- in
- ignore (Declare.declare_constant lemma lemma_def)
- in
+ let f_type = EConstr.Unsafe.to_constr f_type in
+ let ef = EConstr.Unsafe.to_constr ef in
+ let env' = Environ.push_named (LocalDef (annotR f, ef, f_type)) env in
+ let sigma, suchthat = Constrintern.interp_type_evars ~program_mode:false env' sigma suchthat in
+ TCons ( env' , sigma , suchthat , (fun sigma _ ->
+ TNil sigma))))))
+ in
- let terminator = Proof_global.make_terminator terminator in
- let pstate = Proof_global.start_dependent_proof ~ontop:None lemma kind goals terminator in
- Proof_global.simple_with_current_proof begin fun _ p ->
- let p,_,() = Proof.run_tactic env Proofview.(tclFOCUS 1 2 shelve) p in
- p
- end pstate
+ let proof_ending = Lemmas.Proof_ending.(End_derive {f; name}) in
+ let lemma = Lemmas.start_dependent_lemma name kind goals ~proof_ending in
+ Lemmas.pf_map (Proof_global.map_proof begin fun p ->
+ Util.pi1 @@ Proof.run_tactic env Proofview.(tclFOCUS 1 2 shelve) p
+ end) lemma
diff --git a/plugins/derive/derive.mli b/plugins/derive/derive.mli
index 6bb923118e..d4c62e802e 100644
--- a/plugins/derive/derive.mli
+++ b/plugins/derive/derive.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -12,4 +12,8 @@
(which can contain references to [f]) in the context extended by
[f:=?x]. When the proof ends, [f] is defined as the value of [?x]
and [lemma] as the proof. *)
-val start_deriving : Names.Id.t -> Constrexpr.constr_expr -> Names.Id.t -> Proof_global.t
+val start_deriving
+ : Names.Id.t
+ -> Constrexpr.constr_expr
+ -> Names.Id.t
+ -> Lemmas.t
diff --git a/plugins/derive/g_derive.mlg b/plugins/derive/g_derive.mlg
index 214a9d8bb5..bfb67462a0 100644
--- a/plugins/derive/g_derive.mlg
+++ b/plugins/derive/g_derive.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -18,11 +18,11 @@ DECLARE PLUGIN "derive_plugin"
{
-let classify_derive_command _ = Vernacextend.(VtStartProof (Doesn'tGuaranteeOpacity,[]),VtLater)
+let classify_derive_command _ = Vernacextend.(VtStartProof (Doesn'tGuaranteeOpacity,[]))
}
-VERNAC COMMAND EXTEND Derive CLASSIFIED BY { classify_derive_command }
-| ![ proof ] [ "Derive" ident(f) "SuchThat" constr(suchthat) "As" ident(lemma) ] ->
- { fun ~pstate -> Some Derive.(start_deriving f suchthat lemma) }
+VERNAC COMMAND EXTEND Derive CLASSIFIED BY { classify_derive_command } STATE open_proof
+| [ "Derive" ident(f) "SuchThat" constr(suchthat) "As" ident(lemma) ] ->
+ { Derive.start_deriving f suchthat lemma }
END
diff --git a/plugins/extraction/CHANGES b/plugins/extraction/CHANGES
index 4bc3dba36e..bc7e1448f7 100644
--- a/plugins/extraction/CHANGES
+++ b/plugins/extraction/CHANGES
@@ -200,7 +200,7 @@ For the moment there are:
Wf.well_founded_induction
Wf.well_founded_induction_type
Those constants does not match the auto-inlining criterion based on strictness.
-Of course, you can still overide this behaviour via some Extraction NoInline.
+Of course, you can still override this behaviour via some Extraction NoInline.
* There is now a web page showing the extraction of all standard theories:
http://www.lri.fr/~letouzey/extraction
diff --git a/plugins/extraction/ExtrOcamlBasic.v b/plugins/extraction/ExtrOcamlBasic.v
index 36bb1148b6..2f82b24862 100644
--- a/plugins/extraction/ExtrOcamlBasic.v
+++ b/plugins/extraction/ExtrOcamlBasic.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -26,9 +26,9 @@ Extract Inductive prod => "( * )" [ "" ].
Extract Inductive sumbool => bool [ true false ].
Extract Inductive sumor => option [ Some None ].
-(** Restore lazyness of andb, orb.
+(** Restore laziness of andb, orb.
NB: without these Extract Constant, andb/orb would be inlined
- by extraction in order to have lazyness, producing inelegant
+ by extraction in order to have laziness, producing inelegant
(if ... then ... else false) and (if ... then true else ...).
*)
diff --git a/plugins/extraction/ExtrOcamlBigIntConv.v b/plugins/extraction/ExtrOcamlBigIntConv.v
index 2d832799a3..f8bc86d087 100644
--- a/plugins/extraction/ExtrOcamlBigIntConv.v
+++ b/plugins/extraction/ExtrOcamlBigIntConv.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/ExtrOcamlIntConv.v b/plugins/extraction/ExtrOcamlIntConv.v
index a3a4d45c13..2de1906323 100644
--- a/plugins/extraction/ExtrOcamlIntConv.v
+++ b/plugins/extraction/ExtrOcamlIntConv.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/ExtrOcamlNatBigInt.v b/plugins/extraction/ExtrOcamlNatBigInt.v
index c403f7c5a1..a66d6e41fd 100644
--- a/plugins/extraction/ExtrOcamlNatBigInt.v
+++ b/plugins/extraction/ExtrOcamlNatBigInt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/ExtrOcamlNatInt.v b/plugins/extraction/ExtrOcamlNatInt.v
index a2f809a0c1..406a7f0d2b 100644
--- a/plugins/extraction/ExtrOcamlNatInt.v
+++ b/plugins/extraction/ExtrOcamlNatInt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/ExtrOcamlString.v b/plugins/extraction/ExtrOcamlString.v
index f094d4860e..6265a67577 100644
--- a/plugins/extraction/ExtrOcamlString.v
+++ b/plugins/extraction/ExtrOcamlString.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/ExtrOcamlZBigInt.v b/plugins/extraction/ExtrOcamlZBigInt.v
index f7746b3e3c..c36ea50755 100644
--- a/plugins/extraction/ExtrOcamlZBigInt.v
+++ b/plugins/extraction/ExtrOcamlZBigInt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/ExtrOcamlZInt.v b/plugins/extraction/ExtrOcamlZInt.v
index f0e4b297e2..c7343d2468 100644
--- a/plugins/extraction/ExtrOcamlZInt.v
+++ b/plugins/extraction/ExtrOcamlZInt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/Extraction.v b/plugins/extraction/Extraction.v
index b79d32e650..207c95247e 100644
--- a/plugins/extraction/Extraction.v
+++ b/plugins/extraction/Extraction.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/big.ml b/plugins/extraction/big.ml
index c675eacc92..ef76154d75 100644
--- a/plugins/extraction/big.ml
+++ b/plugins/extraction/big.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/common.ml b/plugins/extraction/common.ml
index 59c57cc544..9abf212443 100644
--- a/plugins/extraction/common.ml
+++ b/plugins/extraction/common.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -573,7 +573,7 @@ let pp_ocaml_gen k mp rls olab =
if is_mp_bound base then pp_ocaml_bound base rls
else pp_ocaml_extern k base rls
-(* For Haskell, things are simplier: we have removed (almost) all structures *)
+(* For Haskell, things are simpler: we have removed (almost) all structures *)
let pp_haskell_gen k mp rls = match rls with
| [] -> assert false
@@ -590,7 +590,7 @@ let pp_global k r =
let s = List.hd ls in
let mp,l = repr_of_r r in
if ModPath.equal mp (top_visible_mp ()) then
- (* simpliest situation: definition of r (or use in the same context) *)
+ (* simplest situation: definition of r (or use in the same context) *)
(* we update the visible environment *)
(add_visible (k,s) l; unquote s)
else
@@ -607,7 +607,7 @@ let pp_module mp =
let ls = mp_renaming mp in
match mp with
| MPdot (mp0,l) when ModPath.equal mp0 (top_visible_mp ()) ->
- (* simpliest situation: definition of mp (or use in the same context) *)
+ (* simplest situation: definition of mp (or use in the same context) *)
(* we update the visible environment *)
let s = List.hd ls in
add_visible (Mod,s) l; s
diff --git a/plugins/extraction/common.mli b/plugins/extraction/common.mli
index 07237d7504..e4e9c4c527 100644
--- a/plugins/extraction/common.mli
+++ b/plugins/extraction/common.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/extract_env.ml b/plugins/extraction/extract_env.ml
index 8f17f7b2dd..31dcfdd168 100644
--- a/plugins/extraction/extract_env.ml
+++ b/plugins/extraction/extract_env.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -751,18 +751,14 @@ let extract_and_compile l =
(* Show the extraction of the current ongoing proof *)
let show_extraction ~pstate =
- let pstate = match pstate with
- | None -> CErrors.user_err Pp.(str "No ongoing proof")
- | Some pstate -> pstate
- in
init ~inner:true false false;
- let prf = Proof_global.give_me_the_proof pstate in
+ let prf = Proof_global.get_proof pstate in
let sigma, env = Pfedit.get_current_context pstate in
let trms = Proof.partial_proof prf in
let extr_term t =
let ast, ty = extract_constr env sigma t in
let mp = Lib.current_mp () in
- let l = Label.of_id (Proof_global.get_current_proof_name pstate) in
+ let l = Label.of_id (Proof_global.get_proof_name pstate) in
let fake_ref = ConstRef (Constant.make2 mp l) in
let decl = Dterm (fake_ref, ast, ty) in
print_one_decl [] mp decl
diff --git a/plugins/extraction/extract_env.mli b/plugins/extraction/extract_env.mli
index 7ba7e05019..927b10729f 100644
--- a/plugins/extraction/extract_env.mli
+++ b/plugins/extraction/extract_env.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -40,4 +40,4 @@ val structure_for_compute :
(* Show the extraction of the current ongoing proof *)
-val show_extraction : pstate:Proof_global.t option -> unit
+val show_extraction : pstate:Proof_global.t -> unit
diff --git a/plugins/extraction/extraction.ml b/plugins/extraction/extraction.ml
index 9db7c8d8d3..d0ad21a13e 100644
--- a/plugins/extraction/extraction.ml
+++ b/plugins/extraction/extraction.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -115,7 +115,7 @@ let get_body lconstr = EConstr.of_constr (Mod_subst.force_constr lconstr)
let get_opaque env c =
EConstr.of_constr
- (Opaqueproof.force_proof (Environ.opaque_tables env) c)
+ (fst (Opaqueproof.force_proof Library.indirect_accessor (Environ.opaque_tables env) c))
let applistc c args = EConstr.mkApp (c, Array.of_list args)
diff --git a/plugins/extraction/extraction.mli b/plugins/extraction/extraction.mli
index bf98f8cd70..c2919d09f5 100644
--- a/plugins/extraction/extraction.mli
+++ b/plugins/extraction/extraction.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/g_extraction.mlg b/plugins/extraction/g_extraction.mlg
index d7bb27f121..e222fbc808 100644
--- a/plugins/extraction/g_extraction.mlg
+++ b/plugins/extraction/g_extraction.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -93,7 +93,7 @@ VERNAC COMMAND EXTEND Extraction CLASSIFIED AS QUERY
END
VERNAC COMMAND EXTEND SeparateExtraction CLASSIFIED AS QUERY
-(* Same, with content splitted in several files *)
+(* Same, with content split in several files *)
| [ "Separate" "Extraction" ne_global_list(l) ]
-> { separate_extraction l }
END
@@ -177,7 +177,7 @@ VERNAC COMMAND EXTEND ExtractionInductive CLASSIFIED AS SIDEFF
END
(* Show the extraction of the current proof *)
-VERNAC COMMAND EXTEND ShowExtraction CLASSIFIED AS QUERY
-| ![ proof ] [ "Show" "Extraction" ]
- -> { fun ~pstate -> let () = show_extraction ~pstate in pstate }
+VERNAC COMMAND EXTEND ShowExtraction CLASSIFIED AS QUERY STATE proof_query
+| [ "Show" "Extraction" ]
+ -> { show_extraction }
END
diff --git a/plugins/extraction/haskell.ml b/plugins/extraction/haskell.ml
index a3cd92d556..a62fb1a728 100644
--- a/plugins/extraction/haskell.ml
+++ b/plugins/extraction/haskell.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/haskell.mli b/plugins/extraction/haskell.mli
index 27cb6b9460..26f54de7d6 100644
--- a/plugins/extraction/haskell.mli
+++ b/plugins/extraction/haskell.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/miniml.ml b/plugins/extraction/miniml.ml
index b7f80d543b..8b69edbe4c 100644
--- a/plugins/extraction/miniml.ml
+++ b/plugins/extraction/miniml.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/miniml.mli b/plugins/extraction/miniml.mli
index 9df0f4964e..e3c9635c55 100644
--- a/plugins/extraction/miniml.mli
+++ b/plugins/extraction/miniml.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/mlutil.ml b/plugins/extraction/mlutil.ml
index 2432887673..a8d766cd6e 100644
--- a/plugins/extraction/mlutil.ml
+++ b/plugins/extraction/mlutil.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/mlutil.mli b/plugins/extraction/mlutil.mli
index d23fdb3d53..2567804db6 100644
--- a/plugins/extraction/mlutil.mli
+++ b/plugins/extraction/mlutil.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/modutil.ml b/plugins/extraction/modutil.ml
index 654695c232..bded698ea7 100644
--- a/plugins/extraction/modutil.ml
+++ b/plugins/extraction/modutil.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/modutil.mli b/plugins/extraction/modutil.mli
index f45773f095..d0c90d83bb 100644
--- a/plugins/extraction/modutil.mli
+++ b/plugins/extraction/modutil.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/ocaml.ml b/plugins/extraction/ocaml.ml
index 8940aedd6d..21a8b8e5fb 100644
--- a/plugins/extraction/ocaml.ml
+++ b/plugins/extraction/ocaml.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/ocaml.mli b/plugins/extraction/ocaml.mli
index 96d123444f..e145673473 100644
--- a/plugins/extraction/ocaml.mli
+++ b/plugins/extraction/ocaml.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/scheme.ml b/plugins/extraction/scheme.ml
index 6aa3a6220e..dd840cd929 100644
--- a/plugins/extraction/scheme.ml
+++ b/plugins/extraction/scheme.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/scheme.mli b/plugins/extraction/scheme.mli
index defd81846b..25aabea1e7 100644
--- a/plugins/extraction/scheme.mli
+++ b/plugins/extraction/scheme.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/extraction/table.ml b/plugins/extraction/table.ml
index 4e229a94b6..b09a81e1c8 100644
--- a/plugins/extraction/table.ml
+++ b/plugins/extraction/table.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -101,7 +101,7 @@ let labels_of_ref r =
(*S The main tables: constants, inductives, records, ... *)
-(* Theses tables are not registered within coq save/undo mechanism
+(* These tables are not registered within coq save/undo mechanism
since we reset their contents at each run of Extraction *)
(* We use [constant_body] (resp. [mutual_inductive_body]) as checksum
@@ -842,7 +842,7 @@ let in_customs : GlobRef.t * string list * string -> obj =
~subst:(Some (fun (s,(r,ids,str)) -> (fst (subst_global s r), ids, str)))
let in_custom_matchs : GlobRef.t * string -> obj =
- declare_object @@ superglobal_object_nodischarge "ML extractions custom matchs"
+ declare_object @@ superglobal_object_nodischarge "ML extractions custom matches"
~cache:(fun (_,(r,s)) -> add_custom_match r s)
~subst:(Some (fun (subs,(r,s)) -> (fst (subst_global subs r), s)))
diff --git a/plugins/extraction/table.mli b/plugins/extraction/table.mli
index 7e53964642..93f1629c4d 100644
--- a/plugins/extraction/table.mli
+++ b/plugins/extraction/table.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/firstorder/formula.ml b/plugins/firstorder/formula.ml
index 4b7bc707d6..2d5ea9536c 100644
--- a/plugins/firstorder/formula.ml
+++ b/plugins/firstorder/formula.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/firstorder/formula.mli b/plugins/firstorder/formula.mli
index e2c6f1c4b1..dc422fa284 100644
--- a/plugins/firstorder/formula.mli
+++ b/plugins/firstorder/formula.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/firstorder/g_ground.mlg b/plugins/firstorder/g_ground.mlg
index ea86a4b514..8a5c32b8b5 100644
--- a/plugins/firstorder/g_ground.mlg
+++ b/plugins/firstorder/g_ground.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/firstorder/ground.ml b/plugins/firstorder/ground.ml
index 6a80525200..bdf339a488 100644
--- a/plugins/firstorder/ground.ml
+++ b/plugins/firstorder/ground.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/firstorder/ground.mli b/plugins/firstorder/ground.mli
index 958fc4cf18..67735fc2a3 100644
--- a/plugins/firstorder/ground.mli
+++ b/plugins/firstorder/ground.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/firstorder/instances.ml b/plugins/firstorder/instances.ml
index 1c9ab2e3bd..eff0db5bf4 100644
--- a/plugins/firstorder/instances.ml
+++ b/plugins/firstorder/instances.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/firstorder/instances.mli b/plugins/firstorder/instances.mli
index 9f9ade3aab..be31a2d7a1 100644
--- a/plugins/firstorder/instances.mli
+++ b/plugins/firstorder/instances.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/firstorder/rules.ml b/plugins/firstorder/rules.ml
index 7f06ab6777..f3a16cd13e 100644
--- a/plugins/firstorder/rules.ml
+++ b/plugins/firstorder/rules.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/firstorder/rules.mli b/plugins/firstorder/rules.mli
index 97bc992b26..62d4354953 100644
--- a/plugins/firstorder/rules.mli
+++ b/plugins/firstorder/rules.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/firstorder/sequent.ml b/plugins/firstorder/sequent.ml
index 9f2ceb2c28..e53412383c 100644
--- a/plugins/firstorder/sequent.ml
+++ b/plugins/firstorder/sequent.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/firstorder/sequent.mli b/plugins/firstorder/sequent.mli
index 709b278ec4..724e1abcc4 100644
--- a/plugins/firstorder/sequent.mli
+++ b/plugins/firstorder/sequent.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/firstorder/unify.ml b/plugins/firstorder/unify.ml
index 0c958ddee3..35b64ccb8f 100644
--- a/plugins/firstorder/unify.ml
+++ b/plugins/firstorder/unify.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/firstorder/unify.mli b/plugins/firstorder/unify.mli
index ed35500f5f..a782900e05 100644
--- a/plugins/firstorder/unify.mli
+++ b/plugins/firstorder/unify.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/funind/FunInd.v b/plugins/funind/FunInd.v
index 12458c1072..d58b169154 100644
--- a/plugins/funind/FunInd.v
+++ b/plugins/funind/FunInd.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/funind/Recdef.v b/plugins/funind/Recdef.v
index d94e62b45a..cd3d69861f 100644
--- a/plugins/funind/Recdef.v
+++ b/plugins/funind/Recdef.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/funind/functional_principles_proofs.ml b/plugins/funind/functional_principles_proofs.ml
index 287a374ab1..ce3b5a82d6 100644
--- a/plugins/funind/functional_principles_proofs.ml
+++ b/plugins/funind/functional_principles_proofs.ml
@@ -33,7 +33,7 @@ let do_observe_tac s tac g =
let e = ExplainErr.process_vernac_interp_error e in
let goal = begin try (Printer.pr_goal g) with _ -> assert false end in
msg_debug (str "observation "++ s++str " raised exception " ++
- Errors.print e ++ str " on goal " ++ goal );
+ Errors.print e ++ str " on goal " ++ goal );
raise e;;
let observe_tac_stream s tac g =
@@ -47,19 +47,19 @@ let observe_tac s tac g = observe_tac_stream (str s) tac g
let debug_queue = Stack.create ()
-let rec print_debug_queue e =
- if not (Stack.is_empty debug_queue)
+let rec print_debug_queue e =
+ if not (Stack.is_empty debug_queue)
then
begin
- let lmsg,goal = Stack.pop debug_queue in
+ let lmsg,goal = Stack.pop debug_queue in
let _ =
- match e with
- | Some e ->
- Feedback.msg_debug (hov 0 (lmsg ++ (str " raised exception " ++ CErrors.print e) ++ str " on goal" ++ fnl() ++ goal))
- | None ->
- begin
- Feedback.msg_debug (str " from " ++ lmsg ++ str " on goal" ++ fnl() ++ goal);
- end in
+ match e with
+ | Some e ->
+ Feedback.msg_debug (hov 0 (lmsg ++ (str " raised exception " ++ CErrors.print e) ++ str " on goal" ++ fnl() ++ goal))
+ | None ->
+ begin
+ Feedback.msg_debug (str " from " ++ lmsg ++ str " on goal" ++ fnl() ++ goal);
+ end in
print_debug_queue None ;
end
@@ -68,11 +68,11 @@ let observe strm =
then Feedback.msg_debug strm
else ()
-let do_observe_tac s tac g =
+let do_observe_tac s tac g =
let goal = Printer.pr_goal g in
- let lmsg = (str "observation : ") ++ s in
+ let lmsg = (str "observation : ") ++ s in
Stack.push (lmsg,goal) debug_queue;
- try
+ try
let v = tac g in
ignore(Stack.pop debug_queue);
v
@@ -88,7 +88,7 @@ let observe_tac_stream s tac g =
else tac g
let observe_tac s = observe_tac_stream (str s)
-
+
let list_chop ?(msg="") n l =
try
@@ -138,11 +138,11 @@ let is_trivial_eq sigma t =
let res = try
begin
match EConstr.kind sigma t with
- | App(f,[|_;t1;t2|]) when eq_constr sigma f (Lazy.force eq) ->
- eq_constr sigma t1 t2
- | App(f,[|t1;a1;t2;a2|]) when eq_constr sigma f (jmeq ()) ->
- eq_constr sigma t1 t2 && eq_constr sigma a1 a2
- | _ -> false
+ | App(f,[|_;t1;t2|]) when eq_constr sigma f (Lazy.force eq) ->
+ eq_constr sigma t1 t2
+ | App(f,[|t1;a1;t2;a2|]) when eq_constr sigma f (jmeq ()) ->
+ eq_constr sigma t1 t2 && eq_constr sigma a1 a2
+ | _ -> false
end
with e when CErrors.noncritical e -> false
in
@@ -157,19 +157,19 @@ let rec incompatible_constructor_terms sigma t1 t2 =
isConstruct sigma c1 && isConstruct sigma c2 &&
(
not (eq_constr sigma c1 c2) ||
- List.exists2 (incompatible_constructor_terms sigma) arg1 arg2
+ List.exists2 (incompatible_constructor_terms sigma) arg1 arg2
)
let is_incompatible_eq env sigma t =
let res =
try
match EConstr.kind sigma t with
- | App(f,[|_;t1;t2|]) when eq_constr sigma f (Lazy.force eq) ->
- incompatible_constructor_terms sigma t1 t2
- | App(f,[|u1;t1;u2;t2|]) when eq_constr sigma f (jmeq ()) ->
- (eq_constr sigma u1 u2 &&
- incompatible_constructor_terms sigma t1 t2)
- | _ -> false
+ | App(f,[|_;t1;t2|]) when eq_constr sigma f (Lazy.force eq) ->
+ incompatible_constructor_terms sigma t1 t2
+ | App(f,[|u1;t1;u2;t2|]) when eq_constr sigma f (jmeq ()) ->
+ (eq_constr sigma u1 u2 &&
+ incompatible_constructor_terms sigma t1 t2)
+ | _ -> false
with e when CErrors.noncritical e -> false
in
if res then observe (str "is_incompatible_eq " ++ pr_leconstr_env env sigma t);
@@ -182,8 +182,8 @@ let change_hyp_with_using msg hyp_id t tac : tactic =
((* observe_tac msg *) Proofview.V82.of_tactic (assert_by (Name prov_id) t (Proofview.V82.tactic (tclCOMPLETE tac))))
[tclTHENLIST
[
- (* observe_tac "change_hyp_with_using thin" *) (thin [hyp_id]);
- (* observe_tac "change_hyp_with_using rename " *) (Proofview.V82.of_tactic (rename_hyp [prov_id,hyp_id]))
+ (* observe_tac "change_hyp_with_using thin" *) (thin [hyp_id]);
+ (* observe_tac "change_hyp_with_using rename " *) (Proofview.V82.of_tactic (rename_hyp [prov_id,hyp_id]))
]] g
exception TOREMOVE
@@ -195,15 +195,15 @@ let prove_trivial_eq h_id context (constructor,type_of_term,term) =
[
tclDO nb_intros (Proofview.V82.of_tactic intro); (* introducing context *)
(fun g ->
- let context_hyps =
- fst (list_chop ~msg:"prove_trivial_eq : " nb_intros (pf_ids_of_hyps g))
- in
- let context_hyps' =
- (mkApp(constructor,[|type_of_term;term|]))::
- (List.map mkVar context_hyps)
- in
- let to_refine = applist(mkVar h_id,List.rev context_hyps') in
- refine to_refine g
+ let context_hyps =
+ fst (list_chop ~msg:"prove_trivial_eq : " nb_intros (pf_ids_of_hyps g))
+ in
+ let context_hyps' =
+ (mkApp(constructor,[|type_of_term;term|]))::
+ (List.map mkVar context_hyps)
+ in
+ let to_refine = applist(mkVar h_id,List.rev context_hyps') in
+ refine to_refine g
)
]
@@ -244,18 +244,18 @@ let change_eq env sigma hyp_id (context:rel_context) x t end_of_type =
let f_eq,args = destApp sigma t in
let constructor,t1,t2,t1_typ =
try
- if (eq_constr f_eq (Lazy.force eq))
- then
- let t1 = (args.(1),args.(0))
- and t2 = (args.(2),args.(0))
- and t1_typ = args.(0)
- in
- (Lazy.force refl_equal,t1,t2,t1_typ)
- else
- if (eq_constr f_eq (jmeq ()))
- then
- (jmeq_refl (),(args.(1),args.(0)),(args.(3),args.(2)),args.(0))
- else nochange "not an equality"
+ if (eq_constr f_eq (Lazy.force eq))
+ then
+ let t1 = (args.(1),args.(0))
+ and t2 = (args.(2),args.(0))
+ and t1_typ = args.(0)
+ in
+ (Lazy.force refl_equal,t1,t2,t1_typ)
+ else
+ if (eq_constr f_eq (jmeq ()))
+ then
+ (jmeq_refl (),(args.(1),args.(0)),(args.(3),args.(2)),args.(0))
+ else nochange "not an equality"
with e when CErrors.noncritical e -> nochange "not an equality"
in
if not ((closed0 sigma (fst t1)) && (closed0 sigma (snd t1)))then nochange "not a closed lhs";
@@ -263,60 +263,60 @@ let change_eq env sigma hyp_id (context:rel_context) x t end_of_type =
(* observe (str "compute_substitution : " ++ pr_lconstr t1 ++ str " === " ++ pr_lconstr t2); *)
if isRel sigma t2
then
- let t2 = destRel sigma t2 in
- begin
- try
- let t1' = Int.Map.find t2 sub in
- if not (eq_constr t1 t1') then nochange "twice bound variable";
- sub
- with Not_found ->
- assert (closed0 sigma t1);
- Int.Map.add t2 t1 sub
- end
+ let t2 = destRel sigma t2 in
+ begin
+ try
+ let t1' = Int.Map.find t2 sub in
+ if not (eq_constr t1 t1') then nochange "twice bound variable";
+ sub
+ with Not_found ->
+ assert (closed0 sigma t1);
+ Int.Map.add t2 t1 sub
+ end
else if isAppConstruct sigma t1 && isAppConstruct sigma t2
then
- begin
- let c1,args1 = find_rectype env sigma t1
- and c2,args2 = find_rectype env sigma t2
- in
- if not (eq_constr c1 c2) then nochange "cannot solve (diff)";
- List.fold_left2 compute_substitution sub args1 args2
- end
+ begin
+ let c1,args1 = find_rectype env sigma t1
+ and c2,args2 = find_rectype env sigma t2
+ in
+ if not (eq_constr c1 c2) then nochange "cannot solve (diff)";
+ List.fold_left2 compute_substitution sub args1 args2
+ end
else
- if (eq_constr t1 t2) then sub else nochange ~t':(make_refl_eq constructor (Reductionops.whd_all env sigma t1) t2) "cannot solve (diff)"
+ if (eq_constr t1 t2) then sub else nochange ~t':(make_refl_eq constructor (Reductionops.whd_all env sigma t1) t2) "cannot solve (diff)"
in
let sub = compute_substitution Int.Map.empty (snd t1) (snd t2) in
let sub = compute_substitution sub (fst t1) (fst t2) in
let end_of_type_with_pop = pop end_of_type in (*the equation will be removed *)
let new_end_of_type =
(* Ugly hack to prevent Map.fold order change between ocaml-3.08.3 and ocaml-3.08.4
- Can be safely replaced by the next comment for Ocaml >= 3.08.4
+ Can be safely replaced by the next comment for Ocaml >= 3.08.4
*)
let sub = Int.Map.bindings sub in
List.fold_left (fun end_of_type (i,t) -> liftn 1 i (substnl [t] (i-1) end_of_type))
- end_of_type_with_pop
- sub
+ end_of_type_with_pop
+ sub
in
let old_context_length = List.length context + 1 in
let witness_fun =
mkLetIn(make_annot Anonymous Sorts.Relevant,make_refl_eq constructor t1_typ (fst t1),t,
- mkApp(mkVar hyp_id,Array.init old_context_length (fun i -> mkRel (old_context_length - i)))
- )
+ mkApp(mkVar hyp_id,Array.init old_context_length (fun i -> mkRel (old_context_length - i)))
+ )
in
let new_type_of_hyp,ctxt_size,witness_fun =
List.fold_left_i
- (fun i (end_of_type,ctxt_size,witness_fun) decl ->
- try
- let witness = Int.Map.find i sub in
- if is_local_def decl then anomaly (Pp.str "can not redefine a rel!");
+ (fun i (end_of_type,ctxt_size,witness_fun) decl ->
+ try
+ let witness = Int.Map.find i sub in
+ if is_local_def decl then anomaly (Pp.str "can not redefine a rel!");
(pop end_of_type,ctxt_size,mkLetIn (RelDecl.get_annot decl,
witness, RelDecl.get_type decl, witness_fun))
- with Not_found ->
- (mkProd_or_LetIn decl end_of_type, ctxt_size + 1, mkLambda_or_LetIn decl witness_fun)
- )
- 1
- (new_end_of_type,0,witness_fun)
- context
+ with Not_found ->
+ (mkProd_or_LetIn decl end_of_type, ctxt_size + 1, mkLambda_or_LetIn decl witness_fun)
+ )
+ 1
+ (new_end_of_type,0,witness_fun)
+ context
in
let new_type_of_hyp =
Reductionops.nf_betaiota env sigma new_type_of_hyp in
@@ -325,31 +325,31 @@ let change_eq env sigma hyp_id (context:rel_context) x t end_of_type =
in
let prove_new_hyp : tactic =
tclTHEN
- (tclDO ctxt_size (Proofview.V82.of_tactic intro))
- (fun g ->
- let all_ids = pf_ids_of_hyps g in
- let new_ids,_ = list_chop ctxt_size all_ids in
- let to_refine = applist(witness_fun,List.rev_map mkVar new_ids) in
- let evm, _ = pf_apply Typing.type_of g to_refine in
- tclTHEN (Refiner.tclEVARS evm) (refine to_refine) g
- )
+ (tclDO ctxt_size (Proofview.V82.of_tactic intro))
+ (fun g ->
+ let all_ids = pf_ids_of_hyps g in
+ let new_ids,_ = list_chop ctxt_size all_ids in
+ let to_refine = applist(witness_fun,List.rev_map mkVar new_ids) in
+ let evm, _ = pf_apply Typing.type_of g to_refine in
+ tclTHEN (Refiner.tclEVARS evm) (refine to_refine) g
+ )
in
let simpl_eq_tac =
change_hyp_with_using "prove_pattern_simplification" hyp_id new_type_of_hyp prove_new_hyp
in
(* observe (str "In " ++ Ppconstr.pr_id hyp_id ++ *)
-(* str "removing an equation " ++ fnl ()++ *)
-(* str "old_typ_of_hyp :=" ++ *)
-(* Printer.pr_lconstr_env *)
-(* env *)
-(* (it_mkProd_or_LetIn ~init:end_of_type ((x,None,t)::context)) *)
-(* ++ fnl () ++ *)
-(* str "new_typ_of_hyp := "++ *)
-(* Printer.pr_lconstr_env env new_type_of_hyp ++ fnl () *)
-(* ++ str "old context := " ++ pr_rel_context env context ++ fnl () *)
-(* ++ str "new context := " ++ pr_rel_context env new_ctxt ++ fnl () *)
-(* ++ str "old type := " ++ pr_lconstr end_of_type ++ fnl () *)
-(* ++ str "new type := " ++ pr_lconstr new_end_of_type ++ fnl () *)
+(* str "removing an equation " ++ fnl ()++ *)
+(* str "old_typ_of_hyp :=" ++ *)
+(* Printer.pr_lconstr_env *)
+(* env *)
+(* (it_mkProd_or_LetIn ~init:end_of_type ((x,None,t)::context)) *)
+(* ++ fnl () ++ *)
+(* str "new_typ_of_hyp := "++ *)
+(* Printer.pr_lconstr_env env new_type_of_hyp ++ fnl () *)
+(* ++ str "old context := " ++ pr_rel_context env context ++ fnl () *)
+(* ++ str "new context := " ++ pr_rel_context env new_ctxt ++ fnl () *)
+(* ++ str "old type := " ++ pr_lconstr end_of_type ++ fnl () *)
+(* ++ str "new type := " ++ pr_lconstr new_end_of_type ++ fnl () *)
(* ); *)
new_ctxt,new_end_of_type,simpl_eq_tac
@@ -361,8 +361,8 @@ let is_property sigma (ptes_info:ptes_info) t_x full_type_of_hyp =
if isVar sigma pte && Array.for_all (closed0 sigma) args
then
try
- let info = Id.Map.find (destVar sigma pte) ptes_info in
- info.is_valid full_type_of_hyp
+ let info = Id.Map.find (destVar sigma pte) ptes_info in
+ info.is_valid full_type_of_hyp
with Not_found -> false
else false
else false
@@ -377,7 +377,7 @@ let h_reduce_with_zeta cl =
Proofview.V82.of_tactic (reduce
(Genredexpr.Cbv
{Redops.all_flags
- with Genredexpr.rDelta = false;
+ with Genredexpr.rDelta = false;
}) cl)
@@ -397,12 +397,12 @@ let rewrite_until_var arg_num eq_ids : tactic =
then tclIDTAC g
else
match eq_ids with
- | [] -> anomaly (Pp.str "Cannot find a way to prove recursive property.");
- | eq_id::eq_ids ->
- tclTHEN
- (tclTRY (Proofview.V82.of_tactic (Equality.rewriteRL (mkVar eq_id))))
- (do_rewrite eq_ids)
- g
+ | [] -> anomaly (Pp.str "Cannot find a way to prove recursive property.");
+ | eq_id::eq_ids ->
+ tclTHEN
+ (tclTRY (Proofview.V82.of_tactic (Equality.rewriteRL (mkVar eq_id))))
+ (do_rewrite eq_ids)
+ g
in
do_rewrite eq_ids
@@ -418,129 +418,129 @@ let clean_hyp_with_heq ptes_infos eq_hyps hyp_id env sigma =
let reduced_type_of_hyp = Reductionops.nf_betaiotazeta env sigma real_type_of_hyp in
(* length of context didn't change ? *)
let new_context,new_typ_of_hyp =
- decompose_prod_n_assum sigma (List.length context) reduced_type_of_hyp
+ decompose_prod_n_assum sigma (List.length context) reduced_type_of_hyp
in
tclTHENLIST
- [ h_reduce_with_zeta (Locusops.onHyp hyp_id);
- scan_type new_context new_typ_of_hyp ]
+ [ h_reduce_with_zeta (Locusops.onHyp hyp_id);
+ scan_type new_context new_typ_of_hyp ]
else if isProd sigma type_of_hyp
then
begin
let (x,t_x,t') = destProd sigma type_of_hyp in
- let actual_real_type_of_hyp = it_mkProd_or_LetIn t' context in
- if is_property sigma ptes_infos t_x actual_real_type_of_hyp then
- begin
- let pte,pte_args = (destApp sigma t_x) in
- let (* fix_info *) prove_rec_hyp = (Id.Map.find (destVar sigma pte) ptes_infos).proving_tac in
- let popped_t' = pop t' in
- let real_type_of_hyp = it_mkProd_or_LetIn popped_t' context in
- let prove_new_type_of_hyp =
- let context_length = List.length context in
- tclTHENLIST
- [
- tclDO context_length (Proofview.V82.of_tactic intro);
- (fun g ->
- let context_hyps_ids =
- fst (list_chop ~msg:"rec hyp : context_hyps"
- context_length (pf_ids_of_hyps g))
- in
- let rec_pte_id = pf_get_new_id rec_pte_id g in
- let to_refine =
- applist(mkVar hyp_id,
- List.rev_map mkVar (rec_pte_id::context_hyps_ids)
- )
- in
-(* observe_tac "rec hyp " *)
- (tclTHENS
- (Proofview.V82.of_tactic (assert_before (Name rec_pte_id) t_x))
- [
- (* observe_tac "prove rec hyp" *) (prove_rec_hyp eq_hyps);
-(* observe_tac "prove rec hyp" *)
- (refine to_refine)
- ])
- g
- )
- ]
- in
- tclTHENLIST
- [
-(* observe_tac "hyp rec" *)
- (change_hyp_with_using "rec_hyp_tac" hyp_id real_type_of_hyp prove_new_type_of_hyp);
- scan_type context popped_t'
- ]
- end
- else if eq_constr sigma t_x coq_False then
- begin
-(* observe (str "Removing : "++ Ppconstr.pr_id hyp_id++ *)
-(* str " since it has False in its preconds " *)
-(* ); *)
- raise TOREMOVE; (* False -> .. useless *)
- end
+ let actual_real_type_of_hyp = it_mkProd_or_LetIn t' context in
+ if is_property sigma ptes_infos t_x actual_real_type_of_hyp then
+ begin
+ let pte,pte_args = (destApp sigma t_x) in
+ let (* fix_info *) prove_rec_hyp = (Id.Map.find (destVar sigma pte) ptes_infos).proving_tac in
+ let popped_t' = pop t' in
+ let real_type_of_hyp = it_mkProd_or_LetIn popped_t' context in
+ let prove_new_type_of_hyp =
+ let context_length = List.length context in
+ tclTHENLIST
+ [
+ tclDO context_length (Proofview.V82.of_tactic intro);
+ (fun g ->
+ let context_hyps_ids =
+ fst (list_chop ~msg:"rec hyp : context_hyps"
+ context_length (pf_ids_of_hyps g))
+ in
+ let rec_pte_id = pf_get_new_id rec_pte_id g in
+ let to_refine =
+ applist(mkVar hyp_id,
+ List.rev_map mkVar (rec_pte_id::context_hyps_ids)
+ )
+ in
+(* observe_tac "rec hyp " *)
+ (tclTHENS
+ (Proofview.V82.of_tactic (assert_before (Name rec_pte_id) t_x))
+ [
+ (* observe_tac "prove rec hyp" *) (prove_rec_hyp eq_hyps);
+(* observe_tac "prove rec hyp" *)
+ (refine to_refine)
+ ])
+ g
+ )
+ ]
+ in
+ tclTHENLIST
+ [
+(* observe_tac "hyp rec" *)
+ (change_hyp_with_using "rec_hyp_tac" hyp_id real_type_of_hyp prove_new_type_of_hyp);
+ scan_type context popped_t'
+ ]
+ end
+ else if eq_constr sigma t_x coq_False then
+ begin
+(* observe (str "Removing : "++ Ppconstr.pr_id hyp_id++ *)
+(* str " since it has False in its preconds " *)
+(* ); *)
+ raise TOREMOVE; (* False -> .. useless *)
+ end
else if is_incompatible_eq env sigma t_x then raise TOREMOVE (* t_x := C1 ... = C2 ... *)
- else if eq_constr sigma t_x coq_True (* Trivial => we remove this precons *)
- then
-(* observe (str "In "++Ppconstr.pr_id hyp_id++ *)
-(* str " removing useless precond True" *)
-(* ); *)
- let popped_t' = pop t' in
- let real_type_of_hyp =
- it_mkProd_or_LetIn popped_t' context
- in
- let prove_trivial =
- let nb_intro = List.length context in
- tclTHENLIST [
- tclDO nb_intro (Proofview.V82.of_tactic intro);
- (fun g ->
- let context_hyps =
- fst (list_chop ~msg:"removing True : context_hyps "nb_intro (pf_ids_of_hyps g))
- in
- let to_refine =
- applist (mkVar hyp_id,
- List.rev (coq_I::List.map mkVar context_hyps)
- )
- in
- refine to_refine g
- )
- ]
- in
- tclTHENLIST[
- change_hyp_with_using "prove_trivial" hyp_id real_type_of_hyp
- ((* observe_tac "prove_trivial" *) prove_trivial);
- scan_type context popped_t'
- ]
- else if is_trivial_eq sigma t_x
- then (* t_x := t = t => we remove this precond *)
- let popped_t' = pop t' in
- let real_type_of_hyp =
- it_mkProd_or_LetIn popped_t' context
- in
- let hd,args = destApp sigma t_x in
- let get_args hd args =
- if eq_constr sigma hd (Lazy.force eq)
- then (Lazy.force refl_equal,args.(0),args.(1))
- else (jmeq_refl (),args.(0),args.(1))
- in
- tclTHENLIST
- [
- change_hyp_with_using
- "prove_trivial_eq"
- hyp_id
- real_type_of_hyp
- ((* observe_tac "prove_trivial_eq" *)
- (prove_trivial_eq hyp_id context (get_args hd args)));
- scan_type context popped_t'
- ]
- else
- begin
- try
- let new_context,new_t',tac = change_eq env sigma hyp_id context x t_x t' in
- tclTHEN
- tac
- (scan_type new_context new_t')
- with NoChange ->
- (* Last thing todo : push the rel in the context and continue *)
+ else if eq_constr sigma t_x coq_True (* Trivial => we remove this precons *)
+ then
+(* observe (str "In "++Ppconstr.pr_id hyp_id++ *)
+(* str " removing useless precond True" *)
+(* ); *)
+ let popped_t' = pop t' in
+ let real_type_of_hyp =
+ it_mkProd_or_LetIn popped_t' context
+ in
+ let prove_trivial =
+ let nb_intro = List.length context in
+ tclTHENLIST [
+ tclDO nb_intro (Proofview.V82.of_tactic intro);
+ (fun g ->
+ let context_hyps =
+ fst (list_chop ~msg:"removing True : context_hyps "nb_intro (pf_ids_of_hyps g))
+ in
+ let to_refine =
+ applist (mkVar hyp_id,
+ List.rev (coq_I::List.map mkVar context_hyps)
+ )
+ in
+ refine to_refine g
+ )
+ ]
+ in
+ tclTHENLIST[
+ change_hyp_with_using "prove_trivial" hyp_id real_type_of_hyp
+ ((* observe_tac "prove_trivial" *) prove_trivial);
+ scan_type context popped_t'
+ ]
+ else if is_trivial_eq sigma t_x
+ then (* t_x := t = t => we remove this precond *)
+ let popped_t' = pop t' in
+ let real_type_of_hyp =
+ it_mkProd_or_LetIn popped_t' context
+ in
+ let hd,args = destApp sigma t_x in
+ let get_args hd args =
+ if eq_constr sigma hd (Lazy.force eq)
+ then (Lazy.force refl_equal,args.(0),args.(1))
+ else (jmeq_refl (),args.(0),args.(1))
+ in
+ tclTHENLIST
+ [
+ change_hyp_with_using
+ "prove_trivial_eq"
+ hyp_id
+ real_type_of_hyp
+ ((* observe_tac "prove_trivial_eq" *)
+ (prove_trivial_eq hyp_id context (get_args hd args)));
+ scan_type context popped_t'
+ ]
+ else
+ begin
+ try
+ let new_context,new_t',tac = change_eq env sigma hyp_id context x t_x t' in
+ tclTHEN
+ tac
+ (scan_type new_context new_t')
+ with NoChange ->
+ (* Last thing todo : push the rel in the context and continue *)
scan_type (LocalAssum (x,t_x) :: context) t'
- end
+ end
end
else
tclIDTAC
@@ -558,25 +558,25 @@ let clean_goal_with_heq ptes_infos continue_tac (dyn_infos:body_info) =
in
let tac,new_hyps =
List.fold_left (
- fun (hyps_tac,new_hyps) hyp_id ->
- let hyp_tac,new_hyp =
- clean_hyp_with_heq ptes_infos dyn_infos.eq_hyps hyp_id env sigma
- in
- (tclTHEN hyp_tac hyps_tac),new_hyp@new_hyps
+ fun (hyps_tac,new_hyps) hyp_id ->
+ let hyp_tac,new_hyp =
+ clean_hyp_with_heq ptes_infos dyn_infos.eq_hyps hyp_id env sigma
+ in
+ (tclTHEN hyp_tac hyps_tac),new_hyp@new_hyps
)
- (tclIDTAC,[])
- dyn_infos.rec_hyps
+ (tclIDTAC,[])
+ dyn_infos.rec_hyps
in
let new_infos =
{ dyn_infos with
- rec_hyps = new_hyps;
- nb_rec_hyps = List.length new_hyps
+ rec_hyps = new_hyps;
+ nb_rec_hyps = List.length new_hyps
}
in
tclTHENLIST
[
- tac ;
- (* observe_tac "clean_hyp_with_heq continue" *) (continue_tac new_infos)
+ tac ;
+ (* observe_tac "clean_hyp_with_heq continue" *) (continue_tac new_infos)
]
g
@@ -587,41 +587,41 @@ let treat_new_case ptes_infos nb_prod continue_tac term dyn_infos =
let nb_first_intro = nb_prod - 1 - dyn_infos.nb_rec_hyps in
tclTHENLIST
[
- (* We first introduce the variables *)
- tclDO nb_first_intro (Proofview.V82.of_tactic (intro_avoiding (Id.Set.of_list dyn_infos.rec_hyps)));
- (* Then the equation itself *)
- Proofview.V82.of_tactic (intro_using heq_id);
- onLastHypId (fun heq_id -> tclTHENLIST [
- (* Then the new hypothesis *)
+ (* We first introduce the variables *)
+ tclDO nb_first_intro (Proofview.V82.of_tactic (intro_avoiding (Id.Set.of_list dyn_infos.rec_hyps)));
+ (* Then the equation itself *)
+ Proofview.V82.of_tactic (intro_using heq_id);
+ onLastHypId (fun heq_id -> tclTHENLIST [
+ (* Then the new hypothesis *)
tclMAP (fun id -> Proofview.V82.of_tactic (introduction id)) dyn_infos.rec_hyps;
- observe_tac "after_introduction" (fun g' ->
- (* We get infos on the equations introduced*)
- let new_term_value_eq = pf_unsafe_type_of g' (mkVar heq_id) in
- (* compute the new value of the body *)
- let new_term_value =
- match EConstr.kind (project g') new_term_value_eq with
- | App(f,[| _;_;args2 |]) -> args2
- | _ ->
- observe (str "cannot compute new term value : " ++ pr_gls g' ++ fnl () ++ str "last hyp is" ++
- pr_leconstr_env (pf_env g') (project g') new_term_value_eq
- );
- anomaly (Pp.str "cannot compute new term value.")
- in
- let fun_body =
+ observe_tac "after_introduction" (fun g' ->
+ (* We get infos on the equations introduced*)
+ let new_term_value_eq = pf_unsafe_type_of g' (mkVar heq_id) in
+ (* compute the new value of the body *)
+ let new_term_value =
+ match EConstr.kind (project g') new_term_value_eq with
+ | App(f,[| _;_;args2 |]) -> args2
+ | _ ->
+ observe (str "cannot compute new term value : " ++ pr_gls g' ++ fnl () ++ str "last hyp is" ++
+ pr_leconstr_env (pf_env g') (project g') new_term_value_eq
+ );
+ anomaly (Pp.str "cannot compute new term value.")
+ in
+ let fun_body =
mkLambda(make_annot Anonymous Sorts.Relevant,
- pf_unsafe_type_of g' term,
- Termops.replace_term (project g') term (mkRel 1) dyn_infos.info
- )
- in
- let new_body = pf_nf_betaiota g' (mkApp(fun_body,[| new_term_value |])) in
- let new_infos =
- {dyn_infos with
- info = new_body;
- eq_hyps = heq_id::dyn_infos.eq_hyps
- }
- in
- clean_goal_with_heq ptes_infos continue_tac new_infos g'
- )])
+ pf_unsafe_type_of g' term,
+ Termops.replace_term (project g') term (mkRel 1) dyn_infos.info
+ )
+ in
+ let new_body = pf_nf_betaiota g' (mkApp(fun_body,[| new_term_value |])) in
+ let new_infos =
+ {dyn_infos with
+ info = new_body;
+ eq_hyps = heq_id::dyn_infos.eq_hyps
+ }
+ in
+ clean_goal_with_heq ptes_infos continue_tac new_infos g'
+ )])
]
g
@@ -638,29 +638,29 @@ let instantiate_hyps_with_args (do_prove:Id.t list -> tactic) hyps args_id =
let instantiate_one_hyp hid =
my_orelse
( (* we instantiate the hyp if possible *)
- fun g ->
- let prov_hid = pf_get_new_id hid g in
- let c = mkApp(mkVar hid,args) in
- let evm, _ = pf_apply Typing.type_of g c in
- tclTHENLIST[
+ fun g ->
+ let prov_hid = pf_get_new_id hid g in
+ let c = mkApp(mkVar hid,args) in
+ let evm, _ = pf_apply Typing.type_of g c in
+ tclTHENLIST[
Refiner.tclEVARS evm;
- Proofview.V82.of_tactic (pose_proof (Name prov_hid) c);
- thin [hid];
- Proofview.V82.of_tactic (rename_hyp [prov_hid,hid])
- ] g
+ Proofview.V82.of_tactic (pose_proof (Name prov_hid) c);
+ thin [hid];
+ Proofview.V82.of_tactic (rename_hyp [prov_hid,hid])
+ ] g
)
( (*
- if not then we are in a mutual function block
- and this hyp is a recursive hyp on an other function.
+ if not then we are in a mutual function block
+ and this hyp is a recursive hyp on an other function.
- We are not supposed to use it while proving this
- principle so that we can trash it
+ We are not supposed to use it while proving this
+ principle so that we can trash it
- *)
- (fun g ->
-(* observe (str "Instanciation: removing hyp " ++ Ppconstr.pr_id hid); *)
- thin [hid] g
- )
+ *)
+ (fun g ->
+(* observe (str "Instantiation: removing hyp " ++ Ppconstr.pr_id hid); *)
+ thin [hid] g
+ )
)
in
if List.is_empty args_id
@@ -672,17 +672,17 @@ let instantiate_hyps_with_args (do_prove:Id.t list -> tactic) hyps args_id =
else
tclTHENLIST
[
- tclMAP (fun hyp_id -> h_reduce_with_zeta (Locusops.onHyp hyp_id)) hyps;
+ tclMAP (fun hyp_id -> h_reduce_with_zeta (Locusops.onHyp hyp_id)) hyps;
tclMAP instantiate_one_hyp hyps;
- (fun g ->
- let all_g_hyps_id =
- List.fold_right Id.Set.add (pf_ids_of_hyps g) Id.Set.empty
- in
- let remaining_hyps =
- List.filter (fun id -> Id.Set.mem id all_g_hyps_id) hyps
- in
- do_prove remaining_hyps g
- )
+ (fun g ->
+ let all_g_hyps_id =
+ List.fold_right Id.Set.add (pf_ids_of_hyps g) Id.Set.empty
+ in
+ let remaining_hyps =
+ List.filter (fun id -> Id.Set.mem id all_g_hyps_id) hyps
+ in
+ do_prove remaining_hyps g
+ )
]
let build_proof
@@ -696,152 +696,152 @@ let build_proof
let env = pf_env g in
let sigma = project g in
(* observe (str "proving on " ++ Printer.pr_lconstr_env (pf_env g) term);*)
- match EConstr.kind sigma dyn_infos.info with
- | Case(ci,ct,t,cb) ->
- let do_finalize_t dyn_info' =
- fun g ->
- let t = dyn_info'.info in
- let dyn_infos = {dyn_info' with info =
- mkCase(ci,ct,t,cb)} in
- let g_nb_prod = nb_prod (project g) (pf_concl g) in
- let type_of_term = pf_unsafe_type_of g t in
- let term_eq =
- make_refl_eq (Lazy.force refl_equal) type_of_term t
- in
- tclTHENLIST
- [
- Proofview.V82.of_tactic (generalize (term_eq::(List.map mkVar dyn_infos.rec_hyps)));
- thin dyn_infos.rec_hyps;
- Proofview.V82.of_tactic (pattern_option [Locus.AllOccurrencesBut [1],t] None);
- (fun g -> observe_tac "toto" (
- tclTHENLIST [Proofview.V82.of_tactic (Simple.case t);
- (fun g' ->
- let g'_nb_prod = nb_prod (project g') (pf_concl g') in
+ match EConstr.kind sigma dyn_infos.info with
+ | Case(ci,ct,t,cb) ->
+ let do_finalize_t dyn_info' =
+ fun g ->
+ let t = dyn_info'.info in
+ let dyn_infos = {dyn_info' with info =
+ mkCase(ci,ct,t,cb)} in
+ let g_nb_prod = nb_prod (project g) (pf_concl g) in
+ let type_of_term = pf_unsafe_type_of g t in
+ let term_eq =
+ make_refl_eq (Lazy.force refl_equal) type_of_term t
+ in
+ tclTHENLIST
+ [
+ Proofview.V82.of_tactic (generalize (term_eq::(List.map mkVar dyn_infos.rec_hyps)));
+ thin dyn_infos.rec_hyps;
+ Proofview.V82.of_tactic (pattern_option [Locus.AllOccurrencesBut [1],t] None);
+ (fun g -> observe_tac "toto" (
+ tclTHENLIST [Proofview.V82.of_tactic (Simple.case t);
+ (fun g' ->
+ let g'_nb_prod = nb_prod (project g') (pf_concl g') in
let nb_instantiate_partial = g'_nb_prod - g_nb_prod in
- observe_tac "treat_new_case"
- (treat_new_case
- ptes_infos
+ observe_tac "treat_new_case"
+ (treat_new_case
+ ptes_infos
nb_instantiate_partial
(build_proof do_finalize)
- t
- dyn_infos)
- g'
- )
-
- ]) g
- )
- ]
- g
- in
+ t
+ dyn_infos)
+ g'
+ )
+
+ ]) g
+ )
+ ]
+ g
+ in
build_proof do_finalize_t {dyn_infos with info = t} g
| Lambda(n,t,b) ->
- begin
- match EConstr.kind sigma (pf_concl g) with
- | Prod _ ->
- tclTHEN
- (Proofview.V82.of_tactic intro)
- (fun g' ->
+ begin
+ match EConstr.kind sigma (pf_concl g) with
+ | Prod _ ->
+ tclTHEN
+ (Proofview.V82.of_tactic intro)
+ (fun g' ->
let open Context.Named.Declaration in
- let id = pf_last_hyp g' |> get_id in
- let new_term =
- pf_nf_betaiota g'
- (mkApp(dyn_infos.info,[|mkVar id|]))
- in
- let new_infos = {dyn_infos with info = new_term} in
- let do_prove new_hyps =
+ let id = pf_last_hyp g' |> get_id in
+ let new_term =
+ pf_nf_betaiota g'
+ (mkApp(dyn_infos.info,[|mkVar id|]))
+ in
+ let new_infos = {dyn_infos with info = new_term} in
+ let do_prove new_hyps =
build_proof do_finalize
- {new_infos with
- rec_hyps = new_hyps;
- nb_rec_hyps = List.length new_hyps
- }
- in
-(* observe_tac "Lambda" *) (instantiate_hyps_with_args do_prove new_infos.rec_hyps [id]) g'
- (* build_proof do_finalize new_infos g' *)
- ) g
- | _ ->
- do_finalize dyn_infos g
- end
- | Cast(t,_,_) ->
+ {new_infos with
+ rec_hyps = new_hyps;
+ nb_rec_hyps = List.length new_hyps
+ }
+ in
+(* observe_tac "Lambda" *) (instantiate_hyps_with_args do_prove new_infos.rec_hyps [id]) g'
+ (* build_proof do_finalize new_infos g' *)
+ ) g
+ | _ ->
+ do_finalize dyn_infos g
+ end
+ | Cast(t,_,_) ->
build_proof do_finalize {dyn_infos with info = t} g
| Const _ | Var _ | Meta _ | Evar _ | Sort _ | Construct _ | Ind _ | Int _ ->
- do_finalize dyn_infos g
- | App(_,_) ->
- let f,args = decompose_app sigma dyn_infos.info in
- begin
- match EConstr.kind sigma f with
+ do_finalize dyn_infos g
+ | App(_,_) ->
+ let f,args = decompose_app sigma dyn_infos.info in
+ begin
+ match EConstr.kind sigma f with
| Int _ -> user_err Pp.(str "integer cannot be applied")
- | App _ -> assert false (* we have collected all the app in decompose_app *)
- | Proj _ -> assert false (*FIXME*)
- | Var _ | Construct _ | Rel _ | Evar _ | Meta _ | Ind _ | Sort _ | Prod _ ->
- let new_infos =
- { dyn_infos with
- info = (f,args)
- }
- in
+ | App _ -> assert false (* we have collected all the app in decompose_app *)
+ | Proj _ -> assert false (*FIXME*)
+ | Var _ | Construct _ | Rel _ | Evar _ | Meta _ | Ind _ | Sort _ | Prod _ ->
+ let new_infos =
+ { dyn_infos with
+ info = (f,args)
+ }
+ in
build_proof_args env sigma do_finalize new_infos g
- | Const (c,_) when not (List.mem_f Constant.equal c fnames) ->
- let new_infos =
- { dyn_infos with
- info = (f,args)
- }
- in
-(* Pp.msgnl (str "proving in " ++ pr_lconstr_env (pf_env g) dyn_infos.info); *)
+ | Const (c,_) when not (List.mem_f Constant.equal c fnames) ->
+ let new_infos =
+ { dyn_infos with
+ info = (f,args)
+ }
+ in
+(* Pp.msgnl (str "proving in " ++ pr_lconstr_env (pf_env g) dyn_infos.info); *)
build_proof_args env sigma do_finalize new_infos g
- | Const _ ->
- do_finalize dyn_infos g
- | Lambda _ ->
- let new_term =
+ | Const _ ->
+ do_finalize dyn_infos g
+ | Lambda _ ->
+ let new_term =
Reductionops.nf_beta env sigma dyn_infos.info in
build_proof do_finalize {dyn_infos with info = new_term}
- g
- | LetIn _ ->
- let new_infos =
+ g
+ | LetIn _ ->
+ let new_infos =
{ dyn_infos with info = Reductionops.nf_betaiotazeta env sigma dyn_infos.info }
- in
-
- tclTHENLIST
- [tclMAP
- (fun hyp_id ->
- h_reduce_with_zeta (Locusops.onHyp hyp_id))
- dyn_infos.rec_hyps;
- h_reduce_with_zeta Locusops.onConcl;
+ in
+
+ tclTHENLIST
+ [tclMAP
+ (fun hyp_id ->
+ h_reduce_with_zeta (Locusops.onHyp hyp_id))
+ dyn_infos.rec_hyps;
+ h_reduce_with_zeta Locusops.onConcl;
build_proof do_finalize new_infos
- ]
- g
- | Cast(b,_,_) ->
+ ]
+ g
+ | Cast(b,_,_) ->
build_proof do_finalize {dyn_infos with info = b } g
- | Case _ | Fix _ | CoFix _ ->
- let new_finalize dyn_infos =
- let new_infos =
- { dyn_infos with
- info = dyn_infos.info,args
- }
- in
+ | Case _ | Fix _ | CoFix _ ->
+ let new_finalize dyn_infos =
+ let new_infos =
+ { dyn_infos with
+ info = dyn_infos.info,args
+ }
+ in
build_proof_args env sigma do_finalize new_infos
- in
+ in
build_proof new_finalize {dyn_infos with info = f } g
- end
- | Fix _ | CoFix _ ->
- user_err Pp.(str ( "Anonymous local (co)fixpoints are not handled yet"))
+ end
+ | Fix _ | CoFix _ ->
+ user_err Pp.(str ( "Anonymous local (co)fixpoints are not handled yet"))
- | Proj _ -> user_err Pp.(str "Prod")
- | Prod _ -> do_finalize dyn_infos g
- | LetIn _ ->
- let new_infos =
- { dyn_infos with
+ | Proj _ -> user_err Pp.(str "Prod")
+ | Prod _ -> do_finalize dyn_infos g
+ | LetIn _ ->
+ let new_infos =
+ { dyn_infos with
info = Reductionops.nf_betaiotazeta env sigma dyn_infos.info
- }
- in
-
- tclTHENLIST
- [tclMAP
- (fun hyp_id -> h_reduce_with_zeta (Locusops.onHyp hyp_id))
- dyn_infos.rec_hyps;
- h_reduce_with_zeta Locusops.onConcl;
+ }
+ in
+
+ tclTHENLIST
+ [tclMAP
+ (fun hyp_id -> h_reduce_with_zeta (Locusops.onHyp hyp_id))
+ dyn_infos.rec_hyps;
+ h_reduce_with_zeta Locusops.onConcl;
build_proof do_finalize new_infos
- ] g
- | Rel _ -> anomaly (Pp.str "Free var in goal conclusion!")
+ ] g
+ | Rel _ -> anomaly (Pp.str "Free var in goal conclusion!")
and build_proof do_finalize dyn_infos g =
(* observe (str "proving with "++Printer.pr_lconstr dyn_infos.info++ str " on goal " ++ pr_gls g); *)
observe_tac_stream (str "build_proof with " ++ pr_leconstr_env (pf_env g) (project g) dyn_infos.info ) (build_proof_aux do_finalize dyn_infos) g
@@ -849,33 +849,33 @@ let build_proof
fun g ->
let (f_args',args) = dyn_infos.info in
let tac : tactic =
- fun g ->
- match args with
- | [] ->
- do_finalize {dyn_infos with info = f_args'} g
- | arg::args ->
- (* observe (str "build_proof_args with arg := "++ pr_lconstr_env (pf_env g) arg++ *)
- (* fnl () ++ *)
- (* pr_goal (Tacmach.sig_it g) *)
- (* ); *)
- let do_finalize dyn_infos =
- let new_arg = dyn_infos.info in
- (* tclTRYD *)
+ fun g ->
+ match args with
+ | [] ->
+ do_finalize {dyn_infos with info = f_args'} g
+ | arg::args ->
+ (* observe (str "build_proof_args with arg := "++ pr_lconstr_env (pf_env g) arg++ *)
+ (* fnl () ++ *)
+ (* pr_goal (Tacmach.sig_it g) *)
+ (* ); *)
+ let do_finalize dyn_infos =
+ let new_arg = dyn_infos.info in
+ (* tclTRYD *)
(build_proof_args env sigma
- do_finalize
- {dyn_infos with info = (mkApp(f_args',[|new_arg|])), args}
- )
- in
+ do_finalize
+ {dyn_infos with info = (mkApp(f_args',[|new_arg|])), args}
+ )
+ in
build_proof do_finalize
- {dyn_infos with info = arg }
- g
+ {dyn_infos with info = arg }
+ g
in
(* observe_tac "build_proof_args" *) (tac ) g
in
let do_finish_proof dyn_infos =
(* tclTRYD *) (clean_goal_with_heq
- ptes_infos
- finish_proof dyn_infos)
+ ptes_infos
+ finish_proof dyn_infos)
in
(* observe_tac "build_proof" *)
fun g ->
@@ -899,14 +899,14 @@ type static_fix_info =
let prove_rec_hyp_for_struct fix_info =
(fun eq_hyps -> tclTHEN
- (rewrite_until_var (fix_info.idx) eq_hyps)
- (fun g ->
- let _,pte_args = destApp (project g) (pf_concl g) in
- let rec_hyp_proof =
- mkApp(mkVar fix_info.name,array_get_start pte_args)
- in
- refine rec_hyp_proof g
- ))
+ (rewrite_until_var (fix_info.idx) eq_hyps)
+ (fun g ->
+ let _,pte_args = destApp (project g) (pf_concl g) in
+ let rec_hyp_proof =
+ mkApp(mkVar fix_info.name,array_get_start pte_args)
+ in
+ refine rec_hyp_proof g
+ ))
let prove_rec_hyp fix_info =
{ proving_tac = prove_rec_hyp_for_struct fix_info
@@ -926,8 +926,8 @@ let generalize_non_dep hyp g =
let hyp = get_id decl in
if Id.List.mem hyp hyps
|| List.exists (Termops.occur_var_in_decl env (project g) hyp) keep
- || Termops.occur_var env (project g) hyp hyp_typ
- || Termops.is_section_variable hyp (* should be dangerous *)
+ || Termops.occur_var env (project g) hyp hyp_typ
+ || Termops.is_section_variable hyp (* should be dangerous *)
then (clear,decl::keep)
else (hyp::clear,keep))
~init:([],[]) (pf_env g)
@@ -951,7 +951,7 @@ let generate_equation_lemma evd fnames f fun_num nb_params nb_args rec_args_num
(* observe (str "rec_args_num := " ++ str (string_of_int (rec_args_num + 1) )); *)
let f_def = Global.lookup_constant (fst (destConst evd f)) in
let eq_lhs = mkApp(f,Array.init (nb_params + nb_args) (fun i -> mkRel(nb_params + nb_args - i))) in
- let (f_body, _) = Option.get (Global.body_of_constant_body f_def) in
+ let (f_body, _, _) = Option.get (Global.body_of_constant_body Library.indirect_accessor f_def) in
let f_body = EConstr.of_constr f_body in
let params,f_body_with_params = decompose_lam_n evd nb_params f_body in
let (_,num),(_,_,bodies) = destFix evd f_body_with_params in
@@ -968,7 +968,7 @@ let generate_equation_lemma evd fnames f fun_num nb_params nb_args rec_args_num
(* observe (str "eq_rhs " ++ pr_lconstr eq_rhs); *)
let (type_ctxt,type_of_f),evd =
let evd,t = Typing.type_of ~refresh:true (Global.env ()) evd f
- in
+ in
decompose_prod_n_assum evd
(nb_params + nb_args) t,evd
in
@@ -979,30 +979,29 @@ let generate_equation_lemma evd fnames f fun_num nb_params nb_args rec_args_num
let prove_replacement =
tclTHENLIST
[
- tclDO (nb_params + rec_args_num + 1) (Proofview.V82.of_tactic intro);
- observe_tac "" (fun g ->
- let rec_id = pf_nth_hyp_id g 1 in
- tclTHENLIST
- [observe_tac "generalize_non_dep in generate_equation_lemma" (generalize_non_dep rec_id);
- observe_tac "h_case" (Proofview.V82.of_tactic (simplest_case (mkVar rec_id)));
- (Proofview.V82.of_tactic intros_reflexivity)] g
- )
+ tclDO (nb_params + rec_args_num + 1) (Proofview.V82.of_tactic intro);
+ observe_tac "" (fun g ->
+ let rec_id = pf_nth_hyp_id g 1 in
+ tclTHENLIST
+ [observe_tac "generalize_non_dep in generate_equation_lemma" (generalize_non_dep rec_id);
+ observe_tac "h_case" (Proofview.V82.of_tactic (simplest_case (mkVar rec_id)));
+ (Proofview.V82.of_tactic intros_reflexivity)] g
+ )
]
in
(* Pp.msgnl (str "lemma type (2) " ++ Printer.pr_lconstr_env (Global.env ()) evd lemma_type); *)
- let pstate = Lemmas.start_proof ~ontop:None
+ let lemma = Lemmas.start_lemma
(*i The next call to mk_equation_id is valid since we are constructing the lemma
Ensures by: obvious
i*)
(mk_equation_id f_id)
- (Decl_kinds.Global, false, (Decl_kinds.Proof Decl_kinds.Theorem))
+ Decl_kinds.(Global ImportDefaultBehavior, false, Proof Theorem)
evd
lemma_type
in
- let pstate,_ = Pfedit.by (Proofview.V82.tactic prove_replacement) pstate in
- let pstate = Lemmas.save_proof_proved ?proof:None ~pstate ~opaque:Proof_global.Transparent ~idopt:None in
- pstate, evd
-
+ let lemma,_ = Lemmas.by (Proofview.V82.tactic prove_replacement) lemma in
+ let () = Lemmas.save_lemma_proved ?proof:None ~lemma ~opaque:Proof_global.Transparent ~idopt:None in
+ evd
let do_replace (evd:Evd.evar_map ref) params rec_arg_num rev_args_id f fun_num all_funs g =
let equation_lemma =
@@ -1012,28 +1011,28 @@ let do_replace (evd:Evd.evar_map ref) params rec_arg_num rev_args_id f fun_num a
with (Not_found | Option.IsNone as e) ->
let f_id = Label.to_id (Constant.label (fst (destConst !evd f))) in
(*i The next call to mk_equation_id is valid since we will construct the lemma
- Ensures by: obvious
- i*)
+ Ensures by: obvious
+ i*)
let equation_lemma_id = (mk_equation_id f_id) in
- evd := snd @@ generate_equation_lemma !evd all_funs f fun_num (List.length params) (List.length rev_args_id) rec_arg_num;
+ evd := generate_equation_lemma !evd all_funs f fun_num (List.length params) (List.length rev_args_id) rec_arg_num;
let _ =
- match e with
- | Option.IsNone ->
- let finfos = find_Function_infos (fst (destConst !evd f)) in
- update_Function
- {finfos with
- equation_lemma = Some (match Nametab.locate (qualid_of_ident equation_lemma_id) with
- ConstRef c -> c
- | _ -> CErrors.anomaly (Pp.str "Not a constant.")
- )
- }
- | _ -> ()
+ match e with
+ | Option.IsNone ->
+ let finfos = find_Function_infos (fst (destConst !evd f)) in
+ update_Function
+ {finfos with
+ equation_lemma = Some (match Nametab.locate (qualid_of_ident equation_lemma_id) with
+ ConstRef c -> c
+ | _ -> CErrors.anomaly (Pp.str "Not a constant.")
+ )
+ }
+ | _ -> ()
in
(* let res = Constrintern.construct_reference (pf_hyps g) equation_lemma_id in *)
let evd',res =
- Evd.fresh_global
- (Global.env ()) !evd
- (Constrintern.locate_reference (qualid_of_ident equation_lemma_id))
+ Evd.fresh_global
+ (Global.env ()) !evd
+ (Constrintern.locate_reference (qualid_of_ident equation_lemma_id))
in
evd:=evd';
let sigma, _ = Typing.type_of ~refresh:true (Global.env ()) !evd res in
@@ -1044,12 +1043,12 @@ let do_replace (evd:Evd.evar_map ref) params rec_arg_num rev_args_id f fun_num a
tclTHEN
(tclDO nb_intro_to_do (Proofview.V82.of_tactic intro))
(
- fun g' ->
- let just_introduced = nLastDecls nb_intro_to_do g' in
+ fun g' ->
+ let just_introduced = nLastDecls nb_intro_to_do g' in
let open Context.Named.Declaration in
- let just_introduced_id = List.map get_id just_introduced in
- tclTHEN (Proofview.V82.of_tactic (Equality.rewriteLR equation_lemma))
- (revert just_introduced_id) g'
+ let just_introduced_id = List.map get_id just_introduced in
+ tclTHEN (Proofview.V82.of_tactic (Equality.rewriteLR equation_lemma))
+ (revert just_introduced_id) g'
)
g
@@ -1063,35 +1062,35 @@ let prove_princ_for_struct (evd:Evd.evar_map ref) interactive_proof fun_num fnam
let fresh_id =
let avoid = ref (pf_ids_of_hyps g) in
(fun na ->
- let new_id =
- match na with
- Name id -> fresh_id !avoid (Id.to_string id)
- | Anonymous -> fresh_id !avoid "H"
- in
- avoid := new_id :: !avoid;
- (Name new_id)
+ let new_id =
+ match na with
+ Name id -> fresh_id !avoid (Id.to_string id)
+ | Anonymous -> fresh_id !avoid "H"
+ in
+ avoid := new_id :: !avoid;
+ (Name new_id)
)
in
let fresh_decl = RelDecl.map_name fresh_id in
let princ_info : elim_scheme =
{ princ_info with
- params = List.map fresh_decl princ_info.params;
- predicates = List.map fresh_decl princ_info.predicates;
- branches = List.map fresh_decl princ_info.branches;
- args = List.map fresh_decl princ_info.args
+ params = List.map fresh_decl princ_info.params;
+ predicates = List.map fresh_decl princ_info.predicates;
+ branches = List.map fresh_decl princ_info.branches;
+ args = List.map fresh_decl princ_info.args
}
in
let get_body const =
- match Global.body_of_constant const with
- | Some (body, _) ->
+ match Global.body_of_constant Library.indirect_accessor const with
+ | Some (body, _, _) ->
let env = Global.env () in
let sigma = Evd.from_env env in
- Tacred.cbv_norm_flags
- (CClosure.RedFlags.mkflags [CClosure.RedFlags.fZETA])
+ Tacred.cbv_norm_flags
+ (CClosure.RedFlags.mkflags [CClosure.RedFlags.fZETA])
env
sigma
- (EConstr.of_constr body)
- | None -> user_err Pp.(str "Cannot define a principle over an axiom ")
+ (EConstr.of_constr body)
+ | None -> user_err Pp.(str "Cannot define a principle over an axiom ")
in
let fbody = get_body fnames.(fun_num) in
let f_ctxt,f_body = decompose_lam (project g) fbody in
@@ -1100,37 +1099,37 @@ let prove_princ_for_struct (evd:Evd.evar_map ref) interactive_proof fun_num fnam
let full_params,princ_params,fbody_with_full_params =
if diff_params > 0
then
- let princ_params,full_params =
- list_chop diff_params princ_info.params
- in
- (full_params, (* real params *)
- princ_params, (* the params of the principle which are not params of the function *)
+ let princ_params,full_params =
+ list_chop diff_params princ_info.params
+ in
+ (full_params, (* real params *)
+ princ_params, (* the params of the principle which are not params of the function *)
substl (* function instantiated with real params *)
- (List.map var_of_decl full_params)
- f_body
- )
+ (List.map var_of_decl full_params)
+ f_body
+ )
else
- let f_ctxt_other,f_ctxt_params =
- list_chop (- diff_params) f_ctxt in
- let f_body = compose_lam f_ctxt_other f_body in
- (princ_info.params, (* real params *)
- [],(* all params are full params *)
+ let f_ctxt_other,f_ctxt_params =
+ list_chop (- diff_params) f_ctxt in
+ let f_body = compose_lam f_ctxt_other f_body in
+ (princ_info.params, (* real params *)
+ [],(* all params are full params *)
substl (* function instantiated with real params *)
- (List.map var_of_decl princ_info.params)
- f_body
- )
+ (List.map var_of_decl princ_info.params)
+ f_body
+ )
in
observe (str "full_params := " ++
- prlist_with_sep spc (RelDecl.get_name %> Nameops.Name.get_id %> Ppconstr.pr_id)
- full_params
- );
+ prlist_with_sep spc (RelDecl.get_name %> Nameops.Name.get_id %> Ppconstr.pr_id)
+ full_params
+ );
observe (str "princ_params := " ++
- prlist_with_sep spc (RelDecl.get_name %> Nameops.Name.get_id %> Ppconstr.pr_id)
- princ_params
- );
+ prlist_with_sep spc (RelDecl.get_name %> Nameops.Name.get_id %> Ppconstr.pr_id)
+ princ_params
+ );
observe (str "fbody_with_full_params := " ++
pr_leconstr_env (Global.env ()) !evd fbody_with_full_params
- );
+ );
let all_funs_with_full_params =
Array.map (fun f -> applist(f, List.rev_map var_of_decl full_params)) all_funs
in
@@ -1138,232 +1137,232 @@ let prove_princ_for_struct (evd:Evd.evar_map ref) interactive_proof fun_num fnam
let ptes_to_fix,infos =
match EConstr.kind (project g) fbody_with_full_params with
| Fix((idxs,i),(names,typess,bodies)) ->
- let bodies_with_all_params =
- Array.map
- (fun body ->
+ let bodies_with_all_params =
+ Array.map
+ (fun body ->
Reductionops.nf_betaiota (pf_env g) (project g)
- (applist(substl (List.rev (Array.to_list all_funs_with_full_params)) body,
- List.rev_map var_of_decl princ_params))
- )
- bodies
- in
- let info_array =
- Array.mapi
- (fun i types ->
- let types = prod_applist (project g) types (List.rev_map var_of_decl princ_params) in
- { idx = idxs.(i) - fix_offset;
+ (applist(substl (List.rev (Array.to_list all_funs_with_full_params)) body,
+ List.rev_map var_of_decl princ_params))
+ )
+ bodies
+ in
+ let info_array =
+ Array.mapi
+ (fun i types ->
+ let types = prod_applist (project g) types (List.rev_map var_of_decl princ_params) in
+ { idx = idxs.(i) - fix_offset;
name = Nameops.Name.get_id (fresh_id names.(i).binder_name);
- types = types;
- offset = fix_offset;
- nb_realargs =
- List.length
- (fst (decompose_lam (project g) bodies.(i))) - fix_offset;
- body_with_param = bodies_with_all_params.(i);
- num_in_block = i
- }
- )
- typess
- in
- let pte_to_fix,rev_info =
- List.fold_left_i
- (fun i (acc_map,acc_info) decl ->
- let pte = RelDecl.get_name decl in
- let infos = info_array.(i) in
- let type_args,_ = decompose_prod (project g) infos.types in
- let nargs = List.length type_args in
- let f = applist(mkConst fnames.(i), List.rev_map var_of_decl princ_info.params) in
- let first_args = Array.init nargs (fun i -> mkRel (nargs -i)) in
- let app_f = mkApp(f,first_args) in
- let pte_args = (Array.to_list first_args)@[app_f] in
- let app_pte = applist(mkVar (Nameops.Name.get_id pte),pte_args) in
- let body_with_param,num =
- let body = get_body fnames.(i) in
- let body_with_full_params =
+ types = types;
+ offset = fix_offset;
+ nb_realargs =
+ List.length
+ (fst (decompose_lam (project g) bodies.(i))) - fix_offset;
+ body_with_param = bodies_with_all_params.(i);
+ num_in_block = i
+ }
+ )
+ typess
+ in
+ let pte_to_fix,rev_info =
+ List.fold_left_i
+ (fun i (acc_map,acc_info) decl ->
+ let pte = RelDecl.get_name decl in
+ let infos = info_array.(i) in
+ let type_args,_ = decompose_prod (project g) infos.types in
+ let nargs = List.length type_args in
+ let f = applist(mkConst fnames.(i), List.rev_map var_of_decl princ_info.params) in
+ let first_args = Array.init nargs (fun i -> mkRel (nargs -i)) in
+ let app_f = mkApp(f,first_args) in
+ let pte_args = (Array.to_list first_args)@[app_f] in
+ let app_pte = applist(mkVar (Nameops.Name.get_id pte),pte_args) in
+ let body_with_param,num =
+ let body = get_body fnames.(i) in
+ let body_with_full_params =
Reductionops.nf_betaiota (pf_env g) (project g) (
- applist(body,List.rev_map var_of_decl full_params))
- in
- match EConstr.kind (project g) body_with_full_params with
+ applist(body,List.rev_map var_of_decl full_params))
+ in
+ match EConstr.kind (project g) body_with_full_params with
| Fix((_,num),(_,_,bs)) ->
Reductionops.nf_betaiota (pf_env g) (project g)
(
- (applist
- (substl
- (List.rev
- (Array.to_list all_funs_with_full_params))
- bs.(num),
- List.rev_map var_of_decl princ_params))
- ),num
- | _ -> user_err Pp.(str "Not a mutual block")
- in
- let info =
- {infos with
- types = compose_prod type_args app_pte;
- body_with_param = body_with_param;
- num_in_block = num
- }
- in
-(* observe (str "binding " ++ Ppconstr.pr_id (Nameops.Name.get_id pte) ++ *)
-(* str " to " ++ Ppconstr.pr_id info.name); *)
- (Id.Map.add (Nameops.Name.get_id pte) info acc_map,info::acc_info)
- )
- 0
- (Id.Map.empty,[])
- (List.rev princ_info.predicates)
- in
- pte_to_fix,List.rev rev_info
- | _ ->
- Id.Map.empty,[]
+ (applist
+ (substl
+ (List.rev
+ (Array.to_list all_funs_with_full_params))
+ bs.(num),
+ List.rev_map var_of_decl princ_params))
+ ),num
+ | _ -> user_err Pp.(str "Not a mutual block")
+ in
+ let info =
+ {infos with
+ types = compose_prod type_args app_pte;
+ body_with_param = body_with_param;
+ num_in_block = num
+ }
+ in
+(* observe (str "binding " ++ Ppconstr.pr_id (Nameops.Name.get_id pte) ++ *)
+(* str " to " ++ Ppconstr.pr_id info.name); *)
+ (Id.Map.add (Nameops.Name.get_id pte) info acc_map,info::acc_info)
+ )
+ 0
+ (Id.Map.empty,[])
+ (List.rev princ_info.predicates)
+ in
+ pte_to_fix,List.rev rev_info
+ | _ ->
+ Id.Map.empty,[]
in
let mk_fixes : tactic =
let pre_info,infos = list_chop fun_num infos in
match pre_info,infos with
- | _,[] -> tclIDTAC
- | _, this_fix_info::others_infos ->
- let other_fix_infos =
- List.map
- (fun fi -> fi.name,fi.idx + 1 ,fi.types)
- (pre_info@others_infos)
- in
- if List.is_empty other_fix_infos
- then
- if this_fix_info.idx + 1 = 0
- then tclIDTAC (* Someone tries to defined a principle on a fully parametric definition declared as a fixpoint (strange but ....) *)
- else
+ | _,[] -> tclIDTAC
+ | _, this_fix_info::others_infos ->
+ let other_fix_infos =
+ List.map
+ (fun fi -> fi.name,fi.idx + 1 ,fi.types)
+ (pre_info@others_infos)
+ in
+ if List.is_empty other_fix_infos
+ then
+ if this_fix_info.idx + 1 = 0
+ then tclIDTAC (* Someone tries to defined a principle on a fully parametric definition declared as a fixpoint (strange but ....) *)
+ else
observe_tac_stream (str "h_fix " ++ int (this_fix_info.idx +1) ) (Proofview.V82.of_tactic (fix this_fix_info.name (this_fix_info.idx +1)))
- else
- Proofview.V82.of_tactic (Tactics.mutual_fix this_fix_info.name (this_fix_info.idx + 1)
- other_fix_infos 0)
+ else
+ Proofview.V82.of_tactic (Tactics.mutual_fix this_fix_info.name (this_fix_info.idx + 1)
+ other_fix_infos 0)
in
let first_tac : tactic = (* every operations until fix creations *)
tclTHENLIST
- [ observe_tac "introducing params" (Proofview.V82.of_tactic (intros_using (List.rev_map id_of_decl princ_info.params)));
- observe_tac "introducing predictes" (Proofview.V82.of_tactic (intros_using (List.rev_map id_of_decl princ_info.predicates)));
- observe_tac "introducing branches" (Proofview.V82.of_tactic (intros_using (List.rev_map id_of_decl princ_info.branches)));
- observe_tac "building fixes" mk_fixes;
- ]
+ [ observe_tac "introducing params" (Proofview.V82.of_tactic (intros_using (List.rev_map id_of_decl princ_info.params)));
+ observe_tac "introducing predictes" (Proofview.V82.of_tactic (intros_using (List.rev_map id_of_decl princ_info.predicates)));
+ observe_tac "introducing branches" (Proofview.V82.of_tactic (intros_using (List.rev_map id_of_decl princ_info.branches)));
+ observe_tac "building fixes" mk_fixes;
+ ]
in
let intros_after_fixes : tactic =
fun gl ->
- let ctxt,pte_app = (decompose_prod_assum (project gl) (pf_concl gl)) in
- let pte,pte_args = (decompose_app (project gl) pte_app) in
- try
- let pte =
+ let ctxt,pte_app = (decompose_prod_assum (project gl) (pf_concl gl)) in
+ let pte,pte_args = (decompose_app (project gl) pte_app) in
+ try
+ let pte =
try destVar (project gl) pte
with DestKO -> anomaly (Pp.str "Property is not a variable.")
in
- let fix_info = Id.Map.find pte ptes_to_fix in
- let nb_args = fix_info.nb_realargs in
- tclTHENLIST
- [
- (* observe_tac ("introducing args") *) (tclDO nb_args (Proofview.V82.of_tactic intro));
- (fun g -> (* replacement of the function by its body *)
- let args = nLastDecls nb_args g in
- let fix_body = fix_info.body_with_param in
-(* observe (str "fix_body := "++ pr_lconstr_env (pf_env gl) fix_body); *)
+ let fix_info = Id.Map.find pte ptes_to_fix in
+ let nb_args = fix_info.nb_realargs in
+ tclTHENLIST
+ [
+ (* observe_tac ("introducing args") *) (tclDO nb_args (Proofview.V82.of_tactic intro));
+ (fun g -> (* replacement of the function by its body *)
+ let args = nLastDecls nb_args g in
+ let fix_body = fix_info.body_with_param in
+(* observe (str "fix_body := "++ pr_lconstr_env (pf_env gl) fix_body); *)
let open Context.Named.Declaration in
- let args_id = List.map get_id args in
- let dyn_infos =
- {
- nb_rec_hyps = -100;
- rec_hyps = [];
- info =
+ let args_id = List.map get_id args in
+ let dyn_infos =
+ {
+ nb_rec_hyps = -100;
+ rec_hyps = [];
+ info =
Reductionops.nf_betaiota (pf_env g) (project g)
- (applist(fix_body,List.rev_map mkVar args_id));
- eq_hyps = []
- }
- in
- tclTHENLIST
- [
- observe_tac "do_replace"
- (do_replace evd
- full_params
- (fix_info.idx + List.length princ_params)
- (args_id@(List.map (RelDecl.get_name %> Nameops.Name.get_id) princ_params))
- (all_funs.(fix_info.num_in_block))
- fix_info.num_in_block
- all_funs
- );
- let do_prove =
- build_proof
- interactive_proof
- (Array.to_list fnames)
- (Id.Map.map prove_rec_hyp ptes_to_fix)
- in
- let prove_tac branches =
- let dyn_infos =
- {dyn_infos with
- rec_hyps = branches;
- nb_rec_hyps = List.length branches
- }
- in
- observe_tac "cleaning" (clean_goal_with_heq
- (Id.Map.map prove_rec_hyp ptes_to_fix)
- do_prove
- dyn_infos)
- in
-(* observe (str "branches := " ++ *)
-(* prlist_with_sep spc (fun decl -> Ppconstr.pr_id (id_of_decl decl)) princ_info.branches ++ fnl () ++ *)
-(* str "args := " ++ prlist_with_sep spc Ppconstr.pr_id args_id *)
-
-(* ); *)
+ (applist(fix_body,List.rev_map mkVar args_id));
+ eq_hyps = []
+ }
+ in
+ tclTHENLIST
+ [
+ observe_tac "do_replace"
+ (do_replace evd
+ full_params
+ (fix_info.idx + List.length princ_params)
+ (args_id@(List.map (RelDecl.get_name %> Nameops.Name.get_id) princ_params))
+ (all_funs.(fix_info.num_in_block))
+ fix_info.num_in_block
+ all_funs
+ );
+ let do_prove =
+ build_proof
+ interactive_proof
+ (Array.to_list fnames)
+ (Id.Map.map prove_rec_hyp ptes_to_fix)
+ in
+ let prove_tac branches =
+ let dyn_infos =
+ {dyn_infos with
+ rec_hyps = branches;
+ nb_rec_hyps = List.length branches
+ }
+ in
+ observe_tac "cleaning" (clean_goal_with_heq
+ (Id.Map.map prove_rec_hyp ptes_to_fix)
+ do_prove
+ dyn_infos)
+ in
+(* observe (str "branches := " ++ *)
+(* prlist_with_sep spc (fun decl -> Ppconstr.pr_id (id_of_decl decl)) princ_info.branches ++ fnl () ++ *)
+(* str "args := " ++ prlist_with_sep spc Ppconstr.pr_id args_id *)
+
+(* ); *)
(* observe_tac "instancing" *) (instantiate_hyps_with_args prove_tac
- (List.rev_map id_of_decl princ_info.branches)
- (List.rev args_id))
- ]
- g
- );
- ] gl
- with Not_found ->
- let nb_args = min (princ_info.nargs) (List.length ctxt) in
- tclTHENLIST
- [
- tclDO nb_args (Proofview.V82.of_tactic intro);
- (fun g -> (* replacement of the function by its body *)
- let args = nLastDecls nb_args g in
+ (List.rev_map id_of_decl princ_info.branches)
+ (List.rev args_id))
+ ]
+ g
+ );
+ ] gl
+ with Not_found ->
+ let nb_args = min (princ_info.nargs) (List.length ctxt) in
+ tclTHENLIST
+ [
+ tclDO nb_args (Proofview.V82.of_tactic intro);
+ (fun g -> (* replacement of the function by its body *)
+ let args = nLastDecls nb_args g in
let open Context.Named.Declaration in
- let args_id = List.map get_id args in
- let dyn_infos =
- {
- nb_rec_hyps = -100;
- rec_hyps = [];
- info =
+ let args_id = List.map get_id args in
+ let dyn_infos =
+ {
+ nb_rec_hyps = -100;
+ rec_hyps = [];
+ info =
Reductionops.nf_betaiota (pf_env g) (project g)
- (applist(fbody_with_full_params,
- (List.rev_map var_of_decl princ_params)@
- (List.rev_map mkVar args_id)
- ));
- eq_hyps = []
- }
- in
- let fname = destConst (project g) (fst (decompose_app (project g) (List.hd (List.rev pte_args)))) in
- tclTHENLIST
- [Proofview.V82.of_tactic (unfold_in_concl [(Locus.AllOccurrences, Names.EvalConstRef (fst fname))]);
- let do_prove =
- build_proof
- interactive_proof
- (Array.to_list fnames)
- (Id.Map.map prove_rec_hyp ptes_to_fix)
- in
- let prove_tac branches =
- let dyn_infos =
- {dyn_infos with
- rec_hyps = branches;
- nb_rec_hyps = List.length branches
- }
- in
- clean_goal_with_heq
- (Id.Map.map prove_rec_hyp ptes_to_fix)
- do_prove
- dyn_infos
- in
+ (applist(fbody_with_full_params,
+ (List.rev_map var_of_decl princ_params)@
+ (List.rev_map mkVar args_id)
+ ));
+ eq_hyps = []
+ }
+ in
+ let fname = destConst (project g) (fst (decompose_app (project g) (List.hd (List.rev pte_args)))) in
+ tclTHENLIST
+ [Proofview.V82.of_tactic (unfold_in_concl [(Locus.AllOccurrences, Names.EvalConstRef (fst fname))]);
+ let do_prove =
+ build_proof
+ interactive_proof
+ (Array.to_list fnames)
+ (Id.Map.map prove_rec_hyp ptes_to_fix)
+ in
+ let prove_tac branches =
+ let dyn_infos =
+ {dyn_infos with
+ rec_hyps = branches;
+ nb_rec_hyps = List.length branches
+ }
+ in
+ clean_goal_with_heq
+ (Id.Map.map prove_rec_hyp ptes_to_fix)
+ do_prove
+ dyn_infos
+ in
instantiate_hyps_with_args prove_tac
- (List.rev_map id_of_decl princ_info.branches)
- (List.rev args_id)
- ]
- g
- )
- ]
- gl
+ (List.rev_map id_of_decl princ_info.branches)
+ (List.rev args_id)
+ ]
+ g
+ )
+ ]
+ gl
in
tclTHEN
first_tac
@@ -1392,23 +1391,23 @@ let prove_with_tcc tcc_lemma_constr eqs : tactic =
match !tcc_lemma_constr with
| Undefined -> anomaly (Pp.str "No tcc proof !!")
| Value lemma ->
- fun gls ->
-(* let hid = next_ident_away_in_goal h_id (pf_ids_of_hyps gls) in *)
-(* let ids = hid::pf_ids_of_hyps gls in *)
- tclTHENLIST
- [
-(* generalize [lemma]; *)
-(* h_intro hid; *)
-(* Elim.h_decompose_and (mkVar hid); *)
- tclTRY(list_rewrite true eqs);
-(* (fun g -> *)
-(* let ids' = pf_ids_of_hyps g in *)
-(* let ids = List.filter (fun id -> not (List.mem id ids)) ids' in *)
-(* rewrite *)
-(* ) *)
- Proofview.V82.of_tactic (Eauto.gen_eauto (false,5) [] (Some []))
- ]
- gls
+ fun gls ->
+(* let hid = next_ident_away_in_goal h_id (pf_ids_of_hyps gls) in *)
+(* let ids = hid::pf_ids_of_hyps gls in *)
+ tclTHENLIST
+ [
+(* generalize [lemma]; *)
+(* h_intro hid; *)
+(* Elim.h_decompose_and (mkVar hid); *)
+ tclTRY(list_rewrite true eqs);
+(* (fun g -> *)
+(* let ids' = pf_ids_of_hyps g in *)
+(* let ids = List.filter (fun id -> not (List.mem id ids)) ids' in *)
+(* rewrite *)
+(* ) *)
+ Proofview.V82.of_tactic (Eauto.gen_eauto (false,5) [] (Some []))
+ ]
+ gls
| Not_needed -> tclIDTAC
let backtrack_eqs_until_hrec hrec eqs : tactic =
@@ -1422,10 +1421,10 @@ let backtrack_eqs_until_hrec hrec eqs : tactic =
let f = (fst (destApp (project gls) f_app)) in
let rec backtrack : tactic =
fun g ->
- let f_app = Array.last (snd (destApp (project g) (pf_concl g))) in
- match EConstr.kind (project g) f_app with
- | App(f',_) when eq_constr (project g) f' f -> tclIDTAC g
- | _ -> tclTHEN rewrite backtrack g
+ let f_app = Array.last (snd (destApp (project g) (pf_concl g))) in
+ match EConstr.kind (project g) f_app with
+ | App(f',_) when eq_constr (project g) f' f -> tclIDTAC g
+ | _ -> tclTHEN rewrite backtrack g
in
backtrack gls
@@ -1435,55 +1434,55 @@ let rec rewrite_eqs_in_eqs eqs =
| [] -> tclIDTAC
| eq::eqs ->
- tclTHEN
- (tclMAP
- (fun id gl ->
- observe_tac
- (Format.sprintf "rewrite %s in %s " (Id.to_string eq) (Id.to_string id))
- (tclTRY (Proofview.V82.of_tactic (Equality.general_rewrite_in true Locus.AllOccurrences
- true (* dep proofs also: *) true id (mkVar eq) false)))
- gl
- )
- eqs
- )
- (rewrite_eqs_in_eqs eqs)
+ tclTHEN
+ (tclMAP
+ (fun id gl ->
+ observe_tac
+ (Format.sprintf "rewrite %s in %s " (Id.to_string eq) (Id.to_string id))
+ (tclTRY (Proofview.V82.of_tactic (Equality.general_rewrite_in true Locus.AllOccurrences
+ true (* dep proofs also: *) true id (mkVar eq) false)))
+ gl
+ )
+ eqs
+ )
+ (rewrite_eqs_in_eqs eqs)
let new_prove_with_tcc is_mes acc_inv hrec tcc_hyps eqs : tactic =
fun gls ->
(tclTHENLIST
[
- backtrack_eqs_until_hrec hrec eqs;
- (* observe_tac ("new_prove_with_tcc ( applying "^(Id.to_string hrec)^" )" ) *)
- (tclTHENS (* We must have exactly ONE subgoal !*)
- (Proofview.V82.of_tactic (apply (mkVar hrec)))
- [ tclTHENLIST
- [
- (Proofview.V82.of_tactic (keep (tcc_hyps@eqs)));
- (Proofview.V82.of_tactic (apply (Lazy.force acc_inv)));
- (fun g ->
- if is_mes
- then
- Proofview.V82.of_tactic (unfold_in_concl [(Locus.AllOccurrences, evaluable_of_global_reference (delayed_force ltof_ref))]) g
- else tclIDTAC g
- );
- observe_tac "rew_and_finish"
- (tclTHENLIST
- [tclTRY(list_rewrite false (List.map (fun v -> (mkVar v,true)) eqs));
- observe_tac "rewrite_eqs_in_eqs" (rewrite_eqs_in_eqs eqs);
- (observe_tac "finishing using"
- (
- tclCOMPLETE(
- Eauto.eauto_with_bases
- (true,5)
- [(fun _ sigma -> (sigma, Lazy.force refl_equal))]
+ backtrack_eqs_until_hrec hrec eqs;
+ (* observe_tac ("new_prove_with_tcc ( applying "^(Id.to_string hrec)^" )" ) *)
+ (tclTHENS (* We must have exactly ONE subgoal !*)
+ (Proofview.V82.of_tactic (apply (mkVar hrec)))
+ [ tclTHENLIST
+ [
+ (Proofview.V82.of_tactic (keep (tcc_hyps@eqs)));
+ (Proofview.V82.of_tactic (apply (Lazy.force acc_inv)));
+ (fun g ->
+ if is_mes
+ then
+ Proofview.V82.of_tactic (unfold_in_concl [(Locus.AllOccurrences, evaluable_of_global_reference (delayed_force ltof_ref))]) g
+ else tclIDTAC g
+ );
+ observe_tac "rew_and_finish"
+ (tclTHENLIST
+ [tclTRY(list_rewrite false (List.map (fun v -> (mkVar v,true)) eqs));
+ observe_tac "rewrite_eqs_in_eqs" (rewrite_eqs_in_eqs eqs);
+ (observe_tac "finishing using"
+ (
+ tclCOMPLETE(
+ Eauto.eauto_with_bases
+ (true,5)
+ [(fun _ sigma -> (sigma, Lazy.force refl_equal))]
[Hints.Hint_db.empty TransparentState.empty false]
- )
- )
- )
- ]
- )
- ]
- ])
+ )
+ )
+ )
+ ]
+ )
+ ]
+ ])
])
gls
@@ -1503,7 +1502,7 @@ let is_valid_hypothesis sigma predicates_name =
is_pte typ ||
match EConstr.kind sigma typ with
| Prod(_,pte,typ') -> is_pte pte && is_valid_hypothesis typ'
- | _ -> false
+ | _ -> false
in
is_valid_hypothesis
@@ -1516,9 +1515,9 @@ let prove_principle_for_gen
let avoid = ref (pf_ids_of_hyps gl) in
fun na ->
let new_id =
- match na with
- | Name id -> fresh_id !avoid (Id.to_string id)
- | Anonymous -> fresh_id !avoid "H"
+ match na with
+ | Name id -> fresh_id !avoid (Id.to_string id)
+ | Anonymous -> fresh_id !avoid "H"
in
avoid := new_id :: !avoid;
Name new_id
@@ -1526,10 +1525,10 @@ let prove_principle_for_gen
let fresh_decl = map_name fresh_id in
let princ_info : elim_scheme =
{ princ_info with
- params = List.map fresh_decl princ_info.params;
- predicates = List.map fresh_decl princ_info.predicates;
- branches = List.map fresh_decl princ_info.branches;
- args = List.map fresh_decl princ_info.args
+ params = List.map fresh_decl princ_info.params;
+ predicates = List.map fresh_decl princ_info.predicates;
+ branches = List.map fresh_decl princ_info.branches;
+ args = List.map fresh_decl princ_info.args
}
in
let wf_tac =
@@ -1546,8 +1545,8 @@ let prove_principle_for_gen
(* str "princ_info.nargs := " ++ int princ_info.nargs ++ fnl () ++ *)
(* str "rec_arg_num := " ++ int rec_arg_num ++ fnl() ++ *)
-(* str "real_rec_arg_num := " ++ int real_rec_arg_num ++ fnl () ++ *)
-(* str "npost_rec_arg := " ++ int npost_rec_arg ); *)
+(* str "real_rec_arg_num := " ++ int real_rec_arg_num ++ fnl () ++ *)
+(* str "npost_rec_arg := " ++ int npost_rec_arg ); *)
let (post_rec_arg,pre_rec_arg) =
Util.List.chop npost_rec_arg princ_info.args
in
@@ -1570,18 +1569,18 @@ let prove_principle_for_gen
let fix_id = Nameops.Name.get_id (fresh_id (Name hrec_id)) in
let prove_rec_arg_acc g =
((* observe_tac "prove_rec_arg_acc" *)
- (tclCOMPLETE
- (tclTHEN
- (Proofview.V82.of_tactic (assert_by (Name wf_thm_id)
- (mkApp (delayed_force well_founded,[|input_type;relation|]))
- (Proofview.V82.tactic (fun g -> (* observe_tac "prove wf" *) (tclCOMPLETE (wf_tac is_mes)) g))))
- (
- (* observe_tac *)
-(* "apply wf_thm" *)
- Proofview.V82.of_tactic (Tactics.Simple.apply (mkApp(mkVar wf_thm_id,[|mkVar rec_arg_id|])))
- )
- )
- )
+ (tclCOMPLETE
+ (tclTHEN
+ (Proofview.V82.of_tactic (assert_by (Name wf_thm_id)
+ (mkApp (delayed_force well_founded,[|input_type;relation|]))
+ (Proofview.V82.tactic (fun g -> (* observe_tac "prove wf" *) (tclCOMPLETE (wf_tac is_mes)) g))))
+ (
+ (* observe_tac *)
+(* "apply wf_thm" *)
+ Proofview.V82.of_tactic (Tactics.Simple.apply (mkApp(mkVar wf_thm_id,[|mkVar rec_arg_id|])))
+ )
+ )
+ )
)
g
in
@@ -1606,129 +1605,121 @@ let prove_principle_for_gen
let start_tac gls =
let hyps = pf_ids_of_hyps gls in
let hid =
- next_ident_away_in_goal
- (Id.of_string "prov")
- (Id.Set.of_list hyps)
+ next_ident_away_in_goal
+ (Id.of_string "prov")
+ (Id.Set.of_list hyps)
in
tclTHENLIST
- [
- Proofview.V82.of_tactic (generalize [lemma]);
- Proofview.V82.of_tactic (Simple.intro hid);
- Proofview.V82.of_tactic (Elim.h_decompose_and (mkVar hid));
- (fun g ->
- let new_hyps = pf_ids_of_hyps g in
- tcc_list := List.rev (List.subtract Id.equal new_hyps (hid::hyps));
- if List.is_empty !tcc_list
- then
- begin
- tcc_list := [hid];
- tclIDTAC g
- end
- else thin [hid] g
- )
- ]
- gls
+ [
+ Proofview.V82.of_tactic (generalize [lemma]);
+ Proofview.V82.of_tactic (Simple.intro hid);
+ Proofview.V82.of_tactic (Elim.h_decompose_and (mkVar hid));
+ (fun g ->
+ let new_hyps = pf_ids_of_hyps g in
+ tcc_list := List.rev (List.subtract Id.equal new_hyps (hid::hyps));
+ if List.is_empty !tcc_list
+ then
+ begin
+ tcc_list := [hid];
+ tclIDTAC g
+ end
+ else thin [hid] g
+ )
+ ]
+ gls
in
tclTHENLIST
[
observe_tac "start_tac" start_tac;
h_intros
- (List.rev_map (get_name %> Nameops.Name.get_id)
- (princ_info.args@princ_info.branches@princ_info.predicates@princ_info.params)
- );
+ (List.rev_map (get_name %> Nameops.Name.get_id)
+ (princ_info.args@princ_info.branches@princ_info.predicates@princ_info.params)
+ );
(* observe_tac "" *) Proofview.V82.of_tactic (assert_by
- (Name acc_rec_arg_id)
- (mkApp (delayed_force acc_rel,[|input_type;relation;mkVar rec_arg_id|]))
- (Proofview.V82.tactic prove_rec_arg_acc)
+ (Name acc_rec_arg_id)
+ (mkApp (delayed_force acc_rel,[|input_type;relation;mkVar rec_arg_id|]))
+ (Proofview.V82.tactic prove_rec_arg_acc)
);
(* observe_tac "reverting" *) (revert (List.rev (acc_rec_arg_id::args_ids)));
(* (fun g -> observe (Printer.pr_goal (sig_it g) ++ fnl () ++ *)
-(* str "fix arg num" ++ int (List.length args_ids + 1) ); tclIDTAC g); *)
+(* str "fix arg num" ++ int (List.length args_ids + 1) ); tclIDTAC g); *)
(* observe_tac "h_fix " *) (Proofview.V82.of_tactic (fix fix_id (List.length args_ids + 1)));
(* (fun g -> observe (Printer.pr_goal (sig_it g) ++ fnl() ++ pr_lconstr_env (pf_env g ) (pf_unsafe_type_of g (mkVar fix_id) )); tclIDTAC g); *)
h_intros (List.rev (acc_rec_arg_id::args_ids));
Proofview.V82.of_tactic (Equality.rewriteLR (mkConst eq_ref));
(* observe_tac "finish" *) (fun gl' ->
- let body =
- let _,args = destApp (project gl') (pf_concl gl') in
- Array.last args
- in
- let body_info rec_hyps =
- {
- nb_rec_hyps = List.length rec_hyps;
- rec_hyps = rec_hyps;
- eq_hyps = [];
- info = body
- }
- in
- let acc_inv =
- lazy (
- mkApp (
- delayed_force acc_inv_id,
- [|input_type;relation;mkVar rec_arg_id|]
- )
- )
- in
- let acc_inv = lazy (mkApp(Lazy.force acc_inv, [|mkVar acc_rec_arg_id|])) in
- let predicates_names =
- List.map (get_name %> Nameops.Name.get_id) princ_info.predicates
- in
- let pte_info =
- { proving_tac =
- (fun eqs ->
-(* msgnl (str "tcc_list := "++ prlist_with_sep spc Ppconstr.pr_id !tcc_list); *)
-(* msgnl (str "princ_info.args := "++ prlist_with_sep spc Ppconstr.pr_id (List.map (fun (na,_,_) -> (Nameops.Name.get_id na)) princ_info.args)); *)
-(* msgnl (str "princ_info.params := "++ prlist_with_sep spc Ppconstr.pr_id (List.map (fun (na,_,_) -> (Nameops.Name.get_id na)) princ_info.params)); *)
-(* msgnl (str "acc_rec_arg_id := "++ Ppconstr.pr_id acc_rec_arg_id); *)
-(* msgnl (str "eqs := "++ prlist_with_sep spc Ppconstr.pr_id eqs); *)
-
- (* observe_tac "new_prove_with_tcc" *)
- (new_prove_with_tcc
- is_mes acc_inv fix_id
-
- (!tcc_list@(List.map
- (get_name %> Nameops.Name.get_id)
- (princ_info.args@princ_info.params)
- )@ ([acc_rec_arg_id])) eqs
- )
-
- );
- is_valid = is_valid_hypothesis (project gl') predicates_names
- }
- in
- let ptes_info : pte_info Id.Map.t =
- List.fold_left
- (fun map pte_id ->
- Id.Map.add pte_id
- pte_info
- map
- )
- Id.Map.empty
- predicates_names
- in
- let make_proof rec_hyps =
- build_proof
- false
- [f_ref]
- ptes_info
- (body_info rec_hyps)
- in
+ let body =
+ let _,args = destApp (project gl') (pf_concl gl') in
+ Array.last args
+ in
+ let body_info rec_hyps =
+ {
+ nb_rec_hyps = List.length rec_hyps;
+ rec_hyps = rec_hyps;
+ eq_hyps = [];
+ info = body
+ }
+ in
+ let acc_inv =
+ lazy (
+ mkApp (
+ delayed_force acc_inv_id,
+ [|input_type;relation;mkVar rec_arg_id|]
+ )
+ )
+ in
+ let acc_inv = lazy (mkApp(Lazy.force acc_inv, [|mkVar acc_rec_arg_id|])) in
+ let predicates_names =
+ List.map (get_name %> Nameops.Name.get_id) princ_info.predicates
+ in
+ let pte_info =
+ { proving_tac =
+ (fun eqs ->
+(* msgnl (str "tcc_list := "++ prlist_with_sep spc Ppconstr.pr_id !tcc_list); *)
+(* msgnl (str "princ_info.args := "++ prlist_with_sep spc Ppconstr.pr_id (List.map (fun (na,_,_) -> (Nameops.Name.get_id na)) princ_info.args)); *)
+(* msgnl (str "princ_info.params := "++ prlist_with_sep spc Ppconstr.pr_id (List.map (fun (na,_,_) -> (Nameops.Name.get_id na)) princ_info.params)); *)
+(* msgnl (str "acc_rec_arg_id := "++ Ppconstr.pr_id acc_rec_arg_id); *)
+(* msgnl (str "eqs := "++ prlist_with_sep spc Ppconstr.pr_id eqs); *)
+
+ (* observe_tac "new_prove_with_tcc" *)
+ (new_prove_with_tcc
+ is_mes acc_inv fix_id
+
+ (!tcc_list@(List.map
+ (get_name %> Nameops.Name.get_id)
+ (princ_info.args@princ_info.params)
+ )@ ([acc_rec_arg_id])) eqs
+ )
+
+ );
+ is_valid = is_valid_hypothesis (project gl') predicates_names
+ }
+ in
+ let ptes_info : pte_info Id.Map.t =
+ List.fold_left
+ (fun map pte_id ->
+ Id.Map.add pte_id
+ pte_info
+ map
+ )
+ Id.Map.empty
+ predicates_names
+ in
+ let make_proof rec_hyps =
+ build_proof
+ false
+ [f_ref]
+ ptes_info
+ (body_info rec_hyps)
+ in
(* observe_tac "instantiate_hyps_with_args" *)
(instantiate_hyps_with_args
- make_proof
- (List.map (get_name %> Nameops.Name.get_id) princ_info.branches)
- (List.rev args_ids)
- )
- gl'
+ make_proof
+ (List.map (get_name %> Nameops.Name.get_id) princ_info.branches)
+ (List.rev args_ids)
+ )
+ gl'
)
]
gl
-
-
-
-
-
-
-
-
diff --git a/plugins/funind/functional_principles_types.ml b/plugins/funind/functional_principles_types.ml
index e9a2c285d0..d49d657d38 100644
--- a/plugins/funind/functional_principles_types.ml
+++ b/plugins/funind/functional_principles_types.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -19,7 +19,6 @@ open Vars
open Namegen
open Names
open Pp
-open Entries
open Tactics
open Context.Rel.Declaration
open Indfun_common
@@ -51,16 +50,16 @@ let compute_new_princ_type_from_rel rel_to_fun sorts princ_type =
| [] -> []
| decl :: predicates ->
(match Context.Rel.Declaration.get_name decl with
- | Name x ->
- let id = Namegen.next_ident_away x (Id.Set.of_list avoid) in
- Hashtbl.add tbl id x;
- RelDecl.set_name (Name id) decl :: change_predicates_names (id::avoid) predicates
- | Anonymous -> anomaly (Pp.str "Anonymous property binder."))
+ | Name x ->
+ let id = Namegen.next_ident_away x (Id.Set.of_list avoid) in
+ Hashtbl.add tbl id x;
+ RelDecl.set_name (Name id) decl :: change_predicates_names (id::avoid) predicates
+ | Anonymous -> anomaly (Pp.str "Anonymous property binder."))
in
let avoid = (Termops.ids_of_context env_with_params ) in
let princ_type_info =
{ princ_type_info with
- predicates = change_predicates_names avoid princ_type_info.predicates
+ predicates = change_predicates_names avoid princ_type_info.predicates
}
in
(* observe (str "starting princ_type := " ++ pr_lconstr_env env princ_type); *)
@@ -85,28 +84,28 @@ let compute_new_princ_type_from_rel rel_to_fun sorts princ_type =
let env_with_params_and_predicates = List.fold_right Environ.push_named new_predicates env_with_params in
let rel_as_kn =
fst (match princ_type_info.indref with
- | Some (Globnames.IndRef ind) -> ind
- | _ -> user_err Pp.(str "Not a valid predicate")
- )
+ | Some (Globnames.IndRef ind) -> ind
+ | _ -> user_err Pp.(str "Not a valid predicate")
+ )
in
let ptes_vars = List.map Context.Named.Declaration.get_id new_predicates in
let is_pte =
let set = List.fold_right Id.Set.add ptes_vars Id.Set.empty in
fun t ->
match Constr.kind t with
- | Var id -> Id.Set.mem id set
- | _ -> false
+ | Var id -> Id.Set.mem id set
+ | _ -> false
in
let pre_princ =
let open EConstr in
it_mkProd_or_LetIn
(it_mkProd_or_LetIn
- (Option.fold_right
- mkProd_or_LetIn
- princ_type_info.indarg
- princ_type_info.concl
- )
- princ_type_info.args
+ (Option.fold_right
+ mkProd_or_LetIn
+ princ_type_info.indarg
+ princ_type_info.concl
+ )
+ princ_type_info.args
)
princ_type_info.branches
in
@@ -135,105 +134,105 @@ let compute_new_princ_type_from_rel rel_to_fun sorts princ_type =
let rec compute_new_princ_type remove env pre_princ : types*(constr list) =
let (new_princ_type,_) as res =
match Constr.kind pre_princ with
- | Rel n ->
- begin
- try match Environ.lookup_rel n env with
+ | Rel n ->
+ begin
+ try match Environ.lookup_rel n env with
| LocalAssum (_,t) | LocalDef (_,_,t) when is_dom t -> raise Toberemoved
- | _ -> pre_princ,[]
- with Not_found -> assert false
- end
+ | _ -> pre_princ,[]
+ with Not_found -> assert false
+ end
| Prod(x,t,b) ->
compute_new_princ_type_for_binder remove mkProd env x t b
| Lambda(x,t,b) ->
compute_new_princ_type_for_binder remove mkLambda env x t b
- | Ind _ | Construct _ when is_dom pre_princ -> raise Toberemoved
- | App(f,args) when is_dom f ->
- let var_to_be_removed = destRel (Array.last args) in
- let num = get_fun_num f in
- raise (Toberemoved_with_rel (var_to_be_removed,mk_replacement pre_princ num args))
- | App(f,args) ->
- let args =
- if is_pte f && remove
- then array_get_start args
- else args
- in
- let new_args,binders_to_remove =
- Array.fold_right (compute_new_princ_type_with_acc remove env)
- args
- ([],[])
- in
- let new_f,binders_to_remove_from_f = compute_new_princ_type remove env f in
- applistc new_f new_args,
- list_union_eq Constr.equal binders_to_remove_from_f binders_to_remove
+ | Ind _ | Construct _ when is_dom pre_princ -> raise Toberemoved
+ | App(f,args) when is_dom f ->
+ let var_to_be_removed = destRel (Array.last args) in
+ let num = get_fun_num f in
+ raise (Toberemoved_with_rel (var_to_be_removed,mk_replacement pre_princ num args))
+ | App(f,args) ->
+ let args =
+ if is_pte f && remove
+ then array_get_start args
+ else args
+ in
+ let new_args,binders_to_remove =
+ Array.fold_right (compute_new_princ_type_with_acc remove env)
+ args
+ ([],[])
+ in
+ let new_f,binders_to_remove_from_f = compute_new_princ_type remove env f in
+ applistc new_f new_args,
+ list_union_eq Constr.equal binders_to_remove_from_f binders_to_remove
| LetIn(x,v,t,b) ->
compute_new_princ_type_for_letin remove env x v t b
- | _ -> pre_princ,[]
+ | _ -> pre_princ,[]
in
(* let _ = match Constr.kind pre_princ with *)
-(* | Prod _ -> *)
-(* observe(str "compute_new_princ_type for "++ *)
-(* pr_lconstr_env env pre_princ ++ *)
-(* str" is "++ *)
-(* pr_lconstr_env env new_princ_type ++ fnl ()) *)
-(* | _ -> () in *)
+(* | Prod _ -> *)
+(* observe(str "compute_new_princ_type for "++ *)
+(* pr_lconstr_env env pre_princ ++ *)
+(* str" is "++ *)
+(* pr_lconstr_env env new_princ_type ++ fnl ()) *)
+(* | _ -> () in *)
res
and compute_new_princ_type_for_binder remove bind_fun env x t b =
begin
try
- let new_t,binders_to_remove_from_t = compute_new_princ_type remove env t in
+ let new_t,binders_to_remove_from_t = compute_new_princ_type remove env t in
let new_x = map_annot (get_name (Termops.ids_of_context env)) x in
let new_env = Environ.push_rel (LocalAssum (x,t)) env in
- let new_b,binders_to_remove_from_b = compute_new_princ_type remove new_env b in
- if List.exists (Constr.equal (mkRel 1)) binders_to_remove_from_b
- then (pop new_b), filter_map (Constr.equal (mkRel 1)) pop binders_to_remove_from_b
- else
- (
+ let new_b,binders_to_remove_from_b = compute_new_princ_type remove new_env b in
+ if List.exists (Constr.equal (mkRel 1)) binders_to_remove_from_b
+ then (pop new_b), filter_map (Constr.equal (mkRel 1)) pop binders_to_remove_from_b
+ else
+ (
bind_fun(new_x,new_t,new_b),
- list_union_eq
- Constr.equal
- binders_to_remove_from_t
- (List.map pop binders_to_remove_from_b)
- )
+ list_union_eq
+ Constr.equal
+ binders_to_remove_from_t
+ (List.map pop binders_to_remove_from_b)
+ )
with
- | Toberemoved ->
-(* observe (str "Decl of "++Ppconstr.Name.print x ++ str " is removed "); *)
- let new_b,binders_to_remove_from_b = compute_new_princ_type remove env (substnl [dummy_var] 1 b) in
- new_b, List.map pop binders_to_remove_from_b
- | Toberemoved_with_rel (n,c) ->
-(* observe (str "Decl of "++Ppconstr.Name.print x ++ str " is removed "); *)
- let new_b,binders_to_remove_from_b = compute_new_princ_type remove env (substnl [c] n b) in
- new_b, list_add_set_eq Constr.equal (mkRel n) (List.map pop binders_to_remove_from_b)
+ | Toberemoved ->
+(* observe (str "Decl of "++Ppconstr.Name.print x ++ str " is removed "); *)
+ let new_b,binders_to_remove_from_b = compute_new_princ_type remove env (substnl [dummy_var] 1 b) in
+ new_b, List.map pop binders_to_remove_from_b
+ | Toberemoved_with_rel (n,c) ->
+(* observe (str "Decl of "++Ppconstr.Name.print x ++ str " is removed "); *)
+ let new_b,binders_to_remove_from_b = compute_new_princ_type remove env (substnl [c] n b) in
+ new_b, list_add_set_eq Constr.equal (mkRel n) (List.map pop binders_to_remove_from_b)
end
and compute_new_princ_type_for_letin remove env x v t b =
begin
try
- let new_t,binders_to_remove_from_t = compute_new_princ_type remove env t in
- let new_v,binders_to_remove_from_v = compute_new_princ_type remove env v in
+ let new_t,binders_to_remove_from_t = compute_new_princ_type remove env t in
+ let new_v,binders_to_remove_from_v = compute_new_princ_type remove env v in
let new_x = map_annot (get_name (Termops.ids_of_context env)) x in
let new_env = Environ.push_rel (LocalDef (x,v,t)) env in
- let new_b,binders_to_remove_from_b = compute_new_princ_type remove new_env b in
- if List.exists (Constr.equal (mkRel 1)) binders_to_remove_from_b
- then (pop new_b),filter_map (Constr.equal (mkRel 1)) pop binders_to_remove_from_b
- else
- (
+ let new_b,binders_to_remove_from_b = compute_new_princ_type remove new_env b in
+ if List.exists (Constr.equal (mkRel 1)) binders_to_remove_from_b
+ then (pop new_b),filter_map (Constr.equal (mkRel 1)) pop binders_to_remove_from_b
+ else
+ (
mkLetIn(new_x,new_v,new_t,new_b),
- list_union_eq
- Constr.equal
- (list_union_eq Constr.equal binders_to_remove_from_t binders_to_remove_from_v)
- (List.map pop binders_to_remove_from_b)
- )
+ list_union_eq
+ Constr.equal
+ (list_union_eq Constr.equal binders_to_remove_from_t binders_to_remove_from_v)
+ (List.map pop binders_to_remove_from_b)
+ )
with
- | Toberemoved ->
-(* observe (str "Decl of "++Ppconstr.Name.print x ++ str " is removed "); *)
- let new_b,binders_to_remove_from_b = compute_new_princ_type remove env (substnl [dummy_var] 1 b) in
- new_b, List.map pop binders_to_remove_from_b
- | Toberemoved_with_rel (n,c) ->
-(* observe (str "Decl of "++Ppconstr.Name.print x ++ str " is removed "); *)
- let new_b,binders_to_remove_from_b = compute_new_princ_type remove env (substnl [c] n b) in
- new_b, list_add_set_eq Constr.equal (mkRel n) (List.map pop binders_to_remove_from_b)
+ | Toberemoved ->
+(* observe (str "Decl of "++Ppconstr.Name.print x ++ str " is removed "); *)
+ let new_b,binders_to_remove_from_b = compute_new_princ_type remove env (substnl [dummy_var] 1 b) in
+ new_b, List.map pop binders_to_remove_from_b
+ | Toberemoved_with_rel (n,c) ->
+(* observe (str "Decl of "++Ppconstr.Name.print x ++ str " is removed "); *)
+ let new_b,binders_to_remove_from_b = compute_new_princ_type remove env (substnl [c] n b) in
+ new_b, list_add_set_eq Constr.equal (mkRel n) (List.map pop binders_to_remove_from_b)
end
and compute_new_princ_type_with_acc remove env e (c_acc,to_remove_acc) =
let new_e,to_remove_from_e = compute_new_princ_type remove env e
@@ -256,7 +255,7 @@ let compute_new_princ_type_from_rel rel_to_fun sorts princ_type =
LocalAssum (map_annot (fun id -> Name.mk_name (Hashtbl.find tbl id)) id, b)
| Context.Named.Declaration.LocalDef (id,t,b) ->
LocalDef (map_annot (fun id -> Name.mk_name (Hashtbl.find tbl id)) id, t, b))
- new_predicates)
+ new_predicates)
)
(List.map (fun d -> Termops.map_rel_decl EConstr.Unsafe.to_constr d) princ_type_info.params)
@@ -281,8 +280,8 @@ let change_property_sort evd toSort princ princName =
let init =
let nargs = (princ_info.nparams + (List.length princ_info.predicates)) in
mkApp(EConstr.Unsafe.to_constr princName_as_constr,
- Array.init nargs
- (fun i -> mkRel (nargs - i )))
+ Array.init nargs
+ (fun i -> mkRel (nargs - i )))
in
evd, it_mkLambda_or_LetIn
(it_mkLambda_or_LetIn init
@@ -307,29 +306,28 @@ let build_functional_principle (evd:Evd.evar_map ref) interactive_proof old_prin
in
let sigma, _ = Typing.type_of ~refresh:true (Global.env ()) !evd (EConstr.of_constr new_principle_type) in
evd := sigma;
- let hook = Lemmas.mk_hook (hook new_principle_type) in
- let pstate =
- Lemmas.start_proof ~ontop:None
+ let hook = DeclareDef.Hook.make (hook new_principle_type) in
+ let lemma =
+ Lemmas.start_lemma
new_princ_name
- (Decl_kinds.Global,false,(Decl_kinds.Proof Decl_kinds.Theorem))
+ Decl_kinds.(Global ImportDefaultBehavior,false,Proof Theorem)
!evd
(EConstr.of_constr new_principle_type)
in
(* let _tim1 = System.get_time () in *)
let map (c, u) = EConstr.mkConstU (c, EConstr.EInstance.make u) in
- let pstate,_ = Pfedit.by (Proofview.V82.tactic (proof_tac (Array.map map funs) mutr_nparams)) pstate in
+ let lemma,_ = Lemmas.by (Proofview.V82.tactic (proof_tac (Array.map map funs) mutr_nparams)) lemma in
(* let _tim2 = System.get_time () in *)
- (* begin *)
- (* let dur1 = System.time_difference tim1 tim2 in *)
- (* Pp.msgnl (str ("Time to compute proof: ") ++ str (string_of_float dur1)); *)
- (* end; *)
+ (* begin *)
+ (* let dur1 = System.time_difference tim1 tim2 in *)
+ (* Pp.msgnl (str ("Time to compute proof: ") ++ str (string_of_float dur1)); *)
+ (* end; *)
let open Proof_global in
- let { id; entries; persistence } = fst @@ close_proof ~opaque:Transparent ~keep_body_ucst_separate:false (fun x -> x) pstate in
+ let { id; entries; persistence } = Lemmas.pf_fold (close_proof ~opaque:Transparent ~keep_body_ucst_separate:false (fun x -> x)) lemma in
match entries with
| [entry] ->
- let pstate = discard_current pstate in
- (id,(entry,persistence)), hook, pstate
+ (id,(entry,persistence)), hook
| _ ->
CErrors.anomaly Pp.(str "[build_functional_principle] close_proof returned more than one proof term")
@@ -351,8 +349,8 @@ let generate_functional_principle (evd: Evd.evar_map ref)
match new_princ_name with
| Some (id) -> id,id
| None ->
- let id_of_f = Label.to_id (Constant.label (fst f)) in
- id_of_f,Indrec.make_elimination_ident id_of_f (Sorts.family type_sort)
+ let id_of_f = Label.to_id (Constant.label (fst f)) in
+ id_of_f,Indrec.make_elimination_ident id_of_f (Sorts.family type_sort)
in
let names = ref [new_princ_name] in
let hook =
@@ -370,18 +368,18 @@ let generate_functional_principle (evd: Evd.evar_map ref)
let univs = Evd.univ_entry ~poly:false evd' in
let ce = Declare.definition_entry ~univs value in
ignore(
- Declare.declare_constant
- name
- (DefinitionEntry ce,
- Decl_kinds.IsDefinition (Decl_kinds.Scheme))
- );
- Declare.definition_message name;
- names := name :: !names
+ Declare.declare_constant
+ name
+ (Declare.DefinitionEntry ce,
+ Decl_kinds.IsDefinition (Decl_kinds.Scheme))
+ );
+ Declare.definition_message name;
+ names := name :: !names
in
register_with_sort InProp;
register_with_sort InSet
in
- let ((id,(entry,g_kind)),hook,pstate) =
+ let ((id,(entry,g_kind)),hook) =
build_functional_principle evd interactive_proof old_princ_type new_sorts funs i
proof_tac hook
in
@@ -399,72 +397,72 @@ let get_funs_constant mp =
let get_funs_constant const e : (Names.Constant.t*int) array =
match Constr.kind ((strip_lam e)) with
| Fix((_,(na,_,_))) ->
- Array.mapi
- (fun i na ->
+ Array.mapi
+ (fun i na ->
match na.binder_name with
- | Name id ->
+ | Name id ->
let const = Constant.make2 mp (Label.of_id id) in
- const,i
- | Anonymous ->
- anomaly (Pp.str "Anonymous fix.")
- )
- na
+ const,i
+ | Anonymous ->
+ anomaly (Pp.str "Anonymous fix.")
+ )
+ na
| _ -> [|const,0|]
in
function const ->
let find_constant_body const =
- match Global.body_of_constant const with
- | Some (body, _) ->
- let body = Tacred.cbv_norm_flags
- (CClosure.RedFlags.mkflags [CClosure.RedFlags.fZETA])
- (Global.env ())
- (Evd.from_env (Global.env ()))
- (EConstr.of_constr body)
- in
- let body = EConstr.Unsafe.to_constr body in
- body
- | None -> user_err Pp.(str ( "Cannot define a principle over an axiom "))
+ match Global.body_of_constant Library.indirect_accessor const with
+ | Some (body, _, _) ->
+ let body = Tacred.cbv_norm_flags
+ (CClosure.RedFlags.mkflags [CClosure.RedFlags.fZETA])
+ (Global.env ())
+ (Evd.from_env (Global.env ()))
+ (EConstr.of_constr body)
+ in
+ let body = EConstr.Unsafe.to_constr body in
+ body
+ | None -> user_err Pp.(str ( "Cannot define a principle over an axiom "))
in
let f = find_constant_body const in
let l_const = get_funs_constant const f in
(*
We need to check that all the functions found are in the same block
- to prevent Reset stange thing
+ to prevent Reset strange thing
*)
let l_bodies = List.map find_constant_body (Array.to_list (Array.map fst l_const)) in
let l_params,l_fixes = List.split (List.map decompose_lam l_bodies) in
- (* all the paremeter must be equal*)
+ (* all the parameters must be equal*)
let _check_params =
let first_params = List.hd l_params in
List.iter
- (fun params ->
+ (fun params ->
if not (List.equal (fun (n1, c1) (n2, c2) ->
eq_annot Name.equal n1 n2 && Constr.equal c1 c2) first_params params)
- then user_err Pp.(str "Not a mutal recursive block")
- )
- l_params
+ then user_err Pp.(str "Not a mutal recursive block")
+ )
+ l_params
in
(* The bodies has to be very similar *)
let _check_bodies =
try
- let extract_info is_first body =
- match Constr.kind body with
+ let extract_info is_first body =
+ match Constr.kind body with
| Fix((idxs,_),(na,ta,ca)) -> (idxs,na,ta,ca)
- | _ ->
- if is_first && Int.equal (List.length l_bodies) 1
- then raise Not_Rec
- else user_err Pp.(str "Not a mutal recursive block")
- in
- let first_infos = extract_info true (List.hd l_bodies) in
- let check body = (* Hope this is correct *)
+ | _ ->
+ if is_first && Int.equal (List.length l_bodies) 1
+ then raise Not_Rec
+ else user_err Pp.(str "Not a mutal recursive block")
+ in
+ let first_infos = extract_info true (List.hd l_bodies) in
+ let check body = (* Hope this is correct *)
let eq_infos (ia1, na1, ta1, ca1) (ia2, na2, ta2, ca2) =
Array.equal Int.equal ia1 ia2 && Array.equal (eq_annot Name.equal) na1 na2 &&
Array.equal Constr.equal ta1 ta2 && Array.equal Constr.equal ca1 ca2
- in
- if not (eq_infos first_infos (extract_info false body))
- then user_err Pp.(str "Not a mutal recursive block")
- in
- List.iter check l_bodies
+ in
+ if not (eq_infos first_infos (extract_info false body))
+ then user_err Pp.(str "Not a mutal recursive block")
+ in
+ List.iter check l_bodies
with Not_Rec -> ()
in
l_const
@@ -472,7 +470,7 @@ let get_funs_constant mp =
exception No_graph_found
exception Found_type of int
-let make_scheme evd (fas : (pconstant*Sorts.family) list) : Safe_typing.private_constants definition_entry list =
+let make_scheme evd (fas : (pconstant*Sorts.family) list) : Evd.side_effects Proof_global.proof_entry list =
let env = Global.env () in
let funs = List.map fst fas in
let first_fun = List.hd funs in
@@ -494,15 +492,15 @@ let make_scheme evd (fas : (pconstant*Sorts.family) list) : Safe_typing.private_
let ind_list =
List.map
(fun (idx) ->
- let ind = first_fun_kn,idx in
- (ind,snd first_fun),true,prop_sort
+ let ind = first_fun_kn,idx in
+ (ind,snd first_fun),true,prop_sort
)
funs_indexes
in
- let sigma, schemes =
+ let sigma, schemes =
Indrec.build_mutual_induction_scheme env !evd ind_list
in
- let _ = evd := sigma in
+ let _ = evd := sigma in
let l_schemes =
List.map (EConstr.of_constr %> Typing.unsafe_type_of env sigma %> EConstr.Unsafe.to_constr) schemes
in
@@ -514,20 +512,20 @@ let make_scheme evd (fas : (pconstant*Sorts.family) list) : Safe_typing.private_
)
fas
in
- (* We create the first priciple by tactic *)
+ (* We create the first principle by tactic *)
let first_type,other_princ_types =
match l_schemes with
- s::l_schemes -> s,l_schemes
+ s::l_schemes -> s,l_schemes
| _ -> anomaly (Pp.str "")
in
- let ((_,(const,_)),_,pstate) =
+ let ((_,(const,_)),_) =
try
build_functional_principle evd false
- first_type
- (Array.of_list sorts)
- this_block_funs
- 0
- (prove_princ_for_struct evd false 0 (Array.of_list (List.map fst funs)))
+ first_type
+ (Array.of_list sorts)
+ this_block_funs
+ 0
+ (prove_princ_for_struct evd false 0 (Array.of_list (List.map fst funs)))
(fun _ _ _ _ _ -> ())
with e when CErrors.noncritical e ->
raise (Defining_principle e)
@@ -542,7 +540,7 @@ let make_scheme evd (fas : (pconstant*Sorts.family) list) : Safe_typing.private_
with Option.IsNone -> (* non recursive definition *)
false
in
- let const = {const with const_entry_opaque = opacity } in
+ let const = {const with Proof_global.proof_entry_opaque = opacity } in
(* The others are just deduced *)
if List.is_empty other_princ_types
then
@@ -553,54 +551,55 @@ let make_scheme evd (fas : (pconstant*Sorts.family) list) : Safe_typing.private_
let sorts = Array.of_list sorts in
List.map (compute_new_princ_type_from_rel funs sorts) other_princ_types
in
- let first_princ_body,first_princ_type = const.const_entry_body, const.const_entry_type in
+ let open Proof_global in
+ let first_princ_body,first_princ_type = const.proof_entry_body, const.proof_entry_type in
let ctxt,fix = decompose_lam_assum (fst(fst(Future.force first_princ_body))) in (* the principle has for forall ...., fix .*)
let (idxs,_),(_,ta,_ as decl) = destFix fix in
let other_result =
List.map (* we can now compute the other principles *)
- (fun scheme_type ->
- incr i;
+ (fun scheme_type ->
+ incr i;
observe (Printer.pr_lconstr_env env sigma scheme_type);
- let type_concl = (strip_prod_assum scheme_type) in
- let applied_f = List.hd (List.rev (snd (decompose_app type_concl))) in
- let f = fst (decompose_app applied_f) in
- try (* we search the number of the function in the fix block (name of the function) *)
- Array.iteri
- (fun j t ->
- let t = (strip_prod_assum t) in
- let applied_g = List.hd (List.rev (snd (decompose_app t))) in
- let g = fst (decompose_app applied_g) in
- if Constr.equal f g
- then raise (Found_type j);
+ let type_concl = (strip_prod_assum scheme_type) in
+ let applied_f = List.hd (List.rev (snd (decompose_app type_concl))) in
+ let f = fst (decompose_app applied_f) in
+ try (* we search the number of the function in the fix block (name of the function) *)
+ Array.iteri
+ (fun j t ->
+ let t = (strip_prod_assum t) in
+ let applied_g = List.hd (List.rev (snd (decompose_app t))) in
+ let g = fst (decompose_app applied_g) in
+ if Constr.equal f g
+ then raise (Found_type j);
observe (Printer.pr_lconstr_env env sigma f ++ str " <> " ++
Printer.pr_lconstr_env env sigma g)
- )
- ta;
- (* If we reach this point, the two principle are not mutually recursive
- We fall back to the previous method
- *)
- let ((_,(const,_)),_,pstate) =
- build_functional_principle
- evd
- false
- (List.nth other_princ_types (!i - 1))
- (Array.of_list sorts)
- this_block_funs
- !i
- (prove_princ_for_struct evd false !i (Array.of_list (List.map fst funs)))
+ )
+ ta;
+ (* If we reach this point, the two principle are not mutually recursive
+ We fall back to the previous method
+ *)
+ let ((_,(const,_)),_) =
+ build_functional_principle
+ evd
+ false
+ (List.nth other_princ_types (!i - 1))
+ (Array.of_list sorts)
+ this_block_funs
+ !i
+ (prove_princ_for_struct evd false !i (Array.of_list (List.map fst funs)))
(fun _ _ _ _ _ -> ())
- in
- const
- with Found_type i ->
- let princ_body =
- Termops.it_mkLambda_or_LetIn (mkFix((idxs,i),decl)) ctxt
- in
- {const with
- const_entry_body =
- (Future.from_val (Safe_typing.mk_pure_proof princ_body));
- const_entry_type = Some scheme_type
- }
+ in
+ const
+ with Found_type i ->
+ let princ_body =
+ Termops.it_mkLambda_or_LetIn (mkFix((idxs,i),decl)) ctxt
+ in
+ {const with
+ proof_entry_body =
+ (Future.from_val ((princ_body, Univ.ContextSet.empty), Evd.empty_side_effects));
+ proof_entry_type = Some scheme_type
+ }
)
other_fun_princ_types
in
@@ -609,16 +608,16 @@ let make_scheme evd (fas : (pconstant*Sorts.family) list) : Safe_typing.private_
let build_scheme fas =
let evd = (ref (Evd.from_env (Global.env ()))) in
let pconstants = (List.map
- (fun (_,f,sort) ->
- let f_as_constant =
- try
- Smartlocate.global_with_alias f
- with Not_found ->
+ (fun (_,f,sort) ->
+ let f_as_constant =
+ try
+ Smartlocate.global_with_alias f
+ with Not_found ->
user_err ~hdr:"FunInd.build_scheme"
(str "Cannot find " ++ Libnames.pr_qualid f)
- in
+ in
let evd',f = Evd.fresh_global (Global.env ()) !evd f_as_constant in
- let _ = evd := evd' in
+ let _ = evd := evd' in
let sigma, _ = Typing.type_of ~refresh:true (Global.env ()) !evd f in
evd := sigma;
let c, u =
@@ -628,18 +627,18 @@ let build_scheme fas =
in
(c, EConstr.EInstance.kind !evd u), sort
)
- fas
- ) in
+ fas
+ ) in
let bodies_types =
- make_scheme evd pconstants
+ make_scheme evd pconstants
in
List.iter2
(fun (princ_id,_,_) def_entry ->
ignore
- (Declare.declare_constant
- princ_id
- (DefinitionEntry def_entry,Decl_kinds.IsProof Decl_kinds.Theorem));
+ (Declare.declare_constant
+ princ_id
+ (Declare.DefinitionEntry def_entry,Decl_kinds.IsProof Decl_kinds.Theorem));
Declare.definition_message princ_id
)
fas
@@ -672,10 +671,10 @@ let build_case_scheme fa =
List.assoc_f Constant.equal funs this_block_funs_indexes
in
let (ind, sf) =
- let ind = first_fun_kn,funs_indexes in
- (ind,Univ.Instance.empty)(*FIXME*),prop_sort
+ let ind = first_fun_kn,funs_indexes in
+ (ind,Univ.Instance.empty)(*FIXME*),prop_sort
in
- let (sigma, scheme) =
+ let (sigma, scheme) =
Indrec.build_case_analysis_scheme_default env sigma ind sf
in
let scheme_type = EConstr.Unsafe.to_constr ((Typing.unsafe_type_of env sigma) (EConstr.of_constr scheme)) in
@@ -688,8 +687,8 @@ let build_case_scheme fa =
let princ_name = (fun (x,_,_) -> x) fa in
let _ =
(* Pp.msgnl (str "Generating " ++ Ppconstr.pr_id princ_name ++str " with " ++
- pr_lconstr scheme_type ++ str " and " ++ (fun a -> prlist_with_sep spc (fun c -> pr_lconstr (mkConst c)) (Array.to_list a)) this_block_funs
- );
+ pr_lconstr scheme_type ++ str " and " ++ (fun a -> prlist_with_sep spc (fun c -> pr_lconstr (mkConst c)) (Array.to_list a)) this_block_funs
+ );
*)
generate_functional_principle
(ref (Evd.from_env (Global.env ())))
@@ -702,5 +701,5 @@ let build_case_scheme fa =
(prove_princ_for_struct (ref (Evd.from_env (Global.env ()))) false 0 [|funs|])
in
()
-
+
diff --git a/plugins/funind/functional_principles_types.mli b/plugins/funind/functional_principles_types.mli
index 97f9acdb3a..b4f6f92f9c 100644
--- a/plugins/funind/functional_principles_types.mli
+++ b/plugins/funind/functional_principles_types.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -34,7 +34,7 @@ val generate_functional_principle :
exception No_graph_found
val make_scheme : Evd.evar_map ref ->
- (pconstant*Sorts.family) list -> Safe_typing.private_constants Entries.definition_entry list
+ (pconstant*Sorts.family) list -> Evd.side_effects Proof_global.proof_entry list
val build_scheme : (Id.t*Libnames.qualid*Sorts.family) list -> unit
val build_case_scheme : (Id.t*Libnames.qualid*Sorts.family) -> unit
diff --git a/plugins/funind/g_indfun.mlg b/plugins/funind/g_indfun.mlg
index dbfc0fc91d..ef9d91c7fa 100644
--- a/plugins/funind/g_indfun.mlg
+++ b/plugins/funind/g_indfun.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -83,7 +83,7 @@ let out_disjunctive = CAst.map (function
}
-ARGUMENT EXTEND with_names TYPED AS intropattern option PRINTED BY { pr_intro_as_pat }
+ARGUMENT EXTEND with_names TYPED AS intro_pattern option PRINTED BY { pr_intro_as_pat }
| [ "as" simple_intropattern(ipat) ] -> { Some ipat }
| [] -> { None }
END
@@ -173,24 +173,41 @@ let () =
let raw_printer env sigma _ _ _ (loc,body) = Ppvernac.pr_rec_definition body in
Pptactic.declare_extra_vernac_genarg_pprule wit_function_rec_definition_loc raw_printer
+let is_proof_termination_interactively_checked recsl =
+ List.exists (function
+ | _,((_,( Some { CAst.v = CMeasureRec _ }
+ | Some { CAst.v = CWfRec _}),_,_,_),_) -> true
+ | _,((_,Some { CAst.v = CStructRec _ },_,_,_),_)
+ | _,((_,None,_,_,_),_) -> false) recsl
+
+let classify_as_Fixpoint recsl =
+ Vernac_classifier.classify_vernac
+ (Vernacexpr.(CAst.make @@ VernacExpr([], VernacFixpoint(Decl_kinds.NoDischarge, List.map snd recsl))))
+
+let classify_funind recsl =
+ match classify_as_Fixpoint recsl with
+ | Vernacextend.VtSideff (ids, _)
+ when is_proof_termination_interactively_checked recsl ->
+ Vernacextend.(VtStartProof (GuaranteesOpacity, ids))
+ | x -> x
+
+let is_interactive recsl =
+ match classify_funind recsl with
+ | Vernacextend.VtStartProof _ -> true
+ | _ -> false
+
}
-(* TASSI: n'importe quoi ! *)
-VERNAC COMMAND EXTEND Function
-| ![ proof ] ["Function" ne_function_rec_definition_loc_list_sep(recsl,"with")]
- => { let hard = List.exists (function
- | _,((_,(Some { CAst.v = CMeasureRec _ }
- | Some { CAst.v = CWfRec _}),_,_,_),_) -> true
- | _,((_,Some { CAst.v = CStructRec _ },_,_,_),_)
- | _,((_,None,_,_,_),_) -> false) recsl in
- match
- Vernac_classifier.classify_vernac
- (Vernacexpr.(CAst.make @@ VernacExpr([], VernacFixpoint(Decl_kinds.NoDischarge, List.map snd recsl))))
- with
- | Vernacextend.VtSideff ids, _ when hard ->
- Vernacextend.(VtStartProof (GuaranteesOpacity, ids), VtLater)
- | x -> x }
- -> { do_generate_principle false (List.map snd recsl) }
+VERNAC COMMAND EXTEND Function STATE CUSTOM
+| ["Function" ne_function_rec_definition_loc_list_sep(recsl,"with")]
+ => { classify_funind recsl }
+ -> {
+ if is_interactive recsl then
+ Vernacextend.VtOpenProof (fun () ->
+ do_generate_principle_interactive (List.map snd recsl))
+ else
+ Vernacextend.VtDefault (fun () ->
+ do_generate_principle (List.map snd recsl)) }
END
{
@@ -225,33 +242,32 @@ let warning_error names e =
}
VERNAC COMMAND EXTEND NewFunctionalScheme
-| ![ proof ] ["Functional" "Scheme" ne_fun_scheme_arg_list_sep(fas,"with") ]
- => { Vernacextend.(VtSideff(List.map pi1 fas), VtLater) }
+| ["Functional" "Scheme" ne_fun_scheme_arg_list_sep(fas,"with") ]
+ => { Vernacextend.(VtSideff(List.map pi1 fas, VtLater)) }
->
- { fun ~pstate ->
- begin
+ { begin
try
- Functional_principles_types.build_scheme fas; pstate
+ Functional_principles_types.build_scheme fas
with
| Functional_principles_types.No_graph_found ->
begin
match fas with
| (_,fun_name,_)::_ ->
begin
- let pstate = make_graph ~pstate (Smartlocate.global_with_alias fun_name) in
- try Functional_principles_types.build_scheme fas; pstate
+ make_graph (Smartlocate.global_with_alias fun_name);
+ try Functional_principles_types.build_scheme fas
with
| Functional_principles_types.No_graph_found ->
CErrors.user_err Pp.(str "Cannot generate induction principle(s)")
| e when CErrors.noncritical e ->
let names = List.map (fun (_,na,_) -> na) fas in
- warning_error names e; pstate
+ warning_error names e
end
| _ -> assert false (* we can only have non empty list *)
end
| e when CErrors.noncritical e ->
let names = List.map (fun (_,na,_) -> na) fas in
- warning_error names e; pstate
+ warning_error names e
end
}
END
@@ -259,12 +275,12 @@ END
VERNAC COMMAND EXTEND NewFunctionalCase
| ["Functional" "Case" fun_scheme_arg(fas) ]
- => { Vernacextend.(VtSideff[pi1 fas], VtLater) }
+ => { Vernacextend.(VtSideff([pi1 fas], VtLater)) }
-> { Functional_principles_types.build_case_scheme fas }
END
(***** debug only ***)
VERNAC COMMAND EXTEND GenerateGraph CLASSIFIED AS QUERY
-| ![ proof ] ["Generate" "graph" "for" reference(c)] ->
+| ["Generate" "graph" "for" reference(c)] ->
{ make_graph (Smartlocate.global_with_alias c) }
END
diff --git a/plugins/funind/glob_term_to_relation.ml b/plugins/funind/glob_term_to_relation.ml
index e15e167ff3..201d953692 100644
--- a/plugins/funind/glob_term_to_relation.ml
+++ b/plugins/funind/glob_term_to_relation.ml
@@ -1299,10 +1299,10 @@ let rec rebuild_return_type rt =
| Constrexpr.CProdN(n,t') ->
CAst.make ?loc @@ Constrexpr.CProdN(n,rebuild_return_type t')
| Constrexpr.CLetIn(na,v,t,t') ->
- CAst.make ?loc @@ Constrexpr.CLetIn(na,v,t,rebuild_return_type t')
+ CAst.make ?loc @@ Constrexpr.CLetIn(na,v,t,rebuild_return_type t')
| _ -> CAst.make ?loc @@ Constrexpr.CProdN([Constrexpr.CLocalAssum ([CAst.make Anonymous],
Constrexpr.Default Decl_kinds.Explicit, rt)],
- CAst.make @@ Constrexpr.CSort(GType []))
+ CAst.make @@ Constrexpr.CSort(UAnonymous {rigid=true}))
let do_build_inductive
evd (funconstants: pconstant list) (funsargs: (Name.t * glob_constr * glob_constr option) list list)
@@ -1369,7 +1369,7 @@ let do_build_inductive
(rebuild_return_type returned_types.(i))
in
(* We need to lift back our work topconstr but only with all information
- We mimick a Set Printing All.
+ We mimic a Set Printing All.
Then save the graphs and reset Printing options to their primitive values
*)
let rel_arities = Array.mapi rel_arity funsargs in
@@ -1438,7 +1438,7 @@ let do_build_inductive
(rebuild_return_type returned_types.(i))
in
(* We need to lift back our work topconstr but only with all information
- We mimick a Set Printing All.
+ We mimic a Set Printing All.
Then save the graphs and reset Printing options to their primitive values
*)
let rel_arities = Array.mapi rel_arity funsargs in
diff --git a/plugins/funind/glob_termops.mli b/plugins/funind/glob_termops.mli
index 481a8be3ba..24b3690138 100644
--- a/plugins/funind/glob_termops.mli
+++ b/plugins/funind/glob_termops.mli
@@ -55,7 +55,7 @@ val change_vars : Id.t Id.Map.t -> glob_constr -> glob_constr
Glob_term.cases_pattern * Id.Map.key list *
Id.t Id.Map.t
-(* [alpha_rt avoid rt] alpha convert [rt] s.t. the result repects barendregt
+(* [alpha_rt avoid rt] alpha convert [rt] s.t. the result respects barendregt
conventions and does not share bound variables with avoid
*)
val alpha_rt : Id.t list -> glob_constr -> glob_constr
diff --git a/plugins/funind/indfun.ml b/plugins/funind/indfun.ml
index ce7d149ae1..0ecfbacb09 100644
--- a/plugins/funind/indfun.ml
+++ b/plugins/funind/indfun.ml
@@ -20,7 +20,7 @@ let is_rec_info sigma scheme_info =
let test_branche min acc decl =
acc || (
let new_branche =
- it_mkProd_or_LetIn mkProp (fst (decompose_prod_assum sigma (RelDecl.get_type decl))) in
+ it_mkProd_or_LetIn mkProp (fst (decompose_prod_assum sigma (RelDecl.get_type decl))) in
let free_rels_in_br = Termops.free_rels sigma new_branche in
let max = min + scheme_info.Tactics.npredicates in
Int.Set.exists (fun i -> i >= min && i< max) free_rels_in_br
@@ -40,57 +40,57 @@ let functional_induction with_clean c princl pat =
let princ,bindings, princ_type,g' =
match princl with
| None -> (* No principle is given let's find the good one *)
- begin
- match EConstr.kind sigma f with
- | Const (c',u) ->
- let princ_option =
- let finfo = (* we first try to find out a graph on f *)
- try find_Function_infos c'
- with Not_found ->
- user_err (str "Cannot find induction information on "++
+ begin
+ match EConstr.kind sigma f with
+ | Const (c',u) ->
+ let princ_option =
+ let finfo = (* we first try to find out a graph on f *)
+ try find_Function_infos c'
+ with Not_found ->
+ user_err (str "Cannot find induction information on "++
Printer.pr_leconstr_env (Tacmach.pf_env g) sigma (mkConst c') )
- in
+ in
match Tacticals.elimination_sort_of_goal g with
| InSProp -> finfo.sprop_lemma
- | InProp -> finfo.prop_lemma
- | InSet -> finfo.rec_lemma
- | InType -> finfo.rect_lemma
- in
- let princ,g' = (* then we get the principle *)
- try
- let g',princ =
- Tacmach.pf_eapply (Evd.fresh_global) g (Globnames.ConstRef (Option.get princ_option )) in
- princ,g'
- with Option.IsNone ->
- (*i If there is not default lemma defined then,
- we cross our finger and try to find a lemma named f_ind
- (or f_rec, f_rect) i*)
- let princ_name =
- Indrec.make_elimination_ident
- (Label.to_id (Constant.label c'))
- (Tacticals.elimination_sort_of_goal g)
- in
- try
- let princ_ref = const_of_id princ_name in
- let (a,b) = Tacmach.pf_eapply (Evd.fresh_global) g princ_ref in
- (b,a)
- (* mkConst(const_of_id princ_name ),g (\* FIXME *\) *)
- with Not_found -> (* This one is neither defined ! *)
- user_err (str "Cannot find induction principle for "
+ | InProp -> finfo.prop_lemma
+ | InSet -> finfo.rec_lemma
+ | InType -> finfo.rect_lemma
+ in
+ let princ,g' = (* then we get the principle *)
+ try
+ let g',princ =
+ Tacmach.pf_eapply (Evd.fresh_global) g (Globnames.ConstRef (Option.get princ_option )) in
+ princ,g'
+ with Option.IsNone ->
+ (*i If there is not default lemma defined then,
+ we cross our finger and try to find a lemma named f_ind
+ (or f_rec, f_rect) i*)
+ let princ_name =
+ Indrec.make_elimination_ident
+ (Label.to_id (Constant.label c'))
+ (Tacticals.elimination_sort_of_goal g)
+ in
+ try
+ let princ_ref = const_of_id princ_name in
+ let (a,b) = Tacmach.pf_eapply (Evd.fresh_global) g princ_ref in
+ (b,a)
+ (* mkConst(const_of_id princ_name ),g (\* FIXME *\) *)
+ with Not_found -> (* This one is neither defined ! *)
+ user_err (str "Cannot find induction principle for "
++ Printer.pr_leconstr_env (Tacmach.pf_env g) sigma (mkConst c') )
- in
+ in
(princ,NoBindings,Tacmach.pf_unsafe_type_of g' princ,g')
- | _ -> raise (UserError(None,str "functional induction must be used with a function" ))
- end
+ | _ -> raise (UserError(None,str "functional induction must be used with a function" ))
+ end
| Some ((princ,binding)) ->
- princ,binding,Tacmach.pf_unsafe_type_of g princ,g
+ princ,binding,Tacmach.pf_unsafe_type_of g princ,g
in
let sigma = Tacmach.project g' in
let princ_infos = Tactics.compute_elim_sig (Tacmach.project g') princ_type in
let args_as_induction_constr =
let c_list =
- if princ_infos.Tactics.farg_in_concl
- then [c] else []
+ if princ_infos.Tactics.farg_in_concl
+ then [c] else []
in
if List.length args + List.length c_list = 0
then user_err Pp.(str "Cannot recognize a valid functional scheme" );
@@ -109,35 +109,35 @@ let functional_induction with_clean c princl pat =
let princ' = Some (princ,bindings) in
let princ_vars =
List.fold_right
- (fun a acc -> try Id.Set.add (destVar sigma a) acc with DestKO -> acc)
- args
- Id.Set.empty
+ (fun a acc -> try Id.Set.add (destVar sigma a) acc with DestKO -> acc)
+ args
+ Id.Set.empty
in
let old_idl = List.fold_right Id.Set.add (Tacmach.pf_ids_of_hyps g) Id.Set.empty in
let old_idl = Id.Set.diff old_idl princ_vars in
let subst_and_reduce g =
if with_clean
then
- let idl =
- List.filter (fun id -> not (Id.Set.mem id old_idl))
- (Tacmach.pf_ids_of_hyps g)
- in
- let flag =
- Genredexpr.Cbv
- {Redops.all_flags
- with Genredexpr.rDelta = false;
- }
- in
- Tacticals.tclTHEN
- (Tacticals.tclMAP (fun id -> Tacticals.tclTRY (Proofview.V82.of_tactic (Equality.subst_gen (do_rewrite_dependent ()) [id]))) idl )
- (Proofview.V82.of_tactic (Tactics.reduce flag Locusops.allHypsAndConcl))
- g
+ let idl =
+ List.filter (fun id -> not (Id.Set.mem id old_idl))
+ (Tacmach.pf_ids_of_hyps g)
+ in
+ let flag =
+ Genredexpr.Cbv
+ {Redops.all_flags
+ with Genredexpr.rDelta = false;
+ }
+ in
+ Tacticals.tclTHEN
+ (Tacticals.tclMAP (fun id -> Tacticals.tclTRY (Proofview.V82.of_tactic (Equality.subst_gen (do_rewrite_dependent ()) [id]))) idl )
+ (Proofview.V82.of_tactic (Tactics.reduce flag Locusops.allHypsAndConcl))
+ g
else Tacticals.tclIDTAC g
in
Tacticals.tclTHEN
(Proofview.V82.of_tactic (choose_dest_or_ind
- princ_infos
- (args_as_induction_constr,princ')))
+ princ_infos
+ (args_as_induction_constr,princ')))
subst_and_reduce
g'
in res
@@ -185,13 +185,13 @@ let build_newrecursive
in
recdef,rec_impls
-let build_newrecursive l =
- let l' = List.map
- (fun ((fixna,_,bll,ar,body_opt),lnot) ->
- match body_opt with
- | Some body ->
- (fixna,bll,ar,body)
- | None -> user_err ~hdr:"Function" (str "Body of Function must be given")
+let build_newrecursive l =
+ let l' = List.map
+ (fun ((fixna,_,bll,ar,body_opt),lnot) ->
+ match body_opt with
+ | Some body ->
+ (fixna,bll,ar,body)
+ | None -> user_err ~hdr:"Function" (str "Body of Function must be given")
) l
in
build_newrecursive l'
@@ -208,23 +208,23 @@ let is_rec names =
| GCast(b,_) -> lookup names b
| GRec _ -> error "GRec not handled"
| GIf(b,_,lhs,rhs) ->
- (lookup names b) || (lookup names lhs) || (lookup names rhs)
+ (lookup names b) || (lookup names lhs) || (lookup names rhs)
| GProd(na,_,t,b) | GLambda(na,_,t,b) ->
- lookup names t || lookup (Nameops.Name.fold_right Id.Set.remove na names) b
+ lookup names t || lookup (Nameops.Name.fold_right Id.Set.remove na names) b
| GLetIn(na,b,t,c) ->
- lookup names b || Option.cata (lookup names) true t || lookup (Nameops.Name.fold_right Id.Set.remove na names) c
+ lookup names b || Option.cata (lookup names) true t || lookup (Nameops.Name.fold_right Id.Set.remove na names) c
| GLetTuple(nal,_,t,b) -> lookup names t ||
- lookup
- (List.fold_left
- (fun acc na -> Nameops.Name.fold_right Id.Set.remove na acc)
- names
- nal
- )
- b
+ lookup
+ (List.fold_left
+ (fun acc na -> Nameops.Name.fold_right Id.Set.remove na acc)
+ names
+ nal
+ )
+ b
| GApp(f,args) -> List.exists (lookup names) (f::args)
| GCases(_,_,el,brl) ->
- List.exists (fun (e,_) -> lookup names e) el ||
- List.exists (lookup_br names) brl
+ List.exists (fun (e,_) -> lookup names e) el ||
+ List.exists (lookup_br names) brl
and lookup_br names {CAst.v=(idl,_,rt)} =
let new_names = List.fold_right Id.Set.remove idl names in
lookup new_names rt
@@ -254,19 +254,19 @@ let warn_funind_cannot_build_inversion =
let derive_inversion fix_names =
try
- let evd' = Evd.from_env (Global.env ()) in
+ let evd' = Evd.from_env (Global.env ()) in
(* we first transform the fix_names identifier into their corresponding constant *)
let evd',fix_names_as_constant =
List.fold_right
- (fun id (evd,l) ->
- let evd,c =
- Evd.fresh_global
- (Global.env ()) evd (Constrintern.locate_reference (Libnames.qualid_of_ident id)) in
+ (fun id (evd,l) ->
+ let evd,c =
+ Evd.fresh_global
+ (Global.env ()) evd (Constrintern.locate_reference (Libnames.qualid_of_ident id)) in
let (cst, u) = destConst evd c in
- evd, (cst, EInstance.kind evd u) :: l
- )
- fix_names
- (evd',[])
+ evd, (cst, EInstance.kind evd u) :: l
+ )
+ fix_names
+ (evd',[])
in
(*
Then we check that the graphs have been defined
@@ -276,22 +276,22 @@ let derive_inversion fix_names =
List.iter (fun c -> ignore (find_Function_infos (fst c))) fix_names_as_constant ;
try
let evd', lind =
- List.fold_right
- (fun id (evd,l) ->
- let evd,id =
- Evd.fresh_global
- (Global.env ()) evd
- (Constrintern.locate_reference (Libnames.qualid_of_ident (mk_rel_id id)))
- in
+ List.fold_right
+ (fun id (evd,l) ->
+ let evd,id =
+ Evd.fresh_global
+ (Global.env ()) evd
+ (Constrintern.locate_reference (Libnames.qualid_of_ident (mk_rel_id id)))
+ in
evd,(fst (destInd evd id))::l
- )
- fix_names
- (evd',[])
+ )
+ fix_names
+ (evd',[])
in
Invfun.derive_correctness
- Functional_principles_types.make_scheme
- fix_names_as_constant
- lind;
+ Functional_principles_types.make_scheme
+ fix_names_as_constant
+ lind;
with e when CErrors.noncritical e ->
let e' = process_vernac_interp_error e in
warn_funind_cannot_build_inversion e'
@@ -313,15 +313,15 @@ let warning_error names e =
let e = process_vernac_interp_error e in
let e_explain e =
match e with
- | ToShow e ->
- let e = process_vernac_interp_error e in
- spc () ++ CErrors.print e
- | _ ->
- if do_observe ()
- then
- let e = process_vernac_interp_error e in
- (spc () ++ CErrors.print e)
- else mt ()
+ | ToShow e ->
+ let e = process_vernac_interp_error e in
+ spc () ++ CErrors.print e
+ | _ ->
+ if do_observe ()
+ then
+ let e = process_vernac_interp_error e in
+ (spc () ++ CErrors.print e)
+ else mt ()
in
match e with
| Building_graph e ->
@@ -341,10 +341,10 @@ let error_error names e =
in
match e with
| Building_graph e ->
- user_err
- (str "Cannot define graph(s) for " ++
- h 1 (prlist_with_sep (fun _ -> str","++spc ()) Ppconstr.pr_id names) ++
- e_explain e)
+ user_err
+ (str "Cannot define graph(s) for " ++
+ h 1 (prlist_with_sep (fun _ -> str","++spc ()) Ppconstr.pr_id names) ++
+ e_explain e)
| _ -> raise e
let generate_principle (evd:Evd.evar_map ref) pconstants on_error
@@ -361,94 +361,94 @@ let generate_principle (evd:Evd.evar_map ref) pconstants on_error
if do_built
then
begin
- (*i The next call to mk_rel_id is valid since we have just construct the graph
- Ensures by : do_built
- i*)
+ (*i The next call to mk_rel_id is valid since we have just construct the graph
+ Ensures by : do_built
+ i*)
let f_R_mut = qualid_of_ident @@ mk_rel_id (List.nth names 0) in
- let ind_kn =
- fst (locate_with_msg
+ let ind_kn =
+ fst (locate_with_msg
(pr_qualid f_R_mut++str ": Not an inductive type!")
- locate_ind
- f_R_mut)
- in
- let fname_kn (((fname,_),_,_,_,_),_) =
+ locate_ind
+ f_R_mut)
+ in
+ let fname_kn (((fname,_),_,_,_,_),_) =
let f_ref = qualid_of_ident ?loc:fname.CAst.loc fname.CAst.v in
locate_with_msg
(pr_qualid f_ref++str ": Not an inductive type!")
- locate_constant
- f_ref
- in
- let funs_kn = Array.of_list (List.map fname_kn fix_rec_l) in
- let _ =
- List.map_i
- (fun i x ->
+ locate_constant
+ f_ref
+ in
+ let funs_kn = Array.of_list (List.map fname_kn fix_rec_l) in
+ let _ =
+ List.map_i
+ (fun i x ->
let env = Global.env () in
let princ = Indrec.lookup_eliminator env (ind_kn,i) (InProp) in
- let evd = ref (Evd.from_env env) in
- let evd',uprinc = Evd.fresh_global env !evd princ in
- let _ = evd := evd' in
+ let evd = ref (Evd.from_env env) in
+ let evd',uprinc = Evd.fresh_global env !evd princ in
+ let _ = evd := evd' in
let sigma, princ_type = Typing.type_of ~refresh:true env !evd uprinc in
evd := sigma;
- let princ_type = EConstr.Unsafe.to_constr princ_type in
- Functional_principles_types.generate_functional_principle
- evd
- interactive_proof
- princ_type
- None
- None
- (Array.of_list pconstants)
- (* funs_kn *)
- i
- (continue_proof 0 [|funs_kn.(i)|])
- )
- 0
- fix_rec_l
- in
- Array.iter (add_Function is_general) funs_kn;
- ()
+ let princ_type = EConstr.Unsafe.to_constr princ_type in
+ Functional_principles_types.generate_functional_principle
+ evd
+ interactive_proof
+ princ_type
+ None
+ None
+ (Array.of_list pconstants)
+ (* funs_kn *)
+ i
+ (continue_proof 0 [|funs_kn.(i)|])
+ )
+ 0
+ fix_rec_l
+ in
+ Array.iter (add_Function is_general) funs_kn;
+ ()
end
with e when CErrors.noncritical e ->
on_error names e
-let register_struct ~pstate is_rec (fixpoint_exprl:(Vernacexpr.fixpoint_expr * Vernacexpr.decl_notation list) list) =
+let register_struct is_rec (fixpoint_exprl:(Vernacexpr.fixpoint_expr * Vernacexpr.decl_notation list) list) =
match fixpoint_exprl with
| [(({CAst.v=fname},pl),_,bl,ret_type,body),_] when not is_rec ->
- let body = match body with | Some body -> body | None -> user_err ~hdr:"Function" (str "Body of Function must be given") in
+ let body = match body with | Some body -> body | None -> user_err ~hdr:"Function" (str "Body of Function must be given") in
ComDefinition.do_definition
~program_mode:false
- fname
- (Decl_kinds.Global,false,Decl_kinds.Definition) pl
+ fname
+ Decl_kinds.(Global ImportDefaultBehavior,false,Definition) pl
bl None body (Some ret_type);
let evd,rev_pconstants =
- List.fold_left
+ List.fold_left
(fun (evd,l) ((({CAst.v=fname},_),_,_,_,_),_) ->
- let evd,c =
- Evd.fresh_global
- (Global.env ()) evd (Constrintern.locate_reference (Libnames.qualid_of_ident fname)) in
+ let evd,c =
+ Evd.fresh_global
+ (Global.env ()) evd (Constrintern.locate_reference (Libnames.qualid_of_ident fname)) in
let (cst, u) = destConst evd c in
let u = EInstance.kind evd u in
evd,((cst, u) :: l)
- )
- (Evd.from_env (Global.env ()),[])
- fixpoint_exprl
+ )
+ (Evd.from_env (Global.env ()),[])
+ fixpoint_exprl
in
- pstate, evd,List.rev rev_pconstants
+ None, evd,List.rev rev_pconstants
| _ ->
- let pstate = ComFixpoint.do_fixpoint ~ontop:pstate Global false fixpoint_exprl in
+ ComFixpoint.do_fixpoint (Global ImportDefaultBehavior) false fixpoint_exprl;
let evd,rev_pconstants =
- List.fold_left
+ List.fold_left
(fun (evd,l) ((({CAst.v=fname},_),_,_,_,_),_) ->
- let evd,c =
- Evd.fresh_global
- (Global.env ()) evd (Constrintern.locate_reference (Libnames.qualid_of_ident fname)) in
+ let evd,c =
+ Evd.fresh_global
+ (Global.env ()) evd (Constrintern.locate_reference (Libnames.qualid_of_ident fname)) in
let (cst, u) = destConst evd c in
let u = EInstance.kind evd u in
evd,((cst, u) :: l)
- )
- (Evd.from_env (Global.env ()),[])
- fixpoint_exprl
+ )
+ (Evd.from_env (Global.env ()),[])
+ fixpoint_exprl
in
- pstate,evd,List.rev rev_pconstants
+ None,evd,List.rev rev_pconstants
let generate_correction_proof_wf f_ref tcc_lemma_ref
@@ -459,7 +459,7 @@ let generate_correction_proof_wf f_ref tcc_lemma_ref
tcc_lemma_ref is_mes rec_arg_num rec_arg_type relation
-let register_wf ?(is_mes=false) fname rec_impls wf_rel_expr wf_arg using_lemmas args ret_type body
+let register_wf interactive_proof ?(is_mes=false) fname rec_impls wf_rel_expr wf_arg using_lemmas args ret_type body
pre_hook
=
let type_of_f = Constrexpr_ops.mkCProdN args ret_type in
@@ -467,41 +467,41 @@ let register_wf ?(is_mes=false) fname rec_impls wf_rel_expr wf_arg using_lemmas
let names =
List.map
CAst.(with_val (fun x -> x))
- (Constrexpr_ops.names_of_local_assums args)
+ (Constrexpr_ops.names_of_local_assums args)
in
- List.index Name.equal (Name wf_arg) names
+ List.index Name.equal (Name wf_arg) names
in
let unbounded_eq =
let f_app_args =
CAst.make @@ Constrexpr.CAppExpl(
(None,qualid_of_ident fname,None) ,
- (List.map
- (function
+ (List.map
+ (function
| {CAst.v=Anonymous} -> assert false
| {CAst.v=Name e} -> (Constrexpr_ops.mkIdentC e)
- )
- (Constrexpr_ops.names_of_local_assums args)
- )
- )
+ )
+ (Constrexpr_ops.names_of_local_assums args)
+ )
+ )
in
CAst.make @@ Constrexpr.CApp ((None,Constrexpr_ops.mkRefC (qualid_of_string "Logic.eq")),
- [(f_app_args,None);(body,None)])
+ [(f_app_args,None);(body,None)])
in
let eq = Constrexpr_ops.mkCProdN args unbounded_eq in
let hook ((f_ref,_) as fconst) tcc_lemma_ref (functional_ref,_) (eq_ref,_) rec_arg_num rec_arg_type
nb_args relation =
try
pre_hook [fconst]
- (generate_correction_proof_wf f_ref tcc_lemma_ref is_mes
- functional_ref eq_ref rec_arg_num rec_arg_type nb_args relation
- );
+ (generate_correction_proof_wf f_ref tcc_lemma_ref is_mes
+ functional_ref eq_ref rec_arg_num rec_arg_type nb_args relation
+ );
derive_inversion [fname]
with e when CErrors.noncritical e ->
(* No proof done *)
()
in
- Recdef.recursive_definition
- is_mes fname rec_impls
+ Recdef.recursive_definition ~interactive_proof
+ ~is_mes fname rec_impls
type_of_f
wf_rel_expr
rec_arg_num
@@ -510,219 +510,219 @@ let register_wf ?(is_mes=false) fname rec_impls wf_rel_expr wf_arg using_lemmas
using_lemmas
-let register_mes fname rec_impls wf_mes_expr wf_rel_expr_opt wf_arg using_lemmas args ret_type body =
+let register_mes interactive_proof fname rec_impls wf_mes_expr wf_rel_expr_opt wf_arg using_lemmas args ret_type body =
let wf_arg_type,wf_arg =
match wf_arg with
| None ->
- begin
- match args with
+ begin
+ match args with
| [Constrexpr.CLocalAssum ([{CAst.v=Name x}],k,t)] -> t,x
- | _ -> error "Recursive argument must be specified"
- end
+ | _ -> error "Recursive argument must be specified"
+ end
| Some wf_args ->
- try
- match
- List.find
- (function
- | Constrexpr.CLocalAssum(l,k,t) ->
- List.exists
+ try
+ match
+ List.find
+ (function
+ | Constrexpr.CLocalAssum(l,k,t) ->
+ List.exists
(function {CAst.v=Name id} -> Id.equal id wf_args | _ -> false)
- l
- | _ -> false
- )
- args
- with
- | Constrexpr.CLocalAssum(_,k,t) -> t,wf_args
- | _ -> assert false
- with Not_found -> assert false
+ l
+ | _ -> false
+ )
+ args
+ with
+ | Constrexpr.CLocalAssum(_,k,t) -> t,wf_args
+ | _ -> assert false
+ with Not_found -> assert false
in
- let wf_rel_from_mes,is_mes =
- match wf_rel_expr_opt with
+ let wf_rel_from_mes,is_mes =
+ match wf_rel_expr_opt with
| None ->
- let ltof =
- let make_dir l = DirPath.make (List.rev_map Id.of_string l) in
+ let ltof =
+ let make_dir l = DirPath.make (List.rev_map Id.of_string l) in
Libnames.qualid_of_path
(Libnames.make_path (make_dir ["Arith";"Wf_nat"]) (Id.of_string "ltof"))
in
- let fun_from_mes =
- let applied_mes =
- Constrexpr_ops.mkAppC(wf_mes_expr,[Constrexpr_ops.mkIdentC wf_arg]) in
+ let fun_from_mes =
+ let applied_mes =
+ Constrexpr_ops.mkAppC(wf_mes_expr,[Constrexpr_ops.mkIdentC wf_arg]) in
Constrexpr_ops.mkLambdaC ([CAst.make @@ Name wf_arg],Constrexpr_ops.default_binder_kind,wf_arg_type,applied_mes)
- in
- let wf_rel_from_mes =
- Constrexpr_ops.mkAppC(Constrexpr_ops.mkRefC ltof,[wf_arg_type;fun_from_mes])
- in
- wf_rel_from_mes,true
- | Some wf_rel_expr ->
- let wf_rel_with_mes =
- let a = Names.Id.of_string "___a" in
- let b = Names.Id.of_string "___b" in
- Constrexpr_ops.mkLambdaC(
+ in
+ let wf_rel_from_mes =
+ Constrexpr_ops.mkAppC(Constrexpr_ops.mkRefC ltof,[wf_arg_type;fun_from_mes])
+ in
+ wf_rel_from_mes,true
+ | Some wf_rel_expr ->
+ let wf_rel_with_mes =
+ let a = Names.Id.of_string "___a" in
+ let b = Names.Id.of_string "___b" in
+ Constrexpr_ops.mkLambdaC(
[CAst.make @@ Name a; CAst.make @@ Name b],
- Constrexpr.Default Explicit,
- wf_arg_type,
- Constrexpr_ops.mkAppC(wf_rel_expr,
- [
- Constrexpr_ops.mkAppC(wf_mes_expr,[Constrexpr_ops.mkIdentC a]);
- Constrexpr_ops.mkAppC(wf_mes_expr,[Constrexpr_ops.mkIdentC b])
- ])
- )
- in
- wf_rel_with_mes,false
- in
- register_wf ~is_mes:is_mes fname rec_impls wf_rel_from_mes wf_arg
+ Constrexpr.Default Explicit,
+ wf_arg_type,
+ Constrexpr_ops.mkAppC(wf_rel_expr,
+ [
+ Constrexpr_ops.mkAppC(wf_mes_expr,[Constrexpr_ops.mkIdentC a]);
+ Constrexpr_ops.mkAppC(wf_mes_expr,[Constrexpr_ops.mkIdentC b])
+ ])
+ )
+ in
+ wf_rel_with_mes,false
+ in
+ register_wf interactive_proof ~is_mes:is_mes fname rec_impls wf_rel_from_mes wf_arg
using_lemmas args ret_type body
-let map_option f = function
- | None -> None
+let map_option f = function
+ | None -> None
| Some v -> Some (f v)
open Constrexpr
let rec rebuild_bl aux bl typ =
- match bl,typ with
- | [], _ -> List.rev aux,typ
- | (CLocalAssum(nal,bk,_))::bl',typ ->
- rebuild_nal aux bk bl' nal typ
- | (CLocalDef(na,_,_))::bl',{ CAst.v = CLetIn(_,nat,ty,typ') } ->
- rebuild_bl (Constrexpr.CLocalDef(na,nat,ty)::aux)
- bl' typ'
- | _ -> assert false
+ match bl,typ with
+ | [], _ -> List.rev aux,typ
+ | (CLocalAssum(nal,bk,_))::bl',typ ->
+ rebuild_nal aux bk bl' nal typ
+ | (CLocalDef(na,_,_))::bl',{ CAst.v = CLetIn(_,nat,ty,typ') } ->
+ rebuild_bl (Constrexpr.CLocalDef(na,nat,ty)::aux)
+ bl' typ'
+ | _ -> assert false
and rebuild_nal aux bk bl' nal typ =
- match nal,typ with
- | _,{ CAst.v = CProdN([],typ) } -> rebuild_nal aux bk bl' nal typ
- | [], _ -> rebuild_bl aux bl' typ
+ match nal,typ with
+ | _,{ CAst.v = CProdN([],typ) } -> rebuild_nal aux bk bl' nal typ
+ | [], _ -> rebuild_bl aux bl' typ
| na::nal,{ CAst.v = CProdN(CLocalAssum(na'::nal',bk',nal't)::rest,typ') } ->
if Name.equal (na.CAst.v) (na'.CAst.v) || Name.is_anonymous (na'.CAst.v)
- then
- let assum = CLocalAssum([na],bk,nal't) in
+ then
+ let assum = CLocalAssum([na],bk,nal't) in
let new_rest = if nal' = [] then rest else (CLocalAssum(nal',bk',nal't)::rest) in
- rebuild_nal
- (assum::aux)
- bk
- bl'
- nal
- (CAst.make @@ CProdN(new_rest,typ'))
- else
- let assum = CLocalAssum([na'],bk,nal't) in
+ rebuild_nal
+ (assum::aux)
+ bk
+ bl'
+ nal
+ (CAst.make @@ CProdN(new_rest,typ'))
+ else
+ let assum = CLocalAssum([na'],bk,nal't) in
let new_rest = if nal' = [] then rest else (CLocalAssum(nal',bk',nal't)::rest) in
- rebuild_nal
- (assum::aux)
- bk
- bl'
- (na::nal)
- (CAst.make @@ CProdN(new_rest,typ'))
- | _ ->
- assert false
+ rebuild_nal
+ (assum::aux)
+ bk
+ bl'
+ (na::nal)
+ (CAst.make @@ CProdN(new_rest,typ'))
+ | _ ->
+ assert false
let rebuild_bl aux bl typ = rebuild_bl aux bl typ
-let recompute_binder_list (fixpoint_exprl : (Vernacexpr.fixpoint_expr * Vernacexpr.decl_notation list) list) =
+let recompute_binder_list (fixpoint_exprl : (Vernacexpr.fixpoint_expr * Vernacexpr.decl_notation list) list) =
let fixl,ntns = ComFixpoint.extract_fixpoint_components ~structonly:false fixpoint_exprl in
let ((_,_,_,typel),_,ctx,_) = ComFixpoint.interp_fixpoint ~cofix:false fixl ntns in
let constr_expr_typel =
with_full_print (List.map (fun c -> Constrextern.extern_constr false (Global.env ()) (Evd.from_ctx ctx) (EConstr.of_constr c))) typel in
- let fixpoint_exprl_with_new_bl =
+ let fixpoint_exprl_with_new_bl =
List.map2 (fun ((lna,rec_order_opt,bl,ret_typ,opt_body),notation_list) fix_typ ->
-
- let new_bl',new_ret_type = rebuild_bl [] bl fix_typ in
+
+ let new_bl',new_ret_type = rebuild_bl [] bl fix_typ in
(((lna,rec_order_opt,new_bl',new_ret_type,opt_body),notation_list):(Vernacexpr.fixpoint_expr * Vernacexpr.decl_notation list))
)
- fixpoint_exprl constr_expr_typel
- in
+ fixpoint_exprl constr_expr_typel
+ in
fixpoint_exprl_with_new_bl
-
-let do_generate_principle ~pstate pconstants on_error register_built interactive_proof
- (fixpoint_exprl:(Vernacexpr.fixpoint_expr * Vernacexpr.decl_notation list) list) : Proof_global.t option =
+
+let do_generate_principle_aux pconstants on_error register_built interactive_proof
+ (fixpoint_exprl:(Vernacexpr.fixpoint_expr * Vernacexpr.decl_notation list) list) : Lemmas.t option =
List.iter (fun (_,l) -> if not (List.is_empty l) then error "Function does not support notations for now") fixpoint_exprl;
- let pstate, _is_struct =
+ let lemma, _is_struct =
match fixpoint_exprl with
| [((_,Some {CAst.v = Constrexpr.CWfRec (wf_x,wf_rel)},_,_,_),_) as fixpoint_expr] ->
let (((({CAst.v=name},pl),_,args,types,body)),_) as fixpoint_expr =
- match recompute_binder_list [fixpoint_expr] with
- | [e] -> e
- | _ -> assert false
- in
- let fixpoint_exprl = [fixpoint_expr] in
- let body = match body with | Some body -> body | None -> user_err ~hdr:"Function" (str "Body of Function must be given") in
- let recdefs,rec_impls = build_newrecursive fixpoint_exprl in
- let using_lemmas = [] in
- let pre_hook pconstants =
- generate_principle
- (ref (Evd.from_env (Global.env ())))
- pconstants
- on_error
- true
- register_built
- fixpoint_exprl
- recdefs
- true
- in
- if register_built
- then register_wf name rec_impls wf_rel wf_x.CAst.v using_lemmas args types body pre_hook, false
- else pstate, false
+ match recompute_binder_list [fixpoint_expr] with
+ | [e] -> e
+ | _ -> assert false
+ in
+ let fixpoint_exprl = [fixpoint_expr] in
+ let body = match body with | Some body -> body | None -> user_err ~hdr:"Function" (str "Body of Function must be given") in
+ let recdefs,rec_impls = build_newrecursive fixpoint_exprl in
+ let using_lemmas = [] in
+ let pre_hook pconstants =
+ generate_principle
+ (ref (Evd.from_env (Global.env ())))
+ pconstants
+ on_error
+ true
+ register_built
+ fixpoint_exprl
+ recdefs
+ true
+ in
+ if register_built
+ then register_wf interactive_proof name rec_impls wf_rel wf_x.CAst.v using_lemmas args types body pre_hook, false
+ else None, false
|[((_,Some {CAst.v = Constrexpr.CMeasureRec(wf_x,wf_mes,wf_rel_opt)},_,_,_),_) as fixpoint_expr] ->
let (((({CAst.v=name},_),_,args,types,body)),_) as fixpoint_expr =
- match recompute_binder_list [fixpoint_expr] with
- | [e] -> e
- | _ -> assert false
- in
- let fixpoint_exprl = [fixpoint_expr] in
- let recdefs,rec_impls = build_newrecursive fixpoint_exprl in
- let using_lemmas = [] in
- let body = match body with | Some body -> body | None -> user_err ~hdr:"Function" (str "Body of Function must be given") in
- let pre_hook pconstants =
- generate_principle
- (ref (Evd.from_env (Global.env ())))
- pconstants
- on_error
- true
- register_built
- fixpoint_exprl
- recdefs
- true
- in
- if register_built
- then register_mes name rec_impls wf_mes wf_rel_opt (map_option (fun x -> x.CAst.v) wf_x) using_lemmas args types body pre_hook, true
- else pstate, true
+ match recompute_binder_list [fixpoint_expr] with
+ | [e] -> e
+ | _ -> assert false
+ in
+ let fixpoint_exprl = [fixpoint_expr] in
+ let recdefs,rec_impls = build_newrecursive fixpoint_exprl in
+ let using_lemmas = [] in
+ let body = match body with | Some body -> body | None -> user_err ~hdr:"Function" (str "Body of Function must be given") in
+ let pre_hook pconstants =
+ generate_principle
+ (ref (Evd.from_env (Global.env ())))
+ pconstants
+ on_error
+ true
+ register_built
+ fixpoint_exprl
+ recdefs
+ true
+ in
+ if register_built
+ then register_mes interactive_proof name rec_impls wf_mes wf_rel_opt (map_option (fun x -> x.CAst.v) wf_x) using_lemmas args types body pre_hook, true
+ else None, true
| _ ->
List.iter (function ((_na,ord,_args,_body,_type),_not) ->
- match ord with
+ match ord with
| Some { CAst.v = (Constrexpr.CMeasureRec _ | Constrexpr.CWfRec _) } ->
- error
- ("Cannot use mutual definition with well-founded recursion or measure")
- | _ -> ()
- )
- fixpoint_exprl;
- let fixpoint_exprl = recompute_binder_list fixpoint_exprl in
- let fix_names =
+ error
+ ("Cannot use mutual definition with well-founded recursion or measure")
+ | _ -> ()
+ )
+ fixpoint_exprl;
+ let fixpoint_exprl = recompute_binder_list fixpoint_exprl in
+ let fix_names =
List.map (function ((({CAst.v=name},_),_,_,_,_),_) -> name) fixpoint_exprl
- in
- (* ok all the expressions are structural *)
- let recdefs,rec_impls = build_newrecursive fixpoint_exprl in
- let is_rec = List.exists (is_rec fix_names) recdefs in
- let pstate,evd,pconstants =
- if register_built
- then register_struct ~pstate is_rec fixpoint_exprl
- else pstate, Evd.from_env (Global.env ()), pconstants
- in
- let evd = ref evd in
- generate_principle
- (ref !evd)
- pconstants
- on_error
- false
- register_built
- fixpoint_exprl
- recdefs
- interactive_proof
- (Functional_principles_proofs.prove_princ_for_struct evd interactive_proof);
+ in
+ (* ok all the expressions are structural *)
+ let recdefs,rec_impls = build_newrecursive fixpoint_exprl in
+ let is_rec = List.exists (is_rec fix_names) recdefs in
+ let lemma,evd,pconstants =
+ if register_built
+ then register_struct is_rec fixpoint_exprl
+ else None, Evd.from_env (Global.env ()), pconstants
+ in
+ let evd = ref evd in
+ generate_principle
+ (ref !evd)
+ pconstants
+ on_error
+ false
+ register_built
+ fixpoint_exprl
+ recdefs
+ interactive_proof
+ (Functional_principles_proofs.prove_princ_for_struct evd interactive_proof);
if register_built then
begin derive_inversion fix_names; end;
- pstate, true
+ lemma, true
in
- pstate
+ lemma
let rec add_args id new_args = CAst.map (function
| CRef (qid,_) as b ->
@@ -734,12 +734,12 @@ let rec add_args id new_args = CAst.map (function
CProdN(List.map (function CLocalAssum (nal,k,b2) -> CLocalAssum (nal,k,add_args id new_args b2)
| CLocalDef (na,b1,t) -> CLocalDef (na,add_args id new_args b1,Option.map (add_args id new_args) t)
| CLocalPattern _ -> user_err (Pp.str "pattern with quote not allowed here.")) nal,
- add_args id new_args b1)
+ add_args id new_args b1)
| CLambdaN(nal,b1) ->
CLambdaN(List.map (function CLocalAssum (nal,k,b2) -> CLocalAssum (nal,k,add_args id new_args b2)
| CLocalDef (na,b1,t) -> CLocalDef (na,add_args id new_args b1,Option.map (add_args id new_args) t)
| CLocalPattern _ -> user_err (Pp.str "pattern with quote not allowed here.")) nal,
- add_args id new_args b1)
+ add_args id new_args b1)
| CLetIn(na,b1,t,b2) ->
CLetIn(na,add_args id new_args b1,Option.map (add_args id new_args) t,add_args id new_args b2)
| CAppExpl((pf,qid,us),exprl) ->
@@ -748,26 +748,26 @@ let rec add_args id new_args = CAst.map (function
else CAppExpl((pf,qid,us),List.map (add_args id new_args) exprl)
| CApp((pf,b),bl) ->
CApp((pf,add_args id new_args b),
- List.map (fun (e,o) -> add_args id new_args e,o) bl)
+ List.map (fun (e,o) -> add_args id new_args e,o) bl)
| CCases(sty,b_option,cel,cal) ->
CCases(sty,Option.map (add_args id new_args) b_option,
- List.map (fun (b,na,b_option) ->
- add_args id new_args b,
- na, b_option) cel,
+ List.map (fun (b,na,b_option) ->
+ add_args id new_args b,
+ na, b_option) cel,
List.map CAst.(map (fun (cpl,e) -> (cpl,add_args id new_args e))) cal
- )
+ )
| CLetTuple(nal,(na,b_option),b1,b2) ->
CLetTuple(nal,(na,Option.map (add_args id new_args) b_option),
- add_args id new_args b1,
- add_args id new_args b2
- )
+ add_args id new_args b1,
+ add_args id new_args b2
+ )
| CIf(b1,(na,b_option),b2,b3) ->
CIf(add_args id new_args b1,
- (na,Option.map (add_args id new_args) b_option),
- add_args id new_args b2,
- add_args id new_args b3
- )
+ (na,Option.map (add_args id new_args) b_option),
+ add_args id new_args b2,
+ add_args id new_args b3
+ )
| CHole _
| CPatVar _
| CEvar _
@@ -794,35 +794,35 @@ let rec chop_n_arrow n t =
else (* If not we check the form of [t] *)
match t.CAst.v with
| Constrexpr.CProdN(nal_ta',t') -> (* If we have a forall, two results are possible :
- either we need to discard more than the number of arrows contained
- in this product declaration then we just recall [chop_n_arrow] on
- the remaining number of arrow to chop and [t'] we discard it and
- recall [chop_n_arrow], either this product contains more arrows
- than the number we need to chop and then we return the new type
- *)
- begin
- try
- let new_n =
- let rec aux (n:int) = function
- [] -> n
+ either we need to discard more than the number of arrows contained
+ in this product declaration then we just recall [chop_n_arrow] on
+ the remaining number of arrow to chop and [t'] we discard it and
+ recall [chop_n_arrow], either this product contains more arrows
+ than the number we need to chop and then we return the new type
+ *)
+ begin
+ try
+ let new_n =
+ let rec aux (n:int) = function
+ [] -> n
| CLocalAssum(nal,k,t'')::nal_ta' ->
- let nal_l = List.length nal in
- if n >= nal_l
- then
- aux (n - nal_l) nal_ta'
- else
- let new_t' = CAst.make @@
- Constrexpr.CProdN(
+ let nal_l = List.length nal in
+ if n >= nal_l
+ then
+ aux (n - nal_l) nal_ta'
+ else
+ let new_t' = CAst.make @@
+ Constrexpr.CProdN(
CLocalAssum((snd (List.chop n nal)),k,t'')::nal_ta',t')
- in
- raise (Stop new_t')
+ in
+ raise (Stop new_t')
| _ -> anomaly (Pp.str "Not enough products.")
- in
- aux n nal_ta'
- in
- chop_n_arrow new_n t'
- with Stop t -> t
- end
+ in
+ aux n nal_ta'
+ in
+ chop_n_arrow new_n t'
+ with Stop t -> t
+ end
| _ -> anomaly (Pp.str "Not enough products.")
@@ -830,18 +830,18 @@ let rec get_args b t : Constrexpr.local_binder_expr list *
Constrexpr.constr_expr * Constrexpr.constr_expr =
match b.CAst.v with
| Constrexpr.CLambdaN (CLocalAssum(nal,k,ta) as d::rest, b') ->
- begin
+ begin
let n = List.length nal in
let nal_tas,b'',t'' = get_args (CAst.make ?loc:b.CAst.loc @@ Constrexpr.CLambdaN (rest,b')) (chop_n_arrow n t) in
d :: nal_tas, b'',t''
- end
+ end
| Constrexpr.CLambdaN ([], b) -> [],b,t
| _ -> [],b,t
-let make_graph ~pstate (f_ref : GlobRef.t) =
- let sigma, env = Option.cata Pfedit.get_current_context
- (let e = Global.env () in Evd.from_env e, e) pstate in
+let make_graph (f_ref : GlobRef.t) =
+ let env = Global.env() in
+ let sigma = Evd.from_env env in
let c,c_body =
match f_ref with
| ConstRef c ->
@@ -851,19 +851,19 @@ let make_graph ~pstate (f_ref : GlobRef.t) =
end
| _ -> raise (UserError (None, str "Not a function reference") )
in
- (match Global.body_of_constant_body c_body with
+ (match Global.body_of_constant_body Library.indirect_accessor c_body with
| None -> error "Cannot build a graph over an axiom!"
- | Some (body, _) ->
+ | Some (body, _, _) ->
let env = Global.env () in
- let extern_body,extern_type =
- with_full_print (fun () ->
- (Constrextern.extern_constr false env sigma (EConstr.of_constr body),
- Constrextern.extern_type false env sigma
+ let extern_body,extern_type =
+ with_full_print (fun () ->
+ (Constrextern.extern_constr false env sigma (EConstr.of_constr body),
+ Constrextern.extern_type false env sigma
(EConstr.of_constr (*FIXME*) c_body.const_type)
- )
- )
- ()
- in
+ )
+ )
+ ()
+ in
let (nal_tas,b,t) = get_args extern_body extern_type in
let expr_list =
match b.CAst.v with
@@ -897,16 +897,32 @@ let make_graph ~pstate (f_ref : GlobRef.t) =
fixexprl
in
l
- | _ ->
- let id = Label.to_id (Constant.label c) in
+ | _ ->
+ let id = Label.to_id (Constant.label c) in
[((CAst.make id,None),None,nal_tas,t,Some b),[]]
- in
+ in
let mp = Constant.modpath c in
- let pstate = do_generate_principle ~pstate [c,Univ.Instance.empty] error_error false false expr_list in
- (* We register the infos *)
- List.iter
+ let pstate = do_generate_principle_aux [c,Univ.Instance.empty] error_error false false expr_list in
+ assert (Option.is_empty pstate);
+ (* We register the infos *)
+ List.iter
(fun ((({CAst.v=id},_),_,_,_,_),_) -> add_Function false (Constant.make2 mp (Label.of_id id)))
- expr_list;
- pstate)
-
-let do_generate_principle = do_generate_principle [] warning_error true
+ expr_list)
+
+(* *************** statically typed entrypoints ************************* *)
+
+let do_generate_principle_interactive fixl : Lemmas.t =
+ match
+ do_generate_principle_aux [] warning_error true true fixl
+ with
+ | Some lemma -> lemma
+ | None ->
+ CErrors.anomaly
+ (Pp.str"indfun: leaving no open proof in interactive mode")
+
+let do_generate_principle fixl : unit =
+ match do_generate_principle_aux [] warning_error true false fixl with
+ | Some _lemma ->
+ CErrors.anomaly
+ (Pp.str"indfun: leaving a goal open in non-interactive mode")
+ | None -> ()
diff --git a/plugins/funind/indfun.mli b/plugins/funind/indfun.mli
index acf85f539e..3bc52272ac 100644
--- a/plugins/funind/indfun.mli
+++ b/plugins/funind/indfun.mli
@@ -5,10 +5,12 @@ val warn_cannot_define_graph : ?loc:Loc.t -> Pp.t * Pp.t -> unit
val warn_cannot_define_principle : ?loc:Loc.t -> Pp.t * Pp.t -> unit
-val do_generate_principle : pstate:Proof_global.t option ->
- bool ->
+val do_generate_principle :
+ (Vernacexpr.fixpoint_expr * Vernacexpr.decl_notation list) list -> unit
+
+val do_generate_principle_interactive :
(Vernacexpr.fixpoint_expr * Vernacexpr.decl_notation list) list ->
- Proof_global.t option
+ Lemmas.t
val functional_induction :
bool ->
@@ -17,4 +19,4 @@ val functional_induction :
Ltac_plugin.Tacexpr.or_and_intro_pattern option ->
Goal.goal Evd.sigma -> Goal.goal list Evd.sigma
-val make_graph : pstate:Proof_global.t option -> GlobRef.t -> Proof_global.t option
+val make_graph : GlobRef.t -> unit
diff --git a/plugins/funind/indfun_common.ml b/plugins/funind/indfun_common.ml
index 40f66ce5eb..17c79e0e6c 100644
--- a/plugins/funind/indfun_common.ml
+++ b/plugins/funind/indfun_common.ml
@@ -49,10 +49,10 @@ let filter_map filter f =
let rec it = function
| [] -> []
| e::l ->
- if filter e
- then
- (f e) :: it l
- else it l
+ if filter e
+ then
+ (f e) :: it l
+ else it l
in
it
@@ -62,12 +62,12 @@ let chop_rlambda_n =
if n == 0
then List.rev acc,rt
else
- match DAst.get rt with
- | Glob_term.GLambda(name,k,t,b) -> chop_lambda_n ((name,t,None)::acc) (n-1) b
- | Glob_term.GLetIn(name,v,t,b) -> chop_lambda_n ((name,v,t)::acc) (n-1) b
- | _ ->
- raise (CErrors.UserError(Some "chop_rlambda_n",
- str "chop_rlambda_n: Not enough Lambdas"))
+ match DAst.get rt with
+ | Glob_term.GLambda(name,k,t,b) -> chop_lambda_n ((name,t,None)::acc) (n-1) b
+ | Glob_term.GLetIn(name,v,t,b) -> chop_lambda_n ((name,v,t)::acc) (n-1) b
+ | _ ->
+ raise (CErrors.UserError(Some "chop_rlambda_n",
+ str "chop_rlambda_n: Not enough Lambdas"))
in
chop_lambda_n []
@@ -76,9 +76,9 @@ let chop_rprod_n =
if n == 0
then List.rev acc,rt
else
- match DAst.get rt with
- | Glob_term.GProd(name,k,t,b) -> chop_prod_n ((name,t)::acc) (n-1) b
- | _ -> raise (CErrors.UserError(Some "chop_rprod_n",str "chop_rprod_n: Not enough products"))
+ match DAst.get rt with
+ | Glob_term.GProd(name,k,t,b) -> chop_prod_n ((name,t)::acc) (n-1) b
+ | _ -> raise (CErrors.UserError(Some "chop_rprod_n",str "chop_rprod_n: Not enough products"))
in
chop_prod_n []
@@ -115,35 +115,28 @@ let eq = lazy(EConstr.of_constr (coq_constant "eq"))
let refl_equal = lazy(EConstr.of_constr (coq_constant "eq_refl"))
(*****************************************************************)
-(* Copy of the standart save mechanism but without the much too *)
+(* Copy of the standard save mechanism but without the much too *)
(* slow reduction function *)
(*****************************************************************)
-open Entries
open Decl_kinds
open Declare
let definition_message = Declare.definition_message
-let get_locality = function
-| Discharge -> true
-| Local -> true
-| Global -> false
-
let save id const ?hook uctx (locality,_,kind) =
- let fix_exn = Future.fix_exn_of const.const_entry_body in
- let l,r = match locality with
- | Discharge when Lib.sections_are_opened () ->
+ let fix_exn = Future.fix_exn_of const.Proof_global.proof_entry_body in
+ let r = match locality with
+ | Discharge ->
let k = Kindops.logical_kind_of_goal_kind kind in
- let c = SectionLocalDef const in
- let _ = declare_variable id (Lib.cwd(), c, k) in
- (Local, VarRef id)
- | Discharge | Local | Global ->
- let local = get_locality locality in
+ let c = SectionLocalDef const in
+ let _ = declare_variable id (Lib.cwd(), c, k) in
+ VarRef id
+ | Global local ->
let k = Kindops.logical_kind_of_goal_kind kind in
- let kn = declare_constant id ~local (DefinitionEntry const, k) in
- (locality, ConstRef kn)
+ let kn = declare_constant id ~local (Declare.DefinitionEntry const, k) in
+ ConstRef kn
in
- Lemmas.call_hook ?hook ~fix_exn uctx [] l r;
+ DeclareDef.Hook.call ?hook ~fix_exn uctx [] locality r;
definition_message id
let with_full_print f a =
@@ -172,14 +165,14 @@ let with_full_print f a =
res
with
| reraise ->
- Impargs.make_implicit_args old_implicit_args;
- Impargs.make_strict_implicit_args old_strict_implicit_args;
- Impargs.make_contextual_implicit_args old_contextual_implicit_args;
- Flags.raw_print := old_rawprint;
- Constrextern.print_universes := old_printuniverses;
+ Impargs.make_implicit_args old_implicit_args;
+ Impargs.make_strict_implicit_args old_strict_implicit_args;
+ Impargs.make_contextual_implicit_args old_contextual_implicit_args;
+ Flags.raw_print := old_rawprint;
+ Constrextern.print_universes := old_printuniverses;
Detyping.print_allow_match_default_clause := old_printallowmatchdefaultclause;
- Dumpglob.continue ();
- raise reraise
+ Dumpglob.continue ();
+ raise reraise
@@ -219,8 +212,8 @@ let rec do_cache_info finfo = function
else if finfo'.function_constant = finfo.function_constant
then finfo::finfos
else
- let res = do_cache_info finfo finfos in
- if res == finfos then l else finfo'::l
+ let res = do_cache_info finfo finfos in
+ if res == finfos then l else finfo'::l
let cache_Function (_,(finfos)) =
@@ -324,7 +317,7 @@ let find_Function_of_graph ind =
let update_Function finfo =
(* Pp.msgnl (pr_info finfo); *)
Lib.add_anonymous_leaf (in_Function finfo)
-
+
let add_Function is_general f =
let f_id = Label.to_id (Constant.label f) in
@@ -357,12 +350,12 @@ let add_Function is_general f =
let pr_table env sigma = pr_table env sigma !from_function
(*********************************)
-(* Debuging *)
+(* Debugging *)
let functional_induction_rewrite_dependent_proofs = ref true
let function_debug = ref false
open Goptions
-let functional_induction_rewrite_dependent_proofs_sig =
+let functional_induction_rewrite_dependent_proofs_sig =
{
optdepr = false;
optname = "Functional Induction Rewrite Dependent";
@@ -386,7 +379,7 @@ let function_debug_sig =
let () = declare_bool_option function_debug_sig
-let do_observe () = !function_debug
+let do_observe () = !function_debug
diff --git a/plugins/funind/indfun_common.mli b/plugins/funind/indfun_common.mli
index 9670cf1fa7..1d096fa488 100644
--- a/plugins/funind/indfun_common.mli
+++ b/plugins/funind/indfun_common.mli
@@ -44,8 +44,8 @@ val jmeq_refl : unit -> EConstr.constr
val save
: Id.t
- -> Safe_typing.private_constants Entries.definition_entry
- -> ?hook:Lemmas.declaration_hook
+ -> Evd.side_effects Proof_global.proof_entry
+ -> ?hook:DeclareDef.Hook.t
-> UState.t
-> Decl_kinds.goal_kind
-> unit
diff --git a/plugins/funind/invfun.ml b/plugins/funind/invfun.ml
index edb698280f..2020881c7c 100644
--- a/plugins/funind/invfun.ml
+++ b/plugins/funind/invfun.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -56,7 +56,7 @@ let do_observe_tac s tac g =
let reraise = CErrors.push reraise in
let e = ExplainErr.process_vernac_interp_error reraise in
observe (hov 0 (str "observation "++ s++str " raised exception " ++
- CErrors.iprint e ++ str " on goal" ++ fnl() ++ goal ));
+ CErrors.iprint e ++ str " on goal" ++ fnl() ++ goal ));
iraise reraise;;
let observe_tac s tac g =
@@ -115,8 +115,8 @@ let generate_type evd g_to_f f graph i =
in
(*i We need to name the vars [res] and [fv] i*)
let filter = fun decl -> match RelDecl.get_name decl with
- | Name id -> Some id
- | Anonymous -> None
+ | Name id -> Some id
+ | Anonymous -> None
in
let named_ctxt = Id.Set.of_list (List.map_filter filter fun_ctxt) in
let res_id = Namegen.next_ident_away_in_goal (Id.of_string "_res") named_ctxt in
@@ -232,12 +232,12 @@ let prove_fun_correct evd funs_constr graphs_constr schemes lemmas_types_infos i
(* and built the intro pattern for each of them *)
let intro_pats =
List.map
- (fun decl ->
- List.map
+ (fun decl ->
+ List.map
(fun id -> CAst.make @@ IntroNaming (Namegen.IntroIdentifier id))
- (generate_fresh_id (Id.of_string "y") ids (List.length (fst (decompose_prod_assum evd (RelDecl.get_type decl)))))
- )
- branches
+ (generate_fresh_id (Id.of_string "y") ids (List.length (fst (decompose_prod_assum evd (RelDecl.get_type decl)))))
+ )
+ branches
in
(* before building the full intro pattern for the principle *)
let eq_ind = make_eq () in
@@ -249,113 +249,113 @@ let prove_fun_correct evd funs_constr graphs_constr schemes lemmas_types_infos i
let prove_branche i g =
(* We get the identifiers of this branch *)
let pre_args =
- List.fold_right
+ List.fold_right
(fun {CAst.v=pat} acc ->
- match pat with
+ match pat with
| IntroNaming (Namegen.IntroIdentifier id) -> id::acc
- | _ -> anomaly (Pp.str "Not an identifier.")
- )
- (List.nth intro_pats (pred i))
- []
+ | _ -> anomaly (Pp.str "Not an identifier.")
+ )
+ (List.nth intro_pats (pred i))
+ []
in
(* and get the real args of the branch by unfolding the defined constant *)
(*
- We can then recompute the arguments of the constructor.
- For each [hid] introduced by this branch, if [hid] has type
- $forall res, res=fv -> graph.(j)\ x_1\ x_n res$ the corresponding arguments of the constructor are
- [ fv (hid fv (refl_equal fv)) ].
- If [hid] has another type the corresponding argument of the constructor is [hid]
+ We can then recompute the arguments of the constructor.
+ For each [hid] introduced by this branch, if [hid] has type
+ $forall res, res=fv -> graph.(j)\ x_1\ x_n res$ the corresponding arguments of the constructor are
+ [ fv (hid fv (refl_equal fv)) ].
+ If [hid] has another type the corresponding argument of the constructor is [hid]
*)
let constructor_args g =
- List.fold_right
- (fun hid acc ->
- let type_of_hid = pf_unsafe_type_of g (mkVar hid) in
- let sigma = project g in
- match EConstr.kind sigma type_of_hid with
+ List.fold_right
+ (fun hid acc ->
+ let type_of_hid = pf_unsafe_type_of g (mkVar hid) in
+ let sigma = project g in
+ match EConstr.kind sigma type_of_hid with
| Prod(_,_,t') ->
- begin
- match EConstr.kind sigma t' with
+ begin
+ match EConstr.kind sigma t' with
| Prod(_,t'',t''') ->
- begin
- match EConstr.kind sigma t'',EConstr.kind sigma t''' with
- | App(eq,args), App(graph',_)
- when
- (EConstr.eq_constr sigma eq eq_ind) &&
- Array.exists (EConstr.eq_constr_nounivs sigma graph') graphs_constr ->
- (args.(2)::(mkApp(mkVar hid,[|args.(2);(mkApp(eq_construct,[|args.(0);args.(2)|]))|]))
- ::acc)
- | _ -> mkVar hid :: acc
- end
- | _ -> mkVar hid :: acc
- end
- | _ -> mkVar hid :: acc
- ) pre_args []
+ begin
+ match EConstr.kind sigma t'',EConstr.kind sigma t''' with
+ | App(eq,args), App(graph',_)
+ when
+ (EConstr.eq_constr sigma eq eq_ind) &&
+ Array.exists (EConstr.eq_constr_nounivs sigma graph') graphs_constr ->
+ (args.(2)::(mkApp(mkVar hid,[|args.(2);(mkApp(eq_construct,[|args.(0);args.(2)|]))|]))
+ ::acc)
+ | _ -> mkVar hid :: acc
+ end
+ | _ -> mkVar hid :: acc
+ end
+ | _ -> mkVar hid :: acc
+ ) pre_args []
in
(* in fact we must also add the parameters to the constructor args *)
let constructor_args g =
- let params_id = fst (List.chop princ_infos.nparams args_names) in
- (List.map mkVar params_id)@((constructor_args g))
+ let params_id = fst (List.chop princ_infos.nparams args_names) in
+ (List.map mkVar params_id)@((constructor_args g))
in
(* We then get the constructor corresponding to this branch and
- modifies the references has needed i.e.
- if the constructor is the last one of the current inductive then
- add one the number of the inductive to take and add the number of constructor of the previous
- graph to the minimal constructor number
+ modifies the references has needed i.e.
+ if the constructor is the last one of the current inductive then
+ add one the number of the inductive to take and add the number of constructor of the previous
+ graph to the minimal constructor number
*)
let constructor =
- let constructor_num = i - !min_constr_number in
- let length = Array.length (mib.Declarations.mind_packets.(!ind_number).Declarations.mind_consnames) in
- if constructor_num <= length
- then
- begin
- (kn,!ind_number),constructor_num
- end
- else
- begin
- incr ind_number;
- min_constr_number := !min_constr_number + length ;
- (kn,!ind_number),1
- end
+ let constructor_num = i - !min_constr_number in
+ let length = Array.length (mib.Declarations.mind_packets.(!ind_number).Declarations.mind_consnames) in
+ if constructor_num <= length
+ then
+ begin
+ (kn,!ind_number),constructor_num
+ end
+ else
+ begin
+ incr ind_number;
+ min_constr_number := !min_constr_number + length ;
+ (kn,!ind_number),1
+ end
in
(* we can then build the final proof term *)
let app_constructor g = applist((mkConstructU(constructor,u)),constructor_args g) in
(* an apply the tactic *)
let res,hres =
- match generate_fresh_id (Id.of_string "z") (ids(* @this_branche_ids *)) 2 with
- | [res;hres] -> res,hres
- | _ -> assert false
+ match generate_fresh_id (Id.of_string "z") (ids(* @this_branche_ids *)) 2 with
+ | [res;hres] -> res,hres
+ | _ -> assert false
in
(* observe (str "constructor := " ++ Printer.pr_lconstr_env (pf_env g) app_constructor); *)
(
- tclTHENLIST
- [
- observe_tac("h_intro_patterns ") (let l = (List.nth intro_pats (pred i)) in
- match l with
- | [] -> tclIDTAC
- | _ -> Proofview.V82.of_tactic (intro_patterns false l));
- (* unfolding of all the defined variables introduced by this branch *)
- (* observe_tac "unfolding" pre_tac; *)
- (* $zeta$ normalizing of the conclusion *)
- Proofview.V82.of_tactic (reduce
- (Genredexpr.Cbv
- { Redops.all_flags with
- Genredexpr.rDelta = false ;
- Genredexpr.rConst = []
- }
- )
- Locusops.onConcl);
- observe_tac ("toto ") tclIDTAC;
-
+ tclTHENLIST
+ [
+ observe_tac("h_intro_patterns ") (let l = (List.nth intro_pats (pred i)) in
+ match l with
+ | [] -> tclIDTAC
+ | _ -> Proofview.V82.of_tactic (intro_patterns false l));
+ (* unfolding of all the defined variables introduced by this branch *)
+ (* observe_tac "unfolding" pre_tac; *)
+ (* $zeta$ normalizing of the conclusion *)
+ Proofview.V82.of_tactic (reduce
+ (Genredexpr.Cbv
+ { Redops.all_flags with
+ Genredexpr.rDelta = false ;
+ Genredexpr.rConst = []
+ }
+ )
+ Locusops.onConcl);
+ observe_tac ("toto ") tclIDTAC;
+
(* introducing the result of the graph and the equality hypothesis *)
- observe_tac "introducing" (tclMAP (fun x -> Proofview.V82.of_tactic (Simple.intro x)) [res;hres]);
- (* replacing [res] with its value *)
- observe_tac "rewriting res value" (Proofview.V82.of_tactic (Equality.rewriteLR (mkVar hres)));
- (* Conclusion *)
- observe_tac "exact" (fun g ->
- Proofview.V82.of_tactic (exact_check (app_constructor g)) g)
- ]
+ observe_tac "introducing" (tclMAP (fun x -> Proofview.V82.of_tactic (Simple.intro x)) [res;hres]);
+ (* replacing [res] with its value *)
+ observe_tac "rewriting res value" (Proofview.V82.of_tactic (Equality.rewriteLR (mkVar hres)));
+ (* Conclusion *)
+ observe_tac "exact" (fun g ->
+ Proofview.V82.of_tactic (exact_check (app_constructor g)) g)
+ ]
)
- g
+ g
in
(* end of branche proof *)
let lemmas =
@@ -379,44 +379,44 @@ let prove_fun_correct evd funs_constr graphs_constr schemes lemmas_types_infos i
*)
let bindings =
let params_bindings,avoid =
- List.fold_left2
- (fun (bindings,avoid) decl p ->
- let id = Namegen.next_ident_away (Nameops.Name.get_id (RelDecl.get_name decl)) (Id.Set.of_list avoid) in
- p::bindings,id::avoid
- )
- ([],pf_ids_of_hyps g)
- princ_infos.params
- (List.rev params)
+ List.fold_left2
+ (fun (bindings,avoid) decl p ->
+ let id = Namegen.next_ident_away (Nameops.Name.get_id (RelDecl.get_name decl)) (Id.Set.of_list avoid) in
+ p::bindings,id::avoid
+ )
+ ([],pf_ids_of_hyps g)
+ princ_infos.params
+ (List.rev params)
in
let lemmas_bindings =
- List.rev (fst (List.fold_left2
- (fun (bindings,avoid) decl p ->
- let id = Namegen.next_ident_away (Nameops.Name.get_id (RelDecl.get_name decl)) (Id.Set.of_list avoid) in
+ List.rev (fst (List.fold_left2
+ (fun (bindings,avoid) decl p ->
+ let id = Namegen.next_ident_away (Nameops.Name.get_id (RelDecl.get_name decl)) (Id.Set.of_list avoid) in
(Reductionops.nf_zeta (pf_env g) (project g) p)::bindings,id::avoid)
- ([],avoid)
- princ_infos.predicates
- (lemmas)))
+ ([],avoid)
+ princ_infos.predicates
+ (lemmas)))
in
(params_bindings@lemmas_bindings)
in
tclTHENLIST
- [
- observe_tac "principle" (Proofview.V82.of_tactic (assert_by
- (Name principle_id)
- princ_type
- (exact_check f_principle)));
- observe_tac "intro args_names" (tclMAP (fun id -> Proofview.V82.of_tactic (Simple.intro id)) args_names);
- (* observe_tac "titi" (pose_proof (Name (Id.of_string "__")) (Reductionops.nf_beta Evd.empty ((mkApp (mkVar principle_id,Array.of_list bindings))))); *)
- observe_tac "idtac" tclIDTAC;
- tclTHEN_i
- (observe_tac
- "functional_induction" (
- (fun gl ->
- let term = mkApp (mkVar principle_id,Array.of_list bindings) in
- let gl', _ty = pf_eapply (Typing.type_of ~refresh:true) gl term in
- Proofview.V82.of_tactic (apply term) gl')
- ))
- (fun i g -> observe_tac ("proving branche "^string_of_int i) (prove_branche i) g )
+ [
+ observe_tac "principle" (Proofview.V82.of_tactic (assert_by
+ (Name principle_id)
+ princ_type
+ (exact_check f_principle)));
+ observe_tac "intro args_names" (tclMAP (fun id -> Proofview.V82.of_tactic (Simple.intro id)) args_names);
+ (* observe_tac "titi" (pose_proof (Name (Id.of_string "__")) (Reductionops.nf_beta Evd.empty ((mkApp (mkVar principle_id,Array.of_list bindings))))); *)
+ observe_tac "idtac" tclIDTAC;
+ tclTHEN_i
+ (observe_tac
+ "functional_induction" (
+ (fun gl ->
+ let term = mkApp (mkVar principle_id,Array.of_list bindings) in
+ let gl', _ty = pf_eapply (Typing.type_of ~refresh:true) gl term in
+ Proofview.V82.of_tactic (apply term) gl')
+ ))
+ (fun i g -> observe_tac ("proving branche "^string_of_int i) (prove_branche i) g )
]
g
@@ -431,7 +431,7 @@ let generalize_dependent_of x hyp g =
tclMAP
(function
| LocalAssum ({binder_name=id},t) when not (Id.equal id hyp) &&
- (Termops.occur_var (pf_env g) (project g) x t) -> tclTHEN (Proofview.V82.of_tactic (Tactics.generalize [mkVar id])) (thin [id])
+ (Termops.occur_var (pf_env g) (project g) x t) -> tclTHEN (Proofview.V82.of_tactic (Tactics.generalize [mkVar id])) (thin [id])
| _ -> tclIDTAC
)
(pf_hyps g)
@@ -458,99 +458,99 @@ and intros_with_rewrite_aux : Tacmach.tactic =
let sigma = project g in
match EConstr.kind sigma (pf_concl g) with
| Prod(_,t,t') ->
- begin
- match EConstr.kind sigma t with
- | App(eq,args) when (EConstr.eq_constr sigma eq eq_ind) ->
- if Reductionops.is_conv (pf_env g) (project g) args.(1) args.(2)
- then
- let id = pf_get_new_id (Id.of_string "y") g in
- tclTHENLIST [ Proofview.V82.of_tactic (Simple.intro id); thin [id]; intros_with_rewrite ] g
- else if isVar sigma args.(1) && (Environ.evaluable_named (destVar sigma args.(1)) (pf_env g))
- then tclTHENLIST[
- Proofview.V82.of_tactic (unfold_in_concl [(Locus.AllOccurrences, Names.EvalVarRef (destVar sigma args.(1)))]);
- tclMAP (fun id -> tclTRY(Proofview.V82.of_tactic (unfold_in_hyp [(Locus.AllOccurrences, Names.EvalVarRef (destVar sigma args.(1)))] ((destVar sigma args.(1)),Locus.InHyp) )))
- (pf_ids_of_hyps g);
- intros_with_rewrite
- ] g
- else if isVar sigma args.(2) && (Environ.evaluable_named (destVar sigma args.(2)) (pf_env g))
- then tclTHENLIST[
- Proofview.V82.of_tactic (unfold_in_concl [(Locus.AllOccurrences, Names.EvalVarRef (destVar sigma args.(2)))]);
- tclMAP (fun id -> tclTRY(Proofview.V82.of_tactic (unfold_in_hyp [(Locus.AllOccurrences, Names.EvalVarRef (destVar sigma args.(2)))] ((destVar sigma args.(2)),Locus.InHyp) )))
- (pf_ids_of_hyps g);
- intros_with_rewrite
- ] g
- else if isVar sigma args.(1)
- then
- let id = pf_get_new_id (Id.of_string "y") g in
- tclTHENLIST [ Proofview.V82.of_tactic (Simple.intro id);
- generalize_dependent_of (destVar sigma args.(1)) id;
- tclTRY (Proofview.V82.of_tactic (Equality.rewriteLR (mkVar id)));
- intros_with_rewrite
- ]
- g
- else if isVar sigma args.(2)
- then
- let id = pf_get_new_id (Id.of_string "y") g in
- tclTHENLIST [ Proofview.V82.of_tactic (Simple.intro id);
- generalize_dependent_of (destVar sigma args.(2)) id;
- tclTRY (Proofview.V82.of_tactic (Equality.rewriteRL (mkVar id)));
- intros_with_rewrite
- ]
- g
- else
- begin
- let id = pf_get_new_id (Id.of_string "y") g in
- tclTHENLIST[
- Proofview.V82.of_tactic (Simple.intro id);
- tclTRY (Proofview.V82.of_tactic (Equality.rewriteLR (mkVar id)));
- intros_with_rewrite
- ] g
- end
+ begin
+ match EConstr.kind sigma t with
+ | App(eq,args) when (EConstr.eq_constr sigma eq eq_ind) ->
+ if Reductionops.is_conv (pf_env g) (project g) args.(1) args.(2)
+ then
+ let id = pf_get_new_id (Id.of_string "y") g in
+ tclTHENLIST [ Proofview.V82.of_tactic (Simple.intro id); thin [id]; intros_with_rewrite ] g
+ else if isVar sigma args.(1) && (Environ.evaluable_named (destVar sigma args.(1)) (pf_env g))
+ then tclTHENLIST[
+ Proofview.V82.of_tactic (unfold_in_concl [(Locus.AllOccurrences, Names.EvalVarRef (destVar sigma args.(1)))]);
+ tclMAP (fun id -> tclTRY(Proofview.V82.of_tactic (unfold_in_hyp [(Locus.AllOccurrences, Names.EvalVarRef (destVar sigma args.(1)))] ((destVar sigma args.(1)),Locus.InHyp) )))
+ (pf_ids_of_hyps g);
+ intros_with_rewrite
+ ] g
+ else if isVar sigma args.(2) && (Environ.evaluable_named (destVar sigma args.(2)) (pf_env g))
+ then tclTHENLIST[
+ Proofview.V82.of_tactic (unfold_in_concl [(Locus.AllOccurrences, Names.EvalVarRef (destVar sigma args.(2)))]);
+ tclMAP (fun id -> tclTRY(Proofview.V82.of_tactic (unfold_in_hyp [(Locus.AllOccurrences, Names.EvalVarRef (destVar sigma args.(2)))] ((destVar sigma args.(2)),Locus.InHyp) )))
+ (pf_ids_of_hyps g);
+ intros_with_rewrite
+ ] g
+ else if isVar sigma args.(1)
+ then
+ let id = pf_get_new_id (Id.of_string "y") g in
+ tclTHENLIST [ Proofview.V82.of_tactic (Simple.intro id);
+ generalize_dependent_of (destVar sigma args.(1)) id;
+ tclTRY (Proofview.V82.of_tactic (Equality.rewriteLR (mkVar id)));
+ intros_with_rewrite
+ ]
+ g
+ else if isVar sigma args.(2)
+ then
+ let id = pf_get_new_id (Id.of_string "y") g in
+ tclTHENLIST [ Proofview.V82.of_tactic (Simple.intro id);
+ generalize_dependent_of (destVar sigma args.(2)) id;
+ tclTRY (Proofview.V82.of_tactic (Equality.rewriteRL (mkVar id)));
+ intros_with_rewrite
+ ]
+ g
+ else
+ begin
+ let id = pf_get_new_id (Id.of_string "y") g in
+ tclTHENLIST[
+ Proofview.V82.of_tactic (Simple.intro id);
+ tclTRY (Proofview.V82.of_tactic (Equality.rewriteLR (mkVar id)));
+ intros_with_rewrite
+ ] g
+ end
| Ind _ when EConstr.eq_constr sigma t (EConstr.of_constr (UnivGen.constr_of_monomorphic_global @@ Coqlib.lib_ref "core.False.type")) ->
- Proofview.V82.of_tactic tauto g
- | Case(_,_,v,_) ->
- tclTHENLIST[
- Proofview.V82.of_tactic (simplest_case v);
- intros_with_rewrite
- ] g
- | LetIn _ ->
- tclTHENLIST[
- Proofview.V82.of_tactic (reduce
- (Genredexpr.Cbv
- {Redops.all_flags
- with Genredexpr.rDelta = false;
- })
- Locusops.onConcl)
- ;
- intros_with_rewrite
- ] g
- | _ ->
- let id = pf_get_new_id (Id.of_string "y") g in
- tclTHENLIST [ Proofview.V82.of_tactic (Simple.intro id);intros_with_rewrite] g
- end
- | LetIn _ ->
- tclTHENLIST[
- Proofview.V82.of_tactic (reduce
- (Genredexpr.Cbv
- {Redops.all_flags
- with Genredexpr.rDelta = false;
- })
- Locusops.onConcl)
- ;
- intros_with_rewrite
- ] g
- | _ -> tclIDTAC g
+ Proofview.V82.of_tactic tauto g
+ | Case(_,_,v,_) ->
+ tclTHENLIST[
+ Proofview.V82.of_tactic (simplest_case v);
+ intros_with_rewrite
+ ] g
+ | LetIn _ ->
+ tclTHENLIST[
+ Proofview.V82.of_tactic (reduce
+ (Genredexpr.Cbv
+ {Redops.all_flags
+ with Genredexpr.rDelta = false;
+ })
+ Locusops.onConcl)
+ ;
+ intros_with_rewrite
+ ] g
+ | _ ->
+ let id = pf_get_new_id (Id.of_string "y") g in
+ tclTHENLIST [ Proofview.V82.of_tactic (Simple.intro id);intros_with_rewrite] g
+ end
+ | LetIn _ ->
+ tclTHENLIST[
+ Proofview.V82.of_tactic (reduce
+ (Genredexpr.Cbv
+ {Redops.all_flags
+ with Genredexpr.rDelta = false;
+ })
+ Locusops.onConcl)
+ ;
+ intros_with_rewrite
+ ] g
+ | _ -> tclIDTAC g
let rec reflexivity_with_destruct_cases g =
let destruct_case () =
try
match EConstr.kind (project g) (snd (destApp (project g) (pf_concl g))).(2) with
- | Case(_,_,v,_) ->
- tclTHENLIST[
- Proofview.V82.of_tactic (simplest_case v);
- Proofview.V82.of_tactic intros;
- observe_tac "reflexivity_with_destruct_cases" reflexivity_with_destruct_cases
- ]
+ | Case(_,_,v,_) ->
+ tclTHENLIST[
+ Proofview.V82.of_tactic (simplest_case v);
+ Proofview.V82.of_tactic intros;
+ observe_tac "reflexivity_with_destruct_cases" reflexivity_with_destruct_cases
+ ]
| _ -> Proofview.V82.of_tactic reflexivity
with e when CErrors.noncritical e -> Proofview.V82.of_tactic reflexivity
in
@@ -563,27 +563,27 @@ let rec reflexivity_with_destruct_cases g =
let discr_inject =
Tacticals.onAllHypsAndConcl (
fun sc g ->
- match sc with
- None -> tclIDTAC g
- | Some id ->
- match EConstr.kind (project g) (pf_unsafe_type_of g (mkVar id)) with
- | App(eq,[|_;t1;t2|]) when EConstr.eq_constr (project g) eq eq_ind ->
- if Equality.discriminable (pf_env g) (project g) t1 t2
- then Proofview.V82.of_tactic (Equality.discrHyp id) g
- else if Equality.injectable (pf_env g) (project g) ~keep_proofs:None t1 t2
- then tclTHENLIST [Proofview.V82.of_tactic (Equality.injHyp my_inj_flags None id);thin [id];intros_with_rewrite] g
- else tclIDTAC g
- | _ -> tclIDTAC g
+ match sc with
+ None -> tclIDTAC g
+ | Some id ->
+ match EConstr.kind (project g) (pf_unsafe_type_of g (mkVar id)) with
+ | App(eq,[|_;t1;t2|]) when EConstr.eq_constr (project g) eq eq_ind ->
+ if Equality.discriminable (pf_env g) (project g) t1 t2
+ then Proofview.V82.of_tactic (Equality.discrHyp id) g
+ else if Equality.injectable (pf_env g) (project g) ~keep_proofs:None t1 t2
+ then tclTHENLIST [Proofview.V82.of_tactic (Equality.injHyp my_inj_flags None id);thin [id];intros_with_rewrite] g
+ else tclIDTAC g
+ | _ -> tclIDTAC g
)
in
(tclFIRST
[ observe_tac "reflexivity_with_destruct_cases : reflexivity" (Proofview.V82.of_tactic reflexivity);
observe_tac "reflexivity_with_destruct_cases : destruct_case" ((destruct_case ()));
(* We reach this point ONLY if
- the same value is matched (at least) two times
- along binding path.
- In this case, either we have a discriminable hypothesis and we are done,
- either at least an injectable one and we do the injection before continuing
+ the same value is matched (at least) two times
+ along binding path.
+ In this case, either we have a discriminable hypothesis and we are done,
+ either at least an injectable one and we do the injection before continuing
*)
observe_tac "reflexivity_with_destruct_cases : others" (tclTHEN (tclPROGRESS discr_inject ) reflexivity_with_destruct_cases)
])
@@ -591,7 +591,7 @@ let rec reflexivity_with_destruct_cases g =
(* [prove_fun_complete funs graphs schemes lemmas_types_infos i]
- is the tactic used to prove completness lemma.
+ is the tactic used to prove completeness lemma.
[funcs], [graphs] [schemes] [lemmas_types_infos] are the mutually recursive functions
(resp. definitions of the graphs of the functions, principles and correctness lemma types) to prove correct.
@@ -626,7 +626,7 @@ let prove_fun_complete funcs graphs schemes lemmas_types_infos i : Tacmach.tacti
let lemmas =
Array.map
(fun (_,(ctxt,concl)) -> Reductionops.nf_zeta (pf_env g) (project g) (EConstr.it_mkLambda_or_LetIn concl ctxt))
- lemmas_types_infos
+ lemmas_types_infos
in
(* We get the constant and the principle corresponding to this lemma *)
let f = funcs.(i) in
@@ -642,8 +642,8 @@ let prove_fun_complete funcs graphs schemes lemmas_types_infos i : Tacmach.tacti
(* and fresh names for res H and the principle (cf bug bug #1174) *)
let res,hres,graph_principle_id =
match generate_fresh_id (Id.of_string "z") ids 3 with
- | [res;hres;graph_principle_id] -> res,hres,graph_principle_id
- | _ -> assert false
+ | [res;hres;graph_principle_id] -> res,hres,graph_principle_id
+ | _ -> assert false
in
let ids = res::hres::graph_principle_id::ids in
(* we also compute fresh names for each hyptohesis of each branch
@@ -651,12 +651,12 @@ let prove_fun_complete funcs graphs schemes lemmas_types_infos i : Tacmach.tacti
let branches = List.rev princ_infos.branches in
let intro_pats =
List.map
- (fun decl ->
- List.map
- (fun id -> id)
- (generate_fresh_id (Id.of_string "y") ids (nb_prod (project g) (RelDecl.get_type decl)))
- )
- branches
+ (fun decl ->
+ List.map
+ (fun id -> id)
+ (generate_fresh_id (Id.of_string "y") ids (nb_prod (project g) (RelDecl.get_type decl)))
+ )
+ branches
in
(* We will need to change the function by its body
using [f_equation] if it is recursive (that is the graph is infinite
@@ -671,25 +671,25 @@ let prove_fun_complete funcs graphs schemes lemmas_types_infos i : Tacmach.tacti
if infos.is_general
|| Rtree.is_infinite Declareops.eq_recarg graph_def.mind_recargs
then
- let eq_lemma =
- try Option.get (infos).equation_lemma
- with Option.IsNone -> anomaly (Pp.str "Cannot find equation lemma.")
- in
- tclTHENLIST[
- tclMAP (fun id -> Proofview.V82.of_tactic (Simple.intro id)) ids;
- Proofview.V82.of_tactic (Equality.rewriteLR (mkConst eq_lemma));
- (* Don't forget to $\zeta$ normlize the term since the principles
+ let eq_lemma =
+ try Option.get (infos).equation_lemma
+ with Option.IsNone -> anomaly (Pp.str "Cannot find equation lemma.")
+ in
+ tclTHENLIST[
+ tclMAP (fun id -> Proofview.V82.of_tactic (Simple.intro id)) ids;
+ Proofview.V82.of_tactic (Equality.rewriteLR (mkConst eq_lemma));
+ (* Don't forget to $\zeta$ normlize the term since the principles
have been $\zeta$-normalized *)
- Proofview.V82.of_tactic (reduce
- (Genredexpr.Cbv
- {Redops.all_flags
- with Genredexpr.rDelta = false;
- })
- Locusops.onConcl)
- ;
- Proofview.V82.of_tactic (generalize (List.map mkVar ids));
- thin ids
- ]
+ Proofview.V82.of_tactic (reduce
+ (Genredexpr.Cbv
+ {Redops.all_flags
+ with Genredexpr.rDelta = false;
+ })
+ Locusops.onConcl)
+ ;
+ Proofview.V82.of_tactic (generalize (List.map mkVar ids));
+ thin ids
+ ]
else
Proofview.V82.of_tactic (unfold_in_concl [(Locus.AllOccurrences, Names.EvalConstRef (fst (destConst (project g) f)))])
in
@@ -699,39 +699,39 @@ let prove_fun_complete funcs graphs schemes lemmas_types_infos i : Tacmach.tacti
let prove_branche i g =
(* we fist compute the inductive corresponding to the branch *)
let this_ind_number =
- let constructor_num = i - !min_constr_number in
- let length = Array.length (graphs.(!ind_number).Declarations.mind_consnames) in
- if constructor_num <= length
- then !ind_number
- else
- begin
- incr ind_number;
- min_constr_number := !min_constr_number + length;
- !ind_number
- end
+ let constructor_num = i - !min_constr_number in
+ let length = Array.length (graphs.(!ind_number).Declarations.mind_consnames) in
+ if constructor_num <= length
+ then !ind_number
+ else
+ begin
+ incr ind_number;
+ min_constr_number := !min_constr_number + length;
+ !ind_number
+ end
in
let this_branche_ids = List.nth intro_pats (pred i) in
tclTHENLIST[
- (* we expand the definition of the function *)
+ (* we expand the definition of the function *)
observe_tac "rewrite_tac" (rewrite_tac this_ind_number this_branche_ids);
- (* introduce hypothesis with some rewrite *)
+ (* introduce hypothesis with some rewrite *)
observe_tac "intros_with_rewrite (all)" intros_with_rewrite;
- (* The proof is (almost) complete *)
+ (* The proof is (almost) complete *)
observe_tac "reflexivity" (reflexivity_with_destruct_cases)
]
- g
+ g
in
let params_names = fst (List.chop princ_infos.nparams args_names) in
let open EConstr in
let params = List.map mkVar params_names in
tclTHENLIST
[ tclMAP (fun id -> Proofview.V82.of_tactic (Simple.intro id)) (args_names@[res;hres]);
- observe_tac "h_generalize"
- (Proofview.V82.of_tactic (generalize [mkApp(applist(graph_principle,params),Array.map (fun c -> applist(c,params)) lemmas)]));
- Proofview.V82.of_tactic (Simple.intro graph_principle_id);
- observe_tac "" (tclTHEN_i
- (observe_tac "elim" (Proofview.V82.of_tactic (elim false None (mkVar hres,NoBindings) (Some (mkVar graph_principle_id,NoBindings)))))
- (fun i g -> observe_tac "prove_branche" (prove_branche i) g ))
+ observe_tac "h_generalize"
+ (Proofview.V82.of_tactic (generalize [mkApp(applist(graph_principle,params),Array.map (fun c -> applist(c,params)) lemmas)]));
+ Proofview.V82.of_tactic (Simple.intro graph_principle_id);
+ observe_tac "" (tclTHEN_i
+ (observe_tac "elim" (Proofview.V82.of_tactic (elim false None (mkVar hres,NoBindings) (Some (mkVar graph_principle_id,NoBindings)))))
+ (fun i g -> observe_tac "prove_branche" (prove_branche i) g ))
]
g
@@ -748,109 +748,109 @@ let derive_correctness make_scheme (funs: pconstant list) (graphs:inductive list
let funs = Array.of_list funs and graphs = Array.of_list graphs in
let map (c, u) = mkConstU (c, EInstance.make u) in
let funs_constr = Array.map map funs in
- (* XXX STATE Why do we need this... why is the toplevel protection not enought *)
+ (* XXX STATE Why do we need this... why is the toplevel protection not enough *)
funind_purify
(fun () ->
let env = Global.env () in
- let evd = ref (Evd.from_env env) in
+ let evd = ref (Evd.from_env env) in
let graphs_constr = Array.map mkInd graphs in
let lemmas_types_infos =
Util.Array.map2_i
- (fun i f_constr graph ->
- (* let const_of_f,u = destConst f_constr in *)
- let (type_of_lemma_ctxt,type_of_lemma_concl,graph) =
- generate_type evd false f_constr graph i
- in
- let type_info = (type_of_lemma_ctxt,type_of_lemma_concl) in
- graphs_constr.(i) <- graph;
- let type_of_lemma = EConstr.it_mkProd_or_LetIn type_of_lemma_concl type_of_lemma_ctxt in
+ (fun i f_constr graph ->
+ (* let const_of_f,u = destConst f_constr in *)
+ let (type_of_lemma_ctxt,type_of_lemma_concl,graph) =
+ generate_type evd false f_constr graph i
+ in
+ let type_info = (type_of_lemma_ctxt,type_of_lemma_concl) in
+ graphs_constr.(i) <- graph;
+ let type_of_lemma = EConstr.it_mkProd_or_LetIn type_of_lemma_concl type_of_lemma_ctxt in
let sigma, _ = Typing.type_of (Global.env ()) !evd type_of_lemma in
evd := sigma;
let type_of_lemma = Reductionops.nf_zeta (Global.env ()) !evd type_of_lemma in
- observe (str "type_of_lemma := " ++ Printer.pr_leconstr_env (Global.env ()) !evd type_of_lemma);
- type_of_lemma,type_info
- )
- funs_constr
- graphs_constr
+ observe (str "type_of_lemma := " ++ Printer.pr_leconstr_env (Global.env ()) !evd type_of_lemma);
+ type_of_lemma,type_info
+ )
+ funs_constr
+ graphs_constr
in
let schemes =
(* The functional induction schemes are computed and not saved if there is more that one function
- if the block contains only one function we can safely reuse [f_rect]
+ if the block contains only one function we can safely reuse [f_rect]
*)
try
- if not (Int.equal (Array.length funs_constr) 1) then raise Not_found;
- [| find_induction_principle evd funs_constr.(0) |]
+ if not (Int.equal (Array.length funs_constr) 1) then raise Not_found;
+ [| find_induction_principle evd funs_constr.(0) |]
with Not_found ->
- (
-
- Array.of_list
- (List.map
- (fun entry ->
- (EConstr.of_constr (fst (fst(Future.force entry.Entries.const_entry_body))), EConstr.of_constr (Option.get entry.Entries.const_entry_type ))
- )
- (make_scheme evd (Array.map_to_list (fun const -> const,Sorts.InType) funs))
- )
- )
+ (
+
+ Array.of_list
+ (List.map
+ (fun entry ->
+ (EConstr.of_constr (fst (fst(Future.force entry.Proof_global.proof_entry_body))), EConstr.of_constr (Option.get entry.Proof_global.proof_entry_type ))
+ )
+ (make_scheme evd (Array.map_to_list (fun const -> const,Sorts.InType) funs))
+ )
+ )
in
let proving_tac =
prove_fun_correct !evd funs_constr graphs_constr schemes lemmas_types_infos
in
Array.iteri
(fun i f_as_constant ->
- let f_id = Label.to_id (Constant.label (fst f_as_constant)) in
- (*i The next call to mk_correct_id is valid since we are constructing the lemma
- Ensures by: obvious
- i*)
- let lem_id = mk_correct_id f_id in
+ let f_id = Label.to_id (Constant.label (fst f_as_constant)) in
+ (*i The next call to mk_correct_id is valid since we are constructing the lemma
+ Ensures by: obvious
+ i*)
+ let lem_id = mk_correct_id f_id in
let (typ,_) = lemmas_types_infos.(i) in
- let pstate = Lemmas.start_proof ~ontop:None
- lem_id
- (Decl_kinds.Global,false,((Decl_kinds.Proof Decl_kinds.Theorem)))
+ let lemma = Lemmas.start_lemma
+ lem_id
+ Decl_kinds.(Global ImportDefaultBehavior,false,Proof Theorem)
!evd
typ in
- let pstate = fst @@ Pfedit.by
- (Proofview.V82.tactic (observe_tac ("prove correctness ("^(Id.to_string f_id)^")")
- (proving_tac i))) pstate in
- let _ = Lemmas.save_proof_proved ?proof:None ~pstate ~opaque:Proof_global.Transparent ~idopt:None in
- let finfo = find_Function_infos (fst f_as_constant) in
- (* let lem_cst = fst (destConst (Constrintern.global_reference lem_id)) in *)
- let _,lem_cst_constr = Evd.fresh_global
- (Global.env ()) !evd (Constrintern.locate_reference (Libnames.qualid_of_ident lem_id)) in
+ let lemma = fst @@ Lemmas.by
+ (Proofview.V82.tactic (observe_tac ("prove correctness ("^(Id.to_string f_id)^")")
+ (proving_tac i))) lemma in
+ let () = Lemmas.save_lemma_proved ?proof:None ~lemma ~opaque:Proof_global.Transparent ~idopt:None in
+ let finfo = find_Function_infos (fst f_as_constant) in
+ (* let lem_cst = fst (destConst (Constrintern.global_reference lem_id)) in *)
+ let _,lem_cst_constr = Evd.fresh_global
+ (Global.env ()) !evd (Constrintern.locate_reference (Libnames.qualid_of_ident lem_id)) in
let (lem_cst,_) = destConst !evd lem_cst_constr in
- update_Function {finfo with correctness_lemma = Some lem_cst};
+ update_Function {finfo with correctness_lemma = Some lem_cst};
)
funs;
let lemmas_types_infos =
Util.Array.map2_i
- (fun i f_constr graph ->
- let (type_of_lemma_ctxt,type_of_lemma_concl,graph) =
- generate_type evd true f_constr graph i
- in
- let type_info = (type_of_lemma_ctxt,type_of_lemma_concl) in
- graphs_constr.(i) <- graph;
- let type_of_lemma =
- EConstr.it_mkProd_or_LetIn type_of_lemma_concl type_of_lemma_ctxt
- in
+ (fun i f_constr graph ->
+ let (type_of_lemma_ctxt,type_of_lemma_concl,graph) =
+ generate_type evd true f_constr graph i
+ in
+ let type_info = (type_of_lemma_ctxt,type_of_lemma_concl) in
+ graphs_constr.(i) <- graph;
+ let type_of_lemma =
+ EConstr.it_mkProd_or_LetIn type_of_lemma_concl type_of_lemma_ctxt
+ in
let type_of_lemma = Reductionops.nf_zeta env !evd type_of_lemma in
observe (str "type_of_lemma := " ++ Printer.pr_leconstr_env env !evd type_of_lemma);
- type_of_lemma,type_info
- )
- funs_constr
- graphs_constr
+ type_of_lemma,type_info
+ )
+ funs_constr
+ graphs_constr
in
let (kn,_) as graph_ind,u = (destInd !evd graphs_constr.(0)) in
let mib,mip = Global.lookup_inductive graph_ind in
- let sigma, scheme =
- (Indrec.build_mutual_induction_scheme (Global.env ()) !evd
- (Array.to_list
- (Array.mapi
- (fun i _ -> ((kn,i), EInstance.kind !evd u),true,InType)
- mib.Declarations.mind_packets
- )
- )
- )
+ let sigma, scheme =
+ (Indrec.build_mutual_induction_scheme (Global.env ()) !evd
+ (Array.to_list
+ (Array.mapi
+ (fun i _ -> ((kn,i), EInstance.kind !evd u),true,InType)
+ mib.Declarations.mind_packets
+ )
+ )
+ )
in
let schemes =
Array.of_list scheme
@@ -860,23 +860,23 @@ let derive_correctness make_scheme (funs: pconstant list) (graphs:inductive list
in
Array.iteri
(fun i f_as_constant ->
- let f_id = Label.to_id (Constant.label (fst f_as_constant)) in
- (*i The next call to mk_complete_id is valid since we are constructing the lemma
- Ensures by: obvious
- i*)
- let lem_id = mk_complete_id f_id in
- let pstate = Lemmas.start_proof ~ontop:None lem_id
- (Decl_kinds.Global,false,(Decl_kinds.Proof Decl_kinds.Theorem)) sigma
+ let f_id = Label.to_id (Constant.label (fst f_as_constant)) in
+ (*i The next call to mk_complete_id is valid since we are constructing the lemma
+ Ensures by: obvious
+ i*)
+ let lem_id = mk_complete_id f_id in
+ let lemma = Lemmas.start_lemma lem_id
+ Decl_kinds.(Global ImportDefaultBehavior,false,Proof Theorem) sigma
(fst lemmas_types_infos.(i)) in
- let pstate = fst (Pfedit.by
- (Proofview.V82.tactic (observe_tac ("prove completeness ("^(Id.to_string f_id)^")")
- (proving_tac i))) pstate) in
- let _pstate = Lemmas.save_proof_proved ?proof:None ~pstate ~opaque:Proof_global.Transparent ~idopt:None in
- let finfo = find_Function_infos (fst f_as_constant) in
- let _,lem_cst_constr = Evd.fresh_global
- (Global.env ()) !evd (Constrintern.locate_reference (Libnames.qualid_of_ident lem_id)) in
+ let lemma = fst (Lemmas.by
+ (Proofview.V82.tactic (observe_tac ("prove completeness ("^(Id.to_string f_id)^")")
+ (proving_tac i))) lemma) in
+ let () = Lemmas.save_lemma_proved ?proof:None ~lemma ~opaque:Proof_global.Transparent ~idopt:None in
+ let finfo = find_Function_infos (fst f_as_constant) in
+ let _,lem_cst_constr = Evd.fresh_global
+ (Global.env ()) !evd (Constrintern.locate_reference (Libnames.qualid_of_ident lem_id)) in
let (lem_cst,_) = destConst !evd lem_cst_constr in
- update_Function {finfo with completeness_lemma = Some lem_cst}
+ update_Function {finfo with completeness_lemma = Some lem_cst}
)
funs)
()
@@ -894,31 +894,31 @@ let revert_graph kn post_tac hid g =
let typ = pf_unsafe_type_of g (mkVar hid) in
match EConstr.kind sigma typ with
| App(i,args) when isInd sigma i ->
- let ((kn',num) as ind'),u = destInd sigma i in
- if MutInd.equal kn kn'
- then (* We have generated a graph hypothesis so that we must change it if we can *)
- let info =
- try find_Function_of_graph ind'
- with Not_found -> (* The graphs are mutually recursive but we cannot find one of them !*)
- anomaly (Pp.str "Cannot retrieve infos about a mutual block.")
- in
- (* if we can find a completeness lemma for this function
- then we can come back to the functional form. If not, we do nothing
- *)
- match info.completeness_lemma with
- | None -> tclIDTAC g
- | Some f_complete ->
- let f_args,res = Array.chop (Array.length args - 1) args in
- tclTHENLIST
- [
- Proofview.V82.of_tactic (generalize [applist(mkConst f_complete,(Array.to_list f_args)@[res.(0);mkVar hid])]);
- thin [hid];
- Proofview.V82.of_tactic (Simple.intro hid);
- post_tac hid
- ]
- g
-
- else tclIDTAC g
+ let ((kn',num) as ind'),u = destInd sigma i in
+ if MutInd.equal kn kn'
+ then (* We have generated a graph hypothesis so that we must change it if we can *)
+ let info =
+ try find_Function_of_graph ind'
+ with Not_found -> (* The graphs are mutually recursive but we cannot find one of them !*)
+ anomaly (Pp.str "Cannot retrieve infos about a mutual block.")
+ in
+ (* if we can find a completeness lemma for this function
+ then we can come back to the functional form. If not, we do nothing
+ *)
+ match info.completeness_lemma with
+ | None -> tclIDTAC g
+ | Some f_complete ->
+ let f_args,res = Array.chop (Array.length args - 1) args in
+ tclTHENLIST
+ [
+ Proofview.V82.of_tactic (generalize [applist(mkConst f_complete,(Array.to_list f_args)@[res.(0);mkVar hid])]);
+ thin [hid];
+ Proofview.V82.of_tactic (Simple.intro hid);
+ post_tac hid
+ ]
+ g
+
+ else tclIDTAC g
| _ -> tclIDTAC g
@@ -928,7 +928,7 @@ let revert_graph kn post_tac hid g =
[hid] is the hypothesis to invert, [fconst] is the function to invert and [f_correct]
is the correctness lemma for [fconst].
- The sketch is the follwing~:
+ The sketch is the following~:
\begin{enumerate}
\item Transforms the hypothesis [hid] such that its type is now $res\ =\ f\ t_1 \ldots t_n$
(fails if it is not possible)
@@ -946,25 +946,25 @@ let functional_inversion kn hid fconst f_correct : Tacmach.tactic =
let type_of_h = pf_unsafe_type_of g (mkVar hid) in
match EConstr.kind sigma type_of_h with
| App(eq,args) when EConstr.eq_constr sigma eq (make_eq ()) ->
- let pre_tac,f_args,res =
- match EConstr.kind sigma args.(1),EConstr.kind sigma args.(2) with
- | App(f,f_args),_ when EConstr.eq_constr sigma f fconst ->
- ((fun hid -> Proofview.V82.of_tactic (intros_symmetry (Locusops.onHyp hid))),f_args,args.(2))
- |_,App(f,f_args) when EConstr.eq_constr sigma f fconst ->
- ((fun hid -> tclIDTAC),f_args,args.(1))
- | _ -> (fun hid -> tclFAIL 1 (mt ())),[||],args.(2)
- in
- tclTHENLIST [
- pre_tac hid;
- Proofview.V82.of_tactic (generalize [applist(f_correct,(Array.to_list f_args)@[res;mkVar hid])]);
- thin [hid];
- Proofview.V82.of_tactic (Simple.intro hid);
+ let pre_tac,f_args,res =
+ match EConstr.kind sigma args.(1),EConstr.kind sigma args.(2) with
+ | App(f,f_args),_ when EConstr.eq_constr sigma f fconst ->
+ ((fun hid -> Proofview.V82.of_tactic (intros_symmetry (Locusops.onHyp hid))),f_args,args.(2))
+ |_,App(f,f_args) when EConstr.eq_constr sigma f fconst ->
+ ((fun hid -> tclIDTAC),f_args,args.(1))
+ | _ -> (fun hid -> tclFAIL 1 (mt ())),[||],args.(2)
+ in
+ tclTHENLIST [
+ pre_tac hid;
+ Proofview.V82.of_tactic (generalize [applist(f_correct,(Array.to_list f_args)@[res;mkVar hid])]);
+ thin [hid];
+ Proofview.V82.of_tactic (Simple.intro hid);
Proofview.V82.of_tactic (Inv.inv Inv.FullInversion None (NamedHyp hid));
- (fun g ->
- let new_ids = List.filter (fun id -> not (Id.Set.mem id old_ids)) (pf_ids_of_hyps g) in
- tclMAP (revert_graph kn pre_tac) (hid::new_ids) g
- );
- ] g
+ (fun g ->
+ let new_ids = List.filter (fun id -> not (Id.Set.mem id old_ids)) (pf_ids_of_hyps g) in
+ tclMAP (revert_graph kn pre_tac) (hid::new_ids) g
+ );
+ ] g
| _ -> tclFAIL 1 (mt ()) g
@@ -994,46 +994,46 @@ let invfun qhyp f g =
| Some f -> invfun qhyp f g
| None ->
Proofview.V82.of_tactic begin
- Tactics.try_intros_until
- (fun hid -> Proofview.V82.tactic begin fun g ->
+ Tactics.try_intros_until
+ (fun hid -> Proofview.V82.tactic begin fun g ->
let sigma = project g in
- let hyp_typ = pf_unsafe_type_of g (mkVar hid) in
- match EConstr.kind sigma hyp_typ with
- | App(eq,args) when EConstr.eq_constr sigma eq (make_eq ()) ->
- begin
- let f1,_ = decompose_app sigma args.(1) in
- try
- if not (isConst sigma f1) then raise NoFunction;
- let finfos = find_Function_infos (fst (destConst sigma f1)) in
- let f_correct = mkConst(Option.get finfos.correctness_lemma)
- and kn = fst finfos.graph_ind
- in
- functional_inversion kn hid f1 f_correct g
- with | NoFunction | Option.IsNone | Not_found ->
- try
- let f2,_ = decompose_app sigma args.(2) in
- if not (isConst sigma f2) then raise NoFunction;
- let finfos = find_Function_infos (fst (destConst sigma f2)) in
- let f_correct = mkConst(Option.get finfos.correctness_lemma)
- and kn = fst finfos.graph_ind
- in
- functional_inversion kn hid f2 f_correct g
- with
- | NoFunction ->
- user_err (str "Hypothesis " ++ Ppconstr.pr_id hid ++ str " must contain at least one Function")
- | Option.IsNone ->
- if do_observe ()
- then
- error "Cannot use equivalence with graph for any side of the equality"
- else user_err (str "Cannot find inversion information for hypothesis " ++ Ppconstr.pr_id hid)
- | Not_found ->
- if do_observe ()
- then
- error "No graph found for any side of equality"
- else user_err (str "Cannot find inversion information for hypothesis " ++ Ppconstr.pr_id hid)
- end
- | _ -> user_err (Ppconstr.pr_id hid ++ str " must be an equality ")
- end)
- qhyp
+ let hyp_typ = pf_unsafe_type_of g (mkVar hid) in
+ match EConstr.kind sigma hyp_typ with
+ | App(eq,args) when EConstr.eq_constr sigma eq (make_eq ()) ->
+ begin
+ let f1,_ = decompose_app sigma args.(1) in
+ try
+ if not (isConst sigma f1) then raise NoFunction;
+ let finfos = find_Function_infos (fst (destConst sigma f1)) in
+ let f_correct = mkConst(Option.get finfos.correctness_lemma)
+ and kn = fst finfos.graph_ind
+ in
+ functional_inversion kn hid f1 f_correct g
+ with | NoFunction | Option.IsNone | Not_found ->
+ try
+ let f2,_ = decompose_app sigma args.(2) in
+ if not (isConst sigma f2) then raise NoFunction;
+ let finfos = find_Function_infos (fst (destConst sigma f2)) in
+ let f_correct = mkConst(Option.get finfos.correctness_lemma)
+ and kn = fst finfos.graph_ind
+ in
+ functional_inversion kn hid f2 f_correct g
+ with
+ | NoFunction ->
+ user_err (str "Hypothesis " ++ Ppconstr.pr_id hid ++ str " must contain at least one Function")
+ | Option.IsNone ->
+ if do_observe ()
+ then
+ error "Cannot use equivalence with graph for any side of the equality"
+ else user_err (str "Cannot find inversion information for hypothesis " ++ Ppconstr.pr_id hid)
+ | Not_found ->
+ if do_observe ()
+ then
+ error "No graph found for any side of equality"
+ else user_err (str "Cannot find inversion information for hypothesis " ++ Ppconstr.pr_id hid)
+ end
+ | _ -> user_err (Ppconstr.pr_id hid ++ str " must be an equality ")
+ end)
+ qhyp
end
- g
+ g
diff --git a/plugins/funind/invfun.mli b/plugins/funind/invfun.mli
index 3ddc609201..96601785b6 100644
--- a/plugins/funind/invfun.mli
+++ b/plugins/funind/invfun.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -15,5 +15,5 @@ val invfun :
val derive_correctness :
(Evd.evar_map ref ->
(Constr.pconstant * Sorts.family) list ->
- 'a Entries.definition_entry list) ->
+ 'a Proof_global.proof_entry list) ->
Constr.pconstant list -> Names.inductive list -> unit
diff --git a/plugins/funind/recdef.ml b/plugins/funind/recdef.ml
index 1fca132655..2647e7449b 100644
--- a/plugins/funind/recdef.ml
+++ b/plugins/funind/recdef.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -17,7 +17,6 @@ open EConstr
open Vars
open Namegen
open Environ
-open Entries
open Pp
open Names
open Libnames
@@ -34,7 +33,6 @@ open Declare
open Decl_kinds
open Tacred
open Goal
-open Pfedit
open Glob_term
open Pretyping
open Termops
@@ -72,17 +70,18 @@ let declare_fun f_id kind ?univs value =
let ce = definition_entry ?univs value (*FIXME *) in
ConstRef(declare_constant f_id (DefinitionEntry ce, kind));;
-let defined pstate = Lemmas.save_proof_proved ?proof:None ~pstate ~opaque:Proof_global.Transparent ~idopt:None
+let defined lemma =
+ Lemmas.save_lemma_proved ?proof:None ~lemma ~opaque:Proof_global.Transparent ~idopt:None
let def_of_const t =
match (Constr.kind t) with
Const sp ->
(try (match constant_opt_value_in (Global.env ()) sp with
| Some c -> c
- | _ -> raise Not_found)
+ | _ -> raise Not_found)
with Not_found ->
- anomaly (str "Cannot find definition of constant " ++
- (Id.print (Label.to_id (Constant.label (fst sp)))) ++ str ".")
+ anomaly (str "Cannot find definition of constant " ++
+ (Id.print (Label.to_id (Constant.label (fst sp)))) ++ str ".")
)
|_ -> assert false
@@ -129,8 +128,8 @@ let lt = function () -> (coq_init_constant "lt")
let le = function () -> (Coqlib.gen_reference_in_modules "RecursiveDefinition" Coqlib.init_modules "le")
let ex = function () -> (coq_init_constant "ex")
let nat = function () -> (coq_init_constant "nat")
-let iter_ref () =
- try find_reference ["Recdef"] "iter"
+let iter_ref () =
+ try find_reference ["Recdef"] "iter"
with Not_found -> user_err Pp.(str "module Recdef not loaded")
let iter_rd = function () -> (constr_of_monomorphic_global (delayed_force iter_ref))
let eq = function () -> (coq_init_constant "eq")
@@ -169,13 +168,13 @@ let (value_f: Constr.t list -> GlobRef.t -> Constr.t) =
fun al fterm ->
let rev_x_id_l =
(
- List.fold_left
- (fun x_id_l _ ->
- let x_id = next_ident_away_in_goal x_id x_id_l in
- x_id::x_id_l
- )
- []
- al
+ List.fold_left
+ (fun x_id_l _ ->
+ let x_id = next_ident_away_in_goal x_id x_id_l in
+ x_id::x_id_l
+ )
+ []
+ al
)
in
let context = List.map
@@ -185,13 +184,13 @@ let (value_f: Constr.t list -> GlobRef.t -> Constr.t) =
let glob_body =
DAst.make @@
GCases
- (RegularStyle,None,
- [DAst.make @@ GApp(DAst.make @@ GRef(fterm,None), List.rev_map (fun x_id -> DAst.make @@ GVar x_id) rev_x_id_l),
- (Anonymous,None)],
+ (RegularStyle,None,
+ [DAst.make @@ GApp(DAst.make @@ GRef(fterm,None), List.rev_map (fun x_id -> DAst.make @@ GVar x_id) rev_x_id_l),
+ (Anonymous,None)],
[CAst.make ([v_id], [DAst.make @@ PatCstr ((destIndRef (delayed_force coq_sig_ref),1),
- [DAst.make @@ PatVar(Name v_id); DAst.make @@ PatVar Anonymous],
+ [DAst.make @@ PatVar(Name v_id); DAst.make @@ PatVar Anonymous],
Anonymous)],
- DAst.make @@ GVar v_id)])
+ DAst.make @@ GVar v_id)])
in
let body = fst (understand env (Evd.from_env env) glob_body)(*FIXME*) in
let body = EConstr.Unsafe.to_constr body in
@@ -206,17 +205,17 @@ let (declare_f : Id.t -> logical_kind -> Constr.t list -> GlobRef.t -> GlobRef.t
(* Debugging mechanism *)
let debug_queue = Stack.create ()
-let print_debug_queue b e =
- if not (Stack.is_empty debug_queue)
+let print_debug_queue b e =
+ if not (Stack.is_empty debug_queue)
then
begin
- let lmsg,goal = Stack.pop debug_queue in
- if b then
- Feedback.msg_debug (hov 1 (lmsg ++ (str " raised exception " ++ CErrors.print e) ++ str " on goal" ++ fnl() ++ goal))
+ let lmsg,goal = Stack.pop debug_queue in
+ if b then
+ Feedback.msg_debug (hov 1 (lmsg ++ (str " raised exception " ++ CErrors.print e) ++ str " on goal" ++ fnl() ++ goal))
else
- begin
- Feedback.msg_debug (hov 1 (str " from " ++ lmsg ++ str " on goal"++fnl() ++ goal));
- end;
+ begin
+ Feedback.msg_debug (hov 1 (str " from " ++ lmsg ++ str " on goal"++fnl() ++ goal));
+ end;
(* print_debug_queue false e; *)
end
@@ -226,14 +225,14 @@ let observe strm =
else ()
-let do_observe_tac s tac g =
+let do_observe_tac s tac g =
let goal = Printer.pr_goal g in
let s = s (pf_env g) (project g) in
- let lmsg = (str "recdef : ") ++ s in
+ let lmsg = (str "recdef : ") ++ s in
observe (s++fnl());
Stack.push (lmsg,goal) debug_queue;
- try
- let v = tac g in
+ try
+ let v = tac g in
ignore(Stack.pop debug_queue);
v
with reraise ->
@@ -258,7 +257,7 @@ let observe_tclTHENLIST s tacl =
in
aux 0 tacl
else tclTHENLIST tacl
-
+
(* Conclusion tactics *)
(* The boolean value is_mes expresses that the termination is expressed
@@ -275,10 +274,10 @@ let tclUSER tac is_mes l g =
if is_mes
then observe_tclTHENLIST (fun _ _ -> str "tclUSER2")
[
- Proofview.V82.of_tactic (unfold_in_concl [(Locus.AllOccurrences, evaluable_of_global_reference
+ Proofview.V82.of_tactic (unfold_in_concl [(Locus.AllOccurrences, evaluable_of_global_reference
(delayed_force Indfun_common.ltof_ref))]);
tac
- ]
+ ]
else tac
]
g
@@ -290,19 +289,19 @@ let tclUSER_if_not_mes concl_tac is_mes names_to_suppress =
-
+
(* Traveling term.
- Both definitions of [f_terminate] and [f_equation] use the same generic
+ Both definitions of [f_terminate] and [f_equation] use the same generic
traveling mechanism.
*)
-(* [check_not_nested forbidden e] checks that [e] does not contains any variable
+(* [check_not_nested forbidden e] checks that [e] does not contains any variable
of [forbidden]
*)
let check_not_nested env sigma forbidden e =
- let rec check_not_nested e =
- match EConstr.kind sigma e with
+ let rec check_not_nested e =
+ match EConstr.kind sigma e with
| Rel _ -> ()
| Int _ -> ()
| Var x ->
@@ -319,18 +318,18 @@ let check_not_nested env sigma forbidden e =
| Const _ -> ()
| Ind _ -> ()
| Construct _ -> ()
- | Case(_,t,e,a) ->
- check_not_nested t;check_not_nested e;Array.iter check_not_nested a
+ | Case(_,t,e,a) ->
+ check_not_nested t;check_not_nested e;Array.iter check_not_nested a
| Fix _ -> user_err Pp.(str "check_not_nested : Fix")
| CoFix _ -> user_err Pp.(str "check_not_nested : Fix")
in
- try
- check_not_nested e
- with UserError(_,p) ->
+ try
+ check_not_nested e
+ with UserError(_,p) ->
user_err ~hdr:"_" (str "on expr : " ++ Printer.pr_leconstr_env env sigma e ++ str " " ++ p)
(* ['a info] contains the local information for traveling *)
-type 'a infos =
+type 'a infos =
{ nb_arg : int; (* function number of arguments *)
concl_tac : tactic; (* final tactic to finish proofs *)
rec_arg_id : Id.t; (*name of the declared recursive argument *)
@@ -343,8 +342,8 @@ type 'a infos =
info : 'a;
is_main_branch : bool; (* on the main branch or on a matched expression *)
is_final : bool; (* final first order term or not *)
- values_and_bounds : (Id.t*Id.t) list;
- eqs : Id.t list;
+ values_and_bounds : (Id.t*Id.t) list;
+ eqs : Id.t list;
forbidden_ids : Id.t list;
acc_inv : constr lazy_t;
acc_id : Id.t;
@@ -352,166 +351,166 @@ type 'a infos =
}
-type ('a,'b) journey_info_tac =
+type ('a,'b) journey_info_tac =
'a -> (* the arguments of the constructor *)
'b infos -> (* infos of the caller *)
('b infos -> tactic) -> (* the continuation tactic of the caller *)
'b infos -> (* argument of the tactic *)
tactic
-
+
(* journey_info : specifies the actions to do on the different term constructors during the traveling of the term
*)
-type journey_info =
+type journey_info =
{ letiN : ((Name.t*constr*types*constr),constr) journey_info_tac;
lambdA : ((Name.t*types*constr),constr) journey_info_tac;
- casE : ((constr infos -> tactic) -> constr infos -> tactic) ->
- ((case_info * constr * constr * constr array),constr) journey_info_tac;
+ casE : ((constr infos -> tactic) -> constr infos -> tactic) ->
+ ((case_info * constr * constr * constr array),constr) journey_info_tac;
otherS : (unit,constr) journey_info_tac;
apP : (constr*(constr list),constr) journey_info_tac;
app_reC : (constr*(constr list),constr) journey_info_tac;
message : string
}
-
-let add_vars sigma forbidden e =
+
+let add_vars sigma forbidden e =
let rec aux forbidden e =
- match EConstr.kind sigma e with
- | Var x -> x::forbidden
+ match EConstr.kind sigma e with
+ | Var x -> x::forbidden
| _ -> EConstr.fold sigma aux forbidden e
in
aux forbidden e
-let treat_case forbid_new_ids to_intros finalize_tac nb_lam e infos : tactic =
- fun g ->
+let treat_case forbid_new_ids to_intros finalize_tac nb_lam e infos : tactic =
+ fun g ->
let rev_context,b = decompose_lam_n (project g) nb_lam e in
let ids = List.fold_left (fun acc (na,_) ->
- let pre_id =
+ let pre_id =
match na.binder_name with
- | Name x -> x
- | Anonymous -> ano_id
+ | Name x -> x
+ | Anonymous -> ano_id
in
pre_id::acc
- ) [] rev_context in
- let rev_ids = pf_get_new_ids (List.rev ids) g in
- let new_b = substl (List.map mkVar rev_ids) b in
+ ) [] rev_context in
+ let rev_ids = pf_get_new_ids (List.rev ids) g in
+ let new_b = substl (List.map mkVar rev_ids) b in
observe_tclTHENLIST (fun _ _ -> str "treat_case1")
[
- h_intros (List.rev rev_ids);
- Proofview.V82.of_tactic (intro_using teq_id);
- onLastHypId (fun heq ->
+ h_intros (List.rev rev_ids);
+ Proofview.V82.of_tactic (intro_using teq_id);
+ onLastHypId (fun heq ->
observe_tclTHENLIST (fun _ _ -> str "treat_case2")[
- Proofview.V82.of_tactic (clear to_intros);
- h_intros to_intros;
- (fun g' ->
- let ty_teq = pf_unsafe_type_of g' (mkVar heq) in
- let teq_lhs,teq_rhs =
- let _,args = try destApp (project g') ty_teq with DestKO -> assert false in
- args.(1),args.(2)
- in
- let new_b' = Termops.replace_term (project g') teq_lhs teq_rhs new_b in
- let new_infos = {
- infos with
- info = new_b';
- eqs = heq::infos.eqs;
- forbidden_ids =
- if forbid_new_ids
- then add_vars (project g') infos.forbidden_ids new_b'
- else infos.forbidden_ids
- } in
- finalize_tac new_infos g'
- )
- ]
- )
+ Proofview.V82.of_tactic (clear to_intros);
+ h_intros to_intros;
+ (fun g' ->
+ let ty_teq = pf_unsafe_type_of g' (mkVar heq) in
+ let teq_lhs,teq_rhs =
+ let _,args = try destApp (project g') ty_teq with DestKO -> assert false in
+ args.(1),args.(2)
+ in
+ let new_b' = Termops.replace_term (project g') teq_lhs teq_rhs new_b in
+ let new_infos = {
+ infos with
+ info = new_b';
+ eqs = heq::infos.eqs;
+ forbidden_ids =
+ if forbid_new_ids
+ then add_vars (project g') infos.forbidden_ids new_b'
+ else infos.forbidden_ids
+ } in
+ finalize_tac new_infos g'
+ )
+ ]
+ )
] g
let rec travel_aux jinfo continuation_tac (expr_info:constr infos) g =
let sigma = project g in
let env = pf_env g in
- match EConstr.kind sigma expr_info.info with
+ match EConstr.kind sigma expr_info.info with
| CoFix _ | Fix _ -> user_err Pp.(str "Function cannot treat local fixpoint or cofixpoint")
| Proj _ -> user_err Pp.(str "Function cannot treat projections")
| LetIn(na,b,t,e) ->
begin
- let new_continuation_tac =
+ let new_continuation_tac =
jinfo.letiN (na.binder_name,b,t,e) expr_info continuation_tac
- in
- travel jinfo new_continuation_tac
- {expr_info with info = b; is_final=false} g
+ in
+ travel jinfo new_continuation_tac
+ {expr_info with info = b; is_final=false} g
end
| Rel _ -> anomaly (Pp.str "Free var in goal conclusion!")
- | Prod _ ->
+ | Prod _ ->
begin
- try
+ try
check_not_nested env sigma (expr_info.f_id::expr_info.forbidden_ids) expr_info.info;
- jinfo.otherS () expr_info continuation_tac expr_info g
- with e when CErrors.noncritical e ->
+ jinfo.otherS () expr_info continuation_tac expr_info g
+ with e when CErrors.noncritical e ->
user_err ~hdr:"Recdef.travel" (str "the term " ++ Printer.pr_leconstr_env env sigma expr_info.info ++ str " can not contain a recursive call to " ++ Id.print expr_info.f_id)
end
| Lambda(n,t,b) ->
begin
- try
+ try
check_not_nested env sigma (expr_info.f_id::expr_info.forbidden_ids) expr_info.info;
- jinfo.otherS () expr_info continuation_tac expr_info g
- with e when CErrors.noncritical e ->
+ jinfo.otherS () expr_info continuation_tac expr_info g
+ with e when CErrors.noncritical e ->
user_err ~hdr:"Recdef.travel" (str "the term " ++ Printer.pr_leconstr_env env sigma expr_info.info ++ str " can not contain a recursive call to " ++ Id.print expr_info.f_id)
end
- | Case(ci,t,a,l) ->
+ | Case(ci,t,a,l) ->
begin
- let continuation_tac_a =
- jinfo.casE
- (travel jinfo) (ci,t,a,l)
- expr_info continuation_tac in
- travel
- jinfo continuation_tac_a
- {expr_info with info = a; is_main_branch = false;
- is_final = false} g
+ let continuation_tac_a =
+ jinfo.casE
+ (travel jinfo) (ci,t,a,l)
+ expr_info continuation_tac in
+ travel
+ jinfo continuation_tac_a
+ {expr_info with info = a; is_main_branch = false;
+ is_final = false} g
end
- | App _ ->
- let f,args = decompose_app sigma expr_info.info in
- if EConstr.eq_constr sigma f (expr_info.f_constr)
+ | App _ ->
+ let f,args = decompose_app sigma expr_info.info in
+ if EConstr.eq_constr sigma f (expr_info.f_constr)
then jinfo.app_reC (f,args) expr_info continuation_tac expr_info g
else
begin
- match EConstr.kind sigma f with
- | App _ -> assert false (* f is coming from a decompose_app *)
- | Const _ | Construct _ | Rel _ | Evar _ | Meta _ | Ind _
- | Sort _ | Prod _ | Var _ ->
- let new_infos = {expr_info with info=(f,args)} in
- let new_continuation_tac =
- jinfo.apP (f,args) expr_info continuation_tac in
- travel_args jinfo
- expr_info.is_main_branch new_continuation_tac new_infos g
+ match EConstr.kind sigma f with
+ | App _ -> assert false (* f is coming from a decompose_app *)
+ | Const _ | Construct _ | Rel _ | Evar _ | Meta _ | Ind _
+ | Sort _ | Prod _ | Var _ ->
+ let new_infos = {expr_info with info=(f,args)} in
+ let new_continuation_tac =
+ jinfo.apP (f,args) expr_info continuation_tac in
+ travel_args jinfo
+ expr_info.is_main_branch new_continuation_tac new_infos g
| Case _ -> user_err ~hdr:"Recdef.travel" (str "the term " ++ Printer.pr_leconstr_env env sigma expr_info.info ++ str " can not contain an applied match (See Limitation in Section 2.3 of refman)")
| _ -> anomaly (Pp.str "travel_aux : unexpected "++ Printer.pr_leconstr_env env sigma expr_info.info ++ Pp.str ".")
end
| Cast(t,_,_) -> travel jinfo continuation_tac {expr_info with info=t} g
| Const _ | Var _ | Meta _ | Evar _ | Sort _ | Construct _ | Ind _ | Int _ ->
- let new_continuation_tac =
- jinfo.otherS () expr_info continuation_tac in
+ let new_continuation_tac =
+ jinfo.otherS () expr_info continuation_tac in
new_continuation_tac expr_info g
-and travel_args jinfo is_final continuation_tac infos =
- let (f_args',args) = infos.info in
- match args with
- | [] ->
+and travel_args jinfo is_final continuation_tac infos =
+ let (f_args',args) = infos.info in
+ match args with
+ | [] ->
continuation_tac {infos with info = f_args'; is_final = is_final}
- | arg::args' ->
- let new_continuation_tac new_infos =
- let new_arg = new_infos.info in
- travel_args jinfo is_final
- continuation_tac
- {new_infos with info = (mkApp(f_args',[|new_arg|]),args')}
+ | arg::args' ->
+ let new_continuation_tac new_infos =
+ let new_arg = new_infos.info in
+ travel_args jinfo is_final
+ continuation_tac
+ {new_infos with info = (mkApp(f_args',[|new_arg|]),args')}
in
- travel jinfo new_continuation_tac
- {infos with info=arg;is_final=false}
+ travel jinfo new_continuation_tac
+ {infos with info=arg;is_final=false}
and travel jinfo continuation_tac expr_info =
observe_tac
(fun env sigma -> str jinfo.message ++ Printer.pr_leconstr_env env sigma expr_info.info)
(travel_aux jinfo continuation_tac expr_info)
-(* Termination proof *)
+(* Termination proof *)
-let rec prove_lt hyple g =
+let rec prove_lt hyple g =
let sigma = project g in
begin
try
@@ -520,125 +519,125 @@ let rec prove_lt hyple g =
| _ -> assert false
in
let h =
- List.find (fun id ->
+ List.find (fun id ->
match decompose_app sigma (pf_unsafe_type_of g (mkVar id)) with
| _, t::_ -> EConstr.eq_constr sigma t varx
| _ -> false
- ) hyple
+ ) hyple
in
let y =
- List.hd (List.tl (snd (decompose_app sigma (pf_unsafe_type_of g (mkVar h))))) in
+ List.hd (List.tl (snd (decompose_app sigma (pf_unsafe_type_of g (mkVar h))))) in
observe_tclTHENLIST (fun _ _ -> str "prove_lt1")[
- Proofview.V82.of_tactic (apply (mkApp(le_lt_trans (),[|varx;y;varz;mkVar h|])));
+ Proofview.V82.of_tactic (apply (mkApp(le_lt_trans (),[|varx;y;varz;mkVar h|])));
observe_tac (fun _ _ -> str "prove_lt") (prove_lt hyple)
]
- with Not_found ->
+ with Not_found ->
(
- (
+ (
observe_tclTHENLIST (fun _ _ -> str "prove_lt2")[
- Proofview.V82.of_tactic (apply (delayed_force lt_S_n));
+ Proofview.V82.of_tactic (apply (delayed_force lt_S_n));
(observe_tac (fun _ _ -> str "assumption: " ++ Printer.pr_goal g) (Proofview.V82.of_tactic assumption))
- ])
+ ])
)
end
g
-let rec destruct_bounds_aux infos (bound,hyple,rechyps) lbounds g =
- match lbounds with
- | [] ->
- let ids = pf_ids_of_hyps g in
- let s_max = mkApp(delayed_force coq_S, [|bound|]) in
+let rec destruct_bounds_aux infos (bound,hyple,rechyps) lbounds g =
+ match lbounds with
+ | [] ->
+ let ids = pf_ids_of_hyps g in
+ let s_max = mkApp(delayed_force coq_S, [|bound|]) in
let k = next_ident_away_in_goal k_id ids in
let ids = k::ids in
let h' = next_ident_away_in_goal (h'_id) ids in
let ids = h'::ids in
let def = next_ident_away_in_goal def_id ids in
observe_tclTHENLIST (fun _ _ -> str "destruct_bounds_aux1")[
- Proofview.V82.of_tactic (split (ImplicitBindings [s_max]));
- Proofview.V82.of_tactic (intro_then
- (fun id ->
+ Proofview.V82.of_tactic (split (ImplicitBindings [s_max]));
+ Proofview.V82.of_tactic (intro_then
+ (fun id ->
Proofview.V82.tactic begin
observe_tac (fun _ _ -> str "destruct_bounds_aux")
- (tclTHENS (Proofview.V82.of_tactic (simplest_case (mkVar id)))
- [
+ (tclTHENS (Proofview.V82.of_tactic (simplest_case (mkVar id)))
+ [
observe_tclTHENLIST (fun _ _ -> str "")[Proofview.V82.of_tactic (intro_using h_id);
- Proofview.V82.of_tactic (simplest_elim(mkApp(delayed_force lt_n_O,[|s_max|])));
- Proofview.V82.of_tactic default_full_auto];
+ Proofview.V82.of_tactic (simplest_elim(mkApp(delayed_force lt_n_O,[|s_max|])));
+ Proofview.V82.of_tactic default_full_auto];
observe_tclTHENLIST (fun _ _ -> str "destruct_bounds_aux2")[
observe_tac (fun _ _ -> str "clearing k ") (Proofview.V82.of_tactic (clear [id]));
- h_intros [k;h';def];
+ h_intros [k;h';def];
observe_tac (fun _ _ -> str "simple_iter") (Proofview.V82.of_tactic (simpl_iter Locusops.onConcl));
observe_tac (fun _ _ -> str "unfold functional")
- (Proofview.V82.of_tactic (unfold_in_concl[(Locus.OnlyOccurrences [1],
- evaluable_of_global_reference infos.func)]));
- (
+ (Proofview.V82.of_tactic (unfold_in_concl[(Locus.OnlyOccurrences [1],
+ evaluable_of_global_reference infos.func)]));
+ (
observe_tclTHENLIST (fun _ _ -> str "test")[
- list_rewrite true
- (List.fold_right
- (fun e acc -> (mkVar e,true)::acc)
- infos.eqs
- (List.map (fun e -> (e,true)) rechyps)
- );
- (* list_rewrite true *)
- (* (List.map (fun e -> (mkVar e,true)) infos.eqs) *)
- (* ; *)
-
+ list_rewrite true
+ (List.fold_right
+ (fun e acc -> (mkVar e,true)::acc)
+ infos.eqs
+ (List.map (fun e -> (e,true)) rechyps)
+ );
+ (* list_rewrite true *)
+ (* (List.map (fun e -> (mkVar e,true)) infos.eqs) *)
+ (* ; *)
+
(observe_tac (fun _ _ -> str "finishing")
- (tclORELSE
- (Proofview.V82.of_tactic intros_reflexivity)
+ (tclORELSE
+ (Proofview.V82.of_tactic intros_reflexivity)
(observe_tac (fun _ _ -> str "calling prove_lt") (prove_lt hyple))))])
- ]
- ]
- )end))
- ] g
- | (_,v_bound)::l ->
+ ]
+ ]
+ )end))
+ ] g
+ | (_,v_bound)::l ->
observe_tclTHENLIST (fun _ _ -> str "destruct_bounds_aux3")[
- Proofview.V82.of_tactic (simplest_elim (mkVar v_bound));
- Proofview.V82.of_tactic (clear [v_bound]);
- tclDO 2 (Proofview.V82.of_tactic intro);
- onNthHypId 1
- (fun p_hyp ->
- (onNthHypId 2
- (fun p ->
+ Proofview.V82.of_tactic (simplest_elim (mkVar v_bound));
+ Proofview.V82.of_tactic (clear [v_bound]);
+ tclDO 2 (Proofview.V82.of_tactic intro);
+ onNthHypId 1
+ (fun p_hyp ->
+ (onNthHypId 2
+ (fun p ->
observe_tclTHENLIST (fun _ _ -> str "destruct_bounds_aux4")[
- Proofview.V82.of_tactic (simplest_elim
- (mkApp(delayed_force max_constr, [| bound; mkVar p|])));
- tclDO 3 (Proofview.V82.of_tactic intro);
- onNLastHypsId 3 (fun lids ->
- match lids with
- [hle2;hle1;pmax] ->
- destruct_bounds_aux infos
- ((mkVar pmax),
- hle1::hle2::hyple,(mkVar p_hyp)::rechyps)
- l
- | _ -> assert false) ;
- ]
- )
- )
- )
+ Proofview.V82.of_tactic (simplest_elim
+ (mkApp(delayed_force max_constr, [| bound; mkVar p|])));
+ tclDO 3 (Proofview.V82.of_tactic intro);
+ onNLastHypsId 3 (fun lids ->
+ match lids with
+ [hle2;hle1;pmax] ->
+ destruct_bounds_aux infos
+ ((mkVar pmax),
+ hle1::hle2::hyple,(mkVar p_hyp)::rechyps)
+ l
+ | _ -> assert false) ;
+ ]
+ )
+ )
+ )
] g
-let destruct_bounds infos =
+let destruct_bounds infos =
destruct_bounds_aux infos (delayed_force coq_O,[],[]) infos.values_and_bounds
-let terminate_app f_and_args expr_info continuation_tac infos =
- if expr_info.is_final && expr_info.is_main_branch
- then
+let terminate_app f_and_args expr_info continuation_tac infos =
+ if expr_info.is_final && expr_info.is_main_branch
+ then
observe_tclTHENLIST (fun _ _ -> str "terminate_app1")[
- continuation_tac infos;
+ continuation_tac infos;
observe_tac (fun _ _ -> str "first split")
- (Proofview.V82.of_tactic (split (ImplicitBindings [infos.info])));
+ (Proofview.V82.of_tactic (split (ImplicitBindings [infos.info])));
observe_tac (fun _ _ -> str "destruct_bounds (1)") (destruct_bounds infos)
]
else continuation_tac infos
-let terminate_others _ expr_info continuation_tac infos =
- if expr_info.is_final && expr_info.is_main_branch
- then
+let terminate_others _ expr_info continuation_tac infos =
+ if expr_info.is_final && expr_info.is_main_branch
+ then
observe_tclTHENLIST (fun _ _ -> str "terminate_others")[
- continuation_tac infos;
+ continuation_tac infos;
observe_tac (fun _ _ -> str "first split")
- (Proofview.V82.of_tactic (split (ImplicitBindings [infos.info])));
+ (Proofview.V82.of_tactic (split (ImplicitBindings [infos.info])));
observe_tac (fun _ _ -> str "destruct_bounds") (destruct_bounds infos)
]
else continuation_tac infos
@@ -646,24 +645,24 @@ let terminate_others _ expr_info continuation_tac infos =
let terminate_letin (na,b,t,e) expr_info continuation_tac info g =
let sigma = project g in
let env = pf_env g in
- let new_e = subst1 info.info e in
- let new_forbidden =
- let forbid =
- try
+ let new_e = subst1 info.info e in
+ let new_forbidden =
+ let forbid =
+ try
check_not_nested env sigma (expr_info.f_id::expr_info.forbidden_ids) b;
- true
+ true
with e when CErrors.noncritical e -> false
in
- if forbid
- then
+ if forbid
+ then
match na with
- | Anonymous -> info.forbidden_ids
- | Name id -> id::info.forbidden_ids
- else info.forbidden_ids
+ | Anonymous -> info.forbidden_ids
+ | Name id -> id::info.forbidden_ids
+ else info.forbidden_ids
in
continuation_tac {info with info = new_e; forbidden_ids = new_forbidden} g
-let pf_type c tac gl =
+let pf_type c tac gl =
let evars, ty = Typing.type_of (pf_env gl) (project gl) c in
tclTHEN (Refiner.tclEVARS evars) (tac ty) gl
@@ -704,7 +703,6 @@ let mkDestructEq :
Proofview.V82.of_tactic (change_in_concl ~check:true None changefun) g2);
Proofview.V82.of_tactic (simplest_case expr)]), to_revert
-
let terminate_case next_step (ci,a,t,l) expr_info continuation_tac infos g =
let sigma = project g in
let env = pf_env g in
@@ -721,104 +719,104 @@ let terminate_case next_step (ci,a,t,l) expr_info continuation_tac infos g =
info = mkCase(ci,t,a',l);
is_main_branch = expr_info.is_main_branch;
is_final = expr_info.is_final} in
- let destruct_tac,rev_to_thin_intro =
- mkDestructEq [expr_info.rec_arg_id] a' g in
- let to_thin_intro = List.rev rev_to_thin_intro in
+ let destruct_tac,rev_to_thin_intro =
+ mkDestructEq [expr_info.rec_arg_id] a' g in
+ let to_thin_intro = List.rev rev_to_thin_intro in
observe_tac (fun _ _ -> str "treating cases (" ++ int (Array.length l) ++ str")" ++ spc () ++ Printer.pr_leconstr_env (pf_env g) sigma a')
(try
(tclTHENS
- destruct_tac
+ destruct_tac
(List.map_i (fun i e -> observe_tac (fun _ _ -> str "do treat case") (treat_case f_is_present to_thin_intro (next_step continuation_tac) ci.ci_cstr_ndecls.(i) e new_info)) 0 (Array.to_list l)
- ))
- with
- | UserError(Some "Refiner.thensn_tac3",_)
+ ))
+ with
+ | UserError(Some "Refiner.thensn_tac3",_)
| UserError(Some "Refiner.tclFAIL_s",_) ->
(observe_tac (fun _ _ -> str "is computable " ++ Printer.pr_leconstr_env env sigma new_info.info) (next_step continuation_tac {new_info with info = Reductionops.nf_betaiotazeta (pf_env g) sigma new_info.info} )
- ))
+ ))
g
-
+
let terminate_app_rec (f,args) expr_info continuation_tac _ g =
let sigma = project g in
let env = pf_env g in
List.iter (check_not_nested env sigma (expr_info.f_id::expr_info.forbidden_ids))
args;
begin
- try
+ try
let v = List.assoc_f (List.equal (EConstr.eq_constr sigma)) args expr_info.args_assoc in
- let new_infos = {expr_info with info = v} in
+ let new_infos = {expr_info with info = v} in
observe_tclTHENLIST (fun _ _ -> str "terminate_app_rec")[
- continuation_tac new_infos;
- if expr_info.is_final && expr_info.is_main_branch
- then
+ continuation_tac new_infos;
+ if expr_info.is_final && expr_info.is_main_branch
+ then
observe_tclTHENLIST (fun _ _ -> str "terminate_app_rec1")[
observe_tac (fun _ _ -> str "first split")
- (Proofview.V82.of_tactic (split (ImplicitBindings [new_infos.info])));
+ (Proofview.V82.of_tactic (split (ImplicitBindings [new_infos.info])));
observe_tac (fun _ _ -> str "destruct_bounds (3)")
- (destruct_bounds new_infos)
- ]
- else
- tclIDTAC
+ (destruct_bounds new_infos)
+ ]
+ else
+ tclIDTAC
] g
- with Not_found ->
+ with Not_found ->
observe_tac (fun _ _ -> str "terminate_app_rec not found") (tclTHENS
- (Proofview.V82.of_tactic (simplest_elim (mkApp(mkVar expr_info.ih,Array.of_list args))))
- [
+ (Proofview.V82.of_tactic (simplest_elim (mkApp(mkVar expr_info.ih,Array.of_list args))))
+ [
observe_tclTHENLIST (fun _ _ -> str "terminate_app_rec2")[
- Proofview.V82.of_tactic (intro_using rec_res_id);
- Proofview.V82.of_tactic intro;
- onNthHypId 1
- (fun v_bound ->
- (onNthHypId 2
- (fun v ->
- let new_infos = { expr_info with
- info = (mkVar v);
- values_and_bounds =
- (v,v_bound)::expr_info.values_and_bounds;
- args_assoc=(args,mkVar v)::expr_info.args_assoc
- } in
+ Proofview.V82.of_tactic (intro_using rec_res_id);
+ Proofview.V82.of_tactic intro;
+ onNthHypId 1
+ (fun v_bound ->
+ (onNthHypId 2
+ (fun v ->
+ let new_infos = { expr_info with
+ info = (mkVar v);
+ values_and_bounds =
+ (v,v_bound)::expr_info.values_and_bounds;
+ args_assoc=(args,mkVar v)::expr_info.args_assoc
+ } in
observe_tclTHENLIST (fun _ _ -> str "terminate_app_rec3")[
- continuation_tac new_infos;
- if expr_info.is_final && expr_info.is_main_branch
- then
+ continuation_tac new_infos;
+ if expr_info.is_final && expr_info.is_main_branch
+ then
observe_tclTHENLIST (fun _ _ -> str "terminate_app_rec4")[
observe_tac (fun _ _ -> str "first split")
- (Proofview.V82.of_tactic (split (ImplicitBindings [new_infos.info])));
+ (Proofview.V82.of_tactic (split (ImplicitBindings [new_infos.info])));
observe_tac (fun _ _ -> str "destruct_bounds (2)")
- (destruct_bounds new_infos)
- ]
- else
- tclIDTAC
- ]
- )
- )
- )
- ];
+ (destruct_bounds new_infos)
+ ]
+ else
+ tclIDTAC
+ ]
+ )
+ )
+ )
+ ];
observe_tac (fun _ _ -> str "proving decreasing") (
- tclTHENS (* proof of args < formal args *)
- (Proofview.V82.of_tactic (apply (Lazy.force expr_info.acc_inv)))
- [
+ tclTHENS (* proof of args < formal args *)
+ (Proofview.V82.of_tactic (apply (Lazy.force expr_info.acc_inv)))
+ [
observe_tac (fun _ _ -> str "assumption") (Proofview.V82.of_tactic assumption);
observe_tclTHENLIST (fun _ _ -> str "terminate_app_rec5")
- [
- tclTRY(list_rewrite true
- (List.map
- (fun e -> mkVar e,true)
- expr_info.eqs
- )
- );
- tclUSER expr_info.concl_tac true
- (Some (
- expr_info.ih::expr_info.acc_id::
- (fun (x,y) -> y)
- (List.split expr_info.values_and_bounds)
- )
- );
- ]
- ])
- ]) g
+ [
+ tclTRY(list_rewrite true
+ (List.map
+ (fun e -> mkVar e,true)
+ expr_info.eqs
+ )
+ );
+ tclUSER expr_info.concl_tac true
+ (Some (
+ expr_info.ih::expr_info.acc_id::
+ (fun (x,y) -> y)
+ (List.split expr_info.values_and_bounds)
+ )
+ );
+ ]
+ ])
+ ]) g
end
-let terminate_info =
+let terminate_info =
{ message = "prove_terminate with term ";
letiN = terminate_letin;
lambdA = (fun _ _ _ _ -> assert false);
@@ -833,15 +831,15 @@ let prove_terminate = travel terminate_info
(* Equation proof *)
-let equation_case next_step (ci,a,t,l) expr_info continuation_tac infos =
+let equation_case next_step (ci,a,t,l) expr_info continuation_tac infos =
observe_tac (fun _ _ -> str "equation case") (terminate_case next_step (ci,a,t,l) expr_info continuation_tac infos)
-let rec prove_le g =
+let rec prove_le g =
let sigma = project g in
- let x,z =
- let _,args = decompose_app sigma (pf_concl g) in
+ let x,z =
+ let _,args = decompose_app sigma (pf_concl g) in
(List.hd args,List.hd (List.tl args))
- in
+ in
tclFIRST[
Proofview.V82.of_tactic assumption;
Proofview.V82.of_tactic (apply (delayed_force le_n));
@@ -856,151 +854,151 @@ let rec prove_le g =
in
let (h,t) = List.find (fun (_,t) -> matching_fun t) (pf_hyps_types g) in
let h = h.binder_name in
- let y =
- let _,args = decompose_app sigma t in
- List.hd (List.tl args)
- in
+ let y =
+ let _,args = decompose_app sigma t in
+ List.hd (List.tl args)
+ in
observe_tclTHENLIST (fun _ _ -> str "prove_le")[
- Proofview.V82.of_tactic (apply(mkApp(le_trans (),[|x;y;z;mkVar h|])));
+ Proofview.V82.of_tactic (apply(mkApp(le_trans (),[|x;y;z;mkVar h|])));
observe_tac (fun _ _ -> str "prove_le (rec)") (prove_le)
- ]
+ ]
with Not_found -> tclFAIL 0 (mt())
end;
]
g
-let rec make_rewrite_list expr_info max = function
+let rec make_rewrite_list expr_info max = function
| [] -> tclIDTAC
- | (_,p,hp)::l ->
+ | (_,p,hp)::l ->
observe_tac (fun _ _ -> str "make_rewrite_list") (tclTHENS
(observe_tac (fun _ _ -> str "rewrite heq on " ++ Id.print p ) (
- (fun g ->
+ (fun g ->
let sigma = project g in
- let t_eq = compute_renamed_type g (mkVar hp) in
- let k,def =
+ let t_eq = compute_renamed_type g (mkVar hp) in
+ let k,def =
let k_na,_,t = destProd sigma t_eq in
let _,_,t = destProd sigma t in
let def_na,_,_ = destProd sigma t in
Nameops.Name.get_id k_na.binder_name,Nameops.Name.get_id def_na.binder_name
- in
- Proofview.V82.of_tactic (general_rewrite_bindings false Locus.AllOccurrences
- true (* dep proofs also: *) true
- (mkVar hp,
+ in
+ Proofview.V82.of_tactic (general_rewrite_bindings false Locus.AllOccurrences
+ true (* dep proofs also: *) true
+ (mkVar hp,
ExplicitBindings[CAst.make @@ (NamedHyp def, expr_info.f_constr);
CAst.make @@ (NamedHyp k, f_S max)]) false) g) )
)
[make_rewrite_list expr_info max l;
observe_tclTHENLIST (fun _ _ -> str "make_rewrite_list")[ (* x < S max proof *)
- Proofview.V82.of_tactic (apply (delayed_force le_lt_n_Sm));
+ Proofview.V82.of_tactic (apply (delayed_force le_lt_n_Sm));
observe_tac (fun _ _ -> str "prove_le(2)") prove_le
]
] )
-let make_rewrite expr_info l hp max =
+let make_rewrite expr_info l hp max =
tclTHENFIRST
(observe_tac (fun _ _ -> str "make_rewrite") (make_rewrite_list expr_info max l))
(observe_tac (fun _ _ -> str "make_rewrite") (tclTHENS
- (fun g ->
+ (fun g ->
let sigma = project g in
- let t_eq = compute_renamed_type g (mkVar hp) in
- let k,def =
+ let t_eq = compute_renamed_type g (mkVar hp) in
+ let k,def =
let k_na,_,t = destProd sigma t_eq in
let _,_,t = destProd sigma t in
let def_na,_,_ = destProd sigma t in
Nameops.Name.get_id k_na.binder_name,Nameops.Name.get_id def_na.binder_name
- in
+ in
observe_tac (fun _ _ -> str "general_rewrite_bindings")
- (Proofview.V82.of_tactic (general_rewrite_bindings false Locus.AllOccurrences
- true (* dep proofs also: *) true
- (mkVar hp,
+ (Proofview.V82.of_tactic (general_rewrite_bindings false Locus.AllOccurrences
+ true (* dep proofs also: *) true
+ (mkVar hp,
ExplicitBindings[CAst.make @@ (NamedHyp def, expr_info.f_constr);
CAst.make @@ (NamedHyp k, f_S (f_S max))]) false)) g)
[observe_tac(fun _ _ -> str "make_rewrite finalize") (
- (* tclORELSE( h_reflexivity) *)
+ (* tclORELSE( h_reflexivity) *)
(observe_tclTHENLIST (fun _ _ -> str "make_rewrite")[
- Proofview.V82.of_tactic (simpl_iter Locusops.onConcl);
+ Proofview.V82.of_tactic (simpl_iter Locusops.onConcl);
observe_tac (fun _ _ -> str "unfold functional")
- (Proofview.V82.of_tactic (unfold_in_concl[(Locus.OnlyOccurrences [1],
- evaluable_of_global_reference expr_info.func)]));
-
- (list_rewrite true
- (List.map (fun e -> mkVar e,true) expr_info.eqs));
+ (Proofview.V82.of_tactic (unfold_in_concl[(Locus.OnlyOccurrences [1],
+ evaluable_of_global_reference expr_info.func)]));
+
+ (list_rewrite true
+ (List.map (fun e -> mkVar e,true) expr_info.eqs));
(observe_tac (fun _ _ -> str "h_reflexivity")
- (Proofview.V82.of_tactic intros_reflexivity)
- )
- ]))
+ (Proofview.V82.of_tactic intros_reflexivity)
+ )
+ ]))
;
observe_tclTHENLIST (fun _ _ -> str "make_rewrite1")[ (* x < S (S max) proof *)
- Proofview.V82.of_tactic (apply (EConstr.of_constr (delayed_force le_lt_SS)));
+ Proofview.V82.of_tactic (apply (EConstr.of_constr (delayed_force le_lt_SS)));
observe_tac (fun _ _ -> str "prove_le (3)") prove_le
- ]
- ])
+ ]
+ ])
)
-let rec compute_max rew_tac max l =
- match l with
+let rec compute_max rew_tac max l =
+ match l with
| [] -> rew_tac max
- | (_,p,_)::l ->
+ | (_,p,_)::l ->
observe_tclTHENLIST (fun _ _ -> str "compute_max")[
- Proofview.V82.of_tactic (simplest_elim
- (mkApp(delayed_force max_constr, [| max; mkVar p|])));
- tclDO 3 (Proofview.V82.of_tactic intro);
- onNLastHypsId 3 (fun lids ->
- match lids with
- | [hle2;hle1;pmax] -> compute_max rew_tac (mkVar pmax) l
- | _ -> assert false
- )]
-
-let rec destruct_hex expr_info acc l =
- match l with
- | [] ->
+ Proofview.V82.of_tactic (simplest_elim
+ (mkApp(delayed_force max_constr, [| max; mkVar p|])));
+ tclDO 3 (Proofview.V82.of_tactic intro);
+ onNLastHypsId 3 (fun lids ->
+ match lids with
+ | [hle2;hle1;pmax] -> compute_max rew_tac (mkVar pmax) l
+ | _ -> assert false
+ )]
+
+let rec destruct_hex expr_info acc l =
+ match l with
+ | [] ->
begin
- match List.rev acc with
- | [] -> tclIDTAC
- | (_,p,hp)::tl ->
+ match List.rev acc with
+ | [] -> tclIDTAC
+ | (_,p,hp)::tl ->
observe_tac (fun _ _ -> str "compute max ") (compute_max (make_rewrite expr_info tl hp) (mkVar p) tl)
end
- | (v,hex)::l ->
+ | (v,hex)::l ->
observe_tclTHENLIST (fun _ _ -> str "destruct_hex")[
- Proofview.V82.of_tactic (simplest_case (mkVar hex));
- Proofview.V82.of_tactic (clear [hex]);
- tclDO 2 (Proofview.V82.of_tactic intro);
- onNthHypId 1 (fun hp ->
- onNthHypId 2 (fun p ->
- observe_tac
+ Proofview.V82.of_tactic (simplest_case (mkVar hex));
+ Proofview.V82.of_tactic (clear [hex]);
+ tclDO 2 (Proofview.V82.of_tactic intro);
+ onNthHypId 1 (fun hp ->
+ onNthHypId 2 (fun p ->
+ observe_tac
(fun _ _ -> str "destruct_hex after " ++ Id.print hp ++ spc () ++ Id.print p)
- (destruct_hex expr_info ((v,p,hp)::acc) l)
- )
- )
+ (destruct_hex expr_info ((v,p,hp)::acc) l)
+ )
+ )
]
-
-let rec intros_values_eq expr_info acc =
+
+let rec intros_values_eq expr_info acc =
tclORELSE(
observe_tclTHENLIST (fun _ _ -> str "intros_values_eq")[
tclDO 2 (Proofview.V82.of_tactic intro);
- onNthHypId 1 (fun hex ->
- (onNthHypId 2 (fun v -> intros_values_eq expr_info ((v,hex)::acc)))
+ onNthHypId 1 (fun hex ->
+ (onNthHypId 2 (fun v -> intros_values_eq expr_info ((v,hex)::acc)))
)
])
(tclCOMPLETE (
destruct_hex expr_info [] acc
))
-let equation_others _ expr_info continuation_tac infos =
- if expr_info.is_final && expr_info.is_main_branch
+let equation_others _ expr_info continuation_tac infos =
+ if expr_info.is_final && expr_info.is_main_branch
then
observe_tac (fun env sigma -> str "equation_others (cont_tac +intros) " ++ Printer.pr_leconstr_env env sigma expr_info.info)
- (tclTHEN
- (continuation_tac infos)
+ (tclTHEN
+ (continuation_tac infos)
(observe_tac (fun env sigma -> str "intros_values_eq equation_others " ++ Printer.pr_leconstr_env env sigma expr_info.info) (intros_values_eq expr_info [])))
else observe_tac (fun env sigma -> str "equation_others (cont_tac) " ++ Printer.pr_leconstr_env env sigma expr_info.info) (continuation_tac infos)
-let equation_app f_and_args expr_info continuation_tac infos =
- if expr_info.is_final && expr_info.is_main_branch
+let equation_app f_and_args expr_info continuation_tac infos =
+ if expr_info.is_final && expr_info.is_main_branch
then ((observe_tac (fun _ _ -> str "intros_values_eq equation_app") (intros_values_eq expr_info [])))
else continuation_tac infos
-
-let equation_app_rec (f,args) expr_info continuation_tac info g =
+
+let equation_app_rec (f,args) expr_info continuation_tac info g =
let sigma = project g in
begin
try
@@ -1008,21 +1006,21 @@ let equation_app_rec (f,args) expr_info continuation_tac info g =
let new_infos = {expr_info with info = v} in
observe_tac (fun _ _ -> str "app_rec found") (continuation_tac new_infos) g
with Not_found ->
- if expr_info.is_final && expr_info.is_main_branch
- then
+ if expr_info.is_final && expr_info.is_main_branch
+ then
observe_tclTHENLIST (fun _ _ -> str "equation_app_rec")
- [ Proofview.V82.of_tactic (simplest_case (mkApp (expr_info.f_terminate,Array.of_list args)));
- continuation_tac {expr_info with args_assoc = (args,delayed_force coq_O)::expr_info.args_assoc};
+ [ Proofview.V82.of_tactic (simplest_case (mkApp (expr_info.f_terminate,Array.of_list args)));
+ continuation_tac {expr_info with args_assoc = (args,delayed_force coq_O)::expr_info.args_assoc};
observe_tac (fun _ _ -> str "app_rec intros_values_eq") (intros_values_eq expr_info [])
- ] g
- else
+ ] g
+ else
observe_tclTHENLIST (fun _ _ -> str "equation_app_rec1")[
- Proofview.V82.of_tactic (simplest_case (mkApp (expr_info.f_terminate,Array.of_list args)));
+ Proofview.V82.of_tactic (simplest_case (mkApp (expr_info.f_terminate,Array.of_list args)));
observe_tac (fun _ _ -> str "app_rec not_found") (continuation_tac {expr_info with args_assoc = (args,delayed_force coq_O)::expr_info.args_assoc})
- ] g
+ ] g
end
-let equation_info =
+let equation_info =
{message = "prove_equation with term ";
letiN = (fun _ -> assert false);
lambdA = (fun _ _ _ _ -> assert false);
@@ -1031,7 +1029,7 @@ let equation_info =
apP = equation_app;
app_reC = equation_app_rec
}
-
+
let prove_eq = travel equation_info
(* wrappers *)
@@ -1045,12 +1043,12 @@ let compute_terminate_type nb_args func =
let rev_args,b = decompose_prod_n nb_args a_arrow_b in
let left =
mkApp(delayed_force iter_rd,
- Array.of_list
- (lift 5 a_arrow_b:: mkRel 3::
+ Array.of_list
+ (lift 5 a_arrow_b:: mkRel 3::
constr_of_monomorphic_global func::mkRel 1::
- List.rev (List.map_i (fun i _ -> mkRel (6+i)) 0 rev_args)
- )
- )
+ List.rev (List.map_i (fun i _ -> mkRel (6+i)) 0 rev_args)
+ )
+ )
in
let right = mkRel 5 in
let delayed_force c = EConstr.Unsafe.to_constr (delayed_force c) in
@@ -1059,14 +1057,14 @@ let compute_terminate_type nb_args func =
let cond = mkApp(delayed_force lt, [|(mkRel 2); (mkRel 1)|]) in
let nb_iter =
mkApp(delayed_force ex,
- [|delayed_force nat;
- (mkLambda
+ [|delayed_force nat;
+ (mkLambda
(make_annot (Name p_id) Sorts.Relevant,
- delayed_force nat,
+ delayed_force nat,
(mkProd (make_annot (Name k_id) Sorts.Relevant, delayed_force nat,
mkArrow cond Sorts.Relevant result))))|])in
let value = mkApp(constr_of_monomorphic_global (Util.delayed_force coq_sig_ref),
- [|b;
+ [|b;
(mkLambda (make_annot (Name v_id) Sorts.Relevant, b, nb_iter))|]) in
compose_prod rev_args value
@@ -1077,74 +1075,74 @@ let termination_proof_header is_mes input_type ids args_id relation
fun g ->
let nargs = List.length args_id in
let pre_rec_args =
- List.rev_map
- mkVar (fst (List.chop (rec_arg_num - 1) args_id))
+ List.rev_map
+ mkVar (fst (List.chop (rec_arg_num - 1) args_id))
in
let relation = substl pre_rec_args relation in
let input_type = substl pre_rec_args input_type in
let wf_thm = next_ident_away_in_goal (Id.of_string ("wf_R")) ids in
let wf_rec_arg =
- next_ident_away_in_goal
- (Id.of_string ("Acc_"^(Id.to_string rec_arg_id)))
- (wf_thm::ids)
+ next_ident_away_in_goal
+ (Id.of_string ("Acc_"^(Id.to_string rec_arg_id)))
+ (wf_thm::ids)
in
let hrec = next_ident_away_in_goal hrec_id
- (wf_rec_arg::wf_thm::ids) in
+ (wf_rec_arg::wf_thm::ids) in
let acc_inv =
- lazy (
- mkApp (
- delayed_force acc_inv_id,
- [|input_type;relation;mkVar rec_arg_id|]
- )
- )
+ lazy (
+ mkApp (
+ delayed_force acc_inv_id,
+ [|input_type;relation;mkVar rec_arg_id|]
+ )
+ )
in
tclTHEN
- (h_intros args_id)
- (tclTHENS
- (observe_tac
+ (h_intros args_id)
+ (tclTHENS
+ (observe_tac
(fun _ _ -> str "first assert")
- (Proofview.V82.of_tactic (assert_before
- (Name wf_rec_arg)
- (mkApp (delayed_force acc_rel,
- [|input_type;relation;mkVar rec_arg_id|])
- )
- ))
- )
- [
- (* accesibility proof *)
- tclTHENS
- (observe_tac
+ (Proofview.V82.of_tactic (assert_before
+ (Name wf_rec_arg)
+ (mkApp (delayed_force acc_rel,
+ [|input_type;relation;mkVar rec_arg_id|])
+ )
+ ))
+ )
+ [
+ (* accesibility proof *)
+ tclTHENS
+ (observe_tac
(fun _ _ -> str "second assert")
- (Proofview.V82.of_tactic (assert_before
- (Name wf_thm)
- (mkApp (delayed_force well_founded,[|input_type;relation|]))
- ))
- )
- [
- (* interactive proof that the relation is well_founded *)
+ (Proofview.V82.of_tactic (assert_before
+ (Name wf_thm)
+ (mkApp (delayed_force well_founded,[|input_type;relation|]))
+ ))
+ )
+ [
+ (* interactive proof that the relation is well_founded *)
observe_tac (fun _ _ -> str "wf_tac") (wf_tac is_mes (Some args_id));
- (* this gives the accessibility argument *)
- observe_tac
+ (* this gives the accessibility argument *)
+ observe_tac
(fun _ _ -> str "apply wf_thm")
- (Proofview.V82.of_tactic (Simple.apply (mkApp(mkVar wf_thm,[|mkVar rec_arg_id|])))
- )
- ]
- ;
- (* rest of the proof *)
+ (Proofview.V82.of_tactic (Simple.apply (mkApp(mkVar wf_thm,[|mkVar rec_arg_id|])))
+ )
+ ]
+ ;
+ (* rest of the proof *)
observe_tclTHENLIST (fun _ _ -> str "rest of proof")
[observe_tac (fun _ _ -> str "generalize")
- (onNLastHypsId (nargs+1)
- (tclMAP (fun id ->
- tclTHEN (Proofview.V82.of_tactic (Tactics.generalize [mkVar id])) (Proofview.V82.of_tactic (clear [id])))
- ))
- ;
+ (onNLastHypsId (nargs+1)
+ (tclMAP (fun id ->
+ tclTHEN (Proofview.V82.of_tactic (Tactics.generalize [mkVar id])) (Proofview.V82.of_tactic (clear [id])))
+ ))
+ ;
observe_tac (fun _ _ -> str "fix") (Proofview.V82.of_tactic (fix hrec (nargs+1)));
- h_intros args_id;
- Proofview.V82.of_tactic (Simple.intro wf_rec_arg);
+ h_intros args_id;
+ Proofview.V82.of_tactic (Simple.intro wf_rec_arg);
observe_tac (fun _ _ -> str "tac") (tac wf_rec_arg hrec wf_rec_arg acc_inv)
- ]
- ]
- ) g
+ ]
+ ]
+ ) g
end
@@ -1166,62 +1164,62 @@ let whole_start (concl_tac:tactic) nb_args is_mes func input_type relation rec_a
let (f_name, _, body1) = destLambda sigma func_body in
let f_id =
match f_name.binder_name with
- | Name f_id -> next_ident_away_in_goal f_id ids
- | Anonymous -> anomaly (Pp.str "Anonymous function.")
+ | Name f_id -> next_ident_away_in_goal f_id ids
+ | Anonymous -> anomaly (Pp.str "Anonymous function.")
in
let n_names_types,_ = decompose_lam_n sigma nb_args body1 in
let n_ids,ids =
- List.fold_left
+ List.fold_left
(fun (n_ids,ids) (n_name,_) ->
match n_name.binder_name with
- | Name id ->
- let n_id = next_ident_away_in_goal id ids in
- n_id::n_ids,n_id::ids
- | _ -> anomaly (Pp.str "anonymous argument.")
- )
- ([],(f_id::ids))
- n_names_types
+ | Name id ->
+ let n_id = next_ident_away_in_goal id ids in
+ n_id::n_ids,n_id::ids
+ | _ -> anomaly (Pp.str "anonymous argument.")
+ )
+ ([],(f_id::ids))
+ n_names_types
in
let rec_arg_id = List.nth n_ids (rec_arg_num - 1) in
let expr = instantiate_lambda sigma func_body (mkVar f_id::(List.map mkVar n_ids)) in
termination_proof_header
- is_mes
- input_type
- ids
- n_ids
- relation
- rec_arg_num
- rec_arg_id
- (fun rec_arg_id hrec acc_id acc_inv g ->
- (prove_terminate (fun infos -> tclIDTAC)
- { is_main_branch = true; (* we are on the main branche (i.e. still on a match ... with .... end *)
- is_final = true; (* and on leaf (more or less) *)
- f_terminate = delayed_force coq_O;
- nb_arg = nb_args;
- concl_tac = concl_tac;
- rec_arg_id = rec_arg_id;
- is_mes = is_mes;
- ih = hrec;
- f_id = f_id;
- f_constr = mkVar f_id;
- func = func;
- info = expr;
- acc_inv = acc_inv;
- acc_id = acc_id;
- values_and_bounds = [];
- eqs = [];
- forbidden_ids = [];
- args_assoc = []
- }
- )
- g
- )
- (tclUSER_if_not_mes concl_tac)
- g
+ is_mes
+ input_type
+ ids
+ n_ids
+ relation
+ rec_arg_num
+ rec_arg_id
+ (fun rec_arg_id hrec acc_id acc_inv g ->
+ (prove_terminate (fun infos -> tclIDTAC)
+ { is_main_branch = true; (* we are on the main branche (i.e. still on a match ... with .... end *)
+ is_final = true; (* and on leaf (more or less) *)
+ f_terminate = delayed_force coq_O;
+ nb_arg = nb_args;
+ concl_tac = concl_tac;
+ rec_arg_id = rec_arg_id;
+ is_mes = is_mes;
+ ih = hrec;
+ f_id = f_id;
+ f_constr = mkVar f_id;
+ func = func;
+ info = expr;
+ acc_inv = acc_inv;
+ acc_id = acc_id;
+ values_and_bounds = [];
+ eqs = [];
+ forbidden_ids = [];
+ args_assoc = []
+ }
+ )
+ g
+ )
+ (tclUSER_if_not_mes concl_tac)
+ g
end
let get_current_subgoals_types pstate =
- let p = Proof_global.give_me_the_proof pstate in
+ let p = Proof_global.get_proof pstate in
let Proof.{ goals=sgs; sigma; _ } = Proof.data p in
sigma, List.map (Goal.V82.abstract_type sigma) sgs
@@ -1231,32 +1229,32 @@ let build_and_l sigma l =
let conj_constr = Coqlib.build_coq_conj () in
let mk_and p1 p2 =
mkApp(EConstr.of_constr and_constr,[|p1;p2|]) in
- let rec is_well_founded t =
- match EConstr.kind sigma t with
+ let rec is_well_founded t =
+ match EConstr.kind sigma t with
| Prod(_,_,t') -> is_well_founded t'
- | App(_,_) ->
- let (f,_) = decompose_app sigma t in
- EConstr.eq_constr sigma f (well_founded ())
- | _ ->
- false
+ | App(_,_) ->
+ let (f,_) = decompose_app sigma t in
+ EConstr.eq_constr sigma f (well_founded ())
+ | _ ->
+ false
in
- let compare t1 t2 =
- let b1,b2= is_well_founded t1,is_well_founded t2 in
+ let compare t1 t2 =
+ let b1,b2= is_well_founded t1,is_well_founded t2 in
if (b1&&b2) || not (b1 || b2) then 0
else if b1 && not b2 then 1 else -1
in
- let l = List.sort compare l in
+ let l = List.sort compare l in
let rec f = function
| [] -> raise EmptySubgoals
| [p] -> p,tclIDTAC,1
| p1::pl ->
- let c,tac,nb = f pl in
- mk_and p1 c,
- tclTHENS
+ let c,tac,nb = f pl in
+ mk_and p1 c,
+ tclTHENS
(Proofview.V82.of_tactic (apply (EConstr.of_constr (constr_of_monomorphic_global conj_constr))))
- [tclIDTAC;
- tac
- ],nb+1
+ [tclIDTAC;
+ tac
+ ],nb+1
in f l
@@ -1266,23 +1264,23 @@ let is_rec_res id =
try
String.equal (String.sub id_name 0 (String.length rec_res_name)) rec_res_name
with Invalid_argument _ -> false
-
+
let clear_goals sigma =
let rec clear_goal t =
match EConstr.kind sigma t with
| Prod({binder_name=Name id} as na,t',b) ->
- let b' = clear_goal b in
- if noccurn sigma 1 b' && (is_rec_res id)
- then Vars.lift (-1) b'
- else if b' == b then t
+ let b' = clear_goal b in
+ if noccurn sigma 1 b' && (is_rec_res id)
+ then Vars.lift (-1) b'
+ else if b' == b then t
else mkProd(na,t',b')
| _ -> EConstr.map sigma clear_goal t
in
List.map clear_goal
-let build_new_goal_type pstate =
- let sigma, sub_gls_types = get_current_subgoals_types pstate in
+let build_new_goal_type lemma =
+ let sigma, sub_gls_types = Lemmas.pf_fold get_current_subgoals_types lemma in
(* Pp.msgnl (str "sub_gls_types1 := " ++ Util.prlist_with_sep (fun () -> Pp.fnl () ++ Pp.fnl ()) Printer.pr_lconstr sub_gls_types); *)
let sub_gls_types = clear_goals sigma sub_gls_types in
(* Pp.msgnl (str "sub_gls_types2 := " ++ Pp.prlist_with_sep (fun () -> Pp.fnl () ++ Pp.fnl ()) Printer.pr_lconstr sub_gls_types); *)
@@ -1297,14 +1295,14 @@ let is_opaque_constant c =
| Declarations.Def _ -> Proof_global.Transparent
| Declarations.Primitive _ -> Proof_global.Opaque
-let open_new_goal pstate build_proof sigma using_lemmas ref_ goal_name (gls_type,decompose_and_tac,nb_goal) =
+let open_new_goal ~lemma build_proof sigma using_lemmas ref_ goal_name (gls_type,decompose_and_tac,nb_goal) =
(* Pp.msgnl (str "gls_type := " ++ Printer.pr_lconstr gls_type); *)
- let current_proof_name = Proof_global.get_current_proof_name pstate in
+ let current_proof_name = Lemmas.pf_fold Proof_global.get_proof_name lemma in
let name = match goal_name with
| Some s -> s
| None ->
- try add_suffix current_proof_name "_subproof"
- with e when CErrors.noncritical e ->
+ try add_suffix current_proof_name "_subproof"
+ with e when CErrors.noncritical e ->
anomaly (Pp.str "open_new_goal with an unnamed theorem.")
in
let na = next_global_ident_away name Id.Set.empty in
@@ -1315,93 +1313,90 @@ let open_new_goal pstate build_proof sigma using_lemmas ref_ goal_name (gls_type
let na_ref = qualid_of_ident na in
let na_global = Smartlocate.global_with_alias na_ref in
match na_global with
- ConstRef c -> is_opaque_constant c
- | _ -> anomaly ~label:"equation_lemma" (Pp.str "not a constant.")
+ ConstRef c -> is_opaque_constant c
+ | _ -> anomaly ~label:"equation_lemma" (Pp.str "not a constant.")
in
let lemma = mkConst (Names.Constant.make1 (Lib.make_kn na)) in
ref_ := Value (EConstr.Unsafe.to_constr lemma);
let lid = ref [] in
let h_num = ref (-1) in
let env = Global.env () in
- let pstate = build_proof env (Evd.from_env env)
+ let lemma = build_proof env (Evd.from_env env)
( fun gls ->
- let hid = next_ident_away_in_goal h_id (pf_ids_of_hyps gls) in
+ let hid = next_ident_away_in_goal h_id (pf_ids_of_hyps gls) in
observe_tclTHENLIST (fun _ _ -> str "")
- [
- Proofview.V82.of_tactic (generalize [lemma]);
- Proofview.V82.of_tactic (Simple.intro hid);
- (fun g ->
- let ids = pf_ids_of_hyps g in
- tclTHEN
- (Proofview.V82.of_tactic (Elim.h_decompose_and (mkVar hid)))
- (fun g ->
- let ids' = pf_ids_of_hyps g in
- lid := List.rev (List.subtract Id.equal ids' ids);
- if List.is_empty !lid then lid := [hid];
- tclIDTAC g
- )
- g
- );
- ] gls)
+ [
+ Proofview.V82.of_tactic (generalize [lemma]);
+ Proofview.V82.of_tactic (Simple.intro hid);
+ (fun g ->
+ let ids = pf_ids_of_hyps g in
+ tclTHEN
+ (Proofview.V82.of_tactic (Elim.h_decompose_and (mkVar hid)))
+ (fun g ->
+ let ids' = pf_ids_of_hyps g in
+ lid := List.rev (List.subtract Id.equal ids' ids);
+ if List.is_empty !lid then lid := [hid];
+ tclIDTAC g
+ )
+ g
+ );
+ ] gls)
(fun g ->
let sigma = project g in
- match EConstr.kind sigma (pf_concl g) with
- | App(f,_) when EConstr.eq_constr sigma f (well_founded ()) ->
- Proofview.V82.of_tactic (Auto.h_auto None [] (Some [])) g
- | _ ->
- incr h_num;
+ match EConstr.kind sigma (pf_concl g) with
+ | App(f,_) when EConstr.eq_constr sigma f (well_founded ()) ->
+ Proofview.V82.of_tactic (Auto.h_auto None [] (Some [])) g
+ | _ ->
+ incr h_num;
(observe_tac (fun _ _ -> str "finishing using")
- (
- tclCOMPLETE(
- tclFIRST[
- tclTHEN
- (Proofview.V82.of_tactic (eapply_with_bindings (mkVar (List.nth !lid !h_num), NoBindings)))
- (Proofview.V82.of_tactic e_assumption);
- Eauto.eauto_with_bases
- (true,5)
- [(fun _ sigma -> (sigma, (Lazy.force refl_equal)))]
+ (
+ tclCOMPLETE(
+ tclFIRST[
+ tclTHEN
+ (Proofview.V82.of_tactic (eapply_with_bindings (mkVar (List.nth !lid !h_num), NoBindings)))
+ (Proofview.V82.of_tactic e_assumption);
+ Eauto.eauto_with_bases
+ (true,5)
+ [(fun _ sigma -> (sigma, (Lazy.force refl_equal)))]
[Hints.Hint_db.empty TransparentState.empty false]
- ]
- )
- )
- )
- g)
+ ]
+ )
+ )
+ )
+ g)
in
- let _pstate = Lemmas.save_proof_proved ?proof:None ~pstate ~opaque:opacity ~idopt:None in
- ()
+ Lemmas.save_lemma_proved ?proof:None ~lemma ~opaque:opacity ~idopt:None
in
- let pstate = Lemmas.start_proof ~ontop:(Some pstate)
+ let lemma = Lemmas.start_lemma
na
- (Decl_kinds.Global, false (* FIXME *), Decl_kinds.Proof Decl_kinds.Lemma)
- sigma gls_type ~hook:(Lemmas.mk_hook hook) in
- let pstate = if Indfun_common.is_strict_tcc ()
+ Decl_kinds.(Global ImportDefaultBehavior, false (* FIXME *), Proof Lemma)
+ sigma gls_type ~hook:(DeclareDef.Hook.make hook) in
+ let lemma = if Indfun_common.is_strict_tcc ()
then
- fst @@ by (Proofview.V82.tactic (tclIDTAC)) pstate
- else
- fst @@ by (Proofview.V82.tactic begin
- fun g ->
- tclTHEN
- (decompose_and_tac)
- (tclORELSE
- (tclFIRST
- (List.map
- (fun c ->
- Proofview.V82.of_tactic (Tacticals.New.tclTHENLIST
- [intros;
+ fst @@ Lemmas.by (Proofview.V82.tactic (tclIDTAC)) lemma
+ else
+ fst @@ Lemmas.by (Proofview.V82.tactic begin
+ fun g ->
+ tclTHEN
+ (decompose_and_tac)
+ (tclORELSE
+ (tclFIRST
+ (List.map
+ (fun c ->
+ Proofview.V82.of_tactic (Tacticals.New.tclTHENLIST
+ [intros;
Simple.apply (fst (interp_constr (Global.env()) Evd.empty c)) (*FIXME*);
- Tacticals.New.tclCOMPLETE Auto.default_auto
- ])
- )
- using_lemmas)
- ) tclIDTAC)
- g end) pstate
+ Tacticals.New.tclCOMPLETE Auto.default_auto
+ ])
+ )
+ using_lemmas)
+ ) tclIDTAC)
+ g end) lemma
in
- try
- Some (fst @@ by (Proofview.V82.tactic tclIDTAC) pstate) (* raises UserError _ if the proof is complete *)
- with UserError _ ->
- defined pstate
+ if Lemmas.(pf_fold Proof_global.get_open_goals) lemma = 0 then (defined lemma; None) else Some lemma
let com_terminate
+ interactive_proof
tcc_lemma_name
tcc_lemma_ref
is_mes
@@ -1413,25 +1408,26 @@ let com_terminate
nb_args ctx
hook =
let start_proof env ctx (tac_start:tactic) (tac_end:tactic) =
- let pstate = Lemmas.start_proof ~ontop:None thm_name
- (Global, false (* FIXME *), Proof Lemma) ~sign:(Environ.named_context_val env)
+ let lemma = Lemmas.start_lemma thm_name
+ (Global ImportDefaultBehavior, false (* FIXME *), Proof Lemma) ~sign:(Environ.named_context_val env)
ctx (EConstr.of_constr (compute_terminate_type nb_args fonctional_ref)) ~hook in
- let pstate = fst @@ by (Proofview.V82.tactic (observe_tac (fun _ _ -> str "starting_tac") tac_start)) pstate in
- fst @@ by (Proofview.V82.tactic (observe_tac (fun _ _ -> str "whole_start") (whole_start tac_end nb_args is_mes fonctional_ref
- input_type relation rec_arg_num ))) pstate
+ let lemma = fst @@ Lemmas.by (Proofview.V82.tactic (observe_tac (fun _ _ -> str "starting_tac") tac_start)) lemma in
+ fst @@ Lemmas.by (Proofview.V82.tactic (observe_tac (fun _ _ -> str "whole_start") (whole_start tac_end nb_args is_mes fonctional_ref
+ input_type relation rec_arg_num ))) lemma
in
- let pstate = start_proof Global.(env ()) ctx tclIDTAC tclIDTAC in
+ let lemma = start_proof Global.(env ()) ctx tclIDTAC tclIDTAC in
try
- let sigma, new_goal_type = build_new_goal_type pstate in
+ let sigma, new_goal_type = build_new_goal_type lemma in
let sigma = Evd.from_ctx (Evd.evar_universe_context sigma) in
- open_new_goal pstate start_proof sigma
+ open_new_goal ~lemma start_proof sigma
using_lemmas tcc_lemma_ref
(Some tcc_lemma_name)
(new_goal_type)
with EmptySubgoals ->
(* a non recursive function declared with measure ! *)
tcc_lemma_ref := Not_needed;
- defined pstate
+ if interactive_proof then Some lemma
+ else (defined lemma; None)
let start_equation (f:GlobRef.t) (term_f:GlobRef.t)
(cont_tactic:Id.t list -> tactic) g =
@@ -1453,51 +1449,49 @@ let com_eqn sign uctx nb_arg eq_name functional_ref f_ref terminate_ref equation
let open CVars in
let opacity =
match terminate_ref with
- | ConstRef c -> is_opaque_constant c
- | _ -> anomaly ~label:"terminate_lemma" (Pp.str "not a constant.")
+ | ConstRef c -> is_opaque_constant c
+ | _ -> anomaly ~label:"terminate_lemma" (Pp.str "not a constant.")
in
let evd = Evd.from_ctx uctx in
let f_constr = constr_of_monomorphic_global f_ref in
let equation_lemma_type = subst1 f_constr equation_lemma_type in
- let pstate = Lemmas.start_proof ~ontop:None eq_name (Global, false, Proof Lemma) ~sign evd
+ let lemma = Lemmas.start_lemma eq_name (Global ImportDefaultBehavior, false, Proof Lemma) ~sign evd
(EConstr.of_constr equation_lemma_type) in
- let pstate = fst @@ by
+ let lemma = fst @@ Lemmas.by
(Proofview.V82.tactic (start_equation f_ref terminate_ref
- (fun x ->
- prove_eq (fun _ -> tclIDTAC)
- {nb_arg=nb_arg;
+ (fun x ->
+ prove_eq (fun _ -> tclIDTAC)
+ {nb_arg=nb_arg;
f_terminate = EConstr.of_constr (constr_of_monomorphic_global terminate_ref);
- f_constr = EConstr.of_constr f_constr;
- concl_tac = tclIDTAC;
- func=functional_ref;
- info=(instantiate_lambda Evd.empty
+ f_constr = EConstr.of_constr f_constr;
+ concl_tac = tclIDTAC;
+ func=functional_ref;
+ info=(instantiate_lambda Evd.empty
(EConstr.of_constr (def_of_const (constr_of_monomorphic_global functional_ref)))
- (EConstr.of_constr f_constr::List.map mkVar x)
- );
- is_main_branch = true;
- is_final = true;
- values_and_bounds = [];
- eqs = [];
- forbidden_ids = [];
- acc_inv = lazy (assert false);
- acc_id = Id.of_string "____";
- args_assoc = [];
- f_id = Id.of_string "______";
- rec_arg_id = Id.of_string "______";
- is_mes = false;
- ih = Id.of_string "______";
- }
- )
- )) pstate in
- (* (try Vernacentries.interp (Vernacexpr.VernacShow Vernacexpr.ShowProof) with _ -> ()); *)
-(* Vernacentries.interp (Vernacexpr.VernacShow Vernacexpr.ShowScript); *)
- let _ = Flags.silently (fun () -> Lemmas.save_proof_proved ?proof:None ~pstate ~opaque:opacity ~idopt:None) () in
+ (EConstr.of_constr f_constr::List.map mkVar x)
+ );
+ is_main_branch = true;
+ is_final = true;
+ values_and_bounds = [];
+ eqs = [];
+ forbidden_ids = [];
+ acc_inv = lazy (assert false);
+ acc_id = Id.of_string "____";
+ args_assoc = [];
+ f_id = Id.of_string "______";
+ rec_arg_id = Id.of_string "______";
+ is_mes = false;
+ ih = Id.of_string "______";
+ }
+ )
+ )) lemma in
+ let _ = Flags.silently (fun () -> Lemmas.save_lemma_proved ?proof:None ~lemma ~opaque:opacity ~idopt:None) () in
()
(* Pp.msgnl (fun _ _ -> str "eqn finished"); *)
-let recursive_definition is_mes function_name rec_impls type_of_f r rec_arg_num eq
- generate_induction_principle using_lemmas : Proof_global.t option =
+let recursive_definition ~interactive_proof ~is_mes function_name rec_impls type_of_f r rec_arg_num eq
+ generate_induction_principle using_lemmas : Lemmas.t option =
let open Term in
let open Constr in
let open CVars in
@@ -1554,18 +1548,19 @@ let recursive_definition is_mes function_name rec_impls type_of_f r rec_arg_num
let stop =
(* XXX: What is the correct way to get sign at hook time *)
let sign = Environ.named_context_val Global.(env ()) in
- try com_eqn sign uctx (List.length res_vars) equation_id functional_ref f_ref term_ref (subst_var function_name equation_lemma_type);
- false
+ try
+ com_eqn sign uctx (List.length res_vars) equation_id functional_ref f_ref term_ref (subst_var function_name equation_lemma_type);
+ false
with e when CErrors.noncritical e ->
- begin
- if do_observe ()
- then Feedback.msg_debug (str "Cannot create equation Lemma " ++ CErrors.print e)
- else CErrors.user_err ~hdr:"Cannot create equation Lemma"
- (str "Cannot create equation lemma." ++ spc () ++
+ begin
+ if do_observe ()
+ then Feedback.msg_debug (str "Cannot create equation Lemma " ++ CErrors.print e)
+ else CErrors.user_err ~hdr:"Cannot create equation Lemma"
+ (str "Cannot create equation lemma." ++ spc () ++
str "This may be because the function is nested-recursive.")
- ;
- true
- end
+ ;
+ true
+ end
in
if not stop
then
@@ -1579,21 +1574,22 @@ let recursive_definition is_mes function_name rec_impls type_of_f r rec_arg_num
(nb_prod evd (EConstr.of_constr res)) relation;
Flags.if_verbose
msgnl (h 1 (Ppconstr.pr_id function_name ++
- spc () ++ str"is defined" )++ fnl () ++
- h 1 (Ppconstr.pr_id equation_id ++
- spc () ++ str"is defined" )
+ spc () ++ str"is defined" )++ fnl () ++
+ h 1 (Ppconstr.pr_id equation_id ++
+ spc () ++ str"is defined" )
)
in
- (* XXX STATE Why do we need this... why is the toplevel protection not enought *)
+ (* XXX STATE Why do we need this... why is the toplevel protection not enough *)
funind_purify (fun () ->
- let pstate = com_terminate
- tcc_lemma_name
- tcc_lemma_constr
- is_mes functional_ref
- (EConstr.of_constr rec_arg_type)
- relation rec_arg_num
- term_id
- using_lemmas
- (List.length res_vars)
- evd (Lemmas.mk_hook hook)
- in pstate) ()
+ com_terminate
+ interactive_proof
+ tcc_lemma_name
+ tcc_lemma_constr
+ is_mes functional_ref
+ (EConstr.of_constr rec_arg_type)
+ relation rec_arg_num
+ term_id
+ using_lemmas
+ (List.length res_vars)
+ evd (DeclareDef.Hook.make hook))
+ ()
diff --git a/plugins/funind/recdef.mli b/plugins/funind/recdef.mli
index a006c2c354..e6aa452def 100644
--- a/plugins/funind/recdef.mli
+++ b/plugins/funind/recdef.mli
@@ -1,19 +1,21 @@
open Constr
-val tclUSER_if_not_mes :
+val tclUSER_if_not_mes :
Tacmach.tactic ->
- bool ->
- Names.Id.t list option ->
+ bool ->
+ Names.Id.t list option ->
Tacmach.tactic
-val recursive_definition :
-bool ->
- Names.Id.t ->
- Constrintern.internalization_env ->
- Constrexpr.constr_expr ->
- Constrexpr.constr_expr ->
- int -> Constrexpr.constr_expr -> (pconstant ->
- Indfun_common.tcc_lemma_value ref ->
- pconstant ->
- pconstant -> int -> EConstr.types -> int -> EConstr.constr -> unit) -> Constrexpr.constr_expr list -> Proof_global.t option
-
+val recursive_definition
+ : interactive_proof:bool
+ -> is_mes:bool
+ -> Names.Id.t
+ -> Constrintern.internalization_env
+ -> Constrexpr.constr_expr
+ -> Constrexpr.constr_expr
+ -> int
+ -> Constrexpr.constr_expr
+ -> (pconstant -> Indfun_common.tcc_lemma_value ref -> pconstant ->
+ pconstant -> int -> EConstr.types -> int -> EConstr.constr -> unit)
+ -> Constrexpr.constr_expr list
+ -> Lemmas.t option
diff --git a/plugins/ltac/coretactics.mlg b/plugins/ltac/coretactics.mlg
index d9338f0421..2159c05f80 100644
--- a/plugins/ltac/coretactics.mlg
+++ b/plugins/ltac/coretactics.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -150,7 +150,7 @@ TACTIC EXTEND specialize
| [ "specialize" constr_with_bindings(c) ] -> {
Tacticals.New.tclDELAYEDWITHHOLES false c (fun c -> Tactics.specialize c None)
}
-| [ "specialize" constr_with_bindings(c) "as" intropattern(ipat) ] -> {
+| [ "specialize" constr_with_bindings(c) "as" simple_intropattern(ipat) ] -> {
Tacticals.New.tclDELAYEDWITHHOLES false c (fun c -> Tactics.specialize c (Some ipat))
}
END
diff --git a/plugins/ltac/evar_tactics.ml b/plugins/ltac/evar_tactics.ml
index 050fdcb608..5211bedd46 100644
--- a/plugins/ltac/evar_tactics.ml
+++ b/plugins/ltac/evar_tactics.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/evar_tactics.mli b/plugins/ltac/evar_tactics.mli
index b6cfc38260..d99c800320 100644
--- a/plugins/ltac/evar_tactics.mli
+++ b/plugins/ltac/evar_tactics.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/extraargs.mlg b/plugins/ltac/extraargs.mlg
index eb9cacb975..2654729652 100644
--- a/plugins/ltac/extraargs.mlg
+++ b/plugins/ltac/extraargs.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -35,7 +35,7 @@ let () = create_generic_quotation "ident" Pcoq.Prim.ident Stdarg.wit_ident
let () = create_generic_quotation "reference" Pcoq.Prim.reference Stdarg.wit_ref
let () = create_generic_quotation "uconstr" Pcoq.Constr.lconstr Stdarg.wit_uconstr
let () = create_generic_quotation "constr" Pcoq.Constr.lconstr Stdarg.wit_constr
-let () = create_generic_quotation "ipattern" Pltac.simple_intropattern wit_intro_pattern
+let () = create_generic_quotation "ipattern" Pltac.simple_intropattern wit_simple_intropattern
let () = create_generic_quotation "open_constr" Pcoq.Constr.lconstr Stdarg.wit_open_constr
let () =
let inject (loc, v) = Tacexpr.Tacexp v in
@@ -46,7 +46,7 @@ let () =
let () =
let register name entry = Tacentries.register_tactic_notation_entry name entry in
register "hyp" wit_var;
- register "simple_intropattern" wit_intro_pattern;
+ register "simple_intropattern" wit_simple_intropattern;
register "integer" wit_integer;
register "reference" wit_ref;
()
diff --git a/plugins/ltac/extraargs.mli b/plugins/ltac/extraargs.mli
index 7f9eecbef5..6dd51e4e01 100644
--- a/plugins/ltac/extraargs.mli
+++ b/plugins/ltac/extraargs.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/extratactics.mlg b/plugins/ltac/extratactics.mlg
index f5098d2a34..49d8ab4e23 100644
--- a/plugins/ltac/extratactics.mlg
+++ b/plugins/ltac/extratactics.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -146,6 +146,23 @@ let discrHyp id =
let injection_main with_evars c =
elimOnConstrWithHoles (injClause None None) with_evars c
+let isInjPat pat = match pat.CAst.v with IntroAction (IntroInjection _) -> Some pat.CAst.loc | _ -> None
+
+let decode_inj_ipat ?loc = function
+ (* For the "as [= pat1 ... patn ]" syntax *)
+ | [{ CAst.v = IntroAction (IntroInjection ipat) }] -> ipat
+ (* For the "as pat1 ... patn" syntax *)
+ | ([] | [_]) as ipat -> ipat
+ | pat1::pat2::_ as ipat ->
+ (* To be sure that there is no confusion of syntax, we check that no [= ...] occurs
+ in the non-singleton list of patterns *)
+ match isInjPat pat1 with
+ | Some _ -> user_err ?loc:pat2.CAst.loc (str "Unexpected pattern.")
+ | None ->
+ match List.map_filter isInjPat ipat with
+ | loc :: _ -> user_err ?loc (str "Unexpected injection pattern.")
+ | [] -> ipat
+
}
TACTIC EXTEND injection
@@ -157,16 +174,16 @@ TACTIC EXTEND einjection
| [ "einjection" destruction_arg(c) ] -> { mytclWithHoles (injClause None None) true c }
END
TACTIC EXTEND injection_as
-| [ "injection" "as" intropattern_list(ipat)] ->
- { injClause None (Some ipat) false None }
-| [ "injection" destruction_arg(c) "as" intropattern_list(ipat)] ->
- { mytclWithHoles (injClause None (Some ipat)) false c }
+| [ "injection" "as" simple_intropattern_list(ipat)] ->
+ { injClause None (Some (decode_inj_ipat ipat)) false None }
+| [ "injection" destruction_arg(c) "as" simple_intropattern_list(ipat)] ->
+ { mytclWithHoles (injClause None (Some (decode_inj_ipat ipat))) false c }
END
TACTIC EXTEND einjection_as
-| [ "einjection" "as" intropattern_list(ipat)] ->
- { injClause None (Some ipat) true None }
-| [ "einjection" destruction_arg(c) "as" intropattern_list(ipat)] ->
- { mytclWithHoles (injClause None (Some ipat)) true c }
+| [ "einjection" "as" simple_intropattern_list(ipat)] ->
+ { injClause None (Some (decode_inj_ipat ipat)) true None }
+| [ "einjection" destruction_arg(c) "as" simple_intropattern_list(ipat)] ->
+ { mytclWithHoles (injClause None (Some (decode_inj_ipat ipat))) true c }
END
TACTIC EXTEND simple_injection
| [ "simple" "injection" ] -> { simpleInjClause None false None }
@@ -319,7 +336,7 @@ let add_rewrite_hint ~poly bases ort t lcsr =
let add_hints base = add_rew_rules base eqs in
List.iter add_hints bases
-let classify_hint _ = VtSideff [], VtLater
+let classify_hint _ = VtSideff ([], VtLater)
}
@@ -405,7 +422,7 @@ END
open Inv
open Leminv
-let seff id = VtSideff [id], VtLater
+let seff id = VtSideff ([id], VtLater)
}
@@ -914,10 +931,10 @@ END
(* spiwack: I put it in extratactics because it is somewhat tied with
the semantics of the LCF-style tactics, hence with the classic tactic
mode. *)
-VERNAC COMMAND EXTEND GrabEvars
-| ![ proof ] [ "Grab" "Existential" "Variables" ]
+VERNAC COMMAND EXTEND GrabEvars STATE proof
+| [ "Grab" "Existential" "Variables" ]
=> { classify_as_proofstep }
- -> { fun ~pstate -> Option.map (Proof_global.simple_with_current_proof (fun _ p -> Proof.V82.grab_evars p)) pstate }
+ -> { fun ~pstate -> Proof_global.map_proof (fun p -> Proof.V82.grab_evars p) pstate }
END
(* Shelves all the goals under focus. *)
@@ -946,10 +963,10 @@ TACTIC EXTEND unshelve
END
(* Command to add every unshelved variables to the focus *)
-VERNAC COMMAND EXTEND Unshelve
-| ![ proof ] [ "Unshelve" ]
+VERNAC COMMAND EXTEND Unshelve STATE proof
+| [ "Unshelve" ]
=> { classify_as_proofstep }
- -> { fun ~pstate -> Option.map (Proof_global.simple_with_current_proof (fun _ p -> Proof.unshelve p)) pstate }
+ -> { fun ~pstate -> Proof_global.map_proof (fun p -> Proof.unshelve p) pstate }
END
(* Gives up on the goals under focus: the goals are considered solved,
@@ -1101,7 +1118,7 @@ END
VERNAC COMMAND EXTEND OptimizeProof
| ![ proof ] [ "Optimize" "Proof" ] => { classify_as_proofstep } ->
- { fun ~pstate -> Option.map Proof_global.compact_the_proof pstate }
+ { fun ~pstate -> Proof_global.compact_the_proof pstate }
| [ "Optimize" "Heap" ] => { classify_as_proofstep } ->
{ Gc.compact () }
END
diff --git a/plugins/ltac/extratactics.mli b/plugins/ltac/extratactics.mli
index 4576562634..e47226410a 100644
--- a/plugins/ltac/extratactics.mli
+++ b/plugins/ltac/extratactics.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/g_auto.mlg b/plugins/ltac/g_auto.mlg
index e59076bd63..8344f9dae3 100644
--- a/plugins/ltac/g_auto.mlg
+++ b/plugins/ltac/g_auto.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/g_class.mlg b/plugins/ltac/g_class.mlg
index 049a699cbd..0aaf417f33 100644
--- a/plugins/ltac/g_class.mlg
+++ b/plugins/ltac/g_class.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/g_eqdecide.mlg b/plugins/ltac/g_eqdecide.mlg
index e57afe3e33..d416f08c06 100644
--- a/plugins/ltac/g_eqdecide.mlg
+++ b/plugins/ltac/g_eqdecide.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/g_ltac.mlg b/plugins/ltac/g_ltac.mlg
index 7eb34158e8..5c84b35f1b 100644
--- a/plugins/ltac/g_ltac.mlg
+++ b/plugins/ltac/g_ltac.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -38,7 +38,7 @@ let arg_of_expr = function
let genarg_of_unit () = in_gen (rawwit Stdarg.wit_unit) ()
let genarg_of_int n = in_gen (rawwit Stdarg.wit_int) n
-let genarg_of_ipattern pat = in_gen (rawwit Tacarg.wit_intro_pattern) pat
+let genarg_of_ipattern pat = in_gen (rawwit Tacarg.wit_simple_intropattern) pat
let genarg_of_uconstr c = in_gen (rawwit Stdarg.wit_uconstr) c
let in_tac tac = in_gen (rawwit Tacarg.wit_ltac) tac
@@ -376,7 +376,7 @@ let () = declare_int_option {
let vernac_solve ~pstate n info tcom b =
let open Goal_select in
- let pstate, status = Proof_global.with_current_proof (fun etac p ->
+ let pstate, status = Proof_global.map_fold_proof_endline (fun etac p ->
let with_end_tac = if b then Some etac else None in
let global = match n with SelectAll | SelectList _ -> true | _ -> false in
let info = Option.append info !print_info_trace in
@@ -388,7 +388,7 @@ let vernac_solve ~pstate n info tcom b =
let p = Proof.maximal_unfocus Vernacentries.command_focus p in
p,status) pstate in
if not status then Feedback.feedback Feedback.AddedAxiom;
- Some pstate
+ pstate
let pr_ltac_selector s = Pptactic.pr_goal_selector ~toplevel:true s
@@ -434,23 +434,22 @@ let is_explicit_terminator = function TacSolve _ -> true | _ -> false
}
-VERNAC { tactic_mode } EXTEND VernacSolve
-| ![ proof ] [ ltac_selector_opt(g) ltac_info_opt(n) tactic(t) ltac_use_default(def) ] =>
+VERNAC { tactic_mode } EXTEND VernacSolve STATE proof
+| [ ltac_selector_opt(g) ltac_info_opt(n) tactic(t) ltac_use_default(def) ] =>
{ classify_as_proofstep } -> {
let g = Option.default (Goal_select.get_default_goal_selector ()) g in
- Vernacentries.vernac_require_open_proof vernac_solve g n t def
+ vernac_solve g n t def
}
-| ![ proof ] [ "par" ":" ltac_info_opt(n) tactic(t) ltac_use_default(def) ] =>
+| [ "par" ":" ltac_info_opt(n) tactic(t) ltac_use_default(def) ] =>
{
let anon_abstracting_tac = is_anonymous_abstract t in
let solving_tac = is_explicit_terminator t in
let parallel = `Yes (solving_tac,anon_abstracting_tac) in
let pbr = if solving_tac then Some "par" else None in
- VtProofStep{ parallel = parallel; proof_block_detection = pbr },
- VtLater
+ VtProofStep{ parallel = parallel; proof_block_detection = pbr }
} -> {
let t = rm_abstract t in
- Vernacentries.vernac_require_open_proof vernac_solve Goal_select.SelectAll n t def
+ vernac_solve Goal_select.SelectAll n t def
}
END
@@ -494,7 +493,7 @@ END
VERNAC COMMAND EXTEND VernacTacticNotation
| #[ deprecation; locality; ]
[ "Tactic" "Notation" ltac_tactic_level_opt(n) ne_ltac_production_item_list(r) ":=" tactic(e) ] =>
- { VtSideff [], VtNow } ->
+ { VtSideff ([], VtNow) } ->
{
let n = Option.default 0 n in
Tacentries.add_tactic_notation (Locality.make_module_locality locality) n ?deprecation r e;
@@ -542,7 +541,7 @@ VERNAC COMMAND EXTEND VernacDeclareTacticDefinition
| #[ deprecation; locality; ] [ "Ltac" ne_ltac_tacdef_body_list_sep(l, "with") ] => {
VtSideff (List.map (function
| TacticDefinition ({CAst.v=r},_) -> r
- | TacticRedefinition (qid,_) -> qualid_basename qid) l), VtLater
+ | TacticRedefinition (qid,_) -> qualid_basename qid) l, VtLater)
} -> {
Tacentries.register_ltac (Locality.make_module_locality locality) ?deprecation l;
}
diff --git a/plugins/ltac/g_obligations.mlg b/plugins/ltac/g_obligations.mlg
index de3a9c9fa9..455c8ab003 100644
--- a/plugins/ltac/g_obligations.mlg
+++ b/plugins/ltac/g_obligations.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -80,25 +80,25 @@ GRAMMAR EXTEND Gram
open Obligations
-let obligation ~pstate obl tac = Some (with_tac (fun t -> Obligations.obligation ~ontop:pstate obl t) tac)
-let next_obligation ~pstate obl tac = Some (with_tac (fun t -> Obligations.next_obligation ~ontop:pstate obl t) tac)
+let obligation obl tac = with_tac (fun t -> Obligations.obligation obl t) tac
+let next_obligation obl tac = with_tac (fun t -> Obligations.next_obligation obl t) tac
-let classify_obbl _ = Vernacextend.(VtStartProof (Doesn'tGuaranteeOpacity,[]), VtLater)
+let classify_obbl _ = Vernacextend.(VtStartProof (Doesn'tGuaranteeOpacity,[]))
}
-VERNAC COMMAND EXTEND Obligations CLASSIFIED BY { classify_obbl }
-| ![ proof ] [ "Obligation" integer(num) "of" ident(name) ":" lglob(t) withtac(tac) ] ->
+VERNAC COMMAND EXTEND Obligations CLASSIFIED BY { classify_obbl } STATE open_proof
+| [ "Obligation" integer(num) "of" ident(name) ":" lglob(t) withtac(tac) ] ->
{ obligation (num, Some name, Some t) tac }
-| ![ proof ] [ "Obligation" integer(num) "of" ident(name) withtac(tac) ] ->
+| [ "Obligation" integer(num) "of" ident(name) withtac(tac) ] ->
{ obligation (num, Some name, None) tac }
-| ![ proof ] [ "Obligation" integer(num) ":" lglob(t) withtac(tac) ] ->
+| [ "Obligation" integer(num) ":" lglob(t) withtac(tac) ] ->
{ obligation (num, None, Some t) tac }
-| ![ proof ] [ "Obligation" integer(num) withtac(tac) ] ->
+| [ "Obligation" integer(num) withtac(tac) ] ->
{ obligation (num, None, None) tac }
-| ![ proof ] [ "Next" "Obligation" "of" ident(name) withtac(tac) ] ->
+| [ "Next" "Obligation" "of" ident(name) withtac(tac) ] ->
{ next_obligation (Some name) tac }
-| ![ proof ] [ "Next" "Obligation" withtac(tac) ] -> { next_obligation None tac }
+| [ "Next" "Obligation" withtac(tac) ] -> { next_obligation None tac }
END
VERNAC COMMAND EXTEND Solve_Obligation CLASSIFIED AS SIDEFF
diff --git a/plugins/ltac/g_rewrite.mlg b/plugins/ltac/g_rewrite.mlg
index 12b12bc7b0..d25448b5cb 100644
--- a/plugins/ltac/g_rewrite.mlg
+++ b/plugins/ltac/g_rewrite.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -180,34 +180,34 @@ TACTIC EXTEND setoid_rewrite
END
VERNAC COMMAND EXTEND AddRelation CLASSIFIED AS SIDEFF
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Relation" constr(a) constr(aeq) "reflexivity" "proved" "by" constr(lemma1)
+ | #[ atts = rewrite_attributes; ] [ "Add" "Relation" constr(a) constr(aeq) "reflexivity" "proved" "by" constr(lemma1)
"symmetry" "proved" "by" constr(lemma2) "as" ident(n) ] ->
{ declare_relation atts a aeq n (Some lemma1) (Some lemma2) None }
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Relation" constr(a) constr(aeq) "reflexivity" "proved" "by" constr(lemma1)
+ | #[ atts = rewrite_attributes; ] [ "Add" "Relation" constr(a) constr(aeq) "reflexivity" "proved" "by" constr(lemma1)
"as" ident(n) ] ->
{ declare_relation atts a aeq n (Some lemma1) None None }
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Relation" constr(a) constr(aeq) "as" ident(n) ] ->
+ | #[ atts = rewrite_attributes; ] [ "Add" "Relation" constr(a) constr(aeq) "as" ident(n) ] ->
{ declare_relation atts a aeq n None None None }
END
VERNAC COMMAND EXTEND AddRelation2 CLASSIFIED AS SIDEFF
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Relation" constr(a) constr(aeq) "symmetry" "proved" "by" constr(lemma2)
+ | #[ atts = rewrite_attributes; ] [ "Add" "Relation" constr(a) constr(aeq) "symmetry" "proved" "by" constr(lemma2)
"as" ident(n) ] ->
{ declare_relation atts a aeq n None (Some lemma2) None }
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Relation" constr(a) constr(aeq) "symmetry" "proved" "by" constr(lemma2) "transitivity" "proved" "by" constr(lemma3) "as" ident(n) ] ->
+ | #[ atts = rewrite_attributes; ] [ "Add" "Relation" constr(a) constr(aeq) "symmetry" "proved" "by" constr(lemma2) "transitivity" "proved" "by" constr(lemma3) "as" ident(n) ] ->
{ declare_relation atts a aeq n None (Some lemma2) (Some lemma3) }
END
VERNAC COMMAND EXTEND AddRelation3 CLASSIFIED AS SIDEFF
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Relation" constr(a) constr(aeq) "reflexivity" "proved" "by" constr(lemma1)
+ | #[ atts = rewrite_attributes; ] [ "Add" "Relation" constr(a) constr(aeq) "reflexivity" "proved" "by" constr(lemma1)
"transitivity" "proved" "by" constr(lemma3) "as" ident(n) ] ->
{ declare_relation atts a aeq n (Some lemma1) None (Some lemma3) }
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Relation" constr(a) constr(aeq) "reflexivity" "proved" "by" constr(lemma1)
+ | #[ atts = rewrite_attributes; ] [ "Add" "Relation" constr(a) constr(aeq) "reflexivity" "proved" "by" constr(lemma1)
"symmetry" "proved" "by" constr(lemma2) "transitivity" "proved" "by" constr(lemma3)
"as" ident(n) ] ->
{ declare_relation atts a aeq n (Some lemma1) (Some lemma2) (Some lemma3) }
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Relation" constr(a) constr(aeq) "transitivity" "proved" "by" constr(lemma3)
+ | #[ atts = rewrite_attributes; ] [ "Add" "Relation" constr(a) constr(aeq) "transitivity" "proved" "by" constr(lemma3)
"as" ident(n) ] ->
{ declare_relation atts a aeq n None None (Some lemma3) }
END
@@ -234,65 +234,63 @@ GRAMMAR EXTEND Gram
END
VERNAC COMMAND EXTEND AddParametricRelation CLASSIFIED AS SIDEFF
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq)
+ | #[ atts = rewrite_attributes; ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq)
"reflexivity" "proved" "by" constr(lemma1)
"symmetry" "proved" "by" constr(lemma2) "as" ident(n) ] ->
{ declare_relation atts ~binders:b a aeq n (Some lemma1) (Some lemma2) None }
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq)
+ | #[ atts = rewrite_attributes; ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq)
"reflexivity" "proved" "by" constr(lemma1)
"as" ident(n) ] ->
{ declare_relation atts ~binders:b a aeq n (Some lemma1) None None }
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq) "as" ident(n) ] ->
+ | #[ atts = rewrite_attributes; ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq) "as" ident(n) ] ->
{ declare_relation atts ~binders:b a aeq n None None None }
END
VERNAC COMMAND EXTEND AddParametricRelation2 CLASSIFIED AS SIDEFF
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq) "symmetry" "proved" "by" constr(lemma2)
+ | #[ atts = rewrite_attributes; ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq) "symmetry" "proved" "by" constr(lemma2)
"as" ident(n) ] ->
{ declare_relation atts ~binders:b a aeq n None (Some lemma2) None }
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq) "symmetry" "proved" "by" constr(lemma2) "transitivity" "proved" "by" constr(lemma3) "as" ident(n) ] ->
+ | #[ atts = rewrite_attributes; ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq) "symmetry" "proved" "by" constr(lemma2) "transitivity" "proved" "by" constr(lemma3) "as" ident(n) ] ->
{ declare_relation atts ~binders:b a aeq n None (Some lemma2) (Some lemma3) }
END
VERNAC COMMAND EXTEND AddParametricRelation3 CLASSIFIED AS SIDEFF
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq) "reflexivity" "proved" "by" constr(lemma1)
+ | #[ atts = rewrite_attributes; ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq) "reflexivity" "proved" "by" constr(lemma1)
"transitivity" "proved" "by" constr(lemma3) "as" ident(n) ] ->
{ declare_relation atts ~binders:b a aeq n (Some lemma1) None (Some lemma3) }
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq) "reflexivity" "proved" "by" constr(lemma1)
+ | #[ atts = rewrite_attributes; ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq) "reflexivity" "proved" "by" constr(lemma1)
"symmetry" "proved" "by" constr(lemma2) "transitivity" "proved" "by" constr(lemma3)
"as" ident(n) ] ->
{ declare_relation atts ~binders:b a aeq n (Some lemma1) (Some lemma2) (Some lemma3) }
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq) "transitivity" "proved" "by" constr(lemma3)
+ | #[ atts = rewrite_attributes; ] [ "Add" "Parametric" "Relation" binders(b) ":" constr(a) constr(aeq) "transitivity" "proved" "by" constr(lemma3)
"as" ident(n) ] ->
{ declare_relation atts ~binders:b a aeq n None None (Some lemma3) }
END
VERNAC COMMAND EXTEND AddSetoid1 CLASSIFIED AS SIDEFF
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Setoid" constr(a) constr(aeq) constr(t) "as" ident(n) ] ->
+ | #[ atts = rewrite_attributes; ] [ "Add" "Setoid" constr(a) constr(aeq) constr(t) "as" ident(n) ] ->
{
add_setoid atts [] a aeq t n
}
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Parametric" "Setoid" binders(binders) ":" constr(a) constr(aeq) constr(t) "as" ident(n) ] ->
+ | #[ atts = rewrite_attributes; ] [ "Add" "Parametric" "Setoid" binders(binders) ":" constr(a) constr(aeq) constr(t) "as" ident(n) ] ->
{
add_setoid atts binders a aeq t n
}
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Morphism" constr(m) ":" ident(n) ]
- (* This command may or may not open a goal *)
- => { (if Lib.is_modtype() then VtSideff([n]) else VtStartProof(GuaranteesOpacity, [n])), VtLater }
- -> {
- add_morphism_infer atts m n
- }
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Morphism" constr(m) "with" "signature" lconstr(s) "as" ident(n) ]
- => { VtStartProof(GuaranteesOpacity,[n]), VtLater }
- -> {
- add_morphism atts [] m s n
- }
- | #[ atts = rewrite_attributes; ] ![ proof ] [ "Add" "Parametric" "Morphism" binders(binders) ":" constr(m)
+ | #[ atts = rewrite_attributes; ] ![ open_proof ] [ "Add" "Morphism" constr(m) ":" ident(n) ]
+ => { VtStartProof(GuaranteesOpacity, [n]) }
+ -> { if Lib.is_modtype () then
+ CErrors.user_err Pp.(str "Add Morphism cannot be used in a module type. Use Parameter Morphism instead.");
+ add_morphism_interactive atts m n }
+ | #[ atts = rewrite_attributes; ] [ "Declare" "Morphism" constr(m) ":" ident(n) ]
+ => { VtSideff([n], VtLater) }
+ -> { add_morphism_as_parameter atts m n }
+ | #[ atts = rewrite_attributes; ] ![ open_proof ] [ "Add" "Morphism" constr(m) "with" "signature" lconstr(s) "as" ident(n) ]
+ => { VtStartProof(GuaranteesOpacity,[n]) }
+ -> { add_morphism atts [] m s n }
+ | #[ atts = rewrite_attributes; ] ![ open_proof ] [ "Add" "Parametric" "Morphism" binders(binders) ":" constr(m)
"with" "signature" lconstr(s) "as" ident(n) ]
- => { VtStartProof(GuaranteesOpacity,[n]), VtLater }
- -> {
- add_morphism atts binders m s n
- }
+ => { VtStartProof(GuaranteesOpacity,[n]) }
+ -> { add_morphism atts binders m s n }
END
TACTIC EXTEND setoid_symmetry
@@ -310,12 +308,6 @@ TACTIC EXTEND setoid_transitivity
END
VERNAC COMMAND EXTEND PrintRewriteHintDb CLASSIFIED AS QUERY
-| ![ proof ] [ "Print" "Rewrite" "HintDb" preident(s) ] ->
- { (* This command should not use the proof env, keeping previous
- behavior as requested in review. *)
- fun ~pstate ->
- let sigma, env = Option.cata Pfedit.get_current_context
- (let e = Global.env () in Evd.from_env e, e) pstate in
- Feedback.msg_notice (Autorewrite.print_rewrite_hintdb env sigma s);
- pstate }
+| [ "Print" "Rewrite" "HintDb" preident(s) ] ->
+ { Feedback.msg_notice (Autorewrite.print_rewrite_hintdb s) }
END
diff --git a/plugins/ltac/g_tactic.mlg b/plugins/ltac/g_tactic.mlg
index c23240b782..945a2dd613 100644
--- a/plugins/ltac/g_tactic.mlg
+++ b/plugins/ltac/g_tactic.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/pltac.ml b/plugins/ltac/pltac.ml
index 759bb62fdd..e3042dc3cb 100644
--- a/plugins/ltac/pltac.ml
+++ b/plugins/ltac/pltac.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -52,7 +52,9 @@ let () =
let open Stdarg in
let open Tacarg in
register_grammar wit_int_or_var (int_or_var);
- register_grammar wit_intro_pattern (simple_intropattern);
+ register_grammar wit_intro_pattern (simple_intropattern); (* To remove at end of deprecation phase *)
+(* register_grammar wit_intropattern (intropattern); *) (* To be added at end of deprecation phase *)
+ register_grammar wit_simple_intropattern (simple_intropattern);
register_grammar wit_quant_hyp (quantified_hypothesis);
register_grammar wit_uconstr (uconstr);
register_grammar wit_open_constr (open_constr);
diff --git a/plugins/ltac/pltac.mli b/plugins/ltac/pltac.mli
index 9bff98b6c3..aa2631ae41 100644
--- a/plugins/ltac/pltac.mli
+++ b/plugins/ltac/pltac.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/pptactic.ml b/plugins/ltac/pptactic.ml
index 79f0f521cc..db8d09b79e 100644
--- a/plugins/ltac/pptactic.ml
+++ b/plugins/ltac/pptactic.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -1314,6 +1314,12 @@ let pr_glob_constr_pptac env sigma c =
let pr_lglob_constr_pptac env sigma c =
pr_lglob_constr_env env c
+let pr_raw_intro_pattern =
+ lift_env (fun env sigma -> Miscprint.pr_intro_pattern @@ pr_constr_expr env sigma)
+
+let pr_glob_intro_pattern =
+ lift_env (fun env sigma -> Miscprint.pr_intro_pattern (fun (c,_) -> pr_glob_constr_pptac env sigma c))
+
let () =
let pr_bool b = if b then str "true" else str "false" in
let pr_unit _ = str "()" in
@@ -1323,11 +1329,8 @@ let () =
pr_qualid (pr_or_var (pr_located pr_global)) pr_global;
register_basic_print0 wit_ident pr_id pr_id pr_id;
register_basic_print0 wit_var pr_lident pr_lident pr_id;
- register_print0
- wit_intro_pattern
- (lift_env (fun env sigma -> Miscprint.pr_intro_pattern @@ pr_constr_expr env sigma))
- (lift_env (fun env sigma -> Miscprint.pr_intro_pattern (fun (c,_) -> pr_glob_constr_pptac env sigma c)))
- pr_intro_pattern_env;
+ register_print0 wit_intropattern pr_raw_intro_pattern pr_glob_intro_pattern pr_intro_pattern_env [@warning "-3"];
+ register_print0 wit_simple_intropattern pr_raw_intro_pattern pr_glob_intro_pattern pr_intro_pattern_env;
Genprint.register_print0
wit_clause_dft_concl
(lift (pr_clauses (Some true) pr_lident))
diff --git a/plugins/ltac/pptactic.mli b/plugins/ltac/pptactic.mli
index 70af09833d..9cff3ea1eb 100644
--- a/plugins/ltac/pptactic.mli
+++ b/plugins/ltac/pptactic.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/profile_ltac.ml b/plugins/ltac/profile_ltac.ml
index ae4b53325f..243e0e945c 100644
--- a/plugins/ltac/profile_ltac.ml
+++ b/plugins/ltac/profile_ltac.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/profile_ltac.mli b/plugins/ltac/profile_ltac.mli
index 6a67aab5dc..7595f53fd7 100644
--- a/plugins/ltac/profile_ltac.mli
+++ b/plugins/ltac/profile_ltac.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/profile_ltac_tactics.mlg b/plugins/ltac/profile_ltac_tactics.mlg
index 2713819c7b..9dd71505c8 100644
--- a/plugins/ltac/profile_ltac_tactics.mlg
+++ b/plugins/ltac/profile_ltac_tactics.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/rewrite.ml b/plugins/ltac/rewrite.ml
index 963b7189f9..f977ba34d2 100644
--- a/plugins/ltac/rewrite.ml
+++ b/plugins/ltac/rewrite.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -23,14 +23,12 @@ open Tacticals.New
open Tactics
open Pretype_errors
open Typeclasses
-open Classes
open Constrexpr
open Globnames
open Evd
open Tactypes
open Locus
open Locusops
-open Decl_kinds
open Elimschemes
open Environ
open Termops
@@ -44,13 +42,13 @@ module NamedDecl = Context.Named.Declaration
(** Typeclass-based generalized rewriting. *)
-type rewrite_attributes = { polymorphic : bool; program : bool; global : bool }
+type rewrite_attributes = { polymorphic : bool; global : bool }
let rewrite_attributes =
let open Attributes.Notations in
Attributes.(polymorphic ++ program ++ locality) >>= fun ((polymorphic, program), locality) ->
let global = not (Locality.make_section_locality locality) in
- Attributes.Notations.return { polymorphic; program; global }
+ Attributes.Notations.return { polymorphic; global }
(** Constants used by the tactic. *)
@@ -207,7 +205,7 @@ end) = struct
let mk_relation env evd a =
app_poly env evd relation [| a |]
- (** Build an infered signature from constraints on the arguments and expected output
+ (** Build an inferred signature from constraints on the arguments and expected output
relation *)
let build_signature evars env m (cstrs : (types * types option) option list)
@@ -948,9 +946,9 @@ let fold_match ?(force=false) env sigma c =
if dep then case_dep_scheme_kind_from_prop
else case_scheme_kind_from_prop
else (
- if dep
- then case_dep_scheme_kind_from_type_in_prop
- else case_scheme_kind_from_type)
+ if dep
+ then case_dep_scheme_kind_from_type_in_prop
+ else case_scheme_kind_from_type)
else ((* sortc <> InProp by typing *)
if dep
then case_dep_scheme_kind_from_type
@@ -1791,20 +1789,21 @@ let rec strategy_of_ast = function
let mkappc s l = CAst.make @@ CAppExpl ((None,qualid_of_ident (Id.of_string s),None),l)
let declare_an_instance n s args =
- (((CAst.make @@ Name n),None), Explicit,
+ (((CAst.make @@ Name n),None),
CAst.make @@ CAppExpl ((None, qualid_of_string s,None), args))
let declare_instance a aeq n s = declare_an_instance n s [a;aeq]
-let anew_instance ~pstate atts binders instance fields =
- let program_mode = atts.program in
- new_instance ~pstate ~program_mode atts.polymorphic
- binders instance (Some (true, CAst.make @@ CRecord (fields)))
- ~global:atts.global ~generalize:false Hints.empty_hint_info
+let anew_instance atts binders (name,t) fields =
+ let _id = Classes.new_instance atts.polymorphic
+ name binders t (true, CAst.make @@ CRecord (fields))
+ ~global:atts.global ~generalize:false Hints.empty_hint_info
+ in
+ ()
-let declare_instance_refl ~pstate atts binders a aeq n lemma =
+let declare_instance_refl atts binders a aeq n lemma =
let instance = declare_instance a aeq (add_suffix n "_Reflexive") "Coq.Classes.RelationClasses.Reflexive"
- in anew_instance ~pstate atts binders instance
+ in anew_instance atts binders instance
[(qualid_of_ident (Id.of_string "reflexivity"),lemma)]
let declare_instance_sym atts binders a aeq n lemma =
@@ -1817,44 +1816,44 @@ let declare_instance_trans atts binders a aeq n lemma =
in anew_instance atts binders instance
[(qualid_of_ident (Id.of_string "transitivity"),lemma)]
-let declare_relation ~pstate atts ?(binders=[]) a aeq n refl symm trans =
+let declare_relation atts ?(binders=[]) a aeq n refl symm trans =
init_setoid ();
let instance = declare_instance a aeq (add_suffix n "_relation") "Coq.Classes.RelationClasses.RewriteRelation" in
- let _, pstate = anew_instance ~pstate atts binders instance [] in
+ let () = anew_instance atts binders instance [] in
match (refl,symm,trans) with
- (None, None, None) -> pstate
- | (Some lemma1, None, None) ->
- snd @@ declare_instance_refl ~pstate atts binders a aeq n lemma1
- | (None, Some lemma2, None) ->
- snd @@ declare_instance_sym ~pstate atts binders a aeq n lemma2
- | (None, None, Some lemma3) ->
- snd @@ declare_instance_trans ~pstate atts binders a aeq n lemma3
- | (Some lemma1, Some lemma2, None) ->
- let _lemma_refl, pstate = declare_instance_refl ~pstate atts binders a aeq n lemma1 in
- snd @@ declare_instance_sym ~pstate atts binders a aeq n lemma2
- | (Some lemma1, None, Some lemma3) ->
- let _lemma_refl, pstate = declare_instance_refl ~pstate atts binders a aeq n lemma1 in
- let _lemma_trans, pstate = declare_instance_trans ~pstate atts binders a aeq n lemma3 in
- let instance = declare_instance a aeq n "Coq.Classes.RelationClasses.PreOrder" in
- snd @@ anew_instance ~pstate atts binders instance
- [(qualid_of_ident (Id.of_string "PreOrder_Reflexive"), lemma1);
- (qualid_of_ident (Id.of_string "PreOrder_Transitive"),lemma3)]
- | (None, Some lemma2, Some lemma3) ->
- let _lemma_sym, pstate = declare_instance_sym ~pstate atts binders a aeq n lemma2 in
- let _lemma_trans, pstate = declare_instance_trans ~pstate atts binders a aeq n lemma3 in
- let instance = declare_instance a aeq n "Coq.Classes.RelationClasses.PER" in
- snd @@ anew_instance ~pstate atts binders instance
- [(qualid_of_ident (Id.of_string "PER_Symmetric"), lemma2);
- (qualid_of_ident (Id.of_string "PER_Transitive"),lemma3)]
- | (Some lemma1, Some lemma2, Some lemma3) ->
- let _lemma_refl, pstate = declare_instance_refl ~pstate atts binders a aeq n lemma1 in
- let _lemma_sym, pstate = declare_instance_sym ~pstate atts binders a aeq n lemma2 in
- let _lemma_trans, pstate = declare_instance_trans ~pstate atts binders a aeq n lemma3 in
- let instance = declare_instance a aeq n "Coq.Classes.RelationClasses.Equivalence" in
- snd @@ anew_instance ~pstate atts binders instance
- [(qualid_of_ident (Id.of_string "Equivalence_Reflexive"), lemma1);
- (qualid_of_ident (Id.of_string "Equivalence_Symmetric"), lemma2);
- (qualid_of_ident (Id.of_string "Equivalence_Transitive"), lemma3)]
+ (None, None, None) -> ()
+ | (Some lemma1, None, None) ->
+ declare_instance_refl atts binders a aeq n lemma1
+ | (None, Some lemma2, None) ->
+ declare_instance_sym atts binders a aeq n lemma2
+ | (None, None, Some lemma3) ->
+ declare_instance_trans atts binders a aeq n lemma3
+ | (Some lemma1, Some lemma2, None) ->
+ let () = declare_instance_refl atts binders a aeq n lemma1 in
+ declare_instance_sym atts binders a aeq n lemma2
+ | (Some lemma1, None, Some lemma3) ->
+ let () = declare_instance_refl atts binders a aeq n lemma1 in
+ let () = declare_instance_trans atts binders a aeq n lemma3 in
+ let instance = declare_instance a aeq n "Coq.Classes.RelationClasses.PreOrder" in
+ anew_instance atts binders instance
+ [(qualid_of_ident (Id.of_string "PreOrder_Reflexive"), lemma1);
+ (qualid_of_ident (Id.of_string "PreOrder_Transitive"),lemma3)]
+ | (None, Some lemma2, Some lemma3) ->
+ let () = declare_instance_sym atts binders a aeq n lemma2 in
+ let () = declare_instance_trans atts binders a aeq n lemma3 in
+ let instance = declare_instance a aeq n "Coq.Classes.RelationClasses.PER" in
+ anew_instance atts binders instance
+ [(qualid_of_ident (Id.of_string "PER_Symmetric"), lemma2);
+ (qualid_of_ident (Id.of_string "PER_Transitive"),lemma3)]
+ | (Some lemma1, Some lemma2, Some lemma3) ->
+ let () = declare_instance_refl atts binders a aeq n lemma1 in
+ let () = declare_instance_sym atts binders a aeq n lemma2 in
+ let () = declare_instance_trans atts binders a aeq n lemma3 in
+ let instance = declare_instance a aeq n "Coq.Classes.RelationClasses.Equivalence" in
+ anew_instance atts binders instance
+ [(qualid_of_ident (Id.of_string "Equivalence_Reflexive"), lemma1);
+ (qualid_of_ident (Id.of_string "Equivalence_Symmetric"), lemma2);
+ (qualid_of_ident (Id.of_string "Equivalence_Transitive"), lemma3)]
let cHole = CAst.make @@ CHole (None, Namegen.IntroAnonymous, None)
@@ -1903,7 +1902,7 @@ let declare_projection n instance_id r =
Declare.definition_entry ~types:typ ~univs term
in
ignore(Declare.declare_constant n
- (Entries.DefinitionEntry cst, Decl_kinds.IsDefinition Decl_kinds.Definition))
+ (Declare.DefinitionEntry cst, Decl_kinds.IsDefinition Decl_kinds.Definition))
let build_morphism_signature env sigma m =
let m,ctx = Constrintern.interp_constr env sigma m in
@@ -1950,19 +1949,18 @@ let warn_add_setoid_deprecated =
CWarnings.create ~name:"add-setoid" ~category:"deprecated" (fun () ->
Pp.(str "Add Setoid is deprecated, please use Add Parametric Relation."))
-let add_setoid ~pstate atts binders a aeq t n =
+let add_setoid atts binders a aeq t n =
warn_add_setoid_deprecated ?loc:a.CAst.loc ();
init_setoid ();
- let _lemma_refl, pstate = declare_instance_refl ~pstate atts binders a aeq n (mkappc "Seq_refl" [a;aeq;t]) in
- let _lemma_sym, pstate = declare_instance_sym ~pstate atts binders a aeq n (mkappc "Seq_sym" [a;aeq;t]) in
- let _lemma_trans, pstate = declare_instance_trans ~pstate atts binders a aeq n (mkappc "Seq_trans" [a;aeq;t]) in
+ let () = declare_instance_refl atts binders a aeq n (mkappc "Seq_refl" [a;aeq;t]) in
+ let () = declare_instance_sym atts binders a aeq n (mkappc "Seq_sym" [a;aeq;t]) in
+ let () = declare_instance_trans atts binders a aeq n (mkappc "Seq_trans" [a;aeq;t]) in
let instance = declare_instance a aeq n "Coq.Classes.RelationClasses.Equivalence"
in
- snd @@ anew_instance ~pstate atts binders instance
- [(qualid_of_ident (Id.of_string "Equivalence_Reflexive"), mkappc "Seq_refl" [a;aeq;t]);
- (qualid_of_ident (Id.of_string "Equivalence_Symmetric"), mkappc "Seq_sym" [a;aeq;t]);
- (qualid_of_ident (Id.of_string "Equivalence_Transitive"), mkappc "Seq_trans" [a;aeq;t])]
-
+ anew_instance atts binders instance
+ [(qualid_of_ident (Id.of_string "Equivalence_Reflexive"), mkappc "Seq_refl" [a;aeq;t]);
+ (qualid_of_ident (Id.of_string "Equivalence_Symmetric"), mkappc "Seq_sym" [a;aeq;t]);
+ (qualid_of_ident (Id.of_string "Equivalence_Transitive"), mkappc "Seq_trans" [a;aeq;t])]
let make_tactic name =
let open Tacexpr in
@@ -1973,58 +1971,63 @@ let warn_add_morphism_deprecated =
CWarnings.create ~name:"add-morphism" ~category:"deprecated" (fun () ->
Pp.(str "Add Morphism f : id is deprecated, please use Add Morphism f with signature (...) as id"))
-let add_morphism_infer ~pstate atts m n : Proof_global.t option =
+let add_morphism_as_parameter atts m n : unit =
+ init_setoid ();
+ let instance_id = add_suffix n "_Proper" in
+ let env = Global.env () in
+ let evd = Evd.from_env env in
+ let uctx, instance = build_morphism_signature env evd m in
+ let uctx = UState.univ_entry ~poly:atts.polymorphic uctx in
+ let cst = Declare.declare_constant ~internal:Declare.InternalTacticRequest instance_id
+ (Declare.ParameterEntry
+ (None,(instance,uctx),None),
+ Decl_kinds.IsAssumption Decl_kinds.Logical)
+ in
+ Classes.add_instance (Classes.mk_instance
+ (PropGlobal.proper_class env evd) Hints.empty_hint_info atts.global (ConstRef cst));
+ declare_projection n instance_id (ConstRef cst)
+
+let add_morphism_interactive atts m n : Lemmas.t =
warn_add_morphism_deprecated ?loc:m.CAst.loc ();
init_setoid ();
- (* NB: atts.program is ignored, program mode automatically set by vernacentries *)
let instance_id = add_suffix n "_Proper" in
let env = Global.env () in
let evd = Evd.from_env env in
let uctx, instance = build_morphism_signature env evd m in
- if Lib.is_modtype () then
- let uctx = UState.univ_entry ~poly:atts.polymorphic uctx in
- let cst = Declare.declare_constant ~internal:Declare.InternalTacticRequest instance_id
- (Entries.ParameterEntry
- (None,(instance,uctx),None),
- Decl_kinds.IsAssumption Decl_kinds.Logical)
- in
- add_instance (Classes.mk_instance
- (PropGlobal.proper_class env evd) Hints.empty_hint_info atts.global (ConstRef cst));
- declare_projection n instance_id (ConstRef cst);
- pstate
- else
- let kind = Decl_kinds.Global, atts.polymorphic,
- Decl_kinds.DefinitionBody Decl_kinds.Instance
- in
- let tac = make_tactic "Coq.Classes.SetoidTactics.add_morphism_tactic" in
- let hook _ _ _ = function
- | Globnames.ConstRef cst ->
- add_instance (Classes.mk_instance
- (PropGlobal.proper_class env evd) Hints.empty_hint_info
- atts.global (ConstRef cst));
- declare_projection n instance_id (ConstRef cst)
- | _ -> assert false
- in
- let hook = Lemmas.mk_hook hook in
- Flags.silently
- (fun () ->
- let pstate = Lemmas.start_proof ~ontop:pstate ~hook instance_id kind (Evd.from_ctx uctx) (EConstr.of_constr instance) in
- Some (fst Pfedit.(by (Tacinterp.interp tac) pstate))) ()
+ let kind = Decl_kinds.Global Decl_kinds.ImportDefaultBehavior, atts.polymorphic,
+ Decl_kinds.DefinitionBody Decl_kinds.Instance
+ in
+ let tac = make_tactic "Coq.Classes.SetoidTactics.add_morphism_tactic" in
+ let hook _ _ _ = function
+ | Globnames.ConstRef cst ->
+ Classes.add_instance (Classes.mk_instance
+ (PropGlobal.proper_class env evd) Hints.empty_hint_info
+ atts.global (ConstRef cst));
+ declare_projection n instance_id (ConstRef cst)
+ | _ -> assert false
+ in
+ let hook = DeclareDef.Hook.make hook in
+ Flags.silently
+ (fun () ->
+ let lemma = Lemmas.start_lemma ~hook instance_id kind (Evd.from_ctx uctx) (EConstr.of_constr instance) in
+ fst (Lemmas.by (Tacinterp.interp tac) lemma)) ()
-let add_morphism ~pstate atts binders m s n =
+let add_morphism atts binders m s n =
init_setoid ();
let instance_id = add_suffix n "_Proper" in
- let instance =
- (((CAst.make @@ Name instance_id),None), Explicit,
- CAst.make @@ CAppExpl (
- (None, Libnames.qualid_of_string "Coq.Classes.Morphisms.Proper",None),
- [cHole; s; m]))
+ let instance_name = (CAst.make @@ Name instance_id),None in
+ let instance_t =
+ CAst.make @@ CAppExpl
+ ((None, Libnames.qualid_of_string "Coq.Classes.Morphisms.Proper",None),
+ [cHole; s; m])
in
let tac = Tacinterp.interp (make_tactic "add_morphism_tactic") in
- let _, pstate = new_instance ~pstate ~program_mode:atts.program ~global:atts.global atts.polymorphic binders instance
- None
- ~generalize:false ~tac ~hook:(declare_projection n instance_id) Hints.empty_hint_info in
- pstate
+ let _id, lemma = Classes.new_instance_interactive
+ ~global:atts.global atts.polymorphic
+ instance_name binders instance_t
+ ~generalize:false ~tac ~hook:(declare_projection n instance_id) Hints.empty_hint_info
+ in
+ lemma (* no instance body -> always open proof *)
(** Bind to "rewrite" too *)
diff --git a/plugins/ltac/rewrite.mli b/plugins/ltac/rewrite.mli
index a200cb5ced..8e0b0a8003 100644
--- a/plugins/ltac/rewrite.mli
+++ b/plugins/ltac/rewrite.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -81,18 +81,36 @@ val cl_rewrite_clause :
val is_applied_rewrite_relation :
env -> evar_map -> rel_context -> constr -> types option
-val declare_relation : pstate:Proof_global.t option -> rewrite_attributes ->
- ?binders:local_binder_expr list -> constr_expr -> constr_expr -> Id.t ->
- constr_expr option -> constr_expr option -> constr_expr option -> Proof_global.t option
-
-val add_setoid : pstate:Proof_global.t option ->
- rewrite_attributes -> local_binder_expr list -> constr_expr -> constr_expr -> constr_expr ->
- Id.t -> Proof_global.t option
-
-val add_morphism_infer : pstate:Proof_global.t option -> rewrite_attributes -> constr_expr -> Id.t -> Proof_global.t option
-
-val add_morphism : pstate:Proof_global.t option ->
- rewrite_attributes -> local_binder_expr list -> constr_expr -> constr_expr -> Id.t -> Proof_global.t option
+val declare_relation
+ : rewrite_attributes
+ -> ?binders:local_binder_expr list
+ -> constr_expr
+ -> constr_expr
+ -> Id.t
+ -> constr_expr option
+ -> constr_expr option
+ -> constr_expr option
+ -> unit
+
+val add_setoid
+ : rewrite_attributes
+ -> local_binder_expr list
+ -> constr_expr
+ -> constr_expr
+ -> constr_expr
+ -> Id.t
+ -> unit
+
+val add_morphism_interactive : rewrite_attributes -> constr_expr -> Id.t -> Lemmas.t
+val add_morphism_as_parameter : rewrite_attributes -> constr_expr -> Id.t -> unit
+
+val add_morphism
+ : rewrite_attributes
+ -> local_binder_expr list
+ -> constr_expr
+ -> constr_expr
+ -> Id.t
+ -> Lemmas.t
val get_reflexive_proof : env -> evar_map -> constr -> constr -> evar_map * constr
diff --git a/plugins/ltac/tacarg.ml b/plugins/ltac/tacarg.ml
index 8a25d4851f..9e8e86d4fc 100644
--- a/plugins/ltac/tacarg.ml
+++ b/plugins/ltac/tacarg.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -19,13 +19,19 @@ let make0 ?dyn name =
let () = Geninterp.register_val0 wit dyn in
wit
-let wit_intro_pattern = make0 "intropattern"
+let wit_intropattern = make0 "intropattern" (* To keep after deprecation phase but it will get a different parsing semantics (Tactic Notation and TACTIC EXTEND) in pltac.ml *)
+let wit_simple_intropattern = make0 "simple_intropattern"
let wit_quant_hyp = make0 "quant_hyp"
let wit_constr_with_bindings = make0 "constr_with_bindings"
let wit_open_constr_with_bindings = make0 "open_constr_with_bindings"
let wit_bindings = make0 "bindings"
let wit_quantified_hypothesis = wit_quant_hyp
-let wit_intropattern = wit_intro_pattern
+
+(* A convenient common part to simple_intropattern and intropattern
+ usable when no parsing rule is concerned: indeed
+ simple_intropattern and intropattern are in the same type and have
+ the same interp/intern/subst methods *)
+let wit_intro_pattern = wit_intropattern
let wit_tactic : (raw_tactic_expr, glob_tactic_expr, Val.t) genarg_type =
make0 "tactic"
diff --git a/plugins/ltac/tacarg.mli b/plugins/ltac/tacarg.mli
index 0c7096a4de..945f237c91 100644
--- a/plugins/ltac/tacarg.mli
+++ b/plugins/ltac/tacarg.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -16,6 +16,12 @@ open Tactypes
open Tacexpr
(** Tactic related witnesses, could also live in tactics/ if other users *)
+(* To keep after deprecation phase but it will get a different parsing semantics in pltac.ml *)
+val wit_intropattern : (constr_expr intro_pattern_expr CAst.t, glob_constr_and_expr intro_pattern_expr CAst.t, intro_pattern) genarg_type
+[@@ocaml.deprecated "Use wit_simple_intropattern"]
+
+val wit_simple_intropattern : (constr_expr intro_pattern_expr CAst.t, glob_constr_and_expr intro_pattern_expr CAst.t, intro_pattern) genarg_type
+
val wit_intro_pattern : (constr_expr intro_pattern_expr CAst.t, glob_constr_and_expr intro_pattern_expr CAst.t, intro_pattern) genarg_type
val wit_quant_hyp : quantified_hypothesis uniform_genarg_type
@@ -36,7 +42,6 @@ val wit_bindings :
constr bindings delayed_open) genarg_type
val wit_quantified_hypothesis : quantified_hypothesis uniform_genarg_type
-val wit_intropattern : (constr_expr intro_pattern_expr CAst.t, glob_constr_and_expr intro_pattern_expr CAst.t, intro_pattern) genarg_type
(** Generic arguments based on Ltac. *)
diff --git a/plugins/ltac/taccoerce.ml b/plugins/ltac/taccoerce.ml
index fcab98c7e8..4e79bab28e 100644
--- a/plugins/ltac/taccoerce.ml
+++ b/plugins/ltac/taccoerce.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -144,9 +144,22 @@ let coerce_to_constr_context v =
out_gen (topwit wit_constr_context) v
else raise (CannotCoerceTo "a term context")
+let is_intro_pattern v =
+ if has_type v (topwit wit_intropattern [@warning "-3"]) then
+ Some (out_gen (topwit wit_intropattern [@warning "-3"]) v).CAst.v
+ else
+ if has_type v (topwit wit_simple_intropattern) then
+ Some (out_gen (topwit wit_simple_intropattern) v).CAst.v
+ else
+ None
+
(* Interprets an identifier which must be fresh *)
let coerce_var_to_ident fresh env sigma v =
let fail () = raise (CannotCoerceTo "a fresh identifier") in
+ match is_intro_pattern v with
+ | Some (IntroNaming (IntroIdentifier id)) -> id
+ | Some _ -> fail ()
+ | None ->
if has_type v (topwit wit_intro_pattern) then
match out_gen (topwit wit_intro_pattern) v with
| { CAst.v=IntroNaming (IntroIdentifier id)} -> id
@@ -170,11 +183,11 @@ let id_of_name = function
| Name.Anonymous -> Id.of_string "x"
| Name.Name x -> x 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
- | {CAst.v=IntroNaming (IntroIdentifier id)} -> id
- | _ -> fail ()
- else if has_type v (topwit wit_var) then
+ match is_intro_pattern v with
+ | Some (IntroNaming (IntroIdentifier id)) -> id
+ | Some _ -> fail ()
+ | None ->
+ if has_type v (topwit wit_var) then
out_gen (topwit wit_var) v
else
match Value.to_constr v with
@@ -209,9 +222,10 @@ let id_of_name = function
let coerce_to_intro_pattern sigma v =
- if has_type v (topwit wit_intro_pattern) then
- (out_gen (topwit wit_intro_pattern) v).CAst.v
- else if has_type v (topwit wit_var) then
+ match is_intro_pattern v with
+ | Some pat -> pat
+ | None ->
+ if has_type v (topwit wit_var) then
let id = out_gen (topwit wit_var) v in
IntroNaming (IntroIdentifier id)
else match Value.to_constr v with
@@ -227,11 +241,9 @@ let coerce_to_intro_pattern_naming sigma v =
| _ -> raise (CannotCoerceTo "a naming introduction pattern")
let coerce_to_hint_base v =
- if has_type v (topwit wit_intro_pattern) then
- match out_gen (topwit wit_intro_pattern) v with
- | {CAst.v=IntroNaming (IntroIdentifier id)} -> Id.to_string id
- | _ -> raise (CannotCoerceTo "a hint base name")
- else raise (CannotCoerceTo "a hint base name")
+ match is_intro_pattern v with
+ | Some (IntroNaming (IntroIdentifier id)) -> Id.to_string id
+ | Some _ | None -> raise (CannotCoerceTo "a hint base name")
let coerce_to_int v =
if has_type v (topwit wit_int) then
@@ -240,12 +252,12 @@ let coerce_to_int v =
let coerce_to_constr env v =
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
- | {CAst.v=IntroNaming (IntroIdentifier id)} ->
+ match is_intro_pattern v with
+ | Some (IntroNaming (IntroIdentifier id)) ->
(try ([], constr_of_id env id) with Not_found -> fail ())
- | _ -> fail ()
- else if has_type v (topwit wit_constr) then
+ | Some _ -> fail ()
+ | None ->
+ if has_type v (topwit wit_constr) then
let c = out_gen (topwit wit_constr) v in
([], c)
else if has_type v (topwit wit_constr_under_binders) then
@@ -269,11 +281,11 @@ let coerce_to_closed_constr env v =
let coerce_to_evaluable_ref env sigma v =
let fail () = raise (CannotCoerceTo "an evaluable reference") in
let ev =
- if has_type v (topwit wit_intro_pattern) then
- match out_gen (topwit wit_intro_pattern) v with
- | {CAst.v=IntroNaming (IntroIdentifier id)} when is_variable env id -> EvalVarRef id
- | _ -> fail ()
- else if has_type v (topwit wit_var) then
+ match is_intro_pattern v with
+ | Some (IntroNaming (IntroIdentifier id)) when is_variable env id -> EvalVarRef id
+ | Some _ -> fail ()
+ | None ->
+ if has_type v (topwit wit_var) then
let id = out_gen (topwit wit_var) v in
if Id.List.mem id (Termops.ids_of_context env) then EvalVarRef id
else fail ()
@@ -308,11 +320,11 @@ let coerce_to_intro_pattern_list ?loc sigma v =
let coerce_to_hyp env sigma v =
let fail () = raise (CannotCoerceTo "a variable") in
- if has_type v (topwit wit_intro_pattern) then
- match out_gen (topwit wit_intro_pattern) v with
- | {CAst.v=IntroNaming (IntroIdentifier id)} when is_variable env id -> id
- | _ -> fail ()
- else if has_type v (topwit wit_var) then
+ match is_intro_pattern v with
+ | Some (IntroNaming (IntroIdentifier id)) when is_variable env id -> id
+ | Some _ -> fail ()
+ | None ->
+ if has_type v (topwit wit_var) then
let id = out_gen (topwit wit_var) v in
if is_variable env id then id else fail ()
else match Value.to_constr v with
@@ -340,12 +352,11 @@ let coerce_to_reference sigma v =
(* Quantified named or numbered hypothesis or hypothesis in context *)
(* (as in Inversion) *)
let coerce_to_quantified_hypothesis sigma v =
- if has_type v (topwit wit_intro_pattern) then
- let v = out_gen (topwit wit_intro_pattern) v in
- match v with
- | {CAst.v=IntroNaming (IntroIdentifier id)} -> NamedHyp id
- | _ -> raise (CannotCoerceTo "a quantified hypothesis")
- else if has_type v (topwit wit_var) then
+ match is_intro_pattern v with
+ | Some (IntroNaming (IntroIdentifier id)) -> NamedHyp id
+ | Some _ -> raise (CannotCoerceTo "a quantified hypothesis")
+ | None ->
+ if has_type v (topwit wit_var) then
let id = out_gen (topwit wit_var) v in
NamedHyp id
else if has_type v (topwit wit_int) then
diff --git a/plugins/ltac/taccoerce.mli b/plugins/ltac/taccoerce.mli
index b04c3b9f4e..22d1681a61 100644
--- a/plugins/ltac/taccoerce.mli
+++ b/plugins/ltac/taccoerce.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/tacentries.ml b/plugins/ltac/tacentries.ml
index 814be64f81..13a2f3b8c0 100644
--- a/plugins/ltac/tacentries.ml
+++ b/plugins/ltac/tacentries.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/tacentries.mli b/plugins/ltac/tacentries.mli
index 309db539d0..95b958955e 100644
--- a/plugins/ltac/tacentries.mli
+++ b/plugins/ltac/tacentries.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -12,11 +12,10 @@
open Vernacexpr
open Tacexpr
-open Attributes
(** {5 Tactic Definitions} *)
-val register_ltac : locality_flag -> ?deprecation:deprecation ->
+val register_ltac : locality_flag -> ?deprecation:Deprecation.t ->
Tacexpr.tacdef_body list -> unit
(** Adds new Ltac definitions to the environment. *)
@@ -36,7 +35,7 @@ type argument = Genarg.ArgT.any Extend.user_symbol
leaves. *)
val add_tactic_notation :
- locality_flag -> int -> ?deprecation:deprecation -> raw_argument
+ locality_flag -> int -> ?deprecation:Deprecation.t -> raw_argument
grammar_tactic_prod_item_expr list -> raw_tactic_expr -> unit
(** [add_tactic_notation local level prods expr] adds a tactic notation in the
environment at level [level] with locality [local] made of the grammar
@@ -49,7 +48,7 @@ val register_tactic_notation_entry : string -> ('a, 'b, 'c) Genarg.genarg_type -
to finding an argument by name (as in {!Genarg}) if there is none
matching. *)
-val add_ml_tactic_notation : ml_tactic_name -> level:int -> ?deprecation:deprecation ->
+val add_ml_tactic_notation : ml_tactic_name -> level:int -> ?deprecation:Deprecation.t ->
argument grammar_tactic_prod_item_expr list list -> unit
(** A low-level variant of {!add_tactic_notation} used by the TACTIC EXTEND
ML-side macro. *)
@@ -80,7 +79,7 @@ type _ ty_sig =
type ty_ml = TyML : 'r ty_sig * 'r -> ty_ml
val tactic_extend : string -> string -> level:Int.t ->
- ?deprecation:deprecation -> ty_ml list -> unit
+ ?deprecation:Deprecation.t -> ty_ml list -> unit
(** {5 ARGUMENT EXTEND} *)
diff --git a/plugins/ltac/tacenv.ml b/plugins/ltac/tacenv.ml
index d5f22b2c72..6a5ab55604 100644
--- a/plugins/ltac/tacenv.ml
+++ b/plugins/ltac/tacenv.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -55,7 +55,7 @@ type alias = KerName.t
type alias_tactic =
{ alias_args: Id.t list;
alias_body: glob_tactic_expr;
- alias_deprecation: Attributes.deprecation option;
+ alias_deprecation: Deprecation.t option;
}
let alias_map = Summary.ref ~name:"tactic-alias"
@@ -121,7 +121,7 @@ type ltac_entry = {
tac_for_ml : bool;
tac_body : glob_tactic_expr;
tac_redef : ModPath.t list;
- tac_deprecation : Attributes.deprecation option
+ tac_deprecation : Deprecation.t option
}
let mactab =
@@ -178,7 +178,7 @@ let subst_md (subst, (local, id, b, t, deprecation)) =
let classify_md (local, _, _, _, _ as o) = Substitute o
let inMD : bool * ltac_constant option * bool * glob_tactic_expr *
- Attributes.deprecation option -> obj =
+ Deprecation.t option -> obj =
declare_object {(default_object "TAC-DEFINITION") with
cache_function = cache_md;
load_function = load_md;
diff --git a/plugins/ltac/tacenv.mli b/plugins/ltac/tacenv.mli
index 5b98daf383..6a1e6e3bbd 100644
--- a/plugins/ltac/tacenv.mli
+++ b/plugins/ltac/tacenv.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -12,7 +12,6 @@ open Names
open Libnames
open Tacexpr
open Geninterp
-open Attributes
(** This module centralizes the various ways of registering tactics. *)
@@ -33,7 +32,7 @@ type alias = KerName.t
type alias_tactic =
{ alias_args: Id.t list;
alias_body: glob_tactic_expr;
- alias_deprecation: deprecation option;
+ alias_deprecation: Deprecation.t option;
}
(** Contents of a tactic notation *)
@@ -48,7 +47,7 @@ val check_alias : alias -> bool
(** {5 Coq tactic definitions} *)
-val register_ltac : bool -> bool -> ?deprecation:deprecation -> Id.t ->
+val register_ltac : bool -> bool -> ?deprecation:Deprecation.t -> Id.t ->
glob_tactic_expr -> unit
(** Register a new Ltac with the given name and body.
@@ -57,7 +56,7 @@ val register_ltac : bool -> bool -> ?deprecation:deprecation -> Id.t ->
definition. It also puts the Ltac name in the nametab, so that it can be
used unqualified. *)
-val redefine_ltac : bool -> ?deprecation:deprecation -> KerName.t ->
+val redefine_ltac : bool -> ?deprecation:Deprecation.t -> KerName.t ->
glob_tactic_expr -> unit
(** Replace a Ltac with the given name and body. If the boolean flag is set
to true, then this is a local redefinition. *)
@@ -68,7 +67,7 @@ val interp_ltac : KerName.t -> glob_tactic_expr
val is_ltac_for_ml_tactic : KerName.t -> bool
(** Whether the tactic is defined from ML-side *)
-val tac_deprecation : KerName.t -> deprecation option
+val tac_deprecation : KerName.t -> Deprecation.t option
(** The tactic deprecation notice, if any *)
type ltac_entry = {
@@ -78,7 +77,7 @@ type ltac_entry = {
(** The current body of the tactic *)
tac_redef : ModPath.t list;
(** List of modules redefining the tactic in reverse chronological order *)
- tac_deprecation : deprecation option;
+ tac_deprecation : Deprecation.t option;
(** Deprecation notice to be printed when the tactic is used *)
}
diff --git a/plugins/ltac/tacexpr.ml b/plugins/ltac/tacexpr.ml
index 0eb7726a18..e6e0c9d92c 100644
--- a/plugins/ltac/tacexpr.ml
+++ b/plugins/ltac/tacexpr.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -24,7 +24,7 @@ type direction_flag = bool (* true = Left-to-right false = right-to-right *)
type lazy_flag =
| General (* returns all possible successes *)
| Select (* returns all successes of the first matching branch *)
- | Once (* returns the first success in a maching branch
+ | Once (* returns the first success in a matching branch
(not necessarily the first) *)
type global_flag = (* [gfail] or [fail] *)
| TacGlobal
diff --git a/plugins/ltac/tacexpr.mli b/plugins/ltac/tacexpr.mli
index fd303f5d94..6abcdf2afa 100644
--- a/plugins/ltac/tacexpr.mli
+++ b/plugins/ltac/tacexpr.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -24,7 +24,7 @@ type direction_flag = bool (* true = Left-to-right false = right-to-right *)
type lazy_flag =
| General (* returns all possible successes *)
| Select (* returns all successes of the first matching branch *)
- | Once (* returns the first success in a maching branch
+ | Once (* returns the first success in a matching branch
(not necessarily the first) *)
type global_flag = (* [gfail] or [fail] *)
| TacGlobal
diff --git a/plugins/ltac/tacintern.ml b/plugins/ltac/tacintern.ml
index c1f7fab123..3ed5b1aab2 100644
--- a/plugins/ltac/tacintern.ml
+++ b/plugins/ltac/tacintern.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -119,18 +119,13 @@ let intern_constr_reference strict ist qid =
(* Internalize an isolated reference in position of tactic *)
let warn_deprecated_tactic =
- CWarnings.create ~name:"deprecated-tactic" ~category:"deprecated"
- (fun (qid,depr) -> str "Tactic " ++ pr_qualid qid ++
- strbrk " is deprecated" ++
- pr_opt (fun since -> str "since " ++ str since) depr.Attributes.since ++
- str "." ++ pr_opt (fun note -> str note) depr.Attributes.note)
+ Deprecation.create_warning ~object_name:"Tactic" ~warning_name:"deprecated-tactic"
+ pr_qualid
let warn_deprecated_alias =
- CWarnings.create ~name:"deprecated-tactic-notation" ~category:"deprecated"
- (fun (kn,depr) -> str "Tactic Notation " ++ Pptactic.pr_alias_key kn ++
- strbrk " is deprecated since" ++
- pr_opt (fun since -> str "since " ++ str since) depr.Attributes.since ++
- str "." ++ pr_opt (fun note -> str note) depr.Attributes.note)
+ Deprecation.create_warning ~object_name:"Tactic Notation"
+ ~warning_name:"deprecated-tactic-notation"
+ Pptactic.pr_alias_key
let intern_isolated_global_tactic_reference qid =
let loc = qid.CAst.loc in
@@ -800,7 +795,8 @@ let () =
let ist = { ist with ltacvars = !lf } in
(ist, ans)
in
- Genintern.register_intern0 wit_intro_pattern intern_intro_pattern
+ Genintern.register_intern0 wit_intropattern intern_intro_pattern [@warning "-3"];
+ Genintern.register_intern0 wit_simple_intropattern intern_intro_pattern
let () =
let intern_clause ist cl =
diff --git a/plugins/ltac/tacintern.mli b/plugins/ltac/tacintern.mli
index 978ad4dd24..0480b0c34d 100644
--- a/plugins/ltac/tacintern.mli
+++ b/plugins/ltac/tacintern.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/tacinterp.ml b/plugins/ltac/tacinterp.ml
index 800be2565d..8ddf17ca14 100644
--- a/plugins/ltac/tacinterp.ml
+++ b/plugins/ltac/tacinterp.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -855,7 +855,7 @@ let interp_binding_name ist env sigma = function
| NamedHyp id ->
(* If a name is bound, it has to be a quantified hypothesis *)
(* user has to use other names for variables if these ones clash with *)
- (* a name intented to be used as a (non-variable) identifier *)
+ (* a name intended to be used as a (non-variable) identifier *)
try try_interp_ltac_var (coerce_to_quantified_hypothesis sigma) ist (Some (env,sigma)) (make id)
with Not_found -> NamedHyp id
@@ -2029,7 +2029,8 @@ let () =
register_interp0 wit_pre_ident (lift interp_pre_ident);
register_interp0 wit_ident (lift interp_ident);
register_interp0 wit_var (lift interp_hyp);
- register_interp0 wit_intro_pattern (lifts interp_intro_pattern);
+ register_interp0 wit_intropattern (lifts interp_intro_pattern) [@warning "-3"];
+ register_interp0 wit_simple_intropattern (lifts interp_intro_pattern);
register_interp0 wit_clause_dft_concl (lift interp_clause);
register_interp0 wit_constr (lifts interp_constr);
register_interp0 wit_tacvalue (fun ist v -> Ftactic.return v);
@@ -2075,7 +2076,7 @@ let _ =
let extra = TacStore.set TacStore.empty f_debug (get_debug ()) in
let ist = { lfun; poly; extra; } in
let tac = interp_tactic ist tac in
- (* EJGA: We sould also pass the proof name if desired, for now
+ (* EJGA: We should also pass the proof name if desired, for now
poly seems like enough to get reasonable behavior in practice
*)
let name, poly = Id.of_string "ltac_gen", poly in
diff --git a/plugins/ltac/tacinterp.mli b/plugins/ltac/tacinterp.mli
index 22a092fa8b..c7c30bc167 100644
--- a/plugins/ltac/tacinterp.mli
+++ b/plugins/ltac/tacinterp.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/tacsubst.ml b/plugins/ltac/tacsubst.ml
index a3eeca2267..b6e7dd64b0 100644
--- a/plugins/ltac/tacsubst.ml
+++ b/plugins/ltac/tacsubst.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -287,7 +287,8 @@ let () =
Genintern.register_subst0 wit_pre_ident (fun _ v -> v);
Genintern.register_subst0 wit_ident (fun _ v -> v);
Genintern.register_subst0 wit_var (fun _ v -> v);
- Genintern.register_subst0 wit_intro_pattern (fun _ v -> v);
+ Genintern.register_subst0 wit_intropattern subst_intro_pattern [@warning "-3"];
+ Genintern.register_subst0 wit_simple_intropattern subst_intro_pattern;
Genintern.register_subst0 wit_tactic subst_tactic;
Genintern.register_subst0 wit_ltac subst_tactic;
Genintern.register_subst0 wit_constr subst_glob_constr;
diff --git a/plugins/ltac/tacsubst.mli b/plugins/ltac/tacsubst.mli
index 4487604dca..00b148166a 100644
--- a/plugins/ltac/tacsubst.mli
+++ b/plugins/ltac/tacsubst.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/tactic_debug.ml b/plugins/ltac/tactic_debug.ml
index 04f3116664..3014ba5115 100644
--- a/plugins/ltac/tactic_debug.ml
+++ b/plugins/ltac/tactic_debug.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/tactic_debug.mli b/plugins/ltac/tactic_debug.mli
index 74ea4e6b74..e0126ad448 100644
--- a/plugins/ltac/tactic_debug.mli
+++ b/plugins/ltac/tactic_debug.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/tactic_matching.ml b/plugins/ltac/tactic_matching.ml
index 2b5e496168..d008f9da1f 100644
--- a/plugins/ltac/tactic_matching.ml
+++ b/plugins/ltac/tactic_matching.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -128,7 +128,7 @@ module PatternMatching (E:StaticEnvironment) = struct
(** To focus on the algorithmic portion of pattern-matching, the
bookkeeping is relegated to a monad: the composition of the
- bactracking monad of {!IStream.t} with a "writer" effect. *)
+ backtracking monad of {!IStream.t} with a "writer" effect. *)
(* spiwack: as we don't benefit from the various stream optimisations
of Haskell, it may be costly to give the monad in direct style such as
here. We may want to use some continuation passing style. *)
diff --git a/plugins/ltac/tactic_matching.mli b/plugins/ltac/tactic_matching.mli
index 457c4e0b9a..b847ebbc66 100644
--- a/plugins/ltac/tactic_matching.mli
+++ b/plugins/ltac/tactic_matching.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/tactic_option.ml b/plugins/ltac/tactic_option.ml
index f6b2e5b362..21e02d4c04 100644
--- a/plugins/ltac/tactic_option.ml
+++ b/plugins/ltac/tactic_option.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/tactic_option.mli b/plugins/ltac/tactic_option.mli
index d2f2947c94..637dd238fe 100644
--- a/plugins/ltac/tactic_option.mli
+++ b/plugins/ltac/tactic_option.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ltac/tauto.ml b/plugins/ltac/tauto.ml
index d1951cc18d..94af4a3151 100644
--- a/plugins/ltac/tauto.ml
+++ b/plugins/ltac/tauto.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/DeclConstant.v b/plugins/micromega/DeclConstant.v
index 4e8fe5a8ff..0288728504 100644
--- a/plugins/micromega/DeclConstant.v
+++ b/plugins/micromega/DeclConstant.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/Env.v b/plugins/micromega/Env.v
index 10326990ea..8f4d4726b6 100644
--- a/plugins/micromega/Env.v
+++ b/plugins/micromega/Env.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/EnvRing.v b/plugins/micromega/EnvRing.v
index 36ed0210e3..78bfe480b3 100644
--- a/plugins/micromega/EnvRing.v
+++ b/plugins/micromega/EnvRing.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -925,7 +925,7 @@ Qed.
revert P1. induction LM1 as [|(M2,P2') LM2 IH]; simpl; intros.
- discriminate.
- assert (H':=PNSubst_ok n P3 M2 P2'). destruct PNSubst.
- * injection H as <-. rewrite <- PSubstL1_ok; intuition.
+ * injection H as [= <-]. rewrite <- PSubstL1_ok; intuition.
* now apply IH.
Qed.
diff --git a/plugins/micromega/Lia.v b/plugins/micromega/Lia.v
index 1582ec554e..8c7b601aba 100644
--- a/plugins/micromega/Lia.v
+++ b/plugins/micromega/Lia.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/Lqa.v b/plugins/micromega/Lqa.v
index f3cd24be8a..25fb62cfad 100644
--- a/plugins/micromega/Lqa.v
+++ b/plugins/micromega/Lqa.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/Lra.v b/plugins/micromega/Lra.v
index 72e29319ff..2403696696 100644
--- a/plugins/micromega/Lra.v
+++ b/plugins/micromega/Lra.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/MExtraction.v b/plugins/micromega/MExtraction.v
index 830cbdf7f6..1050bae303 100644
--- a/plugins/micromega/MExtraction.v
+++ b/plugins/micromega/MExtraction.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/OrderedRing.v b/plugins/micromega/OrderedRing.v
index e0e2232be5..d5884d9c1c 100644
--- a/plugins/micromega/OrderedRing.v
+++ b/plugins/micromega/OrderedRing.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -129,7 +129,7 @@ Proof.
intros n m H1 H2; rewrite H2 in H1; now apply H1.
Qed.
-(* Propeties of plus, minus and opp *)
+(* Properties of plus, minus and opp *)
Theorem Rplus_0_l : forall n : R, 0 + n == n.
Proof.
diff --git a/plugins/micromega/Psatz.v b/plugins/micromega/Psatz.v
index 28234e7a28..16ae24ba81 100644
--- a/plugins/micromega/Psatz.v
+++ b/plugins/micromega/Psatz.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/QMicromega.v b/plugins/micromega/QMicromega.v
index 0d593a321c..a99f21ad47 100644
--- a/plugins/micromega/QMicromega.v
+++ b/plugins/micromega/QMicromega.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/RMicromega.v b/plugins/micromega/RMicromega.v
index 7704e42d40..30bbac44d0 100644
--- a/plugins/micromega/RMicromega.v
+++ b/plugins/micromega/RMicromega.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/Refl.v b/plugins/micromega/Refl.v
index 898a3a1a28..63b4d5e8f8 100644
--- a/plugins/micromega/Refl.v
+++ b/plugins/micromega/Refl.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/RingMicromega.v b/plugins/micromega/RingMicromega.v
index 60931df517..75801162a7 100644
--- a/plugins/micromega/RingMicromega.v
+++ b/plugins/micromega/RingMicromega.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -990,7 +990,7 @@ Proof.
rewrite IHs. reflexivity.
Qed.
-(** equality migth be (too) strong *)
+(** equality might be (too) strong *)
Lemma eval_formulaSC : forall env f, eval_sformula env f = eval_formula env (map_Formula f).
Proof.
destruct f.
diff --git a/plugins/micromega/Tauto.v b/plugins/micromega/Tauto.v
index 7b9b88c0fe..56032befba 100644
--- a/plugins/micromega/Tauto.v
+++ b/plugins/micromega/Tauto.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/VarMap.v b/plugins/micromega/VarMap.v
index 8148c7033c..79cb6a3a3e 100644
--- a/plugins/micromega/VarMap.v
+++ b/plugins/micromega/VarMap.v
@@ -1,10 +1,12 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2015 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
(* *)
(* Micromega: A reflexive tactic using the Positivstellensatz *)
diff --git a/plugins/micromega/ZCoeff.v b/plugins/micromega/ZCoeff.v
index 9ff6850fdf..26970faf0c 100644
--- a/plugins/micromega/ZCoeff.v
+++ b/plugins/micromega/ZCoeff.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/ZMicromega.v b/plugins/micromega/ZMicromega.v
index 953690c510..3ea7635244 100644
--- a/plugins/micromega/ZMicromega.v
+++ b/plugins/micromega/ZMicromega.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/certificate.ml b/plugins/micromega/certificate.ml
index 3f9f4726e7..2e32b00c25 100644
--- a/plugins/micromega/certificate.ml
+++ b/plugins/micromega/certificate.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/certificate.mli b/plugins/micromega/certificate.mli
index 3428428441..cd26b72a27 100644
--- a/plugins/micromega/certificate.mli
+++ b/plugins/micromega/certificate.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/coq_micromega.ml b/plugins/micromega/coq_micromega.ml
index bed9e55ac0..f0435126aa 100644
--- a/plugins/micromega/coq_micromega.ml
+++ b/plugins/micromega/coq_micromega.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -1208,8 +1208,8 @@ let dump_rexpr = lazy
(** [make_goal_of_formula depxr vars props form] where
- - vars is an environment for the arithmetic variables occuring in form
- - props is an environment for the propositions occuring in form
+ - vars is an environment for the arithmetic variables occurring in form
+ - props is an environment for the propositions occurring in form
@return a goal where all the variables and propositions of the formula are quantified
*)
@@ -1469,7 +1469,7 @@ let pre_processZ mt f =
x <= y or (x and y are incomparable) *)
(**
- * Instanciate the current Coq goal with a Micromega formula, a varmap, and a
+ * Instantiate the current Coq goal with a Micromega formula, a varmap, and a
* witness.
*)
diff --git a/plugins/micromega/coq_micromega.mli b/plugins/micromega/coq_micromega.mli
index 075594cffc..7567e7c322 100644
--- a/plugins/micromega/coq_micromega.mli
+++ b/plugins/micromega/coq_micromega.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/csdpcert.ml b/plugins/micromega/csdpcert.ml
index 9c1b4810d5..d8f71cda0c 100644
--- a/plugins/micromega/csdpcert.ml
+++ b/plugins/micromega/csdpcert.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/csdpcert.mli b/plugins/micromega/csdpcert.mli
index 7c3ee60040..87553dcb56 100644
--- a/plugins/micromega/csdpcert.mli
+++ b/plugins/micromega/csdpcert.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/g_micromega.mlg b/plugins/micromega/g_micromega.mlg
index 6bf5f76a04..ffc803af44 100644
--- a/plugins/micromega/g_micromega.mlg
+++ b/plugins/micromega/g_micromega.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/g_micromega.mli b/plugins/micromega/g_micromega.mli
index 7c3ee60040..87553dcb56 100644
--- a/plugins/micromega/g_micromega.mli
+++ b/plugins/micromega/g_micromega.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/itv.ml b/plugins/micromega/itv.ml
index 44cad820ed..533b060dd3 100644
--- a/plugins/micromega/itv.ml
+++ b/plugins/micromega/itv.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/itv.mli b/plugins/micromega/itv.mli
index 31f6a89fe2..7b7edc64ea 100644
--- a/plugins/micromega/itv.mli
+++ b/plugins/micromega/itv.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/mfourier.ml b/plugins/micromega/mfourier.ml
index baf8c82355..34fb32c270 100644
--- a/plugins/micromega/mfourier.ml
+++ b/plugins/micromega/mfourier.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/mfourier.mli b/plugins/micromega/mfourier.mli
index 45a81cc118..16cb49c85e 100644
--- a/plugins/micromega/mfourier.mli
+++ b/plugins/micromega/mfourier.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/mutils.ml b/plugins/micromega/mutils.ml
index 084ea39c27..97cf23ac1f 100644
--- a/plugins/micromega/mutils.ml
+++ b/plugins/micromega/mutils.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/mutils.mli b/plugins/micromega/mutils.mli
index 739d1a73da..8dbdea39e2 100644
--- a/plugins/micromega/mutils.mli
+++ b/plugins/micromega/mutils.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/persistent_cache.ml b/plugins/micromega/persistent_cache.ml
index 0209030b64..5829292a0c 100644
--- a/plugins/micromega/persistent_cache.ml
+++ b/plugins/micromega/persistent_cache.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -21,7 +21,7 @@ module type PHashtable =
val open_in : string -> 'a t
(** [open_in f] rebuilds a table from the records stored in file [f].
- As marshaling is not type-safe, it migth segault.
+ As marshaling is not type-safe, it might segfault.
*)
val find : 'a t -> key -> 'a
diff --git a/plugins/micromega/persistent_cache.mli b/plugins/micromega/persistent_cache.mli
index 4e7a388aaf..4248407221 100644
--- a/plugins/micromega/persistent_cache.mli
+++ b/plugins/micromega/persistent_cache.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -17,7 +17,7 @@ module type PHashtable =
val open_in : string -> 'a t
(** [open_in f] rebuilds a table from the records stored in file [f].
- As marshaling is not type-safe, it migth segault.
+ As marshaling is not type-safe, it might segfault.
*)
val find : 'a t -> key -> 'a
diff --git a/plugins/micromega/polynomial.ml b/plugins/micromega/polynomial.ml
index d406560fb8..f909b4ecda 100644
--- a/plugins/micromega/polynomial.ml
+++ b/plugins/micromega/polynomial.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/polynomial.mli b/plugins/micromega/polynomial.mli
index b5c6fefbb5..cfb1bb914c 100644
--- a/plugins/micromega/polynomial.mli
+++ b/plugins/micromega/polynomial.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/simplex.ml b/plugins/micromega/simplex.ml
index 4ddeb6c2c0..15fb55c007 100644
--- a/plugins/micromega/simplex.ml
+++ b/plugins/micromega/simplex.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/simplex.mli b/plugins/micromega/simplex.mli
index 9f87e745eb..cba8e94ea7 100644
--- a/plugins/micromega/simplex.mli
+++ b/plugins/micromega/simplex.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/sos.mli b/plugins/micromega/sos.mli
index 6e62c56385..c9181953c8 100644
--- a/plugins/micromega/sos.mli
+++ b/plugins/micromega/sos.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/sos_lib.ml b/plugins/micromega/sos_lib.ml
index 6aebc4ca9a..e3a9f6f60f 100644
--- a/plugins/micromega/sos_lib.ml
+++ b/plugins/micromega/sos_lib.ml
@@ -200,7 +200,7 @@ let is_undefined f =
| _ -> false;;
(* ------------------------------------------------------------------------- *)
-(* Operation analagous to "map" for lists. *)
+(* Operation analogous to "map" for lists. *)
(* ------------------------------------------------------------------------- *)
let mapf =
diff --git a/plugins/micromega/sos_lib.mli b/plugins/micromega/sos_lib.mli
index 8b53b8151e..f01b632c67 100644
--- a/plugins/micromega/sos_lib.mli
+++ b/plugins/micromega/sos_lib.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/sos_types.ml b/plugins/micromega/sos_types.ml
index 79d67b6ae9..0ba76fc0ea 100644
--- a/plugins/micromega/sos_types.ml
+++ b/plugins/micromega/sos_types.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/sos_types.mli b/plugins/micromega/sos_types.mli
index aa5fb08489..c55bb69e8a 100644
--- a/plugins/micromega/sos_types.mli
+++ b/plugins/micromega/sos_types.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/vect.ml b/plugins/micromega/vect.ml
index b80d5536eb..4b2bc66eb7 100644
--- a/plugins/micromega/vect.ml
+++ b/plugins/micromega/vect.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/micromega/vect.mli b/plugins/micromega/vect.mli
index 4c9b140aad..40ef8078e4 100644
--- a/plugins/micromega/vect.mli
+++ b/plugins/micromega/vect.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/nsatz/Nsatz.v b/plugins/nsatz/Nsatz.v
index a964febf9c..58d01c125c 100644
--- a/plugins/nsatz/Nsatz.v
+++ b/plugins/nsatz/Nsatz.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/nsatz/g_nsatz.mlg b/plugins/nsatz/g_nsatz.mlg
index 16ff512e8d..4873aa9566 100644
--- a/plugins/nsatz/g_nsatz.mlg
+++ b/plugins/nsatz/g_nsatz.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/nsatz/ideal.ml b/plugins/nsatz/ideal.ml
index 1825a4d77c..7ea56b41ec 100644
--- a/plugins/nsatz/ideal.ml
+++ b/plugins/nsatz/ideal.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/nsatz/ideal.mli b/plugins/nsatz/ideal.mli
index 9657280828..a82751f772 100644
--- a/plugins/nsatz/ideal.mli
+++ b/plugins/nsatz/ideal.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/nsatz/nsatz.ml b/plugins/nsatz/nsatz.ml
index 1777418ef6..71a3132283 100644
--- a/plugins/nsatz/nsatz.ml
+++ b/plugins/nsatz/nsatz.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -267,7 +267,7 @@ module PIdeal = Ideal.Make(Poly)
open PIdeal
(* term to sparse polynomial
- varaibles <=np are in the coefficients
+ variables <=np are in the coefficients
*)
let term_pol_sparse nvars np t=
diff --git a/plugins/nsatz/nsatz.mli b/plugins/nsatz/nsatz.mli
index c97c99081d..f2b86b2a9e 100644
--- a/plugins/nsatz/nsatz.mli
+++ b/plugins/nsatz/nsatz.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/nsatz/polynom.ml b/plugins/nsatz/polynom.ml
index 5db587b9cc..071c74ab9b 100644
--- a/plugins/nsatz/polynom.ml
+++ b/plugins/nsatz/polynom.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -357,7 +357,7 @@ let remP v p =
moinsP p (multP (coefDom v p) (puisP (x v) (deg v p)))
-(* first interger coefficient of p *)
+(* first integer coefficient of p *)
let rec coef_int_tete p =
let v = max_var_pol p in
if v>0
@@ -526,7 +526,7 @@ let div_pol_rat p q=
(* pseudo division :
q = c*x^m+q1
- retruns (r,c,d,s) s.t. c^d*p = s*q + r.
+ returns (r,c,d,s) s.t. c^d*p = s*q + r.
*)
let pseudo_div p q x =
diff --git a/plugins/nsatz/polynom.mli b/plugins/nsatz/polynom.mli
index d45a0505c5..e683bf526f 100644
--- a/plugins/nsatz/polynom.mli
+++ b/plugins/nsatz/polynom.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/omega/Omega.v b/plugins/omega/Omega.v
index 6c8f23a012..4ceb530827 100644
--- a/plugins/omega/Omega.v
+++ b/plugins/omega/Omega.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/omega/OmegaLemmas.v b/plugins/omega/OmegaLemmas.v
index 81bf1fb83d..d2378569fc 100644
--- a/plugins/omega/OmegaLemmas.v
+++ b/plugins/omega/OmegaLemmas.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/omega/OmegaPlugin.v b/plugins/omega/OmegaPlugin.v
index 3c339c8b8f..303eb0527a 100644
--- a/plugins/omega/OmegaPlugin.v
+++ b/plugins/omega/OmegaPlugin.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/omega/OmegaTactic.v b/plugins/omega/OmegaTactic.v
index 3c339c8b8f..303eb0527a 100644
--- a/plugins/omega/OmegaTactic.v
+++ b/plugins/omega/OmegaTactic.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/omega/PreOmega.v b/plugins/omega/PreOmega.v
index 23d7b141a4..acc8214e3e 100644
--- a/plugins/omega/PreOmega.v
+++ b/plugins/omega/PreOmega.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/omega/coq_omega.ml b/plugins/omega/coq_omega.ml
index ffc3506a1f..6aec83318c 100644
--- a/plugins/omega/coq_omega.ml
+++ b/plugins/omega/coq_omega.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/omega/coq_omega.mli b/plugins/omega/coq_omega.mli
index a657826caa..c292bdbb87 100644
--- a/plugins/omega/coq_omega.mli
+++ b/plugins/omega/coq_omega.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/omega/g_omega.mlg b/plugins/omega/g_omega.mlg
index 85081b24a3..bb9bee080a 100644
--- a/plugins/omega/g_omega.mlg
+++ b/plugins/omega/g_omega.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/omega/omega.ml b/plugins/omega/omega.ml
index 7bca7c7099..cec87221f0 100644
--- a/plugins/omega/omega.ml
+++ b/plugins/omega/omega.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/rtauto/Bintree.v b/plugins/rtauto/Bintree.v
index c2dec264ad..0ca0d0c12d 100644
--- a/plugins/rtauto/Bintree.v
+++ b/plugins/rtauto/Bintree.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/rtauto/Rtauto.v b/plugins/rtauto/Rtauto.v
index f027a4a46e..2e9b4347b9 100644
--- a/plugins/rtauto/Rtauto.v
+++ b/plugins/rtauto/Rtauto.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/rtauto/g_rtauto.mlg b/plugins/rtauto/g_rtauto.mlg
index d8724eb976..feef0246e0 100644
--- a/plugins/rtauto/g_rtauto.mlg
+++ b/plugins/rtauto/g_rtauto.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/rtauto/proof_search.ml b/plugins/rtauto/proof_search.ml
index aab1e47555..13da8220f4 100644
--- a/plugins/rtauto/proof_search.ml
+++ b/plugins/rtauto/proof_search.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/rtauto/proof_search.mli b/plugins/rtauto/proof_search.mli
index 607cdc952e..bad2b7065c 100644
--- a/plugins/rtauto/proof_search.mli
+++ b/plugins/rtauto/proof_search.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/rtauto/refl_tauto.ml b/plugins/rtauto/refl_tauto.ml
index 89528fe357..df27c9c9d7 100644
--- a/plugins/rtauto/refl_tauto.ml
+++ b/plugins/rtauto/refl_tauto.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/rtauto/refl_tauto.mli b/plugins/rtauto/refl_tauto.mli
index 3de0ba44df..f07e092b5a 100644
--- a/plugins/rtauto/refl_tauto.mli
+++ b/plugins/rtauto/refl_tauto.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Algebra_syntax.v b/plugins/setoid_ring/Algebra_syntax.v
index 1204bbd2e1..5f594d29cd 100644
--- a/plugins/setoid_ring/Algebra_syntax.v
+++ b/plugins/setoid_ring/Algebra_syntax.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/ArithRing.v b/plugins/setoid_ring/ArithRing.v
index bb1eca49ce..727e99f0b4 100644
--- a/plugins/setoid_ring/ArithRing.v
+++ b/plugins/setoid_ring/ArithRing.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/BinList.v b/plugins/setoid_ring/BinList.v
index b02b7484d5..958832274b 100644
--- a/plugins/setoid_ring/BinList.v
+++ b/plugins/setoid_ring/BinList.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Cring.v b/plugins/setoid_ring/Cring.v
index 7cb930ba5a..4f3f0c3878 100644
--- a/plugins/setoid_ring/Cring.v
+++ b/plugins/setoid_ring/Cring.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Field.v b/plugins/setoid_ring/Field.v
index a8ec1717f9..9ff07948df 100644
--- a/plugins/setoid_ring/Field.v
+++ b/plugins/setoid_ring/Field.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Field_tac.v b/plugins/setoid_ring/Field_tac.v
index 73acce2253..a5390efc7f 100644
--- a/plugins/setoid_ring/Field_tac.v
+++ b/plugins/setoid_ring/Field_tac.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Field_theory.v b/plugins/setoid_ring/Field_theory.v
index ad2ee821b3..b4300da4d5 100644
--- a/plugins/setoid_ring/Field_theory.v
+++ b/plugins/setoid_ring/Field_theory.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/InitialRing.v b/plugins/setoid_ring/InitialRing.v
index 4886c8b9aa..b024f65988 100644
--- a/plugins/setoid_ring/InitialRing.v
+++ b/plugins/setoid_ring/InitialRing.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -105,7 +105,7 @@ Section ZMORPHISM.
Proof.
constructor.
destruct c;intros;try discriminate.
- injection H as <-.
+ injection H as [= <-].
simpl. unfold Zeq_bool. rewrite Z.compare_refl. trivial.
Qed.
diff --git a/plugins/setoid_ring/Integral_domain.v b/plugins/setoid_ring/Integral_domain.v
index 98407cb6d7..f1394c51d5 100644
--- a/plugins/setoid_ring/Integral_domain.v
+++ b/plugins/setoid_ring/Integral_domain.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/NArithRing.v b/plugins/setoid_ring/NArithRing.v
index 36a92505eb..8cda4ad714 100644
--- a/plugins/setoid_ring/NArithRing.v
+++ b/plugins/setoid_ring/NArithRing.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Ncring.v b/plugins/setoid_ring/Ncring.v
index 2ca0d60948..8f3de26272 100644
--- a/plugins/setoid_ring/Ncring.v
+++ b/plugins/setoid_ring/Ncring.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Ncring_initial.v b/plugins/setoid_ring/Ncring_initial.v
index aa0370b2ac..e40ef6056d 100644
--- a/plugins/setoid_ring/Ncring_initial.v
+++ b/plugins/setoid_ring/Ncring_initial.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Ncring_polynom.v b/plugins/setoid_ring/Ncring_polynom.v
index 31182f51e2..6a8c514a7b 100644
--- a/plugins/setoid_ring/Ncring_polynom.v
+++ b/plugins/setoid_ring/Ncring_polynom.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Ncring_tac.v b/plugins/setoid_ring/Ncring_tac.v
index c8d560cfe9..65233873b1 100644
--- a/plugins/setoid_ring/Ncring_tac.v
+++ b/plugins/setoid_ring/Ncring_tac.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/RealField.v b/plugins/setoid_ring/RealField.v
index e12bf36339..d83fcf3781 100644
--- a/plugins/setoid_ring/RealField.v
+++ b/plugins/setoid_ring/RealField.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Ring.v b/plugins/setoid_ring/Ring.v
index b83e1c6704..35e308565f 100644
--- a/plugins/setoid_ring/Ring.v
+++ b/plugins/setoid_ring/Ring.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Ring_base.v b/plugins/setoid_ring/Ring_base.v
index 920b13ef49..36e7890fbb 100644
--- a/plugins/setoid_ring/Ring_base.v
+++ b/plugins/setoid_ring/Ring_base.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Ring_polynom.v b/plugins/setoid_ring/Ring_polynom.v
index f7cb6b688b..9d56084fd4 100644
--- a/plugins/setoid_ring/Ring_polynom.v
+++ b/plugins/setoid_ring/Ring_polynom.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -894,7 +894,7 @@ Section MakeRingPol.
revert P1. induction LM1 as [|(M2,P2') LM2 IH]; simpl; intros.
- discriminate.
- assert (H':=PNSubst_ok n P3 M2 P2'). destruct PNSubst.
- * injection H as <-. rewrite <- PSubstL1_ok; intuition.
+ * injection H as [= <-]. rewrite <- PSubstL1_ok; intuition.
* now apply IH.
Qed.
diff --git a/plugins/setoid_ring/Ring_tac.v b/plugins/setoid_ring/Ring_tac.v
index 26fef99bb2..0a14c0ee5c 100644
--- a/plugins/setoid_ring/Ring_tac.v
+++ b/plugins/setoid_ring/Ring_tac.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Ring_theory.v b/plugins/setoid_ring/Ring_theory.v
index 3e835f5c9f..8f24b281c6 100644
--- a/plugins/setoid_ring/Ring_theory.v
+++ b/plugins/setoid_ring/Ring_theory.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Rings_Q.v b/plugins/setoid_ring/Rings_Q.v
index df3677e1c3..b3ed0be916 100644
--- a/plugins/setoid_ring/Rings_Q.v
+++ b/plugins/setoid_ring/Rings_Q.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Rings_R.v b/plugins/setoid_ring/Rings_R.v
index fe7558845d..ec91fa9e97 100644
--- a/plugins/setoid_ring/Rings_R.v
+++ b/plugins/setoid_ring/Rings_R.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/Rings_Z.v b/plugins/setoid_ring/Rings_Z.v
index 75e77ab6ef..a0901202f7 100644
--- a/plugins/setoid_ring/Rings_Z.v
+++ b/plugins/setoid_ring/Rings_Z.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/ZArithRing.v b/plugins/setoid_ring/ZArithRing.v
index 19eaddc123..833e19a698 100644
--- a/plugins/setoid_ring/ZArithRing.v
+++ b/plugins/setoid_ring/ZArithRing.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/g_newring.mlg b/plugins/setoid_ring/g_newring.mlg
index 6be556b2ae..f2a3608d92 100644
--- a/plugins/setoid_ring/g_newring.mlg
+++ b/plugins/setoid_ring/g_newring.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -13,8 +13,6 @@
open Ltac_plugin
open Pp
open Util
-open Libnames
-open Printer
open Newring_ast
open Newring
open Stdarg
@@ -85,21 +83,10 @@ END
VERNAC COMMAND EXTEND AddSetoidRing CLASSIFIED AS SIDEFF
| [ "Add" "Ring" ident(id) ":" constr(t) ring_mods_opt(l) ] ->
- { let l = match l with None -> [] | Some l -> l in add_theory id t l }
- | ![proof] [ "Print" "Rings" ] => { Vernacextend.classify_as_query } -> {
- fun ~pstate ->
- Feedback.msg_notice (strbrk "The following ring structures have been declared:");
- Spmap.iter (fun fn fi ->
- (* We should use the global env here as this shouldn't contain proof
- data, however preserving behavior as requested in review. *)
- let sigma, env = Option.cata Pfedit.get_current_context
- (let e = Global.env () in Evd.from_env e, e) pstate in
- Feedback.msg_notice (hov 2
- (Ppconstr.pr_id (Libnames.basename fn)++spc()++
- str"with carrier "++ pr_constr_env env sigma fi.ring_carrier++spc()++
- str"and equivalence relation "++ pr_constr_env env sigma fi.ring_req))
- ) !from_name;
- pstate }
+ { add_theory id t (Option.default [] l) }
+ | [ "Print" "Rings" ] => { Vernacextend.classify_as_query } -> {
+ print_rings ()
+ }
END
TACTIC EXTEND ring_lookup
@@ -135,20 +122,9 @@ END
VERNAC COMMAND EXTEND AddSetoidField CLASSIFIED AS SIDEFF
| [ "Add" "Field" ident(id) ":" constr(t) field_mods_opt(l) ] ->
{ let l = match l with None -> [] | Some l -> l in add_field_theory id t l }
-| ![proof] [ "Print" "Fields" ] => {Vernacextend.classify_as_query} -> {
- fun ~pstate ->
- Feedback.msg_notice (strbrk "The following field structures have been declared:");
- Spmap.iter (fun fn fi ->
- (* We should use the global env here as this shouldn't
- contain proof data. *)
- let sigma, env = Option.cata Pfedit.get_current_context
- (let e = Global.env () in Evd.from_env e, e) pstate in
- Feedback.msg_notice (hov 2
- (Ppconstr.pr_id (Libnames.basename fn)++spc()++
- str"with carrier "++ pr_constr_env env sigma fi.field_carrier++spc()++
- str"and equivalence relation "++ pr_constr_env env sigma fi.field_req))
- ) !field_from_name;
- pstate }
+| [ "Print" "Fields" ] => {Vernacextend.classify_as_query} -> {
+ print_fields ()
+ }
END
TACTIC EXTEND field_lookup
diff --git a/plugins/setoid_ring/newring.ml b/plugins/setoid_ring/newring.ml
index b02b97f656..9bbe339770 100644
--- a/plugins/setoid_ring/newring.ml
+++ b/plugins/setoid_ring/newring.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -153,9 +153,11 @@ let decl_constant na univs c =
let open Constr in
let vars = CVars.universes_of_constr c in
let univs = UState.restrict_universe_context univs vars in
- let univs = Monomorphic_entry univs in
+ let () = Declare.declare_universe_context false univs in
+ let types = (Typeops.infer (Global.env ()) c).uj_type in
+ let univs = Monomorphic_entry Univ.ContextSet.empty in
mkConst(declare_constant (Id.of_string na)
- (DefinitionEntry (definition_entry ~opaque:true ~univs c),
+ (DefinitionEntry (definition_entry ~opaque:true ~types ~univs c),
IsProof Lemma))
(* Calling a global tactic *)
@@ -327,6 +329,18 @@ module Cmap = Map.Make(Constr)
let from_carrier = Summary.ref Cmap.empty ~name:"ring-tac-carrier-table"
let from_name = Summary.ref Spmap.empty ~name:"ring-tac-name-table"
+let print_rings () =
+ Feedback.msg_notice (strbrk "The following ring structures have been declared:");
+ Spmap.iter (fun fn fi ->
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
+ Feedback.msg_notice
+ (hov 2
+ (Ppconstr.pr_id (Libnames.basename fn)++spc()++
+ str"with carrier "++ pr_constr_env env sigma fi.ring_carrier++spc()++
+ str"and equivalence relation "++ pr_constr_env env sigma fi.ring_req))
+ ) !from_name
+
let ring_for_carrier r = Cmap.find r !from_carrier
let find_ring_structure env sigma l =
@@ -824,6 +838,18 @@ let dest_field env evd th_spec =
let field_from_carrier = Summary.ref Cmap.empty ~name:"field-tac-carrier-table"
let field_from_name = Summary.ref Spmap.empty ~name:"field-tac-name-table"
+let print_fields () =
+ Feedback.msg_notice (strbrk "The following field structures have been declared:");
+ Spmap.iter (fun fn fi ->
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
+ Feedback.msg_notice
+ (hov 2
+ (Ppconstr.pr_id (Libnames.basename fn)++spc()++
+ str"with carrier "++ pr_constr_env env sigma fi.field_carrier++spc()++
+ str"and equivalence relation "++ pr_constr_env env sigma fi.field_req))
+ ) !field_from_name
+
let field_for_carrier r = Cmap.find r !field_from_carrier
let find_field_structure env sigma l =
diff --git a/plugins/setoid_ring/newring.mli b/plugins/setoid_ring/newring.mli
index fcd04a2e73..4c848d3f5b 100644
--- a/plugins/setoid_ring/newring.mli
+++ b/plugins/setoid_ring/newring.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -10,7 +10,6 @@
open Names
open EConstr
-open Libnames
open Constrexpr
open Newring_ast
@@ -23,7 +22,7 @@ val add_theory :
constr_expr ->
constr_expr ring_mod list -> unit
-val from_name : ring_info Spmap.t ref
+val print_rings : unit -> unit
val ring_lookup :
Geninterp.Val.t ->
@@ -35,7 +34,7 @@ val add_field_theory :
constr_expr ->
constr_expr field_mod list -> unit
-val field_from_name : field_info Spmap.t ref
+val print_fields : unit -> unit
val field_lookup :
Geninterp.Val.t ->
diff --git a/plugins/setoid_ring/newring_ast.ml b/plugins/setoid_ring/newring_ast.ml
index a83c79d11b..0a3e7bd9ca 100644
--- a/plugins/setoid_ring/newring_ast.ml
+++ b/plugins/setoid_ring/newring_ast.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/setoid_ring/newring_ast.mli b/plugins/setoid_ring/newring_ast.mli
index a83c79d11b..0a3e7bd9ca 100644
--- a/plugins/setoid_ring/newring_ast.mli
+++ b/plugins/setoid_ring/newring_ast.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrast.mli b/plugins/ssr/ssrast.mli
index 0897d3b45b..9e7442caf6 100644
--- a/plugins/ssr/ssrast.mli
+++ b/plugins/ssr/ssrast.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrbool.v b/plugins/ssr/ssrbool.v
index 49d729bd6c..bf0761d3ae 100644
--- a/plugins/ssr/ssrbool.v
+++ b/plugins/ssr/ssrbool.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -49,7 +49,7 @@ Require Import ssreflect ssrfun.
altP (idP my_formula) but circumventing the
dependent index capture issue; destructing
boolP my_formula generates two subgoals with
- assumtions my_formula and ~~ myformula. As
+ assumptions my_formula and ~~ myformula. As
with altP, my_formula must be an application.
\unless C, P <-> we can assume property P when a something that
holds under condition C (such as C itself).
@@ -64,7 +64,7 @@ Require Import ssreflect ssrfun.
:= forall b : bool, (P -> b) -> b.
This is equivalent to ~ (~ P) when P : Prop.
implies P Q == wrapper variant type that coerces to P -> Q and
- can be used as a P -> Q view unambigously.
+ can be used as a P -> Q view unambiguously.
Useful to avoid spurious insertion of <-> views
when Q is a conjunction of foralls, as in Lemma
all_and2 below; conversely, avoids confusion in
@@ -1003,7 +1003,7 @@ Proof. by case: a; case: b. Qed.
Lemma negb_or (a b : bool) : ~~ (a || b) = ~~ a && ~~ b.
Proof. by case: a; case: b. Qed.
-(** Pseudo-cancellation -- i.e, absorbtion **)
+(** Pseudo-cancellation -- i.e, absorption **)
Lemma andbK a b : a && b || a = a. Proof. by case: a; case: b. Qed.
Lemma andKb a b : a || b && a = a. Proof. by case: a; case: b. Qed.
@@ -1245,7 +1245,7 @@ Notation "[ 'pred' x : T | E1 & E2 ]" :=
(** Coercions for simpl_pred.
As simpl_pred T values are used both applicatively and collectively we
need simpl_pred to coerce to both pred T _and_ {pred T}. However it is
- undesireable to have two distinct constants for what are essentially identical
+ undesirable to have two distinct constants for what are essentially identical
coercion functions, as this confuses the SSReflect keyed matching algorithm.
While the Coq Coercion declarations appear to disallow such Coercion aliasing,
it is possible to work around this limitation with a combination of modules
@@ -1331,9 +1331,9 @@ Variant mem_pred T := Mem of pred T.
Similarly to pred_of_simpl, it will usually not be inserted by type
inference, as all mem_pred mp =~= pred_sort ?pT unification problems will
be solve by the memPredType instance below; pred_of_mem will however
- be used if a mem_pred T is used as a {pred T}, which is desireable as it
+ be used if a mem_pred T is used as a {pred T}, which is desirable as it
will avoid a redundant mem in a collective, e.g., passing (mem A) to a lemma
- expection a generic collective predicate p : {pred T} and premise x \in P
+ exception a generic collective predicate p : {pred T} and premise x \in P
will display a subgoal x \in A rathere than x \in mem A.
Conversely, pred_of_mem will _not_ if it is used id (mem A) is used
applicatively or as a pred T; there the simpl_of_mem coercion defined below
@@ -1396,7 +1396,7 @@ Notation "[ 'rel' x y 'in' A & B ]" :=
Notation "[ 'rel' x y 'in' A | E ]" := [rel x y in A & A | E] : fun_scope.
Notation "[ 'rel' x y 'in' A ]" := [rel x y in A & A] : fun_scope.
-(** Aliases of pred T that let us tag intances of simpl_pred as applicative
+(** Aliases of pred T that let us tag instances of simpl_pred as applicative
or collective, via bespoke coercions. This tagging will give control over
the simplification behaviour of inE and othe rewriting lemmas below.
For this control to work it is crucial that collective_of_simpl _not_
@@ -1428,7 +1428,7 @@ Implicit Types (mp : mem_pred T).
- registered_applicative_pred: this user-facing structure is used to
declare values of type pred T meant to be used applicatively. The
structure parameter merely displays this same value, and is used to avoid
- undesireable, visible occurrence of the structure in the right hand side
+ undesirable, visible occurrence of the structure in the right hand side
of rewrite rules such as app_predE.
There is a canonical instance of registered_applicative_pred for values
of the applicative_of_simpl coercion, which handles the
@@ -1454,7 +1454,7 @@ Implicit Types (mp : mem_pred T).
has been fixed earlier by the manifest_mem_pred match. In particular the
definition of a predicate using the applicative_pred_of_simpl idiom above
will not be expanded - this very case is the reason in_applicative uses
- a mem_pred telescope in its left hand side. The more straighforward
+ a mem_pred telescope in its left hand side. The more straightforward
?x \in applicative_pred_value ?ap (equivalent to in_mem ?x (Mem ?ap))
with ?ap : registered_applicative_pred ?p would set ?p := [pred x | ...]
rather than ?p := Apred in the example above.
diff --git a/plugins/ssr/ssrbwd.ml b/plugins/ssr/ssrbwd.ml
index 3e0fbc9a8c..f0ae90beca 100644
--- a/plugins/ssr/ssrbwd.ml
+++ b/plugins/ssr/ssrbwd.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrbwd.mli b/plugins/ssr/ssrbwd.mli
index 694ecfa379..e4c7192489 100644
--- a/plugins/ssr/ssrbwd.mli
+++ b/plugins/ssr/ssrbwd.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrcommon.ml b/plugins/ssr/ssrcommon.ml
index 56f17703ff..4c95a92022 100644
--- a/plugins/ssr/ssrcommon.ml
+++ b/plugins/ssr/ssrcommon.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -194,8 +194,8 @@ let mkRApp f args = if args = [] then f else DAst.make @@ GApp (f, args)
let mkRVar id = DAst.make @@ GRef (VarRef id,None)
let mkRltacVar id = DAst.make @@ GVar (id)
let mkRCast rc rt = DAst.make @@ GCast (rc, CastConv rt)
-let mkRType = DAst.make @@ GSort (GType [])
-let mkRProp = DAst.make @@ GSort (GProp)
+let mkRType = DAst.make @@ GSort (UAnonymous {rigid=true})
+let mkRProp = DAst.make @@ GSort (UNamed [GProp,0])
let mkRArrow rt1 rt2 = DAst.make @@ GProd (Anonymous, Explicit, rt1, rt2)
let mkRConstruct c = DAst.make @@ GRef (ConstructRef c,None)
let mkRInd mind = DAst.make @@ GRef (IndRef mind,None)
@@ -871,8 +871,8 @@ open Constrexpr
open Util
(** Constructors for constr_expr *)
-let mkCProp loc = CAst.make ?loc @@ CSort GProp
-let mkCType loc = CAst.make ?loc @@ CSort (GType [])
+let mkCProp loc = CAst.make ?loc @@ CSort (UNamed [GProp,0])
+let mkCType loc = CAst.make ?loc @@ CSort (UAnonymous {rigid=true})
let mkCVar ?loc id = CAst.make ?loc @@ CRef (qualid_of_ident ?loc id, None)
let rec mkCHoles ?loc n =
if n <= 0 then [] else (CAst.make ?loc @@ CHole (None, Namegen.IntroAnonymous, None)) :: mkCHoles ?loc (n - 1)
@@ -1119,6 +1119,7 @@ let cleartac clr = check_hyps_uniq [] clr; Tactics.clear (hyps_ids clr)
(* XXX the k of the redex should percolate out *)
let pf_interp_gen_aux gl to_ind ((oclr, occ), t) =
let pat = interp_cpattern gl t None in (* UGLY API *)
+ let gl = pf_merge_uc_of (fst pat) gl in
let cl, env, sigma = Tacmach.pf_concl gl, pf_env gl, project gl in
let (c, ucst), cl =
try fill_occ_pattern ~raise_NoMatch:true env sigma (EConstr.Unsafe.to_constr cl) pat occ 1
@@ -1253,6 +1254,7 @@ let abs_wgen keep_let f gen (gl,args,c) =
| _, Some ((x, "@"), Some p) ->
let x = hoi_id x in
let cp = interp_cpattern gl p None in
+ let gl = pf_merge_uc_of (fst cp) gl in
let (t, ucst), c =
try fill_occ_pattern ~raise_NoMatch:true env sigma (EConstr.Unsafe.to_constr c) cp None 1
with NoMatch -> redex_of_pattern env cp, (EConstr.Unsafe.to_constr c) in
@@ -1265,6 +1267,7 @@ let abs_wgen keep_let f gen (gl,args,c) =
| _, Some ((x, _), Some p) ->
let x = hoi_id x in
let cp = interp_cpattern gl p None in
+ let gl = pf_merge_uc_of (fst cp) gl in
let (t, ucst), c =
try fill_occ_pattern ~raise_NoMatch:true env sigma (EConstr.Unsafe.to_constr c) cp None 1
with NoMatch -> redex_of_pattern env cp, (EConstr.Unsafe.to_constr c) in
diff --git a/plugins/ssr/ssrcommon.mli b/plugins/ssr/ssrcommon.mli
index 575f016014..e920bc318a 100644
--- a/plugins/ssr/ssrcommon.mli
+++ b/plugins/ssr/ssrcommon.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssreflect.v b/plugins/ssr/ssreflect.v
index 5e3e8ce5fb..71abafc22f 100644
--- a/plugins/ssr/ssreflect.v
+++ b/plugins/ssr/ssreflect.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -132,7 +132,7 @@ Delimit Scope ssripat_scope with ssripat.
Make the general "if" into a notation, so that we can override it below.
The notations are "only parsing" because the Coq decompiler will not
recognize the expansion of the boolean if; using the default printer
- avoids a spurrious trailing %%GEN_IF. **)
+ avoids a spurious trailing %%GEN_IF. **)
Declare Scope general_if_scope.
Delimit Scope general_if_scope with GEN_IF.
@@ -347,10 +347,10 @@ Register protect_term as plugins.ssreflect.protect_term.
(**
The ssreflect idiom for a non-keyed pattern:
- - unkeyed t wiil match any subterm that unifies with t, regardless of
+ - unkeyed t will match any subterm that unifies with t, regardless of
whether it displays the same head symbol as t.
- unkeyed t a b will match any application of a term f unifying with t,
- to two arguments unifying with with a and b, repectively, regardless of
+ to two arguments unifying with with a and b, respectively, regardless of
apparent head symbols.
- unkeyed x where x is a variable will match any subterm with the same
type as x (when x would raise the 'indeterminate pattern' error). **)
@@ -380,7 +380,7 @@ Notation "=^~ r" := (ssr_converse r) : form_scope.
locked_with k t is equal but not convertible to t, much like locked t,
but supports explicit tagging with a value k : unit. This is used to
mitigate a flaw in the term comparison heuristic of the Coq kernel,
- which treats all terms of the form locked t as equal and conpares their
+ which treats all terms of the form locked t as equal and compares their
arguments recursively, leading to an exponential blowup of comparison.
For this reason locked_with should be used rather than locked when
defining ADT operations. The unlock tactic does not support locked_with
@@ -523,7 +523,7 @@ Hint View for apply/ iffRLn|2 iffLRn|2 iffRL|2 iffLR|2.
elim/abstract_context: (pattern) => G defG.
vm_compute; rewrite {}defG {G}.
Note that vm_cast are not stored in the proof term
- for reductions occuring in the context, hence
+ for reductions occurring in the context, hence
set here := pattern; vm_compute in (value of here)
blows up at Qed time. **)
Lemma abstract_context T (P : T -> Type) x :
@@ -637,7 +637,7 @@ Ltac over :=
later complain that it cannot erase _top_assumption_ after having
abstracted the viewed assumption. Making x and y maximal implicits
would avoid this and force the intended @Some_inj nat x y _top_assumption_
- interpretation, but is undesireable as it makes it harder to use Some_inj
+ interpretation, but is undesirable as it makes it harder to use Some_inj
with the many SSReflect and MathComp lemmas that have an injectivity
premise. Specifying {T : nonPropType} solves this more elegantly, as then
(?T : Type) no longer unifies with (Some n = Some 0), which has sort Prop.
@@ -655,13 +655,13 @@ Module NonPropType.
maybeProp T to tt and use the test_negative instance and set ?r to false.
- call_of c r sets up a call to test_of on condition c with expected result r.
It has a default instance for its 'callee' projection to Type, which
- sets c := maybeProj T and r := false whe unifying with a type T.
+ sets c := maybeProj T and r := false when unifying with a type T.
- type is a telescope on call_of c r, which checks that unifying test_of ?r1
with c indeed sets ?r1 := r; the type structure bundles the 'test' instance
and its 'result' value along with its call_of c r projection. The default
instance essentially provides eta-expansion for 'type'. This is only
essential for the first 'result' projection to bool; using the instance
- for other projection merely avoids spurrious delta expansions that would
+ for other projection merely avoids spurious delta expansions that would
spoil the notProp T notation.
In detail, unifying T =~= ?S with ?S : nonPropType, i.e.,
(1) T =~= @callee (@condition (result ?S) (test ?S)) (result ?S) (frame ?S)
diff --git a/plugins/ssr/ssrelim.ml b/plugins/ssr/ssrelim.ml
index 675e4d2457..d0426c86b9 100644
--- a/plugins/ssr/ssrelim.ml
+++ b/plugins/ssr/ssrelim.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -96,7 +96,7 @@ let subgoals_tys sigma (relctx, concl) =
* (occ, c), deps and the pattern inferred from the type of the eliminator
* 3. build the new predicate matching the patterns, and the tactic to
* generalize the equality in case eqid is not None
- * 4. build the tactic handle intructions and clears as required in ipats and
+ * 4. build the tactic handle instructions and clears as required in ipats and
* by eqid *)
let get_eq_type gl =
@@ -383,15 +383,22 @@ let ssrelim ?(is_case=false) deps what ?elim eqid elim_intro_tac =
let c = fire_subst gl (List.assoc (n_elim_args - k - 1) elim_args) in
let gl, t = pfe_type_of gl c in
let gl, eq = get_eq_type gl in
- let gen_eq_tac, gl =
+ let gen_eq_tac, eq_ty, gl =
let refl = EConstr.mkApp (eq, [|t; c; c|]) in
let new_concl = EConstr.mkArrow refl Sorts.Relevant (EConstr.Vars.lift 1 (pf_concl orig_gl)) in
let new_concl = fire_subst gl new_concl in
let erefl, gl = mkRefl t c gl in
let erefl = fire_subst gl erefl in
- apply_type new_concl [erefl], gl in
+ let erefl_ty = Retyping.get_type_of (pf_env gl) (project gl) erefl in
+ let eq_ty = Retyping.get_type_of (pf_env gl) (project gl) erefl_ty in
+ let gen_eq_tac s =
+ let open Evd in
+ let sigma = merge_universe_context s.sigma (evar_universe_context (project gl)) in
+ apply_type new_concl [erefl] { s with sigma }
+ in
+ gen_eq_tac, eq_ty, gl in
let rel = k + if c_is_head_p then 1 else 0 in
- let src, gl = mkProt EConstr.mkProp EConstr.(mkApp (eq,[|t; c; mkRel rel|])) gl in
+ let src, gl = mkProt eq_ty EConstr.(mkApp (eq,[|t; c; mkRel rel|])) gl in
let concl = EConstr.mkArrow src Sorts.Relevant (EConstr.Vars.lift 1 concl) in
let clr = if deps <> [] then clr else [] in
concl, gen_eq_tac, clr, gl
diff --git a/plugins/ssr/ssrelim.mli b/plugins/ssr/ssrelim.mli
index a1e2f63b8f..a18df2ced3 100644
--- a/plugins/ssr/ssrelim.mli
+++ b/plugins/ssr/ssrelim.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrequality.ml b/plugins/ssr/ssrequality.ml
index 93c0d5c236..aa1316f15e 100644
--- a/plugins/ssr/ssrequality.ml
+++ b/plugins/ssr/ssrequality.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -128,7 +128,7 @@ let newssrcongrtac arg ist gl =
x, re_sig si sigma in
let arr, gl = pf_mkSsrConst "ssr_congr_arrow" gl in
let ssr_congr lr = EConstr.mkApp (arr, lr) in
- (* here thw two cases: simple equality or arrow *)
+ (* here the two cases: simple equality or arrow *)
let equality, _, eq_args, gl' =
let eq, gl = pf_fresh_global Coqlib.(lib_ref "core.eq.type") gl in
pf_saturate gl (EConstr.of_constr eq) 3 in
@@ -313,7 +313,7 @@ let rw_progress rhs lhs ise = not (EConstr.eq_constr ise lhs (Evarutil.nf_evar i
(* Coq has a more general form of "equation" (any type with a single *)
(* constructor with no arguments with_rect_r elimination lemmas). *)
(* However there is no clear way of determining the LHS and RHS of *)
-(* such a generic Leibnitz equation -- short of inspecting the type *)
+(* such a generic Leibniz equation -- short of inspecting the type *)
(* of the elimination lemmas. *)
let rec strip_prod_assum c = match Constr.kind c with
@@ -336,14 +336,14 @@ let pirrel_rewrite ?(under=false) ?(map_redex=id_map_redex) pred rdx rdx_ty new_
let sigma, p = (* The resulting goal *)
Evarutil.new_evar env sigma (beta (EConstr.Vars.subst1 new_rdx pred)) in
let pred = EConstr.mkNamedLambda (make_annot pattern_id Sorts.Relevant) rdx_ty pred in
- let elim, gl =
+ let elim, gl =
let ((kn, i) as ind, _), unfolded_c_ty = pf_reduce_to_quantified_ind gl c_ty in
let sort = elimination_sort_of_goal gl in
let elim, gl = pf_fresh_global (Indrec.lookup_eliminator env ind sort) gl in
if dir = R2L then elim, gl else (* taken from Coq's rewrite *)
let elim, _ = destConst elim in
let mp,l = Constant.repr2 (Constant.make1 (Constant.canonical elim)) in
- let l' = Label.of_id (Nameops.add_suffix (Label.to_id l) "_r") in
+ let l' = Label.of_id (Nameops.add_suffix (Label.to_id l) "_r") in
let c1' = Global.constant_of_delta_kn (Constant.canonical (Constant.make2 mp l')) in
mkConst c1', gl in
let elim = EConstr.of_constr elim in
@@ -619,7 +619,11 @@ let rwargtac ?under ?map_redex ist ((dir, mult), (((oclr, occ), grx), (kind, gt)
with _ when snd mult = May -> fail := true; (project gl, EConstr.mkProp) in
let rwtac gl =
let rx = Option.map (interp_rpattern gl) grx in
+ let gl = match rx with
+ | None -> gl
+ | Some (s,_) -> pf_merge_uc_of s gl in
let t = interp gt gl in
+ let gl = pf_merge_uc_of (fst t) gl in
(match kind with
| RWred sim -> simplintac occ rx sim
| RWdef -> if dir = R2L then foldtac occ rx t else unfoldintac occ rx t gt
diff --git a/plugins/ssr/ssrequality.mli b/plugins/ssr/ssrequality.mli
index 601968d511..43aeeb2dae 100644
--- a/plugins/ssr/ssrequality.mli
+++ b/plugins/ssr/ssrequality.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrfun.v b/plugins/ssr/ssrfun.v
index 46af775296..5e600362b4 100644
--- a/plugins/ssr/ssrfun.v
+++ b/plugins/ssr/ssrfun.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrfwd.ml b/plugins/ssr/ssrfwd.ml
index 4d4400a0f8..cca94c8c9b 100644
--- a/plugins/ssr/ssrfwd.ml
+++ b/plugins/ssr/ssrfwd.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrfwd.mli b/plugins/ssr/ssrfwd.mli
index 6dd01ca6fc..6f8eb51caf 100644
--- a/plugins/ssr/ssrfwd.mli
+++ b/plugins/ssr/ssrfwd.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssripats.ml b/plugins/ssr/ssripats.ml
index 3481b25c8b..580c0423e9 100644
--- a/plugins/ssr/ssripats.ml
+++ b/plugins/ssr/ssripats.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssripats.mli b/plugins/ssr/ssripats.mli
index 893061b154..1d76a9000e 100644
--- a/plugins/ssr/ssripats.mli
+++ b/plugins/ssr/ssripats.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrparser.mlg b/plugins/ssr/ssrparser.mlg
index 27a558611e..858a75698a 100644
--- a/plugins/ssr/ssrparser.mlg
+++ b/plugins/ssr/ssrparser.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -79,7 +79,6 @@ let pr_ssrtacarg env sigma _ _ prt = prt env sigma tacltop
}
ARGUMENT EXTEND ssrtacarg TYPED AS tactic PRINTED BY { pr_ssrtacarg env sigma }
-| [ "YouShouldNotTypeThis" ] -> { CErrors.anomaly (Pp.str "Grammar placeholder match") }
END
GRAMMAR EXTEND Gram
GLOBAL: ssrtacarg;
@@ -88,7 +87,6 @@ END
(* Copy of ssrtacarg with LEVEL "3", useful for: "under ... do ..." *)
ARGUMENT EXTEND ssrtac3arg TYPED AS tactic PRINTED BY { pr_ssrtacarg env sigma }
-| [ "YouShouldNotTypeThis" ] -> { CErrors.anomaly (Pp.str "Grammar placeholder match") }
END
GRAMMAR EXTEND Gram
GLOBAL: ssrtac3arg;
@@ -204,17 +202,6 @@ ARGUMENT EXTEND ssrhoi_id TYPED AS ssrhoirep PRINTED BY { pr_ssrhoi }
| [ ident(id) ] -> { Id (SsrHyp(Loc.tag ~loc id)) }
END
-{
-
-let pr_ssrhyps _ _ _ = pr_hyps
-
-}
-
-ARGUMENT EXTEND ssrhyps TYPED AS ssrhyp list PRINTED BY { pr_ssrhyps }
- INTERPRETED BY { interp_hyps }
- | [ ssrhyp_list(hyps) ] -> { check_hyps_uniq [] hyps; hyps }
-END
-
(** Rewriting direction *)
{
@@ -310,18 +297,13 @@ GRAMMAR EXTEND Gram
END
-ARGUMENT EXTEND ssrsimpl TYPED AS ssrsimplrep PRINTED BY { pr_ssrsimpl }
-| [ ssrsimpl_ne(sim) ] -> { sim }
-| [ ] -> { Nop }
-END
-
{
let pr_ssrclear _ _ _ = pr_clear mt
}
-ARGUMENT EXTEND ssrclear_ne TYPED AS ssrhyps PRINTED BY { pr_ssrclear }
+ARGUMENT EXTEND ssrclear_ne TYPED AS ssrhyp list PRINTED BY { pr_ssrclear }
| [ "{" ne_ssrhyp_list(clr) "}" ] -> { check_hyps_uniq [] clr; clr }
END
@@ -1005,7 +987,6 @@ let pr_ssrfwdidx _ _ _ = pr_ssrfwdid
(* We use a primitive parser for the head identifier of forward *)
(* tactis to avoid syntactic conflicts with basic Coq tactics. *)
ARGUMENT EXTEND ssrfwdid TYPED AS ident PRINTED BY { pr_ssrfwdidx }
- | [ "YouShouldNotTypeThis" ] -> { anomaly "Grammar placeholder match" }
END
{
@@ -1564,7 +1545,6 @@ let pr_ssrdoarg env sigma prc _ prt (((n, m), tac), clauses) =
ARGUMENT EXTEND ssrdoarg
TYPED AS (((ssrindex * ssrmmod) * ssrhintarg) * ssrclauses)
PRINTED BY { pr_ssrdoarg env sigma }
-| [ "YouShouldNotTypeThis" ] -> { anomaly "Grammar placeholder match" }
END
{
@@ -1587,7 +1567,7 @@ let pr_ssrseqarg env sigma _ _ prt = function
(* an unindexed tactic. *)
ARGUMENT EXTEND ssrseqarg TYPED AS (ssrindex * (ssrhintarg * tactic option))
PRINTED BY { pr_ssrseqarg env sigma }
-| [ "YouShouldNotTypeThis" ] -> { anomaly "Grammar placeholder match" }
+
END
{
@@ -1867,7 +1847,6 @@ let pr_ssrseqdir _ _ _ = function
}
ARGUMENT EXTEND ssrseqdir TYPED AS ssrdir PRINTED BY { pr_ssrseqdir }
-| [ "YouShouldNotTypeThis" ] -> { anomaly "Grammar placeholder match" }
END
TACTIC EXTEND ssrtclseq
@@ -2004,7 +1983,6 @@ let pr_ssreqid _ _ _ = pr_eqid
(* We must use primitive parsing here to avoid conflicts with the *)
(* basic move, case, and elim tactics. *)
ARGUMENT EXTEND ssreqid TYPED AS ssripatrep option PRINTED BY { pr_ssreqid }
-| [ "YouShouldNotTypeThis" ] -> { anomaly "Grammar placeholder match" }
END
{
@@ -2326,7 +2304,6 @@ let noruleterm loc = mk_term xNoFlag (mkCProp loc)
}
ARGUMENT EXTEND ssrrule_ne TYPED AS (ssrrwkind * ssrterm) PRINTED BY { pr_ssrrule }
- | [ "YouShouldNotTypeThis" ] -> { anomaly "Grammar placeholder match" }
END
GRAMMAR EXTEND Gram
@@ -2413,7 +2390,6 @@ let pr_ssrrwargs _ _ _ rwargs = pr_list spc pr_rwarg rwargs
}
ARGUMENT EXTEND ssrrwargs TYPED AS ssrrwarg list PRINTED BY { pr_ssrrwargs }
- | [ "YouShouldNotTypeThis" ] -> { anomaly "Grammar placeholder match" }
END
{
diff --git a/plugins/ssr/ssrparser.mli b/plugins/ssr/ssrparser.mli
index 4a872be6a5..e6b1706b41 100644
--- a/plugins/ssr/ssrparser.mli
+++ b/plugins/ssr/ssrparser.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrprinters.ml b/plugins/ssr/ssrprinters.ml
index 5d8c94e49b..f0aed1a934 100644
--- a/plugins/ssr/ssrprinters.ml
+++ b/plugins/ssr/ssrprinters.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrprinters.mli b/plugins/ssr/ssrprinters.mli
index 5f20ac2705..e4df7399e1 100644
--- a/plugins/ssr/ssrprinters.mli
+++ b/plugins/ssr/ssrprinters.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrtacticals.ml b/plugins/ssr/ssrtacticals.ml
index 91ff432364..cd2448d764 100644
--- a/plugins/ssr/ssrtacticals.ml
+++ b/plugins/ssr/ssrtacticals.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrtacticals.mli b/plugins/ssr/ssrtacticals.mli
index 684e002352..1a9f13cbae 100644
--- a/plugins/ssr/ssrtacticals.mli
+++ b/plugins/ssr/ssrtacticals.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrvernac.mlg b/plugins/ssr/ssrvernac.mlg
index 08f028465b..279e7ce1a6 100644
--- a/plugins/ssr/ssrvernac.mlg
+++ b/plugins/ssr/ssrvernac.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -566,12 +566,10 @@ let print_view_hints env sigma kind l =
}
VERNAC COMMAND EXTEND PrintView CLASSIFIED AS QUERY
-| ![proof] [ "Print" "Hint" "View" ssrviewpos(i) ] ->
+| [ "Print" "Hint" "View" ssrviewpos(i) ] ->
{
- fun ~pstate ->
- (* XXX this is incorrect *)
- let sigma, env = Option.cata Pfedit.get_current_context
- (let e = Global.env () in Evd.from_env e, e) pstate in
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
(match i with
| Some k ->
print_view_hints env sigma k (Ssrview.AdaptorDb.get k)
@@ -579,8 +577,7 @@ VERNAC COMMAND EXTEND PrintView CLASSIFIED AS QUERY
List.iter (fun k -> print_view_hints env sigma k (Ssrview.AdaptorDb.get k))
[ Ssrview.AdaptorDb.Forward;
Ssrview.AdaptorDb.Backward;
- Ssrview.AdaptorDb.Equivalence ]);
- pstate
+ Ssrview.AdaptorDb.Equivalence ])
}
END
diff --git a/plugins/ssr/ssrvernac.mli b/plugins/ssr/ssrvernac.mli
index aa6e02d3eb..994fadcc27 100644
--- a/plugins/ssr/ssrvernac.mli
+++ b/plugins/ssr/ssrvernac.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrview.ml b/plugins/ssr/ssrview.ml
index 0a5c85f4ab..34f13b1096 100644
--- a/plugins/ssr/ssrview.ml
+++ b/plugins/ssr/ssrview.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssr/ssrview.mli b/plugins/ssr/ssrview.mli
index fb9203263a..130bd81d6d 100644
--- a/plugins/ssr/ssrview.mli
+++ b/plugins/ssr/ssrview.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssrmatching/g_ssrmatching.mlg b/plugins/ssrmatching/g_ssrmatching.mlg
index d1c7a23e99..d920ea9a46 100644
--- a/plugins/ssrmatching/g_ssrmatching.mlg
+++ b/plugins/ssrmatching/g_ssrmatching.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssrmatching/g_ssrmatching.mli b/plugins/ssrmatching/g_ssrmatching.mli
index 65ea3f79c8..55f3101baf 100644
--- a/plugins/ssrmatching/g_ssrmatching.mli
+++ b/plugins/ssrmatching/g_ssrmatching.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssrmatching/ssrmatching.ml b/plugins/ssrmatching/ssrmatching.ml
index adbcfb8f3b..7fc1a12b61 100644
--- a/plugins/ssrmatching/ssrmatching.ml
+++ b/plugins/ssrmatching/ssrmatching.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/ssrmatching/ssrmatching.mli b/plugins/ssrmatching/ssrmatching.mli
index 25975c84e8..c6b85738ec 100644
--- a/plugins/ssrmatching/ssrmatching.mli
+++ b/plugins/ssrmatching/ssrmatching.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -143,7 +143,7 @@ val mk_tpattern :
type find_P =
env -> constr -> int -> k:subst -> constr
-(** [conclude ()] asserts that all mentioned ocurrences have been visited.
+(** [conclude ()] asserts that all mentioned occurrences have been visited.
@return the instance of the pattern, the evarmap after the pattern
instantiation, the proof term and the ssrdit stored in the tpattern
@raise UserEerror if too many occurrences were specified *)
diff --git a/plugins/ssrmatching/ssrmatching.v b/plugins/ssrmatching/ssrmatching.v
index a39f76db9e..23a16615f5 100644
--- a/plugins/ssrmatching/ssrmatching.v
+++ b/plugins/ssrmatching/ssrmatching.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/syntax/g_numeral.mlg b/plugins/syntax/g_numeral.mlg
index 0f0f3953da..44c494e075 100644
--- a/plugins/syntax/g_numeral.mlg
+++ b/plugins/syntax/g_numeral.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -34,23 +34,8 @@ VERNAC ARGUMENT EXTEND numnotoption
END
VERNAC COMMAND EXTEND NumeralNotation CLASSIFIED AS SIDEFF
- | #[ locality = Attributes.locality; ] ![proof][ "Numeral" "Notation" reference(ty) reference(f) reference(g) ":"
+ | #[ locality = Attributes.locality; ] [ "Numeral" "Notation" reference(ty) reference(f) reference(g) ":"
ident(sc) numnotoption(o) ] ->
- { (* It is a bug to use the proof context here, but at the request of
- * the reviewers we keep this broken behavior for now. The Global env
- * should be used instead, and the `env, sigma` parameteter to the
- * numeral notation command removed.
- *)
- fun ~pstate ->
- let sigma, env = match pstate with
- | None ->
- let env = Global.env () in
- let sigma = Evd.from_env env in
- sigma, env
- | Some pstate ->
- Pfedit.get_current_context pstate
- in
- vernac_numeral_notation env sigma (Locality.make_module_locality locality) ty f g (Id.to_string sc) o;
- pstate }
+ { vernac_numeral_notation (Locality.make_module_locality locality) ty f g (Id.to_string sc) o }
END
diff --git a/plugins/syntax/g_string.mlg b/plugins/syntax/g_string.mlg
index cc8c13a84b..c94119fdb0 100644
--- a/plugins/syntax/g_string.mlg
+++ b/plugins/syntax/g_string.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -19,22 +19,7 @@ open Stdarg
}
VERNAC COMMAND EXTEND StringNotation CLASSIFIED AS SIDEFF
- | #[ locality = Attributes.locality; ] ![proof] [ "String" "Notation" reference(ty) reference(f) reference(g) ":"
+ | #[ locality = Attributes.locality; ] [ "String" "Notation" reference(ty) reference(f) reference(g) ":"
ident(sc) ] ->
- { (* It is a bug to use the proof context here, but at the request of
- * the reviewers we keep this broken behavior for now. The Global env
- * should be used instead, and the `env, sigma` parameteter to the
- * numeral notation command removed.
- *)
- fun ~pstate ->
- let sigma, env = match pstate with
- | None ->
- let env = Global.env () in
- let sigma = Evd.from_env env in
- sigma, env
- | Some pstate ->
- Pfedit.get_current_context pstate
- in
- vernac_string_notation env sigma (Locality.make_module_locality locality) ty f g (Id.to_string sc);
- pstate }
+ { vernac_string_notation (Locality.make_module_locality locality) ty f g (Id.to_string sc) }
END
diff --git a/plugins/syntax/int63_syntax.ml b/plugins/syntax/int63_syntax.ml
index 992b7a986b..bfbf9d6b88 100644
--- a/plugins/syntax/int63_syntax.ml
+++ b/plugins/syntax/int63_syntax.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
diff --git a/plugins/syntax/numeral.ml b/plugins/syntax/numeral.ml
index ec8c2338fb..0a1cc8745d 100644
--- a/plugins/syntax/numeral.ml
+++ b/plugins/syntax/numeral.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -101,7 +101,9 @@ let type_error_of g ty =
str " to Decimal.int or (option Decimal.int)." ++ fnl () ++
str "Instead of Decimal.int, the types Decimal.uint or Z or Int63.int or Decimal.decimal could be used (you may need to require BinNums or Decimal or Int63 first).")
-let vernac_numeral_notation env sigma local ty f g scope opts =
+let vernac_numeral_notation local ty f g scope opts =
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
let dec_ty = locate_decimal () in
let z_pos_ty = locate_z () in
let int63_ty = locate_int63 () in
diff --git a/plugins/syntax/numeral.mli b/plugins/syntax/numeral.mli
index b14ed18497..54e293c8b1 100644
--- a/plugins/syntax/numeral.mli
+++ b/plugins/syntax/numeral.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -14,6 +14,6 @@ open Notation
(** * Numeral notation *)
-val vernac_numeral_notation : Environ.env -> Evd.evar_map -> locality_flag ->
+val vernac_numeral_notation : locality_flag ->
qualid -> qualid -> qualid ->
Notation_term.scope_name -> numnot_option -> unit
diff --git a/plugins/syntax/r_syntax.ml b/plugins/syntax/r_syntax.ml
index b9062dd16b..1cbc86b6fe 100644
--- a/plugins/syntax/r_syntax.ml
+++ b/plugins/syntax/r_syntax.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/syntax/r_syntax.mli b/plugins/syntax/r_syntax.mli
index 7c3ee60040..87553dcb56 100644
--- a/plugins/syntax/r_syntax.mli
+++ b/plugins/syntax/r_syntax.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/plugins/syntax/string_notation.ml b/plugins/syntax/string_notation.ml
index 5fae696d58..bc586acce7 100644
--- a/plugins/syntax/string_notation.ml
+++ b/plugins/syntax/string_notation.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -47,7 +47,9 @@ let type_error_of g ty =
(pr_qualid g ++ str " should go from " ++ pr_qualid ty ++
str " to Byte.byte or (option Byte.byte) or (list Byte.byte) or (option (list Byte.byte)).")
-let vernac_string_notation env sigma local ty f g scope =
+let vernac_string_notation local ty f g scope =
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
let app x y = mkAppC (x,[y]) in
let cref q = mkRefC q in
let cbyte = cref (q_byte ()) in
diff --git a/plugins/syntax/string_notation.mli b/plugins/syntax/string_notation.mli
index e81de603d9..abdf4560d8 100644
--- a/plugins/syntax/string_notation.mli
+++ b/plugins/syntax/string_notation.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -13,6 +13,6 @@ open Vernacexpr
(** * String notation *)
-val vernac_string_notation : Environ.env -> Evd.evar_map -> locality_flag ->
+val vernac_string_notation : locality_flag ->
qualid -> qualid -> qualid ->
Notation_term.scope_name -> unit
diff --git a/pretyping/arguments_renaming.ml b/pretyping/arguments_renaming.ml
index 3b3de33d8e..47916ffb79 100644
--- a/pretyping/arguments_renaming.ml
+++ b/pretyping/arguments_renaming.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/arguments_renaming.mli b/pretyping/arguments_renaming.mli
index 6d1b6eefd4..f1c84cb63b 100644
--- a/pretyping/arguments_renaming.mli
+++ b/pretyping/arguments_renaming.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/cases.ml b/pretyping/cases.ml
index d7a6c4c832..20dec96ef4 100644
--- a/pretyping/cases.ml
+++ b/pretyping/cases.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -824,7 +824,7 @@ let push_alias_eqn sigma alias eqn =
(**********************************************************************)
(* Functions to deal with elimination predicate *)
-(* Infering the predicate *)
+(* Inferring the predicate *)
(*
The problem to solve is the following:
@@ -1455,7 +1455,7 @@ let compile ~program_mode sigma pb =
(* Building the sub-problem when all patterns are variables. Case
- where [current] is an intially pushed term. *)
+ where [current] is an initially pushed term. *)
and shift_problem ((current,t),_,na) sigma pb =
let ty = type_of_tomatch t in
let tomatch = lift_tomatch_stack 1 pb.tomatch in
@@ -1542,7 +1542,7 @@ let compile ~program_mode sigma pb =
mat = List.map drop_alias_eqn pb.mat } in
compile sigma pb
in
- (* If the "match" was orginally over a variable, as in "match x with
+ (* If the "match" was originally over a variable, as in "match x with
O => true | n => n end", we give preference to non-expansion in
the default clause (i.e. "match x with O => true | n => n end"
rather than "match x with O => true | S p => S p end";
@@ -2067,7 +2067,7 @@ let prepare_predicate ?loc ~program_mode typing_fun env sigma tomatchs arsign ty
let p2 =
prepare_predicate_from_arsign_tycon ~program_mode env sigma loc tomatchs arsign t in
(* Third strategy: we take the type constraint as it is; of course we could *)
- (* need something inbetween, abstracting some but not all of the dependencies *)
+ (* need something in between, abstracting some but not all of the dependencies *)
(* the "inversion" strategy deals with that but unification may not be *)
(* powerful enough so strategy 2 and 3 helps; moreover, inverting does not *)
(* work (yet) when a constructor has a type not precise enough for the inversion *)
diff --git a/pretyping/cases.mli b/pretyping/cases.mli
index b0349a3d05..59cb1ca4ab 100644
--- a/pretyping/cases.mli
+++ b/pretyping/cases.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/cbv.ml b/pretyping/cbv.ml
index 5ea9b79336..43b94aed3d 100644
--- a/pretyping/cbv.ml
+++ b/pretyping/cbv.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -477,7 +477,7 @@ and cbv_stack_value info env = function
cbv_stack_value info env (CONSTR(c, [||]), stack_app args stk)
| Some v -> cbv_stack_value info env (v,stk)
| None -> mkSTACK(PRIMITIVE(op,c,args), stk)
- else (* partical application *)
+ else (* partial application *)
(assert (stk = TOP);
PRIMITIVE(op,c,appl))
diff --git a/pretyping/cbv.mli b/pretyping/cbv.mli
index d6c2ad146e..16c4364f17 100644
--- a/pretyping/cbv.mli
+++ b/pretyping/cbv.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/classops.ml b/pretyping/classops.ml
index 90ce1cc594..f5fffc4c1c 100644
--- a/pretyping/classops.ml
+++ b/pretyping/classops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -441,7 +441,7 @@ let coercion_of_reference r =
module CoercionPrinting =
struct
type t = coe_typ
- let compare = GlobRef.Ordered.compare
+ module Set = GlobRef.Set
let encode _env = coercion_of_reference
let subst = subst_coe_typ
let printer x = Nametab.pr_global_env Id.Set.empty x
diff --git a/pretyping/classops.mli b/pretyping/classops.mli
index c04182930e..9c5274286e 100644
--- a/pretyping/classops.mli
+++ b/pretyping/classops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/coercion.ml b/pretyping/coercion.ml
index 8c9b6550f3..3c71871968 100644
--- a/pretyping/coercion.ml
+++ b/pretyping/coercion.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/coercion.mli b/pretyping/coercion.mli
index 43d4059785..0dc8208786 100644
--- a/pretyping/coercion.mli
+++ b/pretyping/coercion.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/constr_matching.ml b/pretyping/constr_matching.ml
index 6bfbb9a9c0..415b9ec6df 100644
--- a/pretyping/constr_matching.ml
+++ b/pretyping/constr_matching.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/constr_matching.mli b/pretyping/constr_matching.mli
index d19789ef42..88001bba6e 100644
--- a/pretyping/constr_matching.mli
+++ b/pretyping/constr_matching.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/detyping.ml b/pretyping/detyping.ml
index 82726eccf0..0daf1ab531 100644
--- a/pretyping/detyping.ml
+++ b/pretyping/detyping.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -182,7 +182,7 @@ module PrintingInductiveMake =
end) ->
struct
type t = inductive
- let compare = ind_ord
+ module Set = Indset
let encode = Test.encode
let subst subst obj = subst_ind subst obj
let printer ind = Nametab.pr_global_env Id.Set.empty (IndRef ind)
@@ -688,20 +688,21 @@ let hack_qualid_of_univ_level sigma l =
let detype_universe sigma u =
let fn (l, n) =
- let qid = hack_qualid_of_univ_level sigma l in
- Some (qid, n)
- in
+ let s =
+ if Univ.Level.is_prop l then GProp else
+ if Univ.Level.is_set l then GSet else
+ GType (hack_qualid_of_univ_level sigma l) in
+ (s, n) in
Univ.Universe.map fn u
let detype_sort sigma = function
- | SProp -> GSProp
- | Prop -> GProp
- | Set -> GSet
+ | SProp -> UNamed [GSProp,0]
+ | Prop -> UNamed [GProp,0]
+ | Set -> UNamed [GSet,0]
| Type u ->
- GType
(if !print_universes
- then detype_universe sigma u
- else [])
+ then UNamed (detype_universe sigma u)
+ else UAnonymous {rigid=true})
type binder_kind = BProd | BLambda | BLetIn
@@ -710,7 +711,7 @@ type binder_kind = BProd | BLambda | BLetIn
let detype_level sigma l =
let l = hack_qualid_of_univ_level sigma l in
- GType (UNamed l)
+ UNamed (GType l)
let detype_instance sigma l =
let l = EInstance.kind sigma l in
diff --git a/pretyping/detyping.mli b/pretyping/detyping.mli
index 00b0578a52..cc9f520583 100644
--- a/pretyping/detyping.mli
+++ b/pretyping/detyping.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -91,7 +91,7 @@ module PrintingInductiveMake :
end) ->
sig
type t = Names.inductive
- val compare : t -> t -> int
+ module Set = Indset
val encode : Environ.env -> Libnames.qualid -> Names.inductive
val subst : substitution -> t -> t
val printer : t -> Pp.t
diff --git a/pretyping/evarconv.ml b/pretyping/evarconv.ml
index 6b149a8b41..edc948eb65 100644
--- a/pretyping/evarconv.ml
+++ b/pretyping/evarconv.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/evarconv.mli b/pretyping/evarconv.mli
index eae961714d..e1dd0a0cdc 100644
--- a/pretyping/evarconv.mli
+++ b/pretyping/evarconv.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -34,7 +34,7 @@ exception UnableToUnify of evar_map * Pretype_errors.unification_error
([unify_delay]) and another that tries to solve such remaining constraints using
heuristics ([unify]). *)
-(** Theses functions allow to pass arbitrary flags to the unifier and can delay constraints.
+(** These functions allow to pass arbitrary flags to the unifier and can delay constraints.
In case the flags are not specified, they default to
[default_flags_of TransparentState.full] currently.
diff --git a/pretyping/evardefine.ml b/pretyping/evardefine.ml
index a51cb22c20..705ab56703 100644
--- a/pretyping/evardefine.ml
+++ b/pretyping/evardefine.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/evardefine.mli b/pretyping/evardefine.mli
index 8ff113196b..3dc3e45068 100644
--- a/pretyping/evardefine.mli
+++ b/pretyping/evardefine.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/evarsolve.ml b/pretyping/evarsolve.ml
index 4a941a68b1..769079dea7 100644
--- a/pretyping/evarsolve.ml
+++ b/pretyping/evarsolve.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -284,9 +284,9 @@ let noccur_evar env evd evk c =
in
try occur_rec false (0,env) c; true with Occur -> false
-(***************************************)
-(* Managing chains of local definitons *)
-(***************************************)
+(****************************************)
+(* Managing chains of local definitions *)
+(****************************************)
type alias =
| RelAlias of int
@@ -629,7 +629,7 @@ let solve_pattern_eqn env sigma l c =
* If a variable and an alias of it are bound to the same instance, we skip
* the alias (we just use eq_constr -- instead of conv --, since anyway,
* only instances that are variables -- or evars -- are later considered;
- * morever, we can bet that similar instances came at some time from
+ * moreover, we can bet that similar instances came at some time from
* the very same substitution. The removal of aliased duplicates is
* useful to ensure the uniqueness of a projection.
*)
@@ -1738,7 +1738,7 @@ let reconsider_unif_constraints unify flags evd =
* Returns an optional list of evars that were instantiated, or None
* if the problem couldn't be solved. *)
-(* Rq: uncomplete algorithm if pbty = CONV_X_LEQ ! *)
+(* Rq: incomplete algorithm if pbty = CONV_X_LEQ ! *)
let solve_simple_eqn unify flags ?(choose=false) ?(imitate_defs=true)
env evd (pbty,(evk1,args1 as ev1),t2) =
try
diff --git a/pretyping/evarsolve.mli b/pretyping/evarsolve.mli
index ebf8230bbd..9d5d75d9ba 100644
--- a/pretyping/evarsolve.mli
+++ b/pretyping/evarsolve.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/find_subterm.ml b/pretyping/find_subterm.ml
index 7019cdf046..9db37bfa9b 100644
--- a/pretyping/find_subterm.ml
+++ b/pretyping/find_subterm.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/find_subterm.mli b/pretyping/find_subterm.mli
index 9ba63b4f52..3ad69e6e50 100644
--- a/pretyping/find_subterm.mli
+++ b/pretyping/find_subterm.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/geninterp.ml b/pretyping/geninterp.ml
index 32152ad0e4..b9128aa107 100644
--- a/pretyping/geninterp.ml
+++ b/pretyping/geninterp.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/geninterp.mli b/pretyping/geninterp.mli
index 49d874289d..088f97271b 100644
--- a/pretyping/geninterp.mli
+++ b/pretyping/geninterp.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/globEnv.ml b/pretyping/globEnv.ml
index e76eb2a7de..d49a39b547 100644
--- a/pretyping/globEnv.ml
+++ b/pretyping/globEnv.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/globEnv.mli b/pretyping/globEnv.mli
index cdd36bbba6..a49ac80f47 100644
--- a/pretyping/globEnv.mli
+++ b/pretyping/globEnv.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -40,7 +40,7 @@ type t
val make : hypnaming:naming_mode -> env -> evar_map -> ltac_var_map -> t
-(** Export the underlying environement *)
+(** Export the underlying environment *)
val env : t -> env
diff --git a/pretyping/glob_ops.ml b/pretyping/glob_ops.ml
index 85b9faac77..ea94305dd8 100644
--- a/pretyping/glob_ops.ml
+++ b/pretyping/glob_ops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -45,20 +45,27 @@ let map_glob_decl_left_to_right f (na,k,obd,ty) =
let comp2 = f ty in
(na,k,comp1,comp2)
+let glob_sort_name_eq g1 g2 = match g1, g2 with
+ | GSProp, GSProp
+ | GProp, GProp
+ | GSet, GSet -> true
+ | GType u1, GType u2 -> Libnames.qualid_eq u1 u2
+ | (GSProp|GProp|GSet|GType _), _ -> false
-let glob_sort_eq g1 g2 = let open Glob_term in match g1, g2 with
-| GSProp, GSProp
-| GProp, GProp
-| GSet, GSet -> true
-| GType l1, GType l2 ->
- List.equal (Option.equal (fun (x,m) (y,n) -> Libnames.qualid_eq x y && Int.equal m n)) l1 l2
-| (GSProp|GProp|GSet|GType _), _ -> false
+exception ComplexSort
let glob_sort_family = let open Sorts in function
-| GSProp -> InSProp
-| GProp -> InProp
-| GSet -> InSet
-| GType _ -> InType
+ | UAnonymous {rigid=true} -> InType
+ | UNamed [GSProp,0] -> InProp
+ | UNamed [GProp,0] -> InProp
+ | UNamed [GSet,0] -> InSet
+ | _ -> raise ComplexSort
+
+let glob_sort_eq u1 u2 = match u1, u2 with
+ | UAnonymous {rigid=r1}, UAnonymous {rigid=r2} -> r1 = r2
+ | UNamed l1, UNamed l2 ->
+ List.equal (fun (x,m) (y,n) -> glob_sort_name_eq x y && Int.equal m n) l1 l2
+ | (UNamed _ | UAnonymous _), _ -> false
let binding_kind_eq bk1 bk2 = match bk1, bk2 with
| Decl_kinds.Explicit, Decl_kinds.Explicit -> true
diff --git a/pretyping/glob_ops.mli b/pretyping/glob_ops.mli
index df902a8fa7..467b72e520 100644
--- a/pretyping/glob_ops.mli
+++ b/pretyping/glob_ops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -15,10 +15,13 @@ open Glob_term
val glob_sort_eq : Glob_term.glob_sort -> Glob_term.glob_sort -> bool
-val glob_sort_family : 'a glob_sort_gen -> Sorts.family
-
val cases_pattern_eq : 'a cases_pattern_g -> 'a cases_pattern_g -> bool
+(** Expect a Prop/SProp/Set/Type universe; raise [ComplexSort] if
+ contains a max, an increment, or a flexible universe *)
+exception ComplexSort
+val glob_sort_family : glob_sort -> Sorts.family
+
val alias_of_pat : 'a cases_pattern_g -> Name.t
val set_pat_alias : Id.t -> 'a cases_pattern_g -> 'a cases_pattern_g
diff --git a/pretyping/glob_term.ml b/pretyping/glob_term.ml
index 02cb294f6d..7c859a5332 100644
--- a/pretyping/glob_term.ml
+++ b/pretyping/glob_term.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -23,23 +23,23 @@ type existential_name = Id.t
(** Sorts *)
-type 'a glob_sort_gen =
+type glob_sort_name =
| GSProp (** representation of [SProp] literal *)
- | GProp (** representation of [Prop] literal *)
- | GSet (** representation of [Set] literal *)
- | GType of 'a (** representation of [Type] literal *)
+ | GProp (** representation of [Prop] level *)
+ | GSet (** representation of [Set] level *)
+ | GType of Libnames.qualid (** representation of a [Type] level *)
-type 'a universe_kind =
- | UAnonymous
- | UUnknown
+type 'a glob_sort_expr =
+ | UAnonymous of { rigid : bool } (** not rigid = unifiable by minimization *)
| UNamed of 'a
-type level_info = Libnames.qualid universe_kind
-type glob_level = level_info glob_sort_gen
-type glob_constraint = glob_level * Univ.constraint_type * glob_level
+(** levels, occurring in universe instances *)
+type glob_level = glob_sort_name glob_sort_expr
-type sort_info = (Libnames.qualid * int) option list
-type glob_sort = sort_info glob_sort_gen
+(** sort expressions *)
+type glob_sort = (glob_sort_name * int) list glob_sort_expr
+
+type glob_constraint = glob_sort_name * Univ.constraint_type * glob_sort_name
type glob_recarg = int option
diff --git a/pretyping/heads.ml b/pretyping/heads.ml
index ef27ca9b4e..d65faecd19 100644
--- a/pretyping/heads.ml
+++ b/pretyping/heads.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/heads.mli b/pretyping/heads.mli
index e5f9967590..bb096a846e 100644
--- a/pretyping/heads.mli
+++ b/pretyping/heads.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/indrec.ml b/pretyping/indrec.ml
index 7615a17514..e25ebad380 100644
--- a/pretyping/indrec.ml
+++ b/pretyping/indrec.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -84,7 +84,7 @@ let mis_make_case_com dep env sigma (ind, u as pind) (mib,mip as specif) kind =
let () = if Option.is_empty projs then check_privacy_block mib in
let () =
- if not (Sorts.List.mem kind (elim_sorts specif)) then
+ if not (Sorts.family_leq kind (elim_sort specif)) then
raise
(RecursionSchemeError
(env, NotAllowedCaseAnalysis (false, fst (UnivGen.fresh_sort_in_family kind), pind)))
@@ -557,8 +557,8 @@ let weaken_sort_scheme env evd set sort npars term ty =
let check_arities env listdepkind =
let _ = List.fold_left
(fun ln (((_,ni as mind),u),mibi,mipi,dep,kind) ->
- let kelim = elim_sorts (mibi,mipi) in
- if not (Sorts.List.mem kind kelim) then raise
+ let kelim = elim_sort (mibi,mipi) in
+ if not (Sorts.family_leq kind kelim) then raise
(RecursionSchemeError
(env, NotAllowedCaseAnalysis (true, fst (UnivGen.fresh_sort_in_family kind),(mind,u))))
else if Int.List.mem ni ln then raise
diff --git a/pretyping/indrec.mli b/pretyping/indrec.mli
index 8eb571a8be..ae23fc4ee6 100644
--- a/pretyping/indrec.mli
+++ b/pretyping/indrec.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/inductiveops.ml b/pretyping/inductiveops.ml
index b1c98da2c7..36b405e981 100644
--- a/pretyping/inductiveops.ml
+++ b/pretyping/inductiveops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -255,10 +255,13 @@ let inductive_has_local_defs env ind =
let l2 = mib.mind_nparams + mip.mind_nrealargs in
not (Int.equal l1 l2)
-let allowed_sorts env (kn,i as ind) =
+let top_allowed_sort env (kn,i as ind) =
let (mib,mip) = Inductive.lookup_mind_specif env ind in
mip.mind_kelim
+let sorts_below top =
+ List.filter (fun s -> Sorts.family_leq s top) Sorts.[InSProp;InProp;InSet;InType]
+
let has_dependent_elim mib =
match mib.mind_record with
| PrimRecord _ -> mib.mind_finite == BiFinite
diff --git a/pretyping/inductiveops.mli b/pretyping/inductiveops.mli
index cfc650938e..55eb74cacf 100644
--- a/pretyping/inductiveops.mli
+++ b/pretyping/inductiveops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -141,7 +141,9 @@ val constructor_nrealdecls_env : env -> constructor -> int
val constructor_has_local_defs : env -> constructor -> bool
val inductive_has_local_defs : env -> inductive -> bool
-val allowed_sorts : env -> inductive -> Sorts.family list
+val sorts_below : Sorts.family -> Sorts.family list
+
+val top_allowed_sort : env -> inductive -> Sorts.family
(** (Co)Inductive records with primitive projections do not have eta-conversion,
hence no dependent elimination. *)
diff --git a/pretyping/inferCumulativity.ml b/pretyping/inferCumulativity.ml
index 9f2397ec38..ed069eace0 100644
--- a/pretyping/inferCumulativity.ml
+++ b/pretyping/inferCumulativity.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/inferCumulativity.mli b/pretyping/inferCumulativity.mli
index 6e5bf30f6b..a234e334d1 100644
--- a/pretyping/inferCumulativity.mli
+++ b/pretyping/inferCumulativity.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/locus.ml b/pretyping/locus.ml
index 087a6b9174..afb4cc708a 100644
--- a/pretyping/locus.ml
+++ b/pretyping/locus.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/locusops.ml b/pretyping/locusops.ml
index aaa4ce684d..02c8f6a2a8 100644
--- a/pretyping/locusops.ml
+++ b/pretyping/locusops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/locusops.mli b/pretyping/locusops.mli
index ac15fe1018..195dbec935 100644
--- a/pretyping/locusops.mli
+++ b/pretyping/locusops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/nativenorm.ml b/pretyping/nativenorm.ml
index 0fcd6a9e9d..0c639b4328 100644
--- a/pretyping/nativenorm.ml
+++ b/pretyping/nativenorm.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/nativenorm.mli b/pretyping/nativenorm.mli
index 4997d0bf0d..02de034fcb 100644
--- a/pretyping/nativenorm.mli
+++ b/pretyping/nativenorm.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/pattern.ml b/pretyping/pattern.ml
index d1c0a4ea2a..e0beb383b5 100644
--- a/pretyping/pattern.ml
+++ b/pretyping/pattern.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/patternops.ml b/pretyping/patternops.ml
index c788efda48..3600f1761b 100644
--- a/pretyping/patternops.ml
+++ b/pretyping/patternops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -410,7 +410,9 @@ let rec pat_of_raw metas vars = DAst.with_loc_val (fun ?loc -> function
PLetIn (na, pat_of_raw metas vars c1,
Option.map (pat_of_raw metas vars) t,
pat_of_raw metas (na::vars) c2)
- | GSort gs -> PSort (Glob_ops.glob_sort_family gs)
+ | GSort gs ->
+ (try PSort (Glob_ops.glob_sort_family gs)
+ with Glob_ops.ComplexSort -> user_err ?loc (str "Unexpected universe in pattern."))
| GHole _ ->
PMeta None
| GCast (c,_) ->
diff --git a/pretyping/patternops.mli b/pretyping/patternops.mli
index 3821fbf1a0..304e06818e 100644
--- a/pretyping/patternops.mli
+++ b/pretyping/patternops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/pretype_errors.ml b/pretyping/pretype_errors.ml
index 35a7036af4..c1b05014c0 100644
--- a/pretyping/pretype_errors.ml
+++ b/pretyping/pretype_errors.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/pretype_errors.mli b/pretyping/pretype_errors.mli
index a9e2b0ea8f..af2d75a19d 100644
--- a/pretyping/pretype_errors.mli
+++ b/pretyping/pretype_errors.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -107,7 +107,7 @@ val error_ill_typed_rec_body :
val error_elim_arity :
?loc:Loc.t -> env -> Evd.evar_map ->
pinductive -> constr ->
- unsafe_judgment -> (Sorts.family list * Sorts.family * Sorts.family * arity_error) option -> 'b
+ unsafe_judgment -> (Sorts.family * Sorts.family * Sorts.family * arity_error) option -> 'b
val error_not_a_type :
?loc:Loc.t -> env -> Evd.evar_map -> unsafe_judgment -> 'b
diff --git a/pretyping/pretyping.ml b/pretyping/pretyping.ml
index f2b8671a48..280b6f9dae 100644
--- a/pretyping/pretyping.ml
+++ b/pretyping/pretyping.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -52,6 +52,18 @@ type typing_constraint = OfType of types | IsType | WithoutTypeConstraint
let (!!) env = GlobEnv.env env
+let bidi_hints =
+ Summary.ref (GlobRef.Map.empty : int GlobRef.Map.t) ~name:"bidirectionalityhints"
+
+let add_bidirectionality_hint gr n =
+ bidi_hints := GlobRef.Map.add gr n !bidi_hints
+
+let get_bidirectionality_hint gr =
+ GlobRef.Map.find_opt gr !bidi_hints
+
+let clear_bidirectionality_hint gr =
+ bidi_hints := GlobRef.Map.remove gr !bidi_hints
+
(************************************************************************)
(* This concerns Cases *)
open Inductive
@@ -120,7 +132,7 @@ let is_strict_universe_declarations =
(** Miscellaneous interpretation functions *)
-let interp_known_universe_level evd qid =
+let interp_known_universe_level_name evd qid =
try
let open Libnames in
if qualid_is_ident qid then Evd.universe_of_name evd @@ qualid_basename qid
@@ -130,7 +142,7 @@ let interp_known_universe_level evd qid =
Univ.Level.make qid
let interp_universe_level_name ~anon_rigidity evd qid =
- try evd, interp_known_universe_level evd qid
+ try evd, interp_known_universe_level_name evd qid
with Not_found ->
if Libnames.qualid_is_ident qid then (* Undeclared *)
let id = Libnames.qualid_basename qid in
@@ -152,44 +164,31 @@ let interp_universe_level_name ~anon_rigidity evd qid =
with UGraph.AlreadyDeclared -> evd
in evd, level
-let interp_universe ?loc evd = function
- | [] -> let evd, l = new_univ_level_variable ?loc univ_rigid evd in
- evd, Univ.Universe.make l
- | l ->
- List.fold_left (fun (evd, u) l ->
- let evd', u' =
- match l with
- | Some (l,n) ->
- (* [univ_flexible_alg] can produce algebraic universes in terms *)
- let anon_rigidity = univ_flexible in
- let evd', l = interp_universe_level_name ~anon_rigidity evd l in
- let u' = Univ.Universe.make l in
- (match n with
- | 0 -> evd', u'
- | 1 -> evd', Univ.Universe.super u'
- | _ ->
- user_err ?loc ~hdr:"interp_universe"
- (Pp.(str "Cannot interpret universe increment +" ++ int n)))
- | None ->
- let evd, l = new_univ_level_variable ?loc univ_flexible evd in
- evd, Univ.Universe.make l
+let interp_universe_name ?loc evd l =
+ (* [univ_flexible_alg] can produce algebraic universes in terms *)
+ let anon_rigidity = univ_flexible in
+ let evd', l = interp_universe_level_name ~anon_rigidity evd l in
+ evd', l
+
+let interp_sort_name ?loc sigma = function
+ | GSProp -> sigma, Univ.Level.sprop
+ | GProp -> sigma, Univ.Level.prop
+ | GSet -> sigma, Univ.Level.set
+ | GType l -> interp_universe_name ?loc sigma l
+
+let interp_sort_info ?loc evd l =
+ List.fold_left (fun (evd, u) (l,n) ->
+ let evd', u' = interp_sort_name ?loc evd l in
+ let u' = Univ.Universe.make u' in
+ let u' = match n with
+ | 0 -> u'
+ | 1 -> Univ.Universe.super u'
+ | n ->
+ user_err ?loc ~hdr:"interp_universe"
+ (Pp.(str "Cannot interpret universe increment +" ++ int n))
in (evd', Univ.sup u u'))
(evd, Univ.Universe.type0m) l
-let interp_known_level_info ?loc evd = function
- | UUnknown | UAnonymous ->
- user_err ?loc ~hdr:"interp_known_level_info"
- (str "Anonymous universes not allowed here.")
- | UNamed qid ->
- try interp_known_universe_level evd qid
- with Not_found ->
- user_err ?loc ~hdr:"interp_known_level_info" (str "Undeclared universe " ++ Libnames.pr_qualid qid)
-
-let interp_level_info ?loc evd : level_info -> _ = function
- | UUnknown -> new_univ_level_variable ?loc univ_rigid evd
- | UAnonymous -> new_univ_level_variable ?loc univ_flexible evd
- | UNamed s -> interp_universe_level_name ~anon_rigidity:univ_flexible evd s
-
type inference_hook = env -> evar_map -> Evar.t -> evar_map * constr
type inference_flags = {
@@ -403,13 +402,14 @@ let interp_known_glob_level ?loc evd = function
| GSProp -> Univ.Level.sprop
| GProp -> Univ.Level.prop
| GSet -> Univ.Level.set
- | GType s -> interp_known_level_info ?loc evd s
+ | GType qid ->
+ try interp_known_universe_level_name evd qid
+ with Not_found ->
+ user_err ?loc ~hdr:"interp_known_level_info" (str "Undeclared universe " ++ Libnames.pr_qualid qid)
let interp_glob_level ?loc evd : glob_level -> _ = function
- | GSProp -> evd, Univ.Level.sprop
- | GProp -> evd, Univ.Level.prop
- | GSet -> evd, Univ.Level.set
- | GType s -> interp_level_info ?loc evd s
+ | UAnonymous {rigid} -> new_univ_level_variable ?loc (if rigid then univ_rigid else univ_flexible) evd
+ | UNamed s -> interp_sort_name ?loc evd s
let interp_instance ?loc evd l =
let evd, l' =
@@ -448,18 +448,26 @@ let pretype_ref ?loc sigma env ref us =
let ty = unsafe_type_of !!env sigma c in
sigma, make_judge c ty
-let judge_of_Type ?loc evd s =
- let evd, s = interp_universe ?loc evd s in
+let interp_sort ?loc evd : glob_sort -> _ = function
+ | UAnonymous {rigid} ->
+ let evd, l = new_univ_level_variable ?loc (if rigid then univ_rigid else univ_flexible) evd in
+ evd, Univ.Universe.make l
+ | UNamed l -> interp_sort_info ?loc evd l
+
+let judge_of_sort ?loc evd s =
let judge =
{ uj_val = mkType s; uj_type = mkType (Univ.super s) }
in
evd, judge
-let pretype_sort ?loc sigma = function
- | GSProp -> sigma, judge_of_sprop
- | GProp -> sigma, judge_of_prop
- | GSet -> sigma, judge_of_set
- | GType s -> judge_of_Type ?loc sigma s
+let pretype_sort ?loc sigma s =
+ match s with
+ | UNamed [GSProp,0] -> sigma, judge_of_sprop
+ | UNamed [GProp,0] -> sigma, judge_of_prop
+ | UNamed [GSet,0] -> sigma, judge_of_set
+ | _ ->
+ let sigma, s = interp_sort ?loc sigma s in
+ judge_of_sort ?loc sigma s
let new_type_evar env sigma loc =
new_type_evar env sigma ~src:(Loc.tag ?loc Evar_kinds.InternalHole)
@@ -635,24 +643,36 @@ let rec pretype ~program_mode ~poly resolve_tc (tycon : type_constraint) (env :
let sigma, fj = pretype empty_tycon env sigma f in
let floc = loc_of_glob_constr f in
let length = List.length args in
+ let nargs_before_bidi =
+ (* if `f` is a global, we retrieve bidirectionality hints *)
+ try
+ let (gr,_) = destRef sigma fj.uj_val in
+ Option.default length @@ GlobRef.Map.find_opt gr !bidi_hints
+ with DestKO ->
+ length
+ in
let candargs =
- (* Bidirectional typechecking hint:
- parameters of a constructor are completely determined
- by a typing constraint *)
+ (* Bidirectional typechecking hint:
+ parameters of a constructor are completely determined
+ by a typing constraint *)
+ (* This bidirectionality machinery is the one of `Program` for
+ constructors and is orthogonal to bidirectionality hints. However, we
+ could probably factorize both by providing default bidirectionality hints
+ for constructors corresponding to their number of parameters. *)
if program_mode && length > 0 && isConstruct sigma fj.uj_val then
- match tycon with
- | None -> []
- | Some ty ->
+ match tycon with
+ | None -> []
+ | Some ty ->
let ((ind, i), u) = destConstruct sigma fj.uj_val in
let npars = inductive_nparams !!env ind in
- if Int.equal npars 0 then []
- else
- try
- let IndType (indf, args) = find_rectype !!env sigma ty in
- let ((ind',u'),pars) = dest_ind_family indf in
- if eq_ind ind ind' then List.map EConstr.of_constr pars
- else (* Let the usual code throw an error *) []
- with Not_found -> []
+ if Int.equal npars 0 then []
+ else
+ try
+ let IndType (indf, args) = find_rectype !!env sigma ty in
+ let ((ind',u'),pars) = dest_ind_family indf in
+ if eq_ind ind ind' then List.map EConstr.of_constr pars
+ else (* Let the usual code throw an error *) []
+ with Not_found -> []
else []
in
let app_f =
@@ -662,20 +682,29 @@ let rec pretype ~program_mode ~poly resolve_tc (tycon : type_constraint) (env :
let p = Projection.make p false in
let npars = Projection.npars p in
fun n ->
- if n == npars + 1 then fun _ v -> mkProj (p, v)
+ if Int.equal n npars then fun _ v -> mkProj (p, v)
else fun f v -> applist (f, [v])
| _ -> fun _ f v -> applist (f, [v])
in
- let rec apply_rec env sigma n resj candargs = function
- | [] -> sigma, resj
+ let rec apply_rec env sigma n resj candargs bidiargs = function
+ | [] -> sigma, resj, List.rev bidiargs
| c::rest ->
+ let bidi = n >= nargs_before_bidi in
let argloc = loc_of_glob_constr c in
let sigma, resj = Coercion.inh_app_fun ~program_mode resolve_tc !!env sigma resj in
let resty = whd_all !!env sigma resj.uj_type in
match EConstr.kind sigma resty with
| Prod (na,c1,c2) ->
let tycon = Some c1 in
- let sigma, hj = pretype tycon env sigma c in
+ let (sigma, hj), bidiargs =
+ if bidi && Option.has_some tycon then
+ (* We want to get some typing information from the context before
+ typing the argument, so we replace it by an existential
+ variable *)
+ let sigma, c_hole = new_evar env sigma ~src:(loc,Evar_kinds.InternalHole) c1 in
+ (sigma, make_judge c_hole c1), (c_hole, c) :: bidiargs
+ else pretype tycon env sigma c, bidiargs
+ in
let sigma, candargs, ujval =
match candargs with
| [] -> sigma, [], j_val hj
@@ -687,30 +716,45 @@ let rec pretype ~program_mode ~poly resolve_tc (tycon : type_constraint) (env :
sigma, args, nf_evar sigma (j_val hj)
end
in
- let sigma, ujval = adjust_evar_source sigma na.binder_name ujval in
- let value, typ = app_f n (j_val resj) ujval, subst1 ujval c2 in
- let j = { uj_val = value; uj_type = typ } in
- apply_rec env sigma (n+1) j candargs rest
- | _ ->
- let sigma, hj = pretype empty_tycon env sigma c in
- error_cant_apply_not_functional
- ?loc:(Loc.merge_opt floc argloc) !!env sigma resj [|hj|]
+ let sigma, ujval = adjust_evar_source sigma na.binder_name ujval in
+ let value, typ = app_f n (j_val resj) ujval, subst1 ujval c2 in
+ let j = { uj_val = value; uj_type = typ } in
+ apply_rec env sigma (n+1) j candargs bidiargs rest
+ | _ ->
+ let sigma, hj = pretype empty_tycon env sigma c in
+ error_cant_apply_not_functional
+ ?loc:(Loc.merge_opt floc argloc) !!env sigma resj [|hj|]
in
- let sigma, resj = apply_rec env sigma 1 fj candargs args in
+ let sigma, resj, bidiargs = apply_rec env sigma 0 fj candargs [] args in
let sigma, resj =
match EConstr.kind sigma resj.uj_val with
| App (f,args) ->
- if Termops.is_template_polymorphic_ind !!env sigma f then
- (* Special case for inductive type applications that must be
- refreshed right away. *)
- let c = mkApp (f, args) in
- let sigma, c = Evarsolve.refresh_universes (Some true) !!env sigma c in
- let t = Retyping.get_type_of !!env sigma c in
- sigma, make_judge c (* use this for keeping evars: resj.uj_val *) t
- else sigma, resj
+ if Termops.is_template_polymorphic_ind !!env sigma f then
+ (* Special case for inductive type applications that must be
+ refreshed right away. *)
+ let c = mkApp (f, args) in
+ let sigma, c = Evarsolve.refresh_universes (Some true) !!env sigma c in
+ let t = Retyping.get_type_of !!env sigma c in
+ sigma, make_judge c (* use this for keeping evars: resj.uj_val *) t
+ else sigma, resj
| _ -> sigma, resj
in
- inh_conv_coerce_to_tycon ?loc env sigma resj tycon
+ let sigma, t = inh_conv_coerce_to_tycon ?loc env sigma resj tycon in
+ let refine_arg sigma (newarg,origarg) =
+ (* Refine an argument (originally `origarg`) represented by an evar
+ (`newarg`) to use typing information from the context *)
+ (* Recover the expected type of the argument *)
+ let ty = Retyping.get_type_of !!env sigma newarg in
+ (* Type the argument using this expected type *)
+ let sigma, j = pretype (Some ty) env sigma origarg in
+ (* Unify the (possibly refined) existential variable with the
+ (typechecked) original value *)
+ Evarconv.unify_delay !!env sigma newarg (j_val j)
+ in
+ (* We now refine any arguments whose typing was delayed for
+ bidirectionality *)
+ let sigma = List.fold_left refine_arg sigma bidiargs in
+ (sigma, t)
| GLambda(name,bk,c1,c2) ->
let sigma, tycon' =
diff --git a/pretyping/pretyping.mli b/pretyping/pretyping.mli
index 1037cf6cc5..f9da568c75 100644
--- a/pretyping/pretyping.mli
+++ b/pretyping/pretyping.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -14,14 +14,24 @@
into elementary ones, insertion of coercions and resolution of
implicit arguments. *)
+open Names
open Environ
open Evd
open EConstr
open Glob_term
open Ltac_pretype
+val add_bidirectionality_hint : GlobRef.t -> int -> unit
+(** A bidirectionality hint `n` for a global `g` tells the pretyper to use
+ typing information from the context after typing the `n` for arguments of an
+ application of `g`. *)
+
+val get_bidirectionality_hint : GlobRef.t -> int option
+
+val clear_bidirectionality_hint : GlobRef.t -> unit
+
val interp_known_glob_level : ?loc:Loc.t -> Evd.evar_map ->
- glob_level -> Univ.Level.t
+ glob_sort_name -> Univ.Level.t
(** An auxiliary function for searching for fixpoint guard indexes *)
diff --git a/pretyping/program.ml b/pretyping/program.ml
index 7e38c09189..a15e66f329 100644
--- a/pretyping/program.ml
+++ b/pretyping/program.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/program.mli b/pretyping/program.mli
index a8f5115788..6604b3a854 100644
--- a/pretyping/program.mli
+++ b/pretyping/program.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -11,7 +11,7 @@
open Names
open EConstr
-(** A bunch of Coq constants used by Progam *)
+(** A bunch of Coq constants used by Program *)
val sig_typ : unit -> GlobRef.t
val sig_intro : unit -> GlobRef.t
diff --git a/pretyping/recordops.ml b/pretyping/recordops.ml
index a23c58c062..1b70119f20 100644
--- a/pretyping/recordops.ml
+++ b/pretyping/recordops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/recordops.mli b/pretyping/recordops.mli
index 25b6cd0751..3f64c06a2d 100644
--- a/pretyping/recordops.mli
+++ b/pretyping/recordops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/reductionops.ml b/pretyping/reductionops.ml
index 85e6f51387..d8f01c6bb5 100644
--- a/pretyping/reductionops.ml
+++ b/pretyping/reductionops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -886,7 +886,7 @@ module CredNative = RedNative(CNativeEntries)
(** Generic reduction function with environment
Here is where unfolded constant are stored in order to be
- eventualy refolded.
+ eventually refolded.
If tactic_mode is true, it uses ReductionBehaviour, prefers
refold constant instead of value and tries to infer constants
@@ -1315,7 +1315,7 @@ let whd_allnolet_stack env =
let whd_allnolet env =
red_of_state_red (whd_allnolet_state env)
-(* 4. Ad-hoc eta reduction, does not subsitute evars *)
+(* 4. Ad-hoc eta reduction, does not substitute evars *)
let shrink_eta c = Stack.zip Evd.empty (local_whd_state_gen eta Evd.empty (c,Stack.empty))
diff --git a/pretyping/reductionops.mli b/pretyping/reductionops.mli
index aa39921ea2..e72f5f2793 100644
--- a/pretyping/reductionops.mli
+++ b/pretyping/reductionops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/retyping.ml b/pretyping/retyping.ml
index 38e254a5b4..cc341afac3 100644
--- a/pretyping/retyping.ml
+++ b/pretyping/retyping.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/retyping.mli b/pretyping/retyping.mli
index 252bfb1a84..68a88df194 100644
--- a/pretyping/retyping.mli
+++ b/pretyping/retyping.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/tacred.ml b/pretyping/tacred.ml
index 231219c9de..6646dfb80c 100644
--- a/pretyping/tacred.ml
+++ b/pretyping/tacred.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/tacred.mli b/pretyping/tacred.mli
index 0887d0efd3..c05a6cde18 100644
--- a/pretyping/tacred.mli
+++ b/pretyping/tacred.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/typeclasses.ml b/pretyping/typeclasses.ml
index ee27aea93f..1d3e77452f 100644
--- a/pretyping/typeclasses.ml
+++ b/pretyping/typeclasses.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -62,7 +62,7 @@ type typeclass = {
(* Context of definitions and properties on defs, will not be shared *)
cl_props : Constr.rel_context;
- (* The method implementaions as projections. *)
+ (* The method implementations as projections. *)
cl_projs : (Name.t * (direction * hint_info) option
* Constant.t option) list;
diff --git a/pretyping/typeclasses.mli b/pretyping/typeclasses.mli
index e42b82c51f..787c722938 100644
--- a/pretyping/typeclasses.mli
+++ b/pretyping/typeclasses.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/typeclasses_errors.ml b/pretyping/typeclasses_errors.ml
index af5b3016c9..a335ba8b0b 100644
--- a/pretyping/typeclasses_errors.ml
+++ b/pretyping/typeclasses_errors.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -8,13 +8,9 @@
(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
-(*i*)
open Names
open EConstr
open Environ
-(*i*)
-
-type contexts = Parameters | Properties
type typeclass_error =
| NotAClass of constr
diff --git a/pretyping/typeclasses_errors.mli b/pretyping/typeclasses_errors.mli
index fd75781ed5..3b58b4a16e 100644
--- a/pretyping/typeclasses_errors.mli
+++ b/pretyping/typeclasses_errors.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -12,8 +12,6 @@ open Names
open EConstr
open Environ
-type contexts = Parameters | Properties
-
type typeclass_error =
| NotAClass of constr
| UnboundMethod of GlobRef.t * lident (** Class name, method *)
diff --git a/pretyping/typing.ml b/pretyping/typing.ml
index be71f44a5e..2db5512ff4 100644
--- a/pretyping/typing.ml
+++ b/pretyping/typing.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -117,12 +117,12 @@ let check_branch_types env sigma (ind,u) cj (lfj,explft) =
sigma lfj explft
let max_sort l =
- if Sorts.List.mem InType l then InType else
- if Sorts.List.mem InSet l then InSet else InProp
+ if List.mem_f Sorts.family_equal InType l then InType else
+ if List.mem_f Sorts.family_equal InSet l then InSet else InProp
let is_correct_arity env sigma c pj ind specif params =
let arsign = make_arity_signature env sigma true (make_ind_family (ind,params)) in
- let allowed_sorts = elim_sorts specif in
+ let allowed_sorts = sorts_below (elim_sort specif) in
let error () = Pretype_errors.error_elim_arity env sigma ind c pj None in
let rec srec env sigma pt ar =
let pt' = whd_all env sigma pt in
@@ -135,7 +135,7 @@ let is_correct_arity env sigma c pj ind specif params =
end
| Sort s, [] ->
let s = ESorts.kind sigma s in
- if not (Sorts.List.mem (Sorts.family s) allowed_sorts)
+ if not (List.mem_f Sorts.family_equal (Sorts.family s) allowed_sorts)
then error ()
else sigma, s
| Evar (ev,_), [] ->
@@ -199,13 +199,13 @@ let check_type_fixpoint ?loc env sigma lna lar vdefj =
(* FIXME: might depend on the level of actual parameters!*)
let check_allowed_sort env sigma ind c p =
let specif = lookup_mind_specif env (fst ind) in
- let sorts = elim_sorts specif in
+ let sorts = elim_sort specif in
let pj = Retyping.get_judgment_of env sigma p in
let _, s = splay_prod env sigma pj.uj_type in
let ksort = match EConstr.kind sigma s with
| Sort s -> Sorts.family (ESorts.kind sigma s)
| _ -> error_elim_arity env sigma ind c pj None in
- if not (List.exists ((==) ksort) sorts) then
+ if not (Sorts.family_leq ksort sorts) then
let s = inductive_sort_family (snd specif) in
error_elim_arity env sigma ind c pj
(Some(sorts,ksort,s,Type_errors.error_elim_explain ksort s))
diff --git a/pretyping/typing.mli b/pretyping/typing.mli
index f68820429b..63fb0679f1 100644
--- a/pretyping/typing.mli
+++ b/pretyping/typing.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/unification.ml b/pretyping/unification.ml
index d134c7319f..00831b5962 100644
--- a/pretyping/unification.ml
+++ b/pretyping/unification.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -1219,12 +1219,12 @@ let merge_instances env sigma flags st1 st2 c1 c2 =
* bindings. This may or may not close off all RHSs of
* the EVARs. For each EVAR whose RHS is closed off,
* we can just apply it, and go on. For each which
- * is not closed off, we need to do a mimick step -
+ * is not closed off, we need to do a mimic step -
* in general, we have something like:
*
* ?X == (c e1 e2 ... ei[Meta(k)] ... en)
*
- * so we need to do a mimick step, converting ?X
+ * so we need to do a mimic step, converting ?X
* into
*
* ?X -> (c ?z1 ... ?zn)
@@ -1247,7 +1247,7 @@ let merge_instances env sigma flags st1 st2 c1 c2 =
* we can reverse the equation, put it into our metavar
* substitution, and keep going.
*
- * The most efficient mimick possible is, for each
+ * The most efficient mimic possible is, for each
* Meta-var remaining in the term, to declare a
* new EVAR of the same type. This is supposedly
* determinable from the clausale form context -
diff --git a/pretyping/unification.mli b/pretyping/unification.mli
index a45b8f1dd8..0ee71246d8 100644
--- a/pretyping/unification.mli
+++ b/pretyping/unification.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/vnorm.ml b/pretyping/vnorm.ml
index 1fe6545ce4..da0a92f284 100644
--- a/pretyping/vnorm.ml
+++ b/pretyping/vnorm.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/pretyping/vnorm.mli b/pretyping/vnorm.mli
index 3e0eabb013..07f1696032 100644
--- a/pretyping/vnorm.mli
+++ b/pretyping/vnorm.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/printing/genprint.ml b/printing/genprint.ml
index 2f0f7f48c9..a04df31d30 100644
--- a/printing/genprint.ml
+++ b/printing/genprint.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/printing/genprint.mli b/printing/genprint.mli
index 24b008643b..21b8417ffa 100644
--- a/printing/genprint.mli
+++ b/printing/genprint.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/printing/ppconstr.ml b/printing/ppconstr.ml
index 9d3ed40f6c..aea4f23205 100644
--- a/printing/ppconstr.ml
+++ b/printing/ppconstr.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -157,10 +157,14 @@ let tag_var = tag Tag.variable
let pr_sep_com sep f c = pr_with_comments ?loc:(constr_loc c) (sep() ++ f c)
- let pr_univ_expr = function
- | Some (x,n) ->
- pr_qualid x ++ (match n with 0 -> mt () | _ -> str"+" ++ int n)
- | None -> str"_"
+ let pr_glob_sort_name = function
+ | GSProp -> str "SProp"
+ | GProp -> str "Prop"
+ | GSet -> str "Set"
+ | GType qid -> pr_qualid qid
+
+ let pr_univ_expr (u,n) =
+ pr_glob_sort_name u ++ (match n with 0 -> mt () | _ -> str"+" ++ int n)
let pr_univ l =
match l with
@@ -170,19 +174,20 @@ let tag_var = tag Tag.variable
let pr_univ_annot pr x = str "@{" ++ pr x ++ str "}"
let pr_glob_sort = let open Glob_term in function
- | GSProp -> tag_type (str "SProp")
- | GProp -> tag_type (str "Prop")
- | GSet -> tag_type (str "Set")
- | GType [] -> tag_type (str "Type")
- | GType u -> hov 0 (tag_type (str "Type") ++ pr_univ_annot pr_univ u)
+ | UNamed [GSProp,0] -> tag_type (str "SProp")
+ | UNamed [GProp,0] -> tag_type (str "Prop")
+ | UNamed [GSet,0] -> tag_type (str "Set")
+ | UAnonymous {rigid=true} -> tag_type (str "Type")
+ | UAnonymous {rigid=false} -> tag_type (str "Type") ++ pr_univ_annot (fun _ -> str "_") ()
+ | UNamed u -> hov 0 (tag_type (str "Type") ++ pr_univ_annot pr_univ u)
let pr_glob_level = let open Glob_term in function
- | GSProp -> tag_type (str "SProp")
- | GProp -> tag_type (str "Prop")
- | GSet -> tag_type (str "Set")
- | GType UUnknown -> tag_type (str "Type")
- | GType UAnonymous -> tag_type (str "_")
- | GType (UNamed u) -> tag_type (pr_qualid u)
+ | UNamed GSProp -> tag_type (str "SProp")
+ | UNamed GProp -> tag_type (str "Prop")
+ | UNamed GSet -> tag_type (str "Set")
+ | UAnonymous {rigid=true} -> tag_type (str "Type")
+ | UAnonymous {rigid=false} -> tag_type (str "_")
+ | UNamed (GType u) -> tag_type (pr_qualid u)
let pr_qualid sp =
let (sl, id) = repr_qualid sp in
@@ -199,21 +204,8 @@ let tag_var = tag Tag.variable
let pr_qualid = pr_qualid
let pr_patvar = pr_id
- let pr_glob_sort_instance = let open Glob_term in function
- | GSProp ->
- tag_type (str "SProp")
- | GProp ->
- tag_type (str "Prop")
- | GSet ->
- tag_type (str "Set")
- | GType u ->
- (match u with
- | UNamed u -> pr_qualid u
- | UAnonymous -> tag_type (str "Type")
- | UUnknown -> tag_type (str "_"))
-
let pr_universe_instance l =
- pr_opt_no_spc (pr_univ_annot (prlist_with_sep spc pr_glob_sort_instance)) l
+ pr_opt_no_spc (pr_univ_annot (prlist_with_sep spc pr_glob_level)) l
let pr_reference qid =
if qualid_is_ident qid then tag_var (pr_id @@ qualid_basename qid)
@@ -249,7 +241,7 @@ let tag_var = tag Tag.variable
str"@{" ++ hov 0 (prlist_with_sep pr_semicolon f (List.rev l)) ++ str"}"))
let las = lapp
- let lpator = 100
+ let lpator = 0
let lpatrec = 0
let rec pr_patt sep inh p =
@@ -283,7 +275,8 @@ let tag_var = tag Tag.variable
pr_reference r, latom
| CPatOr pl ->
- hov 0 (prlist_with_sep pr_spcbar (pr_patt mt (lpator,L)) pl), lpator
+ let pp = pr_patt mt (lpator,Any) in
+ surround (hov 0 (prlist_with_sep pr_spcbar pp pl)), lpator
| CPatNotation ((_,"( _ )"),([p],[]),[]) ->
pr_patt (fun()->str"(") (max_int,E) p ++ str")", latom
@@ -348,7 +341,7 @@ let tag_var = tag Tag.variable
hov 1 (str "`" ++ (surround_impl b'
(pr_lident CAst.(make ?loc id) ++ str " : " ++
(if t' then str "!" else mt()) ++ pr t)))
- |_ -> anomaly (Pp.str "List of generalized binders have alwais one element.")
+ |_ -> anomaly (Pp.str "List of generalized binders have always one element.")
end
| Default b ->
match t with
diff --git a/printing/ppconstr.mli b/printing/ppconstr.mli
index 1332cd0168..c17ca251a8 100644
--- a/printing/ppconstr.mli
+++ b/printing/ppconstr.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -33,6 +33,7 @@ val pr_id : Id.t -> Pp.t
val pr_qualid : qualid -> Pp.t
val pr_patvar : Pattern.patvar -> Pp.t
+val pr_glob_sort_name : Glob_term.glob_sort_name -> Pp.t
val pr_glob_level : Glob_term.glob_level -> Pp.t
val pr_glob_sort : Glob_term.glob_sort -> Pp.t
val pr_guard_annot
diff --git a/printing/pputils.ml b/printing/pputils.ml
index fff6dae1b4..5ec2f93cd8 100644
--- a/printing/pputils.ml
+++ b/printing/pputils.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/printing/pputils.mli b/printing/pputils.mli
index d0f3e61eac..f260c4a373 100644
--- a/printing/pputils.mli
+++ b/printing/pputils.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/printing/prettyp.ml b/printing/prettyp.ml
index 9541ea5882..a2bdb30773 100644
--- a/printing/prettyp.ml
+++ b/printing/prettyp.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -304,6 +304,12 @@ let print_inductive_argument_scopes =
print_args_data_of_inductive_ids
Notation.find_arguments_scope (Option.has_some) print_argument_scopes
+let print_bidi_hints gr =
+ match Pretyping.get_bidirectionality_hint gr with
+ | None -> []
+ | Some nargs ->
+ [str "Using typing information from context after typing the " ++ int nargs ++ str " first arguments"]
+
(*********************)
(* "Locate" commands *)
@@ -549,7 +555,7 @@ let print_instance sigma cb =
let print_constant with_values sep sp udecl =
let cb = Global.lookup_constant sp in
- let val_0 = Global.body_of_constant_body cb in
+ let val_0 = Global.body_of_constant_body Library.indirect_accessor cb in
let typ = cb.const_type in
let univs =
let open Univ in
@@ -557,7 +563,7 @@ let print_constant with_values sep sp udecl =
match cb.const_body with
| Undef _ | Def _ | Primitive _ -> cb.const_universes
| OpaqueDef o ->
- let body_uctxs = Opaqueproof.force_constraints otab o in
+ let body_uctxs = Opaqueproof.force_constraints Library.indirect_accessor otab o in
match cb.const_universes with
| Monomorphic ctx ->
Monomorphic (ContextSet.union body_uctxs ctx)
@@ -577,11 +583,15 @@ let print_constant with_values sep sp udecl =
str"*** [ " ++
print_basename sp ++ print_instance sigma cb ++ str " : " ++ cut () ++ pr_ltype typ ++
str" ]" ++
- Printer.pr_universes sigma univs ?priv:cb.const_private_poly_univs
- | Some (c, ctx) ->
+ Printer.pr_universes sigma univs
+ | Some (c, priv, ctx) ->
+ let priv = match priv with
+ | Opaqueproof.PrivateMonomorphic () -> None
+ | Opaqueproof.PrivatePolymorphic (_, ctx) -> Some ctx
+ in
print_basename sp ++ print_instance sigma cb ++ str sep ++ cut () ++
(if with_values then print_typed_body env sigma (Some c,typ) else pr_ltype typ)++
- Printer.pr_universes sigma univs ?priv:cb.const_private_poly_univs)
+ Printer.pr_universes sigma univs ?priv)
let gallina_print_constant_with_infos sp udecl =
print_constant true " = " sp udecl ++
@@ -717,7 +727,7 @@ let print_full_pure_context env sigma =
| OpaqueDef lc ->
str "Theorem " ++ print_basename con ++ cut () ++
str " : " ++ pr_ltype_env env sigma typ ++ str "." ++ fnl () ++
- str "Proof " ++ pr_lconstr_env env sigma (Opaqueproof.force_proof (Global.opaque_tables ()) lc)
+ str "Proof " ++ pr_lconstr_env env sigma (fst (Opaqueproof.force_proof Library.indirect_accessor (Global.opaque_tables ()) lc))
| Def c ->
str "Definition " ++ print_basename con ++ cut () ++
str " : " ++ pr_ltype_env env sigma typ ++ cut () ++ str " := " ++
@@ -841,7 +851,8 @@ let print_about_any ?loc env sigma k udecl =
print_name_infos ref @
(if Pp.ismt rb then [] else [rb]) @
print_opacity ref @
- [hov 0 (str "Expands to: " ++ pr_located_qualid k)])
+ print_bidi_hints ref @
+ [hov 0 (str "Expands to: " ++ pr_located_qualid k)])
| Syntactic kn ->
let () = match Syntax_def.search_syntactic_definition kn with
| [],Notation_term.NRef ref -> Dumpglob.add_glob ?loc ref
diff --git a/printing/prettyp.mli b/printing/prettyp.mli
index 9213bc8561..7485f4bd19 100644
--- a/printing/prettyp.mli
+++ b/printing/prettyp.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/printing/printer.ml b/printing/printer.ml
index 2951d8e5c8..0bcea3b01c 100644
--- a/printing/printer.ml
+++ b/printing/printer.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/printing/printer.mli b/printing/printer.mli
index 4e27268c4d..4923e9ec0e 100644
--- a/printing/printer.mli
+++ b/printing/printer.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/printing/printmod.ml b/printing/printmod.ml
index bd97104f60..74d4f69c9c 100644
--- a/printing/printmod.ml
+++ b/printing/printmod.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -297,7 +297,7 @@ let print_body is_impl extent env mp (l,body) =
hov 2 (str ":= " ++
Printer.pr_lconstr_env env sigma (Mod_subst.force_constr l))
| _ -> mt ()) ++ str "." ++
- Printer.pr_abstract_universe_ctx sigma ctx ?priv:cb.const_private_poly_univs)
+ Printer.pr_abstract_universe_ctx sigma ctx)
| SFBmind mib ->
match extent with
| WithContents ->
diff --git a/printing/printmod.mli b/printing/printmod.mli
index 48ba866cc0..8fd1cb4183 100644
--- a/printing/printmod.mli
+++ b/printing/printmod.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/printing/proof_diffs.ml b/printing/proof_diffs.ml
index f378a5d2dd..233163d097 100644
--- a/printing/proof_diffs.ml
+++ b/printing/proof_diffs.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -408,7 +408,7 @@ the call to db_goal_map and entering the following:
let match_goals ot nt =
let nevar_to_oevar = ref StringMap.empty in
(* ogname is "" when there is no difference on the current path.
- It's set to the old goal's evar name once a rewitten goal is found,
+ It's set to the old goal's evar name once a rewritten goal is found,
at which point the code only searches for the replacing goals
(and ot is set to nt). *)
let iter2 f l1 l2 =
diff --git a/printing/proof_diffs.mli b/printing/proof_diffs.mli
index fd10eaa458..f6fca91eea 100644
--- a/printing/proof_diffs.mli
+++ b/printing/proof_diffs.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/clenv.ml b/proofs/clenv.ml
index 2d2113b636..0dcc55a1cb 100644
--- a/proofs/clenv.ml
+++ b/proofs/clenv.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/clenv.mli b/proofs/clenv.mli
index 03acb9e46e..eecd318287 100644
--- a/proofs/clenv.mli
+++ b/proofs/clenv.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/clenvtac.ml b/proofs/clenvtac.ml
index c36b0fa337..1904d9b112 100644
--- a/proofs/clenvtac.ml
+++ b/proofs/clenvtac.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -19,7 +19,7 @@ open Reduction
open Clenv
(* This function put casts around metavariables whose type could not be
- * infered by the refiner, that is head of applications, predicates and
+ * inferred by the refiner, that is head of applications, predicates and
* subject of Cases.
* Does check that the casted type is closed. Anyway, the refiner would
* fail in this case... *)
diff --git a/proofs/clenvtac.mli b/proofs/clenvtac.mli
index d178478425..2357a1fe30 100644
--- a/proofs/clenvtac.mli
+++ b/proofs/clenvtac.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/evar_refiner.ml b/proofs/evar_refiner.ml
index 1a34105ab6..6c9c95e342 100644
--- a/proofs/evar_refiner.ml
+++ b/proofs/evar_refiner.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/evar_refiner.mli b/proofs/evar_refiner.mli
index e8f3c4d173..8f3ac7ed25 100644
--- a/proofs/evar_refiner.mli
+++ b/proofs/evar_refiner.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/goal.ml b/proofs/goal.ml
index 94707accab..888c4785df 100644
--- a/proofs/goal.ml
+++ b/proofs/goal.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/goal.mli b/proofs/goal.mli
index 665b0c9e59..46b54f9c2c 100644
--- a/proofs/goal.mli
+++ b/proofs/goal.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/goal_select.ml b/proofs/goal_select.ml
index 955d797227..a6e27c238f 100644
--- a/proofs/goal_select.ml
+++ b/proofs/goal_select.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/goal_select.mli b/proofs/goal_select.mli
index b1c5723885..c322ace9f3 100644
--- a/proofs/goal_select.mli
+++ b/proofs/goal_select.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/logic.ml b/proofs/logic.ml
index b79e1e6024..a9843e080e 100644
--- a/proofs/logic.ml
+++ b/proofs/logic.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/logic.mli b/proofs/logic.mli
index 406fe57985..1046fd8b29 100644
--- a/proofs/logic.mli
+++ b/proofs/logic.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/miscprint.ml b/proofs/miscprint.ml
index ec17b8076f..1092e290c7 100644
--- a/proofs/miscprint.ml
+++ b/proofs/miscprint.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/miscprint.mli b/proofs/miscprint.mli
index f4e2e683d1..70a3726605 100644
--- a/proofs/miscprint.mli
+++ b/proofs/miscprint.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/pfedit.ml b/proofs/pfedit.ml
index 52e15f466f..cb4eabcc85 100644
--- a/proofs/pfedit.ml
+++ b/proofs/pfedit.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -11,7 +11,6 @@
open Pp
open Util
open Names
-open Entries
open Environ
open Evd
@@ -42,11 +41,11 @@ let get_goal_context_gen pf i =
(sigma, Refiner.pf_env { it=goal ; sigma=sigma; })
let get_goal_context pf i =
- let p = Proof_global.give_me_the_proof pf in
+ let p = Proof_global.get_proof pf in
get_goal_context_gen p i
let get_current_goal_context pf =
- let p = Proof_global.give_me_the_proof pf in
+ let p = Proof_global.get_proof pf in
try get_goal_context_gen p 1
with
| NoSuchGoal ->
@@ -57,7 +56,7 @@ let get_current_goal_context pf =
Evd.from_env env, env
let get_current_context pf =
- let p = Proof_global.give_me_the_proof pf in
+ let p = Proof_global.get_proof pf in
try get_goal_context_gen p 1
with
| NoSuchGoal ->
@@ -108,7 +107,7 @@ let solve ?with_end_tac gi info_lvl tac pr =
in
(p,status)
-let by tac = Proof_global.with_current_proof (fun _ -> solve (Goal_select.SelectNth 1) None tac)
+let by tac = Proof_global.map_fold_proof (solve (Goal_select.SelectNth 1) None tac)
(**********************************************************************)
(* Shortcut to build a term using tactics *)
@@ -117,18 +116,17 @@ open Decl_kinds
let next = let n = ref 0 in fun () -> incr n; !n
-let build_constant_by_tactic id ctx sign ?(goal_kind = Global, false, Proof Theorem) typ tac =
+let build_constant_by_tactic id ctx sign ?(goal_kind = Global ImportDefaultBehavior, false, Proof Theorem) typ tac =
let evd = Evd.from_ctx ctx in
- let terminator = Proof_global.make_terminator (fun _ -> ()) in
let goals = [ (Global.env_of_context sign , typ) ] in
- let pf = Proof_global.start_proof ~ontop:None evd id goal_kind goals terminator in
+ let pf = Proof_global.start_proof evd id goal_kind goals in
try
let pf, status = by tac pf in
let open Proof_global in
- let { entries; universes } = fst @@ close_proof ~opaque:Transparent ~keep_body_ucst_separate:false (fun x -> x) pf in
+ let { entries; universes } = close_proof ~opaque:Transparent ~keep_body_ucst_separate:false (fun x -> x) pf in
match entries with
| [entry] ->
- let univs = UState.demote_seff_univs entry universes in
+ let univs = UState.demote_seff_univs entry.Proof_global.proof_entry_universes universes in
entry, status, univs
| _ ->
CErrors.anomaly Pp.(str "[build_constant_by_tactic] close_proof returned more than one proof term")
@@ -139,15 +137,14 @@ let build_constant_by_tactic id ctx sign ?(goal_kind = Global, false, Proof Theo
let build_by_tactic ?(side_eff=true) env sigma ?(poly=false) typ tac =
let id = Id.of_string ("temporary_proof"^string_of_int (next())) in
let sign = val_of_named_context (named_context env) in
- let gk = Global, poly, Proof Theorem in
+ let gk = Global ImportDefaultBehavior, poly, Proof Theorem in
let ce, status, univs =
build_constant_by_tactic id sigma sign ~goal_kind:gk typ tac in
- let ce =
- if side_eff then Safe_typing.inline_private_constants_in_definition_entry env ce
- else { ce with
- const_entry_body = Future.chain ce.const_entry_body
- (fun (pt, _) -> pt, ()) } in
- let (cb, ctx), () = Future.force ce.const_entry_body in
+ let body, eff = Future.force ce.Proof_global.proof_entry_body in
+ let (cb, ctx) =
+ if side_eff then Safe_typing.inline_private_constants env (body, eff.Evd.seff_private)
+ else body
+ in
let univs = UState.merge ~sideff:side_eff ~extend:true Evd.univ_rigid univs ctx in
cb, status, univs
@@ -197,5 +194,6 @@ let refine_by_tactic ~name ~poly env sigma ty tac =
other goals that were already present during its invocation, so that
those goals rely on effects that are not present anymore. Hopefully,
this hack will work in most cases. *)
- let ans = Safe_typing.inline_private_constants_in_constr env ans neff in
+ let neff = neff.Evd.seff_private in
+ let (ans, _) = Safe_typing.inline_private_constants env ((ans, Univ.ContextSet.empty), neff) in
ans, sigma
diff --git a/proofs/pfedit.mli b/proofs/pfedit.mli
index 77d701b41f..d01704926a 100644
--- a/proofs/pfedit.mli
+++ b/proofs/pfedit.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -61,7 +61,7 @@ val use_unification_heuristics : unit -> bool
val build_constant_by_tactic :
Id.t -> UState.t -> named_context_val -> ?goal_kind:goal_kind ->
EConstr.types -> unit Proofview.tactic ->
- Safe_typing.private_constants Entries.definition_entry * bool *
+ Evd.side_effects Proof_global.proof_entry * bool *
UState.t
val build_by_tactic : ?side_eff:bool -> env -> UState.t -> ?poly:polymorphic ->
diff --git a/proofs/proof.ml b/proofs/proof.ml
index 09e4e898fe..47502fe402 100644
--- a/proofs/proof.ml
+++ b/proofs/proof.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/proof.mli b/proofs/proof.mli
index 248b9d921e..6ef34eed80 100644
--- a/proofs/proof.mli
+++ b/proofs/proof.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/proof_bullet.ml b/proofs/proof_bullet.ml
index 640feb2f5b..5702156b65 100644
--- a/proofs/proof_bullet.ml
+++ b/proofs/proof_bullet.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/proof_bullet.mli b/proofs/proof_bullet.mli
index 6fdf818497..ef4530a363 100644
--- a/proofs/proof_bullet.mli
+++ b/proofs/proof_bullet.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/proofs/proof_global.ml b/proofs/proof_global.ml
index 40ae4acc88..4490fbdd64 100644
--- a/proofs/proof_global.ml
+++ b/proofs/proof_global.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -24,62 +24,45 @@ module NamedDecl = Context.Named.Declaration
(*** Proof Global Environment ***)
-(* Extra info on proofs. *)
-type lemma_possible_guards = int list list
+type 'a proof_entry = {
+ proof_entry_body : 'a Entries.const_entry_body;
+ (* List of section variables *)
+ proof_entry_secctx : Constr.named_context option;
+ (* State id on which the completion of type checking is reported *)
+ proof_entry_feedback : Stateid.t option;
+ proof_entry_type : Constr.types option;
+ proof_entry_universes : Entries.universes_entry;
+ proof_entry_opaque : bool;
+ proof_entry_inline_code : bool;
+}
type proof_object = {
id : Names.Id.t;
- entries : Safe_typing.private_constants Entries.definition_entry list;
+ entries : Evd.side_effects proof_entry list;
persistence : Decl_kinds.goal_kind;
universes: UState.t;
}
type opacity_flag = Opaque | Transparent
-type proof_ending =
- | Admitted of Names.Id.t * Decl_kinds.goal_kind * Entries.parameter_entry * UState.t
- | Proved of opacity_flag *
- lident option *
- proof_object
-
-type proof_terminator = proof_ending -> unit
-type closed_proof = proof_object * proof_terminator
-
-type pstate = {
- terminator : proof_terminator CEphemeron.key;
- endline_tactic : Genarg.glob_generic_argument option;
- section_vars : Constr.named_context option;
- proof : Proof.t;
- universe_decl: UState.universe_decl;
- strength : Decl_kinds.goal_kind;
-}
-
-(* The head of [t] is the actual current proof, the other ones are
- to be resumed when the current proof is closed or aborted. *)
-type t = pstate * pstate list
-
-let pstate_map f (pf, pfl) = (f pf, List.map f pfl)
-
-let make_terminator f = f
-let apply_terminator f = f
-
-(* combinators for the current_proof lists *)
-let push ~ontop a =
- match ontop with
- | None -> a , []
- | Some (l,ls) -> a, (l :: ls)
+type t =
+ { endline_tactic : Genarg.glob_generic_argument option
+ ; section_vars : Constr.named_context option
+ ; proof : Proof.t
+ ; universe_decl: UState.universe_decl
+ ; strength : Decl_kinds.goal_kind
+ }
(*** Proof Global manipulation ***)
-let get_all_proof_names (pf : t) =
- let (pn, pns) = pstate_map Proof.(function pf -> (data pf.proof).name) pf in
- pn :: pns
+let get_proof ps = ps.proof
+let get_proof_name ps = (Proof.data ps.proof).Proof.name
+let get_persistence ps = ps.strength
-let give_me_the_proof (ps,_) = ps.proof
-let get_current_proof_name (ps,_) = (Proof.data ps.proof).Proof.name
-let get_current_persistence (ps,_) = ps.strength
+let map_proof f p = { p with proof = f p.proof }
+let map_fold_proof f p = let proof, res = f p.proof in { p with proof }, res
-let with_current_proof f (ps, psl) =
+let map_fold_proof_endline f ps =
let et =
match ps.endline_tactic with
| None -> Proofview.tclUNIT ()
@@ -92,30 +75,15 @@ let with_current_proof f (ps, psl) =
in
let (newpr,ret) = f et ps.proof in
let ps = { ps with proof = newpr } in
- (ps, psl), ret
-
-let simple_with_current_proof f pf =
- let p, () = with_current_proof (fun t p -> f t p , ()) pf in p
+ ps, ret
-let compact_the_proof pf = simple_with_current_proof (fun _ -> Proof.compact) pf
+let compact_the_proof pf = map_proof Proof.compact pf
(* Sets the tactic to be used when a tactic line is closed with [...] *)
-let set_endline_tactic tac (ps, psl) =
- { ps with endline_tactic = Some tac }, psl
-
-let pf_name_eq id ps =
- let Proof.{ name } = Proof.data ps.proof in
- Id.equal name id
-
-let discard {CAst.loc;v=id} (ps, psl) =
- match List.filter (fun pf -> not (pf_name_eq id pf)) (ps :: psl) with
- | [] -> None
- | ps :: psl -> Some (ps, psl)
-
-let discard_current (ps, psl) =
- if List.is_empty psl then None else Some List.(hd psl, tl psl)
+let set_endline_tactic tac ps =
+ { ps with endline_tactic = Some tac }
-(** [start_proof sigma id pl str goals terminator] starts a proof of name
+(** [start_proof sigma id pl str goals] starts a proof of name
[id] with goals [goals] (a list of pairs of environment and
conclusion); [str] describes what kind of theorem/definition this
is (spiwack: for potential printing, I believe is used only by
@@ -123,30 +91,26 @@ let discard_current (ps, psl) =
end of the proof to close the proof. The proof is started in the
evar map [sigma] (which can typically contain universe
constraints), and with universe bindings pl. *)
-let start_proof ~ontop sigma name ?(pl=UState.default_univ_decl) kind goals terminator =
- let initial_state = {
- terminator = CEphemeron.create terminator;
- proof = Proof.start ~name ~poly:(pi2 kind) sigma goals;
- endline_tactic = None;
- section_vars = None;
- universe_decl = pl;
- strength = kind } in
- push ~ontop initial_state
-
-let start_dependent_proof ~ontop name ?(pl=UState.default_univ_decl) kind goals terminator =
- let initial_state = {
- terminator = CEphemeron.create terminator;
- proof = Proof.dependent_start ~name ~poly:(pi2 kind) goals;
- endline_tactic = None;
- section_vars = None;
- universe_decl = pl;
- strength = kind } in
- push ~ontop initial_state
-
-let get_used_variables (pf,_) = pf.section_vars
-let get_universe_decl (pf,_) = pf.universe_decl
-
-let set_used_variables (ps,psl) l =
+let start_proof sigma name ?(pl=UState.default_univ_decl) kind goals =
+ { proof = Proof.start ~name ~poly:(pi2 kind) sigma goals
+ ; endline_tactic = None
+ ; section_vars = None
+ ; universe_decl = pl
+ ; strength = kind
+ }
+
+let start_dependent_proof name ?(pl=UState.default_univ_decl) kind goals =
+ { proof = Proof.dependent_start ~name ~poly:(pi2 kind) goals
+ ; endline_tactic = None
+ ; section_vars = None
+ ; universe_decl = pl
+ ; strength = kind
+ }
+
+let get_used_variables pf = pf.section_vars
+let get_universe_decl pf = pf.universe_decl
+
+let set_used_variables ps l =
let open Context.Named.Declaration in
let env = Global.env () in
let ids = List.fold_right Id.Set.add l Id.Set.empty in
@@ -170,16 +134,16 @@ let set_used_variables (ps,psl) l =
if not (Option.is_empty ps.section_vars) then
CErrors.user_err Pp.(str "Used section variables can be declared only once");
(* EJGA: This is always empty thus we should modify the type *)
- (ctx, []), ({ ps with section_vars = Some ctx}, psl)
+ (ctx, []), { ps with section_vars = Some ctx}
-let get_open_goals (ps, _) =
+let get_open_goals ps =
let Proof.{ goals; stack; shelf } = Proof.data ps.proof in
List.length goals +
List.fold_left (+) 0
(List.map (fun (l1,l2) -> List.length l1 + List.length l2) stack) +
List.length shelf
-type closed_proof_output = (Constr.t * Safe_typing.private_constants) list * UState.t
+type closed_proof_output = (Constr.t * Evd.side_effects) list * UState.t
let private_poly_univs =
let b = ref true in
@@ -195,7 +159,7 @@ let private_poly_univs =
let close_proof ~opaque ~keep_body_ucst_separate ?feedback_id ~now
(fpl : closed_proof_output Future.computation) ps =
- let { section_vars; proof; terminator; universe_decl; strength } = ps in
+ let { section_vars; proof; universe_decl; strength } = ps in
let Proof.{ name; poly; entry; initial_euctx } = Proof.data proof in
let opaque = match opaque with Opaque -> true | Transparent -> false in
let constrain_variables ctx =
@@ -217,7 +181,7 @@ let close_proof ~opaque ~keep_body_ucst_separate ?feedback_id ~now
let body = c in
let allow_deferred =
not poly && (keep_body_ucst_separate ||
- not (Safe_typing.empty_private_constants = eff))
+ not (Safe_typing.empty_private_constants = eff.Evd.seff_private))
in
let typ = if allow_deferred then t else nf t in
let used_univs_body = Vars.universes_of_constr body in
@@ -279,21 +243,20 @@ let close_proof ~opaque ~keep_body_ucst_separate ?feedback_id ~now
let t = EConstr.Unsafe.to_constr t in
let univstyp, body = make_body t p in
let univs, typ = Future.force univstyp in
- {Entries.
- const_entry_body = body;
- const_entry_secctx = section_vars;
- const_entry_feedback = feedback_id;
- const_entry_type = Some typ;
- const_entry_inline_code = false;
- const_entry_opaque = opaque;
- const_entry_universes = univs; }
+ {
+ proof_entry_body = body;
+ proof_entry_secctx = section_vars;
+ proof_entry_feedback = feedback_id;
+ proof_entry_type = Some typ;
+ proof_entry_inline_code = false;
+ proof_entry_opaque = opaque;
+ proof_entry_universes = univs; }
in
let entries = Future.map2 entry_fn fpl Proofview.(initial_goals entry) in
{ id = name; entries = entries; persistence = strength;
- universes },
- fun pr_ending -> CEphemeron.get terminator pr_ending
+ universes }
-let return_proof ?(allow_partial=false) (ps,_) =
+let return_proof ?(allow_partial=false) ps =
let { proof } = ps in
if allow_partial then begin
let proofs = Proof.partial_proof proof in
@@ -310,41 +273,36 @@ let return_proof ?(allow_partial=false) (ps,_) =
let evd = Proof.return ~pid proof in
let eff = Evd.eval_side_effects evd in
let evd = Evd.minimize_universes evd in
- (* ppedrot: FIXME, this is surely wrong. There is no reason to duplicate
- side-effects... This may explain why one need to uniquize side-effects
- thereafter... *)
let proof_opt c =
match EConstr.to_constr_opt evd c with
| Some p -> p
| None -> CErrors.user_err Pp.(str "Some unresolved existential variables remain")
in
+ (* ppedrot: FIXME, this is surely wrong. There is no reason to duplicate
+ side-effects... This may explain why one need to uniquize side-effects
+ thereafter... *)
+ (* EJGA: actually side-effects de-duplication and this codepath is
+ unrelated. Duplicated side-effects arise from incorrect scheme
+ generation code, the main bulk of it was mostly fixed by #9836
+ but duplication can still happen because of rewriting schemes I
+ think; however the code below is mostly untested, the only
+ code-paths that generate several proof entries are derive and
+ equations and so far there is no code in the CI that will
+ actually call those and do a side-effect, TTBOMK *)
let proofs =
List.map (fun (c, _) -> (proof_opt c, eff)) initial_goals in
proofs, Evd.evar_universe_context evd
-let close_future_proof ~opaque ~feedback_id (ps, psl) proof =
+let close_future_proof ~opaque ~feedback_id ps proof =
close_proof ~opaque ~keep_body_ucst_separate:true ~feedback_id ~now:false proof ps
-let close_proof ~opaque ~keep_body_ucst_separate fix_exn (ps, psl) =
+let close_proof ~opaque ~keep_body_ucst_separate fix_exn ps =
close_proof ~opaque ~keep_body_ucst_separate ~now:true
- (Future.from_val ~fix_exn (return_proof (ps,psl))) ps
-
-(** Gets the current terminator without checking that the proof has
- been completed. Useful for the likes of [Admitted]. *)
-let get_terminator (ps, _) = CEphemeron.get ps.terminator
-let set_terminator hook (ps, psl) =
- { ps with terminator = CEphemeron.create hook }, psl
-
-let copy_terminators ~src ~tgt =
- let (ps, psl), (ts,tsl) = src, tgt in
- assert(List.length psl = List.length tsl);
- {ts with terminator = ps.terminator}, List.map2 (fun op p -> { p with terminator = op.terminator }) psl tsl
-
-let update_global_env (pf : t) =
- let res, () =
- with_current_proof (fun _ p ->
- Proof.in_proof p (fun sigma ->
- let tac = Proofview.Unsafe.tclEVARS (Evd.update_sigma_env sigma (Global.env ())) in
- let (p,(status,info),()) = Proof.run_tactic (Global.env ()) tac p in
- (p, ()))) pf
- in res
+ (Future.from_val ~fix_exn (return_proof ps)) ps
+
+let update_global_env =
+ map_proof (fun p ->
+ Proof.in_proof p (fun sigma ->
+ let tac = Proofview.Unsafe.tclEVARS (Evd.update_sigma_env sigma (Global.env ())) in
+ let p,(status,info),_ = Proof.run_tactic (Global.env ()) tac p in
+ p))
diff --git a/proofs/proof_global.mli b/proofs/proof_global.mli
index e2e457483b..4e1aa64e7b 100644
--- a/proofs/proof_global.mli
+++ b/proofs/proof_global.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -13,14 +13,16 @@
environment. *)
type t
-val get_current_proof_name : t -> Names.Id.t
-val get_current_persistence : t -> Decl_kinds.goal_kind
-val get_all_proof_names : t -> Names.Id.t list
-val discard : Names.lident -> t -> t option
-val discard_current : t -> t option
+(* Should be moved into a proper view *)
+val get_proof : t -> Proof.t
+val get_proof_name : t -> Names.Id.t
+val get_persistence : t -> Decl_kinds.goal_kind
+val get_used_variables : t -> Constr.named_context option
+
+(** Get the universe declaration associated to the current proof. *)
+val get_universe_decl : t -> UState.universe_decl
-val give_me_the_proof : t -> Proof.t
val compact_the_proof : t -> t
(** When a proof is closed, it is reified into a [proof_object], where
@@ -29,30 +31,28 @@ val compact_the_proof : t -> t
function which takes a [proof_object] together with a [proof_end]
(i.e. an proof ending command) and registers the appropriate
values. *)
-type lemma_possible_guards = int list list
+type 'a proof_entry = {
+ proof_entry_body : 'a Entries.const_entry_body;
+ (* List of section variables *)
+ proof_entry_secctx : Constr.named_context option;
+ (* State id on which the completion of type checking is reported *)
+ proof_entry_feedback : Stateid.t option;
+ proof_entry_type : Constr.types option;
+ proof_entry_universes : Entries.universes_entry;
+ proof_entry_opaque : bool;
+ proof_entry_inline_code : bool;
+}
type proof_object = {
id : Names.Id.t;
- entries : Safe_typing.private_constants Entries.definition_entry list;
+ entries : Evd.side_effects proof_entry list;
persistence : Decl_kinds.goal_kind;
universes: UState.t;
}
type opacity_flag = Opaque | Transparent
-type proof_ending =
- | Admitted of Names.Id.t * Decl_kinds.goal_kind * Entries.parameter_entry *
- UState.t
- | Proved of opacity_flag *
- Names.lident option *
- proof_object
-type proof_terminator
-type closed_proof = proof_object * proof_terminator
-
-val make_terminator : (proof_ending -> unit) -> proof_terminator
-val apply_terminator : proof_terminator -> proof_ending -> unit
-
-(** [start_proof ~ontop id str pl goals terminator] starts a proof of name
+(** [start_proof id str pl goals] starts a proof of name
[id] with goals [goals] (a list of pairs of environment and
conclusion); [str] describes what kind of theorem/definition this
is; [terminator] is used at the end of the proof to close the proof
@@ -60,16 +60,22 @@ val apply_terminator : proof_terminator -> proof_ending -> unit
morphism). The proof is started in the evar map [sigma] (which can
typically contain universe constraints), and with universe bindings
pl. *)
-val start_proof : ontop:t option ->
- Evd.evar_map -> Names.Id.t -> ?pl:UState.universe_decl ->
- Decl_kinds.goal_kind -> (Environ.env * EConstr.types) list ->
- proof_terminator -> t
+val start_proof
+ : Evd.evar_map
+ -> Names.Id.t
+ -> ?pl:UState.universe_decl
+ -> Decl_kinds.goal_kind
+ -> (Environ.env * EConstr.types) list
+ -> t
(** Like [start_proof] except that there may be dependencies between
initial goals. *)
-val start_dependent_proof : ontop:t option ->
- Names.Id.t -> ?pl:UState.universe_decl -> Decl_kinds.goal_kind ->
- Proofview.telescope -> proof_terminator -> t
+val start_dependent_proof
+ : Names.Id.t
+ -> ?pl:UState.universe_decl
+ -> Decl_kinds.goal_kind
+ -> Proofview.telescope
+ -> t
(** Update the proofs global environment after a side-effecting command
(e.g. a sublemma definition) has been run inside it. Assumes
@@ -78,33 +84,25 @@ val update_global_env : t -> t
(* Takes a function to add to the exceptions data relative to the
state in which the proof was built *)
-val close_proof : opaque:opacity_flag -> keep_body_ucst_separate:bool -> Future.fix_exn -> t -> closed_proof
+val close_proof : opaque:opacity_flag -> keep_body_ucst_separate:bool -> Future.fix_exn -> t -> proof_object
(* Intermediate step necessary to delegate the future.
* Both access the current proof state. The former is supposed to be
* chained with a computation that completed the proof *)
-type closed_proof_output = (Constr.t * Safe_typing.private_constants) list * UState.t
+type closed_proof_output = (Constr.t * Evd.side_effects) list * UState.t
(* If allow_partial is set (default no) then an incomplete proof
* is allowed (no error), and a warn is given if the proof is complete. *)
val return_proof : ?allow_partial:bool -> t -> closed_proof_output
val close_future_proof : opaque:opacity_flag -> feedback_id:Stateid.t -> t ->
- closed_proof_output Future.computation -> closed_proof
+ closed_proof_output Future.computation -> proof_object
-(** Gets the current terminator without checking that the proof has
- been completed. Useful for the likes of [Admitted]. *)
-val get_terminator : t -> proof_terminator
-val set_terminator : proof_terminator -> t -> t
val get_open_goals : t -> int
-(** Runs a tactic on the current proof. Raises [NoCurrentProof] is there is
- no current proof.
- The return boolean is set to [false] if an unsafe tactic has been used. *)
-val with_current_proof :
- (unit Proofview.tactic -> Proof.t -> Proof.t * 'a) -> t -> t * 'a
-val simple_with_current_proof :
- (unit Proofview.tactic -> Proof.t -> Proof.t) -> t -> t
+val map_proof : (Proof.t -> Proof.t) -> t -> t
+val map_fold_proof : (Proof.t -> Proof.t * 'a) -> t -> t * 'a
+val map_fold_proof_endline : (unit Proofview.tactic -> Proof.t -> Proof.t * 'a) -> t -> t * 'a
(** Sets the tactic to be used when a tactic line is closed with [...] *)
val set_endline_tactic : Genarg.glob_generic_argument -> t -> t
@@ -114,10 +112,3 @@ val set_endline_tactic : Genarg.glob_generic_argument -> t -> t
* ids to be cleared *)
val set_used_variables : t ->
Names.Id.t list -> (Constr.named_context * Names.lident list) * t
-
-val get_used_variables : t -> Constr.named_context option
-
-(** Get the universe declaration associated to the current proof. *)
-val get_universe_decl : t -> UState.universe_decl
-
-val copy_terminators : src:t -> tgt:t -> t
diff --git a/proofs/refine.ml b/proofs/refine.ml
index 4a9404aa96..dd8b52e56c 100644
--- a/proofs/refine.ml
+++ b/proofs/refine.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -60,7 +60,7 @@ let generic_refine ~typecheck f gl =
let evs = Evd.save_future_goals sigma in
(* Redo the effects in sigma in the monad's env *)
let privates_csts = Evd.eval_side_effects sigma in
- let env = Safe_typing.push_private_constants env privates_csts in
+ let env = Safe_typing.push_private_constants env privates_csts.Evd.seff_private in
(* Check that the introduced evars are well-typed *)
let fold accu ev = typecheck_evar ev env accu in
let sigma = if typecheck then Evd.fold_future_goals fold sigma evs else sigma in
@@ -116,9 +116,6 @@ let lift c =
let make_refine_enter ~typecheck f gl = generic_refine ~typecheck (lift f) gl
-let refine_one ~typecheck f =
- Proofview.Goal.enter_one (make_refine_enter ~typecheck f)
-
let refine ~typecheck f =
let f evd =
let (evd,c) = f evd in (evd,((), c))
diff --git a/proofs/refine.mli b/proofs/refine.mli
index 55dafe521f..bdcccae805 100644
--- a/proofs/refine.mli
+++ b/proofs/refine.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -9,7 +9,7 @@
(************************************************************************)
(** The primitive refine tactic used to fill the holes in partial proofs. This
- is the recommanded way to write tactics when the proof term is easy to
+ is the recommended way to write tactics when the proof term is easy to
write down. Note that this is not the user-level refine tactic defined
in Ltac which is actually based on the one below. *)
@@ -27,9 +27,6 @@ val refine : typecheck:bool -> (Evd.evar_map -> Evd.evar_map * EConstr.t) -> uni
raised during the interpretation of [t] are caught and result in
tactic failures. If [typecheck] is [true] [t] is type-checked beforehand. *)
-val refine_one : typecheck:bool -> (Evd.evar_map -> Evd.evar_map * ('a * EConstr.t)) -> 'a tactic
-(** A variant of [refine] which assumes exactly one goal under focus *)
-
val generic_refine : typecheck:bool -> ('a * EConstr.t) tactic ->
Proofview.Goal.t -> 'a tactic
(** The general version of refine. *)
diff --git a/proofs/refiner.ml b/proofs/refiner.ml
index bce227dabb..e1896d51e3 100644
--- a/proofs/refiner.ml
+++ b/proofs/refiner.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -129,9 +129,6 @@ let tclTHENSLASTn tac1 tac taci = tclTHENS3PARTS tac1 [||] tac taci
let tclTHEN_i tac taci gls =
finish_tac (thensi_tac taci (then_tac tac (start_tac gls)))
-let tclTHENLASTn tac1 taci = tclTHENSLASTn tac1 tclIDTAC taci
-let tclTHENFIRSTn tac1 taci = tclTHENSFIRSTn tac1 taci tclIDTAC
-
(* [tclTHEN tac1 tac2 gls] applies the tactic [tac1] to [gls] and applies
[tac2] to every resulting subgoals *)
let tclTHEN tac1 tac2 = tclTHENS3PARTS tac1 [||] tac2 [||]
@@ -253,46 +250,9 @@ let rec tclFIRST = function
| [] -> tclFAIL_s "No applicable tactic."
| t::rest -> tclORELSE0 t (tclFIRST rest)
-let ite_gen tcal tac_if continue tac_else gl=
- let success=ref false in
- let tac_if0 gl=
- let result=tac_if gl in
- success:=true;result in
- let tac_else0 e gl=
- if !success then
- iraise e
- else
- try
- tac_else gl
- with
- e' when CErrors.noncritical e' -> iraise e in
- try
- tcal tac_if0 continue gl
- with (* Breakpoint *)
- | e when CErrors.noncritical e ->
- let e = CErrors.push e in catch_failerror e; tac_else0 e gl
-
-(* Try the first tactic and, if it succeeds, continue with
- the second one, and if it fails, use the third one *)
-
-let tclIFTHENELSE=ite_gen tclTHEN
-
-(* Idem with tclTHENS and tclTHENSV *)
-
-let tclIFTHENSELSE=ite_gen tclTHENS
-
-let tclIFTHENSVELSE=ite_gen tclTHENSV
-
-let tclIFTHENTRYELSEMUST tac1 tac2 gl =
- tclIFTHENELSE tac1 (tclTRY tac2) tac2 gl
-
(* Fails if a tactic did not solve the goal *)
let tclCOMPLETE tac = tclTHEN tac (tclFAIL_s "Proof is not complete.")
-(* Try the first thats solves the current goal *)
-let tclSOLVE tacl = tclFIRST (List.map tclCOMPLETE tacl)
-
-
(* Iteration tacticals *)
let tclDO n t =
@@ -311,22 +271,7 @@ let rec tclREPEAT t g =
let tclAT_LEAST_ONCE t = (tclTHEN t (tclREPEAT t))
-(* Repeat on the first subgoal (no failure if no more subgoal) *)
-let rec tclREPEAT_MAIN t g =
- (tclORELSE (tclTHEN_i t (fun i -> if Int.equal i 1 then (tclREPEAT_MAIN t) else
- tclIDTAC)) tclIDTAC) g
-
(* Change evars *)
let tclEVARS sigma gls = tclIDTAC {gls with sigma=sigma}
-
-let tclEVARUNIVCONTEXT ctx gls = tclIDTAC {gls with sigma= Evd.set_universe_context gls.sigma ctx}
-
-(* Push universe context *)
-let tclPUSHCONTEXT rigid ctx tac gl =
- tclTHEN (tclEVARS (Evd.merge_context_set rigid (project gl) ctx)) tac gl
-
let tclPUSHEVARUNIVCONTEXT ctx gl =
tclEVARS (Evd.merge_universe_context (project gl) ctx) gl
-
-let tclPUSHCONSTRAINTS cst gl =
- tclEVARS (Evd.add_constraints (project gl) cst) gl
diff --git a/proofs/refiner.mli b/proofs/refiner.mli
index 52cbf7658b..7f8e24fc0e 100644
--- a/proofs/refiner.mli
+++ b/proofs/refiner.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -32,12 +32,8 @@ val tclIDTAC_MESSAGE : Pp.t -> tactic
(** [tclEVARS sigma] changes the current evar map *)
val tclEVARS : evar_map -> tactic
-val tclEVARUNIVCONTEXT : UState.t -> tactic
-
-val tclPUSHCONTEXT : Evd.rigid -> Univ.ContextSet.t -> tactic -> tactic
val tclPUSHEVARUNIVCONTEXT : UState.t -> tactic
-val tclPUSHCONSTRAINTS : Univ.Constraint.t -> tactic
(** [tclTHEN tac1 tac2 gls] applies the tactic [tac1] to [gls] and applies
[tac2] to every resulting subgoals *)
@@ -86,16 +82,6 @@ val tclTHENSLASTn : tactic -> tactic -> tactic array -> tactic
[tac2] for the remaining last subgoals (previously called tclTHENST) *)
val tclTHENSFIRSTn : tactic -> tactic array -> tactic -> tactic
-(** [tclTHENLASTn tac1 [t1 ; ... ; tn] gls] first applies [tac1] then,
- applies [t1],...,[tn] on the last [n] resulting subgoals and leaves
- unchanged the other subgoals *)
-val tclTHENLASTn : tactic -> tactic array -> tactic
-
-(** [tclTHENFIRSTn tac1 [t1 ; ... ; tn] gls] first applies [tac1] then,
- applies [t1],...,[tn] on the first [n] resulting subgoals and leaves
- unchanged the other subgoals (previously called [tclTHENSI]) *)
-val tclTHENFIRSTn : tactic -> tactic array -> tactic
-
(** A special exception for levels for the Fail tactic *)
exception FailError of int * Pp.t Lazy.t
@@ -106,9 +92,7 @@ val catch_failerror : Exninfo.iexn -> unit
val tclORELSE0 : tactic -> tactic -> tactic
val tclORELSE : tactic -> tactic -> tactic
val tclREPEAT : tactic -> tactic
-val tclREPEAT_MAIN : tactic -> tactic
val tclFIRST : tactic list -> tactic
-val tclSOLVE : tactic list -> tactic
val tclTRY : tactic -> tactic
val tclTHENTRY : tactic -> tactic -> tactic
val tclCOMPLETE : tactic -> tactic
@@ -118,16 +102,3 @@ val tclFAIL_lazy : int -> Pp.t Lazy.t -> tactic
val tclDO : int -> tactic -> tactic
val tclPROGRESS : tactic -> tactic
val tclSHOWHYPS : tactic -> tactic
-
-(** [tclIFTHENELSE tac1 tac2 tac3 gls] first applies [tac1] to [gls] then,
- if it succeeds, applies [tac2] to the resulting subgoals,
- and if not applies [tac3] to the initial goal [gls] *)
-val tclIFTHENELSE : tactic -> tactic -> tactic -> tactic
-val tclIFTHENSELSE : tactic -> tactic list -> tactic ->tactic
-val tclIFTHENSVELSE : tactic -> tactic array -> tactic ->tactic
-
-(** [tclIFTHENTRYELSEMUST tac1 tac2 gls] applies [tac1] then [tac2]. If [tac1]
- has been successful, then [tac2] may fail. Otherwise, [tac2] must succeed.
- Equivalent to [(tac1;try tac2)||tac2] *)
-
-val tclIFTHENTRYELSEMUST : tactic -> tactic -> tactic
diff --git a/proofs/tacmach.ml b/proofs/tacmach.ml
index 93031c2202..d3bce07814 100644
--- a/proofs/tacmach.ml
+++ b/proofs/tacmach.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -81,12 +81,10 @@ let pf_type_of = pf_reduce type_of
let pf_get_type_of = pf_reduce Retyping.get_type_of
let pf_conv_x gl = pf_reduce test_conversion gl Reduction.CONV
-let pf_conv_x_leq gl = pf_reduce test_conversion gl Reduction.CUMUL
let pf_const_value = pf_reduce (fun env _ c -> EConstr.of_constr (constant_value_in env c))
let pf_reduce_to_quantified_ind = pf_reduce reduce_to_quantified_ind
let pf_reduce_to_atomic_ind = pf_reduce reduce_to_atomic_ind
-
let pf_hnf_type_of gls = pf_get_type_of gls %> pf_whd_all gls
(* Pretty-printers *)
@@ -181,14 +179,7 @@ module New = struct
let pf_hnf_type_of gl t =
pf_whd_all gl (pf_get_type_of gl t)
- let pf_whd_all gl t = pf_apply whd_all gl t
let pf_compute gl t = pf_apply compute gl t
let pf_nf_evar gl t = nf_evar (project gl) t
-
- let pf_undefined_evars gl =
- let sigma = Proofview.Goal.sigma gl in
- let ev = Proofview.Goal.goal gl in
- let evi = Evd.find sigma ev in
- Evarutil.filtered_undefined_evars_of_evar_info sigma evi
end
diff --git a/proofs/tacmach.mli b/proofs/tacmach.mli
index 23e1e6f566..def67abad7 100644
--- a/proofs/tacmach.mli
+++ b/proofs/tacmach.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -64,7 +64,6 @@ val pf_unfoldn : (occurrences * evaluable_global_reference) list
val pf_const_value : Goal.goal sigma -> pconstant -> constr
val pf_conv_x : Goal.goal sigma -> constr -> constr -> bool
-val pf_conv_x_leq : Goal.goal sigma -> constr -> constr -> bool
(** {6 Pretty-printing functions (debug only). } *)
val pr_gls : Goal.goal sigma -> Pp.t
@@ -109,11 +108,8 @@ module New : sig
val pf_hnf_constr : Proofview.Goal.t -> constr -> types
val pf_hnf_type_of : Proofview.Goal.t -> constr -> types
- val pf_whd_all : Proofview.Goal.t -> constr -> constr
val pf_compute : Proofview.Goal.t -> constr -> constr
val pf_nf_evar : Proofview.Goal.t -> constr -> constr
- (** Gathers the undefined evars of the given goal. *)
- val pf_undefined_evars : Proofview.Goal.t -> Evar.Set.t
end
diff --git a/proofs/tactypes.ml b/proofs/tactypes.ml
index 86a7e9c527..634faf1acc 100644
--- a/proofs/tactypes.ml
+++ b/proofs/tactypes.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/asyncTaskQueue.ml b/stm/asyncTaskQueue.ml
index 8b455821af..044ac29e92 100644
--- a/stm/asyncTaskQueue.ml
+++ b/stm/asyncTaskQueue.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/asyncTaskQueue.mli b/stm/asyncTaskQueue.mli
index 067ea5df0c..a9a215acc8 100644
--- a/stm/asyncTaskQueue.mli
+++ b/stm/asyncTaskQueue.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/coqworkmgrApi.ml b/stm/coqworkmgrApi.ml
index 841cc08c07..c21f057742 100644
--- a/stm/coqworkmgrApi.ml
+++ b/stm/coqworkmgrApi.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/coqworkmgrApi.mli b/stm/coqworkmgrApi.mli
index be5b291776..d53af84071 100644
--- a/stm/coqworkmgrApi.mli
+++ b/stm/coqworkmgrApi.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/dag.ml b/stm/dag.ml
index eb5063bf0c..4504de681b 100644
--- a/stm/dag.ml
+++ b/stm/dag.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/dag.mli b/stm/dag.mli
index cae4fccc73..3a291c8d52 100644
--- a/stm/dag.mli
+++ b/stm/dag.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/proofBlockDelimiter.ml b/stm/proofBlockDelimiter.ml
index 04f10e7399..4f5cef648b 100644
--- a/stm/proofBlockDelimiter.ml
+++ b/stm/proofBlockDelimiter.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -48,14 +48,14 @@ let simple_goal sigma g gs =
let is_focused_goal_simple ~doc id =
match state_of_id ~doc id with
| `Expired | `Error _ | `Valid None -> `Not
- | `Valid (Some { Vernacstate.proof }) ->
- Option.cata (fun proof ->
- let proof = Proof_global.give_me_the_proof proof in
+ | `Valid (Some { Vernacstate.lemmas }) ->
+ Option.cata (Lemmas.Stack.with_top_pstate ~f:(fun proof ->
+ let proof = Proof_global.get_proof proof in
let Proof.{ goals=focused; stack=r1; shelf=r2; given_up=r3; sigma } = Proof.data proof in
let rest = List.(flatten (map (fun (x,y) -> x @ y) r1)) @ r2 @ r3 in
if List.for_all (fun x -> simple_goal sigma x rest) focused
then `Simple focused
- else `Not) `Not proof
+ else `Not)) `Not lemmas
type 'a until = [ `Stop | `Found of static_block_declaration | `Cont of 'a ]
diff --git a/stm/proofBlockDelimiter.mli b/stm/proofBlockDelimiter.mli
index eacd3687ae..e45f489a38 100644
--- a/stm/proofBlockDelimiter.mli
+++ b/stm/proofBlockDelimiter.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/spawned.ml b/stm/spawned.ml
index bd772d825d..916139884b 100644
--- a/stm/spawned.ml
+++ b/stm/spawned.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/spawned.mli b/stm/spawned.mli
index df4e725953..36612b1450 100644
--- a/stm/spawned.mli
+++ b/stm/spawned.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/stm.ml b/stm/stm.ml
index 6f7cefb582..89d95d0cc9 100644
--- a/stm/stm.ml
+++ b/stm/stm.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -100,6 +100,15 @@ let forward_feedback, forward_feedback_hook =
let unreachable_state, unreachable_state_hook = Hook.make
~default:(fun ~doc:_ _ _ -> ()) ()
+let document_add, document_add_hook = Hook.make
+ ~default:(fun _ _ -> ()) ()
+
+let document_edit, document_edit_hook = Hook.make
+ ~default:(fun _ -> ()) ()
+
+let sentence_exec, sentence_exec_hook = Hook.make
+ ~default:(fun _ -> ()) ()
+
include Hook
(* enables: Hooks.(call foo args) *)
@@ -199,7 +208,7 @@ let mkTransCmd cast cids ceff cqueue =
(* Parts of the system state that are morally part of the proof state *)
let summary_pstate = Evarutil.meta_counter_summary_tag,
Evd.evar_counter_summary_tag,
- Obligations.program_tcc_summary_tag
+ DeclareObl.program_tcc_summary_tag
type cached_state =
| EmptyState
@@ -571,7 +580,7 @@ end = struct (* {{{ *)
(match Vernacprop.under_control x with
| VernacDefinition (_,({CAst.v=Name i},_),_) -> Id.to_string i
| VernacStartTheoremProof (_,[({CAst.v=i},_),_]) -> Id.to_string i
- | VernacInstance (_,(({CAst.v=Name i},_),_,_),_,_) -> Id.to_string i
+ | VernacInstance (({CAst.v=Name i},_),_,_,_,_) -> Id.to_string i
| _ -> "branch")
let edit_branch = Branch.make "edit"
let branch ?root ?pos name kind = vcs := branch !vcs ?root ?pos name kind
@@ -872,18 +881,18 @@ end = struct (* {{{ *)
let invalidate_cur_state () = cur_id := Stateid.dummy
type proof_part =
- Proof_global.t option *
+ Lemmas.Stack.t option *
int * (* Evarutil.meta_counter_summary_tag *)
int * (* Evd.evar_counter_summary_tag *)
- Obligations.program_info Names.Id.Map.t (* Obligations.program_tcc_summary_tag *)
+ DeclareObl.program_info CEphemeron.key Names.Id.Map.t (* Obligations.program_tcc_summary_tag *)
type partial_state =
[ `Full of Vernacstate.t
| `ProofOnly of Stateid.t * proof_part ]
- let proof_part_of_frozen { Vernacstate.proof; system } =
+ let proof_part_of_frozen { Vernacstate.lemmas; system } =
let st = States.summary_of_state system in
- proof,
+ lemmas,
Summary.project_from_summary st Util.(pi1 summary_pstate),
Summary.project_from_summary st Util.(pi2 summary_pstate),
Summary.project_from_summary st Util.(pi3 summary_pstate)
@@ -947,17 +956,17 @@ end = struct (* {{{ *)
try
let prev = (VCS.visit id).next in
if is_cached_and_valid prev
- then { s with proof =
+ then { s with lemmas =
PG_compat.copy_terminators
- ~src:((get_cached prev).proof) ~tgt:s.proof }
+ ~src:((get_cached prev).lemmas) ~tgt:s.lemmas }
else s
with VCS.Expired -> s in
VCS.set_state id (FullState s)
| `ProofOnly(ontop,(pstate,c1,c2,c3)) ->
if is_cached_and_valid ontop then
let s = get_cached ontop in
- let s = { s with proof =
- PG_compat.copy_terminators ~src:s.proof ~tgt:pstate } in
+ let s = { s with lemmas =
+ PG_compat.copy_terminators ~src:s.lemmas ~tgt:pstate } in
let s = { s with system =
States.replace_summary s.system
begin
@@ -1051,99 +1060,6 @@ end = struct (* {{{ *)
end (* }}} *)
-(* indentation code for Show Script, initially contributed
- * by D. de Rauglaudre. Should be moved away.
- *)
-
-module ShowScript = struct
-
-let indent_script_item ((ng1,ngl1),nl,beginend,ppl) (cmd,ng) =
- (* ng1 : number of goals remaining at the current level (before cmd)
- ngl1 : stack of previous levels with their remaining goals
- ng : number of goals after the execution of cmd
- beginend : special indentation stack for { } *)
- let ngprev = List.fold_left (+) ng1 ngl1 in
- let new_ngl =
- if ng > ngprev then
- (* We've branched *)
- (ng - ngprev + 1, ng1 - 1 :: ngl1)
- else if ng < ngprev then
- (* A subgoal have been solved. Let's compute the new current level
- by discarding all levels with 0 remaining goals. *)
- let rec loop = function
- | (0, ng2::ngl2) -> loop (ng2,ngl2)
- | p -> p
- in loop (ng1-1, ngl1)
- else
- (* Standard case, same goal number as before *)
- (ng1, ngl1)
- in
- (* When a subgoal have been solved, separate this block by an empty line *)
- let new_nl = (ng < ngprev)
- in
- (* Indentation depth *)
- let ind = List.length ngl1
- in
- (* Some special handling of bullets and { }, to get a nicer display *)
- let pred n = max 0 (n-1) in
- let ind, nl, new_beginend = match Vernacprop.under_control cmd with
- | VernacSubproof _ -> pred ind, nl, (pred ind)::beginend
- | VernacEndSubproof -> List.hd beginend, false, List.tl beginend
- | VernacBullet _ -> pred ind, nl, beginend
- | _ -> ind, nl, beginend
- in
- let pp = Pp.(
- (if nl then fnl () else mt ()) ++
- (hov (ind+1) (str (String.make ind ' ') ++ Ppvernac.pr_vernac cmd)))
- in
- (new_ngl, new_nl, new_beginend, pp :: ppl)
-
-let get_script prf =
- let branch, test =
- match prf with
- | None -> VCS.Branch.master, fun _ -> true
- | Some name -> VCS.current_branch (),fun nl -> nl=[] || List.mem name nl in
- let rec find acc id =
- if Stateid.equal id Stateid.initial ||
- Stateid.equal id Stateid.dummy then acc else
- let view = VCS.visit id in
- match view.step with
- | `Fork((_,_,_,ns), _) when test ns -> acc
- | `Qed (qed, proof) -> find [qed.qast.expr, (VCS.get_info id).n_goals] proof
- | `Sideff (ReplayCommand x,_) ->
- find ((x.expr, (VCS.get_info id).n_goals)::acc) view.next
- | `Sideff (CherryPickEnv, id) -> find acc id
- | `Cmd {cast = x; ctac} when ctac -> (* skip non-tactics *)
- find ((x.expr, (VCS.get_info id).n_goals)::acc) view.next
- | `Cmd _ -> find acc view.next
- | `Alias (id,_) -> find acc id
- | `Fork _ -> find acc view.next
- in
- find [] (VCS.get_branch_pos branch)
-
-let warn_show_script_deprecated =
- CWarnings.create ~name:"deprecated-show-script" ~category:"deprecated"
- (fun () -> Pp.str "The “Show Script” command is deprecated.")
-
-let show_script ?proof () =
- warn_show_script_deprecated ();
- try
- let prf =
- try match proof with
- | None -> Some (PG_compat.get_current_proof_name ())
- | Some (p,_) -> Some (p.Proof_global.id)
- with PG_compat.NoCurrentProof -> None
- in
- let cmds = get_script prf in
- let _,_,_,indented_cmds =
- List.fold_left indent_script_item ((1,[]),false,[],[]) cmds
- in
- let indented_cmds = List.rev (indented_cmds) in
- msg_notice Pp.(v 0 (prlist_with_sep fnl (fun x -> x) indented_cmds))
- with Vcs_aux.Expired -> ()
-
-end
-
(* Wrapper for Vernacentries.interp to set the feedback id *)
(* It is currently called 19 times, this number should be certainly
reduced... *)
@@ -1163,21 +1079,17 @@ let stm_vernac_interp ?proof ?route id st { verbose; expr } : Vernacstate.t =
| VernacAbortAll | VernacAbort _ -> true
| _ -> false
in
- let aux_interp st expr =
- (* XXX unsupported attributes *)
- let cmd = Vernacprop.under_control expr in
- if is_filtered_command cmd then
- (stm_pperr_endline Pp.(fun () -> str "ignoring " ++ Ppvernac.pr_vernac expr); st)
- else
- match cmd with
- | VernacShow ShowScript -> ShowScript.show_script (); st (* XX we are ignoring control here *)
- | _ ->
- stm_pperr_endline Pp.(fun () -> str "interpreting " ++ Ppvernac.pr_vernac expr);
- try Vernacentries.interp ?verbosely:(Some verbose) ?proof ~st expr
- with e ->
- let e = CErrors.push e in
- Exninfo.iraise Hooks.(call_process_error_once e)
- in aux_interp st expr
+ (* XXX unsupported attributes *)
+ let cmd = Vernacprop.under_control expr in
+ if is_filtered_command cmd then
+ (stm_pperr_endline Pp.(fun () -> str "ignoring " ++ Ppvernac.pr_vernac expr); st)
+ else begin
+ stm_pperr_endline Pp.(fun () -> str "interpreting " ++ Ppvernac.pr_vernac expr);
+ try Vernacentries.interp ?verbosely:(Some verbose) ?proof ~st expr
+ with e ->
+ let e = CErrors.push e in
+ Exninfo.iraise Hooks.(call_process_error_once e)
+ end
(****************************** CRUFT *****************************************)
(******************************************************************************)
@@ -1256,7 +1168,7 @@ end = struct (* {{{ *)
let get_proof ~doc id =
match state_of_id ~doc id with
- | `Valid (Some vstate) -> Option.map Proof_global.give_me_the_proof vstate.Vernacstate.proof
+ | `Valid (Some vstate) -> Option.map (Lemmas.Stack.with_top_pstate ~f:Proof_global.get_proof) vstate.Vernacstate.lemmas
| _ -> None
let undo_vernac_classifier v ~doc =
@@ -1620,14 +1532,12 @@ end = struct (* {{{ *)
(* Unfortunately close_future_proof and friends are not pure so we need
to set the state manually here *)
State.unfreeze st;
- let pobject, _ =
+ let pobject, _info =
PG_compat.close_future_proof ~opaque ~feedback_id:stop (Future.from_val ~fix_exn p) in
- let terminator = (* The one sent by master is an InvalidKey *)
- Lemmas.(standard_proof_terminator []) in
let st = Vernacstate.freeze_interp_state ~marshallable:false in
stm_vernac_interp stop
- ~proof:(pobject, terminator) st
+ ~proof:(pobject, Lemmas.default_info) st
{ verbose = false; indentation = 0; strlen = 0;
expr = CAst.make ?loc @@ VernacExpr ([], VernacEndProof (Proved (opaque,None))) }) in
ignore(Future.join checked_proof);
@@ -1651,7 +1561,7 @@ end = struct (* {{{ *)
let perform_states query =
if query = [] then [] else
let is_tac e = match Vernac_classifier.classify_vernac e with
- | VtProofStep _, _ -> true
+ | VtProofStep _ -> true
| _ -> false
in
let initial =
@@ -1725,7 +1635,7 @@ and Slaves : sig
val info_tasks : 'a tasks -> (string * float * int) list
val finish_task :
string ->
- Library.seg_univ -> Library.seg_discharge -> Library.seg_proofs ->
+ Library.seg_univ -> Library.seg_proofs ->
int tasks -> int -> Library.seg_univ
val cancel_worker : WorkerPool.worker_id -> unit
@@ -1761,14 +1671,17 @@ end = struct (* {{{ *)
let _proof = PG_compat.return_proof ~allow_partial:true () in
`OK_ADMITTED
else begin
- (* The original terminator, a hook, has not been saved in the .vio*)
- PG_compat.set_terminator (Lemmas.standard_proof_terminator []);
-
let opaque = Proof_global.Opaque in
- let proof =
+
+ (* The original terminator, a hook, has not been saved in the .vio*)
+ let pterm, _info =
PG_compat.close_proof ~opaque ~keep_body_ucst_separate:true (fun x -> x) in
+
+ let proof = pterm, Lemmas.default_info in
+
(* We jump at the beginning since the kernel handles side effects by also
* looking at the ones that happen to be present in the current env *)
+
Reach.known_state ~doc:dummy_doc (* XXX should be document *) ~cache:false start;
(* STATE SPEC:
* - start: First non-expired state! [This looks very fishy]
@@ -1810,17 +1723,16 @@ end = struct (* {{{ *)
str (Printexc.to_string e)));
if drop then `ERROR_ADMITTED else `ERROR
- let finish_task name (u,cst,_) d p l i =
+ let finish_task name (cst,_) p l i =
let { Stateid.uuid = bucket }, drop = List.nth l i in
let bucket_name =
if bucket < 0 then (assert drop; ", no bucket")
else Printf.sprintf ", bucket %d" bucket in
match check_task_aux bucket_name name l i with
| `ERROR -> exit 1
- | `ERROR_ADMITTED -> u, cst, false
- | `OK_ADMITTED -> u, cst, false
+ | `ERROR_ADMITTED -> cst, false
+ | `OK_ADMITTED -> cst, false
| `OK (po,_) ->
- let discharge c = List.fold_right Cooking.cook_constr d.(bucket) c in
let con =
Nametab.locate_constant
(Libnames.qualid_of_ident po.Proof_global.id) in
@@ -1828,22 +1740,24 @@ end = struct (* {{{ *)
let o = match c.Declarations.const_body with
| Declarations.OpaqueDef o -> o
| _ -> assert false in
- let uc =
- Option.get
- (Opaqueproof.get_constraints (Global.opaque_tables ()) o) in
+ (* No need to delay the computation, the future has been forced by
+ the call to [check_task_aux] above. *)
+ let uc = Opaqueproof.force_constraints Library.indirect_accessor (Global.opaque_tables ()) o in
+ let uc = Univ.hcons_universe_context_set uc in
+ let (pr, priv, ctx) = Option.get (Global.body_of_constant_body Library.indirect_accessor c) in
(* We only manipulate monomorphic terms here. *)
- let map (c, ctx) = assert (Univ.AUContext.is_empty ctx); c in
- let pr =
- Future.from_val (map (Option.get (Global.body_of_constant_body c))) in
- let uc =
- Future.chain uc Univ.hcons_universe_context_set in
- let pr = Future.chain pr discharge in
- let pr = Future.chain pr Constr.hcons in
- Future.sink pr;
- let extra = Future.join uc in
- u.(bucket) <- uc;
- p.(bucket) <- pr;
- u, Univ.ContextSet.union cst extra, false
+ let () = assert (Univ.AUContext.is_empty ctx) in
+ let () = match priv with
+ | Opaqueproof.PrivateMonomorphic () -> ()
+ | Opaqueproof.PrivatePolymorphic (univs, uctx) ->
+ let () = assert (Int.equal (Univ.AUContext.size ctx) univs) in
+ assert (Univ.ContextSet.is_empty uctx)
+ in
+ let pr = Constr.hcons pr in
+ let (ci, dummy) = p.(bucket) in
+ let () = assert (Option.is_empty dummy) in
+ p.(bucket) <- ci, Some (pr, priv);
+ Univ.ContextSet.union cst uc, false
let check_task name l i =
match check_task_aux "" name l i with
@@ -2029,7 +1943,7 @@ end = struct (* {{{ *)
"goals only"))
else begin
let (i, ast) = r_ast in
- PG_compat.simple_with_current_proof (fun _ p -> Proof.focus focus_cond () i p);
+ PG_compat.map_proof (fun p -> Proof.focus focus_cond () i p);
(* STATE SPEC:
* - start : id
* - return: id
@@ -2085,7 +1999,7 @@ end = struct (* {{{ *)
stm_fail ~st fail (fun () ->
(if time then System.with_time ~batch ~header:(Pp.mt ()) else (fun x -> x)) (fun () ->
TaskQueue.with_n_workers nworkers (fun queue ->
- PG_compat.simple_with_current_proof (fun _ p ->
+ PG_compat.map_proof (fun p ->
let Proof.{goals} = Proof.data p in
let open TacTask in
let res = CList.map_i (fun i g ->
@@ -2400,8 +2314,8 @@ let known_state ~doc ?(redefine_qed=false) ~cache id =
Proofview.give_up else Proofview.tclUNIT ()
end in
match (VCS.get_info base_state).state with
- | FullState { Vernacstate.proof } ->
- Option.iter PG_compat.unfreeze proof;
+ | FullState { Vernacstate.lemmas } ->
+ Option.iter PG_compat.unfreeze lemmas;
PG_compat.with_current_proof (fun _ p ->
feedback ~id:id Feedback.AddedAxiom;
fst (Pfedit.solve Goal_select.SelectAll None tac p), ());
@@ -2652,16 +2566,16 @@ end (* }}} *)
(********************************* STM API ************************************)
(******************************************************************************)
-(* Main initalization routine *)
+(* Main initialization routine *)
type stm_init_options = {
(* The STM will set some internal flags differently depending on the
- specified [doc_type]. This distinction should dissappear at some
+ specified [doc_type]. This distinction should disappear at some
some point. *)
doc_type : stm_doc_type;
(* Initial load path in scope for the document. Usually extracted
from -R options / _CoqProject *)
- iload_path : Mltop.coq_path list;
+ iload_path : Loadpath.coq_path list;
(* Require [require_libs] before the initial state is
ready. Parameters follow [Library], that is to say,
@@ -2693,8 +2607,8 @@ let dirpath_of_file f =
Loadpath.logical lp
with Not_found -> Libnames.default_root_prefix
in
- let file = Filename.chop_extension (Filename.basename f) in
- let id = Id.of_string file in
+ let f = try Filename.chop_extension (Filename.basename f) with Invalid_argument _ -> f in
+ let id = Id.of_string f in
let ldir = Libnames.add_dirpath_suffix ldir0 id in
ldir
@@ -2719,7 +2633,7 @@ let new_doc { doc_type ; iload_path; require_libs; stm_options } =
(* Set load path; important, this has to happen before we declare
the library below as [Declaremods/Library] will infer the module
name by looking at the load path! *)
- List.iter Mltop.add_coq_path iload_path;
+ List.iter Loadpath.add_coq_path iload_path;
Safe_typing.allow_delayed_constants := !cur_opt.async_proofs_mode <> APoff;
@@ -2767,6 +2681,7 @@ let new_doc { doc_type ; iload_path; require_libs; stm_options } =
doc, VCS.cur_tip ()
let observe ~doc id =
+ Hooks.(call sentence_exec id);
let vcs = VCS.backup () in
try
Reach.known_state ~doc ~cache:(VCS.is_interactive ()) id;
@@ -2837,16 +2752,16 @@ let check_task name (tasks,rcbackup) i =
with e when CErrors.noncritical e -> VCS.restore vcs; false
let info_tasks (tasks,_) = Slaves.info_tasks tasks
-let finish_tasks name u d p (t,rcbackup as tasks) =
+let finish_tasks name u p (t,rcbackup as tasks) =
RemoteCounter.restore rcbackup;
let finish_task u (_,_,i) =
let vcs = VCS.backup () in
- let u = State.purify (Slaves.finish_task name u d p t) i in
+ let u = State.purify (Slaves.finish_task name u p t) i in
VCS.restore vcs;
u in
try
- let u, a, _ = List.fold_left finish_task u (info_tasks tasks) in
- (u,a,true), p
+ let a, _ = List.fold_left finish_task u (info_tasks tasks) in
+ (a,true), p
with e ->
let e = CErrors.push e in
msg_warning (str"File " ++ str name ++ str ":" ++ spc () ++ iprint e);
@@ -2948,12 +2863,12 @@ let process_transaction ~doc ?(newtip=Stateid.fresh ())
" classified as: " ^ Vernac_classifier.string_of_vernac_classification c);
match c with
(* Meta *)
- | VtMeta, _ ->
+ | VtMeta ->
let id = Backtrack.undo_vernac_classifier expr ~doc in
process_back_meta_command ~newtip ~head id x
(* Query *)
- | VtQuery, w ->
+ | VtQuery ->
let id = VCS.new_node ~id:newtip proof_mode () in
let queue =
if VCS.is_vio_doc () &&
@@ -2963,10 +2878,10 @@ let process_transaction ~doc ?(newtip=Stateid.fresh ())
else `MainQueue in
VCS.commit id (mkTransCmd x [] false queue);
VCS.set_parsing_state id head_parsing;
- Backtrack.record (); assert (w == VtLater); `Ok
+ Backtrack.record (); `Ok
(* Proof *)
- | VtStartProof (guarantee, names), w ->
+ | VtStartProof (guarantee, names) ->
if not (get_allow_nested_proofs ()) && VCS.proof_nesting () > 0 then
"Nested proofs are not allowed unless you turn option Nested Proofs Allowed on."
@@ -2988,9 +2903,9 @@ let process_transaction ~doc ?(newtip=Stateid.fresh ())
VCS.merge id ~ours:(Fork (x, bname, guarantee, names)) head
end;
VCS.set_parsing_state id head_parsing;
- Backtrack.record (); assert (w == VtLater); `Ok
+ Backtrack.record (); `Ok
- | VtProofStep { parallel; proof_block_detection = cblock }, w ->
+ | VtProofStep { parallel; proof_block_detection = cblock } ->
let id = VCS.new_node ~id:newtip proof_mode () in
let queue =
match parallel with
@@ -3002,18 +2917,18 @@ let process_transaction ~doc ?(newtip=Stateid.fresh ())
detection should occur here.
detect_proof_block id cblock; *)
VCS.set_parsing_state id head_parsing;
- Backtrack.record (); assert (w == VtLater); `Ok
+ Backtrack.record (); `Ok
- | VtQed keep, w ->
+ | VtQed keep ->
let valid = VCS.get_branch_pos head in
let rc =
merge_proof_branch ~valid ~id:newtip x keep head in
VCS.checkout_shallowest_proof_branch ();
- Backtrack.record (); assert (w == VtLater);
+ Backtrack.record ();
rc
(* Side effect in a (still open) proof is replayed on all branches*)
- | VtSideff l, w ->
+ | VtSideff (l, w) ->
let id = VCS.new_node ~id:newtip proof_mode () in
let new_ids =
match (VCS.get_branch head).VCS.kind with
@@ -3049,15 +2964,13 @@ let process_transaction ~doc ?(newtip=Stateid.fresh ())
VCS.set_parsing_state id parsing_state) new_ids;
`Ok
- | VtProofMode pm, VtNow ->
+ | VtProofMode pm ->
let proof_mode = Pvernac.lookup_proof_mode pm in
let id = VCS.new_node ~id:newtip proof_mode () in
VCS.commit id (mkTransCmd x [] false `MainQueue);
VCS.set_parsing_state id head_parsing;
Backtrack.record (); `Ok
- | VtProofMode _, VtLater ->
- anomaly(str"classifier: VtProofMode must imply VtNow.")
end in
let pr_rc rc = match rc with
| `Ok -> Pp.(seq [str "newtip ("; str (Stateid.to_string (VCS.cur_tip ())); str ")"])
@@ -3107,7 +3020,7 @@ let ind_len_loc_of_id sid =
let compute_indentation ?loc sid = Option.cata (fun loc ->
let open Loc in
- (* The effective lenght is the lenght on the last line *)
+ (* The effective length is the length on the last line *)
let len = loc.ep - loc.bp in
let prev_indent = match ind_len_loc_of_id sid with
| None -> 0
@@ -3122,6 +3035,7 @@ let compute_indentation ?loc sid = Option.cata (fun loc ->
) (0, 0) loc
let add ~doc ~ontop ?newtip verb ast =
+ Hooks.(call document_add ast ontop);
let loc = ast.CAst.loc in
let cur_tip = VCS.cur_tip () in
if not (Stateid.equal ontop cur_tip) then
@@ -3167,6 +3081,7 @@ let query ~doc ~at ~route s =
s
let edit_at ~doc id =
+ Hooks.(call document_edit id);
if Stateid.equal id Stateid.dummy then anomaly(str"edit_at dummy.") else
let vcs = VCS.backup () in
let on_cur_branch id =
@@ -3322,7 +3237,10 @@ let state_computed_hook = Hooks.state_computed_hook
let state_ready_hook = Hooks.state_ready_hook
let forward_feedback_hook = Hooks.forward_feedback_hook
let unreachable_state_hook = Hooks.unreachable_state_hook
-let () = Hook.set Obligations.stm_get_fix_exn (fun () -> !State.fix_exn_ref)
+let document_add_hook = Hooks.document_add_hook
+let document_edit_hook = Hooks.document_edit_hook
+let sentence_exec_hook = Hooks.sentence_exec_hook
+let () = Hook.set DeclareObl.stm_get_fix_exn (fun () -> !State.fix_exn_ref)
type document = VCS.vcs
let backup () = VCS.backup ()
diff --git a/stm/stm.mli b/stm/stm.mli
index 9d2bf56629..f1bef2dc4d 100644
--- a/stm/stm.mli
+++ b/stm/stm.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -50,7 +50,7 @@ type stm_doc_type =
| VioDoc of string (* file path *)
| Interactive of interactive_top (* module path *)
-(** Coq initalization options:
+(** Coq initialization options:
- [doc_type]: Type of document being created.
@@ -63,13 +63,13 @@ type stm_doc_type =
*)
type stm_init_options = {
(* The STM will set some internal flags differently depending on the
- specified [doc_type]. This distinction should dissappear at some
+ specified [doc_type]. This distinction should disappear at some
some point. *)
doc_type : stm_doc_type;
(* Initial load path in scope for the document. Usually extracted
from -R options / _CoqProject *)
- iload_path : Mltop.coq_path list;
+ iload_path : Loadpath.coq_path list;
(* Require [require_libs] before the initial state is
ready. Parameters follow [Library], that is to say,
@@ -86,7 +86,7 @@ type stm_init_options = {
(** The type of a STM document *)
type doc
-(** [init_core] performs some low-level initalization; should go away
+(** [init_core] performs some low-level initialization; should go away
in future releases. *)
val init_core : unit -> unit
@@ -167,7 +167,7 @@ type tasks
val check_task : string -> tasks -> int -> bool
val info_tasks : tasks -> (string * float * int) list
val finish_tasks : string ->
- Library.seg_univ -> Library.seg_discharge -> Library.seg_proofs ->
+ Library.seg_univ -> Library.seg_proofs ->
tasks -> Library.seg_univ * Library.seg_proofs
(* Id of the tip of the current branch *)
@@ -282,6 +282,19 @@ val state_ready_hook : (doc:doc -> Stateid.t -> unit) Hook.t
(* Messages from the workers to the master *)
val forward_feedback_hook : (Feedback.feedback -> unit) Hook.t
+(*
+ * Hooks into the UI for plugins (not for general use)
+ *)
+
+(** User adds a sentence to the document (after parsing) *)
+val document_add_hook : (Vernacexpr.vernac_control -> Stateid.t -> unit) Hook.t
+
+(** User edits a sentence in the document *)
+val document_edit_hook : (Stateid.t -> unit) Hook.t
+
+(** User requests evaluation of a sentence *)
+val sentence_exec_hook : (Stateid.t -> unit) Hook.t
+
val get_doc : Feedback.doc_id -> doc
val state_of_id : doc:doc ->
diff --git a/stm/tQueue.ml b/stm/tQueue.ml
index 33744e7323..72a40a2a9c 100644
--- a/stm/tQueue.ml
+++ b/stm/tQueue.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/tQueue.mli b/stm/tQueue.mli
index e098c37f2a..c8c592e42f 100644
--- a/stm/tQueue.mli
+++ b/stm/tQueue.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/vcs.ml b/stm/vcs.ml
index 4bd46286bd..78edeb53d3 100644
--- a/stm/vcs.ml
+++ b/stm/vcs.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/vcs.mli b/stm/vcs.mli
index 47622ef6f1..f6ca81257b 100644
--- a/stm/vcs.mli
+++ b/stm/vcs.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/vernac_classifier.ml b/stm/vernac_classifier.ml
index 7cecd801e4..4e7f6a0ac6 100644
--- a/stm/vernac_classifier.ml
+++ b/stm/vernac_classifier.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -20,9 +20,13 @@ let string_of_parallel = function
"par" ^ if solve then "solve" else "" ^ if abs then "abs" else ""
| `No -> ""
-let string_of_vernac_type = function
+let string_of_vernac_when = function
+ | VtLater -> "Later"
+ | VtNow -> "Now"
+
+let string_of_vernac_classification = function
| VtStartProof _ -> "StartProof"
- | VtSideff _ -> "Sideff"
+ | VtSideff (_,w) -> "Sideff"^" "^(string_of_vernac_when w)
| VtQed (VtKeep VtKeepAxiom) -> "Qed(admitted)"
| VtQed (VtKeep (VtKeepOpaque | VtKeepDefined)) -> "Qed(keep)"
| VtQed VtDrop -> "Qed(drop)"
@@ -33,13 +37,6 @@ let string_of_vernac_type = function
| VtMeta -> "Meta "
| VtProofMode _ -> "Proof Mode"
-let string_of_vernac_when = function
- | VtLater -> "Later"
- | VtNow -> "Now"
-
-let string_of_vernac_classification (t,w) =
- string_of_vernac_type t ^ " " ^ string_of_vernac_when w
-
let vtkeep_of_opaque = let open Proof_global in function
| Opaque -> VtKeepOpaque
| Transparent -> VtKeepDefined
@@ -67,15 +64,15 @@ let classify_vernac e =
| VernacSetOption (_, l,_)
when CList.exists (CList.equal String.equal l)
options_affecting_stm_scheduling ->
- VtSideff [], VtNow
+ VtSideff ([], VtNow)
(* Qed *)
- | VernacAbort _ -> VtQed VtDrop, VtLater
- | VernacEndProof Admitted -> VtQed (VtKeep VtKeepAxiom), VtLater
- | VernacEndProof (Proved (opaque,_)) -> VtQed (VtKeep (vtkeep_of_opaque opaque)), VtLater
- | VernacExactProof _ -> VtQed (VtKeep VtKeepOpaque), VtLater
+ | VernacAbort _ -> VtQed VtDrop
+ | VernacEndProof Admitted -> VtQed (VtKeep VtKeepAxiom)
+ | VernacEndProof (Proved (opaque,_)) -> VtQed (VtKeep (vtkeep_of_opaque opaque))
+ | VernacExactProof _ -> VtQed (VtKeep VtKeepOpaque)
(* Query *)
| VernacShow _ | VernacPrint _ | VernacSearch _ | VernacLocate _
- | VernacCheckMayEval _ -> VtQuery, VtLater
+ | VernacCheckMayEval _ -> VtQuery
(* ProofStep *)
| VernacProof _
| VernacFocus _ | VernacUnfocus
@@ -83,27 +80,25 @@ let classify_vernac e =
| VernacCheckGuard
| VernacUnfocused
| VernacSolveExistential _ ->
- VtProofStep { parallel = `No; proof_block_detection = None }, VtLater
+ VtProofStep { parallel = `No; proof_block_detection = None }
| VernacBullet _ ->
- VtProofStep { parallel = `No; proof_block_detection = Some "bullet" },
- VtLater
+ VtProofStep { parallel = `No; proof_block_detection = Some "bullet" }
| VernacEndSubproof ->
VtProofStep { parallel = `No;
- proof_block_detection = Some "curly" },
- VtLater
+ proof_block_detection = Some "curly" }
(* StartProof *)
| VernacDefinition ((Decl_kinds.DoDischarge,_),({v=i},_),ProveBody _) ->
- VtStartProof(Doesn'tGuaranteeOpacity, idents_of_name i), VtLater
+ VtStartProof(Doesn'tGuaranteeOpacity, idents_of_name i)
| VernacDefinition (_,({v=i},_),ProveBody _) ->
let polymorphic = Attributes.(parse_drop_extra polymorphic atts) in
let guarantee = if polymorphic then Doesn'tGuaranteeOpacity else GuaranteesOpacity in
- VtStartProof(guarantee, idents_of_name i), VtLater
+ VtStartProof(guarantee, idents_of_name i)
| VernacStartTheoremProof (_,l) ->
let polymorphic = Attributes.(parse_drop_extra polymorphic atts) in
let ids = List.map (fun (({v=i}, _), _) -> i) l in
let guarantee = if polymorphic then Doesn'tGuaranteeOpacity else GuaranteesOpacity in
- VtStartProof (guarantee,ids), VtLater
+ VtStartProof (guarantee,ids)
| VernacFixpoint (discharge,l) ->
let polymorphic = Attributes.(parse_drop_extra polymorphic atts) in
let guarantee =
@@ -114,8 +109,8 @@ let classify_vernac e =
List.fold_left (fun (l,b) ((({v=id},_),_,_,_,p),_) ->
id::l, b || p = None) ([],false) l in
if open_proof
- then VtStartProof (guarantee,ids), VtLater
- else VtSideff ids, VtLater
+ then VtStartProof (guarantee,ids)
+ else VtSideff (ids, VtLater)
| VernacCoFixpoint (discharge,l) ->
let polymorphic = Attributes.(parse_drop_extra polymorphic atts) in
let guarantee =
@@ -126,15 +121,15 @@ let classify_vernac e =
List.fold_left (fun (l,b) ((({v=id},_),_,_,p),_) ->
id::l, b || p = None) ([],false) l in
if open_proof
- then VtStartProof (guarantee,ids), VtLater
- else VtSideff ids, VtLater
+ then VtStartProof (guarantee,ids)
+ else VtSideff (ids, VtLater)
(* Sideff: apply to all open branches. usually run on master only *)
| VernacAssumption (_,_,l) ->
let ids = List.flatten (List.map (fun (_,(l,_)) -> List.map (fun (id, _) -> id.v) l) l) in
- VtSideff ids, VtLater
+ VtSideff (ids, VtLater)
| VernacPrimitive (id,_,_) ->
- VtSideff [id.CAst.v], VtLater
- | VernacDefinition (_,({v=id},_),DefineBody _) -> VtSideff (idents_of_name id), VtLater
+ VtSideff ([id.CAst.v], VtLater)
+ | VernacDefinition (_,({v=id},_),DefineBody _) -> VtSideff (idents_of_name id, VtLater)
| VernacInductive (_, _,_,l) ->
let ids = List.map (fun (((_,({v=id},_)),_,_,_,cl),_) -> id :: match cl with
| Constructors l -> List.map (fun (_,({v=id},_)) -> id) l
@@ -142,12 +137,12 @@ let classify_vernac e =
CList.map_filter (function
| AssumExpr({v=Names.Name n},_), _ -> Some n
| _ -> None) l) l in
- VtSideff (List.flatten ids), VtLater
+ VtSideff (List.flatten ids, VtLater)
| VernacScheme l ->
let ids = List.map (fun {v}->v) (CList.map_filter (fun (x,_) -> x) l) in
- VtSideff ids, VtLater
- | VernacCombinedScheme ({v=id},_) -> VtSideff [id], VtLater
- | VernacBeginSection {v=id} -> VtSideff [id], VtLater
+ VtSideff (ids, VtLater)
+ | VernacCombinedScheme ({v=id},_) -> VtSideff ([id], VtLater)
+ | VernacBeginSection {v=id} -> VtSideff ([id], VtLater)
| VernacUniverse _ | VernacConstraint _
| VernacCanonical _ | VernacCoercion _ | VernacIdentityCoercion _
| VernacAddLoadPath _ | VernacRemoveLoadPath _ | VernacAddMLPath _
@@ -166,17 +161,17 @@ let classify_vernac e =
| VernacRegister _
| VernacNameSectionHypSet _
| VernacComments _
- | VernacDeclareInstance _ -> VtSideff [], VtLater
+ | VernacDeclareInstance _ -> VtSideff ([], VtLater)
(* Who knows *)
- | VernacLoad _ -> VtSideff [], VtNow
+ | VernacLoad _ -> VtSideff ([], VtNow)
(* (Local) Notations have to disappear *)
- | VernacEndSegment _ -> VtSideff [], VtNow
+ | VernacEndSegment _ -> VtSideff ([], VtNow)
(* Modules with parameters have to be executed: can import notations *)
| VernacDeclareModule (exp,{v=id},bl,_)
| VernacDefineModule (exp,{v=id},bl,_,_) ->
- VtSideff [id], if bl = [] && exp = None then VtLater else VtNow
+ VtSideff ([id], if bl = [] && exp = None then VtLater else VtNow)
| VernacDeclareModuleType ({v=id},bl,_,_) ->
- VtSideff [id], if bl = [] then VtLater else VtNow
+ VtSideff ([id], if bl = [] then VtLater else VtNow)
(* These commands alter the parser *)
| VernacDeclareCustomEntry _
| VernacOpenCloseScope _ | VernacDeclareScope _
@@ -186,40 +181,39 @@ let classify_vernac e =
| VernacSyntacticDefinition _
| VernacRequire _ | VernacImport _ | VernacInclude _
| VernacDeclareMLModule _
- | VernacContext _ (* TASSI: unsure *) -> VtSideff [], VtNow
- | VernacProofMode pm -> VtProofMode pm, VtNow
- | VernacInstance (_,((name,_),_,_),None,_) when not (Attributes.parse_drop_extra Attributes.program atts) ->
+ | VernacContext _ (* TASSI: unsure *) -> VtSideff ([], VtNow)
+ | VernacProofMode pm -> VtProofMode pm
+ | VernacInstance ((name,_),_,_,None,_) when not (Attributes.parse_drop_extra Attributes.program atts) ->
let polymorphic = Attributes.(parse_drop_extra polymorphic atts) in
let guarantee = if polymorphic then Doesn'tGuaranteeOpacity else GuaranteesOpacity in
- VtStartProof (guarantee, idents_of_name name.CAst.v), VtLater
- | VernacInstance (_,((name,_),_,_),_,_) ->
- VtSideff (idents_of_name name.CAst.v), VtLater
+ VtStartProof (guarantee, idents_of_name name.CAst.v)
+ | VernacInstance ((name,_),_,_,_,_) ->
+ VtSideff (idents_of_name name.CAst.v, VtLater)
(* Stm will install a new classifier to handle these *)
| VernacBack _ | VernacAbortAll
| VernacUndoTo _ | VernacUndo _
| VernacResetName _ | VernacResetInitial
- | VernacBackTo _ | VernacRestart -> VtMeta, VtNow
+ | VernacBackTo _ | VernacRestart -> VtMeta
(* What are these? *)
| VernacRestoreState _
- | VernacWriteState _ -> VtSideff [], VtNow
+ | VernacWriteState _ -> VtSideff ([], VtNow)
(* Plugins should classify their commands *)
| VernacExtend (s,l) ->
try Vernacextend.get_vernac_classifier s l
with Not_found -> anomaly(str"No classifier for"++spc()++str (fst s)++str".")
in
let rec static_control_classifier v = v |> CAst.with_val (function
- | VernacExpr (atts, e) ->
- static_classifier ~atts e
- | VernacTimeout (_,e) -> static_control_classifier e
- | VernacTime (_,e) | VernacRedirect (_, e) ->
- static_control_classifier e
- | VernacFail e -> (* Fail Qed or Fail Lemma must not join/fork the DAG *)
+ | VernacExpr (atts, e) ->
+ static_classifier ~atts e
+ | VernacTimeout (_,e) -> static_control_classifier e
+ | VernacTime (_,e) | VernacRedirect (_, e) ->
+ static_control_classifier e
+ | VernacFail e -> (* Fail Qed or Fail Lemma must not join/fork the DAG *)
+ (* XXX why is Fail not always Query? *)
(match static_control_classifier e with
- | ( VtQuery | VtProofStep _ | VtSideff _
- | VtMeta), _ as x -> x
- | VtQed _, _ ->
- VtProofStep { parallel = `No; proof_block_detection = None },
- VtLater
- | (VtStartProof _ | VtProofMode _), _ -> VtQuery, VtLater))
+ | VtQuery | VtProofStep _ | VtSideff _
+ | VtMeta as x -> x
+ | VtQed _ -> VtProofStep { parallel = `No; proof_block_detection = None }
+ | VtStartProof _ | VtProofMode _ -> VtQuery))
in
static_control_classifier e
diff --git a/stm/vernac_classifier.mli b/stm/vernac_classifier.mli
index 9d93ad1f39..77994fac2e 100644
--- a/stm/vernac_classifier.mli
+++ b/stm/vernac_classifier.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/vio_checking.ml b/stm/vio_checking.ml
index 0f78e0acf6..fab6767beb 100644
--- a/stm/vio_checking.ml
+++ b/stm/vio_checking.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -12,7 +12,7 @@ open Util
let check_vio (ts,f_in) =
Dumpglob.noglob ();
- let _, _, _, _, tasks, _ = Library.load_library_todo f_in in
+ let _, _, _, tasks, _ = Library.load_library_todo f_in in
Stm.set_compilation_hints f_in;
List.fold_left (fun acc ids -> Stm.check_task f_in tasks ids && acc) true ts
@@ -29,7 +29,7 @@ let schedule_vio_checking j fs =
if j < 1 then CErrors.user_err Pp.(str "The number of workers must be bigger than 0");
let jobs = ref [] in
List.iter (fun long_f_dot_vio ->
- let _,_,_,_, tasks, _ = Library.load_library_todo long_f_dot_vio in
+ let _,_,_, tasks, _ = Library.load_library_todo long_f_dot_vio in
Stm.set_compilation_hints long_f_dot_vio;
let infos = Stm.info_tasks tasks in
let eta = List.fold_left (fun a (_,t,_) -> a +. t) 0.0 infos in
diff --git a/stm/vio_checking.mli b/stm/vio_checking.mli
index 177b3b2d06..0f139921ef 100644
--- a/stm/vio_checking.mli
+++ b/stm/vio_checking.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/workerPool.ml b/stm/workerPool.ml
index 2432e72c8a..15c6510f7c 100644
--- a/stm/workerPool.ml
+++ b/stm/workerPool.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/stm/workerPool.mli b/stm/workerPool.mli
index 0f1237b584..5a6c968993 100644
--- a/stm/workerPool.mli
+++ b/stm/workerPool.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/abstract.ml b/tactics/abstract.ml
index 6dd9a976f9..e4fa5e84b4 100644
--- a/tactics/abstract.ml
+++ b/tactics/abstract.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -70,19 +70,19 @@ let rec shrink ctx sign c t accu =
| _ -> assert false
let shrink_entry sign const =
- let open Entries in
- let typ = match const.const_entry_type with
+ let open Proof_global in
+ let typ = match const.proof_entry_type with
| None -> assert false
| Some t -> t
in
(* The body has been forced by the call to [build_constant_by_tactic] *)
- let () = assert (Future.is_over const.const_entry_body) in
- let ((body, uctx), eff) = Future.force const.const_entry_body in
+ let () = assert (Future.is_over const.proof_entry_body) in
+ let ((body, uctx), eff) = Future.force const.proof_entry_body in
let (body, typ, ctx) = decompose (List.length sign) body typ [] in
let (body, typ, args) = shrink ctx sign body typ [] in
let const = { const with
- const_entry_body = Future.from_val ((body, uctx), eff);
- const_entry_type = Some typ;
+ proof_entry_body = Future.from_val ((body, uctx), eff);
+ proof_entry_type = Some typ;
} in
(const, args)
@@ -99,12 +99,12 @@ let cache_term_by_tactic_then ~opaque ~name_op ?(goal_type=None) tac tacK =
(* This is important: The [Global] and [Proof Theorem] parts of the
goal_kind are not relevant here as build_constant_by_tactic does
use the noop terminator; but beware if some day we remove the
- redundancy on constrant declaration. This opens up an interesting
+ redundancy on constant declaration. This opens up an interesting
question, how does abstract behave when discharge is local for example?
*)
let goal_kind, suffix = if opaque
- then (Global,poly,Proof Theorem), "_subproof"
- else (Global,poly,DefinitionBody Definition), "_subterm" in
+ then (Global ImportDefaultBehavior,poly,Proof Theorem), "_subproof"
+ else (Global ImportDefaultBehavior,poly,DefinitionBody Definition), "_subterm" in
let id, goal_kind = name_op_to_name ~name_op ~name ~goal_kind suffix in
Proofview.Goal.enter begin fun gl ->
let env = Proofview.Goal.env gl in
@@ -152,30 +152,29 @@ let cache_term_by_tactic_then ~opaque ~name_op ?(goal_type=None) tac tacK =
in
let const, args = shrink_entry sign const in
let args = List.map EConstr.of_constr args in
- let cd = Entries.DefinitionEntry { const with Entries.const_entry_opaque = opaque } in
+ let cd = Declare.DefinitionEntry { const with Proof_global.proof_entry_opaque = opaque } in
let decl = (cd, if opaque then IsProof Lemma else IsDefinition Definition) in
let cst () =
(* do not compute the implicit arguments, it may be costly *)
let () = Impargs.make_implicit_args false in
(* ppedrot: seems legit to have abstracted subproofs as local*)
- Declare.declare_private_constant ~role:Entries.Subproof ~internal:Declare.InternalTacticRequest ~local:true id decl
+ Declare.declare_private_constant ~internal:Declare.InternalTacticRequest ~local:ImportNeedQualified id decl
in
let cst, eff = Impargs.with_implicit_protection cst () in
- let inst = match const.Entries.const_entry_universes with
+ let inst = match const.Proof_global.proof_entry_universes with
| Entries.Monomorphic_entry _ -> EInstance.empty
| Entries.Polymorphic_entry (_, ctx) ->
- (* We mimick what the kernel does, that is ensuring that no additional
+ (* We mimic what the kernel does, that is ensuring that no additional
constraints appear in the body of polymorphic constants. Ideally this
should be enforced statically. *)
- let (_, body_uctx), _ = Future.force const.Entries.const_entry_body in
+ let (_, body_uctx), _ = Future.force const.Proof_global.proof_entry_body in
let () = assert (Univ.ContextSet.is_empty body_uctx) in
EInstance.make (Univ.UContext.instance ctx)
in
let lem = mkConstU (cst, inst) in
let evd = Evd.set_universe_context evd ectx in
- let open Safe_typing in
- let effs = concat_private eff
- Entries.(snd (Future.force const.const_entry_body)) in
+ let effs = Evd.concat_side_effects eff
+ Proof_global.(snd (Future.force const.proof_entry_body)) in
let solve =
Proofview.tclEFFECTS effs <*>
tacK lem args
diff --git a/tactics/abstract.mli b/tactics/abstract.mli
index 9d4f3cfb27..e278729f89 100644
--- a/tactics/abstract.mli
+++ b/tactics/abstract.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -20,3 +20,11 @@ val cache_term_by_tactic_then
-> unit Proofview.tactic
val tclABSTRACT : ?opaque:bool -> Id.t option -> unit Proofview.tactic -> unit Proofview.tactic
+
+(* Internal but used in a few places; should likely be made intro a
+ proper library function, or incorporated into the generic constant
+ save path *)
+val shrink_entry
+ : ('a, 'b) Context.Named.Declaration.pt list
+ -> 'c Proof_global.proof_entry
+ -> 'c Proof_global.proof_entry * Constr.t list
diff --git a/tactics/auto.ml b/tactics/auto.ml
index 4e0ec1f7e4..339d4de2a0 100644
--- a/tactics/auto.ml
+++ b/tactics/auto.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/auto.mli b/tactics/auto.mli
index 72d2292ffb..a834b4b12d 100644
--- a/tactics/auto.mli
+++ b/tactics/auto.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/autorewrite.ml b/tactics/autorewrite.ml
index 51708670f5..0bc410010c 100644
--- a/tactics/autorewrite.ml
+++ b/tactics/autorewrite.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -75,7 +75,9 @@ let find_matches bas pat =
let res = HintDN.search_pattern base pat in
List.map snd res
-let print_rewrite_hintdb env sigma bas =
+let print_rewrite_hintdb bas =
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
(str "Database " ++ str bas ++ fnl () ++
prlist_with_sep fnl
(fun h ->
diff --git a/tactics/autorewrite.mli b/tactics/autorewrite.mli
index 03e9414e0f..e5125ffe50 100644
--- a/tactics/autorewrite.mli
+++ b/tactics/autorewrite.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -42,7 +42,7 @@ val auto_multi_rewrite : ?conds:conditions -> string list -> Locus.clause -> uni
val auto_multi_rewrite_with : ?conds:conditions -> unit Proofview.tactic -> string list -> Locus.clause -> unit Proofview.tactic
-val print_rewrite_hintdb : Environ.env -> Evd.evar_map -> string -> Pp.t
+val print_rewrite_hintdb : string -> Pp.t
open Clenv
diff --git a/tactics/btermdn.ml b/tactics/btermdn.ml
index 06246ef584..a476381b17 100644
--- a/tactics/btermdn.ml
+++ b/tactics/btermdn.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/btermdn.mli b/tactics/btermdn.mli
index cc31fb0599..d80fa49cc1 100644
--- a/tactics/btermdn.mli
+++ b/tactics/btermdn.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/class_tactics.ml b/tactics/class_tactics.ml
index 160e4f164e..b0fb47726a 100644
--- a/tactics/class_tactics.ml
+++ b/tactics/class_tactics.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/class_tactics.mli b/tactics/class_tactics.mli
index b9291f6124..dc94e6a6fb 100644
--- a/tactics/class_tactics.mli
+++ b/tactics/class_tactics.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/contradiction.ml b/tactics/contradiction.ml
index d9d3764b2a..56e8e7a11f 100644
--- a/tactics/contradiction.ml
+++ b/tactics/contradiction.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/contradiction.mli b/tactics/contradiction.mli
index 4bb3263fb4..cd05d47193 100644
--- a/tactics/contradiction.mli
+++ b/tactics/contradiction.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/interp/declare.ml b/tactics/declare.ml
index 7ee7ecb5e8..ca5d265733 100644
--- a/interp/declare.ml
+++ b/tactics/declare.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -39,10 +39,15 @@ type constant_obj = {
cst_decl : Cooking.recipe option;
(** Non-empty only when rebuilding a constant after a section *)
cst_kind : logical_kind;
- cst_locl : bool;
+ cst_locl : import_status;
}
-type constant_declaration = Safe_typing.private_constants constant_entry * logical_kind
+type 'a constant_entry =
+ | DefinitionEntry of 'a Proof_global.proof_entry
+ | ParameterEntry of parameter_entry
+ | PrimitiveEntry of primitive_entry
+
+type constant_declaration = Evd.side_effects constant_entry * logical_kind
(* At load-time, the segment starting from the module name to the discharge *)
(* section (if Remark or Fact) is needed to access a construction *)
@@ -53,11 +58,19 @@ let load_constant i ((sp,kn), obj) =
Nametab.push (Nametab.Until i) sp (ConstRef con);
add_constant_kind con obj.cst_kind
+let cooking_info segment =
+ let modlist = replacement_context () in
+ let { abstr_ctx = hyps; abstr_subst = subst; abstr_uctx = uctx } = segment in
+ let named_ctx = List.map fst hyps in
+ let abstract = (named_ctx, subst, uctx) in
+ { Opaqueproof.modlist; abstract }
+
(* Opening means making the name without its module qualification available *)
let open_constant i ((sp,kn), obj) =
(* Never open a local definition *)
- if obj.cst_locl then ()
- else
+ match obj.cst_locl with
+ | ImportNeedQualified -> ()
+ | ImportDefaultBehavior ->
let con = Global.constant_of_delta_kn kn in
Nametab.push (Nametab.Exactly i) sp (ConstRef con)
@@ -89,13 +102,10 @@ let cache_constant ((sp,kn), obj) =
let discharge_constant ((sp, kn), obj) =
let con = Constant.make1 kn in
let from = Global.lookup_constant con in
- let modlist = replacement_context () in
- let { abstr_ctx = hyps; abstr_subst = subst; abstr_uctx = uctx } = section_segment_of_constant con in
- let abstract = (named_of_variable_context hyps, subst, uctx) in
- let new_decl = { from; info = { Opaqueproof.modlist; abstract } } in
+ let info = cooking_info (section_segment_of_constant con) in
(* This is a hack: when leaving a section, we lose the constant definition, so
we have to store it in the libobject to be able to retrieve it after. *)
- Some { obj with cst_decl = Some new_decl; }
+ Some { obj with cst_decl = Some { from; info } }
(* Hack to reduce the size of .vo: we keep only what load/open needs *)
let dummy_constant cst = {
@@ -133,25 +143,60 @@ let register_constant kn kind local =
update_tables kn
let register_side_effect (c, role) =
- let () = register_constant c (IsProof Theorem) false in
+ let () = register_constant c (IsProof Theorem) ImportDefaultBehavior in
match role with
- | Subproof -> ()
- | Schema (ind, kind) -> !declare_scheme kind [|ind,c|]
+ | None -> ()
+ | Some (Evd.Schema (ind, kind)) -> !declare_scheme kind [|ind,c|]
let default_univ_entry = Monomorphic_entry Univ.ContextSet.empty
let definition_entry ?fix_exn ?(opaque=false) ?(inline=false) ?types
- ?(univs=default_univ_entry) ?(eff=Safe_typing.empty_private_constants) body =
- { const_entry_body = Future.from_val ?fix_exn ((body,Univ.ContextSet.empty), eff);
- const_entry_secctx = None;
- const_entry_type = types;
- const_entry_universes = univs;
- const_entry_opaque = opaque;
- const_entry_feedback = None;
- const_entry_inline_code = inline}
-
-let define_constant ?role ?(export_seff=false) id cd =
+ ?(univs=default_univ_entry) ?(eff=Evd.empty_side_effects) body =
+ let open Proof_global in
+ { proof_entry_body = Future.from_val ?fix_exn ((body,Univ.ContextSet.empty), eff);
+ proof_entry_secctx = None;
+ proof_entry_type = types;
+ proof_entry_universes = univs;
+ proof_entry_opaque = opaque;
+ proof_entry_feedback = None;
+ proof_entry_inline_code = inline}
+
+let cast_proof_entry e =
+ let open Proof_global in
+ let (body, ctx), () = Future.force e.proof_entry_body in
+ {
+ const_entry_body = (body, ctx);
+ const_entry_secctx = e.proof_entry_secctx;
+ const_entry_feedback = e.proof_entry_feedback;
+ const_entry_type = e.proof_entry_type;
+ const_entry_universes = e.proof_entry_universes;
+ const_entry_inline_code = e.proof_entry_inline_code;
+ }
+
+let cast_opaque_proof_entry e =
+ let open Proof_global in
+ let typ = match e.proof_entry_type with
+ | None -> assert false
+ | Some typ -> typ
+ in
+ {
+ opaque_entry_body = e.proof_entry_body;
+ opaque_entry_secctx = e.proof_entry_secctx;
+ opaque_entry_feedback = e.proof_entry_feedback;
+ opaque_entry_type = typ;
+ opaque_entry_universes = e.proof_entry_universes;
+ }
+
+let get_roles export eff =
+ let map c =
+ let role = try Some (Cmap.find c eff.Evd.seff_roles) with Not_found -> None in
+ (c, role)
+ in
+ List.map map export
+
+let define_constant ~side_effect id cd =
+ let open Proof_global in
(* Logically define the constant and its subproofs, no libobject tampering *)
- let is_poly de = match de.const_entry_universes with
+ let is_poly de = match de.proof_entry_universes with
| Monomorphic_entry _ -> false
| Polymorphic_entry _ -> true
in
@@ -159,43 +204,64 @@ let define_constant ?role ?(export_seff=false) id cd =
let export, decl = (* We deal with side effects *)
match cd with
| DefinitionEntry de when
- export_seff ||
- not de.const_entry_opaque ||
+ not de.proof_entry_opaque ||
is_poly de ->
(* This globally defines the side-effects in the environment. *)
- let de, export = Global.export_private_constants ~in_section de in
- export, ConstantEntry (PureEntry, DefinitionEntry de)
- | _ -> [], ConstantEntry (EffectEntry, cd)
+ let body, eff = Future.force de.proof_entry_body in
+ let body, export = Global.export_private_constants ~in_section (body, eff.Evd.seff_private) in
+ let export = get_roles export eff in
+ let de = { de with proof_entry_body = Future.from_val (body, ()) } in
+ let cd = match de.proof_entry_opaque with
+ | true -> Entries.OpaqueEntry (cast_opaque_proof_entry de)
+ | false -> Entries.DefinitionEntry (cast_proof_entry de)
+ in
+ export, ConstantEntry (PureEntry, cd)
+ | DefinitionEntry de ->
+ let () = assert (de.proof_entry_opaque) in
+ let map (body, eff) = body, eff.Evd.seff_private in
+ let body = Future.chain de.proof_entry_body map in
+ let de = { de with proof_entry_body = body } in
+ let de = cast_opaque_proof_entry de in
+ [], ConstantEntry (EffectEntry, Entries.OpaqueEntry de)
+ | ParameterEntry e ->
+ [], ConstantEntry (PureEntry, Entries.ParameterEntry e)
+ | PrimitiveEntry e ->
+ [], ConstantEntry (PureEntry, Entries.PrimitiveEntry e)
in
- let kn, eff = Global.add_constant ?role ~in_section id decl in
+ let kn, eff = Global.add_constant ~side_effect ~in_section id decl in
kn, eff, export
-let declare_constant ?(internal = UserIndividualRequest) ?(local = false) id ?(export_seff=false) (cd, kind) =
+let declare_constant ?(internal = UserIndividualRequest) ?(local = ImportDefaultBehavior) id (cd, kind) =
let () = check_exists id in
- let kn, _eff, export = define_constant ~export_seff id cd in
+ let kn, (), export = define_constant ~side_effect:PureEntry id cd in
(* Register the libobjects attached to the constants and its subproofs *)
let () = List.iter register_side_effect export in
let () = register_constant kn kind local in
kn
-let declare_private_constant ~role ?(internal=UserIndividualRequest) ?(local = false) id (cd, kind) =
- let kn, eff, export = define_constant ~role id cd in
+let declare_private_constant ?role ?(internal=UserIndividualRequest) ?(local = ImportDefaultBehavior) id (cd, kind) =
+ let kn, eff, export = define_constant ~side_effect:EffectEntry id cd in
let () = assert (List.is_empty export) in
let () = register_constant kn kind local in
+ let seff_roles = match role with
+ | None -> Cmap.empty
+ | Some r -> Cmap.singleton kn r
+ in
+ let eff = { Evd.seff_private = eff; Evd.seff_roles; } in
kn, eff
let declare_definition ?(internal=UserIndividualRequest)
- ?(opaque=false) ?(kind=Decl_kinds.Definition) ?(local = false)
+ ?(opaque=false) ?(kind=Decl_kinds.Definition) ?(local = ImportDefaultBehavior)
id ?types (body,univs) =
let cb =
definition_entry ?types ~univs ~opaque body
in
declare_constant ~internal ~local id
- (Entries.DefinitionEntry cb, Decl_kinds.IsDefinition kind)
+ (DefinitionEntry cb, Decl_kinds.IsDefinition kind)
(** Declaration of section variables and local definitions *)
type section_variable_entry =
- | SectionLocalDef of Safe_typing.private_constants definition_entry
+ | SectionLocalDef of Evd.side_effects Proof_global.proof_entry
| SectionLocalAssum of types Univ.in_universe_context_set * polymorphic * bool (** Implicit status *)
type variable_declaration = DirPath.t * section_variable_entry * logical_kind
@@ -214,12 +280,14 @@ let cache_variable ((sp,_),o) =
let impl = if impl then Implicit else Explicit in
impl, true, poly, ctx
| SectionLocalDef (de) ->
- let (de, eff) = Global.export_private_constants ~in_section:true de in
- let () = List.iter register_side_effect eff in
(* The body should already have been forced upstream because it is a
section-local definition, but it's not enforced by typing *)
- let (body, uctx), () = Future.force de.const_entry_body in
- let poly, univs = match de.const_entry_universes with
+ let open Proof_global in
+ let (body, eff) = Future.force de.proof_entry_body in
+ let ((body, uctx), export) = Global.export_private_constants ~in_section:true (body, eff.Evd.seff_private) in
+ let eff = get_roles export eff in
+ let () = List.iter register_side_effect eff in
+ let poly, univs = match de.proof_entry_universes with
| Monomorphic_entry uctx -> false, uctx
| Polymorphic_entry (_, uctx) -> true, Univ.ContextSet.of_context uctx
in
@@ -229,12 +297,12 @@ let cache_variable ((sp,_),o) =
let () = Global.push_context_set (not poly) univs in
let se = {
secdef_body = body;
- secdef_secctx = de.const_entry_secctx;
- secdef_feedback = de.const_entry_feedback;
- secdef_type = de.const_entry_type;
+ secdef_secctx = de.proof_entry_secctx;
+ secdef_feedback = de.proof_entry_feedback;
+ secdef_type = de.proof_entry_type;
} in
let () = Global.push_named_def (id, se) in
- Explicit, de.const_entry_opaque,
+ Explicit, de.proof_entry_opaque,
poly, univs in
Nametab.push (Nametab.Until 1) (restrict_path 0 sp) (VarRef id);
add_section_variable id impl poly ctx;
@@ -276,18 +344,18 @@ let inductive_names sp kn mie =
let names, _ =
List.fold_left
(fun (names, n) ind ->
- let ind_p = (kn,n) in
- let names, _ =
- List.fold_left
- (fun (names, p) l ->
- let sp =
- Libnames.make_path dp l
- in
- ((sp, ConstructRef (ind_p,p)) :: names, p+1))
- (names, 1) ind.mind_entry_consnames in
- let sp = Libnames.make_path dp ind.mind_entry_typename
- in
- ((sp, IndRef ind_p) :: names, n+1))
+ let ind_p = (kn,n) in
+ let names, _ =
+ List.fold_left
+ (fun (names, p) l ->
+ let sp =
+ Libnames.make_path dp l
+ in
+ ((sp, ConstructRef (ind_p,p)) :: names, p+1))
+ (names, 1) ind.mind_entry_consnames in
+ let sp = Libnames.make_path dp ind.mind_entry_typename
+ in
+ ((sp, IndRef ind_p) :: names, n+1))
([], 0) mie.mind_entry_inds
in names
@@ -312,9 +380,8 @@ let cache_inductive ((sp,kn),mie) =
let discharge_inductive ((sp,kn),mie) =
let mind = Global.mind_of_delta_kn kn in
let mie = Global.lookup_mind mind in
- let repl = replacement_context () in
- let info = section_segment_of_mutual_inductive mind in
- Some (Discharge.process_inductive info repl mie)
+ let info = cooking_info (section_segment_of_mutual_inductive mind) in
+ Some (Cooking.cook_inductive info mie)
let dummy_one_inductive_entry mie = {
mind_entry_typename = mie.mind_entry_typename;
@@ -422,15 +489,15 @@ let fixpoint_message indexes l =
| [] -> anomaly (Pp.str "no recursive definition.")
| [id] -> Id.print id ++ str " is recursively defined" ++
(match indexes with
- | Some [|i|] -> str " (decreasing on "++pr_rank i++str " argument)"
- | _ -> mt ())
+ | Some [|i|] -> str " (decreasing on "++pr_rank i++str " argument)"
+ | _ -> mt ())
| l -> hov 0 (prlist_with_sep pr_comma Id.print l ++
- spc () ++ str "are recursively defined" ++
- match indexes with
- | Some a -> spc () ++ str "(decreasing respectively on " ++
- prvect_with_sep pr_comma pr_rank a ++
- str " arguments)"
- | None -> mt ()))
+ spc () ++ str "are recursively defined" ++
+ match indexes with
+ | Some a -> spc () ++ str "(decreasing respectively on " ++
+ prvect_with_sep pr_comma pr_rank a ++
+ str " arguments)"
+ | None -> mt ()))
let cofixpoint_message l =
Flags.if_verbose Feedback.msg_info (match l with
diff --git a/interp/declare.mli b/tactics/declare.mli
index 2ffde31fc0..0a2332748c 100644
--- a/interp/declare.mli
+++ b/tactics/declare.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -23,28 +23,33 @@ open Decl_kinds
(** Declaration of local constructions (Variable/Hypothesis/Local) *)
type section_variable_entry =
- | SectionLocalDef of Safe_typing.private_constants definition_entry
+ | SectionLocalDef of Evd.side_effects Proof_global.proof_entry
| SectionLocalAssum of types Univ.in_universe_context_set * polymorphic * bool (** Implicit status *)
+type 'a constant_entry =
+ | DefinitionEntry of 'a Proof_global.proof_entry
+ | ParameterEntry of parameter_entry
+ | PrimitiveEntry of primitive_entry
+
type variable_declaration = DirPath.t * section_variable_entry * logical_kind
val declare_variable : variable -> variable_declaration -> Libobject.object_name
-(** Declaration of global constructions
+(** Declaration of global constructions
i.e. Definition/Theorem/Axiom/Parameter/... *)
-type constant_declaration = Safe_typing.private_constants constant_entry * logical_kind
+type constant_declaration = Evd.side_effects constant_entry * logical_kind
type internal_flag =
| UserAutomaticRequest
| InternalTacticRequest
| UserIndividualRequest
-(* Defaut definition entries, transparent with no secctx or proj information *)
+(* Default definition entries, transparent with no secctx or proj information *)
val definition_entry : ?fix_exn:Future.fix_exn ->
?opaque:bool -> ?inline:bool -> ?types:types ->
?univs:Entries.universes_entry ->
- ?eff:Safe_typing.private_constants -> constr -> Safe_typing.private_constants definition_entry
+ ?eff:Evd.side_effects -> constr -> Evd.side_effects Proof_global.proof_entry
(** [declare_constant id cd] declares a global declaration
(constant/parameter) with name [id] in the current section; it returns
@@ -53,14 +58,14 @@ val definition_entry : ?fix_exn:Future.fix_exn ->
internal specify if the constant has been created by the kernel or by the
user, and in the former case, if its errors should be silent *)
val declare_constant :
- ?internal:internal_flag -> ?local:bool -> Id.t -> ?export_seff:bool -> constant_declaration -> Constant.t
+ ?internal:internal_flag -> ?local:import_status -> Id.t -> constant_declaration -> Constant.t
val declare_private_constant :
- role:side_effect_role -> ?internal:internal_flag -> ?local:bool -> Id.t -> constant_declaration -> Constant.t * Safe_typing.private_constants
+ ?role:Evd.side_effect_role -> ?internal:internal_flag -> ?local:import_status -> Id.t -> constant_declaration -> Constant.t * Evd.side_effects
-val declare_definition :
+val declare_definition :
?internal:internal_flag -> ?opaque:bool -> ?kind:definition_object_kind ->
- ?local:bool -> Id.t -> ?types:constr ->
+ ?local:import_status -> Id.t -> ?types:constr ->
constr Entries.in_universes_entry -> Constant.t
(** Since transparent constants' side effects are globally declared, we
@@ -90,5 +95,4 @@ val declare_univ_binders : GlobRef.t -> UnivNames.universe_binders -> unit
val declare_universe_context : polymorphic -> Univ.ContextSet.t -> unit
val do_universe : polymorphic -> lident list -> unit
-val do_constraint : polymorphic -> (Glob_term.glob_level * Univ.constraint_type * Glob_term.glob_level) list ->
- unit
+val do_constraint : polymorphic -> Glob_term.glob_constraint list -> unit
diff --git a/tactics/dnet.ml b/tactics/dnet.ml
index 17ff94ec9c..3171bee7ca 100644
--- a/tactics/dnet.ml
+++ b/tactics/dnet.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/dnet.mli b/tactics/dnet.mli
index 647bbd6bcb..a79afb4bf6 100644
--- a/tactics/dnet.mli
+++ b/tactics/dnet.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/eauto.ml b/tactics/eauto.ml
index 0857c05968..ac6253cf40 100644
--- a/tactics/eauto.ml
+++ b/tactics/eauto.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/eauto.mli b/tactics/eauto.mli
index 5aa2f42de1..ec99baef45 100644
--- a/tactics/eauto.mli
+++ b/tactics/eauto.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/elim.ml b/tactics/elim.ml
index 71ea0098a3..fcc2a94ef5 100644
--- a/tactics/elim.ml
+++ b/tactics/elim.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/elim.mli b/tactics/elim.mli
index ddfac3f2cd..42449be779 100644
--- a/tactics/elim.mli
+++ b/tactics/elim.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/elimschemes.ml b/tactics/elimschemes.ml
index 1fae4c3d9d..9cd2e7b52c 100644
--- a/tactics/elimschemes.ml
+++ b/tactics/elimschemes.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -30,7 +30,7 @@ let optimize_non_type_induction_scheme kind dep sort _ ind =
if check_scheme kind ind then
(* in case the inductive has a type elimination, generates only one
induction scheme, the other ones share the same code with the
- apropriate type *)
+ appropriate type *)
let cte, eff = find_scheme kind ind in
let sigma, cte = Evd.fresh_constant_instance env sigma cte in
let c = mkConstU cte in
@@ -51,7 +51,7 @@ let optimize_non_type_induction_scheme kind dep sort _ ind =
else
let sigma, pind = Evd.fresh_inductive_instance env sigma ind in
let sigma, c = build_induction_scheme env sigma pind dep sort in
- (c, Evd.evar_universe_context sigma), Safe_typing.empty_private_constants
+ (c, Evd.evar_universe_context sigma), Evd.empty_side_effects
let build_induction_scheme_in_type dep sort ind =
let env = Global.env () in
@@ -59,18 +59,18 @@ let build_induction_scheme_in_type dep sort ind =
let sigma, pind = Evd.fresh_inductive_instance env sigma ind in
let sigma, c = build_induction_scheme env sigma pind dep sort in
c, Evd.evar_universe_context sigma
-
+
let rect_scheme_kind_from_type =
declare_individual_scheme_object "_rect_nodep"
- (fun _ x -> build_induction_scheme_in_type false InType x, Safe_typing.empty_private_constants)
+ (fun _ x -> build_induction_scheme_in_type false InType x, Evd.empty_side_effects)
let rect_scheme_kind_from_prop =
declare_individual_scheme_object "_rect" ~aux:"_rect_from_prop"
- (fun _ x -> build_induction_scheme_in_type false InType x, Safe_typing.empty_private_constants)
+ (fun _ x -> build_induction_scheme_in_type false InType x, Evd.empty_side_effects)
let rect_dep_scheme_kind_from_type =
declare_individual_scheme_object "_rect" ~aux:"_rect_from_type"
- (fun _ x -> build_induction_scheme_in_type true InType x, Safe_typing.empty_private_constants)
+ (fun _ x -> build_induction_scheme_in_type true InType x, Evd.empty_side_effects)
let rec_scheme_kind_from_type =
declare_individual_scheme_object "_rec_nodep" ~aux:"_rec_nodep_from_type"
@@ -90,7 +90,7 @@ let ind_scheme_kind_from_type =
let sind_scheme_kind_from_type =
declare_individual_scheme_object "_sind_nodep"
- (fun _ x -> build_induction_scheme_in_type false InSProp x, Safe_typing.empty_private_constants)
+ (fun _ x -> build_induction_scheme_in_type false InSProp x, Evd.empty_side_effects)
let ind_dep_scheme_kind_from_type =
declare_individual_scheme_object "_ind" ~aux:"_ind_from_type"
@@ -98,7 +98,7 @@ let ind_dep_scheme_kind_from_type =
let sind_dep_scheme_kind_from_type =
declare_individual_scheme_object "_sind" ~aux:"_sind_from_type"
- (fun _ x -> build_induction_scheme_in_type true InSProp x, Safe_typing.empty_private_constants)
+ (fun _ x -> build_induction_scheme_in_type true InSProp x, Evd.empty_side_effects)
let ind_scheme_kind_from_prop =
declare_individual_scheme_object "_ind" ~aux:"_ind_from_prop"
@@ -106,8 +106,18 @@ let ind_scheme_kind_from_prop =
let sind_scheme_kind_from_prop =
declare_individual_scheme_object "_sind" ~aux:"_sind_from_prop"
- (fun _ x -> build_induction_scheme_in_type false InSProp x, Safe_typing.empty_private_constants)
-
+ (fun _ x -> build_induction_scheme_in_type false InSProp x, Evd.empty_side_effects)
+
+let nondep_elim_scheme from_kind to_kind =
+ match from_kind, to_kind with
+ | InProp, InProp -> ind_scheme_kind_from_prop
+ | InProp, InSProp -> sind_scheme_kind_from_prop
+ | InProp, InSet -> rec_scheme_kind_from_prop
+ | InProp, InType -> rect_scheme_kind_from_prop
+ | _ , InProp -> ind_scheme_kind_from_type
+ | _ , InSProp -> sind_scheme_kind_from_type
+ | _ , InSet -> rec_scheme_kind_from_type
+ | _ , InType -> rect_scheme_kind_from_type
(* Case analysis *)
@@ -120,24 +130,24 @@ let build_case_analysis_scheme_in_type dep sort ind =
let case_scheme_kind_from_type =
declare_individual_scheme_object "_case_nodep"
- (fun _ x -> build_case_analysis_scheme_in_type false InType x, Safe_typing.empty_private_constants)
+ (fun _ x -> build_case_analysis_scheme_in_type false InType x, Evd.empty_side_effects)
let case_scheme_kind_from_prop =
declare_individual_scheme_object "_case" ~aux:"_case_from_prop"
- (fun _ x -> build_case_analysis_scheme_in_type false InType x, Safe_typing.empty_private_constants)
+ (fun _ x -> build_case_analysis_scheme_in_type false InType x, Evd.empty_side_effects)
let case_dep_scheme_kind_from_type =
declare_individual_scheme_object "_case" ~aux:"_case_from_type"
- (fun _ x -> build_case_analysis_scheme_in_type true InType x, Safe_typing.empty_private_constants)
+ (fun _ x -> build_case_analysis_scheme_in_type true InType x, Evd.empty_side_effects)
let case_dep_scheme_kind_from_type_in_prop =
declare_individual_scheme_object "_casep_dep"
- (fun _ x -> build_case_analysis_scheme_in_type true InProp x, Safe_typing.empty_private_constants)
+ (fun _ x -> build_case_analysis_scheme_in_type true InProp x, Evd.empty_side_effects)
let case_dep_scheme_kind_from_prop =
declare_individual_scheme_object "_case_dep"
- (fun _ x -> build_case_analysis_scheme_in_type true InType x, Safe_typing.empty_private_constants)
+ (fun _ x -> build_case_analysis_scheme_in_type true InType x, Evd.empty_side_effects)
let case_dep_scheme_kind_from_prop_in_prop =
declare_individual_scheme_object "_casep"
- (fun _ x -> build_case_analysis_scheme_in_type true InProp x, Safe_typing.empty_private_constants)
+ (fun _ x -> build_case_analysis_scheme_in_type true InProp x, Evd.empty_side_effects)
diff --git a/tactics/elimschemes.mli b/tactics/elimschemes.mli
index 4472792449..11dbbc7155 100644
--- a/tactics/elimschemes.mli
+++ b/tactics/elimschemes.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -18,7 +18,7 @@ val optimize_non_type_induction_scheme :
Sorts.family ->
'b ->
Names.inductive ->
- (Constr.constr * UState.t) * Safe_typing.private_constants
+ (Constr.constr * UState.t) * Evd.side_effects
val rect_scheme_kind_from_prop : individual scheme_kind
val ind_scheme_kind_from_prop : individual scheme_kind
@@ -33,6 +33,7 @@ val sind_dep_scheme_kind_from_type : individual scheme_kind
val rec_scheme_kind_from_type : individual scheme_kind
val rec_dep_scheme_kind_from_type : individual scheme_kind
+val nondep_elim_scheme : Sorts.family -> Sorts.family -> individual scheme_kind
(** Case analysis schemes *)
diff --git a/tactics/eqdecide.ml b/tactics/eqdecide.ml
index e75a61d0c6..bdfd200988 100644
--- a/tactics/eqdecide.ml
+++ b/tactics/eqdecide.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -30,7 +30,7 @@ open Proofview.Notations
open Tacmach.New
open Tactypes
-(* This file containts the implementation of the tactics ``Decide
+(* This file contains the implementation of the tactics ``Decide
Equality'' and ``Compare''. They can be used to decide the
propositional equality of two objects that belongs to a small
inductive datatype --i.e., an inductive set such that all the
diff --git a/tactics/eqdecide.mli b/tactics/eqdecide.mli
index 1e898d427b..cd2039ba56 100644
--- a/tactics/eqdecide.mli
+++ b/tactics/eqdecide.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/eqschemes.ml b/tactics/eqschemes.ml
index 3fdd97616f..e8782aa674 100644
--- a/tactics/eqschemes.ml
+++ b/tactics/eqschemes.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -229,7 +229,7 @@ let sym_scheme_kind =
declare_individual_scheme_object "_sym_internal"
(fun _ ind ->
let c, ctx = build_sym_scheme (Global.env() (* side-effect! *)) ind in
- (c, ctx), Safe_typing.empty_private_constants)
+ (c, ctx), Evd.empty_side_effects)
(**********************************************************************)
(* Build the involutivity of symmetry for an inductive type *)
@@ -455,7 +455,7 @@ let build_l2r_rew_scheme dep env ind kind =
else
main_body))))))
in (c, UState.of_context_set ctx),
- Safe_typing.concat_private eff' eff
+ Evd.concat_side_effects eff' eff
(**********************************************************************)
(* Build the left-to-right rewriting lemma for hypotheses associated *)
@@ -708,7 +708,7 @@ let rew_l2r_dep_scheme_kind =
(**********************************************************************)
let rew_r2l_dep_scheme_kind =
declare_individual_scheme_object "_rew_dep"
- (fun _ ind -> build_r2l_rew_scheme true (Global.env()) ind InType,Safe_typing.empty_private_constants)
+ (fun _ ind -> build_r2l_rew_scheme true (Global.env()) ind InType,Evd.empty_side_effects)
(**********************************************************************)
(* Dependent rewrite from right-to-left in hypotheses *)
@@ -718,7 +718,7 @@ let rew_r2l_dep_scheme_kind =
(**********************************************************************)
let rew_r2l_forward_dep_scheme_kind =
declare_individual_scheme_object "_rew_fwd_dep"
- (fun _ ind -> build_r2l_forward_rew_scheme true (Global.env()) ind InType,Safe_typing.empty_private_constants)
+ (fun _ ind -> build_r2l_forward_rew_scheme true (Global.env()) ind InType,Evd.empty_side_effects)
(**********************************************************************)
(* Dependent rewrite from left-to-right in hypotheses *)
@@ -728,7 +728,7 @@ let rew_r2l_forward_dep_scheme_kind =
(**********************************************************************)
let rew_l2r_forward_dep_scheme_kind =
declare_individual_scheme_object "_rew_fwd_r_dep"
- (fun _ ind -> build_l2r_forward_rew_scheme true (Global.env()) ind InType,Safe_typing.empty_private_constants)
+ (fun _ ind -> build_l2r_forward_rew_scheme true (Global.env()) ind InType,Evd.empty_side_effects)
(**********************************************************************)
(* Non-dependent rewrite from either left-to-right in conclusion or *)
@@ -742,7 +742,7 @@ let rew_l2r_forward_dep_scheme_kind =
let rew_l2r_scheme_kind =
declare_individual_scheme_object "_rew_r"
(fun _ ind -> fix_r2l_forward_rew_scheme
- (build_r2l_forward_rew_scheme false (Global.env()) ind InType), Safe_typing.empty_private_constants)
+ (build_r2l_forward_rew_scheme false (Global.env()) ind InType), Evd.empty_side_effects)
(**********************************************************************)
(* Non-dependent rewrite from either right-to-left in conclusion or *)
@@ -752,7 +752,7 @@ let rew_l2r_scheme_kind =
(**********************************************************************)
let rew_r2l_scheme_kind =
declare_individual_scheme_object "_rew"
- (fun _ ind -> build_r2l_rew_scheme false (Global.env()) ind InType, Safe_typing.empty_private_constants)
+ (fun _ ind -> build_r2l_rew_scheme false (Global.env()) ind InType, Evd.empty_side_effects)
(* End of rewriting schemes *)
@@ -836,4 +836,4 @@ let congr_scheme_kind = declare_individual_scheme_object "_congr"
(fun _ ind ->
(* May fail if equality is not defined *)
build_congr (Global.env()) (get_coq_eq Univ.ContextSet.empty) ind,
- Safe_typing.empty_private_constants)
+ Evd.empty_side_effects)
diff --git a/tactics/eqschemes.mli b/tactics/eqschemes.mli
index 4749aebd96..b3e10013ac 100644
--- a/tactics/eqschemes.mli
+++ b/tactics/eqschemes.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -27,7 +27,7 @@ val rew_r2l_scheme_kind : individual scheme_kind
val build_r2l_rew_scheme : bool -> env -> inductive -> Sorts.family ->
constr Evd.in_evar_universe_context
val build_l2r_rew_scheme : bool -> env -> inductive -> Sorts.family ->
- constr Evd.in_evar_universe_context * Safe_typing.private_constants
+ constr Evd.in_evar_universe_context * Evd.side_effects
val build_r2l_forward_rew_scheme :
bool -> env -> inductive -> Sorts.family -> constr Evd.in_evar_universe_context
val build_l2r_forward_rew_scheme :
@@ -39,7 +39,7 @@ val build_sym_scheme : env -> inductive -> constr Evd.in_evar_universe_context
val sym_scheme_kind : individual scheme_kind
val build_sym_involutive_scheme : env -> inductive ->
- constr Evd.in_evar_universe_context * Safe_typing.private_constants
+ constr Evd.in_evar_universe_context * Evd.side_effects
val sym_involutive_scheme_kind : individual scheme_kind
(** Builds a congruence scheme for an equality type *)
diff --git a/tactics/equality.ml b/tactics/equality.ml
index 45a4799ea1..98db6cbb97 100644
--- a/tactics/equality.ml
+++ b/tactics/equality.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -352,35 +352,35 @@ let find_elim hdcncl lft2rgt dep cls ot =
(is_global_exists "core.JMeq.type" hdcncl
&& jmeq_same_dom env sigma ot)) && not dep
then
- let c =
+ let c =
match EConstr.kind sigma hdcncl with
- | Ind (ind_sp,u) ->
- let pr1 =
+ | Ind (ind_sp,u) ->
+ let pr1 =
lookup_eliminator env ind_sp (elimination_sort_of_clause cls gl)
- in
+ in
begin match lft2rgt, cls with
| Some true, None
| Some false, Some _ ->
- let c1 = destConstRef pr1 in
+ let c1 = destConstRef pr1 in
let mp,l = Constant.repr2 (Constant.make1 (Constant.canonical c1)) in
- let l' = Label.of_id (add_suffix (Label.to_id l) "_r") in
+ let l' = Label.of_id (add_suffix (Label.to_id l) "_r") in
let c1' = Global.constant_of_delta_kn (KerName.make mp l') in
- begin
- try
- let _ = Global.lookup_constant c1' in
- c1'
- with Not_found ->
+ begin
+ try
+ let _ = Global.lookup_constant c1' in
+ c1'
+ with Not_found ->
user_err ~hdr:"Equality.find_elim"
(str "Cannot find rewrite principle " ++ Label.print l' ++ str ".")
end
- | _ -> destConstRef pr1
+ | _ -> destConstRef pr1
end
| _ ->
(* cannot occur since we checked that we are in presence of
Logic.eq or Jmeq just before *)
assert false
in
- pf_constr_of_global (ConstRef c)
+ pf_constr_of_global (ConstRef c)
else
let scheme_name = match dep, lft2rgt, inccl with
(* Non dependent case *)
@@ -735,7 +735,7 @@ let find_positions env sigma ~keep_proofs ~no_discr t1 t2 =
let project env sorts posn t1 t2 =
let ty1 = get_type_of env sigma t1 in
let s = get_sort_family_of ~truncation_style:true env sigma ty1 in
- if Sorts.List.mem s sorts
+ if List.mem_f Sorts.family_equal s sorts
then [(List.rev posn,t1,t2)] else []
in
let rec findrec sorts posn t1 t2 =
@@ -746,7 +746,7 @@ let find_positions env sigma ~keep_proofs ~no_discr t1 t2 =
when Int.equal (List.length args1) (constructor_nallargs env sp1)
->
let sorts' =
- Sorts.List.intersect sorts (allowed_sorts env (fst sp1))
+ CList.intersect Sorts.family_equal sorts (sorts_below (top_allowed_sort env (fst sp1)))
in
(* both sides are fully applied constructors, so either we descend,
or we can discriminate here. *)
@@ -762,7 +762,7 @@ let find_positions env sigma ~keep_proofs ~no_discr t1 t2 =
List.flatten
(List.map2_i (fun i -> findrec sorts' ((sp1,adjust i)::posn))
0 rargs1 rargs2)
- else if Sorts.List.mem InType sorts' && not no_discr
+ else if List.mem_f Sorts.family_equal InType sorts' && not no_discr
then (* see build_discriminator *)
raise (DiscrFound (List.rev posn,sp1,sp2))
else
@@ -946,12 +946,12 @@ let build_coq_I () = pf_constr_of_global (lib_ref "core.True.I")
let rec build_discriminator env sigma true_0 false_0 dirn c = function
| [] ->
let ind = get_type_of env sigma c in
- build_selector env sigma dirn c ind true_0 false_0
+ build_selector env sigma dirn c ind true_0 (fst false_0)
| ((sp,cnum),argnum)::l ->
let (cnum_nlams,cnum_env,kont) = descend_then env sigma c cnum in
let newc = mkRel(cnum_nlams-argnum) in
let subval = build_discriminator cnum_env sigma true_0 false_0 dirn newc l in
- kont sigma subval (false_0,mkProp)
+ kont sigma subval false_0
(* Note: discrimination could be more clever: if some elimination is
not allowed because of a large impredicative constructor in the
@@ -983,25 +983,22 @@ let gen_absurdity id =
absurd_term=False
*)
-let ind_scheme_of_eq lbeq =
+let ind_scheme_of_eq lbeq to_kind =
let (mib,mip) = Global.lookup_inductive (destIndRef lbeq.eq) in
- let kind = inductive_sort_family mip in
+ let from_kind = inductive_sort_family mip in
(* use ind rather than case by compatibility *)
- let kind =
- if kind == InProp then Elimschemes.ind_scheme_kind_from_prop
- else Elimschemes.ind_scheme_kind_from_type in
+ let kind = Elimschemes.nondep_elim_scheme from_kind to_kind in
let c, eff = find_scheme kind (destIndRef lbeq.eq) in
ConstRef c, eff
-let discrimination_pf e (t,t1,t2) discriminator lbeq =
+let discrimination_pf e (t,t1,t2) discriminator lbeq to_kind =
build_coq_I () >>= fun i ->
- build_coq_False () >>= fun absurd_term ->
- let eq_elim, eff = ind_scheme_of_eq lbeq in
+ let eq_elim, eff = ind_scheme_of_eq lbeq to_kind in
Proofview.tclEFFECTS eff <*>
pf_constr_of_global eq_elim >>= fun eq_elim ->
Proofview.tclUNIT
- (applist (eq_elim, [t;t1;mkNamedLambda (make_annot e Sorts.Relevant) t discriminator;i;t2]), absurd_term)
+ (applist (eq_elim, [t;t1;mkNamedLambda (make_annot e Sorts.Relevant) t discriminator;i;t2]))
let eq_baseid = Id.of_string "e"
@@ -1018,21 +1015,23 @@ let apply_on_clause (f,t) clause =
let discr_positions env sigma (lbeq,eqn,(t,t1,t2)) eq_clause cpath dirn =
build_coq_True () >>= fun true_0 ->
build_coq_False () >>= fun false_0 ->
+ let false_ty = Retyping.get_type_of env sigma false_0 in
+ let false_kind = Retyping.get_sort_family_of env sigma false_0 in
let e = next_ident_away eq_baseid (vars_of_env env) in
let e_env = push_named (Context.Named.Declaration.LocalAssum (make_annot e Sorts.Relevant,t)) env in
let discriminator =
try
Proofview.tclUNIT
- (build_discriminator e_env sigma true_0 false_0 dirn (mkVar e) cpath)
+ (build_discriminator e_env sigma true_0 (false_0,false_ty) dirn (mkVar e) cpath)
with
UserError _ as ex -> Proofview.tclZERO ex
in
discriminator >>= fun discriminator ->
- discrimination_pf e (t,t1,t2) discriminator lbeq >>= fun (pf, absurd_term) ->
- let pf_ty = mkArrow eqn Sorts.Relevant absurd_term in
+ discrimination_pf e (t,t1,t2) discriminator lbeq false_kind >>= fun pf ->
+ let pf_ty = mkArrow eqn Sorts.Relevant false_0 in
let absurd_clause = apply_on_clause (pf,pf_ty) eq_clause in
let pf = Clenvtac.clenv_value_cast_meta absurd_clause in
- tclTHENS (assert_after Anonymous absurd_term)
+ tclTHENS (assert_after Anonymous false_0)
[onLastHypId gen_absurdity; (Proofview.V82.tactic (Refiner.refiner ~check:true EConstr.Unsafe.(to_constr pf)))]
let discrEq (lbeq,_,(t,t1,t2) as u) eq_clause =
diff --git a/tactics/equality.mli b/tactics/equality.mli
index 6f3e08ea02..f8166bba2d 100644
--- a/tactics/equality.mli
+++ b/tactics/equality.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -132,7 +132,7 @@ val subst_all : ?flags:subst_tactic_flags -> unit -> unit Proofview.tactic
(* Replace term *)
(* [replace_term dir_opt c cl]
- perfoms replacement of [c] by the first value found in context
+ performs replacement of [c] by the first value found in context
(according to [dir] if given to get the rewrite direction) in the clause [cl]
*)
val replace_term : bool option -> constr -> clause -> unit Proofview.tactic
diff --git a/tactics/genredexpr.ml b/tactics/genredexpr.ml
index 8209684c37..a65f515ce6 100644
--- a/tactics/genredexpr.ml
+++ b/tactics/genredexpr.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/hints.ml b/tactics/hints.ml
index cc56c1c425..e824c4bd64 100644
--- a/tactics/hints.ml
+++ b/tactics/hints.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -1518,7 +1518,7 @@ let pr_hint_term env sigma cl =
(* print all hints that apply to the concl of the current goal *)
let pr_applicable_hint pf =
let env = Global.env () in
- let pts = Proof_global.give_me_the_proof pf in
+ let pts = Proof_global.get_proof pf in
let Proof.{goals;sigma} = Proof.data pts in
match goals with
| [] -> CErrors.user_err Pp.(str "No focused goal.")
diff --git a/tactics/hints.mli b/tactics/hints.mli
index 7b8f96cdd8..839ef31189 100644
--- a/tactics/hints.mli
+++ b/tactics/hints.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/hipattern.ml b/tactics/hipattern.ml
index e1dad9ad20..a3a88df21e 100644
--- a/tactics/hipattern.ml
+++ b/tactics/hipattern.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -25,7 +25,7 @@ open Context.Rel.Declaration
module RelDecl = Context.Rel.Declaration
(* I implemented the following functions which test whether a term t
- is an inductive but non-recursive type, a general conjuction, a
+ is an inductive but non-recursive type, a general conjunction, a
general disjunction, or a type with no constructors.
They are more general than matching with or_term, and_term, etc,
diff --git a/tactics/hipattern.mli b/tactics/hipattern.mli
index b8c3ddb0f0..5ff257fbfe 100644
--- a/tactics/hipattern.mli
+++ b/tactics/hipattern.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -35,7 +35,7 @@ open Coqlib
contained in the arguments of the application *)
(** I implemented the following functions which test whether a term [t]
- is an inductive but non-recursive type, a general conjuction, a
+ is an inductive but non-recursive type, a general conjunction, a
general disjunction, or a type with no constructors.
They are more general than matching with [or_term], [and_term], etc,
diff --git a/tactics/ind_tables.ml b/tactics/ind_tables.ml
index b9485b8823..8526bdd373 100644
--- a/tactics/ind_tables.ml
+++ b/tactics/ind_tables.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -23,7 +23,6 @@ open Constr
open CErrors
open Util
open Declare
-open Entries
open Decl_kinds
open Pp
@@ -31,9 +30,9 @@ open Pp
(* Registering schemes in the environment *)
type mutual_scheme_object_function =
- internal_flag -> MutInd.t -> constr array Evd.in_evar_universe_context * Safe_typing.private_constants
+ internal_flag -> MutInd.t -> constr array Evd.in_evar_universe_context * Evd.side_effects
type individual_scheme_object_function =
- internal_flag -> inductive -> constr Evd.in_evar_universe_context * Safe_typing.private_constants
+ internal_flag -> inductive -> constr Evd.in_evar_universe_context * Evd.side_effects
type 'a scheme_kind = string
@@ -122,15 +121,15 @@ let define internal role id c poly univs =
let c = UnivSubst.nf_evars_and_universes_opt_subst (fun _ -> None) (UState.subst ctx) c in
let univs = UState.univ_entry ~poly ctx in
let entry = {
- const_entry_body =
+ Proof_global.proof_entry_body =
Future.from_val ((c,Univ.ContextSet.empty),
- Safe_typing.empty_private_constants);
- const_entry_secctx = None;
- const_entry_type = None;
- const_entry_universes = univs;
- const_entry_opaque = false;
- const_entry_inline_code = false;
- const_entry_feedback = None;
+ Evd.empty_side_effects);
+ proof_entry_secctx = None;
+ proof_entry_type = None;
+ proof_entry_universes = univs;
+ proof_entry_opaque = false;
+ proof_entry_inline_code = false;
+ proof_entry_feedback = None;
} in
let kn, eff = declare_private_constant ~role ~internal id (DefinitionEntry entry, Decl_kinds.IsDefinition Scheme) in
let () = match internal with
@@ -145,10 +144,10 @@ let define_individual_scheme_base kind suff f mode idopt (mind,i as ind) =
let id = match idopt with
| Some id -> id
| None -> add_suffix mib.mind_packets.(i).mind_typename suff in
- let role = Entries.Schema (ind, kind) in
+ let role = Evd.Schema (ind, kind) in
let const, neff = define mode role id c (Declareops.inductive_is_polymorphic mib) ctx in
declare_scheme kind [|ind,const|];
- const, Safe_typing.concat_private neff eff
+ const, Evd.concat_side_effects neff eff
let define_individual_scheme kind mode names (mind,i as ind) =
match Hashtbl.find scheme_object_table kind with
@@ -163,9 +162,9 @@ let define_mutual_scheme_base kind suff f mode names mind =
try Int.List.assoc i names
with Not_found -> add_suffix mib.mind_packets.(i).mind_typename suff) in
let fold i effs id cl =
- let role = Entries.Schema ((mind, i), kind)in
+ let role = Evd.Schema ((mind, i), kind)in
let cst, neff = define mode role id cl (Declareops.inductive_is_polymorphic mib) ctx in
- (Safe_typing.concat_private neff effs, cst)
+ (Evd.concat_side_effects neff effs, cst)
in
let (eff, consts) = Array.fold_left2_map_i fold eff ids cl in
let schemes = Array.mapi (fun i cst -> ((mind,i),cst)) consts in
@@ -180,7 +179,7 @@ let define_mutual_scheme kind mode names mind =
let find_scheme_on_env_too kind ind =
let s = String.Map.find kind (Indmap.find ind !scheme_map) in
- s, Safe_typing.empty_private_constants
+ s, Evd.empty_side_effects
let find_scheme ?(mode=InternalTacticRequest) kind (mind,i as ind) =
try find_scheme_on_env_too kind ind
diff --git a/tactics/ind_tables.mli b/tactics/ind_tables.mli
index 0eb4e47aeb..109fb64b2b 100644
--- a/tactics/ind_tables.mli
+++ b/tactics/ind_tables.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -22,9 +22,9 @@ type individual
type 'a scheme_kind
type mutual_scheme_object_function =
- internal_flag -> MutInd.t -> constr array Evd.in_evar_universe_context * Safe_typing.private_constants
+ internal_flag -> MutInd.t -> constr array Evd.in_evar_universe_context * Evd.side_effects
type individual_scheme_object_function =
- internal_flag -> inductive -> constr Evd.in_evar_universe_context * Safe_typing.private_constants
+ internal_flag -> inductive -> constr Evd.in_evar_universe_context * Evd.side_effects
(** Main functions to register a scheme builder *)
@@ -39,13 +39,13 @@ val declare_individual_scheme_object : string -> ?aux:string ->
val define_individual_scheme : individual scheme_kind ->
internal_flag (** internal *) ->
- Id.t option -> inductive -> Constant.t * Safe_typing.private_constants
+ Id.t option -> inductive -> Constant.t * Evd.side_effects
val define_mutual_scheme : mutual scheme_kind -> internal_flag (** internal *) ->
- (int * Id.t) list -> MutInd.t -> Constant.t array * Safe_typing.private_constants
+ (int * Id.t) list -> MutInd.t -> Constant.t array * Evd.side_effects
(** Main function to retrieve a scheme in the cache or to generate it *)
-val find_scheme : ?mode:internal_flag -> 'a scheme_kind -> inductive -> Constant.t * Safe_typing.private_constants
+val find_scheme : ?mode:internal_flag -> 'a scheme_kind -> inductive -> Constant.t * Evd.side_effects
val check_scheme : 'a scheme_kind -> inductive -> bool
diff --git a/tactics/inv.ml b/tactics/inv.ml
index 776148d4cf..49d0428a6f 100644
--- a/tactics/inv.ml
+++ b/tactics/inv.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/inv.mli b/tactics/inv.mli
index bbd1f3352a..a053b18eed 100644
--- a/tactics/inv.mli
+++ b/tactics/inv.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/leminv.ml b/tactics/leminv.ml
index 6efa1ece9c..d8f4b66d0e 100644
--- a/tactics/leminv.ml
+++ b/tactics/leminv.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -22,7 +22,6 @@ open Namegen
open Evd
open Printer
open Reductionops
-open Entries
open Inductiveops
open Tacmach.New
open Clenv
@@ -98,7 +97,7 @@ let get_local_sign sign =
in
List.fold_right add_local lid nil_sign
*)
-(* returs the identifier of lid that was the latest declared in sign.
+(* returns the identifier of lid that was the latest declared in sign.
* (i.e. is the identifier id of lid such that
* sign_length (sign_prefix id sign) > sign_length (sign_prefix id' sign) >
* for any id'<>id in lid).
diff --git a/tactics/leminv.mli b/tactics/leminv.mli
index f42e5a8b05..41f83d3888 100644
--- a/tactics/leminv.mli
+++ b/tactics/leminv.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/redexpr.ml b/tactics/redexpr.ml
index 447b908a1d..fc7b126ee5 100644
--- a/tactics/redexpr.ml
+++ b/tactics/redexpr.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/redexpr.mli b/tactics/redexpr.mli
index 1f65862701..a7e39fb7b4 100644
--- a/tactics/redexpr.mli
+++ b/tactics/redexpr.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/redops.ml b/tactics/redops.ml
index 6f83ea9a34..e0473cbefd 100644
--- a/tactics/redops.ml
+++ b/tactics/redops.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/redops.mli b/tactics/redops.mli
index 7254f29b25..964e80e5ab 100644
--- a/tactics/redops.mli
+++ b/tactics/redops.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/tacticals.ml b/tactics/tacticals.ml
index dcd63fe760..2d0806b2e0 100644
--- a/tactics/tacticals.ml
+++ b/tactics/tacticals.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -43,12 +43,8 @@ let tclTHENS = Refiner.tclTHENS
let tclTHENSV = Refiner.tclTHENSV
let tclTHENSFIRSTn = Refiner.tclTHENSFIRSTn
let tclTHENSLASTn = Refiner.tclTHENSLASTn
-let tclTHENFIRSTn = Refiner.tclTHENFIRSTn
-let tclTHENLASTn = Refiner.tclTHENLASTn
let tclREPEAT = Refiner.tclREPEAT
-let tclREPEAT_MAIN = Refiner.tclREPEAT_MAIN
let tclFIRST = Refiner.tclFIRST
-let tclSOLVE = Refiner.tclSOLVE
let tclTRY = Refiner.tclTRY
let tclCOMPLETE = Refiner.tclCOMPLETE
let tclAT_LEAST_ONCE = Refiner.tclAT_LEAST_ONCE
@@ -58,10 +54,6 @@ let tclDO = Refiner.tclDO
let tclPROGRESS = Refiner.tclPROGRESS
let tclSHOWHYPS = Refiner.tclSHOWHYPS
let tclTHENTRY = Refiner.tclTHENTRY
-let tclIFTHENELSE = Refiner.tclIFTHENELSE
-let tclIFTHENSELSE = Refiner.tclIFTHENSELSE
-let tclIFTHENSVELSE = Refiner.tclIFTHENSVELSE
-let tclIFTHENTRYELSEMUST = Refiner.tclIFTHENTRYELSEMUST
(************************************************************************)
(* Tacticals applying on hypotheses *)
@@ -481,7 +473,7 @@ module New = struct
) <*>
tclUNIT res
- (* Try the first thats solves the current goal *)
+ (* Try the first that solves the current goal *)
let tclSOLVE tacl = tclFIRST (List.map tclCOMPLETE tacl)
let tclPROGRESS t =
diff --git a/tactics/tacticals.mli b/tactics/tacticals.mli
index 201b7801c3..c6aef6a554 100644
--- a/tactics/tacticals.mli
+++ b/tactics/tacticals.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -31,13 +31,9 @@ val tclTHENLAST : tactic -> tactic -> tactic
val tclTHENS : tactic -> tactic list -> tactic
val tclTHENSV : tactic -> tactic array -> tactic
val tclTHENSLASTn : tactic -> tactic -> tactic array -> tactic
-val tclTHENLASTn : tactic -> tactic array -> tactic
val tclTHENSFIRSTn : tactic -> tactic array -> tactic -> tactic
-val tclTHENFIRSTn : tactic -> tactic array -> tactic
val tclREPEAT : tactic -> tactic
-val tclREPEAT_MAIN : tactic -> tactic
val tclFIRST : tactic list -> tactic
-val tclSOLVE : tactic list -> tactic
val tclTRY : tactic -> tactic
val tclCOMPLETE : tactic -> tactic
val tclAT_LEAST_ONCE : tactic -> tactic
@@ -49,11 +45,6 @@ val tclSHOWHYPS : tactic -> tactic
val tclTHENTRY : tactic -> tactic -> tactic
val tclMAP : ('a -> tactic) -> 'a list -> tactic
-val tclIFTHENELSE : tactic -> tactic -> tactic -> tactic
-val tclIFTHENSELSE : tactic -> tactic list -> tactic -> tactic
-val tclIFTHENSVELSE : tactic -> tactic array -> tactic -> tactic
-val tclIFTHENTRYELSEMUST : tactic -> tactic -> tactic
-
(** {6 Tacticals applying to hypotheses } *)
val onNthHypId : int -> (Id.t -> tactic) -> tactic
diff --git a/tactics/tactics.ml b/tactics/tactics.ml
index 9dafa8bad9..9dabe56816 100644
--- a/tactics/tactics.ml
+++ b/tactics/tactics.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -3019,14 +3019,14 @@ let specialize (c,lbind) ipat =
(* We grab names used in product to remember them at re-abstracting phase *)
let typ_of_c_hd = pf_get_type_of gl c_hd in
let lprod, concl = decompose_prod_assum sigma typ_of_c_hd in
- (* accumulator args: arguments to apply to c_hd: all infered
+ (* accumulator args: arguments to apply to c_hd: all inferred
args + re-abstracted rels *)
let rec rebuild_lambdas sigma lprd args hd l =
match lprd , l with
| _, [] -> sigma,applist (hd, (List.map (nf_evar sigma) args))
| Context.Rel.Declaration.LocalAssum(nme,_)::lp' , t::l' when occur_meta sigma t ->
(* nme has not been resolved, let us re-abstract it. Same
- name but type updated by instanciation of other args. *)
+ name but type updated by instantiation of other args. *)
let sigma,new_typ_of_t = Typing.type_of clause.env sigma t in
let r = Retyping.relevance_of_type env sigma new_typ_of_t in
let liftedargs = List.map liftrel args in
@@ -4292,7 +4292,7 @@ let induction_tac with_evars params indvars elim =
let elimc = contract_letin_in_lam_header sigma elimc in
let elimc = mkCast (elimc, DEFAULTcast, elimt) in
let elimclause = Tacmach.New.pf_apply make_clenv_binding gl (elimc,elimt) lbindelimc in
- (* elimclause' is built from elimclause by instanciating all args and params. *)
+ (* elimclause' is built from elimclause by instantiating all args and params. *)
let elimclause' = recolle_clenv i params indvars elimclause gl in
(* one last resolution (useless?) *)
let resolved = clenv_unique_resolver ~flags:(elim_flags ()) elimclause' gl in
diff --git a/tactics/tactics.mli b/tactics/tactics.mli
index 32c64bacf6..d3c800df20 100644
--- a/tactics/tactics.mli
+++ b/tactics/tactics.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/tactics.mllib b/tactics/tactics.mllib
index 1861c5b99b..6dd749aa0d 100644
--- a/tactics/tactics.mllib
+++ b/tactics/tactics.mllib
@@ -1,3 +1,4 @@
+Declare
Dnet
Dn
Btermdn
diff --git a/tactics/term_dnet.ml b/tactics/term_dnet.ml
index 2831aec9f6..c3132ed6f0 100644
--- a/tactics/term_dnet.ml
+++ b/tactics/term_dnet.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tactics/term_dnet.mli b/tactics/term_dnet.mli
index 7bce577899..625a97fdb9 100644
--- a/tactics/term_dnet.mli
+++ b/tactics/term_dnet.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/Makefile b/test-suite/Makefile
index 94011447d7..c0bdb29fab 100644
--- a/test-suite/Makefile
+++ b/test-suite/Makefile
@@ -1,6 +1,6 @@
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
-## v # INRIA, CNRS and contributors - Copyright 1999-2018 ##
+## v # INRIA, CNRS and contributors - Copyright 1999-2019 ##
## <O___,, # (see CREDITS file for the list of authors) ##
## \VV/ ###############################################################
## // # This file is distributed under the terms of the ##
@@ -97,7 +97,7 @@ COMPLEXITY := $(if $(bogomips),complexity)
BUGS := bugs/opened bugs/closed
INTERACTIVE := interactive
UNIT_TESTS := unit-tests
-VSUBSYSTEMS := prerequisite success failure $(BUGS) output \
+VSUBSYSTEMS := prerequisite success failure $(BUGS) output output-coqtop \
output-modulo-time $(INTERACTIVE) micromega $(COMPLEXITY) modules stm \
coqdoc ssr arithmetic ltac2
@@ -164,6 +164,7 @@ summary:
$(call summary_dir, "Failure tests", failure); \
$(call summary_dir, "Bugs tests", bugs); \
$(call summary_dir, "Output tests", output); \
+ $(call summary_dir, "Output tests with coqtop", output-coqtop); \
$(call summary_dir, "Output (modulo time changes) tests", output-modulo-time); \
$(call summary_dir, "Interactive tests", interactive); \
$(call summary_dir, "Micromega tests", micromega); \
@@ -299,6 +300,11 @@ unit-tests/%.ml.log: unit-tests/%.ml unit-tests/src/$(UNIT_LINK)
$(HIDE)$(OCAMLBEST) -linkall -linkpkg -package coq.toplevel,oUnit \
-I unit-tests/src $(UNIT_LINK) $< -o $<.test;
$(HIDE)./$<.test
+unit-tests/ide/%.ml.log: unit-tests/ide/%.ml unit-tests/src/$(UNIT_LINK)
+ $(SHOW) 'TEST $<'
+ $(HIDE)$(OCAMLBEST) -linkall -linkpkg -package coq.ide,oUnit \
+ -I unit-tests/src $(UNIT_LINK) $< -o $<.test;
+ $(HIDE)./$<.test
#######################################################################
# Other generic tests
@@ -335,16 +341,16 @@ $(addsuffix .log,$(wildcard ssr/*.v success/*.v micromega/*.v modules/*.v arithm
$(FAIL); \
fi; \
} > "$@"
- @echo "CHECK $<"
- $(HIDE){ \
- opts="$(if $(findstring modules/,$<),-R modules Mods -norec Mods.$(shell basename $< .v),-I $(shell dirname $<) -norec $(shell basename $< .v))"; \
+ @if ! grep -q -F "Error!" $@; then echo "CHECK $<"; fi
+ $(HIDE)if ! grep -q -F "Error!" $@; then { \
+ opts="$(if $(findstring modules/,$<),-R modules Mods -norec Mods.$(shell basename $< .v),-I $(shell dirname $<) -norec $(shell basename $< .v))"; \
$(coqchk) -silent $(call get_set_impredicativity,$<) $$opts 2>&1; R=$$?; \
if [ $$R != 0 ]; then \
echo $(log_failure); \
echo " $<...could not be checked (Error!)" ; \
$(FAIL); \
fi; \
- } > "$(shell dirname $<)/$(shell basename $< .v).chk.log"
+ } > "$(shell dirname $<)/$(shell basename $< .v).chk.log"; fi
stm: $(wildcard stm/*.v:%.v=%.v.log)
$(addsuffix .log,$(wildcard stm/*.v)): %.v.log: %.v
@@ -362,15 +368,15 @@ $(addsuffix .log,$(wildcard stm/*.v)): %.v.log: %.v
$(FAIL); \
fi; \
} > "$@"
- @echo "CHECK $<"
- $(HIDE){ \
+ @if ! grep -q -F "Error!" $@; then echo "CHECK $<"; fi
+ $(HIDE)if ! grep -q -F "Error!" $@; then { \
$(coqchk) -silent -I $(shell dirname $<) -norec $(shell basename $< .v) 2>&1; R=$$?; \
if [ $$R != 0 ]; then \
echo $(log_failure); \
echo " $<...could not be checked (Error!)" ; \
$(FAIL); \
fi; \
- } > "$(shell dirname $<)/$(shell basename $< .v).chk.log"
+ } > "$(shell dirname $<)/$(shell basename $< .v).chk.log"; fi
$(addsuffix .log,$(wildcard failure/*.v)): %.v.log: %.v $(PREREQUISITELOG)
@echo "TEST $< $(call get_coq_prog_args_in_parens,"$<")"
@@ -386,15 +392,15 @@ $(addsuffix .log,$(wildcard failure/*.v)): %.v.log: %.v $(PREREQUISITELOG)
$(FAIL); \
fi; \
} > "$@"
- @echo "CHECK $<"
- $(HIDE){ \
+ @if ! grep -q -F "Error!" $@; then echo "CHECK $<"; fi
+ $(HIDE)if ! grep -q -F "Error!" $@; then { \
$(coqchk) -silent -I $(shell dirname $<) -norec $(shell basename $< .v) 2>&1; R=$$?; \
if [ $$R != 0 ]; then \
echo $(log_failure); \
echo " $<...could not be checked (Error!)" ; \
$(FAIL); \
fi; \
- } > "$(shell dirname $<)/$(shell basename $< .v).chk.log"
+ } > "$(shell dirname $<)/$(shell basename $< .v).chk.log"; fi
$(addsuffix .log,$(wildcard output/*.v)): %.v.log: %.v %.out $(PREREQUISITELOG)
@echo "TEST $< $(call get_coq_prog_args_in_parens,"$<")"
@@ -420,8 +426,32 @@ $(addsuffix .log,$(wildcard output/*.v)): %.v.log: %.v %.out $(PREREQUISITELOG)
fi; \
} > "$@"
+$(addsuffix .log,$(wildcard output-coqtop/*.v)): %.v.log: %.v %.out $(PREREQUISITELOG)
+ @echo "TEST $< $(call get_coq_prog_args_in_parens,"$<")"
+ $(HIDE){ \
+ echo $(call log_intro,$<); \
+ output=$*.out.real; \
+ $(coqtop) < "$<" $(call get_coq_prog_args,"$<") 2>&1 \
+ | grep -v "Welcome to Coq" \
+ | grep -v "\[Loading ML file" \
+ | grep -v "Skipping rcfile loading" \
+ | grep -v "^<W>" \
+ | sed 's/File "[^"]*"/File "stdin"/' \
+ > $$output; \
+ diff -u --strip-trailing-cr $*.out $$output 2>&1; R=$$?; times; \
+ if [ $$R = 0 ]; then \
+ echo $(log_success); \
+ echo " $<...Ok"; \
+ rm $$output; \
+ else \
+ echo $(log_failure); \
+ echo " $<...Error! (unexpected output)"; \
+ $(FAIL); \
+ fi; \
+ } > "$@"
+
.PHONY: approve-output
-approve-output: output
+approve-output: output output-coqtop
$(HIDE)for f in output/*.out.real; do \
mv "$$f" "$${f%.real}"; \
echo "Updated $${f%.real}!"; \
@@ -561,7 +591,6 @@ $(patsubst %.sh,%.log,$(wildcard misc/*.sh)): %.log: %.sh $(PREREQUISITELOG)
export coqc="$(coqc)"; \
export coqtop="$(coqc)"; \
export coqdep="$(coqdep)"; \
- export coqtopbyte="$(coqtopbyte)"; \
"$<" 2>&1; R=$$?; times; \
if [ $$R = 0 ]; then \
echo $(log_success); \
diff --git a/test-suite/README.md b/test-suite/README.md
index e81da0830f..a2d5905710 100644
--- a/test-suite/README.md
+++ b/test-suite/README.md
@@ -76,7 +76,9 @@ The error "(bug seems to be opened, please check)" when running
compile.
There are also output tests in [`output`](output) which consist of a `.v` file
-and a `.out` file with the expected output.
+and a `.out` file with the expected output. Output tests in this directory are
+run with coqc in -test-mode. Output tests in [`output-coqtop`](output-coqtop)
+work the same way, but are run with coqtop.
There are unit tests of OCaml code in [`unit-tests`](unit-tests). These tests
are contained in `.ml` files, and rely on the `OUnit` unit-test framework, as
diff --git a/test-suite/bugs/closed/bug_10161.v b/test-suite/bugs/closed/bug_10161.v
new file mode 100644
index 0000000000..3d262b89fe
--- /dev/null
+++ b/test-suite/bugs/closed/bug_10161.v
@@ -0,0 +1,8 @@
+Inductive SwitchT (A : Type) : Type :=
+| switchT : forall T, SwitchT T -> SwitchT A.
+
+Set Printing Universes.
+
+Fail Inductive UseSwitchT :=
+| useSwitchT : SwitchT UseSwitchT -> UseSwitchT.
+(* used to stack overflow, should be univ inconsistency cannot satisfy u = u+1 *)
diff --git a/test-suite/bugs/closed/bug_10197.v b/test-suite/bugs/closed/bug_10197.v
new file mode 100644
index 0000000000..920c5f5cb7
--- /dev/null
+++ b/test-suite/bugs/closed/bug_10197.v
@@ -0,0 +1,16 @@
+(* Some check about implicit arguments in fix *)
+
+Check fix f {f:nat} := match f with 0 => true | _ => false end.
+
+CoInductive stream := { this : nat ; next : option stream }.
+
+Check cofix f {f:nat} := {| this := f ; next := None |}.
+
+(* The following was ok from 8.4, just checking that the order is not
+ mixed up accidentally *)
+
+Check fix f (x : nat) (x : forall {a:nat}, a = 0 -> nat) :=
+ match x eq_refl with 0 => true | _ => false end.
+
+Check fix f (x : forall {a:nat}, a = 0 -> bool) (x : nat) :=
+ match x with 0 => true | _ => false end.
diff --git a/test-suite/bugs/closed/bug_10225.v b/test-suite/bugs/closed/bug_10225.v
new file mode 100644
index 0000000000..6d6bb39a65
--- /dev/null
+++ b/test-suite/bugs/closed/bug_10225.v
@@ -0,0 +1,7 @@
+
+Class Bar := {}.
+Instance bb : Bar := {}.
+
+Class Foo := { xx : Bar; foo : nat }.
+
+Fail Instance bar : Foo := { foo := 1 + 1; foo := 2 + 2 }.
diff --git a/test-suite/bugs/closed/bug_10264.v b/test-suite/bugs/closed/bug_10264.v
new file mode 100644
index 0000000000..8351f8325b
--- /dev/null
+++ b/test-suite/bugs/closed/bug_10264.v
@@ -0,0 +1,10 @@
+Require Import Program.Tactics.
+
+Definition bla (A:Type) := A.
+Existing Class bla.
+
+Program Instance fubar : bla nat := {}.
+Next Obligation.
+Fail exact bool.
+exact 0.
+Qed.
diff --git a/test-suite/bugs/closed/bug_1618.v b/test-suite/bugs/closed/bug_1618.v
index a7be12e26f..041055a38f 100644
--- a/test-suite/bugs/closed/bug_1618.v
+++ b/test-suite/bugs/closed/bug_1618.v
@@ -20,3 +20,4 @@ a :=
match a return (P a) with
| A1 n => f n
end.
+Proof. Defined.
diff --git a/test-suite/bugs/closed/bug_2137.v b/test-suite/bugs/closed/bug_2137.v
index b1f54b1766..981cc94dc1 100644
--- a/test-suite/bugs/closed/bug_2137.v
+++ b/test-suite/bugs/closed/bug_2137.v
@@ -3,7 +3,7 @@
The fsetdec tactic is sensitive to which way round the arguments to <> are.
In the small, self-contained example below, it is able to solve the goal
if it knows that "b <> a", but not if it knows that "a <> b". I would expect
-it to be able to solve hte goal in either case.
+it to be able to solve the goal in either case.
I have coq r12238.
diff --git a/test-suite/bugs/closed/bug_2603.v b/test-suite/bugs/closed/bug_2603.v
index 371bfdc575..64c656a7a6 100644
--- a/test-suite/bugs/closed/bug_2603.v
+++ b/test-suite/bugs/closed/bug_2603.v
@@ -3,7 +3,7 @@
As noticed by A. Appel in bug #2603, module names and definition
names used to be in the same namespace. But conflict with names
of constructors (or 2nd mutual inductive...) used to not be checked
-enough, leading to stange situations.
+enough, leading to strange situations.
- In 8.3pl3 we introduced checks that forbid uniformly the following
situations.
diff --git a/test-suite/bugs/closed/bug_3080.v b/test-suite/bugs/closed/bug_3080.v
index 36ab7ff599..06719653fe 100644
--- a/test-suite/bugs/closed/bug_3080.v
+++ b/test-suite/bugs/closed/bug_3080.v
@@ -15,4 +15,4 @@ Notation " g ∘ f " := (compose g f)
(at level 40, left associativity) : function_scope.
Fail Check (fun x => x) ∘ (fun x => x). (* this [Check] should fail, as [function_scope] is not opened *)
-Check compose ((fun x => x) ∘ (fun x => x)) (fun x => x). (* this check should succeed, as [function_scope] should be automatically bound in the arugments to [compose] *)
+Check compose ((fun x => x) ∘ (fun x => x)) (fun x => x). (* this check should succeed, as [function_scope] should be automatically bound in the arguments to [compose] *)
diff --git a/test-suite/bugs/closed/bug_3810.v b/test-suite/bugs/closed/bug_3810.v
new file mode 100644
index 0000000000..0b2bef8a9b
--- /dev/null
+++ b/test-suite/bugs/closed/bug_3810.v
@@ -0,0 +1,6 @@
+Class Foo.
+
+Fixpoint test (H : Foo) (n : nat) {A : Type} {struct n} : A.
+Admitted.
+
+Check fun (x:Foo) => test x 0.
diff --git a/test-suite/bugs/closed/bug_4306.v b/test-suite/bugs/closed/bug_4306.v
index 80c348d207..f1bce04451 100644
--- a/test-suite/bugs/closed/bug_4306.v
+++ b/test-suite/bugs/closed/bug_4306.v
@@ -30,3 +30,5 @@ Function bar (xys : (list nat * list nat)) {measure (fun xys => length (fst xys)
| Gt => y :: foo (xs, ys')
end
end.
+Proof.
+Defined.
diff --git a/test-suite/bugs/closed/bug_4503.v b/test-suite/bugs/closed/bug_4503.v
index 5162f352df..26731e3292 100644
--- a/test-suite/bugs/closed/bug_4503.v
+++ b/test-suite/bugs/closed/bug_4503.v
@@ -29,7 +29,7 @@ End ILogic.
Set Printing Universes.
-(* There is stil a problem if the class is universe polymorphic *)
+(* There is still a problem if the class is universe polymorphic *)
Section Embed_ILogic_Pre.
Polymorphic Universes A T.
Fail Context {A : Type@{A}} {ILA: ILogic.ILogic@{A} A}.
diff --git a/test-suite/bugs/closed/bug_4720.v b/test-suite/bugs/closed/bug_4720.v
index 704331e784..a870792c39 100644
--- a/test-suite/bugs/closed/bug_4720.v
+++ b/test-suite/bugs/closed/bug_4720.v
@@ -34,7 +34,7 @@ End WithModPriv.
identical by the extraction.
In Coq 8.5 and 8.6, the extractions of WithMod, WithDef, WithModPriv
- were all causing Anomaly or Assert Failure. This shoud be fixed now.
+ were all causing Anomaly or Assert Failure. This should be fixed now.
*)
Require Extraction.
diff --git a/test-suite/bugs/closed/bug_4798.v b/test-suite/bugs/closed/bug_4798.v
deleted file mode 100644
index f238086633..0000000000
--- a/test-suite/bugs/closed/bug_4798.v
+++ /dev/null
@@ -1,5 +0,0 @@
-(* DO NOT MODIFY THIS FILE DIRECTLY *)
-(* It is autogenerated by dev/tools/update-compat.py. *)
-Check match 2 with 0 => 0 | S n => n end.
-Notation "|" := 1 (compat "8.8").
-Check match 2 with 0 => 0 | S n => n end. (* fails *)
diff --git a/test-suite/bugs/closed/bug_4869.v b/test-suite/bugs/closed/bug_4869.v
index ac5d7ea287..1fe91de72d 100644
--- a/test-suite/bugs/closed/bug_4869.v
+++ b/test-suite/bugs/closed/bug_4869.v
@@ -6,7 +6,9 @@ Fail Constraint i = Set.
Constraint Set <= i.
Constraint Set < i.
Fail Constraint i < j. (* undeclared j *)
+(* Now a parsing error
Fail Constraint i < Type. (* anonymous *)
+*)
Set Universe Polymorphism.
diff --git a/test-suite/bugs/closed/bug_5123.v b/test-suite/bugs/closed/bug_5123.v
index 17231bffcf..a4029aeee0 100644
--- a/test-suite/bugs/closed/bug_5123.v
+++ b/test-suite/bugs/closed/bug_5123.v
@@ -28,6 +28,6 @@ Goal True.
opose (@vect_sigT_eqdec _ _ _ _) as H.
Unshelve.
all:cycle 3.
- eapply existT. (*This does no typeclass resultion, which is correct.*)
+ eapply existT. (*This does no typeclass resolution, which is correct.*)
Focus 5.
Abort.
diff --git a/test-suite/bugs/closed/bug_5149.v b/test-suite/bugs/closed/bug_5149.v
index ae32217057..b56abfe42e 100644
--- a/test-suite/bugs/closed/bug_5149.v
+++ b/test-suite/bugs/closed/bug_5149.v
@@ -36,7 +36,7 @@ Proof.
solve [ unshelve (subst; eapply interpf_SmartVarVar; eassumption) ] || fail
"too early".
Undo.
- (** Implicitely at the dot. The first fails because unshelve adds a goal, and solve hence fails. The second has an ambiant unification problem that is solved after solve *)
+ (** Implicitly at the dot. The first fails because unshelve adds a goal, and solve hence fails. The second has an ambiant unification problem that is solved after solve *)
Fail solve [ unshelve (eapply interpf_SmartVarVar; subst; eassumption) ].
solve [eapply interpf_SmartVarVar; subst; eassumption].
Undo.
diff --git a/test-suite/bugs/closed/bug_808_2411.v b/test-suite/bugs/closed/bug_808_2411.v
index 1169b2036b..9fe4c9d503 100644
--- a/test-suite/bugs/closed/bug_808_2411.v
+++ b/test-suite/bugs/closed/bug_808_2411.v
@@ -2,7 +2,7 @@ Section test.
Variable n:nat.
Lemma foo: 0 <= n.
Proof.
-(* declaring an Axiom during a proof makes it immediatly
+(* declaring an Axiom during a proof makes it immediately
usable, juste as a full Definition. *)
Axiom bar : n = 1.
rewrite bar.
diff --git a/test-suite/bugs/closed/bug_8725.v b/test-suite/bugs/closed/bug_8725.v
new file mode 100644
index 0000000000..c888b9e96d
--- /dev/null
+++ b/test-suite/bugs/closed/bug_8725.v
@@ -0,0 +1,2 @@
+Set Warnings "+local-declaration".
+Fail Let foo : True.
diff --git a/test-suite/bugs/closed/bug_9166.v b/test-suite/bugs/closed/bug_9166.v
index 21cd770cbb..cd594c660f 100644
--- a/test-suite/bugs/closed/bug_9166.v
+++ b/test-suite/bugs/closed/bug_9166.v
@@ -1,8 +1,7 @@
-(* DO NOT MODIFY THIS FILE DIRECTLY *)
-(* It is autogenerated by dev/tools/update-compat.py. *)
Set Warnings "+deprecated".
-Notation bar := option (compat "8.8").
+#[deprecated(since = "X", note = "Y")]
+Notation bar := option.
Definition foo (x: nat) : nat :=
match x with
diff --git a/test-suite/dune b/test-suite/dune
index cd33319fa4..041c181d66 100644
--- a/test-suite/dune
+++ b/test-suite/dune
@@ -22,6 +22,7 @@
../doc/stdlib/index-list.html.template
; For the changelog test
../config/coq_config.py
+ (source_tree doc/changelog)
(package coq)
; For fake_ide
(package coqide-server)
diff --git a/test-suite/failure/Tauto.v b/test-suite/failure/Tauto.v
index c10cb0b869..6eef3c9845 100644
--- a/test-suite/failure/Tauto.v
+++ b/test-suite/failure/Tauto.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/failure/clash_cons.v b/test-suite/failure/clash_cons.v
index 89299110be..88dee9a683 100644
--- a/test-suite/failure/clash_cons.v
+++ b/test-suite/failure/clash_cons.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/failure/fixpoint1.v b/test-suite/failure/fixpoint1.v
index eb3d94526c..4b8e861616 100644
--- a/test-suite/failure/fixpoint1.v
+++ b/test-suite/failure/fixpoint1.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/failure/guard.v b/test-suite/failure/guard.v
index 2a5ad7789c..023a494a66 100644
--- a/test-suite/failure/guard.v
+++ b/test-suite/failure/guard.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/failure/illtype1.v b/test-suite/failure/illtype1.v
index ec43ea5fc8..3988292248 100644
--- a/test-suite/failure/illtype1.v
+++ b/test-suite/failure/illtype1.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/failure/positivity.v b/test-suite/failure/positivity.v
index 2798dcf974..ec8eb35b87 100644
--- a/test-suite/failure/positivity.v
+++ b/test-suite/failure/positivity.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/failure/redef.v b/test-suite/failure/redef.v
index 981d14387d..b1a578d15c 100644
--- a/test-suite/failure/redef.v
+++ b/test-suite/failure/redef.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/failure/search.v b/test-suite/failure/search.v
index 058c427c93..284acb88fc 100644
--- a/test-suite/failure/search.v
+++ b/test-suite/failure/search.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ideal-features/Apply.v b/test-suite/ideal-features/Apply.v
index 14eb1e3f96..5e1218851a 100644
--- a/test-suite/ideal-features/Apply.v
+++ b/test-suite/ideal-features/Apply.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/interactive/ParalITP_smallproofs.v b/test-suite/interactive/ParalITP_smallproofs.v
index 0d75d52a31..d2e6794c0b 100644
--- a/test-suite/interactive/ParalITP_smallproofs.v
+++ b/test-suite/interactive/ParalITP_smallproofs.v
@@ -14,7 +14,7 @@
(* 02110-1301 USA *)
-(** This file includes random facts about Integers (and natural numbers) which are not found in the standard library. Some of the lemma here are not used in the QArith developement but are rather useful.
+(** This file includes random facts about Integers (and natural numbers) which are not found in the standard library. Some of the lemma here are not used in the QArith development but are rather useful.
*)
Require Export ZArith.
@@ -84,7 +84,7 @@ End projection.
(*###########################################################################*)
-(* Declaring some realtions on natural numbers for stepl and stepr tactics. *)
+(* Declaring some relations on natural numbers for stepl and stepr tactics. *)
(*###########################################################################*)
Lemma le_stepl: forall x y z, le x y -> x=z -> le z y.
@@ -173,7 +173,7 @@ Qed.
(*###########################################################################*)
-(* Declaring some realtions on integers for stepl and stepr tactics. *)
+(* Declaring some relations on integers for stepl and stepr tactics. *)
(*###########################################################################*)
Lemma Zle_stepl: forall x y z, (x<=y)%Z -> x=z -> (z<=y)%Z.
diff --git a/test-suite/ltac2/notations.v b/test-suite/ltac2/notations.v
new file mode 100644
index 0000000000..3d2a875e38
--- /dev/null
+++ b/test-suite/ltac2/notations.v
@@ -0,0 +1,24 @@
+From Ltac2 Require Import Ltac2.
+From Coq Require Import ZArith String List.
+
+Open Scope Z_scope.
+
+Check 1 + 1 : Z.
+
+Ltac2 Notation "ex" arg(constr(nat,Z)) := arg.
+
+Check (1 + 1)%nat%Z = 1%nat.
+
+Lemma two : nat.
+ refine (ex (1 + 1)).
+Qed.
+
+Import ListNotations.
+Close Scope list_scope.
+
+Ltac2 Notation "sl" arg(constr(string,list)) := arg.
+
+Lemma maybe : list bool.
+Proof.
+ refine (sl ["left" =? "right"]).
+Qed.
diff --git a/test-suite/misc/changelog.sh b/test-suite/misc/changelog.sh
index ed473e5874..76eb0de5aa 100755
--- a/test-suite/misc/changelog.sh
+++ b/test-suite/misc/changelog.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
if grep -q -F "is_a_released_version = False" ../config/coq_config.py; then
echo "This is not a released version: nothing to test."
@@ -7,7 +7,8 @@ fi
for d in ../doc/changelog/*; do
if [ -d "$d" ]; then
- if [ "$(ls $d/*.rst | wc -l)" != "1" ]; then
+ files=("$d"/*.rst)
+ if [ "${#files[@]}" != 1 ]; then
echo "Fatal: unreleased changelog entries remain in ${d#../}/"
echo "Include them in doc/sphinx/changes.rst and remove them from doc/changelog/"
exit 1
diff --git a/test-suite/misc/poly-capture-global-univs/src/evilImpl.ml b/test-suite/misc/poly-capture-global-univs/src/evilImpl.ml
index adabb7a0a0..8447cf10db 100644
--- a/test-suite/misc/poly-capture-global-univs/src/evilImpl.ml
+++ b/test-suite/misc/poly-capture-global-univs/src/evilImpl.ml
@@ -11,7 +11,7 @@ let evil t f =
let te = Declare.definition_entry
~univs:(Monomorphic_entry (ContextSet.singleton u)) tu
in
- let tc = Declare.declare_constant t (DefinitionEntry te, k) in
+ let tc = Declare.declare_constant t (Declare.DefinitionEntry te, k) in
let tc = mkConst tc in
let fe = Declare.definition_entry
@@ -19,4 +19,4 @@ let evil t f =
~types:(Term.mkArrowR tc tu)
(mkLambda (Context.nameR (Id.of_string "x"), tc, mkRel 1))
in
- ignore (Declare.declare_constant f (DefinitionEntry fe, k))
+ ignore (Declare.declare_constant f (Declare.DefinitionEntry fe, k))
diff --git a/test-suite/misc/printers.sh b/test-suite/misc/printers.sh
index ef3f056d89..f659fce680 100755
--- a/test-suite/misc/printers.sh
+++ b/test-suite/misc/printers.sh
@@ -1,2 +1,8 @@
#!/bin/sh
-if printf "Drop. #use\"include\";; #quit;;\n" | $coqtopbyte 2>&1 | grep -E "Error|Unbound" ; then exit 1; else exit 0; fi
+
+command -v "${BIN}coqtop.byte" || { echo "Missing coqtop.byte"; exit 1; }
+
+f=$(mktemp)
+printf 'Drop. #use"include";; #quit;;\n' | "${BIN}coqtop.byte" -q 2>&1 | tee "$f"
+
+if grep -q -E "Error|Unbound" "$f"; then exit 1; fi
diff --git a/test-suite/misc/quotation_token.sh b/test-suite/misc/quotation_token.sh
new file mode 100755
index 0000000000..6357e8d7ce
--- /dev/null
+++ b/test-suite/misc/quotation_token.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+set -e
+
+export COQBIN=$BIN
+export PATH=$COQBIN:$PATH
+
+cd misc/quotation_token/
+
+coq_makefile -f _CoqProject -o Makefile
+
+make clean
+
+make src/quotation_plugin.cma
+
+TMP=`mktemp`
+
+if make > $TMP 2>&1; then
+ echo "should fail"
+ rm $TMP
+ exit 1
+fi
+
+if grep "File.*quotation.v., line 12, characters 6-30" $TMP; then
+ rm $TMP
+ exit 0
+else
+ echo "wong loc: `grep File.*quotation.v $TMP`"
+ rm $TMP
+ exit 1
+fi
diff --git a/test-suite/misc/quotation_token/.gitignore b/test-suite/misc/quotation_token/.gitignore
new file mode 100644
index 0000000000..18da256f3e
--- /dev/null
+++ b/test-suite/misc/quotation_token/.gitignore
@@ -0,0 +1,2 @@
+/Makefile*
+/src/quotation.ml
diff --git a/test-suite/misc/quotation_token/_CoqProject b/test-suite/misc/quotation_token/_CoqProject
new file mode 100644
index 0000000000..1b3e7c6399
--- /dev/null
+++ b/test-suite/misc/quotation_token/_CoqProject
@@ -0,0 +1,6 @@
+-Q theories Quotation
+-I src
+
+src/quotation.mlg
+src/quotation_plugin.mlpack
+theories/quotation.v
diff --git a/test-suite/misc/quotation_token/src/quotation.mlg b/test-suite/misc/quotation_token/src/quotation.mlg
new file mode 100644
index 0000000000..961b170a0d
--- /dev/null
+++ b/test-suite/misc/quotation_token/src/quotation.mlg
@@ -0,0 +1,12 @@
+{
+open Pcoq.Constr
+}
+GRAMMAR EXTEND Gram
+ GLOBAL: operconstr;
+
+ operconstr: LEVEL "0"
+ [ [ s = QUOTATION "foobar:" ->
+ {
+ CAst.make ~loc Constrexpr.(CSort Glob_term.(UNamed [GProp,0])) } ] ]
+ ;
+END
diff --git a/test-suite/misc/quotation_token/src/quotation_plugin.mlpack b/test-suite/misc/quotation_token/src/quotation_plugin.mlpack
new file mode 100644
index 0000000000..b372b94b30
--- /dev/null
+++ b/test-suite/misc/quotation_token/src/quotation_plugin.mlpack
@@ -0,0 +1 @@
+Quotation
diff --git a/test-suite/misc/quotation_token/theories/quotation.v b/test-suite/misc/quotation_token/theories/quotation.v
new file mode 100644
index 0000000000..66326e89c1
--- /dev/null
+++ b/test-suite/misc/quotation_token/theories/quotation.v
@@ -0,0 +1,13 @@
+
+Declare ML Module "quotation_plugin".
+
+Definition x := foobar:{{ hello
+ there
+}}.
+
+Definition y := foobar:{{ another
+ multi line
+ thing
+}}.
+Check foobar:{{ oops
+ ips }} y.
diff --git a/test-suite/output/Notations3.v b/test-suite/output/Notations3.v
index dcc8bd7165..29614c032a 100644
--- a/test-suite/output/Notations3.v
+++ b/test-suite/output/Notations3.v
@@ -209,7 +209,7 @@ Notation "'exists_mixed' x .. y , P" := (ex (fun x => forall z:nat, .. (ex (fun
Check exists_mixed x y '(u,t), x+y=0/\u+t=0.
Check exists_mixed x y '(z,t), x+y=0/\z+t=0.
-(* Check that intermediary let-in are inserted inbetween instances of
+(* Check that intermediary let-in are inserted in between instances of
the repeated pattern *)
Notation "'exists_true' x .. y , P" := (exists x, True /\ .. (exists y, True /\ P) ..) (at level 200, x binder).
Check exists_true '(x,y) (u:=0) '(z,t), x+y=0/\z+t=0.
diff --git a/test-suite/output/injection.out b/test-suite/output/injection.out
new file mode 100644
index 0000000000..ff40a478f3
--- /dev/null
+++ b/test-suite/output/injection.out
@@ -0,0 +1,4 @@
+The command has indeed failed with message:
+Unexpected pattern.
+The command has indeed failed with message:
+Unexpected injection pattern.
diff --git a/test-suite/output/injection.v b/test-suite/output/injection.v
new file mode 100644
index 0000000000..bfd5a67bf5
--- /dev/null
+++ b/test-suite/output/injection.v
@@ -0,0 +1,8 @@
+(* Test error messages *)
+
+Goal forall x, (x,0) = (0, S x) -> x = 0.
+Fail intros x H; injection H as [= H'] H''.
+Fail intros x H; injection H as H' [= H''].
+intros x H; injection H as [= H' H''].
+exact H'.
+Qed.
diff --git a/test-suite/output/ssr_explain_match.v b/test-suite/output/ssr_explain_match.v
index 56ca24b6e2..4a840fe20c 100644
--- a/test-suite/output/ssr_explain_match.v
+++ b/test-suite/output/ssr_explain_match.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/prerequisite/ssr_mini_mathcomp.v b/test-suite/prerequisite/ssr_mini_mathcomp.v
index 6fc630056c..74f94a9bed 100644
--- a/test-suite/prerequisite/ssr_mini_mathcomp.v
+++ b/test-suite/prerequisite/ssr_mini_mathcomp.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/prerequisite/ssr_ssrsyntax1.v b/test-suite/prerequisite/ssr_ssrsyntax1.v
index 2b404e2de0..1ffc83ecf8 100644
--- a/test-suite/prerequisite/ssr_ssrsyntax1.v
+++ b/test-suite/prerequisite/ssr_ssrsyntax1.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/absevarprop.v b/test-suite/ssr/absevarprop.v
index fa1de00957..d534443c32 100644
--- a/test-suite/ssr/absevarprop.v
+++ b/test-suite/ssr/absevarprop.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/abstract_var2.v b/test-suite/ssr/abstract_var2.v
index 7c57d2024f..aaeb80646b 100644
--- a/test-suite/ssr/abstract_var2.v
+++ b/test-suite/ssr/abstract_var2.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/binders.v b/test-suite/ssr/binders.v
index 97b7d830fa..a4b77257dc 100644
--- a/test-suite/ssr/binders.v
+++ b/test-suite/ssr/binders.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/binders_of.v b/test-suite/ssr/binders_of.v
index 69b52eacea..3f60a480dc 100644
--- a/test-suite/ssr/binders_of.v
+++ b/test-suite/ssr/binders_of.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/case_polyuniv.v b/test-suite/ssr/case_polyuniv.v
new file mode 100644
index 0000000000..8774e191c1
--- /dev/null
+++ b/test-suite/ssr/case_polyuniv.v
@@ -0,0 +1,12 @@
+Require Import ssreflect.
+
+Set Universe Polymorphism.
+
+Cumulative Variant paths {A} (x:A) : A -> Type
+ := idpath : paths x x.
+
+Register paths as core.eq.type.
+Register idpath as core.eq.refl.
+
+Lemma case_test (b:bool) : paths b b.
+Proof. case B:b; reflexivity. Qed.
diff --git a/test-suite/ssr/caseview.v b/test-suite/ssr/caseview.v
index 94b064b02f..098263ee4c 100644
--- a/test-suite/ssr/caseview.v
+++ b/test-suite/ssr/caseview.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/congr.v b/test-suite/ssr/congr.v
index 7e60b04a6b..026f7538e8 100644
--- a/test-suite/ssr/congr.v
+++ b/test-suite/ssr/congr.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/deferclear.v b/test-suite/ssr/deferclear.v
index 85353dadff..817101a268 100644
--- a/test-suite/ssr/deferclear.v
+++ b/test-suite/ssr/deferclear.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/dependent_type_err.v b/test-suite/ssr/dependent_type_err.v
index a5789d8dd8..436813bc94 100644
--- a/test-suite/ssr/dependent_type_err.v
+++ b/test-suite/ssr/dependent_type_err.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/derive_inversion.v b/test-suite/ssr/derive_inversion.v
index abf63a20ce..a2c438f8fe 100644
--- a/test-suite/ssr/derive_inversion.v
+++ b/test-suite/ssr/derive_inversion.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/elim.v b/test-suite/ssr/elim.v
index 720f4f6607..15b1d91eef 100644
--- a/test-suite/ssr/elim.v
+++ b/test-suite/ssr/elim.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/elim2.v b/test-suite/ssr/elim2.v
index c7c20d8f8b..52fc2ed333 100644
--- a/test-suite/ssr/elim2.v
+++ b/test-suite/ssr/elim2.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/elim_pattern.v b/test-suite/ssr/elim_pattern.v
index ef4658287f..ecc5d1d5c7 100644
--- a/test-suite/ssr/elim_pattern.v
+++ b/test-suite/ssr/elim_pattern.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/first_n.v b/test-suite/ssr/first_n.v
index 4971add919..0d42a55390 100644
--- a/test-suite/ssr/first_n.v
+++ b/test-suite/ssr/first_n.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/gen_have.v b/test-suite/ssr/gen_have.v
index 249e006f9f..4adad3d3ac 100644
--- a/test-suite/ssr/gen_have.v
+++ b/test-suite/ssr/gen_have.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/gen_pattern.v b/test-suite/ssr/gen_pattern.v
index c0592e8843..0120d77194 100644
--- a/test-suite/ssr/gen_pattern.v
+++ b/test-suite/ssr/gen_pattern.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/have_TC.v b/test-suite/ssr/have_TC.v
index b3a26ed2c2..c74282ed4f 100644
--- a/test-suite/ssr/have_TC.v
+++ b/test-suite/ssr/have_TC.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/have_transp.v b/test-suite/ssr/have_transp.v
index 1c998da71b..d663780adc 100644
--- a/test-suite/ssr/have_transp.v
+++ b/test-suite/ssr/have_transp.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/have_view_idiom.v b/test-suite/ssr/have_view_idiom.v
index 3d6c9d9802..623eaac2b9 100644
--- a/test-suite/ssr/have_view_idiom.v
+++ b/test-suite/ssr/have_view_idiom.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/havesuff.v b/test-suite/ssr/havesuff.v
index aa1f71879e..3ca69bcc4c 100644
--- a/test-suite/ssr/havesuff.v
+++ b/test-suite/ssr/havesuff.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/if_isnt.v b/test-suite/ssr/if_isnt.v
index b8f6b77391..23bc581213 100644
--- a/test-suite/ssr/if_isnt.v
+++ b/test-suite/ssr/if_isnt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/intro_beta.v b/test-suite/ssr/intro_beta.v
index 8a164bd809..dce4650611 100644
--- a/test-suite/ssr/intro_beta.v
+++ b/test-suite/ssr/intro_beta.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/intro_noop.v b/test-suite/ssr/intro_noop.v
index fdc85173a8..9e141a9487 100644
--- a/test-suite/ssr/intro_noop.v
+++ b/test-suite/ssr/intro_noop.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/ipatalternation.v b/test-suite/ssr/ipatalternation.v
index 6aa9a954c8..ae783ac7ed 100644
--- a/test-suite/ssr/ipatalternation.v
+++ b/test-suite/ssr/ipatalternation.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/ltac_have.v b/test-suite/ssr/ltac_have.v
index 380e52af40..3862aa72da 100644
--- a/test-suite/ssr/ltac_have.v
+++ b/test-suite/ssr/ltac_have.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/ltac_in.v b/test-suite/ssr/ltac_in.v
index bcdf96dded..e379c21773 100644
--- a/test-suite/ssr/ltac_in.v
+++ b/test-suite/ssr/ltac_in.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/move_after.v b/test-suite/ssr/move_after.v
index a7a9afea07..45c23e30c3 100644
--- a/test-suite/ssr/move_after.v
+++ b/test-suite/ssr/move_after.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/multiview.v b/test-suite/ssr/multiview.v
index f4e717b384..fcb7e2a520 100644
--- a/test-suite/ssr/multiview.v
+++ b/test-suite/ssr/multiview.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/occarrow.v b/test-suite/ssr/occarrow.v
index 49af7ae08a..8d11219a23 100644
--- a/test-suite/ssr/occarrow.v
+++ b/test-suite/ssr/occarrow.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/patnoX.v b/test-suite/ssr/patnoX.v
index d69f03ac3d..2dea5fcb6d 100644
--- a/test-suite/ssr/patnoX.v
+++ b/test-suite/ssr/patnoX.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/pattern.v b/test-suite/ssr/pattern.v
index 396f4f032c..ae4745b352 100644
--- a/test-suite/ssr/pattern.v
+++ b/test-suite/ssr/pattern.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/primproj.v b/test-suite/ssr/primproj.v
index cf61eb4363..89aa56e8ec 100644
--- a/test-suite/ssr/primproj.v
+++ b/test-suite/ssr/primproj.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/rewpatterns.v b/test-suite/ssr/rewpatterns.v
index f7993f402d..82d0112362 100644
--- a/test-suite/ssr/rewpatterns.v
+++ b/test-suite/ssr/rewpatterns.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/set_lamda.v b/test-suite/ssr/set_lamda.v
index a012ec680b..a18dde31bf 100644
--- a/test-suite/ssr/set_lamda.v
+++ b/test-suite/ssr/set_lamda.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/set_pattern.v b/test-suite/ssr/set_pattern.v
index 3ce75e879e..b513673215 100644
--- a/test-suite/ssr/set_pattern.v
+++ b/test-suite/ssr/set_pattern.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/ssrsyntax2.v b/test-suite/ssr/ssrsyntax2.v
index af839fabdb..c98ab98742 100644
--- a/test-suite/ssr/ssrsyntax2.v
+++ b/test-suite/ssr/ssrsyntax2.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/tc.v b/test-suite/ssr/tc.v
index ae4589ef30..bffb20d39b 100644
--- a/test-suite/ssr/tc.v
+++ b/test-suite/ssr/tc.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/typeof.v b/test-suite/ssr/typeof.v
index ca121fdb31..bd51230157 100644
--- a/test-suite/ssr/typeof.v
+++ b/test-suite/ssr/typeof.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/unfold_Opaque.v b/test-suite/ssr/unfold_Opaque.v
index 7c2b51de48..0b220b31f5 100644
--- a/test-suite/ssr/unfold_Opaque.v
+++ b/test-suite/ssr/unfold_Opaque.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/unfold_fold_polyuniv.v b/test-suite/ssr/unfold_fold_polyuniv.v
new file mode 100644
index 0000000000..1a9309bc79
--- /dev/null
+++ b/test-suite/ssr/unfold_fold_polyuniv.v
@@ -0,0 +1,40 @@
+Require Import ssreflect ssrbool.
+
+Set Universe Polymorphism.
+
+Cumulative Variant paths {A} (x:A) : A -> Type
+ := idpath : paths x x.
+
+Register paths as core.eq.type.
+Register idpath as core.eq.refl.
+
+Structure type := Pack {sort; op : rel sort}.
+
+Example unfold_fold (T : type) (x : sort T) (a : op T x x) : op T x x.
+Proof.
+ rewrite /op. rewrite -/(op _ _ _). assumption.
+Qed.
+
+Example pattern_unfold_fold (b:bool) (a := b) : paths a b.
+Proof.
+ rewrite [in X in paths X _]/a.
+ rewrite -[in X in paths X _]/a.
+ constructor.
+Qed.
+
+Example unfold_in_hyp (b:bool) (a := b) : unit.
+Proof.
+ assert (paths a a) as A by reflexivity.
+ rewrite [in X in paths X _]/a in A.
+ rewrite /a in (B := idpath a).
+ rewrite [in X in paths _ X]/a in (C := idpath a).
+ constructor.
+Qed.
+
+Example fold_in_hyp (b:bool) (p := idpath b) : unit.
+Proof.
+ assert (paths (idpath b) (idpath b)) as A by reflexivity.
+ rewrite -[in X in paths X _]/p in A.
+ rewrite -[in X in paths _ X]/p in (C := idpath (idpath b)).
+ constructor.
+Qed.
diff --git a/test-suite/ssr/unkeyed.v b/test-suite/ssr/unkeyed.v
index 710941c307..eee1d1cf67 100644
--- a/test-suite/ssr/unkeyed.v
+++ b/test-suite/ssr/unkeyed.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/view_case.v b/test-suite/ssr/view_case.v
index 2721470c44..d212d377b6 100644
--- a/test-suite/ssr/view_case.v
+++ b/test-suite/ssr/view_case.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/wlog_suff.v b/test-suite/ssr/wlog_suff.v
index 43a8f3b8b7..3deceebb39 100644
--- a/test-suite/ssr/wlog_suff.v
+++ b/test-suite/ssr/wlog_suff.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/wlogletin.v b/test-suite/ssr/wlogletin.v
index 64e1ea84f7..2dca6d939f 100644
--- a/test-suite/ssr/wlogletin.v
+++ b/test-suite/ssr/wlogletin.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/ssr/wlong_intro.v b/test-suite/ssr/wlong_intro.v
index dd80f04359..c24b66f7b8 100644
--- a/test-suite/ssr/wlong_intro.v
+++ b/test-suite/ssr/wlong_intro.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/stm/Nijmegen_QArithSternBrocot_Zaux.v b/test-suite/stm/Nijmegen_QArithSternBrocot_Zaux.v
index 3c427237b4..69ed621877 100644
--- a/test-suite/stm/Nijmegen_QArithSternBrocot_Zaux.v
+++ b/test-suite/stm/Nijmegen_QArithSternBrocot_Zaux.v
@@ -14,7 +14,7 @@
(* 02110-1301 USA *)
-(** This file includes random facts about Integers (and natural numbers) which are not found in the standard library. Some of the lemma here are not used in the QArith developement but are rather useful.
+(** This file includes random facts about Integers (and natural numbers) which are not found in the standard library. Some of the lemma here are not used in the QArith development but are rather useful.
*)
Require Export ZArith.
@@ -84,7 +84,7 @@ End projection.
(*###########################################################################*)
-(* Declaring some realtions on natural numbers for stepl and stepr tactics. *)
+(* Declaring some relations on natural numbers for stepl and stepr tactics. *)
(*###########################################################################*)
Lemma le_stepl: forall x y z, le x y -> x=z -> le z y.
@@ -173,7 +173,7 @@ Qed.
(*###########################################################################*)
-(* Declaring some realtions on integers for stepl and stepr tactics. *)
+(* Declaring some relations on integers for stepl and stepr tactics. *)
(*###########################################################################*)
Lemma Zle_stepl: forall x y z, (x<=y)%Z -> x=z -> (z<=y)%Z.
diff --git a/test-suite/success/BidirectionalityHints.v b/test-suite/success/BidirectionalityHints.v
new file mode 100644
index 0000000000..284cdc871b
--- /dev/null
+++ b/test-suite/success/BidirectionalityHints.v
@@ -0,0 +1,114 @@
+From Coq Require Import Utf8.
+Set Default Proof Using "Type".
+
+Module SimpleExamples.
+
+Axiom c : bool -> nat.
+Coercion c : bool >-> nat.
+Inductive Boxed A := Box (a : A).
+Arguments Box {A} & a.
+Check Box true : Boxed nat.
+
+(* Here we check that there is no regression due e.g. to refining arguments
+ in the wrong order *)
+Axiom f : forall b : bool, (if b then bool else nat) -> Type.
+Check f true true : Type.
+Arguments f & _ _.
+Check f true true : Type.
+
+End SimpleExamples.
+
+Module Issue7910.
+
+Local Set Universe Polymorphism.
+
+(** Telescopes *)
+Inductive tele : Type :=
+ | TeleO : tele
+ | TeleS {X} (binder : X → tele) : tele.
+
+Arguments TeleS {_} _.
+
+(** The telescope version of Coq's function type *)
+Fixpoint tele_fun (TT : tele) (T : Type) : Type :=
+ match TT with
+ | TeleO => T
+ | TeleS b => ∀ x, tele_fun (b x) T
+ end.
+
+Notation "TT -t> A" :=
+ (tele_fun TT A) (at level 99, A at level 200, right associativity).
+
+(** An eliminator for elements of [tele_fun].
+ We use a [fix] because, for some reason, that makes stuff print nicer
+ in the proofs in iris:bi/lib/telescopes.v *)
+Definition tele_fold {X Y} {TT : tele} (step : ∀ {A : Type}, (A → Y) → Y) (base : X → Y)
+ : (TT -t> X) → Y :=
+ (fix rec {TT} : (TT -t> X) → Y :=
+ match TT as TT return (TT -t> X) → Y with
+ | TeleO => λ x : X, base x
+ | TeleS b => λ f, step (λ x, rec (f x))
+ end) TT.
+Arguments tele_fold {_ _ !_} _ _ _ /.
+
+(** A sigma-like type for an "element" of a telescope, i.e. the data it
+ takes to get a [T] from a [TT -t> T]. *)
+Inductive tele_arg : tele → Type :=
+| TargO : tele_arg TeleO
+(* the [x] is the only relevant data here *)
+| TargS {X} {binder} (x : X) : tele_arg (binder x) → tele_arg (TeleS binder).
+
+Definition tele_app {TT : tele} {T} (f : TT -t> T) : tele_arg TT → T :=
+ λ a, (fix rec {TT} (a : tele_arg TT) : (TT -t> T) → T :=
+ match a in tele_arg TT return (TT -t> T) → T with
+ | TargO => λ t : T, t
+ | TargS x a => λ f, rec a (f x)
+ end) TT a f.
+Arguments tele_app {!_ _} & _ !_ /.
+
+Coercion tele_arg : tele >-> Sortclass.
+Coercion tele_app : tele_fun >-> Funclass.
+
+(** Operate below [tele_fun]s with argument telescope [TT]. *)
+Fixpoint tele_bind {U} {TT : tele} : (TT → U) → TT -t> U :=
+ match TT as TT return (TT → U) → TT -t> U with
+ | TeleO => λ F, F TargO
+ | @TeleS X b => λ (F : TeleS b → U) (x : X), (* b x -t> U *)
+ tele_bind (λ a, F (TargS x a))
+ end.
+Arguments tele_bind {_ !_} _ /.
+
+(** Telescopic quantifiers *)
+Definition tforall {TT : tele} (Ψ : TT → Prop) : Prop :=
+ tele_fold (λ (T : Type) (b : T → Prop), ∀ x : T, b x) (λ x, x) (tele_bind Ψ).
+Arguments tforall {!_} _ /.
+Definition texist {TT : tele} (Ψ : TT → Prop) : Prop :=
+ tele_fold ex (λ x, x) (tele_bind Ψ).
+Arguments texist {!_} _ /.
+
+Notation "'∀..' x .. y , P" := (tforall (λ x, .. (tforall (λ y, P)) .. ))
+ (at level 200, x binder, y binder, right associativity,
+ format "∀.. x .. y , P").
+Notation "'∃..' x .. y , P" := (texist (λ x, .. (texist (λ y, P)) .. ))
+ (at level 200, x binder, y binder, right associativity,
+ format "∃.. x .. y , P").
+
+(** The actual test case *)
+Definition test {TT : tele} (t : TT → Prop) : Prop :=
+ ∀.. x, t x ∧ t x.
+
+Notation "'[TEST' x .. z , P ']'" :=
+ (test (TT:=(TeleS (fun x => .. (TeleS (fun z => TeleO)) ..)))
+ (tele_app (λ x, .. (λ z, P) ..)))
+ (x binder, z binder).
+Notation "'[TEST2' x .. z , P ']'" :=
+ (test (TT:=(TeleS (fun x => .. (TeleS (fun z => TeleO)) ..)))
+ (tele_app (TT:=(TeleS (fun x => .. (TeleS (fun z => TeleO)) ..)))
+ (λ x, .. (λ z, P) ..)))
+ (x binder, z binder).
+
+Check [TEST (x y : nat), x = y].
+
+Check [TEST2 (x y : nat), x = y].
+
+End Issue7910.
diff --git a/test-suite/success/Case15.v b/test-suite/success/Case15.v
index 69fca48e24..ba6bf3bba2 100644
--- a/test-suite/success/Case15.v
+++ b/test-suite/success/Case15.v
@@ -20,7 +20,7 @@ Definition test (B : Boite) :=
| boite false (n, m) => n + m
end.
-(* Check lazyness of compilation ... future work
+(* Check laziness of compilation ... future work
Inductive I : Set := c : (b:bool)(if b then bool else nat)->I.
Check [x]
diff --git a/test-suite/success/Case18.v b/test-suite/success/Case18.v
index be9ca8d41b..6bea435090 100644
--- a/test-suite/success/Case18.v
+++ b/test-suite/success/Case18.v
@@ -1,7 +1,10 @@
(* Check or-patterns *)
+(* Non-interference with Numbers divisibility. *)
+Reserved Notation "( p | q )" (at level 0).
+
Definition g x :=
- match x with ((((1 as x),_) | (_,x)), (_,(2 as y))|(y,_)) => (x,y) end.
+ match x with ((((1 as x),_) | (_,x)), ((_,(2 as y)) | (y,_))) => (x,y) end.
Check (refl_equal _ : g ((1,2),(3,4)) = (1,3)).
diff --git a/test-suite/success/CasesDep.v b/test-suite/success/CasesDep.v
index 8d9edbd62d..02e15b8ee2 100644
--- a/test-suite/success/CasesDep.v
+++ b/test-suite/success/CasesDep.v
@@ -62,7 +62,7 @@ Check fun x:{_:{x:nat*nat|fst x = 0 & True}|True}+nat => match x return option n
(* -------------------------------------------------------------------- *)
(* Example to test patterns matching on dependent families *)
-(* This exemple extracted from the developement done by Nacira Chabane *)
+(* This exemple extracted from the development done by Nacira Chabane *)
(* (equipe Paris 6) *)
(* -------------------------------------------------------------------- *)
@@ -298,7 +298,7 @@ End Version1.
(* ------------------------------------------------------------------*)
-(* Initial exemple (without patterns) *)
+(* Initial example (without patterns) *)
(*-------------------------------------------------------------------*)
Module Version2.
diff --git a/test-suite/success/Check.v b/test-suite/success/Check.v
index 36fecf7204..56a4fa0aad 100644
--- a/test-suite/success/Check.v
+++ b/test-suite/success/Check.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/success/Discriminate_HoTT.v b/test-suite/success/Discriminate_HoTT.v
new file mode 100644
index 0000000000..2a5e083d56
--- /dev/null
+++ b/test-suite/success/Discriminate_HoTT.v
@@ -0,0 +1,89 @@
+(* -*- mode: coq; coq-prog-args: ("-noinit" "-indices-matter") -*- *)
+
+(* This file tests the discriminate tactic compatibility with HoTT.
+ The first part of the file will setup a mini HoTT environment.
+ Afterwards a number of tests are performed. The tests are basically
+ copied from the Discriminate.v test file. *)
+
+Unset Elimination Schemes.
+
+Set Universe Polymorphism.
+
+Declare ML Module "ltac_plugin".
+
+Global Set Default Proof Mode "Classic".
+
+Notation "x -> y" := (forall (_:x), y) (at level 99, right associativity, y at level 200).
+
+Cumulative Variant paths {A} (a:A) : A -> Type
+ := idpath : paths a a.
+
+Arguments idpath {A a} , [A] a.
+
+Scheme paths_ind := Induction for paths Sort Type.
+Arguments paths_ind [A] a P f y p.
+
+Notation "x = y :> A" := (@paths A x y) (at level 70, y at next level, no associativity).
+Notation "x = y" := (x = y :>_) (at level 70, no associativity).
+
+Register paths as core.identity.type.
+Register idpath as core.identity.refl.
+Register paths_ind as core.identity.ind.
+
+Definition inverse {A : Type} {x y : A} (p : x = y) : y = x
+ := match p with idpath => idpath end.
+Arguments inverse {A x y} p : simpl nomatch.
+Register inverse as core.identity.sym.
+
+Definition concat {A : Type} {x y z : A} (p : x = y) (q : y = z) : x = z :=
+ match p, q with idpath, idpath => idpath end.
+Arguments concat {A x y z} p q : simpl nomatch.
+Register concat as core.identity.trans.
+
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+Arguments ap {A B} f {x y} p.
+Register ap as core.identity.congr.
+
+Variant Empty : Type :=.
+
+Register Empty as core.False.type.
+
+Variant Unit : Type := tt.
+
+Register Unit as core.True.type.
+Register tt as core.True.I.
+
+Variant Bool : Type := true | false.
+
+Inductive nat : Type := O | S (n:nat).
+
+(*********** Test discriminate tactic below. ***************)
+
+Goal O = S O -> Empty.
+ discriminate 1.
+Qed.
+
+Goal forall H : O = S O, H = H.
+ discriminate H.
+Qed.
+
+Goal O = S O -> Unit.
+intros. discriminate H. Qed.
+Goal O = S O -> Unit.
+intros. Ltac g x := discriminate x. g H. Qed.
+
+Goal (forall x y : nat, x = y -> x = S y) -> Unit.
+intros.
+try discriminate (H O) || exact tt.
+Qed.
+
+Goal (forall x y : nat, x = y -> x = S y) -> Unit.
+intros. ediscriminate (H O). instantiate (1:=O). Abort.
+
+(* Check discriminate on types with local definitions *)
+
+Inductive A := B (T := Unit) (x y : Bool) (z := x).
+Goal forall x y, B x true = B y false -> Empty.
+discriminate.
+Qed.
diff --git a/test-suite/success/Field.v b/test-suite/success/Field.v
index fdf7797d4b..31e442549b 100644
--- a/test-suite/success/Field.v
+++ b/test-suite/success/Field.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/success/Hints.v b/test-suite/success/Hints.v
index 2f13b7c225..e96a5f9048 100644
--- a/test-suite/success/Hints.v
+++ b/test-suite/success/Hints.v
@@ -175,7 +175,7 @@ End HintCut.
(* Check that auto-like tactics do not prefer "eq_refl" over more complex solutions, *)
-(* e.g. those tactics when considering a goal with existential varibles *)
+(* e.g. those tactics when considering a goal with existential variables *)
(* like "m = ?n" won't pick "plus_n_O" hint over "eq_refl" hint. *)
(* See this Coq club post for more detail: *)
(* https://sympa.inria.fr/sympa/arc/coq-club/2017-12/msg00103.html *)
diff --git a/test-suite/success/Inversion.v b/test-suite/success/Inversion.v
index ee540d7109..1dbeaf3e1f 100644
--- a/test-suite/success/Inversion.v
+++ b/test-suite/success/Inversion.v
@@ -179,7 +179,7 @@ exact Logic.I.
Qed.
(* Up to September 2014, H0 below was renamed called H1 because of a collision
- with the automaticallly generated names for equations.
+ with the automatically generated names for equations.
(example taken from CoLoR) *)
Inductive term := Var | Fun : term -> term -> term.
diff --git a/test-suite/success/LocalDefinition.v b/test-suite/success/LocalDefinition.v
new file mode 100644
index 0000000000..22fb09526d
--- /dev/null
+++ b/test-suite/success/LocalDefinition.v
@@ -0,0 +1,53 @@
+(* Test consistent behavior of Local Definition (#8722) *)
+
+(* Test consistent behavior of Local Definition wrt Admitted *)
+
+Module TestAdmittedVisibility.
+ Module A.
+ Let a1 : nat. Admitted. (* Suppose to behave like a "Local Definition" *)
+ Local Definition b1 : nat. Admitted. (* Told to be a "Local Definition" *)
+ Local Definition c1 := 0.
+ Local Parameter d1 : nat.
+ Section S.
+ Let a2 : nat. Admitted. (* Told to be turned into a toplevel assumption *)
+ Local Definition b2 : nat. Admitted. (* Told to be a "Local Definition" *)
+ Local Definition c2 := 0.
+ Local Parameter d2 : nat.
+ End S.
+ End A.
+ Import A.
+ Fail Check a1. (* used to be accepted *)
+ Fail Check b1. (* used to be accepted *)
+ Fail Check c1.
+ Fail Check d1.
+ Fail Check a2. (* used to be accepted *)
+ Fail Check b2. (* used to be accepted *)
+ Fail Check c2.
+ Fail Check d2.
+End TestAdmittedVisibility.
+
+(* Test consistent behavior of Local Definition wrt automatic declaration of instances *)
+
+Module TestVariableAsInstances.
+ Module Test1.
+ Set Typeclasses Axioms Are Instances.
+ Class U.
+ Local Parameter b : U.
+ Definition testU := _ : U. (* _ resolved *)
+
+ Class T.
+ Variable a : T. (* warned to be the same as "Local Parameter" *)
+ Definition testT := _ : T. (* _ resolved *)
+ End Test1.
+
+ Module Test2.
+ Unset Typeclasses Axioms Are Instances.
+ Class U.
+ Local Parameter b : U.
+ Fail Definition testU := _ : U. (* _ unresolved *)
+
+ Class T.
+ Variable a : T. (* warned to be the same as "Local Parameter" thus should not be an instance *)
+ Fail Definition testT := _ : T. (* used to succeed *)
+ End Test2.
+End TestVariableAsInstances.
diff --git a/test-suite/success/NotationDeprecation.v b/test-suite/success/NotationDeprecation.v
new file mode 100644
index 0000000000..d313ba0aa4
--- /dev/null
+++ b/test-suite/success/NotationDeprecation.v
@@ -0,0 +1,62 @@
+Module Syndefs.
+
+#[deprecated(since = "8.8", note = "Do not use.")]
+Notation foo := Prop.
+
+Notation bar := Prop (compat "8.8").
+
+Fail
+#[deprecated(since = "8.8", note = "Do not use.")]
+Notation zar := Prop (compat "8.8").
+
+Check foo.
+Check bar.
+
+Set Warnings "+deprecated".
+
+Fail Check foo.
+Fail Check bar.
+
+End Syndefs.
+
+Module Notations.
+
+#[deprecated(since = "8.8", note = "Do not use.")]
+Notation "!!" := Prop.
+
+Notation "##" := Prop (compat "8.8").
+
+Fail
+#[deprecated(since = "8.8", note = "Do not use.")]
+Notation "**" := Prop (compat "8.8").
+
+Check !!.
+Check ##.
+
+Set Warnings "+deprecated".
+
+Fail Check !!.
+Fail Check ##.
+
+End Notations.
+
+Module Infix.
+
+#[deprecated(since = "8.8", note = "Do not use.")]
+Infix "!!" := plus (at level 1).
+
+Infix "##" := plus (at level 1, compat "8.8").
+
+Fail
+#[deprecated(since = "8.8", note = "Do not use.")]
+Infix "**" := plus (at level 1, compat "8.8").
+
+Check (_ !! _).
+Check (_ ## _).
+
+Set Warnings "+deprecated".
+
+Fail Check (_ !! _).
+Fail Check (_ ## _).
+
+End Infix.
diff --git a/test-suite/success/Reordering.v b/test-suite/success/Reordering.v
index de9b997590..98759264e5 100644
--- a/test-suite/success/Reordering.v
+++ b/test-suite/success/Reordering.v
@@ -1,7 +1,7 @@
(* Testing the reordering of hypothesis required by pattern, fold and change. *)
Goal forall (A:Set) (x:A) (A':=A), True.
intros.
-fold A' in x. (* suceeds: x is moved after A' *)
+fold A' in x. (* succeeds: x is moved after A' *)
Undo.
pattern A' in x.
Undo.
diff --git a/test-suite/success/Tauto.v b/test-suite/success/Tauto.v
index 7d01d3b07b..ea0cf43451 100644
--- a/test-suite/success/Tauto.v
+++ b/test-suite/success/Tauto.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/success/TestRefine.v b/test-suite/success/TestRefine.v
index f1683078cb..287c77c866 100644
--- a/test-suite/success/TestRefine.v
+++ b/test-suite/success/TestRefine.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/success/eauto.v b/test-suite/success/eauto.v
index 5b616ccc33..28200f8783 100644
--- a/test-suite/success/eauto.v
+++ b/test-suite/success/eauto.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/success/eqdecide.v b/test-suite/success/eqdecide.v
index 9b3fb3c5c7..17c6a93d21 100644
--- a/test-suite/success/eqdecide.v
+++ b/test-suite/success/eqdecide.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/success/extraction.v b/test-suite/success/extraction.v
index 95ae070940..54c82ff6f1 100644
--- a/test-suite/success/extraction.v
+++ b/test-suite/success/extraction.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/success/extraction_dep.v b/test-suite/success/extraction_dep.v
index fb0adabae9..c566a6db9f 100644
--- a/test-suite/success/extraction_dep.v
+++ b/test-suite/success/extraction_dep.v
@@ -34,7 +34,7 @@ Definition testAbis := Abis.u + Abis.y.
Recursive Extraction testAbis. (* without: A B v w x *)
Extraction TestCompile testAbis.
-(** 2) With signature, we only keep elements mentionned in signature. *)
+(** 2) With signature, we only keep elements mentioned in signature. *)
Module Type SIG.
Parameter u : nat.
diff --git a/test-suite/success/goal_selector.v b/test-suite/success/goal_selector.v
index 0951c5c8d4..ae834e7696 100644
--- a/test-suite/success/goal_selector.v
+++ b/test-suite/success/goal_selector.v
@@ -13,13 +13,15 @@ Goal two false /\ two true /\ two false /\ two true /\ two true /\ two true.
Proof.
do 2 dup.
- repeat split.
- 2, 4-99, 100-3:idtac.
+ Fail 7:idtac.
+ Fail 2-1:idtac.
+ 1,2,4-6:idtac.
2-5:exact One.
par:exact Zero.
- repeat split.
3-6:swap 1 4.
1-5:swap 1 5.
- 0-4:exact One.
+ 1-4:exact One.
all:exact Zero.
- repeat split.
1, 3:exact Zero.
@@ -34,7 +36,7 @@ Qed.
Goal True -> True.
Proof.
- intros y; only 1-2 : repeat idtac.
+ intros y.
1-1:match goal with y : _ |- _ => let x := y in idtac x end.
Fail 1-1:let x := y in idtac x.
1:let x := y in idtac x.
diff --git a/test-suite/success/if.v b/test-suite/success/if.v
index c81d2b9bf1..68d26ac8df 100644
--- a/test-suite/success/if.v
+++ b/test-suite/success/if.v
@@ -1,4 +1,4 @@
-(* The synthesis of the elimination predicate may fail if algebric *)
+(* The synthesis of the elimination predicate may fail if algebraic *)
(* universes are not cautiously treated *)
Check (fun b : bool => if b then Type else nat).
diff --git a/test-suite/success/inds_type_sec.v b/test-suite/success/inds_type_sec.v
index 92fd6cb17d..ed781b3a40 100644
--- a/test-suite/success/inds_type_sec.v
+++ b/test-suite/success/inds_type_sec.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/success/induct.v b/test-suite/success/induct.v
index da7df69e62..c8e5be93e9 100644
--- a/test-suite/success/induct.v
+++ b/test-suite/success/induct.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/success/mutual_ind.v b/test-suite/success/mutual_ind.v
index 2c76a13597..ac734de9df 100644
--- a/test-suite/success/mutual_ind.v
+++ b/test-suite/success/mutual_ind.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/success/unfold.v b/test-suite/success/unfold.v
index 72f0d94dea..b7ab75349e 100644
--- a/test-suite/success/unfold.v
+++ b/test-suite/success/unfold.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/typeclasses/NewSetoid.v b/test-suite/typeclasses/NewSetoid.v
index 81c4a1469c..c5238eff22 100644
--- a/test-suite/typeclasses/NewSetoid.v
+++ b/test-suite/typeclasses/NewSetoid.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/test-suite/unit-tests/ide/lex_tests.ml b/test-suite/unit-tests/ide/lex_tests.ml
new file mode 100644
index 0000000000..3082acdf1f
--- /dev/null
+++ b/test-suite/unit-tests/ide/lex_tests.ml
@@ -0,0 +1,50 @@
+open Utest
+
+let log_out_ch = open_log_out_ch __FILE__
+
+let lex s =
+ let n =
+ let last = String.length s - 1 in
+ if s.[last] = '.' then Some last else None in
+ let stop = ref None in
+ let f i _ = assert(!stop = None); stop := Some i in
+ begin try Coq_lex.delimit_sentences f s
+ with Coq_lex.Unterminated -> () end;
+ if n <> !stop then begin
+ let p_opt = function None -> "None" | Some i -> "Some " ^ string_of_int i in
+ Printf.fprintf log_out_ch "ERROR: %S\nEXPECTED: %s\nGOT: %s\n" s (p_opt n) (p_opt !stop)
+ end;
+ n = !stop
+
+let i2s i = "test at line: " ^ string_of_int i
+
+let tests = [
+
+ mk_bool_test (i2s __LINE__) "no quotation" @@ lex
+ "foo.+1 bar."
+ ;
+ mk_bool_test (i2s __LINE__) "quotation" @@ lex
+ "foo constr:(xxx)."
+ ;
+ mk_bool_test (i2s __LINE__) "quotation with dot" @@ lex
+ "foo constr:(xxx. yyy)."
+ ;
+ mk_bool_test (i2s __LINE__) "quotation with dot double paren" @@ lex
+ "foo constr:((xxx. (foo.+1 ) \")\" yyy))."
+ ;
+ mk_bool_test (i2s __LINE__) "quotation with dot paren [" @@ lex
+ "foo constr:[xxx. (foo.+1 ) \")\" yyy]."
+ ;
+ mk_bool_test (i2s __LINE__) "quotation with dot double paren [" @@ lex
+ "foo constr:[[xxx. (foo.+1 ) \")\" yyy]]."
+ ;
+ mk_bool_test (i2s __LINE__) "quotation with dot triple paren [" @@ lex
+ "foo constr:[[[xxx. (foo.+1 @@ [] ) \"]])\" yyy]]]."
+ ;
+ mk_bool_test (i2s __LINE__) "quotation nesting {" @@ lex
+ "bar:{{ foo {{ hello. }} }}."
+ ;
+
+]
+
+let _ = run_tests __FILE__ log_out_ch tests
diff --git a/test-suite/vio/section.v b/test-suite/vio/section.v
new file mode 100644
index 0000000000..0e7722516a
--- /dev/null
+++ b/test-suite/vio/section.v
@@ -0,0 +1,12 @@
+Section Foo.
+ Variable A : Type.
+
+ Definition bla := A.
+
+ Variable B : bla.
+
+ Lemma blu : {X:Type & X}.
+ Proof using A B.
+ exists bla;exact B.
+ Qed.
+End Foo.
diff --git a/theories/Arith/Arith.v b/theories/Arith/Arith.v
index 1cba8fafe6..109d5620cc 100644
--- a/theories/Arith/Arith.v
+++ b/theories/Arith/Arith.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Arith_base.v b/theories/Arith/Arith_base.v
index e3a033a4ad..fb0ec34490 100644
--- a/theories/Arith/Arith_base.v
+++ b/theories/Arith/Arith_base.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Between.v b/theories/Arith/Between.v
index 25d84a621b..0e1e04058b 100644
--- a/theories/Arith/Between.v
+++ b/theories/Arith/Between.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Bool_nat.v b/theories/Arith/Bool_nat.v
index d892542e7d..78b66ea669 100644
--- a/theories/Arith/Bool_nat.v
+++ b/theories/Arith/Bool_nat.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Compare.v b/theories/Arith/Compare.v
index 6778d6a025..2838670e8b 100644
--- a/theories/Arith/Compare.v
+++ b/theories/Arith/Compare.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Compare_dec.v b/theories/Arith/Compare_dec.v
index e91f589d67..ecbe5fd2fc 100644
--- a/theories/Arith/Compare_dec.v
+++ b/theories/Arith/Compare_dec.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Div2.v b/theories/Arith/Div2.v
index a5e4578319..f9daf418d2 100644
--- a/theories/Arith/Div2.v
+++ b/theories/Arith/Div2.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/EqNat.v b/theories/Arith/EqNat.v
index 4b51dfc005..6b61ca36ef 100644
--- a/theories/Arith/EqNat.v
+++ b/theories/Arith/EqNat.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Euclid.v b/theories/Arith/Euclid.v
index 29f4d3e239..fbf8e648a0 100644
--- a/theories/Arith/Euclid.v
+++ b/theories/Arith/Euclid.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Even.v b/theories/Arith/Even.v
index a1d0e9fcc2..102d1cfaca 100644
--- a/theories/Arith/Even.v
+++ b/theories/Arith/Even.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Factorial.v b/theories/Arith/Factorial.v
index 22f586d7e4..d77b3a54f1 100644
--- a/theories/Arith/Factorial.v
+++ b/theories/Arith/Factorial.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Gt.v b/theories/Arith/Gt.v
index 52ecf131bd..e784c77d27 100644
--- a/theories/Arith/Gt.v
+++ b/theories/Arith/Gt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Le.v b/theories/Arith/Le.v
index 69626cc10a..9dadf540cc 100644
--- a/theories/Arith/Le.v
+++ b/theories/Arith/Le.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Lt.v b/theories/Arith/Lt.v
index 0c7515c6f0..918b0efc5a 100644
--- a/theories/Arith/Lt.v
+++ b/theories/Arith/Lt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Max.v b/theories/Arith/Max.v
index 1727fa371c..7163ada41c 100644
--- a/theories/Arith/Max.v
+++ b/theories/Arith/Max.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Min.v b/theories/Arith/Min.v
index fcf0b14c8b..4073347e3a 100644
--- a/theories/Arith/Min.v
+++ b/theories/Arith/Min.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Minus.v b/theories/Arith/Minus.v
index d6adb7e205..f27443dc12 100644
--- a/theories/Arith/Minus.v
+++ b/theories/Arith/Minus.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Mult.v b/theories/Arith/Mult.v
index 4f4aa18371..57261d5951 100644
--- a/theories/Arith/Mult.v
+++ b/theories/Arith/Mult.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/PeanoNat.v b/theories/Arith/PeanoNat.v
index c46c23ad60..f12785029a 100644
--- a/theories/Arith/PeanoNat.v
+++ b/theories/Arith/PeanoNat.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Peano_dec.v b/theories/Arith/Peano_dec.v
index ddbc128aa1..a778079858 100644
--- a/theories/Arith/Peano_dec.v
+++ b/theories/Arith/Peano_dec.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -53,7 +53,7 @@ destruct le_mn1; intros le_mn2; destruct le_mn2.
now destruct (Nat.nle_succ_diag_l _ le_mn0).
+ intros def_n0; generalize le_mn1; rewrite def_n0; intros le_mn0.
now destruct (Nat.nle_succ_diag_l _ le_mn0).
-+ intros def_n0. injection def_n0 as ->.
++ intros def_n0. injection def_n0 as [= ->].
rewrite (UIP_nat _ _ def_n0 eq_refl); simpl.
assert (H : le_mn1 = le_mn2).
now apply IHn0.
diff --git a/theories/Arith/Plus.v b/theories/Arith/Plus.v
index b8297c2d8d..7969d42e50 100644
--- a/theories/Arith/Plus.v
+++ b/theories/Arith/Plus.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Arith/Wf_nat.v b/theories/Arith/Wf_nat.v
index b022889862..9822b270ba 100644
--- a/theories/Arith/Wf_nat.v
+++ b/theories/Arith/Wf_nat.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Bool/Bool.v b/theories/Bool/Bool.v
index 075288e216..0c0a1897a8 100644
--- a/theories/Bool/Bool.v
+++ b/theories/Bool/Bool.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Bool/BoolEq.v b/theories/Bool/BoolEq.v
index 59a1b8da43..f603fb4225 100644
--- a/theories/Bool/BoolEq.v
+++ b/theories/Bool/BoolEq.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Bool/Bvector.v b/theories/Bool/Bvector.v
index 3d615485b9..9413c20c02 100644
--- a/theories/Bool/Bvector.v
+++ b/theories/Bool/Bvector.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Bool/DecBool.v b/theories/Bool/DecBool.v
index f84aed1918..c865be2bd9 100644
--- a/theories/Bool/DecBool.v
+++ b/theories/Bool/DecBool.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Bool/IfProp.v b/theories/Bool/IfProp.v
index 32ed7fe78d..12d2ce6801 100644
--- a/theories/Bool/IfProp.v
+++ b/theories/Bool/IfProp.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Bool/Sumbool.v b/theories/Bool/Sumbool.v
index 5333c7411c..2144f0c13d 100644
--- a/theories/Bool/Sumbool.v
+++ b/theories/Bool/Sumbool.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Bool/Zerob.v b/theories/Bool/Zerob.v
index 2420c0fdce..6718bbb0f4 100644
--- a/theories/Bool/Zerob.v
+++ b/theories/Bool/Zerob.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Classes/CEquivalence.v b/theories/Classes/CEquivalence.v
index f04ae90950..b18863ad10 100644
--- a/theories/Classes/CEquivalence.v
+++ b/theories/Classes/CEquivalence.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Classes/CMorphisms.v b/theories/Classes/CMorphisms.v
index f9ca1bed29..fd47044d4f 100644
--- a/theories/Classes/CMorphisms.v
+++ b/theories/Classes/CMorphisms.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8; coq-prog-args: ("-coqlib" "../.." "-R" ".." "Coq" "-top" "Coq.Classes.CMorphisms") -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Classes/CRelationClasses.v b/theories/Classes/CRelationClasses.v
index c014ecc7ab..9ea9f6ecf7 100644
--- a/theories/Classes/CRelationClasses.v
+++ b/theories/Classes/CRelationClasses.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -337,7 +337,7 @@ Section Binary.
morphism for equivalence (see Morphisms). It is also sufficient to
show that [R] is antisymmetric w.r.t. [eqA] *)
- Global Instance partial_order_antisym `(PartialOrder eqA R) : ! Antisymmetric A eqA R.
+ Global Instance partial_order_antisym `(PartialOrder eqA R) : Antisymmetric eqA R.
Proof with auto.
reduce_goal.
apply H. firstorder.
diff --git a/theories/Classes/DecidableClass.v b/theories/Classes/DecidableClass.v
index bffad2b387..65dbdc1380 100644
--- a/theories/Classes/DecidableClass.v
+++ b/theories/Classes/DecidableClass.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Classes/EquivDec.v b/theories/Classes/EquivDec.v
index e9a9d6aff2..8b35b576f1 100644
--- a/theories/Classes/EquivDec.v
+++ b/theories/Classes/EquivDec.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -76,7 +76,7 @@ Infix "<>b" := nequiv_decb (no associativity, at level 70).
(** Decidable leibniz equality instances. *)
-(** The equiv is burried inside the setoid, but we can recover it by specifying
+(** The equiv is buried inside the setoid, but we can recover it by specifying
which setoid we're talking about. *)
Program Instance nat_eq_eqdec : EqDec nat eq := eq_nat_dec.
@@ -94,7 +94,7 @@ Program Instance unit_eqdec : EqDec unit eq := fun x y => in_left.
Obligation Tactic := unfold complement, equiv ; program_simpl.
Program Instance prod_eqdec `(EqDec A eq, EqDec B eq) :
- ! EqDec (prod A B) eq :=
+ EqDec (prod A B) eq :=
{ equiv_dec x y :=
let '(x1, x2) := x in
let '(y1, y2) := y in
@@ -115,7 +115,7 @@ Program Instance sum_eqdec `(EqDec A eq, EqDec B eq) :
(** Objects of function spaces with countable domains like bool have decidable
equality. Proving the reflection requires functional extensionality though. *)
-Program Instance bool_function_eqdec `(EqDec A eq) : ! EqDec (bool -> A) eq :=
+Program Instance bool_function_eqdec `(EqDec A eq) : EqDec (bool -> A) eq :=
{ equiv_dec f g :=
if f true == g true then
if f false == g false then in_left
@@ -130,7 +130,7 @@ Program Instance bool_function_eqdec `(EqDec A eq) : ! EqDec (bool -> A) eq :=
Require Import List.
-Program Instance list_eqdec `(eqa : EqDec A eq) : ! EqDec (list A) eq :=
+Program Instance list_eqdec `(eqa : EqDec A eq) : EqDec (list A) eq :=
{ equiv_dec :=
fix aux (x y : list A) :=
match x, y with
diff --git a/theories/Classes/Equivalence.v b/theories/Classes/Equivalence.v
index 384d041461..c4c6d2fbc6 100644
--- a/theories/Classes/Equivalence.v
+++ b/theories/Classes/Equivalence.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Classes/Init.v b/theories/Classes/Init.v
index 8732305953..5aa54ca114 100644
--- a/theories/Classes/Init.v
+++ b/theories/Classes/Init.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Classes/Morphisms.v b/theories/Classes/Morphisms.v
index a4fa537128..1d909ebf1f 100644
--- a/theories/Classes/Morphisms.v
+++ b/theories/Classes/Morphisms.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8; coq-prog-args: ("-coqlib" "../.." "-R" ".." "Coq" "-top" "Coq.Classes.Morphisms") -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Classes/Morphisms_Prop.v b/theories/Classes/Morphisms_Prop.v
index efb85aa341..7542440a94 100644
--- a/theories/Classes/Morphisms_Prop.v
+++ b/theories/Classes/Morphisms_Prop.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Classes/Morphisms_Relations.v b/theories/Classes/Morphisms_Relations.v
index a3e5750102..45f40649c8 100644
--- a/theories/Classes/Morphisms_Relations.v
+++ b/theories/Classes/Morphisms_Relations.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Classes/RelationClasses.v b/theories/Classes/RelationClasses.v
index 440b317573..428af5fcfe 100644
--- a/theories/Classes/RelationClasses.v
+++ b/theories/Classes/RelationClasses.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -464,7 +464,7 @@ Section Binary.
morphism for equivalence (see Morphisms). It is also sufficient to
show that [R] is antisymmetric w.r.t. [eqA] *)
- Global Instance partial_order_antisym `(PartialOrder eqA R) : ! Antisymmetric A eqA R.
+ Global Instance partial_order_antisym `(PartialOrder eqA R) : Antisymmetric A eqA R.
Proof with auto.
reduce_goal.
pose proof partial_order_equivalence as poe. do 3 red in poe.
@@ -481,7 +481,7 @@ Hint Extern 3 (PartialOrder (flip _)) => class_apply PartialOrder_inverse : type
(** The partial order defined by subrelation and relation equivalence. *)
Program Instance subrelation_partial_order :
- ! PartialOrder (relation A) relation_equivalence subrelation.
+ PartialOrder (@relation_equivalence A) subrelation.
Next Obligation.
Proof.
diff --git a/theories/Classes/RelationPairs.v b/theories/Classes/RelationPairs.v
index 341dacd4b2..8f458d7cf1 100644
--- a/theories/Classes/RelationPairs.v
+++ b/theories/Classes/RelationPairs.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Classes/SetoidClass.v b/theories/Classes/SetoidClass.v
index e6968bd6c2..071810acdc 100644
--- a/theories/Classes/SetoidClass.v
+++ b/theories/Classes/SetoidClass.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Classes/SetoidDec.v b/theories/Classes/SetoidDec.v
index f6b240bf20..1ec21a1e03 100644
--- a/theories/Classes/SetoidDec.v
+++ b/theories/Classes/SetoidDec.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -77,7 +77,7 @@ Infix "<>b" := nequiv_decb (no associativity, at level 70).
Require Import Coq.Arith.Arith.
-(** The equiv is burried inside the setoid, but we can recover
+(** The equiv is buried inside the setoid, but we can recover
it by specifying which setoid we're talking about. *)
Program Instance eq_setoid A : Setoid A | 10 :=
diff --git a/theories/Classes/SetoidTactics.v b/theories/Classes/SetoidTactics.v
index 94920f74ec..559a404ddd 100644
--- a/theories/Classes/SetoidTactics.v
+++ b/theories/Classes/SetoidTactics.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Compat/AdmitAxiom.v b/theories/Compat/AdmitAxiom.v
index f6b751bd5f..8ab8923c76 100644
--- a/theories/Compat/AdmitAxiom.v
+++ b/theories/Compat/AdmitAxiom.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Compat/Coq810.v b/theories/Compat/Coq810.v
index f10201661e..d24af2186f 100644
--- a/theories/Compat/Coq810.v
+++ b/theories/Compat/Coq810.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Compat/Coq88.v b/theories/Compat/Coq88.v
index e4a8df1e93..130aa35633 100644
--- a/theories/Compat/Coq88.v
+++ b/theories/Compat/Coq88.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Compat/Coq89.v b/theories/Compat/Coq89.v
index 49e0af9b2c..5025bce093 100644
--- a/theories/Compat/Coq89.v
+++ b/theories/Compat/Coq89.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FMapAVL.v b/theories/FSets/FMapAVL.v
index 63f907e567..801be79ba4 100644
--- a/theories/FSets/FMapAVL.v
+++ b/theories/FSets/FMapAVL.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FMapFacts.v b/theories/FSets/FMapFacts.v
index e68bc5930d..1a531542cc 100644
--- a/theories/FSets/FMapFacts.v
+++ b/theories/FSets/FMapFacts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -1988,7 +1988,7 @@ Module OrdProperties (M:S).
simpl; intros; try discriminate.
intros.
destruct a; destruct l; simpl in *.
- injection H as -> ->.
+ injection H as [= -> ->].
inversion_clear H1.
red in H; simpl in *; intuition.
elim H0; eauto.
@@ -2052,7 +2052,7 @@ Module OrdProperties (M:S).
generalize (elements_3 m).
destruct (elements m).
try discriminate.
- destruct p; injection H as -> ->; intros H4.
+ destruct p; injection H as [= -> ->]; intros H4.
inversion_clear H1 as [? ? H2|? ? H2].
red in H2; destruct H2; simpl in *; ME.order.
inversion_clear H4. rename H1 into H3.
diff --git a/theories/FSets/FMapFullAVL.v b/theories/FSets/FMapFullAVL.v
index b23885154b..8ca9401a06 100644
--- a/theories/FSets/FMapFullAVL.v
+++ b/theories/FSets/FMapFullAVL.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FMapInterface.v b/theories/FSets/FMapInterface.v
index 8970529103..a6ef26de0e 100644
--- a/theories/FSets/FMapInterface.v
+++ b/theories/FSets/FMapInterface.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -192,7 +192,7 @@ Module Type WSfun (E : DecidableType).
(** Equality of maps *)
(** Caveat: there are at least three distinct equality predicates on maps.
- - The simpliest (and maybe most natural) way is to consider keys up to
+ - The simplest (and maybe most natural) way is to consider keys up to
their equivalence [E.eq], but elements up to Leibniz equality, in
the spirit of [eq_key_elt] above. This leads to predicate [Equal].
- Unfortunately, this [Equal] predicate can't be used to describe
diff --git a/theories/FSets/FMapList.v b/theories/FSets/FMapList.v
index 335fdc3232..2af6e5c6a4 100644
--- a/theories/FSets/FMapList.v
+++ b/theories/FSets/FMapList.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FMapPositive.v b/theories/FSets/FMapPositive.v
index b47c99244b..e5133f66b2 100644
--- a/theories/FSets/FMapPositive.v
+++ b/theories/FSets/FMapPositive.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -277,7 +277,7 @@ Module PositiveMap <: S with Module E:=PositiveOrderedTypeBits.
rewrite append_assoc_1; apply in_or_app; right; apply in_cons;
apply IHm2; auto.
rewrite append_assoc_0; apply in_or_app; left; apply IHm1; auto.
- rewrite append_neutral_r; apply in_or_app; injection H as ->;
+ rewrite append_neutral_r; apply in_or_app; injection H as [= ->];
right; apply in_eq.
rewrite append_assoc_1; apply in_or_app; right; apply IHm2; auto.
rewrite append_assoc_0; apply in_or_app; left; apply IHm1; auto.
@@ -318,7 +318,7 @@ Module PositiveMap <: S with Module E:=PositiveOrderedTypeBits.
apply in_or_app.
left; apply IHm1; auto.
right; destruct (in_inv H0).
- injection H1 as -> ->; apply in_eq.
+ injection H1 as [= -> ->]; apply in_eq.
apply in_cons; apply IHm2; auto.
left; apply IHm1; auto.
right; apply IHm2; auto.
@@ -349,7 +349,7 @@ Module PositiveMap <: S with Module E:=PositiveOrderedTypeBits.
apply in_or_app.
left; apply IHm1; auto.
right; destruct (in_inv H0).
- injection H1 as -> ->; apply in_eq.
+ injection H1 as [= -> ->]; apply in_eq.
apply in_cons; apply IHm2; auto.
left; apply IHm1; auto.
right; apply IHm2; auto.
@@ -692,7 +692,7 @@ Module PositiveMap <: S with Module E:=PositiveOrderedTypeBits.
destruct y2; destruct y0; compute in Hy2; destruct Hy2; subst.
red; red; simpl.
destruct H0.
- injection H0 as H0 _; subst.
+ injection H0 as [= H0 _]; subst.
eapply xelements_bits_lt_1; eauto.
apply E.bits_lt_trans with p.
eapply xelements_bits_lt_1; eauto.
diff --git a/theories/FSets/FMapWeakList.v b/theories/FSets/FMapWeakList.v
index 12550ddf9a..0c04437581 100644
--- a/theories/FSets/FMapWeakList.v
+++ b/theories/FSets/FMapWeakList.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FMaps.v b/theories/FSets/FMaps.v
index ec50763589..1eefb1c0ad 100644
--- a/theories/FSets/FMaps.v
+++ b/theories/FSets/FMaps.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FSetAVL.v b/theories/FSets/FSetAVL.v
index dcaea894eb..f466052b98 100644
--- a/theories/FSets/FSetAVL.v
+++ b/theories/FSets/FSetAVL.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FSetBridge.v b/theories/FSets/FSetBridge.v
index 3952c28061..6e08c38a49 100644
--- a/theories/FSets/FSetBridge.v
+++ b/theories/FSets/FSetBridge.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FSetCompat.v b/theories/FSets/FSetCompat.v
index 736c85dada..fa275bc48f 100644
--- a/theories/FSets/FSetCompat.v
+++ b/theories/FSets/FSetCompat.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FSetDecide.v b/theories/FSets/FSetDecide.v
index 83bb07ffb6..b795ed42e3 100644
--- a/theories/FSets/FSetDecide.v
+++ b/theories/FSets/FSetDecide.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -240,7 +240,7 @@ the above form:
True.
Proof.
intros. push not in *.
- (* note that ~(R->P) remains (since R isnt decidable) *)
+ (* note that ~(R->P) remains (since R isn't decidable) *)
tauto.
Qed.
diff --git a/theories/FSets/FSetEqProperties.v b/theories/FSets/FSetEqProperties.v
index 3f8840529e..da504259f5 100644
--- a/theories/FSets/FSetEqProperties.v
+++ b/theories/FSets/FSetEqProperties.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FSetFacts.v b/theories/FSets/FSetFacts.v
index f4d281e937..8c96bec647 100644
--- a/theories/FSets/FSetFacts.v
+++ b/theories/FSets/FSetFacts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FSetInterface.v b/theories/FSets/FSetInterface.v
index fa7f1c5f4e..141935c31a 100644
--- a/theories/FSets/FSetInterface.v
+++ b/theories/FSets/FSetInterface.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FSetList.v b/theories/FSets/FSetList.v
index 2036d360aa..916ba4ff66 100644
--- a/theories/FSets/FSetList.v
+++ b/theories/FSets/FSetList.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FSetPositive.v b/theories/FSets/FSetPositive.v
index 8a93f38164..35e97a47c1 100644
--- a/theories/FSets/FSetPositive.v
+++ b/theories/FSets/FSetPositive.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -1009,10 +1009,10 @@ Module PositiveSet <: S with Module E:=PositiveOrderedTypeBits.
destruct o.
intros x H. injection H; intros; subst. reflexivity.
revert IHl. case choose.
- intros p Hp x H. injection H as <-. apply Hp.
+ intros p Hp x [= <-]. apply Hp.
reflexivity.
intros _ x. revert IHr. case choose.
- intros p Hp H. injection H as <-. apply Hp.
+ intros p Hp [= <-]. apply Hp.
reflexivity.
intros. discriminate.
Qed.
@@ -1068,11 +1068,11 @@ Module PositiveSet <: S with Module E:=PositiveOrderedTypeBits.
induction s as [| l IHl o r IHr]; simpl.
intros. discriminate.
intros x. destruct (min_elt l); intros.
- injection H as <-. apply IHl. reflexivity.
+ injection H as [= <-]. apply IHl. reflexivity.
destruct o; simpl.
- injection H as <-. reflexivity.
+ injection H as [= <-]. reflexivity.
destruct (min_elt r); simpl in *.
- injection H as <-. apply IHr. reflexivity.
+ injection H as [= <-]. apply IHr. reflexivity.
discriminate.
Qed.
@@ -1096,15 +1096,15 @@ Module PositiveSet <: S with Module E:=PositiveOrderedTypeBits.
induction s as [|l IHl o r IHr]; intros x y H H'.
discriminate.
simpl in H. case_eq (min_elt l).
- intros p Hp. rewrite Hp in H. injection H as <-.
+ intros p Hp. rewrite Hp in H. injection H as [= <-].
destruct y as [z|z|]; simpl; intro; trivial. apply (IHl p z); trivial.
intro Hp; rewrite Hp in H. apply min_elt_3 in Hp.
destruct o.
- injection H as <-. intros Hl.
+ injection H as [= <-]. intros Hl.
destruct y as [z|z|]; simpl; trivial. elim (Hp _ H').
destruct (min_elt r).
- injection H as <-.
+ injection H as [= <-].
destruct y as [z|z|].
apply (IHr e z); trivial.
elim (Hp _ H').
@@ -1121,11 +1121,11 @@ Module PositiveSet <: S with Module E:=PositiveOrderedTypeBits.
induction s as [| l IHl o r IHr]; simpl.
intros. discriminate.
intros x. destruct (max_elt r); intros.
- injection H as <-. apply IHr. reflexivity.
+ injection H as [= <-]. apply IHr. reflexivity.
destruct o; simpl.
- injection H as <-. reflexivity.
+ injection H as [= <-]. reflexivity.
destruct (max_elt l); simpl in *.
- injection H as <-. apply IHl. reflexivity.
+ injection H as [= <-]. apply IHl. reflexivity.
discriminate.
Qed.
@@ -1149,15 +1149,15 @@ Module PositiveSet <: S with Module E:=PositiveOrderedTypeBits.
induction s as [|l IHl o r IHr]; intros x y H H'.
discriminate.
simpl in H. case_eq (max_elt r).
- intros p Hp. rewrite Hp in H. injection H as <-.
+ intros p Hp. rewrite Hp in H. injection H as [= <-].
destruct y as [z|z|]; simpl; intro; trivial. apply (IHr p z); trivial.
intro Hp; rewrite Hp in H. apply max_elt_3 in Hp.
destruct o.
- injection H as <-. intros Hl.
+ injection H as [= <-]. intros Hl.
destruct y as [z|z|]; simpl; trivial. elim (Hp _ H').
destruct (max_elt l).
- injection H as <-.
+ injection H as [= <-].
destruct y as [z|z|].
elim (Hp _ H').
apply (IHl e z); trivial.
diff --git a/theories/FSets/FSetProperties.v b/theories/FSets/FSetProperties.v
index 6b6546f82d..c6b2e0a09d 100644
--- a/theories/FSets/FSetProperties.v
+++ b/theories/FSets/FSetProperties.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FSetToFiniteSet.v b/theories/FSets/FSetToFiniteSet.v
index f8d13ed2ba..d64ee9fd98 100644
--- a/theories/FSets/FSetToFiniteSet.v
+++ b/theories/FSets/FSetToFiniteSet.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FSetWeakList.v b/theories/FSets/FSetWeakList.v
index 1dacd05681..54cfc6e2b0 100644
--- a/theories/FSets/FSetWeakList.v
+++ b/theories/FSets/FSetWeakList.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/FSets/FSets.v b/theories/FSets/FSets.v
index 7e9e7aae7e..07a06a923d 100644
--- a/theories/FSets/FSets.v
+++ b/theories/FSets/FSets.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Init/Byte.v b/theories/Init/Byte.v
index eede9d5028..87936cb99c 100644
--- a/theories/Init/Byte.v
+++ b/theories/Init/Byte.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Init/Datatypes.v b/theories/Init/Datatypes.v
index 3603604a71..1639115cbd 100644
--- a/theories/Init/Datatypes.v
+++ b/theories/Init/Datatypes.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Init/Decimal.v b/theories/Init/Decimal.v
index 1a7dadb2c3..2ca3dd5adf 100644
--- a/theories/Init/Decimal.v
+++ b/theories/Init/Decimal.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Init/Logic.v b/theories/Init/Logic.v
index 1a391ed799..09a32e9483 100644
--- a/theories/Init/Logic.v
+++ b/theories/Init/Logic.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -37,7 +37,7 @@ Notation "~ x" := (not x) : type_scope.
Register not as core.not.type.
(** Create the "core" hint database, and set its transparent state for
- variables and constants explicitely. *)
+ variables and constants explicitly. *)
Create HintDb core.
Hint Variables Opaque : core.
diff --git a/theories/Init/Logic_Type.v b/theories/Init/Logic_Type.v
index 587de12a15..f8f0378a16 100644
--- a/theories/Init/Logic_Type.v
+++ b/theories/Init/Logic_Type.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Init/Nat.v b/theories/Init/Nat.v
index 7e7a1ced58..194fb59b13 100644
--- a/theories/Init/Nat.v
+++ b/theories/Init/Nat.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -331,7 +331,7 @@ Definition iter (n:nat) {A} (f:A->A) (x:A) : A :=
(** Bitwise operations *)
(** We provide here some bitwise operations for unary numbers.
- Some might be really naive, they are just there for fullfiling
+ Some might be really naive, they are just there for fulfilling
the same interface as other for natural representations. As
soon as binary representations such as NArith are available,
it is clearly better to convert to/from them and use their ops.
diff --git a/theories/Init/Notations.v b/theories/Init/Notations.v
index 8f8e639187..77236f77df 100644
--- a/theories/Init/Notations.v
+++ b/theories/Init/Notations.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Init/Peano.v b/theories/Init/Peano.v
index 4489f4cb15..149a7a0cc5 100644
--- a/theories/Init/Peano.v
+++ b/theories/Init/Peano.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Init/Prelude.v b/theories/Init/Prelude.v
index 81268a87ad..8c06a7dad2 100644
--- a/theories/Init/Prelude.v
+++ b/theories/Init/Prelude.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Init/Specif.v b/theories/Init/Specif.v
index fcec2f2fd6..c00f8edcf7 100644
--- a/theories/Init/Specif.v
+++ b/theories/Init/Specif.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Init/Tactics.v b/theories/Init/Tactics.v
index 497cf2550b..ad6f1765a3 100644
--- a/theories/Init/Tactics.v
+++ b/theories/Init/Tactics.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -75,7 +75,7 @@ Ltac case_eq x := generalize (eq_refl x); pattern x at -1; case x.
(* use either discriminate or injection on a hypothesis *)
-Ltac destr_eq H := discriminate H || (try (injection H as H)).
+Ltac destr_eq H := discriminate H || (try (injection H as [= H])).
(* Similar variants of destruct *)
diff --git a/theories/Init/Wf.v b/theories/Init/Wf.v
index f4cb34c713..998bbc7047 100644
--- a/theories/Init/Wf.v
+++ b/theories/Init/Wf.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Lists/List.v b/theories/Lists/List.v
index a48e9929c4..7f36edf5bb 100644
--- a/theories/Lists/List.v
+++ b/theories/Lists/List.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -250,7 +250,7 @@ Section Facts.
generalize (app_nil_r l); intros E.
rewrite -> E; auto.
intros.
- injection H as H H0.
+ injection H as [= H H0].
assert ([] = l ++ a0 :: l0) by auto.
apply app_cons_not_nil in H1 as [].
Qed.
@@ -261,18 +261,14 @@ Section Facts.
induction x as [| x l IHl];
[ destruct y as [| a l] | destruct y as [| a l0] ];
simpl; auto.
- - intros a b H.
- injection H.
+ - intros a b [= ].
auto.
- - intros a0 b H.
- injection H as H1 H0.
+ - intros a0 b [= H1 H0].
apply app_cons_not_nil in H0 as [].
- - intros a b H.
- injection H as H1 H0.
+ - intros a b [= H1 H0].
assert ([] = l ++ [a]) by auto.
apply app_cons_not_nil in H as [].
- - intros a0 b H.
- injection H as <- H0.
+ - intros a0 b [= <- H0].
destruct (IHl l0 a0 b H0) as (<-,<-).
split; auto.
Qed.
@@ -336,7 +332,7 @@ Section Facts.
absurd (length (x1 :: l1 ++ l) <= length l).
simpl; rewrite app_length; auto with arith.
rewrite H; auto with arith.
- injection H as H H0; f_equal; eauto.
+ injection H as [= H H0]; f_equal; eauto.
Qed.
End Facts.
@@ -519,7 +515,7 @@ Section Elts.
Proof.
revert l.
induction n as [|n IH]; intros [|x l] H; simpl in *; try easy.
- - exists nil; exists l. now injection H as ->.
+ - exists nil; exists l. now injection H as [= ->].
- destruct (IH _ H) as (l1 & l2 & H1 & H2).
exists (x::l1); exists l2; simpl; split; now f_equal.
Qed.
@@ -1243,7 +1239,7 @@ End Fold_Right_Recursor.
Proof.
induction l as [|a l IH]; simpl; [easy| ].
case_eq (f a); intros Ha Eq.
- * injection Eq as ->; auto.
+ * injection Eq as [= ->]; auto.
* destruct (IH Eq); auto.
Qed.
@@ -1304,10 +1300,10 @@ End Fold_Right_Recursor.
forall x:A, In x l <-> In x l1 \/ In x l2.
Proof.
revert l1 l2. induction l as [| a l' Hrec]; simpl; intros l1 l2 Eq x.
- - injection Eq as <- <-. tauto.
+ - injection Eq as [= <- <-]. tauto.
- destruct (partition l') as (left, right).
specialize (Hrec left right eq_refl x).
- destruct (f a); injection Eq as <- <-; simpl; tauto.
+ destruct (f a); injection Eq as [= <- <-]; simpl; tauto.
Qed.
End Bool.
@@ -1483,7 +1479,7 @@ End Fold_Right_Recursor.
destruct (in_app_or _ _ _ H); clear H.
destruct (in_map_iff (fun y : B => (a, y)) l' (x,y)) as (H1,_).
destruct (H1 H0) as (z,(H2,H3)); clear H0 H1.
- injection H2 as -> ->; intuition.
+ injection H2 as [= -> ->]; intuition.
intuition.
Qed.
diff --git a/theories/Lists/ListDec.v b/theories/Lists/ListDec.v
index e7e2cfc87e..88fd412f3d 100644
--- a/theories/Lists/ListDec.v
+++ b/theories/Lists/ListDec.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Lists/ListSet.v b/theories/Lists/ListSet.v
index 3afdd8df27..dc5f3658fa 100644
--- a/theories/Lists/ListSet.v
+++ b/theories/Lists/ListSet.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Lists/ListTactics.v b/theories/Lists/ListTactics.v
index 843e38352e..33d3915221 100644
--- a/theories/Lists/ListTactics.v
+++ b/theories/Lists/ListTactics.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Lists/SetoidList.v b/theories/Lists/SetoidList.v
index cab4c23df1..12885f5444 100644
--- a/theories/Lists/SetoidList.v
+++ b/theories/Lists/SetoidList.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Lists/SetoidPermutation.v b/theories/Lists/SetoidPermutation.v
index f5ea303343..a4766e59b3 100644
--- a/theories/Lists/SetoidPermutation.v
+++ b/theories/Lists/SetoidPermutation.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Lists/StreamMemo.v b/theories/Lists/StreamMemo.v
index 419a0be49c..c11a0941fa 100644
--- a/theories/Lists/StreamMemo.v
+++ b/theories/Lists/StreamMemo.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -70,7 +70,7 @@ Qed.
End MemoFunction.
(** For a dependent function, the previous solution is
- reused thanks to a temporarly hiding of the dependency
+ reused thanks to a temporary hiding of the dependency
in a "container" [memo_val]. *)
Section DependentMemoFunction.
diff --git a/theories/Lists/Streams.v b/theories/Lists/Streams.v
index 4503b3b643..407a7ae45d 100644
--- a/theories/Lists/Streams.v
+++ b/theories/Lists/Streams.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/Berardi.v b/theories/Logic/Berardi.v
index 4576ff4cbe..6e0143d93e 100644
--- a/theories/Logic/Berardi.v
+++ b/theories/Logic/Berardi.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -149,6 +149,7 @@ apply AC_IF.
Qed.
-Notation classical_proof_irrelevence := classical_proof_irrelevance (compat "8.8").
+#[deprecated(since = "8.8", note = "Use classical_proof_irrelevance instead.")]
+Notation classical_proof_irrelevence := classical_proof_irrelevance.
End Berardis_paradox.
diff --git a/theories/Logic/ChoiceFacts.v b/theories/Logic/ChoiceFacts.v
index 238ac7df0b..727217177e 100644
--- a/theories/Logic/ChoiceFacts.v
+++ b/theories/Logic/ChoiceFacts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/Classical.v b/theories/Logic/Classical.v
index 72f53a46e1..26861aaa96 100644
--- a/theories/Logic/Classical.v
+++ b/theories/Logic/Classical.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/ClassicalChoice.v b/theories/Logic/ClassicalChoice.v
index 016fa72f9b..94c40bed97 100644
--- a/theories/Logic/ClassicalChoice.v
+++ b/theories/Logic/ClassicalChoice.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/ClassicalDescription.v b/theories/Logic/ClassicalDescription.v
index 6867c76e21..de14d6cee2 100644
--- a/theories/Logic/ClassicalDescription.v
+++ b/theories/Logic/ClassicalDescription.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/ClassicalEpsilon.v b/theories/Logic/ClassicalEpsilon.v
index 77af904812..bca49a2e37 100644
--- a/theories/Logic/ClassicalEpsilon.v
+++ b/theories/Logic/ClassicalEpsilon.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/ClassicalFacts.v b/theories/Logic/ClassicalFacts.v
index b06384e992..2a9e15ab37 100644
--- a/theories/Logic/ClassicalFacts.v
+++ b/theories/Logic/ClassicalFacts.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -385,7 +385,7 @@ End Proof_irrelevance_EM_CC.
fragment of [Prop] into [bool], hence weak classical logic,
i.e. [forall A, ~A\/~~A], is enough for deriving a weak version of
proof-irrelevance. This is enough to derive a contradiction from a
- [Set]-bound weak excluded middle wih an impredicative [Set]
+ [Set]-bound weak excluded middle with an impredicative [Set]
universe. *)
Section Proof_irrelevance_WEM_CC.
diff --git a/theories/Logic/ClassicalUniqueChoice.v b/theories/Logic/ClassicalUniqueChoice.v
index 841bd1bede..0a15d02063 100644
--- a/theories/Logic/ClassicalUniqueChoice.v
+++ b/theories/Logic/ClassicalUniqueChoice.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/Classical_Pred_Type.v b/theories/Logic/Classical_Pred_Type.v
index 18820d3ba3..a53d77c60f 100644
--- a/theories/Logic/Classical_Pred_Type.v
+++ b/theories/Logic/Classical_Pred_Type.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/Classical_Prop.v b/theories/Logic/Classical_Prop.v
index 9f5a299371..6af7b1fe6e 100644
--- a/theories/Logic/Classical_Prop.v
+++ b/theories/Logic/Classical_Prop.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/ConstructiveEpsilon.v b/theories/Logic/ConstructiveEpsilon.v
index 04e3981001..6bd2c4f0d5 100644
--- a/theories/Logic/ConstructiveEpsilon.v
+++ b/theories/Logic/ConstructiveEpsilon.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/Decidable.v b/theories/Logic/Decidable.v
index 49276f904f..e7bdc72fd3 100644
--- a/theories/Logic/Decidable.v
+++ b/theories/Logic/Decidable.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/Description.v b/theories/Logic/Description.v
index 5c4f1960fb..e010824f45 100644
--- a/theories/Logic/Description.v
+++ b/theories/Logic/Description.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/Diaconescu.v b/theories/Logic/Diaconescu.v
index 66e82ddbf4..fcfdde86ce 100644
--- a/theories/Logic/Diaconescu.v
+++ b/theories/Logic/Diaconescu.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/Epsilon.v b/theories/Logic/Epsilon.v
index d8c527c612..53afeb1562 100644
--- a/theories/Logic/Epsilon.v
+++ b/theories/Logic/Epsilon.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/Eqdep.v b/theories/Logic/Eqdep.v
index 35bc422597..e3abe33133 100644
--- a/theories/Logic/Eqdep.v
+++ b/theories/Logic/Eqdep.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/EqdepFacts.v b/theories/Logic/EqdepFacts.v
index e2ec41ca94..7c0d1e3ca4 100644
--- a/theories/Logic/EqdepFacts.v
+++ b/theories/Logic/EqdepFacts.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/Eqdep_dec.v b/theories/Logic/Eqdep_dec.v
index 3babc9437b..ff8ae7b66f 100644
--- a/theories/Logic/Eqdep_dec.v
+++ b/theories/Logic/Eqdep_dec.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/ExtensionalFunctionRepresentative.v b/theories/Logic/ExtensionalFunctionRepresentative.v
index 0aac56bbcc..e4407808e3 100644
--- a/theories/Logic/ExtensionalFunctionRepresentative.v
+++ b/theories/Logic/ExtensionalFunctionRepresentative.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/ExtensionalityFacts.v b/theories/Logic/ExtensionalityFacts.v
index a70bd92329..5ea0f03551 100644
--- a/theories/Logic/ExtensionalityFacts.v
+++ b/theories/Logic/ExtensionalityFacts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/FinFun.v b/theories/Logic/FinFun.v
index 89f5a82a82..82c03e0a7d 100644
--- a/theories/Logic/FinFun.v
+++ b/theories/Logic/FinFun.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/FunctionalExtensionality.v b/theories/Logic/FunctionalExtensionality.v
index 95e1af2ead..b9785b7676 100644
--- a/theories/Logic/FunctionalExtensionality.v
+++ b/theories/Logic/FunctionalExtensionality.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/Hurkens.v b/theories/Logic/Hurkens.v
index 6c4a8533a1..9aed952183 100644
--- a/theories/Logic/Hurkens.v
+++ b/theories/Logic/Hurkens.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/IndefiniteDescription.v b/theories/Logic/IndefiniteDescription.v
index 86e81529dc..9ace708a7b 100644
--- a/theories/Logic/IndefiniteDescription.v
+++ b/theories/Logic/IndefiniteDescription.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/JMeq.v b/theories/Logic/JMeq.v
index 11897b6cb1..acaaa43052 100644
--- a/theories/Logic/JMeq.v
+++ b/theories/Logic/JMeq.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/ProofIrrelevance.v b/theories/Logic/ProofIrrelevance.v
index 134bf649dc..e4fbd1c273 100644
--- a/theories/Logic/ProofIrrelevance.v
+++ b/theories/Logic/ProofIrrelevance.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/ProofIrrelevanceFacts.v b/theories/Logic/ProofIrrelevanceFacts.v
index 10d9dbcdaf..afe63e03e1 100644
--- a/theories/Logic/ProofIrrelevanceFacts.v
+++ b/theories/Logic/ProofIrrelevanceFacts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/PropExtensionality.v b/theories/Logic/PropExtensionality.v
index 80dd4e850e..8e19a633a2 100644
--- a/theories/Logic/PropExtensionality.v
+++ b/theories/Logic/PropExtensionality.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/PropExtensionalityFacts.v b/theories/Logic/PropExtensionalityFacts.v
index 2b30351738..280cd8faed 100644
--- a/theories/Logic/PropExtensionalityFacts.v
+++ b/theories/Logic/PropExtensionalityFacts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/PropFacts.v b/theories/Logic/PropFacts.v
index 067870356a..80d9d783b6 100644
--- a/theories/Logic/PropFacts.v
+++ b/theories/Logic/PropFacts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/RelationalChoice.v b/theories/Logic/RelationalChoice.v
index 994f07856d..b8d4459cbc 100644
--- a/theories/Logic/RelationalChoice.v
+++ b/theories/Logic/RelationalChoice.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/SetIsType.v b/theories/Logic/SetIsType.v
index afa85514eb..238197adbf 100644
--- a/theories/Logic/SetIsType.v
+++ b/theories/Logic/SetIsType.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/SetoidChoice.v b/theories/Logic/SetoidChoice.v
index 21bf73356f..d16288f94c 100644
--- a/theories/Logic/SetoidChoice.v
+++ b/theories/Logic/SetoidChoice.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/StrictProp.v b/theories/Logic/StrictProp.v
index 99ee54e42f..600f629caf 100644
--- a/theories/Logic/StrictProp.v
+++ b/theories/Logic/StrictProp.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/WKL.v b/theories/Logic/WKL.v
index 579800b802..b6686092d4 100644
--- a/theories/Logic/WKL.v
+++ b/theories/Logic/WKL.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Logic/WeakFan.v b/theories/Logic/WeakFan.v
index c9822f47dc..b61edab665 100644
--- a/theories/Logic/WeakFan.v
+++ b/theories/Logic/WeakFan.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -64,7 +64,7 @@ induction l1, l2.
- discriminate.
- discriminate.
- intros H (HY1,H1) (HY2,H2).
- injection H as H.
+ injection H as [= H].
pose proof (IHl1 l2 H HY1 HY2). clear HY1 HY2 H IHl1.
subst l1.
f_equal.
diff --git a/theories/MSets/MSetAVL.v b/theories/MSets/MSetAVL.v
index 13e1dad361..4442108ffc 100644
--- a/theories/MSets/MSetAVL.v
+++ b/theories/MSets/MSetAVL.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/MSets/MSetDecide.v b/theories/MSets/MSetDecide.v
index f228cbb3bf..ab2bd446ee 100644
--- a/theories/MSets/MSetDecide.v
+++ b/theories/MSets/MSetDecide.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -240,7 +240,7 @@ the above form:
True.
Proof.
intros. push not in *.
- (* note that ~(R->P) remains (since R isnt decidable) *)
+ (* note that ~(R->P) remains (since R isn't decidable) *)
tauto.
Qed.
diff --git a/theories/MSets/MSetEqProperties.v b/theories/MSets/MSetEqProperties.v
index 4f2fdcf94c..e777f10411 100644
--- a/theories/MSets/MSetEqProperties.v
+++ b/theories/MSets/MSetEqProperties.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/MSets/MSetFacts.v b/theories/MSets/MSetFacts.v
index d57a7741e8..87ecd9c87a 100644
--- a/theories/MSets/MSetFacts.v
+++ b/theories/MSets/MSetFacts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/MSets/MSetGenTree.v b/theories/MSets/MSetGenTree.v
index a3dcca7dfd..37a169b02e 100644
--- a/theories/MSets/MSetGenTree.v
+++ b/theories/MSets/MSetGenTree.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -166,7 +166,7 @@ end.
*)
(** Enumeration of the elements of a tree. This corresponds
- to the "samefringe" notion in the litterature. *)
+ to the "samefringe" notion in the literature. *)
#[universes(template)]
Inductive enumeration :=
diff --git a/theories/MSets/MSetInterface.v b/theories/MSets/MSetInterface.v
index 6a18f59fc4..29c84d0d1a 100644
--- a/theories/MSets/MSetInterface.v
+++ b/theories/MSets/MSetInterface.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -659,7 +659,7 @@ End Raw2Sets.
(** It is in fact possible to provide an ordering on sets with
very little information on them (more or less only the [In]
predicate). This generic build of ordering is in fact not
- used for the moment, we rather use a simplier version
+ used for the moment, we rather use a simpler version
dedicated to sets-as-sorted-lists, see [MakeListOrdering].
*)
diff --git a/theories/MSets/MSetList.v b/theories/MSets/MSetList.v
index 7b64818b24..dd566a3cfa 100644
--- a/theories/MSets/MSetList.v
+++ b/theories/MSets/MSetList.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/MSets/MSetPositive.v b/theories/MSets/MSetPositive.v
index a726eebd31..4a11ea8f37 100644
--- a/theories/MSets/MSetPositive.v
+++ b/theories/MSets/MSetPositive.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -910,10 +910,10 @@ Module PositiveSet <: S with Module E:=PositiveOrderedTypeBits.
destruct o.
intros x H. injection H; intros; subst. reflexivity.
revert IHl. case choose.
- intros p Hp x H. injection H as <-. apply Hp.
+ intros p Hp x [= <-]. apply Hp.
reflexivity.
intros _ x. revert IHr. case choose.
- intros p Hp H. injection H as <-. apply Hp.
+ intros p Hp [= <-]. apply Hp.
reflexivity.
intros. discriminate.
Qed.
@@ -970,11 +970,11 @@ Module PositiveSet <: S with Module E:=PositiveOrderedTypeBits.
induction s as [| l IHl o r IHr]; simpl.
intros. discriminate.
intros x. destruct (min_elt l); intros.
- injection H as <-. apply IHl. reflexivity.
+ injection H as [= <-]. apply IHl. reflexivity.
destruct o; simpl.
- injection H as <-. reflexivity.
+ injection H as [= <-]. reflexivity.
destruct (min_elt r); simpl in *.
- injection H as <-. apply IHr. reflexivity.
+ injection H as [= <-]. apply IHr. reflexivity.
discriminate.
Qed.
@@ -998,15 +998,15 @@ Module PositiveSet <: S with Module E:=PositiveOrderedTypeBits.
induction s as [|l IHl o r IHr]; intros x y H H'.
discriminate.
simpl in H. case_eq (min_elt l).
- intros p Hp. rewrite Hp in H. injection H as <-.
+ intros p Hp. rewrite Hp in H. injection H as [= <-].
destruct y as [z|z|]; simpl; intro; trivial. apply (IHl p z); trivial.
intro Hp; rewrite Hp in H. apply min_elt_spec3 in Hp.
destruct o.
- injection H as <-. intros Hl.
+ injection H as [= <-]. intros Hl.
destruct y as [z|z|]; simpl; trivial. elim (Hp _ H').
destruct (min_elt r).
- injection H as <-.
+ injection H as [= <-].
destruct y as [z|z|].
apply (IHr e z); trivial.
elim (Hp _ H').
@@ -1023,11 +1023,11 @@ Module PositiveSet <: S with Module E:=PositiveOrderedTypeBits.
induction s as [| l IHl o r IHr]; simpl.
intros. discriminate.
intros x. destruct (max_elt r); intros.
- injection H as <-. apply IHr. reflexivity.
+ injection H as [= <-]. apply IHr. reflexivity.
destruct o; simpl.
- injection H as <-. reflexivity.
+ injection H as [= <-]. reflexivity.
destruct (max_elt l); simpl in *.
- injection H as <-. apply IHl. reflexivity.
+ injection H as [= <-]. apply IHl. reflexivity.
discriminate.
Qed.
@@ -1051,15 +1051,15 @@ Module PositiveSet <: S with Module E:=PositiveOrderedTypeBits.
induction s as [|l IHl o r IHr]; intros x y H H'.
discriminate.
simpl in H. case_eq (max_elt r).
- intros p Hp. rewrite Hp in H. injection H as <-.
+ intros p Hp. rewrite Hp in H. injection H as [= <-].
destruct y as [z|z|]; simpl; intro; trivial. apply (IHr p z); trivial.
intro Hp; rewrite Hp in H. apply max_elt_spec3 in Hp.
destruct o.
- injection H as <-. intros Hl.
+ injection H as [= <-]. intros Hl.
destruct y as [z|z|]; simpl; trivial. elim (Hp _ H').
destruct (max_elt l).
- injection H as <-.
+ injection H as [= <-].
destruct y as [z|z|].
elim (Hp _ H').
apply (IHl e z); trivial.
diff --git a/theories/MSets/MSetProperties.v b/theories/MSets/MSetProperties.v
index 29e57ff0a2..b2e135e1b9 100644
--- a/theories/MSets/MSetProperties.v
+++ b/theories/MSets/MSetProperties.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/MSets/MSetRBT.v b/theories/MSets/MSetRBT.v
index f9105fdf74..a3e0ec5884 100644
--- a/theories/MSets/MSetRBT.v
+++ b/theories/MSets/MSetRBT.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -1950,7 +1950,7 @@ Module Make (X: Orders.OrderedType) <:
generalize (fun x s' => @Raw.remove_min_spec1 s x s' Hs).
set (P := Raw.remove_min_ok s). clearbody P.
destruct (Raw.remove_min s) as [(x0,s0)|]; try easy.
- intros H U. injection U as -> <-. simpl.
+ intros H [= -> <-]. simpl.
destruct (H x s0); auto. subst; intuition.
Qed.
diff --git a/theories/MSets/MSetToFiniteSet.v b/theories/MSets/MSetToFiniteSet.v
index f456c407bc..40bd9606d5 100644
--- a/theories/MSets/MSetToFiniteSet.v
+++ b/theories/MSets/MSetToFiniteSet.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/MSets/MSetWeakList.v b/theories/MSets/MSetWeakList.v
index 19058a767e..aef7ab163e 100644
--- a/theories/MSets/MSetWeakList.v
+++ b/theories/MSets/MSetWeakList.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/MSets/MSets.v b/theories/MSets/MSets.v
index 0c9bc20cc2..3870669c82 100644
--- a/theories/MSets/MSets.v
+++ b/theories/MSets/MSets.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/NArith/BinNat.v b/theories/NArith/BinNat.v
index b8da5a2ed1..ad19e96466 100644
--- a/theories/NArith/BinNat.v
+++ b/theories/NArith/BinNat.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/NArith/BinNatDef.v b/theories/NArith/BinNatDef.v
index be12fffaaf..257daa6039 100644
--- a/theories/NArith/BinNatDef.v
+++ b/theories/NArith/BinNatDef.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -25,7 +25,7 @@ Module N.
Definition t := N.
-(** ** Nicer name [N.pos] for contructor [Npos] *)
+(** ** Nicer name [N.pos] for constructor [Npos] *)
Notation pos := Npos.
diff --git a/theories/NArith/NArith.v b/theories/NArith/NArith.v
index f3007970b4..399a710cc6 100644
--- a/theories/NArith/NArith.v
+++ b/theories/NArith/NArith.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/NArith/Ndec.v b/theories/NArith/Ndec.v
index 302ec434d0..2a1db6de56 100644
--- a/theories/NArith/Ndec.v
+++ b/theories/NArith/Ndec.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/NArith/Ndigits.v b/theories/NArith/Ndigits.v
index fb1cef1ddd..2b02f50c89 100644
--- a/theories/NArith/Ndigits.v
+++ b/theories/NArith/Ndigits.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/NArith/Ndist.v b/theories/NArith/Ndist.v
index d9a58c057b..6e6058ad24 100644
--- a/theories/NArith/Ndist.v
+++ b/theories/NArith/Ndist.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/NArith/Ndiv_def.v b/theories/NArith/Ndiv_def.v
index 9d8745fff7..df3185ac82 100644
--- a/theories/NArith/Ndiv_def.v
+++ b/theories/NArith/Ndiv_def.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/NArith/Ngcd_def.v b/theories/NArith/Ngcd_def.v
index 70784d9ced..6d340196ee 100644
--- a/theories/NArith/Ngcd_def.v
+++ b/theories/NArith/Ngcd_def.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/NArith/Nnat.v b/theories/NArith/Nnat.v
index 3488c8b434..179cb3f9c1 100644
--- a/theories/NArith/Nnat.v
+++ b/theories/NArith/Nnat.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/NArith/Nsqrt_def.v b/theories/NArith/Nsqrt_def.v
index 3a37c94fd8..bb1a1d259c 100644
--- a/theories/NArith/Nsqrt_def.v
+++ b/theories/NArith/Nsqrt_def.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/AltBinNotations.v b/theories/Numbers/AltBinNotations.v
index c7e3999691..7dcb9a8825 100644
--- a/theories/Numbers/AltBinNotations.v
+++ b/theories/Numbers/AltBinNotations.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -18,7 +18,7 @@
thousands of digits and more, conversion from/to [Decimal.int] can
become significantly slow. If that becomes a problem for your
development, this file provides some alternative [Numeral
- Notation] commmands that use [Z] as bridge type. To enable these
+ Notation] commands that use [Z] as bridge type. To enable these
commands, just be sure to [Require] this file after other files
defining numeral notations.
diff --git a/theories/Numbers/BinNums.v b/theories/Numbers/BinNums.v
index 247827597a..749d01fa71 100644
--- a/theories/Numbers/BinNums.v
+++ b/theories/Numbers/BinNums.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Cyclic/Abstract/CyclicAxioms.v b/theories/Numbers/Cyclic/Abstract/CyclicAxioms.v
index 9f718cba65..daca0ee5dc 100644
--- a/theories/Numbers/Cyclic/Abstract/CyclicAxioms.v
+++ b/theories/Numbers/Cyclic/Abstract/CyclicAxioms.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Cyclic/Abstract/DoubleType.v b/theories/Numbers/Cyclic/Abstract/DoubleType.v
index 9547a642df..83e9c29b13 100644
--- a/theories/Numbers/Cyclic/Abstract/DoubleType.v
+++ b/theories/Numbers/Cyclic/Abstract/DoubleType.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Cyclic/Abstract/NZCyclic.v b/theories/Numbers/Cyclic/Abstract/NZCyclic.v
index 64935ffe1a..53a71ce0c9 100644
--- a/theories/Numbers/Cyclic/Abstract/NZCyclic.v
+++ b/theories/Numbers/Cyclic/Abstract/NZCyclic.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Cyclic/Int31/Cyclic31.v b/theories/Numbers/Cyclic/Int31/Cyclic31.v
index 4b0bda3d44..e878fa289e 100644
--- a/theories/Numbers/Cyclic/Int31/Cyclic31.v
+++ b/theories/Numbers/Cyclic/Int31/Cyclic31.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -1288,7 +1288,7 @@ Section Int31_Specs.
intros; rewrite <- spec_1; apply spec_add.
Qed.
- (** Substraction *)
+ (** Subtraction *)
Lemma spec_sub_c : forall x y, [-|sub31c x y|] = [|x|] - [|y|].
Proof.
diff --git a/theories/Numbers/Cyclic/Int31/Int31.v b/theories/Numbers/Cyclic/Int31/Int31.v
index b9185c9ca0..07a3e998c0 100644
--- a/theories/Numbers/Cyclic/Int31/Int31.v
+++ b/theories/Numbers/Cyclic/Int31/Int31.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -255,7 +255,7 @@ Definition add31carryc (n m : int31) :=
| _ => C1 npmpone
end.
-(** * Substraction *)
+(** * Subtraction *)
(** Subtraction modulo [2^31] *)
diff --git a/theories/Numbers/Cyclic/Int31/Ring31.v b/theories/Numbers/Cyclic/Int31/Ring31.v
index eb47141cab..890f42d301 100644
--- a/theories/Numbers/Cyclic/Int31/Ring31.v
+++ b/theories/Numbers/Cyclic/Int31/Ring31.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Cyclic/Int63/Cyclic63.v b/theories/Numbers/Cyclic/Int63/Cyclic63.v
index c03e6615cb..74c91ac226 100644
--- a/theories/Numbers/Cyclic/Int63/Cyclic63.v
+++ b/theories/Numbers/Cyclic/Int63/Cyclic63.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2018 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
(** * Int63 numbers defines indeed a cyclic structure : Z/(2^31)Z *)
diff --git a/theories/Numbers/Cyclic/Int63/Int63.v b/theories/Numbers/Cyclic/Int63/Int63.v
index 3c96130bf3..9bb16b97e2 100644
--- a/theories/Numbers/Cyclic/Int63/Int63.v
+++ b/theories/Numbers/Cyclic/Int63/Int63.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Cyclic/Int63/Ring63.v b/theories/Numbers/Cyclic/Int63/Ring63.v
index d230435378..6ddf8eae7b 100644
--- a/theories/Numbers/Cyclic/Int63/Ring63.v
+++ b/theories/Numbers/Cyclic/Int63/Ring63.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2018 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
(** * Int63 numbers defines Z/(2^63)Z, and can hence be equipped
diff --git a/theories/Numbers/Cyclic/ZModulo/ZModulo.v b/theories/Numbers/Cyclic/ZModulo/ZModulo.v
index 4bcd22543f..28565b2fe3 100644
--- a/theories/Numbers/Cyclic/ZModulo/ZModulo.v
+++ b/theories/Numbers/Cyclic/ZModulo/ZModulo.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -372,7 +372,7 @@ Section ZModulo.
assert (Z.div_eucl ([|x|]*[|y|]) wB = (([|x|]*[|y|])/wB,([|x|]*[|y|]) mod wB)).
unfold Z.modulo, Z.div; destruct Z.div_eucl; auto.
generalize (Z_div_mod ([|x|]*[|y|]) wB wB_pos); destruct Z.div_eucl as (h,l).
- destruct 1; injection H as ? ?.
+ destruct 1; injection H as [= ? ?].
rewrite H0.
assert ([|l|] = l).
apply Zmod_small; auto.
@@ -414,7 +414,7 @@ Section ZModulo.
unfold Z.modulo, Z.div; destruct Z.div_eucl; auto.
generalize (Z_div_mod [|a|] [|b|] H0).
destruct Z.div_eucl as (q,r); destruct 1; intros.
- injection H1 as ? ?.
+ injection H1 as [= ? ?].
assert ([|r|]=r).
apply Zmod_small; generalize (Z_mod_lt b wB wB_pos); fold [|b|];
auto with zarith.
@@ -525,7 +525,7 @@ Section ZModulo.
unfold Z.modulo, Z.div; destruct Z.div_eucl; auto.
generalize (Z_div_mod a [|b|] H3).
destruct Z.div_eucl as (q,r); destruct 1; intros.
- injection H4 as ? ?.
+ injection H4 as [= ? ?].
assert ([|r|]=r).
apply Zmod_small; generalize (Z_mod_lt b wB wB_pos); fold [|b|];
auto with zarith.
diff --git a/theories/Numbers/DecimalFacts.v b/theories/Numbers/DecimalFacts.v
index 0f49052777..5c57d869d0 100644
--- a/theories/Numbers/DecimalFacts.v
+++ b/theories/Numbers/DecimalFacts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/DecimalN.v b/theories/Numbers/DecimalN.v
index ef00e2805b..2b46d8d342 100644
--- a/theories/Numbers/DecimalN.v
+++ b/theories/Numbers/DecimalN.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/DecimalNat.v b/theories/Numbers/DecimalNat.v
index 5ffe1688b5..7d8e5ab749 100644
--- a/theories/Numbers/DecimalNat.v
+++ b/theories/Numbers/DecimalNat.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/DecimalPos.v b/theories/Numbers/DecimalPos.v
index 722e73d96b..7e8c52736f 100644
--- a/theories/Numbers/DecimalPos.v
+++ b/theories/Numbers/DecimalPos.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/DecimalString.v b/theories/Numbers/DecimalString.v
index 591024baec..94bcf4dd1d 100644
--- a/theories/Numbers/DecimalString.v
+++ b/theories/Numbers/DecimalString.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/DecimalZ.v b/theories/Numbers/DecimalZ.v
index 3a08379635..5c12d808ff 100644
--- a/theories/Numbers/DecimalZ.v
+++ b/theories/Numbers/DecimalZ.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZAdd.v b/theories/Numbers/Integer/Abstract/ZAdd.v
index c4c5174dac..dec0489250 100644
--- a/theories/Numbers/Integer/Abstract/ZAdd.v
+++ b/theories/Numbers/Integer/Abstract/ZAdd.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZAddOrder.v b/theories/Numbers/Integer/Abstract/ZAddOrder.v
index 7f5b0df68e..33f89bc37f 100644
--- a/theories/Numbers/Integer/Abstract/ZAddOrder.v
+++ b/theories/Numbers/Integer/Abstract/ZAddOrder.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZAxioms.v b/theories/Numbers/Integer/Abstract/ZAxioms.v
index 4f1ab7752d..cb8d77a5ce 100644
--- a/theories/Numbers/Integer/Abstract/ZAxioms.v
+++ b/theories/Numbers/Integer/Abstract/ZAxioms.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZBase.v b/theories/Numbers/Integer/Abstract/ZBase.v
index 7fdd018d33..17a6afb124 100644
--- a/theories/Numbers/Integer/Abstract/ZBase.v
+++ b/theories/Numbers/Integer/Abstract/ZBase.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZBits.v b/theories/Numbers/Integer/Abstract/ZBits.v
index 4aabda77ee..a57abf3910 100644
--- a/theories/Numbers/Integer/Abstract/ZBits.v
+++ b/theories/Numbers/Integer/Abstract/ZBits.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -324,7 +324,7 @@ Proof.
now rewrite <- opp_succ, opp_nonneg_nonpos, le_succ_l.
Qed.
-(** Accesing a high enough bit of a number gives its sign *)
+(** Accessing a high enough bit of a number gives its sign *)
Lemma bits_iff_nonneg : forall a n, log2 (abs a) < n ->
(0<=a <-> a.[n] = false).
diff --git a/theories/Numbers/Integer/Abstract/ZDivEucl.v b/theories/Numbers/Integer/Abstract/ZDivEucl.v
index a70ecd19d8..a2c2d17adb 100644
--- a/theories/Numbers/Integer/Abstract/ZDivEucl.v
+++ b/theories/Numbers/Integer/Abstract/ZDivEucl.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZDivFloor.v b/theories/Numbers/Integer/Abstract/ZDivFloor.v
index a0d1821b63..0a2281c1ce 100644
--- a/theories/Numbers/Integer/Abstract/ZDivFloor.v
+++ b/theories/Numbers/Integer/Abstract/ZDivFloor.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZDivTrunc.v b/theories/Numbers/Integer/Abstract/ZDivTrunc.v
index 31e427383d..5ce18ce722 100644
--- a/theories/Numbers/Integer/Abstract/ZDivTrunc.v
+++ b/theories/Numbers/Integer/Abstract/ZDivTrunc.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZGcd.v b/theories/Numbers/Integer/Abstract/ZGcd.v
index f0b7bf9d25..49e379dc53 100644
--- a/theories/Numbers/Integer/Abstract/ZGcd.v
+++ b/theories/Numbers/Integer/Abstract/ZGcd.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZLcm.v b/theories/Numbers/Integer/Abstract/ZLcm.v
index 0ab528de80..8193949f1f 100644
--- a/theories/Numbers/Integer/Abstract/ZLcm.v
+++ b/theories/Numbers/Integer/Abstract/ZLcm.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -207,7 +207,7 @@ Qed.
We had an abs in order to have an always-nonnegative lcm,
in the spirit of gcd. Nota: [lcm 0 0] should be 0, which
- isn't garantee with the third equation above.
+ isn't guarantee with the third equation above.
*)
Definition lcm a b := abs (a*(b/gcd a b)).
diff --git a/theories/Numbers/Integer/Abstract/ZLt.v b/theories/Numbers/Integer/Abstract/ZLt.v
index 726b041c21..f80c074567 100644
--- a/theories/Numbers/Integer/Abstract/ZLt.v
+++ b/theories/Numbers/Integer/Abstract/ZLt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZMaxMin.v b/theories/Numbers/Integer/Abstract/ZMaxMin.v
index f3f3a861b7..cfb8fceaf1 100644
--- a/theories/Numbers/Integer/Abstract/ZMaxMin.v
+++ b/theories/Numbers/Integer/Abstract/ZMaxMin.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZMul.v b/theories/Numbers/Integer/Abstract/ZMul.v
index 120647dcc4..50b168f559 100644
--- a/theories/Numbers/Integer/Abstract/ZMul.v
+++ b/theories/Numbers/Integer/Abstract/ZMul.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZMulOrder.v b/theories/Numbers/Integer/Abstract/ZMulOrder.v
index cd9523d34e..802243d325 100644
--- a/theories/Numbers/Integer/Abstract/ZMulOrder.v
+++ b/theories/Numbers/Integer/Abstract/ZMulOrder.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZParity.v b/theories/Numbers/Integer/Abstract/ZParity.v
index a5e53b3615..88dad3ff0b 100644
--- a/theories/Numbers/Integer/Abstract/ZParity.v
+++ b/theories/Numbers/Integer/Abstract/ZParity.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZPow.v b/theories/Numbers/Integer/Abstract/ZPow.v
index a4b964e52f..fe50fe2868 100644
--- a/theories/Numbers/Integer/Abstract/ZPow.v
+++ b/theories/Numbers/Integer/Abstract/ZPow.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZProperties.v b/theories/Numbers/Integer/Abstract/ZProperties.v
index e4b997cfdc..2fee4efe7e 100644
--- a/theories/Numbers/Integer/Abstract/ZProperties.v
+++ b/theories/Numbers/Integer/Abstract/ZProperties.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Abstract/ZSgnAbs.v b/theories/Numbers/Integer/Abstract/ZSgnAbs.v
index dda1287269..cdbcc928ea 100644
--- a/theories/Numbers/Integer/Abstract/ZSgnAbs.v
+++ b/theories/Numbers/Integer/Abstract/ZSgnAbs.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/Binary/ZBinary.v b/theories/Numbers/Integer/Binary/ZBinary.v
index bed827fd0e..d2a2b881aa 100644
--- a/theories/Numbers/Integer/Binary/ZBinary.v
+++ b/theories/Numbers/Integer/Binary/ZBinary.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Integer/NatPairs/ZNatPairs.v b/theories/Numbers/Integer/NatPairs/ZNatPairs.v
index 995d96b314..0f3d531ac4 100644
--- a/theories/Numbers/Integer/NatPairs/ZNatPairs.v
+++ b/theories/Numbers/Integer/NatPairs/ZNatPairs.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NaryFunctions.v b/theories/Numbers/NaryFunctions.v
index ee28628ed9..90d14a4274 100644
--- a/theories/Numbers/NaryFunctions.v
+++ b/theories/Numbers/NaryFunctions.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZAdd.v b/theories/Numbers/NatInt/NZAdd.v
index 9fcb029b3c..5a561889da 100644
--- a/theories/Numbers/NatInt/NZAdd.v
+++ b/theories/Numbers/NatInt/NZAdd.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZAddOrder.v b/theories/Numbers/NatInt/NZAddOrder.v
index 5f102e853b..be6704db0a 100644
--- a/theories/Numbers/NatInt/NZAddOrder.v
+++ b/theories/Numbers/NatInt/NZAddOrder.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -149,7 +149,7 @@ Proof.
intros n m H; apply add_le_cases; now nzsimpl.
Qed.
-(** Substraction *)
+(** Subtraction *)
(** We can prove the existence of a subtraction of any number by
a smaller one *)
diff --git a/theories/Numbers/NatInt/NZAxioms.v b/theories/Numbers/NatInt/NZAxioms.v
index 8c364cde7d..47b26d3d36 100644
--- a/theories/Numbers/NatInt/NZAxioms.v
+++ b/theories/Numbers/NatInt/NZAxioms.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZBase.v b/theories/Numbers/NatInt/NZBase.v
index 840a798d9b..95238198b5 100644
--- a/theories/Numbers/NatInt/NZBase.v
+++ b/theories/Numbers/NatInt/NZBase.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZBits.v b/theories/Numbers/NatInt/NZBits.v
index eefa51572f..b915bf4fbb 100644
--- a/theories/Numbers/NatInt/NZBits.v
+++ b/theories/Numbers/NatInt/NZBits.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZDiv.v b/theories/Numbers/NatInt/NZDiv.v
index b94cef7cee..9a338e1939 100644
--- a/theories/Numbers/NatInt/NZDiv.v
+++ b/theories/Numbers/NatInt/NZDiv.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZDomain.v b/theories/Numbers/NatInt/NZDomain.v
index acebfcf1d2..4fdcf7be6c 100644
--- a/theories/Numbers/NatInt/NZDomain.v
+++ b/theories/Numbers/NatInt/NZDomain.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -310,7 +310,7 @@ Qed.
End NZOfNatOrd.
-(** For basic operations, we can prove correspondance with
+(** For basic operations, we can prove correspondence with
their counterpart in [nat]. *)
Module NZOfNatOps (Import NZ:NZAxiomsSig').
diff --git a/theories/Numbers/NatInt/NZGcd.v b/theories/Numbers/NatInt/NZGcd.v
index 1ac89ce942..4479575327 100644
--- a/theories/Numbers/NatInt/NZGcd.v
+++ b/theories/Numbers/NatInt/NZGcd.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZLog.v b/theories/Numbers/NatInt/NZLog.v
index 1951cfc3ef..02ccc9e798 100644
--- a/theories/Numbers/NatInt/NZLog.v
+++ b/theories/Numbers/NatInt/NZLog.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZMul.v b/theories/Numbers/NatInt/NZMul.v
index 1492188452..e83d5d74c8 100644
--- a/theories/Numbers/NatInt/NZMul.v
+++ b/theories/Numbers/NatInt/NZMul.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZMulOrder.v b/theories/Numbers/NatInt/NZMulOrder.v
index dc4167e96f..249dc6390c 100644
--- a/theories/Numbers/NatInt/NZMulOrder.v
+++ b/theories/Numbers/NatInt/NZMulOrder.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZOrder.v b/theories/Numbers/NatInt/NZOrder.v
index 89bc5cfecb..005822d0a9 100644
--- a/theories/Numbers/NatInt/NZOrder.v
+++ b/theories/Numbers/NatInt/NZOrder.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZParity.v b/theories/Numbers/NatInt/NZParity.v
index 84b8a96e64..5bc461fb8e 100644
--- a/theories/Numbers/NatInt/NZParity.v
+++ b/theories/Numbers/NatInt/NZParity.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZPow.v b/theories/Numbers/NatInt/NZPow.v
index 830540bc66..4f9337a1b6 100644
--- a/theories/Numbers/NatInt/NZPow.v
+++ b/theories/Numbers/NatInt/NZPow.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZProperties.v b/theories/Numbers/NatInt/NZProperties.v
index fbcf43e880..aeade29062 100644
--- a/theories/Numbers/NatInt/NZProperties.v
+++ b/theories/Numbers/NatInt/NZProperties.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NatInt/NZSqrt.v b/theories/Numbers/NatInt/NZSqrt.v
index 85ed71b8a4..6aa94ddf38 100644
--- a/theories/Numbers/NatInt/NZSqrt.v
+++ b/theories/Numbers/NatInt/NZSqrt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NAdd.v b/theories/Numbers/Natural/Abstract/NAdd.v
index dc5f8e5372..cc2a4c0207 100644
--- a/theories/Numbers/Natural/Abstract/NAdd.v
+++ b/theories/Numbers/Natural/Abstract/NAdd.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NAddOrder.v b/theories/Numbers/Natural/Abstract/NAddOrder.v
index 2da3f0bfcb..10cf4dfee7 100644
--- a/theories/Numbers/Natural/Abstract/NAddOrder.v
+++ b/theories/Numbers/Natural/Abstract/NAddOrder.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NAxioms.v b/theories/Numbers/Natural/Abstract/NAxioms.v
index dd09ac5f3e..50a2fb4cae 100644
--- a/theories/Numbers/Natural/Abstract/NAxioms.v
+++ b/theories/Numbers/Natural/Abstract/NAxioms.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NBase.v b/theories/Numbers/Natural/Abstract/NBase.v
index ad0b3d3d2a..974fd5be95 100644
--- a/theories/Numbers/Natural/Abstract/NBase.v
+++ b/theories/Numbers/Natural/Abstract/NBase.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NBits.v b/theories/Numbers/Natural/Abstract/NBits.v
index 90663de3f2..6948e17f1b 100644
--- a/theories/Numbers/Natural/Abstract/NBits.v
+++ b/theories/Numbers/Natural/Abstract/NBits.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NDefOps.v b/theories/Numbers/Natural/Abstract/NDefOps.v
index 4539dea276..b877858679 100644
--- a/theories/Numbers/Natural/Abstract/NDefOps.v
+++ b/theories/Numbers/Natural/Abstract/NDefOps.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NDiv.v b/theories/Numbers/Natural/Abstract/NDiv.v
index 4c26a071f0..f0a67750e6 100644
--- a/theories/Numbers/Natural/Abstract/NDiv.v
+++ b/theories/Numbers/Natural/Abstract/NDiv.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NGcd.v b/theories/Numbers/Natural/Abstract/NGcd.v
index 96fb4247cc..e159341af3 100644
--- a/theories/Numbers/Natural/Abstract/NGcd.v
+++ b/theories/Numbers/Natural/Abstract/NGcd.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NIso.v b/theories/Numbers/Natural/Abstract/NIso.v
index d41d0aff56..0996704413 100644
--- a/theories/Numbers/Natural/Abstract/NIso.v
+++ b/theories/Numbers/Natural/Abstract/NIso.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NLcm.v b/theories/Numbers/Natural/Abstract/NLcm.v
index 47b74193ed..bf1c96845e 100644
--- a/theories/Numbers/Natural/Abstract/NLcm.v
+++ b/theories/Numbers/Natural/Abstract/NLcm.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -90,7 +90,7 @@ Qed.
= (a / gcd a b) * b
= (a*b) / gcd a b
- Nota: [lcm 0 0] should be 0, which isn't garantee with the third
+ Nota: [lcm 0 0] should be 0, which isn't guarantee with the third
equation above.
*)
diff --git a/theories/Numbers/Natural/Abstract/NLog.v b/theories/Numbers/Natural/Abstract/NLog.v
index fe6fcee567..ad6bb9c740 100644
--- a/theories/Numbers/Natural/Abstract/NLog.v
+++ b/theories/Numbers/Natural/Abstract/NLog.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NMaxMin.v b/theories/Numbers/Natural/Abstract/NMaxMin.v
index 3cf4d3f9f2..7ad6d2ef5a 100644
--- a/theories/Numbers/Natural/Abstract/NMaxMin.v
+++ b/theories/Numbers/Natural/Abstract/NMaxMin.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NMulOrder.v b/theories/Numbers/Natural/Abstract/NMulOrder.v
index b7f1c8e453..8cd67d80cf 100644
--- a/theories/Numbers/Natural/Abstract/NMulOrder.v
+++ b/theories/Numbers/Natural/Abstract/NMulOrder.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NOrder.v b/theories/Numbers/Natural/Abstract/NOrder.v
index acaecad93c..ab1a526300 100644
--- a/theories/Numbers/Natural/Abstract/NOrder.v
+++ b/theories/Numbers/Natural/Abstract/NOrder.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NParity.v b/theories/Numbers/Natural/Abstract/NParity.v
index cb89e1d729..a278b4a45a 100644
--- a/theories/Numbers/Natural/Abstract/NParity.v
+++ b/theories/Numbers/Natural/Abstract/NParity.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NPow.v b/theories/Numbers/Natural/Abstract/NPow.v
index fc1cc93b11..cdda29aae5 100644
--- a/theories/Numbers/Natural/Abstract/NPow.v
+++ b/theories/Numbers/Natural/Abstract/NPow.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NProperties.v b/theories/Numbers/Natural/Abstract/NProperties.v
index bcf906cf92..0d6b438f81 100644
--- a/theories/Numbers/Natural/Abstract/NProperties.v
+++ b/theories/Numbers/Natural/Abstract/NProperties.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NSqrt.v b/theories/Numbers/Natural/Abstract/NSqrt.v
index 6bffe693e6..5ea34a9716 100644
--- a/theories/Numbers/Natural/Abstract/NSqrt.v
+++ b/theories/Numbers/Natural/Abstract/NSqrt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NStrongRec.v b/theories/Numbers/Natural/Abstract/NStrongRec.v
index f76d8ae8a2..74633a0be5 100644
--- a/theories/Numbers/Natural/Abstract/NStrongRec.v
+++ b/theories/Numbers/Natural/Abstract/NStrongRec.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Abstract/NSub.v b/theories/Numbers/Natural/Abstract/NSub.v
index 453b0c0d4c..212db0a990 100644
--- a/theories/Numbers/Natural/Abstract/NSub.v
+++ b/theories/Numbers/Natural/Abstract/NSub.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Binary/NBinary.v b/theories/Numbers/Natural/Binary/NBinary.v
index c9e1c64013..d899f8eb2a 100644
--- a/theories/Numbers/Natural/Binary/NBinary.v
+++ b/theories/Numbers/Natural/Binary/NBinary.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/Natural/Peano/NPeano.v b/theories/Numbers/Natural/Peano/NPeano.v
index 6000bdcf79..d630a9655f 100644
--- a/theories/Numbers/Natural/Peano/NPeano.v
+++ b/theories/Numbers/Natural/Peano/NPeano.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Numbers/NumPrelude.v b/theories/Numbers/NumPrelude.v
index 7cf13feaea..f73fe824e5 100644
--- a/theories/Numbers/NumPrelude.v
+++ b/theories/Numbers/NumPrelude.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/PArith/BinPos.v b/theories/PArith/BinPos.v
index c85252d6f8..0ce835ae98 100644
--- a/theories/PArith/BinPos.v
+++ b/theories/PArith/BinPos.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/PArith/BinPosDef.v b/theories/PArith/BinPosDef.v
index 7f30733559..63f9b53396 100644
--- a/theories/PArith/BinPosDef.v
+++ b/theories/PArith/BinPosDef.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -310,7 +310,7 @@ Infix "<?" := ltb (at level 70, no associativity) : positive_scope.
(** ** A Square Root function for positive numbers *)
-(** We procede by blocks of two digits : if p is written qbb'
+(** We proceed by blocks of two digits : if p is written qbb'
then sqrt(p) will be sqrt(q)~0 or sqrt(q)~1.
For deciding easily in which case we are, we store the remainder
(as a mask, since it can be null).
diff --git a/theories/PArith/PArith.v b/theories/PArith/PArith.v
index 2be3d07cc4..fba38b785b 100644
--- a/theories/PArith/PArith.v
+++ b/theories/PArith/PArith.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/PArith/POrderedType.v b/theories/PArith/POrderedType.v
index c454e8afde..b96923b7c0 100644
--- a/theories/PArith/POrderedType.v
+++ b/theories/PArith/POrderedType.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/PArith/Pnat.v b/theories/PArith/Pnat.v
index 26aba87fb1..1be353a623 100644
--- a/theories/PArith/Pnat.v
+++ b/theories/PArith/Pnat.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Program/Basics.v b/theories/Program/Basics.v
index d86112abc0..2a814873f3 100644
--- a/theories/Program/Basics.v
+++ b/theories/Program/Basics.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Program/Combinators.v b/theories/Program/Combinators.v
index f78d06b1d4..92f381397f 100644
--- a/theories/Program/Combinators.v
+++ b/theories/Program/Combinators.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Program/Equality.v b/theories/Program/Equality.v
index 5ae933d433..b09a7d3264 100644
--- a/theories/Program/Equality.v
+++ b/theories/Program/Equality.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -31,7 +31,7 @@ Definition block {A : Type} (a : A) := a.
Ltac block_goal := match goal with [ |- ?T ] => change (block T) end.
Ltac unblock_goal := unfold block in *.
-(** Notation for heterogenous equality. *)
+(** Notation for heterogeneous equality. *)
Notation " x ~= y " := (@JMeq _ x _ y) (at level 70, no associativity).
@@ -88,7 +88,7 @@ Ltac elim_eq_rect :=
end
end.
-(** Rewrite using uniqueness of indentity proofs [H = eq_refl]. *)
+(** Rewrite using uniqueness of identity proofs [H = eq_refl]. *)
Ltac simpl_uip :=
match goal with
@@ -450,7 +450,7 @@ Tactic Notation "dependent" "destruction" ident(H) "generalizing" ne_hyp_list(l)
do_depelim' ltac:(fun hyp => revert l) ltac:(fun hyp => destruct hyp using c) H.
(** Then we have wrappers for usual calls to induction. One can customize the induction tactic by
- writting another wrapper calling do_depelim. We suppose the hyp has to be generalized before
+ writing another wrapper calling do_depelim. We suppose the hyp has to be generalized before
calling [induction]. *)
Tactic Notation "dependent" "induction" ident(H) :=
diff --git a/theories/Program/Program.v b/theories/Program/Program.v
index de0a6d5d6c..02907e6e18 100644
--- a/theories/Program/Program.v
+++ b/theories/Program/Program.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Program/Subset.v b/theories/Program/Subset.v
index ae366204ac..fbe68b12cd 100644
--- a/theories/Program/Subset.v
+++ b/theories/Program/Subset.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Program/Syntax.v b/theories/Program/Syntax.v
index 785b9437ee..f75e0ba4b5 100644
--- a/theories/Program/Syntax.v
+++ b/theories/Program/Syntax.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Program/Tactics.v b/theories/Program/Tactics.v
index 001e1cfb01..ba8e4dff6d 100644
--- a/theories/Program/Tactics.v
+++ b/theories/Program/Tactics.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Program/Utils.v b/theories/Program/Utils.v
index c51cacac68..1eab2ebddf 100644
--- a/theories/Program/Utils.v
+++ b/theories/Program/Utils.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Program/Wf.v b/theories/Program/Wf.v
index 092c1d6f48..8813a26b4f 100644
--- a/theories/Program/Wf.v
+++ b/theories/Program/Wf.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/QArith/QArith.v b/theories/QArith/QArith.v
index 813900822f..7a78fa01db 100644
--- a/theories/QArith/QArith.v
+++ b/theories/QArith/QArith.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/QArith/QArith_base.v b/theories/QArith/QArith_base.v
index 790bdf9ed6..3a613c55ec 100644
--- a/theories/QArith/QArith_base.v
+++ b/theories/QArith/QArith_base.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/QArith/QOrderedType.v b/theories/QArith/QOrderedType.v
index 37b4b298a2..5a2f3d25a2 100644
--- a/theories/QArith/QOrderedType.v
+++ b/theories/QArith/QOrderedType.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/QArith/Qabs.v b/theories/QArith/Qabs.v
index 31eb41bc93..fbe5fe9a71 100644
--- a/theories/QArith/Qabs.v
+++ b/theories/QArith/Qabs.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/QArith/Qcabs.v b/theories/QArith/Qcabs.v
index f45868a778..dbdfedac08 100644
--- a/theories/QArith/Qcabs.v
+++ b/theories/QArith/Qcabs.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/QArith/Qcanon.v b/theories/QArith/Qcanon.v
index f18fca99a0..7687ff13a2 100644
--- a/theories/QArith/Qcanon.v
+++ b/theories/QArith/Qcanon.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -43,10 +43,10 @@ Proof.
generalize (Z.gcd_nonneg a (Zpos b)) (Z.ggcd_correct_divisors a (Zpos b)).
rewrite <- Z.ggcd_gcd.
destruct Z.ggcd as (g,(aa,bb)); simpl in *.
- injection H as <- <-. intros H (_,H').
+ injection H as [= <- <-]. intros H (_,H').
destruct g as [|g|g]; [ discriminate | | now elim H ].
destruct bb as [|b|b]; simpl in *; try discriminate.
- injection H' as H'. f_equal.
+ injection H' as [= H']. f_equal.
apply Pos.mul_reg_r with b. now rewrite Pos.mul_1_l.
Qed.
@@ -87,7 +87,7 @@ Arguments Q2Qc q%Q.
Lemma Q2Qc_eq_iff (q q' : Q) : Q2Qc q = Q2Qc q' <-> q == q'.
Proof.
split; intro H.
- - now injection H as H%Qred_eq_iff.
+ - now injection H as [= H%Qred_eq_iff].
- apply Qc_is_canon. simpl. now rewrite H.
Qed.
@@ -269,7 +269,7 @@ Theorem Qcmult_integral : forall x y, x*y=0 -> x=0 \/ y=0.
Proof.
intros.
destruct (Qmult_integral x y); try qc; auto.
- injection H as H.
+ injection H as [= H].
rewrite <- (Qred_correct (x*y)).
rewrite <- (Qred_correct 0).
rewrite H; auto with qarith.
diff --git a/theories/QArith/Qfield.v b/theories/QArith/Qfield.v
index 6cbb491b83..41094a1a79 100644
--- a/theories/QArith/Qfield.v
+++ b/theories/QArith/Qfield.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/QArith/Qminmax.v b/theories/QArith/Qminmax.v
index 264b2f9286..f6ae4486c5 100644
--- a/theories/QArith/Qminmax.v
+++ b/theories/QArith/Qminmax.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/QArith/Qpower.v b/theories/QArith/Qpower.v
index 0107822093..88c74ab653 100644
--- a/theories/QArith/Qpower.v
+++ b/theories/QArith/Qpower.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/QArith/Qreals.v b/theories/QArith/Qreals.v
index b4c869b4dd..5b3d6ea30e 100644
--- a/theories/QArith/Qreals.v
+++ b/theories/QArith/Qreals.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/QArith/Qreduction.v b/theories/QArith/Qreduction.v
index 17307c8279..78cd549ce6 100644
--- a/theories/QArith/Qreduction.v
+++ b/theories/QArith/Qreduction.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/QArith/Qring.v b/theories/QArith/Qring.v
index 7f972d5687..83a6389705 100644
--- a/theories/QArith/Qring.v
+++ b/theories/QArith/Qring.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/QArith/Qround.v b/theories/QArith/Qround.v
index 7c5ddbb6a9..af5c471d5d 100644
--- a/theories/QArith/Qround.v
+++ b/theories/QArith/Qround.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Alembert.v b/theories/Reals/Alembert.v
index 09aad1ecb3..31f5c09d02 100644
--- a/theories/Reals/Alembert.v
+++ b/theories/Reals/Alembert.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/AltSeries.v b/theories/Reals/AltSeries.v
index c17ad0cfa4..d9afc4037a 100644
--- a/theories/Reals/AltSeries.v
+++ b/theories/Reals/AltSeries.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/ArithProp.v b/theories/Reals/ArithProp.v
index 37240eb748..cbf90c5adb 100644
--- a/theories/Reals/ArithProp.v
+++ b/theories/Reals/ArithProp.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Binomial.v b/theories/Reals/Binomial.v
index 271100a585..35f94458b9 100644
--- a/theories/Reals/Binomial.v
+++ b/theories/Reals/Binomial.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Cauchy_prod.v b/theories/Reals/Cauchy_prod.v
index 306b09dc47..d8b012c3fc 100644
--- a/theories/Reals/Cauchy_prod.v
+++ b/theories/Reals/Cauchy_prod.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Cos_plus.v b/theories/Reals/Cos_plus.v
index d046ecf1e4..d09b3248ef 100644
--- a/theories/Reals/Cos_plus.v
+++ b/theories/Reals/Cos_plus.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Cos_rel.v b/theories/Reals/Cos_rel.v
index f9919278d9..d5086db6cf 100644
--- a/theories/Reals/Cos_rel.v
+++ b/theories/Reals/Cos_rel.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/DiscrR.v b/theories/Reals/DiscrR.v
index f3bc2f22ed..9205df1bb7 100644
--- a/theories/Reals/DiscrR.v
+++ b/theories/Reals/DiscrR.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Exp_prop.v b/theories/Reals/Exp_prop.v
index 3de131eaec..1636d81d25 100644
--- a/theories/Reals/Exp_prop.v
+++ b/theories/Reals/Exp_prop.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Integration.v b/theories/Reals/Integration.v
index 1f4fd57648..7f75ad7474 100644
--- a/theories/Reals/Integration.v
+++ b/theories/Reals/Integration.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/MVT.v b/theories/Reals/MVT.v
index 717df1b11e..9cad6ced6c 100644
--- a/theories/Reals/MVT.v
+++ b/theories/Reals/MVT.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Machin.v b/theories/Reals/Machin.v
index 8f7e07ac4d..81f8b08c92 100644
--- a/theories/Reals/Machin.v
+++ b/theories/Reals/Machin.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/NewtonInt.v b/theories/Reals/NewtonInt.v
index 66918eeed3..27027eec56 100644
--- a/theories/Reals/NewtonInt.v
+++ b/theories/Reals/NewtonInt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/PSeries_reg.v b/theories/Reals/PSeries_reg.v
index 146d691018..03b2c4b6c5 100644
--- a/theories/Reals/PSeries_reg.v
+++ b/theories/Reals/PSeries_reg.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/PartSum.v b/theories/Reals/PartSum.v
index 33feeac0c0..ec30f071c4 100644
--- a/theories/Reals/PartSum.v
+++ b/theories/Reals/PartSum.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/RIneq.v b/theories/Reals/RIneq.v
index ec283b886e..51ae0baf1b 100644
--- a/theories/Reals/RIneq.v
+++ b/theories/Reals/RIneq.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -95,7 +95,7 @@ Proof.
Qed.
(*********************************************************)
-(** ** Relating [<], [>], [<=] and [>=] *)
+(** ** Relating [<], [>], [<=] and [>=] *)
(*********************************************************)
(*********************************************************)
@@ -711,7 +711,7 @@ Proof.
Qed.
(*********************************************************)
-(** ** Subtraction *)
+(** ** Subtraction *)
(*********************************************************)
Lemma Rminus_0_r : forall r, r - 0 = r.
@@ -1352,7 +1352,7 @@ Proof.
Qed.
(*********************************************************)
-(** ** Order and substraction *)
+(** ** Order and subtraction *)
(*********************************************************)
Lemma Rlt_minus : forall r1 r2, r1 < r2 -> r1 - r2 < 0.
diff --git a/theories/Reals/RList.v b/theories/Reals/RList.v
index e12937c702..128543d8ab 100644
--- a/theories/Reals/RList.v
+++ b/theories/Reals/RList.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/ROrderedType.v b/theories/Reals/ROrderedType.v
index ee65ee1d1c..c88d8ea173 100644
--- a/theories/Reals/ROrderedType.v
+++ b/theories/Reals/ROrderedType.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/R_Ifp.v b/theories/Reals/R_Ifp.v
index 77e2a1e042..5365e04000 100644
--- a/theories/Reals/R_Ifp.v
+++ b/theories/Reals/R_Ifp.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/R_sqr.v b/theories/Reals/R_sqr.v
index a60bb7cf43..1a74582b71 100644
--- a/theories/Reals/R_sqr.v
+++ b/theories/Reals/R_sqr.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/R_sqrt.v b/theories/Reals/R_sqrt.v
index 6991923b13..285324e778 100644
--- a/theories/Reals/R_sqrt.v
+++ b/theories/Reals/R_sqrt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Ranalysis.v b/theories/Reals/Ranalysis.v
index 4bde9b6096..28d1c2c97f 100644
--- a/theories/Reals/Ranalysis.v
+++ b/theories/Reals/Ranalysis.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Ranalysis1.v b/theories/Reals/Ranalysis1.v
index 9f8039ec9d..5c0fc3cd9a 100644
--- a/theories/Reals/Ranalysis1.v
+++ b/theories/Reals/Ranalysis1.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Ranalysis2.v b/theories/Reals/Ranalysis2.v
index 7a97ca63e4..7a838f2772 100644
--- a/theories/Reals/Ranalysis2.v
+++ b/theories/Reals/Ranalysis2.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Ranalysis3.v b/theories/Reals/Ranalysis3.v
index 301d6d2c5a..950f90c1cb 100644
--- a/theories/Reals/Ranalysis3.v
+++ b/theories/Reals/Ranalysis3.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Ranalysis4.v b/theories/Reals/Ranalysis4.v
index 94f1757a85..1aab8ab81f 100644
--- a/theories/Reals/Ranalysis4.v
+++ b/theories/Reals/Ranalysis4.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Ranalysis5.v b/theories/Reals/Ranalysis5.v
index d16b5a3020..ca82222c25 100644
--- a/theories/Reals/Ranalysis5.v
+++ b/theories/Reals/Ranalysis5.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Ranalysis_reg.v b/theories/Reals/Ranalysis_reg.v
index e1d4781bfc..cb6d57be84 100644
--- a/theories/Reals/Ranalysis_reg.v
+++ b/theories/Reals/Ranalysis_reg.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Ratan.v b/theories/Reals/Ratan.v
index 38bed570a3..57bc89b7e5 100644
--- a/theories/Reals/Ratan.v
+++ b/theories/Reals/Ratan.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Raxioms.v b/theories/Reals/Raxioms.v
index a2818371e9..0d29e821c6 100644
--- a/theories/Reals/Raxioms.v
+++ b/theories/Reals/Raxioms.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rbase.v b/theories/Reals/Rbase.v
index b63c8e1c65..52468a418d 100644
--- a/theories/Reals/Rbase.v
+++ b/theories/Reals/Rbase.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rbasic_fun.v b/theories/Reals/Rbasic_fun.v
index e17f02bb6e..efca826077 100644
--- a/theories/Reals/Rbasic_fun.v
+++ b/theories/Reals/Rbasic_fun.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rcomplete.v b/theories/Reals/Rcomplete.v
index 19cbbeca19..47a1d22f8f 100644
--- a/theories/Reals/Rcomplete.v
+++ b/theories/Reals/Rcomplete.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rdefinitions.v b/theories/Reals/Rdefinitions.v
index 932fcddaf5..bb32000841 100644
--- a/theories/Reals/Rdefinitions.v
+++ b/theories/Reals/Rdefinitions.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rderiv.v b/theories/Reals/Rderiv.v
index aaf691ed1a..effbc3a404 100644
--- a/theories/Reals/Rderiv.v
+++ b/theories/Reals/Rderiv.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Reals.v b/theories/Reals/Reals.v
index 3ef368bb4f..720a2da825 100644
--- a/theories/Reals/Reals.v
+++ b/theories/Reals/Reals.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rfunctions.v b/theories/Reals/Rfunctions.v
index 77e5314747..17b39d22cb 100644
--- a/theories/Reals/Rfunctions.v
+++ b/theories/Reals/Rfunctions.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rgeom.v b/theories/Reals/Rgeom.v
index 6c2f3ac6ee..8e3cd30ca3 100644
--- a/theories/Reals/Rgeom.v
+++ b/theories/Reals/Rgeom.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/RiemannInt.v b/theories/Reals/RiemannInt.v
index f7d98fca85..a848a59d48 100644
--- a/theories/Reals/RiemannInt.v
+++ b/theories/Reals/RiemannInt.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/RiemannInt_SF.v b/theories/Reals/RiemannInt_SF.v
index 49a485c741..128ee286b8 100644
--- a/theories/Reals/RiemannInt_SF.v
+++ b/theories/Reals/RiemannInt_SF.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rlimit.v b/theories/Reals/Rlimit.v
index 2bfd99ebc7..5443ff68ed 100644
--- a/theories/Reals/Rlimit.v
+++ b/theories/Reals/Rlimit.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rlogic.v b/theories/Reals/Rlogic.v
index 04f13477cb..8ce4ffc756 100644
--- a/theories/Reals/Rlogic.v
+++ b/theories/Reals/Rlogic.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rminmax.v b/theories/Reals/Rminmax.v
index 7f73f7c182..bcc5081d3a 100644
--- a/theories/Reals/Rminmax.v
+++ b/theories/Reals/Rminmax.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rpow_def.v b/theories/Reals/Rpow_def.v
index 0d92130314..c4df293d43 100644
--- a/theories/Reals/Rpow_def.v
+++ b/theories/Reals/Rpow_def.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rpower.v b/theories/Reals/Rpower.v
index d465523a70..58b404a5f0 100644
--- a/theories/Reals/Rpower.v
+++ b/theories/Reals/Rpower.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rprod.v b/theories/Reals/Rprod.v
index 17736af651..15ec7891f7 100644
--- a/theories/Reals/Rprod.v
+++ b/theories/Reals/Rprod.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rseries.v b/theories/Reals/Rseries.v
index 3521a476b0..29b0ca638f 100644
--- a/theories/Reals/Rseries.v
+++ b/theories/Reals/Rseries.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rsigma.v b/theories/Reals/Rsigma.v
index 83c60751d6..2a9c6953c5 100644
--- a/theories/Reals/Rsigma.v
+++ b/theories/Reals/Rsigma.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rsqrt_def.v b/theories/Reals/Rsqrt_def.v
index 9b8dd1db0b..4ff4364759 100644
--- a/theories/Reals/Rsqrt_def.v
+++ b/theories/Reals/Rsqrt_def.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rtopology.v b/theories/Reals/Rtopology.v
index f94b5cab65..cfcc82d765 100644
--- a/theories/Reals/Rtopology.v
+++ b/theories/Reals/Rtopology.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rtrigo.v b/theories/Reals/Rtrigo.v
index ddd8722e1e..ab9880585e 100644
--- a/theories/Reals/Rtrigo.v
+++ b/theories/Reals/Rtrigo.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rtrigo1.v b/theories/Reals/Rtrigo1.v
index a75fd2ddeb..a760a0af6a 100644
--- a/theories/Reals/Rtrigo1.v
+++ b/theories/Reals/Rtrigo1.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rtrigo_alt.v b/theories/Reals/Rtrigo_alt.v
index 71b90fb45f..58d6603c9a 100644
--- a/theories/Reals/Rtrigo_alt.v
+++ b/theories/Reals/Rtrigo_alt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rtrigo_calc.v b/theories/Reals/Rtrigo_calc.v
index 78797c87c8..5ed60b0a0f 100644
--- a/theories/Reals/Rtrigo_calc.v
+++ b/theories/Reals/Rtrigo_calc.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rtrigo_def.v b/theories/Reals/Rtrigo_def.v
index d2faf95bc5..9b51685735 100644
--- a/theories/Reals/Rtrigo_def.v
+++ b/theories/Reals/Rtrigo_def.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rtrigo_fun.v b/theories/Reals/Rtrigo_fun.v
index 744a99a12d..bec22fd543 100644
--- a/theories/Reals/Rtrigo_fun.v
+++ b/theories/Reals/Rtrigo_fun.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Rtrigo_reg.v b/theories/Reals/Rtrigo_reg.v
index 456fb6a712..415ea42939 100644
--- a/theories/Reals/Rtrigo_reg.v
+++ b/theories/Reals/Rtrigo_reg.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Runcountable.v b/theories/Reals/Runcountable.v
index ed5f75b74e..e0347e3566 100644
--- a/theories/Reals/Runcountable.v
+++ b/theories/Reals/Runcountable.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/SeqProp.v b/theories/Reals/SeqProp.v
index 38b0b3c4b1..d73f6ce0f3 100644
--- a/theories/Reals/SeqProp.v
+++ b/theories/Reals/SeqProp.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/SeqSeries.v b/theories/Reals/SeqSeries.v
index ccd205e23d..8150a6b0c4 100644
--- a/theories/Reals/SeqSeries.v
+++ b/theories/Reals/SeqSeries.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/SplitAbsolu.v b/theories/Reals/SplitAbsolu.v
index aa67b67748..2047b88195 100644
--- a/theories/Reals/SplitAbsolu.v
+++ b/theories/Reals/SplitAbsolu.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/SplitRmult.v b/theories/Reals/SplitRmult.v
index a8ff60b072..be2b5a73f3 100644
--- a/theories/Reals/SplitRmult.v
+++ b/theories/Reals/SplitRmult.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Reals/Sqrt_reg.v b/theories/Reals/Sqrt_reg.v
index d6b386f103..d4fb2e490c 100644
--- a/theories/Reals/Sqrt_reg.v
+++ b/theories/Reals/Sqrt_reg.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Relations/Operators_Properties.v b/theories/Relations/Operators_Properties.v
index 0a60d96afc..9440fcc456 100644
--- a/theories/Relations/Operators_Properties.v
+++ b/theories/Relations/Operators_Properties.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Relations/Relation_Definitions.v b/theories/Relations/Relation_Definitions.v
index 53def47419..04f5973624 100644
--- a/theories/Relations/Relation_Definitions.v
+++ b/theories/Relations/Relation_Definitions.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Relations/Relation_Operators.v b/theories/Relations/Relation_Operators.v
index 529e4d08e5..9781276451 100644
--- a/theories/Relations/Relation_Operators.v
+++ b/theories/Relations/Relation_Operators.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Relations/Relations.v b/theories/Relations/Relations.v
index 61344974e2..b665f075a8 100644
--- a/theories/Relations/Relations.v
+++ b/theories/Relations/Relations.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Setoids/Setoid.v b/theories/Setoids/Setoid.v
index 43c8d9bc09..2f8be5de12 100644
--- a/theories/Setoids/Setoid.v
+++ b/theories/Setoids/Setoid.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Classical_sets.v b/theories/Sets/Classical_sets.v
index b68022f8f7..64017e0904 100644
--- a/theories/Sets/Classical_sets.v
+++ b/theories/Sets/Classical_sets.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Constructive_sets.v b/theories/Sets/Constructive_sets.v
index 862c3238e7..3485ddbc99 100644
--- a/theories/Sets/Constructive_sets.v
+++ b/theories/Sets/Constructive_sets.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Cpo.v b/theories/Sets/Cpo.v
index 2ed422ffe9..e1d7d37e42 100644
--- a/theories/Sets/Cpo.v
+++ b/theories/Sets/Cpo.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Ensembles.v b/theories/Sets/Ensembles.v
index c37132078a..05299fb3ad 100644
--- a/theories/Sets/Ensembles.v
+++ b/theories/Sets/Ensembles.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Finite_sets.v b/theories/Sets/Finite_sets.v
index 5c42cbe674..e424d2ad96 100644
--- a/theories/Sets/Finite_sets.v
+++ b/theories/Sets/Finite_sets.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Finite_sets_facts.v b/theories/Sets/Finite_sets_facts.v
index 1c191613fa..6aa2ea420c 100644
--- a/theories/Sets/Finite_sets_facts.v
+++ b/theories/Sets/Finite_sets_facts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Image.v b/theories/Sets/Image.v
index 3e28bbe91a..02e8262b3d 100644
--- a/theories/Sets/Image.v
+++ b/theories/Sets/Image.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Infinite_sets.v b/theories/Sets/Infinite_sets.v
index a0271a88a3..2046f86a7c 100644
--- a/theories/Sets/Infinite_sets.v
+++ b/theories/Sets/Infinite_sets.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Integers.v b/theories/Sets/Integers.v
index 225e388b13..5f55286ff9 100644
--- a/theories/Sets/Integers.v
+++ b/theories/Sets/Integers.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Multiset.v b/theories/Sets/Multiset.v
index 6a8a3014c3..e9233a34e7 100644
--- a/theories/Sets/Multiset.v
+++ b/theories/Sets/Multiset.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Partial_Order.v b/theories/Sets/Partial_Order.v
index 811e42f091..d2fae6db28 100644
--- a/theories/Sets/Partial_Order.v
+++ b/theories/Sets/Partial_Order.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Permut.v b/theories/Sets/Permut.v
index 5cd9f52c6b..2b9042be76 100644
--- a/theories/Sets/Permut.v
+++ b/theories/Sets/Permut.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Powerset.v b/theories/Sets/Powerset.v
index 5b352f05fa..c5fb36f181 100644
--- a/theories/Sets/Powerset.v
+++ b/theories/Sets/Powerset.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Powerset_Classical_facts.v b/theories/Sets/Powerset_Classical_facts.v
index 7975a02697..431208fd23 100644
--- a/theories/Sets/Powerset_Classical_facts.v
+++ b/theories/Sets/Powerset_Classical_facts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Powerset_facts.v b/theories/Sets/Powerset_facts.v
index 784f2ce0ff..fe13b33d56 100644
--- a/theories/Sets/Powerset_facts.v
+++ b/theories/Sets/Powerset_facts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Relations_1.v b/theories/Sets/Relations_1.v
index 1ed7459954..8047f3e611 100644
--- a/theories/Sets/Relations_1.v
+++ b/theories/Sets/Relations_1.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Relations_1_facts.v b/theories/Sets/Relations_1_facts.v
index 17bdefcdbf..22e16d51f4 100644
--- a/theories/Sets/Relations_1_facts.v
+++ b/theories/Sets/Relations_1_facts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Relations_2.v b/theories/Sets/Relations_2.v
index cc839506f1..a58870c4d0 100644
--- a/theories/Sets/Relations_2.v
+++ b/theories/Sets/Relations_2.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Relations_2_facts.v b/theories/Sets/Relations_2_facts.v
index 48d0ea55c9..e907466a2a 100644
--- a/theories/Sets/Relations_2_facts.v
+++ b/theories/Sets/Relations_2_facts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Relations_3.v b/theories/Sets/Relations_3.v
index de3212e2e2..6f8eced77b 100644
--- a/theories/Sets/Relations_3.v
+++ b/theories/Sets/Relations_3.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Relations_3_facts.v b/theories/Sets/Relations_3_facts.v
index a4806ea0a6..9b4c602c2a 100644
--- a/theories/Sets/Relations_3_facts.v
+++ b/theories/Sets/Relations_3_facts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sets/Uniset.v b/theories/Sets/Uniset.v
index edfffe6ce9..d42a2521f1 100644
--- a/theories/Sets/Uniset.v
+++ b/theories/Sets/Uniset.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sorting/Heap.v b/theories/Sorting/Heap.v
index f5cda792ce..76e555ed5a 100644
--- a/theories/Sorting/Heap.v
+++ b/theories/Sorting/Heap.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sorting/Mergesort.v b/theories/Sorting/Mergesort.v
index 824d000d20..92f7a87ff2 100644
--- a/theories/Sorting/Mergesort.v
+++ b/theories/Sorting/Mergesort.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sorting/PermutEq.v b/theories/Sorting/PermutEq.v
index 97297f7eff..8e8f05dabc 100644
--- a/theories/Sorting/PermutEq.v
+++ b/theories/Sorting/PermutEq.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sorting/PermutSetoid.v b/theories/Sorting/PermutSetoid.v
index 08bc400f0a..90c82b677b 100644
--- a/theories/Sorting/PermutSetoid.v
+++ b/theories/Sorting/PermutSetoid.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -543,7 +543,7 @@ Qed.
End Permut_permut.
(* begin hide *)
-(** For compatibilty *)
+(** For compatibility *)
Notation permut_right := permut_cons (only parsing).
Notation permut_tran := permut_trans (only parsing).
(* end hide *)
diff --git a/theories/Sorting/Permutation.v b/theories/Sorting/Permutation.v
index f5bc9eee4e..a4b61570cd 100644
--- a/theories/Sorting/Permutation.v
+++ b/theories/Sorting/Permutation.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -304,7 +304,7 @@ Qed.
Lemma Permutation_length_1_inv: forall a l, Permutation [a] l -> l = [a].
Proof.
intros a l H; remember [a] as m in H.
- induction H; try (injection Heqm as -> ->);
+ induction H; try (injection Heqm as [= -> ->]);
discriminate || auto.
apply Permutation_nil in H as ->; trivial.
Qed.
@@ -312,7 +312,7 @@ Qed.
Lemma Permutation_length_1: forall a b, Permutation [a] [b] -> a = b.
Proof.
intros a b H.
- apply Permutation_length_1_inv in H; injection H as ->; trivial.
+ apply Permutation_length_1_inv in H; injection H as [= ->]; trivial.
Qed.
Lemma Permutation_length_2_inv :
@@ -320,7 +320,7 @@ Lemma Permutation_length_2_inv :
Proof.
intros a1 a2 l H; remember [a1;a2] as m in H.
revert a1 a2 Heqm.
- induction H; intros; try (injection Heqm as ? ?; subst);
+ induction H; intros; try (injection Heqm as [= ? ?]; subst);
discriminate || (try tauto).
apply Permutation_length_1_inv in H as ->; left; auto.
apply IHPermutation1 in Heqm as [H1|H1]; apply IHPermutation2 in H1 as [];
@@ -332,7 +332,7 @@ Lemma Permutation_length_2 :
a1 = b1 /\ a2 = b2 \/ a1 = b2 /\ a2 = b1.
Proof.
intros a1 b1 a2 b2 H.
- apply Permutation_length_2_inv in H as [H|H]; injection H as -> ->; auto.
+ apply Permutation_length_2_inv in H as [H|H]; injection H as [= -> ->]; auto.
Qed.
Lemma NoDup_Permutation l l' : NoDup l -> NoDup l' ->
diff --git a/theories/Sorting/Sorted.v b/theories/Sorting/Sorted.v
index 6782dd9ca3..006be5248c 100644
--- a/theories/Sorting/Sorted.v
+++ b/theories/Sorting/Sorted.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Sorting/Sorting.v b/theories/Sorting/Sorting.v
index c2be14616e..aac4a7d454 100644
--- a/theories/Sorting/Sorting.v
+++ b/theories/Sorting/Sorting.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Strings/Ascii.v b/theories/Strings/Ascii.v
index 6a0c5f066e..79ec67b633 100644
--- a/theories/Strings/Ascii.v
+++ b/theories/Strings/Ascii.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Strings/BinaryString.v b/theories/Strings/BinaryString.v
index a2bb1763f5..b4a89f193b 100644
--- a/theories/Strings/BinaryString.v
+++ b/theories/Strings/BinaryString.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ascii String.
diff --git a/theories/Strings/Byte.v b/theories/Strings/Byte.v
index 2759ea60cb..0189e70502 100644
--- a/theories/Strings/Byte.v
+++ b/theories/Strings/Byte.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Strings/ByteVector.v b/theories/Strings/ByteVector.v
index 3588aaca3f..c4ce46bda5 100644
--- a/theories/Strings/ByteVector.v
+++ b/theories/Strings/ByteVector.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Strings/HexString.v b/theories/Strings/HexString.v
index 9fa8e0ccf2..392b8f8720 100644
--- a/theories/Strings/HexString.v
+++ b/theories/Strings/HexString.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ascii String.
diff --git a/theories/Strings/OctalString.v b/theories/Strings/OctalString.v
index 78e98e451b..4653bed29e 100644
--- a/theories/Strings/OctalString.v
+++ b/theories/Strings/OctalString.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2017 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ascii String.
diff --git a/theories/Strings/String.v b/theories/Strings/String.v
index 08ccfac877..9d0d2f854d 100644
--- a/theories/Strings/String.v
+++ b/theories/Strings/String.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -123,7 +123,7 @@ intros H; generalize (H O); simpl; intros H1; inversion H1.
case (Rec s).
intros H0; rewrite H0; auto.
intros n; exact (H (S n)).
-intros H; injection H as H1 H2.
+intros [= H1 H2].
rewrite H2; trivial.
rewrite H1; auto.
Qed.
@@ -290,14 +290,14 @@ intros n m s1 s2; generalize n m s1; clear n m s1; elim s2; simpl;
auto.
intros n; case n; simpl; auto.
intros m s1; case s1; simpl; auto.
-intros H; injection H as <-; auto.
+intros [= <-]; auto.
intros; discriminate.
intros; discriminate.
intros b s2' Rec n m s1.
case n; simpl; auto.
generalize (prefix_correct s1 (String b s2'));
case (prefix s1 (String b s2')).
-intros H0 H; injection H as <-; auto.
+intros H0 [= <-]; auto.
case H0; simpl; auto.
case m; simpl; auto.
case (index O s1 s2'); intros; discriminate.
@@ -323,7 +323,7 @@ intros n m s1 s2; generalize n m s1; clear n m s1; elim s2; simpl;
auto.
intros n; case n; simpl; auto.
intros m s1; case s1; simpl; auto.
-intros H; injection H as <-.
+intros [= <-].
intros p H0 H2; inversion H2.
intros; discriminate.
intros; discriminate.
@@ -331,7 +331,7 @@ intros b s2' Rec n m s1.
case n; simpl; auto.
generalize (prefix_correct s1 (String b s2'));
case (prefix s1 (String b s2')).
-intros H0 H; injection H as <-; auto.
+intros H0 [= <-]; auto.
intros p H2 H3; inversion H3.
case m; simpl; auto.
case (index 0 s1 s2'); intros; discriminate.
diff --git a/theories/Structures/DecidableType.v b/theories/Structures/DecidableType.v
index f82ca5fa3c..8307308414 100644
--- a/theories/Structures/DecidableType.v
+++ b/theories/Structures/DecidableType.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Structures/DecidableTypeEx.v b/theories/Structures/DecidableTypeEx.v
index 8dd2e71030..3c7af1fdc7 100644
--- a/theories/Structures/DecidableTypeEx.v
+++ b/theories/Structures/DecidableTypeEx.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Structures/Equalities.v b/theories/Structures/Equalities.v
index 4591c7ed94..477d3fa986 100644
--- a/theories/Structures/Equalities.v
+++ b/theories/Structures/Equalities.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Structures/EqualitiesFacts.v b/theories/Structures/EqualitiesFacts.v
index 0f63855b55..0516e1e8b9 100644
--- a/theories/Structures/EqualitiesFacts.v
+++ b/theories/Structures/EqualitiesFacts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Structures/GenericMinMax.v b/theories/Structures/GenericMinMax.v
index c314f3f982..fb3705fbd1 100644
--- a/theories/Structures/GenericMinMax.v
+++ b/theories/Structures/GenericMinMax.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Structures/OrderedType.v b/theories/Structures/OrderedType.v
index d000b75bf4..566dd31a9e 100644
--- a/theories/Structures/OrderedType.v
+++ b/theories/Structures/OrderedType.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -208,7 +208,7 @@ Module OrderedTypeFacts (Import O: OrderedType).
unfold eqb; intros; destruct (eq_dec x y); elim_comp; auto.
Qed.
-(* Specialization of resuts about lists modulo. *)
+(* Specialization of results about lists modulo. *)
Section ForNotations.
diff --git a/theories/Structures/OrderedTypeAlt.v b/theories/Structures/OrderedTypeAlt.v
index 278046a890..b6220999c6 100644
--- a/theories/Structures/OrderedTypeAlt.v
+++ b/theories/Structures/OrderedTypeAlt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Structures/OrderedTypeEx.v b/theories/Structures/OrderedTypeEx.v
index 1a182de764..9b99fa5de4 100644
--- a/theories/Structures/OrderedTypeEx.v
+++ b/theories/Structures/OrderedTypeEx.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Structures/Orders.v b/theories/Structures/Orders.v
index 7fcf517457..a21c358ddf 100644
--- a/theories/Structures/Orders.v
+++ b/theories/Structures/Orders.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Structures/OrdersAlt.v b/theories/Structures/OrdersAlt.v
index ad6a387630..0c6e716220 100644
--- a/theories/Structures/OrdersAlt.v
+++ b/theories/Structures/OrdersAlt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Structures/OrdersEx.v b/theories/Structures/OrdersEx.v
index 93168f7df8..ec9330f657 100644
--- a/theories/Structures/OrdersEx.v
+++ b/theories/Structures/OrdersEx.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Structures/OrdersFacts.v b/theories/Structures/OrdersFacts.v
index 182b781fe1..edcb650715 100644
--- a/theories/Structures/OrdersFacts.v
+++ b/theories/Structures/OrdersFacts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -431,7 +431,7 @@ Proof.
apply eq_true_iff_eq. now rewrite negb_true_iff, ltb_lt, leb_gt.
Qed.
-(** Relation bewteen [compare] and the boolean comparisons *)
+(** Relation between [compare] and the boolean comparisons *)
Lemma eqb_compare x y :
(x =? y) = match compare x y with Eq => true | _ => false end.
diff --git a/theories/Structures/OrdersLists.v b/theories/Structures/OrdersLists.v
index fef9b14a9e..3c12f092b8 100644
--- a/theories/Structures/OrdersLists.v
+++ b/theories/Structures/OrdersLists.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Structures/OrdersTac.v b/theories/Structures/OrdersTac.v
index ebd8ee8fc2..6800b53c3f 100644
--- a/theories/Structures/OrdersTac.v
+++ b/theories/Structures/OrdersTac.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -51,7 +51,7 @@ Local Infix "+" := trans_ord.
This used to be provided here via a [TotalOrder], but
for technical reasons related to extraction, we now ask
- for two sperate parts: relations in a [EqLtLe] + properties in
+ for two separate parts: relations in a [EqLtLe] + properties in
[IsTotalOrder]. Note that [TotalOrder = EqLtLe <+ IsTotalOrder]
*)
diff --git a/theories/Unicode/Utf8.v b/theories/Unicode/Utf8.v
index 6cc9ea09da..d44f491ddc 100644
--- a/theories/Unicode/Utf8.v
+++ b/theories/Unicode/Utf8.v
@@ -1,7 +1,7 @@
(* -*- coding:utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Unicode/Utf8_core.v b/theories/Unicode/Utf8_core.v
index d4cdb064f3..7929ae7bc5 100644
--- a/theories/Unicode/Utf8_core.v
+++ b/theories/Unicode/Utf8_core.v
@@ -1,7 +1,7 @@
(* -*- coding:utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Vectors/Fin.v b/theories/Vectors/Fin.v
index 4088843a1b..da59671f21 100644
--- a/theories/Vectors/Fin.v
+++ b/theories/Vectors/Fin.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -160,7 +160,7 @@ Qed.
(** The p{^ th} element of [fin m] viewed as the p{^ th} element of
[fin (n + m)]
-Really really ineficient !!! *)
+Really really inefficient !!! *)
Definition L_R {m} n (p : t m) : t (n + m).
Proof.
induction n.
diff --git a/theories/Vectors/Vector.v b/theories/Vectors/Vector.v
index 08158769f5..a05dadacab 100644
--- a/theories/Vectors/Vector.v
+++ b/theories/Vectors/Vector.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Vectors/VectorDef.v b/theories/Vectors/VectorDef.v
index 906cf79ca9..20a8581d46 100644
--- a/theories/Vectors/VectorDef.v
+++ b/theories/Vectors/VectorDef.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -217,8 +217,7 @@ End BASES.
Local Notation "v [@ p ]" := (nth v p) (at level 1).
Section ITERATORS.
-(** * Here are special non dependent useful instantiation of induction
-schemes *)
+(** * Here are special non dependent useful instantiation of induction schemes *)
(** Uniform application on the arguments of the vector *)
Definition map {A} {B} (f : A -> B) : forall {n} (v:t A n), t B n :=
diff --git a/theories/Vectors/VectorEq.v b/theories/Vectors/VectorEq.v
index 317f3f1c67..128ab9d8e7 100644
--- a/theories/Vectors/VectorEq.v
+++ b/theories/Vectors/VectorEq.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Vectors/VectorSpec.v b/theories/Vectors/VectorSpec.v
index 34dbaf36af..55a55c0b2f 100644
--- a/theories/Vectors/VectorSpec.v
+++ b/theories/Vectors/VectorSpec.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Wellfounded/Disjoint_Union.v b/theories/Wellfounded/Disjoint_Union.v
index ea7769a994..49fd9ca96d 100644
--- a/theories/Wellfounded/Disjoint_Union.v
+++ b/theories/Wellfounded/Disjoint_Union.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Wellfounded/Inclusion.v b/theories/Wellfounded/Inclusion.v
index 18c4bedd9a..3fc7c8b546 100644
--- a/theories/Wellfounded/Inclusion.v
+++ b/theories/Wellfounded/Inclusion.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Wellfounded/Inverse_Image.v b/theories/Wellfounded/Inverse_Image.v
index 4a4ab87d99..24422f7d71 100644
--- a/theories/Wellfounded/Inverse_Image.v
+++ b/theories/Wellfounded/Inverse_Image.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Wellfounded/Lexicographic_Exponentiation.v b/theories/Wellfounded/Lexicographic_Exponentiation.v
index 684efeebe5..38611f9c1f 100644
--- a/theories/Wellfounded/Lexicographic_Exponentiation.v
+++ b/theories/Wellfounded/Lexicographic_Exponentiation.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Wellfounded/Lexicographic_Product.v b/theories/Wellfounded/Lexicographic_Product.v
index b2d08186ea..c5f1f95f44 100644
--- a/theories/Wellfounded/Lexicographic_Product.v
+++ b/theories/Wellfounded/Lexicographic_Product.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -46,11 +46,11 @@ Section WfLexicographic_Product.
apply H2.
auto with sets.
- + injection H1 as <- _.
- injection H3 as <- _; auto with sets.
+ + injection H1 as [= <- _].
+ injection H3 as [= <- _]; auto with sets.
- rewrite <- H1.
- injection H3 as -> H3.
+ injection H3 as [= -> H3].
apply IHAcc0.
elim inj_pair2 with A B x y' x0; assumption.
Defined.
diff --git a/theories/Wellfounded/Transitive_Closure.v b/theories/Wellfounded/Transitive_Closure.v
index 0d56d88869..7702a9e664 100644
--- a/theories/Wellfounded/Transitive_Closure.v
+++ b/theories/Wellfounded/Transitive_Closure.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Wellfounded/Union.v b/theories/Wellfounded/Union.v
index 14d425b811..b8ae1da76e 100644
--- a/theories/Wellfounded/Union.v
+++ b/theories/Wellfounded/Union.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Wellfounded/Well_Ordering.v b/theories/Wellfounded/Well_Ordering.v
index eb98fb2aba..d747258f56 100644
--- a/theories/Wellfounded/Well_Ordering.v
+++ b/theories/Wellfounded/Well_Ordering.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/Wellfounded/Wellfounded.v b/theories/Wellfounded/Wellfounded.v
index bfe09e40b1..e14eb8b693 100644
--- a/theories/Wellfounded/Wellfounded.v
+++ b/theories/Wellfounded/Wellfounded.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/BinInt.v b/theories/ZArith/BinInt.v
index a346ab8ccb..405cacd428 100644
--- a/theories/ZArith/BinInt.v
+++ b/theories/ZArith/BinInt.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -1259,7 +1259,7 @@ Proof.
f_equal. now rewrite <- add_assoc, add_opp_diag_r, add_0_r.
Qed.
-(** * [testbit] in terms of comparision. *)
+(** * [testbit] in terms of comparison. *)
Lemma testbit_mod_pow2 a n i (H : 0 <= n)
: testbit (a mod 2 ^ n) i = ((i <? n) && testbit a i)%bool.
diff --git a/theories/ZArith/BinIntDef.v b/theories/ZArith/BinIntDef.v
index 8cb62622db..c1f82e9578 100644
--- a/theories/ZArith/BinIntDef.v
+++ b/theories/ZArith/BinIntDef.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -28,7 +28,7 @@ Module Z.
Definition t := Z.
-(** ** Nicer names [Z.pos] and [Z.neg] for contructors *)
+(** ** Nicer names [Z.pos] and [Z.neg] for constructors *)
Notation pos := Zpos.
Notation neg := Zneg.
diff --git a/theories/ZArith/Int.v b/theories/ZArith/Int.v
index 0b0ed48d51..577544f971 100644
--- a/theories/ZArith/Int.v
+++ b/theories/ZArith/Int.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -13,7 +13,7 @@
(** We define a signature for an integer datatype based on [Z].
The goal is to allow a switch after extraction to ocaml's
[big_int] or even [int] when finiteness isn't a problem
- (typically : when mesuring the height of an AVL tree).
+ (typically : when measuring the height of an AVL tree).
*)
Require Import BinInt.
diff --git a/theories/ZArith/Wf_Z.v b/theories/ZArith/Wf_Z.v
index 864342088c..ab89e531e5 100644
--- a/theories/ZArith/Wf_Z.v
+++ b/theories/ZArith/Wf_Z.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/ZArith.v b/theories/ZArith/ZArith.v
index 0842920bbb..c2c97fca4f 100644
--- a/theories/ZArith/ZArith.v
+++ b/theories/ZArith/ZArith.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/ZArith_base.v b/theories/ZArith/ZArith_base.v
index 3d6bcddcd1..09929e0593 100644
--- a/theories/ZArith/ZArith_base.v
+++ b/theories/ZArith/ZArith_base.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/ZArith_dec.v b/theories/ZArith/ZArith_dec.v
index 88288d3964..786a979a52 100644
--- a/theories/ZArith/ZArith_dec.v
+++ b/theories/ZArith/ZArith_dec.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zabs.v b/theories/ZArith/Zabs.v
index d926198a9c..0b3fabc63f 100644
--- a/theories/ZArith/Zabs.v
+++ b/theories/ZArith/Zabs.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zbool.v b/theories/ZArith/Zbool.v
index 632d41b6a9..28355f1047 100644
--- a/theories/ZArith/Zbool.v
+++ b/theories/ZArith/Zbool.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zcompare.v b/theories/ZArith/Zcompare.v
index eec3878898..7de9021c28 100644
--- a/theories/ZArith/Zcompare.v
+++ b/theories/ZArith/Zcompare.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zcomplements.v b/theories/ZArith/Zcomplements.v
index adf72a6ac9..73c8ec11c6 100644
--- a/theories/ZArith/Zcomplements.v
+++ b/theories/ZArith/Zcomplements.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zdigits.v b/theories/ZArith/Zdigits.v
index d1eef6131b..056e67db83 100644
--- a/theories/ZArith/Zdigits.v
+++ b/theories/ZArith/Zdigits.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zdiv.v b/theories/ZArith/Zdiv.v
index 8b69fb04f4..78df9941c9 100644
--- a/theories/ZArith/Zdiv.v
+++ b/theories/ZArith/Zdiv.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zeuclid.v b/theories/ZArith/Zeuclid.v
index dc75db131f..edc1eb4c1d 100644
--- a/theories/ZArith/Zeuclid.v
+++ b/theories/ZArith/Zeuclid.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zeven.v b/theories/ZArith/Zeven.v
index 45d0f58524..5b07add732 100644
--- a/theories/ZArith/Zeven.v
+++ b/theories/ZArith/Zeven.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zgcd_alt.v b/theories/ZArith/Zgcd_alt.v
index cced1190c8..0cc137ef5d 100644
--- a/theories/ZArith/Zgcd_alt.v
+++ b/theories/ZArith/Zgcd_alt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zhints.v b/theories/ZArith/Zhints.v
index bfcc60edd3..0584a6f84f 100644
--- a/theories/ZArith/Zhints.v
+++ b/theories/ZArith/Zhints.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zlogarithm.v b/theories/ZArith/Zlogarithm.v
index b8c7319939..edbd3a18fe 100644
--- a/theories/ZArith/Zlogarithm.v
+++ b/theories/ZArith/Zlogarithm.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zmax.v b/theories/ZArith/Zmax.v
index 08d4de0d1e..dc4ffc8d0c 100644
--- a/theories/ZArith/Zmax.v
+++ b/theories/ZArith/Zmax.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zmin.v b/theories/ZArith/Zmin.v
index b56f563e0e..be83da6961 100644
--- a/theories/ZArith/Zmin.v
+++ b/theories/ZArith/Zmin.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zminmax.v b/theories/ZArith/Zminmax.v
index 06919642fc..677f819a18 100644
--- a/theories/ZArith/Zminmax.v
+++ b/theories/ZArith/Zminmax.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zmisc.v b/theories/ZArith/Zmisc.v
index c46241cee2..be01c6494a 100644
--- a/theories/ZArith/Zmisc.v
+++ b/theories/ZArith/Zmisc.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Znat.v b/theories/ZArith/Znat.v
index 776efa2978..b0a4bd0734 100644
--- a/theories/ZArith/Znat.v
+++ b/theories/ZArith/Znat.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Znumtheory.v b/theories/ZArith/Znumtheory.v
index 7191825af0..5d1a13ff6c 100644
--- a/theories/ZArith/Znumtheory.v
+++ b/theories/ZArith/Znumtheory.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zorder.v b/theories/ZArith/Zorder.v
index 9911a568cc..7440cc90c9 100644
--- a/theories/ZArith/Zorder.v
+++ b/theories/ZArith/Zorder.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zpow_alt.v b/theories/ZArith/Zpow_alt.v
index 983405acbd..6fcc009626 100644
--- a/theories/ZArith/Zpow_alt.v
+++ b/theories/ZArith/Zpow_alt.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zpow_def.v b/theories/ZArith/Zpow_def.v
index 2b099671ff..f95de2c764 100644
--- a/theories/ZArith/Zpow_def.v
+++ b/theories/ZArith/Zpow_def.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zpow_facts.v b/theories/ZArith/Zpow_facts.v
index 6e4850338a..66e246616f 100644
--- a/theories/ZArith/Zpow_facts.v
+++ b/theories/ZArith/Zpow_facts.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zpower.v b/theories/ZArith/Zpower.v
index fa69053559..f80d075b67 100644
--- a/theories/ZArith/Zpower.v
+++ b/theories/ZArith/Zpower.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zquot.v b/theories/ZArith/Zquot.v
index a619eb90ef..fea7db7921 100644
--- a/theories/ZArith/Zquot.v
+++ b/theories/ZArith/Zquot.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -105,7 +105,7 @@ Proof.
rewrite Z.rem_sign_nz; trivial. apply Z.square_nonneg.
Qed.
-(** This can also be said in a simplier way: *)
+(** This can also be said in a simpler way: *)
Theorem Zrem_sgn2 a b : 0 <= (Z.rem a b) * a.
Proof.
diff --git a/theories/ZArith/Zsqrt_compat.v b/theories/ZArith/Zsqrt_compat.v
index bd09045407..6873c737a7 100644
--- a/theories/ZArith/Zsqrt_compat.v
+++ b/theories/ZArith/Zsqrt_compat.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/Zwf.v b/theories/ZArith/Zwf.v
index a71ea4f30a..853ec951ae 100644
--- a/theories/ZArith/Zwf.v
+++ b/theories/ZArith/Zwf.v
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/theories/ZArith/auxiliary.v b/theories/ZArith/auxiliary.v
index fd357502d2..43acd3056e 100644
--- a/theories/ZArith/auxiliary.v
+++ b/theories/ZArith/auxiliary.v
@@ -1,7 +1,7 @@
(* -*- coding: utf-8 -*- *)
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/CoqMakefile.in b/tools/CoqMakefile.in
index 2ec55d1bd0..d37d2bea94 100644
--- a/tools/CoqMakefile.in
+++ b/tools/CoqMakefile.in
@@ -171,7 +171,7 @@ DYNOBJ:=.cmxs
DYNLIB:=.cmxs
endif
-# these variables are meant to be overriden if you want to add *extra* flags
+# these variables are meant to be overridden if you want to add *extra* flags
COQEXTRAFLAGS?=
COQCHKEXTRAFLAGS?=
COQDOCEXTRAFLAGS?=
diff --git a/tools/coq_dune.ml b/tools/coq_dune.ml
index 6ddc503542..1920d493de 100644
--- a/tools/coq_dune.ml
+++ b/tools/coq_dune.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -128,6 +128,7 @@ module Options = struct
[ { enabled = false; cmd = "-debug"; }
; { enabled = false; cmd = "-native_compiler"; }
; { enabled = true; cmd = "-allow-sprop"; }
+ ; { enabled = true; cmd = "-w +default"; }
]
let build_coq_flags () =
diff --git a/tools/coq_makefile.ml b/tools/coq_makefile.ml
index 68281d6481..1bd52d5bf1 100644
--- a/tools/coq_makefile.ml
+++ b/tools/coq_makefile.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coq_tex.ml b/tools/coq_tex.ml
index c6d3551561..371483b862 100644
--- a/tools/coq_tex.ml
+++ b/tools/coq_tex.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdep.ml b/tools/coqdep.ml
index 8823206252..7a07e815ce 100644
--- a/tools/coqdep.ml
+++ b/tools/coqdep.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -454,7 +454,7 @@ let usage () =
eprintf " -I dir : add (non recursively) dir to ocaml path\n";
eprintf " -R dir -as logname : add and import dir recursively to coq load path under logical name logname\n"; (* deprecate? *)
eprintf " -R dir logname : add and import dir recursively to coq load path under logical name logname\n";
- eprintf " -Q dir logname : add (recusively) and open (non recursively) dir to coq load path under logical name logname\n";
+ eprintf " -Q dir logname : add (recursively) and open (non recursively) dir to coq load path under logical name logname\n";
eprintf " -dumpgraph f : print a dot dependency graph in file 'f'\n";
eprintf " -dumpgraphbox f : print a dot dependency graph box in file 'f'\n";
eprintf " -exclude-dir dir : skip subdirectories named 'dir' during -R/-Q search\n";
diff --git a/tools/coqdep_boot.ml b/tools/coqdep_boot.ml
index a638906c11..1730dd3d68 100644
--- a/tools/coqdep_boot.ml
+++ b/tools/coqdep_boot.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdep_common.ml b/tools/coqdep_common.ml
index e3dd32fb63..d98242ef17 100644
--- a/tools/coqdep_common.ml
+++ b/tools/coqdep_common.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdep_common.mli b/tools/coqdep_common.mli
index 91d2b45876..e450d0e36f 100644
--- a/tools/coqdep_common.mli
+++ b/tools/coqdep_common.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdep_lexer.mli b/tools/coqdep_lexer.mli
index 0e2b332f1e..018fc1b7a2 100644
--- a/tools/coqdep_lexer.mli
+++ b/tools/coqdep_lexer.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdep_lexer.mll b/tools/coqdep_lexer.mll
index 5533ab106d..743da535b8 100644
--- a/tools/coqdep_lexer.mll
+++ b/tools/coqdep_lexer.mll
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdoc/alpha.ml b/tools/coqdoc/alpha.ml
index 36ce405fe6..4def233ff8 100644
--- a/tools/coqdoc/alpha.ml
+++ b/tools/coqdoc/alpha.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdoc/alpha.mli b/tools/coqdoc/alpha.mli
index 863034504c..c74df82d4b 100644
--- a/tools/coqdoc/alpha.mli
+++ b/tools/coqdoc/alpha.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdoc/cdglobals.ml b/tools/coqdoc/cdglobals.ml
index 5dd6cc6c83..dc13acadcb 100644
--- a/tools/coqdoc/cdglobals.ml
+++ b/tools/coqdoc/cdglobals.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdoc/cpretty.mli b/tools/coqdoc/cpretty.mli
index 7732610f5c..dcc1369c72 100644
--- a/tools/coqdoc/cpretty.mli
+++ b/tools/coqdoc/cpretty.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdoc/cpretty.mll b/tools/coqdoc/cpretty.mll
index 230c5524b7..0685f979c8 100644
--- a/tools/coqdoc/cpretty.mll
+++ b/tools/coqdoc/cpretty.mll
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdoc/index.ml b/tools/coqdoc/index.ml
index 8d395b418f..8f82bee5c6 100644
--- a/tools/coqdoc/index.ml
+++ b/tools/coqdoc/index.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdoc/index.mli b/tools/coqdoc/index.mli
index 7c9aad67fc..c05b2a459a 100644
--- a/tools/coqdoc/index.mli
+++ b/tools/coqdoc/index.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdoc/main.ml b/tools/coqdoc/main.ml
index 11ec3d3993..1c22efa513 100644
--- a/tools/coqdoc/main.ml
+++ b/tools/coqdoc/main.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdoc/output.ml b/tools/coqdoc/output.ml
index b703af934d..9b7da862a8 100644
--- a/tools/coqdoc/output.ml
+++ b/tools/coqdoc/output.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -762,7 +762,7 @@ module Html = struct
(* inference rules *)
let inf_rule assumptions (_,_,midnm) conclusions =
- (* this first function replaces any occurance of 3 or more spaces
+ (* this first function replaces any occurrence of 3 or more spaces
in a row with "&nbsp;"s. We do this to the assumptions so that
people can put multiple rules on a line with nice formatting *)
let replace_spaces str =
diff --git a/tools/coqdoc/output.mli b/tools/coqdoc/output.mli
index a8a50d751d..ceed67fff2 100644
--- a/tools/coqdoc/output.mli
+++ b/tools/coqdoc/output.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdoc/tokens.ml b/tools/coqdoc/tokens.ml
index 49f7ef2f5d..5adc18e1a0 100644
--- a/tools/coqdoc/tokens.ml
+++ b/tools/coqdoc/tokens.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/coqdoc/tokens.mli b/tools/coqdoc/tokens.mli
index 00db2ad317..1ec541f417 100644
--- a/tools/coqdoc/tokens.mli
+++ b/tools/coqdoc/tokens.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -57,7 +57,7 @@ val translate : string -> string option
dictionary, "<>_h" is one word and gets translated
*)
-(* Warning: do not output anything on output channel inbetween a call
+(* Warning: do not output anything on output channel in between a call
to [output_tagged_*] and [flush_sublexer]!! *)
type out_function =
diff --git a/tools/coqwc.mll b/tools/coqwc.mll
index f0f138740c..cfd65a2349 100644
--- a/tools/coqwc.mll
+++ b/tools/coqwc.mll
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -207,7 +207,7 @@ and string = parse
| eof { 0 }
(*s The following entry [read_header] is used to skip the possible header at
- the beggining of files (unless option \texttt{-e} is specified).
+ the beginning of files (unless option \texttt{-e} is specified).
It stops whenever it encounters an empty line or any character outside
a comment. In this last case, it correctly resets the lexer position
on that character (decreasing [lex_curr_pos] by 1). *)
diff --git a/tools/coqworkmgr.ml b/tools/coqworkmgr.ml
index bfea141bb3..9f9c6dd5d0 100644
--- a/tools/coqworkmgr.ml
+++ b/tools/coqworkmgr.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/tools/ocamllibdep.mll b/tools/ocamllibdep.mll
index 680c8f30ae..bd19d30409 100644
--- a/tools/ocamllibdep.mll
+++ b/tools/ocamllibdep.mll
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/topbin/coqc_bin.ml b/topbin/coqc_bin.ml
index d711c81124..11a6871a5c 100644
--- a/topbin/coqc_bin.ml
+++ b/topbin/coqc_bin.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/topbin/coqproofworker_bin.ml b/topbin/coqproofworker_bin.ml
index 7ae91cfbd3..baf76582ac 100644
--- a/topbin/coqproofworker_bin.ml
+++ b/topbin/coqproofworker_bin.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/topbin/coqqueryworker_bin.ml b/topbin/coqqueryworker_bin.ml
index 98c8581213..0f7005e422 100644
--- a/topbin/coqqueryworker_bin.ml
+++ b/topbin/coqqueryworker_bin.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/topbin/coqtacticworker_bin.ml b/topbin/coqtacticworker_bin.ml
index 2634baa83f..19a8cde88a 100644
--- a/topbin/coqtacticworker_bin.ml
+++ b/topbin/coqtacticworker_bin.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/topbin/coqtop_bin.ml b/topbin/coqtop_bin.ml
index 4490db59e7..a31e58a55d 100644
--- a/topbin/coqtop_bin.ml
+++ b/topbin/coqtop_bin.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/topbin/coqtop_byte_bin.ml b/topbin/coqtop_byte_bin.ml
index abe397830f..aaabd90370 100644
--- a/topbin/coqtop_byte_bin.ml
+++ b/topbin/coqtop_byte_bin.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/topbin/dune b/topbin/dune
index 3b861afe78..7b77826216 100644
--- a/topbin/dune
+++ b/topbin/dune
@@ -26,6 +26,8 @@
(package coq)
(modules coqc_bin)
(libraries coq.toplevel)
+ ; Adding -ccopt -flto to links options could be interesting, however,
+ ; it doesn't work on Windows
(link_flags -linkall))
(install
diff --git a/toplevel/ccompile.ml b/toplevel/ccompile.ml
index 2f63410761..e6255a947e 100644
--- a/toplevel/ccompile.ml
+++ b/toplevel/ccompile.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -176,9 +176,9 @@ let compile opts copts ~echo ~f_in ~f_out =
Dumpglob.noglob ();
let long_f_dot_vio, long_f_dot_vo =
ensure_exists_with_prefix f_in f_out ".vio" ".vo" in
- let sum, lib, univs, disch, tasks, proofs =
+ let sum, lib, univs, tasks, proofs =
Library.load_library_todo long_f_dot_vio in
- let univs, proofs = Stm.finish_tasks long_f_dot_vo univs disch proofs tasks in
+ let univs, proofs = Stm.finish_tasks long_f_dot_vo univs proofs tasks in
Library.save_library_raw long_f_dot_vo sum lib univs proofs
let compile opts copts ~echo ~f_in ~f_out =
@@ -225,7 +225,7 @@ let do_vio opts copts =
process happens outside of the STM *)
if copts.vio_files <> [] || copts.vio_tasks <> [] then
let iload_path = build_load_path opts in
- List.iter Mltop.add_coq_path iload_path;
+ List.iter Loadpath.add_coq_path iload_path;
(* Vio compile pass *)
if copts.vio_files <> [] then schedule_vio copts;
diff --git a/toplevel/ccompile.mli b/toplevel/ccompile.mli
index 29a76eb966..ed558ca805 100644
--- a/toplevel/ccompile.mli
+++ b/toplevel/ccompile.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/toplevel/coqargs.ml b/toplevel/coqargs.ml
index ec43dbb1d7..7e3759f177 100644
--- a/toplevel/coqargs.ml
+++ b/toplevel/coqargs.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -10,7 +10,7 @@
let fatal_error exn =
Topfmt.(in_phase ~phase:ParsingCommandLine print_err_exn exn);
- let exit_code = if CErrors.(is_anomaly exn || not (handled exn)) then 129 else 1 in
+ let exit_code = if (CErrors.is_anomaly exn) then 129 else 1 in
exit exit_code
let error_wrong_arg msg =
@@ -46,8 +46,8 @@ type t = {
load_rcfile : bool;
rcfile : string option;
- ml_includes : Mltop.coq_path list;
- vo_includes : Mltop.coq_path list;
+ ml_includes : Loadpath.coq_path list;
+ vo_includes : Loadpath.coq_path list;
vo_requires : (string * string option * bool option) list;
(* None = No Import; Some false = Import; Some true = Export *)
@@ -147,10 +147,10 @@ let default = {
(* Functional arguments *)
(******************************************************************************)
let add_ml_include opts s =
- Mltop.{ opts with ml_includes = {recursive = false; path_spec = MlPath s} :: opts.ml_includes }
+ Loadpath.{ opts with ml_includes = {recursive = false; path_spec = MlPath s} :: opts.ml_includes }
let add_vo_include opts unix_path coq_path implicit =
- let open Mltop in
+ let open Loadpath in
let coq_path = Libnames.dirpath_of_string coq_path in
{ opts with vo_includes = {
recursive = true;
@@ -184,6 +184,10 @@ let warn_deprecated_inputstate =
CWarnings.create ~name:"deprecated-inputstate" ~category:"deprecated"
(fun () -> Pp.strbrk "The inputstate option is deprecated and discouraged.")
+let warn_deprecated_simple_require =
+ CWarnings.create ~name:"deprecated-boot" ~category:"deprecated"
+ (fun () -> Pp.strbrk "The -require option is deprecated, please use -require-import instead.")
+
let set_inputstate opts s =
warn_deprecated_inputstate ();
{ opts with inputstate = Some s }
@@ -273,7 +277,7 @@ let usage help =
end;
let lp = Coqinit.toplevel_init_load_path () in
(* Necessary for finding the toplevels below *)
- List.iter Mltop.add_coq_path lp;
+ List.iter Loadpath.add_coq_path lp;
help ()
(* Main parsing routine *)
@@ -416,7 +420,22 @@ let parse_args ~help ~init arglist : t * string list =
Flags.profile_ltac_cutoff := get_float opt (next ());
oval
- |"-require" -> add_vo_require oval (next ()) None (Some false)
+ |"-rfrom" ->
+ let from = next () in add_vo_require oval (next ()) (Some from) None
+
+ |"-require" ->
+ warn_deprecated_simple_require ();
+ add_vo_require oval (next ()) None (Some false)
+
+ |"-require-import" | "-ri" -> add_vo_require oval (next ()) None (Some false)
+
+ |"-require-export" | "-re" -> add_vo_require oval (next ()) None (Some true)
+
+ |"-require-import-from" | "-rifrom" ->
+ let from = next () in add_vo_require oval (next ()) (Some from) (Some false)
+
+ |"-require-export-from" | "-refrom" ->
+ let from = next () in add_vo_require oval (next ()) (Some from) (Some true)
|"-top" ->
let topname = Libnames.dirpath_of_string (next ()) in
diff --git a/toplevel/coqargs.mli b/toplevel/coqargs.mli
index d7f9819bee..81f8983e98 100644
--- a/toplevel/coqargs.mli
+++ b/toplevel/coqargs.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -22,8 +22,8 @@ type t = {
load_rcfile : bool;
rcfile : string option;
- ml_includes : Mltop.coq_path list;
- vo_includes : Mltop.coq_path list;
+ ml_includes : Loadpath.coq_path list;
+ vo_includes : Loadpath.coq_path list;
vo_requires : (string * string option * bool option) list;
toplevel_name : Stm.interactive_top;
@@ -69,4 +69,4 @@ val parse_args : help:(unit -> unit) -> init:t -> string list -> t * string list
val exitcode : t -> int
val require_libs : t -> (string * string option * bool option) list
-val build_load_path : t -> Mltop.coq_path list
+val build_load_path : t -> Loadpath.coq_path list
diff --git a/toplevel/coqc.ml b/toplevel/coqc.ml
index fd4c515209..a04552e8db 100644
--- a/toplevel/coqc.ml
+++ b/toplevel/coqc.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -62,7 +62,5 @@ let main () =
flush_all();
Topfmt.print_err_exn exn;
flush_all();
- let exit_code =
- if CErrors.(is_anomaly exn || not (handled exn)) then 129 else 1
- in
+ let exit_code = if (CErrors.is_anomaly exn) then 129 else 1 in
exit exit_code
diff --git a/toplevel/coqc.mli b/toplevel/coqc.mli
index 6049c5e188..42e44815d5 100644
--- a/toplevel/coqc.mli
+++ b/toplevel/coqc.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/toplevel/coqcargs.ml b/toplevel/coqcargs.ml
index 2279ce5505..5cced2baac 100644
--- a/toplevel/coqcargs.ml
+++ b/toplevel/coqcargs.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -48,7 +48,7 @@ let depr opt =
(* XXX Remove this duplication with Coqargs *)
let fatal_error exn =
Topfmt.(in_phase ~phase:ParsingCommandLine print_err_exn exn);
- let exit_code = if CErrors.(is_anomaly exn || not (handled exn)) then 129 else 1 in
+ let exit_code = if (CErrors.is_anomaly exn) then 129 else 1 in
exit exit_code
let error_missing_arg s =
@@ -63,7 +63,10 @@ let check_compilation_output_name_consistency args =
prerr_endline ("file have to be compiled")
| _ -> ()
+let is_dash_argument s = String.length s > 0 && s.[0] = '-'
+
let add_compile ?echo copts s =
+ if is_dash_argument s then (prerr_endline ("Unknown option " ^ s); exit 1);
(* make the file name explicit; needed not to break up Coq loadpath stuff. *)
let echo = Option.default copts.echo echo in
let s =
diff --git a/toplevel/coqcargs.mli b/toplevel/coqcargs.mli
index 7792056b24..b02eeeb9ee 100644
--- a/toplevel/coqcargs.mli
+++ b/toplevel/coqcargs.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/toplevel/coqinit.ml b/toplevel/coqinit.ml
index 74a089510e..ce1b3c7896 100644
--- a/toplevel/coqinit.ml
+++ b/toplevel/coqinit.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -17,7 +17,7 @@ let set_debug () =
let () = Backtrace.record_backtrace true in
Flags.debug := true
-(* Loading of the ressource file.
+(* Loading of the resource file.
rcfile is either $XDG_CONFIG_HOME/.coqrc.VERSION, or $XDG_CONFIG_HOME/.coqrc if the first one
does not exist. *)
@@ -53,25 +53,25 @@ let load_rcfile ~rcfile ~state =
(* Recursively puts dir in the LoadPath if -nois was not passed *)
let build_stdlib_path ~load_init ~unix_path ~coq_path ~with_ml =
- let open Mltop in
+ let open Loadpath in
let add_ml = if with_ml then AddRecML else AddNoML in
{ recursive = true;
path_spec = VoPath { unix_path; coq_path ; has_ml = add_ml; implicit = load_init }
}
let build_userlib_path ~unix_path =
- let open Mltop in
+ let open Loadpath in
{ recursive = true;
path_spec = VoPath {
unix_path;
coq_path = Libnames.default_root_prefix;
- has_ml = Mltop.AddRecML;
+ has_ml = AddRecML;
implicit = false;
}
}
let ml_path_if c p =
- let open Mltop in
+ let open Loadpath in
let f x = { recursive = false; path_spec = MlPath x } in
if c then List.map f p else []
@@ -85,7 +85,7 @@ let toplevel_init_load_path () =
(* LoadPath for Coq user libraries *)
let libs_init_load_path ~load_init =
- let open Mltop in
+ let open Loadpath in
let coqlib = Envars.coqlib () in
let user_contrib = coqlib/"user-contrib" in
let xdg_dirs = Envars.xdg_dirs ~warn:(fun x -> Feedback.msg_warning (str x)) in
@@ -115,10 +115,10 @@ let libs_init_load_path ~load_init =
(* Initialises the Ocaml toplevel before launching it, so that it can
find the "include" file in the *source* directory *)
let init_ocaml_path () =
- let open Mltop in
+ let open Loadpath in
let lp s = { recursive = false; path_spec = MlPath s } in
let add_subdir dl =
- Mltop.add_coq_path (lp (List.fold_left (/) Envars.coqroot [dl]))
+ Loadpath.add_coq_path (lp (List.fold_left (/) Envars.coqroot [dl]))
in
- Mltop.add_coq_path (lp (Envars.coqlib ()));
+ Loadpath.add_coq_path (lp (Envars.coqlib ()));
List.iter add_subdir Coq_config.all_src_dirs
diff --git a/toplevel/coqinit.mli b/toplevel/coqinit.mli
index c891e736b4..fc53c8b47c 100644
--- a/toplevel/coqinit.mli
+++ b/toplevel/coqinit.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -17,7 +17,7 @@ val load_rcfile : rcfile:(string option) -> state:Vernac.State.t -> Vernac.State
val init_ocaml_path : unit -> unit
(* LoadPath for toploop toplevels *)
-val toplevel_init_load_path : unit -> Mltop.coq_path list
+val toplevel_init_load_path : unit -> Loadpath.coq_path list
(* LoadPath for Coq user libraries *)
-val libs_init_load_path : load_init:bool -> Mltop.coq_path list
+val libs_init_load_path : load_init:bool -> Loadpath.coq_path list
diff --git a/toplevel/coqloop.ml b/toplevel/coqloop.ml
index de447db51f..4077c02604 100644
--- a/toplevel/coqloop.ml
+++ b/toplevel/coqloop.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/toplevel/coqloop.mli b/toplevel/coqloop.mli
index 0cc22ba31d..aab4ebff03 100644
--- a/toplevel/coqloop.mli
+++ b/toplevel/coqloop.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -17,7 +17,7 @@ type input_buffer = {
mutable prompt : Stm.doc -> string;
mutable str : Bytes.t; (** buffer of already read characters *)
mutable len : int; (** number of chars in the buffer *)
- mutable bols : int list; (** offsets in str of begining of lines *)
+ mutable bols : int list; (** offsets in str of beginning of lines *)
mutable tokens : Pcoq.Parsable.t; (** stream of tokens *)
mutable start : int } (** stream count of the first char of the buffer *)
diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml
index b769405cf6..e43e6a8da4 100644
--- a/toplevel/coqtop.ml
+++ b/toplevel/coqtop.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -103,7 +103,7 @@ let fatal_error_exn exn =
Topfmt.(in_phase ~phase:Initialization print_err_exn exn);
flush_all ();
let exit_code =
- if CErrors.(is_anomaly exn || not (handled exn)) then 129 else 1
+ if (CErrors.is_anomaly exn) then 129 else 1
in
exit exit_code
@@ -222,7 +222,7 @@ let init_toplevel ~help ~init custom_init arglist =
exit 0;
end;
let top_lp = Coqinit.toplevel_init_load_path () in
- List.iter Mltop.add_coq_path top_lp;
+ List.iter Loadpath.add_coq_path top_lp;
let opts, extras = custom_init ~opts extras in
Mltop.init_known_plugins ();
diff --git a/toplevel/coqtop.mli b/toplevel/coqtop.mli
index 300a7a039b..40f569a1c8 100644
--- a/toplevel/coqtop.mli
+++ b/toplevel/coqtop.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/toplevel/g_toplevel.mlg b/toplevel/g_toplevel.mlg
index 0cac024300..cddcd5faa7 100644
--- a/toplevel/g_toplevel.mlg
+++ b/toplevel/g_toplevel.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/toplevel/usage.ml b/toplevel/usage.ml
index 29948d50b2..91b3c32126 100644
--- a/toplevel/usage.ml
+++ b/toplevel/usage.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -44,10 +44,23 @@ let print_usage_common co command =
\n -load-ml-source f load ML file f\
\n -load-vernac-source f load Coq file f.v (Load \"f\".)\
\n -l f (idem)\
-\n -require path load Coq library path and import it (Require Import path.)\
\n -load-vernac-source-verbose f load Coq file f.v (Load Verbose \"f\".)\
\n -lv f (idem)\
-\n -load-vernac-object path load Coq library path (Require path)\
+\n -load-vernac-object lib, -r lib\
+\n load Coq library lib (Require lib)\
+\n -rfrom root lib load Coq library lib (From root Require lib.)\
+\n -require-import lib, -ri lib\
+\n load and import Coq library lib\
+\n (equivalent to Require Import lib.)\
+\n -require-export lib, -re lib\
+\n load and transitively import Coq library lib\
+\n (equivalent to Require Export lib.)\
+\n -require-import-from root lib, -rifrom lib\
+\n load and import Coq library lib\
+\n (equivalent to From root Require Import lib.)\
+\n -require-export-from root lib, -refrom lib\
+\n load and transitively import Coq library lib\
+\n (equivalent to From root Require Export lib.)\
\n\
\n -where print Coq's standard library location and exit\
\n -config, --config print Coq's configuration information and exit\
diff --git a/toplevel/usage.mli b/toplevel/usage.mli
index 64170adaa4..1f257a5896 100644
--- a/toplevel/usage.mli
+++ b/toplevel/usage.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/toplevel/vernac.ml b/toplevel/vernac.ml
index c41f16c95b..7a59a4dd12 100644
--- a/toplevel/vernac.ml
+++ b/toplevel/vernac.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -37,7 +37,7 @@ let vernac_echo ?loc in_chan = let open Loc in
Feedback.msg_notice @@ str @@ really_input_string in_chan len
) loc
-(* Reenable when we get back to feedback printing *)
+(* Re-enable when we get back to feedback printing *)
(* let is_end_of_input any = match any with *)
(* Stm.End_of_input -> true *)
(* | _ -> false *)
diff --git a/toplevel/vernac.mli b/toplevel/vernac.mli
index 197891707c..ce49a7de95 100644
--- a/toplevel/vernac.mli
+++ b/toplevel/vernac.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/toplevel/workerLoop.ml b/toplevel/workerLoop.ml
index f922ad8fee..d362f9db22 100644
--- a/toplevel/workerLoop.ml
+++ b/toplevel/workerLoop.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/toplevel/workerLoop.mli b/toplevel/workerLoop.mli
index e497dee6d3..685a10f6f3 100644
--- a/toplevel/workerLoop.mli
+++ b/toplevel/workerLoop.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/user-contrib/Ltac2/Array.v b/user-contrib/Ltac2/Array.v
index 11b64e3515..c55e20bc88 100644
--- a/user-contrib/Ltac2/Array.v
+++ b/user-contrib/Ltac2/Array.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ltac2.Init.
diff --git a/user-contrib/Ltac2/Char.v b/user-contrib/Ltac2/Char.v
index 29fef60f2c..c48ea7be5c 100644
--- a/user-contrib/Ltac2/Char.v
+++ b/user-contrib/Ltac2/Char.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ltac2.Init.
diff --git a/user-contrib/Ltac2/Constr.v b/user-contrib/Ltac2/Constr.v
index 1701bf4365..34299f3cf9 100644
--- a/user-contrib/Ltac2/Constr.v
+++ b/user-contrib/Ltac2/Constr.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ltac2.Init.
@@ -48,7 +50,7 @@ Ltac2 @ external make : kind -> constr := "ltac2" "constr_make".
Ltac2 @ external check : constr -> constr result := "ltac2" "constr_check".
(** Checks that a constr generated by unsafe means is indeed safe in the
current environment, and returns it, or the error otherwise. Panics if
- not focussed. *)
+ not focused. *)
Ltac2 @ external substnl : constr list -> int -> constr -> constr := "ltac2" "constr_substnl".
(** [substnl [r₁;...;rₙ] k c] substitutes in parallel [Rel(k+1); ...; Rel(k+n)] with
@@ -68,6 +70,6 @@ Ltac2 @ external constructor : inductive -> int -> constructor := "ltac2" "const
End Unsafe.
Ltac2 @ external in_context : ident -> constr -> (unit -> unit) -> constr := "ltac2" "constr_in_context".
-(** On a focussed goal [Γ ⊢ A], [in_context id c tac] evaluates [tac] in a
- focussed goal [Γ, id : c ⊢ ?X] and returns [fun (id : c) => t] where [t] is
+(** On a focused goal [Γ ⊢ A], [in_context id c tac] evaluates [tac] in a
+ focused goal [Γ, id : c ⊢ ?X] and returns [fun (id : c) => t] where [t] is
the proof built by the tactic. *)
diff --git a/user-contrib/Ltac2/Control.v b/user-contrib/Ltac2/Control.v
index 6068dd20cb..8f35e1a279 100644
--- a/user-contrib/Ltac2/Control.v
+++ b/user-contrib/Ltac2/Control.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ltac2.Init.
diff --git a/user-contrib/Ltac2/Env.v b/user-contrib/Ltac2/Env.v
index 4aa1718c9a..2cb8406618 100644
--- a/user-contrib/Ltac2/Env.v
+++ b/user-contrib/Ltac2/Env.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
From Ltac2 Require Import Init Std.
diff --git a/user-contrib/Ltac2/Fresh.v b/user-contrib/Ltac2/Fresh.v
index 5e876bb077..8872300ef9 100644
--- a/user-contrib/Ltac2/Fresh.v
+++ b/user-contrib/Ltac2/Fresh.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ltac2.Init.
diff --git a/user-contrib/Ltac2/Ident.v b/user-contrib/Ltac2/Ident.v
index 55456afbe2..6b6041aff9 100644
--- a/user-contrib/Ltac2/Ident.v
+++ b/user-contrib/Ltac2/Ident.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ltac2.Init.
diff --git a/user-contrib/Ltac2/Init.v b/user-contrib/Ltac2/Init.v
index 7c735f3b10..88454ff2fb 100755
--- a/user-contrib/Ltac2/Init.v
+++ b/user-contrib/Ltac2/Init.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Declare ML Module "ltac2_plugin".
diff --git a/user-contrib/Ltac2/Int.v b/user-contrib/Ltac2/Int.v
index d88f8a70f3..60aafcd37d 100644
--- a/user-contrib/Ltac2/Int.v
+++ b/user-contrib/Ltac2/Int.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ltac2.Init.
diff --git a/user-contrib/Ltac2/Ltac1.v b/user-contrib/Ltac2/Ltac1.v
index c4e0b606d0..d069150634 100644
--- a/user-contrib/Ltac2/Ltac1.v
+++ b/user-contrib/Ltac2/Ltac1.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
(** This module defines the Ltac2 FFI to Ltac1 code. Due to intricate semantics
diff --git a/user-contrib/Ltac2/Ltac2.v b/user-contrib/Ltac2/Ltac2.v
index ac90f63560..05bc36cbdc 100644
--- a/user-contrib/Ltac2/Ltac2.v
+++ b/user-contrib/Ltac2/Ltac2.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Export Ltac2.Init.
diff --git a/user-contrib/Ltac2/Message.v b/user-contrib/Ltac2/Message.v
index 7bffe0746b..07a82f4d42 100644
--- a/user-contrib/Ltac2/Message.v
+++ b/user-contrib/Ltac2/Message.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ltac2.Init.
diff --git a/user-contrib/Ltac2/Notations.v b/user-contrib/Ltac2/Notations.v
index 0eab36df82..b650c1a2ec 100644
--- a/user-contrib/Ltac2/Notations.v
+++ b/user-contrib/Ltac2/Notations.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ltac2.Init.
diff --git a/user-contrib/Ltac2/Pattern.v b/user-contrib/Ltac2/Pattern.v
index 8d1fb0cd8a..b2cf97ea40 100644
--- a/user-contrib/Ltac2/Pattern.v
+++ b/user-contrib/Ltac2/Pattern.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ltac2.Init.
@@ -25,7 +27,7 @@ Ltac2 @ external empty_context : unit -> context :=
Ltac2 @ external matches : t -> constr -> (ident * constr) list :=
"ltac2" "pattern_matches".
(** If the term matches the pattern, returns the bound variables. If it doesn't,
- fail with [Match_failure]. Panics if not focussed. *)
+ fail with [Match_failure]. Panics if not focused. *)
Ltac2 @ external matches_subterm : t -> constr -> context * ((ident * constr) list) :=
"ltac2" "pattern_matches_subterm".
diff --git a/user-contrib/Ltac2/Std.v b/user-contrib/Ltac2/Std.v
index 6c3f465f33..af2249d058 100644
--- a/user-contrib/Ltac2/Std.v
+++ b/user-contrib/Ltac2/Std.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ltac2.Init.
@@ -145,7 +147,7 @@ Ltac2 @ external set : evar_flag -> (unit -> ident option * constr) -> clause ->
Ltac2 @ external remember : evar_flag -> ident option -> (unit -> constr) -> intro_pattern option -> clause -> unit := "ltac2" "tac_remember".
Ltac2 @ external destruct : evar_flag -> induction_clause list ->
- constr_with_bindings option -> unit := "ltac2" "tac_induction".
+ constr_with_bindings option -> unit := "ltac2" "tac_destruct".
Ltac2 @ external induction : evar_flag -> induction_clause list ->
constr_with_bindings option -> unit := "ltac2" "tac_induction".
diff --git a/user-contrib/Ltac2/String.v b/user-contrib/Ltac2/String.v
index 99e1dab76b..081025168d 100644
--- a/user-contrib/Ltac2/String.v
+++ b/user-contrib/Ltac2/String.v
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Require Import Ltac2.Init.
diff --git a/user-contrib/Ltac2/g_ltac2.mlg b/user-contrib/Ltac2/g_ltac2.mlg
index 890ed76d52..e348396aad 100644
--- a/user-contrib/Ltac2/g_ltac2.mlg
+++ b/user-contrib/Ltac2/g_ltac2.mlg
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
{
@@ -90,7 +92,6 @@ let tac2def_typ = Entry.create "tactic:tac2def_typ"
let tac2def_ext = Entry.create "tactic:tac2def_ext"
let tac2def_syn = Entry.create "tactic:tac2def_syn"
let tac2def_mut = Entry.create "tactic:tac2def_mut"
-let tac2def_run = Entry.create "tactic:tac2def_run"
let tac2mode = Entry.create "vernac:ltac2_command"
let ltac1_expr = Pltac.tactic_expr
@@ -114,7 +115,7 @@ let pattern_of_qualid qid =
GRAMMAR EXTEND Gram
GLOBAL: tac2expr tac2type tac2def_val tac2def_typ tac2def_ext tac2def_syn
- tac2def_mut tac2def_run;
+ tac2def_mut;
tac2pat:
[ "1" LEFTA
[ qid = Prim.qualid; pl = LIST1 tac2pat LEVEL "0" -> {
@@ -288,9 +289,6 @@ GRAMMAR EXTEND Gram
tac2def_mut:
[ [ "Set"; qid = Prim.qualid; ":="; e = tac2expr -> { StrMut (qid, e) } ] ]
;
- tac2def_run:
- [ [ "Eval"; e = tac2expr -> { StrRun e } ] ]
- ;
tac2typ_knd:
[ [ t = tac2type -> { CTydDef (Some t) }
| "["; ".."; "]" -> { CTydOpn }
@@ -878,20 +876,27 @@ PRINTED BY { pr_ltac2entry }
| [ tac2def_ext(e) ] -> { e }
| [ tac2def_syn(e) ] -> { e }
| [ tac2def_mut(e) ] -> { e }
-| [ tac2def_run(e) ] -> { e }
+END
+
+VERNAC ARGUMENT EXTEND ltac2_expr
+PRINTED BY { pr_ltac2expr }
+| [ tac2expr(e) ] -> { e }
END
{
let classify_ltac2 = function
-| StrSyn _ -> Vernacextend.(VtSideff [], VtNow)
-| StrMut _ | StrVal _ | StrPrm _ | StrTyp _ | StrRun _ -> Vernacextend.classify_as_sideeff
+| StrSyn _ -> Vernacextend.(VtSideff ([], VtNow))
+| StrMut _ | StrVal _ | StrPrm _ | StrTyp _ -> Vernacextend.classify_as_sideeff
}
VERNAC COMMAND EXTEND VernacDeclareTactic2Definition
-| #[ local = locality ] ![proof] [ "Ltac2" ltac2_entry(e) ] => { classify_ltac2 e } -> {
- fun ~pstate -> Tac2entries.register_struct ?local ~pstate e; pstate
+| #[ local = locality ] [ "Ltac2" ltac2_entry(e) ] => { classify_ltac2 e } -> {
+ Tac2entries.register_struct ?local e
+ }
+| ![proof_opt_query] [ "Ltac2" "Eval" ltac2_expr(e) ] => { Vernacextend.classify_as_sideeff } -> {
+ fun ~pstate -> Tac2entries.perform_eval ~pstate e
}
END
@@ -899,15 +904,6 @@ END
let _ = Pvernac.register_proof_mode "Ltac2" tac2mode
-}
-
-VERNAC ARGUMENT EXTEND ltac2_expr
-PRINTED BY { pr_ltac2expr }
-| [ tac2expr(e) ] -> { e }
-END
-
-{
-
open G_ltac
open Vernacextend
@@ -917,9 +913,7 @@ VERNAC { tac2mode } EXTEND VernacLtac2
| ![proof] [ ltac2_expr(t) ltac_use_default(default) ] =>
{ classify_as_proofstep } -> {
(* let g = Option.default (Proof_global.get_default_goal_selector ()) g in *)
- fun ~pstate ->
- Option.map (fun pstate -> Tac2entries.call ~pstate ~default t) pstate
- }
+ fun ~pstate -> Tac2entries.call ~pstate ~default t }
END
{
diff --git a/user-contrib/Ltac2/tac2core.ml b/user-contrib/Ltac2/tac2core.ml
index da8600109e..2eb199633d 100644
--- a/user-contrib/Ltac2/tac2core.ml
+++ b/user-contrib/Ltac2/tac2core.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Util
@@ -1355,6 +1357,16 @@ let () = add_scope "thunk" begin function
| arg -> scope_fail "thunk" arg
end
+let () = add_scope "constr" (fun arg ->
+ let delimiters = List.map (function
+ | SexprRec (_, { v = Some s }, []) -> s
+ | _ -> scope_fail "constr" arg)
+ arg
+ in
+ let act e = Tac2quote.of_constr ~delimiters e in
+ Tac2entries.ScopeRule (Extend.Aentry Pcoq.Constr.constr, act)
+ )
+
let add_expr_scope name entry f =
add_scope name begin function
| [] -> Tac2entries.ScopeRule (Extend.Aentry entry, f)
@@ -1382,7 +1394,6 @@ let () = add_expr_scope "assert" q_assert Tac2quote.of_assertion
let () = add_expr_scope "constr_matching" q_constr_matching Tac2quote.of_constr_matching
let () = add_expr_scope "goal_matching" q_goal_matching Tac2quote.of_goal_matching
-let () = add_generic_scope "constr" Pcoq.Constr.constr Tac2quote.wit_constr
let () = add_generic_scope "open_constr" Pcoq.Constr.constr Tac2quote.wit_open_constr
let () = add_generic_scope "pattern" Pcoq.Constr.constr Tac2quote.wit_pattern
diff --git a/user-contrib/Ltac2/tac2core.mli b/user-contrib/Ltac2/tac2core.mli
index 9fae65bb3e..eb66332936 100644
--- a/user-contrib/Ltac2/tac2core.mli
+++ b/user-contrib/Ltac2/tac2core.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Tac2expr
diff --git a/user-contrib/Ltac2/tac2dyn.ml b/user-contrib/Ltac2/tac2dyn.ml
index 896676f08b..32894f3643 100644
--- a/user-contrib/Ltac2/tac2dyn.ml
+++ b/user-contrib/Ltac2/tac2dyn.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
module Arg =
diff --git a/user-contrib/Ltac2/tac2dyn.mli b/user-contrib/Ltac2/tac2dyn.mli
index e995296840..df4f003a1f 100644
--- a/user-contrib/Ltac2/tac2dyn.mli
+++ b/user-contrib/Ltac2/tac2dyn.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
(** Dynamic arguments for Ltac2. *)
diff --git a/user-contrib/Ltac2/tac2entries.ml b/user-contrib/Ltac2/tac2entries.ml
index 254c2e5086..624d4d7f04 100644
--- a/user-contrib/Ltac2/tac2entries.ml
+++ b/user-contrib/Ltac2/tac2entries.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Pp
@@ -751,7 +753,7 @@ let perform_eval ~pstate e =
Goal_select.SelectAll, Proof.start ~name ~poly sigma []
| Some pstate ->
Goal_select.get_default_goal_selector (),
- Proof_global.give_me_the_proof pstate
+ Proof_global.get_proof pstate
in
let v = match selector with
| Goal_select.SelectNth i -> Proofview.tclFOCUS i i v
@@ -769,13 +771,12 @@ let perform_eval ~pstate e =
(** Toplevel entries *)
-let register_struct ?local ~pstate str = match str with
+let register_struct ?local str = match str with
| StrVal (mut, isrec, e) -> register_ltac ?local ~mut isrec e
| StrTyp (isrec, t) -> register_type ?local isrec t
| StrPrm (id, t, ml) -> register_primitive ?local id t ml
| StrSyn (tok, lev, e) -> register_notation ?local tok lev e
| StrMut (qid, e) -> register_redefinition ?local qid e
-| StrRun e -> perform_eval ~pstate e
(** Toplevel exception *)
@@ -857,7 +858,7 @@ let print_ltac qid =
(** Calling tactics *)
let solve ~pstate default tac =
- let pstate, status = Proof_global.with_current_proof begin fun etac p ->
+ let pstate, status = Proof_global.map_fold_proof_endline begin fun etac p ->
let with_end_tac = if default then Some etac else None in
let g = Goal_select.get_default_goal_selector () in
let (p, status) = Pfedit.solve g None tac ?with_end_tac p in
diff --git a/user-contrib/Ltac2/tac2entries.mli b/user-contrib/Ltac2/tac2entries.mli
index d493192bb3..a913a62e45 100644
--- a/user-contrib/Ltac2/tac2entries.mli
+++ b/user-contrib/Ltac2/tac2entries.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Names
@@ -23,13 +25,14 @@ val register_primitive : ?local:bool ->
val register_struct
: ?local:bool
- -> pstate:Proof_global.t option
-> strexpr
-> unit
val register_notation : ?local:bool -> sexpr list -> int option ->
raw_tacexpr -> unit
+val perform_eval : pstate:Proof_global.t option -> raw_tacexpr -> unit
+
(** {5 Notations} *)
type scope_rule =
diff --git a/user-contrib/Ltac2/tac2env.ml b/user-contrib/Ltac2/tac2env.ml
index 93ad57e97e..963c3aa37f 100644
--- a/user-contrib/Ltac2/tac2env.ml
+++ b/user-contrib/Ltac2/tac2env.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Util
diff --git a/user-contrib/Ltac2/tac2env.mli b/user-contrib/Ltac2/tac2env.mli
index c7e87c5432..2dbb16e184 100644
--- a/user-contrib/Ltac2/tac2env.mli
+++ b/user-contrib/Ltac2/tac2env.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Genarg
diff --git a/user-contrib/Ltac2/tac2expr.mli b/user-contrib/Ltac2/tac2expr.mli
index 2e7dfc42db..b69b51b559 100644
--- a/user-contrib/Ltac2/tac2expr.mli
+++ b/user-contrib/Ltac2/tac2expr.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Names
@@ -168,8 +170,6 @@ type strexpr =
(** Syntactic extensions *)
| StrMut of qualid * raw_tacexpr
(** Redefinition of mutable globals *)
-| StrRun of raw_tacexpr
- (** Toplevel evaluation of an expression *)
(** {5 Dynamic semantics} *)
diff --git a/user-contrib/Ltac2/tac2extffi.ml b/user-contrib/Ltac2/tac2extffi.ml
index 315c970f9e..7098ab4863 100644
--- a/user-contrib/Ltac2/tac2extffi.ml
+++ b/user-contrib/Ltac2/tac2extffi.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Tac2ffi
diff --git a/user-contrib/Ltac2/tac2extffi.mli b/user-contrib/Ltac2/tac2extffi.mli
index f5251c3d0d..38b5b79084 100644
--- a/user-contrib/Ltac2/tac2extffi.mli
+++ b/user-contrib/Ltac2/tac2extffi.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Tac2ffi
diff --git a/user-contrib/Ltac2/tac2ffi.ml b/user-contrib/Ltac2/tac2ffi.ml
index 1043d25a75..ee61bdab71 100644
--- a/user-contrib/Ltac2/tac2ffi.ml
+++ b/user-contrib/Ltac2/tac2ffi.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Util
diff --git a/user-contrib/Ltac2/tac2ffi.mli b/user-contrib/Ltac2/tac2ffi.mli
index f8581061a0..480eee51fc 100644
--- a/user-contrib/Ltac2/tac2ffi.mli
+++ b/user-contrib/Ltac2/tac2ffi.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Names
diff --git a/user-contrib/Ltac2/tac2intern.ml b/user-contrib/Ltac2/tac2intern.ml
index de99fb167f..0961e9c9c9 100644
--- a/user-contrib/Ltac2/tac2intern.ml
+++ b/user-contrib/Ltac2/tac2intern.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Pp
@@ -367,7 +369,7 @@ let unify_arrow ?loc env ft args =
iter ft args true
| GTypVar id, (_, t) :: args ->
let ft = GTypVar (fresh_id env) in
- let () = unify_var env id (GTypArrow (t, ft)) in
+ let () = unify ?loc env (GTypVar id) (GTypArrow (t, ft)) in
iter ft args true
| GTypRef _, _ :: _ ->
if is_fun then
diff --git a/user-contrib/Ltac2/tac2intern.mli b/user-contrib/Ltac2/tac2intern.mli
index 829570a354..5e282a386a 100644
--- a/user-contrib/Ltac2/tac2intern.mli
+++ b/user-contrib/Ltac2/tac2intern.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Names
diff --git a/user-contrib/Ltac2/tac2interp.ml b/user-contrib/Ltac2/tac2interp.ml
index db779db471..3b5cdb79aa 100644
--- a/user-contrib/Ltac2/tac2interp.ml
+++ b/user-contrib/Ltac2/tac2interp.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Util
diff --git a/user-contrib/Ltac2/tac2interp.mli b/user-contrib/Ltac2/tac2interp.mli
index 21fdcd03af..a186320668 100644
--- a/user-contrib/Ltac2/tac2interp.mli
+++ b/user-contrib/Ltac2/tac2interp.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Names
diff --git a/user-contrib/Ltac2/tac2match.ml b/user-contrib/Ltac2/tac2match.ml
index 354a578cb3..d18cfbf8ce 100644
--- a/user-contrib/Ltac2/tac2match.ml
+++ b/user-contrib/Ltac2/tac2match.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Names
diff --git a/user-contrib/Ltac2/tac2match.mli b/user-contrib/Ltac2/tac2match.mli
index c82c40d238..9dba98de63 100644
--- a/user-contrib/Ltac2/tac2match.mli
+++ b/user-contrib/Ltac2/tac2match.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Names
diff --git a/user-contrib/Ltac2/tac2print.ml b/user-contrib/Ltac2/tac2print.ml
index f4cb290265..b89067086f 100644
--- a/user-contrib/Ltac2/tac2print.ml
+++ b/user-contrib/Ltac2/tac2print.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Util
@@ -471,7 +473,7 @@ end
let () = register_init "err" begin fun _ _ e ->
let e = to_ext val_exn e in
- let (e, _) = ExplainErr.process_vernac_interp_error ~allow_uncaught:true e in
+ let (e, _) = ExplainErr.process_vernac_interp_error e in
str "err:(" ++ CErrors.print_no_report e ++ str ")"
end
diff --git a/user-contrib/Ltac2/tac2print.mli b/user-contrib/Ltac2/tac2print.mli
index 9b9db2937d..4c9fcb4016 100644
--- a/user-contrib/Ltac2/tac2print.mli
+++ b/user-contrib/Ltac2/tac2print.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Tac2expr
diff --git a/user-contrib/Ltac2/tac2qexpr.mli b/user-contrib/Ltac2/tac2qexpr.mli
index 400ab1a092..736c0a96ac 100644
--- a/user-contrib/Ltac2/tac2qexpr.mli
+++ b/user-contrib/Ltac2/tac2qexpr.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Names
diff --git a/user-contrib/Ltac2/tac2quote.ml b/user-contrib/Ltac2/tac2quote.ml
index a98264745e..405c80fa9b 100644
--- a/user-contrib/Ltac2/tac2quote.ml
+++ b/user-contrib/Ltac2/tac2quote.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Pp
@@ -94,8 +96,14 @@ let of_anti f = function
let of_ident {loc;v=id} = inj_wit ?loc wit_ident id
-let of_constr c =
+let of_constr ?delimiters c =
let loc = Constrexpr_ops.constr_loc c in
+ let c = Option.cata
+ (List.fold_left (fun c d ->
+ CAst.make ?loc @@ Constrexpr.CDelimiters(Id.to_string d, c))
+ c)
+ c delimiters
+ in
inj_wit ?loc wit_constr c
let of_open_constr c =
diff --git a/user-contrib/Ltac2/tac2quote.mli b/user-contrib/Ltac2/tac2quote.mli
index 1b03dad8ec..0cef0e3a2b 100644
--- a/user-contrib/Ltac2/tac2quote.mli
+++ b/user-contrib/Ltac2/tac2quote.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Names
@@ -32,7 +34,7 @@ val of_variable : Id.t CAst.t -> raw_tacexpr
val of_ident : Id.t CAst.t -> raw_tacexpr
-val of_constr : Constrexpr.constr_expr -> raw_tacexpr
+val of_constr : ?delimiters:Id.t list -> Constrexpr.constr_expr -> raw_tacexpr
val of_open_constr : Constrexpr.constr_expr -> raw_tacexpr
diff --git a/user-contrib/Ltac2/tac2stdlib.ml b/user-contrib/Ltac2/tac2stdlib.ml
index fb51fc965b..ce510dad16 100644
--- a/user-contrib/Ltac2/tac2stdlib.ml
+++ b/user-contrib/Ltac2/tac2stdlib.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Names
diff --git a/user-contrib/Ltac2/tac2stdlib.mli b/user-contrib/Ltac2/tac2stdlib.mli
index 927b57074d..6008a066ec 100644
--- a/user-contrib/Ltac2/tac2stdlib.mli
+++ b/user-contrib/Ltac2/tac2stdlib.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
(** Standard tactics sharing their implementation with Ltac1 *)
diff --git a/user-contrib/Ltac2/tac2tactics.ml b/user-contrib/Ltac2/tac2tactics.ml
index a8c1a67f6f..6c96ef7742 100644
--- a/user-contrib/Ltac2/tac2tactics.ml
+++ b/user-contrib/Ltac2/tac2tactics.ml
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Pp
diff --git a/user-contrib/Ltac2/tac2tactics.mli b/user-contrib/Ltac2/tac2tactics.mli
index e56544cd68..1f8f8d5240 100644
--- a/user-contrib/Ltac2/tac2tactics.mli
+++ b/user-contrib/Ltac2/tac2tactics.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Names
diff --git a/user-contrib/Ltac2/tac2types.mli b/user-contrib/Ltac2/tac2types.mli
index fa31153a27..6d98f3f6ef 100644
--- a/user-contrib/Ltac2/tac2types.mli
+++ b/user-contrib/Ltac2/tac2types.mli
@@ -1,9 +1,11 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
open Names
diff --git a/vernac/assumptions.ml b/vernac/assumptions.ml
index 445f10ecc1..d7cb9dc727 100644
--- a/vernac/assumptions.ml
+++ b/vernac/assumptions.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -168,7 +168,7 @@ let rec traverse current ctx accu t = match Constr.kind t with
let body () = id |> Global.lookup_named |> NamedDecl.get_value in
traverse_object accu body (VarRef id)
| Const (kn, _) ->
- let body () = Option.map fst (Global.body_of_constant_body (lookup_constant kn)) in
+ let body () = Option.map pi1 (Global.body_of_constant_body Library.indirect_accessor (lookup_constant kn)) in
traverse_object accu body (ConstRef kn)
| Ind ((mind, _) as ind, _) ->
traverse_inductive accu mind (IndRef ind)
@@ -181,7 +181,7 @@ let rec traverse current ctx accu t = match Constr.kind t with
| Lambda(_,_,oty), Const (kn, _)
when Vars.noccurn 1 oty &&
not (Declareops.constant_has_body (lookup_constant kn)) ->
- let body () = Option.map fst (Global.body_of_constant_body (lookup_constant kn)) in
+ let body () = Option.map pi1 (Global.body_of_constant_body Library.indirect_accessor (lookup_constant kn)) in
traverse_object
~inhabits:(current,ctx,Vars.subst1 mkProp oty) accu body (ConstRef kn)
| _ ->
diff --git a/vernac/assumptions.mli b/vernac/assumptions.mli
index 536185f4aa..5e63829411 100644
--- a/vernac/assumptions.mli
+++ b/vernac/assumptions.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/attributes.ml b/vernac/attributes.ml
index 1ad5862d5d..6af454eee5 100644
--- a/vernac/attributes.ml
+++ b/vernac/attributes.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -73,11 +73,6 @@ module Notations = struct
end
open Notations
-type deprecation = { since : string option ; note : string option }
-
-let mk_deprecation ?(since=None) ?(note=None) () =
- { since ; note }
-
let assert_empty k v =
if v <> VernacFlagEmpty
then user_err Pp.(str "Attribute " ++ str k ++ str " does not accept arguments")
@@ -213,19 +208,16 @@ let polymorphic =
universe_transform ~warn_unqualified:true >>
qualify_attribute ukey polymorphic_base
-let deprecation_parser : deprecation key_parser = fun orig args ->
+let deprecation_parser : Deprecation.t key_parser = fun orig args ->
assert_once ~name:"deprecation" orig;
match args with
| VernacFlagList [ "since", VernacFlagLeaf since ; "note", VernacFlagLeaf note ]
| VernacFlagList [ "note", VernacFlagLeaf note ; "since", VernacFlagLeaf since ] ->
- let since = Some since and note = Some note in
- mk_deprecation ~since ~note ()
+ Deprecation.make ~since ~note ()
| VernacFlagList [ "since", VernacFlagLeaf since ] ->
- let since = Some since in
- mk_deprecation ~since ()
+ Deprecation.make ~since ()
| VernacFlagList [ "note", VernacFlagLeaf note ] ->
- let note = Some note in
- mk_deprecation ~note ()
+ Deprecation.make ~note ()
| _ -> CErrors.user_err (Pp.str "Ill formed “deprecated” attribute")
let deprecation = attribute_of_list ["deprecated",deprecation_parser]
diff --git a/vernac/attributes.mli b/vernac/attributes.mli
index 44688ddafc..34ff15ca7d 100644
--- a/vernac/attributes.mli
+++ b/vernac/attributes.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -43,15 +43,11 @@ end
(** Definitions for some standard attributes. *)
-type deprecation = { since : string option ; note : string option }
-
-val mk_deprecation : ?since: string option -> ?note: string option -> unit -> deprecation
-
val polymorphic : bool attribute
val program : bool attribute
val template : bool option attribute
val locality : bool option attribute
-val deprecation : deprecation option attribute
+val deprecation : Deprecation.t option attribute
val canonical : bool attribute
val program_mode_option_name : string list
diff --git a/vernac/auto_ind_decl.ml b/vernac/auto_ind_decl.ml
index 528829f3a5..38852992e4 100644
--- a/vernac/auto_ind_decl.ml
+++ b/vernac/auto_ind_decl.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -195,7 +195,7 @@ let build_beq_scheme mode kn =
let (c,a) = Reductionops.whd_betaiota_stack Evd.empty EConstr.(of_constr c) in
let (c,a) = EConstr.Unsafe.(to_constr c, List.map to_constr a) in
match Constr.kind c with
- | Rel x -> mkRel (x-nlist+ndx), Safe_typing.empty_private_constants
+ | Rel x -> mkRel (x-nlist+ndx), Evd.empty_side_effects
| Var x ->
(* Support for working in a context with "eq_x : x -> x -> bool" *)
let eid = Id.of_string ("eq_"^(Id.to_string x)) in
@@ -203,11 +203,11 @@ let build_beq_scheme mode kn =
try ignore (Environ.lookup_named eid env)
with Not_found -> raise (ParameterWithoutEquality (VarRef x))
in
- mkVar eid, Safe_typing.empty_private_constants
+ mkVar eid, Evd.empty_side_effects
| Cast (x,_,_) -> aux (Term.applist (x,a))
| App _ -> assert false
| Ind ((kn',i as ind'),u) (*FIXME: universes *) ->
- if MutInd.equal kn kn' then mkRel(eqA-nlist-i+nb_ind-1), Safe_typing.empty_private_constants
+ if MutInd.equal kn kn' then mkRel(eqA-nlist-i+nb_ind-1), Evd.empty_side_effects
else begin
try
let eq, eff =
@@ -216,7 +216,7 @@ let build_beq_scheme mode kn =
let eqa, eff =
let eqa, effs = List.split (List.map aux a) in
Array.of_list eqa,
- List.fold_left Safe_typing.concat_private eff (List.rev effs)
+ List.fold_left Evd.concat_side_effects eff (List.rev effs)
in
let args =
Array.append
@@ -239,7 +239,7 @@ let build_beq_scheme mode kn =
let kneq = Constant.change_label kn eq_lbl in
try let _ = Environ.constant_opt_value_in env (kneq, u) in
Term.applist (mkConst kneq,a),
- Safe_typing.empty_private_constants
+ Evd.empty_side_effects
with Not_found -> raise (ParameterWithoutEquality (ConstRef kn)))
| Proj _ -> raise (EqUnknown "projection")
| Construct _ -> raise (EqUnknown "constructor")
@@ -270,7 +270,7 @@ let build_beq_scheme mode kn =
let constrsi = constrs (3+nparrec) in
let n = Array.length constrsi in
let ar = Array.make n (ff ()) in
- let eff = ref Safe_typing.empty_private_constants in
+ let eff = ref Evd.empty_side_effects in
for i=0 to n-1 do
let nb_cstr_args = List.length constrsi.(i).cs_args in
let ar2 = Array.make n (ff ()) in
@@ -288,7 +288,7 @@ let build_beq_scheme mode kn =
(nb_cstr_args+ndx+1)
cc
in
- eff := Safe_typing.concat_private eff' !eff;
+ eff := Evd.concat_side_effects eff' !eff;
Array.set eqs ndx
(mkApp (eqA,
[|mkRel (ndx+1+nb_cstr_args);mkRel (ndx+1)|]
@@ -320,7 +320,7 @@ let build_beq_scheme mode kn =
let names = Array.make nb_ind (make_annot Anonymous Sorts.Relevant) and
types = Array.make nb_ind mkSet and
cores = Array.make nb_ind mkSet in
- let eff = ref Safe_typing.empty_private_constants in
+ let eff = ref Evd.empty_side_effects in
let u = Univ.Instance.empty in
for i=0 to (nb_ind-1) do
names.(i) <- make_annot (Name (Id.of_string (rec_name i))) Sorts.Relevant;
@@ -328,11 +328,11 @@ let build_beq_scheme mode kn =
(mkArrow (mkFullInd ((kn,i),u) 1) Sorts.Relevant (bb ()));
let c, eff' = make_one_eq i in
cores.(i) <- c;
- eff := Safe_typing.concat_private eff' !eff
+ eff := Evd.concat_side_effects eff' !eff
done;
(Array.init nb_ind (fun i ->
- let kelim = Inductive.elim_sorts (mib,mib.mind_packets.(i)) in
- if not (Sorts.List.mem InSet kelim) then
+ let kelim = Inductive.elim_sort (mib,mib.mind_packets.(i)) in
+ if not (Sorts.family_leq InSet kelim) then
raise (NonSingletonProp (kn,i));
let fix = match mib.mind_finite with
| CoFinite ->
@@ -938,7 +938,7 @@ let compute_dec_tact ind lnamesparrec nparrec =
Not_found ->
Tacticals.New.tclZEROMSG (str "Error during the decidability part, leibniz to boolean equality is required.")
end >>= fun (lbI,eff'') ->
- let eff = (Safe_typing.concat_private eff'' (Safe_typing.concat_private eff' eff)) in
+ let eff = (Evd.concat_side_effects eff'' (Evd.concat_side_effects eff' eff)) in
Tacticals.New.tclTHENLIST [
Proofview.tclEFFECTS eff;
intros_using fresh_first_intros;
@@ -1005,7 +1005,7 @@ let make_eq_decidability mode mind =
(EConstr.of_constr (compute_dec_goal (ind,u) lnamesparrec nparrec))
(compute_dec_tact ind lnamesparrec nparrec)
in
- ([|ans|], ctx), Safe_typing.empty_private_constants
+ ([|ans|], ctx), Evd.empty_side_effects
let eq_dec_scheme_kind =
declare_mutual_scheme_object "_eq_dec" make_eq_decidability
diff --git a/vernac/auto_ind_decl.mli b/vernac/auto_ind_decl.mli
index 647ff3d8d6..0de8c61f59 100644
--- a/vernac/auto_ind_decl.mli
+++ b/vernac/auto_ind_decl.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/canonical.ml b/vernac/canonical.ml
index 92d5731f92..e9454bab8a 100644
--- a/vernac/canonical.ml
+++ b/vernac/canonical.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/canonical.mli b/vernac/canonical.mli
index 5b223a0615..a3bbaf6d18 100644
--- a/vernac/canonical.mli
+++ b/vernac/canonical.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/class.ml b/vernac/class.ml
index f3a279eab1..d5c75ed809 100644
--- a/vernac/class.ml
+++ b/vernac/class.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -17,7 +17,6 @@ open Constr
open Context
open Vars
open Termops
-open Entries
open Environ
open Classops
open Declare
@@ -358,23 +357,23 @@ let try_add_new_coercion_with_source ref ~local poly ~source =
let add_coercion_hook poly _uctx _trans local ref =
let local = match local with
- | Discharge
- | Local -> true
- | Global -> false
+ | Discharge -> assert false (* Local Coercion in section behaves like Local Definition *)
+ | Global ImportNeedQualified -> true
+ | Global ImportDefaultBehavior -> false
in
let () = try_add_new_coercion ref ~local poly in
let msg = Nametab.pr_global_env Id.Set.empty ref ++ str " is now a coercion" in
Flags.if_verbose Feedback.msg_info msg
-let add_coercion_hook poly = Lemmas.mk_hook (add_coercion_hook poly)
+let add_coercion_hook poly = DeclareDef.Hook.make (add_coercion_hook poly)
let add_subclass_hook poly _uctx _trans local ref =
let stre = match local with
- | Local -> true
- | Global -> false
- | Discharge -> assert false
+ | Discharge -> assert false (* Local Subclass in section behaves like Local Definition *)
+ | Global ImportNeedQualified -> true
+ | Global ImportDefaultBehavior -> false
in
let cl = class_of_global ref in
try_add_new_coercion_subclass cl ~local:stre poly
-let add_subclass_hook poly = Lemmas.mk_hook (add_subclass_hook poly)
+let add_subclass_hook poly = DeclareDef.Hook.make (add_subclass_hook poly)
diff --git a/vernac/class.mli b/vernac/class.mli
index 80d6d4383c..d530d218d4 100644
--- a/vernac/class.mli
+++ b/vernac/class.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -42,8 +42,8 @@ val try_add_new_coercion_with_source : GlobRef.t -> local:bool ->
val try_add_new_identity_coercion : Id.t -> local:bool ->
Decl_kinds.polymorphic -> source:cl_typ -> target:cl_typ -> unit
-val add_coercion_hook : Decl_kinds.polymorphic -> Lemmas.declaration_hook
+val add_coercion_hook : Decl_kinds.polymorphic -> DeclareDef.Hook.t
-val add_subclass_hook : Decl_kinds.polymorphic -> Lemmas.declaration_hook
+val add_subclass_hook : Decl_kinds.polymorphic -> DeclareDef.Hook.t
val class_of_global : GlobRef.t -> cl_typ
diff --git a/vernac/classes.ml b/vernac/classes.ml
index 5a7f60584a..d6a2f2727a 100644
--- a/vernac/classes.ml
+++ b/vernac/classes.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -29,7 +29,6 @@ module NamedDecl = Context.Named.Declaration
(*i*)
open Decl_kinds
-open Entries
let set_typeclass_transparency c local b =
Hints.add_hints ~local [typeclasses_db]
@@ -281,9 +280,6 @@ let existing_instance glob g info =
~hdr:"declare_instance"
(Pp.str "Constant does not build instances of a declared type class.")
-let mismatched_params env n m = Implicit_quantifiers.mismatched_ctx_inst_err env Parameters n m
-let mismatched_props env n m = Implicit_quantifiers.mismatched_ctx_inst_err env Properties n m
-
(* Declare everything in the parameters as implicit, and the class instance as well *)
let type_ctx_instance ~program_mode env sigma ctx inst subst =
@@ -309,7 +305,7 @@ let id_of_class cl =
mip.(0).Declarations.mind_typename
| _ -> assert false
-let instance_hook k info global imps ?hook cst =
+let instance_hook info global imps ?hook cst =
Impargs.maybe_declare_manual_implicits false cst imps;
let info = intern_info info in
let env = Global.env () in
@@ -317,7 +313,7 @@ let instance_hook k info global imps ?hook cst =
declare_instance env sigma (Some info) (not global) cst;
(match hook with Some h -> h cst | None -> ())
-let declare_instance_constant k info global imps ?hook id decl poly sigma term termtype =
+let declare_instance_constant info global imps ?hook id decl poly sigma term termtype =
(* XXX: Duplication of the declare_constant path *)
let kind = IsDefinition Instance in
let sigma =
@@ -327,13 +323,13 @@ let declare_instance_constant k info global imps ?hook id decl poly sigma term t
in
let uctx = Evd.check_univ_decl ~poly sigma decl in
let entry = Declare.definition_entry ~types:termtype ~univs:uctx term in
- let cdecl = (DefinitionEntry entry, kind) in
+ let cdecl = (Declare.DefinitionEntry entry, kind) in
let kn = Declare.declare_constant id cdecl in
Declare.definition_message id;
Declare.declare_univ_binders (ConstRef kn) (Evd.universe_binders sigma);
- instance_hook k info global imps ?hook (ConstRef kn)
+ instance_hook info global imps ?hook (ConstRef kn)
-let do_declare_instance env sigma ~global ~poly k u ctx ctx' pri decl imps subst id =
+let do_declare_instance sigma ~global ~poly k u ctx ctx' pri decl imps subst id =
let subst = List.fold_left2
(fun subst' s decl -> if is_local_assum decl then s :: subst' else subst')
[] subst (snd k.cl_context)
@@ -342,138 +338,80 @@ let do_declare_instance env sigma ~global ~poly k u ctx ctx' pri decl imps subst
let termtype = it_mkProd_or_LetIn ty_constr (ctx' @ ctx) in
let sigma, entry = DeclareDef.prepare_parameter ~allow_evars:false ~poly sigma decl termtype in
let cst = Declare.declare_constant ~internal:Declare.InternalTacticRequest id
- (ParameterEntry entry, Decl_kinds.IsAssumption Decl_kinds.Logical) in
+ (Declare.ParameterEntry entry, Decl_kinds.IsAssumption Decl_kinds.Logical) in
Declare.declare_univ_binders (ConstRef cst) (Evd.universe_binders sigma);
- instance_hook k pri global imps (ConstRef cst)
-
-let declare_instance_open ~pstate env sigma ?hook ~tac ~program_mode ~global ~poly k id pri imps decl ids term termtype =
- let kind = Decl_kinds.Global, poly, Decl_kinds.DefinitionBody Decl_kinds.Instance in
- if program_mode then
- let hook _ _ vis gr =
- let cst = match gr with ConstRef kn -> kn | _ -> assert false in
- Impargs.declare_manual_implicits false gr imps;
- let pri = intern_info pri in
- let env = Global.env () in
- let sigma = Evd.from_env env in
- declare_instance env sigma (Some pri) (not global) (ConstRef cst)
- in
- let obls, constr, typ =
- match term with
- | Some t ->
- let termtype = EConstr.of_constr termtype in
- let obls, _, constr, typ =
- Obligations.eterm_obligations env id sigma 0 t termtype
- in obls, Some constr, typ
- | None -> [||], None, termtype
- in
- let hook = Lemmas.mk_hook hook in
- let ctx = Evd.evar_universe_context sigma in
- let _progress = Obligations.add_definition id ?term:constr
- ~univdecl:decl typ ctx ~kind:(Global,poly,Instance) ~hook obls in
- pstate
- else
- Some Flags.(silently (fun () ->
- (* spiwack: it is hard to reorder the actions to do
- the pretyping after the proof has opened. As a
- consequence, we use the low-level primitives to code
- the refinement manually.*)
- let gls = List.rev (Evd.future_goals sigma) in
- let sigma = Evd.reset_future_goals sigma in
- let pstate = Lemmas.start_proof ~ontop:pstate id ~pl:decl kind sigma (EConstr.of_constr termtype)
- ~hook:(Lemmas.mk_hook
- (fun _ _ _ -> instance_hook k pri global imps ?hook)) in
- (* spiwack: I don't know what to do with the status here. *)
- let pstate =
- if not (Option.is_empty term) then
- let init_refine =
- Tacticals.New.tclTHENLIST [
- Refine.refine ~typecheck:false (fun sigma -> (sigma, Option.get term));
- Proofview.Unsafe.tclNEWGOALS (CList.map Proofview.with_empty_state gls);
- Tactics.New.reduce_after_refine;
- ]
- in
- let pstate, _ = Pfedit.by init_refine pstate in
- pstate
- else
- let pstate, _ = Pfedit.by (Tactics.auto_intros_tac ids) pstate in
- pstate
- in
- match tac with
- | Some tac ->
- let pstate, _ = Pfedit.by tac pstate in
- pstate
- | None ->
- pstate) ())
-
-let do_instance ~pstate env env' sigma ?hook ~tac ~global ~poly ~program_mode cty k u ctx ctx' pri decl imps subst id props =
- let props =
- match props with
- | Some (true, { CAst.v = CRecord fs }) ->
- if List.length fs > List.length k.cl_props then
- mismatched_props env' (List.map snd fs) k.cl_props;
- Some (Inl fs)
- | Some (_, t) -> Some (Inr t)
- | None ->
- if program_mode then Some (Inl [])
- else None
+ instance_hook pri global imps (ConstRef cst)
+
+let declare_instance_program env sigma ~global ~poly id pri imps decl term termtype =
+ let hook _ _ vis gr =
+ let cst = match gr with ConstRef kn -> kn | _ -> assert false in
+ Impargs.declare_manual_implicits false gr imps;
+ let pri = intern_info pri in
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
+ declare_instance env sigma (Some pri) (not global) (ConstRef cst)
in
- let subst, sigma =
- match props with
- | None ->
- (if List.is_empty k.cl_props then Some (Inl subst) else None), sigma
- | Some (Inr term) ->
- let sigma, c = interp_casted_constr_evars ~program_mode env' sigma term cty in
- Some (Inr (c, subst)), sigma
- | Some (Inl props) ->
- let get_id qid = CAst.make ?loc:qid.CAst.loc @@ qualid_basename qid in
- let props, rest =
- List.fold_left
- (fun (props, rest) decl ->
- if is_local_assum decl then
- try
- let is_id (id', _) = match RelDecl.get_name decl, get_id id' with
- | Name id, {CAst.v=id'} -> Id.equal id id'
- | Anonymous, _ -> false
- in
- let (loc_mid, c) = List.find is_id rest in
- let rest' = List.filter (fun v -> not (is_id v)) rest
- in
- let {CAst.loc;v=mid} = get_id loc_mid in
- List.iter (fun (n, _, x) ->
- if Name.equal n (Name mid) then
- Option.iter (fun x -> Dumpglob.add_glob ?loc (ConstRef x)) x) k.cl_projs;
- c :: props, rest'
- with Not_found ->
- ((CAst.make @@ CHole (None(* Some Evar_kinds.GoalEvar *), Namegen.IntroAnonymous, None)) :: props), rest
- else props, rest)
- ([], props) k.cl_props
- in
- match rest with
- | (n, _) :: _ ->
- unbound_method env' sigma k.cl_impl (get_id n)
- | _ ->
- let kcl_props = List.map (Termops.map_rel_decl of_constr) k.cl_props in
- let sigma, res = type_ctx_instance ~program_mode (push_rel_context ctx' env') sigma kcl_props props subst in
- Some (Inl res), sigma
+ let obls, constr, typ =
+ match term with
+ | Some t ->
+ let termtype = EConstr.of_constr termtype in
+ let obls, _, constr, typ =
+ Obligations.eterm_obligations env id sigma 0 t termtype
+ in obls, Some constr, typ
+ | None -> [||], None, termtype
in
- let term, termtype =
- match subst with
- | None -> let termtype = it_mkProd_or_LetIn cty ctx in
- None, termtype
- | Some (Inl subst) ->
- let subst = List.fold_left2
- (fun subst' s decl -> if is_local_assum decl then s :: subst' else subst')
- [] subst (k.cl_props @ snd k.cl_context)
+ let hook = DeclareDef.Hook.make hook in
+ let ctx = Evd.evar_universe_context sigma in
+ ignore(Obligations.add_definition id ?term:constr
+ ~univdecl:decl typ ctx ~kind:(Global ImportDefaultBehavior,poly,Instance) ~hook obls)
+
+
+let declare_instance_open sigma ?hook ~tac ~global ~poly id pri imps decl ids term termtype =
+ (* spiwack: it is hard to reorder the actions to do
+ the pretyping after the proof has opened. As a
+ consequence, we use the low-level primitives to code
+ the refinement manually.*)
+ let gls = List.rev (Evd.future_goals sigma) in
+ let sigma = Evd.reset_future_goals sigma in
+ let kind = Decl_kinds.(Global ImportDefaultBehavior, poly, DefinitionBody Instance) in
+ let lemma = Lemmas.start_lemma id ~pl:decl kind sigma (EConstr.of_constr termtype)
+ ~hook:(DeclareDef.Hook.make
+ (fun _ _ _ -> instance_hook pri global imps ?hook)) in
+ (* spiwack: I don't know what to do with the status here. *)
+ let lemma =
+ if not (Option.is_empty term) then
+ let init_refine =
+ Tacticals.New.tclTHENLIST [
+ Refine.refine ~typecheck:false (fun sigma -> (sigma, Option.get term));
+ Proofview.Unsafe.tclNEWGOALS (CList.map Proofview.with_empty_state gls);
+ Tactics.New.reduce_after_refine;
+ ]
in
- let (app, ty_constr) = instance_constructor (k,u) subst in
- let termtype = it_mkProd_or_LetIn ty_constr (ctx' @ ctx) in
- let term = it_mkLambda_or_LetIn (Option.get app) (ctx' @ ctx) in
- Some term, termtype
- | Some (Inr (def, subst)) ->
- let termtype = it_mkProd_or_LetIn cty ctx in
- let term = it_mkLambda_or_LetIn def ctx in
- Some term, termtype
+ let lemma, _ = Lemmas.by init_refine lemma in
+ lemma
+ else
+ let lemma, _ = Lemmas.by (Tactics.auto_intros_tac ids) lemma in
+ lemma
+ in
+ match tac with
+ | Some tac ->
+ let lemma, _ = Lemmas.by tac lemma in
+ lemma
+ | None ->
+ lemma
+
+let do_instance_subst_constructor_and_ty subst k u ctx =
+ let subst =
+ List.fold_left2 (fun subst' s decl ->
+ if is_local_assum decl then s :: subst' else subst')
+ [] subst (k.cl_props @ snd k.cl_context)
in
+ let (app, ty_constr) = instance_constructor (k,u) subst in
+ let termtype = it_mkProd_or_LetIn ty_constr ctx in
+ let term = it_mkLambda_or_LetIn (Option.get app) ctx in
+ term, termtype
+
+let do_instance_resolve_TC term termtype sigma env =
let sigma = Evarutil.nf_evar_map sigma in
let sigma = Typeclasses.resolve_typeclasses ~filter:Typeclasses.no_goals_or_obligations ~fail:true env sigma in
(* Try resolving fields that are typeclasses automatically. *)
@@ -484,39 +422,116 @@ let do_instance ~pstate env env' sigma ?hook ~tac ~global ~poly ~program_mode ct
(* Check that the type is free of evars now. *)
Pretyping.check_evars env (Evd.from_env env) sigma termtype;
let termtype = to_constr sigma termtype in
- let pstate =
- if not (Evd.has_undefined sigma) && not (Option.is_empty props) then
- let term = to_constr sigma (Option.get term) in
- (declare_instance_constant k pri global imps ?hook id decl poly sigma term termtype;
- None)
- else if program_mode || Option.is_empty props then
- declare_instance_open ~pstate env sigma ?hook ~tac ~program_mode ~global ~poly k id pri imps decl (List.map RelDecl.get_name ctx) term termtype
- else CErrors.user_err Pp.(str "Unsolved obligations remaining.") in
- id, pstate
-
-let interp_instance_context ~program_mode env ctx ?(generalize=false) pl bk cl =
- let sigma, decl = Constrexpr_ops.interp_univ_decl_opt env pl in
- let tclass, ids =
- match bk with
- | Decl_kinds.Implicit ->
- Implicit_quantifiers.implicit_application Id.Set.empty ~allow_partial:false
- (fun avoid (clname, _) ->
- match clname with
- | Some cl ->
- let t = CAst.make @@ CHole (None, Namegen.IntroAnonymous, None) in
- t, avoid
- | None -> failwith ("new instance: under-applied typeclass"))
- cl
- | Explicit -> cl, Id.Set.empty
+ termtype, sigma
+
+let do_instance_type_ctx_instance props k env' ctx' sigma ~program_mode subst =
+ let get_id qid = CAst.make ?loc:qid.CAst.loc @@ qualid_basename qid in
+ let props, rest =
+ List.fold_left
+ (fun (props, rest) decl ->
+ if is_local_assum decl then
+ try
+ let is_id (id', _) = match RelDecl.get_name decl, get_id id' with
+ | Name id, {CAst.v=id'} -> Id.equal id id'
+ | Anonymous, _ -> false
+ in
+ let (loc_mid, c) = List.find is_id rest in
+ let rest' = List.filter (fun v -> not (is_id v)) rest
+ in
+ let {CAst.loc;v=mid} = get_id loc_mid in
+ List.iter (fun (n, _, x) ->
+ if Name.equal n (Name mid) then
+ Option.iter (fun x -> Dumpglob.add_glob ?loc (ConstRef x)) x) k.cl_projs;
+ c :: props, rest'
+ with Not_found ->
+ ((CAst.make @@ CHole (None(* Some Evar_kinds.GoalEvar *), Namegen.IntroAnonymous, None)) :: props), rest
+ else props, rest)
+ ([], props) k.cl_props
in
+ match rest with
+ | (n, _) :: _ ->
+ unbound_method env' sigma k.cl_impl (get_id n)
+ | _ ->
+ let kcl_props = List.map (Termops.map_rel_decl of_constr) k.cl_props in
+ let sigma, res =
+ type_ctx_instance ~program_mode
+ (push_rel_context ctx' env') sigma kcl_props props subst in
+ res, sigma
+
+let do_instance_interactive env sigma ?hook ~tac ~global ~poly cty k u ctx ctx' pri decl imps subst id =
+ let term, termtype =
+ if List.is_empty k.cl_props then
+ let term, termtype =
+ do_instance_subst_constructor_and_ty subst k u (ctx' @ ctx) in
+ Some term, termtype
+ else
+ None, it_mkProd_or_LetIn cty ctx in
+ let termtype, sigma = do_instance_resolve_TC term termtype sigma env in
+ Flags.silently (fun () ->
+ declare_instance_open sigma ?hook ~tac ~global ~poly
+ id pri imps decl (List.map RelDecl.get_name ctx) term termtype)
+ ()
+
+let do_instance env env' sigma ?hook ~global ~poly cty k u ctx ctx' pri decl imps subst id props =
+ let term, termtype, sigma =
+ match props with
+ | (true, { CAst.v = CRecord fs; loc }) ->
+ check_duplicate ?loc fs;
+ let subst, sigma = do_instance_type_ctx_instance fs k env' ctx' sigma ~program_mode:false subst in
+ let term, termtype =
+ do_instance_subst_constructor_and_ty subst k u (ctx' @ ctx) in
+ term, termtype, sigma
+ | (_, term) ->
+ let sigma, def =
+ interp_casted_constr_evars ~program_mode:false env' sigma term cty in
+ let termtype = it_mkProd_or_LetIn cty ctx in
+ let term = it_mkLambda_or_LetIn def ctx in
+ term, termtype, sigma in
+ let termtype, sigma = do_instance_resolve_TC (Some term) termtype sigma env in
+ if Evd.has_undefined sigma then
+ CErrors.user_err Pp.(str "Unsolved obligations remaining.")
+ else
+ let term = to_constr sigma term in
+ declare_instance_constant pri global imps ?hook id decl poly sigma term termtype
+
+let do_instance_program env env' sigma ?hook ~global ~poly cty k u ctx ctx' pri decl imps subst id opt_props =
+ let term, termtype, sigma =
+ match opt_props with
+ | Some (true, { CAst.v = CRecord fs; loc }) ->
+ check_duplicate ?loc fs;
+ let subst, sigma =
+ do_instance_type_ctx_instance fs k env' ctx' sigma ~program_mode:true subst in
+ let term, termtype =
+ do_instance_subst_constructor_and_ty subst k u (ctx' @ ctx) in
+ Some term, termtype, sigma
+ | Some (_, term) ->
+ let sigma, def =
+ interp_casted_constr_evars ~program_mode:true env' sigma term cty in
+ let termtype = it_mkProd_or_LetIn cty ctx in
+ let term = it_mkLambda_or_LetIn def ctx in
+ Some term, termtype, sigma
+ | None ->
+ let subst, sigma =
+ do_instance_type_ctx_instance [] k env' ctx' sigma ~program_mode:true subst in
+ let term, termtype =
+ do_instance_subst_constructor_and_ty subst k u (ctx' @ ctx) in
+ Some term, termtype, sigma in
+ let termtype, sigma = do_instance_resolve_TC term termtype sigma env in
+ if not (Evd.has_undefined sigma) && not (Option.is_empty opt_props) then
+ let term = to_constr sigma (Option.get term) in
+ declare_instance_constant pri global imps ?hook id decl poly sigma term termtype
+ else
+ declare_instance_program env sigma ~global ~poly id pri imps decl term termtype
+
+let interp_instance_context ~program_mode env ctx ~generalize pl tclass =
+ let sigma, decl = Constrexpr_ops.interp_univ_decl_opt env pl in
let tclass =
if generalize then CAst.make @@ CGeneralization (Implicit, Some AbsPi, tclass)
else tclass
in
let sigma, (impls, ((env', ctx), imps)) = interp_context_evars ~program_mode env sigma ctx in
let sigma, (c', imps') = interp_type_evars_impls ~program_mode ~impls env' sigma tclass in
- let len = Context.Rel.nhyps ctx in
- let imps = imps @ Impargs.lift_implicits len imps' in
+ let imps = imps @ imps' in
let ctx', c = decompose_prod_assum sigma c' in
let ctx'' = ctx' @ ctx in
let (k, u), args = Typeclasses.dest_class_app (push_rel_context ctx'' env) sigma c in
@@ -535,15 +550,12 @@ let interp_instance_context ~program_mode env ctx ?(generalize=false) pl bk cl =
let sigma = resolve_typeclasses ~filter:Typeclasses.all_evars ~fail:true env sigma in
sigma, cl, u, c', ctx', ctx, imps, args, decl
-
-let new_instance ~pstate ?(global=false) ~program_mode
- poly ctx (instid, bk, cl) props
- ?(generalize=true) ?(tac:unit Proofview.tactic option) ?hook pri =
- let env = Global.env() in
+let new_instance_common ~program_mode ~generalize env instid ctx cl =
let ({CAst.loc;v=instid}, pl) = instid in
let sigma, k, u, cty, ctx', ctx, imps, subst, decl =
- interp_instance_context ~program_mode env ~generalize ctx pl bk cl
+ interp_instance_context ~program_mode env ~generalize ctx pl cl
in
+ (* The name generator should not be here *)
let id =
match instid with
| Name id -> id
@@ -552,13 +564,41 @@ let new_instance ~pstate ?(global=false) ~program_mode
Namegen.next_global_ident_away i (Termops.vars_of_env env)
in
let env' = push_rel_context ctx env in
- do_instance ~pstate env env' sigma ?hook ~tac ~global ~poly ~program_mode
- cty k u ctx ctx' pri decl imps subst id props
+ id, env', sigma, k, u, cty, ctx', ctx, imps, subst, decl
+
+let new_instance_interactive ?(global=false)
+ poly instid ctx cl
+ ?(generalize=true) ?(tac:unit Proofview.tactic option) ?hook pri =
+ let env = Global.env() in
+ let id, env', sigma, k, u, cty, ctx', ctx, imps, subst, decl =
+ new_instance_common ~program_mode:false ~generalize env instid ctx cl in
+ id, do_instance_interactive env sigma ?hook ~tac ~global ~poly
+ cty k u ctx ctx' pri decl imps subst id
+
+let new_instance_program ?(global=false)
+ poly instid ctx cl opt_props
+ ?(generalize=true) ?hook pri =
+ let env = Global.env() in
+ let id, env', sigma, k, u, cty, ctx', ctx, imps, subst, decl =
+ new_instance_common ~program_mode:true ~generalize env instid ctx cl in
+ do_instance_program env env' sigma ?hook ~global ~poly
+ cty k u ctx ctx' pri decl imps subst id opt_props;
+ id
+
+let new_instance ?(global=false)
+ poly instid ctx cl props
+ ?(generalize=true) ?hook pri =
+ let env = Global.env() in
+ let id, env', sigma, k, u, cty, ctx', ctx, imps, subst, decl =
+ new_instance_common ~program_mode:false ~generalize env instid ctx cl in
+ do_instance env env' sigma ?hook ~global ~poly
+ cty k u ctx ctx' pri decl imps subst id props;
+ id
-let declare_new_instance ?(global=false) ~program_mode poly ctx (instid, bk, cl) pri =
+let declare_new_instance ?(global=false) ~program_mode poly instid ctx cl pri =
let env = Global.env() in
let ({CAst.loc;v=instid}, pl) = instid in
let sigma, k, u, cty, ctx', ctx, imps, subst, decl =
- interp_instance_context ~program_mode env ctx pl bk cl
+ interp_instance_context ~program_mode ~generalize:false env ctx pl cl
in
- do_declare_instance env sigma ~global ~poly k u ctx ctx' pri decl imps subst instid
+ do_declare_instance sigma ~global ~poly k u ctx ctx' pri decl imps subst instid
diff --git a/vernac/classes.mli b/vernac/classes.mli
index 57bb9ce312..472690cdd4 100644
--- a/vernac/classes.mli
+++ b/vernac/classes.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -14,12 +14,6 @@ open Constrexpr
open Typeclasses
open Libnames
-(** Errors *)
-
-val mismatched_params : env -> constr_expr list -> Constr.rel_context -> 'a
-
-val mismatched_props : env -> constr_expr list -> Constr.rel_context -> 'a
-
(** Instance declaration *)
val declare_instance : ?warn:bool -> env -> Evd.evar_map ->
@@ -31,43 +25,51 @@ val declare_instance : ?warn:bool -> env -> Evd.evar_map ->
val existing_instance : bool -> qualid -> Hints.hint_info_expr option -> unit
(** globality, reference, optional priority and pattern information *)
-val declare_instance_constant :
- typeclass ->
- Hints.hint_info_expr (** priority *) ->
- bool (** globality *) ->
- Impargs.manual_explicitation list (** implicits *) ->
- ?hook:(GlobRef.t -> unit) ->
- Id.t (** name *) ->
- UState.universe_decl ->
- bool (** polymorphic *) ->
- Evd.evar_map (** Universes *) ->
- Constr.t (** body *) ->
- Constr.types (** type *) ->
- unit
-
-val new_instance :
- pstate:Proof_global.t option ->
- ?global:bool (** Not global by default. *) ->
- program_mode:bool ->
- Decl_kinds.polymorphic ->
- local_binder_expr list ->
- Vernacexpr.typeclass_constraint ->
- (bool * constr_expr) option ->
- ?generalize:bool ->
- ?tac:unit Proofview.tactic ->
- ?hook:(GlobRef.t -> unit) ->
- Hints.hint_info_expr ->
- (* May open a proof *)
- Id.t * Proof_global.t option
-
-val declare_new_instance :
- ?global:bool (** Not global by default. *) ->
- program_mode:bool ->
- Decl_kinds.polymorphic ->
- local_binder_expr list ->
- ident_decl * Decl_kinds.binding_kind * constr_expr ->
- Hints.hint_info_expr ->
- unit
+val new_instance_interactive
+ : ?global:bool (** Not global by default. *)
+ -> Decl_kinds.polymorphic
+ -> name_decl
+ -> local_binder_expr list
+ -> constr_expr
+ -> ?generalize:bool
+ -> ?tac:unit Proofview.tactic
+ -> ?hook:(GlobRef.t -> unit)
+ -> Hints.hint_info_expr
+ -> Id.t * Lemmas.t
+
+val new_instance
+ : ?global:bool (** Not global by default. *)
+ -> Decl_kinds.polymorphic
+ -> name_decl
+ -> local_binder_expr list
+ -> constr_expr
+ -> (bool * constr_expr)
+ -> ?generalize:bool
+ -> ?hook:(GlobRef.t -> unit)
+ -> Hints.hint_info_expr
+ -> Id.t
+
+val new_instance_program
+ : ?global:bool (** Not global by default. *)
+ -> Decl_kinds.polymorphic
+ -> name_decl
+ -> local_binder_expr list
+ -> constr_expr
+ -> (bool * constr_expr) option
+ -> ?generalize:bool
+ -> ?hook:(GlobRef.t -> unit)
+ -> Hints.hint_info_expr
+ -> Id.t
+
+val declare_new_instance
+ : ?global:bool (** Not global by default. *)
+ -> program_mode:bool
+ -> Decl_kinds.polymorphic
+ -> ident_decl
+ -> local_binder_expr list
+ -> constr_expr
+ -> Hints.hint_info_expr
+ -> unit
(** {6 Low level interface used by Add Morphism, do not use } *)
val mk_instance : typeclass -> hint_info -> bool -> GlobRef.t -> instance
diff --git a/vernac/comAssumption.ml b/vernac/comAssumption.ml
index 635751bb24..b0297b7c51 100644
--- a/vernac/comAssumption.ml
+++ b/vernac/comAssumption.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -37,15 +37,15 @@ let () =
optwrite = (:=) axiom_into_instance; }
let should_axiom_into_instance = function
- | Discharge ->
+ | Context ->
(* The typeclass behaviour of Variable and Context doesn't depend
on section status *)
true
- | Global | Local -> !axiom_into_instance
+ | Definitional | Logical | Conjectural -> !axiom_into_instance
let declare_assumption is_coe (local,p,kind) (c,ctx) pl imps impl nl {CAst.v=ident} =
match local with
-| Discharge when Lib.sections_are_opened () ->
+| Discharge ->
let ctx = match ctx with
| Monomorphic_entry ctx -> ctx
| Polymorphic_entry (_, ctx) -> Univ.ContextSet.of_context ctx
@@ -61,15 +61,14 @@ match local with
let () = if is_coe then Class.try_add_new_coercion r ~local:true false in
(r,Univ.Instance.empty,true)
-| Global | Local | Discharge ->
- let do_instance = should_axiom_into_instance local in
- let local = DeclareDef.get_locality ident ~kind:"axiom" local in
+| Global local ->
+ let do_instance = should_axiom_into_instance kind in
let inl = let open Declaremods in match nl with
| NoInline -> None
| DefaultInline -> Some (Flags.get_inline_level())
| InlineAt i -> Some i
in
- let decl = (ParameterEntry (None,(c,ctx),inl), IsAssumption kind) in
+ let decl = (Declare.ParameterEntry (None,(c,ctx),inl), IsAssumption kind) in
let kn = declare_constant ident ~local decl in
let gr = ConstRef kn in
let () = maybe_declare_manual_implicits false gr imps in
@@ -78,6 +77,7 @@ match local with
let env = Global.env () in
let sigma = Evd.from_env env in
let () = if do_instance then Classes.declare_instance env sigma None false gr in
+ let local = match local with ImportNeedQualified -> true | ImportDefaultBehavior -> false in
let () = if is_coe then Class.try_add_new_coercion gr ~local p in
let inst = match ctx with
| Polymorphic_entry (_, ctx) -> Univ.UContext.instance ctx
@@ -124,7 +124,7 @@ let process_assumptions_udecls kind l =
| (_, ([], _))::_ | [] -> assert false
in
let () = match kind, udecl with
- | (Discharge, _, _), Some _ when Lib.sections_are_opened () ->
+ | (Discharge, _, _), Some _ ->
let loc = first_id.CAst.loc in
let msg = Pp.str "Section variables cannot be polymorphic." in
user_err ?loc msg
@@ -146,7 +146,7 @@ let do_assumptions ~program_mode kind nl l =
l []
else l
in
- (* We intepret all declarations in the same evar_map, i.e. as a telescope. *)
+ (* We interpret all declarations in the same evar_map, i.e. as a telescope. *)
let (sigma,_,_),l = List.fold_left_map (fun (sigma,env,ienv) (is_coe,(idl,c)) ->
let sigma,(t,imps) = interp_assumption ~program_mode sigma env ienv c in
let r = Retyping.relevance_of_type env sigma t in
@@ -273,22 +273,24 @@ let context poly l =
(* Declare the universe context once *)
let decl = match b with
| None ->
- (ParameterEntry (None,(t,univs),None), IsAssumption Logical)
+ (Declare.ParameterEntry (None,(t,univs),None), IsAssumption Logical)
| Some b ->
let entry = Declare.definition_entry ~univs ~types:t b in
- (DefinitionEntry entry, IsAssumption Logical)
+ (Declare.DefinitionEntry entry, IsAssumption Logical)
in
let cst = Declare.declare_constant ~internal:Declare.InternalTacticRequest id decl in
let env = Global.env () in
Classes.declare_instance env sigma (Some Hints.empty_hint_info) true (ConstRef cst);
status
else
- let test (x, _) = match x with
- | Constrexpr.ExplByPos (_, Some id') -> Id.equal id id'
+ let test x = match x.CAst.v with
+ | Some (Name id',_) -> Id.equal id id'
| _ -> false
in
let impl = List.exists test impls in
- let decl = (Discharge, poly, Definitional) in
+ let persistence =
+ if Lib.sections_are_opened () then Discharge else Global ImportDefaultBehavior in
+ let decl = (persistence, poly, Context) in
let nstatus = match b with
| None ->
pi3 (declare_assumption false decl (t, univs) UnivNames.empty_binders [] impl
diff --git a/vernac/comAssumption.mli b/vernac/comAssumption.mli
index 8f37bc0ba4..07e96d87a2 100644
--- a/vernac/comAssumption.mli
+++ b/vernac/comAssumption.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/comDefinition.ml b/vernac/comDefinition.ml
index 4cae4b8a74..b3cc0a4236 100644
--- a/vernac/comDefinition.ml
+++ b/vernac/comDefinition.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -10,7 +10,6 @@
open Pp
open Util
-open Entries
open Redexpr
open Constrintern
open Pretyping
@@ -27,18 +26,19 @@ let warn_implicits_in_term =
CWarnings.create ~name:"implicits-in-term" ~category:"implicits"
(fun () ->
strbrk "Implicit arguments declaration relies on type." ++ spc () ++
- strbrk "The term declares more implicits than the type here.")
+ strbrk "Discarding incompatible declaration in term.")
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 Constrexpr_ops.explicitation_eq key impsty) va)
- impsbody
- with Not_found -> false
- in
- if not b then warn_implicits_in_term ()
+ let rec aux impsty impsbody =
+ match impsty, impsbody with
+ | a1 :: impsty, a2 :: impsbody ->
+ (match a1.CAst.v, a2.CAst.v with
+ | None , None -> aux impsty impsbody
+ | Some _ , Some _ -> aux impsty impsbody
+ | _, _ -> warn_implicits_in_term ?loc:a2.CAst.loc ())
+ | _ :: _, [] | [], _ :: _ -> (* Information only on one side *) ()
+ | [], [] -> () in
+ aux impsty impsbody
let interp_definition ~program_mode pl bl poly red_option c ctypopt =
let env = Global.env() in
@@ -56,11 +56,11 @@ let interp_definition ~program_mode pl bl poly red_option c ctypopt =
match tyopt with
| None ->
let evd, (c, impsbody) = interp_constr_evars_impls ~program_mode ~impls env_bl evd c in
- evd, c, imps1@Impargs.lift_implicits (Context.Rel.nhyps ctx) impsbody, None
+ evd, c, imps1@impsbody, None
| Some (ty, impsty) ->
let evd, (c, impsbody) = interp_casted_constr_evars_impls ~program_mode ~impls env_bl evd c ty in
check_imps ~impsty ~impsbody;
- evd, c, imps1@Impargs.lift_implicits (Context.Rel.nhyps ctx) impsty, Some ty
+ evd, c, imps1@impsty, Some ty
in
(* Do the reduction *)
let evd, c = red_constant_body red_option env_bl evd c in
@@ -85,12 +85,12 @@ let do_definition ~program_mode ?hook ident k univdecl bl red_option c ctypopt =
in
if program_mode then
let env = Global.env () in
- let (c,ctx), sideff = Future.force ce.const_entry_body in
- assert(Safe_typing.empty_private_constants = sideff);
+ let (c,ctx), sideff = Future.force ce.Proof_global.proof_entry_body in
+ assert(Safe_typing.empty_private_constants = sideff.Evd.seff_private);
assert(Univ.ContextSet.is_empty ctx);
Obligations.check_evars env evd;
let c = EConstr.of_constr c in
- let typ = match ce.const_entry_type with
+ let typ = match ce.Proof_global.proof_entry_type with
| Some t -> EConstr.of_constr t
| None -> Retyping.get_type_of env evd c
in
diff --git a/vernac/comDefinition.mli b/vernac/comDefinition.mli
index fa4860b079..256abed6a1 100644
--- a/vernac/comDefinition.mli
+++ b/vernac/comDefinition.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -9,7 +9,6 @@
(************************************************************************)
open Names
-open Entries
open Decl_kinds
open Redexpr
open Constrexpr
@@ -18,7 +17,7 @@ open Constrexpr
val do_definition
: program_mode:bool
- -> ?hook:Lemmas.declaration_hook
+ -> ?hook:DeclareDef.Hook.t
-> Id.t
-> definition_kind
-> universe_decl_expr option
@@ -33,7 +32,13 @@ val do_definition
(************************************************************************)
(** Not used anywhere. *)
-val interp_definition : program_mode:bool ->
- universe_decl_expr option -> local_binder_expr list -> polymorphic -> red_expr option -> constr_expr ->
- constr_expr option -> Safe_typing.private_constants definition_entry * Evd.evar_map *
- UState.universe_decl * Impargs.manual_implicits
+val interp_definition
+ : program_mode:bool
+ -> universe_decl_expr option
+ -> local_binder_expr list
+ -> polymorphic
+ -> red_expr option
+ -> constr_expr
+ -> constr_expr option
+ -> Evd.side_effects Proof_global.proof_entry *
+ Evd.evar_map * UState.universe_decl * Impargs.manual_implicits
diff --git a/vernac/comFixpoint.ml b/vernac/comFixpoint.ml
index 00f19f545c..a88413cf7f 100644
--- a/vernac/comFixpoint.ml
+++ b/vernac/comFixpoint.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -197,7 +197,7 @@ let interp_recursive ~program_mode ~cofix fixl notations =
let fixtypes = List.map2 build_fix_type fixctxs fixccls in
let fixtypes = List.map (fun c -> nf_evar sigma c) fixtypes in
let fiximps = List.map3
- (fun ctximps cclimps (_,ctx) -> ctximps@(Impargs.lift_implicits (Context.Rel.nhyps ctx) cclimps))
+ (fun ctximps cclimps (_,ctx) -> ctximps@cclimps)
fixctximps fixcclimps fixctxs in
let sigma, rec_sign =
List.fold_left2
@@ -255,85 +255,86 @@ let interp_fixpoint ~cofix l ntns =
let uctx,fix = ground_fixpoint env evd fix in
(fix,pl,uctx,info)
-let declare_fixpoint ~ontop local poly ((fixnames,fixrs,fixdefs,fixtypes),pl,ctx,fiximps) indexes ntns =
- let pstate =
- if List.exists Option.is_empty fixdefs then
- (* Some bodies to define by proof *)
- let thms =
- List.map3 (fun id t (ctx,imps,_) -> (id,(EConstr.of_constr t,(List.map RelDecl.get_name ctx,imps))))
- fixnames fixtypes fiximps in
- let init_tac =
- Some (List.map (Option.cata (EConstr.of_constr %> Tactics.exact_no_check) Tacticals.New.tclIDTAC)
- fixdefs) in
- let evd = Evd.from_ctx ctx in
- Some
- (Lemmas.start_proof_with_initialization ~ontop (local,poly,DefinitionBody Fixpoint)
- evd pl (Some(false,indexes,init_tac)) thms None)
- else begin
- (* We shortcut the proof process *)
- let fixdefs = List.map Option.get fixdefs in
- let fixdecls = prepare_recursive_declaration fixnames fixrs fixtypes fixdefs in
- let env = Global.env() in
- let indexes = search_guard env indexes fixdecls in
- let fiximps = List.map (fun (n,r,p) -> r) fiximps in
- let vars = Vars.universes_of_constr (mkFix ((indexes,0),fixdecls)) in
- let fixdecls =
- List.map_i (fun i _ -> mkFix ((indexes,i),fixdecls)) 0 fixnames in
- let evd = Evd.from_ctx ctx in
- let evd = Evd.restrict_universe_context evd vars in
- let ctx = Evd.check_univ_decl ~poly evd pl in
- let pl = Evd.universe_binders evd in
- let fixdecls = List.map Safe_typing.mk_pure_proof fixdecls in
- ignore (List.map4 (DeclareDef.declare_fix (local, poly, Fixpoint) pl ctx)
- fixnames fixdecls fixtypes fiximps);
- (* Declare the recursive definitions *)
- fixpoint_message (Some indexes) fixnames;
- None
- end in
- (* Declare notations *)
- List.iter (Metasyntax.add_notation_interpretation (Global.env())) ntns;
- pstate
-
-let declare_cofixpoint ~ontop local poly ((fixnames,fixrs,fixdefs,fixtypes),pl,ctx,fiximps) ntns =
- let pstate =
- if List.exists Option.is_empty fixdefs then
- (* Some bodies to define by proof *)
- let thms =
- List.map3 (fun id t (ctx,imps,_) -> (id,(EConstr.of_constr t,(List.map RelDecl.get_name ctx,imps))))
- fixnames fixtypes fiximps in
- let init_tac =
- Some (List.map (Option.cata (EConstr.of_constr %> Tactics.exact_no_check) Tacticals.New.tclIDTAC)
- fixdefs) in
- let evd = Evd.from_ctx ctx in
- Some (Lemmas.start_proof_with_initialization ~ontop (Global,poly, DefinitionBody CoFixpoint)
- evd pl (Some(true,[],init_tac)) thms None)
- else begin
- (* We shortcut the proof process *)
- let fixdefs = List.map Option.get fixdefs in
- let fixdecls = prepare_recursive_declaration fixnames fixrs fixtypes fixdefs in
- let fixdecls = List.map_i (fun i _ -> mkCoFix (i,fixdecls)) 0 fixnames in
- let vars = Vars.universes_of_constr (List.hd fixdecls) in
- let fixdecls = List.map Safe_typing.mk_pure_proof fixdecls in
- let fiximps = List.map (fun (len,imps,idx) -> imps) fiximps in
- let evd = Evd.from_ctx ctx in
- let evd = Evd.restrict_universe_context evd vars in
- let ctx = Evd.check_univ_decl ~poly evd pl in
- let pl = Evd.universe_binders evd in
- ignore (List.map4 (DeclareDef.declare_fix (local, poly, CoFixpoint) pl ctx)
- fixnames fixdecls fixtypes fiximps);
- (* Declare the recursive definitions *)
- cofixpoint_message fixnames;
- None
- end in
- (* Declare notations *)
- List.iter (Metasyntax.add_notation_interpretation (Global.env())) ntns;
- pstate
+let declare_fixpoint_notations ntns =
+ List.iter (Metasyntax.add_notation_interpretation (Global.env())) ntns
+
+let declare_fixpoint_interactive local poly ((fixnames,fixrs,fixdefs,fixtypes),pl,ctx,fiximps) indexes ntns =
+ (* Some bodies to define by proof *)
+ let thms =
+ List.map3 (fun id t (ctx,imps,_) -> (id,(EConstr.of_constr t,(List.map RelDecl.get_name ctx,imps))))
+ fixnames fixtypes fiximps in
+ let init_tac =
+ Some (List.map (Option.cata (EConstr.of_constr %> Tactics.exact_no_check) Tacticals.New.tclIDTAC)
+ fixdefs) in
+ let evd = Evd.from_ctx ctx in
+ let lemma = Lemmas.start_lemma_with_initialization (local,poly,DefinitionBody Fixpoint)
+ evd pl (Some(false,indexes,init_tac)) thms None in
+ declare_fixpoint_notations ntns;
+ lemma
+
+let declare_fixpoint local poly ((fixnames,fixrs,fixdefs,fixtypes),pl,ctx,fiximps) indexes ntns =
+ (* We shortcut the proof process *)
+ let fixdefs = List.map Option.get fixdefs in
+ let fixdecls = prepare_recursive_declaration fixnames fixrs fixtypes fixdefs in
+ let env = Global.env() in
+ let indexes = search_guard env indexes fixdecls in
+ let fiximps = List.map (fun (n,r,p) -> r) fiximps in
+ let vars = Vars.universes_of_constr (mkFix ((indexes,0),fixdecls)) in
+ let fixdecls =
+ List.map_i (fun i _ -> mkFix ((indexes,i),fixdecls)) 0 fixnames in
+ let evd = Evd.from_ctx ctx in
+ let evd = Evd.restrict_universe_context evd vars in
+ let ctx = Evd.check_univ_decl ~poly evd pl in
+ let pl = Evd.universe_binders evd in
+ let mk_pure c = (c, Univ.ContextSet.empty), Evd.empty_side_effects in
+ let fixdecls = List.map mk_pure fixdecls in
+ ignore (List.map4 (DeclareDef.declare_fix (local, poly, Fixpoint) pl ctx)
+ fixnames fixdecls fixtypes fiximps);
+ (* Declare the recursive definitions *)
+ fixpoint_message (Some indexes) fixnames;
+ declare_fixpoint_notations ntns
+
+let declare_cofixpoint_notations = declare_fixpoint_notations
+
+let declare_cofixpoint_interactive local poly ((fixnames,fixrs,fixdefs,fixtypes),pl,ctx,fiximps) ntns =
+ (* Some bodies to define by proof *)
+ let thms =
+ List.map3 (fun id t (ctx,imps,_) -> (id,(EConstr.of_constr t,(List.map RelDecl.get_name ctx,imps))))
+ fixnames fixtypes fiximps in
+ let init_tac =
+ Some (List.map (Option.cata (EConstr.of_constr %> Tactics.exact_no_check) Tacticals.New.tclIDTAC)
+ fixdefs) in
+ let evd = Evd.from_ctx ctx in
+ let lemma = Lemmas.start_lemma_with_initialization
+ (Global ImportDefaultBehavior,poly, DefinitionBody CoFixpoint)
+ evd pl (Some(true,[],init_tac)) thms None in
+ declare_cofixpoint_notations ntns;
+ lemma
+
+let declare_cofixpoint local poly ((fixnames,fixrs,fixdefs,fixtypes),pl,ctx,fiximps) ntns =
+ (* We shortcut the proof process *)
+ let fixdefs = List.map Option.get fixdefs in
+ let fixdecls = prepare_recursive_declaration fixnames fixrs fixtypes fixdefs in
+ let fixdecls = List.map_i (fun i _ -> mkCoFix (i,fixdecls)) 0 fixnames in
+ let vars = Vars.universes_of_constr (List.hd fixdecls) in
+ let mk_pure c = (c, Univ.ContextSet.empty), Evd.empty_side_effects in
+ let fixdecls = List.map mk_pure fixdecls in
+ let fiximps = List.map (fun (len,imps,idx) -> imps) fiximps in
+ let evd = Evd.from_ctx ctx in
+ let evd = Evd.restrict_universe_context evd vars in
+ let ctx = Evd.check_univ_decl ~poly evd pl in
+ let pl = Evd.universe_binders evd in
+ ignore (List.map4 (DeclareDef.declare_fix (local, poly, CoFixpoint) pl ctx)
+ fixnames fixdecls fixtypes fiximps);
+ (* Declare the recursive definitions *)
+ cofixpoint_message fixnames;
+ declare_cofixpoint_notations ntns
let extract_decreasing_argument ~structonly = function { CAst.v = v } -> match v with
| CStructRec na -> na
| (CWfRec (na,_) | CMeasureRec (Some na,_,_)) when not structonly -> na
| CMeasureRec (None,_,_) when not structonly ->
- user_err Pp.(str "Decreasing argument must be specificed in measure clause.")
+ user_err Pp.(str "Decreasing argument must be specified in measure clause.")
| _ -> user_err Pp.(str
"Well-founded induction requires Program Fixpoint or Function.")
@@ -366,18 +367,33 @@ let check_safe () =
let flags = Environ.typing_flags (Global.env ()) in
flags.check_universes && flags.check_guarded
-let do_fixpoint ~ontop local poly l =
+let do_fixpoint_common l =
let fixl, ntns = extract_fixpoint_components ~structonly:true l in
let (_, _, _, info as fix) = interp_fixpoint ~cofix:false fixl ntns in
- let possible_indexes =
- List.map compute_possible_guardness_evidences info in
- let pstate = declare_fixpoint ~ontop local poly fix possible_indexes ntns in
+ fixl, ntns, fix, List.map compute_possible_guardness_evidences info
+
+let do_fixpoint_interactive local poly l =
+ let fixl, ntns, fix, possible_indexes = do_fixpoint_common l in
+ let pstate = declare_fixpoint_interactive local poly fix possible_indexes ntns in
if not (check_safe ()) then Feedback.feedback Feedback.AddedAxiom else ();
pstate
-let do_cofixpoint ~ontop local poly l =
+let do_fixpoint local poly l =
+ let fixl, ntns, fix, possible_indexes = do_fixpoint_common l in
+ declare_fixpoint local poly fix possible_indexes ntns;
+ if not (check_safe ()) then Feedback.feedback Feedback.AddedAxiom else ()
+
+let do_cofixpoint_common l =
let fixl,ntns = extract_cofixpoint_components l in
- let cofix = interp_fixpoint ~cofix:true fixl ntns in
- let pstate = declare_cofixpoint ~ontop local poly cofix ntns in
+ ntns, interp_fixpoint ~cofix:true fixl ntns
+
+let do_cofixpoint_interactive local poly l =
+ let ntns, cofix = do_cofixpoint_common l in
+ let pstate = declare_cofixpoint_interactive local poly cofix ntns in
if not (check_safe ()) then Feedback.feedback Feedback.AddedAxiom else ();
pstate
+
+let do_cofixpoint local poly l =
+ let ntns, cofix = do_cofixpoint_common l in
+ declare_cofixpoint local poly cofix ntns;
+ if not (check_safe ()) then Feedback.feedback Feedback.AddedAxiom else ()
diff --git a/vernac/comFixpoint.mli b/vernac/comFixpoint.mli
index 5937842f17..b42e877d41 100644
--- a/vernac/comFixpoint.mli
+++ b/vernac/comFixpoint.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -18,15 +18,17 @@ open Vernacexpr
(** Entry points for the vernacular commands Fixpoint and CoFixpoint *)
+val do_fixpoint_interactive :
+ locality -> polymorphic -> (fixpoint_expr * decl_notation list) list -> Lemmas.t
+
val do_fixpoint :
- ontop:Proof_global.t option ->
- (* When [false], assume guarded. *)
- locality -> polymorphic -> (fixpoint_expr * decl_notation list) list -> Proof_global.t option
+ locality -> polymorphic -> (fixpoint_expr * decl_notation list) list -> unit
+
+val do_cofixpoint_interactive :
+ locality -> polymorphic -> (cofixpoint_expr * decl_notation list) list -> Lemmas.t
val do_cofixpoint :
- ontop:Proof_global.t option ->
- (* When [false], assume guarded. *)
- locality -> polymorphic -> (cofixpoint_expr * decl_notation list) list -> Proof_global.t option
+ locality -> polymorphic -> (cofixpoint_expr * decl_notation list) list -> unit
(************************************************************************)
(** Internal API *)
@@ -55,7 +57,7 @@ val interp_recursive :
(* names / defs / types *)
(Id.t list * Sorts.relevance list * EConstr.constr option list * EConstr.types list) *
(* ctx per mutual def / implicits / struct annotations *)
- (EConstr.rel_context * Impargs.manual_explicitation list * int option) list
+ (EConstr.rel_context * Impargs.manual_implicits * int option) list
(** Exported for Funind *)
@@ -83,20 +85,17 @@ val interp_fixpoint :
(** [Not used so far] *)
val declare_fixpoint :
- ontop:Proof_global.t option ->
locality -> polymorphic ->
recursive_preentry * UState.universe_decl * UState.t *
(Constr.rel_context * Impargs.manual_implicits * int option) list ->
- Proof_global.lemma_possible_guards -> decl_notation list ->
- Proof_global.t option
+ Lemmas.lemma_possible_guards -> decl_notation list ->
+ unit
val declare_cofixpoint :
- ontop:Proof_global.t option ->
locality -> polymorphic ->
recursive_preentry * UState.universe_decl * UState.t *
(Constr.rel_context * Impargs.manual_implicits * int option) list ->
- decl_notation list ->
- Proof_global.t option
+ decl_notation list -> unit
(** Very private function, do not use *)
val compute_possible_guardness_evidences :
diff --git a/vernac/comInductive.ml b/vernac/comInductive.ml
index 977e804da2..363ba5beff 100644
--- a/vernac/comInductive.ml
+++ b/vernac/comInductive.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -121,7 +121,7 @@ let mk_mltype_data sigma env assums arity indname =
let rec check_anonymous_type ind =
let open Glob_term in
match DAst.get ind with
- | GSort (GType []) -> true
+ | GSort (UAnonymous {rigid=true}) -> true
| GProd ( _, _, _, e)
| GLetIn (_, _, _, e)
| GLambda (_, _, _, e)
@@ -375,8 +375,7 @@ let interp_mutual_inductive_gen env0 ~template udecl (uparamsl,paramsl,indl) not
let env_ar_params = EConstr.push_rel_context ctx_params env_ar in
(* Compute interpretation metadatas *)
- let indimpls = List.map (fun impls -> userimpls @
- lift_implicits (Context.Rel.nhyps ctx_params) impls) indimpls in
+ let indimpls = List.map (fun impls -> userimpls @ impls) indimpls in
let impls = compute_internalization_env env_uparams sigma ~impls (Inductive (params,true)) indnames fullarities indimpls in
let ntn_impls = compute_internalization_env env_uparams sigma (Inductive (params,true)) indnames fullarities indimpls in
let mldatas = List.map2 (mk_mltype_data sigma env_params params) arities indnames in
@@ -402,8 +401,8 @@ let interp_mutual_inductive_gen env0 ~template udecl (uparamsl,paramsl,indl) not
constructors
in
let ctx_params = ctx_params @ ctx_uparams in
- let userimpls = useruimpls @ (lift_implicits (Context.Rel.nhyps ctx_uparams) userimpls) in
- let indimpls = List.map (fun iimpl -> useruimpls @ (lift_implicits (Context.Rel.nhyps ctx_uparams) iimpl)) indimpls in
+ let userimpls = useruimpls @ userimpls in
+ let indimpls = List.map (fun iimpl -> useruimpls @ iimpl) indimpls in
let fullarities = List.map (fun c -> EConstr.it_mkProd_or_LetIn c ctx_uparams) fullarities in
let env_ar = push_types env0 indnames relevances fullarities in
let env_ar_params = EConstr.push_rel_context ctx_params env_ar in
@@ -450,10 +449,9 @@ let interp_mutual_inductive_gen env0 ~template udecl (uparamsl,paramsl,indl) not
indl arities arityconcl constructors
in
let impls =
- let len = Context.Rel.nhyps ctx_params in
List.map2 (fun indimpls (_,_,cimpls) ->
indimpls, List.map (fun impls ->
- userimpls @ (lift_implicits len impls)) cimpls) indimpls constructors
+ userimpls @ impls) cimpls) indimpls constructors
in
let variance = if poly && cum then Some (InferCumulativity.dummy_variance uctx) else None in
(* Build the mutual inductive entry *)
@@ -495,7 +493,7 @@ let extract_params indl =
let extract_inductive indl =
List.map (fun ({CAst.v=indname},_,ar,lc) -> {
ind_name = indname;
- ind_arity = Option.cata (fun x -> x) (CAst.make @@ CSort (Glob_term.GType [])) ar;
+ ind_arity = Option.cata (fun x -> x) (CAst.make @@ CSort (Glob_term.UAnonymous {rigid=true})) ar;
ind_lc = List.map (fun (_,({CAst.v=id},t)) -> (id,t)) lc
}) indl
@@ -559,8 +557,8 @@ let declare_mutual_inductive_with_eliminations ?(primitive_expected=false) mie p
mind
type one_inductive_impls =
- Impargs.manual_explicitation list (* for inds *)*
- Impargs.manual_explicitation list list (* for constrs *)
+ Impargs.manual_implicits (* for inds *) *
+ Impargs.manual_implicits list (* for constrs *)
type uniform_inductive_flag =
| UniformParameters
diff --git a/vernac/comInductive.mli b/vernac/comInductive.mli
index 224cce67ad..2d6ecf48ef 100644
--- a/vernac/comInductive.mli
+++ b/vernac/comInductive.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/comProgramFixpoint.ml b/vernac/comProgramFixpoint.ml
index 69e2a209eb..6c1c23eacb 100644
--- a/vernac/comProgramFixpoint.ml
+++ b/vernac/comProgramFixpoint.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -13,7 +13,6 @@ open CErrors
open Util
open Constr
open Context
-open Entries
open Vars
open Declare
open Names
@@ -229,7 +228,7 @@ let build_wellfounded (recname,pl,bl,arityc,body) poly r measure notation =
in hook, recname, typ
in
(* XXX: Capturing sigma here... bad bad *)
- let hook = Lemmas.mk_hook (hook sigma) in
+ let hook = DeclareDef.Hook.make (hook sigma) in
Obligations.check_evars env sigma;
let evars, _, evars_def, evars_typ =
Obligations.eterm_obligations env recname sigma 0 def typ
@@ -248,7 +247,7 @@ let collect_evars_of_term evd c ty =
evars (Evd.from_ctx (Evd.evar_universe_context evd))
let do_program_recursive local poly fixkind fixl ntns =
- let cofix = fixkind = Obligations.IsCoFixpoint in
+ let cofix = fixkind = DeclareObl.IsCoFixpoint in
let (env, rec_sign, pl, evd), fix, info =
interp_recursive ~cofix ~program_mode:true fixl ntns
in
@@ -289,8 +288,8 @@ let do_program_recursive local poly fixkind fixl ntns =
end in
let ctx = Evd.evar_universe_context evd in
let kind = match fixkind with
- | Obligations.IsFixpoint _ -> (local, poly, Fixpoint)
- | Obligations.IsCoFixpoint -> (local, poly, CoFixpoint)
+ | DeclareObl.IsFixpoint _ -> (local, poly, Fixpoint)
+ | DeclareObl.IsCoFixpoint -> (local, poly, CoFixpoint)
in
Obligations.add_mutual_definitions defs ~kind ~univdecl:pl ctx ntns fixkind
@@ -316,7 +315,7 @@ let do_program_fixpoint local poly l =
| _, _ when List.for_all (fun ro -> match ro with None | Some { CAst.v = CStructRec _} -> true | _ -> false) g ->
let fixl,ntns = extract_fixpoint_components ~structonly:true l in
- let fixkind = Obligations.IsFixpoint (List.map (fun d -> d.fix_annot) fixl) in
+ let fixkind = DeclareObl.IsFixpoint (List.map (fun d -> d.fix_annot) fixl) in
do_program_recursive local poly fixkind fixl ntns
| _, _ ->
@@ -341,5 +340,5 @@ let do_fixpoint local poly l =
let do_cofixpoint local poly l =
let fixl,ntns = extract_cofixpoint_components l in
- do_program_recursive local poly Obligations.IsCoFixpoint fixl ntns;
+ do_program_recursive local poly DeclareObl.IsCoFixpoint fixl ntns;
if not (check_safe ()) then Feedback.feedback Feedback.AddedAxiom else ()
diff --git a/vernac/declareDef.ml b/vernac/declareDef.ml
index bdda3314ca..a467c22ede 100644
--- a/vernac/declareDef.ml
+++ b/vernac/declareDef.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -10,31 +10,39 @@
open Decl_kinds
open Declare
-open Entries
open Globnames
open Impargs
-let warn_local_declaration =
- CWarnings.create ~name:"local-declaration" ~category:"scope"
- Pp.(fun (id,kind) ->
- Names.Id.print id ++ strbrk " is declared as a local " ++ str kind)
+(* Hooks naturally belong here as they apply to both definitions and lemmas *)
+module Hook = struct
+ module S = struct
+ type t = UState.t
+ -> (Names.Id.t * Constr.t) list
+ -> Decl_kinds.locality
+ -> Names.GlobRef.t
+ -> unit
+ end
-let get_locality id ~kind = function
-| Discharge ->
- (* If a Let is defined outside a section, then we consider it as a local definition *)
- warn_local_declaration (id,kind);
- true
-| Local -> true
-| Global -> false
+ type t = S.t CEphemeron.key
+ let make hook = CEphemeron.create hook
+
+ let call ?hook ?fix_exn uctx trans l c =
+ try Option.iter (fun hook -> CEphemeron.get hook uctx trans l c) hook
+ with e when CErrors.noncritical e ->
+ let e = CErrors.push e in
+ let e = Option.cata (fun fix -> fix e) e fix_exn in
+ Util.iraise e
+end
+
+(* Locality stuff *)
let declare_definition ident (local, p, k) ?hook_data ce pl imps =
- let fix_exn = Future.fix_exn_of ce.const_entry_body in
+ let fix_exn = Future.fix_exn_of ce.Proof_global.proof_entry_body in
let gr = match local with
- | Discharge when Lib.sections_are_opened () ->
+ | Discharge ->
let _ = declare_variable ident (Lib.cwd(), SectionLocalDef ce, IsDefinition k) in
VarRef ident
- | Discharge | Local | Global ->
- let local = get_locality ident ~kind:"definition" local in
+ | Global local ->
let kn = declare_constant ident ~local (DefinitionEntry ce, IsDefinition k) in
let gr = ConstRef kn in
let () = Declare.declare_univ_binders gr pl in
@@ -46,7 +54,7 @@ let declare_definition ident (local, p, k) ?hook_data ce pl imps =
match hook_data with
| None -> ()
| Some (hook, uctx, extra_defs) ->
- Lemmas.call_hook ~fix_exn ~hook uctx extra_defs local gr
+ Hook.call ~fix_exn ~hook uctx extra_defs local gr
end;
gr
diff --git a/vernac/declareDef.mli b/vernac/declareDef.mli
index c4500d0a6b..ac4f44608b 100644
--- a/vernac/declareDef.mli
+++ b/vernac/declareDef.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -11,25 +11,51 @@
open Names
open Decl_kinds
-val get_locality : Id.t -> kind:string -> Decl_kinds.locality -> bool
+(** Declaration hooks *)
+module Hook : sig
+ type t
+
+ (** Hooks allow users of the API to perform arbitrary actions at
+ proof/definition saving time. For example, to register a constant
+ as a Coercion, perform some cleanup, update the search database,
+ etc... *)
+ module S : sig
+ (** [S.t] passes to the client: *)
+ type t
+ = UState.t
+ (** [ustate]: universe constraints obtained when the term was closed *)
+ -> (Id.t * Constr.t) list
+ (** [(n1,t1),...(nm,tm)]: association list between obligation
+ name and the corresponding defined term (might be a constant,
+ but also an arbitrary term in the Expand case of obligations) *)
+ -> Decl_kinds.locality
+ (** [locality]: Locality of the original declaration *)
+ -> GlobRef.t
+ (** [ref]: identifier of the origianl declaration *)
+ -> unit
+ end
+
+ val make : S.t -> t
+ val call : ?hook:t -> ?fix_exn:Future.fix_exn -> S.t
+end
val declare_definition
: Id.t
-> definition_kind
- -> ?hook_data:(Lemmas.declaration_hook * UState.t * (Id.t * Constr.t) list)
- -> Safe_typing.private_constants Entries.definition_entry
+ -> ?hook_data:(Hook.t * UState.t * (Id.t * Constr.t) list)
+ -> Evd.side_effects Proof_global.proof_entry
-> UnivNames.universe_binders
-> Impargs.manual_implicits
-> GlobRef.t
val declare_fix
: ?opaque:bool
- -> ?hook_data:(Lemmas.declaration_hook * UState.t * (Id.t * Constr.t) list)
+ -> ?hook_data:(Hook.t * UState.t * (Id.t * Constr.t) list)
-> definition_kind
-> UnivNames.universe_binders
-> Entries.universes_entry
-> Id.t
- -> Safe_typing.private_constants Entries.proof_output
+ -> Evd.side_effects Entries.proof_output
-> Constr.types
-> Impargs.manual_implicits
-> GlobRef.t
@@ -38,7 +64,7 @@ val prepare_definition : allow_evars:bool ->
?opaque:bool -> ?inline:bool -> poly:bool ->
Evd.evar_map -> UState.universe_decl ->
types:EConstr.t option -> body:EConstr.t ->
- Evd.evar_map * Safe_typing.private_constants Entries.definition_entry
+ Evd.evar_map * Evd.side_effects Proof_global.proof_entry
val prepare_parameter : allow_evars:bool ->
poly:bool -> Evd.evar_map -> UState.universe_decl -> EConstr.types ->
diff --git a/vernac/declareObl.ml b/vernac/declareObl.ml
new file mode 100644
index 0000000000..4936c9838d
--- /dev/null
+++ b/vernac/declareObl.ml
@@ -0,0 +1,562 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+
+open Util
+open Names
+open Environ
+open Context
+open Constr
+open Vars
+open Decl_kinds
+open Entries
+
+type 'a obligation_body = DefinedObl of 'a | TermObl of constr
+
+type obligation =
+ { obl_name : Id.t
+ ; obl_type : types
+ ; obl_location : Evar_kinds.t Loc.located
+ ; obl_body : pconstant obligation_body option
+ ; obl_status : bool * Evar_kinds.obligation_definition_status
+ ; obl_deps : Int.Set.t
+ ; obl_tac : unit Proofview.tactic option }
+
+type obligations = obligation array * int
+
+type notations =
+ (lstring * Constrexpr.constr_expr * Notation_term.scope_name option) list
+
+type fixpoint_kind =
+ | IsFixpoint of lident option list
+ | IsCoFixpoint
+
+type program_info =
+ { prg_name : Id.t
+ ; prg_body : constr
+ ; prg_type : constr
+ ; prg_ctx : UState.t
+ ; prg_univdecl : UState.universe_decl
+ ; prg_obligations : obligations
+ ; prg_deps : Id.t list
+ ; prg_fixkind : fixpoint_kind option
+ ; prg_implicits : Impargs.manual_implicits
+ ; prg_notations : notations
+ ; prg_kind : definition_kind
+ ; prg_reduce : constr -> constr
+ ; prg_hook : DeclareDef.Hook.t option
+ ; prg_opaque : bool
+ ; prg_sign : named_context_val }
+
+(* Saving an obligation *)
+
+let get_shrink_obligations =
+ Goptions.declare_bool_option_and_ref ~depr:true (* remove in 8.8 *)
+ ~name:"Shrinking of Program obligations" ~key:["Shrink"; "Obligations"]
+ ~value:true
+
+(* XXX: Is this the right place for this? *)
+let it_mkLambda_or_LetIn_or_clean t ctx =
+ let open Context.Rel.Declaration in
+ let fold t decl =
+ if is_local_assum decl then Term.mkLambda_or_LetIn decl t
+ else if noccurn 1 t then subst1 mkProp t
+ else Term.mkLambda_or_LetIn decl t
+ in
+ Context.Rel.fold_inside fold ctx ~init:t
+
+(* XXX: Is this the right place for this? *)
+let decompose_lam_prod c ty =
+ let open Context.Rel.Declaration in
+ let rec aux ctx c ty =
+ match (Constr.kind c, Constr.kind ty) with
+ | LetIn (x, b, t, c), LetIn (x', b', t', ty)
+ when Constr.equal b b' && Constr.equal t t' ->
+ let ctx' = Context.Rel.add (LocalDef (x, b', t')) ctx in
+ aux ctx' c ty
+ | _, LetIn (x', b', t', ty) ->
+ let ctx' = Context.Rel.add (LocalDef (x', b', t')) ctx in
+ aux ctx' (lift 1 c) ty
+ | LetIn (x, b, t, c), _ ->
+ let ctx' = Context.Rel.add (LocalDef (x, b, t)) ctx in
+ aux ctx' c (lift 1 ty)
+ | Lambda (x, b, t), Prod (x', b', t')
+ (* By invariant, must be convertible *) ->
+ let ctx' = Context.Rel.add (LocalAssum (x, b')) ctx in
+ aux ctx' t t'
+ | Cast (c, _, _), _ -> aux ctx c ty
+ | _, _ -> (ctx, c, ty)
+ in
+ aux Context.Rel.empty c ty
+
+(* XXX: What's the relation of this with Abstract.shrink ? *)
+let shrink_body c ty =
+ let ctx, b, ty =
+ match ty with
+ | None ->
+ let ctx, b = Term.decompose_lam_assum c in
+ (ctx, b, None)
+ | Some ty ->
+ let ctx, b, ty = decompose_lam_prod c ty in
+ (ctx, b, Some ty)
+ in
+ let b', ty', n, args =
+ List.fold_left
+ (fun (b, ty, i, args) decl ->
+ if noccurn 1 b && Option.cata (noccurn 1) true ty then
+ (subst1 mkProp b, Option.map (subst1 mkProp) ty, succ i, args)
+ else
+ let open Context.Rel.Declaration in
+ let args = if is_local_assum decl then mkRel i :: args else args in
+ ( Term.mkLambda_or_LetIn decl b
+ , Option.map (Term.mkProd_or_LetIn decl) ty
+ , succ i
+ , args ) )
+ (b, ty, 1, []) ctx
+ in
+ (ctx, b', ty', Array.of_list args)
+
+let unfold_entry cst = Hints.HintsUnfoldEntry [EvalConstRef cst]
+
+let add_hint local prg cst =
+ Hints.add_hints ~local [Id.to_string prg.prg_name] (unfold_entry cst)
+
+(***********************************************************************)
+(* Saving an obligation *)
+(***********************************************************************)
+
+(* true = hide obligations *)
+let get_hide_obligations =
+ Goptions.declare_bool_option_and_ref
+ ~depr:false
+ ~name:"Hidding of Program obligations"
+ ~key:["Hide"; "Obligations"]
+ ~value:false
+
+let declare_obligation prg obl body ty uctx =
+ let body = prg.prg_reduce body in
+ let ty = Option.map prg.prg_reduce ty in
+ match obl.obl_status with
+ | _, Evar_kinds.Expand -> (false, {obl with obl_body = Some (TermObl body)})
+ | force, Evar_kinds.Define opaque ->
+ let opaque = (not force) && opaque in
+ let poly = pi2 prg.prg_kind in
+ let ctx, body, ty, args =
+ if get_shrink_obligations () && not poly then shrink_body body ty
+ else ([], body, ty, [||])
+ in
+ let body =
+ ((body, Univ.ContextSet.empty), Evd.empty_side_effects)
+ in
+ let ce =
+ Proof_global.{ proof_entry_body = Future.from_val ~fix_exn:(fun x -> x) body
+ ; proof_entry_secctx = None
+ ; proof_entry_type = ty
+ ; proof_entry_universes = uctx
+ ; proof_entry_opaque = opaque
+ ; proof_entry_inline_code = false
+ ; proof_entry_feedback = None }
+ in
+ (* ppedrot: seems legit to have obligations as local *)
+ let constant =
+ Declare.declare_constant obl.obl_name ~local:ImportNeedQualified
+ (Declare.DefinitionEntry ce, IsProof Property)
+ in
+ if not opaque then
+ add_hint (Locality.make_section_locality None) prg constant;
+ Declare.definition_message obl.obl_name;
+ let body =
+ match uctx with
+ | Polymorphic_entry (_, uctx) ->
+ Some (DefinedObl (constant, Univ.UContext.instance uctx))
+ | Monomorphic_entry _ ->
+ Some
+ (TermObl
+ (it_mkLambda_or_LetIn_or_clean
+ (mkApp (mkConst constant, args))
+ ctx))
+ in
+ (true, {obl with obl_body = body})
+
+(* Updating the obligation meta-info on close *)
+
+let not_transp_msg =
+ Pp.(
+ str "Obligation should be transparent but was declared opaque."
+ ++ spc ()
+ ++ str "Use 'Defined' instead.")
+
+let pperror cmd = CErrors.user_err ~hdr:"Program" cmd
+let err_not_transp () = pperror not_transp_msg
+
+module ProgMap = Id.Map
+
+let from_prg, program_tcc_summary_tag =
+ Summary.ref_tag ProgMap.empty ~name:"program-tcc-table"
+
+(* In all cases, the use of the map is read-only so we don't expose the ref *)
+let get_prg_info_map () = !from_prg
+
+let map_keys m = ProgMap.fold (fun k _ l -> k :: l) m []
+
+let close sec =
+ if not (ProgMap.is_empty !from_prg) then
+ let keys = map_keys !from_prg in
+ CErrors.user_err ~hdr:"Program"
+ Pp.(
+ str "Unsolved obligations when closing "
+ ++ str sec ++ str ":" ++ spc ()
+ ++ prlist_with_sep spc (fun x -> Id.print x) keys
+ ++ ( str (if Int.equal (List.length keys) 1 then " has " else " have ")
+ ++ str "unsolved obligations" ))
+
+let input : program_info CEphemeron.key ProgMap.t -> Libobject.obj =
+ let open Libobject in
+ declare_object
+ { (default_object "Program state") with
+ cache_function = (fun (na, pi) -> from_prg := pi)
+ ; load_function = (fun _ (_, pi) -> from_prg := pi)
+ ; discharge_function =
+ (fun _ ->
+ close "section";
+ None )
+ ; classify_function =
+ (fun _ ->
+ close "module";
+ Dispose ) }
+
+let map_replace k v m =
+ ProgMap.add k (CEphemeron.create v) (ProgMap.remove k m)
+
+let progmap_remove prg =
+ Lib.add_anonymous_leaf (input (ProgMap.remove prg.prg_name !from_prg))
+
+let progmap_add n prg =
+ Lib.add_anonymous_leaf (input (ProgMap.add n prg !from_prg))
+
+let progmap_replace prg' =
+ Lib.add_anonymous_leaf (input (map_replace prg'.prg_name prg' !from_prg))
+
+let obligations_solved prg = Int.equal (snd prg.prg_obligations) 0
+
+let obligations_message rem =
+ if rem > 0 then
+ if Int.equal rem 1 then
+ Flags.if_verbose Feedback.msg_info
+ Pp.(int rem ++ str " obligation remaining")
+ else
+ Flags.if_verbose Feedback.msg_info
+ Pp.(int rem ++ str " obligations remaining")
+ else
+ Flags.if_verbose Feedback.msg_info Pp.(str "No more obligations remaining")
+
+type progress = Remain of int | Dependent | Defined of GlobRef.t
+
+let get_obligation_body expand obl =
+ match obl.obl_body with
+ | None -> None
+ | Some c -> (
+ if expand && snd obl.obl_status == Evar_kinds.Expand then
+ match c with
+ | DefinedObl pc -> Some (constant_value_in (Global.env ()) pc)
+ | TermObl c -> Some c
+ else
+ match c with DefinedObl pc -> Some (mkConstU pc) | TermObl c -> Some c )
+
+let obl_substitution expand obls deps =
+ Int.Set.fold
+ (fun x acc ->
+ let xobl = obls.(x) in
+ match get_obligation_body expand xobl with
+ | None -> acc
+ | Some oblb -> (xobl.obl_name, (xobl.obl_type, oblb)) :: acc )
+ deps []
+
+let rec intset_to = function
+ | -1 -> Int.Set.empty
+ | n -> Int.Set.add n (intset_to (pred n))
+
+let obligation_substitution expand prg =
+ let obls, _ = prg.prg_obligations in
+ let ints = intset_to (pred (Array.length obls)) in
+ obl_substitution expand obls ints
+
+let hide_obligation () =
+ Coqlib.check_required_library ["Coq"; "Program"; "Tactics"];
+ UnivGen.constr_of_monomorphic_global
+ (Coqlib.lib_ref "program.tactics.obligation")
+
+(* XXX: Is this the right place? *)
+let rec prod_app t n =
+ match
+ Constr.kind
+ (EConstr.Unsafe.to_constr
+ (Termops.strip_outer_cast Evd.empty (EConstr.of_constr t)))
+ (* FIXME *)
+ with
+ | Prod (_, _, b) -> subst1 n b
+ | LetIn (_, b, t, b') -> prod_app (subst1 b b') n
+ | _ ->
+ CErrors.user_err ~hdr:"prod_app"
+ Pp.(str "Needed a product, but didn't find one" ++ fnl ())
+
+(* prod_appvect T [| a1 ; ... ; an |] -> (T a1 ... an) *)
+let prod_applist t nL = List.fold_left prod_app t nL
+
+let replace_appvars subst =
+ let rec aux c =
+ let f, l = decompose_app c in
+ if isVar f then
+ try
+ let c' = List.map (Constr.map aux) l in
+ let t, b = Id.List.assoc (destVar f) subst in
+ mkApp
+ ( delayed_force hide_obligation
+ , [|prod_applist t c'; Term.applistc b c'|] )
+ with Not_found -> Constr.map aux c
+ else Constr.map aux c
+ in
+ Constr.map aux
+
+let subst_prog subst prg =
+ if get_hide_obligations () then
+ ( replace_appvars subst prg.prg_body
+ , replace_appvars subst (* Termops.refresh_universes *) prg.prg_type )
+ else
+ let subst' = List.map (fun (n, (_, b)) -> (n, b)) subst in
+ ( Vars.replace_vars subst' prg.prg_body
+ , Vars.replace_vars subst' (* Termops.refresh_universes *) prg.prg_type )
+
+let get_fix_exn, stm_get_fix_exn = Hook.make ()
+
+let declare_definition prg =
+ let varsubst = obligation_substitution true prg in
+ let body, typ = subst_prog varsubst prg in
+ let nf =
+ UnivSubst.nf_evars_and_universes_opt_subst
+ (fun x -> None)
+ (UState.subst prg.prg_ctx)
+ in
+ let opaque = prg.prg_opaque in
+ let fix_exn = Hook.get get_fix_exn () in
+ let typ = nf typ in
+ let body = nf body in
+ let obls = List.map (fun (id, (_, c)) -> (id, nf c)) varsubst in
+ let uvars =
+ Univ.LSet.union
+ (Vars.universes_of_constr typ)
+ (Vars.universes_of_constr body)
+ in
+ let uctx = UState.restrict prg.prg_ctx uvars in
+ let univs =
+ UState.check_univ_decl ~poly:(pi2 prg.prg_kind) uctx prg.prg_univdecl
+ in
+ let ce = Declare.definition_entry ~fix_exn ~opaque ~types:typ ~univs body in
+ let () = progmap_remove prg in
+ let ubinders = UState.universe_binders uctx in
+ let hook_data = Option.map (fun hook -> hook, uctx, obls) prg.prg_hook in
+ DeclareDef.declare_definition prg.prg_name prg.prg_kind ce ubinders
+ prg.prg_implicits ?hook_data
+
+let rec lam_index n t acc =
+ match Constr.kind t with
+ | Lambda ({binder_name=Name n'}, _, _) when Id.equal n n' -> acc
+ | Lambda (_, _, b) -> lam_index n b (succ acc)
+ | _ -> raise Not_found
+
+let compute_possible_guardness_evidences n fixbody fixtype =
+ match n with
+ | Some {CAst.loc; v = n} -> [lam_index n fixbody 0]
+ | None ->
+ (* If recursive argument was not given by user, we try all args.
+ An earlier approach was to look only for inductive arguments,
+ but doing it properly involves delta-reduction, and it finally
+ doesn't seem to worth the effort (except for huge mutual
+ fixpoints ?) *)
+ let m =
+ Termops.nb_prod Evd.empty (EConstr.of_constr fixtype)
+ (* FIXME *)
+ in
+ let ctx = fst (Term.decompose_prod_n_assum m fixtype) in
+ List.map_i (fun i _ -> i) 0 ctx
+
+let mk_proof c =
+ ((c, Univ.ContextSet.empty), Evd.empty_side_effects)
+
+let declare_mutual_definition l =
+ let len = List.length l in
+ let first = List.hd l in
+ let defobl x =
+ let oblsubst = obligation_substitution true x in
+ let subs, typ = subst_prog oblsubst x in
+ let env = Global.env () in
+ let sigma = Evd.from_ctx x.prg_ctx in
+ let r = Retyping.relevance_of_type env sigma (EConstr.of_constr typ) in
+ let term = snd (Reductionops.splay_lam_n env sigma len (EConstr.of_constr subs)) in
+ let typ = snd (Reductionops.splay_prod_n env sigma len (EConstr.of_constr typ)) in
+ let term = EConstr.to_constr sigma term in
+ let typ = EConstr.to_constr sigma typ in
+ let def = (x.prg_reduce term, r, x.prg_reduce typ, x.prg_implicits) in
+ let oblsubst = List.map (fun (id, (_, c)) -> (id, c)) oblsubst in
+ def, oblsubst
+ in
+ let defs, obls =
+ List.fold_right (fun x (defs, obls) ->
+ let xdef, xobls = defobl x in
+ (xdef :: defs, xobls @ obls)) l ([], [])
+ in
+ (* let fixdefs = List.map reduce_fix fixdefs in *)
+ let fixdefs, fixrs,fixtypes, fiximps = List.split4 defs in
+ let fixkind = Option.get first.prg_fixkind in
+ let arrrec, recvec = (Array.of_list fixtypes, Array.of_list fixdefs) in
+ let rvec = Array.of_list fixrs in
+ let namevec = Array.of_list (List.map (fun x -> Name x.prg_name) l) in
+ let fixdecls = (Array.map2 make_annot namevec rvec, arrrec, recvec) in
+ let local, poly, kind = first.prg_kind in
+ let fixnames = first.prg_deps in
+ let opaque = first.prg_opaque in
+ let kind = if fixkind != IsCoFixpoint then Fixpoint else CoFixpoint in
+ let indexes, fixdecls =
+ match fixkind with
+ | IsFixpoint wfl ->
+ let possible_indexes =
+ List.map3 compute_possible_guardness_evidences wfl fixdefs fixtypes
+ in
+ let indexes =
+ Pretyping.search_guard (Global.env ()) possible_indexes fixdecls
+ in
+ ( Some indexes
+ , List.map_i (fun i _ -> mk_proof (mkFix ((indexes, i), fixdecls))) 0 l
+ )
+ | IsCoFixpoint ->
+ (None, List.map_i (fun i _ -> mk_proof (mkCoFix (i, fixdecls))) 0 l)
+ in
+ (* Declare the recursive definitions *)
+ let univs = UState.univ_entry ~poly first.prg_ctx in
+ let fix_exn = Hook.get get_fix_exn () in
+ let kns =
+ List.map4
+ (DeclareDef.declare_fix ~opaque (local, poly, kind)
+ UnivNames.empty_binders univs)
+ fixnames fixdecls fixtypes fiximps
+ in
+ (* Declare notations *)
+ List.iter
+ (Metasyntax.add_notation_interpretation (Global.env ()))
+ first.prg_notations;
+ Declare.recursive_message (fixkind != IsCoFixpoint) indexes fixnames;
+ let gr = List.hd kns in
+ DeclareDef.Hook.call ?hook:first.prg_hook ~fix_exn first.prg_ctx obls local gr;
+ List.iter progmap_remove l;
+ gr
+
+let update_obls prg obls rem =
+ let prg' = {prg with prg_obligations = (obls, rem)} in
+ progmap_replace prg';
+ obligations_message rem;
+ if rem > 0 then Remain rem
+ else
+ match prg'.prg_deps with
+ | [] ->
+ let kn = declare_definition prg' in
+ progmap_remove prg';
+ Defined kn
+ | l ->
+ let progs =
+ List.map
+ (fun x -> CEphemeron.get (ProgMap.find x !from_prg))
+ prg'.prg_deps
+ in
+ if List.for_all (fun x -> obligations_solved x) progs then
+ let kn = declare_mutual_definition progs in
+ Defined kn
+ else Dependent
+
+let dependencies obls n =
+ let res = ref Int.Set.empty in
+ Array.iteri
+ (fun i obl ->
+ if (not (Int.equal i n)) && Int.Set.mem n obl.obl_deps then
+ res := Int.Set.add i !res )
+ obls;
+ !res
+
+type obligation_qed_info =
+ { name : Id.t
+ ; num : int
+ ; auto : Id.t option -> Int.Set.t -> unit Proofview.tactic option -> progress
+ }
+
+let obligation_terminator opq entries uctx { name; num; auto } =
+ let open Proof_global in
+ match entries with
+ | [entry] ->
+ let env = Global.env () in
+ let ty = entry.proof_entry_type in
+ let body, eff = Future.force entry.proof_entry_body in
+ let (body, cstr) = Safe_typing.inline_private_constants env (body, eff.Evd.seff_private) in
+ let sigma = Evd.from_ctx uctx in
+ let sigma = Evd.merge_context_set ~sideff:true Evd.univ_rigid sigma cstr in
+ Inductiveops.control_only_guard (Global.env ()) sigma (EConstr.of_constr body);
+ (* Declare the obligation ourselves and drop the hook *)
+ let prg = CEphemeron.get (ProgMap.find name !from_prg) in
+ (* Ensure universes are substituted properly in body and type *)
+ let body = EConstr.to_constr sigma (EConstr.of_constr body) in
+ let ty = Option.map (fun x -> EConstr.to_constr sigma (EConstr.of_constr x)) ty in
+ let ctx = Evd.evar_universe_context sigma in
+ let obls, rem = prg.prg_obligations in
+ let obl = obls.(num) in
+ let status =
+ match obl.obl_status, opq with
+ | (_, Evar_kinds.Expand), Opaque -> err_not_transp ()
+ | (true, _), Opaque -> err_not_transp ()
+ | (false, _), Opaque -> Evar_kinds.Define true
+ | (_, Evar_kinds.Define true), Transparent ->
+ Evar_kinds.Define false
+ | (_, status), Transparent -> status
+ in
+ let obl = { obl with obl_status = false, status } in
+ let ctx =
+ if pi2 prg.prg_kind then ctx
+ else UState.union prg.prg_ctx ctx
+ in
+ let uctx = UState.univ_entry ~poly:(pi2 prg.prg_kind) ctx in
+ let (defined, obl) = declare_obligation prg obl body ty uctx in
+ let obls = Array.copy obls in
+ let () = obls.(num) <- obl in
+ let prg_ctx =
+ if pi2 (prg.prg_kind) then (* Polymorphic *)
+ (* We merge the new universes and constraints of the
+ polymorphic obligation with the existing ones *)
+ UState.union prg.prg_ctx ctx
+ else
+ (* The first obligation, if defined,
+ declares the univs of the constant,
+ each subsequent obligation declares its own additional
+ universes and constraints if any *)
+ if defined then UState.make (Global.universes ())
+ else ctx
+ in
+ let prg = {prg with prg_ctx} in
+ begin try
+ ignore (update_obls prg obls (pred rem));
+ if pred rem > 0 then
+ let deps = dependencies obls num in
+ if not (Int.Set.is_empty deps) then
+ ignore (auto (Some name) deps None)
+ with e when CErrors.noncritical e ->
+ let e = CErrors.push e in
+ pperror (CErrors.iprint (ExplainErr.process_vernac_interp_error e))
+ end
+ | _ ->
+ CErrors.anomaly
+ Pp.(
+ str
+ "[obligation_terminator] close_proof returned more than one proof \
+ term")
diff --git a/vernac/declareObl.mli b/vernac/declareObl.mli
new file mode 100644
index 0000000000..f4495181b3
--- /dev/null
+++ b/vernac/declareObl.mli
@@ -0,0 +1,114 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+
+open Names
+open Constr
+
+type 'a obligation_body = DefinedObl of 'a | TermObl of constr
+
+type obligation =
+ { obl_name : Id.t
+ ; obl_type : types
+ ; obl_location : Evar_kinds.t Loc.located
+ ; obl_body : pconstant obligation_body option
+ ; obl_status : bool * Evar_kinds.obligation_definition_status
+ ; obl_deps : Int.Set.t
+ ; obl_tac : unit Proofview.tactic option }
+
+type obligations = obligation array * int
+
+type notations =
+ (lstring * Constrexpr.constr_expr * Notation_term.scope_name option) list
+
+type fixpoint_kind =
+ | IsFixpoint of lident option list
+ | IsCoFixpoint
+
+type program_info =
+ { prg_name : Id.t
+ ; prg_body : constr
+ ; prg_type : constr
+ ; prg_ctx : UState.t
+ ; prg_univdecl : UState.universe_decl
+ ; prg_obligations : obligations
+ ; prg_deps : Id.t list
+ ; prg_fixkind : fixpoint_kind option
+ ; prg_implicits : Impargs.manual_implicits
+ ; prg_notations : notations
+ ; prg_kind : Decl_kinds.definition_kind
+ ; prg_reduce : constr -> constr
+ ; prg_hook : DeclareDef.Hook.t option
+ ; prg_opaque : bool
+ ; prg_sign : Environ.named_context_val }
+
+val declare_obligation :
+ program_info
+ -> obligation
+ -> Constr.types
+ -> Constr.types option
+ -> Entries.universes_entry
+ -> bool * obligation
+(** [declare_obligation] Save an obligation *)
+
+module ProgMap : CMap.ExtS with type key = Id.t and module Set := Id.Set
+
+val declare_definition : program_info -> Names.GlobRef.t
+
+type progress =
+ (* Resolution status of a program *)
+ | Remain of int
+ (* n obligations remaining *)
+ | Dependent
+ (* Dependent on other definitions *)
+ | Defined of GlobRef.t
+ (* Defined as id *)
+
+type obligation_qed_info =
+ { name : Id.t
+ ; num : int
+ ; auto : Id.t option -> Int.Set.t -> unit Proofview.tactic option -> progress
+ }
+
+val obligation_terminator
+ : Proof_global.opacity_flag
+ -> Evd.side_effects Proof_global.proof_entry list
+ -> UState.t
+ -> obligation_qed_info -> unit
+(** [obligation_terminator] part 2 of saving an obligation *)
+
+val update_obls :
+ program_info
+ -> obligation array
+ -> int
+ -> progress
+(** [update_obls prg obls n progress] What does this do? *)
+
+(** { 2 Util } *)
+
+val get_prg_info_map : unit -> program_info CEphemeron.key ProgMap.t
+
+val program_tcc_summary_tag :
+ program_info CEphemeron.key Id.Map.t Summary.Dyn.tag
+
+val obl_substitution :
+ bool
+ -> obligation array
+ -> Int.Set.t
+ -> (ProgMap.key * (Constr.types * Constr.types)) list
+
+val dependencies : obligation array -> int -> Int.Set.t
+
+val err_not_transp : unit -> unit
+val progmap_add : ProgMap.key -> program_info CEphemeron.key -> unit
+
+(* This is a hack to make it possible for Obligations to craft a Qed
+ * behind the scenes. The fix_exn the Stm attaches to the Future proof
+ * is not available here, so we provide a side channel to get it *)
+val stm_get_fix_exn : (unit -> Exninfo.iexn -> Exninfo.iexn) Hook.t
diff --git a/vernac/egramcoq.ml b/vernac/egramcoq.ml
index 568e5b9997..c9d9b65e04 100644
--- a/vernac/egramcoq.ml
+++ b/vernac/egramcoq.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -546,6 +546,15 @@ let extend_constr state forpat ng =
let constr_levels = GramState.field ()
+let is_disjunctive_pattern_rule ng =
+ String.is_sub "( _ | " (snd ng.notgram_notation) 0
+
+let warn_disj_pattern_notation =
+ let open Pp in
+ let pp ng = str "Use of " ++ Notation.pr_notation ng.notgram_notation ++
+ str " Notation is deprecated as it is inconsistent with pattern syntax." in
+ CWarnings.create ~name:"disj-pattern-notation" ~category:"notation" ~default:CWarnings.Disabled pp
+
let extend_constr_notation ng state =
let levels = match GramState.get state constr_levels with
| None -> String.Map.add "constr" default_constr_levels String.Map.empty
@@ -553,8 +562,13 @@ let extend_constr_notation ng state =
in
(* Add the notation in constr *)
let (r, levels) = extend_constr levels ForConstr ng in
- (* Add the notation in cases_pattern *)
- let (r', levels) = extend_constr levels ForPattern ng in
+ (* Add the notation in cases_pattern, unless it would disrupt *)
+ (* parsing nested disjunctive patterns. *)
+ let (r', levels) =
+ if is_disjunctive_pattern_rule ng then begin
+ warn_disj_pattern_notation ng;
+ ([], levels)
+ end else extend_constr levels ForPattern ng in
let state = GramState.set state constr_levels levels in
(r @ r', state)
diff --git a/vernac/egramcoq.mli b/vernac/egramcoq.mli
index 3a6f8ae015..f879d51660 100644
--- a/vernac/egramcoq.mli
+++ b/vernac/egramcoq.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/egramml.ml b/vernac/egramml.ml
index bc58993a2e..62eb561f3c 100644
--- a/vernac/egramml.ml
+++ b/vernac/egramml.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/egramml.mli b/vernac/egramml.mli
index 1cf75a55b1..1fe2395df2 100644
--- a/vernac/egramml.mli
+++ b/vernac/egramml.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/explainErr.ml b/vernac/explainErr.ml
index 2bc95dbfcd..5c5a4ffbcb 100644
--- a/vernac/explainErr.ml
+++ b/vernac/explainErr.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -44,59 +44,61 @@ let explain_exn_default = function
let _ = CErrors.register_handler explain_exn_default
-(** Pre-explain a vernac interpretation error *)
-
-let wrap_vernac_error (exn, info) strm = (EvaluatedError (strm, None), info)
-
-let process_vernac_interp_error exn = match fst exn with
+let vernac_interp_error_handler = function
| Univ.UniverseInconsistency i ->
let msg =
if !Constrextern.print_universes then
- str "." ++ spc() ++
- Univ.explain_universe_inconsistency UnivNames.pr_with_global_universes i
+ str "." ++ spc() ++
+ Univ.explain_universe_inconsistency UnivNames.pr_with_global_universes i
else
mt() in
- wrap_vernac_error exn (str "Universe inconsistency" ++ msg ++ str ".")
+ str "Universe inconsistency" ++ msg ++ str "."
| TypeError(ctx,te) ->
- let te = map_ptype_error EConstr.of_constr te in
- wrap_vernac_error exn (Himsg.explain_type_error ctx Evd.empty te)
+ let te = map_ptype_error EConstr.of_constr te in
+ Himsg.explain_type_error ctx Evd.empty te
| PretypeError(ctx,sigma,te) ->
- wrap_vernac_error exn (Himsg.explain_pretype_error ctx sigma te)
+ Himsg.explain_pretype_error ctx sigma te
| Notation.PrimTokenNotationError(kind,ctx,sigma,te) ->
- wrap_vernac_error exn (Himsg.explain_prim_token_notation_error kind ctx sigma te)
+ Himsg.explain_prim_token_notation_error kind ctx sigma te
| Typeclasses_errors.TypeClassError(env, sigma, te) ->
- wrap_vernac_error exn (Himsg.explain_typeclass_error env sigma te)
- | Implicit_quantifiers.MismatchedContextInstance(e,c,l,x) ->
- wrap_vernac_error exn (Himsg.explain_mismatched_contexts e c l x)
+ Himsg.explain_typeclass_error env sigma te
| InductiveError e ->
- wrap_vernac_error exn (Himsg.explain_inductive_error e)
+ Himsg.explain_inductive_error e
| Modops.ModuleTypingError e ->
- wrap_vernac_error exn (Himsg.explain_module_error e)
+ Himsg.explain_module_error e
| Modintern.ModuleInternalizationError e ->
- wrap_vernac_error exn (Himsg.explain_module_internalization_error e)
+ Himsg.explain_module_internalization_error e
| RecursionSchemeError (env,e) ->
- wrap_vernac_error exn (Himsg.explain_recursion_scheme_error env e)
+ Himsg.explain_recursion_scheme_error env e
| Cases.PatternMatchingError (env,sigma,e) ->
- wrap_vernac_error exn (Himsg.explain_pattern_matching_error env sigma e)
+ Himsg.explain_pattern_matching_error env sigma e
| Tacred.ReductionTacticError e ->
- wrap_vernac_error exn (Himsg.explain_reduction_tactic_error e)
+ Himsg.explain_reduction_tactic_error e
| Logic.RefinerError (env, sigma, e) ->
- wrap_vernac_error exn (Himsg.explain_refiner_error env sigma e)
+ Himsg.explain_refiner_error env sigma e
| Nametab.GlobalizationError q ->
- wrap_vernac_error exn
- (str "The reference" ++ spc () ++ Libnames.pr_qualid q ++
- spc () ++ str "was not found" ++
- spc () ++ str "in the current" ++ spc () ++ str "environment.")
+ str "The reference" ++ spc () ++ Libnames.pr_qualid q ++
+ spc () ++ str "was not found" ++
+ spc () ++ str "in the current" ++ spc () ++ str "environment."
| Refiner.FailError (i,s) ->
- let s = Lazy.force s in
- wrap_vernac_error exn
- (str "Tactic failure" ++
- (if Pp.ismt s then s else str ": " ++ s) ++
- if Int.equal i 0 then str "." else str " (level " ++ int i ++ str").")
+ let s = Lazy.force s in
+ str "Tactic failure" ++
+ (if Pp.ismt s then s else str ": " ++ s) ++
+ if Int.equal i 0 then str "." else str " (level " ++ int i ++ str")."
| AlreadyDeclared msg ->
- wrap_vernac_error exn (msg ++ str ".")
+ msg ++ str "."
| _ ->
- exn
+ raise CErrors.Unhandled
+
+let _ = CErrors.register_handler vernac_interp_error_handler
+
+(** Pre-explain a vernac interpretation error *)
+
+let wrap_vernac_error (exn, info) strm = (EvaluatedError (strm, None), info)
+
+let process_vernac_interp_error exn =
+ try vernac_interp_error_handler (fst exn) |> wrap_vernac_error exn
+ with CErrors.Unhandled -> exn
let rec strip_wrapping_exceptions = function
| Logic_monad.TacticFailure e ->
@@ -108,16 +110,9 @@ let additional_error_info = ref []
let register_additional_error_info f =
additional_error_info := f :: !additional_error_info
-let process_vernac_interp_error ?(allow_uncaught=true) (exc, info) =
+let process_vernac_interp_error (exc, info) =
let exc = strip_wrapping_exceptions exc in
let e = process_vernac_interp_error (exc, info) in
- let () =
- if not allow_uncaught && not (CErrors.handled (fst e)) then
- let (e, info) = e in
- let msg = str "Uncaught exception " ++ str (Printexc.to_string e) ++ str "." in
- let err = CErrors.make_anomaly msg in
- Util.iraise (err, info)
- in
let e' =
try Some (CList.find_map (fun f -> f e) !additional_error_info)
with _ -> None
diff --git a/vernac/explainErr.mli b/vernac/explainErr.mli
index b54912a144..cc2a130925 100644
--- a/vernac/explainErr.mli
+++ b/vernac/explainErr.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -13,7 +13,7 @@ exception EvaluatedError of Pp.t * exn option
(** Pre-explain a vernac interpretation error *)
-val process_vernac_interp_error : ?allow_uncaught:bool -> Util.iexn -> Util.iexn
+val process_vernac_interp_error : Util.iexn -> Util.iexn
(** General explain function. Should not be used directly now,
see instead function [Errors.print] and variants *)
diff --git a/vernac/g_proofs.mlg b/vernac/g_proofs.mlg
index ecc7d3ff88..94876d2142 100644
--- a/vernac/g_proofs.mlg
+++ b/vernac/g_proofs.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -88,7 +88,6 @@ GRAMMAR EXTEND Gram
| IDENT "Show" -> { VernacShow (ShowGoal OpenSubgoals) }
| IDENT "Show"; n = natural -> { VernacShow (ShowGoal (NthGoal n)) }
| IDENT "Show"; id = ident -> { VernacShow (ShowGoal (GoalId id)) }
- | IDENT "Show"; IDENT "Script" -> { VernacShow ShowScript }
| IDENT "Show"; IDENT "Existentials" -> { VernacShow ShowExistentials }
| IDENT "Show"; IDENT "Universes" -> { VernacShow ShowUniverses }
| IDENT "Show"; IDENT "Conjectures" -> { VernacShow ShowProofNames }
diff --git a/vernac/g_vernac.mlg b/vernac/g_vernac.mlg
index 6438b48e32..74bd552459 100644
--- a/vernac/g_vernac.mlg
+++ b/vernac/g_vernac.mlg
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -50,7 +50,6 @@ let def_body = Entry.create "vernac:def_body"
let decl_notation = Entry.create "vernac:decl_notation"
let record_field = Entry.create "vernac:record_field"
let of_type_with_opt_coercion = Entry.create "vernac:of_type_with_opt_coercion"
-let instance_name = Entry.create "vernac:instance_name"
let section_subset_expr = Entry.create "vernac:section_subset_expr"
let make_bullet s =
@@ -296,14 +295,14 @@ GRAMMAR EXTEND Gram
| -> { NoInline } ] ]
;
univ_constraint:
- [ [ l = universe_level; ord = [ "<" -> { Univ.Lt } | "=" -> { Univ.Eq } | "<=" -> { Univ.Le } ];
- r = universe_level -> { (l, ord, r) } ] ]
+ [ [ l = universe_name; ord = [ "<" -> { Univ.Lt } | "=" -> { Univ.Eq } | "<=" -> { Univ.Le } ];
+ r = universe_name -> { (l, ord, r) } ] ]
;
univ_decl :
[ [ "@{" ; l = LIST0 identref; ext = [ "+" -> { true } | -> { false } ];
cs = [ "|"; l' = LIST0 univ_constraint SEP ",";
ext = [ "+" -> { true } | -> { false } ]; "}" -> { (l',ext) }
- | ext = [ "}" -> { true } | "|}" -> { false } ] -> { ([], ext) } ]
+ | ext = [ "}" -> { true } | bar_cbrace -> { false } ] -> { ([], ext) } ]
->
{ let open UState in
{ univdecl_instance = l;
@@ -683,7 +682,7 @@ END
(* Extensions: implicits, coercions, etc. *)
GRAMMAR EXTEND Gram
- GLOBAL: gallina_ext instance_name hint_info;
+ GLOBAL: gallina_ext hint_info;
gallina_ext:
[ [ (* Transparent and Opaque *)
@@ -723,11 +722,11 @@ GRAMMAR EXTEND Gram
{ VernacContext (List.flatten c) }
| IDENT "Instance"; namesup = instance_name; ":";
- expl = [ "!" -> { Decl_kinds.Implicit } | -> { Decl_kinds.Explicit } ] ; t = operconstr LEVEL "200";
+ t = operconstr LEVEL "200";
info = hint_info ;
props = [ ":="; "{"; r = record_declaration; "}" -> { Some (true,r) } |
":="; c = lconstr -> { Some (false,c) } | -> { None } ] ->
- { VernacInstance (snd namesup,(fst namesup,expl,t),props,info) }
+ { VernacInstance (fst namesup,snd namesup,t,props,info) }
| IDENT "Existing"; IDENT "Instance"; id = global;
info = hint_info ->
@@ -752,6 +751,7 @@ GRAMMAR EXTEND Gram
mods = OPT [ ":"; l = LIST1 arguments_modifier SEP "," -> { l } ] ->
{ let mods = match mods with None -> [] | Some l -> List.flatten l in
let slash_position = ref None in
+ let ampersand_position = ref None in
let rec parse_args i = function
| [] -> []
| `Id x :: args -> x :: parse_args (i+1) args
@@ -760,10 +760,15 @@ GRAMMAR EXTEND Gram
(slash_position := Some i; parse_args i args)
else
user_err Pp.(str "The \"/\" modifier can occur only once")
+ | `Ampersand :: args ->
+ if Option.is_empty !ampersand_position then
+ (ampersand_position := Some i; parse_args i args)
+ else
+ user_err Pp.(str "The \"&\" modifier can occur only once")
in
let args = parse_args 0 (List.flatten args) in
let more_implicits = Option.default [] more_implicits in
- VernacArguments (qid, args, more_implicits, !slash_position, mods) }
+ VernacArguments (qid, args, more_implicits, !slash_position, !ampersand_position, mods) }
| IDENT "Implicit"; "Type"; bl = reserv_list ->
{ VernacReserve bl }
@@ -785,6 +790,7 @@ GRAMMAR EXTEND Gram
| IDENT "default"; IDENT "implicits" -> { [`DefaultImplicits] }
| IDENT "clear"; IDENT "implicits" -> { [`ClearImplicits] }
| IDENT "clear"; IDENT "scopes" -> { [`ClearScopes] }
+ | IDENT "clear"; IDENT "bidirectionality"; IDENT "hint" -> { [`ClearBidiHint] }
| IDENT "rename" -> { [`Rename] }
| IDENT "assert" -> { [`Assert] }
| IDENT "extra"; IDENT "scopes" -> { [`ExtraScopes] }
@@ -810,6 +816,7 @@ GRAMMAR EXTEND Gram
notation_scope=notation_scope;
implicit_status = NotImplicit}] }
| "/" -> { [`Slash] }
+ | "&" -> { [`Ampersand] }
| "("; items = LIST1 argument_spec; ")"; sc = OPT scope ->
{ let f x = match sc, x with
| None, x -> x | x, None -> Option.map (fun y -> CAst.make ~loc y) x
@@ -888,9 +895,9 @@ GRAMMAR EXTEND Gram
(* Hack! Should be in grammar_ext, but camlp5 factorizes badly *)
| IDENT "Declare"; IDENT "Instance"; id = ident_decl; bl = binders; ":";
- expl = [ "!" -> { Decl_kinds.Implicit } | -> { Decl_kinds.Explicit } ] ; t = operconstr LEVEL "200";
+ t = operconstr LEVEL "200";
info = hint_info ->
- { VernacDeclareInstance (bl, (id, expl, t), info) }
+ { VernacDeclareInstance (id, bl, t, info) }
(* Should be in syntax, but camlp5 would not factorize *)
| IDENT "Declare"; IDENT "Scope"; sc = IDENT ->
diff --git a/vernac/himsg.ml b/vernac/himsg.ml
index b2382ce6fc..2e218942cb 100644
--- a/vernac/himsg.ml
+++ b/vernac/himsg.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -219,6 +219,7 @@ let explain_elim_arity env sigma ind c pj okinds =
let pc = pr_leconstr_env env sigma c in
let msg = match okinds with
| Some(sorts,kp,ki,explanation) ->
+ let sorts = Inductiveops.sorts_below sorts in
let pki = Sorts.pr_sort_family ki in
let pkp = Sorts.pr_sort_family kp in
let explanation = match explanation with
@@ -1094,19 +1095,6 @@ let explain_unbound_method env sigma cid { CAst.v = id } =
str "Unbound method name " ++ Id.print (id) ++ spc () ++
str"of class" ++ spc () ++ pr_global cid ++ str "."
-let pr_constr_exprs env sigma exprs =
- hv 0 (List.fold_right
- (fun d pps -> ws 2 ++ Ppconstr.pr_constr_expr env sigma d ++ pps)
- exprs (mt ()))
-
-let explain_mismatched_contexts env c i j =
- let sigma = Evd.from_env env in
- let pm, pn = with_diffs (pr_rel_context env sigma j) (pr_constr_exprs env sigma i) in
- str"Mismatched contexts while declaring instance: " ++ brk (1,1) ++
- hov 1 (str"Expected:" ++ brk (1, 1) ++ pm) ++
- fnl () ++ brk (1,1) ++
- hov 1 (str"Found:" ++ brk (1, 1) ++ pn)
-
let explain_typeclass_error env sigma = function
| NotAClass c -> explain_not_a_class env sigma c
| UnboundMethod (cid, id) -> explain_unbound_method env sigma cid id
diff --git a/vernac/himsg.mli b/vernac/himsg.mli
index d1c1c092e3..6458fb9e30 100644
--- a/vernac/himsg.mli
+++ b/vernac/himsg.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -24,8 +24,6 @@ val explain_pretype_error : env -> Evd.evar_map -> pretype_error -> Pp.t
val explain_inductive_error : inductive_error -> Pp.t
-val explain_mismatched_contexts : env -> contexts -> Constrexpr.constr_expr list -> Constr.rel_context -> Pp.t
-
val explain_typeclass_error : env -> Evd.evar_map -> typeclass_error -> Pp.t
val explain_recursion_scheme_error : env -> recursion_scheme_error -> Pp.t
diff --git a/vernac/indschemes.ml b/vernac/indschemes.ml
index 642695bda4..b393f33d5d 100644
--- a/vernac/indschemes.ml
+++ b/vernac/indschemes.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -21,7 +21,6 @@ open CErrors
open Util
open Names
open Declarations
-open Entries
open Term
open Constr
open Inductive
@@ -104,15 +103,16 @@ let () =
let define ~poly id internal sigma c t =
let f = declare_constant ~internal in
let univs = Evd.univ_entry ~poly sigma in
+ let open Proof_global in
let kn = f id
(DefinitionEntry
- { const_entry_body = c;
- const_entry_secctx = None;
- const_entry_type = t;
- const_entry_universes = univs;
- const_entry_opaque = false;
- const_entry_inline_code = false;
- const_entry_feedback = None;
+ { proof_entry_body = c;
+ proof_entry_secctx = None;
+ proof_entry_type = t;
+ proof_entry_universes = univs;
+ proof_entry_opaque = false;
+ proof_entry_inline_code = false;
+ proof_entry_feedback = None;
},
Decl_kinds.IsDefinition Scheme) in
definition_message id;
@@ -216,11 +216,11 @@ let declare_one_case_analysis_scheme ind =
else if not (Inductiveops.has_dependent_elim mib) then
case_scheme_kind_from_type
else case_dep_scheme_kind_from_type in
- let kelim = elim_sorts (mib,mip) in
+ let kelim = elim_sort (mib,mip) in
(* in case the inductive has a type elimination, generates only one
induction scheme, the other ones share the same code with the
- apropriate type *)
- if Sorts.List.mem InType kelim then
+ appropriate type *)
+ if Sorts.family_leq InType kelim then
ignore (define_individual_scheme dep UserAutomaticRequest None ind)
(* Induction/recursion schemes *)
@@ -248,16 +248,17 @@ let declare_one_induction_scheme ind =
let kind = inductive_sort_family mip in
let from_prop = kind == InProp in
let depelim = Inductiveops.has_dependent_elim mib in
- let kelim = elim_sorts (mib,mip) in
+ let kelim = Inductiveops.sorts_below (elim_sort (mib,mip)) in
let kelim = if Global.sprop_allowed () then kelim
else List.filter (fun s -> s <> InSProp) kelim
in
let elims =
List.map_filter (fun (sort,kind) ->
- if Sorts.List.mem sort kelim then Some kind else None)
+ if List.mem_f Sorts.family_equal sort kelim then Some kind else None)
(if from_prop then kinds_from_prop
else if depelim then kinds_from_type
- else nondep_kinds_from_type) in
+ else nondep_kinds_from_type)
+ in
List.iter (fun kind -> ignore (define_individual_scheme kind UserAutomaticRequest None ind))
elims
@@ -413,7 +414,7 @@ let do_mutual_induction_scheme ?(force_mutual=false) lnamedepindsort =
let declare decl fi lrecref =
let decltype = Retyping.get_type_of env0 sigma (EConstr.of_constr decl) in
let decltype = EConstr.to_constr sigma decltype in
- let proof_output = Future.from_val ((decl,Univ.ContextSet.empty),Safe_typing.empty_private_constants) in
+ let proof_output = Future.from_val ((decl,Univ.ContextSet.empty),Evd.empty_side_effects) in
let cst = define ~poly fi UserIndividualRequest sigma proof_output (Some decltype) in
ConstRef cst :: lrecref
in
@@ -535,7 +536,7 @@ let do_combined_scheme name schemes =
schemes
in
let sigma,body,typ = build_combined_scheme (Global.env ()) csts in
- let proof_output = Future.from_val ((body,Univ.ContextSet.empty),Safe_typing.empty_private_constants) in
+ let proof_output = Future.from_val ((body,Univ.ContextSet.empty),Evd.empty_side_effects) in
(* It is possible for the constants to have different universe
polymorphism from each other, however that is only when the user
manually defined at least one of them (as Scheme would pick the
diff --git a/vernac/indschemes.mli b/vernac/indschemes.mli
index ebfc76de9d..a747ac6598 100644
--- a/vernac/indschemes.mli
+++ b/vernac/indschemes.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/lemmas.ml b/vernac/lemmas.ml
index 317cf487cc..c2de83c1bb 100644
--- a/vernac/lemmas.ml
+++ b/vernac/lemmas.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -26,7 +26,6 @@ open Decl_kinds
open Declare
open Pretyping
open Termops
-open Namegen
open Reductionops
open Constrintern
open Impargs
@@ -34,17 +33,60 @@ open Impargs
module RelDecl = Context.Rel.Declaration
module NamedDecl = Context.Named.Declaration
-type hook_type = UState.t -> (Id.t * Constr.t) list -> Decl_kinds.locality -> GlobRef.t -> unit
-type declaration_hook = hook_type
+(* Support for terminators and proofs with an associated constant
+ [that can be saved] *)
-let mk_hook hook = hook
+type lemma_possible_guards = int list list
-let call_hook ?hook ?fix_exn uctx trans l c =
- try Option.iter (fun hook -> hook uctx trans l c) hook
- with e when CErrors.noncritical e ->
- let e = CErrors.push e in
- let e = Option.cata (fun fix -> fix e) e fix_exn in
- iraise e
+module Proof_ending = struct
+
+ type t =
+ | Regular
+ | End_obligation of DeclareObl.obligation_qed_info
+ | End_derive of { f : Id.t; name : Id.t }
+ | End_equations of { hook : Constant.t list -> Evd.evar_map -> unit
+ ; i : Id.t
+ ; types : (Environ.env * Evar.t * Evd.evar_info * EConstr.named_context * Evd.econstr) list
+ ; wits : EConstr.t list ref
+ (* wits are actually computed by the proof
+ engine by side-effect after creating the
+ proof! This is due to the start_dependent_proof API *)
+ ; sigma : Evd.evar_map
+ }
+
+end
+
+(* Proofs with a save constant function *)
+type t =
+ { proof : Proof_global.t
+ ; hook : DeclareDef.Hook.t option
+ ; compute_guard : lemma_possible_guards
+ ; proof_ending : Proof_ending.t CEphemeron.key
+ (* This could be improved and the CEphemeron removed *)
+ }
+
+let pf_map f pf = { pf with proof = f pf.proof }
+let pf_fold f pf = f pf.proof
+
+let set_endline_tactic t = pf_map (Proof_global.set_endline_tactic t)
+
+(* To be removed *)
+module Internal = struct
+
+(** Gets the current terminator without checking that the proof has
+ been completed. Useful for the likes of [Admitted]. *)
+let get_info ps = ps.hook, ps.compute_guard, ps.proof_ending
+
+end
+(* Internal *)
+
+let by tac pf =
+ let proof, res = Pfedit.by tac pf.proof in
+ { pf with proof }, res
+
+(************************************************************************)
+(* Creating a lemma-like constant *)
+(************************************************************************)
(* Support for mutually proved theorems *)
@@ -56,8 +98,8 @@ let retrieve_first_recthm uctx = function
(* we get the right order somehow but surely it could be enforced in a better way *)
let uctx = UState.context uctx in
let inst = Univ.UContext.instance uctx in
- let map (c, ctx) = Vars.subst_instance_constr inst c in
- (Option.map map (Global.body_of_constant_body cb), is_opaque cb)
+ let map (c, _, _) = Vars.subst_instance_constr inst c in
+ (Option.map map (Global.body_of_constant_body Library.indirect_accessor cb), is_opaque cb)
| _ -> assert false
let adjust_guardness_conditions const = function
@@ -65,8 +107,9 @@ let adjust_guardness_conditions const = function
| possible_indexes ->
(* Try all combinations... not optimal *)
let env = Global.env() in
- { const with const_entry_body =
- Future.chain const.const_entry_body
+ let open Proof_global in
+ { const with proof_entry_body =
+ Future.chain const.proof_entry_body
(fun ((body, ctx), eff) ->
match Constr.kind body with
| Fix ((nv,0),(_,_,fixdefs as fixdecls)) ->
@@ -75,7 +118,7 @@ let adjust_guardness_conditions const = function
List.interval 0 (List.length ((lam_assum c))))
lemma_guard (Array.to_list fixdefs) in
*)
- let env = Safe_typing.push_private_constants env eff in
+ let env = Safe_typing.push_private_constants env eff.Evd.seff_private in
let indexes =
search_guard env
possible_indexes fixdecls in
@@ -169,55 +212,12 @@ let look_for_possibly_mutual_statements sigma = function
Some recguard,thms, Some (List.map (fun (_,_,i) -> succ i) ordered_inds)
| [] -> anomaly (Pp.str "Empty list of theorems.")
-(* Saving a goal *)
-
-let save ?export_seff id const uctx do_guard (locality,poly,kind) hook universes =
- let fix_exn = Future.fix_exn_of const.Entries.const_entry_body in
- try
- let const = adjust_guardness_conditions const do_guard in
- let k = Kindops.logical_kind_of_goal_kind kind in
- let should_suggest = const.const_entry_opaque && Option.is_empty const.const_entry_secctx in
- let r = match locality with
- | Discharge when Lib.sections_are_opened () ->
- let c = SectionLocalDef const in
- let _ = declare_variable id (Lib.cwd(), c, k) in
- let () = if should_suggest
- then Proof_using.suggest_variable (Global.env ()) id
- in
- VarRef id
- | Local | Global | Discharge ->
- let local = match locality with
- | Local | Discharge -> true
- | Global -> false
- in
- let kn =
- declare_constant ?export_seff id ~local (DefinitionEntry const, k) in
- let () = if should_suggest
- then Proof_using.suggest_constant (Global.env ()) kn
- in
- let gr = ConstRef kn in
- Declare.declare_univ_binders gr (UState.universe_binders uctx);
- gr
- in
- definition_message id;
- call_hook ?hook universes [] locality r
- with e when CErrors.noncritical e ->
- let e = CErrors.push e in
- iraise (fix_exn e)
-
let default_thm_id = Id.of_string "Unnamed_thm"
-let fresh_name_for_anonymous_theorem ~pstate =
- let avoid = match pstate with
- | None -> Id.Set.empty
- | Some pstate -> Id.Set.of_list (Proof_global.get_all_proof_names pstate)
- in
- next_global_ident_away default_thm_id avoid
-
let check_name_freshness locality {CAst.loc;v=id} : unit =
(* We check existence here: it's a bit late at Qed time *)
if Nametab.exists_cci (Lib.make_path id) || is_section_variable id ||
- locality == Global && Nametab.exists_cci (Lib.make_path_except_section id)
+ locality <> Discharge && Nametab.exists_cci (Lib.make_path_except_section id)
then
user_err ?loc (Id.print id ++ str " already exists.")
@@ -237,16 +237,12 @@ let save_remaining_recthms env sigma (locality,p,kind) norm univs body opaq i (i
in
let c = SectionLocalAssum ((t_i, univs),p,impl) in
let _ = declare_variable id (Lib.cwd(),c,k) in
- (Discharge, VarRef id,imps)
- | Local | Global ->
- let local = match locality with
- | Local -> true
- | Global -> false
- | Discharge -> assert false
- in
+ (VarRef id,imps)
+ | Global local ->
+ let k = IsAssumption Conjectural in
let decl = (ParameterEntry (None,(t_i,univs),None), k) in
let kn = declare_constant id ~local decl in
- (locality,ConstRef kn,imps))
+ (ConstRef kn,imps))
| Some body ->
let body = norm body in
let k = Kindops.logical_kind_of_goal_kind kind in
@@ -264,62 +260,13 @@ let save_remaining_recthms env sigma (locality,p,kind) norm univs body opaq i (i
let const = definition_entry ~types:t_i ~opaque:opaq ~univs body_i in
let c = SectionLocalDef const in
let _ = declare_variable id (Lib.cwd(), c, k) in
- (Discharge,VarRef id,imps)
- | Local | Global ->
- let local = match locality with
- | Local -> true
- | Global -> false
- | Discharge -> assert false
- in
+ (VarRef id,imps)
+ | Global local ->
let const =
Declare.definition_entry ~types:t_i ~univs ~opaque:opaq body_i
in
let kn = declare_constant id ~local (DefinitionEntry const, k) in
- (locality,ConstRef kn,imps)
-
-let check_anonymity id save_ident =
- if not (String.equal (atompart_of_id id) (Id.to_string (default_thm_id))) then
- user_err Pp.(str "This command can only be used for unnamed theorem.")
-
-(* Admitted *)
-
-let warn_let_as_axiom =
- CWarnings.create ~name:"let-as-axiom" ~category:"vernacular"
- (fun id -> strbrk "Let definition" ++ spc () ++ Id.print id ++
- spc () ++ strbrk "declared as an axiom.")
-
-let admit ?hook ctx (id,k,e) pl () =
- let kn = declare_constant id (ParameterEntry e, IsAssumption Conjectural) in
- let () = match k with
- | Global, _, _ -> ()
- | Local, _, _ | Discharge, _, _ -> warn_let_as_axiom id
- in
- let () = assumption_message id in
- Declare.declare_univ_binders (ConstRef kn) pl;
- call_hook ?hook ctx [] Global (ConstRef kn)
-
-(* Starting a goal *)
-
-let standard_proof_terminator ?(hook : declaration_hook option) compute_guard =
- let open Proof_global in
- make_terminator begin function
- | Admitted (id,k,pe,ctx) ->
- let () = admit ?hook ctx (id,k,pe) (UState.universe_binders ctx) () in
- Feedback.feedback Feedback.AddedAxiom
- | Proved (opaque,idopt, { id; entries=[const]; persistence; universes } ) ->
- let is_opaque, export_seff = match opaque with
- | Transparent -> false, true
- | Opaque -> true, false
- in
- assert (is_opaque == const.const_entry_opaque);
- let id = match idopt with
- | None -> id
- | Some { CAst.v = save_id } -> check_anonymity id save_id; save_id in
- let () = save ~export_seff id const universes compute_guard persistence hook universes in
- ()
- | Proved (opaque,idopt, _ ) ->
- CErrors.anomaly Pp.(str "[universe_proof_terminator] close_proof returned more than one proof term")
- end
+ (ConstRef kn,imps)
let initialize_named_context_for_proof () =
let sign = Global.named_context () in
@@ -329,18 +276,52 @@ let initialize_named_context_for_proof () =
let d = if variable_opacity id then NamedDecl.drop_body d else d in
Environ.push_named_context_val d signv) sign Environ.empty_named_context_val
-let start_proof ~ontop id ?pl kind sigma ?terminator ?sign ?(compute_guard=[]) ?hook c =
- let terminator = match terminator with
- | None -> standard_proof_terminator ?hook compute_guard
- | Some terminator -> terminator ?hook compute_guard
- in
- let sign =
- match sign with
- | Some sign -> sign
- | None -> initialize_named_context_for_proof ()
- in
+module Stack = struct
+
+ type lemma = t
+ type nonrec t = t * t list
+
+ let map f (pf, pfl) = (f pf, List.map f pfl)
+
+ let map_top ~f (pf, pfl) = (f pf, pfl)
+ let map_top_pstate ~f (pf, pfl) = (pf_map f pf, pfl)
+
+ let pop (ps, p) = match p with
+ | [] -> ps, None
+ | pp :: p -> ps, Some (pp, p)
+
+ let with_top (p, _) ~f = f p
+ let with_top_pstate (p, _) ~f = f p.proof
+
+ let push ontop a =
+ match ontop with
+ | None -> a , []
+ | Some (l,ls) -> a, (l :: ls)
+
+ let get_all_proof_names (pf : t) =
+ let prj x = Proof_global.get_proof x in
+ let (pn, pns) = map Proof.(function pf -> (data (prj pf.proof)).name) pf in
+ pn :: pns
+
+ let copy_info ~src ~tgt =
+ let (ps, psl), (ts,tsl) = src, tgt in
+ assert(List.length psl = List.length tsl);
+ { ps with proof = ts.proof },
+ List.map2 (fun op p -> { op with proof = p.proof }) psl tsl
+
+end
+
+(* Starting a goal *)
+let start_lemma id ?pl kind sigma ?(proof_ending = Proof_ending.Regular)
+ ?(sign=initialize_named_context_for_proof()) ?(compute_guard=[]) ?hook c =
let goals = [ Global.env_of_context sign , c ] in
- Proof_global.start_proof ~ontop sigma id ?pl kind goals terminator
+ let proof = Proof_global.start_proof sigma id ?pl kind goals in
+ { proof ; hook; compute_guard; proof_ending = CEphemeron.create proof_ending }
+
+let start_dependent_lemma id ?pl kind ?(proof_ending = Proof_ending.Regular)
+ ?(compute_guard=[]) ?hook telescope =
+ let proof = Proof_global.start_dependent_proof id ?pl kind telescope in
+ { proof; hook; compute_guard; proof_ending = CEphemeron.create proof_ending }
let rec_tac_initializer finite guard thms snl =
if finite then
@@ -356,7 +337,7 @@ let rec_tac_initializer finite guard thms snl =
| (id,n,_)::l -> Tactics.mutual_fix id n l 0
| _ -> assert false
-let start_proof_with_initialization ~ontop ?hook kind sigma decl recguard thms snl =
+let start_lemma_with_initialization ?hook kind sigma decl recguard thms snl =
let intro_tac (_, (_, (ids, _))) = Tactics.auto_intros_tac ids in
let init_tac,guard = match recguard with
| Some (finite,guard,init_tac) ->
@@ -384,18 +365,19 @@ let start_proof_with_initialization ~ontop ?hook kind sigma decl recguard thms s
let uctx = UState.check_univ_decl ~poly:(pi2 kind) ctx decl in
let env = Global.env () in
List.map_i (save_remaining_recthms env sigma kind norm uctx body opaq) 1 other_thms in
- let thms_data = (strength,ref,imps)::other_thms_data in
- List.iter (fun (strength,ref,imps) ->
+ let thms_data = (ref,imps)::other_thms_data in
+ List.iter (fun (ref,imps) ->
maybe_declare_manual_implicits false ref imps;
- call_hook ?hook ctx [] strength ref) thms_data in
- let pstate = start_proof ~ontop id ~pl:decl kind sigma t ~hook ~compute_guard:guard in
- let pstate = Proof_global.simple_with_current_proof (fun _ p ->
+ DeclareDef.Hook.call ?hook ctx [] strength ref) thms_data in
+ let hook = DeclareDef.Hook.make hook in
+ let lemma = start_lemma id ~pl:decl kind sigma t ~hook ~compute_guard:guard in
+ let lemma = pf_map (Proof_global.map_proof (fun p ->
match init_tac with
| None -> p
- | Some tac -> pi1 @@ Proof.run_tactic Global.(env ()) tac p) pstate in
- pstate
+ | Some tac -> pi1 @@ Proof.run_tactic Global.(env ()) tac p)) lemma in
+ lemma
-let start_proof_com ~program_mode ~ontop ?inference_hook ?hook kind thms =
+let start_lemma_com ~program_mode ?inference_hook ?hook kind thms =
let env0 = Global.env () in
let decl = fst (List.hd thms) in
let evd, decl = Constrexpr_ops.interp_univ_decl_opt env0 (snd decl) in
@@ -410,7 +392,7 @@ let start_proof_com ~program_mode ~ontop ?inference_hook ?hook kind thms =
(* XXX: The nf_evar is critical !! *)
evd, (id.CAst.v,
(Evarutil.nf_evar evd (EConstr.it_mkProd_or_LetIn t' ctx),
- (ids, imps @ lift_implicits (Context.Rel.nhyps ctx) imps'))))
+ (ids, imps @ imps'))))
evd thms in
let recguard,thms,snl = look_for_possibly_mutual_statements evd thms in
let evd = Evd.minimize_universes evd in
@@ -427,38 +409,56 @@ let start_proof_com ~program_mode ~ontop ?inference_hook ?hook kind thms =
else (* We fix the variables to ensure they won't be lowered to Set *)
Evd.fix_undefined_variables evd
in
- start_proof_with_initialization ~ontop ?hook kind evd decl recguard thms snl
+ start_lemma_with_initialization ?hook kind evd decl recguard thms snl
-(* Saving a proof *)
+(************************************************************************)
+(* Admitting a lemma-like constant *)
+(************************************************************************)
-let keep_admitted_vars = ref true
+let check_anonymity id save_ident =
+ if not (String.equal (atompart_of_id id) (Id.to_string (default_thm_id))) then
+ user_err Pp.(str "This command can only be used for unnamed theorem.")
-let () =
- let open Goptions in
- declare_bool_option
- { optdepr = false;
- optname = "keep section variables in admitted proofs";
- optkey = ["Keep"; "Admitted"; "Variables"];
- optread = (fun () -> !keep_admitted_vars);
- optwrite = (fun b -> keep_admitted_vars := b) }
+(* Admitted *)
+let warn_let_as_axiom =
+ CWarnings.create ~name:"let-as-axiom" ~category:"vernacular"
+ (fun id -> strbrk "Let definition" ++ spc () ++ Id.print id ++
+ spc () ++ strbrk "declared as an axiom.")
-let save_proof_admitted ?proof ~pstate =
- let pe =
+let finish_admitted id k pe ctx hook =
+ let local = match k with
+ | Global local, _, _ -> local
+ | Discharge, _, _ -> warn_let_as_axiom id; ImportNeedQualified
+ in
+ let kn = declare_constant id ~local (ParameterEntry pe, IsAssumption Conjectural) in
+ let () = assumption_message id in
+ Declare.declare_univ_binders (ConstRef kn) (UState.universe_binders ctx);
+ DeclareDef.Hook.call ?hook ctx [] (Global local) (ConstRef kn);
+ Feedback.feedback Feedback.AddedAxiom
+
+let get_keep_admitted_vars =
+ Goptions.declare_bool_option_and_ref
+ ~depr:false
+ ~name:"keep section variables in admitted proofs"
+ ~key:["Keep"; "Admitted"; "Variables"]
+ ~value:true
+
+let save_lemma_admitted ?proof ~(lemma : t) =
let open Proof_global in
match proof with
- | Some ({ id; entries; persistence = k; universes }, _) ->
+ | Some ({ id; entries; persistence = k; universes }, (hook, _, _)) ->
if List.length entries <> 1 then
user_err Pp.(str "Admitted does not support multiple statements");
- let { const_entry_secctx; const_entry_type } = List.hd entries in
- if const_entry_type = None then
+ let { proof_entry_secctx; proof_entry_type } = List.hd entries in
+ if proof_entry_type = None then
user_err Pp.(str "Admitted requires an explicit statement");
- let typ = Option.get const_entry_type in
+ let typ = Option.get proof_entry_type in
let ctx = UState.univ_entry ~poly:(pi2 k) universes in
- let sec_vars = if !keep_admitted_vars then const_entry_secctx else None in
- Admitted(id, k, (sec_vars, (typ, ctx), None), universes)
+ let sec_vars = if get_keep_admitted_vars () then proof_entry_secctx else None in
+ finish_admitted id k (sec_vars, (typ, ctx), None) universes hook
| None ->
- let pftree = Proof_global.give_me_the_proof pstate in
- let gk = Proof_global.get_current_persistence pstate in
+ let pftree = Proof_global.get_proof lemma.proof in
+ let gk = Proof_global.get_persistence lemma.proof in
let Proof.{ name; poly; entry } = Proof.data pftree in
let typ = match Proofview.initial_goals entry with
| [typ] -> snd typ
@@ -470,10 +470,10 @@ let save_proof_admitted ?proof ~pstate =
let universes = Proof.((data pftree).initial_euctx) in
(* This will warn if the proof is complete *)
let pproofs, _univs =
- Proof_global.return_proof ~allow_partial:true pstate in
+ Proof_global.return_proof ~allow_partial:true lemma.proof in
let sec_vars =
- if not !keep_admitted_vars then None
- else match Proof_global.get_used_variables pstate, pproofs with
+ if not (get_keep_admitted_vars ()) then None
+ else match Proof_global.get_used_variables lemma.proof, pproofs with
| Some _ as x, _ -> x
| None, (pproof, _) :: _ ->
let env = Global.env () in
@@ -481,26 +481,154 @@ let save_proof_admitted ?proof ~pstate =
let ids_def = Environ.global_vars_set env pproof in
Some (Environ.keep_hyps env (Id.Set.union ids_typ ids_def))
| _ -> None in
- let decl = Proof_global.get_universe_decl pstate in
+ let decl = Proof_global.get_universe_decl lemma.proof in
let ctx = UState.check_univ_decl ~poly universes decl in
- Admitted(name,gk,(sec_vars, (typ, ctx), None), universes)
+ finish_admitted name gk (sec_vars, (typ, ctx), None) universes lemma.hook
+
+(************************************************************************)
+(* Saving a lemma-like constant *)
+(************************************************************************)
+
+type proof_info = DeclareDef.Hook.t option * lemma_possible_guards * Proof_ending.t CEphemeron.key
+
+let default_info = None, [], CEphemeron.create Proof_ending.Regular
+
+let finish_proved opaque idopt po hook compute_guard =
+ let open Proof_global in
+ match po with
+ | { id; entries=[const]; persistence=locality,poly,kind; universes } ->
+ let is_opaque = match opaque with
+ | Transparent -> false
+ | Opaque -> true
+ in
+ assert (is_opaque == const.proof_entry_opaque);
+ let id = match idopt with
+ | None -> id
+ | Some { CAst.v = save_id } -> check_anonymity id save_id; save_id in
+ let fix_exn = Future.fix_exn_of const.proof_entry_body in
+ let () = try
+ let const = adjust_guardness_conditions const compute_guard in
+ let k = Kindops.logical_kind_of_goal_kind kind in
+ let should_suggest = const.proof_entry_opaque && Option.is_empty const.proof_entry_secctx in
+ let r = match locality with
+ | Discharge ->
+ let c = SectionLocalDef const in
+ let _ = declare_variable id (Lib.cwd(), c, k) in
+ let () = if should_suggest
+ then Proof_using.suggest_variable (Global.env ()) id
+ in
+ VarRef id
+ | Global local ->
+ let kn =
+ declare_constant id ~local (DefinitionEntry const, k) in
+ let () = if should_suggest
+ then Proof_using.suggest_constant (Global.env ()) kn
+ in
+ let gr = ConstRef kn in
+ Declare.declare_univ_binders gr (UState.universe_binders universes);
+ gr
+ in
+ definition_message id;
+ DeclareDef.Hook.call ~fix_exn ?hook universes [] locality r
+ with e when CErrors.noncritical e ->
+ let e = CErrors.push e in
+ iraise (fix_exn e)
+ in ()
+ | _ ->
+ CErrors.anomaly Pp.(str "[standard_proof_terminator] close_proof returned more than one proof term")
+
+let finish_derived ~f ~name ~idopt ~opaque ~entries =
+ (* [f] and [name] correspond to the proof of [f] and of [suchthat], respectively. *)
+
+ if Option.has_some idopt then
+ CErrors.user_err Pp.(str "Cannot save a proof of Derive with an explicit name.");
+
+ let opaque, f_def, lemma_def =
+ match entries with
+ | [_;f_def;lemma_def] ->
+ opaque <> Proof_global.Transparent , f_def , lemma_def
+ | _ -> assert false
+ in
+ (* The opacity of [f_def] is adjusted to be [false], as it
+ must. Then [f] is declared in the global environment. *)
+ let f_def = { f_def with Proof_global.proof_entry_opaque = false } in
+ let f_def = Declare.DefinitionEntry f_def , Decl_kinds.(IsDefinition Definition) in
+ let f_kn = Declare.declare_constant f f_def in
+ let f_kn_term = mkConst f_kn in
+ (* In the type and body of the proof of [suchthat] there can be
+ references to the variable [f]. It needs to be replaced by
+ references to the constant [f] declared above. This substitution
+ performs this precise action. *)
+ let substf c = Vars.replace_vars [f,f_kn_term] c in
+ (* Extracts the type of the proof of [suchthat]. *)
+ let lemma_pretype =
+ match Proof_global.(lemma_def.proof_entry_type) with
+ | Some t -> t
+ | None -> assert false (* Proof_global always sets type here. *)
+ in
+ (* The references of [f] are subsituted appropriately. *)
+ let lemma_type = substf lemma_pretype in
+ (* The same is done in the body of the proof. *)
+ let lemma_body = Future.chain Proof_global.(lemma_def.proof_entry_body) (fun ((b,ctx),fx) -> (substf b, ctx), fx) in
+ let lemma_def = let open Proof_global in
+ { lemma_def with
+ proof_entry_body = lemma_body ;
+ proof_entry_type = Some lemma_type ;
+ proof_entry_opaque = opaque ; }
in
- Proof_global.apply_terminator (Proof_global.get_terminator pstate) pe
+ let lemma_def =
+ Declare.DefinitionEntry lemma_def ,
+ Decl_kinds.(IsProof Proposition)
+ in
+ ignore (Declare.declare_constant name lemma_def)
+
+let finish_proved_equations opaque lid proof_obj hook i types wits sigma0 =
-let save_proof_proved ?proof ?pstate ~opaque ~idopt =
+ let open Decl_kinds in
+ let obls = ref 1 in
+ let kind = match pi3 proof_obj.Proof_global.persistence with
+ | DefinitionBody d -> IsDefinition d
+ | Proof p -> IsProof p
+ in
+ let sigma, recobls =
+ CList.fold_left2_map (fun sigma (wit, (evar_env, ev, evi, local_context, type_)) entry ->
+ let id =
+ match Evd.evar_ident ev sigma0 with
+ | Some id -> id
+ | None -> let n = !obls in incr obls; add_suffix i ("_obligation_" ^ string_of_int n)
+ in
+ let entry, args = Abstract.shrink_entry local_context entry in
+ let cst = Declare.declare_constant id (Declare.DefinitionEntry entry, kind) in
+ let sigma, app = Evarutil.new_global sigma (ConstRef cst) in
+ let sigma = Evd.define ev (EConstr.applist (app, List.map EConstr.of_constr args)) sigma in
+ sigma, cst) sigma0
+ (CList.combine (List.rev !wits) types) proof_obj.Proof_global.entries
+ in
+ hook recobls sigma
+
+let save_lemma_proved ?proof ?lemma ~opaque ~idopt =
(* Invariant (uh) *)
- if Option.is_empty pstate && Option.is_empty proof then
+ if Option.is_empty lemma && Option.is_empty proof then
user_err (str "No focused proof (No proof-editing in progress).");
- let (proof_obj,terminator) =
+ let proof_obj, proof_info =
match proof with
| None ->
(* XXX: The close_proof and proof state API should be refactored
so it is possible to insert proofs properly into the state *)
- let pstate = Option.get pstate in
- Proof_global.close_proof ~opaque ~keep_body_ucst_separate:false (fun x -> x) pstate
- | Some proof -> proof
+ let { proof; hook; compute_guard; proof_ending } = Option.get lemma in
+ Proof_global.close_proof ~opaque ~keep_body_ucst_separate:false (fun x -> x) proof, (hook, compute_guard, proof_ending)
+ | Some (proof, info) ->
+ proof, info
in
- (* if the proof is given explicitly, nothing has to be deleted *)
- let pstate = if Option.is_empty proof then Proof_global.discard_current Option.(get pstate) else pstate in
- Proof_global.(apply_terminator terminator (Proved (opaque,idopt,proof_obj)));
- pstate
+ let hook, compute_guard, proof_ending = proof_info in
+ let open Proof_global in
+ let open Proof_ending in
+ match CEphemeron.default proof_ending Regular with
+ | Regular ->
+ finish_proved opaque idopt proof_obj hook compute_guard
+ | End_obligation oinfo ->
+ DeclareObl.obligation_terminator opaque proof_obj.entries proof_obj.universes oinfo
+ | End_derive { f ; name } ->
+ finish_derived ~f ~name ~idopt ~opaque ~entries:proof_obj.entries
+ | End_equations { hook; i; types; wits; sigma } ->
+ finish_proved_equations opaque idopt proof_obj hook i types wits sigma
diff --git a/vernac/lemmas.mli b/vernac/lemmas.mli
index 1f70cfa1ad..70c8b511a1 100644
--- a/vernac/lemmas.mli
+++ b/vernac/lemmas.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -11,74 +11,120 @@
open Names
open Decl_kinds
-type declaration_hook
-
-(* Hooks allow users of the API to perform arbitrary actions at
- * proof/definition saving time. For example, to register a constant
- * as a Coercion, perform some cleanup, update the search database,
- * etc...
- *
- * Here, we use an extended hook type suitable for obligations /
- * equations.
- *)
-(** [hook_type] passes to the client:
- - [ustate]: universe constraints obtained when the term was closed
- - [(n1,t1),...(nm,tm)]: association list between obligation
- name and the corresponding defined term (might be a constant,
- but also an arbitrary term in the Expand case of obligations)
- - [locality]: Locality of the original declaration
- - [ref]: identifier of the origianl declaration
- *)
-type hook_type = UState.t -> (Id.t * Constr.t) list -> Decl_kinds.locality -> GlobRef.t -> unit
-
-val mk_hook : hook_type -> declaration_hook
-val call_hook
- : ?hook:declaration_hook
- -> ?fix_exn:Future.fix_exn
- -> hook_type
-
-val start_proof : ontop:Proof_global.t option -> Id.t -> ?pl:UState.universe_decl -> goal_kind -> Evd.evar_map ->
- ?terminator:(?hook:declaration_hook -> Proof_global.lemma_possible_guards -> Proof_global.proof_terminator) ->
- ?sign:Environ.named_context_val ->
- ?compute_guard:Proof_global.lemma_possible_guards ->
- ?hook:declaration_hook -> EConstr.types -> Proof_global.t
-
-val start_proof_com
+(* Proofs that define a constant *)
+type t
+type lemma_possible_guards = int list list
+
+module Stack : sig
+
+ type lemma = t
+ type t
+
+ val pop : t -> lemma * t option
+ val push : t option -> lemma -> t
+
+ val map_top : f:(lemma -> lemma) -> t -> t
+ val map_top_pstate : f:(Proof_global.t -> Proof_global.t) -> t -> t
+
+ val with_top : t -> f:(lemma -> 'a ) -> 'a
+ val with_top_pstate : t -> f:(Proof_global.t -> 'a ) -> 'a
+
+ val get_all_proof_names : t -> Names.Id.t list
+
+ val copy_info : src:t -> tgt:t -> t
+ (** Gets the current info without checking that the proof has been
+ completed. Useful for the likes of [Admitted]. *)
+
+end
+
+val set_endline_tactic : Genarg.glob_generic_argument -> t -> t
+val pf_map : (Proof_global.t -> Proof_global.t) -> t -> t
+val pf_fold : (Proof_global.t -> 'a) -> t -> 'a
+
+val by : unit Proofview.tactic -> t -> t * bool
+
+(* Start of high-level proofs with an associated constant *)
+
+module Proof_ending : sig
+
+ type t =
+ | Regular
+ | End_obligation of DeclareObl.obligation_qed_info
+ | End_derive of { f : Id.t; name : Id.t }
+ | End_equations of { hook : Constant.t list -> Evd.evar_map -> unit
+ ; i : Id.t
+ ; types : (Environ.env * Evar.t * Evd.evar_info * EConstr.named_context * Evd.econstr) list
+ ; wits : EConstr.t list ref
+ ; sigma : Evd.evar_map
+ }
+
+end
+
+val start_lemma
+ : Id.t
+ -> ?pl:UState.universe_decl
+ -> goal_kind
+ -> Evd.evar_map
+ -> ?proof_ending:Proof_ending.t
+ -> ?sign:Environ.named_context_val
+ -> ?compute_guard:lemma_possible_guards
+ -> ?hook:DeclareDef.Hook.t
+ -> EConstr.types
+ -> t
+
+val start_dependent_lemma
+ : Id.t
+ -> ?pl:UState.universe_decl
+ -> goal_kind
+ -> ?proof_ending:Proof_ending.t
+ -> ?compute_guard:lemma_possible_guards
+ -> ?hook:DeclareDef.Hook.t
+ -> Proofview.telescope
+ -> t
+
+val start_lemma_com
: program_mode:bool
- -> ontop:Proof_global.t option
-> ?inference_hook:Pretyping.inference_hook
- -> ?hook:declaration_hook -> goal_kind -> Vernacexpr.proof_expr list
- -> Proof_global.t
+ -> ?hook:DeclareDef.Hook.t -> goal_kind -> Vernacexpr.proof_expr list
+ -> t
-val start_proof_with_initialization : ontop:Proof_global.t option ->
- ?hook:declaration_hook ->
- goal_kind -> Evd.evar_map -> UState.universe_decl ->
- (bool * Proof_global.lemma_possible_guards * unit Proofview.tactic list option) option ->
- (Id.t (* name of thm *) *
- (EConstr.types (* type of thm *) * (Name.t list (* names to pre-introduce *) * Impargs.manual_explicitation list))) list
- -> int list option -> Proof_global.t
+val start_lemma_with_initialization
+ : ?hook:DeclareDef.Hook.t
+ -> goal_kind -> Evd.evar_map -> UState.universe_decl
+ -> (bool * lemma_possible_guards * unit Proofview.tactic list option) option
+ -> (Id.t (* name of thm *) *
+ (EConstr.types (* type of thm *) *
+ (Name.t list (* names to pre-introduce *) * Impargs.manual_implicits))) list
+ -> int list option
+ -> t
-val standard_proof_terminator :
- ?hook:declaration_hook -> Proof_global.lemma_possible_guards ->
- Proof_global.proof_terminator
-
-val fresh_name_for_anonymous_theorem : pstate:Proof_global.t option -> Id.t
+val default_thm_id : Names.Id.t
(* Prepare global named context for proof session: remove proofs of
opaque section definitions and remove vm-compiled code *)
val initialize_named_context_for_proof : unit -> Environ.named_context_val
-(** {6 ... } *)
+(** {6 Saving proofs } *)
+
+type proof_info
+
+val default_info : proof_info
-val save_proof_admitted
- : ?proof:Proof_global.closed_proof
- -> pstate:Proof_global.t
+val save_lemma_admitted
+ : ?proof:(Proof_global.proof_object * proof_info)
+ -> lemma:t
-> unit
-val save_proof_proved
- : ?proof:Proof_global.closed_proof
- -> ?pstate:Proof_global.t
+val save_lemma_proved
+ : ?proof:(Proof_global.proof_object * proof_info)
+ -> ?lemma:t
-> opaque:Proof_global.opacity_flag
-> idopt:Names.lident option
- -> Proof_global.t option
+ -> unit
+
+(* To be removed *)
+module Internal : sig
+ (** Only needed due to the Proof_global compatibility layer. *)
+ val get_info : t -> proof_info
+end
diff --git a/vernac/loadpath.ml b/vernac/loadpath.ml
new file mode 100644
index 0000000000..bea0c943c3
--- /dev/null
+++ b/vernac/loadpath.ml
@@ -0,0 +1,273 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+
+open Util
+module DP = Names.DirPath
+
+(** Load paths. Mapping from physical to logical paths. *)
+
+type t = {
+ path_physical : CUnix.physical_path;
+ path_logical : DP.t;
+ path_implicit : bool;
+}
+
+let load_paths = Summary.ref ([] : t list) ~name:"LOADPATHS"
+
+let logical p = p.path_logical
+let physical p = p.path_physical
+
+let pp p =
+ let dir = DP.print p.path_logical in
+ let path = Pp.str (CUnix.escaped_string_of_physical_path p.path_physical) in
+ Pp.(hov 2 (dir ++ spc () ++ path))
+
+let get_load_paths () = !load_paths
+
+let anomaly_too_many_paths path =
+ CErrors.anomaly Pp.(str "Several logical paths are associated to" ++ spc () ++ str path ++ str ".")
+
+let find_load_path phys_dir =
+ let phys_dir = CUnix.canonical_path_name phys_dir in
+ let filter p = String.equal p.path_physical phys_dir in
+ let paths = List.filter filter !load_paths in
+ match paths with
+ | [] -> raise Not_found
+ | [p] -> p
+ | _ -> anomaly_too_many_paths phys_dir
+
+let remove_load_path dir =
+ let filter p = not (String.equal p.path_physical dir) in
+ load_paths := List.filter filter !load_paths
+
+let warn_overriding_logical_loadpath =
+ CWarnings.create ~name:"overriding-logical-loadpath" ~category:"loadpath"
+ (fun (phys_path, old_path, coq_path) ->
+ Pp.(seq [str phys_path; strbrk " was previously bound to "
+ ; DP.print old_path; strbrk "; it is remapped to "
+ ; DP.print coq_path]))
+
+let add_load_path phys_path coq_path ~implicit =
+ let phys_path = CUnix.canonical_path_name phys_path in
+ let filter p = String.equal p.path_physical phys_path in
+ let binding = {
+ path_logical = coq_path;
+ path_physical = phys_path;
+ path_implicit = implicit;
+ } in
+ match List.filter filter !load_paths with
+ | [] ->
+ load_paths := binding :: !load_paths
+ | [{ path_logical = old_path; path_implicit = old_implicit }] ->
+ let replace =
+ if DP.equal coq_path old_path then
+ implicit <> old_implicit
+ else
+ let () =
+ (* Do not warn when overriding the default "-I ." path *)
+ if not (DP.equal old_path Libnames.default_root_prefix) then
+ warn_overriding_logical_loadpath (phys_path, old_path, coq_path)
+ in
+ true in
+ if replace then
+ begin
+ remove_load_path phys_path;
+ load_paths := binding :: !load_paths;
+ end
+ | _ -> anomaly_too_many_paths phys_path
+
+let filter_path f =
+ let rec aux = function
+ | [] -> []
+ | p :: l ->
+ if f p.path_logical then (p.path_physical, p.path_logical) :: aux l
+ else aux l
+ in
+ aux !load_paths
+
+let expand_path ?root dir =
+ let rec aux = function
+ | [] -> []
+ | { path_physical = ph; path_logical = lg; path_implicit = implicit } :: l ->
+ let success =
+ match root with
+ | None ->
+ if implicit then Libnames.is_dirpath_suffix_of dir lg
+ else DP.equal dir lg
+ | Some root ->
+ Libnames.(is_dirpath_prefix_of root lg &&
+ is_dirpath_suffix_of dir (drop_dirpath_prefix root lg)) in
+ if success then (ph, lg) :: aux l else aux l in
+ aux !load_paths
+
+let locate_file fname =
+ let paths = List.map physical !load_paths in
+ let _,longfname =
+ System.find_file_in_path ~warn:(not !Flags.quiet) paths fname in
+ longfname
+
+(************************************************************************)
+(*s Locate absolute or partially qualified library names in the path *)
+
+type library_location = LibLoaded | LibInPath
+type locate_error = LibUnmappedDir | LibNotFound
+type 'a locate_result = ('a, locate_error) result
+
+let warn_several_object_files =
+ CWarnings.create ~name:"several-object-files" ~category:"require"
+ Pp.(fun (vi, vo) ->
+ seq [ str "Loading"; spc (); str vi
+ ; strbrk " instead of "; str vo
+ ; strbrk " because it is more recent"
+ ])
+
+
+let select_vo_file ~warn loadpath base =
+ let find ext =
+ let loadpath = List.map fst loadpath in
+ try
+ let name = Names.Id.to_string base ^ ext in
+ let lpath, file =
+ System.where_in_path ~warn loadpath name in
+ Some (lpath, file)
+ with Not_found -> None in
+ match find ".vo", find ".vio" with
+ | None, None ->
+ Error LibNotFound
+ | Some res, None | None, Some res ->
+ Ok res
+ | Some (_, vo), Some (_, vi as resvi)
+ when Unix.((stat vo).st_mtime < (stat vi).st_mtime) ->
+ warn_several_object_files (vi, vo);
+ Ok resvi
+ | Some resvo, Some _ ->
+ Ok resvo
+
+let locate_absolute_library dir : CUnix.physical_path locate_result =
+ (* Search in loadpath *)
+ let pref, base = Libnames.split_dirpath dir in
+ let loadpath = filter_path (fun dir -> DP.equal dir pref) in
+ match loadpath with
+ | [] -> Error LibUnmappedDir
+ | _ ->
+ match select_vo_file ~warn:false loadpath base with
+ | Ok (_, file) -> Ok file
+ | Error fail -> Error fail
+
+let locate_qualified_library ?root ?(warn = true) qid :
+ (library_location * DP.t * CUnix.physical_path) locate_result =
+ (* Search library in loadpath *)
+ let dir, base = Libnames.repr_qualid qid in
+ let loadpath = expand_path ?root dir in
+ match loadpath with
+ | [] -> Error LibUnmappedDir
+ | _ ->
+ match select_vo_file ~warn loadpath base with
+ | Ok (lpath, file) ->
+ let dir = Libnames.add_dirpath_suffix
+ (CString.List.assoc lpath loadpath) base in
+ (* Look if loaded *)
+ if Library.library_is_loaded dir
+ then Ok (LibLoaded, dir, Library.library_full_filename dir)
+ (* Otherwise, look for it in the file system *)
+ else Ok (LibInPath, dir, file)
+ | Error fail -> Error fail
+
+let error_unmapped_dir qid =
+ let prefix, _ = Libnames.repr_qualid qid in
+ CErrors.user_err ~hdr:"load_absolute_library_from"
+ Pp.(seq [ str "Cannot load "; Libnames.pr_qualid qid; str ":"; spc ()
+ ; str "no physical path bound to"; spc ()
+ ; DP.print prefix; fnl ()
+ ])
+
+let error_lib_not_found qid =
+ CErrors.user_err ~hdr:"load_absolute_library_from"
+ Pp.(seq [ str "Cannot find library "; Libnames.pr_qualid qid; str" in loadpath"])
+
+let try_locate_absolute_library dir =
+ match locate_absolute_library dir with
+ | Ok res -> res
+ | Error LibUnmappedDir ->
+ error_unmapped_dir (Libnames.qualid_of_dirpath dir)
+ | Error LibNotFound ->
+ error_lib_not_found (Libnames.qualid_of_dirpath dir)
+
+(** { 5 Extending the load path } *)
+
+(* Adds a path to the Coq and ML paths *)
+type add_ml = AddNoML | AddTopML | AddRecML
+
+type vo_path_spec = {
+ unix_path : string; (* Filesystem path containing vo/ml files *)
+ coq_path : DP.t; (* Coq prefix for the path *)
+ implicit : bool; (* [implicit = true] avoids having to qualify with [coq_path] *)
+ has_ml : add_ml; (* If [has_ml] is true, the directory will also be search for plugins *)
+}
+
+type coq_path_spec =
+ | VoPath of vo_path_spec
+ | MlPath of string
+
+type coq_path = {
+ path_spec: coq_path_spec;
+ recursive: bool;
+}
+
+let warn_cannot_open_path =
+ CWarnings.create ~name:"cannot-open-path" ~category:"filesystem"
+ (fun unix_path -> Pp.(str "Cannot open " ++ str unix_path))
+
+let warn_cannot_use_directory =
+ CWarnings.create ~name:"cannot-use-directory" ~category:"filesystem"
+ (fun d ->
+ Pp.(str "Directory " ++ str d ++
+ strbrk " cannot be used as a Coq identifier (skipped)"))
+
+let convert_string d =
+ try Names.Id.of_string d
+ with
+ | CErrors.UserError _ ->
+ let d = Unicode.escaped_if_non_utf8 d in
+ warn_cannot_use_directory d;
+ raise Exit
+
+let add_vo_path ~recursive lp =
+ let unix_path = lp.unix_path in
+ let implicit = lp.implicit in
+ if System.exists_dir unix_path then
+ let dirs = if recursive then System.all_subdirs ~unix_path else [] in
+ let prefix = DP.repr lp.coq_path in
+ let convert_dirs (lp, cp) =
+ try
+ let path = List.rev_map convert_string cp @ prefix in
+ Some (lp, DP.make path)
+ with Exit -> None
+ in
+ let dirs = List.map_filter convert_dirs dirs in
+ let add_ml_dir = Mltop.add_ml_dir ~recursive:false in
+ let () = match lp.has_ml with
+ | AddNoML -> ()
+ | AddTopML ->
+ Mltop.add_ml_dir ~recursive:false unix_path
+ | AddRecML ->
+ List.iter (fun (lp,_) -> add_ml_dir lp) dirs;
+ add_ml_dir unix_path in
+ let add (path, dir) = add_load_path path ~implicit dir in
+ let () = List.iter add dirs in
+ add_load_path unix_path ~implicit lp.coq_path
+ else
+ warn_cannot_open_path unix_path
+
+let add_coq_path { recursive; path_spec } = match path_spec with
+ | VoPath lp ->
+ add_vo_path ~recursive lp
+ | MlPath dir ->
+ Mltop.add_ml_dir ~recursive dir
diff --git a/library/loadpath.mli b/vernac/loadpath.mli
index 4044ca1127..47d2d34125 100644
--- a/library/loadpath.mli
+++ b/vernac/loadpath.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -20,19 +20,15 @@ open Names
type t
(** Type of loadpath bindings. *)
-val physical : t -> CUnix.physical_path
-(** Get the physical path (filesystem location) of a loadpath. *)
-
val logical : t -> DirPath.t
(** Get the logical path (Coq module hierarchy) of a loadpath. *)
+val pp : t -> Pp.t
+(** Print a load path *)
+
val get_load_paths : unit -> t list
(** Get the current loadpath association. *)
-val add_load_path : CUnix.physical_path -> DirPath.t -> implicit:bool -> unit
-(** [add_load_path phys log type] adds the binding [phys := log] to the current
- loadpaths. *)
-
val remove_load_path : CUnix.physical_path -> unit
(** Remove the current logical path binding associated to a given physical path,
if any. *)
@@ -41,17 +37,53 @@ val find_load_path : CUnix.physical_path -> t
(** Get the binding associated to a physical path. Raises [Not_found] if there
is none. *)
-val is_in_load_paths : CUnix.physical_path -> bool
-(** Whether a physical path is currently bound. *)
-
-val expand_path : ?root:DirPath.t -> DirPath.t -> (CUnix.physical_path * DirPath.t) list
-(** Given a relative logical path, associate the list of absolute physical and
- logical paths which are possible matches of it. *)
-
-val filter_path : (DirPath.t -> bool) -> (CUnix.physical_path * DirPath.t) list
-(** As {!expand_path} but uses a filter function instead, and ignores the
- implicit status of loadpaths. *)
-
val locate_file : string -> string
(** Locate a file among the registered paths. Do not use this function, as
it does not respect the visibility of paths. *)
+
+(** {6 Locate a library in the load path } *)
+type library_location = LibLoaded | LibInPath
+type locate_error = LibUnmappedDir | LibNotFound
+type 'a locate_result = ('a, locate_error) result
+
+val locate_qualified_library
+ : ?root:DirPath.t
+ -> ?warn:bool
+ -> Libnames.qualid
+ -> (library_location * DirPath.t * CUnix.physical_path) locate_result
+
+(** Locates a library by implicit name.
+
+ @raise LibUnmappedDir if the library is not in the path
+ @raise LibNotFound if there is no corresponding file in the path
+
+*)
+
+val try_locate_absolute_library : DirPath.t -> string
+
+(** {6 Extending the Load Path } *)
+
+(** Adds a path to the Coq and ML paths *)
+type add_ml = AddNoML | AddTopML | AddRecML
+
+type vo_path_spec = {
+ unix_path : string;
+ (** Filesystem path containing vo/ml files *)
+ coq_path : Names.DirPath.t;
+ (** Coq prefix for the path *)
+ implicit : bool;
+ (** [implicit = true] avoids having to qualify with [coq_path] *)
+ has_ml : add_ml;
+ (** If [has_ml] is true, the directory will also be search for plugins *)
+}
+
+type coq_path_spec =
+ | VoPath of vo_path_spec
+ | MlPath of string
+
+type coq_path = {
+ path_spec: coq_path_spec;
+ recursive: bool;
+}
+
+val add_coq_path : coq_path -> unit
diff --git a/vernac/locality.ml b/vernac/locality.ml
index 21be73b39c..bc33d53594 100644
--- a/vernac/locality.ml
+++ b/vernac/locality.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -12,10 +12,9 @@ open Decl_kinds
(** * Managing locality *)
-let local_of_bool = function
- | true -> Local
- | false -> Global
-
+let importability_of_bool = function
+ | true -> ImportNeedQualified
+ | false -> ImportDefaultBehavior
(** Positioning locality for commands supporting discharging and export
outside of modules *)
@@ -28,10 +27,22 @@ let make_non_locality = function Some false -> false | _ -> true
let make_locality = function Some true -> true | _ -> false
+let warn_local_declaration =
+ CWarnings.create ~name:"local-declaration" ~category:"scope"
+ Pp.(fun () ->
+ Pp.strbrk "Interpreting this declaration as if " ++
+ strbrk "a global declaration prefixed by \"Local\", " ++
+ strbrk "i.e. as a global declaration which shall not be " ++
+ strbrk "available without qualification when imported.")
+
let enforce_locality_exp locality_flag discharge =
match locality_flag, discharge with
- | Some b, NoDischarge -> local_of_bool b
- | None, NoDischarge -> Global
+ | Some b, NoDischarge -> Global (importability_of_bool b)
+ | None, NoDischarge -> Global ImportDefaultBehavior
+ | None, DoDischarge when not (Lib.sections_are_opened ()) ->
+ (* If a Let/Variable is defined outside a section, then we consider it as a local definition *)
+ warn_local_declaration ();
+ Global ImportNeedQualified
| None, DoDischarge -> Discharge
| Some true, DoDischarge -> CErrors.user_err Pp.(str "Local not allowed in this case")
| Some false, DoDischarge -> CErrors.user_err Pp.(str "Global not allowed in this case")
diff --git a/vernac/locality.mli b/vernac/locality.mli
index 3c63c82117..be7e0cbe76 100644
--- a/vernac/locality.mli
+++ b/vernac/locality.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/metasyntax.ml b/vernac/metasyntax.ml
index 50914959dc..90892feb13 100644
--- a/vernac/metasyntax.ml
+++ b/vernac/metasyntax.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -732,13 +732,8 @@ type syntax_extension = {
synext_notgram : notation_grammar;
synext_unparsing : unparsing list;
synext_extra : (string * string) list;
- synext_compat : Flags.compat_version option;
}
-let is_active_compat = function
-| None -> true
-| Some v -> 0 <= Flags.version_compare v !Flags.compat_version
-
type syntax_extension_obj = locality_flag * syntax_extension
let check_and_extend_constr_grammar ntn rule =
@@ -759,7 +754,7 @@ let cache_one_syntax_extension se =
let oldprec = Notgram_ops.level_of_notation ~onlyprint ntn in
if not (Notgram_ops.level_eq prec oldprec) then error_incompatible_level ntn oldprec prec;
with Not_found ->
- if is_active_compat se.synext_compat then begin
+ begin
(* Reserve the notation level *)
Notgram_ops.declare_notation_level ntn prec ~onlyprint;
(* Declare the parsing rule *)
@@ -934,10 +929,6 @@ let is_only_printing mods =
let test = function SetOnlyPrinting -> true | _ -> false in
List.exists test mods
-let get_compat_version mods =
- let test = function SetCompatVersion v -> Some v | _ -> None in
- try Some (List.find_map test mods) with Not_found -> None
-
(* Compute precedences from modifiers (or find default ones) *)
let set_entry_type from etyps (x,typ) =
@@ -1177,7 +1168,7 @@ module SynData = struct
(* Fields coming from the vernac-level modifiers *)
only_parsing : bool;
only_printing : bool;
- compat : Flags.compat_version option;
+ deprecation : Deprecation.t option;
format : lstring option;
extra : (string * string) list;
@@ -1222,12 +1213,32 @@ let check_locality_compatibility local custom i_typs =
strbrk " which is local."))
(List.uniquize allcustoms)
-let compute_syntax_data local df modifiers =
+let warn_deprecated_compat =
+ CWarnings.create ~name:"deprecated-compat" ~category:"deprecated"
+ (fun () -> Pp.(str"The \"compat\" modifier is deprecated." ++ spc () ++
+ str"Please use the \"deprecated\" attributed instead."))
+
+(* Returns the new deprecation and the onlyparsing status. This should be
+removed together with the compat syntax modifier. *)
+let merge_compat_deprecation compat deprecation =
+ match compat, deprecation with
+ | Some Flags.Current, _ -> deprecation, true
+ | Some _, Some _ ->
+ CErrors.user_err Pp.(str"The \"compat\" modifier cannot be used with the \"deprecated\" attribute."
+ ++ spc () ++ str"Please use only the latter.")
+ | Some v, None ->
+ warn_deprecated_compat ();
+ Some (Deprecation.make ~since:(Flags.pr_version v) ()), true
+ | None, Some _ -> deprecation, true
+ | None, None -> deprecation, false
+
+let compute_syntax_data ~local deprecation df modifiers =
let open SynData in
let open NotationMods in
let mods = interp_modifiers modifiers in
let onlyprint = mods.only_printing in
let onlyparse = mods.only_parsing in
+ let deprecation, _ = merge_compat_deprecation mods.compat deprecation in
if onlyprint && onlyparse then user_err (str "A notation cannot be both 'only printing' and 'only parsing'.");
let assoc = Option.append mods.assoc (Some Gramlib.Gramext.NonA) in
let (recvars,mainvars,symbols) = analyze_notation_tokens ~onlyprint df in
@@ -1265,7 +1276,7 @@ let compute_syntax_data local df modifiers =
only_parsing = mods.only_parsing;
only_printing = mods.only_printing;
- compat = mods.compat;
+ deprecation;
format = mods.format;
extra = mods.extra;
@@ -1281,9 +1292,9 @@ let compute_syntax_data local df modifiers =
not_data = sy_fulldata;
}
-let compute_pure_syntax_data local df mods =
+let compute_pure_syntax_data ~local df mods =
let open SynData in
- let sd = compute_syntax_data local df mods in
+ let sd = compute_syntax_data ~local None df mods in
let msgs =
if sd.only_parsing then
(Feedback.msg_warning ?loc:None,
@@ -1301,7 +1312,7 @@ type notation_obj = {
notobj_coercion : entry_coercion_kind option;
notobj_onlyparse : bool;
notobj_onlyprint : bool;
- notobj_compat : Flags.compat_version option;
+ notobj_deprecation : Deprecation.t option;
notobj_notation : notation * notation_location;
}
@@ -1323,11 +1334,11 @@ let open_notation i (_, nobj) =
let (ntn, df) = nobj.notobj_notation in
let pat = nobj.notobj_interp in
let onlyprint = nobj.notobj_onlyprint in
+ let deprecation = nobj.notobj_deprecation in
let fresh = not (Notation.exists_notation_in_scope scope ntn onlyprint pat) in
- let active = is_active_compat nobj.notobj_compat in
- if Int.equal i 1 && fresh && active then begin
+ if Int.equal i 1 && fresh then begin
(* Declare the interpretation *)
- let () = Notation.declare_notation_interpretation ntn scope pat df ~onlyprint in
+ let () = Notation.declare_notation_interpretation ntn scope pat df ~onlyprint deprecation in
(* Declare the uninterpretation *)
if not nobj.notobj_onlyparse then
Notation.declare_uninterpretation (NotationRule (scope, ntn)) pat;
@@ -1388,7 +1399,6 @@ let recover_notation_syntax ntn =
synext_notgram = pa_rule;
synext_unparsing = pp_rule;
synext_extra = pp_extra_rules;
- synext_compat = None;
}
with Not_found ->
raise NoSyntaxRule
@@ -1437,7 +1447,6 @@ let make_syntax_rules (sd : SynData.syn_data) = let open SynData in
synext_notgram = { notgram_onlyprinting = sd.only_printing; notgram_rules = pa_rule };
synext_unparsing = pp_rule;
synext_extra = sd.extra;
- synext_compat = sd.compat;
}
(**********************************************************************)
@@ -1447,9 +1456,9 @@ let to_map l =
let fold accu (x, v) = Id.Map.add x v accu in
List.fold_left fold Id.Map.empty l
-let add_notation_in_scope local df env c mods scope =
+let add_notation_in_scope ~local deprecation df env c mods scope =
let open SynData in
- let sd = compute_syntax_data local df mods in
+ let sd = compute_syntax_data ~local deprecation df mods in
(* Prepare the interpretation *)
(* Prepare the parsing and printing rules *)
let sy_rules = make_syntax_rules sd in
@@ -1470,7 +1479,7 @@ let add_notation_in_scope local df env c mods scope =
notobj_onlyparse = onlyparse;
notobj_coercion = coe;
notobj_onlyprint = sd.only_printing;
- notobj_compat = sd.compat;
+ notobj_deprecation = sd.deprecation;
notobj_notation = sd.info;
} in
(* Ready to change the global state *)
@@ -1479,7 +1488,7 @@ let add_notation_in_scope local df env c mods scope =
Lib.add_anonymous_leaf (inNotation notation);
sd.info
-let add_notation_interpretation_core local df env ?(impls=empty_internalization_env) c scope onlyparse onlyprint compat =
+let add_notation_interpretation_core ~local df env ?(impls=empty_internalization_env) c scope onlyparse onlyprint deprecation =
let (recvars,mainvars,symbs) = analyze_notation_tokens ~onlyprint df in
(* Recover types of variables and pa/pp rules; redeclare them if needed *)
let level, i_typs, onlyprint = if not (is_numeral symbs) then begin
@@ -1510,7 +1519,7 @@ let add_notation_interpretation_core local df env ?(impls=empty_internalization_
notobj_onlyparse = onlyparse;
notobj_coercion = coe;
notobj_onlyprint = onlyprint;
- notobj_compat = compat;
+ notobj_deprecation = deprecation;
notobj_notation = df';
} in
Lib.add_anonymous_leaf (inNotation notation);
@@ -1518,41 +1527,40 @@ let add_notation_interpretation_core local df env ?(impls=empty_internalization_
(* Notations without interpretation (Reserved Notation) *)
-let add_syntax_extension local ({CAst.loc;v=df},mods) = let open SynData in
- let psd = compute_pure_syntax_data local df mods in
- let sy_rules = make_syntax_rules {psd with compat = None} in
+let add_syntax_extension ~local ({CAst.loc;v=df},mods) = let open SynData in
+ let psd = compute_pure_syntax_data ~local df mods in
+ let sy_rules = make_syntax_rules {psd with deprecation = None} in
Flags.if_verbose (List.iter (fun (f,x) -> f x)) psd.msgs;
Lib.add_anonymous_leaf (inSyntaxExtension(local,sy_rules))
(* Notations with only interpretation *)
let add_notation_interpretation env ({CAst.loc;v=df},c,sc) =
- let df' = add_notation_interpretation_core false df env c sc false false None in
+ let df' = add_notation_interpretation_core ~local:false df env c sc false false None in
Dumpglob.dump_notation (loc,df') sc true
let set_notation_for_interpretation env impls ({CAst.v=df},c,sc) =
(try ignore
- (Flags.silently (fun () -> add_notation_interpretation_core false df env ~impls c sc false false None) ());
+ (Flags.silently (fun () -> add_notation_interpretation_core ~local:false df env ~impls c sc false false None) ());
with NoSyntaxRule ->
user_err Pp.(str "Parsing rule for this notation has to be previously declared."));
Option.iter (fun sc -> Notation.open_close_scope (false,true,sc)) sc
(* Main entry point *)
-let add_notation local env c ({CAst.loc;v=df},modifiers) sc =
+let add_notation ~local deprecation env c ({CAst.loc;v=df},modifiers) sc =
let df' =
if no_syntax_modifiers modifiers then
(* No syntax data: try to rely on a previously declared rule *)
let onlyparse = is_only_parsing modifiers in
let onlyprint = is_only_printing modifiers in
- let compat = get_compat_version modifiers in
- try add_notation_interpretation_core local df env c sc onlyparse onlyprint compat
+ try add_notation_interpretation_core ~local df env c sc onlyparse onlyprint deprecation
with NoSyntaxRule ->
(* Try to determine a default syntax rule *)
- add_notation_in_scope local df env c modifiers sc
+ add_notation_in_scope ~local deprecation df env c modifiers sc
else
(* Declare both syntax and interpretation *)
- add_notation_in_scope local df env c modifiers sc
+ add_notation_in_scope ~local deprecation df env c modifiers sc
in
Dumpglob.dump_notation (loc,df') sc true
@@ -1566,7 +1574,7 @@ let add_notation_extra_printing_rule df k v =
let inject_var x = CAst.make @@ CRef (qualid_of_ident x,None)
-let add_infix local env ({CAst.loc;v=inf},modifiers) pr sc =
+let add_infix ~local deprecation env ({CAst.loc;v=inf},modifiers) pr sc =
check_infix_modifiers modifiers;
(* check the precedence *)
let vars = names_of_constr_expr pr in
@@ -1575,7 +1583,7 @@ let add_infix local env ({CAst.loc;v=inf},modifiers) pr sc =
let metas = [inject_var x; inject_var y] in
let c = mkAppC (pr,metas) in
let df = CAst.make ?loc @@ Id.to_string x ^" "^(quote_notation_token inf)^" "^Id.to_string y in
- add_notation local env c (df,modifiers) sc
+ add_notation ~local deprecation env c (df,modifiers) sc
(**********************************************************************)
(* Scopes, delimiters and classes bound to scopes *)
@@ -1651,7 +1659,7 @@ let try_interp_name_alias = function
| [], { CAst.v = CRef (ref,_) } -> intern_reference ref
| _ -> raise Not_found
-let add_syntactic_definition env ident (vars,c) local onlyparse =
+let add_syntactic_definition ~local deprecation env ident (vars,c) compat =
let vars,reversibility,pat =
try [], APrioriReversible, NRef (try_interp_name_alias (vars,c))
with Not_found ->
@@ -1665,11 +1673,9 @@ let add_syntactic_definition env ident (vars,c) local onlyparse =
let map id = let (_,sc) = Id.Map.find id nvars in (id, sc) in
List.map map vars, reversibility, pat
in
- let onlyparse = match onlyparse with
- | None when fst (printability None false reversibility pat) -> Some Flags.Current
- | p -> p
- in
- Syntax_def.declare_syntactic_definition local ident onlyparse (vars,pat)
+ let deprecation, onlyparsing = merge_compat_deprecation compat deprecation in
+ let onlyparsing = onlyparsing || fst (printability None false reversibility pat) in
+ Syntax_def.declare_syntactic_definition ~local deprecation ident ~onlyparsing (vars,pat)
(**********************************************************************)
(* Declaration of custom entry *)
diff --git a/vernac/metasyntax.mli b/vernac/metasyntax.mli
index 6435df23c7..44e08c4819 100644
--- a/vernac/metasyntax.mli
+++ b/vernac/metasyntax.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -19,10 +19,10 @@ val add_token_obj : string -> unit
(** Adding a (constr) notation in the environment*)
-val add_infix : locality_flag -> env -> (lstring * syntax_modifier list) ->
+val add_infix : local:bool -> Deprecation.t option -> env -> (lstring * syntax_modifier list) ->
constr_expr -> scope_name option -> unit
-val add_notation : locality_flag -> env -> constr_expr ->
+val add_notation : local:bool -> Deprecation.t option -> env -> constr_expr ->
(lstring * syntax_modifier list) -> scope_name option -> unit
val add_notation_extra_printing_rule : string -> string -> string -> unit
@@ -47,12 +47,12 @@ val set_notation_for_interpretation : env -> Constrintern.internalization_env ->
(** Add only the parsing/printing rule of a notation *)
val add_syntax_extension :
- locality_flag -> (lstring * syntax_modifier list) -> unit
+ local:bool -> (lstring * syntax_modifier list) -> unit
(** Add a syntactic definition (as in "Notation f := ...") *)
-val add_syntactic_definition : env -> Id.t -> Id.t list * constr_expr ->
- bool -> Flags.compat_version option -> unit
+val add_syntactic_definition : local:bool -> Deprecation.t option -> env ->
+ Id.t -> Id.t list * constr_expr -> Flags.compat_version option -> unit
(** Print the Camlp5 state of a grammar *)
diff --git a/vernac/mltop.ml b/vernac/mltop.ml
index 78e26c65d4..0130de2543 100644
--- a/vernac/mltop.ml
+++ b/vernac/mltop.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -159,75 +159,9 @@ let add_ml_dir s =
| _ -> ()
(* For Rec Add ML Path (-R) *)
-let add_rec_ml_dir unix_path =
- List.iter (fun (lp,_) -> add_ml_dir lp) (all_subdirs ~unix_path)
-
-(* Adding files to Coq and ML loadpath *)
-
-let warn_cannot_use_directory =
- CWarnings.create ~name:"cannot-use-directory" ~category:"filesystem"
- (fun d ->
- str "Directory " ++ str d ++
- strbrk " cannot be used as a Coq identifier (skipped)")
-
-let convert_string d =
- try Names.Id.of_string d
- with UserError _ ->
- let d = Unicode.escaped_if_non_utf8 d in
- warn_cannot_use_directory d;
- raise Exit
-
-let warn_cannot_open_path =
- CWarnings.create ~name:"cannot-open-path" ~category:"filesystem"
- (fun unix_path -> str "Cannot open " ++ str unix_path)
-
-type add_ml = AddNoML | AddTopML | AddRecML
-
-type vo_path_spec = {
- unix_path : string;
- coq_path : Names.DirPath.t;
- implicit : bool;
- has_ml : add_ml;
-}
-
-type coq_path_spec =
- | VoPath of vo_path_spec
- | MlPath of string
-
-type coq_path = {
- path_spec: coq_path_spec;
- recursive: bool;
-}
-
-let add_vo_path ~recursive lp =
- let unix_path = lp.unix_path in
- let implicit = lp.implicit in
- if exists_dir unix_path then
- let dirs = if recursive then all_subdirs ~unix_path else [] in
- let prefix = Names.DirPath.repr lp.coq_path in
- let convert_dirs (lp, cp) =
- try
- let path = List.rev_map convert_string cp @ prefix in
- Some (lp, Names.DirPath.make path)
- with Exit -> None
- in
- let dirs = List.map_filter convert_dirs dirs in
- let () = match lp.has_ml with
- | AddNoML -> ()
- | AddTopML -> add_ml_dir unix_path
- | AddRecML -> List.iter (fun (lp,_) -> add_ml_dir lp) dirs; add_ml_dir unix_path in
- let add (path, dir) =
- Loadpath.add_load_path path ~implicit dir in
- let () = List.iter add dirs in
- Loadpath.add_load_path unix_path ~implicit lp.coq_path
- else
- warn_cannot_open_path unix_path
-
-let add_coq_path { recursive; path_spec } = match path_spec with
- | VoPath lp ->
- add_vo_path ~recursive lp
- | MlPath dir ->
- if recursive then add_rec_ml_dir dir else add_ml_dir dir
+let add_ml_dir ~recursive unix_path =
+ let dirs = if recursive then (all_subdirs ~unix_path) else [unix_path,[]] in
+ List.iter (fun (lp,_) -> add_ml_dir lp) dirs
(* convertit un nom quelconque en nom de fichier ou de module *)
let mod_of_name name =
diff --git a/vernac/mltop.mli b/vernac/mltop.mli
index 3d796aa4aa..56a28b64b0 100644
--- a/vernac/mltop.mli
+++ b/vernac/mltop.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -32,6 +32,9 @@ val ocaml_toploop : unit -> unit
(** {5 ML Dynlink} *)
+(** Adds a dir to the plugin search path *)
+val add_ml_dir : recursive:bool -> string -> unit
+
(** Tests if we can load ML files *)
val has_dynlink : bool
@@ -41,27 +44,6 @@ val dir_ml_load : string -> unit
(** Dynamic interpretation of .ml *)
val dir_ml_use : string -> unit
-(** Adds a path to the Coq and ML paths *)
-type add_ml = AddNoML | AddTopML | AddRecML
-
-type vo_path_spec = {
- unix_path : string; (* Filesystem path contaning vo/ml files *)
- coq_path : Names.DirPath.t; (* Coq prefix for the path *)
- implicit : bool; (* [implicit = true] avoids having to qualify with [coq_path] *)
- has_ml : add_ml; (* If [has_ml] is true, the directory will also be search for plugins *)
-}
-
-type coq_path_spec =
- | VoPath of vo_path_spec
- | MlPath of string
-
-type coq_path = {
- path_spec: coq_path_spec;
- recursive: bool;
-}
-
-val add_coq_path : coq_path -> unit
-
(** List of modules linked to the toplevel *)
val add_known_module : string -> unit
val module_is_known : string -> bool
diff --git a/vernac/obligations.ml b/vernac/obligations.ml
index 46c4422d17..aa15718452 100644
--- a/vernac/obligations.ml
+++ b/vernac/obligations.ml
@@ -1,8 +1,15 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
+(************************************************************************)
+
open Printf
-open Libobject
-open Entries
open Decl_kinds
-open Declare
(**
- Get types of existentials ;
@@ -13,7 +20,6 @@ open Declare
open Term
open Constr
-open Context
open Vars
open Names
open Evd
@@ -23,7 +29,7 @@ open Util
module NamedDecl = Context.Named.Declaration
-let get_fix_exn, stm_get_fix_exn = Hook.make ()
+open DeclareObl
let succfix (depth, fixrels) =
(succ depth, List.map succ fixrels)
@@ -163,16 +169,16 @@ let evar_dependencies evm oev =
else aux deps'
in aux (Evar.Set.singleton oev)
-let move_after (id, ev, deps as obl) l =
+let move_after (id, ev, deps as obl) l =
let rec aux restdeps = function
- | (id', _, _) as obl' :: tl ->
+ | (id', _, _) as obl' :: tl ->
let restdeps' = Evar.Set.remove id' restdeps in
if Evar.Set.is_empty restdeps' then
obl' :: obl :: tl
else obl' :: aux restdeps' tl
| [] -> [obl]
in aux (Evar.Set.remove id deps) l
-
+
let sort_dependencies evl =
let rec aux l found list =
match l with
@@ -186,7 +192,7 @@ let sort_dependencies evl =
open Environ
-let eterm_obligations env name evm fs ?status t ty =
+let eterm_obligations env name evm fs ?status t ty =
(* 'Serialize' the evars *)
let nc = Environ.named_context env in
let nc_len = Context.Named.length nc in
@@ -253,10 +259,6 @@ let eterm_obligations env name evm fs ?status t ty =
let evmap f c = pi1 (subst_evar_constr evm evts 0 f c) in
Array.of_list (List.rev evars), (evnames, evmap), t', ty
-let hide_obligation () =
- Coqlib.check_required_library ["Coq";"Program";"Tactics"];
- UnivGen.constr_of_monomorphic_global (Coqlib.lib_ref "program.tactics.obligation")
-
let pperror cmd = CErrors.user_err ~hdr:"Program" cmd
let error s = pperror (str s)
@@ -276,386 +278,27 @@ type obligation_info =
(bool * Evar_kinds.obligation_definition_status)
* Int.Set.t * unit Proofview.tactic option) array
-type 'a obligation_body =
- | DefinedObl of 'a
- | TermObl of constr
-
-type obligation =
- { obl_name : Id.t;
- obl_type : types;
- obl_location : Evar_kinds.t Loc.located;
- obl_body : pconstant obligation_body option;
- obl_status : bool * Evar_kinds.obligation_definition_status;
- obl_deps : Int.Set.t;
- obl_tac : unit Proofview.tactic option;
- }
-
-type obligations = (obligation array * int)
-
-type fixpoint_kind =
- | IsFixpoint of lident option list
- | IsCoFixpoint
-
-type notations = (lstring * Constrexpr.constr_expr * Notation_term.scope_name option) list
-
-type program_info_aux = {
- prg_name: Id.t;
- prg_body: constr;
- prg_type: constr;
- prg_ctx: UState.t;
- prg_univdecl: UState.universe_decl;
- prg_obligations: obligations;
- prg_deps : Id.t list;
- prg_fixkind : fixpoint_kind option ;
- prg_implicits : (Constrexpr.explicitation * (bool * bool * bool)) list;
- prg_notations : notations ;
- prg_kind : definition_kind;
- prg_reduce : constr -> constr;
- prg_hook : Lemmas.declaration_hook option;
- prg_opaque : bool;
- prg_sign: named_context_val;
-}
-
-type program_info = program_info_aux CEphemeron.key
-
-let get_info x =
- try CEphemeron.get x
- with CEphemeron.InvalidKey ->
- CErrors.anomaly Pp.(str "Program obligation can't be accessed by a worker.")
-
let assumption_message = Declare.assumption_message
let default_tactic = ref (Proofview.tclUNIT ())
-(* true = hide obligations *)
-let get_hide_obligations =
- Goptions.declare_bool_option_and_ref
- ~depr:false
- ~name:"Hidding of Program obligations"
- ~key:["Hide";"Obligations"]
- ~value:false
-
-
-let get_shrink_obligations =
- Goptions.declare_bool_option_and_ref
- ~depr:true (* remove in 8.8 *)
- ~name:"Shrinking of Program obligations"
- ~key:["Shrink";"Obligations"]
- ~value:true
-
let evar_of_obligation o = make_evar (Global.named_context_val ()) (EConstr.of_constr o.obl_type)
-let get_obligation_body expand obl =
- match obl.obl_body with
- | None -> None
- | Some c ->
- if expand && snd obl.obl_status == Evar_kinds.Expand then
- match c with
- | DefinedObl pc -> Some (constant_value_in (Global.env ()) pc)
- | TermObl c -> Some c
- else (match c with
- | DefinedObl pc -> Some (mkConstU pc)
- | TermObl c -> Some c)
-
-let obl_substitution expand obls deps =
- Int.Set.fold
- (fun x acc ->
- let xobl = obls.(x) in
- match get_obligation_body expand xobl with
- | None -> acc
- | Some oblb -> (xobl.obl_name, (xobl.obl_type, oblb)) :: acc)
- deps []
-
let subst_deps expand obls deps t =
let osubst = obl_substitution expand obls deps in
(Vars.replace_vars (List.map (fun (n, (_, b)) -> n, b) osubst) t)
-let rec prod_app t n =
- match Constr.kind (EConstr.Unsafe.to_constr (Termops.strip_outer_cast Evd.empty (EConstr.of_constr t))) (* FIXME *) with
- | Prod (_,_,b) -> subst1 n b
- | LetIn (_, b, t, b') -> prod_app (subst1 b b') n
- | _ ->
- user_err ~hdr:"prod_app"
- (str"Needed a product, but didn't find one" ++ fnl ())
-
-
-(* prod_appvect T [| a1 ; ... ; an |] -> (T a1 ... an) *)
-let prod_applist t nL = List.fold_left prod_app t nL
-
-let replace_appvars subst =
- let rec aux c =
- let f, l = decompose_app c in
- if isVar f then
- try
- let c' = List.map (Constr.map aux) l in
- let (t, b) = Id.List.assoc (destVar f) subst in
- mkApp (delayed_force hide_obligation,
- [| prod_applist t c'; applistc b c' |])
- with Not_found -> Constr.map aux c
- else Constr.map aux c
- in Constr.map aux
-
let subst_deps_obl obls obl =
let t' = subst_deps true obls obl.obl_deps obl.obl_type in
{ obl with obl_type = t' }
-module ProgMap = Id.Map
-
-let map_replace k v m = ProgMap.add k (CEphemeron.create v) (ProgMap.remove k m)
-
-let map_keys m = ProgMap.fold (fun k _ l -> k :: l) m []
-
-let from_prg, program_tcc_summary_tag =
- Summary.ref_tag ProgMap.empty ~name:"program-tcc-table"
-
-let close sec =
- if not (ProgMap.is_empty !from_prg) then
- let keys = map_keys !from_prg in
- user_err ~hdr:"Program"
- (str "Unsolved obligations when closing " ++ str sec ++ str":" ++ spc () ++
- prlist_with_sep spc (fun x -> Id.print x) keys ++
- (str (if Int.equal (List.length keys) 1 then " has " else " have ") ++
- str "unsolved obligations"))
-
-let input : program_info ProgMap.t -> obj =
- declare_object
- { (default_object "Program state") with
- cache_function = (fun (na, pi) -> from_prg := pi);
- load_function = (fun _ (_, pi) -> from_prg := pi);
- discharge_function = (fun _ -> close "section"; None);
- classify_function = (fun _ -> close "module"; Dispose) }
-
open Evd
-let progmap_remove prg =
- Lib.add_anonymous_leaf (input (ProgMap.remove prg.prg_name !from_prg))
-
-let progmap_add n prg =
- Lib.add_anonymous_leaf (input (ProgMap.add n prg !from_prg))
-
-let progmap_replace prg' =
- Lib.add_anonymous_leaf (input (map_replace prg'.prg_name prg' !from_prg))
-
-let rec intset_to = function
- -1 -> Int.Set.empty
- | n -> Int.Set.add n (intset_to (pred n))
-
-let subst_prog subst prg =
- if get_hide_obligations () then
- (replace_appvars subst prg.prg_body,
- replace_appvars subst ((* Termops.refresh_universes *) prg.prg_type))
- else
- let subst' = List.map (fun (n, (_, b)) -> n, b) subst in
- (Vars.replace_vars subst' prg.prg_body,
- Vars.replace_vars subst' ((* Termops.refresh_universes *) prg.prg_type))
-
-let obligation_substitution expand prg =
- let obls, _ = prg.prg_obligations in
- let ints = intset_to (pred (Array.length obls)) in
- obl_substitution expand obls ints
-
-let declare_definition prg =
- let varsubst = obligation_substitution true prg in
- let body, typ = subst_prog varsubst prg in
- let nf = UnivSubst.nf_evars_and_universes_opt_subst (fun x -> None)
- (UState.subst prg.prg_ctx) in
- let opaque = prg.prg_opaque in
- let fix_exn = Hook.get get_fix_exn () in
- let typ = nf typ in
- let body = nf body in
- let obls = List.map (fun (id, (_, c)) -> (id, nf c)) varsubst in
- let uvars = Univ.LSet.union
- (Vars.universes_of_constr typ)
- (Vars.universes_of_constr body) in
- let uctx = UState.restrict prg.prg_ctx uvars in
- let univs = UState.check_univ_decl ~poly:(pi2 prg.prg_kind) uctx prg.prg_univdecl in
- let ce = definition_entry ~fix_exn ~opaque ~types:typ ~univs body in
- let () = progmap_remove prg in
- let ubinders = UState.universe_binders uctx in
- let hook_data = Option.map (fun hook -> hook, uctx, obls) prg.prg_hook in
- DeclareDef.declare_definition prg.prg_name
- prg.prg_kind ce ubinders prg.prg_implicits ?hook_data
-
-let rec lam_index n t acc =
- match Constr.kind t with
- | Lambda ({binder_name=Name n'}, _, _) when Id.equal n n' ->
- acc
- | Lambda (_, _, b) ->
- lam_index n b (succ acc)
- | _ -> raise Not_found
-
-let compute_possible_guardness_evidences n fixbody fixtype =
- match n with
- | Some { CAst.loc; v = n } -> [lam_index n fixbody 0]
- | None ->
- (* If recursive argument was not given by user, we try all args.
- An earlier approach was to look only for inductive arguments,
- but doing it properly involves delta-reduction, and it finally
- doesn't seem to worth the effort (except for huge mutual
- fixpoints ?) *)
- let m = Termops.nb_prod Evd.empty (EConstr.of_constr fixtype) (* FIXME *) in
- let ctx = fst (decompose_prod_n_assum m fixtype) in
- List.map_i (fun i _ -> i) 0 ctx
-
-let mk_proof c = ((c, Univ.ContextSet.empty), Safe_typing.empty_private_constants)
-
-let declare_mutual_definition l =
- let len = List.length l in
- let first = List.hd l in
- let defobl x =
- let oblsubst = obligation_substitution true x in
- let subs, typ = subst_prog oblsubst x in
- let env = Global.env () in
- let sigma = Evd.from_ctx x.prg_ctx in
- let r = Retyping.relevance_of_type env sigma (EConstr.of_constr typ) in
- let term = snd (Reductionops.splay_lam_n env sigma len (EConstr.of_constr subs)) in
- let typ = snd (Reductionops.splay_prod_n env sigma len (EConstr.of_constr typ)) in
- let term = EConstr.to_constr sigma term in
- let typ = EConstr.to_constr sigma typ in
- let def = (x.prg_reduce term, r, x.prg_reduce typ, x.prg_implicits) in
- let oblsubst = List.map (fun (id, (_, c)) -> id, c) oblsubst in
- def, oblsubst
- in
- let defs, obls =
- List.fold_right (fun x (defs, obls) ->
- let xdef, xobls = defobl x in
- (xdef :: defs, xobls @ obls)) l ([], [])
- in
-(* let fixdefs = List.map reduce_fix fixdefs in *)
- let fixdefs, fixrs, fixtypes, fiximps = List.split4 defs in
- let fixkind = Option.get first.prg_fixkind in
- let arrrec, recvec = Array.of_list fixtypes, Array.of_list fixdefs in
- let rvec = Array.of_list fixrs in
- let namevec = Array.of_list (List.map (fun x -> Name x.prg_name) l) in
- let fixdecls = (Array.map2 make_annot namevec rvec, arrrec, recvec) in
- let (local,poly,kind) = first.prg_kind in
- let fixnames = first.prg_deps in
- let opaque = first.prg_opaque in
- let kind = if fixkind != IsCoFixpoint then Fixpoint else CoFixpoint in
- let indexes, fixdecls =
- match fixkind with
- | IsFixpoint wfl ->
- let possible_indexes =
- List.map3 compute_possible_guardness_evidences
- wfl fixdefs fixtypes in
- let indexes =
- Pretyping.search_guard (Global.env())
- possible_indexes fixdecls in
- Some indexes,
- List.map_i (fun i _ ->
- mk_proof (mkFix ((indexes,i),fixdecls))) 0 l
- | IsCoFixpoint ->
- None,
- List.map_i (fun i _ ->
- mk_proof (mkCoFix (i,fixdecls))) 0 l
- in
- (* Declare the recursive definitions *)
- let univs = UState.univ_entry ~poly first.prg_ctx in
- let fix_exn = Hook.get get_fix_exn () in
- let kns = List.map4 (DeclareDef.declare_fix ~opaque (local, poly, kind) UnivNames.empty_binders univs)
- fixnames fixdecls fixtypes fiximps in
- (* Declare notations *)
- List.iter (Metasyntax.add_notation_interpretation (Global.env())) first.prg_notations;
- Declare.recursive_message (fixkind != IsCoFixpoint) indexes fixnames;
- let gr = List.hd kns in
- Lemmas.call_hook ?hook:first.prg_hook ~fix_exn first.prg_ctx obls local gr;
- List.iter progmap_remove l; gr
-
-let decompose_lam_prod c ty =
- let open Context.Rel.Declaration in
- let rec aux ctx c ty =
- match Constr.kind c, Constr.kind ty with
- | LetIn (x, b, t, c), LetIn (x', b', t', ty)
- when Constr.equal b b' && Constr.equal t t' ->
- let ctx' = Context.Rel.add (LocalDef (x,b',t')) ctx in
- aux ctx' c ty
- | _, LetIn (x', b', t', ty) ->
- let ctx' = Context.Rel.add (LocalDef (x',b',t')) ctx in
- aux ctx' (lift 1 c) ty
- | LetIn (x, b, t, c), _ ->
- let ctx' = Context.Rel.add (LocalDef (x,b,t)) ctx in
- aux ctx' c (lift 1 ty)
- | Lambda (x, b, t), Prod (x', b', t')
- (* By invariant, must be convertible *) ->
- let ctx' = Context.Rel.add (LocalAssum (x,b')) ctx in
- aux ctx' t t'
- | Cast (c, _, _), _ -> aux ctx c ty
- | _, _ -> ctx, c, ty
- in aux Context.Rel.empty c ty
-
-let shrink_body c ty =
- let ctx, b, ty =
- match ty with
- | None ->
- let ctx, b = decompose_lam_assum c in
- ctx, b, None
- | Some ty ->
- let ctx, b, ty = decompose_lam_prod c ty in
- ctx, b, Some ty
- in
- let b', ty', n, args =
- List.fold_left (fun (b, ty, i, args) decl ->
- if noccurn 1 b && Option.cata (noccurn 1) true ty then
- subst1 mkProp b, Option.map (subst1 mkProp) ty, succ i, args
- else
- let open Context.Rel.Declaration in
- let args = if is_local_assum decl then mkRel i :: args else args in
- mkLambda_or_LetIn decl b, Option.map (mkProd_or_LetIn decl) ty,
- succ i, args)
- (b, ty, 1, []) ctx
- in ctx, b', ty', Array.of_list args
-
let unfold_entry cst = Hints.HintsUnfoldEntry [EvalConstRef cst]
let add_hint local prg cst =
Hints.add_hints ~local [Id.to_string prg.prg_name] (unfold_entry cst)
-let it_mkLambda_or_LetIn_or_clean t ctx =
- let open Context.Rel.Declaration in
- let fold t decl =
- if is_local_assum decl then mkLambda_or_LetIn decl t
- else
- if noccurn 1 t then subst1 mkProp t
- else mkLambda_or_LetIn decl t
- in
- Context.Rel.fold_inside fold ctx ~init:t
-
-let declare_obligation prg obl body ty uctx =
- let body = prg.prg_reduce body in
- let ty = Option.map prg.prg_reduce ty in
- match obl.obl_status with
- | _, Evar_kinds.Expand -> false, { obl with obl_body = Some (TermObl body) }
- | force, Evar_kinds.Define opaque ->
- let opaque = not force && opaque in
- let poly = pi2 prg.prg_kind in
- let ctx, body, ty, args =
- if get_shrink_obligations () && not poly then
- shrink_body body ty else [], body, ty, [||]
- in
- let body = ((body,Univ.ContextSet.empty),Safe_typing.empty_private_constants) in
- let ce =
- { const_entry_body = Future.from_val ~fix_exn:(fun x -> x) body;
- const_entry_secctx = None;
- const_entry_type = ty;
- const_entry_universes = uctx;
- const_entry_opaque = opaque;
- const_entry_inline_code = false;
- const_entry_feedback = None;
- } in
- (* ppedrot: seems legit to have obligations as local *)
- let constant = Declare.declare_constant obl.obl_name ~local:true
- (DefinitionEntry ce,IsProof Property)
- in
- if not opaque then add_hint (Locality.make_section_locality None) prg constant;
- definition_message obl.obl_name;
- let body = match uctx with
- | Polymorphic_entry (_, uctx) ->
- Some (DefinedObl (constant, Univ.UContext.instance uctx))
- | Monomorphic_entry _ ->
- Some (TermObl (it_mkLambda_or_LetIn_or_clean (mkApp (mkConst constant, args)) ctx))
- in
- true, { obl with obl_body = body }
-
let init_prog_info ?(opaque = false) ?hook sign n udecl b t ctx deps fixkind
notations obls impls kind reduce =
let obls', b =
@@ -671,27 +314,27 @@ let init_prog_info ?(opaque = false) ?hook sign n udecl b t ctx deps fixkind
| Some b ->
Array.mapi
(fun i (n, t, l, o, d, tac) ->
- { obl_name = n ; obl_body = None;
+ { obl_name = n ; obl_body = None;
obl_location = l; obl_type = t; obl_status = o;
obl_deps = d; obl_tac = tac })
obls, b
in
let ctx = UState.make_flexible_nonalgebraic ctx in
- { prg_name = n ; prg_body = b; prg_type = reduce t;
+ { prg_name = n ; prg_body = b; prg_type = reduce t;
prg_ctx = ctx; prg_univdecl = udecl;
prg_obligations = (obls', Array.length obls');
prg_deps = deps; prg_fixkind = fixkind ; prg_notations = notations ;
- prg_implicits = impls; prg_kind = kind; prg_reduce = reduce;
+ prg_implicits = impls; prg_kind = kind; prg_reduce = reduce;
prg_hook = hook; prg_opaque = opaque;
prg_sign = sign }
let map_cardinal m =
let i = ref 0 in
ProgMap.iter (fun _ v ->
- if snd (CEphemeron.get v).prg_obligations > 0 then incr i) m;
+ if snd (CEphemeron.get v).prg_obligations > 0 then incr i) m;
!i
-exception Found of program_info
+exception Found of program_info CEphemeron.key
let map_first m =
try
@@ -702,28 +345,28 @@ let map_first m =
with Found x -> x
let get_prog name =
- let prg_infos = !from_prg in
+ let prg_infos = get_prg_info_map () in
match name with
Some n ->
- (try get_info (ProgMap.find n prg_infos)
+ (try CEphemeron.get (ProgMap.find n prg_infos)
with Not_found -> raise (NoObligations (Some n)))
| None ->
(let n = map_cardinal prg_infos in
match n with
0 -> raise (NoObligations None)
- | 1 -> get_info (map_first prg_infos)
+ | 1 -> CEphemeron.get (map_first prg_infos)
| _ ->
let progs = Id.Set.elements (ProgMap.domain prg_infos) in
let prog = List.hd progs in
let progs = prlist_with_sep pr_comma Id.print progs in
- user_err
+ user_err
(str "More than one program with unsolved obligations: " ++ progs
++ str "; use the \"of\" clause to specify, as in \"Obligation 1 of " ++ Id.print prog ++ str "\""))
let get_any_prog () =
- let prg_infos = !from_prg in
+ let prg_infos = get_prg_info_map () in
let n = map_cardinal prg_infos in
- if n > 0 then get_info (map_first prg_infos)
+ if n > 0 then CEphemeron.get (map_first prg_infos)
else raise (NoObligations None)
let get_prog_err n =
@@ -732,42 +375,8 @@ let get_prog_err n =
let get_any_prog_err () =
try get_any_prog () with NoObligations id -> pperror (explain_no_obligations id)
-let obligations_solved prg = Int.equal (snd prg.prg_obligations) 0
-
let all_programs () =
- ProgMap.fold (fun k p l -> p :: l) !from_prg []
-
-type progress =
- | Remain of int
- | Dependent
- | Defined of GlobRef.t
-
-let obligations_message rem =
- if rem > 0 then
- if Int.equal rem 1 then
- Flags.if_verbose Feedback.msg_info (int rem ++ str " obligation remaining")
- else
- Flags.if_verbose Feedback.msg_info (int rem ++ str " obligations remaining")
- else
- Flags.if_verbose Feedback.msg_info (str "No more obligations remaining")
-
-let update_obls prg obls rem =
- let prg' = { prg with prg_obligations = (obls, rem) } in
- progmap_replace prg';
- obligations_message rem;
- if rem > 0 then Remain rem
- else (
- match prg'.prg_deps with
- | [] ->
- let kn = declare_definition prg' in
- progmap_remove prg';
- Defined kn
- | l ->
- let progs = List.map (fun x -> get_info (ProgMap.find x !from_prg)) prg'.prg_deps in
- if List.for_all (fun x -> obligations_solved x) progs then
- let kn = declare_mutual_definition progs in
- Defined kn
- else Dependent)
+ ProgMap.fold (fun k p l -> p :: l) (get_prg_info_map ()) []
let is_defined obls x = not (Option.is_empty obls.(x).obl_body)
@@ -778,30 +387,18 @@ let deps_remaining obls deps =
else x :: acc)
deps []
-let dependencies obls n =
- let res = ref Int.Set.empty in
- Array.iteri
- (fun i obl ->
- if not (Int.equal i n) && Int.Set.mem n obl.obl_deps then
- res := Int.Set.add i !res)
- obls;
- !res
-let goal_kind poly = Decl_kinds.Local, poly, Decl_kinds.DefinitionBody Decl_kinds.Definition
+let goal_kind poly =
+ Decl_kinds.(Global ImportNeedQualified, poly, DefinitionBody Definition)
-let goal_proof_kind poly = Decl_kinds.Local, poly, Decl_kinds.Proof Decl_kinds.Lemma
+let goal_proof_kind poly =
+ Decl_kinds.(Global ImportNeedQualified, poly, Proof Lemma)
let kind_of_obligation poly o =
match o with
| Evar_kinds.Define false | Evar_kinds.Expand -> goal_kind poly
| _ -> goal_proof_kind poly
-let not_transp_msg =
- str "Obligation should be transparent but was declared opaque." ++ spc () ++
- str"Use 'Defined' instead."
-
-let err_not_transp () = pperror not_transp_msg
-
let rec string_of_list sep f = function
[] -> ""
| x :: [] -> f x
@@ -820,11 +417,11 @@ let solve_by_tac ?loc name evi t poly ctx =
Pfedit.build_constant_by_tactic
id ~goal_kind:(goal_kind poly) ctx evi.evar_hyps evi.evar_concl t in
let env = Global.env () in
- let entry = Safe_typing.inline_private_constants_in_definition_entry env entry in
- let body, () = Future.force entry.const_entry_body in
+ let (body, eff) = Future.force entry.Proof_global.proof_entry_body in
+ let body = Safe_typing.inline_private_constants env (body, eff.Evd.seff_private) in
let ctx' = Evd.merge_context_set ~sideff:true Evd.univ_rigid (Evd.from_ctx ctx') (snd body) in
Inductiveops.control_only_guard env ctx' (EConstr.of_constr (fst body));
- Some (fst body, entry.const_entry_type, Evd.evar_universe_context ctx')
+ Some (fst body, entry.Proof_global.proof_entry_type, Evd.evar_universe_context ctx')
with
| Refiner.FailError (_, s) as exn ->
let _ = CErrors.push exn in
@@ -837,80 +434,12 @@ let solve_by_tac ?loc name evi t poly ctx =
warn_solve_errored ?loc err;
None
-let obligation_terminator ?hook name num guard auto pf =
- let open Proof_global in
- let term = Lemmas.standard_proof_terminator ?hook guard in
- match pf with
- | Admitted _ -> apply_terminator term pf
- | Proved (opq, id, { entries=[entry]; universes=uctx } ) -> begin
- let env = Global.env () in
- let entry = Safe_typing.inline_private_constants_in_definition_entry env entry in
- let ty = entry.Entries.const_entry_type in
- let (body, cstr), () = Future.force entry.Entries.const_entry_body in
- let sigma = Evd.from_ctx uctx in
- let sigma = Evd.merge_context_set ~sideff:true Evd.univ_rigid sigma cstr in
- Inductiveops.control_only_guard (Global.env ()) sigma (EConstr.of_constr body);
- (* Declare the obligation ourselves and drop the hook *)
- let prg = get_info (ProgMap.find name !from_prg) in
- (* Ensure universes are substituted properly in body and type *)
- let body = EConstr.to_constr sigma (EConstr.of_constr body) in
- let ty = Option.map (fun x -> EConstr.to_constr sigma (EConstr.of_constr x)) ty in
- let ctx = Evd.evar_universe_context sigma in
- let obls, rem = prg.prg_obligations in
- let obl = obls.(num) in
- let status =
- match obl.obl_status, opq with
- | (_, Evar_kinds.Expand), Opaque -> err_not_transp ()
- | (true, _), Opaque -> err_not_transp ()
- | (false, _), Opaque -> Evar_kinds.Define true
- | (_, Evar_kinds.Define true), Transparent ->
- Evar_kinds.Define false
- | (_, status), Transparent -> status
- in
- let obl = { obl with obl_status = false, status } in
- let ctx =
- if pi2 prg.prg_kind then ctx
- else UState.union prg.prg_ctx ctx
- in
- let uctx = UState.univ_entry ~poly:(pi2 prg.prg_kind) ctx in
- let (defined, obl) = declare_obligation prg obl body ty uctx in
- let obls = Array.copy obls in
- let () = obls.(num) <- obl in
- let prg_ctx =
- if pi2 (prg.prg_kind) then (* Polymorphic *)
- (* We merge the new universes and constraints of the
- polymorphic obligation with the existing ones *)
- UState.union prg.prg_ctx ctx
- else
- (* The first obligation, if defined,
- declares the univs of the constant,
- each subsequent obligation declares its own additional
- universes and constraints if any *)
- if defined then UState.make (Global.universes ())
- else ctx
- in
- let prg = { prg with prg_ctx } in
- try
- ignore (update_obls prg obls (pred rem));
- if pred rem > 0 then
- begin
- let deps = dependencies obls num in
- if not (Int.Set.is_empty deps) then
- ignore (auto (Some name) None deps)
- end
- with e when CErrors.noncritical e ->
- let e = CErrors.push e in
- pperror (CErrors.iprint (ExplainErr.process_vernac_interp_error e))
- end
- | Proved (_, _, _ ) ->
- CErrors.anomaly Pp.(str "[obligation_terminator] close_proof returned more than one proof term")
-
let obligation_hook prg obl num auto ctx' _ _ gr =
let obls, rem = prg.prg_obligations in
let cst = match gr with GlobRef.ConstRef cst -> cst | _ -> assert false in
let transparent = evaluable_constant cst (Global.env ()) in
let () = match obl.obl_status with
- (true, Evar_kinds.Expand)
+ (true, Evar_kinds.Expand)
| (true, Evar_kinds.Define true) ->
if not transparent then err_not_transp ()
| _ -> ()
@@ -941,10 +470,10 @@ let obligation_hook prg obl num auto ctx' _ _ gr =
if pred rem > 0 then begin
let deps = dependencies obls num in
if not (Int.Set.is_empty deps) then
- ignore (auto (Some prg.prg_name) None deps)
+ ignore (auto (Some prg.prg_name) deps None)
end
-let rec solve_obligation ~ontop prg num tac =
+let rec solve_obligation prg num tac =
let user_num = succ num in
let obls, rem = prg.prg_obligations in
let obl = obls.(num) in
@@ -960,24 +489,22 @@ let rec solve_obligation ~ontop prg num tac =
let kind = kind_of_obligation (pi2 prg.prg_kind) (snd obl.obl_status) in
let evd = Evd.from_ctx prg.prg_ctx in
let evd = Evd.update_sigma_env evd (Global.env ()) in
- let auto n tac oblset = auto_solve_obligations n ~oblset tac in
- let terminator ?hook guard =
- Proof_global.make_terminator
- (obligation_terminator prg.prg_name num guard ?hook auto) in
- let hook = Lemmas.mk_hook (obligation_hook prg obl num auto) in
- let pstate = Lemmas.start_proof ~ontop ~sign:prg.prg_sign obl.obl_name kind evd (EConstr.of_constr obl.obl_type) ~terminator ~hook in
- let pstate = fst @@ Pfedit.by !default_tactic pstate in
- let pstate = Option.cata (fun tac -> Proof_global.set_endline_tactic tac pstate) pstate tac in
- pstate
-
-and obligation ~ontop (user_num, name, typ) tac =
+ let auto n oblset tac = auto_solve_obligations n ~oblset tac in
+ let proof_ending = Lemmas.Proof_ending.End_obligation (DeclareObl.{name = prg.prg_name; num; auto}) in
+ let hook = DeclareDef.Hook.make (obligation_hook prg obl num auto) in
+ let lemma = Lemmas.start_lemma ~sign:prg.prg_sign obl.obl_name kind evd (EConstr.of_constr obl.obl_type) ~proof_ending ~hook in
+ let lemma = fst @@ Lemmas.by !default_tactic lemma in
+ let lemma = Option.cata (fun tac -> Lemmas.set_endline_tactic tac lemma) lemma tac in
+ lemma
+
+and obligation (user_num, name, typ) tac =
let num = pred user_num in
let prg = get_prog_err name in
let obls, rem = prg.prg_obligations in
if num >= 0 && num < Array.length obls then
let obl = obls.(num) in
match obl.obl_body with
- | None -> solve_obligation ~ontop prg num tac
+ | None -> solve_obligation prg num tac
| Some r -> error "Obligation already solved"
else error (sprintf "Unknown obligation number %i" (succ num))
@@ -1046,7 +573,7 @@ and solve_obligations n tac =
solve_prg_obligations prg tac
and solve_all_obligations tac =
- ProgMap.iter (fun k v -> ignore(solve_prg_obligations (get_info v) tac)) !from_prg
+ ProgMap.iter (fun k v -> ignore(solve_prg_obligations (CEphemeron.get v) tac)) (get_prg_info_map ())
and try_solve_obligation n prg tac =
let prg = get_prog prg in
@@ -1088,9 +615,9 @@ let show_obligations ?(msg=true) n =
let progs = match n with
| None -> all_programs ()
| Some n ->
- try [ProgMap.find n !from_prg]
+ try [ProgMap.find n (get_prg_info_map ())]
with Not_found -> raise (NoObligations (Some n))
- in List.iter (fun x -> show_obligations_of_prg ~msg (get_info x)) progs
+ in List.iter (fun x -> show_obligations_of_prg ~msg (CEphemeron.get x)) progs
let show_term n =
let prg = get_prog_err n in
@@ -1102,7 +629,7 @@ let show_term n =
++ Printer.pr_constr_env env sigma prg.prg_body)
let add_definition n ?term t ctx ?(univdecl=UState.default_univ_decl)
- ?(implicits=[]) ?(kind=Global,false,Definition) ?tactic
+ ?(implicits=[]) ?(kind=Global ImportDefaultBehavior,false,Definition) ?tactic
?(reduce=reduce) ?hook ?(opaque = false) obls =
let sign = Lemmas.initialize_named_context_for_proof () in
let info = Id.print n ++ str " has type-checked" in
@@ -1110,8 +637,8 @@ let add_definition n ?term t ctx ?(univdecl=UState.default_univ_decl)
let obls,_ = prg.prg_obligations in
if Int.equal (Array.length obls) 0 then (
Flags.if_verbose Feedback.msg_info (info ++ str ".");
- let cst = declare_definition prg in
- Defined cst)
+ let cst = DeclareObl.declare_definition prg in
+ Defined cst)
else (
let len = Array.length obls in
let () = Flags.if_verbose Feedback.msg_info (info ++ str ", generating " ++ int len ++ str (String.plural len " obligation")) in
@@ -1122,7 +649,7 @@ let add_definition n ?term t ctx ?(univdecl=UState.default_univ_decl)
| _ -> res)
let add_mutual_definitions l ctx ?(univdecl=UState.default_univ_decl) ?tactic
- ?(kind=Global,false,Definition) ?(reduce=reduce)
+ ?(kind=Global ImportDefaultBehavior,false,Definition) ?(reduce=reduce)
?hook ?(opaque = false) notations fixkind =
let sign = Lemmas.initialize_named_context_for_proof () in
let deps = List.map (fun (n, b, t, imps, obls) -> n) l in
@@ -1137,8 +664,8 @@ let add_mutual_definitions l ctx ?(univdecl=UState.default_univ_decl) ?tactic
else
let res = auto_solve_obligations (Some x) tactic in
match res with
- | Defined _ ->
- (* If one definition is turned into a constant,
+ | Defined _ ->
+ (* If one definition is turned into a constant,
the whole block is defined. *) true
| _ -> false)
false deps
@@ -1147,14 +674,14 @@ let add_mutual_definitions l ctx ?(univdecl=UState.default_univ_decl) ?tactic
let admit_prog prg =
let obls, rem = prg.prg_obligations in
let obls = Array.copy obls in
- Array.iteri
+ Array.iteri
(fun i x ->
match x.obl_body with
| None ->
let x = subst_deps_obl obls x in
let ctx = UState.univ_entry ~poly:false prg.prg_ctx in
- let kn = Declare.declare_constant x.obl_name ~local:true
- (ParameterEntry (None,(x.obl_type,ctx),None), IsAssumption Conjectural)
+ let kn = Declare.declare_constant x.obl_name ~local:ImportNeedQualified
+ (Declare.ParameterEntry (None,(x.obl_type,ctx),None), IsAssumption Conjectural)
in
assumption_message x.obl_name;
obls.(i) <- { x with obl_body = Some (DefinedObl (kn, Univ.Instance.empty)) }
@@ -1177,7 +704,7 @@ let admit_obligations n =
let prg = get_prog_err n in
admit_prog prg
-let next_obligation ~ontop n tac =
+let next_obligation n tac =
let prg = match n with
| None -> get_any_prog_err ()
| Some _ -> get_prog_err n
@@ -1188,7 +715,7 @@ let next_obligation ~ontop n tac =
| Some i -> i
| None -> anomaly (Pp.str "Could not find a solvable obligation.")
in
- solve_obligation ~ontop prg i tac
+ solve_obligation prg i tac
let check_program_libraries () =
Coqlib.check_required_library Coqlib.datatypes_module_name;
diff --git a/vernac/obligations.mli b/vernac/obligations.mli
index 9214ddd4b9..a0010a5026 100644
--- a/vernac/obligations.mli
+++ b/vernac/obligations.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -13,11 +13,6 @@ open Constr
open Evd
open Names
-(* This is a hack to make it possible for Obligations to craft a Qed
- * behind the scenes. The fix_exn the Stm attaches to the Future proof
- * is not available here, so we provide a side channel to get it *)
-val stm_get_fix_exn : (unit -> Exninfo.iexn -> Exninfo.iexn) Hook.t
-
val check_evars : env -> evar_map -> unit
val evar_dependencies : evar_map -> Evar.t -> Evar.Set.t
@@ -45,11 +40,6 @@ type obligation_info =
(* ident, type, location, (opaque or transparent, expand or define),
dependencies, tactic to solve it *)
-type progress = (* Resolution status of a program *)
- | Remain of int (* n obligations remaining *)
- | Dependent (* Dependent on other definitions *)
- | Defined of GlobRef.t (* Defined as id *)
-
val default_tactic : unit Proofview.tactic ref
val add_definition
@@ -57,47 +47,38 @@ val add_definition
-> ?term:constr -> types
-> UState.t
-> ?univdecl:UState.universe_decl (* Universe binders and constraints *)
- -> ?implicits:(Constrexpr.explicitation * (bool * bool * bool)) list
+ -> ?implicits:Impargs.manual_implicits
-> ?kind:Decl_kinds.definition_kind
-> ?tactic:unit Proofview.tactic
-> ?reduce:(constr -> constr)
- -> ?hook:Lemmas.declaration_hook
+ -> ?hook:DeclareDef.Hook.t
-> ?opaque:bool
-> obligation_info
- -> progress
-
-type notations =
- (lstring * Constrexpr.constr_expr * Notation_term.scope_name option) list
-
-type fixpoint_kind =
- | IsFixpoint of lident option list
- | IsCoFixpoint
+ -> DeclareObl.progress
val add_mutual_definitions :
- (Names.Id.t * constr * types *
- (Constrexpr.explicitation * (bool * bool * bool)) list * obligation_info) list ->
+ (Names.Id.t * constr * types * Impargs.manual_implicits * obligation_info) list ->
UState.t ->
?univdecl:UState.universe_decl -> (* Universe binders and constraints *)
?tactic:unit Proofview.tactic ->
?kind:Decl_kinds.definition_kind ->
?reduce:(constr -> constr) ->
- ?hook:Lemmas.declaration_hook -> ?opaque:bool ->
- notations ->
- fixpoint_kind -> unit
+ ?hook:DeclareDef.Hook.t -> ?opaque:bool ->
+ DeclareObl.notations ->
+ DeclareObl.fixpoint_kind -> unit
val obligation
- : ontop:Proof_global.t option
- -> int * Names.Id.t option * Constrexpr.constr_expr option
+ : int * Names.Id.t option * Constrexpr.constr_expr option
-> Genarg.glob_generic_argument option
- -> Proof_global.t
+ -> Lemmas.t
val next_obligation
- : ontop:Proof_global.t option
- -> Names.Id.t option
+ : Names.Id.t option
-> Genarg.glob_generic_argument option
- -> Proof_global.t
+ -> Lemmas.t
-val solve_obligations : Names.Id.t option -> unit Proofview.tactic option -> progress
+val solve_obligations : Names.Id.t option -> unit Proofview.tactic option
+ -> DeclareObl.progress
(* Number of remaining obligations to be solved for this program *)
val solve_all_obligations : unit Proofview.tactic option -> unit
@@ -117,6 +98,3 @@ exception NoObligations of Names.Id.t option
val explain_no_obligations : Names.Id.t option -> Pp.t
val check_program_libraries : unit -> unit
-
-type program_info
-val program_tcc_summary_tag : program_info Id.Map.t Summary.Dyn.tag
diff --git a/vernac/ppvernac.ml b/vernac/ppvernac.ml
index f2332bab8b..4f053b98ae 100644
--- a/vernac/ppvernac.ml
+++ b/vernac/ppvernac.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -39,8 +39,8 @@ open Pputils
pr_sep_com spc @@ pr_lconstr_expr env sigma
let pr_uconstraint (l, d, r) =
- pr_glob_level l ++ spc () ++ Univ.pr_constraint_type d ++ spc () ++
- pr_glob_level r
+ pr_glob_sort_name l ++ spc () ++ Univ.pr_constraint_type d ++ spc () ++
+ pr_glob_sort_name r
let pr_univ_name_list = function
| None -> mt ()
@@ -359,6 +359,8 @@ open Pputils
keyword (if many then "Variables" else "Variable")
| (DoDischarge,Conjectural) ->
anomaly (Pp.str "Don't know how to beautify a local conjecture.")
+ | (_,Context) ->
+ anomaly (Pp.str "Context is used only internally.")
let pr_params pr_c (xl,(c,t)) =
hov 2 (prlist_with_sep sep pr_lident xl ++ spc() ++
@@ -628,7 +630,6 @@ open Pputils
let pr_showable = function
| ShowGoal n -> keyword "Show" ++ pr_goal_reference n
| ShowProof -> keyword "Show Proof"
- | ShowScript -> keyword "Show Script"
| ShowExistentials -> keyword "Show Existentials"
| ShowUniverses -> keyword "Show Universes"
| ShowProofNames -> keyword "Show Conjectures"
@@ -911,7 +912,7 @@ open Pputils
spc() ++ pr_class_rawexpr c2)
)
- | VernacInstance (sup, (instid, bk, cl), props, info) ->
+ | VernacInstance (instid, sup, cl, props, info) ->
return (
hov 1 (
keyword "Instance" ++
@@ -920,7 +921,6 @@ open Pputils
| { v = Anonymous }, _ -> mt ()) ++
pr_and_type_binders_arg sup ++
str":" ++ spc () ++
- (match bk with Implicit -> str "! " | Explicit -> mt ()) ++
pr_constr env sigma cl ++ pr_hint_info (pr_constr_pattern_expr env sigma) info ++
(match props with
| Some (true, { v = CRecord l}) -> spc () ++ str":=" ++ spc () ++ str"{" ++ pr_record_body l ++ str "}"
@@ -929,13 +929,12 @@ open Pputils
| None -> mt()))
)
- | VernacDeclareInstance (sup, (instid, bk, cl), info) ->
+ | VernacDeclareInstance (instid, sup, cl, info) ->
return (
hov 1 (
keyword "Declare Instance" ++ spc () ++ pr_ident_decl instid ++ spc () ++
pr_and_type_binders_arg sup ++
str":" ++ spc () ++
- (match bk with Implicit -> str "! " | Explicit -> mt ()) ++
pr_constr env sigma cl ++ pr_hint_info (pr_constr_pattern_expr env sigma) info)
)
@@ -1049,7 +1048,7 @@ open Pputils
| Some Flags.Current -> [SetOnlyParsing]
| Some v -> [SetCompatVersion v]))
)
- | VernacArguments (q, args, more_implicits, nargs, mods) ->
+ | VernacArguments (q, args, more_implicits, nargs, nargs_before_bidi, mods) ->
return (
hov 2 (
keyword "Arguments" ++ spc() ++
@@ -1060,22 +1059,23 @@ open Pputils
| Impargs.Implicit -> str "[" ++ x ++ str "]"
| Impargs.MaximallyImplicit -> str "{" ++ x ++ str "}"
| Impargs.NotImplicit -> x in
- let rec print_arguments n l =
- match n, l with
- | Some 0, l -> spc () ++ str"/" ++ print_arguments None l
- | _, [] -> mt()
- | n, { name = id; recarg_like = k;
+ let rec print_arguments n nbidi l =
+ match n, nbidi, l with
+ | Some 0, _, l -> spc () ++ str"/" ++ print_arguments None nbidi l
+ | _, Some 0, l -> spc () ++ str"|" ++ print_arguments n None l
+ | _, _, [] -> mt()
+ | n, nbidi, { name = id; recarg_like = k;
notation_scope = s;
implicit_status = imp } :: tl ->
spc() ++ pr_br imp (pr_if k (str"!") ++ Name.print id ++ pr_s s) ++
- print_arguments (Option.map pred n) tl
+ print_arguments (Option.map pred n) (Option.map pred nbidi) tl
in
let rec print_implicits = function
| [] -> mt ()
| (name, impl) :: rest ->
spc() ++ pr_br impl (Name.print name) ++ print_implicits rest
in
- print_arguments nargs args ++
+ print_arguments nargs nargs_before_bidi args ++
if not (List.is_empty more_implicits) then
prlist (fun l -> str"," ++ print_implicits l) more_implicits
else (mt ()) ++
@@ -1088,7 +1088,8 @@ open Pputils
| `Assert -> keyword "assert"
| `ExtraScopes -> keyword "extra scopes"
| `ClearImplicits -> keyword "clear implicits"
- | `ClearScopes -> keyword "clear scopes")
+ | `ClearScopes -> keyword "clear scopes"
+ | `ClearBidiHint -> keyword "clear bidirectionality hint")
mods)
)
| VernacReserve bl ->
diff --git a/vernac/ppvernac.mli b/vernac/ppvernac.mli
index 4aa24bf5db..d4d49a09a3 100644
--- a/vernac/ppvernac.mli
+++ b/vernac/ppvernac.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/proof_using.ml b/vernac/proof_using.ml
index 1d089d0a55..094e2c1184 100644
--- a/vernac/proof_using.ml
+++ b/vernac/proof_using.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/proof_using.mli b/vernac/proof_using.mli
index 702043a4a9..a0567eef47 100644
--- a/vernac/proof_using.mli
+++ b/vernac/proof_using.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/pvernac.ml b/vernac/pvernac.ml
index 4d9157089c..da28e260b3 100644
--- a/vernac/pvernac.ml
+++ b/vernac/pvernac.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/pvernac.mli b/vernac/pvernac.mli
index 41a2e7fd6f..c9eb979a90 100644
--- a/vernac/pvernac.mli
+++ b/vernac/pvernac.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/record.ml b/vernac/record.ml
index f737a8c524..9e3353bc54 100644
--- a/vernac/record.ml
+++ b/vernac/record.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -125,7 +125,7 @@ let typecheck_params_and_fields finite def poly pl ps records =
let env = EConstr.push_rel_context newps env0 in
let poly =
match t with
- | { CAst.v = CSort (Glob_term.GType []) } -> true | _ -> false in
+ | { CAst.v = CSort (Glob_term.UAnonymous {rigid=true}) } -> true | _ -> false in
let sigma, s = interp_type_evars ~program_mode:false env sigma ~impls:empty_internalization_env t in
let sred = Reductionops.whd_allnolet env sigma s in
(match EConstr.kind sigma sred with
@@ -342,16 +342,17 @@ let declare_projections indsp ctx ?(kind=StructureComponent) binder_name flags f
let projtyp =
it_mkProd_or_LetIn (mkProd (x,rp,ccl)) paramdecls in
try
+ let open Proof_global in
let entry = {
- const_entry_body =
- Future.from_val (Safe_typing.mk_pure_proof proj);
- const_entry_secctx = None;
- const_entry_type = Some projtyp;
- const_entry_universes = ctx;
- const_entry_opaque = false;
- const_entry_inline_code = false;
- const_entry_feedback = None } in
- let k = (DefinitionEntry entry,IsDefinition kind) in
+ proof_entry_body =
+ Future.from_val ((proj, Univ.ContextSet.empty), Evd.empty_side_effects);
+ proof_entry_secctx = None;
+ proof_entry_type = Some projtyp;
+ proof_entry_universes = ctx;
+ proof_entry_opaque = false;
+ proof_entry_inline_code = false;
+ proof_entry_feedback = None } in
+ let k = (Declare.DefinitionEntry entry,IsDefinition kind) in
let kn = declare_constant ~internal:InternalTacticRequest fid k in
let constr_fip =
let proj_args = (*Rel 1 refers to "x"*) paramargs@[mkRel 1] in
@@ -476,21 +477,15 @@ let declare_structure ~cum finite ubinders univs paramimpls params template ?(ki
List.mapi map record_data
let implicits_of_context ctx =
- List.map_i (fun i name ->
- let explname =
- match name with
- | Name n -> Some n
- | Anonymous -> None
- in ExplByPos (i, explname), (true, true, true))
- 1 (List.rev (Anonymous :: (List.map RelDecl.get_name ctx)))
+ List.map (fun name -> CAst.make (Some (name,true)))
+ (List.rev (Anonymous :: (List.map RelDecl.get_name ctx)))
let declare_class def cum ubinders univs id idbuild paramimpls params arity
template fieldimpls fields ?(kind=StructureComponent) coers priorities =
let fieldimpls =
(* Make the class implicit in the projections, and the params if applicable. *)
- let len = List.length params in
let impls = implicits_of_context params in
- List.map (fun x -> impls @ Impargs.lift_implicits (succ len) x) fieldimpls
+ List.map (fun x -> impls @ x) fieldimpls
in
let binder_name = Namegen.next_ident_away id (Termops.vars_of_env (Global.env())) in
let data =
@@ -588,12 +583,14 @@ let declare_class def cum ubinders univs id idbuild paramimpls params arity
let add_constant_class env sigma cst =
let ty, univs = Typeops.type_of_global_in_context env (ConstRef cst) in
let r = (Environ.lookup_constant cst env).const_relevance in
- let ctx, arity = decompose_prod_assum ty in
+ let ctx, _ = decompose_prod_assum ty in
+ let args = Context.Rel.to_extended_vect Constr.mkRel 0 ctx in
+ let t = mkApp (mkConstU (cst, Univ.make_abstract_instance univs), args) in
let tc =
{ cl_univs = univs;
cl_impl = ConstRef cst;
cl_context = (List.map (const None) ctx, ctx);
- cl_props = [LocalAssum (make_annot Anonymous r, arity)];
+ cl_props = [LocalAssum (make_annot Anonymous r, t)];
cl_projs = [];
cl_strict = !typeclasses_strict;
cl_unique = !typeclasses_unique
@@ -702,7 +699,7 @@ let definition_structure udecl kind ~template cum poly finite records =
declare_class def cum ubinders univs id.CAst.v idbuild
implpars params arity template implfs fields coers priorities
| _ ->
- let map impls = implpars @ Impargs.lift_implicits (succ (List.length params)) impls in
+ let map impls = implpars @ [CAst.make None] @ impls in
let data = List.map (fun (arity, implfs, fields) -> (arity, List.map map implfs, fields)) data in
let map (arity, implfs, fields) (is_coe, id, _, cfs, idbuild, _) =
let coe = List.map (fun (_, { rf_subclass ; rf_canonical }) ->
diff --git a/vernac/record.mli b/vernac/record.mli
index 24bb27e107..11d9a833e2 100644
--- a/vernac/record.mli
+++ b/vernac/record.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/search.ml b/vernac/search.ml
index e41378908f..a7f1dd33c2 100644
--- a/vernac/search.ml
+++ b/vernac/search.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -28,7 +28,7 @@ type display_function = GlobRef.t -> env -> constr -> unit
[SearchAbout ...], etc. to the names of the symbols matching the
query, separated by a newline. This type of output is useful for
editors (like emacs), to generate a list of completion candidates
-without having to parse thorugh the types of all symbols. *)
+without having to parse through the types of all symbols. *)
type glob_search_about_item =
| GlobSearchSubPattern of constr_pattern
@@ -200,12 +200,10 @@ let full_name_of_reference ref =
DirPath.to_string dir ^ "." ^ Id.to_string id
(** Whether a reference is blacklisted *)
-let blacklist_filter_aux () =
- let l = SearchBlacklist.elements () in
- fun ref env typ ->
+let blacklist_filter ref env typ =
let name = full_name_of_reference ref in
let is_not_bl str = not (String.string_contains ~where:name ~what:str) in
- List.for_all is_not_bl l
+ CString.Set.for_all is_not_bl (SearchBlacklist.v ())
let module_filter (mods, outside) ref env typ =
let sp = Nametab.path_of_global ref in
@@ -227,7 +225,6 @@ let search_about_filter query gr env typ = match query with
(** SearchPattern *)
let search_pattern ?pstate gopt pat mods pr_search =
- let blacklist_filter = blacklist_filter_aux () in
let filter ref env typ =
module_filter mods ref env typ &&
pattern_filter pat ref env (Evd.from_env env) (* FIXME *) (EConstr.of_constr typ) &&
@@ -251,7 +248,6 @@ let rewrite_pat2 pat =
let search_rewrite ?pstate gopt pat mods pr_search =
let pat1 = rewrite_pat1 pat in
let pat2 = rewrite_pat2 pat in
- let blacklist_filter = blacklist_filter_aux () in
let filter ref env typ =
module_filter mods ref env typ &&
(pattern_filter pat1 ref env (Evd.from_env env) (* FIXME *) (EConstr.of_constr typ) ||
@@ -266,7 +262,6 @@ let search_rewrite ?pstate gopt pat mods pr_search =
(** Search *)
let search_by_head ?pstate gopt pat mods pr_search =
- let blacklist_filter = blacklist_filter_aux () in
let filter ref env typ =
module_filter mods ref env typ &&
head_filter pat ref env (Evd.from_env env) (* FIXME *) (EConstr.of_constr typ) &&
@@ -280,7 +275,6 @@ let search_by_head ?pstate gopt pat mods pr_search =
(** SearchAbout *)
let search_about ?pstate gopt items mods pr_search =
- let blacklist_filter = blacklist_filter_aux () in
let filter ref env typ =
let eqb b1 b2 = if b1 then b2 else not b2 in
module_filter mods ref env typ &&
@@ -324,7 +318,6 @@ let interface_search ?pstate =
let (name, tpe, subtpe, mods, blacklist) =
extract_flags [] [] [] [] false flags
in
- let blacklist_filter = blacklist_filter_aux () in
let filter_function ref env constr =
let id = Names.Id.to_string (Nametab.basename_of_global ref) in
let path = Libnames.dirpath (Nametab.path_of_global ref) in
@@ -378,6 +371,3 @@ let interface_search ?pstate =
in
let () = generic_search ?pstate glnum iter in
!ans
-
-let blacklist_filter ref env typ =
- blacklist_filter_aux () ref env typ
diff --git a/vernac/search.mli b/vernac/search.mli
index 0f94ddc5b6..029e8cf7b9 100644
--- a/vernac/search.mli
+++ b/vernac/search.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/topfmt.ml b/vernac/topfmt.ml
index bf2efb2542..7644f4c5b6 100644
--- a/vernac/topfmt.ml
+++ b/vernac/topfmt.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/topfmt.mli b/vernac/topfmt.mli
index 3d522a9e0f..dc4642dc65 100644
--- a/vernac/topfmt.mli
+++ b/vernac/topfmt.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/vernac.mllib b/vernac/vernac.mllib
index 7f5c265eea..d28eeb341d 100644
--- a/vernac/vernac.mllib
+++ b/vernac/vernac.mllib
@@ -11,15 +11,16 @@ Egramml
Vernacextend
Ppvernac
Proof_using
-Lemmas
-Canonical
-Class
Egramcoq
Metasyntax
+DeclareDef
+DeclareObl
+Canonical
+Lemmas
+Class
Auto_ind_decl
Search
Indschemes
-DeclareDef
Obligations
ComDefinition
Classes
@@ -32,6 +33,7 @@ Assumptions
Vernacstate
Mltop
Topfmt
+Loadpath
Vernacentries
Misctypes
diff --git a/vernac/vernacentries.ml b/vernac/vernacentries.ml
index 918852239a..222f727f8e 100644
--- a/vernac/vernacentries.ml
+++ b/vernac/vernacentries.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -38,24 +38,25 @@ module NamedDecl = Context.Named.Declaration
let (f_interp_redexp, interp_redexp_hook) = Hook.make ()
let debug = false
+
(* XXX Should move to a common library *)
let vernac_pperr_endline pp =
if debug then Format.eprintf "@[%a@]@\n%!" Pp.pp_with (pp ()) else ()
-(* Misc *)
-
-let there_are_pending_proofs ~pstate =
- not Option.(is_empty pstate)
-
-let check_no_pending_proof ~pstate =
- if there_are_pending_proofs ~pstate then
- user_err Pp.(str "Command not supported (Open proofs remain)")
+(* Utility functions, at some point they should all disappear and
+ instead enviroment/state selection should be done at the Vernac DSL
+ level. *)
-let vernac_require_open_proof ~pstate f =
- match pstate with
- | Some pstate -> f ~pstate
+(* EJGA: Only used in close_proof, can remove once the ?proof hack is no more *)
+let vernac_require_open_lemma ~stack f =
+ match stack with
+ | Some stack -> f ~stack
| None -> user_err Pp.(str "Command not supported (No proof-editing in progress)")
+let with_pstate ~stack f =
+ vernac_require_open_lemma ~stack
+ (fun ~stack -> Stack.with_top_pstate stack ~f:(fun pstate -> f ~pstate))
+
let get_current_or_global_context ~pstate =
match pstate with
| None -> let env = Global.env () in Evd.(from_env env, env)
@@ -80,7 +81,7 @@ module DefAttributes = struct
locality : bool option;
polymorphic : bool;
program : bool;
- deprecated : deprecation option;
+ deprecated : Deprecation.t option;
}
let parse f =
@@ -91,6 +92,26 @@ module DefAttributes = struct
{ polymorphic; program; locality; deprecated }
end
+let module_locality = Attributes.Notations.(locality >>= fun l -> return (make_module_locality l))
+
+let with_locality ~atts f =
+ let local = Attributes.(parse locality atts) in
+ f ~local
+
+let with_section_locality ~atts f =
+ let local = Attributes.(parse locality atts) in
+ let section_local = make_section_locality local in
+ f ~section_local
+
+let with_module_locality ~atts f =
+ let module_local = Attributes.(parse module_locality atts) in
+ f ~module_local
+
+let with_def_attributes ~atts f =
+ let atts = DefAttributes.parse atts in
+ if atts.DefAttributes.program then Obligations.check_program_libraries ();
+ f ~atts
+
(*******************)
(* "Show" commands *)
@@ -98,7 +119,7 @@ let show_proof ~pstate =
(* spiwack: this would probably be cooler with a bit of polishing. *)
try
let pstate = Option.get pstate in
- let p = Proof_global.give_me_the_proof pstate in
+ let p = Proof_global.get_proof pstate in
let sigma, env = Pfedit.get_current_context pstate in
let pprf = Proof.partial_proof p in
Pp.prlist_with_sep Pp.fnl (Printer.pr_econstr_env env sigma) pprf
@@ -108,24 +129,21 @@ let show_proof ~pstate =
| Option.IsNone ->
user_err (str "No goals to show.")
-let show_top_evars ~pstate =
+let show_top_evars ~proof =
(* spiwack: new as of Feb. 2010: shows goal evars in addition to non-goal evars. *)
- let pfts = Proof_global.give_me_the_proof pstate in
- let Proof.{goals;shelf;given_up;sigma} = Proof.data pfts in
+ let Proof.{goals;shelf;given_up;sigma} = Proof.data proof in
pr_evars_int sigma ~shelf ~given_up 1 (Evd.undefined_map sigma)
-let show_universes ~pstate =
- let pfts = Proof_global.give_me_the_proof pstate in
- let Proof.{goals;sigma} = Proof.data pfts in
+let show_universes ~proof =
+ let Proof.{goals;sigma} = Proof.data proof in
let ctx = Evd.universe_context_set (Evd.minimize_universes sigma) in
Termops.pr_evar_universe_context (Evd.evar_universe_context sigma) ++ fnl () ++
str "Normalized constraints: " ++ Univ.pr_universe_context_set (Termops.pr_evd_level sigma) ctx
(* Simulate the Intro(s) tactic *)
-let show_intro ~pstate all =
+let show_intro ~proof all =
let open EConstr in
- let pf = Proof_global.give_me_the_proof pstate in
- let Proof.{goals;sigma} = Proof.data pf in
+ let Proof.{goals;sigma} = Proof.data proof in
if not (List.is_empty goals) then begin
let gl = {Evd.it=List.hd goals ; sigma = sigma; } in
let l,_= decompose_prod_assum sigma (Termops.strip_outer_cast sigma (pf_concl gl)) in
@@ -201,11 +219,6 @@ let show_match id =
(* "Print" commands *)
-let print_path_entry p =
- let dir = DirPath.print (Loadpath.logical p) in
- let path = str (CUnix.escaped_string_of_physical_path (Loadpath.physical p)) in
- Pp.hov 2 (dir ++ spc () ++ path)
-
let print_loadpath dir =
let l = Loadpath.get_load_paths () in
let l = match dir with
@@ -215,7 +228,7 @@ let print_loadpath dir =
List.filter filter l
in
str "Logical Path / Physical path:" ++ fnl () ++
- prlist_with_sep fnl print_path_entry l
+ prlist_with_sep fnl Loadpath.pp l
let print_modules () =
let opened = Library.opened_libraries ()
@@ -410,7 +423,7 @@ let universe_subgraph ?loc g univ =
let open Univ in
let sigma = Evd.from_env (Global.env()) in
let univs_of q =
- let q = Glob_term.(GType (UNamed q)) in
+ let q = Glob_term.(GType q) in
(* this function has a nice error message for not found univs *)
LSet.singleton (Pretyping.interp_known_glob_level ?loc sigma q)
in
@@ -444,9 +457,9 @@ let locate_file f =
str file
let msg_found_library = function
- | Library.LibLoaded, fulldir, file ->
+ | Loadpath.LibLoaded, fulldir, file ->
hov 0 (DirPath.print fulldir ++ strbrk " has been loaded from file " ++ str file)
- | Library.LibInPath, fulldir, file ->
+ | Loadpath.LibInPath, fulldir, file ->
hov 0 (DirPath.print fulldir ++ strbrk " is bound to file " ++ str file)
let err_unmapped_library ?from qid =
@@ -471,10 +484,11 @@ let err_notfound_library ?from qid =
(strbrk "Unable to locate library " ++ pr_qualid qid ++ prefix)
let print_located_library qid =
- try msg_found_library (Library.locate_qualified_library ~warn:false qid)
- with
- | Library.LibUnmappedDir -> err_unmapped_library qid
- | Library.LibNotFound -> err_notfound_library qid
+ let open Loadpath in
+ match locate_qualified_library ~warn:false qid with
+ | Ok lib -> msg_found_library lib
+ | Error LibUnmappedDir -> err_unmapped_library qid
+ | Error LibNotFound -> err_notfound_library qid
let smart_global r =
let gr = Smartlocate.smart_global r in
@@ -491,7 +505,7 @@ let dump_global r =
let vernac_syntax_extension ~module_local infix l =
if infix then Metasyntax.check_infix_modifiers (snd l);
- Metasyntax.add_syntax_extension module_local l
+ Metasyntax.add_syntax_extension ~local:module_local l
let vernac_declare_scope ~module_local sc =
Metasyntax.declare_scope module_local sc
@@ -510,11 +524,13 @@ let vernac_open_close_scope ~section_local (b,s) =
let vernac_arguments_scope ~section_local r scl =
Notation.declare_arguments_scope section_local (smart_global r) scl
-let vernac_infix ~module_local =
- Metasyntax.add_infix module_local (Global.env())
+let vernac_infix ~atts =
+ let module_local, deprecation = Attributes.(parse Notations.(module_locality ++ deprecation) atts) in
+ Metasyntax.add_infix ~local:module_local deprecation (Global.env())
-let vernac_notation ~module_local =
- Metasyntax.add_notation module_local (Global.env())
+let vernac_notation ~atts =
+ let module_local, deprecation = Attributes.(parse Notations.(module_locality ++ deprecation) atts) in
+ Metasyntax.add_notation ~local:module_local deprecation (Global.env())
let vernac_custom_entry ~module_local s =
Metasyntax.declare_custom_entry module_local s
@@ -544,7 +560,7 @@ let () =
(***********)
(* Gallina *)
-let start_proof_and_print ~program_mode ~pstate ?hook k l =
+let start_proof_and_print ~program_mode ?hook k l =
let inference_hook =
if program_mode then
let hook env sigma ev =
@@ -566,82 +582,97 @@ let start_proof_and_print ~program_mode ~pstate ?hook k l =
in Some hook
else None
in
- start_proof_com ~program_mode ~ontop:pstate ?inference_hook ?hook k l
+ start_lemma_com ~program_mode ?inference_hook ?hook k l
let vernac_definition_hook p = function
| Coercion ->
Some (Class.add_coercion_hook p)
| CanonicalStructure ->
- Some (Lemmas.mk_hook (fun _ _ _ -> Canonical.declare_canonical_structure))
+ Some (DeclareDef.Hook.make (fun _ _ _ -> Canonical.declare_canonical_structure))
| SubClass ->
Some (Class.add_subclass_hook p)
| _ -> None
-let vernac_definition ~atts ~pstate discharge kind ({loc;v=id}, pl) def =
+let fresh_name_for_anonymous_theorem () =
+ Namegen.next_global_ident_away Lemmas.default_thm_id Id.Set.empty
+
+let vernac_definition_name lid local =
+ let lid =
+ match lid with
+ | { v = Name.Anonymous; loc } ->
+ CAst.make ?loc (fresh_name_for_anonymous_theorem ())
+ | { v = Name.Name n; loc } -> CAst.make ?loc n in
+ let () =
+ match local with
+ | Discharge -> Dumpglob.dump_definition lid true "var"
+ | Global _ -> Dumpglob.dump_definition lid false "def"
+ in
+ lid
+
+let vernac_definition_interactive ~atts (discharge, kind) (lid, pl) bl t =
let open DefAttributes in
let local = enforce_locality_exp atts.locality discharge in
let hook = vernac_definition_hook atts.polymorphic kind in
- let () =
- match id with
- | Anonymous -> ()
- | Name n -> let lid = CAst.make ?loc n in
- match local with
- | Discharge -> Dumpglob.dump_definition lid true "var"
- | Local | Global -> Dumpglob.dump_definition lid false "def"
- in
let program_mode = atts.program in
- let name =
- match id with
- | Anonymous -> fresh_name_for_anonymous_theorem ~pstate
- | Name n -> n
- in
- (match def with
- | ProveBody (bl,t) -> (* local binders, typ *)
- Some (start_proof_and_print ~program_mode ~pstate (local, atts.polymorphic, DefinitionBody kind)
- ?hook [(CAst.make ?loc name, pl), (bl, t)])
- | DefineBody (bl,red_option,c,typ_opt) ->
- let red_option = match red_option with
- | None -> None
- | Some r ->
- let sigma, env = get_current_or_global_context ~pstate in
- Some (snd (Hook.get f_interp_redexp env sigma r)) in
- ComDefinition.do_definition ~program_mode name
- (local, atts.polymorphic, kind) pl bl red_option c typ_opt ?hook;
- pstate
- )
-
-let vernac_start_proof ~atts ~pstate kind l =
+ let name = vernac_definition_name lid local in
+ start_proof_and_print ~program_mode (local, atts.polymorphic, DefinitionBody kind) ?hook [(name, pl), (bl, t)]
+
+let vernac_definition ~atts (discharge, kind) (lid, pl) bl red_option c typ_opt =
+ let open DefAttributes in
+ let local = enforce_locality_exp atts.locality discharge in
+ let hook = vernac_definition_hook atts.polymorphic kind in
+ let program_mode = atts.program in
+ let name = vernac_definition_name lid local in
+ let red_option = match red_option with
+ | None -> None
+ | Some r ->
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
+ Some (snd (Hook.get f_interp_redexp env sigma r)) in
+ ComDefinition.do_definition ~program_mode name.v
+ (local, atts.polymorphic, kind) pl bl red_option c typ_opt ?hook
+
+(* NB: pstate argument to use combinators easily *)
+let vernac_start_proof ~atts kind l =
let open DefAttributes in
let local = enforce_locality_exp atts.locality NoDischarge in
if Dumpglob.dump () then
List.iter (fun ((id, _), _) -> Dumpglob.dump_definition id false "prf") l;
- Some (start_proof_and_print ~pstate ~program_mode:atts.program (local, atts.polymorphic, Proof kind) l)
+ start_proof_and_print ~program_mode:atts.program (local, atts.polymorphic, Proof kind) l
-let vernac_end_proof ?pstate ?proof = function
+let vernac_end_proof ?stack ?proof = let open Vernacexpr in function
| Admitted ->
- vernac_require_open_proof ~pstate (save_proof_admitted ?proof);
- pstate
+ vernac_require_open_lemma ~stack (fun ~stack ->
+ let lemma, stack = Stack.pop stack in
+ save_lemma_admitted ?proof ~lemma;
+ stack)
| Proved (opaque,idopt) ->
- save_proof_proved ?pstate ?proof ~opaque ~idopt
+ let lemma, stack = match stack with
+ | None -> None, None
+ | Some stack ->
+ let lemma, stack = Stack.pop stack in
+ Some lemma, stack
+ in
+ save_lemma_proved ?lemma ?proof ~opaque ~idopt;
+ stack
-let vernac_exact_proof ~pstate c =
+let vernac_exact_proof ~lemma c =
(* spiwack: for simplicity I do not enforce that "Proof proof_term" is
- called only at the begining of a proof. *)
- let pstate, status = Pfedit.by (Tactics.exact_proof c) pstate in
- let pstate = save_proof_proved ?proof:None ~pstate ~opaque:Proof_global.Opaque ~idopt:None in
- if not status then Feedback.feedback Feedback.AddedAxiom;
- pstate
+ called only at the beginning of a proof. *)
+ let lemma, status = Lemmas.by (Tactics.exact_proof c) lemma in
+ let () = save_lemma_proved ?proof:None ~lemma ~opaque:Proof_global.Opaque ~idopt:None in
+ if not status then Feedback.feedback Feedback.AddedAxiom
let vernac_assumption ~atts discharge kind l nl =
let open DefAttributes in
let local = enforce_locality_exp atts.locality discharge in
- let global = local == Global in
let kind = local, atts.polymorphic, kind in
List.iter (fun (is_coe,(idl,c)) ->
if Dumpglob.dump () then
List.iter (fun (lid, _) ->
- if global then Dumpglob.dump_definition lid false "ax"
- else Dumpglob.dump_definition lid true "var") idl) l;
+ match local with
+ | Global _ -> Dumpglob.dump_definition lid false "ax"
+ | Discharge -> Dumpglob.dump_definition lid true "var") idl) l;
let status = ComAssumption.do_assumptions ~program_mode:atts.program kind nl l in
if not status then Feedback.feedback Feedback.AddedAxiom
@@ -808,30 +839,46 @@ let vernac_inductive ~atts cum lo finite indl =
in vernac_record cum (Class true) atts.polymorphic finite [id, bl, c, None, [f]]
*)
-let vernac_fixpoint ~atts ~pstate discharge l : Proof_global.t option =
- let open DefAttributes in
- let local = enforce_locality_exp atts.locality discharge in
+let vernac_fixpoint_common ~atts discharge l =
if Dumpglob.dump () then
List.iter (fun (((lid,_), _, _, _, _), _) -> Dumpglob.dump_definition lid false "def") l;
- (* XXX: Switch to the attribute system and match on ~atts *)
- let do_fixpoint = if atts.program then
- fun local sign l -> ComProgramFixpoint.do_fixpoint local sign l; None
- else
- ComFixpoint.do_fixpoint ~ontop:pstate
- in
- do_fixpoint local atts.polymorphic l
+ enforce_locality_exp atts.DefAttributes.locality discharge
-let vernac_cofixpoint ~atts ~pstate discharge l =
+let vernac_fixpoint_interactive ~atts discharge l =
let open DefAttributes in
- let local = enforce_locality_exp atts.locality discharge in
+ let local = vernac_fixpoint_common ~atts discharge l in
+ if atts.program then
+ CErrors.user_err Pp.(str"Program Fixpoint requires a body");
+ ComFixpoint.do_fixpoint_interactive local atts.polymorphic l
+
+let vernac_fixpoint ~atts discharge l =
+ let open DefAttributes in
+ let local = vernac_fixpoint_common ~atts discharge l in
+ if atts.program then
+ (* XXX: Switch to the attribute system and match on ~atts *)
+ ComProgramFixpoint.do_fixpoint local atts.polymorphic l
+ else
+ ComFixpoint.do_fixpoint local atts.polymorphic l
+
+let vernac_cofixpoint_common ~atts discharge l =
if Dumpglob.dump () then
List.iter (fun (((lid,_), _, _, _), _) -> Dumpglob.dump_definition lid false "def") l;
- let do_cofixpoint = if atts.program then
- fun local sign l -> ComProgramFixpoint.do_cofixpoint local sign l; None
- else
- ComFixpoint.do_cofixpoint ~ontop:pstate
- in
- do_cofixpoint local atts.polymorphic l
+ enforce_locality_exp atts.DefAttributes.locality discharge
+
+let vernac_cofixpoint_interactive ~atts discharge l =
+ let open DefAttributes in
+ let local = vernac_cofixpoint_common ~atts discharge l in
+ if atts.program then
+ CErrors.user_err Pp.(str"Program CoFixpoint requires a body");
+ ComFixpoint.do_cofixpoint_interactive local atts.polymorphic l
+
+let vernac_cofixpoint ~atts discharge l =
+ let open DefAttributes in
+ let local = vernac_cofixpoint_common ~atts discharge l in
+ if atts.program then
+ ComProgramFixpoint.do_cofixpoint local atts.polymorphic l
+ else
+ ComFixpoint.do_cofixpoint local atts.polymorphic l
let vernac_scheme l =
if Dumpglob.dump () then
@@ -887,14 +934,13 @@ let vernac_declare_module export {loc;v=id} binders_ast mty_ast =
Flags.if_verbose Feedback.msg_info (str "Module " ++ Id.print id ++ str " is declared");
Option.iter (fun export -> vernac_import export [qualid_of_ident id]) export
-let vernac_define_module ~pstate export {loc;v=id} (binders_ast : module_binder list) mty_ast_o mexpr_ast_l =
+let vernac_define_module export {loc;v=id} (binders_ast : module_binder list) mty_ast_o mexpr_ast_l =
(* We check the state of the system (in section, in module type)
and what module information is supplied *)
if Lib.sections_are_opened () then
user_err Pp.(str "Modules and Module Types are not allowed inside sections.");
match mexpr_ast_l with
| [] ->
- check_no_pending_proof ~pstate;
let binders_ast,argsexport =
List.fold_right
(fun (export,idl,ty) (args,argsexport) ->
@@ -934,13 +980,12 @@ let vernac_end_module export {loc;v=id} =
Flags.if_verbose Feedback.msg_info (str "Module " ++ Id.print id ++ str " is defined");
Option.iter (fun export -> vernac_import export [qualid_of_ident ?loc id]) export
-let vernac_declare_module_type ~pstate {loc;v=id} binders_ast mty_sign mty_ast_l =
+let vernac_declare_module_type {loc;v=id} binders_ast mty_sign mty_ast_l =
if Lib.sections_are_opened () then
user_err Pp.(str "Modules and Module Types are not allowed inside sections.");
match mty_ast_l with
| [] ->
- check_no_pending_proof ~pstate;
let binders_ast,argsexport =
List.fold_right
(fun (export,idl,ty) (args,argsexport) ->
@@ -987,8 +1032,7 @@ let vernac_include l =
(* Sections *)
-let vernac_begin_section ~pstate ({v=id} as lid) =
- check_no_pending_proof ~pstate;
+let vernac_begin_section ({v=id} as lid) =
Dumpglob.dump_definition lid true "sec";
Lib.open_section id
@@ -1001,8 +1045,7 @@ let vernac_name_sec_hyp {v=id} set = Proof_using.name_set id set
(* Dispatcher of the "End" command *)
-let vernac_end_segment ~pstate ({v=id} as lid) =
- check_no_pending_proof ~pstate;
+let vernac_end_segment ({v=id} as lid) =
match Lib.find_opening_node id with
| Lib.OpenedModule (false,export,_,_) -> vernac_end_module export lid
| Lib.OpenedModule (true,_,_,_) -> vernac_end_modtype lid
@@ -1026,18 +1069,18 @@ let vernac_require from import qidl =
Some (Libnames.add_dirpath_suffix hd tl)
in
let locate qid =
- try
- let warn = not !Flags.quiet in
- let (_, dir, f) = Library.locate_qualified_library ?root ~warn qid in
- (dir, f)
- with
- | Library.LibUnmappedDir -> err_unmapped_library ?from:root qid
- | Library.LibNotFound -> err_notfound_library ?from:root qid
+ let open Loadpath in
+ let warn = not !Flags.quiet in
+ match locate_qualified_library ?root ~warn qid with
+ | Ok (_,dir,f) -> dir, f
+ | Error LibUnmappedDir -> err_unmapped_library ?from:root qid
+ | Error LibNotFound -> err_notfound_library ?from:root qid
in
let modrefl = List.map locate qidl in
if Dumpglob.dump () then
List.iter2 (fun {CAst.loc} dp -> Dumpglob.dump_libref ?loc dp "lib") qidl (List.map fst modrefl);
- Library.require_library_from_dirpath modrefl import
+ let lib_resolver = Loadpath.try_locate_absolute_library in
+ Library.require_library_from_dirpath ~lib_resolver modrefl import
(* Coercions and canonical structures *)
@@ -1062,18 +1105,42 @@ let vernac_identity_coercion ~atts id qids qidt =
(* Type classes *)
-let vernac_instance ~atts sup inst props pri =
- let open DefAttributes in
- let global = not (make_section_locality atts.locality) in
- Dumpglob.dump_constraint (fst (pi1 inst)) false "inst";
- let program_mode = atts.program in
- Classes.new_instance ~program_mode ~global atts.polymorphic sup inst props pri
+let vernac_instance_program ~atts name bl t props info =
+ Dumpglob.dump_constraint (fst name) false "inst";
+ let (program, locality), polymorphic =
+ Attributes.(parse (Notations.(program ++ locality ++ polymorphic))) atts
+ in
+ let global = not (make_section_locality locality) in
+ let _id : Id.t = Classes.new_instance_program ~global polymorphic name bl t props info in
+ ()
+
+let vernac_instance_interactive ~atts name bl t info =
+ Dumpglob.dump_constraint (fst name) false "inst";
+ let (program, locality), polymorphic =
+ Attributes.(parse (Notations.(program ++ locality ++ polymorphic))) atts
+ in
+ let global = not (make_section_locality locality) in
+ let _id, pstate =
+ Classes.new_instance_interactive ~global polymorphic name bl t info in
+ pstate
-let vernac_declare_instance ~atts sup inst pri =
- let open DefAttributes in
- let global = not (make_section_locality atts.locality) in
- Dumpglob.dump_definition (fst (pi1 inst)) false "inst";
- Classes.declare_new_instance ~program_mode:atts.program ~global atts.polymorphic sup inst pri
+let vernac_instance ~atts name bl t props info =
+ Dumpglob.dump_constraint (fst name) false "inst";
+ let (program, locality), polymorphic =
+ Attributes.(parse (Notations.(program ++ locality ++ polymorphic))) atts
+ in
+ let global = not (make_section_locality locality) in
+ let _id : Id.t =
+ Classes.new_instance ~global polymorphic name bl t props info in
+ ()
+
+let vernac_declare_instance ~atts id bl inst pri =
+ Dumpglob.dump_definition (fst id) false "inst";
+ let (program, locality), polymorphic =
+ Attributes.(parse (Notations.(program ++ locality ++ polymorphic))) atts
+ in
+ let global = not (make_section_locality locality) in
+ Classes.declare_new_instance ~program_mode:program ~global polymorphic id bl inst pri
let vernac_context ~poly l =
if not (ComAssumption.context poly l) then Feedback.feedback Feedback.AddedAxiom
@@ -1098,7 +1165,7 @@ let focus_command_cond = Proof.no_cond command_focus
all tactics fail if there are no further goals to prove. *)
let vernac_solve_existential ~pstate n com =
- Proof_global.simple_with_current_proof (fun _ p ->
+ Proof_global.map_proof (fun p ->
let intern env sigma = Constrintern.intern_constr env sigma com in
Proof.V82.instantiate_evar (Global.env ()) n intern p) pstate
@@ -1108,23 +1175,20 @@ let vernac_set_end_tac ~pstate tac =
(* TO DO verifier s'il faut pas mettre exist s | TacId s ici*)
Proof_global.set_endline_tactic tac pstate
-let vernac_set_used_variables ~(pstate : Proof_global.t) e : Proof_global.t =
+let vernac_set_used_variables ~pstate e : Proof_global.t =
let env = Global.env () in
let initial_goals pf = Proofview.initial_goals Proof.(data pf).Proof.entry in
- let tys =
- List.map snd (initial_goals (Proof_global.give_me_the_proof pstate)) in
+ let tys = List.map snd (initial_goals (Proof_global.get_proof pstate)) in
let tys = List.map EConstr.Unsafe.to_constr tys in
let l = Proof_using.process_expr env e tys in
let vars = Environ.named_context env in
- List.iter (fun id ->
+ List.iter (fun id ->
if not (List.exists (NamedDecl.get_id %> Id.equal id) vars) then
user_err ~hdr:"vernac_set_used_variables"
(str "Unknown variable: " ++ Id.print id))
l;
let _, pstate = Proof_global.set_used_variables pstate l in
- fst @@ Proof_global.with_current_proof begin fun _ p ->
- (p, ())
- end pstate
+ pstate
(*****************************)
(* Auxiliary file management *)
@@ -1133,7 +1197,7 @@ let expand filename =
Envars.expand_path_macros ~warn:(fun x -> Feedback.msg_warning (str x)) filename
let vernac_add_loadpath implicit pdir ldiropt =
- let open Mltop in
+ let open Loadpath in
let pdir = expand pdir in
let alias = Option.default Libnames.default_root_prefix ldiropt in
add_coq_path { recursive = true;
@@ -1141,11 +1205,10 @@ let vernac_add_loadpath implicit pdir ldiropt =
let vernac_remove_loadpath path =
Loadpath.remove_load_path (expand path)
-
(* Coq syntax for ML or system commands *)
let vernac_add_ml_path isrec path =
- let open Mltop in
+ let open Loadpath in
add_coq_path { recursive = isrec; path_spec = MlPath (expand path) }
let vernac_declare_ml_module ~local l =
@@ -1205,9 +1268,40 @@ let vernac_hints ~atts dbnames h =
let local = enforce_module_locality local in
Hints.add_hints ~local dbnames (Hints.interp_hints poly h)
-let vernac_syntactic_definition ~module_local lid x y =
+let vernac_syntactic_definition ~atts lid x compat =
+ let module_local, deprecation = Attributes.(parse Notations.(module_locality ++ deprecation) atts) in
Dumpglob.dump_definition lid false "syndef";
- Metasyntax.add_syntactic_definition (Global.env()) lid.v x module_local y
+ Metasyntax.add_syntactic_definition ~local:module_local deprecation (Global.env()) lid.v x compat
+
+let cache_bidi_hints (_name, (gr, ohint)) =
+ match ohint with
+ | None -> Pretyping.clear_bidirectionality_hint gr
+ | Some nargs -> Pretyping.add_bidirectionality_hint gr nargs
+
+let load_bidi_hints _ r =
+ cache_bidi_hints r
+
+let subst_bidi_hints (subst, (gr, ohint as orig)) =
+ let gr' = subst_global_reference subst gr in
+ if gr == gr' then orig else (gr', ohint)
+
+let discharge_bidi_hints (_name, (gr, ohint)) =
+ if isVarRef gr && Lib.is_in_section gr then None
+ else
+ let vars = Lib.variable_section_segment_of_reference gr in
+ let n = List.length vars in
+ Some (gr, Option.map ((+) n) ohint)
+
+let inBidiHints =
+ let open Libobject in
+ declare_object { (default_object "BIDIRECTIONALITY-HINTS" ) with
+ load_function = load_bidi_hints;
+ cache_function = cache_bidi_hints;
+ classify_function = (fun o -> Substitute o);
+ subst_function = subst_bidi_hints;
+ discharge_function = discharge_bidi_hints;
+ }
+
let warn_arguments_assert =
CWarnings.create ~name:"arguments-assert" ~category:"vernacular"
@@ -1221,7 +1315,7 @@ let warn_arguments_assert =
(* [nargs_for_red] is the number of arguments required to trigger reduction,
[args] is the main list of arguments statuses,
[more_implicits] is a list of extra lists of implicit statuses *)
-let vernac_arguments ~section_local reference args more_implicits nargs_for_red flags =
+let vernac_arguments ~section_local reference args more_implicits nargs_for_red nargs_before_bidi flags =
let env = Global.env () in
let sigma = Evd.from_env env in
let assert_flag = List.mem `Assert flags in
@@ -1232,6 +1326,7 @@ let vernac_arguments ~section_local reference args more_implicits nargs_for_red
let default_implicits_flag = List.mem `DefaultImplicits flags in
let never_unfold_flag = List.mem `ReductionNeverUnfold flags in
let nomatch_flag = List.mem `ReductionDontExposeCase flags in
+ let clear_bidi_hint = List.mem `ClearBidiHint flags in
let err_incompat x y =
user_err Pp.(str ("Options \""^x^"\" and \""^y^"\" are incompatible.")) in
@@ -1290,6 +1385,9 @@ let vernac_arguments ~section_local reference args more_implicits nargs_for_red
if Option.cata (fun n -> n > num_args) false nargs_for_red then
user_err Pp.(str "The \"/\" modifier should be put before any extra scope.");
+ if Option.cata (fun n -> n > num_args) false nargs_before_bidi then
+ user_err Pp.(str "The \"&\" modifier should be put before any extra scope.");
+
let scopes_specified = List.exists Option.has_some scopes in
if scopes_specified && clear_scopes_flag then
@@ -1401,6 +1499,12 @@ let vernac_arguments ~section_local reference args more_implicits nargs_for_red
let red_modifiers_specified = Option.has_some red_behavior in
+ let bidi_hint_specified = Option.has_some nargs_before_bidi in
+
+ if bidi_hint_specified && clear_bidi_hint then
+ err_incompat "clear bidirectionality hint" "&";
+
+
(* Actions *)
if renaming_specified then begin
@@ -1433,10 +1537,26 @@ let vernac_arguments ~section_local reference args more_implicits nargs_for_red
strbrk "are relevant for constants only.")
end;
+ if bidi_hint_specified then begin
+ let n = Option.get nargs_before_bidi in
+ if section_local then
+ Pretyping.add_bidirectionality_hint sr n
+ else
+ Lib.add_anonymous_leaf (inBidiHints (sr, Some n))
+ end;
+
+ if clear_bidi_hint then begin
+ if section_local then
+ Pretyping.clear_bidirectionality_hint sr
+ else
+ Lib.add_anonymous_leaf (inBidiHints (sr, None))
+ end;
+
if not (renaming_specified ||
implicits_specified ||
scopes_specified ||
- red_modifiers_specified) && (List.is_empty flags) then
+ red_modifiers_specified ||
+ bidi_hint_specified) && (List.is_empty flags) then
warn_arguments_assert sr
let default_env () = {
@@ -1766,10 +1886,10 @@ let get_current_context_of_args ~pstate =
match pstate with
| None -> fun _ ->
let env = Global.env () in Evd.(from_env env, env)
- | Some pstate ->
+ | Some lemma ->
function
- | Some n -> Pfedit.get_goal_context pstate n
- | None -> Pfedit.get_current_context pstate
+ | Some n -> Pfedit.get_goal_context lemma n
+ | None -> Pfedit.get_current_context lemma
let query_command_selector ?loc = function
| None -> None
@@ -1834,7 +1954,7 @@ let vernac_global_check c =
let get_nth_goal ~pstate n =
- let pf = Proof_global.give_me_the_proof pstate in
+ let pf = Proof_global.get_proof pstate in
let Proof.{goals;sigma} = Proof.data pf in
let gl = {Evd.it=List.nth goals (n-1) ; sigma = sigma; } in
gl
@@ -1877,7 +1997,7 @@ let print_about_hyp_globs ~pstate ?loc ref_or_by_not udecl glopt =
let sigma, env = get_current_or_global_context ~pstate in
print_about env sigma ref_or_by_not udecl
-let vernac_print ~(pstate : Proof_global.t option) ~atts =
+let vernac_print ~pstate ~atts =
let sigma, env = get_current_or_global_context ~pstate in
function
| PrintTables -> print_tables ()
@@ -1910,9 +2030,9 @@ let vernac_print ~(pstate : Proof_global.t option) ~atts =
| PrintHintGoal ->
begin match pstate with
| Some pstate ->
- Hints.pr_applicable_hint pstate
+ Hints.pr_applicable_hint pstate
| None ->
- str "No proof in progress"
+ str "No proof in progress"
end
| PrintHintDbName s -> Hints.pr_hint_db_by_name env sigma s
| PrintHintDb -> Hints.pr_searchtable env sigma
@@ -2034,10 +2154,8 @@ let vernac_locate ~pstate = function
| LocateOther (s, qid) -> print_located_other s qid
| LocateFile f -> locate_file f
-let vernac_register ~pstate qid r =
+let vernac_register qid r =
let gr = Smartlocate.global_with_alias qid in
- if there_are_pending_proofs ~pstate then
- user_err Pp.(str "Cannot register a primitive while in proof editing mode.");
match r with
| RegisterInline ->
begin match gr with
@@ -2065,85 +2183,89 @@ let vernac_register ~pstate qid r =
(********************)
(* Proof management *)
-let vernac_focus gln =
- Proof_global.simple_with_current_proof (fun _ p ->
+let vernac_focus ~pstate gln =
+ Proof_global.map_proof (fun p ->
match gln with
| None -> Proof.focus focus_command_cond () 1 p
| Some 0 ->
user_err Pp.(str "Invalid goal number: 0. Goal numbering starts with 1.")
| Some n ->
Proof.focus focus_command_cond () n p)
+ pstate
(* Unfocuses one step in the focus stack. *)
-let vernac_unfocus () =
- Proof_global.simple_with_current_proof
- (fun _ p -> Proof.unfocus command_focus p ())
+let vernac_unfocus ~pstate =
+ Proof_global.map_proof
+ (fun p -> Proof.unfocus command_focus p ())
+ pstate
(* Checks that a proof is fully unfocused. Raises an error if not. *)
let vernac_unfocused ~pstate =
- let p = Proof_global.give_me_the_proof pstate in
+ let p = Proof_global.get_proof pstate in
if Proof.unfocused p then
str"The proof is indeed fully unfocused."
else
user_err Pp.(str "The proof is not fully unfocused.")
-
(* "{" focuses on the first goal, "n: {" focuses on the n-th goal
"}" unfocuses, provided that the proof of the goal has been completed.
*)
let subproof_kind = Proof.new_focus_kind ()
let subproof_cond = Proof.done_cond subproof_kind
-let vernac_subproof gln =
- Proof_global.simple_with_current_proof (fun _ p ->
+let vernac_subproof gln ~pstate =
+ Proof_global.map_proof (fun p ->
match gln with
| None -> Proof.focus subproof_cond () 1 p
| Some (Goal_select.SelectNth n) -> Proof.focus subproof_cond () n p
| Some (Goal_select.SelectId id) -> Proof.focus_id subproof_cond () id p
| _ -> user_err ~hdr:"bracket_selector"
(str "Brackets do not support multi-goal selectors."))
+ pstate
-let vernac_end_subproof () =
- Proof_global.simple_with_current_proof (fun _ p ->
- Proof.unfocus subproof_kind p ())
+let vernac_end_subproof ~pstate =
+ Proof_global.map_proof (fun p ->
+ Proof.unfocus subproof_kind p ())
+ pstate
-let vernac_bullet (bullet : Proof_bullet.t) =
- Proof_global.simple_with_current_proof (fun _ p ->
- Proof_bullet.put p bullet)
+let vernac_bullet (bullet : Proof_bullet.t) ~pstate =
+ Proof_global.map_proof (fun p ->
+ Proof_bullet.put p bullet) pstate
+(* Stack is needed due to show proof names, should deprecate / remove
+ and take pstate *)
let vernac_show ~pstate =
match pstate with
(* Show functions that don't require a proof state *)
| None ->
begin function
- | ShowProof -> show_proof ~pstate
+ | ShowProof -> show_proof ~pstate:None
| ShowMatch id -> show_match id
- | ShowScript -> assert false (* Only the stm knows the script *)
| _ ->
user_err (str "This command requires an open proof.")
end
(* Show functions that require a proof state *)
| Some pstate ->
+ let proof = Proof_global.get_proof pstate in
begin function
| ShowGoal goalref ->
- let proof = Proof_global.give_me_the_proof pstate in
begin match goalref with
| OpenSubgoals -> pr_open_subgoals ~proof
| NthGoal n -> pr_nth_open_subgoal ~proof n
| GoalId id -> pr_goal_by_id ~proof id
end
- | ShowExistentials -> show_top_evars ~pstate
- | ShowUniverses -> show_universes ~pstate
+ | ShowExistentials -> show_top_evars ~proof
+ | ShowUniverses -> show_universes ~proof
+ (* Deprecate *)
| ShowProofNames ->
- pr_sequence Id.print (Proof_global.get_all_proof_names pstate)
- | ShowIntros all -> show_intro ~pstate all
+ Id.print (Proof_global.get_proof_name pstate)
+ | ShowIntros all -> show_intro ~proof all
| ShowProof -> show_proof ~pstate:(Some pstate)
| ShowMatch id -> show_match id
- | ShowScript -> assert false (* Only the stm knows the script *)
end
let vernac_check_guard ~pstate =
- let pts = Proof_global.give_me_the_proof pstate in
+ let pts = Proof_global.get_proof pstate in
let pfterm = List.hd (Proof.partial_proof pts) in
let message =
try
@@ -2154,26 +2276,6 @@ let vernac_check_guard ~pstate =
(str ("Condition violated: ") ++s)
in message
-(* Attributes *)
-let with_locality ~atts f =
- let local = Attributes.(parse locality atts) in
- f ~local
-
-let with_section_locality ~atts f =
- let local = Attributes.(parse locality atts) in
- let section_local = make_section_locality local in
- f ~section_local
-
-let with_module_locality ~atts f =
- let local = Attributes.(parse locality atts) in
- let module_local = make_module_locality local in
- f ~module_local
-
-let with_def_attributes ~atts f =
- let atts = DefAttributes.parse atts in
- if atts.DefAttributes.program then Obligations.check_program_libraries ();
- f ~atts
-
(** A global default timeout, controlled by option "Set Default Timeout n".
Use "Unset Default Timeout" to deactivate it (or set it to 0). *)
@@ -2204,10 +2306,9 @@ let with_fail ~st f =
try let _ = f () in raise HasNotFailed
with
| HasNotFailed as e -> raise e
- | e ->
+ | e when CErrors.noncritical e || e = Timeout ->
let e = CErrors.push e in
- raise (HasFailed (CErrors.iprint
- (ExplainErr.process_vernac_interp_error ~allow_uncaught:false e)))
+ raise (HasFailed (CErrors.iprint (ExplainErr.process_vernac_interp_error e)))
with e when CErrors.noncritical e ->
(* Restore the previous state XXX Careful here with the cache! *)
Vernacstate.invalidate_cache ();
@@ -2228,338 +2329,388 @@ let locate_if_not_already ?loc (e, info) =
exception End_of_input
-(* "locality" is the prefix "Local" attribute, while the "local" component
- * is the outdated/deprecated "Local" attribute of some vernacular commands
- * still parsed as the obsolete_locality grammar entry for retrocompatibility.
- * loc is the Loc.t of the vernacular command being interpreted. *)
-let rec interp_expr ?proof ~atts ~st c : Proof_global.t option =
- let pstate = st.Vernacstate.proof in
- vernac_pperr_endline (fun () -> str "interpreting: " ++ Ppvernac.pr_vernac_expr c);
+let interp_typed_vernac c ~stack =
+ let open Vernacextend in
match c with
-
- (* The STM should handle that, but LOAD bypasses the STM... *)
- | VernacAbortAll -> CErrors.user_err (str "AbortAll cannot be used through the Load command")
- | VernacRestart -> CErrors.user_err (str "Restart cannot be used through the Load command")
- | VernacUndo _ -> CErrors.user_err (str "Undo cannot be used through the Load command")
- | VernacUndoTo _ -> CErrors.user_err (str "UndoTo cannot be used through the Load command")
-
- (* Resetting *)
- | VernacResetName _ -> anomaly (str "VernacResetName not handled by Stm.")
- | VernacResetInitial -> anomaly (str "VernacResetInitial not handled by Stm.")
- | VernacBack _ -> anomaly (str "VernacBack not handled by Stm.")
- | VernacBackTo _ -> anomaly (str "VernacBackTo not handled by Stm.")
-
- (* This one is possible to handle here *)
- | VernacAbort id -> CErrors.user_err (str "Abort cannot be used through the Load command")
-
- (* Loading a file requires access to the control interpreter so
- [vernac_load] is mutually-recursive with [interp_expr] *)
- | VernacLoad (verbosely,fname) ->
- unsupported_attributes atts;
- vernac_load ?proof ~verbosely ~st fname
-
+ | VtDefault f -> f (); stack
+ | VtNoProof f ->
+ if Option.has_some stack then
+ user_err Pp.(str "Command not supported (Open proofs remain)");
+ let () = f () in
+ stack
+ | VtCloseProof f ->
+ vernac_require_open_lemma ~stack (fun ~stack ->
+ let lemma, stack = Stack.pop stack in
+ f ~lemma;
+ stack)
+ | VtOpenProof f ->
+ Some (Stack.push stack (f ()))
+ | VtModifyProof f ->
+ Option.map (Stack.map_top_pstate ~f:(fun pstate -> f ~pstate)) stack
+ | VtReadProofOpt f ->
+ let pstate = Option.map (Stack.with_top_pstate ~f:(fun x -> x)) stack in
+ f ~pstate;
+ stack
+ | VtReadProof f ->
+ with_pstate ~stack f;
+ stack
+
+(* We interpret vernacular commands to a DSL that specifies their
+ allowed actions on proof states *)
+let translate_vernac ~atts v = let open Vernacextend in match v with
+ | VernacEndProof _
+ | VernacAbortAll
+ | VernacRestart
+ | VernacUndo _
+ | VernacUndoTo _
+ | VernacResetName _
+ | VernacResetInitial
+ | VernacBack _
+ | VernacBackTo _
+ | VernacAbort _
+ | VernacLoad _ ->
+ anomaly (str "type_vernac")
(* Syntax *)
| VernacSyntaxExtension (infix, sl) ->
- with_module_locality ~atts vernac_syntax_extension infix sl;
- pstate
+ VtDefault(fun () -> with_module_locality ~atts vernac_syntax_extension infix sl)
| VernacDeclareScope sc ->
- with_module_locality ~atts vernac_declare_scope sc;
- pstate
+ VtDefault(fun () -> with_module_locality ~atts vernac_declare_scope sc)
| VernacDelimiters (sc,lr) ->
- with_module_locality ~atts vernac_delimiters sc lr;
- pstate
+ VtDefault(fun () -> with_module_locality ~atts vernac_delimiters sc lr)
| VernacBindScope (sc,rl) ->
- with_module_locality ~atts vernac_bind_scope sc rl;
- pstate
+ VtDefault(fun () -> with_module_locality ~atts vernac_bind_scope sc rl)
| VernacOpenCloseScope (b, s) ->
- with_section_locality ~atts vernac_open_close_scope (b,s);
- pstate
+ VtDefault(fun () -> with_section_locality ~atts vernac_open_close_scope (b,s))
| VernacInfix (mv,qid,sc) ->
- with_module_locality ~atts vernac_infix mv qid sc;
- pstate
+ VtDefault(fun () -> vernac_infix ~atts mv qid sc)
| VernacNotation (c,infpl,sc) ->
- with_module_locality ~atts vernac_notation c infpl sc;
- pstate
+ VtDefault(fun () -> vernac_notation ~atts c infpl sc)
| VernacNotationAddFormat(n,k,v) ->
- unsupported_attributes atts;
- Metasyntax.add_notation_extra_printing_rule n k v;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ Metasyntax.add_notation_extra_printing_rule n k v)
| VernacDeclareCustomEntry s ->
- with_module_locality ~atts vernac_custom_entry s;
- pstate
+ VtDefault(fun () -> with_module_locality ~atts vernac_custom_entry s)
(* Gallina *)
- | VernacDefinition ((discharge,kind),lid,d) ->
- with_def_attributes ~atts vernac_definition ~pstate discharge kind lid d
+
+ | VernacDefinition (discharge,lid,DefineBody (bl,red_option,c,typ)) ->
+ VtDefault (fun () ->
+ with_def_attributes ~atts
+ vernac_definition discharge lid bl red_option c typ)
+ | VernacDefinition (discharge,lid,ProveBody(bl,typ)) ->
+ VtOpenProof(fun () ->
+ with_def_attributes ~atts
+ vernac_definition_interactive discharge lid bl typ)
+
| VernacStartTheoremProof (k,l) ->
- with_def_attributes ~atts vernac_start_proof ~pstate k l
- | VernacEndProof e ->
- unsupported_attributes atts;
- vernac_end_proof ?proof ?pstate e
+ VtOpenProof(fun () -> with_def_attributes ~atts vernac_start_proof k l)
| VernacExactProof c ->
- unsupported_attributes atts;
- vernac_require_open_proof ~pstate (vernac_exact_proof c)
+ VtCloseProof (fun ~lemma ->
+ unsupported_attributes atts;
+ vernac_exact_proof ~lemma c)
+
+ | VernacDefineModule (export,lid,bl,mtys,mexprl) ->
+ let i () =
+ unsupported_attributes atts;
+ vernac_define_module export lid bl mtys mexprl in
+ (* XXX: We should investigate if eventually this should be made
+ VtNoProof in all cases. *)
+ if List.is_empty mexprl then VtNoProof i else VtDefault i
+
+ | VernacDeclareModuleType (lid,bl,mtys,mtyo) ->
+ VtNoProof(fun () ->
+ unsupported_attributes atts;
+ vernac_declare_module_type lid bl mtys mtyo)
| VernacAssumption ((discharge,kind),nl,l) ->
- with_def_attributes ~atts vernac_assumption discharge kind l nl;
- pstate
+ VtDefault(fun () -> with_def_attributes ~atts vernac_assumption discharge kind l nl)
| VernacInductive (cum, priv, finite, l) ->
- vernac_inductive ~atts cum priv finite l;
- pstate
+ VtDefault(fun () -> vernac_inductive ~atts cum priv finite l)
| VernacFixpoint (discharge, l) ->
- with_def_attributes ~atts vernac_fixpoint ~pstate discharge l
+ let opens = List.exists (fun ((_,_,_,_,p),_) -> Option.is_empty p) l in
+ if opens then
+ VtOpenProof (fun () ->
+ with_def_attributes ~atts vernac_fixpoint_interactive discharge l)
+ else
+ VtDefault (fun () ->
+ with_def_attributes ~atts vernac_fixpoint discharge l)
| VernacCoFixpoint (discharge, l) ->
- with_def_attributes ~atts vernac_cofixpoint ~pstate discharge l
+ let opens = List.exists (fun ((_,_,_,p),_) -> Option.is_empty p) l in
+ if opens then
+ VtOpenProof(fun () -> with_def_attributes ~atts vernac_cofixpoint_interactive discharge l)
+ else
+ VtDefault(fun () -> with_def_attributes ~atts vernac_cofixpoint discharge l)
+
| VernacScheme l ->
- unsupported_attributes atts;
- vernac_scheme l;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_scheme l)
| VernacCombinedScheme (id, l) ->
- unsupported_attributes atts;
- vernac_combined_scheme id l;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_combined_scheme id l)
| VernacUniverse l ->
- vernac_universe ~poly:(only_polymorphism atts) l;
- pstate
+ VtDefault(fun () -> vernac_universe ~poly:(only_polymorphism atts) l)
| VernacConstraint l ->
- vernac_constraint ~poly:(only_polymorphism atts) l;
- pstate
+ VtDefault(fun () -> vernac_constraint ~poly:(only_polymorphism atts) l)
(* Modules *)
| VernacDeclareModule (export,lid,bl,mtyo) ->
- unsupported_attributes atts;
- vernac_declare_module export lid bl mtyo;
- pstate
- | VernacDefineModule (export,lid,bl,mtys,mexprl) ->
- unsupported_attributes atts;
- vernac_define_module ~pstate export lid bl mtys mexprl;
- pstate
- | VernacDeclareModuleType (lid,bl,mtys,mtyo) ->
- unsupported_attributes atts;
- vernac_declare_module_type ~pstate lid bl mtys mtyo;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_declare_module export lid bl mtyo)
| VernacInclude in_asts ->
- unsupported_attributes atts;
- vernac_include in_asts;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_include in_asts)
(* Gallina extensions *)
| VernacBeginSection lid ->
- unsupported_attributes atts;
- vernac_begin_section ~pstate lid;
- pstate
-
+ VtNoProof(fun () ->
+ unsupported_attributes atts;
+ vernac_begin_section lid)
| VernacEndSegment lid ->
- unsupported_attributes atts;
- vernac_end_segment ~pstate lid;
- pstate
-
+ VtNoProof(fun () ->
+ unsupported_attributes atts;
+ vernac_end_segment lid)
| VernacNameSectionHypSet (lid, set) ->
- unsupported_attributes atts;
- vernac_name_sec_hyp lid set;
- pstate
-
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_name_sec_hyp lid set)
| VernacRequire (from, export, qidl) ->
- unsupported_attributes atts;
- vernac_require from export qidl;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_require from export qidl)
| VernacImport (export,qidl) ->
- unsupported_attributes atts;
- vernac_import export qidl;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_import export qidl)
| VernacCanonical qid ->
- unsupported_attributes atts;
- vernac_canonical qid;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_canonical qid)
| VernacCoercion (r,s,t) ->
- vernac_coercion ~atts r s t;
- pstate
+ VtDefault(fun () -> vernac_coercion ~atts r s t)
| VernacIdentityCoercion ({v=id},s,t) ->
- vernac_identity_coercion ~atts id s t;
- pstate
+ VtDefault(fun () -> vernac_identity_coercion ~atts id s t)
(* Type classes *)
- | VernacInstance (sup, inst, props, info) ->
- snd @@ with_def_attributes ~atts (vernac_instance ~pstate sup inst props info)
- | VernacDeclareInstance (sup, inst, info) ->
- with_def_attributes ~atts vernac_declare_instance sup inst info;
- pstate
+ | VernacInstance (name, bl, t, props, info) ->
+ let { DefAttributes.program } = DefAttributes.parse atts in
+ if program then
+ VtDefault (fun () -> vernac_instance_program ~atts name bl t props info)
+ else begin match props with
+ | None ->
+ VtOpenProof(fun () ->
+ vernac_instance_interactive ~atts name bl t info)
+ | Some props ->
+ VtDefault(fun () ->
+ vernac_instance ~atts name bl t props info)
+ end
+
+ | VernacDeclareInstance (id, bl, inst, info) ->
+ VtDefault(fun () -> vernac_declare_instance ~atts id bl inst info)
| VernacContext sup ->
- let () = vernac_context ~poly:(only_polymorphism atts) sup in
- pstate
+ VtDefault(fun () -> vernac_context ~poly:(only_polymorphism atts) sup)
| VernacExistingInstance insts ->
- with_section_locality ~atts vernac_existing_instance insts;
- pstate
+ VtDefault(fun () -> with_section_locality ~atts vernac_existing_instance insts)
| VernacExistingClass id ->
- unsupported_attributes atts;
- vernac_existing_class id;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_existing_class id)
(* Solving *)
| VernacSolveExistential (n,c) ->
- unsupported_attributes atts;
- Some (vernac_require_open_proof ~pstate (vernac_solve_existential n c))
-
+ VtModifyProof(fun ~pstate ->
+ unsupported_attributes atts;
+ vernac_solve_existential ~pstate n c)
(* Auxiliary file and library management *)
| VernacAddLoadPath (isrec,s,alias) ->
- unsupported_attributes atts;
- vernac_add_loadpath isrec s alias;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_add_loadpath isrec s alias)
| VernacRemoveLoadPath s ->
- unsupported_attributes atts;
- vernac_remove_loadpath s;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_remove_loadpath s)
| VernacAddMLPath (isrec,s) ->
- unsupported_attributes atts;
- vernac_add_ml_path isrec s;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_add_ml_path isrec s)
| VernacDeclareMLModule l ->
- with_locality ~atts vernac_declare_ml_module l;
- pstate
+ VtDefault(fun () -> with_locality ~atts vernac_declare_ml_module l)
| VernacChdir s ->
- unsupported_attributes atts;
- vernac_chdir s;
- pstate
+ VtDefault(fun () -> unsupported_attributes atts; vernac_chdir s)
(* State management *)
| VernacWriteState s ->
- unsupported_attributes atts;
- vernac_write_state s;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_write_state s)
| VernacRestoreState s ->
- unsupported_attributes atts;
- vernac_restore_state s;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_restore_state s)
(* Commands *)
| VernacCreateHintDb (dbname,b) ->
- with_module_locality ~atts vernac_create_hintdb dbname b;
- pstate
+ VtDefault(fun () ->
+ with_module_locality ~atts vernac_create_hintdb dbname b)
| VernacRemoveHints (dbnames,ids) ->
- with_module_locality ~atts vernac_remove_hints dbnames ids;
- pstate
+ VtDefault(fun () ->
+ with_module_locality ~atts vernac_remove_hints dbnames ids)
| VernacHints (dbnames,hints) ->
- vernac_hints ~atts dbnames hints;
- pstate
+ VtDefault(fun () ->
+ vernac_hints ~atts dbnames hints)
| VernacSyntacticDefinition (id,c,b) ->
- with_module_locality ~atts vernac_syntactic_definition id c b;
- pstate
- | VernacArguments (qid, args, more_implicits, nargs, flags) ->
- with_section_locality ~atts vernac_arguments qid args more_implicits nargs flags;
- pstate
+ VtDefault(fun () -> vernac_syntactic_definition ~atts id c b)
+ | VernacArguments (qid, args, more_implicits, nargs, bidi, flags) ->
+ VtDefault(fun () ->
+ with_section_locality ~atts (vernac_arguments qid args more_implicits nargs bidi flags))
| VernacReserve bl ->
- unsupported_attributes atts;
- vernac_reserve bl;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_reserve bl)
| VernacGeneralizable gen ->
- with_locality ~atts vernac_generalizable gen;
- pstate
+ VtDefault(fun () -> with_locality ~atts vernac_generalizable gen)
| VernacSetOpacity qidl ->
- with_locality ~atts vernac_set_opacity qidl;
- pstate
+ VtDefault(fun () -> with_locality ~atts vernac_set_opacity qidl)
| VernacSetStrategy l ->
- with_locality ~atts vernac_set_strategy l;
- pstate
+ VtDefault(fun () -> with_locality ~atts vernac_set_strategy l)
| VernacSetOption (export, key,v) ->
- vernac_set_option ~local:(only_locality atts) export key v;
- pstate
+ VtDefault(fun () ->
+ vernac_set_option ~local:(only_locality atts) export key v)
| VernacRemoveOption (key,v) ->
- unsupported_attributes atts;
- vernac_remove_option key v;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_remove_option key v)
| VernacAddOption (key,v) ->
- unsupported_attributes atts;
- vernac_add_option key v;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_add_option key v)
| VernacMemOption (key,v) ->
- unsupported_attributes atts;
- vernac_mem_option key v;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_mem_option key v)
| VernacPrintOption key ->
- unsupported_attributes atts;
- vernac_print_option key;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ vernac_print_option key)
| VernacCheckMayEval (r,g,c) ->
- Feedback.msg_notice @@
- vernac_check_may_eval ~pstate ~atts r g c;
- pstate
+ VtReadProofOpt(fun ~pstate ->
+ Feedback.msg_notice @@
+ vernac_check_may_eval ~pstate ~atts r g c)
| VernacDeclareReduction (s,r) ->
- with_locality ~atts vernac_declare_reduction s r;
- pstate
+ VtDefault(fun () ->
+ with_locality ~atts vernac_declare_reduction s r)
| VernacGlobalCheck c ->
- unsupported_attributes atts;
- Feedback.msg_notice @@ vernac_global_check c;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ Feedback.msg_notice @@ vernac_global_check c)
| VernacPrint p ->
- Feedback.msg_notice @@ vernac_print ~pstate ~atts p;
- pstate
+ VtReadProofOpt(fun ~pstate ->
+ Feedback.msg_notice @@ vernac_print ~pstate ~atts p)
| VernacSearch (s,g,r) ->
- unsupported_attributes atts;
- vernac_search ~pstate ~atts s g r;
- pstate
+ VtReadProofOpt(
+ unsupported_attributes atts;
+ vernac_search ~atts s g r)
| VernacLocate l -> unsupported_attributes atts;
- Feedback.msg_notice @@ vernac_locate ~pstate l;
- pstate
+ VtReadProofOpt(fun ~pstate ->
+ Feedback.msg_notice @@ vernac_locate ~pstate l)
| VernacRegister (qid, r) ->
- unsupported_attributes atts;
- vernac_register ~pstate qid r;
- pstate
+ VtNoProof(fun () ->
+ unsupported_attributes atts;
+ vernac_register qid r)
| VernacPrimitive (id, prim, typopt) ->
- unsupported_attributes atts;
- ComAssumption.do_primitive id prim typopt;
- pstate
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ ComAssumption.do_primitive id prim typopt)
| VernacComments l ->
- unsupported_attributes atts;
- Flags.if_verbose Feedback.msg_info (str "Comments ok\n");
- pstate
-
+ VtDefault(fun () ->
+ unsupported_attributes atts;
+ Flags.if_verbose Feedback.msg_info (str "Comments ok\n"))
(* Proof management *)
| VernacFocus n ->
- unsupported_attributes atts;
- Option.map (vernac_focus n) pstate
+ VtModifyProof(unsupported_attributes atts;vernac_focus n)
| VernacUnfocus ->
- unsupported_attributes atts;
- Option.map (vernac_unfocus ()) pstate
+ VtModifyProof(unsupported_attributes atts;vernac_unfocus)
| VernacUnfocused ->
- unsupported_attributes atts;
- Option.iter (fun pstate -> Feedback.msg_notice @@ vernac_unfocused ~pstate) pstate;
- pstate
+ VtReadProof(fun ~pstate ->
+ unsupported_attributes atts;
+ Feedback.msg_notice @@ vernac_unfocused ~pstate)
| VernacBullet b ->
- unsupported_attributes atts;
- Option.map (vernac_bullet b) pstate
+ VtModifyProof(
+ unsupported_attributes atts;
+ vernac_bullet b)
| VernacSubproof n ->
- unsupported_attributes atts;
- Option.map (vernac_subproof n) pstate
+ VtModifyProof(
+ unsupported_attributes atts;
+ vernac_subproof n)
| VernacEndSubproof ->
- unsupported_attributes atts;
- Option.map (vernac_end_subproof ()) pstate
+ VtModifyProof(
+ unsupported_attributes atts;
+ vernac_end_subproof)
| VernacShow s ->
- unsupported_attributes atts;
- Feedback.msg_notice @@ vernac_show ~pstate s;
- pstate
+ VtReadProofOpt(fun ~pstate ->
+ unsupported_attributes atts;
+ Feedback.msg_notice @@ vernac_show ~pstate s)
| VernacCheckGuard ->
- unsupported_attributes atts;
- Feedback.msg_notice @@
- vernac_require_open_proof ~pstate (vernac_check_guard);
- pstate
+ VtReadProof(fun ~pstate ->
+ unsupported_attributes atts;
+ Feedback.msg_notice @@ vernac_check_guard ~pstate)
| VernacProof (tac, using) ->
+ VtModifyProof(fun ~pstate ->
unsupported_attributes atts;
let using = Option.append using (Proof_using.get_default_proof_using ()) in
let tacs = if Option.is_empty tac then "tac:no" else "tac:yes" in
let usings = if Option.is_empty using then "using:no" else "using:yes" in
Aux_file.record_in_aux_at "VernacProof" (tacs^" "^usings);
- let pstate =
- vernac_require_open_proof ~pstate (fun ~pstate ->
- let pstate = Option.cata (vernac_set_end_tac ~pstate) pstate tac in
- Option.cata (vernac_set_used_variables ~pstate) pstate using)
- in Some pstate
+ let pstate = Option.cata (vernac_set_end_tac ~pstate) pstate tac in
+ Option.cata (vernac_set_used_variables ~pstate) pstate using)
| VernacProofMode mn ->
- unsupported_attributes atts;
- pstate
+ VtDefault(fun () -> unsupported_attributes atts)
(* Extensions *)
| VernacExtend (opn,args) ->
- (* XXX: Here we are returning the state! :) *)
- let st : Vernacstate.t = Vernacextend.call ~atts opn args ~st in
- st.Vernacstate.proof
+ Vernacextend.type_vernac ~atts opn args
+
+(* "locality" is the prefix "Local" attribute, while the "local" component
+ * is the outdated/deprecated "Local" attribute of some vernacular commands
+ * still parsed as the obsolete_locality grammar entry for retrocompatibility.
+ * loc is the Loc.t of the vernacular command being interpreted. *)
+let rec interp_expr ?proof ~atts ~st c =
+ let stack = st.Vernacstate.lemmas in
+ vernac_pperr_endline (fun () -> str "interpreting: " ++ Ppvernac.pr_vernac_expr c);
+ match c with
+
+ (* The STM should handle that, but LOAD bypasses the STM... *)
+ | VernacAbortAll -> CErrors.user_err (str "AbortAll cannot be used through the Load command")
+ | VernacRestart -> CErrors.user_err (str "Restart cannot be used through the Load command")
+ | VernacUndo _ -> CErrors.user_err (str "Undo cannot be used through the Load command")
+ | VernacUndoTo _ -> CErrors.user_err (str "UndoTo cannot be used through the Load command")
+
+ (* Resetting *)
+ | VernacResetName _ -> anomaly (str "VernacResetName not handled by Stm.")
+ | VernacResetInitial -> anomaly (str "VernacResetInitial not handled by Stm.")
+ | VernacBack _ -> anomaly (str "VernacBack not handled by Stm.")
+ | VernacBackTo _ -> anomaly (str "VernacBackTo not handled by Stm.")
+
+ (* This one is possible to handle here *)
+ | VernacAbort id -> CErrors.user_err (str "Abort cannot be used through the Load command")
+
+ (* Loading a file requires access to the control interpreter so
+ [vernac_load] is mutually-recursive with [interp_expr] *)
+ | VernacLoad (verbosely,fname) ->
+ unsupported_attributes atts;
+ vernac_load ~verbosely ~st fname
+
+ (* Special: ?proof parameter doesn't allow for uniform pstate pop :S *)
+ | VernacEndProof e ->
+ unsupported_attributes atts;
+ vernac_end_proof ?proof ?stack e
+
+ | v ->
+ let fv = translate_vernac ~atts v in
+ interp_typed_vernac ~stack fv
(* XXX: This won't properly set the proof mode, as of today, it is
controlled by the STM. Thus, we would need access information from
@@ -2567,9 +2718,10 @@ let rec interp_expr ?proof ~atts ~st c : Proof_global.t option =
the way the proof mode is set there makes the task non trivial
without a considerable amount of refactoring.
*)
-and vernac_load ?proof ~verbosely ~st fname =
- let pstate = st.Vernacstate.proof in
- if there_are_pending_proofs ~pstate then
+and vernac_load ~verbosely ~st fname =
+ let there_are_pending_proofs ~stack = not Option.(is_empty stack) in
+ let stack = st.Vernacstate.lemmas in
+ if there_are_pending_proofs ~stack then
CErrors.user_err Pp.(str "Load is not supported inside proofs.");
(* Open the file *)
let fname =
@@ -2586,29 +2738,29 @@ and vernac_load ?proof ~verbosely ~st fname =
match Pcoq.Entry.parse (Pvernac.main_entry proof_mode) po with
| Some x -> x
| None -> raise End_of_input) in
- let rec load_loop ~pstate =
+ let rec load_loop ~stack =
try
- let proof_mode = Option.map (fun _ -> get_default_proof_mode ()) pstate in
- let pstate =
- v_mod (interp_control ?proof ~st:{ st with Vernacstate.proof = pstate })
+ let proof_mode = Option.map (fun _ -> get_default_proof_mode ()) stack in
+ let stack =
+ v_mod (interp_control ?proof:None ~st:{ st with Vernacstate.lemmas = stack })
(parse_sentence proof_mode input) in
- load_loop ~pstate
+ load_loop ~stack
with
End_of_input ->
- pstate
+ stack
in
- let pstate = load_loop ~pstate in
+ let stack = load_loop ~stack in
(* If Load left a proof open, we fail too. *)
- if there_are_pending_proofs ~pstate then
+ if there_are_pending_proofs ~stack then
CErrors.user_err Pp.(str "Files processed by Load cannot leave open proofs.");
- pstate
+ stack
and interp_control ?proof ~st v = match v with
| { v=VernacExpr (atts, cmd) } ->
interp_expr ?proof ~atts ~st cmd
| { v=VernacFail v } ->
with_fail ~st (fun () -> interp_control ?proof ~st v);
- st.Vernacstate.proof
+ st.Vernacstate.lemmas
| { v=VernacTimeout (timeout,v) } ->
vernac_timeout ~timeout (interp_control ?proof ~st) v
| { v=VernacRedirect (s, v) } ->
@@ -2630,8 +2782,8 @@ let interp ?(verbosely=true) ?proof ~st cmd =
Vernacstate.unfreeze_interp_state st;
try vernac_timeout (fun st ->
let v_mod = if verbosely then Flags.verbosely else Flags.silently in
- let pstate = v_mod (interp_control ?proof ~st) cmd in
- Vernacstate.Proof_global.set pstate [@ocaml.warning "-3"];
+ let ontop = v_mod (interp_control ?proof ~st) cmd in
+ Vernacstate.Proof_global.set ontop [@ocaml.warning "-3"];
Vernacstate.freeze_interp_state ~marshallable:false
) st
with exn ->
diff --git a/vernac/vernacentries.mli b/vernac/vernacentries.mli
index 12451370c8..e46212ca1c 100644
--- a/vernac/vernacentries.mli
+++ b/vernac/vernacentries.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -22,7 +22,7 @@ val vernac_require :
(** The main interpretation function of vernacular expressions *)
val interp :
?verbosely:bool ->
- ?proof:Proof_global.closed_proof ->
+ ?proof:(Proof_global.proof_object * Lemmas.proof_info) ->
st:Vernacstate.t -> Vernacexpr.vernac_control -> Vernacstate.t
(** Prepare a "match" template for a given inductive type.
@@ -41,9 +41,6 @@ val command_focus : unit Proof.focus_kind
val interp_redexp_hook : (Environ.env -> Evd.evar_map -> Genredexpr.raw_red_expr ->
Evd.evar_map * Redexpr.red_expr) Hook.t
-(** Helper *)
-val vernac_require_open_proof : pstate:Proof_global.t option -> (pstate:Proof_global.t -> 'a) -> 'a
-
(* Flag set when the test-suite is called. Its only effect to display
verbose information for `Fail` *)
val test_mode : bool ref
diff --git a/vernac/vernacexpr.ml b/vernac/vernacexpr.ml
index 23633e39ab..6a67a49d0a 100644
--- a/vernac/vernacexpr.ml
+++ b/vernac/vernacexpr.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -81,7 +81,6 @@ type locatable =
type showable =
| ShowGoal of goal_reference
| ShowProof
- | ShowScript
| ShowExistentials
| ShowUniverses
| ShowProofNames
@@ -303,15 +302,17 @@ type nonrec vernac_expr =
(* Type classes *)
| VernacInstance of
- local_binder_expr list * (* super *)
- typeclass_constraint * (* instance name, class name, params *)
- (bool * constr_expr) option * (* props *)
- Hints.hint_info_expr
+ name_decl * (* name *)
+ local_binder_expr list * (* binders *)
+ constr_expr * (* type *)
+ (bool * constr_expr) option * (* body (bool=true when using {}) *)
+ Hints.hint_info_expr
| VernacDeclareInstance of
- local_binder_expr list * (* super *)
- (ident_decl * Decl_kinds.binding_kind * constr_expr) * (* instance name, class name, params *)
- Hints.hint_info_expr
+ ident_decl * (* name *)
+ local_binder_expr list * (* binders *)
+ constr_expr * (* type *)
+ Hints.hint_info_expr
| VernacContext of local_binder_expr list
@@ -360,8 +361,9 @@ type nonrec vernac_expr =
vernac_argument_status list (* Main arguments status list *) *
(Name.t * Impargs.implicit_kind) list list (* Extra implicit status lists *) *
int option (* Number of args to trigger reduction *) *
+ int option (* Number of args before bidirectional typing *) *
[ `ReductionDontExposeCase | `ReductionNeverUnfold | `Rename |
- `ExtraScopes | `Assert | `ClearImplicits | `ClearScopes |
+ `ExtraScopes | `Assert | `ClearImplicits | `ClearScopes | `ClearBidiHint |
`DefaultImplicits ] list
| VernacReserve of simple_binder list
| VernacGeneralizable of (lident list) option
diff --git a/vernac/vernacextend.ml b/vernac/vernacextend.ml
index 730f5fd6da..2725516a76 100644
--- a/vernac/vernacextend.ml
+++ b/vernac/vernacextend.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -16,7 +16,11 @@ type vernac_keep_as = VtKeepAxiom | VtKeepDefined | VtKeepOpaque
type vernac_qed_type = VtKeep of vernac_keep_as | VtDrop
-type vernac_type =
+type vernac_when =
+ | VtNow
+ | VtLater
+
+type vernac_classification =
(* Start of a proof *)
| VtStartProof of vernac_start
(* Command altering the global state, bad for parallel
@@ -37,7 +41,7 @@ type vernac_type =
(* To be removed *)
| VtMeta
and vernac_start = opacity_guarantee * Names.Id.t list
-and vernac_sideff_type = Names.Id.t list
+and vernac_sideff_type = Names.Id.t list * vernac_when
and opacity_guarantee =
| GuaranteesOpacity (** Only generates opaque terms at [Qed] *)
| Doesn'tGuaranteeOpacity (** May generate transparent terms even with [Qed].*)
@@ -48,19 +52,24 @@ and anon_abstracting_tac = bool (** abstracting anonymously its result *)
and proof_block_name = string (** open type of delimiters *)
-type vernac_when =
- | VtNow
- | VtLater
-type vernac_classification = vernac_type * vernac_when
+type typed_vernac =
+ | VtDefault of (unit -> unit)
+
+ | VtNoProof of (unit -> unit)
+ | VtCloseProof of (lemma:Lemmas.t -> unit)
+ | VtOpenProof of (unit -> Lemmas.t)
+ | VtModifyProof of (pstate:Proof_global.t -> Proof_global.t)
+ | VtReadProofOpt of (pstate:Proof_global.t option -> unit)
+ | VtReadProof of (pstate:Proof_global.t -> unit)
-type 'a vernac_command = 'a -> atts:Attributes.vernac_flags -> st:Vernacstate.t -> Vernacstate.t
+type vernac_command = atts:Attributes.vernac_flags -> typed_vernac
type plugin_args = Genarg.raw_generic_argument list
(* Table of vernac entries *)
let vernac_tab =
(Hashtbl.create 211 :
- (Vernacexpr.extend_name, bool * plugin_args vernac_command) Hashtbl.t)
+ (Vernacexpr.extend_name, bool * (plugin_args -> vernac_command)) Hashtbl.t)
let vinterp_add depr s f =
try
@@ -83,7 +92,7 @@ let warn_deprecated_command =
(* Interpretation of a vernac command *)
-let call opn converted_args ~atts ~st =
+let type_vernac opn converted_args ~atts =
let phase = ref "Looking up command" in
try
let depr, callback = vinterp_map opn in
@@ -99,7 +108,7 @@ let call opn converted_args ~atts ~st =
phase := "Checking arguments";
let hunk = callback converted_args in
phase := "Executing command";
- hunk ~atts ~st
+ hunk ~atts
with
| reraise ->
let reraise = CErrors.push reraise in
@@ -120,12 +129,12 @@ let get_vernac_classifier (name, i) args =
let declare_vernac_classifier name f =
classifiers := String.Map.add name f !classifiers
-let classify_as_query = VtQuery, VtLater
-let classify_as_sideeff = VtSideff [], VtLater
-let classify_as_proofstep = VtProofStep { parallel = `No; proof_block_detection = None}, VtLater
+let classify_as_query = VtQuery
+let classify_as_sideeff = VtSideff ([], VtLater)
+let classify_as_proofstep = VtProofStep { parallel = `No; proof_block_detection = None}
type (_, _) ty_sig =
-| TyNil : (atts:Attributes.vernac_flags -> st:Vernacstate.t -> Vernacstate.t, vernac_classification) ty_sig
+| TyNil : (vernac_command, vernac_classification) ty_sig
| TyTerminal : string * ('r, 's) ty_sig -> ('r, 's) ty_sig
| TyNonTerminal : ('a, 'b, 'c) Extend.ty_user_symbol * ('r, 's) ty_sig -> ('a -> 'r, 'a -> 's) ty_sig
@@ -151,7 +160,7 @@ let rec untype_classifier : type r s. (r, s) ty_sig -> s -> classifier = functio
end
(** Stupid GADTs forces us to duplicate the definition just for typing *)
-let rec untype_command : type r s. (r, s) ty_sig -> r -> plugin_args vernac_command = function
+let rec untype_command : type r s. (r, s) ty_sig -> r -> plugin_args -> vernac_command = function
| TyNil -> fun f args ->
begin match args with
| [] -> f
diff --git a/vernac/vernacextend.mli b/vernac/vernacextend.mli
index 54e08d0e95..3df74e5f2c 100644
--- a/vernac/vernacextend.mli
+++ b/vernac/vernacextend.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -22,7 +22,7 @@
a query like Check.
The classification works on the assumption that we have 3 states:
- parsing, execution (global enviroment, etc...), and proof
+ parsing, execution (global environment, etc...), and proof
state. For example, commands that only alter the proof state are
considered safe to delegate to a worker.
@@ -32,7 +32,11 @@ type vernac_keep_as = VtKeepAxiom | VtKeepDefined | VtKeepOpaque
type vernac_qed_type = VtKeep of vernac_keep_as | VtDrop
-type vernac_type =
+type vernac_when =
+ | VtNow
+ | VtLater
+
+type vernac_classification =
(* Start of a proof *)
| VtStartProof of vernac_start
(* Command altering the global state, bad for parallel
@@ -53,7 +57,7 @@ type vernac_type =
(* To be removed *)
| VtMeta
and vernac_start = opacity_guarantee * Names.Id.t list
-and vernac_sideff_type = Names.Id.t list
+and vernac_sideff_type = Names.Id.t list * vernac_when
and opacity_guarantee =
| GuaranteesOpacity (** Only generates opaque terms at [Qed] *)
| Doesn'tGuaranteeOpacity (** May generate transparent terms even with [Qed].*)
@@ -64,25 +68,29 @@ and anon_abstracting_tac = bool (** abstracting anonymously its result *)
and proof_block_name = string (** open type of delimiters *)
-type vernac_when =
- | VtNow
- | VtLater
-type vernac_classification = vernac_type * vernac_when
-
(** Interpretation of extended vernac phrases. *)
-type 'a vernac_command = 'a -> atts:Attributes.vernac_flags -> st:Vernacstate.t -> Vernacstate.t
+type typed_vernac =
+ | VtDefault of (unit -> unit)
+ | VtNoProof of (unit -> unit)
+ | VtCloseProof of (lemma:Lemmas.t -> unit)
+ | VtOpenProof of (unit -> Lemmas.t)
+ | VtModifyProof of (pstate:Proof_global.t -> Proof_global.t)
+ | VtReadProofOpt of (pstate:Proof_global.t option -> unit)
+ | VtReadProof of (pstate:Proof_global.t -> unit)
+
+type vernac_command = atts:Attributes.vernac_flags -> typed_vernac
type plugin_args = Genarg.raw_generic_argument list
-val call : Vernacexpr.extend_name -> plugin_args -> atts:Attributes.vernac_flags -> st:Vernacstate.t -> Vernacstate.t
+val type_vernac : Vernacexpr.extend_name -> plugin_args -> vernac_command
(** {5 VERNAC EXTEND} *)
type classifier = Genarg.raw_generic_argument list -> vernac_classification
type (_, _) ty_sig =
-| TyNil : (atts:Attributes.vernac_flags -> st:Vernacstate.t -> Vernacstate.t, vernac_classification) ty_sig
+| TyNil : (vernac_command, vernac_classification) ty_sig
| TyTerminal : string * ('r, 's) ty_sig -> ('r, 's) ty_sig
| TyNonTerminal :
('a, 'b, 'c) Extend.ty_user_symbol * ('r, 's) ty_sig ->
diff --git a/vernac/vernacprop.ml b/vernac/vernacprop.ml
index b3490c7dc6..1dd8164ebc 100644
--- a/vernac/vernacprop.ml
+++ b/vernac/vernacprop.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/vernacprop.mli b/vernac/vernacprop.mli
index 8296a039f9..8875b86d94 100644
--- a/vernac/vernacprop.mli
+++ b/vernac/vernacprop.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
diff --git a/vernac/vernacstate.ml b/vernac/vernacstate.ml
index 77f54361da..2bc20a747d 100644
--- a/vernac/vernacstate.ml
+++ b/vernac/vernacstate.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -30,16 +30,16 @@ end
type t = {
parsing : Parser.state;
system : States.state; (* summary + libstack *)
- proof : Proof_global.t option; (* proof state *)
+ lemmas : Lemmas.Stack.t option; (* proofs of lemmas currently opened *)
shallow : bool (* is the state trimmed down (libstack) *)
}
let s_cache = ref None
-let s_proof = ref None
+let s_lemmas = ref None
let invalidate_cache () =
s_cache := None;
- s_proof := None
+ s_lemmas := None
let update_cache rf v =
rf := Some v; v
@@ -55,14 +55,14 @@ let do_if_not_cached rf f v =
let freeze_interp_state ~marshallable =
{ system = update_cache s_cache (States.freeze ~marshallable);
- proof = !s_proof;
+ lemmas = !s_lemmas;
shallow = false;
parsing = Parser.cur_state ();
}
-let unfreeze_interp_state { system; proof; parsing } =
+let unfreeze_interp_state { system; lemmas; parsing } =
do_if_not_cached s_cache States.unfreeze system;
- s_proof := proof;
+ s_lemmas := lemmas;
Pcoq.unfreeze parsing
let make_shallow st =
@@ -75,11 +75,16 @@ let make_shallow st =
(* Compatibility module *)
module Proof_global = struct
- let get () = !s_proof
- let set x = s_proof := x
+ type t = Lemmas.Stack.t
+
+ let get () = !s_lemmas
+ let set x = s_lemmas := x
+
+ let get_pstate () =
+ Option.map (Lemmas.Stack.with_top ~f:(Lemmas.pf_fold (fun x -> x))) !s_lemmas
let freeze ~marshallable:_ = get ()
- let unfreeze x = s_proof := Some x
+ let unfreeze x = s_lemmas := Some x
exception NoCurrentProof
@@ -90,49 +95,62 @@ module Proof_global = struct
| _ -> raise CErrors.Unhandled
end
+ open Lemmas
open Proof_global
- let cc f = match !s_proof with
+ let cc f = match !s_lemmas with
+ | None -> raise NoCurrentProof
+ | Some x -> Stack.with_top_pstate ~f x
+
+ let cc_lemma f = match !s_lemmas with
+ | None -> raise NoCurrentProof
+ | Some x -> Stack.with_top ~f x
+
+ let cc_stack f = match !s_lemmas with
| None -> raise NoCurrentProof
| Some x -> f x
- let dd f = match !s_proof with
+ let dd f = match !s_lemmas with
| None -> raise NoCurrentProof
- | Some x -> s_proof := Some (f x)
+ | Some x -> s_lemmas := Some (Stack.map_top_pstate ~f x)
- let there_are_pending_proofs () = !s_proof <> None
+ let there_are_pending_proofs () = !s_lemmas <> None
let get_open_goals () = cc get_open_goals
- let set_terminator x = dd (set_terminator x)
- let give_me_the_proof_opt () = Option.map give_me_the_proof !s_proof
- let give_me_the_proof () = cc give_me_the_proof
- let get_current_proof_name () = cc get_current_proof_name
-
- let simple_with_current_proof f =
- dd (simple_with_current_proof f)
+ let give_me_the_proof_opt () = Option.map (Stack.with_top_pstate ~f:get_proof) !s_lemmas
+ let give_me_the_proof () = cc get_proof
+ let get_current_proof_name () = cc get_proof_name
+ let map_proof f = dd (map_proof f)
let with_current_proof f =
- let pf, res = cc (with_current_proof f) in
- s_proof := Some pf; res
+ match !s_lemmas with
+ | None -> raise NoCurrentProof
+ | Some stack ->
+ let pf, res = Stack.with_top_pstate stack ~f:(map_fold_proof_endline f) in
+ let stack = Stack.map_top_pstate stack ~f:(fun _ -> pf) in
+ s_lemmas := Some stack;
+ res
+
+ type closed_proof = Proof_global.proof_object * Lemmas.proof_info
- let install_state s = s_proof := Some s
- let return_proof ?allow_partial () =
- cc (return_proof ?allow_partial)
+ let return_proof ?allow_partial () = cc (return_proof ?allow_partial)
let close_future_proof ~opaque ~feedback_id pf =
- cc (fun st -> close_future_proof ~opaque ~feedback_id st pf)
+ cc_lemma (fun pt -> pf_fold (fun st -> close_future_proof ~opaque ~feedback_id st pf) pt,
+ Internal.get_info pt)
let close_proof ~opaque ~keep_body_ucst_separate f =
- cc (close_proof ~opaque ~keep_body_ucst_separate f)
+ cc_lemma (fun pt -> pf_fold ((close_proof ~opaque ~keep_body_ucst_separate f)) pt,
+ Internal.get_info pt)
- let discard_all () = s_proof := None
- let update_global_env () = dd update_global_env
+ let discard_all () = s_lemmas := None
+ let update_global_env () = dd (update_global_env)
let get_current_context () = cc Pfedit.get_current_context
let get_all_proof_names () =
- try cc get_all_proof_names
+ try cc_stack Lemmas.Stack.get_all_proof_names
with NoCurrentProof -> []
let copy_terminators ~src ~tgt =
@@ -140,6 +158,6 @@ module Proof_global = struct
| None, None -> None
| Some _ , None -> None
| None, Some x -> Some x
- | Some src, Some tgt -> Some (copy_terminators ~src ~tgt)
+ | Some src, Some tgt -> Some (Stack.copy_info ~src ~tgt)
end
diff --git a/vernac/vernacstate.mli b/vernac/vernacstate.mli
index dff81ad9bb..7e4d5d0315 100644
--- a/vernac/vernacstate.mli
+++ b/vernac/vernacstate.mli
@@ -1,6 +1,6 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
@@ -18,12 +18,12 @@ module Parser : sig
end
-type t = {
- parsing : Parser.state;
- system : States.state; (* summary + libstack *)
- proof : Proof_global.t option; (* proof state *)
- shallow : bool (* is the state trimmed down (libstack) *)
-}
+type t =
+ { parsing : Parser.state
+ ; system : States.state (* summary + libstack *)
+ ; lemmas : Lemmas.Stack.t option (* proofs of lemmas currently opened *)
+ ; shallow : bool (* is the state trimmed down (libstack) *)
+ }
val freeze_interp_state : marshallable:bool -> t
val unfreeze_interp_state : t -> unit
@@ -36,41 +36,29 @@ val invalidate_cache : unit -> unit
(* Compatibility module: Do Not Use *)
module Proof_global : sig
- open Proof_global
-
- (* Low-level stuff *)
- val get : unit -> t option
- val set : t option -> unit
-
- val freeze : marshallable:bool -> t option
- val unfreeze : t -> unit
-
exception NoCurrentProof
val there_are_pending_proofs : unit -> bool
val get_open_goals : unit -> int
- val set_terminator : proof_terminator -> unit
val give_me_the_proof : unit -> Proof.t
val give_me_the_proof_opt : unit -> Proof.t option
val get_current_proof_name : unit -> Names.Id.t
- val simple_with_current_proof :
- (unit Proofview.tactic -> Proof.t -> Proof.t) -> unit
-
+ val map_proof : (Proof.t -> Proof.t) -> unit
val with_current_proof :
(unit Proofview.tactic -> Proof.t -> Proof.t * 'a) -> 'a
- val install_state : t -> unit
+ val return_proof : ?allow_partial:bool -> unit -> Proof_global.closed_proof_output
- val return_proof : ?allow_partial:bool -> unit -> closed_proof_output
+ type closed_proof = Proof_global.proof_object * Lemmas.proof_info
val close_future_proof :
- opaque:opacity_flag ->
+ opaque:Proof_global.opacity_flag ->
feedback_id:Stateid.t ->
- closed_proof_output Future.computation -> closed_proof
+ Proof_global.closed_proof_output Future.computation -> closed_proof
- val close_proof : opaque:opacity_flag -> keep_body_ucst_separate:bool -> Future.fix_exn -> closed_proof
+ val close_proof : opaque:Proof_global.opacity_flag -> keep_body_ucst_separate:bool -> Future.fix_exn -> closed_proof
val discard_all : unit -> unit
val update_global_env : unit -> unit
@@ -79,7 +67,19 @@ module Proof_global : sig
val get_all_proof_names : unit -> Names.Id.t list
- val copy_terminators : src:t option -> tgt:t option -> t option
+ val copy_terminators : src:Lemmas.Stack.t option -> tgt:Lemmas.Stack.t option -> Lemmas.Stack.t option
+
+ (* Handling of the imperative state *)
+ type t = Lemmas.Stack.t
+
+ (* Low-level stuff *)
+ val get : unit -> t option
+ val set : t option -> unit
+
+ val get_pstate : unit -> Proof_global.t option
+
+ val freeze : marshallable:bool -> t option
+ val unfreeze : t -> unit
end
[@@ocaml.deprecated "This module is internal and should not be used, instead, thread the proof state"]