aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.circleci/config.yml11
-rw-r--r--.github/CODEOWNERS11
-rw-r--r--.gitignore18
-rw-r--r--.gitlab-ci.yml175
-rw-r--r--.merlin2
-rw-r--r--.travis.yml14
-rw-r--r--CHANGES15
-rw-r--r--INSTALL.doc14
-rw-r--r--META.coq13
-rw-r--r--Makefile5
-rw-r--r--Makefile.ci3
-rw-r--r--Makefile.common4
-rw-r--r--Makefile.doc146
-rw-r--r--configure.ml46
-rw-r--r--default.nix8
-rw-r--r--dev/base_include1
-rwxr-xr-x[-rw-r--r--]dev/ci/ci-basic-overlay.sh14
-rwxr-xr-xdev/ci/ci-fcsl-pcm.sh12
-rwxr-xr-xdev/ci/ci-fiat-crypto.sh2
-rwxr-xr-xdev/ci/ci-iris-lambda-rust.sh15
-rwxr-xr-xdev/ci/ci-mtac2.sh (renamed from dev/ci/ci-metacoq.sh)6
-rw-r--r--dev/ci/user-overlays/07152-ejgallego-api+vernac_expr_iso.sh12
-rw-r--r--dev/core.dbg1
-rw-r--r--dev/doc/MERGING.md2
-rw-r--r--dev/doc/changes.md13
-rw-r--r--dev/doc/coq-src-description.txt6
-rw-r--r--dev/doc/debugging.md2
-rw-r--r--dev/ocamldebug-coq.run2
-rwxr-xr-xdev/tools/merge-pr.sh8
-rwxr-xr-xdev/tools/pre-commit6
-rw-r--r--dev/top_printers.ml4
-rw-r--r--doc/refman/AddRefMan-pre.tex63
-rw-r--r--doc/refman/Reference-Manual.tex134
-rw-r--r--doc/refman/biblio.bib1397
-rw-r--r--doc/refman/coq-listing.tex152
-rw-r--r--doc/refman/coqide-queries.pngbin66656 -> 0 bytes
-rw-r--r--doc/refman/coqide.pngbin59662 -> 0 bytes
-rw-r--r--doc/refman/headers.hva44
-rw-r--r--doc/refman/headers.sty88
-rw-r--r--doc/refman/index.html14
-rw-r--r--doc/refman/menu.html32
-rw-r--r--doc/sphinx/addendum/generalized-rewriting.rst10
-rw-r--r--doc/sphinx/addendum/implicit-coercions.rst45
-rw-r--r--doc/sphinx/addendum/micromega.rst64
-rw-r--r--doc/sphinx/addendum/program.rst3
-rw-r--r--doc/sphinx/addendum/type-classes.rst184
-rw-r--r--doc/sphinx/biblio.bib3
-rw-r--r--doc/sphinx/credits.rst21
-rw-r--r--doc/sphinx/language/gallina-extensions.rst31
-rw-r--r--doc/sphinx/language/gallina-specification-language.rst62
-rw-r--r--doc/sphinx/proof-engine/ltac.rst39
-rw-r--r--doc/sphinx/proof-engine/proof-handling.rst46
-rw-r--r--doc/sphinx/proof-engine/ssreflect-proof-language.rst28
-rw-r--r--doc/sphinx/proof-engine/tactics.rst625
-rw-r--r--doc/sphinx/proof-engine/vernacular-commands.rst249
-rw-r--r--doc/sphinx/user-extensions/proof-schemes.rst47
-rw-r--r--doc/sphinx/user-extensions/syntax-extensions.rst6
-rw-r--r--engine/engine.mllib1
-rw-r--r--engine/evar_kinds.ml (renamed from intf/evar_kinds.ml)0
-rw-r--r--engine/evarutil.ml46
-rw-r--r--engine/evarutil.mli23
-rw-r--r--engine/universes.ml257
-rw-r--r--engine/universes.mli2
-rw-r--r--ide/ide_slave.ml2
-rw-r--r--interp/interp.mllib1
-rw-r--r--interp/notation_term.ml (renamed from intf/notation_term.ml)0
-rw-r--r--intf/intf.mllib11
-rw-r--r--kernel/byterun/coq_interp.c21
-rw-r--r--kernel/byterun/coq_interp.h9
-rw-r--r--kernel/byterun/coq_memory.c72
-rw-r--r--kernel/byterun/coq_memory.h7
-rw-r--r--kernel/cbytegen.ml4
-rw-r--r--kernel/cbytegen.mli3
-rw-r--r--kernel/clambda.ml4
-rw-r--r--kernel/clambda.mli3
-rw-r--r--kernel/csymtable.ml31
-rw-r--r--kernel/csymtable.mli2
-rw-r--r--kernel/kernel.mllib2
-rw-r--r--kernel/uGraph.ml15
-rw-r--r--kernel/uGraph.mli5
-rw-r--r--kernel/univ.ml15
-rw-r--r--kernel/univ.mli2
-rw-r--r--kernel/vm.ml9
-rw-r--r--kernel/vmvalues.ml24
-rw-r--r--kernel/vmvalues.mli6
-rw-r--r--lib/flags.ml9
-rw-r--r--lib/flags.mli32
-rw-r--r--library/decl_kinds.ml (renamed from intf/decl_kinds.ml)0
-rw-r--r--library/declaremods.ml16
-rw-r--r--library/declaremods.mli16
-rw-r--r--library/library.mllib2
-rw-r--r--library/misctypes.ml (renamed from intf/misctypes.ml)0
-rw-r--r--parsing/g_vernac.ml41
-rw-r--r--plugins/ltac/g_ltac.ml41
-rw-r--r--plugins/ltac/pptactic.ml1
-rw-r--r--plugins/ltac/tacexpr.ml1
-rw-r--r--plugins/ltac/tacexpr.mli1
-rw-r--r--plugins/ltac/tacinterp.ml3
-rw-r--r--pretyping/constrexpr.ml (renamed from intf/constrexpr.ml)0
-rw-r--r--pretyping/detyping.ml2
-rw-r--r--pretyping/extend.ml (renamed from intf/extend.ml)0
-rw-r--r--pretyping/genredexpr.ml (renamed from intf/genredexpr.ml)0
-rw-r--r--pretyping/glob_term.ml (renamed from intf/glob_term.ml)0
-rw-r--r--pretyping/locus.ml (renamed from intf/locus.ml)0
-rw-r--r--pretyping/pattern.ml (renamed from intf/pattern.ml)0
-rw-r--r--pretyping/pretyping.ml2
-rw-r--r--pretyping/pretyping.mllib9
-rw-r--r--pretyping/vernacexpr.ml (renamed from intf/vernacexpr.ml)13
-rw-r--r--printing/ppvernac.ml7
-rw-r--r--proofs/logic.ml68
-rw-r--r--proofs/pfedit.ml12
-rw-r--r--proofs/proof_bullet.ml4
-rw-r--r--stm/stm.ml84
-rw-r--r--stm/stm.mli11
-rw-r--r--stm/workerLoop.ml4
-rw-r--r--stm/workerLoop.mli4
-rw-r--r--tactics/tacticals.ml4
-rw-r--r--tactics/tactics.ml52
-rw-r--r--test-suite/Makefile37
-rw-r--r--test-suite/success/evars.v5
-rw-r--r--test-suite/success/goal_selector.v14
-rw-r--r--theories/Lists/Streams.v2
-rw-r--r--toplevel/coqtop.ml4
-rw-r--r--toplevel/coqtop.mli3
-rw-r--r--vernac/classes.ml2
-rw-r--r--vernac/comAssumption.ml3
-rw-r--r--vernac/comAssumption.mli4
-rw-r--r--vernac/vernacentries.ml12
128 files changed, 1624 insertions, 3376 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 00db64f26..f811f26e1 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -54,7 +54,6 @@ opam-switch: &opam-switch
- restore_cache:
keys:
- coq-opam-cache-v1-{{ arch }}-{{ checksum "COMPILER" }}-{{ checksum ".circleci/config.yml" }}-
- - coq-opam-cache-v1-{{ arch }}-{{ checksum "COMPILER" }}- # this grabs old cache if checksum doesn't match
- run:
name: Update opam lists
command: |
@@ -127,7 +126,7 @@ jobs:
<<: *opam-boot-template
environment:
<<: *envvars
- EXTRA_OPAM: "ocamlgraph ppx_tools_versioned ppx_deriving ocaml-migrate-parsetree"
+ EXTRA_OPAM: "ocamlgraph elpi"
# Build and prepare test environment
build: *build-template
@@ -165,6 +164,9 @@ jobs:
geocoq:
<<: *ci-template
+ fcsl-pcm:
+ <<: *ci-template
+
fiat-crypto:
<<: *ci-template
@@ -204,6 +206,9 @@ jobs:
math-comp:
<<: *ci-template
+ mtac2:
+ <<: *ci-template
+
sf:
<<: *ci-template
environment:
@@ -240,6 +245,7 @@ workflows:
- elpi: *req-main
- equations: *req-main
- geocoq: *req-main
+ - fcsl-pcm: *req-main
- fiat-crypto: *req-main
- fiat-parsers: *req-main
- flocq: *req-main
@@ -247,6 +253,7 @@ workflows:
requires:
- build
- bignums
+ - mtac2: *req-main
- corn:
requires:
- build
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 2d8fc791b..329697ca4 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -11,6 +11,9 @@
/dev/ci/*.sh @ejgallego
# Secondary maintainer @SkySkimmer
+/.circleci/ @SkySkimmer
+# Secondary maintainer @ejgallego
+
/.travis.yml @ejgallego
# Secondary maintainer @SkySkimmer
@@ -83,11 +86,6 @@
/interp/ @herbelin
# Secondary maintainer @ejgallego
-########## Interfaces ##########
-
-/intf/ @letouzey
-# Secondary maintainer @ppedrot
-
########## Kernel ##########
/kernel/ @maximedenes
@@ -304,6 +302,9 @@
/dev/build/windows @MSoegtropIMC
# Secondary maintainer @maximedenes
+# This file belongs to CI
+Makefile.ci @ejgallego
+# Secondary maintainer @SkySkimmer
########## Developer tools ##########
diff --git a/.gitignore b/.gitignore
index 267534365..25c0996cb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -96,21 +96,6 @@ doc/faq/axioms.eps
doc/faq/axioms.eps_t
doc/faq/axioms.pdf_t
doc/faq/axioms.png
-doc/refman/.csdp.cache
-doc/refman/trace
-doc/refman/Reference-Manual.ps
-doc/refman/Reference-Manual.html
-doc/refman/Reference-Manual.out
-doc/refman/Reference-Manual.sh
-doc/refman/cover.html
-doc/refman/styles.hva
-doc/refman/coqide-queries.eps
-doc/refman/coqide.eps
-doc/refman/euclid.ml
-doc/refman/euclid.mli
-doc/refman/heapsort.ml
-doc/refman/heapsort.mli
-doc/refman/html/
doc/stdlib/Library.out
doc/stdlib/Library.ps
doc/stdlib/Library.coqdoc.tex
@@ -177,9 +162,6 @@ dev/myinclude
# coqide generated files (when testing)
*.crashcoqide
-/doc/refman/Reference-Manual.hoptind
-/doc/refman/Reference-Manual.optidx
-/doc/refman/Reference-Manual.optind
user-contrib
.*.sw*
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f0d7463fc..6b42ac7eb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,61 +1,76 @@
-image: ocaml/opam:ubuntu
-
-# this doesn't seem to work
-cache:
- paths:
- - .opamcache
+image: ubuntu:bionic
stages:
+ - opam-boot
- build
- test
+# some default values
variables:
- # some default values
+ # Format: $IMAGE-V$DATE-$HOUR-$MINUTE
+ CACHEKEY: bionic-V2018-04-29-00-50
+ DEBIAN_FRONTEND: "noninteractive"
NJOBS: "2"
- COMPILER: "system"
+ COMPILER: "4.02.3"
CAMLP5_VER: "6.14"
+ OPAMROOT: "$CI_PROJECT_DIR/.opamcache"
+ OPAMROOTISOK: "true"
# some useful values
COMPILER_32BIT: "4.02.3+32bit"
- COMPILER_BLEEDING_EDGE: "4.06.0"
- CAMLP5_VER_BLEEDING_EDGE: "7.03"
+ COMPILER_BLEEDING_EDGE: "4.06.1"
+ CAMLP5_VER_BLEEDING_EDGE: "7.05"
- TIMING_PACKAGES: "time python"
+ TIMING_PACKAGES: "time python3"
COQIDE_PACKAGES: "libgtk2.0-dev libgtksourceview2.0-dev"
#COQIDE_PACKAGES_32BIT: "libgtk2.0-dev:i386 libgtksourceview2.0-dev:i386"
- COQIDE_OPAM: "lablgtk-extras"
- COQIDE_OPAM_BE: "lablgtk.2.18.6 lablgtk-extras.1.6"
- COQDOC_PACKAGES: "texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-math-extra texlive-fonts-recommended texlive-fonts-extra latex-xcolor ghostscript transfig imagemagick tipa python3-pip"
- COQDOC_OPAM: "hevea"
- SPHINX_PACKAGES: "bs4 sphinx sphinx_rtd_theme pexpect antlr4-python3-runtime sphinxcontrib-bibtex"
-
+ COQIDE_OPAM: "lablgtk.2.18.5 conf-gtksourceview.2"
+ COQIDE_OPAM_BE: "lablgtk.2.18.6 conf-gtksourceview.2"
+ COQDOC_PACKAGES: "texlive-latex-extra texlive-fonts-recommended hevea python3-sphinx python3-pexpect python3-sphinx-rtd-theme python3-bs4 python3-sphinxcontrib.bibtex python3-pip"
+ SPHINX_PACKAGES: "antlr4-python3-runtime"
+ ELPI_OPAM: "elpi"
before_script:
- - ls # figure out if artifacts are around
+ - cat /proc/{cpu,mem}info || true
+ - ls -a # figure out if artifacts are around
- printenv
# - if [ "$COMPILER" = "$COMPILER_32BIT" ]; then sudo dpkg --add-architecture i386; fi
- - if [ -n "${EXTRA_PACKAGES}" ]; then sudo apt-get update -qq && sudo apt-get install -y -qq ${EXTRA_PACKAGES}; fi
- - if [ -n "${PIP_PACKAGES}" ]; then sudo pip3 install ${PIP_PACKAGES}; fi
-
- # setup cache
- - if [ ! "(" -d .opamcache ")" ]; then mv ~/.opam .opamcache; else mv ~/.opam ~/.opam-old; fi
- - ln -s $(readlink -f .opamcache) ~/.opam
-
- # the default repo in this docker image is a local directory
- # at the time of 4aaeb8abf it lagged behind the official
- # repository such that camlp5 7.01 was not available
- - opam repository set-url default https://opam.ocaml.org
- - opam update
- - opam switch ${COMPILER}
- - eval $(opam config env)
- - opam config list
- - opam install -j ${NJOBS} -y camlp5.${CAMLP5_VER} ocamlfind num ${EXTRA_OPAM}
- - rm -rf ~/.opam/log/
- - opam list
+ - apt-get update -qq && apt-get install -y -qq m4 opam ${EXTRA_PACKAGES}
+ # This should be replaced by standard debian packages once python3-antlr4 makes to the archive.
+ - if [ -n "${PIP_PACKAGES}" ]; then pip3 install ${PIP_PACKAGES}; fi
+ # if no cache running opam config fails!
+ - if [ -d .opamcache ]; then eval $(opam config env); fi
+
+################ OPAM SYSTEM ######################
+# - use cache between pipelines
+# - use artifacts between jobs
+# (in https://gitlab.com/SkySkimmer/coq/-/jobs/63255417
+# the cache wasn't available at the build step)
+# every non opam-boot job must set dependencies (for ci it's in the template)
+# otherwise all opam-boot artifacts are used together and we get some random switch
+
+# set cache key when using
+.opam-boot-template: &opam-boot-template
+ stage: opam-boot
+ artifacts:
+ name: "opam-$COMPILER"
+ paths:
+ - .opamcache
+ expire_in: 1 week
+ script:
+ - opam init -a -y -j $NJOBS --compiler=${COMPILER} default https://opam.ocaml.org
+ - eval $(opam config env)
+ - opam update
+ - opam config list
+ - opam list
+ - opam install -j ${NJOBS} -y camlp5.${CAMLP5_VER} ocamlfind num ${EXTRA_OPAM}
+ - rm -rf ~/.opam/log/
+ - opam list
# TODO figure out how to build doc for installed coq
+# set dependencies when using
.build-template: &build-template
stage: build
artifacts:
@@ -65,8 +80,13 @@ before_script:
- config/Makefile
- test-suite/misc/universes/all_stdlib.v
expire_in: 1 week
+ dependencies:
+ - not-a-real-job
script:
- set -e
+ - printenv
+ - opam config list
+ - opam list
- echo 'start:coq.config'
- ./configure -prefix "$(pwd)/_install_ci" ${EXTRA_CONF}
@@ -86,10 +106,12 @@ before_script:
- set +e
+# set dependencies when using
.warnings-template: &warnings-template
# keep warnings in test stage so we can test things even when warnings occur
stage: test
- dependencies: []
+ dependencies:
+ - not-a-real-job
script:
- set -e
@@ -107,8 +129,11 @@ before_script:
EXTRA_PACKAGES: "$COQIDE_PACKAGES"
EXTRA_OPAM: "$COQIDE_OPAM"
+# set dependencies when using
.test-suite-template: &test-suite-template
stage: test
+ dependencies:
+ - not-a-real-job
script:
- cd test-suite
- make clean
@@ -122,8 +147,11 @@ before_script:
paths:
- test-suite/logs
+# set dependencies when using
.validate-template: &validate-template
stage: test
+ dependencies:
+ - not-a-real-job
script:
- cd _install_ci
- find lib/coq/ -name '*.vo' -print0 > vofiles
@@ -139,57 +167,90 @@ before_script:
- echo 'end:coq.test'
- set +e
dependencies:
+ - opam-boot
- build
variables: &ci-template-vars
TEST_TARGET: "$CI_JOB_NAME"
EXTRA_PACKAGES: "$TIMING_PACKAGES"
+opam-boot:
+ <<: *opam-boot-template
+ cache:
+ paths: &cache-paths
+ - .opamcache
+ key: "main-$CACHEKEY"
+ variables:
+ EXTRA_OPAM: "$COQIDE_OPAM ocamlgraph $ELPI_OPAM"
+ EXTRA_PACKAGES: "$COQIDE_PACKAGES"
+
+opam-boot:32bit:
+ <<: *opam-boot-template
+ cache:
+ paths: *cache-paths
+ key: "32bit-$CACHEKEY"
+ variables:
+ COMPILER: "$COMPILER_32BIT"
+ EXTRA_PACKAGES: "gcc-multilib"
+
+opam-boot:bleeding-edge:
+ <<: *opam-boot-template
+ cache:
+ paths: *cache-paths
+ key: "be-$CACHEKEY"
+ variables:
+ COMPILER: "$COMPILER_BLEEDING_EDGE"
+ CAMLP5_VER: "$CAMLP5_VER_BLEEDING_EDGE"
+ EXTRA_PACKAGES: "$COQIDE_PACKAGES"
+ EXTRA_OPAM: "$COQIDE_OPAM_BE"
+
build:
<<: *build-template
+ dependencies:
+ - opam-boot
variables:
EXTRA_CONF: "-native-compiler yes -coqide opt -with-doc yes"
EXTRA_PACKAGES: "$COQIDE_PACKAGES $COQDOC_PACKAGES"
- EXTRA_OPAM: "$COQIDE_OPAM $COQDOC_OPAM"
PIP_PACKAGES: "$SPHINX_PACKAGES"
# no coqide for 32bit: libgtk installation problems
build:32bit:
<<: *build-template
+ dependencies:
+ - opam-boot:32bit
variables:
EXTRA_CONF: "-native-compiler yes"
EXTRA_PACKAGES: "gcc-multilib"
- COMPILER: "$COMPILER_32BIT"
build:bleeding-edge:
<<: *build-template
+ dependencies:
+ - opam-boot:bleeding-edge
variables:
EXTRA_CONF: "-native-compiler yes -coqide opt"
- COMPILER: "$COMPILER_BLEEDING_EDGE"
- CAMLP5_VER: "$CAMLP5_VER_BLEEDING_EDGE"
EXTRA_PACKAGES: "$COQIDE_PACKAGES"
- EXTRA_OPAM: "$COQIDE_OPAM_BE"
warnings:
<<: *warnings-template
+ dependencies:
+ - opam-boot
# warnings:32bit:
# <<: *warnings-template
# variables:
# <<: *warnings-variables
# EXTRA_PACKAGES: "$gcc-multilib COQIDE_PACKAGES_32BIT"
-# COMPILER: "$COMPILER_32BIT"
+# dependencies:
+# - opam-boot:32bit
warnings:bleeding-edge:
<<: *warnings-template
- variables:
- <<: *warnings-variables
- COMPILER: "$COMPILER_BLEEDING_EDGE"
- CAMLP5_VER: "$CAMLP5_VER_BLEEDING_EDGE"
- EXTRA_OPAM: "$COQIDE_OPAM_BE"
+ dependencies:
+ - opam-boot:bleeding-edge
test-suite:
<<: *test-suite-template
dependencies:
+ - opam-boot
- build
variables:
EXTRA_PACKAGES: "$TIMING_PACKAGES"
@@ -197,31 +258,31 @@ test-suite:
test-suite:32bit:
<<: *test-suite-template
dependencies:
+ - opam-boot:32bit
- build:32bit
variables:
- COMPILER: "$COMPILER_32BIT"
EXTRA_PACKAGES: "gcc-multilib $TIMING_PACKAGES"
test-suite:bleeding-edge:
<<: *test-suite-template
dependencies:
+ - opam-boot:bleeding-edge
- build:bleeding-edge
variables:
- COMPILER: "$COMPILER_BLEEDING_EDGE"
- CAMLP5_VER: "$CAMLP5_VER_BLEEDING_EDGE"
EXTRA_PACKAGES: "$TIMING_PACKAGES"
validate:
<<: *validate-template
dependencies:
+ - opam-boot
- build
validate:32bit:
<<: *validate-template
dependencies:
+ - opam-boot:32bit
- build:32bit
variables:
- COMPILER: "$COMPILER_32BIT"
EXTRA_PACKAGES: "gcc-multilib"
ci-bignums:
@@ -240,7 +301,6 @@ ci-coq-dpdgraph:
<<: *ci-template
variables:
<<: *ci-template-vars
- EXTRA_OPAM: "ocamlgraph"
EXTRA_PACKAGES: "$TIMING_PACKAGES autoconf"
ci-coquelicot:
@@ -251,9 +311,6 @@ ci-coquelicot:
ci-elpi:
<<: *ci-template
- variables:
- <<: *ci-template-vars
- EXTRA_OPAM: "ppx_tools_versioned ppx_deriving ocaml-migrate-parsetree"
ci-equations:
<<: *ci-template
@@ -262,6 +319,9 @@ ci-geocoq:
<<: *ci-template
allow_failure: true
+ci-fcsl-pcm:
+ <<: *ci-template
+
# ci-fiat-crypto:
# <<: *ci-template
# # out of memory error
@@ -300,6 +360,9 @@ ci-math-classes:
ci-math-comp:
<<: *ci-template
+ci-mtac2:
+ <<: *ci-template
+
ci-sf:
<<: *ci-template
variables:
diff --git a/.merlin b/.merlin
index d60f5037b..40db60950 100644
--- a/.merlin
+++ b/.merlin
@@ -10,8 +10,6 @@ S kernel
B kernel
S kernel/byterun
B kernel/byterun
-S intf
-B intf
S library
B library
S engine
diff --git a/.travis.yml b/.travis.yml
index e56204b0e..a60d68de5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -76,9 +76,9 @@ matrix:
- TEST_TARGET="ci-coquelicot"
- if: NOT (type = pull_request)
env:
+ - TEST_TARGET="ci-elpi" EXTRA_OPAM="elpi"
# ppx_tools_versioned requires a specific version findlib
- FINDLIB_VER=""
- - TEST_TARGET="ci-elpi" EXTRA_OPAM="ppx_tools_versioned ppx_deriving ocaml-migrate-parsetree"
- if: NOT (type = pull_request)
env:
- TEST_TARGET="ci-equations"
@@ -87,6 +87,9 @@ matrix:
- TEST_TARGET="ci-geocoq"
- if: NOT (type = pull_request)
env:
+ - TEST_TARGET="ci-fcsl-pcm"
+ - if: NOT (type = pull_request)
+ env:
- TEST_TARGET="ci-fiat-crypto"
- if: NOT (type = pull_request)
env:
@@ -114,6 +117,9 @@ matrix:
- TEST_TARGET="ci-math-comp"
- if: NOT (type = pull_request)
env:
+ - TEST_TARGET="ci-mtac2"
+ - if: NOT (type = pull_request)
+ env:
- TEST_TARGET="ci-sf"
- if: NOT (type = pull_request)
env:
@@ -157,8 +163,6 @@ matrix:
- texlive-fonts-extra
- latex-xcolor
- ghostscript
- - transfig
- - imagemagick
- tipa
- python3
- python3-pip
@@ -199,8 +203,6 @@ matrix:
- MAIN_TARGET="coqocaml"
- EXTRA_CONF="-byte-only -coqide byte -warn-error yes"
- EXTRA_OPAM="hevea ${LABLGTK}"
- # dummy target
- - BUILD_TARGET="clean"
addons:
apt:
sources:
@@ -218,8 +220,6 @@ matrix:
- CAMLP5_VER="${CAMLP5_VER_BE}"
- EXTRA_CONF="-byte-only -coqide byte -warn-error yes"
- EXTRA_OPAM="num hevea ${LABLGTK_BE}"
- # dummy target
- - BUILD_TARGET="clean"
addons:
apt:
sources:
diff --git a/CHANGES b/CHANGES
index 40e8547ae..a270aef96 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,12 @@
Changes from 8.8.2 to 8.9+beta1
===============================
+Tactics
+
+- Added toplevel goal selector ! which expects a single focused goal.
+ Use with Set Default Goal Selector to force focusing before tactics
+ are called.
+
Tools
- Coq_makefile lets one override or extend the following variables from
@@ -17,8 +23,9 @@ Tactic language
- Support for fix/cofix added in Ltac "match" and "lazymatch".
-- Ltac backtraces now contain include trace information about tactics
+- Ltac backtraces now include trace information about tactics
called by OCaml-defined tactics.
+- Option "Ltac Debug" now applies also to terms built using Ltac functions.
Changes from 8.8+beta1 to 8.8.0
===============================
@@ -35,6 +42,12 @@ Tactic language
deprecated; please use `fix/cofix ident N` to explicitely name
hypothesis to be introduced.
+Documentation
+
+- The reference manual is now fully ported to Sphinx.
+
+Other small deprecations and bug fixes.
+
Changes from 8.7.2 to 8.8+beta1
===============================
diff --git a/INSTALL.doc b/INSTALL.doc
index b71115bfa..8c578fbd6 100644
--- a/INSTALL.doc
+++ b/INSTALL.doc
@@ -22,10 +22,7 @@ To produce all the documents, the following tools are needed:
- dvips
- bibtex
- makeindex
- - fig2dev (transfig)
- - convert (ImageMagick)
- hevea
- - hacha
- Python 3
- Sphinx 1.6.5 (http://www.sphinx-doc.org/en/stable/)
- sphinx_rtd_theme
@@ -38,12 +35,11 @@ Under Debian based operating systems (Debian, Ubuntu, ...) a
working set of packages for compiling the documentation for Coq is:
texlive texlive-latex-extra texlive-math-extra texlive-fonts-extra
- texlive-humanities texlive-pictures latex-xcolor hevea transfig
- imagemagick
- python3 python-pip3
+ texlive-humanities texlive-pictures latex-xcolor hevea python3
+ python-pip3
To install the Python packages required to build the user manual, run:
- pip3 install sphinx sphinx_rtd_theme beautifulsoup4 antlr4-python3-runtime pexpect
+ pip3 install sphinx sphinx_rtd_theme beautifulsoup4 antlr4-python3-runtime pexpect sphinxcontrib-bibtex
Compilation
@@ -66,8 +62,8 @@ Alternatively, you can use some specific targets:
make doc-html
to produce all html documents
- make refman
- to produce all formats of the reference manual
+ make sphinx
+ to produce the HTML version of the reference manual
make tutorial
to produce all formats of the tutorial
diff --git a/META.coq b/META.coq
index 30bfdd67a..3414ccbd4 100644
--- a/META.coq
+++ b/META.coq
@@ -90,19 +90,6 @@ package "library" (
)
-package "intf" (
-
- description = "Coq Public Data Types"
- version = "8.8"
-
- requires = "coq.library"
-
- directory = "intf"
-
- archive(byte) = "intf.cma"
- archive(native) = "intf.cmxa"
-)
-
package "engine" (
description = "Coq Tactic Engine"
diff --git a/Makefile b/Makefile
index c31534f36..793afb661 100644
--- a/Makefile
+++ b/Makefile
@@ -235,11 +235,8 @@ docclean:
doc/stdlib/*Library.coqdoc.tex doc/stdlib/library.files \
doc/stdlib/library.files.ls doc/stdlib/FullLibrary.tex
rm -f doc/*/*.ps doc/*/*.pdf doc/*/*.eps doc/*/*.pdf_t doc/*/*.eps_t
- rm -rf doc/refman/html doc/stdlib/html doc/tutorial/tutorial.v.html
- rm -f doc/refman/euclid.ml doc/refman/euclid.mli
- rm -f doc/refman/heapsort.ml doc/refman/heapsort.mli
+ rm -rf doc/stdlib/html doc/tutorial/tutorial.v.html
rm -f doc/common/version.tex
- rm -f doc/refman/styles.hva doc/refman/cover.html doc/refman/Reference-Manual.html
rm -f doc/coq.tex
rm -rf doc/sphinx/_build
diff --git a/Makefile.ci b/Makefile.ci
index 3c26bf964..37b14ed91 100644
--- a/Makefile.ci
+++ b/Makefile.ci
@@ -17,6 +17,7 @@ CI_TARGETS=ci-bignums \
ci-cpdt \
ci-elpi \
ci-equations \
+ ci-fcsl-pcm \
ci-fiat-crypto \
ci-fiat-parsers \
ci-flocq \
@@ -27,7 +28,7 @@ CI_TARGETS=ci-bignums \
ci-ltac2 \
ci-math-classes \
ci-math-comp \
- ci-metacoq \
+ ci-mtac2 \
ci-sf \
ci-tlc \
ci-unimath \
diff --git a/Makefile.common b/Makefile.common
index 9a30e2a4c..eed41fbe7 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -75,7 +75,7 @@ INSTALLSH:=./install.sh
MKDIR:=install -d
CORESRCDIRS:=\
- config clib lib kernel intf kernel/byterun library \
+ config clib lib kernel kernel/byterun library \
engine pretyping interp proofs parsing printing \
tactics vernac stm toplevel
@@ -102,7 +102,7 @@ BYTERUN:=$(addprefix kernel/byterun/, \
# respecting this order is useful for developers that want to load or link
# the libraries directly
-CORECMA:=clib/clib.cma lib/lib.cma kernel/kernel.cma intf/intf.cma library/library.cma \
+CORECMA:=clib/clib.cma lib/lib.cma kernel/kernel.cma library/library.cma \
engine/engine.cma pretyping/pretyping.cma interp/interp.cma proofs/proofs.cma \
parsing/parsing.cma printing/printing.cma tactics/tactics.cma vernac/vernac.cma \
stm/stm.cma toplevel/toplevel.cma
diff --git a/Makefile.doc b/Makefile.doc
index dc2b9f55d..9b6013d8d 100644
--- a/Makefile.doc
+++ b/Makefile.doc
@@ -32,10 +32,7 @@ BIBTEX:=BIBINPUTS=.: bibtex -min-crossrefs=10
MAKEINDEX:=makeindex
PDFLATEX:=pdflatex
DVIPS:=dvips
-FIG2DEV:=fig2dev
-CONVERT:=convert
HEVEA:=hevea
-HACHA:=hacha
HEVEAOPTS:=-fix -exec xxdate.exe
HEVEALIB:=/usr/local/lib/hevea:/usr/lib/hevea
HTMLSTYLE:=coqremote
@@ -56,29 +53,14 @@ ALLSPHINXOPTS= -d $(SPHINXBUILDDIR)/doctrees $(SPHINXOPTS)
DOCCOMMON:=doc/common/version.tex doc/common/title.tex doc/common/macros.tex
-REFMANCOQTEXFILES:=$(addprefix doc/refman/, )
-
-REFMANTEXFILES:=$(addprefix doc/refman/, \
- headers.sty Reference-Manual.tex) \
- $(REFMANCOQTEXFILES) \
-
-REFMANEPSFILES:=doc/refman/coqide.eps doc/refman/coqide-queries.eps
-
-REFMANFILES:=$(REFMANTEXFILES) $(DOCCOMMON) $(REFMANEPSFILES) doc/refman/biblio.bib
-
-REFMANPNGFILES:=$(REFMANEPSFILES:.eps=.png)
-
-
######################################################################
### General rules
######################################################################
-.PHONY: doc sphinxdoc-html doc-pdf doc-ps refman refman-quick tutorial
-.PHONY: stdlib full-stdlib rectutorial refman-html-dir
-
-INDEXURLS:=doc/refman/html/index_urls.txt
+.PHONY: doc sphinxdoc-html doc-pdf doc-ps tutorial
+.PHONY: stdlib full-stdlib rectutorial
-doc: sphinx refman tutorial rectutorial stdlib $(INDEXURLS)
+doc: sphinx tutorial rectutorial stdlib
sphinx: coq
$(SHOW)'SPHINXBUILD doc/sphinx'
@@ -87,20 +69,17 @@ sphinx: coq
@echo "Build finished. The HTML pages are in $(SPHINXBUILDDIR)/html."
doc-html:\
- doc/tutorial/Tutorial.v.html doc/refman/html/index.html \
+ doc/tutorial/Tutorial.v.html \
doc/stdlib/html/index.html doc/RecTutorial/RecTutorial.html
doc-pdf:\
- doc/tutorial/Tutorial.v.pdf doc/refman/Reference-Manual.pdf \
+ doc/tutorial/Tutorial.v.pdf \
doc/stdlib/Library.pdf doc/RecTutorial/RecTutorial.pdf
doc-ps:\
- doc/tutorial/Tutorial.v.ps doc/refman/Reference-Manual.ps \
+ doc/tutorial/Tutorial.v.ps \
doc/stdlib/Library.ps doc/RecTutorial/RecTutorial.ps
-refman: \
- doc/refman/html/index.html doc/refman/Reference-Manual.ps doc/refman/Reference-Manual.pdf
-
tutorial: \
doc/tutorial/Tutorial.v.html doc/tutorial/Tutorial.v.ps doc/tutorial/Tutorial.v.pdf
@@ -128,20 +107,6 @@ endif
%.ps: %.dvi
(cd `dirname $<`; $(DVIPS) -q -o `basename $@` `basename $<`)
-%.png: %.fig
- $(FIG2DEV) -L png -m 2 $< $@
-
-%.pdf: %.fig
- $(FIG2DEV) -L pdftex $< $@
- $(FIG2DEV) -L pdftex_t -p `basename $@` $< $@_t
-
-%.eps: %.fig
- $(FIG2DEV) -L pstex $< $@
- $(FIG2DEV) -L pstex_t -p `basename $@` $< $@_t
-
-%.eps: %.png
- $(CONVERT) $< $@
-
######################################################################
# Macros for filtering outputs
######################################################################
@@ -159,82 +124,6 @@ doc/common/version.tex: config/Makefile
printf '\\newcommand{\\coqversion}{$(VERSION)}' > doc/common/version.tex
######################################################################
-# Reference Manual
-######################################################################
-
-
-### Reference Manual (printable format)
-
-# The second LATEX compilation is necessary otherwise the pages of the index
-# are not correct (don't know why...) - BB
-doc/refman/Reference-Manual.dvi: $(REFMANFILES) doc/refman/Reference-Manual.tex
- @(cd doc/refman;\
- $(LATEX) -interaction=batchmode Reference-Manual;\
- $(BIBTEX) -terse Reference-Manual $(HIDEBIBTEXINFO);\
- $(LATEX) -interaction=batchmode Reference-Manual > /dev/null;\
- $(MAKEINDEX) -q Reference-Manual;\
- $(SHOWMAKEINDEXERROR) Reference-Manual.ilg;\
- $(MAKEINDEX) -q Reference-Manual.tacidx -o Reference-Manual.tacind;\
- $(SHOWMAKEINDEXERROR) Reference-Manual.ilg;\
- $(MAKEINDEX) -q Reference-Manual.comidx -o Reference-Manual.comind;\
- $(SHOWMAKEINDEXERROR) Reference-Manual.ilg;\
- $(MAKEINDEX) -q Reference-Manual.optidx -o Reference-Manual.optind;\
- $(SHOWMAKEINDEXERROR) Reference-Manual.ilg;\
- $(MAKEINDEX) -q Reference-Manual.erridx -o Reference-Manual.errind;\
- $(SHOWMAKEINDEXERROR) Reference-Manual.ilg;\
- $(LATEX) -interaction=batchmode Reference-Manual > /dev/null;\
- $(LATEX) -interaction=batchmode Reference-Manual > /dev/null;\
- ../tools/show_latex_messages -no-overfull Reference-Manual.log)
-
-doc/refman/Reference-Manual.pdf: doc/refman/Reference-Manual.dvi $(REFMANPNGFILES)
- (cd doc/refman;\
- $(PDFLATEX) -interaction=batchmode Reference-Manual.tex;\
- ../tools/show_latex_messages -no-overfull Reference-Manual.log)
-
-### Reference Manual (browsable format)
-
-doc/refman/Reference-Manual.html: doc/refman/styles.hva doc/refman/headers.hva doc/refman/Reference-Manual.dvi # to ensure bbl file
- (cd doc/refman; BIBINPUTS=.: $(HEVEA) $(HEVEAOPTS) ./styles.hva ./Reference-Manual.tex)
-
-doc/refman/cover.html: doc/common/styles/html/$(HTMLSTYLE)/cover.html
- sed -e "s/COQVERSION/$(VERSION)/g" $< > $@
-
-doc/refman/styles.hva: doc/common/styles/html/$(HTMLSTYLE)/styles.hva
- $(INSTALLLIB) $< doc/refman
-
-INDEXES:= doc/refman/html/command-index.html doc/refman/html/tactic-index.html
-
-refman-html-dir $(INDEXES): doc/refman/html/index.html ;
-
-doc/refman/html/index.html: doc/refman/Reference-Manual.html $(REFMANPNGFILES) \
- doc/refman/cover.html doc/refman/styles.hva doc/refman/index.html
- - rm -rf doc/refman/html
- $(MKDIR) doc/refman/html
- $(INSTALLLIB) $(REFMANPNGFILES) doc/refman/html
- (cd doc/refman/html; $(HACHA) -nolinks -tocbis -o toc.html ../styles.hva ../Reference-Manual.html)
- $(INSTALLLIB) doc/refman/cover.html doc/refman/html/index.html
- @touch $(INDEXES)
- (cd doc/common/styles/html/$(HTMLSTYLE);\
- for f in `find . -name \*.css`; do \
- $(MKDIR) $$(dirname ../../../../refman/html/$$f);\
- $(INSTALLLIB) $$f ../../../../refman/html/$$f;\
- done)
-
-refman-quick:
- (cd doc/refman;\
- $(PDFLATEX) -interaction=batchmode Reference-Manual.tex;\
- ../tools/show_latex_messages -no-overfull Reference-Manual.log && \
- $(HEVEA) $(HEVEAOPTS) ./Reference-Manual.tex)
-
-######################################################################
-# Index file for CoqIDE
-######################################################################
-
-$(INDEXURLS): $(INDEXES)
- cat $< | grep li-indexenv | grep href= | sed -e 's@.*>\([^<]*\)</span>.*, <a href="\([^"]*\)">.*@\1,\2@' > $@
-
-
-######################################################################
# Tutorial
######################################################################
@@ -359,30 +248,20 @@ install-doc-meta:
$(INSTALLLIB) doc/LICENSE $(FULLDOCDIR)/LICENSE.doc
install-doc-html:
- $(MKDIR) $(addprefix $(FULLDOCDIR)/html/, refman stdlib)
- (for f in `cd doc/refman/html; find . -type f`; do \
- $(MKDIR) $$(dirname $(FULLDOCDIR)/html/refman/$$f);\
- $(INSTALLLIB) doc/refman/html/$$f $(FULLDOCDIR)/html/refman/$$f;\
- done)
+ $(MKDIR) $(FULLDOCDIR)/html/stdlib
$(INSTALLLIB) doc/stdlib/html/* $(FULLDOCDIR)/html/stdlib
$(INSTALLLIB) doc/RecTutorial/RecTutorial.html $(FULLDOCDIR)/html/RecTutorial.html
$(INSTALLLIB) doc/tutorial/Tutorial.v.html $(FULLDOCDIR)/html/Tutorial.html
install-doc-printable:
$(MKDIR) $(FULLDOCDIR)/ps $(FULLDOCDIR)/pdf
- $(INSTALLLIB) doc/refman/Reference-Manual.pdf \
- doc/stdlib/Library.pdf $(FULLDOCDIR)/pdf
- $(INSTALLLIB) doc/refman/Reference-Manual.ps \
- doc/stdlib/Library.ps $(FULLDOCDIR)/ps
+ $(INSTALLLIB) doc/stdlib/Library.pdf $(FULLDOCDIR)/pdf
+ $(INSTALLLIB) doc/stdlib/Library.ps $(FULLDOCDIR)/ps
$(INSTALLLIB) doc/tutorial/Tutorial.v.pdf $(FULLDOCDIR)/pdf/Tutorial.pdf
$(INSTALLLIB) doc/RecTutorial/RecTutorial.pdf $(FULLDOCDIR)/pdf/RecTutorial.pdf
$(INSTALLLIB) doc/tutorial/Tutorial.v.ps $(FULLDOCDIR)/ps/Tutorial.ps
$(INSTALLLIB) doc/RecTutorial/RecTutorial.ps $(FULLDOCDIR)/ps/RecTutorial.ps
-install-doc-index-urls:
- $(MKDIR) $(FULLDATADIR)
- $(INSTALLLIB) $(INDEXURLS) $(FULLDATADIR)
-
install-doc-sphinx:
$(MKDIR) $(FULLDOCDIR)/sphinx
(for f in `cd doc/sphinx/_build; find . -type f`; do \
@@ -467,13 +346,6 @@ $(OCAMLDOCDIR)/%.pdf: $(OCAMLDOCDIR)/%.tex
$(HIDE)(cd $(OCAMLDOCDIR) ; pdflatex -interaction=batchmode $*.tex && pdflatex -interaction=batchmode $*.tex)
$(HIDE)(cd doc/tools/; ./show_latex_messages -no-overfull ../../$(OCAMLDOCDIR)/$*.log)
-###########################################################################
-# local web server
-###########################################################################
-
-serve-refman-8080: refman
- cd doc/refman/html; python3 -m http.server 8080
-
# For emacs:
# Local Variables:
# mode: makefile
diff --git a/configure.ml b/configure.ml
index 6c052b63b..e77310eb7 100644
--- a/configure.ml
+++ b/configure.ml
@@ -21,11 +21,18 @@ let distributed_exec = ["coqtop";"coqc";"coqchk";"coqdoc";"coqworkmgr";
let verbose = ref false (* for debugging this script *)
+let red, yellow, reset =
+ if Unix.isatty Unix.stdout && Unix.isatty Unix.stderr && Sys.os_type = "Unix"
+ then "\027[31m", "\027[33m", "\027[0m"
+ else "", "", ""
+
(** * Utility functions *)
let cfprintf oc = kfprintf (fun oc -> fprintf oc "\n%!") oc
let cprintf s = cfprintf stdout s
let ceprintf s = cfprintf stderr s
-let die msg = ceprintf "%s\nConfiguration script failed!" msg; exit 1
+let die msg = ceprintf "%s%s%s\nConfiguration script failed!" red msg reset; exit 1
+
+let warn s = cprintf ("%sWarning: " ^^ s ^^ "%s") yellow reset
let s2i = int_of_string
let i2s = string_of_int
@@ -109,7 +116,7 @@ let run ?(fatal=true) ?(err=StdErr) prog args =
let cmd = String.concat " " (prog::args) in
let exn = match e with Failure s -> s | _ -> Printexc.to_string e in
let msg = sprintf "Error while running '%s' (%s)" cmd exn in
- if fatal then die msg else (cprintf "W: %s" msg; "", [])
+ if fatal then die msg else (warn "%s" msg; "", [])
let tryrun prog args = run ~fatal:false ~err:DevNull prog args
@@ -205,7 +212,7 @@ let win_aware_quote_executable str =
sprintf "%S" str
else
let _ = if contains_suspicious_characters str then
- cprintf "*Warning* The string %S contains suspicious characters; ocamlfind might fail" str in
+ warn "The string %S contains suspicious characters; ocamlfind might fail" str in
Str.global_replace (Str.regexp "\\\\") "/" str
(** * Date *)
@@ -414,8 +421,8 @@ let args_options = Arg.align [
" Do not add debugging information in the Coq executables";
"-profiling", arg_set (fun p profile -> { p with profile }),
" Add profiling information in the Coq executables";
- "-annotate", Arg.Unit (fun () -> cprintf "*Warning* -annotate is deprecated. Please use -annot or -bin-annot instead."),
- " Deprecated. Please use -annot or -bin-annot instead";
+ "-annotate", Arg.Unit (fun () -> die "-annotate has been removed. Please use -annot or -bin-annot instead."),
+ " Removed option. Please use -annot or -bin-annot instead";
"-annot", arg_set (fun p annot -> { p with annot }),
" Dumps ml text annotation files while compiling Coq (e.g. for Tuareg)";
"-bin-annot", arg_set (fun p bin_annot -> { p with bin_annot }),
@@ -598,7 +605,7 @@ let check_caml_version () =
else
let () = cprintf "Your version of OCaml is %s." caml_version in
if !prefs.force_caml_version then
- cprintf "*Warning* Your version of OCaml is outdated."
+ warn "Your version of OCaml is outdated."
else
die "You need OCaml 4.02.1 or later."
@@ -620,7 +627,7 @@ let check_findlib_version () =
else
let () = cprintf "Your version of OCamlfind is %s." findlib_version in
if !prefs.force_findlib_version then
- cprintf "*Warning* Your version of OCamlfind is outdated."
+ warn "Your version of OCamlfind is outdated."
else
die "You need OCamlfind 1.4.1 or later."
@@ -731,17 +738,17 @@ let camlp5libdir = shorten_camllib fullcamlp5libdir
(** * Native compiler *)
-let msg_byteonly () =
- cprintf "Only the bytecode version of Coq will be available."
+let msg_byteonly =
+ "Only the bytecode version of Coq will be available."
let msg_no_ocamlopt () =
- cprintf "Cannot find the OCaml native-code compiler."; msg_byteonly ()
+ warn "Cannot find the OCaml native-code compiler.\n%s" msg_byteonly
let msg_no_camlp5_cmxa () =
- cprintf "Cannot find the native-code library of camlp5."; msg_byteonly ()
+ warn "Cannot find the native-code library of camlp5.\n%s" msg_byteonly
let msg_no_dynlink_cmxa () =
- cprintf "Cannot find native-code dynlink library."; msg_byteonly ();
+ warn "Cannot find native-code dynlink library.\n%s" msg_byteonly;
cprintf "For building a native-code Coq, you may try to first";
cprintf "compile and install a dummy dynlink.cmxa (see dev/dynlink.ml)";
cprintf "and then run ./configure -natdynlink no"
@@ -757,8 +764,7 @@ let check_native () =
else
let () =
if version <> caml_version then
- cprintf
- "Warning: Native and bytecode compilers do not have the same version!"
+ warn "Native and bytecode compilers do not have the same version!"
in cprintf "You have native-code compilation. Good!"
let best_compiler =
@@ -813,7 +819,7 @@ let get_source = function
(** Is some location a suitable LablGtk2 installation ? *)
let check_lablgtkdir ?(fatal=false) src dir =
- let yell msg = if fatal then die msg else (cprintf "%s" msg; false) in
+ let yell msg = if fatal then die msg else (warn "%s" msg; false) in
let msg = get_source src in
if not (dir_exists dir) then
yell (sprintf "No such directory '%s' (%s)." dir msg)
@@ -849,7 +855,7 @@ let get_lablgtkdir () =
let check_lablgtk_version src dir = match src with
| Manual | Stdlib ->
- cprintf "Warning: could not check the version of lablgtk2.\nMake sure your version is at least 2.18.3.";
+ warn "Could not check the version of lablgtk2.\nMake sure your version is at least 2.18.3.";
(true, "an unknown version")
| OCamlFind ->
let v, _ = tryrun camlexec.find ["query"; "-format"; "%v"; "lablgtk2"] in
@@ -860,7 +866,11 @@ let check_lablgtk_version src dir = match src with
else if vi < [2; 18; 3] then
begin
(* Version 2.18.3 is known to report incorrectly as 2.18.0, and Launchpad packages report as version 2.16.0 due to a misconfigured META file; see https://bugs.launchpad.net/ubuntu/+source/lablgtk2/+bug/1577236 *)
- cprintf "Warning: Your installed lablgtk reports as %s.\n It is possible that the installed version is actually more recent\n but reports an incorrect version. If the installed version is\n actually more recent than 2.18.3, that's fine; if it is not,\n CoqIDE will compile but may be very unstable." v;
+ warn "Your installed lablgtk reports as %s.\n\
+It is possible that the installed version is actually more recent\n\
+but reports an incorrect version. If the installed version is\n\
+actually more recent than 2.18.3, that's fine; if it is not,\n
+CoqIDE will compile but may be very unstable." v;
(true, "an unknown version")
end
else
@@ -1212,7 +1222,7 @@ let write_configml f =
let core_src_dirs = [ "config"; "dev"; "lib"; "clib"; "kernel"; "library";
"engine"; "pretyping"; "interp"; "parsing"; "proofs";
- "tactics"; "toplevel"; "printing"; "intf";
+ "tactics"; "toplevel"; "printing";
"grammar"; "ide"; "stm"; "vernac" ] in
let core_src_dirs = List.fold_left (fun acc core_src_subdir -> acc ^ " \"" ^ core_src_subdir ^ "\";\n")
""
diff --git a/default.nix b/default.nix
index 26c6e4b90..0b4794274 100644
--- a/default.nix
+++ b/default.nix
@@ -32,6 +32,7 @@
}:
with pkgs;
+with stdenv.lib;
stdenv.mkDerivation rec {
@@ -61,8 +62,7 @@ stdenv.mkDerivation rec {
] else []) ++ (if doCheck then
# Test-suite dependencies
- let inherit (stdenv.lib) versionAtLeast optional; in
- /* ncurses is required to build an OCaml REPL */
+ # ncurses is required to build an OCaml REPL
optional (!versionAtLeast ocaml.version "4.07") ncurses
++ [
python
@@ -90,6 +90,10 @@ stdenv.mkDerivation rec {
prefixKey = "-prefix ";
+ buildFlags = optionals buildDoc [ "world" "sphinx" ];
+
+ installTargets = [ "install" ] ++ optional buildDoc "install-doc-sphinx";
+
inherit doCheck;
}
diff --git a/dev/base_include b/dev/base_include
index e76044f41..2f7183dd6 100644
--- a/dev/base_include
+++ b/dev/base_include
@@ -15,7 +15,6 @@
#directory "tactics";;
#directory "printing";;
#directory "grammar";;
-#directory "intf";;
#directory "stm";;
#directory "vernac";;
diff --git a/dev/ci/ci-basic-overlay.sh b/dev/ci/ci-basic-overlay.sh
index 48e01e9e9..5cee72cc7 100644..100755
--- a/dev/ci/ci-basic-overlay.sh
+++ b/dev/ci/ci-basic-overlay.sh
@@ -19,13 +19,13 @@
: "${UniMath_CI_GITURL:=https://github.com/UniMath/UniMath.git}"
########################################################################
-# Unicoq + Metacoq
+# Unicoq + Mtac2
########################################################################
: "${unicoq_CI_BRANCH:=master}"
: "${unicoq_CI_GITURL:=https://github.com/unicoq/unicoq.git}"
-: "${metacoq_CI_BRANCH:=master}"
-: "${metacoq_CI_GITURL:=https://github.com/MetaCoq/MetaCoq.git}"
+: "${mtac2_CI_BRANCH:=master-sync}"
+: "${mtac2_CI_GITURL:=https://github.com/Mtac2/Mtac2.git}"
########################################################################
# Mathclasses + Corn
@@ -142,7 +142,7 @@
########################################################################
# Equations
########################################################################
-: "${Equations_CI_BRANCH:=8.8+alpha}"
+: "${Equations_CI_BRANCH:=master}"
: "${Equations_CI_GITURL:=https://github.com/mattam82/Coq-Equations.git}"
########################################################################
@@ -150,3 +150,9 @@
########################################################################
: "${Elpi_CI_BRANCH:=coq-master}"
: "${Elpi_CI_GITURL:=https://github.com/LPCIC/coq-elpi.git}"
+
+########################################################################
+# fcsl-pcm
+########################################################################
+: "${fcsl_pcm_CI_BRANCH:=master}"
+: "${fcsl_pcm_CI_GITURL:=https://github.com/imdea-software/fcsl-pcm.git}"
diff --git a/dev/ci/ci-fcsl-pcm.sh b/dev/ci/ci-fcsl-pcm.sh
new file mode 100755
index 000000000..fdc4c729b
--- /dev/null
+++ b/dev/ci/ci-fcsl-pcm.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+ci_dir="$(dirname "$0")"
+. "${ci_dir}/ci-common.sh"
+
+fcsl_pcm_CI_DIR="${CI_BUILD_DIR}/fcsl-pcm"
+
+install_ssreflect
+
+git_checkout "${fcsl_pcm_CI_BRANCH}" "${fcsl_pcm_CI_GITURL}" "${fcsl_pcm_CI_DIR}"
+
+( cd "${fcsl_pcm_CI_DIR}" && make )
diff --git a/dev/ci/ci-fiat-crypto.sh b/dev/ci/ci-fiat-crypto.sh
index 6c8dce5bd..845addb4c 100755
--- a/dev/ci/ci-fiat-crypto.sh
+++ b/dev/ci/ci-fiat-crypto.sh
@@ -8,4 +8,4 @@ fiat_crypto_CI_DIR="${CI_BUILD_DIR}/fiat-crypto"
git_checkout "${fiat_crypto_CI_BRANCH}" "${fiat_crypto_CI_GITURL}" "${fiat_crypto_CI_DIR}"
( cd "${fiat_crypto_CI_DIR}" && git submodule update --init --recursive )
-( cd "${fiat_crypto_CI_DIR}" && make lite )
+( cd "${fiat_crypto_CI_DIR}" && make lite lite-display )
diff --git a/dev/ci/ci-iris-lambda-rust.sh b/dev/ci/ci-iris-lambda-rust.sh
index b019fa059..1af0f634c 100755
--- a/dev/ci/ci-iris-lambda-rust.sh
+++ b/dev/ci/ci-iris-lambda-rust.sh
@@ -9,27 +9,20 @@ lambdaRust_CI_DIR="${CI_BUILD_DIR}/lambdaRust"
install_ssreflect
-# Add or update the opam repo we need for dependency resolution
-opam repo add iris-dev https://gitlab.mpi-sws.org/FP/opam-dev.git -p 0 || opam update iris-dev
-
# Setup lambdaRust first
git_checkout "${lambdaRust_CI_BRANCH}" "${lambdaRust_CI_GITURL}" "${lambdaRust_CI_DIR}"
# Extract required version of Iris
-Iris_VERSION=$(grep -F coq-iris < "${lambdaRust_CI_DIR}/opam" | grep -E 'dev\.([0-9.-]+)' -o)
-Iris_URL=$(opam show "coq-iris.$Iris_VERSION" -f upstream-url)
-read -r -a Iris_URL_PARTS <<< "$(echo "$Iris_URL" | tr '#' ' ')"
+Iris_SHA=$(grep -F coq-iris < "${lambdaRust_CI_DIR}/opam" | sed 's/.*"dev\.[0-9.-]\+\.\([0-9a-z]\+\)".*/\1/')
# Setup Iris
-git_checkout "${Iris_CI_BRANCH}" "${Iris_URL_PARTS[0]}" "${Iris_CI_DIR}" "${Iris_URL_PARTS[1]}"
+git_checkout "${Iris_CI_BRANCH}" "${Iris_CI_GITURL}" "${Iris_CI_DIR}" "${Iris_SHA}"
# Extract required version of std++
-stdpp_VERSION=$(grep -F coq-stdpp < "${Iris_CI_DIR}/opam" | grep -E 'dev\.([0-9.-]+)' -o)
-stdpp_URL=$(opam show "coq-stdpp.$stdpp_VERSION" -f upstream-url)
-read -r -a stdpp_URL_PARTS <<< "$(echo "$stdpp_URL" | tr '#' ' ')"
+stdpp_SHA=$(grep -F coq-stdpp < "${Iris_CI_DIR}/opam" | sed 's/.*"dev\.[0-9.-]\+\.\([0-9a-z]\+\)".*/\1/')
# Setup std++
-git_checkout "${stdpp_CI_BRANCH}" "${stdpp_URL_PARTS[0]}" "${stdpp_CI_DIR}" "${stdpp_URL_PARTS[1]}"
+git_checkout "${stdpp_CI_BRANCH}" "${stdpp_CI_GITURL}" "${stdpp_CI_DIR}" "${stdpp_SHA}"
# Build std++
( cd "${stdpp_CI_DIR}" && make && make install )
diff --git a/dev/ci/ci-metacoq.sh b/dev/ci/ci-mtac2.sh
index a66dc1e76..1372acb8e 100755
--- a/dev/ci/ci-metacoq.sh
+++ b/dev/ci/ci-mtac2.sh
@@ -4,7 +4,7 @@ ci_dir="$(dirname "$0")"
. "${ci_dir}/ci-common.sh"
unicoq_CI_DIR=${CI_BUILD_DIR}/unicoq
-metacoq_CI_DIR=${CI_BUILD_DIR}/MetaCoq
+mtac2_CI_DIR=${CI_BUILD_DIR}/Mtac2
# Setup UniCoq
@@ -14,6 +14,6 @@ git_checkout "${unicoq_CI_BRANCH}" "${unicoq_CI_GITURL}" "${unicoq_CI_DIR}"
# Setup MetaCoq
-git_checkout "${metacoq_CI_BRANCH}" "${metacoq_CI_GITURL}" "${metacoq_CI_DIR}"
+git_checkout "${mtac2_CI_BRANCH}" "${mtac2_CI_GITURL}" "${mtac2_CI_DIR}"
-( cd "${metacoq_CI_DIR}" && coq_makefile -f _CoqProject -o Makefile && make )
+( cd "${mtac2_CI_DIR}" && coq_makefile -f _CoqProject -o Makefile && make )
diff --git a/dev/ci/user-overlays/07152-ejgallego-api+vernac_expr_iso.sh b/dev/ci/user-overlays/07152-ejgallego-api+vernac_expr_iso.sh
new file mode 100644
index 000000000..7e554684e
--- /dev/null
+++ b/dev/ci/user-overlays/07152-ejgallego-api+vernac_expr_iso.sh
@@ -0,0 +1,12 @@
+if [ "$CI_PULL_REQUEST" = "7152" ] || [ "$CI_BRANCH" = "api+vernac_expr_iso" ]; then
+
+ # Equations_CI_BRANCH=ssr+correct_packing
+ # Equations_CI_GITURL=https://github.com/ejgallego/Coq-Equations
+
+ # ltac2_CI_BRANCH=ssr+correct_packing
+ # ltac2_CI_GITURL=https://github.com/ejgallego/ltac2
+
+ Elpi_CI_BRANCH=api+vernac_expr_iso
+ Elpi_CI_GITURL=https://github.com/ejgallego/coq-elpi.git
+
+fi
diff --git a/dev/core.dbg b/dev/core.dbg
index 57c136900..edf67020a 100644
--- a/dev/core.dbg
+++ b/dev/core.dbg
@@ -16,5 +16,4 @@ load_printer tactics.cma
load_printer vernac.cma
load_printer stm.cma
load_printer toplevel.cma
-load_printer intf.cma
load_printer ltac_plugin.cmo
diff --git a/dev/doc/MERGING.md b/dev/doc/MERGING.md
index 3a2df6a81..84ff94c66 100644
--- a/dev/doc/MERGING.md
+++ b/dev/doc/MERGING.md
@@ -70,7 +70,7 @@ To merge the PR proceed in the following way
```
$ git checkout master
$ git pull
-$ dev/tools/merge-pr XXXX
+$ dev/tools/merge-pr.sh XXXX
$ git push upstream
```
where `XXXX` is the number of the PR to be merged and `upstream` is the name
diff --git a/dev/doc/changes.md b/dev/doc/changes.md
index 1a24f23e5..2bad21bb2 100644
--- a/dev/doc/changes.md
+++ b/dev/doc/changes.md
@@ -5,7 +5,18 @@
Proof engine
More functions have been changed to use `EConstr`, notably the
- functions in `Evd`.
+ functions in `Evd`, and in particular `Evd.define`.
+
+ Note that the core function `EConstr.to_constr` now _enforces_ by
+ default that the resulting term is ground, that is to say, free of
+ Evars. This is usually what you want, as open terms should be of
+ type `EConstr.t` to benefit from the invariants the `EConstr` API is
+ meant to guarantee.
+
+ In case you'd like to violate this API invariant, you can use the
+ `abort_on_undefined_evars` flag to `EConstr.to_constr`, but note
+ that setting this flag to false is deprecated so it is only meant to
+ be used as to help port pre-EConstr code.
## Changes between Coq 8.7 and Coq 8.8
diff --git a/dev/doc/coq-src-description.txt b/dev/doc/coq-src-description.txt
index b3d49b7e5..764d48295 100644
--- a/dev/doc/coq-src-description.txt
+++ b/dev/doc/coq-src-description.txt
@@ -17,12 +17,6 @@ toplevel
Special components
------------------
-intf :
-
- Contains mli-only interfaces, many of them providing a.s.t.
- used for dialog bewteen coq components. Ex: Constrexpr.constr_expr
- produced by parsing and transformed by interp.
-
grammar :
Camlp5 syntax extensions. The file grammar/grammar.cma is used
diff --git a/dev/doc/debugging.md b/dev/doc/debugging.md
index fd3cbd1bc..14a1cc693 100644
--- a/dev/doc/debugging.md
+++ b/dev/doc/debugging.md
@@ -47,7 +47,7 @@ Debugging with ocamldebug from Emacs
7. some hints:
- To debug a failure/error/anomaly, add a breakpoint in
- Vernac.vernac_com at the with clause of the "try ... interp com
+ `Vernac.interp_vernac` (in `toplevel/vernac.ml`) at the with clause of the "try ... interp com
with ..." block, then go "back" a few steps to find where the
failure/error/anomaly has been raised
- Alternatively, for an error or an anomaly, add breakpoints in the middle
diff --git a/dev/ocamldebug-coq.run b/dev/ocamldebug-coq.run
index f3e60edea..8f1c165dd 100644
--- a/dev/ocamldebug-coq.run
+++ b/dev/ocamldebug-coq.run
@@ -18,7 +18,7 @@ exec $OCAMLDEBUG \
-I $CAMLP5LIB -I +threads \
-I $COQTOP \
-I $COQTOP/config -I $COQTOP/printing -I $COQTOP/grammar -I $COQTOP/clib \
- -I $COQTOP/lib -I $COQTOP/intf -I $COQTOP/kernel -I $COQTOP/kernel/byterun \
+ -I $COQTOP/lib -I $COQTOP/kernel -I $COQTOP/kernel/byterun \
-I $COQTOP/library -I $COQTOP/engine \
-I $COQTOP/pretyping -I $COQTOP/parsing -I $COQTOP/vernac \
-I $COQTOP/interp -I $COQTOP/proofs -I $COQTOP/tactics -I $COQTOP/stm \
diff --git a/dev/tools/merge-pr.sh b/dev/tools/merge-pr.sh
index 1c94f630f..00d04e6b3 100755
--- a/dev/tools/merge-pr.sh
+++ b/dev/tools/merge-pr.sh
@@ -5,7 +5,7 @@ set -o pipefail
API=https://api.github.com/repos/coq/coq
OFFICIAL_REMOTE_GIT_URL="git@github.com:coq/coq"
-OFFICIAL_REMOTE_HTTPS_URL="https://github.com/coq/coq"
+OFFICIAL_REMOTE_HTTPS_URL="github.com/coq/coq"
# This script depends (at least) on git (>= 2.7) and jq.
# It should be used like this: dev/tools/merge-pr.sh /PR number/
@@ -91,8 +91,10 @@ fi
REMOTE_URL=$(git remote get-url "$REMOTE" --all)
if [ "$REMOTE_URL" != "${OFFICIAL_REMOTE_GIT_URL}" ] && \
[ "$REMOTE_URL" != "${OFFICIAL_REMOTE_GIT_URL}.git" ] && \
- [ "$REMOTE_URL" != "${OFFICIAL_REMOTE_HTTPS_URL}" ] && \
- [ "$REMOTE_URL" != "${OFFICIAL_REMOTE_HTTPS_URL}.git" ]; then
+ [ "$REMOTE_URL" != "https://${OFFICIAL_REMOTE_HTTPS_URL}" ] && \
+ [ "$REMOTE_URL" != "https://${OFFICIAL_REMOTE_HTTPS_URL}.git" ] && \
+ [[ "$REMOTE_URL" != "https://"*"@${OFFICIAL_REMOTE_HTTPS_URL}" ]] && \
+ [[ "$REMOTE_URL" != "https://"*"@${OFFICIAL_REMOTE_HTTPS_URL}.git" ]] ; then
error "remote ${BLUE}$REMOTE${RESET} does not point to the official Coq repo"
error "that is ${BLUE}$OFFICIAL_REMOTE_GIT_URL"
error "it points to ${BLUE}$REMOTE_URL${RESET} instead"
diff --git a/dev/tools/pre-commit b/dev/tools/pre-commit
index a514b8866..b56925c37 100755
--- a/dev/tools/pre-commit
+++ b/dev/tools/pre-commit
@@ -27,8 +27,8 @@ then
# reset work tree and index
# NB: untracked files which were not added are untouched
- git apply --cached -R "$index"
- git apply -R "$tree"
+ git apply --whitespace=nowarn --cached -R "$index"
+ git apply --whitespace=nowarn -R "$tree"
# Fix index
# For end of file newlines we must go through the worktree
@@ -45,7 +45,7 @@ then
# making git fail. Don't fail now: we fix the worktree first.
if [ -s "$fixed_index" ]
then
- git apply -R "$fixed_index"
+ git apply --whitespace=nowarn -R "$fixed_index"
fi
# Fix worktree
diff --git a/dev/top_printers.ml b/dev/top_printers.ml
index f9b402586..8d5b5bef4 100644
--- a/dev/top_printers.ml
+++ b/dev/top_printers.ml
@@ -162,8 +162,8 @@ let pp_state_t n = pp (Reductionops.pr_state n)
(* proof printers *)
let pr_evar ev = Pp.int (Evar.repr ev)
let ppmetas metas = pp(Termops.pr_metaset metas)
-let ppevm evd = pp(Termops.pr_evar_map ~with_univs:!Flags.univ_print (Some 2) evd)
-let ppevmall evd = pp(Termops.pr_evar_map ~with_univs:!Flags.univ_print None evd)
+let ppevm evd = pp(Termops.pr_evar_map ~with_univs:!Detyping.print_universes (Some 2) evd)
+let ppevmall evd = pp(Termops.pr_evar_map ~with_univs:!Detyping.print_universes None evd)
let pr_existentialset evars =
prlist_with_sep spc pr_evar (Evar.Set.elements evars)
let ppexistentialset evars =
diff --git a/doc/refman/AddRefMan-pre.tex b/doc/refman/AddRefMan-pre.tex
deleted file mode 100644
index 856a823de..000000000
--- a/doc/refman/AddRefMan-pre.tex
+++ /dev/null
@@ -1,63 +0,0 @@
-%\coverpage{Addendum to the Reference Manual}{\ }
-%\addcontentsline{toc}{part}{Additional documentation}
-%BEGIN LATEX
-\setheaders{Presentation of the Addendum}
-%END LATEX
-\chapter*{Presentation of the Addendum}
-%HEVEA\cutname{addendum.html}
-
-Here you will find several pieces of additional documentation for the
-\Coq\ Reference Manual. Each of this chapters is concentrated on a
-particular topic, that should interest only a fraction of the \Coq\
-users: that's the reason why they are apart from the Reference
-Manual.
-
-\begin{description}
-
-\item[Extended pattern-matching] This chapter details the use of
- generalized pattern-matching. It is contributed by Cristina Cornes
- and Hugo Herbelin.
-
-\item[Implicit coercions] This chapter details the use of the coercion
- mechanism. It is contributed by Amokrane Saïbi.
-
-%\item[Proof of imperative programs] This chapter explains how to
-% prove properties of annotated programs with imperative features.
-% It is contributed by Jean-Christophe Filliâtre
-
-\item[Program extraction] This chapter explains how to extract in practice ML
- files from $\FW$ terms. It is contributed by Jean-Christophe
- Filliâtre and Pierre Letouzey.
-
-\item[Program] This chapter explains the use of the \texttt{Program}
- vernacular which allows the development of certified
- programs in \Coq. It is contributed by Matthieu Sozeau and replaces
- the previous \texttt{Program} tactic by Catherine Parent.
-
-%\item[Natural] This chapter is due to Yann Coscoy. It is the user
-% manual of the tools he wrote for printing proofs in natural
-% language. At this time, French and English languages are supported.
-
-\item[omega] \texttt{omega}, written by Pierre Crégut, solves a whole
- class of arithmetic problems.
-
-\item[The {\tt ring} tactic] This is a tactic to do AC rewriting. This
- chapter explains how to use it and how it works.
- The chapter is contributed by Patrick Loiseleur.
-
-\item[The {\tt Setoid\_replace} tactic] This is a
- tactic to do rewriting on types equipped with specific (only partially
- substitutive) equality. The chapter is contributed by Clément Renard.
-
-\item[Calling external provers] This chapter describes several tactics
- which call external provers.
-
-\end{description}
-
-\atableofcontents
-
-
-%%% Local Variables:
-%%% mode: latex
-%%% TeX-master: "Reference-Manual"
-%%% End:
diff --git a/doc/refman/Reference-Manual.tex b/doc/refman/Reference-Manual.tex
deleted file mode 100644
index ba4018d77..000000000
--- a/doc/refman/Reference-Manual.tex
+++ /dev/null
@@ -1,134 +0,0 @@
-%\RequirePackage{ifpdf}
-%\ifpdf
-% \documentclass[11pt,a4paper,pdftex]{book}
-%\else
- \documentclass[11pt,a4paper]{book}
-%\fi
-
-\usepackage[utf8]{inputenc}
-\usepackage[T1]{fontenc}
-\usepackage{textcomp}
-\usepackage{times}
-\usepackage{url}
-\usepackage{verbatim}
-\usepackage{amsmath}
-\usepackage{amssymb}
-\usepackage{alltt}
-\usepackage{hevea}
-\usepackage{ifpdf}
-\usepackage[headings]{fullpage}
-\usepackage{headers} % in this directory
-\usepackage{multicol}
-\usepackage{xspace}
-\usepackage{pmboxdraw}
-\usepackage{float}
-\usepackage{color}
- \definecolor{dkblue}{rgb}{0,0.1,0.5}
- \definecolor{lightblue}{rgb}{0,0.5,0.5}
- \definecolor{dkgreen}{rgb}{0,0.4,0}
- \definecolor{dk2green}{rgb}{0.4,0,0}
- \definecolor{dkviolet}{rgb}{0.6,0,0.8}
- \definecolor{dkpink}{rgb}{0.2,0,0.6}
-\usepackage{listings}
- \def\lstlanguagefiles{coq-listing.tex}
-\usepackage{tabularx}
-\usepackage{array,longtable}
-
-\floatstyle{boxed}
-\restylefloat{figure}
-
-% for coqide
-\ifpdf % si on est pas en pdflatex
- \usepackage[pdftex]{graphicx}
-\else
- \usepackage[dvips]{graphicx}
-\fi
-
-
-%\includeonly{Setoid}
-
-\input{../common/version.tex}
-\input{../common/macros.tex}% extension .tex pour htmlgen
-\input{../common/title.tex}% extension .tex pour htmlgen
-%\input{headers}
-
-\usepackage[linktocpage,colorlinks,bookmarks=true,bookmarksnumbered=true]{hyperref}
-% The manual advises to load hyperref package last to be able to redefine
-% necessary commands.
-% The above should work for both latex and pdflatex. Even if PDF is produced
-% through DVI and PS using dvips and ps2pdf, hyperlinks should still work.
-% linktocpage option makes page numbers, not section names, to be links in
-% the table of contents.
-% colorlinks option colors the links instead of using boxes.
-
-% The command \tocnumber was added to HEVEA in version 1.06-6.
-% It instructs HEVEA to put chapter numbers into the table of
-% content entries. The table of content is produced by HACHA using
-% the options -tocbis -o toc.html. HEVEA produces a warning when
-% a command is not recognized, so versions earlier than 1.06-6 can
-% still be used.
-%HEVEA\tocnumber
-
-\begin{document}
-%BEGIN LATEX
-\sloppy\hbadness=5000
-%END LATEX
-
-%BEGIN LATEX
-\coverpage{Reference Manual}
-{The Coq Development Team}
-{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
-\url{http://www.opencontent.org/openpub}).
-Options A and B of the licence are {\em not} elected.}
-%END LATEX
-
-%\defaultheaders
-
-%BEGIN LATEX
-\tableofcontents
-%END LATEX
-
-\part{The language}
-%BEGIN LATEX
-\defaultheaders
-%END LATEX
-
-
-\part{The proof engine}
-\include{RefMan-ltac.v}% Writing tactics
-
-\lstset{language=SSR}
-\lstset{moredelim=[is][]{|*}{*|}}
-\lstset{moredelim=*[is][\itshape\rmfamily]{/*}{*/}}
-
-%BEGIN LATEX
-\RefManCutCommand{BEGINADDENDUM=\thepage}
-%END LATEX
-\part{Addendum to the Reference Manual}
-\include{AddRefMan-pre}%
-%BEGIN LATEX
-\RefManCutCommand{ENDADDENDUM=\thepage}
-%END LATEX
-\nocite{*}
-\bibliographystyle{plain}
-\bibliography{biblio}
-\cutname{biblio.html}
-
-\printrefmanindex{default}{Global Index}{general-index.html}
-\printrefmanindex{tactic}{Tactics Index}{tactic-index.html}
-\printrefmanindex{command}{Vernacular Commands Index}{command-index.html}
-\printrefmanindex{option}{Vernacular Options Index}{option-index.html}
-\printrefmanindex{error}{Index of Error Messages}{error-index.html}
-
-%BEGIN LATEX
-\cleardoublepage
-\phantomsection
-\addcontentsline{toc}{chapter}{\listfigurename}
-\listoffigures
-%END LATEX
-
-\end{document}
-
-
diff --git a/doc/refman/biblio.bib b/doc/refman/biblio.bib
deleted file mode 100644
index e69725838..000000000
--- a/doc/refman/biblio.bib
+++ /dev/null
@@ -1,1397 +0,0 @@
-@String{jfp = "Journal of Functional Programming"}
-@String{lncs = "Lecture Notes in Computer Science"}
-@String{lnai = "Lecture Notes in Artificial Intelligence"}
-@String{SV = "{Sprin-ger-Verlag}"}
-
-@InProceedings{Aud91,
- author = {Ph. Audebaud},
- booktitle = {Proceedings of the sixth Conf. on Logic in Computer Science.},
- publisher = {IEEE},
- title = {Partial {Objects} in the {Calculus of Constructions}},
- year = {1991}
-}
-
-@PhDThesis{Aud92,
- author = {Ph. Audebaud},
- school = {{Universit\'e} Bordeaux I},
- title = {Extension du Calcul des Constructions par Points fixes},
- year = {1992}
-}
-
-@InProceedings{Audebaud92b,
- author = {Ph. Audebaud},
- booktitle = {{Proceedings of the 1992 Workshop on Types for Proofs and Programs}},
- editor = {{B. Nordstr\"om and K. Petersson and G. Plotkin}},
- note = {Also Research Report LIP-ENS-Lyon},
- pages = {21--34},
- title = {{CC+ : an extension of the Calculus of Constructions with fixpoints}},
- year = {1992}
-}
-
-@InProceedings{Augustsson85,
- author = {L. Augustsson},
- title = {{Compiling Pattern Matching}},
- booktitle = {Conference Functional Programming and
-Computer Architecture},
- year = {1985}
-}
-
-@Article{BaCo85,
- author = {J.L. Bates and R.L. Constable},
- journal = {ACM transactions on Programming Languages and Systems},
- title = {Proofs as {Programs}},
- volume = {7},
- year = {1985}
-}
-
-@Book{Bar81,
- author = {H.P. Barendregt},
- publisher = {North-Holland},
- title = {The Lambda Calculus its Syntax and Semantics},
- year = {1981}
-}
-
-@TechReport{Bar91,
- author = {H. Barendregt},
- institution = {Catholic University Nijmegen},
- note = {In Handbook of Logic in Computer Science, Vol II},
- number = {91-19},
- title = {Lambda {Calculi with Types}},
- year = {1991}
-}
-
-@Article{BeKe92,
- author = {G. Bellin and J. Ketonen},
- journal = {Theoretical Computer Science},
- pages = {115--142},
- title = {A decision procedure revisited : Notes on direct logic, linear logic and its implementation},
- volume = {95},
- year = {1992}
-}
-
-@Book{Bee85,
- author = {M.J. Beeson},
- publisher = SV,
- title = {Foundations of Constructive Mathematics, Metamathematical Studies},
- year = {1985}
-}
-
-@Book{Bis67,
- author = {E. Bishop},
- publisher = {McGraw-Hill},
- title = {Foundations of Constructive Analysis},
- year = {1967}
-}
-
-@Book{BoMo79,
- author = {R.S. Boyer and J.S. Moore},
- key = {BoMo79},
- publisher = {Academic Press},
- series = {ACM Monograph},
- title = {A computational logic},
- year = {1979}
-}
-
-@MastersThesis{Bou92,
- author = {S. Boutin},
- month = sep,
- school = {{Universit\'e Paris 7}},
- title = {Certification d'un compilateur {ML en Coq}},
- year = {1992}
-}
-
-@InProceedings{Bou97,
- title = {Using reflection to build efficient and certified decision procedure
-s},
- author = {S. Boutin},
- booktitle = {TACS'97},
- editor = {Martin Abadi and Takahashi Ito},
- publisher = SV,
- series = lncs,
- volume = 1281,
- year = {1997}
-}
-
-@PhDThesis{Bou97These,
- author = {S. Boutin},
- title = {R\'eflexions sur les quotients},
- school = {Paris 7},
- year = 1997,
- type = {th\`ese d'Universit\'e},
- month = apr
-}
-
-@Article{Bru72,
- author = {N.J. de Bruijn},
- journal = {Indag. Math.},
- title = {{Lambda-Calculus Notation with Nameless Dummies, a Tool for Automatic Formula Manipulation, with Application to the Church-Rosser Theorem}},
- volume = {34},
- year = {1972}
-}
-
-
-@InCollection{Bru80,
- author = {N.J. de Bruijn},
- booktitle = {to H.B. Curry : Essays on Combinatory Logic, Lambda Calculus and Formalism.},
- editor = {J.P. Seldin and J.R. Hindley},
- publisher = {Academic Press},
- title = {A survey of the project {Automath}},
- year = {1980}
-}
-
-@TechReport{COQ93,
- author = {G. Dowek and A. Felty and H. Herbelin and G. Huet and C. Murthy and C. Parent and C. Paulin-Mohring and B. Werner},
- institution = {INRIA},
- month = may,
- number = {154},
- title = {{The Coq Proof Assistant User's Guide Version 5.8}},
- year = {1993}
-}
-
-@TechReport{COQ02,
- author = {The Coq Development Team},
- institution = {INRIA},
- month = Feb,
- number = {255},
- title = {{The Coq Proof Assistant Reference Manual Version 7.2}},
- year = {2002}
-}
-
-@TechReport{CPar93,
- author = {C. Parent},
- institution = {Ecole {Normale} {Sup\'erieure} de {Lyon}},
- month = oct,
- note = {Also in~\cite{Nijmegen93}},
- number = {93-29},
- title = {Developing certified programs in the system {Coq}- {The} {Program} tactic},
- year = {1993}
-}
-
-@PhDThesis{CPar95,
- author = {C. Parent},
- school = {Ecole {Normale} {Sup\'erieure} de {Lyon}},
- title = {{Synth\`ese de preuves de programmes dans le Calcul des Constructions Inductives}},
- year = {1995}
-}
-
-@Book{Caml,
- author = {P. Weis and X. Leroy},
- publisher = {InterEditions},
- title = {Le langage Caml},
- year = {1993}
-}
-
-@InProceedings{ChiPotSimp03,
- author = {Laurent Chicli and Lo\"{\i}c Pottier and Carlos Simpson},
- title = {Mathematical Quotients and Quotient Types in Coq},
- booktitle = {TYPES},
- crossref = {DBLP:conf/types/2002},
- year = {2002}
-}
-
-@TechReport{CoC89,
- author = {Projet Formel},
- institution = {INRIA},
- number = {110},
- title = {{The Calculus of Constructions. Documentation and user's guide, Version 4.10}},
- year = {1989}
-}
-
-@InProceedings{CoHu85a,
- author = {Th. Coquand and G. Huet},
- address = {Linz},
- booktitle = {EUROCAL'85},
- publisher = SV,
- series = LNCS,
- title = {{Constructions : A Higher Order Proof System for Mechanizing Mathematics}},
- volume = {203},
- year = {1985}
-}
-
-@InProceedings{CoHu85b,
- author = {Th. Coquand and G. Huet},
- booktitle = {Logic Colloquium'85},
- editor = {The Paris Logic Group},
- publisher = {North-Holland},
- title = {{Concepts Math\'ematiques et Informatiques formalis\'es dans le Calcul des Constructions}},
- year = {1987}
-}
-
-@Article{CoHu86,
- author = {Th. Coquand and G. Huet},
- journal = {Information and Computation},
- number = {2/3},
- title = {The {Calculus of Constructions}},
- volume = {76},
- year = {1988}
-}
-
-@InProceedings{CoPa89,
- author = {Th. Coquand and C. Paulin-Mohring},
- booktitle = {Proceedings of Colog'88},
- editor = {P. Martin-L\"of and G. Mints},
- publisher = SV,
- series = LNCS,
- title = {Inductively defined types},
- volume = {417},
- year = {1990}
-}
-
-@Book{Con86,
- author = {R.L. {Constable et al.}},
- publisher = {Prentice-Hall},
- title = {{Implementing Mathematics with the Nuprl Proof Development System}},
- year = {1986}
-}
-
-@PhDThesis{Coq85,
- author = {Th. Coquand},
- month = jan,
- school = {Universit\'e Paris~7},
- title = {Une Th\'eorie des Constructions},
- year = {1985}
-}
-
-@InProceedings{Coq86,
- author = {Th. Coquand},
- address = {Cambridge, MA},
- booktitle = {Symposium on Logic in Computer Science},
- publisher = {IEEE Computer Society Press},
- title = {{An Analysis of Girard's Paradox}},
- year = {1986}
-}
-
-@InProceedings{Coq90,
- author = {Th. Coquand},
- booktitle = {Logic and Computer Science},
- editor = {P. Oddifredi},
- note = {INRIA Research Report 1088, also in~\cite{CoC89}},
- publisher = {Academic Press},
- title = {{Metamathematical Investigations of a Calculus of Constructions}},
- year = {1990}
-}
-
-@InProceedings{Coq91,
- author = {Th. Coquand},
- booktitle = {Proceedings 9th Int. Congress of Logic, Methodology and Philosophy of Science},
- title = {{A New Paradox in Type Theory}},
- month = {August},
- year = {1991}
-}
-
-@InProceedings{Coq92,
- author = {Th. Coquand},
- title = {{Pattern Matching with Dependent Types}},
- year = {1992},
- crossref = {Bastad92}
-}
-
-@InProceedings{Coquand93,
- author = {Th. Coquand},
- booktitle = {Types for Proofs and Programs},
- editor = {H. Barendregt and T. Nipokow},
- publisher = SV,
- series = LNCS,
- title = {{Infinite objects in Type Theory}},
- volume = {806},
- year = {1993},
- pages = {62-78}
-}
-
-@inproceedings{Corbineau08types,
- author = {P. Corbineau},
- title = {A Declarative Language for the Coq Proof Assistant},
- editor = {M. Miculan and I. Scagnetto and F. Honsell},
- booktitle = {TYPES '07, Cividale del Friuli, Revised Selected Papers},
- publisher = {Springer},
- series = LNCS,
- volume = {4941},
- year = {2007},
- pages = {69-84},
- ee = {http://dx.doi.org/10.1007/978-3-540-68103-8_5},
-}
-
-@PhDThesis{Cor97,
- author = {C. Cornes},
- month = nov,
- school = {{Universit\'e Paris 7}},
- title = {Conception d'un langage de haut niveau de représentation de preuves},
- type = {Th\`ese de Doctorat},
- year = {1997}
-}
-
-@MastersThesis{Cou94a,
- author = {J. Courant},
- month = sep,
- school = {DEA d'Informatique, ENS Lyon},
- title = {Explicitation de preuves par r\'ecurrence implicite},
- year = {1994}
-}
-
-@book{Cur58,
- author = {Haskell B. Curry and Robert Feys and William Craig},
- title = {Combinatory Logic},
- volume = 1,
- publisher = "North-Holland",
- year = 1958,
- note = {{\S{9E}}},
-}
-
-@InProceedings{Del99,
- author = {Delahaye, D.},
- title = {Information Retrieval in a Coq Proof Library using
- Type Isomorphisms},
- booktitle = {Proceedings of TYPES '99, L\"okeberg},
- publisher = SV,
- series = lncs,
- year = {1999},
- url =
- "\\{\sf ftp://ftp.inria.fr/INRIA/Projects/coq/David.Delahaye/papers/}"#
- "{\sf TYPES99-SIsos.ps.gz}"
-}
-
-@InProceedings{Del00,
- author = {Delahaye, D.},
- title = {A {T}actic {L}anguage for the {S}ystem {{\sf Coq}}},
- booktitle = {Proceedings of Logic for Programming and Automated Reasoning
- (LPAR), Reunion Island},
- publisher = SV,
- series = LNCS,
- volume = {1955},
- pages = {85--95},
- month = {November},
- year = {2000},
- url =
- "{\sf ftp://ftp.inria.fr/INRIA/Projects/coq/David.Delahaye/papers/}"#
- "{\sf LPAR2000-ltac.ps.gz}"
-}
-
-@InProceedings{DelMay01,
- author = {Delahaye, D. and Mayero, M.},
- title = {{\tt Field}: une proc\'edure de d\'ecision pour les nombres r\'eels en {\Coq}},
- booktitle = {Journ\'ees Francophones des Langages Applicatifs, Pontarlier},
- publisher = {INRIA},
- month = {Janvier},
- year = {2001},
- url =
- "\\{\sf ftp://ftp.inria.fr/INRIA/Projects/coq/David.Delahaye/papers/}"#
- "{\sf JFLA2000-Field.ps.gz}"
-}
-
-@TechReport{Dow90,
- author = {G. Dowek},
- institution = {INRIA},
- number = {1283},
- title = {Naming and Scoping in a Mathematical Vernacular},
- type = {Research Report},
- year = {1990}
-}
-
-@Article{Dow91a,
- author = {G. Dowek},
- journal = {Compte-Rendus de l'Acad\'emie des Sciences},
- note = {The undecidability of Third Order Pattern Matching in Calculi with Dependent Types or Type Constructors},
- number = {12},
- pages = {951--956},
- title = {L'Ind\'ecidabilit\'e du Filtrage du Troisi\`eme Ordre dans les Calculs avec Types D\'ependants ou Constructeurs de Types},
- volume = {I, 312},
- year = {1991}
-}
-
-@InProceedings{Dow91b,
- author = {G. Dowek},
- booktitle = {Proceedings of Mathematical Foundation of Computer Science},
- note = {Also INRIA Research Report},
- pages = {151--160},
- publisher = SV,
- series = LNCS,
- title = {A Second Order Pattern Matching Algorithm in the Cube of Typed $\lambda$-calculi},
- volume = {520},
- year = {1991}
-}
-
-@PhDThesis{Dow91c,
- author = {G. Dowek},
- month = dec,
- school = {Universit\'e Paris 7},
- title = {D\'emonstration automatique dans le Calcul des Constructions},
- year = {1991}
-}
-
-@Article{Dow92a,
- author = {G. Dowek},
- title = {The Undecidability of Pattern Matching in Calculi where Primitive Recursive Functions are Representable},
- year = 1993,
- journal = tcs,
- volume = 107,
- number = 2,
- pages = {349-356}
-}
-
-@Article{Dow94a,
- author = {G. Dowek},
- journal = {Annals of Pure and Applied Logic},
- volume = {69},
- pages = {135--155},
- title = {Third order matching is decidable},
- year = {1994}
-}
-
-@InProceedings{Dow94b,
- author = {G. Dowek},
- booktitle = {Proceedings of the second international conference on typed lambda calculus and applications},
- title = {Lambda-calculus, Combinators and the Comprehension Schema},
- year = {1995}
-}
-
-@InProceedings{Dyb91,
- author = {P. Dybjer},
- booktitle = {Logical Frameworks},
- editor = {G. Huet and G. Plotkin},
- pages = {59--79},
- publisher = {Cambridge University Press},
- title = {Inductive sets and families in {Martin-Löf's}
- Type Theory and their set-theoretic semantics: An inversion principle for {Martin-L\"of's} type theory},
- volume = {14},
- year = {1991}
-}
-
-@Article{Dyc92,
- author = {Roy Dyckhoff},
- journal = {The Journal of Symbolic Logic},
- month = sep,
- number = {3},
- title = {Contraction-free sequent calculi for intuitionistic logic},
- volume = {57},
- year = {1992}
-}
-
-@MastersThesis{Fil94,
- author = {J.-C. Filli\^atre},
- month = sep,
- school = {DEA d'Informatique, ENS Lyon},
- title = {Une proc\'edure de d\'ecision pour le Calcul des Pr\'edicats Direct. Étude et impl\'ementation dans le syst\`eme {\Coq}},
- year = {1994}
-}
-
-@TechReport{Filliatre95,
- author = {J.-C. Filli\^atre},
- institution = {LIP-ENS-Lyon},
- title = {A decision procedure for Direct Predicate Calculus},
- type = {Research report},
- number = {96--25},
- year = {1995}
-}
-
-@Article{Filliatre03jfp,
- author = {J.-C. Filliâtre},
- title = {Verification of Non-Functional Programs
- using Interpretations in Type Theory},
- journal = jfp,
- volume = 13,
- number = 4,
- pages = {709--745},
- month = jul,
- year = 2003,
- note = {[English translation of \cite{Filliatre99}]},
- url = {http://www.lri.fr/~filliatr/ftp/publis/jphd.ps.gz},
- topics = {team, lri},
- type_publi = {irevcomlec}
-}
-
-@PhDThesis{Filliatre99,
- author = {J.-C. Filli\^atre},
- title = {Preuve de programmes imp\'eratifs en th\'eorie des types},
- type = {Thèse de Doctorat},
- school = {Universit\'e Paris-Sud},
- year = 1999,
- month = {July},
- url = {\url{http://www.lri.fr/~filliatr/ftp/publis/these.ps.gz}}
-}
-
-@Unpublished{Filliatre99c,
- author = {J.-C. Filli\^atre},
- title = {{Formal Proof of a Program: Find}},
- month = {January},
- year = 2000,
- note = {Submitted to \emph{Science of Computer Programming}},
- url = {\url{http://www.lri.fr/~filliatr/ftp/publis/find.ps.gz}}
-}
-
-@InProceedings{FilliatreMagaud99,
- author = {J.-C. Filli\^atre and N. Magaud},
- title = {Certification of sorting algorithms in the system {\Coq}},
- booktitle = {Theorem Proving in Higher Order Logics:
- Emerging Trends},
- year = 1999,
- url = {\url{http://www.lri.fr/~filliatr/ftp/publis/Filliatre-Magaud.ps.gz}}
-}
-
-@Unpublished{Fle90,
- author = {E. Fleury},
- month = jul,
- note = {Rapport de Stage},
- title = {Implantation des algorithmes de {Floyd et de Dijkstra} dans le {Calcul des Constructions}},
- year = {1990}
-}
-
-@Book{Fourier,
- author = {Jean-Baptiste-Joseph Fourier},
- publisher = {Gauthier-Villars},
- title = {Fourier's method to solve linear
- inequations/equations systems.},
- year = {1890}
-}
-
-@InProceedings{Gim94,
- author = {E. Gim\'enez},
- booktitle = {Types'94 : Types for Proofs and Programs},
- note = {Extended version in LIP research report 95-07, ENS Lyon},
- publisher = SV,
- series = LNCS,
- title = {Codifying guarded definitions with recursive schemes},
- volume = {996},
- year = {1994}
-}
-
-@PhDThesis{Gim96,
- author = {E. Gim\'enez},
- title = {Un calcul des constructions infinies et son application \'a la v\'erification de syst\`emes communicants},
- school = {\'Ecole Normale Sup\'erieure de Lyon},
- year = {1996}
-}
-
-@TechReport{Gim98,
- author = {E. Gim\'enez},
- title = {A Tutorial on Recursive Types in Coq},
- institution = {INRIA},
- year = 1998,
- month = mar
-}
-
-@Unpublished{GimCas05,
- author = {E. Gim\'enez and P. Cast\'eran},
- title = {A Tutorial on [Co-]Inductive Types in Coq},
- institution = {INRIA},
- year = 2005,
- month = jan,
- note = {available at \url{http://coq.inria.fr/doc}}
-}
-
-@InProceedings{Gimenez95b,
- author = {E. Gim\'enez},
- booktitle = {Workshop on Types for Proofs and Programs},
- series = LNCS,
- number = {1158},
- pages = {135-152},
- title = {An application of co-Inductive types in Coq:
- verification of the Alternating Bit Protocol},
- editorS = {S. Berardi and M. Coppo},
- publisher = SV,
- year = {1995}
-}
-
-@InProceedings{Gir70,
- author = {J.-Y. Girard},
- booktitle = {Proceedings of the 2nd Scandinavian Logic Symposium},
- publisher = {North-Holland},
- title = {Une extension de l'interpr\'etation de {G\"odel} \`a l'analyse, et son application \`a l'\'elimination des coupures dans l'analyse et la th\'eorie des types},
- year = {1970}
-}
-
-@PhDThesis{Gir72,
- author = {J.-Y. Girard},
- school = {Universit\'e Paris~7},
- title = {Interpr\'etation fonctionnelle et \'elimination des coupures de l'arithm\'etique d'ordre sup\'erieur},
- year = {1972}
-}
-
-@Book{Gir89,
- author = {J.-Y. Girard and Y. Lafont and P. Taylor},
- publisher = {Cambridge University Press},
- series = {Cambridge Tracts in Theoretical Computer Science 7},
- title = {Proofs and Types},
- year = {1989}
-}
-
-@TechReport{Har95,
- author = {John Harrison},
- title = {Metatheory and Reflection in Theorem Proving: A Survey and Critique},
- institution = {SRI International Cambridge Computer Science Research Centre,},
- year = 1995,
- type = {Technical Report},
- number = {CRC-053},
- abstract = {http://www.cl.cam.ac.uk/users/jrh/papers.html}
-}
-
-@MastersThesis{Hir94,
- author = {D. Hirschkoff},
- month = sep,
- school = {DEA IARFA, Ecole des Ponts et Chauss\'ees, Paris},
- title = {Écriture d'une tactique arithm\'etique pour le syst\`eme {\Coq}},
- year = {1994}
-}
-
-@InProceedings{HofStr98,
- author = {Martin Hofmann and Thomas Streicher},
- title = {The groupoid interpretation of type theory},
- booktitle = {Proceedings of the meeting Twenty-five years of constructive type theory},
- publisher = {Oxford University Press},
- year = {1998}
-}
-
-@InCollection{How80,
- author = {W.A. Howard},
- booktitle = {to H.B. Curry : Essays on Combinatory Logic, Lambda Calculus and Formalism.},
- editor = {J.P. Seldin and J.R. Hindley},
- note = {Unpublished 1969 Manuscript},
- publisher = {Academic Press},
- title = {The Formulae-as-Types Notion of Constructions},
- year = {1980}
-}
-
-@InProceedings{Hue87tapsoft,
- author = {G. Huet},
- title = {Programming of Future Generation Computers},
- booktitle = {Proceedings of TAPSOFT87},
- series = LNCS,
- volume = 249,
- pages = {276--286},
- year = 1987,
- publisher = SV
-}
-
-@InProceedings{Hue87,
- author = {G. Huet},
- booktitle = {Programming of Future Generation Computers},
- editor = {K. Fuchi and M. Nivat},
- note = {Also in \cite{Hue87tapsoft}},
- publisher = {Elsevier Science},
- title = {Induction Principles Formalized in the {Calculus of Constructions}},
- year = {1988}
-}
-
-@InProceedings{Hue88,
- author = {G. Huet},
- booktitle = {A perspective in Theoretical Computer Science. Commemorative Volume for Gift Siromoney},
- editor = {R. Narasimhan},
- note = {Also in~\cite{CoC89}},
- publisher = {World Scientific Publishing},
- title = {{The Constructive Engine}},
- year = {1989}
-}
-
-@Unpublished{Hue88b,
- author = {G. Huet},
- title = {Extending the Calculus of Constructions with Type:Type},
- year = 1988,
- note = {Unpublished}
-}
-
-@Book{Hue89,
- editor = {G. Huet},
- publisher = {Addison-Wesley},
- series = {The UT Year of Programming Series},
- title = {Logical Foundations of Functional Programming},
- year = {1989}
-}
-
-@InProceedings{Hue92,
- author = {G. Huet},
- booktitle = {Proceedings of 12th FST/TCS Conference, New Delhi},
- pages = {229--240},
- publisher = SV,
- series = LNCS,
- title = {The Gallina Specification Language : A case study},
- volume = {652},
- year = {1992}
-}
-
-@Article{Hue94,
- author = {G. Huet},
- journal = {J. Functional Programming},
- pages = {371--394},
- publisher = {Cambridge University Press},
- title = {Residual theory in $\lambda$-calculus: a formal development},
- volume = {4,3},
- year = {1994}
-}
-
-@InCollection{HuetLevy79,
- author = {G. Huet and J.-J. L\'{e}vy},
- title = {Call by Need Computations in Non-Ambigous
-Linear Term Rewriting Systems},
- note = {Also research report 359, INRIA, 1979},
- booktitle = {Computational Logic, Essays in Honor of
-Alan Robinson},
- editor = {J.-L. Lassez and G. Plotkin},
- publisher = {The MIT press},
- year = {1991}
-}
-
-@Article{KeWe84,
- author = {J. Ketonen and R. Weyhrauch},
- journal = {Theoretical Computer Science},
- pages = {297--307},
- title = {A decidable fragment of {P}redicate {C}alculus},
- volume = {32},
- year = {1984}
-}
-
-@Book{Kle52,
- author = {S.C. Kleene},
- publisher = {North-Holland},
- series = {Bibliotheca Mathematica},
- title = {Introduction to Metamathematics},
- year = {1952}
-}
-
-@Book{Kri90,
- author = {J.-L. Krivine},
- publisher = {Masson},
- series = {Etudes et recherche en informatique},
- title = {Lambda-calcul {types et mod\`eles}},
- year = {1990}
-}
-
-@Book{LE92,
- editor = {G. Huet and G. Plotkin},
- publisher = {Cambridge University Press},
- title = {Logical Environments},
- year = {1992}
-}
-
-@Book{LF91,
- editor = {G. Huet and G. Plotkin},
- publisher = {Cambridge University Press},
- title = {Logical Frameworks},
- year = {1991}
-}
-
-@Article{Laville91,
- author = {A. Laville},
- title = {Comparison of Priority Rules in Pattern
-Matching and Term Rewriting},
- journal = {Journal of Symbolic Computation},
- volume = {11},
- pages = {321--347},
- year = {1991}
-}
-
-@InProceedings{LePa94,
- author = {F. Leclerc and C. Paulin-Mohring},
- booktitle = {{Types for Proofs and Programs, Types' 93}},
- editor = {H. Barendregt and T. Nipkow},
- publisher = SV,
- series = {LNCS},
- title = {{Programming with Streams in Coq. A case study : The Sieve of Eratosthenes}},
- volume = {806},
- year = {1994}
-}
-
-@TechReport{Leroy90,
- author = {X. Leroy},
- title = {The {ZINC} experiment: an economical implementation
-of the {ML} language},
- institution = {INRIA},
- number = {117},
- year = {1990}
-}
-
-@InProceedings{Let02,
- author = {P. Letouzey},
- title = {A New Extraction for Coq},
- booktitle = {TYPES},
- year = 2002,
- crossref = {DBLP:conf/types/2002},
- url = {draft at \url{http://www.pps.jussieu.fr/~letouzey/download/extraction2002.ps.gz}}
-}
-
-@PhDThesis{Luo90,
- author = {Z. Luo},
- title = {An Extended Calculus of Constructions},
- school = {University of Edinburgh},
- year = {1990}
-}
-
-@inproceedings{Luttik97specificationof,
- Author = {Sebastiaan P. Luttik and Eelco Visser},
- Booktitle = {2nd International Workshop on the Theory and Practice of Algebraic Specifications (ASF+SDF'97), Electronic Workshops in Computing},
- Publisher = {Springer-Verlag},
- Title = {Specification of Rewriting Strategies},
- Year = {1997}}
-
-@Book{MaL84,
- author = {{P. Martin-L\"of}},
- publisher = {Bibliopolis},
- series = {Studies in Proof Theory},
- title = {Intuitionistic Type Theory},
- year = {1984}
-}
-
-@Article{MaSi94,
- author = {P. Manoury and M. Simonot},
- title = {Automatizing Termination Proofs of Recursively Defined Functions.},
- journal = {TCS},
- volume = {135},
- number = {2},
- year = {1994},
- pages = {319-343},
-}
-
-@InProceedings{Miquel00,
- author = {A. Miquel},
- title = {A Model for Impredicative Type Systems with Universes,
-Intersection Types and Subtyping},
- booktitle = {{Proceedings of the 15th Annual IEEE Symposium on Logic in Computer Science (LICS'00)}},
- publisher = {IEEE Computer Society Press},
- year = {2000}
-}
-
-@PhDThesis{Miquel01a,
- author = {A. Miquel},
- title = {Le Calcul des Constructions implicite: syntaxe et s\'emantique},
- month = {dec},
- school = {{Universit\'e Paris 7}},
- year = {2001}
-}
-
-@InProceedings{Miquel01b,
- author = {A. Miquel},
- title = {The Implicit Calculus of Constructions: Extending Pure Type Systems with an Intersection Type Binder and Subtyping},
- booktitle = {{Proceedings of the fifth International Conference on Typed Lambda Calculi and Applications (TLCA01), Krakow, Poland}},
- publisher = SV,
- series = {LNCS},
- number = 2044,
- year = {2001}
-}
-
-@InProceedings{MiWer02,
- author = {A. Miquel and B. Werner},
- title = {The Not So Simple Proof-Irrelevant Model of CC},
- booktitle = {TYPES},
- year = {2002},
- pages = {240-258},
- ee = {http://link.springer.de/link/service/series/0558/bibs/2646/26460240.htm},
- crossref = {DBLP:conf/types/2002},
- bibsource = {DBLP, http://dblp.uni-trier.de}
-}
-
-@proceedings{DBLP:conf/types/2002,
- editor = {H. Geuvers and F. Wiedijk},
- title = {Types for Proofs and Programs, Second International Workshop,
- TYPES 2002, Berg en Dal, The Netherlands, April 24-28, 2002,
- Selected Papers},
- booktitle = {TYPES},
- publisher = SV,
- series = LNCS,
- volume = {2646},
- year = {2003},
- isbn = {3-540-14031-X},
- bibsource = {DBLP, http://dblp.uni-trier.de}
-}
-
-@InProceedings{Moh89a,
- author = {C. Paulin-Mohring},
- address = {Austin},
- booktitle = {Sixteenth Annual ACM Symposium on Principles of Programming Languages},
- month = jan,
- publisher = {ACM},
- title = {Extracting ${F}_{\omega}$'s programs from proofs in the {Calculus of Constructions}},
- year = {1989}
-}
-
-@PhDThesis{Moh89b,
- author = {C. Paulin-Mohring},
- month = jan,
- school = {{Universit\'e Paris 7}},
- title = {Extraction de programmes dans le {Calcul des Constructions}},
- year = {1989}
-}
-
-@InProceedings{Moh93,
- author = {C. Paulin-Mohring},
- booktitle = {Proceedings of the conference Typed Lambda Calculi and Applications},
- editor = {M. Bezem and J.-F. Groote},
- note = {Also LIP research report 92-49, ENS Lyon},
- number = {664},
- publisher = SV,
- series = {LNCS},
- title = {{Inductive Definitions in the System Coq - Rules and Properties}},
- year = {1993}
-}
-
-@Book{Moh97,
- author = {C. Paulin-Mohring},
- month = jan,
- publisher = {{ENS Lyon}},
- title = {{Le syst\`eme Coq. \mbox{Th\`ese d'habilitation}}},
- year = {1997}
-}
-
-@MastersThesis{Mun94,
- author = {C. Muñoz},
- month = sep,
- school = {DEA d'Informatique Fondamentale, Universit\'e Paris 7},
- title = {D\'emonstration automatique dans la logique propositionnelle intuitionniste},
- year = {1994}
-}
-
-@PhDThesis{Mun97d,
- author = {C. Mu{\~{n}}oz},
- title = {Un calcul de substitutions pour la repr\'esentation
- de preuves partielles en th\'eorie de types},
- school = {Universit\'e Paris 7},
- year = {1997},
- note = {Version en anglais disponible comme rapport de
- recherche INRIA RR-3309},
- type = {Th\`ese de Doctorat}
-}
-
-@Book{NoPS90,
- author = {B. {Nordstr\"om} and K. Peterson and J. Smith},
- booktitle = {Information Processing 83},
- publisher = {Oxford Science Publications},
- series = {International Series of Monographs on Computer Science},
- title = {Programming in {Martin-L\"of's} Type Theory},
- year = {1990}
-}
-
-@Article{Nor88,
- author = {B. {Nordstr\"om}},
- journal = {BIT},
- title = {Terminating General Recursion},
- volume = {28},
- year = {1988}
-}
-
-@Book{Odi90,
- editor = {P. Odifreddi},
- publisher = {Academic Press},
- title = {Logic and Computer Science},
- year = {1990}
-}
-
-@InProceedings{PaMS92,
- author = {M. Parigot and P. Manoury and M. Simonot},
- address = {St. Petersburg, Russia},
- booktitle = {Logic Programming and automated reasoning},
- editor = {A. Voronkov},
- month = jul,
- number = {624},
- publisher = SV,
- series = {LNCS},
- title = {{ProPre : A Programming language with proofs}},
- year = {1992}
-}
-
-@Article{PaWe92,
- author = {C. Paulin-Mohring and B. Werner},
- journal = {Journal of Symbolic Computation},
- pages = {607--640},
- title = {{Synthesis of ML programs in the system Coq}},
- volume = {15},
- year = {1993}
-}
-
-@Article{Par92,
- author = {M. Parigot},
- journal = {Theoretical Computer Science},
- number = {2},
- pages = {335--356},
- title = {{Recursive Programming with Proofs}},
- volume = {94},
- year = {1992}
-}
-
-@InProceedings{Parent95b,
- author = {C. Parent},
- booktitle = {{Mathematics of Program Construction'95}},
- publisher = SV,
- series = {LNCS},
- title = {{Synthesizing proofs from programs in
-the Calculus of Inductive Constructions}},
- volume = {947},
- year = {1995}
-}
-
-@InProceedings{Prasad93,
- author = {K.V. Prasad},
- booktitle = {{Proceedings of CONCUR'93}},
- publisher = SV,
- series = {LNCS},
- title = {{Programming with broadcasts}},
- volume = {715},
- year = {1993}
-}
-
-@Book{RC95,
- author = {di~Cosmo, R.},
- title = {Isomorphisms of Types: from $\lambda$-calculus to information
- retrieval and language design},
- series = {Progress in Theoretical Computer Science},
- publisher = {Birkhauser},
- year = {1995},
- note = {ISBN-0-8176-3763-X}
-}
-
-@TechReport{Rou92,
- author = {J. Rouyer},
- institution = {INRIA},
- month = nov,
- number = {1795},
- title = {{Développement de l'Algorithme d'Unification dans le Calcul des Constructions}},
- year = {1992}
-}
-
-@Article{Rushby98,
- title = {Subtypes for Specifications: Predicate Subtyping in
- {PVS}},
- author = {John Rushby and Sam Owre and N. Shankar},
- journal = {IEEE Transactions on Software Engineering},
- pages = {709--720},
- volume = 24,
- number = 9,
- month = sep,
- year = 1998
-}
-
-@TechReport{Saibi94,
- author = {A. Sa\"{\i}bi},
- institution = {INRIA},
- month = dec,
- number = {2345},
- title = {{Axiomatization of a lambda-calculus with explicit-substitutions in the Coq System}},
- year = {1994}
-}
-
-
-@MastersThesis{Ter92,
- author = {D. Terrasse},
- month = sep,
- school = {IARFA},
- title = {{Traduction de TYPOL en COQ. Application \`a Mini ML}},
- year = {1992}
-}
-
-@TechReport{ThBeKa92,
- author = {L. Th\'ery and Y. Bertot and G. Kahn},
- institution = {INRIA Sophia},
- month = may,
- number = {1684},
- title = {Real theorem provers deserve real user-interfaces},
- type = {Research Report},
- year = {1992}
-}
-
-@Book{TrDa89,
- author = {A.S. Troelstra and D. van Dalen},
- publisher = {North-Holland},
- series = {Studies in Logic and the foundations of Mathematics, volumes 121 and 123},
- title = {Constructivism in Mathematics, an introduction},
- year = {1988}
-}
-
-@PhDThesis{Wer94,
- author = {B. Werner},
- school = {Universit\'e Paris 7},
- title = {Une th\'eorie des constructions inductives},
- type = {Th\`ese de Doctorat},
- year = {1994}
-}
-
-@PhDThesis{Bar99,
- author = {B. Barras},
- school = {Universit\'e Paris 7},
- title = {Auto-validation d'un système de preuves avec familles inductives},
- type = {Th\`ese de Doctorat},
- year = {1999}
-}
-
-@Unpublished{ddr98,
- author = {D. de Rauglaudre},
- title = {Camlp4 version 1.07.2},
- year = {1998},
- note = {In Camlp4 distribution}
-}
-
-@Article{dowek93,
- author = {G. Dowek},
- title = {{A Complete Proof Synthesis Method for the Cube of Type Systems}},
- journal = {Journal Logic Computation},
- volume = {3},
- number = {3},
- pages = {287--315},
- month = {June},
- year = {1993}
-}
-
-@InProceedings{manoury94,
- author = {P. Manoury},
- title = {{A User's Friendly Syntax to Define
-Recursive Functions as Typed $\lambda-$Terms}},
- booktitle = {{Types for Proofs and Programs, TYPES'94}},
- series = {LNCS},
- volume = {996},
- month = jun,
- year = {1994}
-}
-
-@TechReport{maranget94,
- author = {L. Maranget},
- institution = {INRIA},
- number = {2385},
- title = {{Two Techniques for Compiling Lazy Pattern Matching}},
- year = {1994}
-}
-
-@InProceedings{puel-suarez90,
- author = {L.Puel and A. Su\'arez},
- booktitle = {{Conference Lisp and Functional Programming}},
- series = {ACM},
- publisher = SV,
- title = {{Compiling Pattern Matching by Term
-Decomposition}},
- year = {1990}
-}
-
-@MastersThesis{saidi94,
- author = {H. Saidi},
- month = sep,
- school = {DEA d'Informatique Fondamentale, Universit\'e Paris 7},
- title = {R\'esolution d'\'equations dans le syst\`eme T
- de G\"odel},
- year = {1994}
-}
-
-@inproceedings{sozeau06,
- author = {Matthieu Sozeau},
- title = {Subset Coercions in {C}oq},
- year = {2007},
- booktitle = {TYPES'06},
- pages = {237-252},
- volume = {4502},
- publisher = "Springer",
- series = {LNCS}
-}
-
-@inproceedings{sozeau08,
- Author = {Matthieu Sozeau and Nicolas Oury},
- booktitle = {TPHOLs'08},
- Pdf = {http://www.lri.fr/~sozeau/research/publications/drafts/classes.pdf},
- Title = {{F}irst-{C}lass {T}ype {C}lasses},
- Year = {2008},
-}
-
-@Misc{streicher93semantical,
- author = {T. Streicher},
- title = {Semantical Investigations into Intensional Type Theory},
- note = {Habilitationsschrift, LMU Munchen.},
- year = {1993}
-}
-
-@Misc{Pcoq,
- author = {Lemme Team},
- title = {Pcoq a graphical user-interface for {Coq}},
- note = {\url{http://www-sop.inria.fr/lemme/pcoq/}}
-}
-
-@Misc{ProofGeneral,
- author = {David Aspinall},
- title = {Proof General},
- note = {\url{https://proofgeneral.github.io/}}
-}
-
-@Book{CoqArt,
- title = {Interactive Theorem Proving and Program Development.
- Coq'Art: The Calculus of Inductive Constructions},
- author = {Yves Bertot and Pierre Castéran},
- publisher = {Springer Verlag},
- series = {Texts in Theoretical Computer Science. An EATCS series},
- year = 2004
-}
-
-@InCollection{wadler87,
- author = {P. Wadler},
- title = {Efficient Compilation of Pattern Matching},
- booktitle = {The Implementation of Functional Programming
-Languages},
- editor = {S.L. Peyton Jones},
- publisher = {Prentice-Hall},
- year = {1987}
-}
-
-@inproceedings{DBLP:conf/types/CornesT95,
- author = {Cristina Cornes and
- Delphine Terrasse},
- title = {Automating Inversion of Inductive Predicates in Coq},
- booktitle = {TYPES},
- year = {1995},
- pages = {85-104},
- crossref = {DBLP:conf/types/1995},
- bibsource = {DBLP, http://dblp.uni-trier.de}
-}
-@proceedings{DBLP:conf/types/1995,
- editor = {Stefano Berardi and
- Mario Coppo},
- title = {Types for Proofs and Programs, International Workshop TYPES'95,
- Torino, Italy, June 5-8, 1995, Selected Papers},
- booktitle = {TYPES},
- publisher = {Springer},
- series = {Lecture Notes in Computer Science},
- volume = {1158},
- year = {1996},
- isbn = {3-540-61780-9},
- bibsource = {DBLP, http://dblp.uni-trier.de}
-}
-
-@inproceedings{DBLP:conf/types/McBride00,
- author = {Conor McBride},
- title = {Elimination with a Motive},
- booktitle = {TYPES},
- year = {2000},
- pages = {197-216},
- ee = {http://link.springer.de/link/service/series/0558/bibs/2277/22770197.htm},
- crossref = {DBLP:conf/types/2000},
- bibsource = {DBLP, http://dblp.uni-trier.de}
-}
-
-@proceedings{DBLP:conf/types/2000,
- editor = {Paul Callaghan and
- Zhaohui Luo and
- James McKinna and
- Robert Pollack},
- title = {Types for Proofs and Programs, International Workshop, TYPES
- 2000, Durham, UK, December 8-12, 2000, Selected Papers},
- booktitle = {TYPES},
- publisher = {Springer},
- series = {Lecture Notes in Computer Science},
- volume = {2277},
- year = {2002},
- isbn = {3-540-43287-6},
- bibsource = {DBLP, http://dblp.uni-trier.de}
-}
-
-@INPROCEEDINGS{sugar,
- author = {Alessandro Giovini and Teo Mora and Gianfranco Niesi and Lorenzo Robbiano and Carlo Traverso},
- title = {"One sugar cube, please" or Selection strategies in the Buchberger algorithm},
- booktitle = { Proceedings of the ISSAC'91, ACM Press},
- year = {1991},
- pages = {5--4},
- publisher = {}
-}
-
-@article{LeeWerner11,
- author = {Gyesik Lee and
- Benjamin Werner},
- title = {Proof-irrelevant model of {CC} with predicative induction
- and judgmental equality},
- journal = {Logical Methods in Computer Science},
- volume = {7},
- number = {4},
- year = {2011},
- ee = {http://dx.doi.org/10.2168/LMCS-7(4:5)2011},
- bibsource = {DBLP, http://dblp.uni-trier.de}
-}
-
-@Comment{cross-references, must be at end}
-
-@Book{Bastad92,
- editor = {B. Nordstr\"om and K. Petersson and G. Plotkin},
- publisher = {Available by ftp at site ftp.inria.fr},
- title = {Proceedings of the 1992 Workshop on Types for Proofs and Programs},
- year = {1992}
-}
-
-@Book{Nijmegen93,
- editor = {H. Barendregt and T. Nipkow},
- publisher = SV,
- series = LNCS,
- title = {Types for Proofs and Programs},
- volume = {806},
- year = {1994}
-}
-
-@article{ TheOmegaPaper,
- author = "W. Pugh",
- title = "The Omega test: a fast and practical integer programming algorithm for dependence analysis",
- journal = "Communication of the ACM",
- pages = "102--114",
- year = "1992",
-}
-
-@inproceedings{CSwcu,
- hal_id = {hal-00816703},
- url = {http://hal.inria.fr/hal-00816703},
- title = {{Canonical Structures for the working Coq user}},
- author = {Mahboubi, Assia and Tassi, Enrico},
- booktitle = {{ITP 2013, 4th Conference on Interactive Theorem Proving}},
- publisher = {Springer},
- pages = {19-34},
- address = {Rennes, France},
- volume = {7998},
- editor = {Sandrine Blazy and Christine Paulin and David Pichardie },
- series = {LNCS },
- doi = {10.1007/978-3-642-39634-2\_5 },
- year = {2013},
-}
-
-@article{CSlessadhoc,
- author = {Gonthier, Georges and Ziliani, Beta and Nanevski, Aleksandar and Dreyer, Derek},
- title = {How to Make Ad Hoc Proof Automation Less Ad Hoc},
- journal = {SIGPLAN Not.},
- issue_date = {September 2011},
- volume = {46},
- number = {9},
- month = sep,
- year = {2011},
- issn = {0362-1340},
- pages = {163--175},
- numpages = {13},
- url = {http://doi.acm.org/10.1145/2034574.2034798},
- doi = {10.1145/2034574.2034798},
- acmid = {2034798},
- publisher = {ACM},
- address = {New York, NY, USA},
- keywords = {canonical structures, coq, custom proof automation, hoare type theory, interactive theorem proving, tactics, type classes},
-}
-
-@inproceedings{CompiledStrongReduction,
- author = {Benjamin Gr{\'{e}}goire and
- Xavier Leroy},
- editor = {Mitchell Wand and
- Simon L. Peyton Jones},
- title = {A compiled implementation of strong reduction},
- booktitle = {Proceedings of the Seventh {ACM} {SIGPLAN} International Conference
- on Functional Programming {(ICFP} '02), Pittsburgh, Pennsylvania,
- USA, October 4-6, 2002.},
- pages = {235--246},
- publisher = {{ACM}},
- year = {2002},
- url = {http://doi.acm.org/10.1145/581478.581501},
- doi = {10.1145/581478.581501},
- timestamp = {Tue, 11 Jun 2013 13:49:16 +0200},
- biburl = {http://dblp.uni-trier.de/rec/bib/conf/icfp/GregoireL02},
- bibsource = {dblp computer science bibliography, http://dblp.org}
-}
-
-@inproceedings{FullReduction,
- author = {Mathieu Boespflug and
- Maxime D{\'{e}}n{\`{e}}s and
- Benjamin Gr{\'{e}}goire},
- editor = {Jean{-}Pierre Jouannaud and
- Zhong Shao},
- title = {Full Reduction at Full Throttle},
- booktitle = {Certified Programs and Proofs - First International Conference, {CPP}
- 2011, Kenting, Taiwan, December 7-9, 2011. Proceedings},
- series = {Lecture Notes in Computer Science},
- volume = {7086},
- pages = {362--377},
- publisher = {Springer},
- year = {2011},
- url = {http://dx.doi.org/10.1007/978-3-642-25379-9_26},
- doi = {10.1007/978-3-642-25379-9_26},
- timestamp = {Thu, 17 Nov 2011 13:33:48 +0100},
- biburl = {http://dblp.uni-trier.de/rec/bib/conf/cpp/BoespflugDG11},
- bibsource = {dblp computer science bibliography, http://dblp.org}
-}
diff --git a/doc/refman/coq-listing.tex b/doc/refman/coq-listing.tex
deleted file mode 100644
index c69c3b1b8..000000000
--- a/doc/refman/coq-listing.tex
+++ /dev/null
@@ -1,152 +0,0 @@
-%=======================================================================
-% Listings LaTeX package style for Gallina + SSReflect (Assia Mahboubi 2007)
-
-\lstdefinelanguage{SSR} {
-
-% Anything betweeen $ becomes LaTeX math mode
-mathescape=true,
-% Comments may or not include Latex commands
-texcl=false,
-
-
-% Vernacular commands
-morekeywords=[1]{
-From, Section, Module, End, Require, Import, Export, Defensive, Function,
-Variable, Variables, Parameter, Parameters, Axiom, Hypothesis, Hypotheses,
-Notation, Local, Tactic, Reserved, Scope, Open, Close, Bind, Delimit,
-Definition, Let, Ltac, Fixpoint, CoFixpoint, Add, Morphism, Relation,
-Implicit, Arguments, Set, Unset, Contextual, Strict, Prenex, Implicits,
-Inductive, CoInductive, Record, Structure, Canonical, Coercion,
-Theorem, Lemma, Corollary, Proposition, Fact, Remark, Example,
-Proof, Goal, Save, Qed, Defined, Hint, Resolve, Rewrite, View,
-Search, Show, Print, Printing, All, Graph, Projections, inside,
-outside, Locate, Maximal},
-
-% Gallina
-morekeywords=[2]{forall, exists, exists2, fun, fix, cofix, struct,
- match, with, end, as, in, return, let, if, is, then, else,
- for, of, nosimpl},
-
-% Sorts
-morekeywords=[3]{Type, Prop},
-
-% Various tactics, some are std Coq subsumed by ssr, for the manual purpose
-morekeywords=[4]{
- pose, set, move, case, elim, apply, clear,
- hnf, intro, intros, generalize, rename, pattern, after,
- destruct, induction, using, refine, inversion, injection,
- rewrite, congr, unlock, compute, ring, field,
- replace, fold, unfold, change, cutrewrite, simpl,
- have, gen, generally, suff, wlog, suffices, without, loss, nat_norm,
- assert, cut, trivial, revert, bool_congr, nat_congr, abstract,
- symmetry, transitivity, auto, split, left, right, autorewrite},
-
-% Terminators
-morekeywords=[5]{
- by, done, exact, reflexivity, tauto, romega, omega,
- assumption, solve, contradiction, discriminate},
-
-
-% Control
-morekeywords=[6]{do, last, first, try, idtac, repeat},
-
-% Various symbols
-% For the ssr manual we turn off the prettyprint of formulas
-% literate=
-% {->}{{$\rightarrow\,$}}2
-% {->}{{\tt ->}}3
-% {<-}{{$\leftarrow\,$}}2
-% {<-}{{\tt <-}}2
-% {>->}{{$\mapsto$}}3
-% {<=}{{$\leq$}}1
-% {>=}{{$\geq$}}1
-% {<>}{{$\neq$}}1
-% {/\\}{{$\wedge$}}2
-% {\\/}{{$\vee$}}2
-% {<->}{{$\leftrightarrow\;$}}3
-% {<=>}{{$\Leftrightarrow\;$}}3
-% {:nat}{{$~\in\mathbb{N}$}}3
-% {fforall\ }{{$\forall_f\,$}}1
-% {forall\ }{{$\forall\,$}}1
-% {exists\ }{{$\exists\,$}}1
-% {negb}{{$\neg$}}1
-% {spp}{{:*:\,}}1
-% {~}{{$\sim$}}1
-% {\\in}{{$\in\;$}}1
-% {/\\}{$\land\,$}1
-% {:*:}{{$*$}}2
-% {=>}{{$\,\Rightarrow\ $}}1
-% {=>}{{\tt =>}}2
-% {:=}{{{\tt:=}\,\,}}2
-% {==}{{$\equiv$}\,}2
-% {!=}{{$\neq$}\,}2
-% {^-1}{{$^{-1}$}}1
-% {elt'}{elt'}1
-% {=}{{\tt=}\,\,}2
-% {+}{{\tt+}\,\,}2,
-literate=
- {isn't }{{{\ttfamily\color{dkgreen} isn't }}}1,
-
-% Comments delimiters, we do turn this off for the manual
-%comment=[s]{(*}{*)},
-
-% Spaces are not displayed as a special character
-showstringspaces=false,
-
-% String delimiters
-morestring=[b]",
-morestring=[d]",
-
-% Size of tabulations
-tabsize=3,
-
-% Enables ASCII chars 128 to 255
-extendedchars=true,
-
-% Case sensitivity
-sensitive=true,
-
-% Automatic breaking of long lines
-breaklines=true,
-
-% Default style fors listings
-basicstyle=\ttfamily,
-
-% Position of captions is bottom
-captionpos=b,
-
-% Full flexible columns
-columns=[l]fullflexible,
-
-% Style for (listings') identifiers
-identifierstyle={\ttfamily\color{black}},
-% Note : highlighting of Coq identifiers is done through a new
-% delimiter definition through an lstset at the begining of the
-% document. Don't know how to do better.
-
-% Style for declaration keywords
-keywordstyle=[1]{\ttfamily\color{dkviolet}},
-
-% Style for gallina keywords
-keywordstyle=[2]{\ttfamily\color{dkgreen}},
-
-% Style for sorts keywords
-keywordstyle=[3]{\ttfamily\color{lightblue}},
-
-% Style for tactics keywords
-keywordstyle=[4]{\ttfamily\color{dkblue}},
-
-% Style for terminators keywords
-keywordstyle=[5]{\ttfamily\color{red}},
-
-
-%Style for iterators
-keywordstyle=[6]{\ttfamily\color{dkpink}},
-
-% Style for strings
-stringstyle=\ttfamily,
-
-% Style for comments
-commentstyle=\rmfamily,
-
-}
diff --git a/doc/refman/coqide-queries.png b/doc/refman/coqide-queries.png
deleted file mode 100644
index 7a46ac4e6..000000000
--- a/doc/refman/coqide-queries.png
+++ /dev/null
Binary files differ
diff --git a/doc/refman/coqide.png b/doc/refman/coqide.png
deleted file mode 100644
index e300401c9..000000000
--- a/doc/refman/coqide.png
+++ /dev/null
Binary files differ
diff --git a/doc/refman/headers.hva b/doc/refman/headers.hva
deleted file mode 100644
index 9714a29be..000000000
--- a/doc/refman/headers.hva
+++ /dev/null
@@ -1,44 +0,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% File headers.hva
-% Hevea version of headers.sty
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Commands for indexes
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\usepackage{index}
-\makeindex
-
-
-\newindex{tactic}{tacidx}{tacind}{Tactics Index}
-\newindex{command}{comidx}{comind}{Vernacular Commands Index}
-\newindex{option}{optidx}{optind}{Vernacular Options Index}
-\newindex{error}{erridx}{errind}{Index of Error Messages}
-\renewindex{default}{idx}{ind}{Global Index}
-
-\newcommand{\printrefmanindex}[3]{%
-\addcontentsline{toc}{chapter}{#2}%
-\printindex[#1]%
-\cutname{#3}%
-}
-
-\newcommand{\tacindex}[1]{%
-\index{#1@\texttt{#1}}\index[tactic]{#1@\texttt{#1}}}
-\newcommand{\comindex}[1]{%
-\index{#1@\texttt{#1}}\index[command]{#1@\texttt{#1}}}
-\newcommand{\optindex}[1]{%
-\index{#1@\texttt{#1}}\index[option]{#1@\texttt{#1}}}
-\newcommand{\errindex}[1]{\texttt{#1}\index[error]{#1}}
-\newcommand{\errindexbis}[2]{\texttt{#1}\index[error]{#2}}
-\newcommand{\ttindex}[1]{\index{#1@\texttt{#1}}}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% For the Addendum table of contents
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newcommand{\aauthor}[1]{{\LARGE \bf #1} \bigskip} % 3 \bigskip's that were here originally
- % may be good for LaTeX but too much for HTML
-\newcommand{\atableofcontents}{}
-\newcommand{\achapter}[1]{\chapter{#1}}
-\newcommand{\asection}{\section}
-\newcommand{\asubsection}{\subsection}
-\newcommand{\asubsubsection}{\subsubsection}
diff --git a/doc/refman/headers.sty b/doc/refman/headers.sty
deleted file mode 100644
index fb39f687d..000000000
--- a/doc/refman/headers.sty
+++ /dev/null
@@ -1,88 +0,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% File headers.sty
-% Commands for pretty headers, multiple indexes, and the appendix.
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\usepackage{fancyhdr}
-
-\setlength{\headheight}{14pt}
-
-\pagestyle{fancyplain}
-
-\newcommand{\coqfooter}{\tiny Coq Reference Manual, V\coqversion{}, \today}
-
-\cfoot{}
-\lfoot[{\coqfooter}]{}
-\rfoot[]{{\coqfooter}}
-
-\newcommand{\setheaders}[1]{\rhead[\fancyplain{}{\textbf{#1}}]{\fancyplain{}{\thepage}}\lhead[\fancyplain{}{\thepage}]{\fancyplain{}{\textbf{#1}}}}
-\newcommand{\defaultheaders}{\rhead[\fancyplain{}{\leftmark}]{\fancyplain{}{\thepage}}\lhead[\fancyplain{}{\thepage}]{\fancyplain{}{\rightmark}}}
-
-\renewcommand{\chaptermark}[1]{\markboth{{\bf \thechapter~#1}}{}}
-\renewcommand{\sectionmark}[1]{\markright{\thesection~#1}}
-\renewcommand{\contentsname}{%
-\protect\setheaders{Table of contents}Table of contents}
-\renewcommand{\bibname}{\protect\setheaders{Bibliography}%
-\protect\RefManCutCommand{BEGINBIBLIO=\thepage}%
-\protect\addcontentsline{toc}{chapter}{Bibliography}Bibliography}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Commands for indexes
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\usepackage{index}
-\makeindex
-
-\newindex{tactic}{tacidx}{tacind}{Tactics Index}
-\newindex{command}{comidx}{comind}{Vernacular Commands Index}
-\newindex{option}{optidx}{optind}{Vernacular Options Index}
-\newindex{error}{erridx}{errind}{Index of Error Messages}
-\renewindex{default}{idx}{ind}{Global Index}
-
-\newcommand{\printrefmanindex}[3]{%
-\cleardoublepage%
-\phantomsection%
-\setheaders{#2}%
-\addcontentsline{toc}{chapter}{#2}%
-\printindex[#1]%
-\cutname{#3}%
-}
-
-\newcommand{\tacindex}[1]{%
-\index{#1@\texttt{#1}}\index[tactic]{#1@\texttt{#1}}}
-\newcommand{\comindex}[1]{%
-\index{#1@\texttt{#1}}\index[command]{#1@\texttt{#1}}}
-\newcommand{\optindex}[1]{%
-\index{#1@\texttt{#1}}\index[option]{#1@\texttt{#1}}}
-\newcommand{\errindex}[1]{\texttt{#1}\index[error]{#1}}
-\newcommand{\errindexbis}[2]{\texttt{#1}\index[error]{#2}}
-\newcommand{\ttindex}[1]{\index{#1@\texttt{#1}}}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% For the Addendum table of contents
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newcommand{\aauthor}[1]{{\LARGE \bf #1} \bigskip \bigskip \bigskip}
-\newcommand{\atableofcontents}{\section*{Contents}\@starttoc{atoc}}
-\newcommand{\achapter}[1]{
- \chapter{#1}\addcontentsline{atoc}{chapter}{#1}}
-\newcommand{\asection}[1]{
- \section{#1}\addcontentsline{atoc}{section}{#1}}
-\newcommand{\asubsection}[1]{
- \subsection{#1}\addcontentsline{atoc}{subsection}{#1}}
-\newcommand{\asubsubsection}[1]{
- \subsubsection{#1}\addcontentsline{atoc}{subsubsection}{#1}}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Reference-Manual.sh is generated to cut the Postscript
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%\@starttoc{sh}
-\newwrite\RefManCut@out%
-\immediate\openout\RefManCut@out\jobname.sh
-\newcommand{\RefManCutCommand}[1]{%
-\immediate\write\RefManCut@out{#1}}
-\newcommand{\RefManCutClose}{%
-\immediate\closeout\RefManCut@out}
-
-
-%%% Local Variables:
-%%% mode: latex
-%%% TeX-master: "Reference-Manual"
-%%% End:
diff --git a/doc/refman/index.html b/doc/refman/index.html
deleted file mode 100644
index b937350e6..000000000
--- a/doc/refman/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<HTML>
-
-<HEAD>
-
-<TITLE>The Coq Proof Assistant Reference Manual</TITLE>
-
-</HEAD>
-
-<FRAMESET ROWS=90%,*>
- <FRAME SRC="cover.html" NAME="UP">
- <FRAME SRC="menu.html">
-</FRAMESET>
-
-</HTML>
diff --git a/doc/refman/menu.html b/doc/refman/menu.html
deleted file mode 100644
index 7312ad344..000000000
--- a/doc/refman/menu.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<HTML>
-
-<BODY>
-
-<CENTER>
-
-<TABLE BORDER="0" CELLPADDING=10>
-<TR>
-<TD><CENTER><A HREF="cover.html" TARGET="UP"><FONT SIZE=2>Cover page</FONT></A></CENTER></TD>
-<TD><CENTER><A HREF="toc.html" TARGET="UP"><FONT SIZE=2>Table of contents</FONT></A></CENTER></TD>
-<TD><CENTER><A HREF="biblio.html" TARGET="UP"><FONT SIZE=2>
-Bibliography</FONT></A></CENTER></TD>
-<TD><CENTER><A HREF="general-index.html" TARGET="UP"><FONT SIZE=2>
-Global Index
-</FONT></A></CENTER></TD>
-<TD><CENTER><A HREF="tactic-index.html" TARGET="UP"><FONT SIZE=2>
-Tactics Index
-</FONT></A></CENTER></TD>
-<TD><CENTER><A HREF="command-index.html" TARGET="UP"><FONT SIZE=2>
-Vernacular Commands Index
-</FONT></A></CENTER></TD>
-<TD><CENTER><A HREF="option-index.html" TARGET="UP"><FONT SIZE=2>
-Vernacular Options Index
-</FONT></A></CENTER></TD>
-<TD><CENTER><A HREF="error-index.html" TARGET="UP"><FONT SIZE=2>
-Index of Error Messages
-</FONT></A></CENTER></TD>
-</TABLE>
-
-</CENTER>
-
-</BODY></HTML>
diff --git a/doc/sphinx/addendum/generalized-rewriting.rst b/doc/sphinx/addendum/generalized-rewriting.rst
index d60387f4f..e4dea3487 100644
--- a/doc/sphinx/addendum/generalized-rewriting.rst
+++ b/doc/sphinx/addendum/generalized-rewriting.rst
@@ -537,14 +537,19 @@ Notice, however, that using the prefixed tactics it is possible to
pass additional arguments such as ``using relation``.
.. tacv:: setoid_reflexivity
+ :name: setoid_reflexivity
.. tacv:: setoid_symmetry [in @ident]
+ :name: setoid_symmetry
.. tacv:: setoid_transitivity
+ :name: setoid_transitivity
.. tacv:: setoid_rewrite [@orientation] @term [at @occs] [in @ident]
+ :name: setoid_rewrite
.. tacv:: setoid_replace @term with @term [in @ident] [using relation @term] [by @tactic]
+ :name: setoid_replace
The ``using relation`` arguments cannot be passed to the unprefixed form.
@@ -583,7 +588,7 @@ Deprecated syntax and backward incompatibilities
Due to backward compatibility reasons, the following syntax for the
declaration of setoids and morphisms is also accepted.
-.. tacv:: Add Setoid @A @Aeq @ST as @ident
+.. cmd:: Add Setoid @A @Aeq @ST as @ident
where ``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
@@ -818,7 +823,8 @@ Usage
~~~~~
-.. tacv:: rewrite_strat @s [in @ident]
+.. tacn:: rewrite_strat @s [in @ident]
+ :name: rewrite_strat
Rewrite using the strategy s in hypothesis ident or the conclusion.
diff --git a/doc/sphinx/addendum/implicit-coercions.rst b/doc/sphinx/addendum/implicit-coercions.rst
index ec1b942e0..c48c2d7ce 100644
--- a/doc/sphinx/addendum/implicit-coercions.rst
+++ b/doc/sphinx/addendum/implicit-coercions.rst
@@ -138,7 +138,7 @@ Declaration of Coercions
.. exn:: @qualid does not respect the uniform inheritance condition
.. exn:: Found target class ... instead of ...
- .. warn:: Ambigous path:
+ .. warn:: Ambiguous path
When the coercion `qualid` is added to the inheritance graph, non
valid coercion paths are ignored; they are signaled by a warning
@@ -218,6 +218,7 @@ declaration, this constructor is declared as a coercion.
Idem but locally to the current section.
.. cmdv:: SubClass @ident := @type.
+ :name: SubClass
If `type` is a class `ident'` applied to some arguments then
`ident` is defined and an identity coercion of name
@@ -255,17 +256,16 @@ Displaying Available Coercions
Activating the Printing of Coercions
-------------------------------------
-.. cmd:: Set Printing Coercions.
+.. opt:: Printing Coercions
- This command forces all the coercions to be printed.
- Conversely, to skip the printing of coercions, use
- ``Unset Printing Coercions``. By default, coercions are not printed.
+ When on, this option forces all the coercions to be printed.
+ By default, coercions are not printed.
-.. cmd:: Add Printing Coercion @qualid.
+.. cmd:: Add Printing Coercion @qualid
- This command forces coercion denoted by `qualid` to be printed.
- To skip the printing of coercion `qualid`, use
- ``Remove Printing Coercion`` `qualid`. By default, a coercion is never printed.
+ This command forces coercion denoted by :n:`@qualid` to be printed. To skip
+ the printing of coercion :n:`@qualid`, use :cmd:`Remove Printing Coercion`. By
+ default, a coercion is never printed.
.. _coercions-classes-as-records:
@@ -291,12 +291,10 @@ by extending the existing :cmd:`Record` macro. Its new syntax is:
(this may fail if the uniform inheritance condition is not
satisfied).
-.. note::
+.. cmdv:: Structure {? >} @ident {? @binders} : @sort := {? @ident} { {+; @ident :{? >} @term } }.
+ :name: Structure
- The keyword ``Structure`` is a synonym of ``Record``.
-
-..
- FIXME: \comindex{Structure}
+ This is a synonym of :cmd:`Record`.
Coercions and Sections
@@ -312,20 +310,17 @@ coercions which do not verify the uniform inheritance condition any longer
are also forgotten.
Coercions and Modules
---------------------=
-
-From |Coq| version 8.3, the coercions present in a module are activated
-only when the module is explicitly imported. Formerly, the coercions
-were activated as soon as the module was required, whatever it was
-imported or not.
-
-To recover the behavior of the versions of |Coq| prior to 8.3, use the
-following command:
+---------------------
-.. cmd:: Set Automatic Coercions Import.
+.. opt:: Automatic Coercions Import
-To cancel the effect of the option, use instead ``Unset Automatic Coercions Import``.
+ Since |Coq| version 8.3, the coercions present in a module are activated
+ only when the module is explicitly imported. Formerly, the coercions
+ were activated as soon as the module was required, whatever it was
+ imported or not.
+ This option makes it possible to recover the behavior of the versions of
+ |Coq| prior to 8.3.
Examples
--------
diff --git a/doc/sphinx/addendum/micromega.rst b/doc/sphinx/addendum/micromega.rst
index e850587c8..4f8cc34d4 100644
--- a/doc/sphinx/addendum/micromega.rst
+++ b/doc/sphinx/addendum/micromega.rst
@@ -13,20 +13,19 @@ tactics for solving arithmetic goals over :math:`\mathbb{Z}`, :math:`\mathbb{Q}`
It also possible to get the tactics for integers by a ``Require Import Lia``,
rationals ``Require Import Lqa`` and reals ``Require Import Lra``.
-+ ``lia`` is a decision procedure for linear integer arithmetic (see Section :ref:`lia <lia>`);
-+ ``nia`` is an incomplete proof procedure for integer non-linear
- arithmetic (see Section :ref:`nia <nia>`);
-+ ``lra`` is a decision procedure for linear (real or rational) arithmetic
- (see Section :ref:`lra <lra>`);
-+ ``nra`` is an incomplete proof procedure for non-linear (real or
- rational) arithmetic (see Section :ref:`nra <nra>`);
-+ ``psatz D n`` where ``D`` is :math:`\mathbb{Z}` or :math:`\mathbb{Q}` or :math:`\mathbb{R}`, and
++ :tacn:`lia` is a decision procedure for linear integer arithmetic;
++ :tacn:`nia` is an incomplete proof procedure for integer non-linear
+ arithmetic;
++ :tacn:`lra` is a decision procedure for linear (real or rational) arithmetic;
++ :tacn:`nra` is an incomplete proof procedure for non-linear (real or
+ rational) arithmetic;
++ :tacn:`psatz` ``D n`` where ``D`` is :math:`\mathbb{Z}` or :math:`\mathbb{Q}` or :math:`\mathbb{R}`, and
``n`` is an optional integer limiting the proof search depth
is an incomplete proof procedure for non-linear arithmetic.
It is based on John Harrison’s HOL Light
driver to the external prover `csdp` [#]_. Note that the `csdp` driver is
generating a *proof cache* which makes it possible to rerun scripts
- even without `csdp` (see Section :ref:`psatz <psatz>`).
+ even without `csdp`.
The tactics solve propositional formulas parameterized by atomic
arithmetic expressions interpreted over a domain :math:`D` ∈ {ℤ, ℚ, ℝ}.
@@ -91,12 +90,13 @@ For each conjunct :math:`C_i`, the tactic calls a oracle which searches for
expression* that is normalized by the ring tactic (see :ref:`theringandfieldtacticfamilies`)
and checked to be :math:`-1`.
-.. _lra:
-
`lra`: a decision procedure for linear real and rational arithmetic
-------------------------------------------------------------------
-The `lra` tactic is searching for *linear* refutations using Fourier
+.. tacn:: lra
+ :name: lra
+
+This tactic is searching for *linear* refutations using Fourier
elimination [#]_. As a result, this tactic explores a subset of the *Cone*
defined as
@@ -107,16 +107,17 @@ The deductive power of `lra` is the combined deductive power of
tactic *e.g.*, :math:`x = 10 * x / 10` is solved by `lra`.
-.. _lia:
-
`lia`: a tactic for linear integer arithmetic
---------------------------------------------
-The tactic lia offers an alternative to the omega and romega tactic
-(see :ref:`omega`). Roughly speaking, the deductive power of lia is
-the combined deductive power of `ring_simplify` and `omega`. However, it
-solves linear goals that `omega` and `romega` do not solve, such as the
-following so-called *omega nightmare* :cite:`TheOmegaPaper`.
+.. tacn:: lia
+ :name: lia
+
+This tactic offers an alternative to the :tacn:`omega` and :tac:`romega`
+tactics. Roughly speaking, the deductive power of lia is the combined deductive
+power of :tacn:`ring_simplify` and :tacn:`omega`. However, it solves linear
+goals that :tacn:`omega` and :tacn:`romega` do not solve, such as the following
+so-called *omega nightmare* :cite:`TheOmegaPaper`.
.. coqtop:: in
@@ -124,8 +125,8 @@ following so-called *omega nightmare* :cite:`TheOmegaPaper`.
27 <= 11 * x + 13 * y <= 45 ->
-10 <= 7 * x - 9 * y <= 4 -> False.
-The estimation of the relative efficiency of `lia` *vs* `omega` and `romega`
-is under evaluation.
+The estimation of the relative efficiency of :tacn:`lia` *vs* :tacn:`omega` and
+:tacn:`romega` is under evaluation.
High level view of `lia`
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -182,12 +183,13 @@ Our current oracle tries to find an expression :math:`e` with a small range
with an equation :math:`e = i` for :math:`i \in [c_1,c_2]` and recursively search for
a proof.
-.. _nra:
-
`nra`: a proof procedure for non-linear arithmetic
--------------------------------------------------
-The `nra` tactic is an *experimental* proof procedure for non-linear
+.. tacn:: nra
+ :name: nra
+
+This tactic is an *experimental* proof procedure for non-linear
arithmetic. The tactic performs a limited amount of non-linear
reasoning before running the linear prover of `lra`. This pre-processing
does the following:
@@ -202,21 +204,23 @@ does the following:
After this pre-processing, the linear prover of `lra` searches for a
proof by abstracting monomials by variables.
-.. _nia:
-
`nia`: a proof procedure for non-linear integer arithmetic
----------------------------------------------------------
-The `nia` tactic is a proof procedure for non-linear integer arithmetic.
+.. tacn:: nia
+ :name: nia
+
+This tactic is a proof procedure for non-linear integer arithmetic.
It performs a pre-processing similar to `nra`. The obtained goal is
solved using the linear integer prover `lia`.
-.. _psatz:
-
`psatz`: a proof procedure for non-linear arithmetic
----------------------------------------------------
-The `psatz` tactic explores the :math:`\mathit{Cone}` by increasing degrees – hence the
+.. tacn:: psatz
+ :name: psatz
+
+This tactic explores the :math:`\mathit{Cone}` by increasing degrees – hence the
depth parameter :math:`n`. In theory, such a proof search is complete – if the
goal is provable the search eventually stops. Unfortunately, the
external oracle is using numeric (approximate) optimization techniques
diff --git a/doc/sphinx/addendum/program.rst b/doc/sphinx/addendum/program.rst
index 1c3fdeb43..be30d1bc4 100644
--- a/doc/sphinx/addendum/program.rst
+++ b/doc/sphinx/addendum/program.rst
@@ -151,7 +151,7 @@ Program Definition
obligations. Once solved using the commands shown below, it binds the
final |Coq| term to the name ``ident`` in the environment.
- .. exn:: ident already exists
+ .. exn:: @ident already exists (Program Definition)
.. cmdv:: Program Definition @ident : @type := @term
@@ -276,6 +276,7 @@ obligations (e.g. when defining mutually recursive blocks). The
optional tactic is replaced by the default one if not specified.
.. cmd:: {? Local|Global} Obligation Tactic := @tactic
+ :name: Obligation Tactic
Sets the default obligation solving tactic applied to all obligations
automatically, whether to solve them or when starting to prove one,
diff --git a/doc/sphinx/addendum/type-classes.rst b/doc/sphinx/addendum/type-classes.rst
index 8861cac8a..3e95bd8c4 100644
--- a/doc/sphinx/addendum/type-classes.rst
+++ b/doc/sphinx/addendum/type-classes.rst
@@ -314,28 +314,25 @@ optional priority can be declared, 0 being the highest priority as for
auto hints. If the priority is not specified, it defaults to the number
of non-dependent binders of the instance.
-Variants:
-
-
-.. cmd:: Instance ident {? @binders} : forall {? @binders}, Class t1 … tn [| priority] := @term
+..cmdv:: Instance @ident {? @binders} : forall {? @binders}, Class t1 … tn [| priority] := @term
This syntax is used for declaration of singleton class instances or
for directly giving an explicit term of type ``forall binders, Class
t1 … tn``. One need not even mention the unique field name for
singleton classes.
-.. cmd:: Global Instance
+..cmdv:: Global Instance
One can use the ``Global`` modifier on instances declared in a
section so that their generalization is automatically redeclared
after the section is closed.
-.. cmd:: Program Instance
+..cmdv:: Program Instance
Switches the type-checking to Program (chapter :ref:`programs`) and
uses the obligation mechanism to manage missing fields.
-.. cmd:: Declare Instance
+..cmdv:: Declare Instance
In a Module Type, this command states that a corresponding concrete
instance should exist in any implementation of thisModule Type. This
@@ -370,14 +367,10 @@ Context
Declares variables according to the given binding context, which might
use :ref:`implicit-generalization`.
+.. tacn:: typeclasses eauto
-.. _typeclasses-eauto:
-
-``typeclasses eauto``
-~~~~~~~~~~~~~~~~~~~~~
-
-The ``typeclasses eauto`` tactic uses a different resolution engine than
-eauto and auto. The main differences are the following:
+This tactic uses a different resolution engine than :tacn:`eauto` and
+:tacn:`auto`. The main differences are the following:
+ Contrary to ``eauto`` and ``auto``, the resolution is done entirely in
the new proof engine (as of Coq v8.6), meaning that backtracking is
@@ -428,118 +421,114 @@ Variants:
typeclass subgoals the same as other subgoals (no shelving of
non-typeclass goals in particular).
-.. _autoapply:
-
-``autoapply term with ident``
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. tacn:: autoapply @term with @ident
+ :name: autoapply
-The tactic autoapply applies a term using the transparency information
-of the hint database ident, and does *no* typeclass resolution. This can
-be used in ``Hint Extern``’s for typeclass instances (in the hint
-database ``typeclass_instances``) to allow backtracking on the typeclass
-subgoals created by the lemma application, rather than doing type class
-resolution locally at the hint application time.
+ The tactic autoapply applies a term using the transparency information
+ of the hint database ident, and does *no* typeclass resolution. This can
+ be used in :cmd:`Hint Extern`’s for typeclass instances (in the hint
+ database ``typeclass_instances``) to allow backtracking on the typeclass
+ subgoals created by the lemma application, rather than doing type class
+ resolution locally at the hint application time.
.. _TypeclassesTransparent:
Typeclasses Transparent, Typclasses Opaque
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. cmd:: Typeclasses { Transparent | Opaque } {+ @ident}
+.. cmd:: Typeclasses Transparent {+ @ident}
- This commands defines the transparency of the given identifiers
- during type class resolution. It is useful when some constants
- prevent some unifications and make resolution fail. It is also useful
- to declare constants which should never be unfolded during
- proof-search, like fixpoints or anything which does not look like an
- abbreviation. This can additionally speed up proof search as the
- typeclass map can be indexed by such rigid constants (see
- :ref:`thehintsdatabasesforautoandeauto`). By default, all constants
- and local variables are considered transparent. One should take care
- not to make opaque any constant that is used to abbreviate a type,
- like:
+ This command defines makes the identifiers transparent during type class
+ resolution.
-::
+ .. cmdv:: Typeclasses Opaque {+ @ident}
+ :name: Typeclasses Opaque
+
+ Make the identifiers opaque for typeclass search. It is useful when some
+ constants prevent some unifications and make resolution fail. It is also
+ useful to declare constants which should never be unfolded during
+ proof-search, like fixpoints or anything which does not look like an
+ abbreviation. This can additionally speed up proof search as the typeclass
+ map can be indexed by such rigid constants (see
+ :ref:`thehintsdatabasesforautoandeauto`).
+
+ By default, all constants and local variables are considered transparent. One
+ should take care not to make opaque any constant that is used to abbreviate a
+ type, like:
- relation A := A -> A -> Prop.
+ ::
-This is equivalent to ``Hint Transparent, Opaque ident : typeclass_instances``.
+ relation A := A -> A -> Prop.
+ This is equivalent to ``Hint Transparent, Opaque ident : typeclass_instances``.
-Set Typeclasses Dependency Order
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-This option (on by default since 8.6) respects the dependency order
-between subgoals, meaning that subgoals which are depended on by other
-subgoals come first, while the non-dependent subgoals were put before
-the dependent ones previously (Coq v8.5 and below). This can result in
-quite different performance behaviors of proof search.
+.. opt:: Typeclasses Dependency Order
+ This option (on by default since 8.6) respects the dependency order
+ between subgoals, meaning that subgoals which are depended on by other
+ subgoals come first, while the non-dependent subgoals were put before
+ the dependent ones previously (Coq v8.5 and below). This can result in
+ quite different performance behaviors of proof search.
-Set Typeclasses Filtered Unification
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-This option, available since Coq 8.6 and off by default, switches the
-hint application procedure to a filter-then-unify strategy. To apply a
-hint, we first check that the goal *matches* syntactically the
-inferred or specified pattern of the hint, and only then try to
-*unify* the goal with the conclusion of the hint. This can drastically
-improve performance by calling unification less often, matching
-syntactic patterns being very quick. This also provides more control
-on the triggering of instances. For example, forcing a constant to
-explicitely appear in the pattern will make it never apply on a goal
-where there is a hole in that place.
+.. opt:: Typeclasses Filtered Unification
+ This option, available since Coq 8.6 and off by default, switches the
+ hint application procedure to a filter-then-unify strategy. To apply a
+ hint, we first check that the goal *matches* syntactically the
+ inferred or specified pattern of the hint, and only then try to
+ *unify* the goal with the conclusion of the hint. This can drastically
+ improve performance by calling unification less often, matching
+ syntactic patterns being very quick. This also provides more control
+ on the triggering of instances. For example, forcing a constant to
+ explicitely appear in the pattern will make it never apply on a goal
+ where there is a hole in that place.
-Set Typeclasses Limit Intros
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. opt:: Typeclasses Limit Intros
-This option (on by default) controls the ability to apply hints while
-avoiding (functional) eta-expansions in the generated proof term. It
-does so by allowing hints that conclude in a product to apply to a
-goal with a matching product directly, avoiding an introduction.
-*Warning:* this can be expensive as it requires rebuilding hint
-clauses dynamically, and does not benefit from the invertibility
-status of the product introduction rule, resulting in potentially more
-expensive proof-search (i.e. more useless backtracking).
+ This option (on by default) controls the ability to apply hints while
+ avoiding (functional) eta-expansions in the generated proof term. It
+ does so by allowing hints that conclude in a product to apply to a
+ goal with a matching product directly, avoiding an introduction.
+ *Warning:* this can be expensive as it requires rebuilding hint
+ clauses dynamically, and does not benefit from the invertibility
+ status of the product introduction rule, resulting in potentially more
+ expensive proof-search (i.e. more useless backtracking).
-Set Typeclass Resolution For Conversion
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. opt:: Typeclass Resolution For Conversion
-This option (on by default) controls the use of typeclass resolution
-when a unification problem cannot be solved during elaboration/type-
-inference. With this option on, when a unification fails, typeclass
-resolution is tried before launching unification once again.
+ This option (on by default) controls the use of typeclass resolution
+ when a unification problem cannot be solved during elaboration/type-
+ inference. With this option on, when a unification fails, typeclass
+ resolution is tried before launching unification once again.
-Set Typeclasses Strict Resolution
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. opt:: Typeclasses Strict Resolution
-Typeclass declarations introduced when this option is set have a
-stricter resolution behavior (the option is off by default). When
-looking for unifications of a goal with an instance of this class, we
-“freeze” all the existentials appearing in the goals, meaning that
-they are considered rigid during unification and cannot be
-instantiated.
+ Typeclass declarations introduced when this option is set have a
+ stricter resolution behavior (the option is off by default). When
+ looking for unifications of a goal with an instance of this class, we
+ “freeze” all the existentials appearing in the goals, meaning that
+ they are considered rigid during unification and cannot be
+ instantiated.
-Set Typeclasses Unique Solutions
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. opt:: Typeclasses Unique Solutions
-When a typeclass resolution is launched we ensure that it has a single
-solution or fail. This ensures that the resolution is canonical, but
-can make proof search much more expensive.
+ When a typeclass resolution is launched we ensure that it has a single
+ solution or fail. This ensures that the resolution is canonical, but
+ can make proof search much more expensive.
-Set Typeclasses Unique Instances
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. opt:: Typeclasses Unique Instances
-Typeclass declarations introduced when this option is set have a more
-efficient resolution behavior (the option is off by default). When a
-solution to the typeclass goal of this class is found, we never
-backtrack on it, assuming that it is canonical.
+ Typeclass declarations introduced when this option is set have a more
+ efficient resolution behavior (the option is off by default). When a
+ solution to the typeclass goal of this class is found, we never
+ backtrack on it, assuming that it is canonical.
Typeclasses eauto `:=`
@@ -562,7 +551,7 @@ Typeclasses eauto `:=`
Set Typeclasses Debug
~~~~~~~~~~~~~~~~~~~~~
-.. cmd:: Set Typeclasses Debug {? Verbosity @num}
+.. opt:: Typeclasses Debug {? Verbosity @num}
These options allow to see the resolution steps of typeclasses that are
performed during search. The ``Debug`` option is synonymous to ``Debug
@@ -570,11 +559,10 @@ Verbosity 1``, and ``Debug Verbosity 2`` provides more information
(tried tactics, shelving of goals, etc…).
-Set Refine Instance Mode
-~~~~~~~~~~~~~~~~~~~~~~~~
+.. opt:: Refine Instance Mode
-The option Refine Instance Mode allows to switch the behavior of
-instance declarations made through the Instance command.
+This options allows to switch the behavior of instance declarations made through
+the Instance command.
+ When it is on (the default), instances that have unsolved holes in
their proof-term silently open the proof mode with the remaining
diff --git a/doc/sphinx/biblio.bib b/doc/sphinx/biblio.bib
index ef50923c7..97231c9ec 100644
--- a/doc/sphinx/biblio.bib
+++ b/doc/sphinx/biblio.bib
@@ -790,8 +790,7 @@ Matching and Term Rewriting},
@TechReport{Leroy90,
author = {X. Leroy},
- title = {The {ZINC} experiment: an economical implementation
-of the {ML} language},
+ title = {The {ZINC} experiment: an economical implementation of the {ML} language},
institution = {INRIA},
number = {117},
year = {1990}
diff --git a/doc/sphinx/credits.rst b/doc/sphinx/credits.rst
index f3d9f57b4..a75659798 100644
--- a/doc/sphinx/credits.rst
+++ b/doc/sphinx/credits.rst
@@ -1373,17 +1373,16 @@ The OPAM repository for |Coq| packages has been maintained by Guillaume
Melquiond, Matthieu Sozeau, Enrico Tassi with contributions from many
users. A list of packages is available at https://coq.inria.fr/opam/www.
-The 40 contributors for this version are Yves Bertot, Joachim
-Breitner, Tej Chajed, Arthur Charguéraud, Jacques-Pascal Deplaix, Maxime
-Dénès, Jim Fehrle, Yannick Forster, Gaëtan Gilbert, Jason Gross, Samuel
-Gruetter, Thomas Hebb, Hugo Herbelin, Jasper Hugunin, Emilio Jesus
-Gallego Arias, Ralf Jung, Johannes Kloos, Matej Košík, Robbert Krebbers,
-Tony Beta Lambda, Vincent Laporte, Pierre Letouzey, Farzon Lotfi,
-Cyprien Mangin, Guillaume Melquiond, Raphaël Monat, Carl Patenaude
-Poulin, Pierre-Marie Pédrot, Matthew Ryan, Matt Quinn, Sigurd Schneider,
-Bernhard Schommer, Matthieu Sozeau, Arnaud Spiwack, Paul Steckler,
-Enrico Tassi, Anton Trunov, Martin Vassor, Vadim Zaliva and Théo
-Zimmermann.
+The 44 contributors for this version are Yves Bertot, Joachim Breitner, Tej
+Chajed, Arthur Charguéraud, Jacques-Pascal Deplaix, Maxime Dénès, Jim Fehrle,
+Julien Forest, Yannick Forster, Gaëtan Gilbert, Jason Gross, Samuel Gruetter,
+Thomas Hebb, Hugo Herbelin, Jasper Hugunin, Emilio Jesus Gallego Arias, Ralf
+Jung, Johannes Kloos, Matej Košík, Robbert Krebbers, Tony Beta Lambda, Vincent
+Laporte, Peter LeFanu Lumsdaine, Pierre Letouzey, Farzon Lotfi, Cyprien Mangin,
+Guillaume Melquiond, Raphaël Monat, Carl Patenaude Poulin, Pierre-Marie Pédrot,
+Clément Pit-Claudel, Matthew Ryan, Matt Quinn, Sigurd Schneider, Bernhard
+Schommer, Michael Soegtrop, Matthieu Sozeau, Arnaud Spiwack, Paul Steckler,
+Enrico Tassi, Anton Trunov, Martin Vassor, Vadim Zaliva and Théo Zimmermann.
Version 8.8 is the third release of |Coq| developed on a time-based
development cycle. Its development spanned 6 months from the release of
diff --git a/doc/sphinx/language/gallina-extensions.rst b/doc/sphinx/language/gallina-extensions.rst
index f474eade7..a93e9b156 100644
--- a/doc/sphinx/language/gallina-extensions.rst
+++ b/doc/sphinx/language/gallina-extensions.rst
@@ -148,7 +148,7 @@ available:
It can be activated for printing with
-.. cmd:: Set Printing Projections.
+.. opt:: Printing Projections
.. example::
@@ -249,7 +249,7 @@ printing of pattern-matching over primitive records.
Primitive Record Types
++++++++++++++++++++++
-When the ``Set Primitive Projections`` option is on, definitions of
+When the :opt:`Primitive Projections` option is on, definitions of
record types change meaning. When a type is declared with primitive
projections, its :g:`match` construct is disabled (see :ref:`primitive_projections` though).
To eliminate the (co-)inductive type, one must use its defined primitive projections.
@@ -328,7 +328,7 @@ patterns are allowed, as in ML-like languages.
The extension just acts as a macro that is expanded during parsing
into a sequence of match on simple patterns. Especially, a
construction defined using the extended match is generally printed
-under its expanded form (see ``Set Printing Matching`` in :ref:`controlling-match-pp`).
+under its expanded form (see :opt:`Printing Matching`).
See also: :ref:`extendedpatternmatching`.
@@ -874,7 +874,7 @@ In the syntax of module application, the ! prefix indicates that any
Starts an interactive module satisfying each `module_type`.
- .. cmdv:: Module @ident {* @module_binding} <: {+<; @module_type }.
+ .. cmdv:: Module @ident {* @module_binding} <: {+<: @module_type }.
Starts an interactive functor with parameters given by the list of `module_binding`. The output module type
is verified against each `module_type`.
@@ -955,7 +955,8 @@ Reserved commands inside an interactive module type:
is a shortcut for the command ``Include`` `module` for each `module`.
-.. cmd:: @assumption_keyword Inline @assums.
+.. cmd:: @assumption_keyword Inline @assums
+ :name: Inline
The instance of this assumption will be automatically expanded at functor application, except when
this functor application is prefixed by a ``!`` annotation.
@@ -1435,7 +1436,9 @@ For instance, the first argument of
in module ``List.v`` is strict because :g:`list` is an inductive type and :g:`A`
will always be inferable from the type :g:`list A` of the third argument of
-:g:`cons`. On the contrary, the second argument of a term of type
+:g:`cons`. Also, the first argument of :g:`cons` is strict with respect to the second one,
+since the first argument is exactly the type of the second argument.
+On the contrary, the second argument of a term of type
::
forall P:nat->Prop, forall n:nat, P n -> ex nat P
@@ -1506,10 +1509,10 @@ inserted. In the second case, the function is considered to be
implicitly applied to the implicit arguments it is waiting for: one
says that the implicit argument is maximally inserted.
-Each implicit argument can be declared to have to be inserted
-maximally or non maximally. This can be governed argument per argument
-by the command ``Implicit Arguments`` (see Section :ref:`declare-implicit-args`) or globally by the
-command ``Set Maximal Implicit Insertion`` (see Section :ref:`controlling-insertion-implicit-args`).
+Each implicit argument can be declared to have to be inserted maximally or non
+maximally. This can be governed argument per argument by the command ``Implicit
+Arguments`` (see Section :ref:`declare-implicit-args`) or globally by the
+:opt:`Maximal Implicit Insertion` option.
See also :ref:`displaying-implicit-args`.
@@ -1882,7 +1885,7 @@ arguments that are not detected as strict implicit arguments. This
“defensive” mode can quickly make the display cumbersome so this can
be deactivated by turning this option off.
-See also: ``Set Printing All`` in :ref:`printing_constructions_full`.
+See also: :opt:`Printing All`.
Interaction with subtyping
~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2134,9 +2137,9 @@ sensitive to the implicit arguments). Turning this option on
deactivates all high-level printing features such as coercions,
implicit arguments, returned type of pattern-matching, notations and
various syntactic sugar for pattern-matching or record projections.
-Otherwise said, ``Set Printing All`` includes the effects of the commands
-``Set Printing Implicit``, ``Set Printing Coercions``, ``Set Printing Synth``,
-``Unset Printing Projections``, and ``Unset Printing Notations``. To reactivate
+Otherwise said, :opt:`Printing All` includes the effects of the options
+:opt:`Printing Implicit`, :opt:`Printing Coercions`, :opt:`Printing Synth`,
+:opt:`Printing Projections`, and :opt:`Printing Notations`. To reactivate
the high-level printing features, use the command ``Unset Printing All``.
.. _printing-universes:
diff --git a/doc/sphinx/language/gallina-specification-language.rst b/doc/sphinx/language/gallina-specification-language.rst
index 246f45b3e..a9c4dd758 100644
--- a/doc/sphinx/language/gallina-specification-language.rst
+++ b/doc/sphinx/language/gallina-specification-language.rst
@@ -557,9 +557,10 @@ has type :token:`type`.
the global context. The fact asserted by *term* is thus assumed as a
postulate.
-.. exn:: @ident already exists
+.. exn:: @ident already exists (Axiom)
.. cmdv:: Parameter @ident : @term.
+ :name: Parameter
Is equivalent to ``Axiom`` :token:`ident` : :token:`term`
@@ -582,6 +583,7 @@ has type :token:`type`.
qualified name to refer to them.
.. cmdv:: Conjecture @ident : @term
+ :name: Conjecture
Is equivalent to ``Axiom`` :token:`ident` : :token:`term`.
@@ -594,7 +596,7 @@ will be unknown and every object using this variable will be explicitly
parametrized (the variable is *discharged*). Using the ``Variable`` command out
of any section is equivalent to using ``Local Parameter``.
-.. exn:: @ident already exists
+.. exn:: @ident already exists (Variable)
.. cmdv:: Variable {+ @ident } : @term.
@@ -607,6 +609,7 @@ of any section is equivalent to using ``Local Parameter``.
.. cmdv:: Variables {+ ( {+ @ident } : @term) }.
.. cmdv:: Hypothesis {+ ( {+ @ident } : @term) }.
+ :name: Hypothesis
.. cmdv:: Hypotheses {+ ( {+ @ident } : @term) }.
@@ -643,7 +646,7 @@ Section :ref:`typing-rules`.
This command binds :token:`term` to the name :token:`ident` in the environment,
provided that :token:`term` is well-typed.
-.. exn:: @ident already exists
+.. exn:: @ident already exists (Definition)
.. cmdv:: Definition @ident : @term := @term.
@@ -687,7 +690,7 @@ prefixed by the let-in definition ``let`` :token:`ident` ``:=`` :token:`term`
``in``. Using the ``Let`` command out of any section is equivalent to using
``Local Definition``.
-.. exn:: @ident already exists
+.. exn:: @ident already exists (Let)
.. cmdv:: Let @ident : @term := @term.
@@ -1245,20 +1248,25 @@ the theorem is bound to the name :token:`ident` in the environment.
.. exn:: The term @term has type @type which should be Set, Prop or Type
-.. exn:: @ident already exists
+.. exn:: @ident already exists (Theorem)
The name you provided is already defined. You have then to choose
another name.
.. cmdv:: Lemma @ident : @type.
+ :name: Lemma
.. cmdv:: Remark @ident : @type.
+ :name: Remark
.. cmdv:: Fact @ident : @type.
+ :name: Fact
.. cmdv:: Corollary @ident : @type.
+ :name: Corollary
.. cmdv:: Proposition @ident : @type.
+ :name: Proposition
These commands are synonyms of ``Theorem`` :token:`ident` : :token:`type`.
@@ -1273,16 +1281,16 @@ the theorem is bound to the name :token:`ident` in the environment.
coinduction has to be done is assumed to be non ambiguous and is guessed by
the system.
- Like in a ``Fixpoint`` or ``CoFixpoint`` definition, the induction hypotheses
- have to be used on *structurally smaller* arguments (for a ``Fixpoint``) or
- be *guarded by a constructor* (for a ``CoFixpoint``). The verification that
+ Like in a :cmd:`Fixpoint` or :cmd:`CoFixpoint` definition, the induction hypotheses
+ have to be used on *structurally smaller* arguments (for a :cmd:`Fixpoint`) or
+ be *guarded by a constructor* (for a :cmd:`CoFixpoint`). The verification that
recursive proof arguments are correct is done only at the time of registering
the lemma in the environment. To know if the use of induction hypotheses is
correct at some time of the interactive development of a proof, use the
command :cmd:`Guarded`.
- The command can be used also with ``Lemma``, ``Remark``, etc. instead of
- ``Theorem``.
+ The command can be used also with :cmd:`Lemma`, :cmd:`Remark`, etc. instead of
+ :cmd:`Theorem`.
.. cmdv:: Definition @ident : @type.
@@ -1313,16 +1321,20 @@ the theorem is bound to the name :token:`ident` in the environment.
This generalizes the syntax of CoFixpoint so that one or more bodies
can be defined interactively using the proof editing mode.
-.. cmd:: Proof. … Qed.
+.. cmd:: Proof
-A proof starts by the keyword Proof. Then Coq enters the proof editing mode
-until the proof is completed. The proof editing mode essentially contains
-tactics that are described in chapter :ref:`Tactics`. Besides tactics, there are
-commands to manage the proof editing mode. They are described in Chapter
-:ref:`proofhandling`. When the proof is completed it should be validated and
-put in the environment using the keyword Qed.
+ A proof starts by the keyword Proof. Then Coq enters the proof editing mode
+ until the proof is completed. The proof editing mode essentially contains
+ tactics that are described in chapter :ref:`Tactics`. Besides tactics, there
+ are commands to manage the proof editing mode. They are described in Chapter
+ :ref:`proofhandling`.
-.. exn:: @ident already exists
+.. cmd:: Qed
+
+ When the proof is completed it should be validated and put in the environment
+ using the keyword Qed.
+
+.. exn:: @ident already exists (Qed)
.. note::
@@ -1341,14 +1353,16 @@ put in the environment using the keyword Qed.
realizing some form of *proof-irrelevance*. To be able to unfold a
proof, the proof should be ended by Defined (see below).
-.. cmdv:: Proof. … Defined.
+.. cmdv:: Defined
+ :name: Defined
- Same as ``Proof. … Qed.`` but the proof is then declared transparent,
- which means that its content can be explicitly used for
- type-checking and that it can be unfolded in conversion tactics
- (see :ref:`performingcomputations`, :cmd:`Opaque`, :cmd:`Transparent`).
+ Same as :cmd:`Qed` but the proof is then declared transparent, which means
+ that its content can be explicitly used for type-checking and that it can be
+ unfolded in conversion tactics (see :ref:`performingcomputations`,
+ :cmd:`Opaque`, :cmd:`Transparent`).
-.. cmdv:: Proof. … Admitted.
+.. cmdv:: Admitted.
+ :name: Admitted
Turns the current asserted statement into an axiom and exits the proof mode.
diff --git a/doc/sphinx/proof-engine/ltac.rst b/doc/sphinx/proof-engine/ltac.rst
index 247d5d899..7ab11889f 100644
--- a/doc/sphinx/proof-engine/ltac.rst
+++ b/doc/sphinx/proof-engine/ltac.rst
@@ -178,6 +178,7 @@ Sequence
A sequence is an expression of the following form:
.. tacn:: @expr ; @expr
+ :name: ;
The expression :n:`@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,
@@ -193,6 +194,7 @@ Different tactics can be applied to the different goals using the
following form:
.. tacn:: [> {*| @expr }]
+ :name: [> ... | ... | ... ] (dispatch)
The expressions :n:`@expr__i` are evaluated to :n:`v__i`, for
i=0,...,n and all have to be tactics. The :n:`v__i` is applied to the
@@ -240,6 +242,7 @@ We can restrict the application of a tactic to a subset of the currently
focused goals with:
.. tacn:: @toplevel_selector : @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``:
@@ -269,6 +272,12 @@ focused goals with:
In this variant, :n:`@expr` is applied to all focused goals. ``all:`` can only
be used at the toplevel of a tactic expression.
+ .. tacv:: !: @expr
+
+ In this variant, if exactly one goal is focused :n:`expr` is
+ applied to it. Otherwise the tactical fails. ``!:`` can only be
+ used at the toplevel of a tactic expression.
+
.. tacv:: par: @expr
In this variant, :n:`@expr` is applied to all focused goals in parallel.
@@ -290,6 +299,7 @@ For loop
There is a for loop that repeats a tactic :token:`num` times:
.. tacn:: do @num @expr
+ :name: do
:n:`@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
@@ -303,6 +313,7 @@ Repeat loop
We have a repeat loop with:
.. tacn:: repeat @expr
+ :name: repeat
:n:`@expr` is evaluated to ``v``. If ``v`` denotes a tactic, this tactic is
applied to each focused goal independently. If the application succeeds, the
@@ -316,6 +327,7 @@ Error catching
We can catch the tactic errors with:
.. tacn:: try @expr
+ :name: try
:n:`@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
@@ -329,6 +341,7 @@ Detecting progress
We can check if a tactic made progress with:
.. tacn:: progress expr
+ :name: progress
:n:`@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``
@@ -343,6 +356,7 @@ Backtracking branching
We can branch with the following structure:
.. tacn:: @expr__1 + @expr__2
+ :name: + (backtracking branching)
:n:`@expr__1` and :n:`@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
@@ -365,6 +379,7 @@ 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}]
+ :name: first
The :n:`@expr__i` are evaluated to :n:`v__i` and :n:`v__i` must be
tactic values, for i=1,...,n. Supposing n>1, it applies, in each focused
@@ -396,6 +411,7 @@ Yet another way of branching without backtracking is the following
structure:
.. tacn:: @expr__1 || @expr__2
+ :name: || (left-biased branching)
:n:`@expr__1` and :n:`@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
@@ -410,6 +426,7 @@ Generalized biased branching
The tactic
.. tacn:: tryif @expr__1 then @expr__2 else @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
@@ -430,6 +447,7 @@ Another way of restricting backtracking is to restrict a tactic to a
single success *a posteriori*:
.. tacn:: once @expr
+ :name: once
:n:`@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,
@@ -443,6 +461,7 @@ Coq provides an experimental way to check that a tactic has *exactly
one* success:
.. tacn:: exactly_once @expr
+ :name: exactly_once
:n:`@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,
@@ -467,6 +486,7 @@ Checking the failure
Coq provides a derived tactic to check that a tactic *fails*:
.. tacn:: assert_fails @expr
+ :name: assert_fails
This behaves like :n:`tryif @expr then fail 0 tac "succeeds" else idtac`.
@@ -477,6 +497,7 @@ Coq provides a derived tactic to check that a tactic has *at least one*
success:
.. tacn:: assert_succeeds @expr
+ :name: assert_suceeds
This behaves like
:n:`tryif (assert_fails tac) then fail 0 tac "fails" else idtac`.
@@ -488,6 +509,7 @@ We may consider the first to solve (i.e. which generates no subgoal)
among a panel of tactics:
.. tacn:: solve [{*| @expr}]
+ :name: solve
The :n:`@expr__i` are evaluated to :n:`v__i` and :n:`v__i` must be
tactic values, for i=1,...,n. Supposing n>1, it applies :n:`v__1` to
@@ -508,6 +530,7 @@ The constant :n:`idtac` is the identity tactic: it leaves any goal unchanged but
it appears in the proof script.
.. tacn:: idtac {* message_token}
+ :name: idtac
This prints the given tokens. Strings and integers are printed
literally. If a (term) variable is given, its contents are printed.
@@ -516,6 +539,7 @@ Failing
~~~~~~~
.. tacn:: fail
+ :name: fail
This is the always-failing tactic: it does not solve any
goal. It is useful for defining other tacticals since it can be caught by
@@ -543,6 +567,7 @@ Failing
This is a combination of the previous variants.
.. tacv:: gfail
+ :name: gfail
This variant fails even if there are no goals left.
@@ -565,6 +590,7 @@ We can force a tactic to stop if it has not finished after a certain
amount of time:
.. tacn:: timeout @num @expr
+ :name: timeout
:n:`@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
@@ -586,6 +612,7 @@ Timing a tactic
A tactic execution can be timed:
.. tacn:: time @string @expr
+ :name: time
evaluates :n:`@expr` and displays the time the tactic expression ran, whether it
fails or successes. In case of several successes, the time for each successive
@@ -600,6 +627,7 @@ Tactic expressions that produce terms can be timed with the experimental
tactic
.. tacn:: time_constr expr
+ :name: time_constr
which evaluates :n:`@expr ()` and displays the time the tactic expression
evaluated, assuming successful evaluation. Time is in seconds and is
@@ -610,10 +638,12 @@ tactic
implemented using the tactics
.. tacn:: restart_timer @string
+ :name: restart_timer
and
.. tacn:: finish_timing {? @string} @string
+ :name: finish_timing
which (re)set and display an optionally named timer, respectively. The
parenthesized string argument to :n:`finish_timing` is also optional, and
@@ -951,6 +981,7 @@ Testing boolean expressions
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tacn:: guard @test
+ :name: guard
The :tacn:`guard` tactic tests a boolean expression, and fails if the expression
evaluates to false. If the expression evaluates to true, it succeeds
@@ -976,6 +1007,7 @@ Proving a subgoal as a separate lemma
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tacn:: abstract @expr
+ :name: abstract
From the outside, :n:`abstract @expr` is the same as :n:`solve @expr`.
Internally it saves an auxiliary lemma called ``ident_subproofn`` where
@@ -1000,6 +1032,7 @@ Proving a subgoal as a separate lemma
don’t play well with asynchronous proofs.
.. tacv:: transparent_abstract @expr
+ :name: transparent_abstract
Save the subproof in a transparent lemma rather than an opaque one.
@@ -1220,28 +1253,33 @@ performance bug.
Unset Ltac Profiling.
.. tacn:: start ltac profiling
+ :name: start ltac profiling
This tactic behaves like :tacn:`idtac` but enables the profiler.
.. tacn:: stop ltac profiling
+ :name: stop ltac profiling
Similarly to :tacn:`start ltac profiling`, this tactic behaves like
:tacn:`idtac`. Together, they allow you to exclude parts of a proof script
from profiling.
.. tacn:: reset ltac profile
+ :name: reset ltac profile
This tactic behaves like the corresponding vernacular command
and allow displaying and resetting the profile from tactic scripts for
benchmarking purposes.
.. tacn:: show ltac profile
+ :name: show ltac profile
This tactic behaves like the corresponding vernacular command
and allow displaying and resetting the profile from tactic scripts for
benchmarking purposes.
.. tacn:: show ltac profile @string
+ :name: show ltac profile
This tactic behaves like the corresponding vernacular command
and allow displaying and resetting the profile from tactic scripts for
@@ -1261,6 +1299,7 @@ Run-time optimization tactic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tacn:: optimize_heap
+ :name: optimize_heap
This tactic behaves like :n:`idtac`, except that running it compacts the
heap in the OCaml run-time system. It is analogous to the Vernacular
diff --git a/doc/sphinx/proof-engine/proof-handling.rst b/doc/sphinx/proof-engine/proof-handling.rst
index a77b127eb..86c94bab3 100644
--- a/doc/sphinx/proof-engine/proof-handling.rst
+++ b/doc/sphinx/proof-engine/proof-handling.rst
@@ -58,13 +58,14 @@ statement is eventually completed and validated, the statement is then
bound to the name ``Unnamed_thm`` (or a variant of this name not already
used for another statement).
-.. cmd:: Qed.
+.. cmd:: Qed
+ :name: Qed (interactive proof)
This command is available in interactive editing proof mode when the
proof is completed. Then ``Qed`` extracts a proof term from the proof
script, switches back to Coq top-level and attaches the extracted
proof term to the declared name of the original goal. This name is
-added to the environment as an ``Opaque`` constant.
+added to the environment as an opaque constant.
.. exn:: Attempt to save an incomplete proof
@@ -81,6 +82,7 @@ a while when the proof is large. In some exceptional cases one may
even incur a memory overflow.
.. cmdv:: Defined.
+ :name: Defined (interactive proof)
Defines the proved term as a transparent constant.
@@ -91,6 +93,7 @@ command (and the following ones) can only be used if the original goal
has been opened using the ``Goal`` command.
.. cmd:: Admitted.
+ :name: Admitted (interactive proof)
This command is available in interactive editing proof mode to give up
the current proof and declare the initial goal as an axiom.
@@ -105,8 +108,8 @@ This command applies in proof editing mode. It is equivalent to
That is, you have to give the full proof in one gulp, as a
proof term (see Section :ref:`applyingtheorems`).
-
.. cmdv:: Proof.
+ :name: Proof (interactive proof)
Is a noop which is useful to delimit the sequence of tactic commands
which start a proof, after a ``Theorem`` command. It is a good practice to
@@ -182,49 +185,51 @@ Proof using options
The following options modify the behavior of ``Proof using``.
-.. cmdv:: Set Default Proof Using "@expression".
+.. opt:: Default Proof Using "@expression".
-Use :n:`@expression` 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``.
+ Use :n:`@expression` 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``.
-.. cmdv:: Set Suggest Proof Using.
+.. opt:: Suggest Proof Using.
-When ``Qed`` is performed, suggest a using annotation if the user did not
-provide one.
+ When ``Qed`` is performed, suggest a using annotation if the user did not
+ provide one.
.. _`nameaset`:
Name a set of section hypotheses for ``Proof using``
````````````````````````````````````````````````````
+.. cmd:: Collection @ident := @section_subset_expr
+
The command ``Collection`` can be used to name a set of section
hypotheses, with the purpose of making ``Proof using`` annotations more
compact.
-.. cmdv:: Collection Some := x y z.
+.. cmdv:: Collection Some := x y z
Define the collection named "Some" containing ``x``, ``y`` and ``z``.
-.. cmdv:: Collection Fewer := Some - z.
+.. cmdv:: Collection Fewer := Some - z
Define the collection named "Fewer" containing only ``x`` and ``y``.
-.. cmdv:: Collection Many := Fewer + Some.
-.. cmdv:: Collection Many := Fewer - Some.
+.. cmdv:: Collection Many := Fewer + Some
+.. cmdv:: Collection Many := Fewer - Some
Define the collection named "Many" containing the set union or set
difference of "Fewer" and "Some".
-.. cmdv:: Collection Many := Fewer - (x y).
+.. cmdv:: Collection Many := Fewer - (x y)
Define the collection named "Many" containing the set difference of
-"Fewer" and the unnamed collection ``x`` ``y``.
+"Fewer" and the unnamed collection ``x`` ``y``
.. cmd:: Abort.
@@ -288,6 +293,7 @@ backtracks one step.
Repeats Undo :n:`@num` times.
.. cmdv:: Restart.
+ :name: Restart
This command restores the proof editing process to the original goal.
@@ -424,11 +430,11 @@ Set Bullet Behavior
The bullet behavior can be controlled by the following commands.
-.. opt:: Bullet Behavior "None".
+.. opt:: Bullet Behavior "None"
This makes bullets inactive.
-.. opt:: Bullet Behavior "Strict Subproofs".
+.. opt:: Bullet Behavior "Strict Subproofs"
This makes bullets active (this is the default behavior).
@@ -551,7 +557,7 @@ Controlling the effect of proof editing commands
------------------------------------------------
-.. opt:: Hyps Limit @num.
+.. opt:: Hyps Limit @num
This option controls the maximum number of hypotheses displayed in goals
after the application of a tactic. All the hypotheses remain usable
@@ -560,7 +566,7 @@ When unset, it goes back to the default mode which is to print all
available hypotheses.
-.. opt:: Automatic Introduction.
+.. opt:: Automatic Introduction
This option controls the way binders are handled
in assertion commands such as ``Theorem ident [binders] : form``. When the
diff --git a/doc/sphinx/proof-engine/ssreflect-proof-language.rst b/doc/sphinx/proof-engine/ssreflect-proof-language.rst
index 074c6f1e2..977a5b8fa 100644
--- a/doc/sphinx/proof-engine/ssreflect-proof-language.rst
+++ b/doc/sphinx/proof-engine/ssreflect-proof-language.rst
@@ -493,7 +493,10 @@ inferred from the whole context of the goal (see for example section
Definitions
~~~~~~~~~~~
-The pose tactic allows to add a defined constant to a proof context.
+.. tacn:: pose
+ :name: pose (ssreflect)
+
+This tactic allows to add a defined constant to a proof context.
|SSR| generalizes this tactic in several ways. In particular, the
|SSR| pose tactic supports *open syntax*: the body of the
definition does not need surrounding parentheses. For instance:
@@ -1349,6 +1352,7 @@ Discharge
The general syntax of the discharging tactical ``:`` is:
.. tacn:: @tactic {? @ident } : {+ @d_item } {? @clear_switch }
+ :name: ... : ... (ssreflect)
.. prodn::
d_item ::= {? @occ_switch %| @clear_switch } @term
@@ -1500,9 +1504,11 @@ side of an equation.
The abstract tactic
```````````````````
-The ``abstract`` tactic assigns an ``abstract`` constant previously
-introduced with the ``[: name ]`` intro pattern
-(see section :ref:`introduction_ssr`).
+.. tacn:: abstract: {+ d_item}
+ :name abstract (ssreflect)
+
+This tactic assigns an abstract constant previously introduced with the ``[:
+name ]`` intro pattern (see section :ref:`introduction_ssr`).
In a goal like the following::
@@ -1809,6 +1815,8 @@ of a :token:`d_item` immediately following this ``/`` switch,
using the syntax:
.. tacv:: case: {+ @d_item } / {+ @d_item }
+ :name: case (ssreflect)
+
.. tacv:: elim: {+ @d_item } / {+ @d_item }
The :token:`d_item` on the right side of the ``/`` switch are discharged as
@@ -2132,7 +2140,7 @@ tactic using the given second tactic, and fails if it does not succeed.
Its analogue
.. tacn:: @tactic ; first by @tactic
- :name: first
+ :name: first (ssreflect)
tries to solve the first subgoal generated by the first tactic using the
second given tactic, and fails if it does not succeed.
@@ -2212,7 +2220,7 @@ Iteration
thanks to the do tactical, whose general syntax is:
.. tacn:: do {? @mult } ( @tactic | [ {+| @tactic } ] )
- :name: do
+ :name: do (ssreflect)
where :token:`mult` is a *multiplier*.
@@ -2749,12 +2757,9 @@ type classes inference.
No inference for ``t``. Unresolved instances are
quantified in the (inferred) type of ``t`` and abstracted in ``t``.
+.. opt:: SsrHave NoTCResolution
-The behavior of |SSR| 1.4 and below (never resolve type classes)
-can be restored with the option
-
-.. cmd:: Set SsrHave NoTCResolution.
-
+ This option restores the behavior of |SSR| 1.4 and below (never resolve type classes).
Variants: the suff and wlog tactics
```````````````````````````````````
@@ -3727,6 +3732,7 @@ We provide a special tactic unlock for unfolding such definitions
while removing “locks”, e.g., the tactic:
.. tacn:: unlock {? @occ_switch } @ident
+ :name: unlock
replaces the occurrence(s) of :token:`ident` coded by the
:token:`occ_switch` with the corresponding body.
diff --git a/doc/sphinx/proof-engine/tactics.rst b/doc/sphinx/proof-engine/tactics.rst
index 08aa7110d..a3d06ae04 100644
--- a/doc/sphinx/proof-engine/tactics.rst
+++ b/doc/sphinx/proof-engine/tactics.rst
@@ -51,20 +51,22 @@ specified, the default selector is used.
tactic_invocation : toplevel_selector : tactic.
: |tactic .
-.. cmd:: Set Default Goal Selector @toplevel_selector.
+.. opt:: Default Goal Selector @toplevel_selector
-After using this command, the default selector – used when no selector
-is specified when applying a tactic – is set to the chosen value. The
-initial value is 1, hence the tactics are, by default, applied to the
-first goal. Using Set Default Goal Selector ‘‘all’’ will make is so
-that tactics are, by default, applied to every goal simultaneously.
-Then, to apply a tactic tac to the first goal only, you can write
-1:tac. Although more selectors are available, only ‘‘all’’ or a single
-natural number are valid default goal selectors.
+ This option controls the default selector, used when no selector is
+ specified when applying a tactic. The initial value is 1, hence the
+ tactics are, by default, applied to the first goal.
-.. cmd:: Test Default Goal Selector.
+ Using value ``all`` will make it so that tactics are, by default,
+ applied to every goal simultaneously. Then, to apply a tactic tac
+ to the first goal only, you can write ``1:tac``.
-This command displays the current default selector.
+ Using value ``!`` enforces that all tactics are used either on a
+ single focused goal or with a local selector (’’strict focusing
+ mode’’).
+
+ Although more selectors are available, only ``all``, ``!`` or a
+ single natural number are valid default goal selectors.
.. _bindingslist:
@@ -123,14 +125,12 @@ following syntax:
The role of an occurrence clause is to select a set of occurrences of a term in
a goal. In the first case, the :n:`@ident {? at {* num}}` parts indicate that
-occurrences have to be selected in the hypotheses named :n:`@ident`. If no numbers
-are given for hypothesis :n:`@ident`, then all the occurrences of `term` in the
-hypothesis are selected. If numbers are given, they refer to occurrences of
-`term` when the term is printed using option ``Set Printing All`` (see
-:ref:`printing_constructions_full`), counting from left to right. In
-particular, occurrences of `term` in implicit arguments (see
-:ref:`ImplicitArguments`) or coercions (see :ref:`Coercions`)
-are counted.
+occurrences have to be selected in the hypotheses named :n:`@ident`. If no
+numbers are given for hypothesis :n:`@ident`, then all the occurrences of `term`
+in the hypothesis are selected. If numbers are given, they refer to occurrences
+of `term` when the term is printed using option :opt:`Printing All`, counting
+from left to right. In particular, occurrences of `term` in implicit arguments
+(see :ref:`ImplicitArguments`) or coercions (see :ref:`Coercions`) are counted.
If a minus sign is given between at and the list of occurrences, it
negates the condition so that the clause denotes all the occurrences
@@ -175,6 +175,7 @@ term of the goal. Let ``T`` be our goal, let ``p`` be a term of type ``U`` then
.. exn:: Not an exact proof.
.. tacv:: eexact @term.
+ :name: eexact
This tactic behaves like exact but is able to handle terms and goals with
meta-variables.
@@ -188,6 +189,7 @@ the goal. If it is the case, the subgoal is proved. Otherwise, it fails.
.. exn:: No such assumption.
.. tacv:: eassumption
+ :name: eassumption
This tactic behaves like assumption but is able to handle goals with
meta-variables.
@@ -240,6 +242,7 @@ useful to advanced users.
cast around it.
.. tacv:: simple refine @term
+ :name: simple refine
This tactic behaves like refine, but it does not shelve any subgoal. It does
not perform any beta-reduction either.
@@ -250,6 +253,7 @@ useful to advanced users.
resolution of typeclasses.
.. tacv:: simple notypeclasses refine @term
+ :name: simple notypeclasses refine
This tactic behaves like ``simple refine`` except it performs typechecking
without resolution of typeclasses.
@@ -320,6 +324,7 @@ instantiate (see :ref:`Existential-Variables`). The instantiation is
intended to be found later in the proof.
.. tacv:: simple apply @term.
+ :name: simple apply
This behaves like ``apply`` but it reasons modulo conversion only on subterms
that contain no variables to instantiate. For instance, the following example
@@ -342,11 +347,12 @@ does.
.. tacv:: {? simple} apply {+, @term {? with @bindings_list}}
.. tacv:: {? simple} eapply {+, @term {? with @bindings_list}}
+ :name: simple eapply
This summarizes the different syntaxes for ``apply`` and ``eapply``.
.. tacv:: lapply @term
- :name: `lapply
+ :name: lapply
This tactic applies to any goal, say :g:`G`. The argument term has to be
well-formed in the current context, its type being reducible to a non-dependent
@@ -437,7 +443,7 @@ sequence ``cut B. 2:apply H.`` where ``cut`` is described below.
``forall A, ... -> A``. Excluding this kind of lemma can be avoided by
setting the following option:
-.. opt:: Set Universal Lemma Under Conjunction.
+.. opt:: Universal Lemma Under Conjunction
This option, which preserves compatibility with versions of Coq prior to
8.4 is also available for :n:`apply @term in @ident` (see :tacn:`apply ... in`).
@@ -522,8 +528,8 @@ sequence ``cut B. 2:apply H.`` where ``cut`` is described below.
constructor of :g:`I`, then ``constructor i`` is equivalent to
``intros; apply c``:sub:`i`.
-.. exn:: Not an inductive product.
-.. exn:: Not enough constructors.
+.. exn:: Not an inductive product
+.. exn:: Not enough constructors
.. tacv:: constructor
@@ -541,34 +547,39 @@ sequence ``cut B. 2:apply H.`` where ``cut`` is described below.
The terms in the @bindings_list are checked in the context where constructor is executed and not in the context where @apply is executed (the introductions are not taken into account).
.. tacv:: split
+ :name: split
This applies only if :g:`I` has a single constructor. It is then
equivalent to :n:`constructor 1.`. It is typically used in the case of a
conjunction :g:`A` :math:`\wedge` :g:`B`.
-.. exn:: Not an inductive goal with 1 constructor.
+.. exn:: Not an inductive goal with 1 constructor
.. tacv:: exists @val
+ :name: exists
This applies only if :g:`I` has a single constructor. It is then equivalent
to :n:`intros; constructor 1 with @bindings_list.` It is typically used in
the case of an existential quantification :math:`\exists`:g:`x, P(x).`
-.. exn:: Not an inductive goal with 1 constructor.
+.. exn:: Not an inductive goal with 1 constructor
.. tacv:: exists @bindings_list
This iteratively applies :n:`exists @bindings_list`.
.. tacv:: left
+ :name: left
+
.. tacv:: right
+ :name: right
These tactics apply only if :g:`I` has two constructors, for
instance in the case of a disjunction :g:`A` :math:`\vee` :g:`B`.
Then, they are respectively equivalent to ``constructor 1`` and
``constructor 2``.
-.. exn:: Not an inductive goal with 2 constructors.
+.. exn:: Not an inductive goal with 2 constructors
.. tacv:: left with @bindings_list
.. tacv:: right with @bindings_list
@@ -579,15 +590,25 @@ sequence ``cut B. 2:apply H.`` where ``cut`` is described below.
for the appropriate ``i``.
.. tacv:: econstructor
+ :name: econstructor
+
.. tacv:: eexists
+ :name: eexists
+
.. tacv:: esplit
+ :name: esplit
+
.. tacv:: eleft
+ :name: eleft
+
.. tacv:: eright
+ :name: eright
- These tactics and their variants behave like ``constructor``, ``exists``,
- ``split``, ``left``, ``right`` and their variants but they introduce
- existential variables instead of failing when the instantiation of a
- variable cannot be found (cf. :tacn:`eapply` and :tacn:`apply`).
+ These tactics and their variants behave like :tacn:`constructor`,
+ :tacn:`exists`, :tacn:`split`, :tacn:`left`, :tacn:`right` and their variants
+ but they introduce existential variables instead of failing when the
+ instantiation of a variable cannot be found (cf. :tacn:`eapply` and
+ :tacn:`apply`).
.. _managingthelocalcontext:
@@ -618,7 +639,7 @@ the tactic ``intro`` applies the tactic ``hnf`` until the tactic ``intro`` can
be applied or the goal is not head-reducible.
.. exn:: No product even after head-reduction.
-.. exn:: ident is already used.
+.. exn:: @ident is already used.
.. tacv:: intros
@@ -829,15 +850,10 @@ quantification or an implication.
so that all the arguments of the i-th constructors of the corresponding
inductive type are introduced can be controlled with the following option:
- .. cmd:: Set Bracketing Last Introduction Pattern.
-
- Force completion, if needed, when the last introduction pattern is a
- disjunctive or conjunctive pattern (this is the default).
-
- .. cmd:: Unset Bracketing Last Introduction Pattern.
+ .. opt:: Bracketing Last Introduction Pattern
- Deactivate completion when the last introduction pattern is a disjunctive or
- conjunctive pattern.
+ Force completion, if needed, when the last introduction pattern is a
+ disjunctive or conjunctive pattern (on by default).
.. tacn:: clear @ident
:name: clear
@@ -857,6 +873,7 @@ quantification or an implication.
This is equivalent to :n:`clear @ident. ... clear @ident.`
.. tacv:: clearbody @ident
+ :name: clearbody
This tactic expects :n:`@ident` to be a local definition then clears its
body. Otherwise said, this tactic turns a definition into an assumption.
@@ -878,7 +895,7 @@ quantification or an implication.
it.
.. tacn:: revert {+ @ident}
- :name: revert ...
+ :name: revert
This applies to any goal with variables :n:`{+ @ident}`. It moves the hypotheses
(possibly defined) to the goal, if this respects dependencies. This tactic is
@@ -994,6 +1011,7 @@ The name of the hypothesis in the proof-term, however, is left unchanged.
.. tacv:: eset (@ident {+ @binder} := @term ) in @goal_occurrences
.. tacv:: eset @term in @goal_occurrences
+ :name: eset
While the different variants of :tacn:`set` expect that no existential
variables are generated by the tactic, :n:`eset` removes this constraint. In
@@ -1001,6 +1019,7 @@ The name of the hypothesis in the proof-term, however, is left unchanged.
:tacn:`epose`, i.e. when the :`@term` does not occur in the goal.
.. tacv:: remember @term as @ident
+ :name: remember
This behaves as :n:`set (@ident:= @term ) in *` and using a logical
(Leibniz’s) equality instead of a local definition.
@@ -1018,6 +1037,8 @@ The name of the hypothesis in the proof-term, however, is left unchanged.
.. tacv:: eremember @term as @ident
.. tacv:: eremember @term as @ident in @goal_occurrences
.. tacv:: eremember @term as @ident eqn:@ident
+ :name: eremember
+
While the different variants of :n:`remember` expect that no existential
variables are generated by the tactic, :n:`eremember` removes this constraint.
@@ -1124,6 +1145,7 @@ Controlling the proof flow
.. exn:: Variable @ident is already declared
.. tacv:: eassert form as intro_pattern by tactic
+ :name: eassert
.. tacv:: assert (@ident := @term)
@@ -1133,6 +1155,7 @@ Controlling the proof flow
to prove it.
.. tacv:: pose proof @term {? as intro_pattern}
+ :name: pose proof
This tactic behaves like :n:`assert T {? as intro_pattern} by exact @term`
where :g:`T` is the type of :g:`term`. In particular,
@@ -1146,6 +1169,7 @@ Controlling the proof flow
the tactic, :n:`epose proof` removes this constraint.
.. tacv:: enough (@ident : form)
+ :name: enough
This adds a new hypothesis of name :n:`@ident` asserting :n:`form` to the
goal the tactic :n:`enough` is applied to. A new subgoal stating :n:`form` is
@@ -1171,13 +1195,17 @@ Controlling the proof flow
applied to all of them.
.. tacv:: eenough (@ident : form) by tactic
+ :name: eenough
+
.. tacv:: eenough form by tactic
+
.. tacv:: eenough form as intro_pattern by tactic
While the different variants of :n:`enough` expect that no existential
variables are generated by the tactic, :n:`eenough` removes this constraint.
-.. tacv:: cut form
+.. tacv:: cut @form
+ :name: cut
This tactic applies to any goal. It implements the non-dependent case of
the “App” rule given in :ref:`typing-rules`. (This is Modus Ponens inference
@@ -1187,6 +1215,7 @@ Controlling the proof flow
.. tacv:: specialize (ident {* @term}) {? as intro_pattern}
.. tacv:: specialize ident with @bindings_list {? as intro_pattern}
+ :name: specialize
The tactic :n:`specialize` works on local hypothesis :n:`@ident`. The
premises of this hypothesis (either universal quantifications or
@@ -1239,7 +1268,7 @@ name of the variable (here :g:`n`) is chosen based on :g:`T`.
This is equivalent to :n:`generalize @term` but it generalizes only over the
specified occurrences of :n:`@term` (counting from left to right on the
- expression printed using option :g:`Set Printing All`).
+ expression printed using option :opt:`Printing All`).
.. tacv:: generalize @term as @ident
@@ -1428,6 +1457,7 @@ analysis on inductive or co-inductive objects (see :ref:`inductive-definitions`)
dependent premises of the type of :n:`@term` (see :ref:`syntax of bindings <bindingslist>`).
.. tacv:: edestruct @term
+ :name: edestruct
This tactic behaves like :n:`destruct @term` except that it does not fail if
the instance of a dependent premises of the type of :n:`@term` is not
@@ -1454,6 +1484,7 @@ analysis on inductive or co-inductive objects (see :ref:`inductive-definitions`)
the effects of the `with`, `as`, `eqn:`, `using`, and `in` clauses.
.. tacv:: case term
+ :name: case
The tactic :n:`case` is a more basic tactic to perform case analysis without
recursion. It behaves as :n:`elim @term` but using a case-analysis
@@ -1463,14 +1494,15 @@ analysis on inductive or co-inductive objects (see :ref:`inductive-definitions`)
Analogous to :n:`elim @term with @bindings_list` above.
-.. tacv:: ecase @term
-.. tacv:: ecase @term with @bindings_list
+.. tacv:: ecase @term {? with @bindings_list }
+ :name: ecase
In case the type of :n:`@term` has dependent premises, or dependent premises
whose values are not inferable from the :n:`with @bindings_list` clause,
:n:`ecase` turns them into existential variables to be resolved later on.
.. tacv:: simple destruct @ident
+ :name: simple destruct
This tactic behaves as :n:`intros until @ident; case @ident` when :n:`@ident`
is a quantified variable of the goal.
@@ -1561,6 +1593,7 @@ analysis on inductive or co-inductive objects (see :ref:`inductive-definitions`)
premises of the type of :n:`term` (see :ref:`bindings list <bindingslist>`).
.. tacv:: einduction @term
+ :name: einduction
This tactic behaves like :tacn:`induction` except that it does not fail if
some dependent premise of the type of :n:`@term` is not inferable. Instead,
@@ -1633,6 +1666,7 @@ analysis on inductive or co-inductive objects (see :ref:`inductive-definitions`)
(see :ref:`bindings list <bindingslist>`).
.. tacv:: eelim @term
+ :name: eelim
In case the type of :n:`@term` has dependent premises, this turns them into
existential variables to be resolved later on.
@@ -1651,7 +1685,8 @@ analysis on inductive or co-inductive objects (see :ref:`inductive-definitions`)
These are the most general forms of ``elim`` and ``eelim``. It combines the
effects of the ``using`` clause and of the two uses of the ``with`` clause.
-.. tacv:: elimtype form
+.. tacv:: elimtype @form
+ :name: elimtype
The argument :n:`form` must be inductively defined. :n:`elimtype I` is
equivalent to :n:`cut I. intro Hn; elim Hn; clear Hn.` Therefore the
@@ -1661,6 +1696,7 @@ analysis on inductive or co-inductive objects (see :ref:`inductive-definitions`)
:n:`elimtype I; 2:exact t.`
.. tacv:: simple induction @ident
+ :name: simple induction
This tactic behaves as :n:`intros until @ident; elim @ident` when
:n:`@ident` is a quantified variable of the goal.
@@ -1745,6 +1781,7 @@ analysis on inductive or co-inductive objects (see :ref:`inductive-definitions`)
other ones need not be further generalized.
.. tacv:: dependent destruction @ident
+ :name: dependent destruction
This performs the generalization of the instance :n:`@ident` but uses
``destruct`` instead of induction on the generalized hypothesis. This gives
@@ -1854,6 +1891,7 @@ See also: :ref:`advanced-recursive-functions`
.. tacv:: ediscriminate @num
.. tacv:: ediscriminate @term {? with @bindings_list}
+ :name: ediscriminate
This works the same as ``discriminate`` but if the type of :n:`@term`, or the
type of the hypothesis referred to by :n:`@num`, has uninstantiated
@@ -1933,6 +1971,7 @@ the use of a sigma type is avoided.
.. tacv:: einjection @num
.. tacv:: einjection @term {? with @bindings_list}
+ :name: einjection
This works the same as :n:`injection` but if the type of :n:`@term`, or the
type of the hypothesis referred to by :n:`@num`, has uninstantiated
@@ -1960,17 +1999,19 @@ the use of a sigma type is avoided.
to the number of new equalities. The original equality is erased if it
corresponds to an hypothesis.
-It is possible to ensure that :n:`injection @term` erases the original
-hypothesis and leaves the generated equalities in the context rather
-than putting them as antecedents of the current goal, as if giving
-:n:`injection @term as` (with an empty list of names). To obtain this
-behavior, the option ``Set Structural Injection`` must be activated. This
-option is off by default.
+.. opt:: Structural Injection
+
+ This option ensure that :n:`injection @term` erases the original hypothesis
+ and leaves the generated equalities in the context rather than putting them
+ as antecedents of the current goal, as if giving :n:`injection @term as`
+ (with an empty list of names). This option is off by default.
+
+.. opt:: Keep Proof Equalities
-By default, ``injection`` only creates new equalities between :n:`@terms` 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 behavior can be
-turned off by setting the option ``Set Keep Proof Equalities``.
+ By default, :tacn:`injection` only creates new equalities between :n:`@terms`
+ 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.
.. tacn:: inversion @ident
:name: inversion
@@ -1996,8 +2037,8 @@ turned off by setting the option ``Set Keep Proof Equalities``.
equalities between expressions that appeared in the hypothesis that is
being processed. By default, no equalities are generated if they
relate two proofs (i.e. equalities between :n:`@terms` whose type is in sort
- :g:`Prop`). This behavior can be turned off by using the option ``Set Keep
- Proof Equalities``.
+ :g:`Prop`). This behavior can be turned off by using the option
+ :opt`Keep Proof Equalities`.
.. tacv:: inversion @num
@@ -2122,6 +2163,7 @@ turned off by setting the option ``Set Keep Proof Equalities``.
:n:`dependent inversion_clear @ident with @term`.
.. tacv:: simple inversion @ident
+ :name: simple inversion
It is a very primitive inversion tactic that derives all the necessary
equalities but it does not simplify the constraints as ``inversion`` does.
@@ -2422,6 +2464,7 @@ subgoals.
leading to failure if these n rewrites are not possible.
.. tacv:: erewrite @term
+ :name: erewrite
This tactic works as :n:`rewrite @term` but turning
unresolved bindings into existential variables, if any, instead of
@@ -2468,6 +2511,7 @@ subgoals.
clause argument must not contain any type of nor value of.
.. tacv:: cutrewrite <- (@term = @term)
+ :cutrewrite:
This tactic is deprecated. It acts like :n:`replace @term with @term`, or,
equivalently as :n:`enough (@term = @term) as <-`.
@@ -2511,30 +2555,30 @@ unfolded and cleared.
context for which an equality of the form :n:`@ident = t` or :n:`t = @ident`
or :n:`@ident := t` exists, with :n:`@ident` not occurring in `t`.
- .. note::
- The behavior of subst can be controlled using option ``Set Regular Subst
- Tactic.`` When this option is activated, subst also deals with the
- following corner cases:
+ .. opt:: Regular Subst Tactic
- + A context with ordered hypotheses :n:`@ident`:sub:`1` :n:`= @ident`:sub:`2`
- and :n:`@ident`:sub:`1` :n:`= t`, or :n:`t′ = @ident`:sub:`1`` with `t′` not
- a variable, and no other hypotheses of the form :n:`@ident`:sub:`2` :n:`= u`
- or :n:`u = @ident`:sub:`2`; without the option, a second call to
- subst would be necessary to replace :n:`@ident`:sub:`2` by `t` or
- `t′` respectively.
- + The presence of a recursive equation which without the option would
- be a cause of failure of :tacn:`subst`.
- + A context with cyclic dependencies as with hypotheses :n:`@ident`:sub:`1` :n:`= f @ident`:sub:`2`
- and :n:`@ident`:sub:`2` :n:`= g @ident`:sub:`1` which without the
- option would be a cause of failure of :tacn:`subst`.
+ This option controls the behavior of :tacn:`subst`. When it is
+ activated, :tacn:`subst` also deals with the following corner cases:
- Additionally, it prevents a local definition such as :n:`@ident := t` to be
- unfolded which otherwise it would exceptionally unfold in configurations
- containing hypotheses of the form :n:`@ident = u`, or :n:`u′ = @ident`
- with `u′` not a variable. Finally, it preserves the initial order of
- hypotheses, which without the option it may break. The option is on by
- default.
+ + A context with ordered hypotheses :n:`@ident`:sub:`1` :n:`= @ident`:sub:`2`
+ and :n:`@ident`:sub:`1` :n:`= t`, or :n:`t′ = @ident`:sub:`1`` with `t′` not
+ a variable, and no other hypotheses of the form :n:`@ident`:sub:`2` :n:`= u`
+ or :n:`u = @ident`:sub:`2`; without the option, a second call to
+ subst would be necessary to replace :n:`@ident`:sub:`2` by `t` or
+ `t′` respectively.
+ + The presence of a recursive equation which without the option would
+ be a cause of failure of :tacn:`subst`.
+ + A context with cyclic dependencies as with hypotheses :n:`@ident`:sub:`1` :n:`= f @ident`:sub:`2`
+ and :n:`@ident`:sub:`2` :n:`= g @ident`:sub:`1` which without the
+ option would be a cause of failure of :tacn:`subst`.
+
+ Additionally, it prevents a local definition such as :n:`@ident := t` to be
+ unfolded which otherwise it would exceptionally unfold in configurations
+ containing hypotheses of the form :n:`@ident = u`, or :n:`u′ = @ident`
+ with `u′` not a variable. Finally, it preserves the initial order of
+ hypotheses, which without the option it may break. The option is on by
+ default.
.. tacn:: stepl @term
@@ -2548,30 +2592,37 @@ where `eq` is typically a setoid equality. The application of :n:`stepl @term`
then replaces the goal by :n:`R @term @term` and adds a new goal stating
:n:`eq @term @term`.
-Lemmas are added to the database using the command ``Declare Left Step @term.``
+.. cmd:: Declare Left Step @term
+
+ Adds :n:`@term` to the database used by :tacn:`stepl`.
+
The tactic is especially useful for parametric setoids which are not accepted
as regular setoids for :tacn:`rewrite` and :tacn:`setoid_replace` (see
:ref:`Generalizedrewriting`).
.. tacv:: stepl @term by tactic
- This applies :n:`stepl @term` then applies tactic to the second goal.
+ This applies :n:`stepl @term` then applies tactic to the second goal.
.. tacv:: stepr @term stepr @term by tactic
+ :name: stepr
+
+ This behaves as :tacn:`stepl` but on the right-hand-side of the binary
+ relation. Lemmas are expected to be of the form :g:`forall x y z, R x y -> eq
+ y z -> R x z`.
- This behaves as :tacn:`stepl` but on the right-hand-side of the binary
- relation. Lemmas are expected to be of the form :g:`forall x y z, R x y -> eq
- y z -> R x z` and are registered using the command ``Declare Right Step
- @term.``
+ .. cmd:: Declare Right Step @term
+
+ Adds :n:`@term` to the database used by :tacn:`stepr`.
.. tacn:: change @term
:name: change
- This tactic applies to any goal. It implements the rule ``Conv`` given in
- :ref:`subtyping-rules`. :g:`change U` replaces the current goal `T`
- with `U` providing that `U` is well-formed and that `T` and `U` are
- convertible.
+ This tactic applies to any goal. It implements the rule ``Conv`` given in
+ :ref:`subtyping-rules`. :g:`change U` replaces the current goal `T`
+ with `U` providing that `U` is well-formed and that `T` and `U` are
+ convertible.
.. exn:: Not convertible
@@ -2709,6 +2760,7 @@ the conversion in hypotheses :n:`{+ @ident}`.
and :n:`lazy beta delta -{+ @qualid} iota zeta`.
.. tacv:: vm_compute
+ :name: vm_compute
This tactic evaluates the goal using the optimized call-by-value evaluation
bytecode-based virtual machine described in :cite:`CompiledStrongReduction`.
@@ -2718,6 +2770,7 @@ the conversion in hypotheses :n:`{+ @ident}`.
reflection-based tactics.
.. tacv:: native_compute
+ :name: native_compute
This tactic evaluates the goal by compilation to Objective Caml as described
in :cite:`FullReduction`. If Coq is running in native code, it can be
@@ -3108,7 +3161,7 @@ the :tacn:`auto` and :tacn:`trivial` tactics:
.. opt:: Info Auto
.. opt:: Debug Auto
.. opt:: Info Trivial
-.. opt:: Info Trivial
+.. opt:: Debug Trivial
See also: :ref:`The Hints Databases for auto and eauto <thehintsdatabasesforautoandeauto>`
@@ -3263,188 +3316,203 @@ observationally different from the legacy one.
The general command to add a hint to some databases :n:`{+ @ident}` is
-.. cmd:: Hint hint_definition : {+ @ident}
+.. cmd:: Hint @hint_definition : {+ @ident}
-**Variants:**
+ .. cmdv:: Hint @hint_definition
-.. cmd:: Hint hint_definition
+ No database name is given: the hint is registered in the core database.
- No database name is given: the hint is registered in the core database.
+ .. cmdv:: Local Hint @hint_definition : {+ @ident}
-.. cmd:: Local Hint hint_definition : {+ @ident}
+ This is used to declare hints that must not be exported to the other modules
+ that require and import the current module. Inside a section, the option
+ Local is useless since hints do not survive anyway to the closure of
+ sections.
- This is used to declare hints that must not be exported to the other modules
- that require and import the current module. Inside a section, the option
- Local is useless since hints do not survive anyway to the closure of
- sections.
+ .. cmdv:: Local Hint @hint_definition
-.. cmd:: Local Hint hint_definition
+ Idem for the core database.
- Idem for the core database.
+ .. cmdv:: Hint Resolve @term {? | {? @num} {? @pattern}}
+ :name: Hint Resolve
-The ``hint_definition`` is one of the following expressions:
+ This command adds :n:`simple apply @term` to the hint list with the head
+ symbol of the type of :n:`@term`. The cost of that hint is the number of
+ subgoals generated by :n:`simple apply @term` or :n:`@num` if specified. The
+ associated :n:`@pattern` is inferred from the conclusion of the type of
+ :n:`@term` or the given :n:`@pattern` if specified. In case the inferred type
+ of :n:`@term` does not start with a product the tactic added in the hint list
+ is :n:`exact @term`. In case this type can however be reduced to a type
+ starting with a product, the tactic :n:`simple apply @term` is also stored in
+ the hints list. If the inferred type of :n:`@term` contains a dependent
+ quantification on a variable which occurs only in the premisses of the type
+ and not in its conclusion, no instance could be inferred for the variable by
+ unification with the goal. In this case, the hint is added to the hint list
+ of :tacn:`eauto` instead of the hint list of auto and a warning is printed. A
+ typical example of a hint that is used only by :tacn:`eauto` is a transitivity
+ lemma.
-+ :n:`Resolve @term {? | {? @num} {? @pattern}}`
- This command adds :n:`simple apply @term` to the hint list with the head symbol of the type of
- :n:`@term`. The cost of that hint is the number of subgoals generated by
- :n:`simple apply @term` or :n:`@num` if specified. The associated :n:`@pattern`
- is inferred from the conclusion of the type of :n:`@term` or the given
- :n:`@pattern` if specified. In case the inferred type of :n:`@term` does not
- start with a product the tactic added in the hint list is :n:`exact @term`.
- In case this type can however be reduced to a type starting with a product,
- the tactic :n:`simple apply @term` is also stored in the hints list. If the
- inferred type of :n:`@term` contains a dependent quantification on a variable
- which occurs only in the premisses of the type and not in its conclusion, no
- instance could be inferred for the variable by unification with the goal. In
- this case, the hint is added to the hint list of :tacn:`eauto` instead of the
- hint list of auto and a warning is printed. A typical example of a hint that
- is used only by ``eauto`` is a transitivity lemma.
+ .. exn:: @term cannot be used as a hint
- .. exn:: @term cannot be used as a hint
+ The head symbol of the type of :n:`@term` is a bound variable such that
+ this tactic cannot be associated to a constant.
- The head symbol of the type of :n:`@term` is a bound variable such that
- this tactic cannot be associated to a constant.
+ .. cmdv:: Hint Resolve {+ @term}
- **Variants:**
+ Adds each :n:`Hint Resolve @term`.
- + :n:`Resolve {+ @term}`
- Adds each :n:`Resolve @term`.
+ .. cmdv:: Hint Resolve -> @term
- + :n:`Resolve -> @term`
- Adds the left-to-right implication of an equivalence as a hint (informally
- the hint will be used as :n:`apply <- @term`, although as mentionned
- before, the tactic actually used is a restricted version of ``apply``).
+ Adds the left-to-right implication of an equivalence as a hint (informally
+ the hint will be used as :n:`apply <- @term`, although as mentionned
+ before, the tactic actually used is a restricted version of
+ :tacn:`apply`).
- + :n:`Resolve <- @term`
- Adds the right-to-left implication of an equivalence as a hint.
+ .. cmdv:: Resolve <- @term
-+ :n:`Immediate @term`
- This command adds :n:`simple apply @term; trivial` to the hint list associated
- with the head symbol of the type of :n:`@ident` in the given database. This
- tactic will fail if all the subgoals generated by :n:`simple apply @term` are
- not solved immediately by the ``trivial`` tactic (which only tries tactics
- with cost 0).This command is useful for theorems such as the symmetry of
- equality or :g:`n+1=m+1 -> n=m` that we may like to introduce with a limited
- use in order to avoid useless proof-search.The cost of this tactic (which
- never generates subgoals) is always 1, so that it is not used by ``trivial``
- itself.
+ Adds the right-to-left implication of an equivalence as a hint.
- .. exn:: @term cannot be used as a hint
+ .. cmdv:: Hint Immediate @term
+ :name: Hint Immediate
- **Variants:**
+ This command adds :n:`simple apply @term; trivial` to the hint list associated
+ with the head symbol of the type of :n:`@ident` in the given database. This
+ tactic will fail if all the subgoals generated by :n:`simple apply @term` are
+ not solved immediately by the ``trivial`` tactic (which only tries tactics
+ with cost 0).This command is useful for theorems such as the symmetry of
+ equality or :g:`n+1=m+1 -> n=m` that we may like to introduce with a limited
+ use in order to avoid useless proof-search. The cost of this tactic (which
+ never generates subgoals) is always 1, so that it is not used by :tacn:`trivial`
+ itself.
- + :n:`Immediate {+ @term}`
- Adds each :n:`Immediate @term`.
+ .. exn:: @term cannot be used as a hint
-+ :n:`Constructors @ident`
- If :n:`@ident` is an inductive type, this command adds all its constructors as
- hints of type Resolve. Then, when the conclusion of current goal has the form
- :n:`(@ident ...)`, ``auto`` will try to apply each constructor.
+ .. cmdv:: Immediate {+ @term}
- .. exn:: @ident is not an inductive type
+ Adds each :n:`Hint Immediate @term`.
- **Variants:**
+ .. cmdv:: Hint Constructors @ident
+ :name: Hint Constructors
- + :n:`Constructors {+ @ident}`
- Adds each :n:`Constructors @ident`.
+ If :n:`@ident` is an inductive type, this command adds all its constructors as
+ hints of type ``Resolve``. Then, when the conclusion of current goal has the form
+ :n:`(@ident ...)`, :tacn:`auto` will try to apply each constructor.
-+ :n:`Unfold @qualid`
- This adds the tactic :n:`unfold @qualid` to the hint list that will only be
- used when the head constant of the goal is :n:`@ident`.
- Its cost is 4.
+ .. exn:: @ident is not an inductive type
- **Variants:**
+ .. cmdv:: Hint Constructors {+ @ident}
- + :n:`Unfold {+ @ident}`
- Adds each :n:`Unfold @ident`.
+ Adds each :n:`Hint Constructors @ident`.
-+ :n:`Transparent`, :n:`Opaque @qualid`
- This adds a transparency hint to the database, making :n:`@qualid` a
- transparent or opaque constant during resolution. This information is used
- during unification of the goal with any lemma in the database and inside the
- discrimination network to relax or constrain it in the case of discriminated
- databases.
+ .. cmdv:: Hint Unfold @qualid
+ :name: Hint Unfold
- **Variants:**
+ This adds the tactic :n:`unfold @qualid` to the hint list that will only be
+ used when the head constant of the goal is :n:`@ident`.
+ Its cost is 4.
- + :n:`Transparent`, :n:`Opaque {+ @ident}`
- Declares each :n:`@ident` as a transparent or opaque constant.
+ .. cmdv:: Hint Unfold {+ @ident}
-+ :n:`Extern @num {? @pattern} => tactic`
- This hint type is to extend ``auto`` with tactics other than ``apply`` and
- ``unfold``. For that, we must specify a cost, an optional :n:`@pattern` and a
- :n:`tactic` to execute. Here is an example::
-
- Hint Extern 4 (~(_ = _)) => discriminate.
-
- Now, when the head of the goal is a disequality, ``auto`` will try
- discriminate if it does not manage to solve the goal with hints with a
- cost less than 4. One can even use some sub-patterns of the pattern in
- the tactic script. A sub-pattern is a question mark followed by an
- identifier, like ``?X1`` or ``?X2``. Here is an example:
-
- .. example::
- .. coqtop:: reset all
-
- Require Import List.
- Hint Extern 5 ({?X1 = ?X2} + {?X1 <> ?X2}) => generalize X1, X2; decide equality : eqdec.
- Goal forall a b:list (nat * nat), {a = b} + {a <> b}.
- Info 1 auto with eqdec.
-
-+ :n:`Cut @regexp`
-
- .. warning:: these hints currently only apply to typeclass
- proof search and the ``typeclasses eauto`` tactic (:ref:`typeclasses-eauto`).
-
- This command can be used to cut the proof-search tree according to a regular
- expression matching paths to be cut. The grammar for regular expressions is
- the following. Beware, there is no operator precedence during parsing, one can
- check with ``Print HintDb`` to verify the current cut expression:
-
- .. productionlist:: `regexp`
- e : ident hint or instance identifier
- :|_ any hint
- :| e\|e′ disjunction
- :| e e′ sequence
- :| e * Kleene star
- :| emp empty
- :| eps epsilon
- :| ( e )
-
- The `emp` regexp does not match any search path while `eps`
- matches the empty path. During proof search, the path of
- successive successful hints on a search branch is recorded, as a
- list of identifiers for the hints (note Hint Extern’s do not have
- an associated identifier).
- Before applying any hint :n:`@ident` the current path `p` extended with
- :n:`@ident` is matched against the current cut expression `c` associated to
- the hint database. If matching succeeds, the hint is *not* applied. The
- semantics of ``Hint Cut e`` is to set the cut expression to ``c | e``, the
- initial cut expression being `emp`.
-
-+ :n:`Mode @qualid {* (+ | ! | -)}`
- This sets an optional mode of use of the identifier :n:`@qualid`. When
- proof-search faces a goal that ends in an application of :n:`@qualid` to
- arguments :n:`@term ... @term`, the mode tells if the hints associated to
- :n:`@qualid` can be applied or not. A mode specification is a list of n ``+``,
- ``!`` or ``-`` items that specify if an argument of the identifier is to be
- treated as an input (``+``), if its head only is an input (``!``) or an output
- (``-``) of the identifier. For a mode to match a list of arguments, input
- terms and input heads *must not* contain existential variables or be
- existential variables respectively, while outputs can be any term. Multiple
- modes can be declared for a single identifier, in that case only one mode
- needs to match the arguments for the hints to be applied.The head of a term
- is understood here as the applicative head, or the match or projection
- scrutinee’s head, recursively, casts being ignored. ``Hint Mode`` is
- especially useful for typeclasses, when one does not want to support default
- instances and avoid ambiguity in general. Setting a parameter of a class as an
- input forces proof-search to be driven by that index of the class, with ``!``
- giving more flexibility by allowing existentials to still appear deeper in the
- index but not at its head.
+ Adds each :n:`Hint Unfold @ident`.
-.. note::
- One can use an ``Extern`` hint with no pattern to do pattern-matching on
- hypotheses using ``match goal`` with inside the tactic.
+ .. cmdv:: Hint %( Transparent %| Opaque %) @qualid
+ :name: Hint ( Transparent | Opaque )
+
+ This adds a transparency hint to the database, making :n:`@qualid` a
+ transparent or opaque constant during resolution. This information is used
+ during unification of the goal with any lemma in the database and inside the
+ discrimination network to relax or constrain it in the case of discriminated
+ databases.
+
+ .. cmdv:: Hint %(Transparent | Opaque) {+ @ident}
+
+ Declares each :n:`@ident` as a transparent or opaque constant.
+
+ .. cmdv:: Hint Extern @num {? @pattern} => tactic
+
+ This hint type is to extend :tacn:`auto` with tactics other than :tacn:`apply` and
+ :tacn:`unfold`. For that, we must specify a cost, an optional :n:`@pattern` and a
+ :n:`@tactic` to execute.
+
+ .. example::
+
+ .. coqtop:: in
+
+ Hint Extern 4 (~(_ = _)) => discriminate.
+
+ Now, when the head of the goal is a disequality, ``auto`` will try
+ discriminate if it does not manage to solve the goal with hints with a
+ cost less than 4. One can even use some sub-patterns of the pattern in
+ the tactic script. A sub-pattern is a question mark followed by an
+ identifier, like ``?X1`` or ``?X2``. Here is an example:
+
+ .. example::
+
+ .. coqtop:: reset all
+
+ Require Import List.
+ Hint Extern 5 ({?X1 = ?X2} + {?X1 <> ?X2}) => generalize X1, X2; decide equality : eqdec.
+ Goal forall a b:list (nat * nat), {a = b} + {a <> b}.
+ Info 1 auto with eqdec.
+
+ .. cmdv:: Hint Cut @regexp
+
+ .. warning::
+
+ These hints currently only apply to typeclass proof search and the
+ :tacn:`typeclasses eauto` tactic.
+
+ This command can be used to cut the proof-search tree according to a regular
+ expression matching paths to be cut. The grammar for regular expressions is
+ the following. Beware, there is no operator precedence during parsing, one can
+ check with :cmd:`Print HintDb` to verify the current cut expression:
+
+ .. productionlist:: `regexp`
+ e : ident hint or instance identifier
+ :|_ any hint
+ :| e\|e′ disjunction
+ :| e e′ sequence
+ :| e * Kleene star
+ :| emp empty
+ :| eps epsilon
+ :| ( e )
+
+ The `emp` regexp does not match any search path while `eps`
+ matches the empty path. During proof search, the path of
+ successive successful hints on a search branch is recorded, as a
+ list of identifiers for the hints (note Hint Extern’s do not have
+ an associated identifier).
+ Before applying any hint :n:`@ident` the current path `p` extended with
+ :n:`@ident` is matched against the current cut expression `c` associated to
+ the hint database. If matching succeeds, the hint is *not* applied. The
+ semantics of ``Hint Cut e`` is to set the cut expression to ``c | e``, the
+ initial cut expression being `emp`.
+
+ .. cmdv:: Hint Mode @qualid {* (+ | ! | -)}
+
+ This sets an optional mode of use of the identifier :n:`@qualid`. When
+ proof-search faces a goal that ends in an application of :n:`@qualid` to
+ arguments :n:`@term ... @term`, the mode tells if the hints associated to
+ :n:`@qualid` can be applied or not. A mode specification is a list of n ``+``,
+ ``!`` or ``-`` items that specify if an argument of the identifier is to be
+ treated as an input (``+``), if its head only is an input (``!``) or an output
+ (``-``) of the identifier. For a mode to match a list of arguments, input
+ terms and input heads *must not* contain existential variables or be
+ existential variables respectively, while outputs can be any term. Multiple
+ modes can be declared for a single identifier, in that case only one mode
+ needs to match the arguments for the hints to be applied.The head of a term
+ is understood here as the applicative head, or the match or projection
+ scrutinee’s head, recursively, casts being ignored. ``Hint Mode`` is
+ especially useful for typeclasses, when one does not want to support default
+ instances and avoid ambiguity in general. Setting a parameter of a class as an
+ input forces proof-search to be driven by that index of the class, with ``!``
+ giving more flexibility by allowing existentials to still appear deeper in the
+ index but not at its head.
+
+ .. note::
+
+ One can use an ``Extern`` hint with no pattern to do pattern-matching on
+ hypotheses using ``match goal`` with inside the tactic.
Hint databases defined in the Coq standard library
@@ -3578,31 +3646,28 @@ We propose a smooth transitional path by providing the ``Loose Hint Behavior``
option which accepts three flags allowing for a fine-grained handling of
non-imported hints.
-**Variants:**
-
-.. cmd:: Set Loose Hint Behavior "Lax"
+.. opt:: Loose Hint Behavior %( "Lax" %| "Warn" %| "Strict" %)
- This is the default, and corresponds to the historical behavior, that
- is, hints defined outside of a section have a global scope.
+ This option accepts three values, which control the behavior of hints w.r.t.
+ :cmd:`Import`:
-.. cmd:: Set Loose Hint Behavior "Warn"
+ - "Lax": this is the default, and corresponds to the historical behavior,
+ that is, hints defined outside of a section have a global scope.
- When set, it outputs a warning when a non-imported hint is used. Note that
- this is an over-approximation, because a hint may be triggered by a run that
- will eventually fail and backtrack, resulting in the hint not being actually
- useful for the proof.
+ - "Warn": outputs a warning when a non-imported hint is used. Note that this
+ is an over-approximation, because a hint may be triggered by a run that
+ will eventually fail and backtrack, resulting in the hint not being
+ actually useful for the proof.
-.. cmd:: Set Loose Hint Behavior "Strict"
-
- When set, it changes the behavior of an unloaded hint to a immediate fail
- tactic, allowing to emulate an import-scoped hint mechanism.
+ - "Strict": changes the behavior of an unloaded hint to a immediate fail
+ tactic, allowing to emulate an import-scoped hint mechanism.
.. _tactics-implicit-automation:
Setting implicit automation tactics
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. cmd:: Proof with tactic
+.. cmd:: Proof with @tactic
This command may be used to start a proof. It defines a default tactic
to be used each time a tactic command ``tactic``:sub:`1` is ended by ``...``.
@@ -3616,11 +3681,11 @@ Setting implicit automation tactics
Combines in a single line ``Proof with`` and ``Proof using``, see :ref:`proof-editing-mode`
- .. cmdv:: Proof using {+ @ident} with tactic
+ .. cmdv:: Proof using {+ @ident} with @tactic
Combines in a single line ``Proof with`` and ``Proof using``, see :ref:`proof-editing-mode`
- .. cmd:: Declare Implicit Tactic tactic
+ .. cmd:: Declare Implicit Tactic @tactic
This command declares a tactic to be used to solve implicit arguments
that Coq does not know how to solve by unification. It is used every
@@ -3684,11 +3749,12 @@ Therefore, the use of :tacn:`intros` in the previous proof is unnecessary.
an instantiation of `x` is necessary.
.. tacv:: dtauto
+ :name: dtauto
- While :tacn:`tauto` recognizes inductively defined connectives isomorphic to
- the standard connective ``and, prod, or, sum, False, Empty_set, unit, True``,
- :tacn:`dtauto` recognizes also all inductive types with one constructors and
- no indices, i.e. record-style connectives.
+ While :tacn:`tauto` recognizes inductively defined connectives isomorphic to
+ the standard connective ``and, prod, or, sum, False, Empty_set, unit, True``,
+ :tacn:`dtauto` recognizes also all inductive types with one constructors and
+ no indices, i.e. record-style connectives.
.. tacn:: intuition @tactic
:name: intuition
@@ -3734,17 +3800,10 @@ some incompatibilities.
Empty_set, unit, True``, :tacn:`dintuition` recognizes also all inductive
types with one constructors and no indices, i.e. record-style connectives.
-Some aspects of the tactic :tacn:`intuition` can be controlled using options.
-To avoid that inner negations which do not need to be unfolded are
-unfolded, use:
-
-.. cmd:: Unset Intuition Negation Unfolding
+.. opt:: Intuition Negation Unfolding
-
-To do that all negations of the goal are unfolded even inner ones
-(this is the default), use:
-
-.. cmd:: Set Intuition Negation Unfolding
+ Controls whether :tacn:`intuition` unfolds inner negations which do not need
+ to be unfolded. This option is on by default.
.. tacn:: rtauto
:name: rtauto
@@ -3768,14 +3827,15 @@ first- order reasoning, written by Pierre Corbineau. It is not restricted to
usual logical connectives but instead may reason about any first-order class
inductive definition.
-The default tactic used by :tacn:`firstorder` when no rule applies is :g:`auto
-with \*`, it can be reset locally or globally using the ``Set Firstorder
-Solver`` tactic vernacular command and printed using ``Print Firstorder
-Solver``.
+.. opt:: Firstorder Solver
+
+ The default tactic used by :tacn:`firstorder` when no rule applies is
+ :g:`auto with *`, it can be reset locally or globally using this option and
+ printed using :cmd:`Print Firstorder Solver`.
.. tacv:: firstorder @tactic
- Tries to solve the goal with :n:`@tactic` when no logical rule may apply.
+ Tries to solve the goal with :n:`@tactic` when no logical rule may apply.
.. tacv:: firstorder using {+ @qualid}
@@ -3792,8 +3852,9 @@ Solver``.
This combines the effects of the different variants of :tacn:`firstorder`.
-Proof-search is bounded by a depth parameter which can be set by
-typing the ``Set Firstorder Depth n`` vernacular command.
+.. opt:: Firstorder Depth @natural
+
+ This option controls the proof-search depth bound.
.. tacn:: congruence
:name: congruence
@@ -4013,6 +4074,7 @@ symbol :g:`=`.
.. tacv:: esimplify_eq @num
.. tacv:: esimplify_eq @term {? with @bindings_list}
+ :name: esimplify_eq
This works the same as ``simplify_eq`` but if the type of :n:`@term`, or the
type of the hypothesis referred to by :n:`@num`, has uninstantiated
@@ -4024,7 +4086,7 @@ symbol :g:`=`.
:n:`intro @ident; simplify_eq @ident`.
.. tacn:: dependent rewrite -> @ident
- :name: dependent rewrite ->
+ :name: dependent rewrite
This tactic applies to any goal. If :n:`@ident` has type
:g:`(existT B a b)=(existT B a' b')` in the local context (i.e. each
@@ -4292,7 +4354,7 @@ This tactics reverses the list of the focused goals.
This tactic moves all goals under focus to a shelf. While on the
shelf, goals will not be focused on. They can be solved by
unification, or they can be called back into focus with the command
- :tacn:`Unshelve`.
+ :cmd:`Unshelve`.
.. tacv:: shelve_unifiable
@@ -4308,8 +4370,7 @@ This tactics reverses the list of the focused goals.
all:shelve_unifiable.
reflexivity.
-.. tacn:: Unshelve
- :name: Unshelve
+.. cmd:: Unshelve
This command moves all the goals on the shelf (see :tacn:`shelve`)
from the shelf into focus, by appending them to the end of the current
diff --git a/doc/sphinx/proof-engine/vernacular-commands.rst b/doc/sphinx/proof-engine/vernacular-commands.rst
index da4034fb8..692ff294a 100644
--- a/doc/sphinx/proof-engine/vernacular-commands.rst
+++ b/doc/sphinx/proof-engine/vernacular-commands.rst
@@ -39,6 +39,7 @@ This is a synonym to ``Print`` :n:`@qualid` when :n:`@qualid`
denotes a global constant.
.. cmdv:: About @qualid.
+ :name: About
This displays various information about the object
denoted by :n:`@qualid`: its kind (module, constant, assumption, inductive,
@@ -61,6 +62,7 @@ Variants:
.. cmdv:: Inspect @num.
+ :name: Inspect
This command displays the :n:`@num` last objects of the
current environment, including sections and modules.
@@ -77,14 +79,11 @@ section.
Flags, Options and Tables
-----------------------------
-|Coq| configurability is based on flags (e.g. ``Set Printing All`` in
-Section :ref:`printing_constructions_full`), options (e.g. ``Set Printing Widthinteger`` in Section
-:ref:`controlling-display`), or tables (e.g. ``Add Printing Record ident``, in Section
-:ref:`record-types`).
-The names of flags, options and tables are made of non-empty sequences of identifiers
-(conventionally with capital initial
-letter). The general commands handling flags, options and tables are
-given below.
+|Coq| configurability is based on flags (e.g. :opt:`Printing All`), options
+(e.g. :opt:`Printing Width`), or tables (e.g. :cmd:`Add Printing Record`). The
+names of flags, options and tables are made of non-empty sequences of
+identifiers (conventionally with capital initial letter). The general commands
+handling flags, options and tables are given below.
.. TODO : flag is not a syntax entry
@@ -93,7 +92,6 @@ given below.
This command switches :n:`@flag` on. The original state of :n:`@flag` is restored
when the current module ends.
-
Variants:
.. cmdv:: Local Set @flag.
@@ -107,6 +105,11 @@ This command switches :n:`@flag` on. The original state
of :n:`@flag` is *not* restored at the end of the module. Additionally, if
set in a file, :n:`@flag` is switched on when the file is `Require`-d.
+.. cmdv:: Export Set @flag.
+
+ This command switches :n:`@flag` on. The original state
+ of :n:`@flag` is restored at the end of the current module, but :n:`@flag`
+ is switched on when this module is imported.
.. cmd:: Unset @flag.
@@ -128,6 +131,11 @@ This command switches :n:`@flag` off. The original
state of :n:`@flag` is *not* restored at the end of the module. Additionally,
if set in a file, :n:`@flag` is switched off when the file is `Require`-d.
+.. cmdv:: Export Unset @flag.
+
+ This command switches :n:`@flag` off. The original state
+ of :n:`@flag` is restored at the end of the current module, but :n:`@flag`
+ is switched off when this module is imported.
.. cmd:: Test @flag.
@@ -157,11 +165,16 @@ original value of :n:`@option` is *not* restored at the end of the module.
Additionally, if set in a file, :n:`@option` is set to value when the file
is `Require`-d.
+.. cmdv:: Export Set @option.
+
+ This command set :n:`@option` to :n:`@value`. The original state
+ of :n:`@option` is restored at the end of the current module, but :n:`@option`
+ is set to :n:`@value` when this module is imported.
.. cmd:: Unset @option.
-This command resets option to its default value.
+ This command turns off :n:`@option`.
Variants:
@@ -169,17 +182,20 @@ Variants:
.. cmdv:: Local Unset @option.
-This command resets :n:`@option` to its default
-value. The original state of :n:`@option` is restored when the current
-*section* ends.
+ This command turns off :n:`@option`. The original state of :n:`@option` is restored when the current
+ *section* ends.
.. cmdv:: Global Unset @option.
-This command resets :n:`@option` to its default
-value. The original state of :n:`@option` is *not* restored at the end of the
-module. Additionally, if unset in a file, :n:`@option` is reset to its
-default value when the file is `Require`-d.
+ This command turns off :n:`@option`. The original state of :n:`@option` is *not* restored at the end of the
+ module. Additionally, if unset in a file, :n:`@option` is reset to its
+ default value when the file is `Require`-d.
+.. cmdv:: Export Unset @option.
+
+ This command turns off :n:`@option`. The original state of :n:`@option` is restored at the end of the
+ current module, but :n:`@option` is set to its default value when this module
+ is imported.
.. cmd:: Test @option.
@@ -190,9 +206,17 @@ This command prints the current value of :n:`@option`.
.. TODO : table is not a syntax entry
.. cmd:: Add @table @value.
+ :name: Add `table` `value`
+
.. cmd:: Remove @table @value.
+ :name: Remove `table` `value`
+
.. cmd:: Test @table @value.
+ :name: Test `table` `value`
+
.. cmd:: Test @table for @value.
+ :name: Test `table` for `value`
+
.. cmd:: Print Table @table.
These are general commands for tables.
@@ -256,11 +280,10 @@ See also: Section :ref:`performingcomputations`.
.. cmd::Extraction @term.
This command displays the extracted term from :n:`@term`. The extraction is
-processed according to the distinction between ``Set`` and ``Prop``; that is
-to say, between logical and computational content (see Section
-:ref:`sorts`). The extracted term is displayed in OCaml
-syntax,
-where global identifiers are still displayed as in |Coq| terms.
+processed according to the distinction between :g:`Set` and :g:`Prop`; that is
+to say, between logical and computational content (see Section :ref:`sorts`).
+The extracted term is displayed in OCaml syntax, where global identifiers are
+still displayed as in |Coq| terms.
Variants:
@@ -698,9 +721,9 @@ The command did not find the
file foo.vo. Either foo.v exists but is not compiled or foo.vo is in a
directory which is not in your LoadPath (see Section :ref:`libraries-and-filesystem`).
-.. exn:: Compiled library ident.vo makes inconsistent assumptions over library qualid
+.. exn:: Compiled library @ident.vo makes inconsistent assumptions over library qualid
-The command tried to load library file `ident.vo` that
+The command tried to load library file :n:`@ident`.vo that
depends on some specific version of library :n:`@qualid` which is not the
one already loaded in the current |Coq| session. Probably `ident.v` was
not properly recompiled with the last version of the file containing
@@ -766,7 +789,7 @@ Error messages:
.. exn:: File not found on loadpath : @string
-.. exn:: Loading of ML object file forbidden in a native |Coq|
+.. exn:: Loading of ML object file forbidden in a native Coq
@@ -1030,16 +1053,13 @@ to |Coq| with the command:
go();;
+.. warning::
-
-Warnings:
-
-
-#. It only works with the bytecode version of |Coq| (i.e. `coqtop.byte`,
- see Section `interactive-use`).
-#. You must have compiled |Coq| from the source package and set the
- environment variable COQTOP to the root of your copy of the sources
- (see Section `customization-by-environment-variables`).
+ #. It only works with the bytecode version of |Coq| (i.e. `coqtop.byte`,
+ see Section `interactive-use`).
+ #. You must have compiled |Coq| from the source package and set the
+ environment variable COQTOP to the root of your copy of the sources
+ (see Section `customization-by-environment-variables`).
@@ -1065,20 +1085,11 @@ expressed in seconds), then it is interrupted and an error message is
displayed.
-.. cmd:: Set Default Timeout @num.
-
-After using this command, all subsequent commands behave as if they
-were passed to a Timeout command. Commands already starting by a
-`Timeout` are unaffected.
-
-
-.. cmd:: Unset Default Timeout.
+.. opt:: Default Timeout @num
-This command turns off the use of a default timeout.
-
-.. cmd:: Test Default Timeout.
-
-This command displays whether some default timeout has been set or not.
+ This option controls a default timeout for subsequent commands, as if they
+ were passed to a :cmd:`Timeout` command. Commands already starting by a
+ :cmd:`Timeout` are unaffected.
.. cmd:: Fail @command.
@@ -1099,128 +1110,58 @@ Error messages:
Controlling display
-----------------------
+.. opt:: Silent
-.. cmd:: Set Silent.
-
-This command turns off the normal displaying.
-
-
-.. cmd:: Unset Silent.
-
-This command turns the normal display on.
-
-.. todo:: check that spaces are handled well
-
-.. cmd:: Set Warnings ‘‘(@ident {* , @ident } )’’.
-
-This command configures the display of warnings. It is experimental,
-and expects, between quotes, a comma-separated list of warning names
-or categories. Adding - in front of a warning or category disables it,
-adding + makes it an error. It is possible to use the special
-categories all and default, the latter containing the warnings enabled
-by default. The flags are interpreted from left to right, so in case
-of an overlap, the flags on the right have higher priority, meaning
-that `A,-A` is equivalent to `-A`.
-
-
-.. cmd:: Set Search Output Name Only.
-
-This command restricts the output of search commands to identifier
-names; turning it on causes invocations of ``Search``, ``SearchHead``,
-``SearchPattern``, ``SearchRewrite`` etc. to omit types from their output,
-printing only identifiers.
-
-
-.. cmd:: Unset Search Output Name Only.
-
-This command turns type display in search results back on.
-
-
-.. cmd:: Set Printing Width @integer.
-
-This command sets which left-aligned part of the width of the screen
-is used for display.
-
-
-.. cmd:: Unset Printing Width.
-
-This command resets the width of the screen used for display to its
-default value (which is 78 at the time of writing this documentation).
-
-
-.. cmd:: Test Printing Width.
-
-This command displays the current screen width used for display.
-
-
-.. cmd:: Set Printing Depth @integer.
-
-This command sets the nesting depth of the formatter used for pretty-
-printing. Beyond this depth, display of subterms is replaced by dots.
-
-
-.. cmd:: Unset Printing Depth.
-
-This command resets the nesting depth of the formatter used for
-pretty-printing to its default value (at the time of writing this
-documentation, the default value is 50).
-
-
-.. cmd:: Test Printing Depth.
-
-This command displays the current nesting depth used for display.
-
-
-.. cmd:: Unset Printing Compact Contexts.
-
-This command resets the displaying of goals contexts to non compact
-mode (default at the time of writing this documentation). Non compact
-means that consecutive variables of different types are printed on
-different lines.
-
-
-.. cmd:: Set Printing Compact Contexts.
-
-This command sets the displaying of goals contexts to compact mode.
-The printer tries to reduce the vertical size of goals contexts by
-putting several variables (even if of different types) on the same
-line provided it does not exceed the printing width (See Set Printing
-Width above).
-
-
-.. cmd:: Test Printing Compact Contexts.
-
-This command displays the current state of compaction of goal.
+ This option controls the normal displaying.
+.. opt:: Warnings "{+, {? %( - %| + %) } @ident }"
-.. cmd:: Unset Printing Unfocused.
+ This option configures the display of warnings. It is experimental, and
+ expects, between quotes, a comma-separated list of warning names or
+ categories. Adding - in front of a warning or category disables it, adding +
+ makes it an error. It is possible to use the special categories all and
+ default, the latter containing the warnings enabled by default. The flags are
+ interpreted from left to right, so in case of an overlap, the flags on the
+ right have higher priority, meaning that `A,-A` is equivalent to `-A`.
-This command resets the displaying of goals to focused goals only
-(default). Unfocused goals are created by focusing other goals with
-bullets (see :ref:`bullets`) or curly braces (see `here <curly-braces>`).
+.. opt:: Search Output Name Only
+ This option restricts the output of search commands to identifier names;
+ turning it on causes invocations of :cmd:`Search`, :cmd:`SearchHead`,
+ :cmd:`SearchPattern`, :cmd:`SearchRewrite` etc. to omit types from their
+ output, printing only identifiers.
-.. cmd:: Set Printing Unfocused.
+.. opt:: Printing Width @integer
-This command enables the displaying of unfocused goals. The goals are
-displayed after the focused ones and are distinguished by a separator.
+ This command sets which left-aligned part of the width of the screen is used
+ for display. At the time of writing this documentation, the default value
+ is 78.
+.. opt:: Printing Depth @integer
-.. cmd:: Test Printing Unfocused.
+ This option controls the nesting depth of the formatter used for pretty-
+ printing. Beyond this depth, display of subterms is replaced by dots. At the
+ time of writing this documentation, the default value is 50.
-This command displays the current state of unfocused goals display.
+.. opt:: Printing Compact Contexts
+ This option controls the compact display mode for goals contexts. When on,
+ the printer tries to reduce the vertical size of goals contexts by putting
+ several variables (even if of different types) on the same line provided it
+ does not exceed the printing width (see :opt:`Printing Width`). At the time
+ of writing this documentation, it is off by default.
-.. cmd:: Set Printing Dependent Evars Line.
+.. opt:: Printing Unfocused
-This command enables the printing of the “(dependent evars: …)” line
-when -emacs is passed.
+ This option controls whether unfocused goals are displayed. Such goals are
+ created by focusing other goals with bullets (see :ref:`bullets` or
+ :ref:`curly braces <curly-braces>`). It is off by default.
+.. opt:: Printing Dependent Evars Line
-.. cmd:: Unset Printing Dependent Evars Line.
+ This option controls the printing of the “(dependent evars: …)” line when
+ ``-emacs`` is passed.
-This command disables the printing of the “(dependent evars: …)” line
-when -emacs is passed.
.. _vernac-controlling-the-reduction-strategies:
@@ -1234,7 +1175,7 @@ conversion algorithm lazily compares applicative terms while the other
is a brute-force but efficient algorithm that first normalizes the
terms before comparing them. The second algorithm is based on a
bytecode representation of terms similar to the bytecode
-representation used in the ZINC virtual machine [`98`]. It is
+representation used in the ZINC virtual machine :cite:`Leroy90`. It is
especially useful for intensive computation of algebraic values, such
as numbers, and for reflection-based tactics. The commands to fine-
tune the reduction strategies and the lazy conversion algorithm are
diff --git a/doc/sphinx/user-extensions/proof-schemes.rst b/doc/sphinx/user-extensions/proof-schemes.rst
index 8a24a382a..e12e4d897 100644
--- a/doc/sphinx/user-extensions/proof-schemes.rst
+++ b/doc/sphinx/user-extensions/proof-schemes.rst
@@ -12,7 +12,7 @@ The ``Scheme`` command is a high-level tool for generating automatically
(possibly mutual) induction principles for given types and sorts. Its
syntax follows the schema:
-.. cmd:: Scheme ident := Induction for ident' Sort sort {* with ident := Induction for ident' Sort sort}
+.. cmd:: Scheme @ident := Induction for @ident Sort sort {* with @ident := Induction for @ident Sort sort}
where each `ident'ᵢ` is a different inductive type identifier
belonging to the same package of mutual inductive definitions. This
@@ -20,17 +20,17 @@ command generates the `identᵢ`s to be mutually recursive
definitions. Each term `identᵢ` proves a general principle of mutual
induction for objects in type `identᵢ`.
-.. cmdv:: Scheme ident := Minimality for ident' Sort sort {* with ident := Minimality for ident' Sort sort}
+.. cmdv:: Scheme @ident := Minimality for @ident Sort sort {* with @ident := Minimality for @ident' Sort sort}
Same as before but defines a non-dependent elimination principle more
natural in case of inductively defined relations.
-.. cmdv:: Scheme Equality for ident
+.. cmdv:: Scheme Equality for @ident
Tries to generate a Boolean equality and a proof of the decidability of the usual equality. If `ident`
involves some other inductive types, their equality has to be defined first.
-.. cmdv:: Scheme Induction for ident Sort sort {* with Induction for ident Sort sort}
+.. cmdv:: Scheme Induction for @ident Sort sort {* with Induction for @ident Sort sort}
If you do not provide the name of the schemes, they will be automatically computed from the
sorts involved (works also with Minimality).
@@ -103,6 +103,8 @@ induction for objects in type `identᵢ`.
Automatic declaration of schemes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. opt:: Elimination Schemes
+
It is possible to deactivate the automatic declaration of the
induction principles when defining a new inductive type with the
``Unset Elimination Schemes`` command. It may be reactivated at any time with
@@ -113,15 +115,22 @@ induction principles when defining a new inductive type with the
This option controls whether types declared with the keywords :cmd:`Variant` and
:cmd:`Record` get an automatic declaration of the induction principles.
-In addition, the ``Case Analysis Schemes`` flag governs the generation of
-case analysis lemmas for inductive types, i.e. corresponding to the
-pattern-matching term alone and without fixpoint.
-You can also activate the automatic declaration of those Boolean
-equalities (see the second variant of ``Scheme``) with respectively the
-commands ``Set Boolean Equality Schemes`` and ``Set Decidable Equality
-Schemes``. However you have to be careful with this option since Coq may
-now reject well-defined inductive types because it cannot compute a
-Boolean equality for them.
+.. opt:: Case Analysis Schemes
+
+ This flag governs the generation of case analysis lemmas for inductive types,
+ i.e. corresponding to the pattern-matching term alone and without fixpoint.
+
+.. opt:: Boolean Equality Schemes
+
+.. opt:: Decidable Equality Schemes
+
+These flags control the automatic declaration of those Boolean equalities (see
+the second variant of ``Scheme``).
+
+.. warning::
+
+ You have to be careful with this option since Coq may now reject well-defined
+ inductive types because it cannot compute a Boolean equality for them.
.. opt:: Rewriting Schemes
@@ -134,7 +143,7 @@ The ``Combined Scheme`` command is a tool for combining induction
principles generated by the ``Scheme command``. Its syntax follows the
schema :
-.. cmd:: Combined Scheme ident from {+, ident}
+.. cmd:: Combined Scheme @ident from {+, ident}
where each identᵢ after the ``from`` is a different inductive principle that must
belong to the same package of mutual inductive principle definitions.
@@ -175,7 +184,7 @@ generating automatically induction principles corresponding to
available via ``Require Import FunInd``. Its syntax then follows the
schema:
-.. cmd:: Functional Scheme ident := Induction for ident' Sort sort {* with ident := Induction for ident' Sort sort}
+.. cmd:: Functional Scheme @ident := Induction for ident' Sort sort {* with @ident := Induction for @ident Sort sort}
where each `ident'ᵢ` is a different mutually defined function
name (the names must be in the same order as when they were defined). This
@@ -316,7 +325,7 @@ Generation of inversion principles with ``Derive`` ``Inversion``
The syntax of ``Derive`` ``Inversion`` follows the schema:
-.. cmd:: Derive Inversion ident with forall (x : T), I t Sort sort
+.. cmd:: Derive Inversion @ident with forall (x : T), I t Sort sort
This command generates an inversion principle for the `inversion … using`
tactic. Let `I` be an inductive predicate and `x` the variables occurring
@@ -325,17 +334,17 @@ sort `sort` corresponding to the instance `∀ (x:T), I t` with the name
`ident` in the global environment. When applied, it is equivalent to
having inverted the instance with the tactic `inversion`.
-.. cmdv:: Derive Inversion_clear ident with forall (x:T), I t Sort sort
+.. cmdv:: Derive Inversion_clear @ident with forall (x:T), I t Sort sort
When applied, it is equivalent to having inverted the instance with the
tactic inversion replaced by the tactic `inversion_clear`.
-.. cmdv:: Derive Dependent Inversion ident with forall (x:T), I t Sort sort
+.. cmdv:: Derive Dependent Inversion @ident with forall (x:T), I t Sort sort
When applied, it is equivalent to having inverted the instance with
the tactic `dependent inversion`.
-.. cmdv:: Derive Dependent Inversion_clear ident with forall(x:T), I t Sort sort
+.. cmdv:: Derive Dependent Inversion_clear @ident with forall(x:T), I t Sort sort
When applied, it is equivalent to having inverted the instance
with the tactic `dependent inversion_clear`.
diff --git a/doc/sphinx/user-extensions/syntax-extensions.rst b/doc/sphinx/user-extensions/syntax-extensions.rst
index 9965d5002..c4a7121ce 100644
--- a/doc/sphinx/user-extensions/syntax-extensions.rst
+++ b/doc/sphinx/user-extensions/syntax-extensions.rst
@@ -32,6 +32,8 @@ Notations
Basic notations
~~~~~~~~~~~~~~~
+.. cmd:: Notation
+
A *notation* is a symbolic expression denoting some term or term
pattern.
@@ -1200,7 +1202,7 @@ Tactic notations allow to customize the syntax of the tactics of the
tactic language. Tactic notations obey the following syntax:
.. productionlist:: coq
- tacn : [Local] Tactic Notation [`tactic_level`] [`prod_item` … `prod_item`] := `tactic`.
+ tacn : Tactic Notation [`tactic_level`] [`prod_item` … `prod_item`] := `tactic`.
prod_item : `string` | `tactic_argument_type`(`ident`)
tactic_level : (at level `natural`)
tactic_argument_type : ident | simple_intropattern | reference
@@ -1211,7 +1213,7 @@ tactic language. Tactic notations obey the following syntax:
: | tactic | tactic0 | tactic1 | tactic2 | tactic3
: | tactic4 | tactic5
-.. cmd:: {? Local} Tactic Notation {? (at level @level)} {+ @prod_item} := @tactic.
+.. cmd:: Tactic Notation {? (at level @level)} {+ @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
diff --git a/engine/engine.mllib b/engine/engine.mllib
index a3614f6c4..a5df5a9fa 100644
--- a/engine/engine.mllib
+++ b/engine/engine.mllib
@@ -2,6 +2,7 @@ Universes
Univops
UState
Nameops
+Evar_kinds
Evd
EConstr
Namegen
diff --git a/intf/evar_kinds.ml b/engine/evar_kinds.ml
index c964ecf1f..c964ecf1f 100644
--- a/intf/evar_kinds.ml
+++ b/engine/evar_kinds.ml
diff --git a/engine/evarutil.ml b/engine/evarutil.ml
index 065b42bf6..710491f84 100644
--- a/engine/evarutil.ml
+++ b/engine/evarutil.ml
@@ -342,7 +342,15 @@ let update_var src tgt subst =
let csubst_var = Id.Map.add id (Constr.mkVar tgt) subst.csubst_var in
{ subst with csubst_var; csubst_rev }
-let push_rel_decl_to_named_context sigma decl (subst, avoid, nc) =
+type naming_mode =
+ | KeepUserNameAndRenameExistingButSectionNames
+ | KeepUserNameAndRenameExistingEvenSectionNames
+ | KeepExistingNames
+ | FailIfConflict
+
+let push_rel_decl_to_named_context
+ ?(hypnaming=KeepUserNameAndRenameExistingButSectionNames)
+ sigma decl (subst, avoid, nc) =
let open EConstr in
let open Vars in
let map_decl f d =
@@ -373,7 +381,9 @@ let push_rel_decl_to_named_context sigma decl (subst, avoid, nc) =
next_ident_away (id_of_name_using_hdchar empty_env sigma (RelDecl.get_type decl) na) avoid
in
match extract_if_neq id na with
- | Some id0 when not (is_section_variable id0) ->
+ | Some id0 when hypnaming = KeepUserNameAndRenameExistingEvenSectionNames ||
+ hypnaming = KeepUserNameAndRenameExistingButSectionNames &&
+ not (is_section_variable id0) ->
(* spiwack: if [id<>id0], rather than introducing a new
binding named [id], we will keep [id0] (the name given
by the user) and rename [id0] into [id] in the named
@@ -382,6 +392,8 @@ let push_rel_decl_to_named_context sigma decl (subst, avoid, nc) =
let d = decl |> NamedDecl.of_rel_decl (fun _ -> id0) |> map_decl (csubst_subst subst) in
let nc = List.map (replace_var_named_declaration id0 id) nc in
(push_var id0 subst, Id.Set.add id avoid, d :: nc)
+ | Some id0 when hypnaming = FailIfConflict ->
+ user_err Pp.(Id.print id0 ++ str " is already used.")
| _ ->
(* spiwack: if [id0] is a section variable renaming it is
incorrect. We revert to a less robust behaviour where
@@ -390,7 +402,7 @@ let push_rel_decl_to_named_context sigma decl (subst, avoid, nc) =
let d = decl |> NamedDecl.of_rel_decl (fun _ -> id) |> map_decl (csubst_subst subst) in
(push_var id subst, Id.Set.add id avoid, d :: nc)
-let push_rel_context_to_named_context env sigma typ =
+let push_rel_context_to_named_context ?hypnaming env sigma typ =
(* compute the instances relative to the named context and rel_context *)
let open Context.Named.Declaration in
let open EConstr in
@@ -405,7 +417,7 @@ let push_rel_context_to_named_context env sigma typ =
(* with vars of the rel context *)
(* We do keep the instances corresponding to local definition (see above) *)
let (subst, _, env) =
- Context.Rel.fold_outside (fun d acc -> push_rel_decl_to_named_context sigma d acc)
+ Context.Rel.fold_outside (fun d acc -> push_rel_decl_to_named_context ?hypnaming sigma d acc)
(rel_context env) ~init:(empty_csubst, avoid, named_context env) in
(val_of_named_context env, csubst_subst subst typ, inst_rels@inst_vars, subst)
@@ -468,8 +480,8 @@ let new_evar_from_context sign evd ?src ?filter ?candidates ?store ?naming ?prin
(* [new_evar] declares a new existential in an env env with type typ *)
(* Converting the env into the sign of the evar to define *)
-let new_evar env evd ?src ?filter ?candidates ?store ?naming ?principal typ =
- let sign,typ',instance,subst = push_rel_context_to_named_context env evd typ in
+let new_evar env evd ?src ?filter ?candidates ?store ?naming ?principal ?hypnaming typ =
+ let sign,typ',instance,subst = push_rel_context_to_named_context ?hypnaming env evd typ in
let map c = csubst_subst subst c in
let candidates = Option.map (fun l -> List.map map l) candidates in
let instance =
@@ -478,13 +490,13 @@ let new_evar env evd ?src ?filter ?candidates ?store ?naming ?principal typ =
| Some filter -> Filter.filter_list filter instance in
new_evar_instance sign evd typ' ?src ?filter ?candidates ?store ?naming ?principal instance
-let new_type_evar env evd ?src ?filter ?naming ?principal rigid =
+let new_type_evar env evd ?src ?filter ?naming ?principal ?hypnaming rigid =
let (evd', s) = new_sort_variable rigid evd in
- let (evd', e) = new_evar env evd' ?src ?filter ?naming ?principal (EConstr.mkSort s) in
+ let (evd', e) = new_evar env evd' ?src ?filter ?naming ?principal ?hypnaming (EConstr.mkSort s) in
evd', (e, s)
-let e_new_type_evar env evdref ?src ?filter ?naming ?principal rigid =
- let (evd, c) = new_type_evar env !evdref ?src ?filter ?naming ?principal rigid in
+let e_new_type_evar env evdref ?src ?filter ?naming ?principal ?hypnaming rigid =
+ let (evd, c) = new_type_evar env !evdref ?src ?filter ?naming ?principal ?hypnaming rigid in
evdref := evd;
c
@@ -498,8 +510,8 @@ let e_new_Type ?(rigid=Evd.univ_flexible) env evdref =
evdref := evd'; EConstr.mkSort s
(* The same using side-effect *)
-let e_new_evar env evdref ?(src=default_source) ?filter ?candidates ?store ?naming ?principal ty =
- let (evd',ev) = new_evar env !evdref ~src:src ?filter ?candidates ?store ?naming ?principal ty in
+let e_new_evar env evdref ?(src=default_source) ?filter ?candidates ?store ?naming ?principal ?hypnaming ty =
+ let (evd',ev) = new_evar env !evdref ~src:src ?filter ?candidates ?store ?naming ?principal ?hypnaming ty in
evdref := evd';
ev
@@ -522,7 +534,7 @@ type clear_dependency_error =
| OccurHypInSimpleClause of Id.t option
| EvarTypingBreak of existential
-exception ClearDependencyError of Id.t * clear_dependency_error
+exception ClearDependencyError of Id.t * clear_dependency_error * Globnames.global_reference option
exception Depends of Id.t
@@ -533,13 +545,13 @@ let rec check_and_clear_in_constr env evdref err ids global c =
is a section variable *)
match kind c with
| Var id' ->
- if Id.Set.mem id' ids then raise (ClearDependencyError (id', err)) else c
+ if Id.Set.mem id' ids then raise (ClearDependencyError (id', err, None)) else c
| ( Const _ | Ind _ | Construct _ ) ->
let () = if global then
let check id' =
if Id.Set.mem id' ids then
- raise (ClearDependencyError (id',err))
+ raise (ClearDependencyError (id',err,Some (Globnames.global_of_constr c)))
in
Id.Set.iter check (Environ.vars_of_global env c)
in
@@ -587,8 +599,8 @@ let rec check_and_clear_in_constr env evdref err ids global c =
let global = Id.Set.exists is_section_variable nids in
let concl = EConstr.Unsafe.to_constr (evar_concl evi) in
check_and_clear_in_constr env evdref (EvarTypingBreak ev) nids global concl
- with ClearDependencyError (rid,err) ->
- raise (ClearDependencyError (Id.Map.find rid rids,err)) in
+ with ClearDependencyError (rid,err,where) ->
+ raise (ClearDependencyError (Id.Map.find rid rids,err,where)) in
if Id.Map.is_empty rids then c
else
diff --git a/engine/evarutil.mli b/engine/evarutil.mli
index 8bb0d2f61..e3e8f16c8 100644
--- a/engine/evarutil.mli
+++ b/engine/evarutil.mli
@@ -30,11 +30,17 @@ val new_evar_from_context :
?naming:Misctypes.intro_pattern_naming_expr ->
?principal:bool -> types -> evar_map * EConstr.t
+type naming_mode =
+ | KeepUserNameAndRenameExistingButSectionNames
+ | KeepUserNameAndRenameExistingEvenSectionNames
+ | KeepExistingNames
+ | FailIfConflict
+
val new_evar :
env -> evar_map -> ?src:Evar_kinds.t Loc.located -> ?filter:Filter.t ->
?candidates:constr list -> ?store:Store.t ->
?naming:Misctypes.intro_pattern_naming_expr ->
- ?principal:bool -> types -> evar_map * EConstr.t
+ ?principal:bool -> ?hypnaming:naming_mode -> types -> evar_map * EConstr.t
val new_pure_evar :
named_context_val -> evar_map -> ?src:Evar_kinds.t Loc.located -> ?filter:Filter.t ->
@@ -49,18 +55,20 @@ val e_new_evar :
env -> evar_map ref -> ?src:Evar_kinds.t Loc.located -> ?filter:Filter.t ->
?candidates:constr list -> ?store:Store.t ->
?naming:Misctypes.intro_pattern_naming_expr ->
- ?principal:bool -> types -> constr
+ ?principal:bool -> ?hypnaming:naming_mode -> types -> constr
(** Create a new Type existential variable, as we keep track of
them during type-checking and unification. *)
val new_type_evar :
env -> evar_map -> ?src:Evar_kinds.t Loc.located -> ?filter:Filter.t ->
- ?naming:Misctypes.intro_pattern_naming_expr -> ?principal:bool -> rigid ->
+ ?naming:Misctypes.intro_pattern_naming_expr ->
+ ?principal:bool -> ?hypnaming:naming_mode -> rigid ->
evar_map * (constr * Sorts.t)
val e_new_type_evar : env -> evar_map ref ->
?src:Evar_kinds.t Loc.located -> ?filter:Filter.t ->
- ?naming:Misctypes.intro_pattern_naming_expr -> ?principal:bool -> rigid -> constr * Sorts.t
+ ?naming:Misctypes.intro_pattern_naming_expr ->
+ ?principal:bool -> ?hypnaming:naming_mode -> rigid -> constr * Sorts.t
val new_Type : ?rigid:rigid -> env -> evar_map -> evar_map * constr
val e_new_Type : ?rigid:rigid -> env -> evar_map ref -> constr
@@ -227,7 +235,7 @@ type clear_dependency_error =
| OccurHypInSimpleClause of Id.t option
| EvarTypingBreak of Constr.existential
-exception ClearDependencyError of Id.t * clear_dependency_error
+exception ClearDependencyError of Id.t * clear_dependency_error * Globnames.global_reference option
val clear_hyps_in_evi : env -> evar_map ref -> named_context_val -> types ->
Id.Set.t -> named_context_val * types
@@ -243,10 +251,11 @@ val csubst_subst : csubst -> constr -> constr
type ext_named_context =
csubst * Id.Set.t * named_context
-val push_rel_decl_to_named_context :
+val push_rel_decl_to_named_context : ?hypnaming:naming_mode ->
evar_map -> rel_declaration -> ext_named_context -> ext_named_context
-val push_rel_context_to_named_context : Environ.env -> evar_map -> types ->
+val push_rel_context_to_named_context : ?hypnaming:naming_mode ->
+ Environ.env -> evar_map -> types ->
named_context_val * types * constr list * csubst
val generalize_evar_over_rels : evar_map -> existential -> types * constr list
diff --git a/engine/universes.ml b/engine/universes.ml
index e5f9212a7..e98708724 100644
--- a/engine/universes.ml
+++ b/engine/universes.ml
@@ -524,8 +524,6 @@ let new_global_univ () =
(** Simplification *)
-module LevelUnionFind = Unionfind.Make (Univ.LSet) (Univ.LMap)
-
let add_list_map u t map =
try
let l = LMap.find u map in
@@ -533,8 +531,6 @@ let add_list_map u t map =
with Not_found ->
LMap.add u [t] map
-module UF = LevelUnionFind
-
(** Precondition: flexible <= ctx *)
let choose_canonical ctx flexible algs s =
let global = LSet.diff s ctx in
@@ -709,6 +705,7 @@ let pr_universe_body = function
let pr_universe_opt_subst = Univ.LMap.pr pr_universe_body
+(* Eq < Le < Lt *)
let compare_constraint_type d d' =
match d, d' with
| Eq, Eq -> 0
@@ -742,10 +739,12 @@ let lower_add l c m =
let lower_of_list l =
List.fold_left (fun acc (d,l) -> LMap.add l d acc) LMap.empty l
+type lbound = { enforce : bool; alg : bool; lbound: Universe.t; lower : lowermap }
+
exception Found of Level.t * lowermap
let find_inst insts v =
- try LMap.iter (fun k (enf,alg,v',lower) ->
- if not alg && enf && Universe.equal v' v then raise (Found (k, lower)))
+ try LMap.iter (fun k {enforce;alg;lbound=v';lower} ->
+ if not alg && enforce && Universe.equal v' v then raise (Found (k, lower)))
insts; raise Not_found
with Found (f,l) -> (f,l)
@@ -765,18 +764,18 @@ let compute_lbound left =
sup (Universe.super l) lbound
else None))
None left
-
-let instantiate_with_lbound u lbound lower alg enforce (ctx, us, algs, insts, cstrs) =
+
+let instantiate_with_lbound u lbound lower ~alg ~enforce (ctx, us, algs, insts, cstrs) =
if enforce then
let inst = Universe.make u in
let cstrs' = enforce_leq lbound inst cstrs in
(ctx, us, LSet.remove u algs,
- LMap.add u (enforce,alg,lbound,lower) insts, cstrs'),
- (enforce, alg, inst, lower)
+ LMap.add u {enforce;alg;lbound;lower} insts, cstrs'),
+ {enforce; alg; lbound=inst; lower}
else (* Actually instantiate *)
(Univ.LSet.remove u ctx, Univ.LMap.add u (Some lbound) us, algs,
- LMap.add u (enforce,alg,lbound,lower) insts, cstrs),
- (enforce, alg, lbound, lower)
+ LMap.add u {enforce;alg;lbound;lower} insts, cstrs),
+ {enforce; alg; lbound; lower}
type constraints_map = (Univ.constraint_type * Univ.LMap.key) list Univ.LMap.t
@@ -790,73 +789,82 @@ let _pr_constraints_map (cmap:constraints_map) =
let remove_alg l (ctx, us, algs, insts, cstrs) =
(ctx, us, LSet.remove l algs, insts, cstrs)
-let remove_lower u lower =
- let levels = Universe.levels u in
- LSet.fold (fun l acc -> LMap.remove l acc) levels lower
-
+let not_lower lower (d,l) =
+ (* We're checking if (d,l) is already implied by the lower
+ constraints on some level u. If it represents l < u (d is Lt
+ or d is Le and i > 0, the i < 0 case is impossible due to
+ invariants of Univ), and the lower constraints only have l <=
+ u then it is not implied. *)
+ Univ.Universe.exists
+ (fun (l,i) ->
+ let d =
+ if i == 0 then d
+ else match d with
+ | Le -> Lt
+ | d -> d
+ in
+ try let d' = LMap.find l lower in
+ (* If d is stronger than the already implied lower
+ * constraints we must keep it. *)
+ compare_constraint_type d d' > 0
+ with Not_found ->
+ (** No constraint existing on l *) true) l
+
+exception UpperBoundedAlg
+(** [enforce_uppers upper lbound cstrs] interprets [upper] as upper
+ constraints to [lbound], adding them to [cstrs].
+
+ @raise UpperBoundedAlg if any [upper] constraints are strict and
+ [lbound] algebraic. *)
+let enforce_uppers upper lbound cstrs =
+ List.fold_left (fun cstrs (d, r) ->
+ if d == Univ.Le then
+ enforce_leq lbound (Universe.make r) cstrs
+ else
+ match Universe.level lbound with
+ | Some lev -> Constraint.add (lev, d, r) cstrs
+ | None -> raise UpperBoundedAlg)
+ cstrs upper
+
let minimize_univ_variables ctx us algs left right cstrs =
let left, lbounds =
Univ.LMap.fold (fun r lower (left, lbounds as acc) ->
if Univ.LMap.mem r us || not (Univ.LSet.mem r ctx) then acc
else (* Fixed universe, just compute its glb for sharing *)
- let lbounds' =
+ let lbounds =
match compute_lbound (List.map (fun (d,l) -> d, Universe.make l) lower) with
| None -> lbounds
- | Some lbound -> LMap.add r (true, false, lbound, lower_of_list lower)
+ | Some lbound -> LMap.add r {enforce=true; alg=false; lbound; lower=lower_of_list lower}
lbounds
- in (Univ.LMap.remove r left, lbounds'))
+ in (Univ.LMap.remove r left, lbounds))
left (left, Univ.LMap.empty)
in
- let rec instance (ctx', us, algs, insts, cstrs as acc) u =
+ let rec instance (ctx, us, algs, insts, cstrs as acc) u =
let acc, left, lower =
- try
- let l = LMap.find u left in
+ match LMap.find u left with
+ | exception Not_found -> acc, [], LMap.empty
+ | l ->
let acc, left, newlow, lower =
List.fold_left
- (fun (acc, left', newlow, lower') (d, l) ->
- let acc', (enf,alg,l',lower) = aux acc l in
+ (fun (acc, left, newlow, lower') (d, l) ->
+ let acc', {enforce=enf;alg;lbound=l';lower} = aux acc l in
let l' =
if enf then Universe.make l
else l'
- in acc', (d, l') :: left',
+ in acc', (d, l') :: left,
lower_add l d newlow, lower_union lower lower')
(acc, [], LMap.empty, LMap.empty) l
in
- let not_lower (d,l) =
- (* We're checking if (d,l) is already implied by the lower
- constraints on some level u. If it represents l < u (d is Lt
- or d is Le and i > 0, the i < 0 case is impossible due to
- invariants of Univ), and the lower constraints only have l <=
- u then it is not implied. *)
- Univ.Universe.exists
- (fun (l,i) ->
- let d =
- if i == 0 then d
- else match d with
- | Le -> Lt
- | d -> d
- in
- try let d' = LMap.find l lower in
- (* If d is stronger than the already implied lower
- * constraints we must keep it. *)
- compare_constraint_type d d' > 0
- with Not_found ->
- (** No constraint existing on l *) true) l
- in
- let left = List.uniquize (List.filter not_lower left) in
+ let left = List.uniquize (List.filter (not_lower lower) left) in
(acc, left, LMap.union newlow lower)
- with Not_found -> acc, [], LMap.empty
- and right =
- try Some (LMap.find u right)
- with Not_found -> None
in
let instantiate_lbound lbound =
let alg = LSet.mem u algs in
if alg then
(* u is algebraic: we instantiate it with its lower bound, if any,
or enforce the constraints if it is bounded from the top. *)
- let lower = remove_lower lbound lower in
- instantiate_with_lbound u lbound lower true false acc
+ let lower = LSet.fold LMap.remove (Universe.levels lbound) lower in
+ instantiate_with_lbound u lbound lower ~alg:true ~enforce:false acc
else (* u is non algebraic *)
match Universe.level lbound with
| Some l -> (* The lowerbound is directly a level *)
@@ -867,125 +875,96 @@ let minimize_univ_variables ctx us algs left right cstrs =
if not (Level.equal l u) then
(* Should check that u does not
have upper constraints that are not already in right *)
- let acc' = remove_alg l acc in
- instantiate_with_lbound u lbound lower false false acc'
- else acc, (true, false, lbound, lower)
+ let acc = remove_alg l acc in
+ instantiate_with_lbound u lbound lower ~alg:false ~enforce:false acc
+ else acc, {enforce=true; alg=false; lbound; lower}
| None ->
- try
- (* Another universe represents the same lower bound,
- we can share them with no harm. *)
- let can, lower = find_inst insts lbound in
- let lower = LMap.remove can lower in
- instantiate_with_lbound u (Universe.make can) lower false false acc
- with Not_found ->
- (* We set u as the canonical universe representing lbound *)
- instantiate_with_lbound u lbound lower false true acc
+ begin match find_inst insts lbound with
+ | can, lower ->
+ (* Another universe represents the same lower bound,
+ we can share them with no harm. *)
+ let lower = LMap.remove can lower in
+ instantiate_with_lbound u (Universe.make can) lower ~alg:false ~enforce:false acc
+ | exception Not_found ->
+ (* We set u as the canonical universe representing lbound *)
+ instantiate_with_lbound u lbound lower ~alg:false ~enforce:true acc
+ end
in
- let acc' acc =
- match right with
- | None -> acc
- | Some cstrs ->
- let dangling = List.filter (fun (d, r) -> not (LMap.mem r us)) cstrs in
- if List.is_empty dangling then acc
- else
- let ((ctx', us, algs, insts, cstrs), (enf,_,inst,lower as b)) = acc in
- let cstrs' = List.fold_left (fun cstrs (d, r) ->
- if d == Univ.Le then
- enforce_leq inst (Universe.make r) cstrs
- else
- try let lev = Option.get (Universe.level inst) in
- Constraint.add (lev, d, r) cstrs
- with Option.IsNone -> failwith "")
- cstrs dangling
- in
- (ctx', us, algs, insts, cstrs'), b
+ let enforce_uppers ((ctx,us,algs,insts,cstrs), b as acc) =
+ match LMap.find u right with
+ | exception Not_found -> acc
+ | upper ->
+ let upper = List.filter (fun (d, r) -> not (LMap.mem r us)) upper in
+ let cstrs = enforce_uppers upper b.lbound cstrs in
+ (ctx, us, algs, insts, cstrs), b
in
- if not (LSet.mem u ctx) then acc' (acc, (true, false, Universe.make u, lower))
- else
- let lbound = compute_lbound left in
- match lbound with
- | None -> (* Nothing to do *)
- acc' (acc, (true, false, Universe.make u, lower))
- | Some lbound ->
- try acc' (instantiate_lbound lbound)
- with Failure _ -> acc' (acc, (true, false, Universe.make u, lower))
- and aux (ctx', us, algs, seen, cstrs as acc) u =
+ if not (LSet.mem u ctx)
+ then enforce_uppers (acc, {enforce=true; alg=false; lbound=Universe.make u; lower})
+ else
+ let lbound = compute_lbound left in
+ match lbound with
+ | None -> (* Nothing to do *)
+ enforce_uppers (acc, {enforce=true;alg=false;lbound=Universe.make u; lower})
+ | Some lbound ->
+ try enforce_uppers (instantiate_lbound lbound)
+ with UpperBoundedAlg ->
+ enforce_uppers (acc, {enforce=true; alg=false; lbound=Universe.make u; lower})
+ and aux (ctx, us, algs, seen, cstrs as acc) u =
try acc, LMap.find u seen
with Not_found -> instance acc u
in
- LMap.fold (fun u v (ctx', us, algs, seen, cstrs as acc) ->
+ LMap.fold (fun u v (ctx, us, algs, seen, cstrs as acc) ->
if v == None then fst (aux acc u)
- else LSet.remove u ctx', us, LSet.remove u algs, seen, cstrs)
+ else LSet.remove u ctx, us, LSet.remove u algs, seen, cstrs)
us (ctx, us, algs, lbounds, cstrs)
let normalize_context_set g ctx us algs weak =
let (ctx, csts) = ContextSet.levels ctx, ContextSet.constraints ctx in
- let uf = UF.create () in
(** Keep the Prop/Set <= i constraints separate for minimization *)
let smallles, csts =
- Constraint.fold (fun (l,d,r as cstr) (smallles, noneqs) ->
- if d == Le then
- if Univ.Level.is_small l then
- if is_set_minimization () && LSet.mem r ctx then
- (Constraint.add cstr smallles, noneqs)
- else (smallles, noneqs)
- else if Level.is_small r then
- if Level.is_prop r then
- raise (Univ.UniverseInconsistency
- (Le,Universe.make l,Universe.make r,None))
- else (smallles, Constraint.add (l,Eq,r) noneqs)
- else (smallles, Constraint.add cstr noneqs)
- else (smallles, Constraint.add cstr noneqs))
- csts (Constraint.empty, Constraint.empty)
+ Constraint.partition (fun (l,d,r) -> d == Le && Level.is_small l) csts
+ in
+ let smallles = if is_set_minimization ()
+ then Constraint.filter (fun (l,d,r) -> LSet.mem r ctx) smallles
+ else Constraint.empty
in
- let csts =
+ let csts, partition =
(* We first put constraints in a normal-form: all self-loops are collapsed
to equalities. *)
- let g = Univ.LSet.fold (fun v g -> UGraph.add_universe v false g)
+ let g = LSet.fold (fun v g -> UGraph.add_universe v false g)
ctx UGraph.initial_universes
in
- let g =
- Univ.Constraint.fold
- (fun (l, d, r) g ->
- let g =
- if not (Level.is_small l || LSet.mem l ctx) then
- try UGraph.add_universe l false g
- with UGraph.AlreadyDeclared -> g
- else g
- in
- let g =
- if not (Level.is_small r || LSet.mem r ctx) then
- try UGraph.add_universe r false g
- with UGraph.AlreadyDeclared -> g
- else g
- in g) csts g
+ let add_soft u g =
+ if not (Level.is_small u || LSet.mem u ctx)
+ then try UGraph.add_universe u false g with UGraph.AlreadyDeclared -> g
+ else g
+ in
+ let g = Constraint.fold
+ (fun (l, d, r) g -> add_soft r (add_soft l g))
+ csts g
in
- let g = Univ.Constraint.fold UGraph.enforce_constraint csts g in
+ let g = UGraph.merge_constraints csts g in
UGraph.constraints_of_universes g
in
+ (* We ignore the trivial Prop/Set <= i constraints. *)
let noneqs =
- Constraint.fold (fun (l,d,r as cstr) noneqs ->
- if d == Eq then (UF.union l r uf; noneqs)
- else (* We ignore the trivial Prop/Set <= i constraints. *)
- if d == Le && Univ.Level.is_small l then noneqs
- else if Univ.Level.is_prop l && d == Lt && Univ.Level.is_set r
- then noneqs
- else Constraint.add cstr noneqs)
- csts Constraint.empty
+ Constraint.filter
+ (fun (l,d,r) -> not ((d == Le && Level.is_small l) ||
+ (Level.is_prop l && d == Lt && Level.is_set r)))
+ csts
in
let noneqs = Constraint.union noneqs smallles in
- let partition = UF.partition uf in
let flex x = LMap.mem x us in
let ctx, us, eqs = List.fold_left (fun (ctx, us, cstrs) s ->
let canon, (global, rigid, flexible) = choose_canonical ctx flex algs s in
(* Add equalities for globals which can't be merged anymore. *)
let cstrs = LSet.fold (fun g cst ->
- Constraint.add (canon, Univ.Eq, g) cst) global
+ Constraint.add (canon, Eq, g) cst) global
cstrs
in
(* Also add equalities for rigid variables *)
let cstrs = LSet.fold (fun g cst ->
- Constraint.add (canon, Univ.Eq, g) cst) rigid
+ Constraint.add (canon, Eq, g) cst) rigid
cstrs
in
let canonu = Some (Universe.make canon) in
diff --git a/engine/universes.mli b/engine/universes.mli
index 4823c5746..a0a7749f8 100644
--- a/engine/universes.mli
+++ b/engine/universes.mli
@@ -162,8 +162,6 @@ val extend_context : 'a in_universe_context_set -> ContextSet.t ->
(a global one if there is one) and transitively saturate
the constraints w.r.t to the equalities. *)
-module UF : Unionfind.PartitionSig with type elt = Level.t
-
val level_subst_of : universe_subst_fn -> universe_level_subst_fn
val subst_univs_constraints : universe_subst_fn -> Constraint.t -> Constraint.t
diff --git a/ide/ide_slave.ml b/ide/ide_slave.ml
index 2e552b60b..c66d69c03 100644
--- a/ide/ide_slave.ml
+++ b/ide/ide_slave.ml
@@ -511,7 +511,7 @@ let () = Coqtop.toploop_init := (fun coq_args extra_args ->
let args = parse extra_args in
Flags.quiet := true;
CoqworkmgrApi.(init High);
- args)
+ coq_args, args)
let () = Coqtop.toploop_run := loop
diff --git a/interp/interp.mllib b/interp/interp.mllib
index bb22cf468..61313acc4 100644
--- a/interp/interp.mllib
+++ b/interp/interp.mllib
@@ -1,6 +1,7 @@
Tactypes
Stdarg
Genintern
+Notation_term
Notation_ops
Notation
Syntax_def
diff --git a/intf/notation_term.ml b/interp/notation_term.ml
index a9c2e2a53..a9c2e2a53 100644
--- a/intf/notation_term.ml
+++ b/interp/notation_term.ml
diff --git a/intf/intf.mllib b/intf/intf.mllib
deleted file mode 100644
index 2b8960d3f..000000000
--- a/intf/intf.mllib
+++ /dev/null
@@ -1,11 +0,0 @@
-Constrexpr
-Evar_kinds
-Genredexpr
-Locus
-Extend
-Notation_term
-Decl_kinds
-Glob_term
-Misctypes
-Pattern
-Vernacexpr
diff --git a/kernel/byterun/coq_interp.c b/kernel/byterun/coq_interp.c
index af89712d5..cfeb0a9ee 100644
--- a/kernel/byterun/coq_interp.c
+++ b/kernel/byterun/coq_interp.c
@@ -163,8 +163,11 @@ extern void caml_process_pending_signals(void);
/* The interpreter itself */
value coq_interprete
-(code_t coq_pc, value coq_accu, value coq_env, long coq_extra_args)
+(code_t coq_pc, value coq_accu, value coq_atom_tbl, value coq_global_data, value coq_env, long coq_extra_args)
{
+ /* coq_accu is not allocated on the OCaml heap */
+ CAMLparam2(coq_atom_tbl, coq_global_data);
+
/*Declaration des variables */
#ifdef PC_REG
register code_t pc PC_REG;
@@ -196,7 +199,7 @@ value coq_interprete
coq_instr_table = (char **) coq_jumptable;
coq_instr_base = coq_Jumptbl_base;
#endif
- return Val_unit;
+ CAMLreturn(Val_unit);
}
#if defined(THREADED_CODE) && defined(ARCH_SIXTYFOUR) && !defined(ARCH_CODE32)
coq_jumptbl_base = coq_Jumptbl_base;
@@ -1460,7 +1463,7 @@ value coq_interprete
Instruct(STOP){
print_instr("STOP");
coq_sp = sp;
- return accu;
+ CAMLreturn(accu);
}
@@ -1512,12 +1515,16 @@ value coq_push_vstack(value stk, value max_stack_size) {
return Val_unit;
}
-value coq_interprete_ml(value tcode, value a, value e, value ea) {
+value coq_interprete_ml(value tcode, value a, value t, value g, value e, value ea) {
print_instr("coq_interprete");
- return coq_interprete((code_t)tcode, a, e, Long_val(ea));
+ return coq_interprete((code_t)tcode, a, t, g, e, Long_val(ea));
print_instr("end coq_interprete");
}
-value coq_eval_tcode (value tcode, value e) {
- return coq_interprete_ml(tcode, Val_unit, e, 0);
+value coq_interprete_byte(value* argv, int argn){
+ return coq_interprete_ml(argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]);
+}
+
+value coq_eval_tcode (value tcode, value t, value g, value e) {
+ return coq_interprete_ml(tcode, Val_unit, t, g, e, 0);
}
diff --git a/kernel/byterun/coq_interp.h b/kernel/byterun/coq_interp.h
index 60865c32e..c04e9e00b 100644
--- a/kernel/byterun/coq_interp.h
+++ b/kernel/byterun/coq_interp.h
@@ -17,11 +17,10 @@ value coq_push_arguments(value args);
value coq_push_vstack(value stk);
-value coq_interprete_ml(value tcode, value a, value e, value ea);
+value coq_interprete_ml(value tcode, value a, value t, value g, value e, value ea);
+value coq_interprete_byte(value* argv, int argn);
value coq_interprete
- (code_t coq_pc, value coq_accu, value coq_env, long coq_extra_args);
-
-value coq_eval_tcode (value tcode, value e);
-
+ (code_t coq_pc, value coq_accu, value coq_atom_tbl, value coq_global_data, value coq_env, long coq_extra_args);
+value coq_eval_tcode (value tcode, value t, value g, value e);
diff --git a/kernel/byterun/coq_memory.c b/kernel/byterun/coq_memory.c
index 45cfae509..b2917a55e 100644
--- a/kernel/byterun/coq_memory.c
+++ b/kernel/byterun/coq_memory.c
@@ -24,10 +24,6 @@ value * coq_stack_threshold;
asize_t coq_max_stack_size = Coq_max_stack_size;
/* global_data */
-
-value coq_global_data;
-value coq_atom_tbl;
-
int drawinstr;
/* interp state */
@@ -58,9 +54,6 @@ static void (*coq_prev_scan_roots_hook) (scanning_action);
static void coq_scan_roots(scanning_action action)
{
register value * i;
- /* Scan the global variables */
- (*action)(coq_global_data, &coq_global_data);
- (*action)(coq_atom_tbl, &coq_atom_tbl);
/* Scan the stack */
for (i = coq_sp; i < coq_stack_high; i++) {
(*action) (*i, i);
@@ -79,24 +72,10 @@ void init_coq_stack()
coq_max_stack_size = Coq_max_stack_size;
}
-void init_coq_global_data(long requested_size)
-{
- int i;
- coq_global_data = alloc_shr(requested_size, 0);
- for (i = 0; i < requested_size; i++)
- Field (coq_global_data, i) = Val_unit;
-}
-
-void init_coq_atom_tbl(long requested_size){
- int i;
- coq_atom_tbl = alloc_shr(requested_size, 0);
- for (i = 0; i < requested_size; i++) Field (coq_atom_tbl, i) = Val_unit;
-}
-
void init_coq_interpreter()
{
coq_sp = coq_stack_high;
- coq_interprete(NULL, Val_unit, Val_unit, 0);
+ coq_interprete(NULL, Val_unit, Atom(0), Atom(0), Val_unit, 0);
}
static int coq_vm_initialized = 0;
@@ -112,8 +91,6 @@ value init_coq_vm(value unit) /* ML */
#endif /* THREADED_CODE */
/* Allocate the table of global and the stack */
init_coq_stack();
- init_coq_global_data(Coq_global_data_Size);
- init_coq_atom_tbl(40);
/* Initialing the interpreter */
init_coq_interpreter();
@@ -157,53 +134,6 @@ void realloc_coq_stack(asize_t required_space)
#undef shift
}
-value get_coq_global_data(value unit) /* ML */
-{
- return coq_global_data;
-}
-
-value get_coq_atom_tbl(value unit) /* ML */
-{
- return coq_atom_tbl;
-}
-
-value realloc_coq_global_data(value size) /* ML */
-{
- mlsize_t requested_size, actual_size, i;
- value new_global_data;
- requested_size = Long_val(size);
- actual_size = Wosize_val(coq_global_data);
- if (requested_size >= actual_size) {
- requested_size = (requested_size + 0x100) & 0xFFFFFF00;
- new_global_data = alloc_shr(requested_size, 0);
- for (i = 0; i < actual_size; i++)
- initialize(&Field(new_global_data, i), Field(coq_global_data, i));
- for (i = actual_size; i < requested_size; i++){
- Field (new_global_data, i) = Val_long (0);
- }
- coq_global_data = new_global_data;
- }
- return Val_unit;
-}
-
-value realloc_coq_atom_tbl(value size) /* ML */
-{
- mlsize_t requested_size, actual_size, i;
- value new_atom_tbl;
- requested_size = Long_val(size);
- actual_size = Wosize_val(coq_atom_tbl);
- if (requested_size >= actual_size) {
- requested_size = (requested_size + 0x100) & 0xFFFFFF00;
- new_atom_tbl = alloc_shr(requested_size, 0);
- for (i = 0; i < actual_size; i++)
- initialize(&Field(new_atom_tbl, i), Field(coq_atom_tbl, i));
- for (i = actual_size; i < requested_size; i++)
- Field (new_atom_tbl, i) = Val_long (0);
- coq_atom_tbl = new_atom_tbl;
- }
- return Val_unit;
-}
-
value coq_set_drawinstr(value unit)
{
drawinstr = 1;
diff --git a/kernel/byterun/coq_memory.h b/kernel/byterun/coq_memory.h
index cec34f566..9375b15de 100644
--- a/kernel/byterun/coq_memory.h
+++ b/kernel/byterun/coq_memory.h
@@ -20,7 +20,6 @@
#define Coq_stack_size (4096 * sizeof(value))
#define Coq_stack_threshold (256 * sizeof(value))
-#define Coq_global_data_Size (4096 * sizeof(value))
#define Coq_max_stack_size (256 * 1024)
#define TRANSP 0
@@ -34,9 +33,7 @@ extern value * coq_stack_threshold;
/* global_data */
-extern value coq_global_data;
extern int coq_all_transp;
-extern value coq_atom_tbl;
extern int drawinstr;
/* interp state */
@@ -53,10 +50,6 @@ value init_coq_vm(value unit); /* ML */
value re_init_coq_vm(value unit); /* ML */
void realloc_coq_stack(asize_t required_space);
-value get_coq_global_data(value unit); /* ML */
-value realloc_coq_global_data(value size); /* ML */
-value get_coq_atom_tbl(value unit); /* ML */
-value realloc_coq_atom_tbl(value size); /* ML */
value coq_set_transp_value(value transp); /* ML */
value get_coq_transp_value(value unit); /* ML */
#endif /* _COQ_MEMORY_ */
diff --git a/kernel/cbytegen.ml b/kernel/cbytegen.ml
index 70dc6867a..a771945dd 100644
--- a/kernel/cbytegen.ml
+++ b/kernel/cbytegen.ml
@@ -829,6 +829,8 @@ let is_univ_copy max u =
else
false
+let dump_bytecode = ref false
+
let dump_bytecodes init code fvs =
let open Pp in
(str "code =" ++ fnl () ++
@@ -872,7 +874,7 @@ let compile ~fail_on_error ?universes:(universes=0) env c =
reloc, init_code
in
let fv = List.rev (!(reloc.in_env).fv_rev) in
- (if !Flags.dump_bytecode then
+ (if !dump_bytecode then
Feedback.msg_debug (dump_bytecodes init_code !fun_code fv)) ;
Some (init_code,!fun_code, Array.of_list fv)
with TooLargeInductive msg ->
diff --git a/kernel/cbytegen.mli b/kernel/cbytegen.mli
index abab58b60..1c4cdcbeb 100644
--- a/kernel/cbytegen.mli
+++ b/kernel/cbytegen.mli
@@ -25,3 +25,6 @@ val compile_constant_body : fail_on_error:bool ->
(** Shortcut of the previous function used during module strengthening *)
val compile_alias : Names.Constant.t -> body_code
+
+(** Dump the bytecode after compilation (for debugging purposes) *)
+val dump_bytecode : bool ref
diff --git a/kernel/clambda.ml b/kernel/clambda.ml
index 7b637c20e..641d424e2 100644
--- a/kernel/clambda.ml
+++ b/kernel/clambda.ml
@@ -807,7 +807,7 @@ and lambda_of_args env start args =
(*********************************)
-
+let dump_lambda = ref false
let optimize_lambda lam =
let lam = simplify subst_id lam in
@@ -819,7 +819,7 @@ let lambda_of_constr ~optimize genv c =
Renv.push_rels env (Array.of_list ids);
let lam = lambda_of_constr env c in
let lam = if optimize then optimize_lambda lam else lam in
- if !Flags.dump_lambda then
+ if !dump_lambda then
Feedback.msg_debug (pp_lam lam);
lam
diff --git a/kernel/clambda.mli b/kernel/clambda.mli
index 89b7fd8e3..6cf46163e 100644
--- a/kernel/clambda.mli
+++ b/kernel/clambda.mli
@@ -25,3 +25,6 @@ val dynamic_int31_compilation : bool -> lambda array -> lambda
(*spiwack: compiling function to insert dynamic decompilation before
matching integers (in case they are in processor representation) *)
val int31_escape_before_match : bool -> lambda -> lambda
+
+(** Dump the VM lambda code after compilation (for debugging purposes) *)
+val dump_lambda : bool ref
diff --git a/kernel/csymtable.ml b/kernel/csymtable.ml
index 012948954..4f3cbf289 100644
--- a/kernel/csymtable.ml
+++ b/kernel/csymtable.ml
@@ -26,7 +26,9 @@ open Cbytegen
module NamedDecl = Context.Named.Declaration
module RelDecl = Context.Rel.Declaration
-external eval_tcode : tcode -> values array -> values = "coq_eval_tcode"
+external eval_tcode : tcode -> atom array -> vm_global -> values array -> values = "coq_eval_tcode"
+
+type global_data = { mutable glob_len : int; mutable glob_val : values array }
(*******************)
(* Linkage du code *)
@@ -37,21 +39,28 @@ external eval_tcode : tcode -> values array -> values = "coq_eval_tcode"
(* [global_data] contient les valeurs des constantes globales
(axiomes,definitions), les annotations des switch et les structured
constant *)
-external global_data : unit -> values array = "get_coq_global_data"
+let global_data = {
+ glob_len = 0;
+ glob_val = Array.make 4096 crazy_val;
+}
-(* [realloc_global_data n] augmente de n la taille de [global_data] *)
-external realloc_global_data : int -> unit = "realloc_coq_global_data"
+let get_global_data () = Vmvalues.vm_global global_data.glob_val
-let check_global_data n =
- if n >= Array.length (global_data()) then realloc_global_data n
+let realloc_global_data n =
+ let n = min (2 * n + 0x100) Sys.max_array_length in
+ let ans = Array.make n crazy_val in
+ let src = global_data.glob_val in
+ let () = Array.blit src 0 ans 0 (Array.length src) in
+ global_data.glob_val <- ans
-let num_global = ref 0
+let check_global_data n =
+ if n >= Array.length global_data.glob_val then realloc_global_data n
let set_global v =
- let n = !num_global in
+ let n = global_data.glob_len in
check_global_data n;
- (global_data()).(n) <- v;
- incr num_global;
+ global_data.glob_val.(n) <- v;
+ global_data.glob_len <- global_data.glob_len + 1;
n
(* table pour les structured_constant et les annotations des switchs *)
@@ -164,7 +173,7 @@ and eval_to_patch env (buff,pl,fv) =
in
let tc = patch buff pl slots in
let vm_env = Array.map (slot_for_fv env) fv in
- eval_tcode tc vm_env
+ eval_tcode tc (get_atom_rel ()) (vm_global global_data.glob_val) vm_env
and val_of_constr env c =
match compile ~fail_on_error:true env c with
diff --git a/kernel/csymtable.mli b/kernel/csymtable.mli
index 19b2b8b50..d32cfba36 100644
--- a/kernel/csymtable.mli
+++ b/kernel/csymtable.mli
@@ -18,3 +18,5 @@ val val_of_constr : env -> constr -> Vmvalues.values
val set_opaque_const : Constant.t -> unit
val set_transparent_const : Constant.t -> unit
+
+val get_global_data : unit -> Vmvalues.vm_global
diff --git a/kernel/kernel.mllib b/kernel/kernel.mllib
index 370185a72..5d270125a 100644
--- a/kernel/kernel.mllib
+++ b/kernel/kernel.mllib
@@ -43,6 +43,6 @@ Subtyping
Mod_typing
Nativelibrary
Safe_typing
-Vm
Csymtable
+Vm
Vconv
diff --git a/kernel/uGraph.ml b/kernel/uGraph.ml
index 5d1644614..e6b27077b 100644
--- a/kernel/uGraph.ml
+++ b/kernel/uGraph.ml
@@ -21,7 +21,7 @@ open Univ
(* Revisions by Bruno Barras, Hugo Herbelin, Pierre Letouzey, Matthieu
Sozeau, Pierre-Marie Pédrot, Jacques-Henri Jourdan *)
-let error_inconsistency o u v (p:explanation option) =
+let error_inconsistency o u v p =
raise (UniverseInconsistency (o,Universe.make u,Universe.make v,p))
(* Universes are stratified by a partial ordering $\le$.
@@ -557,8 +557,7 @@ let get_explanation strict u v g =
else match traverse strict u with Some exp -> exp | None -> assert false
let get_explanation strict u v g =
- if !Flags.univ_print then Some (get_explanation strict u v g)
- else None
+ Some (lazy (get_explanation strict u v g))
(* To compare two nodes, we simply do a forward search.
We implement two improvements:
@@ -768,18 +767,18 @@ let normalize_universes g =
g.entries g
let constraints_of_universes g =
+ let module UF = Unionfind.Make (LSet) (LMap) in
+ let uf = UF.create () in
let constraints_of u v acc =
match v with
| Canonical {univ=u; ltle} ->
UMap.fold (fun v strict acc->
let typ = if strict then Lt else Le in
Constraint.add (u,typ,v) acc) ltle acc
- | Equiv v -> Constraint.add (u,Eq,v) acc
+ | Equiv v -> UF.union u v uf; acc
in
- UMap.fold constraints_of g.entries Constraint.empty
-
-let constraints_of_universes g =
- constraints_of_universes (normalize_universes g)
+ let csts = UMap.fold constraints_of g.entries Constraint.empty in
+ csts, UF.partition uf
(** [sort_universes g] builds a totally ordered universe graph. The
output graph should imply the input graph (and the implication
diff --git a/kernel/uGraph.mli b/kernel/uGraph.mli
index d4fba63fb..cca2eb472 100644
--- a/kernel/uGraph.mli
+++ b/kernel/uGraph.mli
@@ -59,7 +59,10 @@ val empty_universes : t
val sort_universes : t -> t
-val constraints_of_universes : t -> Constraint.t
+(** [constraints_of_universes g] returns [csts] and [partition] where
+ [csts] are the non-Eq constraints and [partition] is the partition
+ of the universes into equivalence classes. *)
+val constraints_of_universes : t -> Constraint.t * LSet.t list
val check_subtype : AUContext.t check_function
(** [check_subtype univ ctx1 ctx2] checks whether [ctx2] is an instance of
diff --git a/kernel/univ.ml b/kernel/univ.ml
index ea3a52295..8e19fa4e5 100644
--- a/kernel/univ.ml
+++ b/kernel/univ.ml
@@ -541,11 +541,11 @@ let constraint_type_ord c1 c2 = match c1, c2 with
(* Universe inconsistency: error raised when trying to enforce a relation
that would create a cycle in the graph of universes. *)
-type univ_inconsistency = constraint_type * universe * universe * explanation option
+type univ_inconsistency = constraint_type * universe * universe * explanation Lazy.t option
exception UniverseInconsistency of univ_inconsistency
-let error_inconsistency o u v (p:explanation option) =
+let error_inconsistency o u v p =
raise (UniverseInconsistency (o,make u,make v,p))
(* Constraints and sets of constraints. *)
@@ -1235,13 +1235,16 @@ let explain_universe_inconsistency prl (o,u,v,p) =
| Eq -> str"=" | Lt -> str"<" | Le -> str"<="
in
let reason = match p with
- | None | Some [] -> mt()
+ | None -> mt()
| Some p ->
- str " because" ++ spc() ++ pr_uni v ++
+ let p = Lazy.force p in
+ if p = [] then mt ()
+ else
+ str " because" ++ spc() ++ pr_uni v ++
prlist (fun (r,v) -> spc() ++ pr_rel r ++ str" " ++ pr_uni v)
- p ++
+ p ++
(if Universe.equal (snd (List.last p)) u then mt() else
- (spc() ++ str "= " ++ pr_uni u))
+ (spc() ++ str "= " ++ pr_uni u))
in
str "Cannot enforce" ++ spc() ++ pr_uni u ++ spc() ++
pr_rel o ++ spc() ++ pr_uni v ++ reason
diff --git a/kernel/univ.mli b/kernel/univ.mli
index aaed899bf..b68bbdf35 100644
--- a/kernel/univ.mli
+++ b/kernel/univ.mli
@@ -205,7 +205,7 @@ val enforce_leq_level : Level.t constraint_function
Constraint.t...
*)
type explanation = (constraint_type * Universe.t) list
-type univ_inconsistency = constraint_type * Universe.t * Universe.t * explanation option
+type univ_inconsistency = constraint_type * Universe.t * Universe.t * explanation Lazy.t option
exception UniverseInconsistency of univ_inconsistency
diff --git a/kernel/vm.ml b/kernel/vm.ml
index 14aeb732f..d7eedc226 100644
--- a/kernel/vm.ml
+++ b/kernel/vm.ml
@@ -42,8 +42,11 @@ external push_vstack : vstack -> int -> unit = "coq_push_vstack"
(* interpreteur *)
-external interprete : tcode -> values -> vm_env -> int -> values =
- "coq_interprete_ml"
+external coq_interprete : tcode -> values -> atom array -> vm_global -> vm_env -> int -> values =
+ "coq_interprete_byte" "coq_interprete_ml"
+
+let interprete code v env k =
+ coq_interprete code v (get_atom_rel ()) (Csymtable.get_global_data ()) env k
(* Functions over arguments *)
@@ -184,6 +187,6 @@ let apply_whd k whd =
push_val v;
interprete (cofix_upd_code to_up) (cofix_upd_val to_up) (cofix_upd_env to_up) 0
| Vatom_stk(a,stk) ->
- apply_stack (val_of_atom a) stk v
+ apply_stack (val_of_atom a) stk v
| Vuniv_level lvl -> assert false
diff --git a/kernel/vmvalues.ml b/kernel/vmvalues.ml
index 0e0cb4e58..6a41efac2 100644
--- a/kernel/vmvalues.ml
+++ b/kernel/vmvalues.ml
@@ -43,6 +43,7 @@ let fix_val v = (Obj.magic v : values)
let cofix_upd_val v = (Obj.magic v : values)
type vm_env
+type vm_global
let fun_env v = (Obj.magic v : vm_env)
let fix_env v = (Obj.magic v : vm_env)
let cofix_env v = (Obj.magic v : vm_env)
@@ -51,6 +52,8 @@ type vstack = values array
let fun_of_val v = (Obj.magic v : vfun)
+let vm_global (v : values array) = (Obj.magic v : vm_global)
+
(*******************************************)
(* Machine code *** ************************)
(*******************************************)
@@ -407,13 +410,20 @@ let check_fix f1 f2 =
else false
else false
-external atom_rel : unit -> atom array = "get_coq_atom_tbl"
-external realloc_atom_rel : int -> unit = "realloc_coq_atom_tbl"
+let atom_rel : atom array ref =
+ let init i = Aid (RelKey i) in
+ ref (Array.init 40 init)
+
+let get_atom_rel () = !atom_rel
+
+let realloc_atom_rel n =
+ let n = min (2 * n + 0x100) Sys.max_array_length in
+ let init i = Aid (RelKey i) in
+ let ans = Array.init n init in
+ atom_rel := ans
let relaccu_tbl =
- let atom_rel = atom_rel() in
- let len = Array.length atom_rel in
- for i = 0 to len - 1 do atom_rel.(i) <- Aid (RelKey i) done;
+ let len = Array.length !atom_rel in
ref (Array.init len mkAccuCode)
let relaccu_code i =
@@ -422,9 +432,7 @@ let relaccu_code i =
else
begin
realloc_atom_rel i;
- let atom_rel = atom_rel () in
- let nl = Array.length atom_rel in
- for j = len to nl - 1 do atom_rel.(j) <- Aid(RelKey j) done;
+ let nl = Array.length !atom_rel in
relaccu_tbl :=
Array.init nl
(fun j -> if j < len then !relaccu_tbl.(j) else mkAccuCode j);
diff --git a/kernel/vmvalues.mli b/kernel/vmvalues.mli
index c6e342a96..550791b2c 100644
--- a/kernel/vmvalues.mli
+++ b/kernel/vmvalues.mli
@@ -15,6 +15,7 @@ open Cbytecodes
type values
type vm_env
+type vm_global
type vprod
type vfun
type vfix
@@ -33,6 +34,8 @@ val fix_env : vfix -> vm_env
val cofix_env : vcofix -> vm_env
val cofix_upd_env : to_update -> vm_env
+val vm_global : values array -> vm_global
+
(** Cast a value known to be a function, unsafe in general *)
val fun_of_val : values -> vfun
@@ -69,6 +72,9 @@ type atom =
| Aind of inductive
| Asort of Sorts.t
+val get_atom_rel : unit -> atom array
+(** Global table of rels *)
+
(** Zippers *)
type zipper =
diff --git a/lib/flags.ml b/lib/flags.ml
index 8491873e0..56940f1cf 100644
--- a/lib/flags.ml
+++ b/lib/flags.ml
@@ -60,7 +60,6 @@ let profile = false
let ide_slave = ref false
let raw_print = ref false
-let univ_print = ref false
let we_are_parsing = ref false
@@ -160,11 +159,3 @@ let print_mod_uid = ref false
let profile_ltac = ref false
let profile_ltac_cutoff = ref 2.0
-
-let dump_bytecode = ref false
-let set_dump_bytecode = (:=) dump_bytecode
-let get_dump_bytecode () = !dump_bytecode
-
-let dump_lambda = ref false
-let set_dump_lambda = (:=) dump_lambda
-let get_dump_lambda () = !dump_lambda
diff --git a/lib/flags.mli b/lib/flags.mli
index 85aaf879f..17776d68a 100644
--- a/lib/flags.mli
+++ b/lib/flags.mli
@@ -10,6 +10,25 @@
(** Global options of the system. *)
+(** WARNING: don't add new entries to this file!
+
+ This file is own its way to deprecation in favor of a purely
+ functional state, but meanwhile it will contain options that are
+ truly global to the system such as [compat] or [debug]
+
+ If you are thinking about adding a global flag, well, just
+ don't. First of all, options make testins exponentially more
+ expensive, due to the growth of flag combinations. So please make
+ some effort in order for your idea to work in a configuration-free
+ manner.
+
+ If you absolutely must pass an option to your new system, then do
+ so as a functional argument so flags are exposed to unit
+ testing. Then, register such parameters with the proper
+ state-handling mechanism of the top-level subsystem of Coq.
+
+ *)
+
(** Command-line flags *)
val boot : bool ref
@@ -42,9 +61,6 @@ val we_are_parsing : bool ref
(* Set Printing All flag. For some reason it is a global flag *)
val raw_print : bool ref
-(* Univ print flag, never set anywere. Maybe should belong to Univ? *)
-val univ_print : bool ref
-
type compat_version = V8_6 | V8_7 | Current
val compat_version : compat_version ref
val version_compare : compat_version -> compat_version -> int
@@ -129,13 +145,3 @@ val print_mod_uid : bool ref
val profile_ltac : bool ref
val profile_ltac_cutoff : float ref
-
-(** Dump the bytecode after compilation (for debugging purposes) *)
-val dump_bytecode : bool ref
-val set_dump_bytecode : bool -> unit
-val get_dump_bytecode : unit -> bool
-
-(** Dump the VM lambda code after compilation (for debugging purposes) *)
-val dump_lambda : bool ref
-val set_dump_lambda : bool -> unit
-val get_dump_lambda : unit -> bool
diff --git a/intf/decl_kinds.ml b/library/decl_kinds.ml
index 0d3285311..0d3285311 100644
--- a/intf/decl_kinds.ml
+++ b/library/decl_kinds.ml
diff --git a/library/declaremods.ml b/library/declaremods.ml
index 762efc5e3..1d5df49cf 100644
--- a/library/declaremods.ml
+++ b/library/declaremods.ml
@@ -17,11 +17,25 @@ open Entries
open Libnames
open Libobject
open Mod_subst
-open Vernacexpr
open Misctypes
(** {6 Inlining levels} *)
+(** Rigid / flexible module signature *)
+
+type 'a module_signature =
+ | Enforce of 'a (** ... : T *)
+ | Check of 'a list (** ... <: T1 <: T2, possibly empty *)
+
+(** Which module inline annotations should we honor,
+ either None or the ones whose level is less or equal
+ to the given integer *)
+
+type inline =
+ | NoInline
+ | DefaultInline
+ | InlineAt of int
+
let default_inline () = Some (Flags.get_inline_level ())
let inl2intopt = function
diff --git a/library/declaremods.mli b/library/declaremods.mli
index fd8d29614..4aee7feae 100644
--- a/library/declaremods.mli
+++ b/library/declaremods.mli
@@ -9,10 +9,24 @@
(************************************************************************)
open Names
-open Vernacexpr
(** {6 Modules } *)
+(** Rigid / flexible module signature *)
+
+type 'a module_signature =
+ | Enforce of 'a (** ... : T *)
+ | Check of 'a list (** ... <: T1 <: T2, possibly empty *)
+
+(** Which module inline annotations should we honor,
+ either None or the ones whose level is less or equal
+ to the given integer *)
+
+type inline =
+ | NoInline
+ | DefaultInline
+ | InlineAt of int
+
type 'modast module_interpretor =
Environ.env -> Misctypes.module_kind -> 'modast ->
Entries.module_struct_entry * Misctypes.module_kind * Univ.ContextSet.t
diff --git a/library/library.mllib b/library/library.mllib
index e43bfb5a1..1c0368847 100644
--- a/library/library.mllib
+++ b/library/library.mllib
@@ -4,7 +4,9 @@ Libobject
Summary
Nametab
Global
+Decl_kinds
Lib
+Misctypes
Declaremods
Loadpath
Library
diff --git a/intf/misctypes.ml b/library/misctypes.ml
index 72db3b31c..72db3b31c 100644
--- a/intf/misctypes.ml
+++ b/library/misctypes.ml
diff --git a/parsing/g_vernac.ml4 b/parsing/g_vernac.ml4
index 593dcbf58..2dbd624c2 100644
--- a/parsing/g_vernac.ml4
+++ b/parsing/g_vernac.ml4
@@ -17,6 +17,7 @@ open Constrexpr
open Constrexpr_ops
open Extend
open Decl_kinds
+open Declaremods
open Declarations
open Misctypes
open Tok (* necessary for camlp5 *)
diff --git a/plugins/ltac/g_ltac.ml4 b/plugins/ltac/g_ltac.ml4
index 0c42a8bb2..a1d7d9b1a 100644
--- a/plugins/ltac/g_ltac.ml4
+++ b/plugins/ltac/g_ltac.ml4
@@ -325,6 +325,7 @@ GEXTEND Gram
;
toplevel_selector:
[ [ sel = selector_body; ":" -> sel
+ | "!"; ":" -> SelectAlreadyFocused
| IDENT "all"; ":" -> SelectAll ] ]
;
tactic_mode:
diff --git a/plugins/ltac/pptactic.ml b/plugins/ltac/pptactic.ml
index 11bb7a234..bd02d85d5 100644
--- a/plugins/ltac/pptactic.ml
+++ b/plugins/ltac/pptactic.ml
@@ -515,6 +515,7 @@ let string_of_genarg_arg (ArgumentType arg) =
else int i ++ str "-" ++ int j
let pr_goal_selector toplevel = function
+ | SelectAlreadyFocused -> str "!:"
| SelectNth i -> int i ++ str ":"
| SelectList l -> prlist_with_sep (fun () -> str ", ") pr_range_selector l ++ str ":"
| SelectId id -> str "[" ++ Id.print id ++ str "]:"
diff --git a/plugins/ltac/tacexpr.ml b/plugins/ltac/tacexpr.ml
index 3baa475ab..37abfeee9 100644
--- a/plugins/ltac/tacexpr.ml
+++ b/plugins/ltac/tacexpr.ml
@@ -36,6 +36,7 @@ type letin_flag = bool (* true = use local def false = use Leibniz *)
type clear_flag = bool option (* true = clear hyp, false = keep hyp, None = use default *)
type goal_selector = Vernacexpr.goal_selector =
+ | SelectAlreadyFocused
| SelectNth of int
| SelectList of (int * int) list
| SelectId of Id.t
diff --git a/plugins/ltac/tacexpr.mli b/plugins/ltac/tacexpr.mli
index 3baa475ab..37abfeee9 100644
--- a/plugins/ltac/tacexpr.mli
+++ b/plugins/ltac/tacexpr.mli
@@ -36,6 +36,7 @@ type letin_flag = bool (* true = use local def false = use Leibniz *)
type clear_flag = bool option (* true = clear hyp, false = keep hyp, None = use default *)
type goal_selector = Vernacexpr.goal_selector =
+ | SelectAlreadyFocused
| SelectNth of int
| SelectList of (int * int) list
| SelectId of Id.t
diff --git a/plugins/ltac/tacinterp.ml b/plugins/ltac/tacinterp.ml
index 6a4bf577b..84049d4ed 100644
--- a/plugins/ltac/tacinterp.ml
+++ b/plugins/ltac/tacinterp.ml
@@ -2010,7 +2010,8 @@ let interp_redexp env sigma r =
let _ =
let eval lfun env sigma ty tac =
- let ist = { lfun = lfun; extra = TacStore.empty; } in
+ let extra = TacStore.set TacStore.empty f_debug (get_debug ()) in
+ let ist = { lfun = lfun; extra; } in
let tac = interp_tactic ist tac in
let (c, sigma) = Pfedit.refine_by_tactic env sigma ty tac in
(EConstr.of_constr c, sigma)
diff --git a/intf/constrexpr.ml b/pretyping/constrexpr.ml
index fda31756a..fda31756a 100644
--- a/intf/constrexpr.ml
+++ b/pretyping/constrexpr.ml
diff --git a/pretyping/detyping.ml b/pretyping/detyping.ml
index bb563220b..56e582891 100644
--- a/pretyping/detyping.ml
+++ b/pretyping/detyping.ml
@@ -36,7 +36,7 @@ type _ delay =
| Later : [ `thunk ] delay
(** Should we keep details of universes during detyping ? *)
-let print_universes = Flags.univ_print
+let print_universes = ref false
(** If true, prints local context of evars, whatever print_arguments *)
let print_evar_arguments = ref false
diff --git a/intf/extend.ml b/pretyping/extend.ml
index 734b859f6..734b859f6 100644
--- a/intf/extend.ml
+++ b/pretyping/extend.ml
diff --git a/intf/genredexpr.ml b/pretyping/genredexpr.ml
index 80697461a..80697461a 100644
--- a/intf/genredexpr.ml
+++ b/pretyping/genredexpr.ml
diff --git a/intf/glob_term.ml b/pretyping/glob_term.ml
index 84be15552..84be15552 100644
--- a/intf/glob_term.ml
+++ b/pretyping/glob_term.ml
diff --git a/intf/locus.ml b/pretyping/locus.ml
index 95a2e495b..95a2e495b 100644
--- a/intf/locus.ml
+++ b/pretyping/locus.ml
diff --git a/intf/pattern.ml b/pretyping/pattern.ml
index 76367b612..76367b612 100644
--- a/intf/pattern.ml
+++ b/pretyping/pattern.ml
diff --git a/pretyping/pretyping.ml b/pretyping/pretyping.ml
index 947469ca0..e68a25a87 100644
--- a/pretyping/pretyping.ml
+++ b/pretyping/pretyping.ml
@@ -1118,7 +1118,7 @@ and pretype_instance k0 resolve_tc env evdref lvar loc hyps evk update =
with Not_found ->
try
let (n,_,t') = lookup_rel_id id (rel_context env) in
- if is_conv env.ExtraEnv.env !evdref t t' then mkRel n, update else raise Not_found
+ if is_conv env.ExtraEnv.env !evdref t (lift n t') then mkRel n, update else raise Not_found
with Not_found ->
try
let t' = env |> lookup_named id |> NamedDecl.get_type in
diff --git a/pretyping/pretyping.mllib b/pretyping/pretyping.mllib
index ae4ad0be7..d98026bc6 100644
--- a/pretyping/pretyping.mllib
+++ b/pretyping/pretyping.mllib
@@ -1,5 +1,5 @@
Geninterp
-Ltac_pretype
+Locus
Locusops
Pretype_errors
Reductionops
@@ -16,12 +16,19 @@ Evarsolve
Recordops
Evarconv
Typing
+Constrexpr
+Genredexpr
Miscops
+Glob_term
+Ltac_pretype
Glob_ops
Redops
+Pattern
Patternops
Constr_matching
Tacred
+Extend
+Vernacexpr
Typeclasses_errors
Typeclasses
Classops
diff --git a/intf/vernacexpr.ml b/pretyping/vernacexpr.ml
index 06f969f19..548689205 100644
--- a/intf/vernacexpr.ml
+++ b/pretyping/vernacexpr.ml
@@ -22,6 +22,7 @@ type class_rawexpr = FunClass | SortClass | RefClass of reference or_by_notation
make sense to apply a tactic to it. Hence it the types may look very
similar, they do not seem to mean the same thing. *)
type goal_selector =
+ | SelectAlreadyFocused
| SelectNth of int
| SelectList of (int * int) list
| SelectId of Id.t
@@ -281,20 +282,22 @@ type bullet =
(** Rigid / flexible module signature *)
-type 'a module_signature =
+type 'a module_signature = 'a Declaremods.module_signature =
| Enforce of 'a (** ... : T *)
| Check of 'a list (** ... <: T1 <: T2, possibly empty *)
+[@@ocaml.deprecated "please use [Declaremods.module_signature]."]
(** Which module inline annotations should we honor,
either None or the ones whose level is less or equal
to the given integer *)
-type inline =
+type inline = Declaremods.inline =
| NoInline
| DefaultInline
| InlineAt of int
+[@@ocaml.deprecated "please use [Declaremods.inline]."]
-type module_ast_inl = module_ast * inline
+type module_ast_inl = module_ast * Declaremods.inline
type module_binder = bool option * lident list * module_ast_inl
(** [Some b] if locally enabled/disabled according to [b], [None] if
@@ -333,7 +336,7 @@ type nonrec vernac_expr =
| VernacEndProof of proof_end
| VernacExactProof of constr_expr
| VernacAssumption of (Decl_kinds.discharge * Decl_kinds.assumption_object_kind) *
- inline * (ident_decl list * constr_expr) with_coercion list
+ Declaremods.inline * (ident_decl list * constr_expr) with_coercion list
| VernacInductive of vernac_cumulative option * Decl_kinds.private_flag * inductive_flag * (inductive_expr * decl_notation list) list
| VernacFixpoint of Decl_kinds.discharge * (fixpoint_expr * decl_notation list) list
| VernacCoFixpoint of Decl_kinds.discharge * (cofixpoint_expr * decl_notation list) list
@@ -373,7 +376,7 @@ type nonrec vernac_expr =
| VernacDeclareModule of bool option * lident *
module_binder list * module_ast_inl
| VernacDefineModule of bool option * lident * module_binder list *
- module_ast_inl module_signature * module_ast_inl list
+ module_ast_inl Declaremods.module_signature * module_ast_inl list
| VernacDeclareModuleType of lident *
module_binder list * module_ast_inl list * module_ast_inl list
| VernacInclude of module_ast_inl list
diff --git a/printing/ppvernac.ml b/printing/ppvernac.ml
index 7eb8396ac..83c875707 100644
--- a/printing/ppvernac.ml
+++ b/printing/ppvernac.ml
@@ -16,12 +16,13 @@ open Util
open CAst
open Extend
-open Vernacexpr
-open Pputils
open Libnames
+open Decl_kinds
open Constrexpr
open Constrexpr_ops
-open Decl_kinds
+open Vernacexpr
+open Declaremods
+open Pputils
open Ppconstr
diff --git a/proofs/logic.ml b/proofs/logic.ml
index e5294715e..4934afa83 100644
--- a/proofs/logic.ml
+++ b/proofs/logic.ml
@@ -289,7 +289,15 @@ let collect_meta_variables c =
let rec collrec deep acc c = match kind c with
| Meta mv -> if deep then error_unsupported_deep_meta () else mv::acc
| Cast(c,_,_) -> collrec deep acc c
- | (App _| Case _) -> Constr.fold (collrec deep) acc c
+ | Case(ci,p,c,br) ->
+ (* Hack assuming only two situations: the legacy one that branches,
+ if with Metas, are Meta, and the new one with eta-let-expanded
+ branches *)
+ let br = Array.map2 (fun n b -> try snd (Term.decompose_lam_n_decls n b) with UserError _ -> b) ci.ci_cstr_ndecls br in
+ Array.fold_left (collrec deep)
+ (Constr.fold (collrec deep) (Constr.fold (collrec deep) acc p) c)
+ br
+ | App _ -> Constr.fold (collrec deep) acc c
| Proj (_, c) -> collrec deep acc c
| _ -> Constr.fold (collrec true) acc c
in
@@ -387,12 +395,7 @@ let rec mk_refgoals sigma goal goalacc conclty trm =
| Case (ci,p,c,lf) ->
let (acc',lbrty,conclty',sigma,p',c') = mk_casegoals sigma goal goalacc p c in
let sigma = check_conv_leq_goal env sigma trm conclty' conclty in
- let (acc'',sigma, rbranches) =
- Array.fold_left2
- (fun (lacc,sigma,bacc) ty fi ->
- let (r,_,s,b') = mk_refgoals sigma goal lacc ty fi in r,s,(b'::bacc))
- (acc',sigma,[]) lbrty lf
- in
+ let (acc'',sigma,rbranches) = treat_case sigma goal ci lbrty lf acc' in
let lf' = Array.rev_of_list rbranches in
let ans =
if p' == p && c' == c && Array.equal (==) lf' lf then trm
@@ -440,12 +443,7 @@ and mk_hdgoals sigma goal goalacc trm =
| Case (ci,p,c,lf) ->
let (acc',lbrty,conclty',sigma,p',c') = mk_casegoals sigma goal goalacc p c in
- let (acc'',sigma,rbranches) =
- Array.fold_left2
- (fun (lacc,sigma,bacc) ty fi ->
- let (r,_,s,b') = mk_refgoals sigma goal lacc ty fi in r,s,(b'::bacc))
- (acc',sigma,[]) lbrty lf
- in
+ let (acc'',sigma,rbranches) = treat_case sigma goal ci lbrty lf acc' in
let lf' = Array.rev_of_list rbranches in
let ans =
if p' == p && c' == c && Array.equal (==) lf' lf then trm
@@ -497,6 +495,50 @@ and mk_casegoals sigma goal goalacc p c =
let (lbrty,conclty) = type_case_branches_with_names env sigma indspec p c in
(acc'',lbrty,conclty,sigma,p',c')
+and treat_case sigma goal ci lbrty lf acc' =
+ let rec strip_outer_cast c = match kind c with
+ | Cast (c,_,_) -> strip_outer_cast c
+ | _ -> c in
+ let decompose_app_vect c = match kind c with
+ | App (f,cl) -> (f, cl)
+ | _ -> (c,[||]) in
+ let env = Goal.V82.env sigma goal in
+ Array.fold_left3
+ (fun (lacc,sigma,bacc) ty fi l ->
+ if isMeta (strip_outer_cast fi) then
+ (* Support for non-eta-let-expanded Meta as found in *)
+ (* destruct/case with an non eta-let expanded elimination scheme *)
+ let (r,_,s,fi') = mk_refgoals sigma goal lacc ty fi in
+ r,s,(fi'::bacc)
+ else
+ (* Deal with a branch in expanded form of the form
+ Case(ci,p,c,[|eta-let-exp(Meta);...;eta-let-exp(Meta)|]) as
+ if it were not so, so as to preserve compatibility with when
+ destruct/case generated schemes of the form
+ Case(ci,p,c,[|Meta;...;Meta|];
+ CAUTION: it does not deal with the general case of eta-zeta
+ reduced branches having a form different from Meta, as it
+ would be theoretically the case with third-party code *)
+ let n = List.length l in
+ let ctx, body = Term.decompose_lam_n_decls n fi in
+ let head, args = decompose_app_vect body in
+ (* Strip cast because clenv_cast_meta adds a cast when the branch is
+ eta-expanded but when not when the branch has the single-meta
+ form [Meta] *)
+ let head = strip_outer_cast head in
+ if isMeta head then begin
+ assert (args = Context.Rel.to_extended_vect mkRel 0 ctx);
+ let head' = lift (-n) head in
+ let (r,_,s,head'') = mk_refgoals sigma goal lacc ty head' in
+ let fi' = it_mkLambda_or_LetIn (mkApp (head'',args)) ctx in
+ (r,s,fi'::bacc)
+ end
+ else
+ (* Supposed to be meta-free *)
+ let sigma, t'ty = goal_type_of env sigma fi in
+ let sigma = check_conv_leq_goal env sigma fi t'ty ty in
+ (lacc,sigma,fi::bacc))
+ (acc',sigma,[]) lbrty lf ci.ci_pp_info.cstr_tags
let convert_hyp check sign sigma d =
let id = NamedDecl.get_id d in
diff --git a/proofs/pfedit.ml b/proofs/pfedit.ml
index abda04ff1..62a38fa32 100644
--- a/proofs/pfedit.ml
+++ b/proofs/pfedit.ml
@@ -101,6 +101,18 @@ let solve ?with_end_tac gi info_lvl tac pr =
| Some _ -> Proofview.Trace.record_info_trace tac
in
let tac = match gi with
+ | Vernacexpr.SelectAlreadyFocused ->
+ let open Proofview.Notations in
+ Proofview.numgoals >>= fun n ->
+ if n == 1 then tac
+ else
+ let e = CErrors.UserError
+ (None,
+ Pp.(str "Expected a single focused goal but " ++
+ int n ++ str " goals are focused."))
+ in
+ Proofview.tclZERO e
+
| Vernacexpr.SelectNth i -> Proofview.tclFOCUS i i tac
| Vernacexpr.SelectList l -> Proofview.tclFOCUSLIST l tac
| Vernacexpr.SelectId id -> Proofview.tclFOCUSID id tac
diff --git a/proofs/proof_bullet.ml b/proofs/proof_bullet.ml
index e22d382f7..d6f7c0e93 100644
--- a/proofs/proof_bullet.ml
+++ b/proofs/proof_bullet.ml
@@ -212,6 +212,7 @@ let pr_range_selector (i, j) =
else Pp.(int i ++ str "-" ++ int j)
let pr_goal_selector = function
+ | Vernacexpr.SelectAlreadyFocused -> Pp.str "!"
| Vernacexpr.SelectAll -> Pp.str "all"
| Vernacexpr.SelectNth i -> Pp.int i
| Vernacexpr.SelectList l ->
@@ -221,9 +222,10 @@ let pr_goal_selector = function
| Vernacexpr.SelectId id -> Names.Id.print id
let parse_goal_selector = function
+ | "!" -> Vernacexpr.SelectAlreadyFocused
| "all" -> Vernacexpr.SelectAll
| i ->
- let err_msg = "The default selector must be \"all\" or a natural number." in
+ let err_msg = "The default selector must be \"all\" or \"!\" or a natural number." in
begin try
let i = int_of_string i in
if i < 0 then CErrors.user_err Pp.(str err_msg);
diff --git a/stm/stm.ml b/stm/stm.ml
index 326b6d1c2..cbd324f5c 100644
--- a/stm/stm.ml
+++ b/stm/stm.ml
@@ -92,11 +92,11 @@ let execution_error ?loc state_id msg =
module Hooks = struct
let state_computed, state_computed_hook = Hook.make
- ~default:(fun state_id ~in_cache ->
+ ~default:(fun ~doc:_ state_id ~in_cache ->
feedback ~id:state_id Processed) ()
let state_ready, state_ready_hook = Hook.make
- ~default:(fun state_id -> ()) ()
+ ~default:(fun ~doc:_ state_id -> ()) ()
let forward_feedback, forward_feedback_hook =
let m = Mutex.create () in
@@ -106,7 +106,7 @@ let forward_feedback, forward_feedback_hook =
with e -> Mutex.unlock m; raise e) ()
let unreachable_state, unreachable_state_hook = Hook.make
- ~default:(fun _ _ -> ()) ()
+ ~default:(fun ~doc:_ _ _ -> ()) ()
include Hook
@@ -578,7 +578,7 @@ end = struct (* {{{ *)
| None -> raise Vcs_aux.Expired
let set_state id s =
(get_info id).state <- s;
- if async_proofs_is_master !cur_opt then Hooks.(call state_ready id)
+ if async_proofs_is_master !cur_opt then Hooks.(call state_ready ~doc:dummy_doc (* XXX should be taken in input *) id)
let get_state id = (get_info id).state
let reached id =
let info = get_info id in
@@ -770,6 +770,7 @@ module State : sig
Warning: an optimization in installed_cached requires that state
modifying functions are always executed using this wrapper. *)
val define :
+ doc:doc ->
?safe_id:Stateid.t ->
?redefine:bool -> ?cache:Summary.marshallable ->
?feedback_processed:bool -> (unit -> unit) -> Stateid.t -> unit
@@ -919,7 +920,7 @@ end = struct (* {{{ *)
let e2 = Summary.project_from_summary s2 Global.global_env_summary_tag in
e1 == e2
- let define ?safe_id ?(redefine=false) ?(cache=`No) ?(feedback_processed=true)
+ let define ~doc ?safe_id ?(redefine=false) ?(cache=`No) ?(feedback_processed=true)
f id
=
feedback ~id:id (ProcessingIn !Flags.async_proofs_worker_id);
@@ -938,7 +939,7 @@ end = struct (* {{{ *)
stm_prerr_endline (fun () -> "setting cur id to "^str_id);
cur_id := id;
if feedback_processed then
- Hooks.(call state_computed id ~in_cache:false);
+ Hooks.(call state_computed ~doc id ~in_cache:false);
VCS.reached id;
if Proof_global.there_are_pending_proofs () then
VCS.goals id (Proof_global.get_open_goals ())
@@ -954,7 +955,7 @@ end = struct (* {{{ *)
| Some _, None -> (e, info)
| Some (_,at), Some id -> (e, Stateid.add info ~valid:id at) in
if cache = `Yes || cache = `Shallow then freeze_invalid id ie;
- Hooks.(call unreachable_state id ie);
+ Hooks.(call unreachable_state ~doc id ie);
Exninfo.iraise ie
let init_state = ref None
@@ -1352,6 +1353,7 @@ module rec ProofTask : sig
and type request := request
val build_proof_here :
+ doc:doc ->
?loc:Loc.t ->
drop_pt:bool ->
Stateid.t * Stateid.t -> Stateid.t ->
@@ -1466,11 +1468,12 @@ end = struct (* {{{ *)
execution_error start (Pp.strbrk s);
feedback (InProgress ~-1)
- let build_proof_here ?loc ~drop_pt (id,valid) eop =
+ let build_proof_here ~doc ?loc ~drop_pt (id,valid) eop =
Future.create (State.exn_on id ~valid) (fun () ->
let wall_clock1 = Unix.gettimeofday () in
- if VCS.is_interactive () = `No then Reach.known_state ~cache:`No eop
- else Reach.known_state ~cache:`Shallow eop;
+ if VCS.is_interactive () = `No
+ then Reach.known_state ~doc ~cache:`No eop
+ else Reach.known_state ~doc ~cache:`Shallow eop;
let wall_clock2 = Unix.gettimeofday () in
Aux_file.record_in_aux_at ?loc "proof_build_time"
(Printf.sprintf "%.3f" (wall_clock2 -. wall_clock1));
@@ -1484,7 +1487,7 @@ end = struct (* {{{ *)
VCS.print ();
let proof, future_proof, time =
let wall_clock = Unix.gettimeofday () in
- let fp = build_proof_here ?loc ~drop_pt:drop exn_info stop in
+ let fp = build_proof_here ~doc:dummy_doc (* XXX should be document *) ?loc ~drop_pt:drop exn_info stop in
let proof = Future.force fp in
proof, fp, Unix.gettimeofday () -. wall_clock in
(* We typecheck the proof with the kernel (in the worker) to spot
@@ -1577,7 +1580,7 @@ end = struct (* {{{ *)
msg_warning Pp.(strbrk("Marshalling error: "^s^". "^
"The system state could not be sent to the worker process. "^
"Falling back to local, lazy, evaluation."));
- t_assign(`Comp(build_proof_here ?loc:t_loc ~drop_pt t_exn_info t_stop));
+ t_assign(`Comp(build_proof_here ~doc:dummy_doc (* XXX should be stored in a closure, it is the same doc that was used to generate the task *) ?loc:t_loc ~drop_pt t_exn_info t_stop));
feedback (InProgress ~-1)
end (* }}} *)
@@ -1587,6 +1590,7 @@ and Slaves : sig
(* (eventually) remote calls *)
val build_proof :
+ doc:doc ->
?loc:Loc.t -> drop_pt:bool ->
exn_info:(Stateid.t * Stateid.t) -> block_start:Stateid.t -> block_stop:Stateid.t ->
name:string -> future_proof * AsyncTaskQueue.cancel_switch
@@ -1634,7 +1638,7 @@ end = struct (* {{{ *)
with VCS.Expired -> cur in
aux stop in
try
- Reach.known_state ~cache:`No stop;
+ Reach.known_state ~doc:dummy_doc (* XXX should be document *) ~cache:`No stop;
if drop then
let _proof = Proof_global.return_proof ~allow_partial:true () in
`OK_ADMITTED
@@ -1647,7 +1651,7 @@ end = struct (* {{{ *)
Proof_global.close_proof ~keep_body_ucst_separate:true (fun x -> x) 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 ~cache:`No start;
+ Reach.known_state ~doc:dummy_doc (* XXX should be document *) ~cache:`No start;
(* STATE SPEC:
* - start: First non-expired state! [This looks very fishy]
* - end : start + qed
@@ -1754,7 +1758,7 @@ end = struct (* {{{ *)
BuildProof { t_states = s2 } -> overlap_rel s1 s2
| _ -> 0)
- let build_proof ?loc ~drop_pt ~exn_info ~block_start ~block_stop ~name:pname =
+ let build_proof ~doc ?loc ~drop_pt ~exn_info ~block_start ~block_stop ~name:pname =
let id, valid as t_exn_info = exn_info in
let cancel_switch = ref false in
if TaskQueue.n_workers (Option.get !queue) = 0 then
@@ -1769,7 +1773,7 @@ end = struct (* {{{ *)
TaskQueue.enqueue_task (Option.get !queue) task ~cancel_switch;
f, cancel_switch
end else
- ProofTask.build_proof_here ?loc ~drop_pt t_exn_info block_stop, cancel_switch
+ ProofTask.build_proof_here ~doc ?loc ~drop_pt t_exn_info block_stop, cancel_switch
else
let f, t_assign = Future.create_delegate ~name:pname (State.exn_on id ~valid) in
let t_uuid = Future.uuid f in
@@ -1892,7 +1896,7 @@ end = struct (* {{{ *)
let perform { r_state = id; r_state_fb; r_document = vcs; r_ast; r_goal } =
Option.iter VCS.restore vcs;
try
- Reach.known_state ~cache:`No id;
+ Reach.known_state ~doc:dummy_doc (* XXX should be vcs *) ~cache:`No id;
stm_purify (fun () ->
let _,_,_,_,sigma0 = Proof.proof (Proof_global.give_me_the_proof ()) in
let g = Evd.find sigma0 r_goal in
@@ -2047,7 +2051,7 @@ end = struct (* {{{ *)
let perform { r_where; r_doc; r_what; r_for } =
VCS.restore r_doc;
VCS.print ();
- Reach.known_state ~cache:`No r_where;
+ Reach.known_state ~doc:dummy_doc (* XXX should be r_doc *) ~cache:`No r_where;
(* STATE *)
let st = Vernacstate.freeze_interp_state `No in
try
@@ -2092,7 +2096,8 @@ end (* }}} *)
and Reach : sig
val known_state :
- ?redefine_qed:bool -> cache:Summary.marshallable -> Stateid.t -> unit
+ doc:doc -> ?redefine_qed:bool -> cache:Summary.marshallable ->
+ Stateid.t -> unit
end = struct (* {{{ *)
@@ -2250,7 +2255,7 @@ let log_processing_sync id name reason = log_string Printf.(sprintf
let wall_clock_last_fork = ref 0.0
-let known_state ?(redefine_qed=false) ~cache id =
+let known_state ~doc ?(redefine_qed=false) ~cache id =
let error_absorbing_tactic id blockname exn =
(* We keep the static/dynamic part of block detection separate, since
@@ -2345,7 +2350,7 @@ let known_state ?(redefine_qed=false) ~cache id =
and reach ?safe_id ?(redefine_qed=false) ?(cache=cache) id =
stm_prerr_endline (fun () -> "reaching: " ^ Stateid.to_string id);
if not redefine_qed && State.is_cached ~cache id then begin
- Hooks.(call state_computed id ~in_cache:true);
+ Hooks.(call state_computed ~doc id ~in_cache:true);
stm_prerr_endline (fun () -> "reached (cache)");
State.install_cached id
end else
@@ -2426,7 +2431,7 @@ let known_state ?(redefine_qed=false) ~cache id =
^" proof. Reprocess the command declaring "
^"the proof's statement to avoid that."));
let fp, cancel =
- Slaves.build_proof
+ Slaves.build_proof ~doc
?loc ~drop_pt ~exn_info ~block_start ~block_stop ~name in
Future.replace ofp fp;
qed.fproof <- Some (fp, cancel);
@@ -2438,10 +2443,10 @@ let known_state ?(redefine_qed=false) ~cache id =
reach ~cache:`Shallow block_start;
let fp, cancel =
if delegate then
- Slaves.build_proof
+ Slaves.build_proof ~doc
?loc ~drop_pt ~exn_info ~block_start ~block_stop ~name
else
- ProofTask.build_proof_here ?loc
+ ProofTask.build_proof_here ~doc ?loc
~drop_pt exn_info block_stop, ref false
in
qed.fproof <- Some (fp, cancel);
@@ -2511,7 +2516,7 @@ let known_state ?(redefine_qed=false) ~cache id =
let cache_step =
if !cur_opt.async_proofs_cache = Some Force then `Yes
else cache_step in
- State.define ?safe_id
+ State.define ~doc ?safe_id
~cache:cache_step ~redefine:redefine_qed ~feedback_processed step id;
stm_prerr_endline (fun () -> "reached: "^ Stateid.to_string id) in
reach ~redefine_qed id
@@ -2600,7 +2605,7 @@ let new_doc { doc_type ; iload_path; require_libs; stm_options } =
load_objs require_libs;
(* We record the state at this point! *)
- State.define ~cache:`Yes ~redefine:true (fun () -> ()) Stateid.initial;
+ State.define ~doc ~cache:`Yes ~redefine:true (fun () -> ()) Stateid.initial;
Backtrack.record ();
Slaves.init ();
if async_proofs_is_master !cur_opt then begin
@@ -2621,7 +2626,7 @@ let new_doc { doc_type ; iload_path; require_libs; stm_options } =
let observe ~doc id =
let vcs = VCS.backup () in
try
- Reach.known_state ~cache:(VCS.is_interactive ()) id;
+ Reach.known_state ~doc ~cache:(VCS.is_interactive ()) id;
VCS.print ();
doc
with e ->
@@ -2714,7 +2719,7 @@ let merge_proof_branch ~valid ?id qast keep brname =
VCS.rewrite_merge qed_id ~ours:(Qed (qed ofp)) ~at:master_id brname;
VCS.delete_branch brname;
VCS.gc ();
- let _st = Reach.known_state ~redefine_qed:true ~cache:`No qed_id in
+ let _st : unit = Reach.known_state ~doc:dummy_doc (* XXX should be taken in input *) ~redefine_qed:true ~cache:`No qed_id in
VCS.checkout VCS.Branch.master;
`Unfocus qed_id
| { VCS.kind = `Master } ->
@@ -2766,7 +2771,7 @@ let process_back_meta_command ~newtip ~head oid aast w =
VCS.commit id (Alias (oid,aast));
Backtrack.record (); if w == VtNow then ignore(finish ~doc:dummy_doc); `Ok
-let process_transaction ?(newtip=Stateid.fresh ())
+let process_transaction ~doc ?(newtip=Stateid.fresh ())
({ verbose; loc; expr } as x) c =
stm_pperr_endline (fun () -> str "{{{ processing: " ++ pr_ast x);
let vcs = VCS.backup () in
@@ -2871,11 +2876,11 @@ let process_transaction ?(newtip=Stateid.fresh ())
let in_proof = not (VCS.Branch.equal head VCS.Branch.master) in
let id = VCS.new_node ~id:newtip () in
let head_id = VCS.get_branch_pos head in
- let _st = Reach.known_state ~cache:`Yes head_id in (* ensure it is ok *)
+ let _st : unit = Reach.known_state ~doc ~cache:`Yes head_id in (* ensure it is ok *)
let step () =
VCS.checkout VCS.Branch.master;
let mid = VCS.get_branch_pos VCS.Branch.master in
- let _st' = Reach.known_state ~cache:(VCS.is_interactive ()) mid in
+ let _st' : unit = Reach.known_state ~doc ~cache:(VCS.is_interactive ()) mid in
let st = Vernacstate.freeze_interp_state `No in
ignore(stm_vernac_interp id st x);
(* Vernac x may or may not start a proof *)
@@ -2901,7 +2906,7 @@ let process_transaction ?(newtip=Stateid.fresh ())
end;
VCS.checkout_shallowest_proof_branch ();
end in
- State.define ~safe_id:head_id ~cache:`Yes step id;
+ State.define ~doc ~safe_id:head_id ~cache:`Yes step id;
Backtrack.record (); `Ok
| VtUnknown, VtLater ->
@@ -3015,7 +3020,7 @@ let add ~doc ~ontop ?newtip verb { CAst.loc; v=ast } =
(* XXX: Classifiy vernac should be moved inside process transaction *)
let clas = Vernac_classifier.classify_vernac ast in
let aast = { verbose = verb; indentation; strlen; loc; expr = ast } in
- match process_transaction ?newtip aast clas with
+ match process_transaction ~doc ?newtip aast clas with
| `Ok -> doc, VCS.cur_tip (), `NewTip
| `Unfocus qed_id -> doc, qed_id, `Unfocus (VCS.cur_tip ())
@@ -3030,7 +3035,7 @@ type focus = {
let query ~doc ~at ~route s =
stm_purify (fun s ->
if Stateid.equal at Stateid.dummy then ignore(finish ~doc:dummy_doc)
- else Reach.known_state ~cache:`Yes at;
+ else Reach.known_state ~doc ~cache:`Yes at;
try
while true do
let { CAst.loc; v=ast } = parse_sentence ~doc at s in
@@ -3092,7 +3097,7 @@ let edit_at ~doc id =
VCS.edit_branch (`Edit (mode, qed_id, master_id, keep, old_branch));
VCS.delete_boxes_of id;
cancel_switch := true;
- Reach.known_state ~cache:(VCS.is_interactive ()) id;
+ Reach.known_state ~doc ~cache:(VCS.is_interactive ()) id;
VCS.checkout_shallowest_proof_branch ();
`Focus { stop = qed_id; start = master_id; tip } in
let no_edit = function
@@ -3115,7 +3120,7 @@ let edit_at ~doc id =
VCS.gc ();
VCS.print ();
if not !cur_opt.async_proofs_full then
- Reach.known_state ~cache:(VCS.is_interactive ()) id;
+ Reach.known_state ~doc ~cache:(VCS.is_interactive ()) id;
VCS.checkout_shallowest_proof_branch ();
`NewTip in
try
@@ -3144,7 +3149,7 @@ let edit_at ~doc id =
| true, None, _ ->
if on_cur_branch id then begin
VCS.reset_branch (VCS.current_branch ()) id;
- Reach.known_state ~cache:(VCS.is_interactive ()) id;
+ Reach.known_state ~doc ~cache:(VCS.is_interactive ()) id;
VCS.checkout_shallowest_proof_branch ();
`NewTip
end else if is_ancestor_of_cur_branch id then begin
@@ -3207,4 +3212,9 @@ 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)
+type document = VCS.vcs
+let backup () = VCS.backup ()
+let restore d = VCS.restore d
+
+
(* vim:set foldmethod=marker: *)
diff --git a/stm/stm.mli b/stm/stm.mli
index 7a720aa72..aed7274d0 100644
--- a/stm/stm.mli
+++ b/stm/stm.mli
@@ -263,11 +263,12 @@ val register_proof_block_delimiter :
* the alternative toploop for the worker can be selected by changing
* the name of the Task(s) above) *)
-val state_computed_hook : (Stateid.t -> in_cache:bool -> unit) Hook.t
-val unreachable_state_hook : (Stateid.t -> Exninfo.iexn -> unit) Hook.t
+val state_computed_hook : (doc:doc -> Stateid.t -> in_cache:bool -> unit) Hook.t
+val unreachable_state_hook :
+ (doc:doc -> Stateid.t -> Exninfo.iexn -> unit) Hook.t
(* ready means that master has it at hand *)
-val state_ready_hook : (Stateid.t -> unit) Hook.t
+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
@@ -283,3 +284,7 @@ val get_all_proof_names : doc:doc -> Id.t list
(** Enable STM debugging *)
val stm_debug : bool ref
+
+type document
+val backup : unit -> document
+val restore : document -> unit
diff --git a/stm/workerLoop.ml b/stm/workerLoop.ml
index 5445925b1..5130b019a 100644
--- a/stm/workerLoop.ml
+++ b/stm/workerLoop.ml
@@ -17,9 +17,9 @@ let rec parse = function
| x :: rest -> x :: parse rest
| [] -> []
-let loop init _coq_args extra_args =
+let loop init coq_args extra_args =
let args = parse extra_args in
Flags.quiet := true;
init ();
CoqworkmgrApi.init !async_proofs_worker_priority;
- args
+ coq_args, args
diff --git a/stm/workerLoop.mli b/stm/workerLoop.mli
index f02edb9bb..37ec6dacc 100644
--- a/stm/workerLoop.mli
+++ b/stm/workerLoop.mli
@@ -11,4 +11,6 @@
(* Default priority *)
val async_proofs_worker_priority : CoqworkmgrApi.priority ref
-val loop : (unit -> unit) -> Coqargs.coq_cmdopts -> string list -> string list
+val loop :
+ (unit -> unit) -> Coqargs.coq_cmdopts -> string list ->
+ Coqargs.coq_cmdopts * string list
diff --git a/tactics/tacticals.ml b/tactics/tacticals.ml
index 5e81e2d4b..82b178388 100644
--- a/tactics/tacticals.ml
+++ b/tactics/tacticals.ml
@@ -496,7 +496,9 @@ module New = struct
| Vernacexpr.SelectNth i -> Proofview.tclFOCUS i i
| Vernacexpr.SelectList l -> Proofview.tclFOCUSLIST l
| Vernacexpr.SelectId id -> Proofview.tclFOCUSID id
- | Vernacexpr.SelectAll -> fun tac -> tac
+ | Vernacexpr.SelectAll -> anomaly ~label:"tclSELECT" Pp.(str "SelectAll not allowed here")
+ | Vernacexpr.SelectAlreadyFocused ->
+ anomaly ~label:"tclSELECT" Pp.(str "SelectAlreadyFocused not allowed here")
(* Check that holes in arguments have been resolved *)
diff --git a/tactics/tactics.ml b/tactics/tactics.ml
index 482571ea8..3a20c3fc4 100644
--- a/tactics/tactics.ml
+++ b/tactics/tactics.ml
@@ -198,32 +198,40 @@ end
let convert x y = convert_gen Reduction.CONV x y
let convert_leq x y = convert_gen Reduction.CUMUL x y
-let clear_dependency_msg env sigma id = function
+let clear_in_global_msg = function
+ | None -> mt ()
+ | Some ref -> str " implicitly in " ++ Printer.pr_global ref
+
+let clear_dependency_msg env sigma id err inglobal =
+ let pp = clear_in_global_msg inglobal in
+ match err with
| Evarutil.OccurHypInSimpleClause None ->
- Id.print id ++ str " is used in conclusion."
+ Id.print id ++ str " is used" ++ pp ++ str " in conclusion."
| Evarutil.OccurHypInSimpleClause (Some id') ->
- Id.print id ++ strbrk " is used in hypothesis " ++ Id.print id' ++ str"."
+ Id.print id ++ strbrk " is used" ++ pp ++ str " in hypothesis " ++ Id.print id' ++ str"."
| Evarutil.EvarTypingBreak ev ->
str "Cannot remove " ++ Id.print id ++
strbrk " without breaking the typing of " ++
Printer.pr_existential env sigma ev ++ str"."
-let error_clear_dependency env sigma id err =
- user_err (clear_dependency_msg env sigma id err)
+let error_clear_dependency env sigma id err inglobal =
+ user_err (clear_dependency_msg env sigma id err inglobal)
-let replacing_dependency_msg env sigma id = function
+let replacing_dependency_msg env sigma id err inglobal =
+ let pp = clear_in_global_msg inglobal in
+ match err with
| Evarutil.OccurHypInSimpleClause None ->
- str "Cannot change " ++ Id.print id ++ str ", it is used in conclusion."
+ str "Cannot change " ++ Id.print id ++ str ", it is used" ++ pp ++ str " in conclusion."
| Evarutil.OccurHypInSimpleClause (Some id') ->
str "Cannot change " ++ Id.print id ++
- strbrk ", it is used in hypothesis " ++ Id.print id' ++ str"."
+ strbrk ", it is used" ++ pp ++ str " in hypothesis " ++ Id.print id' ++ str"."
| Evarutil.EvarTypingBreak ev ->
str "Cannot change " ++ Id.print id ++
strbrk " without breaking the typing of " ++
Printer.pr_existential env sigma ev ++ str"."
-let error_replacing_dependency env sigma id err =
- user_err (replacing_dependency_msg env sigma id err)
+let error_replacing_dependency env sigma id err inglobal =
+ user_err (replacing_dependency_msg env sigma id err inglobal)
(* This tactic enables the user to remove hypotheses from the signature.
* Some care is taken to prevent him from removing variables that are
@@ -242,7 +250,7 @@ let clear_gen fail = function
let evdref = ref sigma in
let (hyps, concl) =
try clear_hyps_in_evi env evdref (named_context_val env) concl ids
- with Evarutil.ClearDependencyError (id,err) -> fail env sigma id err
+ with Evarutil.ClearDependencyError (id,err,inglobal) -> fail env sigma id err inglobal
in
let env = reset_with_named_context hyps env in
Proofview.tclTHEN (Proofview.Unsafe.tclEVARS !evdref)
@@ -426,8 +434,8 @@ let clear_hyps2 env sigma ids sign t cl =
let evdref = ref (Evd.clear_metas sigma) in
let (hyps,t,cl) = Evarutil.clear_hyps2_in_evi env evdref sign t cl ids in
(hyps, t, cl, !evdref)
- with Evarutil.ClearDependencyError (id,err) ->
- error_replacing_dependency env sigma id err
+ with Evarutil.ClearDependencyError (id,err,inglobal) ->
+ error_replacing_dependency env sigma id err inglobal
let internal_cut_gen ?(check=true) dir replace id t =
Proofview.Goal.enter begin fun gl ->
@@ -3007,8 +3015,24 @@ let unfold_body x =
end
end
+let warn_cannot_remove_as_expected =
+ CWarnings.create ~name:"cannot-remove-as-expected" ~category:"tactics"
+ (fun (id,inglobal) ->
+ let pp = match inglobal with
+ | None -> mt ()
+ | Some ref -> str ", it is used implicitly in " ++ Printer.pr_global ref in
+ str "Cannot remove " ++ Id.print id ++ pp ++ str ".")
+
+let clear_for_destruct ids =
+ Proofview.tclORELSE
+ (clear_gen (fun env sigma id err inglobal -> raise (ClearDependencyError (id,err,inglobal))) ids)
+ (function
+ | ClearDependencyError (id,err,inglobal),_ -> warn_cannot_remove_as_expected (id,inglobal); Proofview.tclUNIT ()
+ | e -> iraise e)
+
(* Either unfold and clear if defined or simply clear if not a definition *)
-let expand_hyp id = Tacticals.New.tclTRY (unfold_body id) <*> clear [id]
+let expand_hyp id =
+ Tacticals.New.tclTRY (unfold_body id) <*> clear_for_destruct [id]
(*****************************)
(* High-level induction *)
diff --git a/test-suite/Makefile b/test-suite/Makefile
index 8239600b1..9d84cd5c7 100644
--- a/test-suite/Makefile
+++ b/test-suite/Makefile
@@ -79,6 +79,8 @@ log_anomaly = "==========> FAILURE <=========="
log_failure = "==========> FAILURE <=========="
log_intro = "==========> TESTING $(1) <=========="
+FAIL = >&2 echo 'FAILED $@'
+
#######################################################################
# Testing subsystems
#######################################################################
@@ -115,25 +117,24 @@ run: $(SUBSYSTEMS)
bugs: $(BUGS)
clean:
- rm -f trace .lia.cache
- $(SHOW) "RM <**/*.stamp> <**/*.vo> <**/*.vio> <**/*.log>"
+ rm -f trace .lia.cache output/MExtraction.out
+ $(SHOW) "RM <**/*.vo> <**/*.vio> <**/*.log> <**/*.glob>"
$(HIDE)find . \( \
- -name '*.stamp' -o -name '*.vo' -o -name '*.vio' -o -name '*.log' \
+ -name '*.vo' -o -name '*.vio' -o -name '*.log' -o -name '*.glob' \
\) -print0 | xargs -0 rm -f
distclean: clean
- $(HIDE)find . -name '*.log' -print0 | xargs -0 rm -f
+ $(SHOW) "RM <**/*.aux>"
+ $(HIDE)find . -name '*.aux' -print0 | xargs -0 rm -f
#######################################################################
# Per-subsystem targets
#######################################################################
-define mkstamp
-$(1): $(1).stamp ; @true
-$(1).stamp: $(patsubst %.v,%.v.log,$(wildcard $(1)/*.v)) ; \
- $(HIDE)touch $$@
+define vdeps
+$(1): $(patsubst %.v,%.v.log,$(wildcard $(1)/*.v))
endef
-$(foreach S,$(VSUBSYSTEMS),$(eval $(call mkstamp,$(S))))
+$(foreach S,$(VSUBSYSTEMS),$(eval $(call vdeps,$(S))))
#######################################################################
# Summary
@@ -221,6 +222,7 @@ $(addsuffix .log,$(wildcard bugs/opened/*.v)): %.v.log: %.v
else \
echo $(log_failure); \
echo " $<...Error! (bug seems to be closed, please check)"; \
+ $(FAIL); \
fi; \
} > "$@"
@@ -236,6 +238,7 @@ $(addsuffix .log,$(wildcard bugs/closed/*.v)): %.v.log: %.v
else \
echo $(log_failure); \
echo " $<...Error! (bug seems to be opened, please check)"; \
+ $(FAIL); \
fi; \
} > "$@"
@@ -251,6 +254,7 @@ $(addsuffix .log,$(wildcard prerequisite/*.v)): %.v.log: %.v
if [ $$R != 0 ]; then \
echo $(log_failure); \
echo " $<...could not be prepared" ; \
+ $(FAIL); \
else \
echo $(log_success); \
echo " $<...correctly prepared" ; \
@@ -269,6 +273,7 @@ $(addsuffix .log,$(wildcard success/*.v micromega/*.v modules/*.v)): %.v.log: %.
else \
echo $(log_failure); \
echo " $<...Error! (should be accepted)"; \
+ $(FAIL); \
fi; \
} > "$@"
@@ -285,6 +290,7 @@ $(addsuffix .log,$(wildcard stm/*.v)): %.v.log: %.v
else \
echo $(log_failure); \
echo " $<...Error! (should be accepted)"; \
+ $(FAIL); \
fi; \
} > "$@"
@@ -299,6 +305,7 @@ $(addsuffix .log,$(wildcard failure/*.v)): %.v.log: %.v $(PREREQUISITELOG)
else \
echo $(log_failure); \
echo " $<...Error! (should be rejected)"; \
+ $(FAIL); \
fi; \
} > "$@"
@@ -321,6 +328,7 @@ $(addsuffix .log,$(wildcard output/*.v)): %.v.log: %.v %.out $(PREREQUISITELOG)
else \
echo $(log_failure); \
echo " $<...Error! (unexpected output)"; \
+ $(FAIL); \
fi; \
rm $$tmpoutput; \
} > "$@"
@@ -363,6 +371,7 @@ $(addsuffix .log,$(wildcard output-modulo-time/*.v)): %.v.log: %.v %.out
else \
echo $(log_failure); \
echo " $<...Error! (unexpected output)"; \
+ $(FAIL); \
fi; \
rm $$tmpoutput; \
rm $$tmpexpected; \
@@ -379,6 +388,7 @@ $(addsuffix .log,$(wildcard interactive/*.v)): %.v.log: %.v $(PREREQUISITELOG)
else \
echo $(log_failure); \
echo " $<...Error! (should be accepted)"; \
+ $(FAIL); \
fi; \
} > "$@"
@@ -411,6 +421,7 @@ $(addsuffix .log,$(wildcard complexity/*.v)): %.v.log: %.v $(PREREQUISITELOG)
else \
echo $(log_failure); \
echo " $<...Error! (should run faster)"; \
+ $(FAIL); \
fi; \
fi; \
} > "$@"
@@ -428,6 +439,7 @@ $(addsuffix .log,$(wildcard ideal-features/*.v)): %.v.log: %.v $(PREREQUISITELOG
else \
echo $(log_failure); \
echo " $<...Good news! (wish seems to be granted, please check)"; \
+ $(FAIL); \
fi; \
} > "$@"
@@ -462,6 +474,7 @@ $(patsubst %.sh,%.log,$(wildcard misc/*.sh)): %.log: %.sh $(PREREQUISITELOG)
else \
echo $(log_failure); \
echo " $<...Error!"; \
+ $(FAIL); \
fi; \
} > "$@"
@@ -480,6 +493,7 @@ ide : $(patsubst %.fake,%.fake.log,$(wildcard ide/*.fake))
else \
echo $(log_failure); \
echo " $<...Error!"; \
+ $(FAIL); \
fi; \
} > "$@"
@@ -499,6 +513,7 @@ vio: $(patsubst %.v,%.vio.log,$(wildcard vio/*.v))
else \
echo $(log_failure); \
echo " $<...Error!"; \
+ $(FAIL); \
fi; \
} > "$@"
@@ -517,6 +532,7 @@ coqchk: $(patsubst %.v,%.chk.log,$(wildcard coqchk/*.v))
else \
echo $(log_failure); \
echo " $<...Error!"; \
+ $(FAIL); \
fi; \
} > "$@"
@@ -536,6 +552,7 @@ coqwc/%.v.log : coqwc/%.v
else \
echo $(log_failure); \
echo " $<...Error! (unexpected output)"; \
+ $(FAIL); \
fi; \
rm $$tmpoutput; \
} > "$@"
@@ -556,6 +573,7 @@ coq-makefile/%.log : coq-makefile/%/run.sh
else \
echo $(log_failure); \
echo " $<...Error!"; \
+ $(FAIL); \
fi; \
) > "$@"
@@ -580,5 +598,6 @@ $(addsuffix .log,$(wildcard coqdoc/*.v)): %.v.log: %.v %.html.out %.tex.out $(PR
else \
echo $(log_failure); \
echo " $<...Error! (unexpected output)"; \
+ $(FAIL); \
fi; \
} > "$@"
diff --git a/test-suite/success/evars.v b/test-suite/success/evars.v
index 5b13f35d5..253b48e4d 100644
--- a/test-suite/success/evars.v
+++ b/test-suite/success/evars.v
@@ -421,3 +421,8 @@ Goal exists n : nat, n = n -> True.
eexists.
set (H := _ = _).
Abort.
+
+(* Check interpretation of default evar instance in pretyping *)
+(* (reported as bug #7356) *)
+
+Check fun (P : nat -> Prop) (x:nat) (h:P x) => exist _ ?[z] (h : P ?z).
diff --git a/test-suite/success/goal_selector.v b/test-suite/success/goal_selector.v
index 868140517..0951c5c8d 100644
--- a/test-suite/success/goal_selector.v
+++ b/test-suite/success/goal_selector.v
@@ -53,3 +53,17 @@ Goal True -> exists (x : Prop), x.
Proof.
intro H; eexists ?[x]; only [x]: exact True. 1: assumption.
Qed.
+
+(* Strict focusing! *)
+Set Default Goal Selector "!".
+
+Goal True -> True /\ True /\ True.
+Proof.
+ intro.
+ split;only 2:split.
+ Fail exact I.
+ Fail !:exact I.
+ 1:exact I.
+ - !:exact H.
+ - exact I.
+Qed.
diff --git a/theories/Lists/Streams.v b/theories/Lists/Streams.v
index 310c651e8..8a01b8fb1 100644
--- a/theories/Lists/Streams.v
+++ b/theories/Lists/Streams.v
@@ -196,7 +196,7 @@ Lemma ForAll_map : forall (P:Stream B -> Prop) (S:Stream A), ForAll (fun s => P
(map s)) S <-> ForAll P (map S).
Proof.
intros P S.
-split; generalize S; clear S; cofix; intros S; constructor;
+split; generalize S; clear S; cofix ForAll_map; intros S; constructor;
destruct H as [H0 H]; firstorder.
Qed.
diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml
index 0dabed6b7..668f9b893 100644
--- a/toplevel/coqtop.ml
+++ b/toplevel/coqtop.ml
@@ -368,7 +368,7 @@ let init_color color_mode =
let toploop_init = ref begin fun opts x ->
let () = init_color opts.color in
let () = CoqworkmgrApi.init !WorkerLoop.async_proofs_worker_priority in
- x
+ opts, x
end
let print_style_tags opts =
@@ -442,7 +442,7 @@ let init_toplevel arglist =
let top_lp = Coqinit.toplevel_init_load_path () in
List.iter Mltop.add_coq_path top_lp;
Option.iter Mltop.load_ml_object_raw opts.toploop;
- let extras = !toploop_init opts extras in
+ let opts, extras = !toploop_init opts extras in
if not (CList.is_empty extras) then begin
prerr_endline ("Don't know what to do with "^String.concat " " extras);
prerr_endline "See -help for the list of supported options";
diff --git a/toplevel/coqtop.mli b/toplevel/coqtop.mli
index 056279bbd..fcc569ca0 100644
--- a/toplevel/coqtop.mli
+++ b/toplevel/coqtop.mli
@@ -18,5 +18,6 @@ val init_toplevel : string list -> Vernac.State.t option * Coqargs.coq_cmdopts
val start : unit -> unit
(* For other toploops *)
-val toploop_init : (Coqargs.coq_cmdopts -> string list -> string list) ref
+val toploop_init :
+ (Coqargs.coq_cmdopts -> string list -> Coqargs.coq_cmdopts * string list) ref
val toploop_run : (Coqargs.coq_cmdopts -> state:Vernac.State.t -> unit) ref
diff --git a/vernac/classes.ml b/vernac/classes.ml
index a98fc15ce..2e1bd6970 100644
--- a/vernac/classes.ml
+++ b/vernac/classes.ml
@@ -425,7 +425,7 @@ let context poly l =
let nstatus = match b with
| None ->
pi3 (ComAssumption.declare_assumption false decl (t, univs) Universes.empty_binders [] impl
- Vernacexpr.NoInline (CAst.make id))
+ Declaremods.NoInline (CAst.make id))
| Some b ->
let decl = (Discharge, poly, Definition) in
let entry = Declare.definition_entry ~univs ~types:t b in
diff --git a/vernac/comAssumption.ml b/vernac/comAssumption.ml
index 6a590758f..26a46a752 100644
--- a/vernac/comAssumption.ml
+++ b/vernac/comAssumption.ml
@@ -20,7 +20,6 @@ open Constrintern
open Impargs
open Decl_kinds
open Pretyping
-open Vernacexpr
open Entries
(* 2| Variable/Hypothesis/Parameter/Axiom declarations *)
@@ -66,7 +65,7 @@ match local with
| Global | Local | Discharge ->
let do_instance = should_axiom_into_instance local in
let local = DeclareDef.get_locality ident ~kind:"axiom" local in
- let inl = match nl with
+ let inl = let open Declaremods in match nl with
| NoInline -> None
| DefaultInline -> Some (Flags.get_inline_level())
| InlineAt i -> Some i
diff --git a/vernac/comAssumption.mli b/vernac/comAssumption.mli
index 56e324376..a2d20a1d1 100644
--- a/vernac/comAssumption.mli
+++ b/vernac/comAssumption.mli
@@ -19,7 +19,7 @@ open Decl_kinds
(** {6 Parameters/Assumptions} *)
val do_assumptions : locality * polymorphic * assumption_object_kind ->
- Vernacexpr.inline -> (ident_decl list * constr_expr) with_coercion list -> bool
+ Declaremods.inline -> (ident_decl list * constr_expr) with_coercion list -> bool
(************************************************************************)
(** Internal API *)
@@ -32,5 +32,5 @@ val do_assumptions : locality * polymorphic * assumption_object_kind ->
val declare_assumption : coercion_flag -> assumption_kind ->
types in_constant_universes_entry ->
Universes.universe_binders -> Impargs.manual_implicits ->
- bool (** implicit *) -> Vernacexpr.inline -> variable CAst.t ->
+ bool (** implicit *) -> Declaremods.inline -> variable CAst.t ->
global_reference * Univ.Instance.t * bool
diff --git a/vernac/vernacentries.ml b/vernac/vernacentries.ml
index b9600d23d..564c0965b 100644
--- a/vernac/vernacentries.ml
+++ b/vernac/vernacentries.ml
@@ -672,7 +672,7 @@ let vernac_declare_module export {loc;v=id} binders_ast mty_ast =
else (idl,ty)) binders_ast in
let mp =
Declaremods.declare_module Modintern.interp_module_ast
- id binders_ast (Enforce mty_ast) []
+ id binders_ast (Declaremods.Enforce mty_ast) []
in
Dumpglob.dump_moddef ?loc mp "mod";
Flags.if_verbose Feedback.msg_info (str "Module " ++ Id.print id ++ str " is declared");
@@ -1465,22 +1465,22 @@ let _ =
optkey = ["Printing";"Universes"];
optread = (fun () -> !Constrextern.print_universes);
optwrite = (fun b -> Constrextern.print_universes:=b) }
-
+
let _ =
declare_bool_option
{ optdepr = false;
optname = "dumping bytecode after compilation";
optkey = ["Dump";"Bytecode"];
- optread = Flags.get_dump_bytecode;
- optwrite = Flags.set_dump_bytecode }
+ optread = (fun () -> !Cbytegen.dump_bytecode);
+ optwrite = (:=) Cbytegen.dump_bytecode }
let _ =
declare_bool_option
{ optdepr = false;
optname = "dumping VM lambda code after compilation";
optkey = ["Dump";"Lambda"];
- optread = Flags.get_dump_lambda;
- optwrite = Flags.set_dump_lambda }
+ optread = (fun () -> !Clambda.dump_lambda);
+ optwrite = (:=) Clambda.dump_lambda }
let _ =
declare_bool_option