From 297b0cb44bbe8ec7304ca635c566815167266d4a Mon Sep 17 00:00:00 2001
From: Jason Gross
Date: Wed, 24 Jun 2015 11:28:44 +0200
Subject: Revert commit 18796b6aea453bdeef1ad12ce80eeb220bf01e67, close 3080
This reverts 18796b6aea453bdeef1ad12ce80eeb220bf01e67 (Slight change
in the semantics of arguments scopes: scopes can no longer be bound to
Funclass or Sortclass (this does not seem to be useful)). It is
useful to have function_scope for, e.g., function composition. This
allows users to, e.g., automatically interpret ∘ as morphism
composition when expecting a morphism of categories, as functor
composition when expecting a functor, and as function composition when
expecting a function.
Additionally, it is nicer to have fewer special cases in the OCaml
code, and give more things a uniform syntax. (The scope type_scope
should not be special-cased; this change is coming up next.)
Also explicitly define [function_scope] in theories/Init/Notations.v.
This closes bug #3080, Build a [function_scope] like [type_scope], or allow
[Bind Scope ... with Sortclass] and [Bind Scope ... with Funclass]
We now mention Funclass and Sortclass in the documentation of [Bind Scope]
again.
---
doc/refman/RefMan-syn.tex | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-syn.tex b/doc/refman/RefMan-syn.tex
index aabc8a8995..3af72db78e 100644
--- a/doc/refman/RefMan-syn.tex
+++ b/doc/refman/RefMan-syn.tex
@@ -860,11 +860,11 @@ statically. For instance, if {\tt f} is a polymorphic function of type
{\scope}, then {\tt a} of type {\tt t} in {\tt f~t~a} is not
recognized as an argument to be interpreted in scope {\scope}.
-\comindex{Bind Scope}
-Any global reference can be bound by default to an
-interpretation scope. The command to do it is
+\comindex{Bind Scope}
+More generally, any {\class} (see Chapter~\ref{Coercions-full}) can be
+bound to an interpretation scope. The command to do it is
\begin{quote}
-{\tt Bind Scope} {\scope} \texttt{with} {\qualid}
+{\tt Bind Scope} {\scope} \texttt{with} {\class}
\end{quote}
\Example
--
cgit v1.2.3
From 238725dd24d43574690b0111761b705753d3bee2 Mon Sep 17 00:00:00 2001
From: Pierre Courtieu
Date: Mon, 27 Apr 2015 15:40:48 +0200
Subject: typo in refman.
---
doc/refman/RefMan-uti.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-uti.tex b/doc/refman/RefMan-uti.tex
index 0729391062..c282083b5c 100644
--- a/doc/refman/RefMan-uti.tex
+++ b/doc/refman/RefMan-uti.tex
@@ -102,7 +102,7 @@ generator using for instance the command:
This command generates a file \texttt{Makefile} that can be used to
compile all the sources of the current project. It follows the
-syntax described by the output of \texttt{\% coq\_makefile --help}.
+syntax described by the output of \texttt{\% coq\_makefile ----help}.
Once the \texttt{Makefile} file has been generated a first time, it
can be used by the \texttt{make} command to compile part or all of
the project. Note that once it has been generated once, as soon as
--
cgit v1.2.3
From 7c5356ed487dcf7cf915e5471832852f7002586c Mon Sep 17 00:00:00 2001
From: Pierre-Marie Pédrot
Date: Mon, 21 Sep 2015 15:54:19 +0200
Subject: Fixing tutorial.
The V7 to V8 translator lost part of term annotations.
---
doc/tutorial/Tutorial.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/tutorial/Tutorial.tex b/doc/tutorial/Tutorial.tex
index 836944ab1c..e09feeb8eb 100644
--- a/doc/tutorial/Tutorial.tex
+++ b/doc/tutorial/Tutorial.tex
@@ -208,7 +208,7 @@ Definition two : nat := S one.
Actually \Coq~ allows several possible syntaxes:
\begin{coq_example}
-Definition three : nat := S two.
+Definition three := S two : nat.
\end{coq_example}
Here is a way to define the doubling function, which expects an
--
cgit v1.2.3
From 3930c586507bfb3b80297d7a2fdbbc6049aa509b Mon Sep 17 00:00:00 2001
From: Pierre-Marie Pédrot
Date: Thu, 24 Sep 2015 19:13:30 +0200
Subject: Updating the documentation and the toolchain w.r.t. the change in
-compile.
---
doc/refman/RefMan-com.tex | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-com.tex b/doc/refman/RefMan-com.tex
index 6335dfd324..2f9758fdee 100644
--- a/doc/refman/RefMan-com.tex
+++ b/doc/refman/RefMan-com.tex
@@ -162,11 +162,11 @@ Add physical path {\em directory} to the {\ocaml} loadpath.
Load \Coq~compiled file {\em file}{\tt .vo} and import it ({\tt
Require} {\em file}).
-\item[{\tt -compile} {\em file},{\tt -compile-verbose} {\em file}, {\tt -batch}]\
+\item[{\tt -compile} {\em file.v},{\tt -compile-verbose} {\em file.v}, {\tt -batch}]\
{\tt coqtop} options only used internally by {\tt coqc}.
- This compiles file {\em file}{\tt .v} into {\em file}{\tt .vo} without/with a
+ This compiles file {\em file.v} into {\em file}{\tt .vo} without/with a
copy of the contents of the file on standard input. This option implies options
{\tt -batch} (exit just after arguments parsing). It is only
available for {\tt coqtop}.
--
cgit v1.2.3
From 8e25e107a8715728a7227934d7b11035863ee5f0 Mon Sep 17 00:00:00 2001
From: Pierre-Marie Pédrot
Date: Fri, 25 Sep 2015 12:25:35 +0200
Subject: The -require option now accepts a logical path instead of a physical
one.
---
doc/refman/RefMan-com.tex | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-com.tex b/doc/refman/RefMan-com.tex
index 2f9758fdee..0f1823a021 100644
--- a/doc/refman/RefMan-com.tex
+++ b/doc/refman/RefMan-com.tex
@@ -157,10 +157,10 @@ Add physical path {\em directory} to the {\ocaml} loadpath.
Load \Coq~compiled file {\em file}{\tt .vo}
-\item[{\tt -require} {\em file}]\
+\item[{\tt -require} {\em path}]\
- Load \Coq~compiled file {\em file}{\tt .vo} and import it ({\tt
- Require} {\em file}).
+ Load \Coq~compiled library {\em path} and import it (equivalent to {\tt
+ Require Import} {\em path}).
\item[{\tt -compile} {\em file.v},{\tt -compile-verbose} {\em file.v}, {\tt -batch}]\
--
cgit v1.2.3
From 5481ff4f6935874ac3798a61f5a2a810006bde37 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sat, 26 Sep 2015 15:00:33 +0200
Subject: Clarifying the doc of coqdoc --utf8 as discussed on coq-club on
August 19, 2015.
---
doc/refman/coqdoc.tex | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/coqdoc.tex b/doc/refman/coqdoc.tex
index ee2b042f4e..30467a5e6e 100644
--- a/doc/refman/coqdoc.tex
+++ b/doc/refman/coqdoc.tex
@@ -285,7 +285,7 @@ suffix \verb!.tex!.
Select a \texmacs\ output.
-\item[\texttt{--stdout}] ~\par
+\item[\texttt{\mm{}stdout}] ~\par
Write output to stdout.
@@ -496,14 +496,16 @@ Default behavior is to assume ASCII 7 bits input files.
\item[\texttt{-latin1}, \texttt{\mm{}latin1}] ~\par
Select ISO-8859-1 input files. It is equivalent to
- \texttt{--inputenc latin1 --charset iso-8859-1}.
+ \texttt{\mm{}inputenc latin1 \mm{}charset iso-8859-1}.
\item[\texttt{-utf8}, \texttt{\mm{}utf8}] ~\par
- Select UTF-8 (Unicode) input files. It is equivalent to
- \texttt{--inputenc utf8 --charset utf-8}.
- \LaTeX\ UTF-8 support can be found at
- \url{http://www.ctan.org/pkg/unicode}.
+ Set \texttt{\mm{}inputenc utf8x} for \LaTeX\ output and
+ \texttt{\mm{}charset utf-8} for HTML output. Also use Unicode
+ replacements for a couple of standard plain ASCII notations such
+ as $\rightarrow$ for \texttt{->} and $\forall$ for
+ \texttt{forall}. \LaTeX\ UTF-8 support can be found at
+ \url{http://www.ctan.org/pkg/unicode}.
\item[\texttt{\mm{}inputenc} \textit{string}] ~\par
--
cgit v1.2.3
From 4b88d774729e0ab7916730e8e6ebedc2033a87f2 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sat, 26 Sep 2015 16:31:29 +0200
Subject: Documenting how to support some special unicode characters in coqdoc
(thanks to coq-club, Sep 2015).
---
doc/refman/coqdoc.tex | 9 +++++++++
1 file changed, 9 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/coqdoc.tex b/doc/refman/coqdoc.tex
index 30467a5e6e..26dbd59e76 100644
--- a/doc/refman/coqdoc.tex
+++ b/doc/refman/coqdoc.tex
@@ -507,6 +507,15 @@ Default behavior is to assume ASCII 7 bits input files.
\texttt{forall}. \LaTeX\ UTF-8 support can be found at
\url{http://www.ctan.org/pkg/unicode}.
+ For the interpretation of Unicode characters by \LaTeX, extra
+ packages which {\coqdoc} does not provide by default might be
+ required, such as \texttt{textgreek} for some Greek letters or
+ \texttt{stmaryrd} for some mathematical symbols. If a Unicode
+ character is missing an interpretation in the \texttt{utf8x} input
+ encoding, add
+ \verb=\DeclareUnicodeCharacter{=\textit{code}\verb=}{=\textit{latex-interpretation}\verb=}=. Packages
+ and declarations can be added with option \texttt{-p}.
+
\item[\texttt{\mm{}inputenc} \textit{string}] ~\par
Give a \LaTeX\ input encoding, as an option to \LaTeX\ package
--
cgit v1.2.3
From 2cf609c41f7af83d9eaf43308a368fcb7307e6fa Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Mon, 28 Sep 2015 11:04:59 +0200
Subject: Make -load-vernac-object respect the loadpath.
This command-line option was behaving like the old -require, except that
it did not do Import. In other words, it was loading files without
respecting the loadpath. Now it behaves exactly like Require, while
-require now behaves like Require Import.
This patch also removes Library.require_library_from_file and all its
dependencies, since they are no longer used inside Coq.
---
doc/refman/RefMan-com.tex | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-com.tex b/doc/refman/RefMan-com.tex
index 0f1823a021..9862abb533 100644
--- a/doc/refman/RefMan-com.tex
+++ b/doc/refman/RefMan-com.tex
@@ -153,9 +153,9 @@ Add physical path {\em directory} to the {\ocaml} loadpath.
Load \Coq~file {\em file}{\tt .v} optionally with copy it contents on the
standard input.
-\item[{\tt -load-vernac-object} {\em file}]\
+\item[{\tt -load-vernac-object} {\em path}]\
- Load \Coq~compiled file {\em file}{\tt .vo}
+ Load \Coq~compiled library {\em path} (equivalent to {\tt Require} {\em path}).
\item[{\tt -require} {\em path}]\
--
cgit v1.2.3
From 9186689cbd5062a2535413369c72896e6f53a69b Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Wed, 30 Sep 2015 15:38:22 +0200
Subject: Fixing documentation wrt the ctrl-shift-u Unicode input method (see
#2013).
Incidentally made writing style in CoqIDE chapter more homogeneous.
---
doc/refman/RefMan-ide.tex | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-ide.tex b/doc/refman/RefMan-ide.tex
index c8d05013b3..c6fbd1c538 100644
--- a/doc/refman/RefMan-ide.tex
+++ b/doc/refman/RefMan-ide.tex
@@ -215,12 +215,13 @@ mouse button, press the key you want for the new shortcut, and release
the mouse button afterwards. If your system does not allow it, you may still
edit this configuration file by hand, but this is more involved.
-\section{Using unicode symbols}
+\section{Using Unicode symbols}
-\CoqIDE{} supports unicode character encoding in its text windows,
-consequently a large set of symbols is available for notations.
+\CoqIDE{} is based on GTK+ and inherits from it support for Unicode in
+its text windows. Consequently a large set of symbols is available for
+notations.
-\subsection{Displaying unicode symbols}
+\subsection{Displaying Unicode symbols}
You just need to define suitable notations as described in
Chapter~\ref{Addoc-syntax}. For example, to use the mathematical symbols
@@ -236,31 +237,33 @@ file \verb|utf8.v| of \Coq{} library, so you may enable them just by
\verb|Require utf8| inside \CoqIDE{}, or equivalently, by starting
\CoqIDE{} with \verb|coqide -l utf8|.
-However, there are some issues when using such unicode symbols: you of
+However, there are some issues when using such Unicode symbols: you of
course need to use a character font which supports them. In the Fonts
-section of the preferences, the Preview line displays some unicode symbols, so
+section of the preferences, the Preview line displays some Unicode symbols, so
you could figure out if the selected font is OK. Related to this, one
-thing you may need to do is choose whether Gtk should use antialiased
+thing you may need to do is choose whether GTK+ should use antialiased
fonts or not, by setting the environment variable \verb|GDK_USE_XFT|
to 1 or 0 respectively.
\subsection{Defining an input method for non ASCII symbols}
-To input an Unicode symbol, a general method is to press both the
-CONTROL and the SHIFT keys, and type the hexadecimal code of the
+To input a Unicode symbol, a general method provided by GTK+
+is to simultaneously press the
+Control, Shift and ``u'' keys, release, then type the hexadecimal code of the
symbol required, for example \verb|2200| for the $\forall$ symbol.
A list of symbol codes is available at \url{http://www.unicode.org}.
-This method obviously doesn't scale, that's why the preferred alternative is to
-use an Input Method Editor. On POSIX systems (Linux distros, BSD variants and
-MacOS X), you can use \texttt{uim} version 1.6 or later which provides a \LaTeX{}-style
+An alternative method which does not require to know the hexadecimal
+code of the character is to use an Input Method Editor. On POSIX
+systems (Linux distributions, BSD variants and MacOS X), you can use
+\texttt{uim} version 1.6 or later which provides a \LaTeX{}-style
input method.
To configure \texttt{uim}, execute \texttt{uim-pref-gtk} as your regular user.
In the "Global Settings" group set the default Input Method to "ELatin" (don't
forget to tick the checkbox "Specify default IM"). In the "ELatin" group set the
layout to "TeX", and remember the content of the "[ELatin] on" field (by default
-"\textbackslash"). You can now execute CoqIDE with the following commands (assuming
+Control-\textbackslash). You can now execute CoqIDE with the following commands (assuming
you use a Bourne-style shell):
\begin{verbatim}
@@ -268,7 +271,7 @@ $ export GTK_IM_MODULE=uim
$ coqide
\end{verbatim}
-Activate the ELatin Input Method with Ctrl-\textbackslash, then type the
+Activate the ELatin Input Method with Control-\textbackslash, then type the
sequence "\verb=\Gamma=". You will see the sequence being
replaced by $\Gamma$ as soon as you type the second "a".
@@ -286,7 +289,7 @@ detect its character encoding.)
If you choose something else than UTF-8, then missing characters will
be written encoded by \verb|\x{....}| or \verb|\x{........}| where
each dot is an hexadecimal digit: the number between braces is the
-hexadecimal UNICODE index for the missing character.
+hexadecimal Unicode index for the missing character.
%%% Local Variables:
--
cgit v1.2.3
From 9227d6e9412ae4ebe70fb9b6bd5d2f6ecc354864 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Thu, 1 Oct 2015 09:29:10 +0200
Subject: Improving reference manual in that auto uses simple apply rather than
apply.
Still, there are small differences, e.g. on
"use_metas_eagerly_in_conv_on_closed_terms", but also maybe in some
amount of use of delta that Matthieu would know better than me if it
matters or not in practice.
---
doc/refman/RefMan-tac.tex | 51 ++++++++++++++++++++++++++---------------------
1 file changed, 28 insertions(+), 23 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index fa6f783934..06431055ad 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -3394,7 +3394,7 @@ local definition. Example: {\tt unfold not in (Type of H1) (Type of H3).}
This tactic implements a Prolog-like resolution procedure to solve the
current goal. It first tries to solve the goal using the {\tt
assumption} tactic, then it reduces the goal to an atomic one using
-{\tt intros} and introducing the newly generated hypotheses as hints.
+{\tt intros} and introduces the newly generated hypotheses as hints.
Then it looks at the list of tactics associated to the head symbol of
the goal and tries to apply one of them (starting from the tactics
with lower cost). This process is recursively applied to the generated
@@ -3454,11 +3454,10 @@ intact. \texttt{auto} and \texttt{trivial} never fail.
\tacindex{eauto}
\label{eauto}
-This tactic generalizes {\tt auto}. In contrast with
-the latter, {\tt eauto} uses unification of the goal
-against the hints rather than pattern-matching
-(in other words, it uses {\tt eapply} instead of
-{\tt apply}).
+This tactic generalizes {\tt auto}. While {\tt auto} does not try
+resolution hints which would leave existential variables in the goal,
+{\tt eauto} does try them (informally speaking, it uses {\tt eapply}
+where {\tt auto} uses {\tt apply}).
As a consequence, {\tt eauto} can solve such a goal:
\begin{coq_eval}
@@ -3623,21 +3622,27 @@ The {\hintdef} is one of the following expressions:
\item {\tt Resolve \term}
\comindex{Hint Resolve}
- This command adds {\tt apply {\term}} to the hint list
+ This command adds {\tt simple apply {\term}} to the hint list
with the head symbol of the type of \term. The cost of that hint is
- the number of subgoals generated by {\tt apply {\term}}.
-
- In case the inferred type of \term\ does not start with a product the
- tactic added in the hint list is {\tt exact {\term}}. In case this
- type can be reduced to a type starting with a product, the tactic {\tt
- apply {\term}} is also stored in the hints list.
-
- If the inferred type of \term\ contains a dependent
- quantification on a predicate, it is added to the hint list of {\tt
- eapply} instead of the hint list of {\tt apply}. In this case, a
- warning is printed since the hint is only used by the tactic {\tt
- eauto} (see \ref{eauto}). A typical example of a hint that is used
- only by \texttt{eauto} is a transitivity lemma.
+ the number of subgoals generated by {\tt simple apply {\term}}.
+%{\tt auto} actually uses a slightly modified variant of {\tt simple apply} with use_metas_eagerly_in_conv_on_closed_terms set to false
+
+ The cost of that hint is the number of subgoals generated by that
+ tactic.
+
+ % Is it really needed?
+ %% In case the inferred type of \term\ does not start with a product
+ %% the tactic added in the hint list is {\tt exact {\term}}. In case
+ %% this type can however be reduced to a type starting with a product,
+ %% the tactic {\tt apply {\term}} is also stored in the hints list.
+
+ If the inferred type of \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 {\tt eauto} (see \ref{eauto}) instead of the hint list
+ of {\tt auto} and a warning is printed. A typical example of a hint
+ that is used only by \texttt{eauto} is a transitivity lemma.
\begin{ErrMsgs}
\item \errindex{Bound head variable}
@@ -3649,7 +3654,7 @@ The {\hintdef} is one of the following expressions:
The type of {\term} contains products over variables that do not
appear in the conclusion. A typical example is a transitivity axiom.
- In that case the {\tt apply} tactic fails, and thus is useless.
+ In that case the {\tt simple apply} tactic fails, and thus is useless.
\end{ErrMsgs}
@@ -3664,10 +3669,10 @@ The {\hintdef} is one of the following expressions:
\item \texttt{Immediate {\term}}
\comindex{Hint Immediate}
- This command adds {\tt apply {\term}; trivial} to the hint list
+ This command adds {\tt simple apply {\term}; trivial} to the hint list
associated with the head symbol of the type of {\ident} in the given
database. This tactic will fail if all the subgoals generated by
- {\tt apply {\term}} are not solved immediately by the {\tt trivial}
+ {\tt simple apply {\term}} are not solved immediately by the {\tt trivial}
tactic (which only tries tactics with cost $0$).
This command is useful for theorems such as the symmetry of equality
--
cgit v1.2.3
From 5e62675419fb6a5a8f8a86fbf3f6df4427e70d21 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Fri, 2 Oct 2015 16:50:26 +0200
Subject: Fixing error messages about Hint.
---
doc/refman/RefMan-tac.tex | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index 06431055ad..a21e5631fc 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -3645,16 +3645,16 @@ The {\hintdef} is one of the following expressions:
that is used only by \texttt{eauto} is a transitivity lemma.
\begin{ErrMsgs}
- \item \errindex{Bound head variable}
+%% \item \errindex{Bound head variable}
+
+ \item \term\ \errindex{cannot be used as a hint}
The head symbol of the type of {\term} is a bound variable such
that this tactic cannot be associated to a constant.
- \item \term\ \errindex{cannot be used as a hint}
-
- The type of {\term} contains products over variables that do not
- appear in the conclusion. A typical example is a transitivity axiom.
- In that case the {\tt simple apply} tactic fails, and thus is useless.
+ %% The type of {\term} contains products over variables that do not
+ %% appear in the conclusion. A typical example is a transitivity axiom.
+ %% In that case the {\tt simple apply} tactic fails, and thus is useless.
\end{ErrMsgs}
@@ -3684,7 +3684,7 @@ The {\hintdef} is one of the following expressions:
\begin{ErrMsgs}
- \item \errindex{Bound head variable}
+%% \item \errindex{Bound head variable}
\item \term\ \errindex{cannot be used as a hint}
@@ -3710,7 +3710,9 @@ The {\hintdef} is one of the following expressions:
\item {\ident} \errindex{is not an inductive type}
- \item {\ident} \errindex{not declared}
+% No need to have this message here, is is generic to all commands
+% referring to globals
+%% \item {\ident} \errindex{not declared}
\end{ErrMsgs}
--
cgit v1.2.3
From f41de34bcd48f008cf7d3fae4c7fce925048e606 Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Fri, 2 Oct 2015 21:32:25 +0200
Subject: Mark the Coq.Compat files for documentation. (Fix bug #4353)
---
doc/stdlib/index-list.html.template | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/stdlib/index-list.html.template b/doc/stdlib/index-list.html.template
index 024e13413a..866193ffb4 100644
--- a/doc/stdlib/index-list.html.template
+++ b/doc/stdlib/index-list.html.template
@@ -591,7 +591,7 @@ through the Require Import command.
Program:
- Support for dependently-typed programming.
+ Support for dependently-typed programming
theories/Program/Basics.v
@@ -612,4 +612,12 @@ through the Require Import command.
theories/Unicode/Utf8_core.v
theories/Unicode/Utf8.v
+
+ Compat:
+ Compatibility wrappers for previous versions of Coq
+
+
+ theories/Compat/Coq84.v
+ theories/Compat/Coq85.v
+
--
cgit v1.2.3
From 2b033589d1b7900fdb86dfad145f1c284657ae8c Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Sun, 4 Oct 2015 09:22:16 +0200
Subject: Fix typo. (Fix bug #4355)
---
doc/refman/RefMan-oth.tex | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-oth.tex b/doc/refman/RefMan-oth.tex
index 739a89af4c..4b2b8660c2 100644
--- a/doc/refman/RefMan-oth.tex
+++ b/doc/refman/RefMan-oth.tex
@@ -967,8 +967,8 @@ the constants {\qualid$_1$} {\ldots} {\qualid$_n$} in tactics using
$\delta$-conversion (unfolding a constant is replacing it by its
definition).
-{\tt Opaque} has also on effect on the conversion algorithm of {\Coq},
-telling it to delay the unfolding of a constant as mush as possible when
+{\tt Opaque} has also an effect on the conversion algorithm of {\Coq},
+telling it to delay the unfolding of a constant as much as possible when
{\Coq} has to check the conversion (see Section~\ref{conv-rules})
of two distinct applied constants.
--
cgit v1.2.3
From 9ea8867a0fa8f2a52df102732fdc1a931c659826 Mon Sep 17 00:00:00 2001
From: Enrico Tassi
Date: Wed, 30 Sep 2015 22:12:25 +0200
Subject: Proof using: let-in policy, optional auto-clear, forward closure*
- "Proof using p*" means: use p and any section var about p.
- Simplify the grammar/parser for proof using .
- Section variables with a body (let-in) are pulled in automatically
since they are safe to be used (add no extra quantification)
- automatic clear of "unused" section variables made optional:
Set Proof Using Clear Unused.
since clearing section hypotheses does not "always work" (e.g. hint
databases are not really cleaned)
- term_typing: trigger a "suggest proof using" message also for Let
theorems.
---
doc/refman/RefMan-pro.tex | 30 ++++++++++++++++++++++++------
1 file changed, 24 insertions(+), 6 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-pro.tex b/doc/refman/RefMan-pro.tex
index 7af87a399a..5dbf315535 100644
--- a/doc/refman/RefMan-pro.tex
+++ b/doc/refman/RefMan-pro.tex
@@ -157,6 +157,14 @@ in Section~\ref{ProofWith}.
Use only section variables occurring in the statement.
+\variant {\tt Proof using Type*.}
+
+ The {\tt *} operator computes the forward transitive closure.
+ E.g. if the variable {\tt H} has type {\tt p < 5} then {\tt H} is
+ in {\tt p*} since {\tt p} occurs in the type of {\tt H}.
+ {\tt Type* } is the forward transitive closure of the entire set of
+ section variables occurring in the statement.
+
\variant {\tt Proof using -(} {\ident$_1$} {\ldots} {\ident$_n$} {\tt ).}
Use all section variables except {\ident$_1$} {\ldots} {\ident$_n$}.
@@ -164,14 +172,18 @@ in Section~\ref{ProofWith}.
\variant {\tt Proof using } {\emph collection$_1$} {\tt + } {\emph collection$_2$} {\tt .}
\variant {\tt Proof using } {\emph collection$_1$} {\tt - } {\emph collection$_2$} {\tt .}
\variant {\tt Proof using } {\emph collection$_1$} {\tt - (} {\ident$_1$} {\ldots} {\ident$_n$} {\tt ).}
+\variant {\tt Proof using } {\emph collection$_1$}{\tt* .}
- Use section variables being in the set union or set difference of the two
- colelctions. See Section~\ref{Collection} to know how to form a named
+ Use section variables being, respectively, in the set union, set difference,
+ set complement, set forward transitive closure.
+ See Section~\ref{Collection} to know how to form a named
collection.
+ The {\tt *} operator binds stronger than {\tt +} and {\tt -}.
\subsubsection{{\tt Proof using} options}
-\comindex{Default Proof Using}
-\comindex{Suggest Proof Using}
+\optindex{Default Proof Using}
+\optindex{Suggest Proof Using}
+\optindex{Proof Using Clear Unused}
The following options modify the behavior of {\tt Proof using}.
@@ -186,11 +198,17 @@ The following options modify the behavior of {\tt Proof using}.
When {\tt Qed} is performed, suggest a {\tt using} annotation if
the user did not provide one.
+\variant{\tt Unset Proof Using Clear Unused.}
+
+ When {\tt Proof using a} all section variables but for {\tt a} and
+ the variables used in the type of {\tt a} are cleared.
+ This option can be used to turn off this behavior.
+
\subsubsection[\tt Collection]{Name a set of section hypotheses for {\tt Proof using}}
\comindex{Collection}\label{Collection}
The command {\tt Collection} can be used to name a set of section hypotheses,
-with the purpose of making {\tt Proof using} annotations more compat.
+with the purpose of making {\tt Proof using} annotations more compact.
\variant {\tt Collection Some := x y z.}
@@ -209,7 +227,7 @@ with the purpose of making {\tt Proof using} annotations more compat.
\variant {\tt Collection Many := Fewer - (x y).}
Define the collection named "Many" containing the set difference
- of "Fewer" and the unamed collection {\tt x y}.
+ of "Fewer" and the unnamed collection {\tt x y}.
\subsection[\tt Abort.]{\tt Abort.\comindex{Abort}}
--
cgit v1.2.3
From cd440dbd43a632cf8f445a80d034f36e4235c63e Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Sat, 10 Oct 2015 13:02:56 +0200
Subject: Fix a few latex errors in documentation of Proof Using (e.g. \tt*).
---
doc/refman/RefMan-pro.tex | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-pro.tex b/doc/refman/RefMan-pro.tex
index 5dbf315535..481afa8f87 100644
--- a/doc/refman/RefMan-pro.tex
+++ b/doc/refman/RefMan-pro.tex
@@ -165,14 +165,17 @@ in Section~\ref{ProofWith}.
{\tt Type* } is the forward transitive closure of the entire set of
section variables occurring in the statement.
-\variant {\tt Proof using -(} {\ident$_1$} {\ldots} {\ident$_n$} {\tt ).}
+\variant {\tt Proof using -( \ident$_1$} {\ldots} {\tt \ident$_n$ ).}
Use all section variables except {\ident$_1$} {\ldots} {\ident$_n$}.
-\variant {\tt Proof using } {\emph collection$_1$} {\tt + } {\emph collection$_2$} {\tt .}
-\variant {\tt Proof using } {\emph collection$_1$} {\tt - } {\emph collection$_2$} {\tt .}
-\variant {\tt Proof using } {\emph collection$_1$} {\tt - (} {\ident$_1$} {\ldots} {\ident$_n$} {\tt ).}
-\variant {\tt Proof using } {\emph collection$_1$}{\tt* .}
+\variant {\tt Proof using \nterm{collection}$_1$ + \nterm{collection}$_2$ .}
+
+\variant {\tt Proof using \nterm{collection}$_1$ - \nterm{collection}$_2$ .}
+
+\variant {\tt Proof using \nterm{collection} - ( \ident$_1$} {\ldots} {\tt \ident$_n$ ).}
+
+\variant {\tt Proof using \nterm{collection} * .}
Use section variables being, respectively, in the set union, set difference,
set complement, set forward transitive closure.
--
cgit v1.2.3
From bf39345125d66d3efd9f934be91200013f57841c Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sun, 11 Oct 2015 16:29:54 +0200
Subject: Documenting matching under binders.
---
doc/refman/RefMan-ltac.tex | 7 +++++++
1 file changed, 7 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-ltac.tex b/doc/refman/RefMan-ltac.tex
index d388840df5..04c356e44f 100644
--- a/doc/refman/RefMan-ltac.tex
+++ b/doc/refman/RefMan-ltac.tex
@@ -691,6 +691,13 @@ variables of the form {\tt @?id} that occur in head position of an
application. For these variables, the matching is second-order and
returns a functional term.
+Alternatively, when a metavariable of the form {\tt ?id} occurs under
+binders, say $x_1$, \ldots, $x_n$ and the expression matches, the
+metavariable is instantiated by a term which can then be used in any
+context which also binds the variables $x_1$, \ldots, $x_n$ with
+same types. This provides with a primitive form of matching
+under context which does not require manipulating a functional term.
+
If the matching with {\cpattern}$_1$ succeeds, then {\tacexpr}$_1$ is
evaluated into some value by substituting the pattern matching
instantiations to the metavariables. If {\tacexpr}$_1$ evaluates to a
--
cgit v1.2.3
From ed95f122f3c68becc09c653471dc2982b346d343 Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Tue, 13 Oct 2015 18:30:47 +0200
Subject: Fix some typos.
---
doc/faq/FAQ.tex | 16 ++++++++--------
doc/refman/Universes.tex | 6 +++---
doc/tools/Translator.tex | 2 +-
3 files changed, 12 insertions(+), 12 deletions(-)
(limited to 'doc')
diff --git a/doc/faq/FAQ.tex b/doc/faq/FAQ.tex
index fbb866e875..2eebac39ac 100644
--- a/doc/faq/FAQ.tex
+++ b/doc/faq/FAQ.tex
@@ -228,7 +228,7 @@ kernel is intentionally small to limit the risk of conceptual or
accidental implementation bugs.
\item[The Objective Caml compiler] The {\Coq} kernel is written using the
Objective Caml language but it uses only the most standard features
-(no object, no label ...), so that it is highly unprobable that an
+(no object, no label ...), so that it is highly improbable that an
Objective Caml bug breaks the consistency of {\Coq} without breaking all
other kinds of features of {\Coq} or of other software compiled with
Objective Caml.
@@ -1497,7 +1497,7 @@ while {\assert} is.
\Question{What can I do if \Coq can not infer some implicit argument ?}
-You can state explicitely what this implicit argument is. See \ref{implicit}.
+You can state explicitly what this implicit argument is. See \ref{implicit}.
\Question{How can I explicit some implicit argument ?}\label{implicit}
@@ -1632,7 +1632,7 @@ before comparing them, you risk to use a lot of time and space.
On the contrary, a function for computing the greatest of two natural numbers
is an algorithm which, called on two natural numbers
-$n$ and $p$, determines wether $n\leq p$ or $p < n$.
+$n$ and $p$, determines whether $n\leq p$ or $p < n$.
Such a function is a \emph{decision procedure} for the inequality of
\texttt{nat}. The possibility of writing such a procedure comes
directly from de decidability of the order $\leq$ on natural numbers.
@@ -1706,7 +1706,7 @@ immediate, whereas one can't wait for the result of
This is normal. Your definition is a simple recursive function which
returns a boolean value. Coq's \texttt{le\_lt\_dec} is a \emph{certified
-function}, i.e. a complex object, able not only to tell wether $n\leq p$
+function}, i.e. a complex object, able not only to tell whether $n\leq p$
or $p/.config/coq/coqiderc| under Linux, or \\
\verb|C:\Documents and Settings\\.config\coq\coqiderc| under Windows)
- and replace any occurence of \texttt{MOD4} by \texttt{MOD1}.
+and replace any occurrence of \texttt{MOD4} by \texttt{MOD1}.
@@ -2638,7 +2638,7 @@ existential variable which eventually got erased by some computation.
You may backtrack to the faulty occurrence of {\eauto} or {\eapply}
and give the missing argument an explicit value. Alternatively, you
can use the commands \texttt{Show Existentials.} and
-\texttt{Existential.} to display and instantiate the remainig
+\texttt{Existential.} to display and instantiate the remaining
existential variables.
diff --git a/doc/refman/Universes.tex b/doc/refman/Universes.tex
index 018d73908b..a03d5c7b20 100644
--- a/doc/refman/Universes.tex
+++ b/doc/refman/Universes.tex
@@ -182,8 +182,8 @@ bound if it is an atomic universe (i.e. not an algebraic max()).
experimental and is likely to change in future versions.
\end{flushleft}
-The syntax has been extended to allow users to explicitely bind names to
-universes and explicitely instantantiate polymorphic
+The syntax has been extended to allow users to explicitly bind names to
+universes and explicitly instantantiate polymorphic
definitions. Currently, binding is implicit at the first occurrence of a
universe name. For example, i and j below are introduced by the
annotations attached to Types.
@@ -202,7 +202,7 @@ definition, they just allow to specify locally what relations should
hold. In the term and in general in proof mode, universe names
introduced in the types can be refered to in terms.
-Definitions can also be instantiated explicitely, giving their full instance:
+Definitions can also be instantiated explicitly, giving their full instance:
\begin{coq_example}
Check (pidentity@{Set}).
Check (le@{i j}).
diff --git a/doc/tools/Translator.tex b/doc/tools/Translator.tex
index 5f7b6dc951..ed1d336d9e 100644
--- a/doc/tools/Translator.tex
+++ b/doc/tools/Translator.tex
@@ -419,7 +419,7 @@ the hypotheses), or a comma-separated list of either hypothesis name,
or {\tt (value of $H$)} or {\tt (type of $H$)}. Moreover, occurrences
can be specified after every hypothesis after the {\TERM{at}}
keyword. {\em concl} is either empty or \TERM{*}, and can be followed
-by occurences.
+by occurrences.
\begin{transbox}
\TRANS{in Goal}{in |- *}
--
cgit v1.2.3
From f617aeef08441e83b13f839ce767b840fddbcf7d Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Wed, 14 Oct 2015 10:39:55 +0200
Subject: Fix some typos.
---
doc/faq/FAQ.tex | 4 ++--
doc/refman/Universes.tex | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
(limited to 'doc')
diff --git a/doc/faq/FAQ.tex b/doc/faq/FAQ.tex
index 2eebac39ac..48b61827d1 100644
--- a/doc/faq/FAQ.tex
+++ b/doc/faq/FAQ.tex
@@ -710,7 +710,7 @@ There are also ``simple enough'' propositions for which you can prove
the equality without requiring any extra axioms. This is typically
the case for propositions defined deterministically as a first-order
inductive predicate on decidable sets. See for instance in question
-\ref{le-uniqueness} an axiom-free proof of the unicity of the proofs of
+\ref{le-uniqueness} an axiom-free proof of the uniqueness of the proofs of
the proposition {\tt le m n} (less or equal on {\tt nat}).
% It is an ongoing work of research to natively include proof
@@ -1625,7 +1625,7 @@ Fail Definition max (n p : nat) := if n <= p then p else n.
As \Coq~ says, the term ``~\texttt{n <= p}~'' is a proposition, i.e. a
statement that belongs to the mathematical world. There are many ways to
prove such a proposition, either by some computation, or using some already
-proven theoremas. For instance, proving $3-2 \leq 2^{45503}$ is very easy,
+proven theorems. For instance, proving $3-2 \leq 2^{45503}$ is very easy,
using some theorems on arithmetical operations. If you compute both numbers
before comparing them, you risk to use a lot of time and space.
diff --git a/doc/refman/Universes.tex b/doc/refman/Universes.tex
index a03d5c7b20..cd8222269d 100644
--- a/doc/refman/Universes.tex
+++ b/doc/refman/Universes.tex
@@ -183,7 +183,7 @@ bound if it is an atomic universe (i.e. not an algebraic max()).
\end{flushleft}
The syntax has been extended to allow users to explicitly bind names to
-universes and explicitly instantantiate polymorphic
+universes and explicitly instantiate polymorphic
definitions. Currently, binding is implicit at the first occurrence of a
universe name. For example, i and j below are introduced by the
annotations attached to Types.
@@ -200,7 +200,7 @@ we are using $A : Type@{i} <= Type@{j}$, hence the generated
constraint. Note that the names here are not bound in the final
definition, they just allow to specify locally what relations should
hold. In the term and in general in proof mode, universe names
-introduced in the types can be refered to in terms.
+introduced in the types can be referred to in terms.
Definitions can also be instantiated explicitly, giving their full instance:
\begin{coq_example}
@@ -209,7 +209,7 @@ Check (le@{i j}).
\end{coq_example}
User-named universes are considered rigid for unification and are never
-miminimized.
+minimized.
Finally, two commands allow to name \emph{global} universes and constraints.
--
cgit v1.2.3
From a856dfb5ce98ea1a8e3961a64e533565387a8b31 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Tue, 13 Oct 2015 19:37:55 +0200
Subject: Reference Manual: Applying standard style recommendation about not
starting a sentence with a symbolic expression.
---
doc/refman/RefMan-ltac.tex | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-ltac.tex b/doc/refman/RefMan-ltac.tex
index 04c356e44f..5880487f71 100644
--- a/doc/refman/RefMan-ltac.tex
+++ b/doc/refman/RefMan-ltac.tex
@@ -367,7 +367,8 @@ There is a for loop that repeats a tactic {\num} times:
\begin{quote}
{\tt do} {\num} {\tacexpr}
\end{quote}
-{\tacexpr} is evaluated to $v$. $v$ must be a tactic value. $v$ is
+{\tacexpr} is evaluated to $v$ which must be a tactic value.
+This tactic value $v$ is
applied {\num} times. Supposing ${\num}>1$, after the first
application of $v$, $v$ is applied, at least once, to the generated
subgoals and so on. It fails if the application of $v$ fails before
@@ -394,7 +395,8 @@ We can catch the tactic errors with:
\begin{quote}
{\tt try} {\tacexpr}
\end{quote}
-{\tacexpr} is evaluated to $v$. $v$ must be a tactic value. $v$ is
+{\tacexpr} is evaluated to $v$ which must be a tactic value.
+The tactic value $v$ is
applied to each focused goal independently. If the application of $v$
fails in a goal, it catches the error and leaves the goal
unchanged. If the level of the exception is positive, then the
@@ -406,7 +408,8 @@ We can check if a tactic made progress with:
\begin{quote}
{\tt progress} {\tacexpr}
\end{quote}
-{\tacexpr} is evaluated to $v$. $v$ must be a tactic value. $v$ is
+{\tacexpr} is evaluated to $v$ which must be a tactic value.
+The tactic value $v$ is
applied to each focued subgoal independently. If the application of
$v$ to one of the focused subgoal produced subgoals equal to the
initial goals (up to syntactical equality), then an error of level 0
@@ -422,7 +425,7 @@ We can branch with the following structure:
{\tacexpr}$_1$ {\tt +} {\tacexpr}$_2$
\end{quote}
{\tacexpr}$_1$ and {\tacexpr}$_2$ are evaluated to $v_1$ and
-$v_2$. $v_1$ and $v_2$ must be tactic values. $v_1$ is applied to each
+$v_2$ which must be tactic values. The tactic value $v_1$ is applied to each
focused goal independently and if it fails or a later tactic fails,
then the proof backtracks to the current goal and $v_2$ is applied.
@@ -462,7 +465,7 @@ Yet another way of branching without backtracking is the following structure:
{\tacexpr}$_1$ {\tt ||} {\tacexpr}$_2$
\end{quote}
{\tacexpr}$_1$ and {\tacexpr}$_2$ are evaluated to $v_1$ and
-$v_2$. $v_1$ and $v_2$ must be tactic values. $v_1$ is applied in each
+$v_2$ which must be tactic values. The tactic value $v_1$ is applied in each
subgoal independently and if it fails \emph{to progress} then $v_2$ is
applied. {\tacexpr}$_1$ {\tt ||} {\tacexpr}$_2$ is equivalent to {\tt
first [} {\tt progress} {\tacexpr}$_1$ {\tt |} {\tt progress}
@@ -494,7 +497,8 @@ single success \emph{a posteriori}:
\begin{quote}
{\tt once} {\tacexpr}
\end{quote}
-{\tacexpr} is evaluated to $v$. $v$ must be a tactic value. $v$ is
+{\tacexpr} 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, {\tt once}
{\tacexpr} fails like $v$. If $v$ has a least one success, {\tt once}
{\tacexpr} succeeds once, but cannot produce more successes.
@@ -505,7 +509,8 @@ Coq provides an experimental way to check that a tactic has \emph{exactly one} s
\begin{quote}
{\tt exactly\_once} {\tacexpr}
\end{quote}
-{\tacexpr} is evaluated to $v$. $v$ must be a tactic value. $v$ is
+{\tacexpr} 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, {\tt
exactly\_once} {\tacexpr} fails like $v$. If $v$ has a exactly one
success, {\tt exactly\_once} {\tacexpr} succeeds like $v$. If $v$ has
@@ -592,7 +597,8 @@ amount of time:
\begin{quote}
{\tt timeout} {\num} {\tacexpr}
\end{quote}
-{\tacexpr} is evaluated to $v$. $v$ must be a tactic value. $v$ is
+{\tacexpr} is evaluated to $v$ which must be a tactic value.
+The tactic value $v$ is
applied normally, except that it is interrupted after ${\num}$ seconds
if it is still running. In this case the outcome is a failure.
--
cgit v1.2.3
From acc54398bd244b15d4dbc396836c279eabf3bf6b Mon Sep 17 00:00:00 2001
From: Matthieu Sozeau
Date: Wed, 4 Nov 2015 13:37:10 -0500
Subject: Hint Cut documentation and cleanup of printing (was duplicated and
inconsistent).
---
doc/refman/RefMan-tac.tex | 37 ++++++++++++++++++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index a21e5631fc..1551b8eefd 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -3788,12 +3788,47 @@ 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_auto with eqdec.
+Info 1 auto with eqdec.
\end{coq_example}
\begin{coq_eval}
Abort.
\end{coq_eval}
+\item \texttt{Cut} {\textit{regexp}}
+\label{HintCut}
+\comindex{Hint Cut}
+
+ \textit{Warning:} these hints currently only apply to typeclass proof search and
+ the \texttt{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:
+\[\begin{array}{lcll}
+ e & ::= & \ident & \text{ hint or instance identifier } \\
+ & & \texttt{*} & \text{ any hint } \\
+ & & e | e' & \text{ disjunction } \\
+ & & e ; e' & \text{ sequence } \\
+ & & ! e & \text{ Kleene star } \\
+ & & \texttt{emp} & \text{ empty } \\
+ & & \texttt{eps} & \text{ epsilon } \\
+ & & \texttt{(} e \texttt{)} &
+\end{array}\]
+
+The \texttt{emp} regexp does not match any search path while
+\texttt{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 \texttt{Hint Extern}'s do not have an
+associated identitier). Before applying any hint $\ident$ the current
+path $p$ extended with $\ident$ is matched against the current cut
+expression $c$ associated to the hint database. If matching succeeds,
+the hint is \emph{not} applied. The semantics of \texttt{Hint Cut} $e$
+is to set the cut expression to $c | e$, the initial cut expression
+being \texttt{emp}.
+
+
+
+
\end{itemize}
\Rem One can use an \texttt{Extern} hint with no pattern to do
--
cgit v1.2.3
From 209faf81c432c39d4537f8b1dc5c9947d4349d30 Mon Sep 17 00:00:00 2001
From: Matthieu Sozeau
Date: Wed, 4 Nov 2015 14:35:02 -0500
Subject: Univs: update refman, better printers for universe contexts.
---
doc/refman/Universes.tex | 119 ++++++++++++++++++++++++++++-------------------
1 file changed, 72 insertions(+), 47 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/Universes.tex b/doc/refman/Universes.tex
index cd8222269d..f47973601b 100644
--- a/doc/refman/Universes.tex
+++ b/doc/refman/Universes.tex
@@ -7,9 +7,7 @@
\asection{General Presentation}
\begin{flushleft}
- \em The status of Universe Polymorphism is experimental. Some features
- are not compatible with it (yet): bytecode compilation does not handle
- polymorphic definitions, it treats them as opaque constants.
+ \em The status of Universe Polymorphism is experimental.
\end{flushleft}
This section describes the universe polymorphic extension of Coq.
@@ -65,7 +63,7 @@ Now \texttt{pidentity} is used at two different levels: at the head of
the application it is instantiated at \texttt{Top.3} while in the
argument position it is instantiated at \texttt{Top.4}. This definition
is only valid as long as \texttt{Top.4} is strictly smaller than
-\texttt{Top.3}, as show by the constraints. Not that this definition is
+\texttt{Top.3}, as show by the constraints. Note that this definition is
monomorphic (not universe polymorphic), so in turn the two universes are
actually global levels.
@@ -119,18 +117,28 @@ producing global universe constraints, one can use the
\begin{itemize}
\item \texttt{Lemma}, \texttt{Axiom}, and all the other ``definition''
keywords support polymorphism.
-\item \texttt{Variables}, \texttt{Context} in a section support polymorphism.
- This means that the
- variables are discharged polymorphically over definitions that use
- them. In other words, two definitions in the section sharing a common
- variable will both get parameterized by the universes produced by the
- variable declaration. This is in contrast to a ``mononorphic'' variable
- which introduces global universes, making the two definitions depend on
- the \emph{same} global universes associated to the variable.
+\item \texttt{Variables}, \texttt{Context}, \texttt{Universe} and
+ \texttt{Constraint} in a section support polymorphism. This means
+ that the universe variables (and associated constraints) are
+ discharged polymorphically over definitions that use them. In other
+ words, two definitions in the section sharing a common variable will
+ both get parameterized by the universes produced by the variable
+ declaration. This is in contrast to a ``mononorphic'' variable which
+ introduces global universes and constraints, making the two
+ definitions depend on the \emph{same} global universes associated to
+ the variable.
\item \texttt{Hint \{Resolve, Rewrite\}} will use the auto/rewrite hint
polymorphically, not at a single instance.
\end{itemize}
+\asection{Global and local universes}
+
+Each universe is declared in a global or local environment before it can
+be used. To ensure compatibility, every \emph{global} universe is set to
+be strictly greater than \Set~when it is introduced, while every
+\emph{local} (i.e. polymorphically quantified) universe is introduced as
+greater or equal to \Set.
+
\asection{Conversion and unification}
The semantics of conversion and unification have to be modified a little
@@ -173,23 +181,48 @@ This definition is elaborated by minimizing the universe of id to level
generated at the application of id and a constraint that $\Set \le i$.
This minimization process is applied only to fresh universe
variables. It simply adds an equation between the variable and its lower
-bound if it is an atomic universe (i.e. not an algebraic max()).
+bound if it is an atomic universe (i.e. not an algebraic \texttt{max()}
+universe).
-\asection{Explicit Universes}
+The option \texttt{Unset Universe Minimization ToSet} disallows
+minimization to the sort $\Set$ and only collapses floating universes
+between themselves.
-\begin{flushleft}
- \em The design and implementation of explicit universes is very
- experimental and is likely to change in future versions.
-\end{flushleft}
+\asection{Explicit Universes}
The syntax has been extended to allow users to explicitly bind names to
-universes and explicitly instantiate polymorphic
-definitions. Currently, binding is implicit at the first occurrence of a
-universe name. For example, i and j below are introduced by the
-annotations attached to Types.
+universes and explicitly instantiate polymorphic definitions.
+
+\subsection{\tt Universe {\ident}.
+ \comindex{Universe}
+ \label{UniverseCmd}}
+
+In the monorphic case, this command declare a new global universe named
+{\ident}. It supports the polymorphic flag only in sections, meaning the
+universe quantification will be discharged on each section definition
+independently.
+
+\subsection{\tt Constraint {\ident} {\textit{ord}} {\ident}.
+ \comindex{Constraint}
+ \label{ConstraintCmd}}
+
+This command declare a new constraint between named universes.
+The order relation can be one of $<$, $\le$ or $=$. If consistent,
+the constraint is then enforced in the global environment. Like
+\texttt{Universe}, it can be used with the \texttt{Polymorphic} prefix
+in sections only to declare constraints discharged at section closing time.
+
+\begin{ErrMsgs}
+\item \errindex{Undeclared universe {\ident}}.
+\item \errindex{Universe inconsistency}
+\end{ErrMsgs}
+
+\subsection{Polymorphic definitions}
+For polymorphic definitions, the declaration of (all) universe levels
+introduced by a definition uses the following syntax:
\begin{coq_example*}
-Polymorphic Definition le (A : Type@{i}) : Type@{j} := A.
+Polymorphic Definition le@{i j} (A : Type@{i}) : Type@{j} := A.
\end{coq_example*}
\begin{coq_example}
Print le.
@@ -197,40 +230,32 @@ Print le.
During refinement we find that $j$ must be larger or equal than $i$, as
we are using $A : Type@{i} <= Type@{j}$, hence the generated
-constraint. Note that the names here are not bound in the final
-definition, they just allow to specify locally what relations should
-hold. In the term and in general in proof mode, universe names
-introduced in the types can be referred to in terms.
+constraint. At the end of a definition or proof, we check that the only
+remaining universes are the ones declared. In the term and in general in
+proof mode, introduced universe names can be referred to in
+terms. Note that local universe names shadow global universe names.
+During a proof, one can use \texttt{Show Universes} to display
+the current context of universes.
Definitions can also be instantiated explicitly, giving their full instance:
\begin{coq_example}
Check (pidentity@{Set}).
-Check (le@{i j}).
+Universes k l.
+Check (le@{k l}).
\end{coq_example}
User-named universes are considered rigid for unification and are never
minimized.
-Finally, two commands allow to name \emph{global} universes and constraints.
-
-\subsection{\tt Universe {\ident}.
- \comindex{Universe}
- \label{UniverseCmd}}
+\subsection{\tt Unset Strict Universe Declaration.
+ \optindex{StrictUniverseDeclaration}
+ \label{StrictUniverseDeclaration}}
-This command declare a new global universe named {\ident}.
-
-\subsection{\tt Constraint {\ident} {\textit{ord}} {\ident}.
- \comindex{Constraint}
- \label{ConstraintCmd}}
-
-This command declare a new constraint between named universes.
-The order relation can be one of $<$, $<=$ or $=$. If consistent,
-the constraint is then enforced in the global environment.
-
-\begin{ErrMsgs}
-\item \errindex{Undeclared universe {\ident}}.
-\item \errindex{Universe inconsistency}
-\end{ErrMsgs}
+The command \texttt{Unset Strict Universe Declaration} allows one to
+freely use identifiers for universes without declaring them first, with
+the semantics that the first use declares it. In this mode, the universe
+names are not associated with the definition or proof once it has been
+defined. This is meant mainly for debugging purposes.
%%% Local Variables:
%%% mode: latex
--
cgit v1.2.3
From bbef0e8702bf5e2dcad9bb4c47f92858d4eea9b4 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sat, 7 Nov 2015 11:02:40 +0100
Subject: Fixing documention of Add Printing Coercion.
---
doc/refman/Coercion.tex | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/Coercion.tex b/doc/refman/Coercion.tex
index e4aa69353d..16006a6adf 100644
--- a/doc/refman/Coercion.tex
+++ b/doc/refman/Coercion.tex
@@ -312,12 +312,13 @@ Conversely, to skip the printing of coercions, use
{\tt Unset Printing Coercions}.
By default, coercions are not printed.
-\asubsection{\tt Set Printing Coercion {\qualid}.}
-\optindex{Printing Coercion}
+\asubsection{\tt Add Printing Coercion {\qualid}.}
+\comindex{Add Printing Coercion}
+\comindex{Remove Printing Coercion}
This command forces coercion denoted by {\qualid} to be printed.
To skip the printing of coercion {\qualid}, use
- {\tt Unset Printing Coercion {\qualid}}.
+ {\tt Remove Printing Coercion {\qualid}}.
By default, a coercion is never printed.
\asection{Classes as Records}
--
cgit v1.2.3
From 4bd5dcfeb558f826d90123357a3e5336f96b2213 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Tue, 22 Sep 2015 18:45:27 +0200
Subject: Adding an amazing property of Prop.
---
doc/stdlib/index-list.html.template | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/stdlib/index-list.html.template b/doc/stdlib/index-list.html.template
index 866193ffb4..33de399c0d 100644
--- a/doc/stdlib/index-list.html.template
+++ b/doc/stdlib/index-list.html.template
@@ -59,6 +59,7 @@ through the Require Import command.
theories/Logic/WeakFan.v
theories/Logic/WKL.v
theories/Logic/FinFun.v
+ theories/Logic/PropFacts.v
Structures:
--
cgit v1.2.3
From 566a24e28924ad4a7dda99891dce3882e6db112c Mon Sep 17 00:00:00 2001
From: Pierre-Marie Pédrot
Date: Thu, 26 Nov 2015 16:01:33 +0100
Subject: Adding the Printing Projections options to the index.
---
doc/refman/RefMan-ext.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-ext.tex b/doc/refman/RefMan-ext.tex
index d21c91201d..b77118e1f9 100644
--- a/doc/refman/RefMan-ext.tex
+++ b/doc/refman/RefMan-ext.tex
@@ -253,6 +253,7 @@ Reset Initial.
\Rem An experimental syntax for projections based on a dot notation is
available. The command to activate it is
+\optindex{Printing Projections}
\begin{quote}
{\tt Set Printing Projections.}
\end{quote}
--
cgit v1.2.3
From 9205d8dc7b9e97b6c2f0815fddc5673c21d11089 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Mon, 2 Nov 2015 12:26:53 +0100
Subject: Changing syntax "$(tactic)$" into "ltac:(tactic)", as discussed in
WG.
---
doc/refman/RefMan-ext.tex | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-ext.tex b/doc/refman/RefMan-ext.tex
index b77118e1f9..80e12898f0 100644
--- a/doc/refman/RefMan-ext.tex
+++ b/doc/refman/RefMan-ext.tex
@@ -1998,7 +1998,7 @@ variables, use
\end{quote}
\subsection{Solving existential variables using tactics}
-\ttindex{\textdollar( \ldots )\textdollar}
+\ttindex{ltac:( \ldots )}
\def\expr{\textrm{\textsl{tacexpr}}}
@@ -2012,7 +2012,7 @@ binding as well as those introduced by tactic binding. The expression {\expr}
can be any tactic expression as described at section~\ref{TacticLanguage}.
\begin{coq_example*}
-Definition foo (x : nat) : nat := $( exact x )$.
+Definition foo (x : nat) : nat := ltac:(exact x).
\end{coq_example*}
This construction is useful when one wants to define complicated terms using
--
cgit v1.2.3
From 6ab4479dfa0f9b8fd4df4342fdfdab6c25b62fb7 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Wed, 2 Dec 2015 12:10:53 +0100
Subject: Improving syntax of pat/constr introduction pattern so that
pat/c1/.../cn behaves as intro H; apply c1, ... , cn in H as pat.
Open to other suggestions of syntax though.
---
doc/refman/RefMan-tac.tex | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index 1551b8eefd..03c4f6a365 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -828,7 +828,9 @@ either:
\item a pattern for decomposing an equality: {\tt [= $p_1$ \dots\ $p_n$]}
\item the rewriting orientations: {\tt ->} or {\tt <-}
\end{itemize}
- \item the on-the-fly application of a lemma: $p${\tt /{\term}}
+ \item the on-the-fly application of lemmas: $p${\tt /{\term$_1$}}
+ \ldots {\tt /{\term$_n$}} where $p$ itself is not an on-the-fly
+ application of lemmas pattern
\end{itemize}
\item the wildcard: {\tt \_}
\end{itemize}
@@ -896,9 +898,10 @@ introduction pattern~$p$:
itself is erased; if the term to substitute is a variable, it is
substituted also in the context of goal and the variable is removed
too;
-\item introduction over a pattern $p${\tt /{\term}} first applies
- {\term} on the hypothesis to be introduced (as in {\tt apply
- }{\term} {\tt in}), prior to the application of the introduction
+\item introduction over a pattern $p${\tt /{\term$_1$}} \ldots {\tt
+ /{\term$_n$}} first applies {\term$_1$},\ldots, {\term$_n$} on the
+ hypothesis to be introduced (as in {\tt apply }{\term}$_1$, \ldots,
+ {\term}$_n$ {\tt in}), prior to the application of the introduction
pattern $p$;
\item introduction on the wildcard depends on whether the product is
dependent or not: in the non-dependent case, it erases the
--
cgit v1.2.3
From 387351b4c0ffeff65d8a7192f5073cfd4bd20f53 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sat, 5 Dec 2015 00:14:37 +0100
Subject: Changing "destruct !hyp" into "destruct (hyp)" (and similarly for
induction) based on a suggestion of Guillaume M. (done like this in
ssreflect).
This is actually consistent with the hack of using "destruct (1)" to
mean the term 1 by opposition to the use of "destruct 1" to mean the
first non-dependent hypothesis of the goal.
---
doc/refman/RefMan-tac.tex | 47 ++++++++++++++++++++---------------------------
1 file changed, 20 insertions(+), 27 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index 03c4f6a365..55b5f622ff 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -1531,25 +1531,27 @@ for each possible form of {\term}, i.e. one for each constructor of
the inductive or co-inductive type. Unlike {\tt induction}, no
induction hypothesis is generated by {\tt destruct}.
-If the argument is dependent in either the conclusion or some
-hypotheses of the goal, the argument is replaced by the appropriate
-constructor form in each of the resulting subgoals, thus performing
-case analysis. If non-dependent, the tactic simply exposes the
-inductive or co-inductive structure of the argument.
-
There are special cases:
\begin{itemize}
\item If {\term} is an identifier {\ident} denoting a quantified
-variable of the conclusion of the goal, then {\tt destruct {\ident}}
-behaves as {\tt intros until {\ident}; destruct {\ident}}.
+ variable of the conclusion of the goal, then {\tt destruct {\ident}}
+ behaves as {\tt intros until {\ident}; destruct {\ident}}. If
+ {\ident} is not anymore dependent in the goal after application of
+ {\tt destruct}, it is erased (to avoid erasure, use
+ parentheses, as in {\tt destruct ({\ident})}).
\item If {\term} is a {\num}, then {\tt destruct {\num}} behaves as
{\tt intros until {\num}} followed by {\tt destruct} applied to the
last introduced hypothesis. Remark: For destruction of a numeral, use
syntax {\tt destruct ({\num})} (not very interesting anyway).
+\item In case {\term} is an hypothesis {\ident} of the context,
+ and {\ident} is not anymore dependent in the goal after
+ application of {\tt destruct}, it is erased (to avoid erasure, use
+ parentheses, as in {\tt destruct ({\ident})}).
+
\item The argument {\term} can also be a pattern of which holes are
denoted by ``\_''. In this case, the tactic checks that all subterms
matching the pattern in the conclusion and the hypotheses are
@@ -1626,14 +1628,6 @@ syntax {\tt destruct ({\num})} (not very interesting anyway).
They combine the effects of the {\tt with}, {\tt as}, {\tt eqn:}, {\tt using},
and {\tt in} clauses.
-\item{\tt destruct !{\ident}}
-
- This is a case when the destructed term is an hypothesis of the
- context. The ``!'' modifier tells to keep the hypothesis in the
- context after destruction.
-
- This applies also to the other form of {\tt destruct} and {\tt edestruct}.
-
\item{\tt case \term}\label{case}\tacindex{case}
The tactic {\tt case} is a more basic tactic to perform case
@@ -1699,14 +1693,22 @@ There are particular cases:
\begin{itemize}
\item If {\term} is an identifier {\ident} denoting a quantified
-variable of the conclusion of the goal, then {\tt induction {\ident}}
-behaves as {\tt intros until {\ident}; induction {\ident}}.
+ variable of the conclusion of the goal, then {\tt induction
+ {\ident}} behaves as {\tt intros until {\ident}; induction
+ {\ident}}. If {\ident} is not anymore dependent in the goal
+ after application of {\tt induction}, it is erased (to avoid
+ erasure, use parentheses, as in {\tt induction ({\ident})}).
\item If {\term} is a {\num}, then {\tt induction {\num}} behaves as
{\tt intros until {\num}} followed by {\tt induction} applied to the
last introduced hypothesis. Remark: For simple induction on a numeral,
use syntax {\tt induction ({\num})} (not very interesting anyway).
+\item In case {\term} is an hypothesis {\ident} of the context,
+ and {\ident} is not anymore dependent in the goal after
+ application of {\tt induction}, it is erased (to avoid erasure, use
+ parentheses, as in {\tt induction ({\ident})}).
+
\item The argument {\term} can also be a pattern of which holes are
denoted by ``\_''. In this case, the tactic checks that all subterms
matching the pattern in the conclusion and the hypotheses are
@@ -1821,15 +1823,6 @@ Show 2.
einduction}. It combines the effects of the {\tt with}, {\tt as}, %%{\tt eqn:},
{\tt using}, and {\tt in} clauses.
-\item{\tt induction !{\ident}}
-
- This is a case when the term on which to apply induction is an
- hypothesis of the context. The ``!'' modifier tells to keep the
- hypothesis in the context after induction.
-
- This applies also to the other form of {\tt induction} and {\tt
- einduction}.
-
\item {\tt elim \term}\label{elim}
This is a more basic induction tactic. Again, the type of the
--
cgit v1.2.3
From 1dfb2c020fa0ed2e853539b8b398a9d91cbbeefa Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Fri, 2 Oct 2015 23:28:16 +0200
Subject: RefMan, ch. 4: Minor changes for spacing, clarity.
---
doc/refman/RefMan-cic.tex | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 3fd5ae0b24..15b8fb9c8d 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -109,7 +109,7 @@ sets, namely the sorts {\Set} and {\Type$(j)$} for $jProp) : Type
%a recursive argument and $(x:_P T)C$ if the argument is not recursive.
\paragraph[Sort-polymorphism of inductive families.]{Sort-polymorphism of inductive families.\index{Sort-polymorphism of inductive families}}
+\label{Sort-polymorphism-inductive}
From {\Coq} version 8.1, inductive families declared in {\Type} are
polymorphic over their arguments in {\Type}.
If $A$ is an arity and $s$ a sort, we write $A_{/s}$ for the arity
obtained from $A$ by replacing its sort with $s$. Especially, if $A$
-is well-typed in some environment and context, then $A_{/s}$ is typable
+is well-typed in some global environment and local context, then $A_{/s}$ is typable
by typability of all products in the Calculus of Inductive Constructions.
The following typing rule is added to the theory.
\begin{description}
\item[Ind-Family] Let $\Ind{\Gamma}{p}{\Gamma_I}{\Gamma_C}$ be an
inductive definition. Let $\Gamma_P = [p_1:P_1;\ldots;p_{p}:P_{p}]$
- be its context of parameters, $\Gamma_I = [I_1:\forall
+ be its local context of parameters, $\Gamma_I = [I_1:\forall
\Gamma_P,A_1;\ldots;I_k:\forall \Gamma_P,A_k]$ its context of
definitions and $\Gamma_C = [c_1:\forall
\Gamma_P,C_1;\ldots;c_n:\forall \Gamma_P,C_n]$ its context of
@@ -1105,7 +1108,7 @@ a strongly normalizing reduction, we cannot accept any sort of
recursion (even terminating). So the basic idea is to restrict
ourselves to primitive recursive functions and functionals.
-For instance, assuming a parameter $A:\Set$ exists in the context, we
+For instance, assuming a parameter $A:\Set$ exists in the local context, we
want to build a function \length\ of type $\ListA\ra \nat$ which
computes the length of the list, so such that $(\length~(\Nil~A)) = \nO$
and $(\length~(\cons~A~a~l)) = (\nS~(\length~l))$. We want these
@@ -1364,7 +1367,7 @@ constructor have type \Prop. In that case, there is a canonical
way to interpret the informative extraction on an object in that type,
such that the elimination on any sort $s$ is legal. Typical examples are
the conjunction of non-informative propositions and the equality.
-If there is an hypothesis $h:a=b$ in the context, it can be used for
+If there is an hypothesis $h:a=b$ in the local context, it can be used for
rewriting not only in logical propositions but also in any type.
% In that case, the term \verb!eq_rec! which was defined as an axiom, is
% now a term of the calculus.
@@ -1438,8 +1441,8 @@ only constructors of $I$.
\paragraph{Example.}
For \List\ and \Length\ the typing rules for the {\tt match} expression
-are (writing just $t:M$ instead of \WTEG{t}{M}, the environment and
-context being the same in all the judgments).
+are (writing just $t:M$ instead of \WTEG{t}{M}, the global environment and
+local context being the same in all the judgments).
\[\frac{l:\ListA~~P:\ListA\ra s~~~f_1:(P~(\Nil~A))~~
f_2:\forall a:A, \forall l:\ListA, (P~(\cons~A~a~l))}
--
cgit v1.2.3
From fe2776f9e0d355cccb0841495a9843351d340066 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sun, 4 Oct 2015 08:14:39 +0200
Subject: RefMan, ch. 1 and 2: avoiding using the name "constant" when
"constructor" and "inductive" are meant also.
---
doc/refman/RefMan-ext.tex | 10 +++++-----
doc/refman/RefMan-gal.tex | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-ext.tex b/doc/refman/RefMan-ext.tex
index 80e12898f0..a2be25c3ba 100644
--- a/doc/refman/RefMan-ext.tex
+++ b/doc/refman/RefMan-ext.tex
@@ -1250,7 +1250,7 @@ possible, the correct argument will be automatically generated.
\end{ErrMsgs}
-\subsection{Declaration of implicit arguments for a constant
+\subsection{Declaration of implicit arguments
\comindex{Arguments}}
\label{ImplicitArguments}
@@ -1263,7 +1263,7 @@ a priori and a posteriori.
\subsubsection{Implicit Argument Binders}
In the first setting, one wants to explicitly give the implicit
-arguments of a constant as part of its definition. To do this, one has
+arguments of a declared object as part of its definition. To do this, one has
to surround the bindings of implicit arguments by curly braces:
\begin{coq_eval}
Reset Initial.
@@ -1300,7 +1300,7 @@ usual implicit arguments disambiguation syntax.
\subsubsection{Declaring Implicit Arguments}
-To set implicit arguments for a constant a posteriori, one can use the
+To set implicit arguments a posteriori, one can use the
command:
\begin{quote}
\tt Arguments {\qualid} \nelist{\possiblybracketedident}{}
@@ -1379,7 +1379,7 @@ Check (fun l => map length l = map (list nat) nat length l).
\Rem To know which are the implicit arguments of an object, use the command
{\tt Print Implicit} (see \ref{PrintImplicit}).
-\subsection{Automatic declaration of implicit arguments for a constant}
+\subsection{Automatic declaration of implicit arguments}
{\Coq} can also automatically detect what are the implicit arguments
of a defined object. The command is just
@@ -1582,7 +1582,7 @@ Implicit arguments names can be redefined using the following syntax:
\end{quote}
Without the {\tt rename} flag, {\tt Arguments} can be used to assert
-that a given constant has the expected number of arguments and that
+that a given object has the expected number of arguments and that
these arguments are named as expected.
\noindent {\bf Example (continued): }
diff --git a/doc/refman/RefMan-gal.tex b/doc/refman/RefMan-gal.tex
index 9b527053c3..e49c82d8fd 100644
--- a/doc/refman/RefMan-gal.tex
+++ b/doc/refman/RefMan-gal.tex
@@ -971,7 +971,7 @@ are the names of its constructors and {\type$_1$}, {\ldots},
{\type$_n$} their respective types. The types of the constructors have
to satisfy a {\em positivity condition} (see Section~\ref{Positivity})
for {\ident}. This condition ensures the soundness of the inductive
-definition. If this is the case, the constants {\ident},
+definition. If this is the case, the names {\ident},
{\ident$_1$}, {\ldots}, {\ident$_n$} are added to the environment with
their respective types. Accordingly to the universe where
the inductive type lives ({\it e.g.} its type {\sort}), {\Coq} provides a
@@ -990,7 +990,7 @@ Inductive nat : Set :=
\end{coq_example}
The type {\tt nat} is defined as the least \verb:Set: containing {\tt
- O} and closed by the {\tt S} constructor. The constants {\tt nat},
+ O} and closed by the {\tt S} constructor. The names {\tt nat},
{\tt O} and {\tt S} are added to the environment.
Now let us have a look at the elimination principles. They are three
@@ -1101,7 +1101,7 @@ Inductive list (A:Set) : Set :=
\end{coq_example*}
Note that in the type of {\tt nil} and {\tt cons}, we write {\tt
- (list A)} and not just {\tt list}.\\ The constants {\tt nil} and
+ (list A)} and not just {\tt list}.\\ The constructors {\tt nil} and
{\tt cons} will have respectively types:
\begin{coq_example}
--
cgit v1.2.3
From df3a49a18c5b01984000df9244ecea9c275b30cd Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Mon, 7 Dec 2015 10:52:14 +0100
Subject: Fix some typos.
---
doc/refman/Program.tex | 4 ++--
doc/refman/RefMan-tac.tex | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/Program.tex b/doc/refman/Program.tex
index 8e078e9814..3a99bfdd4f 100644
--- a/doc/refman/Program.tex
+++ b/doc/refman/Program.tex
@@ -201,7 +201,7 @@ in their context. In this case, the obligations should be transparent
recursive calls can be checked by the
kernel's type-checker. There is an optimization in the generation of
obligations which gets rid of the hypothesis corresponding to the
-functionnal when it is not necessary, so that the obligation can be
+functional when it is not necessary, so that the obligation can be
declared opaque (e.g. using {\tt Qed}). However, as soon as it appears in the
context, the proof of the obligation is \emph{required} to be declared transparent.
@@ -216,7 +216,7 @@ properties. It will generate obligations, try to solve them
automatically and fail if some unsolved obligations remain.
In this case, one can first define the lemma's
statement using {\tt Program Definition} and use it as the goal afterwards.
-Otherwise the proof will be started with the elobarted version as a goal.
+Otherwise the proof will be started with the elaborated version as a goal.
The {\tt Program} prefix can similarly be used as a prefix for {\tt Variable}, {\tt
Hypothesis}, {\tt Axiom} etc...
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index 55b5f622ff..f367f04c43 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -3555,7 +3555,7 @@ The hints for \texttt{auto} and \texttt{eauto} are stored in
databases. Each database maps head symbols to a list of hints. One can
use the command \texttt{Print Hint \ident} to display the hints
associated to the head symbol \ident{} (see \ref{PrintHint}). Each
-hint has a cost that is an nonnegative integer, and an optional pattern.
+hint has a cost that is a nonnegative integer, and an optional pattern.
The hints with lower cost are tried first. A hint is tried by
\texttt{auto} when the conclusion of the current goal
matches its pattern or when it has no pattern.
@@ -3772,7 +3772,7 @@ Hint Extern 4 (~(_ = _)) => discriminate.
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 ident, like
+ script. A sub-pattern is a question mark followed by an identifier, like
\texttt{?X1} or \texttt{?X2}. Here is an example:
% Require EqDecide.
@@ -3815,7 +3815,7 @@ The \texttt{emp} regexp does not match any search path while
\texttt{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 \texttt{Hint Extern}'s do not have an
-associated identitier). Before applying any hint $\ident$ the current
+associated identifier). Before applying any hint $\ident$ the current
path $p$ extended with $\ident$ is matched against the current cut
expression $c$ associated to the hint database. If matching succeeds,
the hint is \emph{not} applied. The semantics of \texttt{Hint Cut} $e$
@@ -4672,7 +4672,7 @@ Use \texttt{classical\_right} to prove the right part of the disjunction with th
%% procedure for first-order intuitionistic logic implemented in {\em
%% NuPRL}\cite{Kre02}.
-%% Search may optionnaly be bounded by a multiplicity parameter
+%% Search may optionally be bounded by a multiplicity parameter
%% indicating how many (at most) copies of a formula may be used in
%% the proof process, its absence may lead to non-termination of the tactic.
--
cgit v1.2.3
From 36cbe8fa3bd20469b45b299f66e88e03768a81af Mon Sep 17 00:00:00 2001
From: Gregory Malecha
Date: Fri, 27 Nov 2015 16:40:34 -0800
Subject: a few edits to the universe polymorphism section of the manual
---
doc/refman/Universes.tex | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/Universes.tex b/doc/refman/Universes.tex
index f47973601b..ea3cca77ed 100644
--- a/doc/refman/Universes.tex
+++ b/doc/refman/Universes.tex
@@ -11,8 +11,8 @@
\end{flushleft}
This section describes the universe polymorphic extension of Coq.
-Universe polymorphism allows writing generic definitions making use of
-universes and reuse them at different and sometimes incompatible levels.
+Universe polymorphism makes it possible to write generic definitions making use of
+universes and reuse them at different and sometimes incompatible universe levels.
A standard example of the difference between universe \emph{polymorphic} and
\emph{monomorphic} definitions is given by the identity function:
@@ -64,10 +64,10 @@ the application it is instantiated at \texttt{Top.3} while in the
argument position it is instantiated at \texttt{Top.4}. This definition
is only valid as long as \texttt{Top.4} is strictly smaller than
\texttt{Top.3}, as show by the constraints. Note that this definition is
-monomorphic (not universe polymorphic), so in turn the two universes are
-actually global levels.
+monomorphic (not universe polymorphic), so the two universes
+(in this case \texttt{Top.3} and \texttt{Top.4}) are actually global levels.
-Inductive types can also be declared universes polymorphic, on universes
+Inductive types can also be declared universes polymorphic on universes
appearing in their parameters or fields. A typical example is given by
monoids:
@@ -79,7 +79,7 @@ Print Monoid.
The \texttt{Monoid}'s carrier universe is polymorphic, hence it is
possible to instantiate it for example with \texttt{Monoid} itself.
-First we build the trivial unit monoid, in \texttt{Set}:
+First we build the trivial unit monoid in \texttt{Set}:
\begin{coq_example}
Definition unit_monoid : Monoid :=
{| mon_car := unit; mon_unit := tt; mon_op x y := tt |}.
@@ -197,7 +197,7 @@ universes and explicitly instantiate polymorphic definitions.
\comindex{Universe}
\label{UniverseCmd}}
-In the monorphic case, this command declare a new global universe named
+In the monorphic case, this command declares a new global universe named
{\ident}. It supports the polymorphic flag only in sections, meaning the
universe quantification will be discharged on each section definition
independently.
@@ -206,7 +206,7 @@ independently.
\comindex{Constraint}
\label{ConstraintCmd}}
-This command declare a new constraint between named universes.
+This command declares a new constraint between named universes.
The order relation can be one of $<$, $\le$ or $=$. If consistent,
the constraint is then enforced in the global environment. Like
\texttt{Universe}, it can be used with the \texttt{Polymorphic} prefix
--
cgit v1.2.3
From 5cdf3cfc8ddfb9854534fadc1a08019e9c472590 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sun, 4 Oct 2015 08:16:54 +0200
Subject: RefMan, ch. 4: Fixing the definition of terms considered in the
section.
---
doc/refman/RefMan-cic.tex | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 9d79f7cac3..ef7b99d6a8 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -176,9 +176,11 @@ in a theory where inductive objects are represented by terms.
\subsection{Terms}
-Terms are built from variables, constants, constructors,
-abstraction, application, local declarations bindings (``let-in''
-expressions) and product.
+Terms are built from sorts, variables, constant,
+%constructors, inductive types,
+abstraction, application, local definitions,
+%case analysis, fixpoints, cofixpoints
+and products.
From a syntactic point of view, types cannot be distinguished from terms,
except that they cannot start by an abstraction, and that if a term is
@@ -188,9 +190,11 @@ More precisely the language of the {\em Calculus of Inductive
Constructions} is built from the following rules:
\begin{enumerate}
-\item the sorts {\sf Set, Prop, Type} are terms.
-\item names for global constants of the environment are terms.
-\item variables are terms.
+\item the sorts {\Set}, {\Prop}, ${\Type(i)}$ are terms.
+\item variables are terms
+\item constants are terms.
+%\item constructors are terms.
+%\item inductive types are terms.
\item if $x$ is a variable and $T$, $U$ are terms then $\forall~x:T,U$
($\kw{forall}~x:T,U$ in \Coq{} concrete syntax) is a term. If $x$
occurs in $U$, $\forall~x:T,U$ reads as {\it ``for all x of type T,
@@ -212,6 +216,9 @@ More precisely the language of the {\em Calculus of Inductive
term which denotes the term $U$ where the variable $x$ is locally
bound to $T$. This stands for the common ``let-in'' construction of
functional programs such as ML or Scheme.
+%\item case ...
+%\item fixpoint ...
+%\item cofixpoint ...
\end{enumerate}
\paragraph{Notations.} Application associates to the left such that
--
cgit v1.2.3
From 5f156b28c84a86a978ab150ab5bbac5ad928ada5 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sun, 4 Oct 2015 08:19:43 +0200
Subject: RefMan, ch. 4: Consistently using "constant" for names assumed or
defined in global environment and "variable" for names assumed or defined in
local context.
---
doc/refman/RefMan-cic.tex | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index ef7b99d6a8..ca3a6135d8 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -250,7 +250,8 @@ a global environment (see below) and a local context.
\paragraph{Local context.}
A {\em local context} is an ordered list of
-declarations of variables. The declaration of some variable $x$ is
+declarations of names which we call {\em variables}.
+The declaration of some variable $x$ is
either a local assumption, written $x:T$ ($T$ is a type) or a local definition,
written $x:=t:T$. We use brackets to write local contexts. A
typical example is $[x:T;y:=u:U;z:V]$. Notice that the variables
@@ -289,11 +290,11 @@ definitions, but also declarations of inductive objects. Inductive objects thems
(see Section~\ref{Cic-inductive-definitions}).
A global assumption will be represented in the global environment as
-\Assum{\Gamma}{c}{T} which means that $c$ is assumed of some type $T$
-well-defined in some local context $\Gamma$. A global definition will
-be represented in the global environment as \Def{\Gamma}{c}{t}{T} which means
-that $c$ is a constant which is valid in some local context $\Gamma$ whose
-value is $t$ and type is $T$.
+\Assum{\Gamma}{c}{T} which assumes the name $c$ to be of some type $T$
+valid in some local context $\Gamma$. A global definition will
+be represented in the global environment as \Def{\Gamma}{c}{t}{T} which defines
+the name $c$ to have value $t$ and type $T$, both valid in $\Gamma$.
+We shall call such names {\em constants}.
The rules for inductive definitions (see section
\ref{Cic-inductive-definitions}) have to be considered as assumption
@@ -405,7 +406,7 @@ called $\iota$-reduction and is more precisely studied in
\paragraph[$\delta$-reduction.]{$\delta$-reduction.\label{delta}\index{delta-reduction@$\delta$-reduction}}
-We may have defined variables in local contexts or constants in the global
+We may have variables defined in local contexts or constants defined in the global
environment. It is legal to identify such a reference with its value,
that is to expand (or unfold) it into its value. This
reduction is called $\delta$-reduction and shows as follows.
--
cgit v1.2.3
From ef7264aa6106d0257e1a34f4ecf765279d9b602e Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sun, 4 Oct 2015 08:22:47 +0200
Subject: RefMan, ch. 4: Removing confusing paragraph "Constants": in it,
constants are yet given another definition; the reference to other
presentation is more confusing than helpful to me.
---
doc/refman/RefMan-cic.tex | 52 ++++++++++++++++++++++++-----------------------
1 file changed, 27 insertions(+), 25 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index ca3a6135d8..3b8a8fee11 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -148,31 +148,33 @@ constraints must remain acyclic. Typing expressions that violate the
acyclicity of the graph of constraints results in a \errindex{Universe
inconsistency} error (see also Section~\ref{PrintingUniverses}).
-\subsection{Constants}
-
-Constants refers to
-objects in the global environment. These constants may denote previously
-defined objects, but also objects related to inductive definitions
-(either the type itself or one of its constructors or destructors).
-
-\medskip\noindent {\bf Remark. } In other presentations of \CIC,
-the inductive objects are not seen as
-external declarations but as first-class terms. Usually the
-definitions are also completely ignored. This is a nice theoretical
-point of view but not so practical. An inductive definition is
-specified by a possibly huge set of declarations, clearly we want to
-share this specification among the various inductive objects and not
-to duplicate it. So the specification should exist somewhere and the
-various objects should refer to it. We choose one more level of
-indirection where the objects are just represented as constants and
-the environment gives the information on the kind of object the
-constant refers to.
-
-\medskip
-Our inductive objects will be manipulated as constants declared in the
-environment. This roughly corresponds to the way they are actually
-implemented in the \Coq\ system. It is simple to map this presentation
-in a theory where inductive objects are represented by terms.
+%% HH: This looks to me more like source of confusion than helpful
+
+%% \subsection{Constants}
+
+%% Constants refers to
+%% objects in the global environment. These constants may denote previously
+%% defined objects, but also objects related to inductive definitions
+%% (either the type itself or one of its constructors or destructors).
+
+%% \medskip\noindent {\bf Remark. } In other presentations of \CIC,
+%% the inductive objects are not seen as
+%% external declarations but as first-class terms. Usually the
+%% definitions are also completely ignored. This is a nice theoretical
+%% point of view but not so practical. An inductive definition is
+%% specified by a possibly huge set of declarations, clearly we want to
+%% share this specification among the various inductive objects and not
+%% to duplicate it. So the specification should exist somewhere and the
+%% various objects should refer to it. We choose one more level of
+%% indirection where the objects are just represented as constants and
+%% the environment gives the information on the kind of object the
+%% constant refers to.
+
+%% \medskip
+%% Our inductive objects will be manipulated as constants declared in the
+%% environment. This roughly corresponds to the way they are actually
+%% implemented in the \Coq\ system. It is simple to map this presentation
+%% in a theory where inductive objects are represented by terms.
\subsection{Terms}
--
cgit v1.2.3
From cd31e372c6fb25769c26879f2f65f1937d098b87 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sun, 4 Oct 2015 08:43:19 +0200
Subject: RefMan, ch. 4: Unify capitalization of "calculus of inductive
constructions".
---
doc/refman/RefMan-ext.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-ext.tex b/doc/refman/RefMan-ext.tex
index a2be25c3ba..a718a26ea5 100644
--- a/doc/refman/RefMan-ext.tex
+++ b/doc/refman/RefMan-ext.tex
@@ -289,7 +289,7 @@ To deactivate the printing of projections, use
The option {\tt Set Primitive Projections} turns on the use of primitive
projections when defining subsequent records. Primitive projections
-extended the calculus of inductive constructions with a new binary term
+extended the Calculus of Inductive Constructions with a new binary term
constructor {\tt r.(p)} representing a primitive projection p applied to
a record object {\tt r} (i.e., primitive projections are always
applied). Even if the record type has parameters, these do not appear at
--
cgit v1.2.3
From 75896eaaf60ce947e1fbc5a795ca5969bb1e4fae Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sun, 4 Oct 2015 08:47:15 +0200
Subject: RefMan, ch. 4: Dropping the "Co" which noone uses in "(Co)Inductive".
---
doc/refman/RefMan-cic.tex | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 3b8a8fee11..2bf5bb357e 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -2,20 +2,22 @@
\label{Cic}
\index{Cic@\textsc{CIC}}
\index{pCic@p\textsc{CIC}}
-\index{Calculus of (Co)Inductive Constructions}}
+\index{Calculus of Inductive Constructions}}
The underlying formal language of {\Coq} is a {\em Calculus of
- Constructions} with {\em Inductive Definitions}. It is presented in
-this chapter.
+ Constructions} with {\em Inductive Definitions}, also featuring a
+universe hierarchy and coinductive types. Its inference rules are
+presented in this chapter.
+
For {\Coq} version V7, this Calculus was known as the
-{\em Calculus of (Co)Inductive Constructions}\index{Calculus of
- (Co)Inductive Constructions} (\iCIC\ in short).
+{\em Calculus of Inductive Constructions}\index{Calculus of
+ Inductive Constructions} (\iCIC\ in short).
The underlying calculus of {\Coq} version V8.0 and up is a weaker
calculus where the sort \Set{} satisfies predicative rules.
We call this calculus the
-{\em Predicative Calculus of (Co)Inductive
+{\em Predicative Calculus of Inductive
Constructions}\index{Predicative Calculus of
- (Co)Inductive Constructions} (\pCIC\ in short).
+ Inductive Constructions} (\pCIC\ in short).
In Section~\ref{impredicativity} we give the extra-rules for \iCIC. A
compiling option of \Coq{} allows type-checking theories in this
extended system.
--
cgit v1.2.3
From 650ed1278160c2d6dae7914703c8755ab54e095c Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sun, 4 Oct 2015 21:16:17 +0200
Subject: RefMan, ch. 4: Reformulating introduction of the chapter on CIC,
being clearer that the version depends on the version of Coq.
Also renouncing to the "Predicative" and "(Co)" in the name, since
after all, usage seems to continue calling the language of Coq
Calculus of Inductive Constructions and to consider the Set
predicative vs Set impredicative, as well as the presence of
coinduction, as flavors of the CIC.
---
doc/common/macros.tex | 3 +--
doc/refman/RefMan-cic.tex | 65 +++++++++++++++++++++++++----------------------
doc/refman/biblio.bib | 25 +++++++++++++++---
3 files changed, 57 insertions(+), 36 deletions(-)
(limited to 'doc')
diff --git a/doc/common/macros.tex b/doc/common/macros.tex
index 0e820008ed..573c3c812e 100644
--- a/doc/common/macros.tex
+++ b/doc/common/macros.tex
@@ -97,8 +97,7 @@
\newcommand{\camlpppp}{\textsc{Camlp4}}
\newcommand{\emacs}{\textsc{GNU Emacs}}
\newcommand{\ProofGeneral}{\textsc{Proof General}}
-\newcommand{\CIC}{\pCIC}
-\newcommand{\pCIC}{p\textsc{Cic}}
+\newcommand{\CIC}{\textsc{Cic}}
\newcommand{\iCIC}{\textsc{Cic}}
\newcommand{\FW}{\ensuremath{F_{\omega}}}
\newcommand{\Program}{\textsc{Program}}
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 2bf5bb357e..a06e7acbad 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -5,22 +5,29 @@
\index{Calculus of Inductive Constructions}}
The underlying formal language of {\Coq} is a {\em Calculus of
- Constructions} with {\em Inductive Definitions}, also featuring a
-universe hierarchy and coinductive types. Its inference rules are
-presented in this chapter.
-
-For {\Coq} version V7, this Calculus was known as the
-{\em Calculus of Inductive Constructions}\index{Calculus of
- Inductive Constructions} (\iCIC\ in short).
-The underlying calculus of {\Coq} version V8.0 and up is a weaker
- calculus where the sort \Set{} satisfies predicative rules.
-We call this calculus the
-{\em Predicative Calculus of Inductive
- Constructions}\index{Predicative Calculus of
- Inductive Constructions} (\pCIC\ in short).
-In Section~\ref{impredicativity} we give the extra-rules for \iCIC. A
- compiling option of \Coq{} allows type-checking theories in this
- extended system.
+ Inductive Constructions} (\CIC) whose inference rules are presented in
+this chapter.
+
+The {\CIC} implemented in {\Coq}
+takes its name from Coquand and Paulin's {\em Calculus of
+ Inductive Constructions}~\cite{CoPa89} which itself extends
+Coquand-Huet's {\em Calculus of
+ Constructions}~\cite{CoHu85a,CoHu85b,CoHu86,Coq85} with a universe
+hierarchy~\cite{Coq86,Luo90,Hue88b} and a generic presentation of
+inductive types à la Martin-L\"of~\cite{MaL84,Dyb91}. First implemented in
+{\Coq} version 5.0, it incorporated coinductive
+types~\cite{Coquand93,Gim96} from {\Coq} version 5.10. It
+progressively extended with various new features such as local
+definitions (since {\Coq} version 7.0), universe polymorphism (since
+{\Coq} version 8.1 for inductive types and version 8.5 for full
+polymorphism), recursively non-uniform parameters (since {\Coq} version 8.1),
+some $\eta$-rules (for dependent product in {\Coq}
+version 8.4, for record types in {\Coq} version 8.5), and other
+refinements in the expressiveness of fixpoints and inductive types.
+Up to version 7.4, the {\CIC} implemented in {\Coq}
+had an impredicative sort {\Set}. Since {\Coq} version 8.0, the sort
+{\Set} is predicative by default, with an option to make it
+impredicative (see Section~\ref{impredicativity}).
In \CIC\, all objects have a {\em type}. There are types for functions (or
programs), there are atomic types (especially datatypes)... but also
@@ -28,29 +35,25 @@ types for proofs and types for the types themselves.
Especially, any object handled in the formalism must belong to a
type. For instance, the statement {\it ``for all x, P''} is not
allowed in type theory; you must say instead: {\it ``for all x
-belonging to T, P''}. The expression {\it ``x belonging to T''} is
-written {\it ``x:T''}. One also says: {\it ``x has type T''}.
+of type T, P''}. The expression {\it ``x of type T''} is
+written {\it ``x:T''}. Informally, {\it ``x:T''} can be thought as
+{\it ``x belongs to T''}.
The terms of {\CIC} are detailed in Section~\ref{Terms}.
-In \CIC\, there is an internal reduction mechanism. In particular, it
+In \CIC, there is an internal reduction mechanism. In particular, it
can decide if two programs are {\em intentionally} equal (one
says {\em convertible}). Convertibility is presented in section
\ref{convertibility}.
-The remaining sections are concerned with the type-checking of terms.
-The beginner can skip them.
-
The reader seeking a background on the Calculus of Inductive
-Constructions may read several papers. Giménez and Castéran~\cite{GimCas05}
+Constructions may read several papers. In addition to the references given above, Giménez and Castéran~\cite{GimCas05}
provide
an introduction to inductive and co-inductive definitions in Coq. In
-their book~\cite{CoqArt}, Bertot and Castéran give a precise
+their book~\cite{CoqArt}, Bertot and Castéran give a
description of the \CIC{} based on numerous practical examples.
Barras~\cite{Bar99}, Werner~\cite{Wer94} and
-Paulin-Mohring~\cite{Moh97} are the most recent theses dealing with
-Inductive Definitions. Coquand-Huet~\cite{CoHu85a,CoHu85b,CoHu86}
-introduces the Calculus of Constructions. Coquand-Paulin~\cite{CoPa89}
-extended this calculus to inductive definitions. The {\CIC} is a
+Paulin-Mohring~\cite{Moh97} are dealing with
+Inductive Definitions. The {\CIC} is a
formulation of type theory including the possibility of inductive
constructions, Barendregt~\cite{Bar91} studies the modern form of type
theory.
@@ -1701,11 +1704,11 @@ More information on co-inductive definitions can be found
in~\cite{Gimenez95b,Gim98,GimCas05}.
%They are described in Chapter~\ref{Co-inductives}.
-\section[\iCIC : the Calculus of Inductive Construction with
- impredicative \Set]{\iCIC : the Calculus of Inductive Construction with
+\section[The Calculus of Inductive Construction with
+ impredicative \Set]{The Calculus of Inductive Construction with
impredicative \Set\label{impredicativity}}
-\Coq{} can be used as a type-checker for \iCIC{}, the original
+\Coq{} can be used as a type-checker for the
Calculus of Inductive Constructions with an impredicative sort \Set{}
by using the compiler option \texttt{-impredicative-set}.
diff --git a/doc/refman/biblio.bib b/doc/refman/biblio.bib
index d78ce4f2c6..6f789b081c 100644
--- a/doc/refman/biblio.bib
+++ b/doc/refman/biblio.bib
@@ -288,9 +288,14 @@ s},
@InProceedings{Coquand93,
author = {Th. Coquand},
- title = {{Infinite Objects in Type Theory}},
+ 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},
- crossref = {Nijmegen93}
+ pages = {62-78}
}
@inproceedings{Corbineau08types,
@@ -540,6 +545,13 @@ s},
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},
@@ -660,6 +672,13 @@ s},
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},
@@ -1366,4 +1385,4 @@ Languages},
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}
-}
\ No newline at end of file
+}
--
cgit v1.2.3
From e7c38a5516246b751b89535594075f6f95a243fd Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sun, 4 Oct 2015 22:17:46 +0200
Subject: RefMan, ch. 4: In chapter 4 about CIC, renounced to keep a local
context for discharge in global declarations. Discharge now done on a global
declaration. Hence removed Def and Assum which were only partially used (e.g.
in rules Def and Assum but not in delta-conversion, nor in rule Const).
Added discharge rule over definitions using let-in. It replaces the
"substitution" rule since about 7.0.
---
doc/common/macros.tex | 1 +
doc/refman/RefMan-cic.tex | 92 ++++++++++++++++++++++++-----------------------
2 files changed, 49 insertions(+), 44 deletions(-)
(limited to 'doc')
diff --git a/doc/common/macros.tex b/doc/common/macros.tex
index 573c3c812e..f785a85bbc 100644
--- a/doc/common/macros.tex
+++ b/doc/common/macros.tex
@@ -412,6 +412,7 @@
\newcommand{\Fix}[2]{\mbox{\tt Fix}~#1\{#2\}}
\newcommand{\CoFix}[2]{\mbox{\tt CoFix}~#1\{#2\}}
\newcommand{\With}[2]{\mbox{\tt ~with~}}
+\newcommand{\letin}[3]{\kw{let}~#1:=#2~\kw{in}~#3}
\newcommand{\subst}[3]{#1\{#2/#3\}}
\newcommand{\substs}[4]{#1\{(#2/#3)_{#4}\}}
\newcommand{\Sort}{\mbox{$\cal S$}}
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index a06e7acbad..52003dc34f 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -297,10 +297,10 @@ definitions, but also declarations of inductive objects. Inductive objects thems
(see Section~\ref{Cic-inductive-definitions}).
A global assumption will be represented in the global environment as
-\Assum{\Gamma}{c}{T} which assumes the name $c$ to be of some type $T$
-valid in some local context $\Gamma$. A global definition will
-be represented in the global environment as \Def{\Gamma}{c}{t}{T} which defines
-the name $c$ to have value $t$ and type $T$, both valid in $\Gamma$.
+$(c:T)$ which assumes the name $c$ to be of some type $T$.
+A global definition will
+be represented in the global environment as $c:=t:T$ which defines
+the name $c$ to have value $t$ and type $T$.
We shall call such names {\em constants}.
The rules for inductive definitions (see section
@@ -342,10 +342,10 @@ be derived from the following rules.
\frac{\WTEG{t}{T}~~~~x \not\in
\Gamma % \cup E
}{\WFE{\Gamma::(x:=t:T)}}}
-\item[Def] \inference{\frac{\WTEG{t}{T}~~~c \notin E \cup \Gamma}
- {\WF{E;\Def{\Gamma}{c}{t}{T}}{\Gamma}}}
-\item[Assum] \inference{\frac{\WTEG{T}{s}~~~~s \in \Sort~~~~c \notin E \cup \Gamma}
- {\WF{E;\Assum{\Gamma}{c}{T}}{\Gamma}}}
+\item[Def] \inference{\frac{\WTE{}{t}{T}~~~c \notin E}
+ {\WF{E;c:=t:T}{}}}
+ \item[Assum] \inference{\frac{\WTE{}{T}{s}~~~~s \in \Sort~~~~c \notin E}
+ {\WF{E;c:T}{}}}
\item[Ax] \index{Typing rules!Ax}
\inference{\frac{\WFE{\Gamma}}{\WTEG{\Prop}{\Type(p)}}~~~~~
\frac{\WFE{\Gamma}}{\WTEG{\Set}{\Type(q)}}}
@@ -372,7 +372,7 @@ be derived from the following rules.
{\WTEG{(t\ u)}{\subst{T}{x}{u}}}}
\item[Let]\index{Typing rules!Let}
\inference{\frac{\WTEG{t}{T}~~~~ \WTE{\Gamma::(x:=t:T)}{u}{U}}
- {\WTEG{\kw{let}~x:=t~\kw{in}~u}{\subst{U}{x}{t}}}}
+ {\WTEG{\letin{x}{t:T}{u}}{\subst{U}{x}{t}}}}
\end{description}
\Rem We may have $\kw{let}~x:=t~\kw{in}~u$
@@ -528,51 +528,55 @@ Because these rules correspond to elementary operations in the \Coq\
engine used in the discharge mechanism at the end of a section, we
state them explicitly.
-\paragraph{Mechanism of substitution.}
+% This is obsolete: Abstraction over defined constants actually uses a
+% let-in since there are let-ins in Coq
-One rule which can be proved valid, is to replace a term $c$ by its
-value in the global environment. As we defined the substitution of a term for
-a variable in a term, one can define the substitution of a term for a
-constant. One easily extends this substitution to local contexts and global
-environments.
+%% \paragraph{Mechanism of substitution.}
-\paragraph{Substitution Property:}
-\inference{\frac{\WF{E;\Def{\Gamma}{c}{t}{T}; F}{\Delta}}
- {\WF{E; \subst{F}{c}{t}}{\subst{\Delta}{c}{t}}}}
+%% One rule which can be proved valid, is to replace a term $c$ by its
+%% value in the global environment. As we defined the substitution of a term for
+%% a variable in a term, one can define the substitution of a term for a
+%% constant. One easily extends this substitution to local contexts and global
+%% environments.
+%% \paragraph{Substitution Property:}
+%% \inference{\frac{\WF{E;c:=t:T; E'}{\Gamma}}
+%% {\WF{E; \subst{E'}{c}{t}}{\subst{\Gamma}{c}{t}}}}
\paragraph{Abstraction.}
-One can modify the local context of definition of a constant $c$ by
-abstracting a constant with respect to the last variable $x$ of its
-defining local context. For doing that, we need to check that the constants
-appearing in the body of the declaration do not depend on $x$, we need
-also to modify the reference to the constant $c$ in the global environment
-and local context by explicitly applying this constant to the variable $x$.
-Because of the rules for building global environments and terms we know the
-variable $x$ is available at each stage where $c$ is mentioned.
-
-\paragraph{Abstracting property:}
- \inference{\frac{\WF{E; \Def{\Gamma::(x:U)}{c}{t}{T};
- F}{\Delta}~~~~\WFE{\Gamma}}
- {\WF{E;\Def{\Gamma}{c}{\lb x:U\mto t}{\forall~x:U,T};
- \subst{F}{c}{(c~x)}}{\subst{\Delta}{c}{(c~x)}}}}
+One can modify the definition of a constant $c$ by generalizing it
+over a previously assumed constant $c'$. For doing that, we need
+to modify the reference to $c$ in the subsequent global environment
+and local context by explicitly applying this constant to the constant $c'$.
-\paragraph{Pruning the local context.}
-We said the judgment \WFE{\Gamma} means that the defining local contexts of
-constants in $E$ are included in $\Gamma$. If one abstracts or
-substitutes the constants with the above rules then it may happen
-that the local context $\Gamma$ is now bigger than the one needed for
-defining the constants in $E$. Because defining local contexts are growing
-in $E$, the minimum local context needed for defining the constants in $E$
-is the same as the one for the last constant. One can consequently
-derive the following property.
+\paragraph{First abstracting property:}
+ \inference{\frac{\WF{E;c':U;E';c:=t:T;E''}{\Gamma}}
+ {\WF{E;c':U;E';c:=\lb x:U\mto \subst{t}{c'}{x}:\forall~x:U,\subst{T}{c'}{x};
+ \subst{E''}{c}{(c~c')}}{\subst{\Gamma}{c}{(c~c')}}}}
-\paragraph{Pruning property:}
-\inference{\frac{\WF{E; \Def{\Delta}{c}{t}{T}}{\Gamma}}
- {\WF{E;\Def{\Delta}{c}{t}{T}}{\Delta}}}
+One can similarly modify the definition of a constant $c$ by generalizing it
+over a previously defined constant $c'$.
+\paragraph{Second abstracting property:}
+ \inference{\frac{\WF{E;c':=u:U;E';c:=t:T;E''}{\Gamma}}
+ {\WF{E;c':=u:U;E';c:=(\letin{x}{u:U}{\subst{t}{c'}{x}}):\subst{T}{c'}{u};
+ E''}{\Gamma}}}
+\paragraph{Pruning the local context.}
+If one abstracts or substitutes constants with the above rules then it
+may happen that some declared or defined constant does not occur any
+more in the subsequent global environment and in the local context. One can
+consequently derive the following property.
+
+\paragraph{First pruning property:}
+\inference{\frac{\WF{E;c:U;E'}{\Gamma} \qquad c \mbox{ does not occur in $E'$ and $\Gamma$}}
+ {\WF{E;E'}{\Gamma}}}
+
+\paragraph{Second pruning property:}
+\inference{\frac{\WF{E;c:=u:U;E'}{\Gamma} \qquad c \mbox{ does not occur in $E'$ and $\Gamma$}}
+ {\WF{E;E'}{\Gamma}}}
+
\section[Inductive Definitions]{Inductive Definitions\label{Cic-inductive-definitions}}
A (possibly mutual) inductive definition is specified by giving the
--
cgit v1.2.3
From 779c314c28abbff3d9fc1fca9a2c75dc7e103a1c Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Tue, 6 Oct 2015 11:45:02 +0200
Subject: RefMan, ch. 4: Reference Manual: more on the "in pattern" clause and
"@qualid pattern".
---
doc/refman/Cases.tex | 4 +++-
doc/refman/RefMan-gal.tex | 21 ++++++++++++---------
2 files changed, 15 insertions(+), 10 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/Cases.tex b/doc/refman/Cases.tex
index 4238bf6a57..a95d8114ff 100644
--- a/doc/refman/Cases.tex
+++ b/doc/refman/Cases.tex
@@ -521,6 +521,8 @@ I have a copy of {\tt b} in type {\tt listn 0} resp {\tt listn (S n')}.
% \end{coq_example}
\paragraph{Patterns in {\tt in}}
+\label{match-in-patterns}
+
If the type of the matched term is more precise than an inductive applied to
variables, arguments of the inductive in the {\tt in} branch can be more
complicated patterns than a variable.
@@ -530,7 +532,7 @@ become impossible branches. In an impossible branch, you can answer
anything but {\tt False\_rect unit} has the advantage to be subterm of
anything. % ???
-To be concrete: the tail function can be written:
+To be concrete: the {\tt tail} function can be written:
\begin{coq_example}
Definition tail n (v: listn (S n)) :=
match v in listn (S m) return listn m with
diff --git a/doc/refman/RefMan-gal.tex b/doc/refman/RefMan-gal.tex
index e49c82d8fd..f631c3717c 100644
--- a/doc/refman/RefMan-gal.tex
+++ b/doc/refman/RefMan-gal.tex
@@ -311,7 +311,7 @@ called \CIC). The formal presentation of {\CIC} is given in Chapter
{\annotation} & ::= & {\tt \{ struct} {\ident} {\tt \}} \\
&&\\
{\caseitem} & ::= & {\term} \zeroone{{\tt as} \name}
- \zeroone{{\tt in} \pattern} \\
+ \zeroone{{\tt in} \qualid \sequence{\pattern}{}} \\
&&\\
{\ifitem} & ::= & \zeroone{{\tt as} {\name}} {\returntype} \\
&&\\
@@ -322,7 +322,7 @@ called \CIC). The formal presentation of {\CIC} is given in Chapter
{\multpattern} & ::= & \nelist{\pattern}{\tt ,}\\
&&\\
{\pattern} & ::= & {\qualid} \nelist{\pattern}{} \\
- & $|$ & {\tt @} {\qualid} \sequence{\pattern}{} \\
+ & $|$ & {\tt @} {\qualid} \nelist{\pattern}{} \\
& $|$ & {\pattern} {\tt as} {\ident} \\
& $|$ & {\pattern} {\tt \%} {\ident} \\
@@ -609,17 +609,20 @@ the type of each branch can depend on the type dependencies specific
to the branch and the whole pattern-matching expression has a type
determined by the specific dependencies in the type of the term being
matched. This dependency of the return type in the annotations of the
-inductive type is expressed using a {\tt
-``in~I~\_~$\ldots$~\_~\ident$_1$~$\ldots$~\ident$_n$}'' clause, where
+inductive type is expressed using a
+ ``in~I~\_~$\ldots$~\_~\pattern$_1$~$\ldots$~\pattern$_n$'' clause, where
\begin{itemize}
\item $I$ is the inductive type of the term being matched;
-\item the names \ident$_i$'s correspond to the arguments of the
-inductive type that carry the annotations: the return type is dependent
-on them;
-
-\item the {\_}'s denote the family parameters of the inductive type:
+\item the {\_}'s are matching the parameters of the inductive type:
the return type is not dependent on them.
+
+\item the \pattern$_i$'s are matching the annotations of the inductive
+ type: the return type is dependent on them
+
+\item in the basic case which we describe below, each \pattern$_i$ is a
+ name \ident$_i$; see \ref{match-in-patterns} for the general case
+
\end{itemize}
For instance, in the following example:
--
cgit v1.2.3
From ba00ffda884142fdd1b4d8b0888d3c9a35457c99 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Tue, 6 Oct 2015 19:45:38 +0200
Subject: RefMan, ch. 4: a few clarifications, thanks to Matej.
There is still something buggy in explaining the interpretation of "match"
as "case": we need typing to reconstruct the types of the x and y1..yn
from the "as x in I ... y1..yn" clause.
---
doc/refman/RefMan-cic.tex | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 52003dc34f..aa4483759e 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -497,7 +497,7 @@ The conversion rule is now exactly:
\paragraph[Normal form.]{Normal form.\index{Normal form}\label{Normal-form}\label{Head-normal-form}\index{Head normal form}}
A term which cannot be any more reduced is said to be in {\em normal
form}. There are several ways (or strategies) to apply the reduction
-rule. Among them, we have to mention the {\em head reduction} which
+rules. Among them, we have to mention the {\em head reduction} which
will play an important role (see Chapter~\ref{Tactics}). Any term can
be written as $\lb x_1:T_1\mto \ldots \lb x_k:T_k \mto
(t_0\ t_1\ldots t_n)$ where
@@ -967,7 +967,7 @@ Inductive exType (P:Type->Prop) : Type
From {\Coq} version 8.1, inductive families declared in {\Type} are
polymorphic over their arguments in {\Type}.
-If $A$ is an arity and $s$ a sort, we write $A_{/s}$ for the arity
+If $A$ is an arity of some sort and $s$ is a sort, we write $A_{/s}$ for the arity
obtained from $A$ by replacing its sort with $s$. Especially, if $A$
is well-typed in some global environment and local context, then $A_{/s}$ is typable
by typability of all products in the Calculus of Inductive Constructions.
@@ -1260,13 +1260,13 @@ compact notation:
\paragraph[Allowed elimination sorts.]{Allowed elimination sorts.\index{Elimination sorts}}
An important question for building the typing rule for \kw{match} is
-what can be the type of $P$ with respect to the type of the inductive
+what can be the type of $\lb a x \mto P$ with respect to the type of the inductive
definitions.
We define now a relation \compat{I:A}{B} between an inductive
definition $I$ of type $A$ and an arity $B$. This relation states that
an object in the inductive definition $I$ can be eliminated for
-proving a property $P$ of type $B$.
+proving a property $\lb a x \mto P$ of type $B$.
The case of inductive definitions in sorts \Set\ or \Type{} is simple.
There is no restriction on the sort of the predicate to be
--
cgit v1.2.3
From 19a3cb9cf627e593026a675ff7201bb1dc8e3574 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Tue, 6 Oct 2015 19:49:57 +0200
Subject: RefMan, ch. 4: Avoiding using "inductive family" which is not
defined. Using consistently "inductive types".
---
doc/refman/RefMan-cic.tex | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index aa4483759e..174f318fed 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -631,7 +631,7 @@ the value over the parameter. In the case of inductive definitions we
have to handle the abstraction over several objects.
One possible way to do that would be to define the type \List\
-inductively as being an inductive family of type $\Set\ra\Set$:
+inductively as being an inductive type of type $\Set\ra\Set$:
\[\NInd{}{\List:\Set\ra\Set}{\Nil:(\forall A:\Set,\List~A),
\cons : (\forall A:\Set, A \ra \List~A \ra \List~A)}\]
There are drawbacks to this point of view. The
@@ -961,10 +961,10 @@ Inductive exType (P:Type->Prop) : Type
%is recursive or not. We shall write the type $(x:_R T)C$ if it is
%a recursive argument and $(x:_P T)C$ if the argument is not recursive.
-\paragraph[Sort-polymorphism of inductive families.]{Sort-polymorphism of inductive families.\index{Sort-polymorphism of inductive families}}
+\paragraph[Sort-polymorphism of inductive types.]{Sort-polymorphism of inductive types.\index{Sort-polymorphism of inductive types}}
\label{Sort-polymorphism-inductive}
-From {\Coq} version 8.1, inductive families declared in {\Type} are
+From {\Coq} version 8.1, inductive types declared in {\Type} are
polymorphic over their arguments in {\Type}.
If $A$ is an arity of some sort and $s$ is a sort, we write $A_{/s}$ for the arity
@@ -1057,7 +1057,7 @@ predicative {\Set}.
More precisely, an empty or small singleton inductive definition
(i.e. an inductive definition of which all inductive types are
singleton -- see paragraph~\ref{singleton}) is set in
-{\Prop}, a small non-singleton inductive family is set in {\Set} (even
+{\Prop}, a small non-singleton inductive type is set in {\Set} (even
in case {\Set} is impredicative -- see Section~\ref{impredicativity}),
and otherwise in the {\Type} hierarchy.
% TODO: clarify the case of a partial application ??
--
cgit v1.2.3
From 6beb39ff5e8e52692cc008e4b43ee28ecf792f8a Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Fri, 9 Oct 2015 14:45:23 +0200
Subject: RefMan, ch. 4: Moving section on discharge after inductive types.
---
doc/refman/RefMan-cic.tex | 116 +++++++++++++++++++++++-----------------------
1 file changed, 58 insertions(+), 58 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 174f318fed..3b0a204e3b 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -375,7 +375,7 @@ be derived from the following rules.
{\WTEG{\letin{x}{t:T}{u}}{\subst{U}{x}{t}}}}
\end{description}
-\Rem We may have $\kw{let}~x:=t~\kw{in}~u$
+\Rem We may have $\letin{x}{t:T}{u}$
well-typed without having $((\lb x:T\mto u)~t)$ well-typed (where
$T$ is a type of $t$). This is because the value $t$ associated to $x$
may be used in a conversion rule (see Section~\ref{conv-rules}).
@@ -520,63 +520,6 @@ $u_i$ can be reducible.
Similar notions of head-normal forms involving $\delta$, $\iota$ and $\zeta$
reductions or any combination of those can also be defined.
-\section{Derived rules for global environments}
-
-From the original rules of the type system, one can derive new rules
-which change the local context of definition of objects in the global environment.
-Because these rules correspond to elementary operations in the \Coq\
-engine used in the discharge mechanism at the end of a section, we
-state them explicitly.
-
-% This is obsolete: Abstraction over defined constants actually uses a
-% let-in since there are let-ins in Coq
-
-%% \paragraph{Mechanism of substitution.}
-
-%% One rule which can be proved valid, is to replace a term $c$ by its
-%% value in the global environment. As we defined the substitution of a term for
-%% a variable in a term, one can define the substitution of a term for a
-%% constant. One easily extends this substitution to local contexts and global
-%% environments.
-
-%% \paragraph{Substitution Property:}
-%% \inference{\frac{\WF{E;c:=t:T; E'}{\Gamma}}
-%% {\WF{E; \subst{E'}{c}{t}}{\subst{\Gamma}{c}{t}}}}
-
-\paragraph{Abstraction.}
-
-One can modify the definition of a constant $c$ by generalizing it
-over a previously assumed constant $c'$. For doing that, we need
-to modify the reference to $c$ in the subsequent global environment
-and local context by explicitly applying this constant to the constant $c'$.
-
-\paragraph{First abstracting property:}
- \inference{\frac{\WF{E;c':U;E';c:=t:T;E''}{\Gamma}}
- {\WF{E;c':U;E';c:=\lb x:U\mto \subst{t}{c'}{x}:\forall~x:U,\subst{T}{c'}{x};
- \subst{E''}{c}{(c~c')}}{\subst{\Gamma}{c}{(c~c')}}}}
-
-One can similarly modify the definition of a constant $c$ by generalizing it
-over a previously defined constant $c'$.
-
-\paragraph{Second abstracting property:}
- \inference{\frac{\WF{E;c':=u:U;E';c:=t:T;E''}{\Gamma}}
- {\WF{E;c':=u:U;E';c:=(\letin{x}{u:U}{\subst{t}{c'}{x}}):\subst{T}{c'}{u};
- E''}{\Gamma}}}
-
-\paragraph{Pruning the local context.}
-If one abstracts or substitutes constants with the above rules then it
-may happen that some declared or defined constant does not occur any
-more in the subsequent global environment and in the local context. One can
-consequently derive the following property.
-
-\paragraph{First pruning property:}
-\inference{\frac{\WF{E;c:U;E'}{\Gamma} \qquad c \mbox{ does not occur in $E'$ and $\Gamma$}}
- {\WF{E;E'}{\Gamma}}}
-
-\paragraph{Second pruning property:}
-\inference{\frac{\WF{E;c:=u:U;E'}{\Gamma} \qquad c \mbox{ does not occur in $E'$ and $\Gamma$}}
- {\WF{E;E'}{\Gamma}}}
-
\section[Inductive Definitions]{Inductive Definitions\label{Cic-inductive-definitions}}
A (possibly mutual) inductive definition is specified by giving the
@@ -1701,6 +1644,63 @@ Abort.
The principles of mutual induction can be automatically generated
using the {\tt Scheme} command described in Section~\ref{Scheme}.
+\section{Derived rules for global environments}
+
+From the original rules of the type system, one can derive new rules
+which change the local context of definition of objects in the global environment.
+Because these rules correspond to elementary operations in the \Coq\
+engine used in the discharge mechanism at the end of a section, we
+state them explicitly.
+
+% This is obsolete: Abstraction over defined constants actually uses a
+% let-in since there are let-ins in Coq
+
+%% \paragraph{Mechanism of substitution.}
+
+%% One rule which can be proved valid, is to replace a term $c$ by its
+%% value in the global environment. As we defined the substitution of a term for
+%% a variable in a term, one can define the substitution of a term for a
+%% constant. One easily extends this substitution to local contexts and global
+%% environments.
+
+%% \paragraph{Substitution Property:}
+%% \inference{\frac{\WF{E;c:=t:T; E'}{\Gamma}}
+%% {\WF{E; \subst{E'}{c}{t}}{\subst{\Gamma}{c}{t}}}}
+
+\paragraph{Abstraction.}
+
+One can modify the definition of a constant $c$ by generalizing it
+over a previously assumed constant $c'$. For doing that, we need
+to modify the reference to $c$ in the subsequent global environment
+and local context by explicitly applying this constant to the constant $c'$.
+
+\paragraph{First abstracting property:}
+ \inference{\frac{\WF{E;c':U;E';c:=t:T;E''}{\Gamma}}
+ {\WF{E;c':U;E';c:=\lb x:U\mto \subst{t}{c'}{x}:\forall~x:U,\subst{T}{c'}{x};
+ \subst{E''}{c}{(c~c')}}{\subst{\Gamma}{c}{(c~c')}}}}
+
+One can similarly modify the definition of a constant $c$ by generalizing it
+over a previously defined constant $c'$.
+
+\paragraph{Second abstracting property:}
+ \inference{\frac{\WF{E;c':=u:U;E';c:=t:T;E''}{\Gamma}}
+ {\WF{E;c':=u:U;E';c:=(\letin{x}{u:U}{\subst{t}{c'}{x}}):\subst{T}{c'}{u};
+ E''}{\Gamma}}}
+
+\paragraph{Pruning the local context.}
+If one abstracts or substitutes constants with the above rules then it
+may happen that some declared or defined constant does not occur any
+more in the subsequent global environment and in the local context. One can
+consequently derive the following property.
+
+\paragraph{First pruning property:}
+\inference{\frac{\WF{E;c:U;E'}{\Gamma} \qquad c \mbox{ does not occur in $E'$ and $\Gamma$}}
+ {\WF{E;E'}{\Gamma}}}
+
+\paragraph{Second pruning property:}
+\inference{\frac{\WF{E;c:=u:U;E'}{\Gamma} \qquad c \mbox{ does not occur in $E'$ and $\Gamma$}}
+ {\WF{E;E'}{\Gamma}}}
+
\section{Co-inductive types}
The implementation contains also co-inductive definitions, which are
types inhabited by infinite objects.
--
cgit v1.2.3
From 8654b03544f0efe4b418a0afdc871ff84784ff83 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Fri, 9 Oct 2015 15:57:52 +0200
Subject: RefMan, ch. 4: Adding discharging of inductive types.
---
doc/common/macros.tex | 1 +
doc/refman/RefMan-cic.tex | 60 +++++++++++++++++++++++++++++++++--------------
2 files changed, 43 insertions(+), 18 deletions(-)
(limited to 'doc')
diff --git a/doc/common/macros.tex b/doc/common/macros.tex
index f785a85bbc..88770affbc 100644
--- a/doc/common/macros.tex
+++ b/doc/common/macros.tex
@@ -363,6 +363,7 @@
\newcommand{\myifthenelse}[3]{\kw{if} ~ #1 ~\kw{then} ~ #2 ~ \kw{else} ~ #3}
\newcommand{\fun}[2]{\item[]{\tt {#1}}. \quad\\ #2}
\newcommand{\WF}[2]{\ensuremath{{\cal W\!F}(#1)[#2]}}
+\newcommand{\WFTWOLINES}[2]{\ensuremath{{\cal W\!F}\begin{array}{l}(#1)\\\mbox{}[{#2}]\end{array}}}
\newcommand{\WFE}[1]{\WF{E}{#1}}
\newcommand{\WT}[4]{\ensuremath{#1[#2] \vdash #3 : #4}}
\newcommand{\WTE}[3]{\WT{E}{#1}{#2}{#3}}
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 3b0a204e3b..6b75fa5216 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1644,13 +1644,12 @@ Abort.
The principles of mutual induction can be automatically generated
using the {\tt Scheme} command described in Section~\ref{Scheme}.
-\section{Derived rules for global environments}
+\section{Admissible rules for global environments}
-From the original rules of the type system, one can derive new rules
-which change the local context of definition of objects in the global environment.
-Because these rules correspond to elementary operations in the \Coq\
-engine used in the discharge mechanism at the end of a section, we
-state them explicitly.
+From the original rules of the type system, one can show the
+admissibility of rules which change the local context of definition of
+objects in the global environment. We show here the admissible rules
+that are used used in the discharge mechanism at the end of a section.
% This is obsolete: Abstraction over defined constants actually uses a
% let-in since there are let-ins in Coq
@@ -1669,23 +1668,48 @@ state them explicitly.
\paragraph{Abstraction.}
-One can modify the definition of a constant $c$ by generalizing it
-over a previously assumed constant $c'$. For doing that, we need
-to modify the reference to $c$ in the subsequent global environment
-and local context by explicitly applying this constant to the constant $c'$.
+One can modify a global declaration by generalizing it over a
+previously assumed constant $c$. For doing that, we need to modify the
+reference to the global declaration in the subsequent global
+environment and local context by explicitly applying this constant to
+the constant $c'$.
+
+Below, if $\Gamma$ is a context of the form
+$[y_1:A_1;\ldots;y_n:A_n]$, we write $\forall
+x:U,\subst{\Gamma}{c}{x}$ to mean
+$[y_1:\forall~x:U,\subst{A_1}{c}{x};\ldots;y_n:\forall~x:U,\subst{A_n}{c}{x}]$
+and
+$\subst{E}{|\Gamma|}{|\Gamma|c}$.
+to mean the parallel substitution
+$\subst{\subst{E}{y_1}{(y_1~c)}\ldots}{y_n}{(y_n~c)}$.
\paragraph{First abstracting property:}
- \inference{\frac{\WF{E;c':U;E';c:=t:T;E''}{\Gamma}}
- {\WF{E;c':U;E';c:=\lb x:U\mto \subst{t}{c'}{x}:\forall~x:U,\subst{T}{c'}{x};
- \subst{E''}{c}{(c~c')}}{\subst{\Gamma}{c}{(c~c')}}}}
+ \inference{\frac{\WF{E;c:U;E';c':=t:T;E''}{\Gamma}}
+ {\WF{E;c:U;E';c':=\lb x:U\mto \subst{t}{c}{x}:\forall~x:U,\subst{T}{c}{x};
+ \subst{E''}{c'}{(c'~c)}}{\subst{\Gamma}{c}{(c~c')}}}}
-One can similarly modify the definition of a constant $c$ by generalizing it
-over a previously defined constant $c'$.
+ \inference{\frac{\WF{E;c:U;E';c':T;E''}{\Gamma}}
+ {\WF{E;c:U;E';c':\forall~x:U,\subst{T}{c}{x};
+ \subst{E''}{c'}{(c'~c)}}{\subst{\Gamma}{c}{(c~c')}}}}
+
+ \inference{\frac{\WF{E;c:U;E';\Ind{}{p}{\Gamma_I}{\Gamma_C};E''}{\Gamma}}
+ {\WFTWOLINES{E;c:U;E';\Ind{}{p+1}{\forall x:U,\subst{\Gamma_I}{c}{x}}{\forall x:U,\subst{\Gamma_C}{c}{x}};\subst{E''}{|\Gamma_I,\Gamma_C|}{|\Gamma_I,\Gamma_C|~c}}{\subst{\Gamma}{|\Gamma_I,\Gamma_C|}{|\Gamma_I,\Gamma_C|~c}}}}
+
+One can similarly modify a global declaration by generalizing it over
+a previously defined constant~$c'$. Below, if $\Gamma$ is a context
+of the form $[y_1:A_1;\ldots;y_n:A_n]$, we write $
+\subst{\Gamma}{c}{u}$ to mean
+$[y_1:\subst{A_1}{c}{u};\ldots;y_n:\subst{A_n}{c}{u}]$.
\paragraph{Second abstracting property:}
- \inference{\frac{\WF{E;c':=u:U;E';c:=t:T;E''}{\Gamma}}
- {\WF{E;c':=u:U;E';c:=(\letin{x}{u:U}{\subst{t}{c'}{x}}):\subst{T}{c'}{u};
- E''}{\Gamma}}}
+ \inference{\frac{\WF{E;c:=u:U;E';c':=t:T;E''}{\Gamma}}
+ {\WF{E;c:=u:U;E';c':=(\letin{x}{u:U}{\subst{t}{c}{x}}):\subst{T}{c}{u};E''}{\Gamma}}}
+
+ \inference{\frac{\WF{E;c:=u:U;E';c':T;E''}{\Gamma}}
+ {\WF{E;c:=u:U;E';c':\subst{T}{c}{u};E''}{\Gamma}}}
+
+ \inference{\frac{\WF{E;c:=u:U;E';\Ind{}{p}{\Gamma_I}{\Gamma_C};E''}{\Gamma}}
+ {\WF{E;c:=u:U;E';\Ind{}{p}{\subst{\Gamma_I}{c}{u}}{\subst{\Gamma_C}{c}{u}};E''}{\Gamma}}}
\paragraph{Pruning the local context.}
If one abstracts or substitutes constants with the above rules then it
--
cgit v1.2.3
From b94bdd32024675b546642c710539f8d583df4e94 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sun, 18 Oct 2015 21:07:27 +0200
Subject: RefMan, ch. 4: Removing the local context of inductive definitions.
---
doc/common/macros.tex | 4 +-
doc/refman/RefMan-cic.tex | 101 +++++++++++++++++++++++-----------------------
2 files changed, 52 insertions(+), 53 deletions(-)
(limited to 'doc')
diff --git a/doc/common/macros.tex b/doc/common/macros.tex
index 88770affbc..ff13ec4557 100644
--- a/doc/common/macros.tex
+++ b/doc/common/macros.tex
@@ -393,9 +393,9 @@
\newcommand{\CIPI}[1]{\CIP{#1}{I}{P}}
\newcommand{\CIF}[1]{\mbox{$\{#1\}_{f_1.. f_n}$}}
%BEGIN LATEX
-\newcommand{\NInd}[3]{\mbox{{\sf Ind}$(#1)(\begin{array}[t]{@{}l}#2:=#3
+\newcommand{\NInd}[3]{\mbox{{\sf Ind}$(\begin{array}[t]{@{}l}#2:=#3
\,)\end{array}$}}
-\newcommand{\Ind}[4]{\mbox{{\sf Ind}$(#1)[#2](\begin{array}[t]{@{}l@{}}#3:=#4
+\newcommand{\Ind}[4]{\mbox{{\sf Ind}$[#2](\begin{array}[t]{@{}l@{}}#3:=#4
\,)\end{array}$}}
%END LATEX
%HEVEA \newcommand{\NInd}[3]{\mbox{{\sf Ind}$(#1)(#2:=#3\,)$}}
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 6b75fa5216..a41e1f398b 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -531,7 +531,7 @@ definitions, one for constructors).
Stating the rules for inductive definitions in their general form
needs quite tedious definitions. We shall try to give a concrete
-understanding of the rules by precising them on running examples. We
+understanding of the rules by illustrating them on running examples. We
take as examples the type of natural numbers, the type of
parameterized lists over a type $A$, the relation which states that
a list has some given length and the mutual inductive definition of trees and
@@ -539,36 +539,38 @@ forests.
\subsection{Representing an inductive definition}
\subsubsection{Inductive definitions without parameters}
-As for constants, inductive definitions can be defined in a non-empty
+As for constants, inductive definitions must be defined in a non-empty
local context. \\
-We write \NInd{\Gamma}{\Gamma_I}{\Gamma_C} an inductive
-definition valid in a local context $\Gamma$, a
+We write \NInd{}{\Gamma_I}{\Gamma_C} for an inductive
+definition with a
context of type definitions $\Gamma_I$ and a context of constructors
$\Gamma_C$.
\paragraph{Examples.}
The inductive declaration for the type of natural numbers will be:
\[\NInd{}{\nat:\Set}{\nO:\nat,\nS:\nat\ra\nat}\]
-In a local context with a variable $A:\Set$, the lists of elements in $A$ are
+In a context with assumption $A:\Set$, the lists of elements in $A$ are
represented by:
-\[\NInd{A:\Set}{\List:\Set}{\Nil:\List,\cons : A \ra \List \ra
+\[\NInd{}{\List:\Set}{\Nil:\List,\cons : A \ra \List \ra
\List}\]
- Assuming
- $\Gamma_I$ is $[I_1:A_1;\ldots;I_k:A_k]$, and $\Gamma_C$ is
- $[c_1:C_1;\ldots;c_n:C_n]$, the general typing rules are,
- for $1\leq j\leq k$ and $1\leq i\leq n$:
+%% Assuming
+%% $\Gamma_I$ is $[I_1:A_1;\ldots;I_k:A_k]$, and $\Gamma_C$ is
+%% $[c_1:C_1;\ldots;c_n:C_n]$, the general typing rules are,
+%% for $1\leq j\leq k$ and $1\leq i\leq n$:
-\bigskip
-\inference{\frac{\NInd{\Gamma}{\Gamma_I}{\Gamma_C} \in E}{(I_j:A_j) \in E}}
+%% \bigskip
-\inference{\frac{\NInd{\Gamma}{\Gamma_I}{\Gamma_C} \in E}{(c_i:C_i) \in E}}
+%% \item[Ind] \index{Typing rules!Ind}
+%% \inference{\frac{\NInd{}{\Gamma_I}{\Gamma_C} \in E}{(I_j:A_j) \in E}}
+%% \item[Constr] \index{Typing rules!Constr}
+
+%% \inference{\frac{\NInd{}{\Gamma_I}{\Gamma_C} \in E}{(c_i:C_i) \in E}}
\subsubsection{Inductive definitions with parameters}
-We have to slightly complicate the representation above in order to handle
-the delicate problem of parameters.
+We have refine the representation above in order to handle parameters.
Let us explain that on the example of \List. With the above definition,
the type \List\ can only be used in a global environment where we
-have a variable $A:\Set$. Generally one want to consider lists of
+have a variable $A:\Set$. Generally one wants to consider lists of
elements in different types. For constants this is easily done by abstracting
the value over the parameter. In the case of inductive definitions we
have to handle the abstraction over several objects.
@@ -648,22 +650,22 @@ parameters.
Formally the representation of an inductive declaration
will be
-\Ind{\Gamma}{p}{\Gamma_I}{\Gamma_C} for an inductive
-definition valid in a local context $\Gamma$ with $p$ parameters, a
+\Ind{}{p}{\Gamma_I}{\Gamma_C} for an inductive
+definition with $p$ parameters, a
context of definitions $\Gamma_I$ and a context of constructors
$\Gamma_C$.
-The definition \Ind{\Gamma}{p}{\Gamma_I}{\Gamma_C} will be
-well-formed exactly when \NInd{\Gamma}{\Gamma_I}{\Gamma_C} is and
+The definition \Ind{}{p}{\Gamma_I}{\Gamma_C} will be
+well-formed exactly when \NInd{}{\Gamma_I}{\Gamma_C} is and
when $p$ is (less or equal than) the number of parameters in
-\NInd{\Gamma}{\Gamma_I}{\Gamma_C}.
+\NInd{}{\Gamma_I}{\Gamma_C}.
\paragraph{Examples}
The declaration for parameterized lists is:
\[\Ind{}{1}{\List:\Set\ra\Set}{\Nil:(\forall A:\Set,\List~A),\cons :
(\forall A:\Set, A \ra \List~A \ra \List~A)}\]
-The declaration for the length of lists is:
+The declaration for an inductive type specifying the length of lists is:
\[\Ind{}{1}{\Length:\forall A:\Set, (\List~A)\ra \nat\ra\Prop}
{\LNil:\forall A:\Set, \Length~A~(\Nil~A)~\nO,\\
\LCons :\forall A:\Set,\forall a:A, \forall l:(\List~A),\forall n:\nat, (\Length~A~l~n)\ra (\Length~A~(\cons~A~a~l)~(\nS~n))}\]
@@ -674,7 +676,7 @@ The declaration for a mutual inductive definition of forests and trees is:
\emptyf:\forest,\consf:\tree \ra \forest \ra \forest\-}\]
These representations are the ones obtained as the result of the \Coq\
-declaration:
+declarations:
\begin{coq_example*}
Inductive nat : Set :=
| O : nat
@@ -731,16 +733,13 @@ We have to give the type of constants in a global environment $E$ which
contains an inductive declaration.
\begin{description}
-\item[Ind-Const] Assuming
- $\Gamma_I$ is $[I_1:A_1;\ldots;I_k:A_k]$, and $\Gamma_C$ is
- $[c_1:C_1;\ldots;c_n:C_n]$,
-
-\inference{\frac{\Ind{\Gamma}{p}{\Gamma_I}{\Gamma_C} \in E
- ~~j=1\ldots k}{(I_j:A_j) \in E}}
-
-\inference{\frac{\Ind{\Gamma}{p}{\Gamma_I}{\Gamma_C} \in E
- ~~~~i=1.. n}
- {(c_i:C_i) \in E}}
+\item[Ind] \index{Typing rules!Ind}
+\inference{\frac{\Ind{}{p}{\Gamma_I}{\Gamma_C} \in E}{(I_j:A_j) \in E}}
+\inference{\frac{\WFE{\Gamma}~~~~\NInd{}{\Gamma_I}{\Gamma_C} \in E}{\WTEG{I_j}{A_j}}}
+\item[Constr] \index{Typing rules!Constr}
+
+\inference{\frac{\Ind{}{p}{\Gamma_I}{\Gamma_C} \in E}{(c_i:C_i) \in E}}
+\inference{\frac{\WFE{\Gamma}~~~~\NInd{}{\Gamma_I}{\Gamma_C} \in E}{\WTEG{c_i}{C_i}}}
\end{description}
\paragraph{Example.}
@@ -846,20 +845,20 @@ inductive definition.
\begin{description}
\item[W-Ind] Let $E$ be a global environment and
- $\Gamma,\Gamma_P,\Gamma_I,\Gamma_C$ are contexts such that
+ $\Gamma_P,\Gamma_I,\Gamma_C$ are contexts such that
$\Gamma_I$ is $[I_1:\forall \Gamma_P,A_1;\ldots;I_k:\forall
\Gamma_P,A_k]$ and $\Gamma_C$ is
$[c_1:\forall \Gamma_P,C_1;\ldots;c_n:\forall \Gamma_P,C_n]$.
\inference{
\frac{
- (\WTE{\Gamma;\Gamma_P}{A_j}{s'_j})_{j=1\ldots k}
- ~~ (\WTE{\Gamma;\Gamma_I;\Gamma_P}{C_i}{s_{q_i}})_{i=1\ldots n}
+ (\WTE{\Gamma_P}{A_j}{s'_j})_{j=1\ldots k}
+ ~~ (\WTE{\Gamma_I;\Gamma_P}{C_i}{s_{q_i}})_{i=1\ldots n}
}
- {\WF{E;\Ind{\Gamma}{p}{\Gamma_I}{\Gamma_C}}{\Gamma}}}
+ {\WF{E;\Ind{}{p}{\Gamma_I}{\Gamma_C}}{\Gamma}}}
provided that the following side conditions hold:
\begin{itemize}
\item $k>0$ and all of $I_j$ and $c_i$ are distinct names for $j=1\ldots k$ and $i=1\ldots n$,
-\item $p$ is the number of parameters of \NInd{\Gamma}{\Gamma_I}{\Gamma_C}
+\item $p$ is the number of parameters of \NInd{}{\Gamma_I}{\Gamma_C}
and $\Gamma_P$ is the context of parameters,
\item for $j=1\ldots k$ we have that $A_j$ is an arity of sort $s_j$ and $I_j
\notin \Gamma \cup E$,
@@ -871,7 +870,7 @@ provided that the following side conditions hold:
One can remark that there is a constraint between the sort of the
arity of the inductive type and the sort of the type of its
constructors which will always be satisfied for the impredicative sort
-(\Prop) but may fail to define inductive definition
+{\Prop} but may fail to define inductive definition
on sort \Set{} and generate constraints between universes for
inductive definitions in the {\Type} hierarchy.
@@ -917,7 +916,7 @@ by typability of all products in the Calculus of Inductive Constructions.
The following typing rule is added to the theory.
\begin{description}
-\item[Ind-Family] Let $\Ind{\Gamma}{p}{\Gamma_I}{\Gamma_C}$ be an
+\item[Ind-Family] Let $\Ind{}{p}{\Gamma_I}{\Gamma_C}$ be an
inductive definition. Let $\Gamma_P = [p_1:P_1;\ldots;p_{p}:P_{p}]$
be its local context of parameters, $\Gamma_I = [I_1:\forall
\Gamma_P,A_1;\ldots;I_k:\forall \Gamma_P,A_k]$ its context of
@@ -937,13 +936,13 @@ The following typing rule is added to the theory.
\inference{\frac
{\left\{\begin{array}{l}
-\Ind{\Gamma}{p}{\Gamma_I}{\Gamma_C} \in E\\
-(E[\Gamma] \vdash q_l : P'_l)_{l=1\ldots r}\\
+\Ind{}{p}{\Gamma_I}{\Gamma_C} \in E\\
+(E[] \vdash q_l : P'_l)_{l=1\ldots r}\\
(\WTEGLECONV{P'_l}{\subst{P_l}{p_u}{q_u}_{u=1\ldots l-1}})_{l=1\ldots r}\\
1 \leq j \leq k
\end{array}
\right.}
-{E[\Gamma] \vdash (I_j\,q_1\,\ldots\,q_r:\forall [p_{r+1}:P_{r+1};\ldots;p_{p}:P_{p}], (A_j)_{/s_j})}
+{E[] \vdash (I_j\,q_1\,\ldots\,q_r:\forall [p_{r+1}:P_{r+1};\ldots;p_{p}:P_{p}], (A_j)_{/s_j})}
}
provided that the following side conditions hold:
@@ -955,7 +954,7 @@ $P_l$ arity implies $P'_l$ arity since $\WTEGLECONV{P'_l}{ \subst{P_l}{p_u}{q_u}
\item there are sorts $s_i$, for $1 \leq i \leq k$ such that, for
$\Gamma_{I'} = [I_1:\forall
\Gamma_{P'},(A_1)_{/s_1};\ldots;I_k:\forall \Gamma_{P'},(A_k)_{/s_k}]$
-we have $(\WTE{\Gamma;\Gamma_{I'};\Gamma_{P'}}{C_i}{s_{q_i}})_{i=1\ldots n}$;
+we have $(\WTE{\Gamma_{I'};\Gamma_{P'}}{C_i}{s_{q_i}})_{i=1\ldots n}$;
\item the sorts are such that all eliminations, to {\Prop}, {\Set} and
$\Type(j)$, are allowed (see section~\ref{elimdep}).
\end{itemize}
@@ -965,12 +964,12 @@ Notice that if $I_j\,q_1\,\ldots\,q_r$ is typable using the rules {\bf
Ind-Const} and {\bf App}, then it is typable using the rule {\bf
Ind-Family}. Conversely, the extended theory is not stronger than the
theory without {\bf Ind-Family}. We get an equiconsistency result by
-mapping each $\Ind{\Gamma}{p}{\Gamma_I}{\Gamma_C}$ occurring into a
+mapping each $\Ind{}{p}{\Gamma_I}{\Gamma_C}$ occurring into a
given derivation into as many different inductive types and constructors
as the number of different (partial) replacements of sorts, needed for
this derivation, in the parameters that are arities (this is possible
-because $\Ind{\Gamma}{p}{\Gamma_I}{\Gamma_C}$ well-formed implies
-that $\Ind{\Gamma}{p}{\Gamma_{I'}}{\Gamma_{C'}}$ is well-formed and
+because $\Ind{}{p}{\Gamma_I}{\Gamma_C}$ well-formed implies
+that $\Ind{}{p}{\Gamma_{I'}}{\Gamma_{C'}}$ is well-formed and
has the same allowed eliminations, where
$\Gamma_{I'}$ is defined as above and $\Gamma_{C'} = [c_1:\forall
\Gamma_{P'},C_1;\ldots;c_n:\forall \Gamma_{P'},C_n]$). That is,
@@ -980,7 +979,7 @@ sorts among the types of parameters, and to each signature is
associated a new inductive definition with fresh names. Conversion is
preserved as any (partial) instance $I_j\,q_1\,\ldots\,q_r$ or
$C_i\,q_1\,\ldots\,q_r$ is mapped to the names chosen in the specific
-instance of $\Ind{\Gamma}{p}{\Gamma_I}{\Gamma_C}$.
+instance of $\Ind{}{p}{\Gamma_I}{\Gamma_C}$.
\newcommand{\Single}{\mbox{\textsf{Set}}}
@@ -1396,7 +1395,7 @@ following typing rule
{\WTEG{\Case{P}{c}{f_1|\ldots |f_l}}{(P\ t_1\ldots t_s\ c)}}}%\\[3mm]
provided $I$ is an inductive type in a declaration
-\Ind{\Delta}{r}{\Gamma_I}{\Gamma_C} with
+\Ind{}{r}{\Gamma_I}{\Gamma_C} with
$\Gamma_C = [c_1:C_1;\ldots;c_n:C_n]$ and $c_{p_1}\ldots c_{p_l}$ are the
only constructors of $I$.
\end{description}
@@ -1511,7 +1510,7 @@ syntactically recognized as structurally smaller than $y_{k_i}$
The definition of being structurally smaller is a bit technical.
One needs first to define the notion of
{\em recursive arguments of a constructor}\index{Recursive arguments}.
-For an inductive definition \Ind{\Gamma}{r}{\Gamma_I}{\Gamma_C},
+For an inductive definition \Ind{}{r}{\Gamma_I}{\Gamma_C},
the type of a constructor $c$ has the form
$\forall p_1:P_1,\ldots \forall p_r:P_r,
\forall x_1:T_1, \ldots \forall x_r:T_r, (I_j~p_1\ldots
@@ -1522,7 +1521,7 @@ which one of the $I_l$ occurs.
The main rules for being structurally smaller are the following:\\
Given a variable $y$ of type an inductive
definition in a declaration
-\Ind{\Gamma}{r}{\Gamma_I}{\Gamma_C}
+\Ind{}{r}{\Gamma_I}{\Gamma_C}
where $\Gamma_I$ is $[I_1:A_1;\ldots;I_k:A_k]$, and $\Gamma_C$ is
$[c_1:C_1;\ldots;c_n:C_n]$.
The terms structurally smaller than $y$ are:
--
cgit v1.2.3
From a9fd632cfa7377aebdcb03ee015384d09ba6bd98 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Mon, 19 Oct 2015 16:27:53 +0200
Subject: RefMan, ch. 4: Misc. local improvements and typesetting.
---
doc/refman/RefMan-cic.tex | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index a41e1f398b..baef635933 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -48,7 +48,7 @@ says {\em convertible}). Convertibility is presented in section
The reader seeking a background on the Calculus of Inductive
Constructions may read several papers. In addition to the references given above, Giménez and Castéran~\cite{GimCas05}
provide
-an introduction to inductive and co-inductive definitions in Coq. In
+an introduction to inductive and co-inductive definitions in {\Coq}. In
their book~\cite{CoqArt}, Bertot and Castéran give a
description of the \CIC{} based on numerous practical examples.
Barras~\cite{Bar99}, Werner~\cite{Wer94} and
@@ -120,15 +120,15 @@ Formally, we call {\Sort} the set of sorts which is defined by:
\index{Set@{\Set}}
The sorts enjoy the following properties\footnote{In the Reference
- Manual of versions of Coq prior to 8.4, the level of {\Type} typing
- {\Prop} and {\Set} was numbered $0$. From Coq 8.4, it started to be
+ Manual of versions of {\Coq} prior to 8.4, the level of {\Type} typing
+ {\Prop} and {\Set} was numbered $0$. From {\Coq} 8.4, it started to be
numbered $1$ so as to be able to leave room for re-interpreting
{\Set} in the hierarchy as {\Type$(0)$}. This change also put the
reference manual in accordance with the internal conventions adopted
in the implementation.}: {\Prop:\Type$(1)$}, {\Set:\Type$(1)$} and
{\Type$(i)$:\Type$(i+1)$}.
-The user will never mention explicitly the index $i$ when referring to
+The user does not have to mention explicitly the index $i$ when referring to
the universe \Type$(i)$. One only writes \Type. The
system itself generates for each instance of \Type\ a new
index for the universe and checks that the constraints between these
@@ -203,14 +203,14 @@ More precisely the language of the {\em Calculus of Inductive
%\item constructors are terms.
%\item inductive types are terms.
\item if $x$ is a variable and $T$, $U$ are terms then $\forall~x:T,U$
- ($\kw{forall}~x:T,U$ in \Coq{} concrete syntax) is a term. If $x$
+ ($\kw{forall}~x:T,~U$ in \Coq{} concrete syntax) is a term. If $x$
occurs in $U$, $\forall~x:T,U$ reads as {\it ``for all x of type T,
U''}. As $U$ depends on $x$, one says that $\forall~x:T,U$ is a
{\em dependent product}. If $x$ doesn't occurs in $U$ then
$\forall~x:T,U$ reads as {\it ``if T then U''}. A non dependent
product can be written: $T \rightarrow U$.
\item if $x$ is a variable and $T$, $U$ are terms then $\lb x:T \mto U$
- ($\kw{fun}~x:T\Ra U$ in \Coq{} concrete syntax) is a term. This is a
+ ($\kw{fun}~x:T~ {\tt =>}~ U$ in \Coq{} concrete syntax) is a term. This is a
notation for the $\lambda$-abstraction of
$\lambda$-calculus\index{lambda-calculus@$\lambda$-calculus}
\cite{Bar81}. The term $\lb x:T \mto U$ is a function which maps
@@ -249,11 +249,11 @@ variable $x$ in a term $u$ is defined as usual. The resulting term
is written $\subst{u}{x}{t}$.
-\section[Typed terms]{Typed terms\label{Typed-terms}}
+\section[Typing rules]{Typing rules\label{Typed-terms}}
As objects of type theory, terms are subjected to {\em type
discipline}. The well typing of a term depends on
-a global environment (see below) and a local context.
+a global environment and a local context.
\paragraph{Local context.}
A {\em local context} is an ordered list of
@@ -375,7 +375,7 @@ be derived from the following rules.
{\WTEG{\letin{x}{t:T}{u}}{\subst{U}{x}{t}}}}
\end{description}
-\Rem We may have $\letin{x}{t:T}{u}$
+\Rem We may have $\kw{let}~x:=t~\kw{in}~u$
well-typed without having $((\lb x:T\mto u)~t)$ well-typed (where
$T$ is a type of $t$). This is because the value $t$ associated to $x$
may be used in a conversion rule (see Section~\ref{conv-rules}).
@@ -628,7 +628,7 @@ But the following definition has $0$ parameters:
%$\NInd{}{\List:\Set\ra\Set}{\Nil:(A:\Set)(\List~A),\cons : (A:\Set)A
% \ra (\List~A\ra A) \ra (\List~A)}$.}
\paragraph{Concrete syntax.}
-In the Coq system, the local context of parameters is given explicitly
+In the {\Coq} system, the local context of parameters is given explicitly
after the name of the inductive definitions and is shared between the
arities and the type of constructors.
% The vernacular declaration of polymorphic trees and forests will be:\\
@@ -906,7 +906,7 @@ Inductive exType (P:Type->Prop) : Type
\paragraph[Sort-polymorphism of inductive types.]{Sort-polymorphism of inductive types.\index{Sort-polymorphism of inductive types}}
\label{Sort-polymorphism-inductive}
-From {\Coq} version 8.1, inductive types declared in {\Type} are
+Inductive types declared in {\Type} are
polymorphic over their arguments in {\Type}.
If $A$ is an arity of some sort and $s$ is a sort, we write $A_{/s}$ for the arity
@@ -1113,7 +1113,7 @@ at the computational level it implements a generic operator for doing
primitive recursion over the structure.
But this operator is rather tedious to implement and use. We choose in
-this version of Coq to factorize the operator for primitive recursion
+this version of {\Coq} to factorize the operator for primitive recursion
into two more primitive operations as was first suggested by Th. Coquand
in~\cite{Coq92}. One is the definition by pattern-matching. The second one is a definition by guarded fixpoints.
--
cgit v1.2.3
From c033eb2624b5b25ddf4c2c35d700c46eba86e27d Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Sun, 18 Oct 2015 22:09:07 +0200
Subject: RefMan, ch. 4: Rephrasing and moving paragraph on the double reading
proof/program of the syntax.
---
doc/refman/RefMan-cic.tex | 46 +++++++++++++++++++++++++++++++---------------
doc/refman/biblio.bib | 9 +++++++++
2 files changed, 40 insertions(+), 15 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index baef635933..b09367a2a9 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -68,21 +68,6 @@ a mutual recursive way and also because similar constructions can be
applied to both terms and types and consequently can share the same
syntactic structure.
-Consider for instance the $\ra$ constructor and assume \nat\ is the
-type of natural numbers. Then $\ra$ is used both to denote
-$\nat\ra\nat$ which is the type of functions from \nat\ to \nat, and
-to denote $\nat \ra \Prop$ which is the type of unary predicates over
-the natural numbers. Consider abstraction which builds functions. It
-serves to build ``ordinary'' functions as $\kw{fun}~x:\nat \Ra ({\tt mult} ~x~x)$ (assuming {\tt mult} is already defined) but may build also
-predicates over the natural numbers. For instance $\kw{fun}~x:\nat \Ra
-(x=x)$ will
-represent a predicate $P$, informally written in mathematics
-$P(x)\equiv x=x$. If $P$ has type $\nat \ra \Prop$, $(P~x)$ is a
-proposition, furthermore $\kw{forall}~x:\nat,(P~x)$ will represent the type of
-functions which associate to each natural number $n$ an object of
-type $(P~n)$ and consequently represent proofs of the formula
-``$\forall x.P(x)$''.
-
\subsection[Sorts]{Sorts\label{Sorts}
\index{Sorts}}
When manipulated as terms, types have themselves a type which is called a sort.
@@ -248,6 +233,37 @@ The notion of substituting a term $t$ to free occurrences of a
variable $x$ in a term $u$ is defined as usual. The resulting term
is written $\subst{u}{x}{t}$.
+\paragraph[The logical vs programming readings.]{The logical vs programming readings.}
+
+The constructions of the {\CIC} can be used to express both logical
+and programming notions, accordingly to the Curry-Howard
+correspondence between proofs and programs, and between propositions
+and types~\cite{Cur58,How80,Bru72}.
+
+For instance, let us assume that \nat\ is the type of natural numbers
+with zero element written $0$ and that ${\tt True}$ is the always true
+proposition. Then $\ra$ is used both to denote $\nat\ra\nat$ which is
+the type of functions from \nat\ to \nat, to denote ${\tt True}\ra{\tt
+ True}$ which is an implicative proposition, to denote $\nat \ra
+\Prop$ which is the type of unary predicates over the natural numbers,
+etc.
+
+Let us assume that ${\tt mult}$ is a function of type $\nat\ra\nat\ra
+\nat$ and ${\tt eqnat}$ a predicate of type $\nat\ra\nat\ra \Prop$.
+The $\lambda$-abstraction can serve to build ``ordinary'' functions as
+in $\lambda x:\nat.({\tt mult}~x~x)$ (i.e. $\kw{fun}~x:\nat ~{\tt =>}~
+{\tt mult} ~x~x$ in {\Coq} notation) but may build also predicates
+over the natural numbers. For instance $\lambda x:\nat.({\tt eqnat}~
+x~0)$ (i.e. $\kw{fun}~x:\nat ~{\tt =>}~ {\tt eqnat}~ x~0$ in {\Coq}
+notation) will represent the predicate of one variable $x$ which
+asserts the equality of $x$ with $0$. This predicate has type $\nat
+\ra \Prop$ and it can be applied to any expression of type ${\nat}$,
+say $t$, to give an object $P~t$ of type \Prop, namely a proposition.
+
+Furthermore $\kw{forall}~x:\nat,\,P\;x$ will represent the type of
+functions which associate to each natural number $n$ an object of type
+$(P~n)$ and consequently represent the type of proofs of the formula
+``$\forall x.\,P(x)$''.
\section[Typing rules]{Typing rules\label{Typed-terms}}
diff --git a/doc/refman/biblio.bib b/doc/refman/biblio.bib
index 6f789b081c..70ee1f41f0 100644
--- a/doc/refman/biblio.bib
+++ b/doc/refman/biblio.bib
@@ -328,6 +328,15 @@ s},
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
--
cgit v1.2.3
From 08857b1f4455e942aeba456affdb0f61eaa4266a Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Thu, 22 Oct 2015 16:22:34 +0200
Subject: Smoothing the introduction and section Terms.
---
doc/refman/RefMan-cic.tex | 66 +++++++++++++++++++++--------------------------
1 file changed, 30 insertions(+), 36 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index b09367a2a9..a97fce8700 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -29,22 +29,6 @@ had an impredicative sort {\Set}. Since {\Coq} version 8.0, the sort
{\Set} is predicative by default, with an option to make it
impredicative (see Section~\ref{impredicativity}).
-In \CIC\, all objects have a {\em type}. There are types for functions (or
-programs), there are atomic types (especially datatypes)... but also
-types for proofs and types for the types themselves.
-Especially, any object handled in the formalism must belong to a
-type. For instance, the statement {\it ``for all x, P''} is not
-allowed in type theory; you must say instead: {\it ``for all x
-of type T, P''}. The expression {\it ``x of type T''} is
-written {\it ``x:T''}. Informally, {\it ``x:T''} can be thought as
-{\it ``x belongs to T''}.
-The terms of {\CIC} are detailed in Section~\ref{Terms}.
-
-In \CIC, there is an internal reduction mechanism. In particular, it
-can decide if two programs are {\em intentionally} equal (one
-says {\em convertible}). Convertibility is presented in section
-\ref{convertibility}.
-
The reader seeking a background on the Calculus of Inductive
Constructions may read several papers. In addition to the references given above, Giménez and Castéran~\cite{GimCas05}
provide
@@ -60,20 +44,26 @@ theory.
\section[The terms]{The terms\label{Terms}}
-In most type theories, one usually makes a syntactic distinction
-between types and terms. This is not the case for \CIC\ which defines
-both types and terms in the same syntactical structure. This is
-because the type-theory itself forces terms and types to be defined in
-a mutual recursive way and also because similar constructions can be
-applied to both terms and types and consequently can share the same
-syntactic structure.
+The expressions of the {\CIC} are {\em terms} and all terms have a {\em type}.
+There are types for functions (or
+programs), there are atomic types (especially datatypes)... but also
+types for proofs and types for the types themselves.
+Especially, any object handled in the formalism must belong to a
+type. For instance, universal quantification is relative to a type and
+takes the form {\it ``for all x
+of type T, P''}. The expression {\it ``x of type T''} is
+written {\it ``x:T''}. Informally, {\it ``x:T''} can be thought as
+{\it ``x belongs to T''}.
+
+The types of types are {\em sorts}. Types and sorts are themselves
+terms so that terms, types and sorts are all components of a common
+syntactic language of terms which is described in
+Section~\label{cic:terms} but, first, we describe sorts.
\subsection[Sorts]{Sorts\label{Sorts}
\index{Sorts}}
-When manipulated as terms, types have themselves a type which is called a sort.
-
-There is an infinite well-founded typing hierarchy of sorts whose base
-sorts are {\Prop} and {\Set}.
+All sorts have a type and there is an infinite well-founded
+typing hierarchy of sorts whose base sorts are {\Prop} and {\Set}.
The sort {\Prop} intends to be the type of logical propositions. If
$M$ is a logical proposition then it denotes the class of terms
@@ -167,6 +157,7 @@ inconsistency} error (see also Section~\ref{PrintingUniverses}).
%% in a theory where inductive objects are represented by terms.
\subsection{Terms}
+\label{cic:terms}
Terms are built from sorts, variables, constant,
%constructors, inductive types,
@@ -175,23 +166,22 @@ abstraction, application, local definitions,
and products.
From a syntactic point of view, types cannot be distinguished from terms,
-except that they cannot start by an abstraction, and that if a term is
-a sort or a product, it should be a type.
+except that they cannot start by an abstraction or a constructor.
More precisely the language of the {\em Calculus of Inductive
- Constructions} is built from the following rules:
+ Constructions} is built from the following rules.
\begin{enumerate}
\item the sorts {\Set}, {\Prop}, ${\Type(i)}$ are terms.
-\item variables are terms
-\item constants are terms.
-%\item constructors are terms.
-%\item inductive types are terms.
+\item variables, hereafter ranged over by letters $x$, $y$, etc., are terms
+\item constants, hereafter ranged over by letters $c$, $d$, etc., are terms.
+%\item constructors, hereafter ranged over by letter $C$, are terms.
+%\item inductive types, hereafter ranged over by letter $I$, are terms.
\item if $x$ is a variable and $T$, $U$ are terms then $\forall~x:T,U$
($\kw{forall}~x:T,~U$ in \Coq{} concrete syntax) is a term. If $x$
occurs in $U$, $\forall~x:T,U$ reads as {\it ``for all x of type T,
U''}. As $U$ depends on $x$, one says that $\forall~x:T,U$ is a
- {\em dependent product}. If $x$ doesn't occurs in $U$ then
+ {\em dependent product}. If $x$ does not occur in $U$ then
$\forall~x:T,U$ reads as {\it ``if T then U''}. A non dependent
product can be written: $T \rightarrow U$.
\item if $x$ is a variable and $T$, $U$ are terms then $\lb x:T \mto U$
@@ -199,7 +189,7 @@ More precisely the language of the {\em Calculus of Inductive
notation for the $\lambda$-abstraction of
$\lambda$-calculus\index{lambda-calculus@$\lambda$-calculus}
\cite{Bar81}. The term $\lb x:T \mto U$ is a function which maps
- elements of $T$ to $U$.
+ elements of $T$ to the expression $U$.
\item if $T$ and $U$ are terms then $(T\ U)$ is a term
($T~U$ in \Coq{} concrete syntax). The term $(T\
U)$ reads as {\it ``T applied to U''}.
@@ -400,6 +390,10 @@ may be used in a conversion rule (see Section~\ref{conv-rules}).
\label{conv-rules}}
\paragraph[$\beta$-reduction.]{$\beta$-reduction.\label{beta}\index{beta-reduction@$\beta$-reduction}}
+In \CIC, there is an internal reduction mechanism. In particular, it
+can decide if two programs are {\em intentionally} equal (one
+says {\em convertible}). Convertibility is described in this section.
+
We want to be able to identify some terms as we can identify the
application of a function to a given argument with its result. For
instance the identity function over a given type $T$ can be written
--
cgit v1.2.3
From f1f19693f16a914b167ebcb18e96aac25a582920 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Fri, 23 Oct 2015 17:56:15 +0200
Subject: fix
---
doc/refman/RefMan-cic.tex | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index a97fce8700..f0046ffe6a 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -388,12 +388,13 @@ may be used in a conversion rule (see Section~\ref{conv-rules}).
\section[Conversion rules]{Conversion rules\index{Conversion rules}
\label{conv-rules}}
-\paragraph[$\beta$-reduction.]{$\beta$-reduction.\label{beta}\index{beta-reduction@$\beta$-reduction}}
In \CIC, there is an internal reduction mechanism. In particular, it
can decide if two programs are {\em intentionally} equal (one
says {\em convertible}). Convertibility is described in this section.
+\paragraph[$\beta$-reduction.]{$\beta$-reduction.\label{beta}\index{beta-reduction@$\beta$-reduction}}
+
We want to be able to identify some terms as we can identify the
application of a function to a given argument with its result. For
instance the identity function over a given type $T$ can be written
--
cgit v1.2.3
From da46d24c2645add913e187ebfc76590140ecd6ff Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Thu, 22 Oct 2015 16:43:33 +0200
Subject: Reformulating subtyping in a way closer to implementation.
---
doc/refman/RefMan-cic.tex | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index f0046ffe6a..ac62abbe55 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -353,9 +353,9 @@ be derived from the following rules.
\item[Assum] \inference{\frac{\WTE{}{T}{s}~~~~s \in \Sort~~~~c \notin E}
{\WF{E;c:T}{}}}
\item[Ax] \index{Typing rules!Ax}
-\inference{\frac{\WFE{\Gamma}}{\WTEG{\Prop}{\Type(p)}}~~~~~
-\frac{\WFE{\Gamma}}{\WTEG{\Set}{\Type(q)}}}
-\inference{\frac{\WFE{\Gamma}~~~~i}~ U$ in \Coq{} concrete syntax) is a term. This is a
+\item if $x$ is a variable and $T$, $u$ are terms then $\lb x:T \mto u$
+ ($\kw{fun}~x:T~ {\tt =>}~ u$ in \Coq{} concrete syntax) is a term. This is a
notation for the $\lambda$-abstraction of
$\lambda$-calculus\index{lambda-calculus@$\lambda$-calculus}
- \cite{Bar81}. The term $\lb x:T \mto U$ is a function which maps
- elements of $T$ to the expression $U$.
-\item if $T$ and $U$ are terms then $(T\ U)$ is a term
- ($T~U$ in \Coq{} concrete syntax). The term $(T\
- U)$ reads as {\it ``T applied to U''}.
-\item if $x$ is a variable, and $T$, $U$ are terms then
- $\kw{let}~x:=T~\kw{in}~U$ is a
- term which denotes the term $U$ where the variable $x$ is locally
- bound to $T$. This stands for the common ``let-in'' construction of
- functional programs such as ML or Scheme.
+ \cite{Bar81}. The term $\lb x:T \mto u$ is a function which maps
+ elements of $T$ to the expression $u$.
+\item if $t$ and $u$ are terms then $(t\ u)$ is a term
+ ($t~u$ in \Coq{} concrete syntax). The term $(t\
+ u)$ reads as {\it ``t applied to u''}.
+\item if $x$ is a variable, and $t$, $T$ and $u$ are terms then
+ $\kw{let}~x:=t:T~\kw{in}~u$ is a
+ term which denotes the term $u$ where the variable $x$ is locally
+ bound to $t$ of type $T$. This stands for the common ``let-in''
+ construction of functional programs such as ML or Scheme.
%\item case ...
%\item fixpoint ...
%\item cofixpoint ...
@@ -208,9 +208,9 @@ $(t\;t_1\;t_2\ldots t_n)$ represents $(\ldots ((t\;t_1)\;t_2)\ldots t_n)$. The
products and arrows associate to the right such that $\forall~x:A,B\ra C\ra
D$ represents $\forall~x:A,(B\ra (C\ra D))$. One uses sometimes
$\forall~x~y:A,B$ or
-$\lb x~y:A\mto B$ to denote the abstraction or product of several variables
+$\lb x~y:A\mto t$ to denote the abstraction or product of several variables
of the same type. The equivalent formulation is $\forall~x:A, \forall y:A,B$ or
-$\lb x:A \mto \lb y:A \mto B$
+$\lb x:A \mto \lb y:A \mto t$
\paragraph{Free variables.}
The notion of free variables is defined as usual. In the expressions
@@ -379,7 +379,7 @@ be derived from the following rules.
{\WTEG{\letin{x}{t:T}{u}}{\subst{U}{x}{t}}}}
\end{description}
-\Rem We may have $\kw{let}~x:=t~\kw{in}~u$
+\Rem We may have $\kw{let}~x:=t:T~\kw{in}~u$
well-typed without having $((\lb x:T\mto u)~t)$ well-typed (where
$T$ is a type of $t$). This is because the value $t$ associated to $x$
may be used in a conversion rule (see Section~\ref{conv-rules}).
--
cgit v1.2.3
From 899b701462fa056a22f997ae22c5ef7c1d247673 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Thu, 22 Oct 2015 21:01:29 +0200
Subject: Starting revising inductive types session
---
doc/refman/RefMan-cic.tex | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 8e1a1766e5..5002b905c7 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -534,11 +534,11 @@ reductions or any combination of those can also be defined.
\section[Inductive Definitions]{Inductive Definitions\label{Cic-inductive-definitions}}
A (possibly mutual) inductive definition is specified by giving the
-names and the type of the inductive sets or families to be
-defined and the names and types of the constructors of the inductive
-predicates. An inductive declaration in the global environment can
-consequently be represented with two local contexts (one for inductive
-definitions, one for constructors).
+names and types of the inductive types to be
+defined and the names and types of the constructors of the inductive types.
+An inductive declaration in the global environment can
+consequently be represented with two local contexts, one for the types
+one for the constructors.
Stating the rules for inductive definitions in their general form
needs quite tedious definitions. We shall try to give a concrete
--
cgit v1.2.3
From 5330263aaccb3ba9e7fcb8fada0737491fd99645 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Fri, 23 Oct 2015 17:51:06 +0200
Subject: Removing note on shifting the hierarchy by 1 in 8.4, which makes
things more complicated than needed.
---
doc/refman/RefMan-cic.tex | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 5002b905c7..08e962ebe2 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -94,13 +94,14 @@ Formally, we call {\Sort} the set of sorts which is defined by:
\index{Prop@{\Prop}}
\index{Set@{\Set}}
-The sorts enjoy the following properties\footnote{In the Reference
+The sorts enjoy the following properties%\footnote{In the Reference
Manual of versions of {\Coq} prior to 8.4, the level of {\Type} typing
{\Prop} and {\Set} was numbered $0$. From {\Coq} 8.4, it started to be
numbered $1$ so as to be able to leave room for re-interpreting
{\Set} in the hierarchy as {\Type$(0)$}. This change also put the
reference manual in accordance with the internal conventions adopted
- in the implementation.}: {\Prop:\Type$(1)$}, {\Set:\Type$(1)$} and
+ in the implementation.}%
+: {\Prop:\Type$(1)$}, {\Set:\Type$(1)$} and
{\Type$(i)$:\Type$(i+1)$}.
The user does not have to mention explicitly the index $i$ when referring to
--
cgit v1.2.3
From 17ca1e516bee3148ea7e3f272a443836c4949fc5 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Fri, 23 Oct 2015 17:54:48 +0200
Subject: Changing representation of prod over two Type: since the rule needs
subtyping anyway to manage the Set and Prop cases, why not to simplify it by
using subtyping also for managing Type.
---
doc/refman/RefMan-cic.tex | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 08e962ebe2..7986648fb9 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -95,12 +95,12 @@ Formally, we call {\Sort} the set of sorts which is defined by:
\index{Set@{\Set}}
The sorts enjoy the following properties%\footnote{In the Reference
- Manual of versions of {\Coq} prior to 8.4, the level of {\Type} typing
- {\Prop} and {\Set} was numbered $0$. From {\Coq} 8.4, it started to be
- numbered $1$ so as to be able to leave room for re-interpreting
- {\Set} in the hierarchy as {\Type$(0)$}. This change also put the
- reference manual in accordance with the internal conventions adopted
- in the implementation.}%
+ %% Manual of versions of {\Coq} prior to 8.4, the level of {\Type} typing
+ %% {\Prop} and {\Set} was numbered $0$. From {\Coq} 8.4, it started to be
+ %% numbered $1$ so as to be able to leave room for re-interpreting
+ %% {\Set} in the hierarchy as {\Type$(0)$}. This change also put the
+ %% reference manual in accordance with the internal conventions adopted
+ %% in the implementation.}
: {\Prop:\Type$(1)$}, {\Set:\Type$(1)$} and
{\Type$(i)$:\Type$(i+1)$}.
@@ -366,9 +366,9 @@ be derived from the following rules.
\inference{\frac{\WTEG{T}{s}~~~~s \in\{\Prop, \Set\}~~~~~~
\WTE{\Gamma::(x:T)}{U}{\Set}}
{ \WTEG{\forall~x:T,U}{\Set}}}
-\inference{\frac{\WTEG{T}{\Type(i)}~~~~i\leq k~~~
- \WTE{\Gamma::(x:T)}{U}{\Type(j)}~~~j \leq k}
- {\WTEG{\forall~x:T,U}{\Type(k)}}}
+\inference{\frac{\WTEG{T}{\Type(i)}~~~~
+ \WTE{\Gamma::(x:T)}{U}{\Type(i)}}
+ {\WTEG{\forall~x:T,U}{\Type(i)}}}
\item[Lam]\index{Typing rules!Lam}
\inference{\frac{\WTEG{\forall~x:T,U}{s}~~~~ \WTE{\Gamma::(x:T)}{t}{U}}
{\WTEG{\lb x:T\mto t}{\forall x:T, U}}}
--
cgit v1.2.3
From 41061d0dc42afe19b520059f36a98d4ec870825f Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 09:05:48 +0100
Subject: CLEANUP PROPOSITION: Duplicate information was removed and replaced
with a reference to the corresponding chapter.
---
doc/refman/RefMan-cic.tex | 39 +++------------------------------------
1 file changed, 3 insertions(+), 36 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 7986648fb9..c481b3adba 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -5,42 +5,9 @@
\index{Calculus of Inductive Constructions}}
The underlying formal language of {\Coq} is a {\em Calculus of
- Inductive Constructions} (\CIC) whose inference rules are presented in
-this chapter.
-
-The {\CIC} implemented in {\Coq}
-takes its name from Coquand and Paulin's {\em Calculus of
- Inductive Constructions}~\cite{CoPa89} which itself extends
-Coquand-Huet's {\em Calculus of
- Constructions}~\cite{CoHu85a,CoHu85b,CoHu86,Coq85} with a universe
-hierarchy~\cite{Coq86,Luo90,Hue88b} and a generic presentation of
-inductive types à la Martin-L\"of~\cite{MaL84,Dyb91}. First implemented in
-{\Coq} version 5.0, it incorporated coinductive
-types~\cite{Coquand93,Gim96} from {\Coq} version 5.10. It
-progressively extended with various new features such as local
-definitions (since {\Coq} version 7.0), universe polymorphism (since
-{\Coq} version 8.1 for inductive types and version 8.5 for full
-polymorphism), recursively non-uniform parameters (since {\Coq} version 8.1),
-some $\eta$-rules (for dependent product in {\Coq}
-version 8.4, for record types in {\Coq} version 8.5), and other
-refinements in the expressiveness of fixpoints and inductive types.
-Up to version 7.4, the {\CIC} implemented in {\Coq}
-had an impredicative sort {\Set}. Since {\Coq} version 8.0, the sort
-{\Set} is predicative by default, with an option to make it
-impredicative (see Section~\ref{impredicativity}).
-
-The reader seeking a background on the Calculus of Inductive
-Constructions may read several papers. In addition to the references given above, Giménez and Castéran~\cite{GimCas05}
-provide
-an introduction to inductive and co-inductive definitions in {\Coq}. In
-their book~\cite{CoqArt}, Bertot and Castéran give a
-description of the \CIC{} based on numerous practical examples.
-Barras~\cite{Bar99}, Werner~\cite{Wer94} and
-Paulin-Mohring~\cite{Moh97} are dealing with
-Inductive Definitions. The {\CIC} is a
-formulation of type theory including the possibility of inductive
-constructions, Barendregt~\cite{Bar91} studies the modern form of type
-theory.
+Inductive Constructions} (\CIC) whose inference rules are presented in
+this chapter. The history of this formalism as well as pointers to related work
+are provided in a separate chapter; see {\em Credits}.
\section[The terms]{The terms\label{Terms}}
--
cgit v1.2.3
From b23331eb03f2640e85bd65277c15a4bcc692b90c Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 09:50:11 +0100
Subject: ENH: citation
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index c481b3adba..2c0f155388 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -44,7 +44,7 @@ function types over these data types.
{\Prop} and {\Set} themselves can be manipulated as ordinary
terms. Consequently they also have a type. Because assuming simply
-that {\Set} has type {\Set} leads to an inconsistent theory, the
+that {\Set} has type {\Set} leads to an inconsistent theory~\cite{Coq86}, the
language of {\CIC} has infinitely many sorts. There are, in addition
to {\Set} and {\Prop} a hierarchy of universes {\Type$(i)$} for any
integer $i$.
--
cgit v1.2.3
From e9db7237481e529f796d603f98965ca01e439386 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 09:52:53 +0100
Subject: CLEANUP PROPOSITION: Duplicate information was removed and replaced
with a reference to the corresponding section.
---
doc/refman/RefMan-cic.tex | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 2c0f155388..834c8273a5 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -60,16 +60,7 @@ Formally, we call {\Sort} the set of sorts which is defined by:
\index{Type@{\Type}}
\index{Prop@{\Prop}}
\index{Set@{\Set}}
-
-The sorts enjoy the following properties%\footnote{In the Reference
- %% Manual of versions of {\Coq} prior to 8.4, the level of {\Type} typing
- %% {\Prop} and {\Set} was numbered $0$. From {\Coq} 8.4, it started to be
- %% numbered $1$ so as to be able to leave room for re-interpreting
- %% {\Set} in the hierarchy as {\Type$(0)$}. This change also put the
- %% reference manual in accordance with the internal conventions adopted
- %% in the implementation.}
-: {\Prop:\Type$(1)$}, {\Set:\Type$(1)$} and
-{\Type$(i)$:\Type$(i+1)$}.
+Their properties are defined in Section~\ref{subtyping-rules}.
The user does not have to mention explicitly the index $i$ when referring to
the universe \Type$(i)$. One only writes \Type. The
--
cgit v1.2.3
From 0117f54f3e3678f348f8ed84c8444dc614ce8298 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 10:03:30 +0100
Subject: COMMENT: to do
---
doc/refman/RefMan-cic.tex | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 834c8273a5..505587988c 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -62,6 +62,11 @@ Formally, we call {\Sort} the set of sorts which is defined by:
\index{Set@{\Set}}
Their properties are defined in Section~\ref{subtyping-rules}.
+% TODO: Somewhere in the document we should explain:
+% - what concrete actions (in *.v files) cause creation of new universes
+% - different kinds of relationships between universes (i.e. "max" and "succ")
+% - what are all the actions (in *.v files) from which those relationships arise
+
The user does not have to mention explicitly the index $i$ when referring to
the universe \Type$(i)$. One only writes \Type. The
system itself generates for each instance of \Type\ a new
--
cgit v1.2.3
From 950dace27c3233f740b2031c9d99cb3f155aefbf Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 10:22:37 +0100
Subject: ENH: Index anchor repositioning.
Originally, when user clicked in index on "Type", he landed
on an incorrect page (immediatelly following the page
which actually contains the definition of "Type").
---
doc/refman/RefMan-cic.tex | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 505587988c..702adc2326 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -56,10 +56,10 @@ sets, namely the sorts {\Set} and {\Type$(j)$} for $j}~ u$ in \Coq{} concrete syntax) is a term. This is a
notation for the $\lambda$-abstraction of
diff --git a/doc/refman/RefMan-gal.tex b/doc/refman/RefMan-gal.tex
index f631c3717c..0e758bcab6 100644
--- a/doc/refman/RefMan-gal.tex
+++ b/doc/refman/RefMan-gal.tex
@@ -468,8 +468,8 @@ proposition $B$ or the functional dependent product from $A$ to $B$ (a
construction usually written $\Pi_{x:A}.B$ in set theory).
Non dependent product types have a special notation: ``$A$ {\tt ->}
-$B$'' stands for ``{\tt forall \_:}$A${\tt ,}~$B$''. The non dependent
-product is used both to denote the propositional implication and
+$B$'' stands for ``{\tt forall \_:}$A${\tt ,}~$B$''. The {\em non dependent
+product} is used both to denote the propositional implication and
function types.
\subsection{Applications
--
cgit v1.2.3
From 8f96f8194608c99ad8efa201c24b527dbc530537 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 12:08:49 +0100
Subject: CLEANUP PROPOSITION: The removed paragraph is not essential for this
chapter. That kind of information is more appropriate for Section 1.2.
---
doc/refman/RefMan-cic.tex | 9 ---------
1 file changed, 9 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index b1becba3f5..ed7889e480 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -178,15 +178,6 @@ More precisely the language of the {\em Calculus of Inductive
%\item cofixpoint ...
\end{enumerate}
-\paragraph{Notations.} Application associates to the left such that
-$(t\;t_1\;t_2\ldots t_n)$ represents $(\ldots ((t\;t_1)\;t_2)\ldots t_n)$. The
-products and arrows associate to the right such that $\forall~x:A,B\ra C\ra
-D$ represents $\forall~x:A,(B\ra (C\ra D))$. One uses sometimes
-$\forall~x~y:A,B$ or
-$\lb x~y:A\mto t$ to denote the abstraction or product of several variables
-of the same type. The equivalent formulation is $\forall~x:A, \forall y:A,B$ or
-$\lb x:A \mto \lb y:A \mto t$
-
\paragraph{Free variables.}
The notion of free variables is defined as usual. In the expressions
$\lb x:T\mto U$ and $\forall x:T, U$ the occurrences of $x$ in $U$
--
cgit v1.2.3
From 1372e075c52aa2dad547a42eaf9aba1f83a7abb1 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 13:47:27 +0100
Subject: CLEANUP PROPOSITION: this sentence does not help us to better
understand the semantics of the language
---
doc/refman/RefMan-cic.tex | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index ed7889e480..fb6a5bff83 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -181,8 +181,7 @@ More precisely the language of the {\em Calculus of Inductive
\paragraph{Free variables.}
The notion of free variables is defined as usual. In the expressions
$\lb x:T\mto U$ and $\forall x:T, U$ the occurrences of $x$ in $U$
-are bound. They are represented by de Bruijn indexes in the internal
-structure of terms.
+are bound.
\paragraph[Substitution.]{Substitution.\index{Substitution}}
The notion of substituting a term $t$ to free occurrences of a
--
cgit v1.2.3
From 3cebb15d999e6e26a98339ecb6fa7e62fdcf6a88 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 13:59:14 +0100
Subject: CLEANUP PROPOSITION: 'declaration' --> 'local declaration'
If, below, we speak about 'global declarations',
here it makes sense to speak about 'local declaration'.
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index fb6a5bff83..04df208ee2 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -228,7 +228,7 @@ a global environment and a local context.
\paragraph{Local context.}
A {\em local context} is an ordered list of
-declarations of names which we call {\em variables}.
+local declarations of names which we call {\em variables}.
The declaration of some variable $x$ is
either a local assumption, written $x:T$ ($T$ is a type) or a local definition,
written $x:=t:T$. We use brackets to write local contexts. A
--
cgit v1.2.3
From cdd31465cee9ea8bef2a253280ee8a9647ecc01d Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 14:05:50 +0100
Subject: SILENT: the anchor for the 'Local context' was moved to a more
appropriate place.
---
doc/refman/RefMan-cic.tex | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 04df208ee2..690bdad950 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -226,7 +226,7 @@ As objects of type theory, terms are subjected to {\em type
discipline}. The well typing of a term depends on
a global environment and a local context.
-\paragraph{Local context.}
+\paragraph{Local context.\index{Local context}}
A {\em local context} is an ordered list of
local declarations of names which we call {\em variables}.
The declaration of some variable $x$ is
@@ -241,7 +241,7 @@ $x:=t:T$, we also write $(x:=t:T) \in \Gamma$.
For the rest of the chapter, the
notation $\Gamma::(y:T)$ (resp. $\Gamma::(y:=t:T)$) denotes the local context
$\Gamma$ enriched with the declaration $y:T$ (resp. $y:=t:T$). The
-notation $[]$ denotes the empty local context. \index{Local context}
+notation $[]$ denotes the empty local context.
% Does not seem to be used further...
% Si dans l'explication WF(E)[Gamma] concernant les constantes
--
cgit v1.2.3
From 0a5ee78c32b5f48d8f90de1ff073e250db5033d6 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 14:39:31 +0100
Subject: ENH: 'Global Index' was enriched.
These notions:
- local assumption
- local definition
- global assumption
- global definition
are now indexed.
---
doc/refman/RefMan-cic.tex | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 690bdad950..b0205b7e9e 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -228,9 +228,9 @@ a global environment and a local context.
\paragraph{Local context.\index{Local context}}
A {\em local context} is an ordered list of
-local declarations of names which we call {\em variables}.
+{\em local declarations\index{declaration!local}} of names which we call {\em variables\index{variable}}.
The declaration of some variable $x$ is
-either a local assumption, written $x:T$ ($T$ is a type) or a local definition,
+either a {\em local assumption\index{assumption!local}}, written $x:T$ ($T$ is a type) or a {\em local definition\index{definition!local}},
written $x:=t:T$. We use brackets to write local contexts. A
typical example is $[x:T;y:=u:U;z:V]$. Notice that the variables
declared in a local context must be distinct. If $\Gamma$ declares some $x$,
@@ -262,9 +262,9 @@ declaration $y:T$ such that $x$ is free in $T$.
%Because we are manipulating global declarations (global constants and global
%assumptions), we also need to consider a global environment $E$.
-A {\em global environment} is an ordered list of global declarations.
-Global declarations are either global assumptions or global
-definitions, but also declarations of inductive objects. Inductive objects themselves declares both inductive or coinductive types and constructors
+A {\em global environment} is an ordered list of {\em global declarations\index{declaration!global}}.
+Global declarations are either {\em global assumptions\index{assumption!global}} or {\em global
+definitions\index{definition!global}}, but also declarations of inductive objects. Inductive objects themselves declares both inductive or coinductive types and constructors
(see Section~\ref{Cic-inductive-definitions}).
A global assumption will be represented in the global environment as
--
cgit v1.2.3
From 9f6ca170331a4f883cae20531bdced9eee663c59 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 14:42:15 +0100
Subject: CLEANUP PROPOSITION: removal of a definition of a concept that is not
used further in the text
---
doc/refman/RefMan-cic.tex | 3 ---
1 file changed, 3 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index b0205b7e9e..73fd4a1182 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -255,9 +255,6 @@ notation $[]$ denotes the empty local context.
% $|\Delta|$ for the length of the context $\Delta$, that is for the number
% of declarations (assumptions or definitions) in $\Delta$.
-A variable $x$ is said to be free in $\Gamma$ if $\Gamma$ contains a
-declaration $y:T$ such that $x$ is free in $T$.
-
\paragraph[Global environment.]{Global environment.\index{Global environment}}
%Because we are manipulating global declarations (global constants and global
%assumptions), we also need to consider a global environment $E$.
--
cgit v1.2.3
From 84d2f601da36e002cf752e9099244499c13bfa73 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 14:45:34 +0100
Subject: GRAMMAR
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 73fd4a1182..89c771238c 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -261,7 +261,7 @@ notation $[]$ denotes the empty local context.
A {\em global environment} is an ordered list of {\em global declarations\index{declaration!global}}.
Global declarations are either {\em global assumptions\index{assumption!global}} or {\em global
-definitions\index{definition!global}}, but also declarations of inductive objects. Inductive objects themselves declares both inductive or coinductive types and constructors
+definitions\index{definition!global}}, but also declarations of inductive objects. Inductive objects themselves declare both inductive or coinductive types and constructors
(see Section~\ref{Cic-inductive-definitions}).
A global assumption will be represented in the global environment as
--
cgit v1.2.3
From 13ebbb8ab04036298d288b47a4664379173e6e3c Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 14:48:37 +0100
Subject: TYPOGRAPHY
---
doc/refman/RefMan-cic.tex | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 89c771238c..1804ebd9ce 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -264,14 +264,14 @@ Global declarations are either {\em global assumptions\index{assumption!global}}
definitions\index{definition!global}}, but also declarations of inductive objects. Inductive objects themselves declare both inductive or coinductive types and constructors
(see Section~\ref{Cic-inductive-definitions}).
-A global assumption will be represented in the global environment as
+A {\em global assumption} will be represented in the global environment as
$(c:T)$ which assumes the name $c$ to be of some type $T$.
-A global definition will
+A {\em global definition} will
be represented in the global environment as $c:=t:T$ which defines
the name $c$ to have value $t$ and type $T$.
We shall call such names {\em constants}.
-The rules for inductive definitions (see section
+The rules for inductive definitions (see Section
\ref{Cic-inductive-definitions}) have to be considered as assumption
rules to which the following definitions apply: if the name $c$ is
declared in $E$, we write $c \in E$ and if $c:T$ or $c:=t:T$ is
--
cgit v1.2.3
From 678f41f598f38c9c0ef7c587f7b876437a6d06d8 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 15:02:04 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 1804ebd9ce..56e9a27790 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -312,6 +312,7 @@ be derived from the following rules.
{\WF{E;c:T}{}}}
\item[W-Global-Def] \inference{\frac{\WTE{}{t}{T}~~~c \notin E}
{\WF{E;c:=t:T}{}}}
+% QUESTION: Why, in case of W-Local-Assum and W-Global-Assum we need s ∈ S hypothesis.
\item[Ax] \index{Typing rules!Ax}
\inference{\frac{\WFE{\Gamma}}{\WTEG{\Prop}{\Type(1)}}~~~~~
\frac{\WFE{\Gamma}}{\WTEG{\Set}{\Type(1)}}}
--
cgit v1.2.3
From e13fed125d22e58e39487a3aa227416e1f2ba329 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 15:13:25 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 56e9a27790..22cec45cc2 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -313,6 +313,10 @@ be derived from the following rules.
\item[W-Global-Def] \inference{\frac{\WTE{}{t}{T}~~~c \notin E}
{\WF{E;c:=t:T}{}}}
% QUESTION: Why, in case of W-Local-Assum and W-Global-Assum we need s ∈ S hypothesis.
+% QUESTION: At the moment, enrichment of a local context is denoted with ∷
+% whereas enrichment of the global environment is denoted with ;
+% Is it necessary to use two different notations?
+% Couldn't we use ∷ also for enrichment of the global context?
\item[Ax] \index{Typing rules!Ax}
\inference{\frac{\WFE{\Gamma}}{\WTEG{\Prop}{\Type(1)}}~~~~~
\frac{\WFE{\Gamma}}{\WTEG{\Set}{\Type(1)}}}
--
cgit v1.2.3
From e31bc1fc036969454a5577758444b91174209b5c Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 15:44:25 +0100
Subject: TYPOGRAPHY: Each of the three 'Ax' and 'Prod' rules now has a unique
name.
---
doc/refman/RefMan-cic.tex | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 22cec45cc2..db26568c5a 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -317,21 +317,25 @@ be derived from the following rules.
% whereas enrichment of the global environment is denoted with ;
% Is it necessary to use two different notations?
% Couldn't we use ∷ also for enrichment of the global context?
-\item[Ax] \index{Typing rules!Ax}
-\inference{\frac{\WFE{\Gamma}}{\WTEG{\Prop}{\Type(1)}}~~~~~
-\frac{\WFE{\Gamma}}{\WTEG{\Set}{\Type(1)}}}
+\item[Ax-Prop] \index{Typing rules!Ax-Prop}
+\inference{\frac{\WFE{\Gamma}}{\WTEG{\Prop}{\Type(1)}}}
+\item[Ax-Set] \index{Typing rules!Ax-Set}
+\inference{\frac{\WFE{\Gamma}}{\WTEG{\Set}{\Type(1)}}}
+\item[Ax-Type] \index{Typing rules!Ax-Type}
\inference{\frac{\WFE{\Gamma}}{\WTEG{\Type(i)}{\Type(i+1)}}}
\item[Var]\index{Typing rules!Var}
\inference{\frac{ \WFE{\Gamma}~~~~~(x:T) \in \Gamma~~\mbox{or}~~(x:=t:T) \in \Gamma~\mbox{for some $t$}}{\WTEG{x}{T}}}
\item[Const] \index{Typing rules!Const}
\inference{\frac{\WFE{\Gamma}~~~~(c:T) \in E~~\mbox{or}~~(c:=t:T) \in E~\mbox{for some $t$} }{\WTEG{c}{T}}}
-\item[Prod] \index{Typing rules!Prod}
+\item[Prod-Prop] \index{Typing rules!Prod-Prop}
\inference{\frac{\WTEG{T}{s}~~~~s \in \Sort~~~
\WTE{\Gamma::(x:T)}{U}{\Prop}}
{ \WTEG{\forall~x:T,U}{\Prop}}}
+\item[Prod-Set] \index{Typing rules!Prod-Set}
\inference{\frac{\WTEG{T}{s}~~~~s \in\{\Prop, \Set\}~~~~~~
\WTE{\Gamma::(x:T)}{U}{\Set}}
{ \WTEG{\forall~x:T,U}{\Set}}}
+\item[Prod-Type] \index{Typing rules!Prod-Type}
\inference{\frac{\WTEG{T}{\Type(i)}~~~~
\WTE{\Gamma::(x:T)}{U}{\Type(i)}}
{\WTEG{\forall~x:T,U}{\Type(i)}}}
--
cgit v1.2.3
From 4beb1ee596afaf4ab4ebea9a89bb3ade7bbbe13d Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 17:32:36 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index db26568c5a..fe32cb7266 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -354,6 +354,7 @@ be derived from the following rules.
well-typed without having $((\lb x:T\mto u)~t)$ well-typed (where
$T$ is a type of $t$). This is because the value $t$ associated to $x$
may be used in a conversion rule (see Section~\ref{conv-rules}).
+% QUESTION: I do not understand. How would that be possible?
\section[Conversion rules]{Conversion rules\index{Conversion rules}
\label{conv-rules}}
--
cgit v1.2.3
From c56035c2850fe09fc5ef6389e58de28109ad5a93 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 17:33:54 +0100
Subject: TYPOGRAPHY: getting rid of an extra space
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index fe32cb7266..a008bd19a5 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -411,7 +411,7 @@ called $\zeta$-reduction and shows as follows.
$$\WTEGRED{\kw{let}~x:=u~\kw{in}~t}{\triangleright_{\zeta}}{\subst{t}{x}{u}}$$
-\paragraph{$\eta$-conversion.
+\paragraph{$\eta$-conversion.%
\label{eta}
\index{eta-conversion@$\eta$-conversion}
%\index{eta-reduction@$\eta$-reduction}
--
cgit v1.2.3
From a388e5401c2f83f4068314087e67d751acb59d17 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 29 Oct 2015 17:34:05 +0100
Subject: GRAMMAR
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index a008bd19a5..b7bbf7125f 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -416,7 +416,7 @@ $$\WTEGRED{\kw{let}~x:=u~\kw{in}~t}{\triangleright_{\zeta}}{\subst{t}{x}{u}}$$
\index{eta-conversion@$\eta$-conversion}
%\index{eta-reduction@$\eta$-reduction}
}
-An other important concept is $\eta$-conversion. It is to identify any
+Another important concept is $\eta$-conversion. It is to identify any
term $t$ of functional type $\forall x:T, U$ with its so-called
$\eta$-expansion $\lb x:T\mto (t\ x)$ for $x$ an arbitrary variable
name fresh in $t$.
--
cgit v1.2.3
From 32d7eb310f348bf4fcc6222de75bc5b423c9787e Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Fri, 30 Oct 2015 12:52:05 +0100
Subject: CLEANUP: the explanation of why eta-reduction is a bad idea was
rephrased
---
doc/refman/RefMan-cic.tex | 30 +++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index b7bbf7125f..229c01b5d2 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -411,24 +411,28 @@ called $\zeta$-reduction and shows as follows.
$$\WTEGRED{\kw{let}~x:=u~\kw{in}~t}{\triangleright_{\zeta}}{\subst{t}{x}{u}}$$
-\paragraph{$\eta$-conversion.%
-\label{eta}
-\index{eta-conversion@$\eta$-conversion}
+\paragraph{$\eta$-expansion.%
+\label{eta}%
+\index{eta-expansion@$\eta$-expansion}%
%\index{eta-reduction@$\eta$-reduction}
-}
-Another important concept is $\eta$-conversion. It is to identify any
+}%
+Another important concept is $\eta$-expansion. It is legal to identify any
term $t$ of functional type $\forall x:T, U$ with its so-called
$\eta$-expansion $\lb x:T\mto (t\ x)$ for $x$ an arbitrary variable
name fresh in $t$.
-The notion of $\eta$-reduction ${\lb x:T\mto (t\ x)}{\;\triangleright\;}{t}$
-(for $x$ not occurring in $t$) is not type-sound because of subtyping
-(think about $\lb x:\Type(1)\mto (f x)$ of type $\forall
-x:\Type(1), \Type(1)$ for $f$ of type $\forall x:\Type(2),
-\Type(1)$). On the other side, $\eta$-expansion requires to know $T$
-and hence requires types. Hence, neither $\eta$-expansion nor
-$\eta$-reduction can be type-safely considered on terms we do not know
-the type. However, $\eta$ can be used as a conversion rule.
+\Rem We deliberately do not define $\eta$-reduction:
+\def\noeta{\hskip-.1em\not\triangleright_\eta}
+$$\lb x:T\mto (t\ x)\hskip.1em\noeta\hskip.3em t$$
+This is because, in general, the type of $t$ need not to be convertible to the type of $\lb x:T\mto (t\ x)$.
+E.g., if we take $f$ such that:
+$$f\hskip.5em:\hskip.5em\forall x:Type(2),Type(1)$$
+then
+$$\lb x:Type(1),(f\, x)\hskip.5em:\hskip.5em\forall x:Type(1),Type(1)$$
+We could not allow
+$$\lb x:Type(1),(f\,x)\hskip.5em\noeta\hskip.6em f$$
+because the type of the reduced term $\forall x:Type(2),Type(1)$
+would not be convertible to the type of the original term $\forall x:Type(1),Type(1)$.
\paragraph[Convertibility.]{Convertibility.\label{convertibility}
\index{beta-reduction@$\beta$-reduction}\index{iota-reduction@$\iota$-reduction}\index{delta-reduction@$\delta$-reduction}\index{zeta-reduction@$\zeta$-reduction}}
--
cgit v1.2.3
From 73985c85792da06857199311834962f6a417e71c Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Fri, 30 Oct 2015 16:31:42 +0100
Subject: ENH: a small remark about Prod1 and Prod2 typing-rules was added
---
doc/refman/RefMan-cic.tex | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 229c01b5d2..764f1189ba 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -349,7 +349,14 @@ be derived from the following rules.
\inference{\frac{\WTEG{t}{T}~~~~ \WTE{\Gamma::(x:=t:T)}{u}{U}}
{\WTEG{\letin{x}{t:T}{u}}{\subst{U}{x}{t}}}}
\end{description}
-
+
+\Rem Prod$_1$ and Prod$_2$ typing-rules make sense if we consider the semantic
+difference between {\Prop} and {\Set}:
+\begin{itemize}
+ \item All values of a type that has a sort {\Set} are extractable.
+ \item No values of a type that has a sort {\Prop} are extractable.
+\end{itemize}
+
\Rem We may have $\kw{let}~x:=t:T~\kw{in}~u$
well-typed without having $((\lb x:T\mto u)~t)$ well-typed (where
$T$ is a type of $t$). This is because the value $t$ associated to $x$
--
cgit v1.2.3
From c5b3e7ff66e1675aaec7be5e0ee6772e88250991 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Fri, 30 Oct 2015 16:50:00 +0100
Subject: ENH: the concept of 'inductive declaration' was added to the 'Global
Index'
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 764f1189ba..7fd5b23039 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -519,7 +519,7 @@ reductions or any combination of those can also be defined.
A (possibly mutual) inductive definition is specified by giving the
names and types of the inductive types to be
defined and the names and types of the constructors of the inductive types.
-An inductive declaration in the global environment can
+An {\em inductive declaration\index{declaration!inductive}} in the global environment can
consequently be represented with two local contexts, one for the types
one for the constructors.
--
cgit v1.2.3
From 47377fa44143d409331dd7d0c662e6ebb34d9f4f Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 2 Nov 2015 14:41:37 +0100
Subject: ENH: The beginning of Section 4.5 (Inductive declarations) was
changed in order to make it more concrete and more comprehensible.
This ver
---
doc/common/macros.tex | 2 +-
doc/refman/RefMan-cic.tex | 380 ++++++++++++++++++++++------------------------
2 files changed, 185 insertions(+), 197 deletions(-)
(limited to 'doc')
diff --git a/doc/common/macros.tex b/doc/common/macros.tex
index ff13ec4557..fb9190a162 100644
--- a/doc/common/macros.tex
+++ b/doc/common/macros.tex
@@ -260,7 +260,7 @@
\newcommand{\Length}{\mbox{\textsf{Length}}}
\newcommand{\length}{\mbox{\textsf{length}}}
\newcommand{\LengthA}{\mbox {\textsf{Length\_A}}}
-\newcommand{\List}{\mbox{\textsf{List}}}
+\newcommand{\List}{\mbox{\textsf{list}}}
\newcommand{\ListA}{\mbox{\textsf{List\_A}}}
\newcommand{\LNil}{\mbox{\textsf{Lnil}}}
\newcommand{\LCons}{\mbox{\textsf{Lcons}}}
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 7fd5b23039..f4d107ed8a 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -514,213 +514,201 @@ $u_i$ can be reducible.
Similar notions of head-normal forms involving $\delta$, $\iota$ and $\zeta$
reductions or any combination of those can also be defined.
-\section[Inductive Definitions]{Inductive Definitions\label{Cic-inductive-definitions}}
-
-A (possibly mutual) inductive definition is specified by giving the
-names and types of the inductive types to be
-defined and the names and types of the constructors of the inductive types.
-An {\em inductive declaration\index{declaration!inductive}} in the global environment can
-consequently be represented with two local contexts, one for the types
-one for the constructors.
-
-Stating the rules for inductive definitions in their general form
-needs quite tedious definitions. We shall try to give a concrete
-understanding of the rules by illustrating them on running examples. We
-take as examples the type of natural numbers, the type of
-parameterized lists over a type $A$, the relation which states that
-a list has some given length and the mutual inductive definition of trees and
-forests.
-
-\subsection{Representing an inductive definition}
-\subsubsection{Inductive definitions without parameters}
-As for constants, inductive definitions must be defined in a non-empty
-local context. \\
-We write \NInd{}{\Gamma_I}{\Gamma_C} for an inductive
-definition with a
-context of type definitions $\Gamma_I$ and a context of constructors
-$\Gamma_C$.
-\paragraph{Examples.}
-The inductive declaration for the type of natural numbers will be:
-\[\NInd{}{\nat:\Set}{\nO:\nat,\nS:\nat\ra\nat}\]
-In a context with assumption $A:\Set$, the lists of elements in $A$ are
-represented by:
-\[\NInd{}{\List:\Set}{\Nil:\List,\cons : A \ra \List \ra
- \List}\]
-%% Assuming
-%% $\Gamma_I$ is $[I_1:A_1;\ldots;I_k:A_k]$, and $\Gamma_C$ is
-%% $[c_1:C_1;\ldots;c_n:C_n]$, the general typing rules are,
-%% for $1\leq j\leq k$ and $1\leq i\leq n$:
-
-%% \bigskip
-
-%% \item[Ind] \index{Typing rules!Ind}
-%% \inference{\frac{\NInd{}{\Gamma_I}{\Gamma_C} \in E}{(I_j:A_j) \in E}}
-%% \item[Constr] \index{Typing rules!Constr}
-
-%% \inference{\frac{\NInd{}{\Gamma_I}{\Gamma_C} \in E}{(c_i:C_i) \in E}}
-
-\subsubsection{Inductive definitions with parameters}
-
-We have refine the representation above in order to handle parameters.
-Let us explain that on the example of \List. With the above definition,
-the type \List\ can only be used in a global environment where we
-have a variable $A:\Set$. Generally one wants to consider lists of
-elements in different types. For constants this is easily done by abstracting
-the value over the parameter. In the case of inductive definitions we
-have to handle the abstraction over several objects.
-
-One possible way to do that would be to define the type \List\
-inductively as being an inductive type of type $\Set\ra\Set$:
-\[\NInd{}{\List:\Set\ra\Set}{\Nil:(\forall A:\Set,\List~A),
- \cons : (\forall A:\Set, A \ra \List~A \ra \List~A)}\]
-There are drawbacks to this point of view. The
-information which says that for any $A$, $(\List~A)$ is an inductively defined
-\Set\ has been lost.
-So we introduce two important definitions.
-
-\paragraph{Inductive parameters, real arguments.}
-An inductive definition $\NInd{\Gamma}{\Gamma_I}{\Gamma_C}$ admits
-$r$ inductive parameters if each type of constructors $(c:C)$ in
-$\Gamma_C$ is such that
-\[C\equiv \forall
-p_1:P_1,\ldots,\forall p_r:P_r,\forall a_1:A_1, \ldots \forall a_n:A_n,
-(I~p_1~\ldots p_r~t_1\ldots t_q)\]
-with $I$ one of the inductive definitions in $\Gamma_I$.
-We say that $q$ is the number of real arguments of the constructor
-$c$.
-\paragraph{Context of parameters.}
-If an inductive definition $\NInd{\Gamma}{\Gamma_I}{\Gamma_C}$ admits
-$r$ inductive parameters, then there exists a local context $\Gamma_P$ of
-size $r$, such that $\Gamma_P=[p_1:P_1;\ldots;p_r:P_r]$ and
-if $(t:A) \in \Gamma_I,\Gamma_C$ then $A$ can be written as
-$\forall p_1:P_1,\ldots \forall p_r:P_r,A'$.
-We call $\Gamma_P$ the local context of parameters of the inductive
-definition and use the notation $\forall \Gamma_P,A'$ for the term $A$.
-\paragraph{Remark.}
-If we have a term $t$ in an instance of an
-inductive definition $I$ which starts with a constructor $c$, then the
-$r$ first arguments of $c$ (the parameters) can be deduced from the
-type $T$ of $t$: these are exactly the $r$ first arguments of $I$ in
-the head normal form of $T$.
-\paragraph{Examples.}
-The \List{} definition has $1$ parameter:
-\[\NInd{}{\List:\Set\ra\Set}{\Nil:(\forall A:\Set, \List~A),
- \cons : (\forall A:\Set, A \ra \List~A \ra \List~A)}\]
-This is also the case for this more complex definition where there is
-a recursive argument on a different instance of \List:
-\[\NInd{}{\List:\Set\ra\Set}{\Nil:(\forall A:\Set, \List~A),
- \cons : (\forall A:\Set, A \ra \List~(A \ra A) \ra \List~A)}\]
-But the following definition has $0$ parameters:
-\[\NInd{}{\List:\Set\ra\Set}{\Nil:(\forall A:\Set, \List~A),
- \cons : (\forall A:\Set, A \ra \List~A \ra \List~(A*A))}\]
-
-%\footnote{
-%The interested reader may compare the above definition with the two
-%following ones which have very different logical meaning:\\
-%$\NInd{}{\List:\Set}{\Nil:\List,\cons : (A:\Set)A
-% \ra \List \ra \List}$ \\
-%$\NInd{}{\List:\Set\ra\Set}{\Nil:(A:\Set)(\List~A),\cons : (A:\Set)A
-% \ra (\List~A\ra A) \ra (\List~A)}$.}
-\paragraph{Concrete syntax.}
-In the {\Coq} system, the local context of parameters is given explicitly
-after the name of the inductive definitions and is shared between the
-arities and the type of constructors.
-% The vernacular declaration of polymorphic trees and forests will be:\\
-% \begin{coq_example*}
-% Inductive Tree (A:Set) : Set :=
-% Node : A -> Forest A -> Tree A
-% with Forest (A : Set) : Set :=
-% Empty : Forest A
-% | Cons : Tree A -> Forest A -> Forest A
-% \end{coq_example*}
-% will correspond in our formalism to:
-% \[\NInd{}{{\tt Tree}:\Set\ra\Set;{\tt Forest}:\Set\ra \Set}
-% {{\tt Node} : \forall A:\Set, A \ra {\tt Forest}~A \ra {\tt Tree}~A,
-% {\tt Empty} : \forall A:\Set, {\tt Forest}~A,
-% {\tt Cons} : \forall A:\Set, {\tt Tree}~A \ra {\tt Forest}~A \ra
-% {\tt Forest}~A}\]
-We keep track in the syntax of the number of
-parameters.
-
-Formally the representation of an inductive declaration
-will be
-\Ind{}{p}{\Gamma_I}{\Gamma_C} for an inductive
-definition with $p$ parameters, a
-context of definitions $\Gamma_I$ and a context of constructors
-$\Gamma_C$.
-
-The definition \Ind{}{p}{\Gamma_I}{\Gamma_C} will be
-well-formed exactly when \NInd{}{\Gamma_I}{\Gamma_C} is and
-when $p$ is (less or equal than) the number of parameters in
-\NInd{}{\Gamma_I}{\Gamma_C}.
-
-\paragraph{Examples}
-The declaration for parameterized lists is:
-\[\Ind{}{1}{\List:\Set\ra\Set}{\Nil:(\forall A:\Set,\List~A),\cons :
- (\forall A:\Set, A \ra \List~A \ra \List~A)}\]
-
-The declaration for an inductive type specifying the length of lists is:
-\[\Ind{}{1}{\Length:\forall A:\Set, (\List~A)\ra \nat\ra\Prop}
- {\LNil:\forall A:\Set, \Length~A~(\Nil~A)~\nO,\\
- \LCons :\forall A:\Set,\forall a:A, \forall l:(\List~A),\forall n:\nat, (\Length~A~l~n)\ra (\Length~A~(\cons~A~a~l)~(\nS~n))}\]
-
-The declaration for a mutual inductive definition of forests and trees is:
-\[\NInd{}{\tree:\Set,\forest:\Set}
- {\\~~\node:\forest \ra \tree,
- \emptyf:\forest,\consf:\tree \ra \forest \ra \forest\-}\]
-
-These representations are the ones obtained as the result of the \Coq\
-declarations:
-\begin{coq_example*}
+\section[Inductive definitions]{Inductive Definitions\label{Cic-inductive-definitions}}
+
+% Here we assume that the reader knows what is an inductive definition.
+
+Formally, we can represent any {\em inductive definition\index{definition!inductive}} as \Ind{}{p}{\Gamma_I}{\Gamma_C} where:
+\begin{itemize}
+ \item $\Gamma_I$ determines the names and types of inductive types;
+ \item $\Gamma_C$ determines the names and types of constructors of these inductive types;
+ \item $p$ determines the number of parameters of these inductive types.
+\end{itemize}
+These inductive definitions, together with global assumptions and global definitions, then form the global environment.
+\vskip.5em
+\noindent Additionally, for any $p$ there always exists $\Gamma_P=[a_1:A_1;\dots;a_p:A_p]$
+such that each $(t:T)\in\Gamma_I\cup\Gamma_C$ can be written as:
+$\forall\Gamma_P, T^\prime$.
+\vskip.5em
+\noindent $\Gamma_P$ is called {\em context of parameters\index{context of parameters}}.
+
+\subsection*{Examples}
+
+If we take the following inductive definition (denoted in concrete syntax):
+\begin{coq_example}
+Inductive bool : Set :=
+ | true : bool
+ | false : bool.
+\end{coq_example}
+then:
+\def\colon{@{\hskip.5em:\hskip.5em}}
+\def\GammaI{\left[\begin{array}{r \colon l}
+ \bool & \Set
+ \end{array}
+ \right]}
+\def\GammaC{\left[\begin{array}{r \colon l}
+ \true & \bool\\
+ \false & \bool
+ \end{array}
+ \right]}
+\newcommand\ind[3]{$\mathsf{Ind}~[#1]\left(\hskip-.4em
+ \begin{array}{r @{\mathrm{~:=~}} l}
+ #2 & #3 \\
+ \end{array}
+ \hskip-.4em
+ \right)$}
+\begin{itemize}
+ \item $p = 0$
+ \item $\Gamma_I = \GammaI$
+ \item $\Gamma_C = \GammaC$
+\end{itemize}
+and thus it enriches the global environment with the following entry:
+\vskip.5em
+\ind{p}{\Gamma_I}{\Gamma_C}
+\vskip.5em
+\noindent that is:
+\vskip.5em
+\ind{0}{\GammaI}{\GammaC}
+\vskip.5em
+\noindent In this case, $\Gamma_P=[\,]$.
+
+\vskip1em\hrule\vskip1em
+
+\noindent If we take the followig inductive definition:
+\begin{coq_example}
Inductive nat : Set :=
| O : nat
| S : nat -> nat.
-Inductive list (A:Set) : Set :=
+\end{coq_example}
+then:
+\def\GammaI{\left[\begin{array}{r \colon l}
+ \nat & \Set
+ \end{array}
+ \right]}
+\def\GammaC{\left[\begin{array}{r \colon l}
+ \nO & \nat\\
+ \nS & \nat\rightarrow\nat
+ \end{array}
+ \right]}
+\begin{itemize}
+ \item $p = 0$
+ \item $\Gamma_I = \GammaI$
+ \item $\Gamma_C = \GammaC$
+\end{itemize}
+and thus it enriches the global environment with the following entry:
+\vskip.5em
+\ind{p}{\Gamma_I}{\Gamma_C}
+\vskip.5em
+\noindent that is:
+\vskip.5em
+\ind{0}{\GammaI}{\GammaC}
+\vskip.5em
+\noindent In this case, $\Gamma_P=[\,]$.
+
+\vskip1em\hrule\vskip1em
+
+\noindent If we take the following inductive definition:
+\begin{coq_example}
+Inductive list (A : Type) : Type :=
| nil : list A
| cons : A -> list A -> list A.
-\end{coq_example*}
-\begin{coq_example*}
-Inductive Length (A:Set) : list A -> nat -> Prop :=
+\end{coq_example}
+then:
+\def\GammaI{\left[\begin{array}{r \colon l}
+ \List & \Type\rightarrow\Type
+ \end{array}
+ \right]}
+\def\GammaC{\left[\begin{array}{r \colon l}
+ \Nil & \forall~A\!:\!\Type,~\List~A\\
+ \cons & \forall~A\!:\!\Type,~A\rightarrow\List~A\rightarrow\List~A
+ \end{array}
+ \right]}
+\begin{itemize}
+ \item $p = 1$
+ \item $\Gamma_I = \GammaI$
+ \item $\Gamma_C = \GammaC$
+\end{itemize}
+and thus it enriches the global environment with the following entry:
+\vskip.5em
+\ind{p}{\Gamma_I}{\Gamma_C}
+\vskip.5em
+\noindent that is:
+\vskip.5em
+\ind{1}{\GammaI}{\GammaC}
+\vskip.5em
+\noindent In this case, $\Gamma_P=[A:\Type]$.
+
+\vskip1em\hrule\vskip1em
+
+\noindent If we take the following inductive definition:
+\begin{coq_example}
+Inductive Length (A : Type) : list A -> nat -> Prop :=
| Lnil : Length A (nil A) O
- | Lcons :
- forall (a:A) (l:list A) (n:nat),
- Length A l n -> Length A (cons A a l) (S n).
+ | Lcons : forall (a:A) (l:list A) (n:nat),
+ Length A l n -> Length A (cons A a l) (S n).
+\end{coq_example}
+then:
+\def\GammaI{\left[\begin{array}{r \colon l}
+ \Length & \forall~A\!:\!\Type,~\List~A\rightarrow\nat\rightarrow\Prop
+ \end{array}
+ \right]}
+\def\GammaC{\left[\begin{array}{r c l}
+ \LNil & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\Length~A~(\Nil~A)~\nO\\
+ \LCons & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\forall~a\!:\!A,~\forall~l\!:\!\List~A,~\forall~n\!:\!\nat,\\
+ & & \Length~A~l~n\rightarrow \Length~A~(\cons~A~a~l)~(\nS~n)
+ \end{array}
+ \right]}
+\begin{itemize}
+ \item $p = 1$
+ \item $\Gamma_I = \GammaI$
+ \item $\Gamma_C = \GammaC$
+\end{itemize}
+and thus it enriches the global environment with the following entry:
+\vskip.5em
+\ind{p}{\Gamma_I}{\Gamma_C}
+%\vskip.5em
+%\noindent that is:
+%\vskip.5em
+%\ind{1}{\GammaI}{\GammaC}
+\vskip.5em
+\noindent In this case, $\Gamma_P=[A:\Type]$.
+
+\vskip1em\hrule\vskip1em
+
+\noindent If we take the following inductive definition:
+\begin{coq_example}
Inductive tree : Set :=
- node : forest -> tree
+ | node : forest -> tree
with forest : Set :=
| emptyf : forest
| consf : tree -> forest -> forest.
-\end{coq_example*}
-% The inductive declaration in \Coq\ is slightly different from the one
-% we described theoretically. The difference is that in the type of
-% constructors the inductive definition is explicitly applied to the
-% parameters variables.
-The \Coq\ type-checker verifies that all
-parameters are applied in the correct manner in the conclusion of the
-type of each constructors:
-
-In particular, the following definition will not be accepted because
-there is an occurrence of \List\ which is not applied to the parameter
-variable in the conclusion of the type of {\tt cons'}:
-\begin{coq_eval}
-Set Printing Depth 50.
-\end{coq_eval}
-% (********** The following is not correct and should produce **********)
-% (********* Error: The 1st argument of list' must be A in ... *********)
-\begin{coq_example}
-Fail Inductive list' (A:Set) : Set :=
- | nil' : list' A
- | cons' : A -> list' A -> list' (A*A).
\end{coq_example}
-Since \Coq{} version 8.1, there is no restriction about parameters in
-the types of arguments of constructors. The following definition is
-valid:
-\begin{coq_example}
-Inductive list' (A:Set) : Set :=
- | nil' : list' A
- | cons' : A -> list' (A->A) -> list' A.
-\end{coq_example}
-
+then:
+\def\GammaI{\left[\begin{array}{r \colon l}
+ \tree & \Set\\
+ \forest & \Set
+ \end{array}
+ \right]}
+\def\GammaC{\left[\begin{array}{r \colon l}
+ \node & \forest\rightarrow\tree\\
+ \emptyf & \forest\\
+ \consf & \tree\rightarrow\forest\rightarrow\forest
+ \end{array}
+ \right]}
+\begin{itemize}
+ \item $p = 0$
+ \item $\Gamma_I = \GammaI$
+ \item $\Gamma_C = \GammaC$
+\end{itemize}
+and thus it enriches the global environment with the following entry:
+\vskip.5em
+\ind{p}{\Gamma_I}{\Gamma_C}
+\vskip.5em
+\noindent that is:
+\vskip.5em
+\ind{0}{\GammaI}{\GammaC}
+\vskip.5em
+\noindent In this case, $\Gamma_P=[\,]$.
\subsection{Types of inductive objects}
We have to give the type of constants in a global environment $E$ which
--
cgit v1.2.3
From 42bc6762952b2d4996e26285720b3e556a63c96d Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 2 Nov 2015 15:25:20 +0100
Subject: QUESTION: Cannot we simplify the presentation of "Ind" and "Constr"
typing rules like this?
---
doc/refman/RefMan-cic.tex | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index f4d107ed8a..2eb79ce842 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -716,12 +716,9 @@ contains an inductive declaration.
\begin{description}
\item[Ind] \index{Typing rules!Ind}
-\inference{\frac{\Ind{}{p}{\Gamma_I}{\Gamma_C} \in E}{(I_j:A_j) \in E}}
-\inference{\frac{\WFE{\Gamma}~~~~\NInd{}{\Gamma_I}{\Gamma_C} \in E}{\WTEG{I_j}{A_j}}}
+ \inference{\frac{\WFE{\Gamma}\hskip2em\Ind{}{p}{\Gamma_I}{\Gamma_C} \in E\hskip2em(a:A)\in\Gamma_I}{\WTEG{a}{A}}}
\item[Constr] \index{Typing rules!Constr}
-
-\inference{\frac{\Ind{}{p}{\Gamma_I}{\Gamma_C} \in E}{(c_i:C_i) \in E}}
-\inference{\frac{\WFE{\Gamma}~~~~\NInd{}{\Gamma_I}{\Gamma_C} \in E}{\WTEG{c_i}{C_i}}}
+ \inference{\frac{\WFE{\Gamma}\hskip2em\Ind{}{p}{\Gamma_I}{\Gamma_C} \in E\hskip2em(c:C)\in\Gamma_C}{\WTEG{c}{C}}}
\end{description}
\paragraph{Example.}
--
cgit v1.2.3
From 089f2195aa0d0351b5692a8b4c947c7652d148b0 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 2 Nov 2015 15:31:56 +0100
Subject: SILENT: s/coq_example/coq_example*/
---
doc/refman/RefMan-cic.tex | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 2eb79ce842..574ef33c2d 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -535,11 +535,11 @@ $\forall\Gamma_P, T^\prime$.
\subsection*{Examples}
If we take the following inductive definition (denoted in concrete syntax):
-\begin{coq_example}
+\begin{coq_example*}
Inductive bool : Set :=
| true : bool
| false : bool.
-\end{coq_example}
+\end{coq_example*}
then:
\def\colon{@{\hskip.5em:\hskip.5em}}
\def\GammaI{\left[\begin{array}{r \colon l}
@@ -575,11 +575,11 @@ and thus it enriches the global environment with the following entry:
\vskip1em\hrule\vskip1em
\noindent If we take the followig inductive definition:
-\begin{coq_example}
+\begin{coq_example*}
Inductive nat : Set :=
| O : nat
| S : nat -> nat.
-\end{coq_example}
+\end{coq_example*}
then:
\def\GammaI{\left[\begin{array}{r \colon l}
\nat & \Set
@@ -608,11 +608,11 @@ and thus it enriches the global environment with the following entry:
\vskip1em\hrule\vskip1em
\noindent If we take the following inductive definition:
-\begin{coq_example}
+\begin{coq_example*}
Inductive list (A : Type) : Type :=
| nil : list A
| cons : A -> list A -> list A.
-\end{coq_example}
+\end{coq_example*}
then:
\def\GammaI{\left[\begin{array}{r \colon l}
\List & \Type\rightarrow\Type
@@ -641,12 +641,12 @@ and thus it enriches the global environment with the following entry:
\vskip1em\hrule\vskip1em
\noindent If we take the following inductive definition:
-\begin{coq_example}
+\begin{coq_example*}
Inductive Length (A : Type) : list A -> nat -> Prop :=
| Lnil : Length A (nil A) O
| Lcons : forall (a:A) (l:list A) (n:nat),
Length A l n -> Length A (cons A a l) (S n).
-\end{coq_example}
+\end{coq_example*}
then:
\def\GammaI{\left[\begin{array}{r \colon l}
\Length & \forall~A\!:\!\Type,~\List~A\rightarrow\nat\rightarrow\Prop
@@ -676,13 +676,13 @@ and thus it enriches the global environment with the following entry:
\vskip1em\hrule\vskip1em
\noindent If we take the following inductive definition:
-\begin{coq_example}
+\begin{coq_example*}
Inductive tree : Set :=
| node : forest -> tree
with forest : Set :=
| emptyf : forest
| consf : tree -> forest -> forest.
-\end{coq_example}
+\end{coq_example*}
then:
\def\GammaI{\left[\begin{array}{r \colon l}
\tree & \Set\\
--
cgit v1.2.3
From bc78fc26204d638f789597e2892d95483918f187 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 2 Nov 2015 16:13:20 +0100
Subject: CLEANUP: Presentation of examples was changed to make them more
comprehensible.
---
doc/refman/RefMan-cic.tex | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 574ef33c2d..cc69355d4a 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -722,12 +722,27 @@ contains an inductive declaration.
\end{description}
\paragraph{Example.}
-We have $(\List:\Set \ra \Set), (\cons:\forall~A:\Set,A\ra(\List~A)\ra
-(\List~A))$, \\
-$(\Length:\forall~A:\Set, (\List~A)\ra\nat\ra\Prop)$, $\tree:\Set$ and $\forest:\Set$.
-
-From now on, we write $\ListA$ instead of $(\List~A)$ and $\LengthA$
-for $(\Length~A)$.
+Provided that our environment $E$ contains inductive definitions we showed before,
+these two inference rules above enable us to conclude that:
+\vskip.5em
+\def\prefix{E[\Gamma]\vdash\hskip.25em}
+$\begin{array}{@{} l}
+ \prefix\bool : \Set\\
+ \prefix\true : \bool\\
+ \prefix\false : \bool\\
+ \prefix\nat : \Set\\
+ \prefix\nO : \nat\\
+ \prefix\nS : \nat\ra\nat\\
+ \prefix\List : \Type\rightarrow\Type\\
+ \prefix\Nil : \forall~A\!:\!\Type,~\List~A\\
+ \prefix\cons : \forall~A\!:\!\Type,~A\rightarrow\List~A\rightarrow\List~A\\
+ \prefix\Length : \forall~A\!:\!\Type,~\List~A\rightarrow\nat\rightarrow\Prop\\
+ \prefix\LNil : \forall~A\!:\!\Type,~\Length~A~(\Nil~A)~\nO\\
+ \begin{array}{l l}
+ \hskip-.5em\prefix\LCons :\hskip-.5em & \forall~A\!:\!\Type,~\forall~a\!:\!A,~\forall~l\!:\!\List~A,~\forall~n\!:\!\nat,\\
+ & \Length~A~l~n\rightarrow \Length~A~(\cons~A~a~l)~(\nS~n)
+ \end{array}
+ \end{array}$
%\paragraph{Parameters.}
%%The parameters introduce a distortion between the inside specification
--
cgit v1.2.3
From 42347ebd180f10b738f628bae904b5773a0150ac Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 2 Nov 2015 16:15:38 +0100
Subject: COMMENT: to do
---
doc/refman/RefMan-cic.tex | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index cc69355d4a..8f03cafd14 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -760,7 +760,9 @@ $\begin{array}{@{} l}
\subsection{Well-formed inductive definitions}
We cannot accept any inductive declaration because some of them lead
-to inconsistent systems. We restrict ourselves to definitions which
+to inconsistent systems.
+% TODO: The statement above deserves explanation.
+We restrict ourselves to definitions which
satisfy a syntactic criterion of positivity. Before giving the formal
rules, we need a few definitions:
--
cgit v1.2.3
From f37c09e169b11ed683aeb9147c402b9980a6706c Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 2 Nov 2015 16:28:13 +0100
Subject: TYPOGRAPHY
---
doc/refman/RefMan-cic.tex | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 8f03cafd14..8f50c1c323 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -771,14 +771,16 @@ rules, we need a few definitions:
A type $T$ is an {\em arity of sort $s$}\index{Arity} if it converts
to the sort $s$ or to a product $\forall~x:T,U$ with $U$ an arity
of sort $s$. (For instance $A\ra \Set$ or $\forall~A:\Prop,A\ra
-\Prop$ are arities of sort respectively \Set\ and \Prop). A {\em type
+\Prop$ are arities of sort respectively \Set\ and \Prop).
+\vskip.5em
+\noindent A {\em type
of constructor of $I$}\index{Type of constructor} is either a term
$(I~t_1\ldots ~t_n)$ or $\fa x:T,C$ with $C$ recursively
a {\em type of constructor of $I$}.
\smallskip
-The type of constructor $T$ will be said to {\em satisfy the positivity
+\noindent The type of constructor $T$ will be said to {\em satisfy the positivity
condition} for a constant $X$ in the following cases:
\begin{itemize}
--
cgit v1.2.3
From 6ce8d9b4b99afca623408e7052d5e6aaf72bb4ab Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 2 Nov 2015 16:38:52 +0100
Subject: TYPOGRAPHY
---
doc/refman/RefMan-cic.tex | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 8f50c1c323..eaf400f263 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -158,7 +158,7 @@ More precisely the language of the {\em Calculus of Inductive
U''}. As $U$ depends on $x$, one says that $\forall~x:T,U$ is a
{\em dependent product}. If $x$ does not occur in $U$ then
$\forall~x:T,U$ reads as {\it ``if T then U''}. A {\em non dependent
- product} can be written: $T \rightarrow U$.
+ product} can be written: $T \ra U$.
\item if $x$ is a variable and $T$, $u$ are terms then $\lb x:T \mto u$
($\kw{fun}~x:T~ {\tt =>}~ u$ in \Coq{} concrete syntax) is a term. This is a
notation for the $\lambda$-abstraction of
@@ -587,7 +587,7 @@ then:
\right]}
\def\GammaC{\left[\begin{array}{r \colon l}
\nO & \nat\\
- \nS & \nat\rightarrow\nat
+ \nS & \nat\ra\nat
\end{array}
\right]}
\begin{itemize}
@@ -615,12 +615,12 @@ Inductive list (A : Type) : Type :=
\end{coq_example*}
then:
\def\GammaI{\left[\begin{array}{r \colon l}
- \List & \Type\rightarrow\Type
+ \List & \Type\ra\Type
\end{array}
\right]}
\def\GammaC{\left[\begin{array}{r \colon l}
\Nil & \forall~A\!:\!\Type,~\List~A\\
- \cons & \forall~A\!:\!\Type,~A\rightarrow\List~A\rightarrow\List~A
+ \cons & \forall~A\!:\!\Type,~A\ra\List~A\ra\List~A
\end{array}
\right]}
\begin{itemize}
@@ -649,13 +649,13 @@ Inductive Length (A : Type) : list A -> nat -> Prop :=
\end{coq_example*}
then:
\def\GammaI{\left[\begin{array}{r \colon l}
- \Length & \forall~A\!:\!\Type,~\List~A\rightarrow\nat\rightarrow\Prop
+ \Length & \forall~A\!:\!\Type,~\List~A\ra\nat\ra\Prop
\end{array}
\right]}
\def\GammaC{\left[\begin{array}{r c l}
\LNil & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\Length~A~(\Nil~A)~\nO\\
\LCons & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\forall~a\!:\!A,~\forall~l\!:\!\List~A,~\forall~n\!:\!\nat,\\
- & & \Length~A~l~n\rightarrow \Length~A~(\cons~A~a~l)~(\nS~n)
+ & & \Length~A~l~n\ra \Length~A~(\cons~A~a~l)~(\nS~n)
\end{array}
\right]}
\begin{itemize}
@@ -690,9 +690,9 @@ then:
\end{array}
\right]}
\def\GammaC{\left[\begin{array}{r \colon l}
- \node & \forest\rightarrow\tree\\
+ \node & \forest\ra\tree\\
\emptyf & \forest\\
- \consf & \tree\rightarrow\forest\rightarrow\forest
+ \consf & \tree\ra\forest\ra\forest
\end{array}
\right]}
\begin{itemize}
@@ -733,14 +733,14 @@ $\begin{array}{@{} l}
\prefix\nat : \Set\\
\prefix\nO : \nat\\
\prefix\nS : \nat\ra\nat\\
- \prefix\List : \Type\rightarrow\Type\\
+ \prefix\List : \Type\ra\Type\\
\prefix\Nil : \forall~A\!:\!\Type,~\List~A\\
- \prefix\cons : \forall~A\!:\!\Type,~A\rightarrow\List~A\rightarrow\List~A\\
- \prefix\Length : \forall~A\!:\!\Type,~\List~A\rightarrow\nat\rightarrow\Prop\\
+ \prefix\cons : \forall~A\!:\!\Type,~A\ra\List~A\ra\List~A\\
+ \prefix\Length : \forall~A\!:\!\Type,~\List~A\ra\nat\ra\Prop\\
\prefix\LNil : \forall~A\!:\!\Type,~\Length~A~(\Nil~A)~\nO\\
\begin{array}{l l}
\hskip-.5em\prefix\LCons :\hskip-.5em & \forall~A\!:\!\Type,~\forall~a\!:\!A,~\forall~l\!:\!\List~A,~\forall~n\!:\!\nat,\\
- & \Length~A~l~n\rightarrow \Length~A~(\cons~A~a~l)~(\nS~n)
+ & \Length~A~l~n\ra \Length~A~(\cons~A~a~l)~(\nS~n)
\end{array}
\end{array}$
--
cgit v1.2.3
From 10f9c82c38c6eb01e64ab9a8fa233300568c18d4 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 2 Nov 2015 16:39:28 +0100
Subject: ENH: adding a definition of the concept "_ is an arity".
There already exists a definition of the following concept:
"_ is an arity of sort _"
I was not 100% sure what the following concept (used later in the text) means:
"_ is an arity"
so I added this (simple) definition in order to avoid possible confusion.
---
doc/refman/RefMan-cic.tex | 3 +++
1 file changed, 3 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index eaf400f263..deaa1047c8 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -773,6 +773,9 @@ to the sort $s$ or to a product $\forall~x:T,U$ with $U$ an arity
of sort $s$. (For instance $A\ra \Set$ or $\forall~A:\Prop,A\ra
\Prop$ are arities of sort respectively \Set\ and \Prop).
\vskip.5em
+\noindent A type $T$ is an {\em arity} if there is a $s\in\Sort$
+such that $T$ is an arity of sort $s$.
+\vskip.5em
\noindent A {\em type
of constructor of $I$}\index{Type of constructor} is either a term
$(I~t_1\ldots ~t_n)$ or $\fa x:T,C$ with $C$ recursively
--
cgit v1.2.3
From fdb02e793da45a37355050342109da1be4a49c89 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 2 Nov 2015 16:58:39 +0100
Subject: TYPOGRAPHY: Examples of "arity" concept(s) were put to a separate
\paragraph{...}
---
doc/refman/RefMan-cic.tex | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index deaa1047c8..2fa9c59a86 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -766,16 +766,23 @@ We restrict ourselves to definitions which
satisfy a syntactic criterion of positivity. Before giving the formal
rules, we need a few definitions:
-\paragraph[Definitions]{Definitions\index{Positivity}\label{Positivity}}
-
-A type $T$ is an {\em arity of sort $s$}\index{Arity} if it converts
+\paragraph[Definition]{Definition\index{Arity}\label{Arity}}
+A type $T$ is an {\em arity of sort $s$} if it converts
to the sort $s$ or to a product $\forall~x:T,U$ with $U$ an arity
-of sort $s$. (For instance $A\ra \Set$ or $\forall~A:\Prop,A\ra
-\Prop$ are arities of sort respectively \Set\ and \Prop).
-\vskip.5em
-\noindent A type $T$ is an {\em arity} if there is a $s\in\Sort$
+of sort $s$.
+
+\paragraph[Examples]{Examples}
+$A\ra \Set$ is an arity of sort $\Set$.
+$\forall~A:\Prop,A\ra \Prop$ is an arity of sort \Prop.
+
+\paragraph[Definition]{Definition}
+A type $T$ is an {\em arity} if there is a $s\in\Sort$
such that $T$ is an arity of sort $s$.
-\vskip.5em
+
+\paragraph[Examples]{Examples}
+$A\ra \Set$ and $\forall~A:\Prop,A\ra \Prop$ are arities.
+
+\paragraph[Definition]{Definition\index{Positivity}\label{Positivity}}
\noindent A {\em type
of constructor of $I$}\index{Type of constructor} is either a term
$(I~t_1\ldots ~t_n)$ or $\fa x:T,C$ with $C$ recursively
--
cgit v1.2.3
From 1231781cf36d94858abc1a73a55fbba543209d4c Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 2 Nov 2015 17:11:01 +0100
Subject: ENH: examples
---
doc/refman/RefMan-cic.tex | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 2fa9c59a86..d0bffa06e7 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -782,15 +782,17 @@ such that $T$ is an arity of sort $s$.
\paragraph[Examples]{Examples}
$A\ra \Set$ and $\forall~A:\Prop,A\ra \Prop$ are arities.
-\paragraph[Definition]{Definition\index{Positivity}\label{Positivity}}
-\noindent A {\em type
- of constructor of $I$}\index{Type of constructor} is either a term
+\paragraph[Definition]{Definition\index{type of constructor}}
+A {\em type of constructor of $I$}\index{Type of constructor} is either a term
$(I~t_1\ldots ~t_n)$ or $\fa x:T,C$ with $C$ recursively
a {\em type of constructor of $I$}.
-\smallskip
+\paragraph[Examples]{Examples}
+$\nat$ and $\nat\ra\nat$ are types of constructors of $\nat$.\\
+$\forall A:\Type,\List~A$ and $\forall A:\Type,A\ra\List~A\ra\List~A$ are constructors of $\List$.
-\noindent The type of constructor $T$ will be said to {\em satisfy the positivity
+\paragraph[Definition]{Definition\index{Positivity}\label{Positivity}}
+The type of constructor $T$ will be said to {\em satisfy the positivity
condition} for a constant $X$ in the following cases:
\begin{itemize}
--
cgit v1.2.3
From 6a66f087bdb773465ce55f8cac040158f07c8d5c Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 3 Nov 2015 10:07:16 +0100
Subject: ALPHA-CONVERSION: s/Length/has_length/g
---
doc/common/macros.tex | 8 +++---
doc/refman/RefMan-cic.tex | 62 +++++++++++++++++++++++------------------------
2 files changed, 35 insertions(+), 35 deletions(-)
(limited to 'doc')
diff --git a/doc/common/macros.tex b/doc/common/macros.tex
index fb9190a162..1ac29b1553 100644
--- a/doc/common/macros.tex
+++ b/doc/common/macros.tex
@@ -257,13 +257,13 @@
\newcommand{\forest}{\mbox{\textsf{forest}}}
\newcommand{\from}{\mbox{\textsf{from}}}
\newcommand{\hd}{\mbox{\textsf{hd}}}
-\newcommand{\Length}{\mbox{\textsf{Length}}}
+\newcommand{\haslength}{\mbox{\textsf{has\_length}}}
\newcommand{\length}{\mbox{\textsf{length}}}
-\newcommand{\LengthA}{\mbox {\textsf{Length\_A}}}
+\newcommand{\haslengthA}{\mbox {\textsf{has\_length~A}}}
\newcommand{\List}{\mbox{\textsf{list}}}
\newcommand{\ListA}{\mbox{\textsf{List\_A}}}
-\newcommand{\LNil}{\mbox{\textsf{Lnil}}}
-\newcommand{\LCons}{\mbox{\textsf{Lcons}}}
+\newcommand{\nilhl}{\mbox{\textsf{nil\_hl}}}
+\newcommand{\conshl}{\mbox{\textsf{cons\_hl}}}
\newcommand{\nat}{\mbox{\textsf{nat}}}
\newcommand{\nO}{\mbox{\textsf{O}}}
\newcommand{\nS}{\mbox{\textsf{S}}}
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index d0bffa06e7..bbf6372846 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -642,20 +642,20 @@ and thus it enriches the global environment with the following entry:
\noindent If we take the following inductive definition:
\begin{coq_example*}
-Inductive Length (A : Type) : list A -> nat -> Prop :=
- | Lnil : Length A (nil A) O
- | Lcons : forall (a:A) (l:list A) (n:nat),
- Length A l n -> Length A (cons A a l) (S n).
+Inductive has_length (A : Type) : list A -> nat -> Prop :=
+ | nil_hl : has_length A (nil A) O
+ | cons_hl : forall (a:A) (l:list A) (n:nat),
+ has_length A l n -> has_length A (cons A a l) (S n).
\end{coq_example*}
then:
\def\GammaI{\left[\begin{array}{r \colon l}
- \Length & \forall~A\!:\!\Type,~\List~A\ra\nat\ra\Prop
+ \haslength & \forall~A\!:\!\Type,~\List~A\ra\nat\ra\Prop
\end{array}
\right]}
\def\GammaC{\left[\begin{array}{r c l}
- \LNil & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\Length~A~(\Nil~A)~\nO\\
- \LCons & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\forall~a\!:\!A,~\forall~l\!:\!\List~A,~\forall~n\!:\!\nat,\\
- & & \Length~A~l~n\ra \Length~A~(\cons~A~a~l)~(\nS~n)
+ \nilhl & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\haslength~A~(\Nil~A)~\nO\\
+ \conshl & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\forall~a\!:\!A,~\forall~l\!:\!\List~A,~\forall~n\!:\!\nat,\\
+ & & \haslength~A~l~n\ra \haslength~A~(\cons~A~a~l)~(\nS~n)
\end{array}
\right]}
\begin{itemize}
@@ -736,11 +736,11 @@ $\begin{array}{@{} l}
\prefix\List : \Type\ra\Type\\
\prefix\Nil : \forall~A\!:\!\Type,~\List~A\\
\prefix\cons : \forall~A\!:\!\Type,~A\ra\List~A\ra\List~A\\
- \prefix\Length : \forall~A\!:\!\Type,~\List~A\ra\nat\ra\Prop\\
- \prefix\LNil : \forall~A\!:\!\Type,~\Length~A~(\Nil~A)~\nO\\
+ \prefix\haslength : \forall~A\!:\!\Type,~\List~A\ra\nat\ra\Prop\\
+ \prefix\nilhl : \forall~A\!:\!\Type,~\haslength~A~(\Nil~A)~\nO\\
\begin{array}{l l}
- \hskip-.5em\prefix\LCons :\hskip-.5em & \forall~A\!:\!\Type,~\forall~a\!:\!A,~\forall~l\!:\!\List~A,~\forall~n\!:\!\nat,\\
- & \Length~A~l~n\ra \Length~A~(\cons~A~a~l)~(\nS~n)
+ \hskip-.5em\prefix\conshl :\hskip-.5em & \forall~A\!:\!\Type,~\forall~a\!:\!A,~\forall~l\!:\!\List~A,~\forall~n\!:\!\nat,\\
+ & \haslength~A~l~n\ra \haslength~A~(\cons~A~a~l)~(\nS~n)
\end{array}
\end{array}$
@@ -752,10 +752,10 @@ $\begin{array}{@{} l}
%%typing rules where the inductive objects are seen as objects
%%abstracted with respect to the parameters.
-%In the definition of \List\ or \Length\, $A$ is a parameter because
-%what is effectively inductively defined is $\ListA$ or $\LengthA$ for
+%In the definition of \List\ or \haslength\, $A$ is a parameter because
+%what is effectively inductively defined is $\ListA$ or $\haslengthA$ for
%a given $A$ which is constant in the type of constructors. But when
-%we define $(\LengthA~l~n)$, $l$ and $n$ are not parameters because the
+%we define $(\haslengthA~l~n)$, $l$ and $n$ are not parameters because the
%constructors manipulate different instances of this family.
\subsection{Well-formed inductive definitions}
@@ -1099,21 +1099,21 @@ fixed point of this recursive equation. This says that we are only
manipulating finite objects. This analysis provides induction
principles.
-For instance, in order to prove $\forall l:\ListA,(\LengthA~l~(\length~l))$
+For instance, in order to prove $\forall l:\ListA,(\haslengthA~l~(\length~l))$
it is enough to prove:
-\noindent $(\LengthA~(\Nil~A)~(\length~(\Nil~A)))$ and
+\noindent $(\haslengthA~(\Nil~A)~(\length~(\Nil~A)))$ and
\smallskip
-$\forall a:A, \forall l:\ListA, (\LengthA~l~(\length~l)) \ra
-(\LengthA~(\cons~A~a~l)~(\length~(\cons~A~a~l)))$.
+$\forall a:A, \forall l:\ListA, (\haslengthA~l~(\length~l)) \ra
+(\haslengthA~(\cons~A~a~l)~(\length~(\cons~A~a~l)))$.
\smallskip
\noindent which given the conversion equalities satisfied by \length\ is the
same as proving:
-$(\LengthA~(\Nil~A)~\nO)$ and $\forall a:A, \forall l:\ListA,
-(\LengthA~l~(\length~l)) \ra
-(\LengthA~(\cons~A~a~l)~(\nS~(\length~l)))$.
+$(\haslengthA~(\Nil~A)~\nO)$ and $\forall a:A, \forall l:\ListA,
+(\haslengthA~l~(\length~l)) \ra
+(\haslengthA~(\cons~A~a~l)~(\nS~(\length~l)))$.
One conceptually simple way to do that, following the basic scheme
proposed by Martin-L\"of in his Intuitionistic Type Theory, is to
@@ -1370,15 +1370,15 @@ For $\ListA$ the type of $P$ will be $\ListA\ra s$ for $s \in \Sort$. \\
$ \CI{(\cons~A)}{P} \equiv
\forall a:A, \forall l:\ListA,(P~(\cons~A~a~l))$.
-For $\LengthA$, the type of $P$ will be
-$\forall l:\ListA,\forall n:\nat, (\LengthA~l~n)\ra \Prop$ and the expression
-\CI{(\LCons~A)}{P} is defined as:\\
+For $\haslengthA$, the type of $P$ will be
+$\forall l:\ListA,\forall n:\nat, (\haslengthA~l~n)\ra \Prop$ and the expression
+\CI{(\conshl~A)}{P} is defined as:\\
$\forall a:A, \forall l:\ListA, \forall n:\nat, \forall
-h:(\LengthA~l~n), (P~(\cons~A~a~l)~(\nS~n)~(\LCons~A~a~l~n~l))$.\\
+h:(\haslengthA~l~n), (P~(\cons~A~a~l)~(\nS~n)~(\conshl~A~a~l~n~l))$.\\
If $P$ does not depend on its third argument, we find the more natural
expression:\\
$\forall a:A, \forall l:\ListA, \forall n:\nat,
-(\LengthA~l~n)\ra(P~(\cons~A~a~l)~(\nS~n))$.
+(\haslengthA~l~n)\ra(P~(\cons~A~a~l)~(\nS~n))$.
\paragraph{Typing rule.}
@@ -1411,7 +1411,7 @@ only constructors of $I$.
\end{description}
\paragraph{Example.}
-For \List\ and \Length\ the typing rules for the {\tt match} expression
+For \List\ and \haslength\ the typing rules for the {\tt match} expression
are (writing just $t:M$ instead of \WTEG{t}{M}, the global environment and
local context being the same in all the judgments).
@@ -1421,11 +1421,11 @@ local context being the same in all the judgments).
\[\frac{
\begin{array}[b]{@{}c@{}}
-H:(\LengthA~L~N) \\ P:\forall l:\ListA, \forall n:\nat, (\LengthA~l~n)\ra
+H:(\haslengthA~L~N) \\ P:\forall l:\ListA, \forall n:\nat, (\haslengthA~l~n)\ra
\Prop\\
- f_1:(P~(\Nil~A)~\nO~\LNil) \\
+ f_1:(P~(\Nil~A)~\nO~\nilhl) \\
f_2:\forall a:A, \forall l:\ListA, \forall n:\nat, \forall
- h:(\LengthA~l~n), (P~(\cons~A~a~n)~(\nS~n)~(\LCons~A~a~l~n~h))
+ h:(\haslengthA~l~n), (P~(\cons~A~a~n)~(\nS~n)~(\conshl~A~a~l~n~h))
\end{array}}
{\Case{P}{H}{f_1~|~f_2}:(P~L~N~H)}\]
--
cgit v1.2.3
From 754bc95497ccf903391e5aa1cfda45cb59ad7927 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 3 Nov 2015 10:23:19 +0100
Subject: ENH: new example: "even"
---
doc/common/macros.tex | 5 +++++
doc/refman/RefMan-cic.tex | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)
(limited to 'doc')
diff --git a/doc/common/macros.tex b/doc/common/macros.tex
index 1ac29b1553..0ea2ed650b 100644
--- a/doc/common/macros.tex
+++ b/doc/common/macros.tex
@@ -280,6 +280,11 @@
\newcommand{\Type}{\mbox{\textsf{Type}}}
\newcommand{\unfold}{\mbox{\textsf{unfold}}}
\newcommand{\zeros}{\mbox{\textsf{zeros}}}
+\newcommand{\even}{\mbox{\textsf{even}}}
+\newcommand{\odd}{\mbox{\textsf{even}}}
+\newcommand{\evenO}{\mbox{\textsf{even\_O}}}
+\newcommand{\evenS}{\mbox{\textsf{even\_S}}}
+\newcommand{\oddS}{\mbox{\textsf{odd\_S}}}
%%%%%%%%%
% Misc. %
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index bbf6372846..101c4e5036 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -640,6 +640,42 @@ and thus it enriches the global environment with the following entry:
\vskip1em\hrule\vskip1em
+\noindent If we take the following inductive definition:
+\begin{coq_example*}
+Inductive even : nat -> Prop :=
+ | even_O : even 0
+ | even_S : forall n, odd n -> even (S n)
+with odd : nat -> Prop :=
+ | odd_S : forall n, even n -> odd (S n).
+\end{coq_example*}
+then:
+\def\GammaI{\left[\begin{array}{r \colon l}
+ \even & \nat\ra\Prop \\
+ \odd & \nat\ra\Prop
+ \end{array}
+ \right]}
+\def\GammaC{\left[\begin{array}{r \colon l}
+ \evenO & \even~\nO \\
+ \evenS & \forall n : \nat, \odd~n \ra \even~(\nS~n)
+ \end{array}
+ \right]}
+\begin{itemize}
+ \item $p = 1$
+ \item $\Gamma_I = \GammaI$
+ \item $\Gamma_C = \GammaC$
+\end{itemize}
+and thus it enriches the global environment with the following entry:
+\vskip.5em
+\ind{p}{\Gamma_I}{\Gamma_C}
+\vskip.5em
+\noindent that is:
+\vskip.5em
+\ind{1}{\GammaI}{\GammaC}
+\vskip.5em
+\noindent In this case, $\Gamma_P=[A:\Type]$.
+
+\vskip1em\hrule\vskip1em
+
\noindent If we take the following inductive definition:
\begin{coq_example*}
Inductive has_length (A : Type) : list A -> nat -> Prop :=
--
cgit v1.2.3
From 6c9f5450f476da94aa70df93c5a6368b98e73e90 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 3 Nov 2015 10:37:16 +0100
Subject: CLEANUP: superfluous examples were removed
---
doc/common/macros.tex | 2 +-
doc/refman/RefMan-cic.tex | 20 +++++---------------
2 files changed, 6 insertions(+), 16 deletions(-)
(limited to 'doc')
diff --git a/doc/common/macros.tex b/doc/common/macros.tex
index 0ea2ed650b..a6240ad284 100644
--- a/doc/common/macros.tex
+++ b/doc/common/macros.tex
@@ -281,7 +281,7 @@
\newcommand{\unfold}{\mbox{\textsf{unfold}}}
\newcommand{\zeros}{\mbox{\textsf{zeros}}}
\newcommand{\even}{\mbox{\textsf{even}}}
-\newcommand{\odd}{\mbox{\textsf{even}}}
+\newcommand{\odd}{\mbox{\textsf{odd}}}
\newcommand{\evenO}{\mbox{\textsf{even\_O}}}
\newcommand{\evenS}{\mbox{\textsf{even\_S}}}
\newcommand{\oddS}{\mbox{\textsf{odd\_S}}}
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 101c4e5036..d3e8755a85 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -763,21 +763,11 @@ these two inference rules above enable us to conclude that:
\vskip.5em
\def\prefix{E[\Gamma]\vdash\hskip.25em}
$\begin{array}{@{} l}
- \prefix\bool : \Set\\
- \prefix\true : \bool\\
- \prefix\false : \bool\\
- \prefix\nat : \Set\\
- \prefix\nO : \nat\\
- \prefix\nS : \nat\ra\nat\\
- \prefix\List : \Type\ra\Type\\
- \prefix\Nil : \forall~A\!:\!\Type,~\List~A\\
- \prefix\cons : \forall~A\!:\!\Type,~A\ra\List~A\ra\List~A\\
- \prefix\haslength : \forall~A\!:\!\Type,~\List~A\ra\nat\ra\Prop\\
- \prefix\nilhl : \forall~A\!:\!\Type,~\haslength~A~(\Nil~A)~\nO\\
- \begin{array}{l l}
- \hskip-.5em\prefix\conshl :\hskip-.5em & \forall~A\!:\!\Type,~\forall~a\!:\!A,~\forall~l\!:\!\List~A,~\forall~n\!:\!\nat,\\
- & \haslength~A~l~n\ra \haslength~A~(\cons~A~a~l)~(\nS~n)
- \end{array}
+ \prefix\even : \nat\ra\Prop\\
+ \prefix\odd : \nat\ra\Prop\\
+ \prefix\evenO : \even~\nO\\
+ \prefix\evenS : \forall~n:\nat, \odd~n \ra \even~(\nS~n)\\
+ \prefix\oddS : \forall~n:\nat, \even~n \ra \odd~(\nS~n)
\end{array}$
%\paragraph{Parameters.}
--
cgit v1.2.3
From 4570133034c9457a4d641449a522c29a8f029a55 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 3 Nov 2015 10:45:04 +0100
Subject: FIX: commit 315f771
---
doc/refman/RefMan-cic.tex | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index d3e8755a85..d3b4f3af7c 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -59,7 +59,9 @@ Formally, we call {\Sort} the set of sorts which is defined by:
\index{Prop@{\Prop}}%
\index{Set@{\Set}}%
\[\Sort \equiv \{\Prop,\Set,\Type(i)\;|\; i \in \NN\} \]
-Their properties are defined in Section~\ref{subtyping-rules}.
+Their properties, such as:
+{\Prop:\Type$(1)$}, {\Set:\Type$(1)$}, and {\Type$(i)$:\Type$(i+1)$},
+are defined in Section~\ref{subtyping-rules}.
% TODO: Somewhere in the document we should explain:
% - what concrete actions (in *.v files) cause creation of new universes
--
cgit v1.2.3
From 8b559623f8f2539836069a7352498a5e2c4784e6 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 3 Nov 2015 11:27:35 +0100
Subject: COMMENT: to do
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index d3b4f3af7c..f7a6470f9c 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -184,6 +184,7 @@ More precisely the language of the {\em Calculus of Inductive
The notion of free variables is defined as usual. In the expressions
$\lb x:T\mto U$ and $\forall x:T, U$ the occurrences of $x$ in $U$
are bound.
+% TODO: what is the best play to say that "terms are considered equal up to α-conversion"?
\paragraph[Substitution.]{Substitution.\index{Substitution}}
The notion of substituting a term $t$ to free occurrences of a
--
cgit v1.2.3
From f07348e606882ddb0d69029bde82be3106335f21 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 3 Nov 2015 11:39:54 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index f7a6470f9c..5df70a8e97 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -305,6 +305,7 @@ local context $\Gamma$ and a term $T$ such that the judgment \WTEG{t}{T} can
be derived from the following rules.
\begin{description}
\item[W-Empty] \inference{\WF{[]}{}}
+% QUESTION: Why in W-Local-Assum and W-Local-Def we do not need x ∉ E hypothesis?
\item[W-Local-Assum] % Ce n'est pas vrai : x peut apparaitre plusieurs fois dans Gamma
\inference{\frac{\WTEG{T}{s}~~~~s \in \Sort~~~~x \not\in \Gamma % \cup E
}{\WFE{\Gamma::(x:T)}}}
--
cgit v1.2.3
From ee629d65f2d36544b0e5c8afb657933ef19c296d Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 3 Nov 2015 11:40:20 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 5df70a8e97..45613e03af 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -312,6 +312,7 @@ be derived from the following rules.
\item[W-Local-Def]
\inference{\frac{\WTEG{t}{T}~~~~x \not\in \Gamma % \cup E
}{\WFE{\Gamma::(x:=t:T)}}}
+% QUESTION: Why in W-Global-Assum and W-Global-Def we do not need x ∉ Γ hypothesis?
\item[W-Global-Assum] \inference{\frac{\WTE{}{T}{s}~~~~s \in \Sort~~~~c \notin E}
{\WF{E;c:T}{}}}
\item[W-Global-Def] \inference{\frac{\WTE{}{t}{T}~~~c \notin E}
--
cgit v1.2.3
From 420e750c4ef3be1d562e1729e5ec6adf94795913 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Wed, 18 Nov 2015 16:36:22 +0100
Subject: CLEANUP: the definition of "type of constructor" was rephrased in
order to make it more clear
---
doc/refman/RefMan-cic.tex | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 45613e03af..d05e3dd9e8 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -814,9 +814,12 @@ such that $T$ is an arity of sort $s$.
$A\ra \Set$ and $\forall~A:\Prop,A\ra \Prop$ are arities.
\paragraph[Definition]{Definition\index{type of constructor}}
-A {\em type of constructor of $I$}\index{Type of constructor} is either a term
-$(I~t_1\ldots ~t_n)$ or $\fa x:T,C$ with $C$ recursively
-a {\em type of constructor of $I$}.
+We say that $T$ is a {\em type of constructor of $I$\index{type of constructor}}
+in one of the following two cases:
+\begin{itemize}
+ \item $T$ is $(I~t_1\ldots ~t_n)$
+ \item $T$ is $\forall x:U,T^\prime$ where $T^\prime$ is also a type of constructor of $I$
+\end{itemize}
\paragraph[Examples]{Examples}
$\nat$ and $\nat\ra\nat$ are types of constructors of $\nat$.\\
--
cgit v1.2.3
From 27c19fffda5c5b1f119a1b2115915b330fdfe1ba Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 3 Nov 2015 13:25:42 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index d05e3dd9e8..c3dc80b1a6 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -828,6 +828,7 @@ $\forall A:\Type,\List~A$ and $\forall A:\Type,A\ra\List~A\ra\List~A$ are constr
\paragraph[Definition]{Definition\index{Positivity}\label{Positivity}}
The type of constructor $T$ will be said to {\em satisfy the positivity
condition} for a constant $X$ in the following cases:
+% QUESTION: Why is this property called "positivity"?
\begin{itemize}
\item $T=(X~t_1\ldots ~t_n)$ and $X$ does not occur free in
--
cgit v1.2.3
From fc73973844f848fafb61b6aa39a327e95f09c129 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 3 Nov 2015 13:28:57 +0100
Subject: CLEANUP: s/List_A/List~A/g
---
doc/common/macros.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/common/macros.tex b/doc/common/macros.tex
index a6240ad284..2271a8f134 100644
--- a/doc/common/macros.tex
+++ b/doc/common/macros.tex
@@ -261,7 +261,7 @@
\newcommand{\length}{\mbox{\textsf{length}}}
\newcommand{\haslengthA}{\mbox {\textsf{has\_length~A}}}
\newcommand{\List}{\mbox{\textsf{list}}}
-\newcommand{\ListA}{\mbox{\textsf{List\_A}}}
+\newcommand{\ListA}{\mbox{\textsf{List}~A}}
\newcommand{\nilhl}{\mbox{\textsf{nil\_hl}}}
\newcommand{\conshl}{\mbox{\textsf{cons\_hl}}}
\newcommand{\nat}{\mbox{\textsf{nat}}}
--
cgit v1.2.3
From 5a155b13b6a6820a1c0417025c67170a3e22fedc Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 3 Nov 2015 13:32:59 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 3 +++
1 file changed, 3 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index c3dc80b1a6..c15ee9ffdd 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -820,6 +820,9 @@ in one of the following two cases:
\item $T$ is $(I~t_1\ldots ~t_n)$
\item $T$ is $\forall x:U,T^\prime$ where $T^\prime$ is also a type of constructor of $I$
\end{itemize}
+% QUESTION: Are we above sufficiently precise?
+% Shouldn't we say also what is "n"?
+% "n" couldn't be "0", could it?
\paragraph[Examples]{Examples}
$\nat$ and $\nat\ra\nat$ are types of constructors of $\nat$.\\
--
cgit v1.2.3
From c5a7d2bec3232625dcb50cfc3a3d6d5abcb81ff0 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 3 Nov 2015 16:59:08 +0100
Subject: ENH: examples for 'strict positivity' were expanded
---
doc/common/macros.tex | 4 ++-
doc/refman/RefMan-cic.tex | 72 +++++++++++++++++++++++++++++++++++------
doc/refman/Reference-Manual.tex | 1 +
3 files changed, 66 insertions(+), 11 deletions(-)
(limited to 'doc')
diff --git a/doc/common/macros.tex b/doc/common/macros.tex
index 2271a8f134..3b12f259b6 100644
--- a/doc/common/macros.tex
+++ b/doc/common/macros.tex
@@ -261,7 +261,7 @@
\newcommand{\length}{\mbox{\textsf{length}}}
\newcommand{\haslengthA}{\mbox {\textsf{has\_length~A}}}
\newcommand{\List}{\mbox{\textsf{list}}}
-\newcommand{\ListA}{\mbox{\textsf{List}~A}}
+\newcommand{\ListA}{\mbox{\textsf{list}}~\ensuremath{A}}
\newcommand{\nilhl}{\mbox{\textsf{nil\_hl}}}
\newcommand{\conshl}{\mbox{\textsf{cons\_hl}}}
\newcommand{\nat}{\mbox{\textsf{nat}}}
@@ -285,6 +285,8 @@
\newcommand{\evenO}{\mbox{\textsf{even\_O}}}
\newcommand{\evenS}{\mbox{\textsf{even\_S}}}
\newcommand{\oddS}{\mbox{\textsf{odd\_S}}}
+\newcommand{\Prod}{\mbox{\textsf{prod}}}
+\newcommand{\Pair}{\mbox{\textsf{pair}}}
%%%%%%%%%
% Misc. %
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index c15ee9ffdd..1c374e9397 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -876,16 +876,68 @@ any $u_i$
the type $V$ satisfies the nested positivity condition for $X$
\end{itemize}
-\paragraph{Example}
-
-$X$ occurs strictly positively in $A\ra X$ or $X*A$ or $({\tt list}~
-X)$ but not in $X \ra A$ or $(X \ra A)\ra A$ nor $({\tt neg}~X)$
-assuming the notion of product and lists were already defined and {\tt
- neg} is an inductive definition with declaration \Ind{}{A:\Set}{{\tt
- neg}:\Set}{{\tt neg}:(A\ra{\tt False}) \ra {\tt neg}}. Assuming
-$X$ has arity ${\tt nat \ra Prop}$ and {\tt ex} is the inductively
-defined existential quantifier, the occurrence of $X$ in ${\tt (ex~
- nat~ \lb n:nat\mto (X~ n))}$ is also strictly positive.
+\newcommand\vv{\textSFxi} % │
+\newcommand\hh{\textSFx} % ─
+\newcommand\vh{\textSFviii} % ├
+\newcommand\hv{\textSFii} % └
+\newlength\framecharacterwidth
+\settowidth\framecharacterwidth{\hh}
+\newcommand\ws{\hbox{}\hskip\the\framecharacterwidth}
+\newcommand\ruleref[1]{\hskip.25em\dots\hskip.2em{\em (bullet #1)}}
+\paragraph{Example}~\\
+\vskip-.5em
+\noindent$X$ occurs strictly positively in $A\ra X$\ruleref5\\
+\vv\\
+\vh\hh\ws $X$does not occur in $A$\ruleref3\\
+\vv\\
+\hv\hh\ws $X$ occurs strictly positively in $X$\ruleref4
+\paragraph{Example}~\\
+\vskip-.5em
+\noindent $X$ occurs strictly positively in $X*A$\\
+\vv\\
+\hv\hh $X$ occurs strictly positively in $(\Prod~X~A)$\ruleref6\\
+\ws\ws\vv\\
+\ws\ws\vv\ws\verb|Inductive prod (A B : Type) : Type :=|\\
+\ws\ws\vv\ws\verb| pair : A -> B -> prod A B.|\\
+\ws\ws\vv\\
+\ws\ws\vh\hh $X$ does not occur in any (real) arguments of $\Prod$ in the original term $(\Prod~X~A)$\\
+\ws\ws\vv\\
+\ws\ws\hv\ws the (instantiated) type $\Prod~X~A$ of constructor $\Pair$,\\
+\ws\ws\ws\ws satisfies the nested positivity condition for $X$\ruleref7\\
+\ws\ws\ws\ws\vv\\
+\ws\ws\ws\ws\hv\ws $X$ does not occur in any (real) arguments of $(\Prod~X~A)$
+\paragraph{Example}~\\
+\vskip-.5em
+\noindent $X$ occurs strictly positively in $\ListA$\ruleref6\\
+\vv\\
+\vv\ws\verb|Inductive list (A:Type) : Type :=|\\
+\vv\ws\verb$ | nil : list A$\\
+\vv\ws\verb$ | cons : A -> list A -> list A$\\
+\vv\\
+\vh\hh $X$ does not occur in any arguments of $\List$\\
+\vv\\
+\hv\hh\ws Every instantiated constructor of $\ListA$ satisfies the nested positivity condition for $X$\\
+\ws\ws\ws\vv\\
+\ws\ws\ws\vh\hh\ws concerning type $\ListA$ of constructor $\Nil$:\\
+\ws\ws\ws\vv\ws\ws Type $\ListA$ of constructor $\Nil$ satisfies the nested positivity condition for $X$\\
+\ws\ws\ws\vv\ws\ws because $X$ does not appear in any (real) arguments of the type of that constructor\\
+\ws\ws\ws\vv\ws\ws (primarily because $\List$ does not have any (real) arguments)\ruleref7\\
+\ws\ws\ws\vv\\
+\ws\ws\ws\hv\hh\ws concerning type $\forall~A\ra\ListA\ra\ListA$ of constructor $\cons$:\\
+\ws\ws\ws\ws\ws\ws Type $\forall~A:\Type,A\ra\ListA\ra\ListA$ of constructor $\cons$\\
+\ws\ws\ws\ws\ws\ws satisfies the nested positivity condition for $X$\ruleref8\\
+\ws\ws\ws\ws\ws\ws\vv\\
+\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $\Type$\ruleref3\\
+\ws\ws\ws\ws\ws\ws\vv\\
+\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $A\ra\ListA\ra\ListA$\ruleref8\\
+\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $A$\ruleref3\\
+\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $\ListA\ra\ListA$\ruleref8\\
+\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\ws $X$ occurs only strictly positively in $\ListA$\ruleref3\\
+\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\ws $X$ satisfies the nested positivity condition for $\ListA$\ruleref7
\paragraph{Correctness rules.}
We shall now describe the rules allowing the introduction of a new
diff --git a/doc/refman/Reference-Manual.tex b/doc/refman/Reference-Manual.tex
index ac28e0ba03..cb5d2ecb54 100644
--- a/doc/refman/Reference-Manual.tex
+++ b/doc/refman/Reference-Manual.tex
@@ -20,6 +20,7 @@
\usepackage{headers} % in this directory
\usepackage{multicol}
\usepackage{xspace}
+\usepackage{pmboxdraw}
% for coqide
\ifpdf % si on est pas en pdflatex
--
cgit v1.2.3
From 7fb0ac951bbc8081642448cab92def3540ee2f3f Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Wed, 4 Nov 2015 14:55:52 +0100
Subject: COMMENT: questions
---
doc/refman/RefMan-cic.tex | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 1c374e9397..28c1c66453 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -835,6 +835,7 @@ condition} for a constant $X$ in the following cases:
\begin{itemize}
\item $T=(X~t_1\ldots ~t_n)$ and $X$ does not occur free in
+% QUESTIONS: What is the meaning of 'n' above?
any $t_i$
\item $T=\forall~x:U,V$ and $X$ occurs only strictly positively in $U$ and
the type $V$ satisfies the positivity condition for $X$
@@ -846,10 +847,12 @@ following cases:
\begin{itemize}
\item $X$ does not occur in $T$
\item $T$ converts to $(X~t_1 \ldots ~t_n)$ and $X$ does not occur in
+% QUESTIONS: What is the meaning of 'n' above?
any of $t_i$
\item $T$ converts to $\forall~x:U,V$ and $X$ does not occur in
type $U$ but occurs strictly positively in type $V$
\item $T$ converts to $(I~a_1 \ldots ~a_m ~ t_1 \ldots ~t_p)$ where
+% QUESTIONS: What is the meaning of 'p' above?
$I$ is the name of an inductive declaration of the form
$\Ind{\Gamma}{m}{I:A}{c_1:\forall p_1:P_1,\ldots \forall
p_m:P_m,C_1;\ldots;c_n:\forall p_1:P_1,\ldots \forall
@@ -872,6 +875,7 @@ cases:
\item $T=(I~b_1\ldots b_m~u_1\ldots ~u_{p})$, $I$ is an inductive
definition with $m$ parameters and $X$ does not occur in
any $u_i$
+% QUESTIONS: What is the meaning of 'p' above?
\item $T=\forall~x:U,V$ and $X$ occurs only strictly positively in $U$ and
the type $V$ satisfies the nested positivity condition for $X$
\end{itemize}
--
cgit v1.2.3
From d0d4eb3aedc2d971a1ab4182ac5e4ee3ac741427 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Wed, 4 Nov 2015 18:54:07 +0100
Subject: FIX: making sure that my previous edits do not break HTML generation
---
doc/refman/RefMan-cic.tex | 87 ++++++++++++++++++++++++++++++-----------------
1 file changed, 56 insertions(+), 31 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 28c1c66453..00ba0091ee 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -434,15 +434,34 @@ $\eta$-expansion $\lb x:T\mto (t\ x)$ for $x$ an arbitrary variable
name fresh in $t$.
\Rem We deliberately do not define $\eta$-reduction:
-\def\noeta{\hskip-.1em\not\triangleright_\eta}
-$$\lb x:T\mto (t\ x)\hskip.1em\noeta\hskip.3em t$$
+\begin{latexonly}
+ $$\lb x:T\mto (t\ x)\not\triangleright_\eta\hskip.3em t$$
+\end{latexonly}
+\begin{htmlonly}
+ $$\lb x:T\mto (t\ x)~\not\triangleright_\eta~t$$
+\end{htmlonly}
This is because, in general, the type of $t$ need not to be convertible to the type of $\lb x:T\mto (t\ x)$.
E.g., if we take $f$ such that:
-$$f\hskip.5em:\hskip.5em\forall x:Type(2),Type(1)$$
+\begin{latexonly}
+ $$f\hskip.5em:\hskip.5em\forall x:Type(2),Type(1)$$
+\end{latexonly}
+\begin{htmlonly}
+ $$f~:~\forall x:Type(2),Type(1)$$
+\end{htmlonly}
then
-$$\lb x:Type(1),(f\, x)\hskip.5em:\hskip.5em\forall x:Type(1),Type(1)$$
+\begin{latexonly}
+ $$\lb x:Type(1),(f\, x)\hskip.5em:\hskip.5em\forall x:Type(1),Type(1)$$
+\end{latexonly}
+\begin{htmlonly}
+ $$\lb x:Type(1),(f\, x)~:~\forall x:Type(1),Type(1)$$
+\end{htmlonly}
We could not allow
-$$\lb x:Type(1),(f\,x)\hskip.5em\noeta\hskip.6em f$$
+\begin{latexonly}
+ $$\lb x:Type(1),(f\,x)\hskip.4em\not\triangleright_\eta\hskip.6em f$$
+\end{latexonly}
+\begin{htmlonly}
+ $$\lb x:Type(1),(f\,x)~\not\triangleright_\eta~f$$
+\end{htmlonly}
because the type of the reduced term $\forall x:Type(2),Type(1)$
would not be convertible to the type of the original term $\forall x:Type(1),Type(1)$.
@@ -530,13 +549,14 @@ Formally, we can represent any {\em inductive definition\index{definition!induct
\item $p$ determines the number of parameters of these inductive types.
\end{itemize}
These inductive definitions, together with global assumptions and global definitions, then form the global environment.
-\vskip.5em
+
\noindent Additionally, for any $p$ there always exists $\Gamma_P=[a_1:A_1;\dots;a_p:A_p]$
such that each $(t:T)\in\Gamma_I\cup\Gamma_C$ can be written as:
$\forall\Gamma_P, T^\prime$.
-\vskip.5em
+
\noindent $\Gamma_P$ is called {\em context of parameters\index{context of parameters}}.
+\begin{latexonly}
\subsection*{Examples}
If we take the following inductive definition (denoted in concrete syntax):
@@ -547,35 +567,35 @@ Inductive bool : Set :=
\end{coq_example*}
then:
\def\colon{@{\hskip.5em:\hskip.5em}}
-\def\GammaI{\left[\begin{array}{r \colon l}
- \bool & \Set
- \end{array}
- \right]}
-\def\GammaC{\left[\begin{array}{r \colon l}
- \true & \bool\\
- \false & \bool
- \end{array}
- \right]}
\newcommand\ind[3]{$\mathsf{Ind}~[#1]\left(\hskip-.4em
\begin{array}{r @{\mathrm{~:=~}} l}
#2 & #3 \\
\end{array}
\hskip-.4em
\right)$}
-\begin{itemize}
- \item $p = 0$
- \item $\Gamma_I = \GammaI$
- \item $\Gamma_C = \GammaC$
-\end{itemize}
-and thus it enriches the global environment with the following entry:
-\vskip.5em
-\ind{p}{\Gamma_I}{\Gamma_C}
-\vskip.5em
-\noindent that is:
-\vskip.5em
-\ind{0}{\GammaI}{\GammaC}
-\vskip.5em
-\noindent In this case, $\Gamma_P=[\,]$.
+ \def\GammaI{\left[\begin{array}{r \colon l}
+ \bool & \Set
+ \end{array}
+ \right]}
+ \def\GammaC{\left[\begin{array}{r \colon l}
+ \true & \bool\\
+ \false & \bool
+ \end{array}
+ \right]}
+ \begin{itemize}
+ \item $p = 0$
+ \item $\Gamma_I = \GammaI$
+ \item $\Gamma_C = \GammaC$
+ \end{itemize}
+ and thus it enriches the global environment with the following entry:
+ \vskip.5em
+ \ind{p}{\Gamma_I}{\Gamma_C}
+ \vskip.5em
+ \noindent that is:
+ \vskip.5em
+ \ind{0}{\GammaI}{\GammaC}
+ \vskip.5em
+ \noindent In this case, $\Gamma_P=[\,]$.
\vskip1em\hrule\vskip1em
@@ -608,7 +628,7 @@ and thus it enriches the global environment with the following entry:
\vskip.5em
\ind{0}{\GammaI}{\GammaC}
\vskip.5em
-\noindent In this case, $\Gamma_P=[\,]$.
+\noindent In this case, $\Gamma_P=[~]$.
\vskip1em\hrule\vskip1em
@@ -750,6 +770,7 @@ and thus it enriches the global environment with the following entry:
\ind{0}{\GammaI}{\GammaC}
\vskip.5em
\noindent In this case, $\Gamma_P=[\,]$.
+\end{latexonly}
\subsection{Types of inductive objects}
We have to give the type of constants in a global environment $E$ which
@@ -762,6 +783,7 @@ contains an inductive declaration.
\inference{\frac{\WFE{\Gamma}\hskip2em\Ind{}{p}{\Gamma_I}{\Gamma_C} \in E\hskip2em(c:C)\in\Gamma_C}{\WTEG{c}{C}}}
\end{description}
+\begin{latexonly}
\paragraph{Example.}
Provided that our environment $E$ contains inductive definitions we showed before,
these two inference rules above enable us to conclude that:
@@ -774,6 +796,7 @@ $\begin{array}{@{} l}
\prefix\evenS : \forall~n:\nat, \odd~n \ra \even~(\nS~n)\\
\prefix\oddS : \forall~n:\nat, \even~n \ra \odd~(\nS~n)
\end{array}$
+\end{latexonly}
%\paragraph{Parameters.}
%%The parameters introduce a distortion between the inside specification
@@ -880,6 +903,7 @@ any $u_i$
the type $V$ satisfies the nested positivity condition for $X$
\end{itemize}
+\begin{latexonly}
\newcommand\vv{\textSFxi} % │
\newcommand\hh{\textSFx} % ─
\newcommand\vh{\textSFviii} % ├
@@ -942,6 +966,7 @@ the type $V$ satisfies the nested positivity condition for $X$
\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\ws $X$ occurs only strictly positively in $\ListA$\ruleref3\\
\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\ws $X$ satisfies the nested positivity condition for $\ListA$\ruleref7
+\end{latexonly}
\paragraph{Correctness rules.}
We shall now describe the rules allowing the introduction of a new
--
cgit v1.2.3
From 70e705a47f435e1453d889177a426d89dacda07b Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Wed, 4 Nov 2015 18:54:17 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 00ba0091ee..1013084702 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -969,6 +969,10 @@ the type $V$ satisfies the nested positivity condition for $X$
\end{latexonly}
\paragraph{Correctness rules.}
+% QUESTION: For a related problem, in case of global definitions
+% and global assumptions, we used the term "well-formedness".
+% Couldn't we continue to use the term also here?
+% Does it make sense to use a different name, i.e. "correctness" in this case?
We shall now describe the rules allowing the introduction of a new
inductive definition.
--
cgit v1.2.3
From 1200468d82136ab3279bbe18da8fa0ba4e4cc8c4 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Wed, 4 Nov 2015 19:23:40 +0100
Subject: FIX: removing a reference to \Gamma, because it is undefined
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 1013084702..51a0068b03 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -994,7 +994,7 @@ provided that the following side conditions hold:
\item $p$ is the number of parameters of \NInd{}{\Gamma_I}{\Gamma_C}
and $\Gamma_P$ is the context of parameters,
\item for $j=1\ldots k$ we have that $A_j$ is an arity of sort $s_j$ and $I_j
- \notin \Gamma \cup E$,
+ \notin E$,
\item for $i=1\ldots n$ we have that $C_i$ is a type of constructor of
$I_{q_i}$ which satisfies the positivity condition for $I_1 \ldots I_k$
and $c_i \notin \Gamma \cup E$.
--
cgit v1.2.3
From d62af5e39af63387f60dd0a92d9fbfd65974fcae Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Wed, 4 Nov 2015 19:24:41 +0100
Subject: COMMENT: to do
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 51a0068b03..bacd62b776 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -999,6 +999,7 @@ provided that the following side conditions hold:
$I_{q_i}$ which satisfies the positivity condition for $I_1 \ldots I_k$
and $c_i \notin \Gamma \cup E$.
\end{itemize}
+% TODO: justify the above constraints
\end{description}
One can remark that there is a constraint between the sort of the
arity of the inductive type and the sort of the type of its
--
cgit v1.2.3
From 2b7368ae43fefb6f151b7032b351f0da796f6cc3 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Wed, 4 Nov 2015 19:26:26 +0100
Subject: COMMENT: to do
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index bacd62b776..ddd9f075ef 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1024,6 +1024,7 @@ The same definition on \Set{} is not allowed and fails:
Fail Inductive exSet (P:Set->Prop) : Set
:= exS_intro : forall X:Set, P X -> exSet P.
\end{coq_example}
+% TODO: add the description of the 'Fail' command to the reference manual
It is possible to declare the same inductive definition in the
universe \Type.
The \texttt{exType} inductive definition has type $(\Type_i \ra\Prop)\ra
--
cgit v1.2.3
From 5edfac63b6feb0b8d6ddad47a4ca9c8b5905b03a Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Wed, 4 Nov 2015 19:31:05 +0100
Subject: COMMENT: questions
---
doc/refman/RefMan-cic.tex | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index ddd9f075ef..b862db3204 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1910,7 +1910,36 @@ impredicative system for sort \Set{} become:
{\compat{I:\Set}{I\ra s}}}
\end{description}
+% QUESTION: Why, when I add this definition:
+%
+% Inductive foo : Type := .
+%
+% Coq claims that the type of 'foo' is 'Prop'?
+
+% QUESTION: If I add this definition:
+%
+% Inductive bar (A:Type) : Type := .
+%
+% then Coq claims that 'bar' has type 'Type → Prop' where I would expect 'Type → Type' with appropriate constraint.
+% QUESTION: If I add this definition:
+%
+% Inductive foo (A:Type) : Type :=
+% | foo1 : foo A
+% | foo2 : foo A.
+%
+% then Coq claims that 'foo' has type 'Type → Set'.
+% Why?
+
+% NOTE: If I add this definition:
+%
+% Inductive foo (A:Type) : Type :=
+% | foo1 : foo A
+% | foo2 : A → foo A.
+%
+% then Coq claims, as expected, that:
+%
+% foo : Type → Type.
%%% Local Variables:
%%% mode: latex
--
cgit v1.2.3
From 760765859cb74930ac8fd14fc1a241aa8ae20aa0 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Wed, 4 Nov 2015 19:41:25 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index b862db3204..9e49481e23 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1007,6 +1007,7 @@ constructors which will always be satisfied for the impredicative sort
{\Prop} but may fail to define inductive definition
on sort \Set{} and generate constraints between universes for
inductive definitions in the {\Type} hierarchy.
+% QUESTION: which 'constraint' are we above referring to?
\paragraph{Examples.}
It is well known that existential quantifier can be encoded as an
--
cgit v1.2.3
From 1a51c868d6f342c094f2d9f0b8101d6c13720537 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Wed, 4 Nov 2015 19:48:18 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 9e49481e23..adaa20de86 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1044,6 +1044,7 @@ Inductive exType (P:Type->Prop) : Type
Inductive types declared in {\Type} are
polymorphic over their arguments in {\Type}.
+% QUESTION: Just arguments? Not also over the parameters?
If $A$ is an arity of some sort and $s$ is a sort, we write $A_{/s}$ for the arity
obtained from $A$ by replacing its sort with $s$. Especially, if $A$
--
cgit v1.2.3
From 90ae0897e80106194795e179d580da0d1118aaf2 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 09:14:23 +0100
Subject: CLEANUP PROPOSITION: s/local context of parameters/context of
parameters
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index adaa20de86..6f0e952ce6 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1055,7 +1055,7 @@ The following typing rule is added to the theory.
\begin{description}
\item[Ind-Family] Let $\Ind{}{p}{\Gamma_I}{\Gamma_C}$ be an
inductive definition. Let $\Gamma_P = [p_1:P_1;\ldots;p_{p}:P_{p}]$
- be its local context of parameters, $\Gamma_I = [I_1:\forall
+ be its context of parameters, $\Gamma_I = [I_1:\forall
\Gamma_P,A_1;\ldots;I_k:\forall \Gamma_P,A_k]$ its context of
definitions and $\Gamma_C = [c_1:\forall
\Gamma_P,C_1;\ldots;c_n:\forall \Gamma_P,C_n]$ its context of
--
cgit v1.2.3
From 02b64e2d6c69996f95fa7bbcaf228e4848ad69f4 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 10:09:01 +0100
Subject: CLEANUP PROPOSITION: superfluous parentheses were removed
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 6f0e952ce6..a5832450ce 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1079,7 +1079,7 @@ The following typing rule is added to the theory.
1 \leq j \leq k
\end{array}
\right.}
-{E[] \vdash (I_j\,q_1\,\ldots\,q_r:\forall [p_{r+1}:P_{r+1};\ldots;p_{p}:P_{p}], (A_j)_{/s_j})}
+{E[] \vdash I_j\,q_1\,\ldots\,q_r:\forall [p_{r+1}:P_{r+1};\ldots;p_{p}:P_{p}], (A_j)_{/s_j}}
}
provided that the following side conditions hold:
--
cgit v1.2.3
From a90487b5b377c1eadcc4bbb373ad489b4d236a7f Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 10:43:04 +0100
Subject: GRAMMAR
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index a5832450ce..14a5e12fc5 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1160,7 +1160,7 @@ hence, if \texttt{option} is applied to a type in {\Set}, the result is
in {\Set}. Note that if \texttt{option} is applied to a type in {\Prop},
then, the result is not set in \texttt{Prop} but in \texttt{Set}
still. This is because \texttt{option} is not a singleton type (see
-section~\ref{singleton}) and it would loose the elimination to {\Set} and
+section~\ref{singleton}) and it would lose the elimination to {\Set} and
{\Type} if set in {\Prop}.
\begin{coq_example}
--
cgit v1.2.3
From 2a5edc8ab15e556c6ee1741ffefb6869736feada Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 13:09:32 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 14a5e12fc5..ea1be67ee9 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1094,6 +1094,7 @@ $P_l$ arity implies $P'_l$ arity since $\WTEGLECONV{P'_l}{ \subst{P_l}{p_u}{q_u}
we have $(\WTE{\Gamma_{I'};\Gamma_{P'}}{C_i}{s_{q_i}})_{i=1\ldots n}$;
\item the sorts are such that all eliminations, to {\Prop}, {\Set} and
$\Type(j)$, are allowed (see section~\ref{elimdep}).
+% QUESTION: How should I interpret the above side-condition, when I am trying to show that 'list nat : Set'?
\end{itemize}
\end{description}
--
cgit v1.2.3
From 3600dbb0546a910cda3996b5226bd7a6800d3040 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 13:46:40 +0100
Subject: TYPESETTING
---
doc/refman/RefMan-cic.tex | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index ea1be67ee9..001ce54f8c 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -962,10 +962,10 @@ the type $V$ satisfies the nested positivity condition for $X$
\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $A$\ruleref3\\
\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $\ListA\ra\ListA$\ruleref8\\
-\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
-\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\ws $X$ occurs only strictly positively in $\ListA$\ruleref3\\
-\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
-\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\ws $X$ satisfies the nested positivity condition for $\ListA$\ruleref7
+\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $\ListA$\ruleref3\\
+\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $\ListA$\ruleref7
\end{latexonly}
\paragraph{Correctness rules.}
--
cgit v1.2.3
From cd60731dae4e7627588027fe1c1aa60a2ae44594 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 14:09:54 +0100
Subject: FIX: removing references to Γ which is not defined in a given context
---
doc/refman/RefMan-cic.tex | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 001ce54f8c..37ca23417d 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1075,7 +1075,7 @@ The following typing rule is added to the theory.
{\left\{\begin{array}{l}
\Ind{}{p}{\Gamma_I}{\Gamma_C} \in E\\
(E[] \vdash q_l : P'_l)_{l=1\ldots r}\\
-(\WTEGLECONV{P'_l}{\subst{P_l}{p_u}{q_u}_{u=1\ldots l-1}})_{l=1\ldots r}\\
+(\WTELECONV{}{P'_l}{\subst{P_l}{p_u}{q_u}_{u=1\ldots l-1}})_{l=1\ldots r}\\
1 \leq j \leq k
\end{array}
\right.}
@@ -1087,7 +1087,7 @@ provided that the following side conditions hold:
\begin{itemize}
\item $\Gamma_{P'}$ is the context obtained from $\Gamma_P$ by
replacing each $P_l$ that is an arity with $P'_l$ for $1\leq l \leq r$ (notice that
-$P_l$ arity implies $P'_l$ arity since $\WTEGLECONV{P'_l}{ \subst{P_l}{p_u}{q_u}_{u=1\ldots l-1}}$);
+$P_l$ arity implies $P'_l$ arity since $\WTELECONV{}{P'_l}{ \subst{P_l}{p_u}{q_u}_{u=1\ldots l-1}}$);
\item there are sorts $s_i$, for $1 \leq i \leq k$ such that, for
$\Gamma_{I'} = [I_1:\forall
\Gamma_{P'},(A_1)_{/s_1};\ldots;I_k:\forall \Gamma_{P'},(A_k)_{/s_k}]$
--
cgit v1.2.3
From 763723a144877582b9a5013b1c32a64de8e27db5 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 14:45:06 +0100
Subject: COMMENT: questions and to do
---
doc/refman/RefMan-cic.tex | 12 ++++++++++++
1 file changed, 12 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 37ca23417d..1781d96fe5 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1098,6 +1098,8 @@ we have $(\WTE{\Gamma_{I'};\Gamma_{P'}}{C_i}{s_{q_i}})_{i=1\ldots n}$;
\end{itemize}
\end{description}
+% QUESTION: Do we need the following paragraph?
+% (I find it confusing.)
Notice that if $I_j\,q_1\,\ldots\,q_r$ is typable using the rules {\bf
Ind-Const} and {\bf App}, then it is typable using the rule {\bf
Ind-Family}. Conversely, the extended theory is not stronger than the
@@ -1206,6 +1208,8 @@ Because we need to keep a consistent theory and also we prefer to keep
a strongly normalizing reduction, we cannot accept any sort of
recursion (even terminating). So the basic idea is to restrict
ourselves to primitive recursive functions and functionals.
+% TODO: it may be worthwhile to show the consequences of lifting
+% those restrictions.
For instance, assuming a parameter $A:\Set$ exists in the local context, we
want to build a function \length\ of type $\ListA\ra \nat$ which
@@ -1925,6 +1929,14 @@ impredicative system for sort \Set{} become:
%
% then Coq claims that 'bar' has type 'Type → Prop' where I would expect 'Type → Type' with appropriate constraint.
+% QUESTION: If I add this definition:
+%
+% Inductive foo (A:Type) : Type :=
+% | foo1 : foo A
+%
+% then Coq claims that 'foo' has type 'Type → Prop'.
+% Why?
+
% QUESTION: If I add this definition:
%
% Inductive foo (A:Type) : Type :=
--
cgit v1.2.3
From 5d32732cdf110e44a51cf6a23a8972f015e3fc88 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 15:05:47 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 1781d96fe5..9e5f18f52a 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1258,6 +1258,11 @@ But this operator is rather tedious to implement and use. We choose in
this version of {\Coq} to factorize the operator for primitive recursion
into two more primitive operations as was first suggested by Th. Coquand
in~\cite{Coq92}. One is the definition by pattern-matching. The second one is a definition by guarded fixpoints.
+% QUESTION: Shouldn't we, instead, include a more straightforward argument:
+%
+% http://matej-kosik.github.io/www/doc/coq/notes/24__match_and_fix.html
+%
+% ?
\subsubsection[The {\tt match\ldots with \ldots end} construction.]{The {\tt match\ldots with \ldots end} construction.\label{Caseexpr}
\index{match@{\tt match\ldots with\ldots end}}}
--
cgit v1.2.3
From d95fd157ac6600f4784de44ef558c4880aed624b Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 15:25:50 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 9e5f18f52a..f69b402783 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1246,6 +1246,11 @@ same as proving:
$(\haslengthA~(\Nil~A)~\nO)$ and $\forall a:A, \forall l:\ListA,
(\haslengthA~l~(\length~l)) \ra
(\haslengthA~(\cons~A~a~l)~(\nS~(\length~l)))$.
+% QUESTION: Wouldn't something like:
+%
+% http://matej-kosik.github.io/www/doc/coq/notes/25__has_length.html
+%
+% be more comprehensible?
One conceptually simple way to do that, following the basic scheme
proposed by Martin-L\"of in his Intuitionistic Type Theory, is to
--
cgit v1.2.3
From 0ad9953cfacda53dea9b08f3b5b60ee5531b0850 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 15:42:17 +0100
Subject: CLEANUP: removing duplicate paragraph
---
doc/refman/RefMan-cic.tex | 6 ------
1 file changed, 6 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index f69b402783..bea0079a5c 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1272,12 +1272,6 @@ in~\cite{Coq92}. One is the definition by pattern-matching. The second one is a
\subsubsection[The {\tt match\ldots with \ldots end} construction.]{The {\tt match\ldots with \ldots end} construction.\label{Caseexpr}
\index{match@{\tt match\ldots with\ldots end}}}
-The basic idea of this operator is that we have an object
-$m$ in an inductive type $I$ and we want to prove a property
-which possibly depends on $m$. For this, it is enough to prove the
-property for $m = (c_i~u_1\ldots u_{p_i})$ for each constructor of $I$.
-
-
The basic idea of this operator is that we have an object
$m$ in an inductive type $I$ and we want to prove a property
which possibly depends on $m$. For this, it is enough to prove the
--
cgit v1.2.3
From 42039fff68ea24ad3fff58d17d79195faa0ee3e7 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 15:46:06 +0100
Subject: FIX: "u_p" was not defined
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index bea0079a5c..34f55fa004 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1284,7 +1284,7 @@ In this expression, if
$m$ eventually happens to evaluate to $(c_i~u_1\ldots u_{p_i})$ then
the expression will behave as specified in its $i$-th branch and
it will reduce to $f_i$ where the $x_{i1}$\ldots $x_{ip_i}$ are replaced
-by the $u_1\ldots u_p$ according to the $\iota$-reduction.
+by the $u_1\ldots u_{p_i}$ according to the $\iota$-reduction.
Actually, for type-checking a \kw{match\ldots with\ldots end}
expression we also need to know the predicate $P$ to be proved by case
--
cgit v1.2.3
From 435c8b0fdf3c01d2618d1ffbbfe2321250326420 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 16:01:00 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 34f55fa004..148c4505c0 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1306,7 +1306,23 @@ The \kw{in} part can be
omitted if the result type does not depend on the arguments of
$I$. Note that the arguments of $I$ corresponding to parameters
\emph{must} be \verb!_!, because the result type is not generalized to
-all possible values of the parameters. The other arguments of $I$
+all possible values of the parameters.
+% QUESTION: The last sentence above does not seem to be accurate.
+%
+% Imagine:
+%
+% Definition foo (A:Type) (a:A) (l : list A) :=
+% match l return A with
+% | nil => a
+% | cons _ _ _ => a
+% end.
+%
+% There, the term in the return-clause happily refer to the parameter of 'l'
+% and Coq does not protest.
+%
+% So I am not sure if I really understand why parameters cannot be bound
+% in as-clause.
+The other arguments of $I$
(sometimes called indices in the litterature) have to be variables
($a$ above) and these variables can occur in $P$ and bound in it.
The expression after \kw{in}
--
cgit v1.2.3
From 7028d08eb6e08d1a1af7f8e99f2e9edd880b8da2 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 16:04:59 +0100
Subject: ENH: improving precision
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 148c4505c0..f6e9152ca2 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1295,7 +1295,7 @@ one corresponds to object $m$. \Coq{} can sometimes infer this
predicate but sometimes not. The concrete syntax for describing this
predicate uses the \kw{as\ldots in\ldots return} construction. For
instance, let us assume that $I$ is an unary predicate with one
-parameter. The predicate is made explicit using the syntax:
+parameter and one argument. The predicate is made explicit using the syntax:
\[\kw{match}~m~\kw{as}~ x~ \kw{in}~ I~\verb!_!~a~ \kw{return}~ P
~\kw{with}~ (c_1~x_{11}~...~x_{1p_1}) \Ra f_1 ~|~\ldots~|~
(c_n~x_{n1}~...~x_{np_n}) \Ra f_n \kw{end}\]
--
cgit v1.2.3
From 3ecbc485d8e00a14aa643a34a448289d0014c7a8 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 16:08:47 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index f6e9152ca2..dee31cf86d 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1323,7 +1323,9 @@ all possible values of the parameters.
% So I am not sure if I really understand why parameters cannot be bound
% in as-clause.
The other arguments of $I$
-(sometimes called indices in the litterature) have to be variables
+(sometimes called indices in the litterature)
+% QUESTION: in which literature?
+have to be variables
($a$ above) and these variables can occur in $P$ and bound in it.
The expression after \kw{in}
must be seen as an \emph{inductive type pattern}. Notice that
--
cgit v1.2.3
From 62005786bdb2e117442230c99ed8922e2c6eed81 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 16:08:55 +0100
Subject: GRAMMAR
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index dee31cf86d..2c1aedc407 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1323,7 +1323,7 @@ all possible values of the parameters.
% So I am not sure if I really understand why parameters cannot be bound
% in as-clause.
The other arguments of $I$
-(sometimes called indices in the litterature)
+(sometimes called indices in the literature)
% QUESTION: in which literature?
have to be variables
($a$ above) and these variables can occur in $P$ and bound in it.
--
cgit v1.2.3
From 740d35edcb1caf599dfbb956efd0f10aa310b5ae Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 16:10:26 +0100
Subject: CLEANUP: unnecessary
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 2c1aedc407..b3a9925b97 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1326,7 +1326,7 @@ The other arguments of $I$
(sometimes called indices in the literature)
% QUESTION: in which literature?
have to be variables
-($a$ above) and these variables can occur in $P$ and bound in it.
+($a$ above) and these variables can occur in $P$.
The expression after \kw{in}
must be seen as an \emph{inductive type pattern}. Notice that
expansion of implicit arguments and notations apply to this pattern.
--
cgit v1.2.3
From 4e8a02a38635cb33ecee78736a2661d169d52046 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 16:18:27 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 3 +++
1 file changed, 3 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index b3a9925b97..c54481e874 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1373,6 +1373,9 @@ We define now a relation \compat{I:A}{B} between an inductive
definition $I$ of type $A$ and an arity $B$. This relation states that
an object in the inductive definition $I$ can be eliminated for
proving a property $\lb a x \mto P$ of type $B$.
+% QUESTION: Is it necessary to explain the meaning of [I:A|B] in such a complicated way?
+% Couldn't we just say that: "relation [I:A|B] defines which types can we choose as 'result types'
+% with respect to the type of the matched object".
The case of inductive definitions in sorts \Set\ or \Type{} is simple.
There is no restriction on the sort of the predicate to be
--
cgit v1.2.3
From d139d73949ee7ab6c070cac98f1af23431967ab0 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 16:21:56 +0100
Subject: ENH: a forward reference to a place where the concept of "allowed
elimination sorts" is actually used
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index c54481e874..49e1649316 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1376,6 +1376,7 @@ proving a property $\lb a x \mto P$ of type $B$.
% QUESTION: Is it necessary to explain the meaning of [I:A|B] in such a complicated way?
% Couldn't we just say that: "relation [I:A|B] defines which types can we choose as 'result types'
% with respect to the type of the matched object".
+We use this concept to formulate the hypothesis of the typing rule for the match-construct.
The case of inductive definitions in sorts \Set\ or \Type{} is simple.
There is no restriction on the sort of the predicate to be
--
cgit v1.2.3
From bce5332773276bca755dd47608dd13ae09016ded Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 16:29:48 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 2 ++
1 file changed, 2 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 49e1649316..9cb52dba28 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1395,6 +1395,8 @@ $I$.
s_1 \in \{\Set,\Type(j)\},
s_2 \in \Sort}{\compat{I:s_1}{I\ra s_2}}}
\end{description}
+% QUESTION: What kind of value is represented by "x" in the "numerator"?
+% There, "x" is unbound. Isn't it?
The case of Inductive definitions of sort \Prop{} is a bit more
complicated, because of our interpretation of this sort. The only
--
cgit v1.2.3
From 55fee343ecbb6e510aa9c2729627fe7a758f384b Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 16:31:57 +0100
Subject: CLEANUP: originally, we talked about "B" as an "arity"
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 9cb52dba28..5a8dcfc245 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1372,7 +1372,7 @@ definitions.
We define now a relation \compat{I:A}{B} between an inductive
definition $I$ of type $A$ and an arity $B$. This relation states that
an object in the inductive definition $I$ can be eliminated for
-proving a property $\lb a x \mto P$ of type $B$.
+proving a property $\lb a x \mto P$ of arity $B$.
% QUESTION: Is it necessary to explain the meaning of [I:A|B] in such a complicated way?
% Couldn't we just say that: "relation [I:A|B] defines which types can we choose as 'result types'
% with respect to the type of the matched object".
--
cgit v1.2.3
From 1caa0c61b7dfd535d4b2026e83933746de19291a Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 16:42:26 +0100
Subject: TYPOGRAPHY
---
doc/refman/RefMan-cic.tex | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 5a8dcfc245..79756eb2fd 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1392,8 +1392,7 @@ $I$.
\item[Prod] \inference{\frac{\compat{(I~x):A'}{B'}}
{\compat{I:\forall x:A, A'}{\forall x:A, B'}}}
\item[{\Set} \& \Type] \inference{\frac{
- s_1 \in \{\Set,\Type(j)\},
- s_2 \in \Sort}{\compat{I:s_1}{I\ra s_2}}}
+ s_1 \in \{\Set,\Type(j)\}~~~~~~~~s_2 \in \Sort}{\compat{I:s_1}{I\ra s_2}}}
\end{description}
% QUESTION: What kind of value is represented by "x" in the "numerator"?
% There, "x" is unbound. Isn't it?
--
cgit v1.2.3
From f427a920e6fa31b145578c53d8853266cd215a26 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 16:43:58 +0100
Subject: COMMENT: note
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 79756eb2fd..7c38a54ea6 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1396,6 +1396,7 @@ $I$.
\end{description}
% QUESTION: What kind of value is represented by "x" in the "numerator"?
% There, "x" is unbound. Isn't it?
+% NOTE: Above, "Set" is subsumed in "Type(0)" so, strictly speaking, we wouldn't need to mention in explicitely.
The case of Inductive definitions of sort \Prop{} is a bit more
complicated, because of our interpretation of this sort. The only
--
cgit v1.2.3
From 6a54c04d60038fbf5b617ee76bb59216ff4038d4 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 17:20:23 +0100
Subject: GRAMMAR
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 7c38a54ea6..611782b4f6 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1450,7 +1450,7 @@ a logical property of a computational object.
In the same spirit, elimination on $P$ of type $I\ra
\Type$ cannot be allowed because it trivially implies the elimination
on $P$ of type $I\ra \Set$ by cumulativity. It also implies that there
-is two proofs of the same property which are provably different,
+are two proofs of the same property which are provably different,
contradicting the proof-irrelevance property which is sometimes a
useful axiom:
\begin{coq_example}
--
cgit v1.2.3
From c3973cc972cd1474fb4bad308197d64634a518dc Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 17:23:45 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 611782b4f6..9e11d66ab5 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1464,6 +1464,7 @@ predicate $P$ of type $I\ra \Type$ leads to a paradox when applied to
impredicative inductive definition like the second-order existential
quantifier \texttt{exProp} defined above, because it give access to
the two projections on this type.
+% QUESTION: I did not get the point of the paragraph above.
%\paragraph{Warning: strong elimination}
%\index{Elimination!Strong elimination}
--
cgit v1.2.3
From 0e7a91379a49be9874ce1669f3058fa0ae1194bb Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 5 Nov 2015 19:33:33 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 9e11d66ab5..6cd84cfc6e 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1396,6 +1396,10 @@ $I$.
\end{description}
% QUESTION: What kind of value is represented by "x" in the "numerator"?
% There, "x" is unbound. Isn't it?
+% The rule does not fully justify the following (plausible) argument:
+%
+% http://matej-kosik.github.io/www/doc/coq/notes/26__allowed_elimination_sorts.html
+%
% NOTE: Above, "Set" is subsumed in "Type(0)" so, strictly speaking, we wouldn't need to mention in explicitely.
The case of Inductive definitions of sort \Prop{} is a bit more
--
cgit v1.2.3
From c372f60433da664431a394153eaf8dbcd6f15f07 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Fri, 6 Nov 2015 11:38:51 +0100
Subject: CLEANUP: removing a superfluous index
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 6cd84cfc6e..23d86cbbc1 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1524,7 +1524,7 @@ We define a new type \CI{c:C}{P} which represents the type of the
branch corresponding to the $c:C$ constructor.
\[
\begin{array}{ll}
-\CI{c:(I_i~p_1\ldots p_r\ t_1 \ldots t_p)}{P} &\equiv (P~t_1\ldots ~t_p~c) \\[2mm]
+\CI{c:(I~p_1\ldots p_r\ t_1 \ldots t_p)}{P} &\equiv (P~t_1\ldots ~t_p~c) \\[2mm]
\CI{c:\forall~x:T,C}{P} &\equiv \forall~x:T,\CI{(c~x):C}{P}
\end{array}
\]
--
cgit v1.2.3
From 4ac0855b28c2e266f4fe2646a00754d907c3e6b3 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Fri, 6 Nov 2015 13:20:17 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 53 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 23d86cbbc1..db80d79109 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1514,6 +1514,59 @@ Extraction eq_rec.
An empty definition has no constructors, in that case also,
elimination on any sort is allowed.
+% QUESTION:
+%
+% In Coq, this works:
+%
+% Check match 42 as x return match x with
+% | O => nat
+% | _ => bool
+% end
+% with
+% | O => 42
+% | _ => true
+% end.
+%
+% Also this works:
+%
+% Check let foo := 42 in
+% match foo return match foo with
+% | O => nat
+% | _ => bool
+% end
+% with
+% | O => 42
+% | _ => true
+% end.
+%
+% But here:
+%
+% Definition foo := 42.
+% Check match foo return match foo with
+% | O => nat
+% | _ => bool
+% end
+% with
+% | O => 42
+% | _ => true
+% end.
+%
+% Coq complains:
+%
+% Error:
+% The term "42" has type "nat" while it is expected to have type
+% "match foo with
+% | 0 => nat
+% | S _ => bool
+% end".
+%
+% However, the Reference Manual says that:
+%
+% "Remark that when the term being matched is a variable, the as clause can
+% be omitted and the term being matched can serve itself as binding name in the return type."
+%
+% so I do not understand why, in this case, Coq produces a given error message.
+
\paragraph{Type of branches.}
Let $c$ be a term of type $C$, we assume $C$ is a type of constructor
for an inductive definition $I$. Let $P$ be a term that represents the
--
cgit v1.2.3
From 8efc7854332a3376a0e7ec348545cff83829a70e Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Fri, 6 Nov 2015 14:36:38 +0100
Subject: CLEANUP: We decided to call these guys E[Γ] ⊢ (Γi := Γc) as inductive
definition.
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index db80d79109..1cb0a7318e 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1622,7 +1622,7 @@ following typing rule
(\WTEG{f_i}{\CI{(c_{p_i}~q_1\ldots q_r)}{P}})_{i=1\ldots l}}
{\WTEG{\Case{P}{c}{f_1|\ldots |f_l}}{(P\ t_1\ldots t_s\ c)}}}%\\[3mm]
-provided $I$ is an inductive type in a declaration
+provided $I$ is an inductive type in a definition
\Ind{}{r}{\Gamma_I}{\Gamma_C} with
$\Gamma_C = [c_1:C_1;\ldots;c_n:C_n]$ and $c_{p_1}\ldots c_{p_l}$ are the
only constructors of $I$.
--
cgit v1.2.3
From 38fc8566ab59bcf67e6eeaf5860ce97cfab38e74 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Fri, 6 Nov 2015 15:09:34 +0100
Subject: CLEANUP PROPOSITION: does it make sense to refer to 'I' as 'inductive
definition'? Doesn't make more sense to refer to it as 'inductive type'?
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 1cb0a7318e..87ef046fa4 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1569,7 +1569,7 @@ elimination on any sort is allowed.
\paragraph{Type of branches.}
Let $c$ be a term of type $C$, we assume $C$ is a type of constructor
-for an inductive definition $I$. Let $P$ be a term that represents the
+for an inductive type $I$. Let $P$ be a term that represents the
property to be proved.
We assume $r$ is the number of parameters.
--
cgit v1.2.3
From f7051cd4eb4cefc4b2ec04c8c29369dcaf0062f2 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Fri, 6 Nov 2015 15:18:35 +0100
Subject: ENH: define the meaning of 'p'
---
doc/refman/RefMan-cic.tex | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 87ef046fa4..91c1418546 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1571,7 +1571,7 @@ elimination on any sort is allowed.
Let $c$ be a term of type $C$, we assume $C$ is a type of constructor
for an inductive type $I$. Let $P$ be a term that represents the
property to be proved.
-We assume $r$ is the number of parameters.
+We assume $r$ is the number of parameters and $p$ is the number of arguments.
We define a new type \CI{c:C}{P} which represents the type of the
branch corresponding to the $c:C$ constructor.
@@ -1584,7 +1584,7 @@ branch corresponding to the $c:C$ constructor.
We write \CI{c}{P} for \CI{c:C}{P} with $C$ the type of $c$.
\paragraph{Examples.}
-For $\ListA$ the type of $P$ will be $\ListA\ra s$ for $s \in \Sort$. \\
+For $\List \nat$ the type of $P$ will be $\ListA\ra s$ for $s \in \Sort$. \\
$ \CI{(\cons~A)}{P} \equiv
\forall a:A, \forall l:\ListA,(P~(\cons~A~a~l))$.
--
cgit v1.2.3
From 56abd3ce281e3fd8f3df27597c6348d6ab033b64 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Fri, 6 Nov 2015 16:58:22 +0100
Subject: ENH: existing example was expanded
---
doc/refman/RefMan-cic.tex | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 91c1418546..d2bae76f61 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1584,9 +1584,12 @@ branch corresponding to the $c:C$ constructor.
We write \CI{c}{P} for \CI{c:C}{P} with $C$ the type of $c$.
\paragraph{Examples.}
-For $\List \nat$ the type of $P$ will be $\ListA\ra s$ for $s \in \Sort$. \\
-$ \CI{(\cons~A)}{P} \equiv
-\forall a:A, \forall l:\ListA,(P~(\cons~A~a~l))$.
+For $\List~\nat$ the type of $P$ will be $\List~\nat\ra s$ for $s \in \Sort$. \\
+$ \CI{(\cons~\nat)}{P}
+ \equiv\CI{(\cons~\nat) : (\nat\ra\List~\nat\ra\List~\nat)}{P} \equiv\\
+ \equiv\forall n:\nat, \CI{(\cons~\nat~n) : \List~\nat\ra\List~\nat)}{P} \equiv\\
+ \equiv\forall n:\nat, \forall l:\List~\nat, \CI{(\cons~\nat~n~l) : \List~\nat)}{P} \equiv\\
+\equiv\forall n:\nat, \forall l:\List~\nat,(P~(\cons~\nat~n~l))$.
For $\haslengthA$, the type of $P$ will be
$\forall l:\ListA,\forall n:\nat, (\haslengthA~l~n)\ra \Prop$ and the expression
--
cgit v1.2.3
From a388d599ba461cf35b40c3850d593f5e9bb71d3d Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Fri, 6 Nov 2015 16:58:44 +0100
Subject: CLEANUP: Existing example was removed.
We have expanded the example above.
For consistency reasons, it would make sense to do the same also for this example.
However, due to the size of the terms, it is hard to typeset it nicely.
I propose to remove it.
---
doc/refman/RefMan-cic.tex | 10 ----------
1 file changed, 10 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index d2bae76f61..87d6f1d28e 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1591,16 +1591,6 @@ $ \CI{(\cons~\nat)}{P}
\equiv\forall n:\nat, \forall l:\List~\nat, \CI{(\cons~\nat~n~l) : \List~\nat)}{P} \equiv\\
\equiv\forall n:\nat, \forall l:\List~\nat,(P~(\cons~\nat~n~l))$.
-For $\haslengthA$, the type of $P$ will be
-$\forall l:\ListA,\forall n:\nat, (\haslengthA~l~n)\ra \Prop$ and the expression
-\CI{(\conshl~A)}{P} is defined as:\\
-$\forall a:A, \forall l:\ListA, \forall n:\nat, \forall
-h:(\haslengthA~l~n), (P~(\cons~A~a~l)~(\nS~n)~(\conshl~A~a~l~n~l))$.\\
-If $P$ does not depend on its third argument, we find the more natural
-expression:\\
-$\forall a:A, \forall l:\ListA, \forall n:\nat,
-(\haslengthA~l~n)\ra(P~(\cons~A~a~l)~(\nS~n))$.
-
\paragraph{Typing rule.}
Our very general destructor for inductive definition enjoys the
--
cgit v1.2.3
From 59b4ea72a6896e05c4b6094b10b9a294b0322e53 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Fri, 6 Nov 2015 18:55:49 +0100
Subject: ENH: an existing example was further expanded.
---
doc/refman/RefMan-cic.tex | 33 +++++++++++++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 87d6f1d28e..edf7840fdd 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1583,13 +1583,42 @@ branch corresponding to the $c:C$ constructor.
\]
We write \CI{c}{P} for \CI{c:C}{P} with $C$ the type of $c$.
-\paragraph{Examples.}
-For $\List~\nat$ the type of $P$ will be $\List~\nat\ra s$ for $s \in \Sort$. \\
+\paragraph{Example.}
+The following term in concrete syntax:
+\begin{verbatim}
+match t as l return P' with
+| nil _ => t1
+| cons _ hd tl => t2
+end
+\end{verbatim}
+can be represented in abstract syntax as $$\Case{P}{t}{f_1\,|\,f_2}$$
+where
+\begin{eqnarray*}
+ P & = & \lambda~l~.~P^\prime\\
+ f_1 & = & t_1\\
+ f_2 & = & \lambda~(hd:\nat)~.~\lambda~(tl:\List~\nat)~.~t_2
+\end{eqnarray*}
+According to the definition:
+\begin{latexonly}\vskip.5em\noindent\end{latexonly}%
+\begin{htmlonly}
+
+\end{htmlonly}
+$ \CI{(\Nil~\nat)}{P} \equiv \CI{(\Nil~\nat) : (\List~\nat)}{P} \equiv (P~(\Nil~\nat))$
+\begin{latexonly}\vskip.5em\noindent\end{latexonly}%
+\begin{htmlonly}
+
+\end{htmlonly}
$ \CI{(\cons~\nat)}{P}
\equiv\CI{(\cons~\nat) : (\nat\ra\List~\nat\ra\List~\nat)}{P} \equiv\\
\equiv\forall n:\nat, \CI{(\cons~\nat~n) : \List~\nat\ra\List~\nat)}{P} \equiv\\
\equiv\forall n:\nat, \forall l:\List~\nat, \CI{(\cons~\nat~n~l) : \List~\nat)}{P} \equiv\\
\equiv\forall n:\nat, \forall l:\List~\nat,(P~(\cons~\nat~n~l))$.
+\begin{latexonly}\vskip.5em\noindent\end{latexonly}%
+\begin{htmlonly}
+
+\end{htmlonly}
+Given some $P$, then \CI{(\Nil~\nat)}{P} represents the expected type of $f_1$, and
+\CI{(\cons~\nat)}{P} represents the expected type of $f_2$.
\paragraph{Typing rule.}
--
cgit v1.2.3
From 793a5842cf7adeff60c380738a7d4bd3430e926a Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Fri, 6 Nov 2015 19:49:05 +0100
Subject: ENH: existing example was changed so that it is now linked to the
results shown in the previous example
---
doc/refman/RefMan-cic.tex | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index edf7840fdd..d512df3b78 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1651,13 +1651,17 @@ only constructors of $I$.
\end{description}
\paragraph{Example.}
-For \List\ and \haslength\ the typing rules for the {\tt match} expression
-are (writing just $t:M$ instead of \WTEG{t}{M}, the global environment and
-local context being the same in all the judgments).
-\[\frac{l:\ListA~~P:\ListA\ra s~~~f_1:(P~(\Nil~A))~~
- f_2:\forall a:A, \forall l:\ListA, (P~(\cons~A~a~l))}
- {\Case{P}{l}{f_1~|~f_2}:(P~l)}\]
+Below is a typing rule for the term shown in the previous example:
+\inference{
+ \frac{%
+ \WTEG{t}{(\List~\nat)}~~~~%
+ \WTEG{P}{B}~~~~%
+ \compat{(\List~\nat)}{B}~~~~%
+ \WTEG{f_1}{\CI{(\Nil~\nat)}{P}}~~~~%
+ \WTEG{f_2}{\CI{(\cons~\nat)}{P}}%
+ }
+{\WTEG{\Case{P}{t}{f_1|f_2}}{(P~t)}}}
\[\frac{
\begin{array}[b]{@{}c@{}}
--
cgit v1.2.3
From 07b9d5bc3c54e849b95f2b8dd223896e64614954 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Fri, 6 Nov 2015 19:50:08 +0100
Subject: CLEANUP PROPOSITION: existing example was removed because it is not
urgently needed
---
doc/refman/RefMan-cic.tex | 10 ----------
1 file changed, 10 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index d512df3b78..e5307ef1ec 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1663,16 +1663,6 @@ Below is a typing rule for the term shown in the previous example:
}
{\WTEG{\Case{P}{t}{f_1|f_2}}{(P~t)}}}
-\[\frac{
- \begin{array}[b]{@{}c@{}}
-H:(\haslengthA~L~N) \\ P:\forall l:\ListA, \forall n:\nat, (\haslengthA~l~n)\ra
- \Prop\\
- f_1:(P~(\Nil~A)~\nO~\nilhl) \\
- f_2:\forall a:A, \forall l:\ListA, \forall n:\nat, \forall
- h:(\haslengthA~l~n), (P~(\cons~A~a~n)~(\nS~n)~(\conshl~A~a~l~n~h))
- \end{array}}
- {\Case{P}{H}{f_1~|~f_2}:(P~L~N~H)}\]
-
\paragraph[Definition of $\iota$-reduction.]{Definition of $\iota$-reduction.\label{iotared}
\index{iota-reduction@$\iota$-reduction}}
We still have to define the $\iota$-reduction in the general case.
--
cgit v1.2.3
From 43816ce712054c07cb04452821570054aff3dc44 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Sat, 7 Nov 2015 15:37:39 +0100
Subject: CLEANUP PROPOSITION: rephrasing the original idea in a simpler way
---
doc/refman/RefMan-cic.tex | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index e5307ef1ec..2a4ccfed87 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -242,7 +242,7 @@ either $x:T$ is an assumption in $\Gamma$ or that there exists some $t$ such
that $x:=t:T$ is a definition in $\Gamma$. If $\Gamma$ defines some
$x:=t:T$, we also write $(x:=t:T) \in \Gamma$.
For the rest of the chapter, the
-notation $\Gamma::(y:T)$ (resp. $\Gamma::(y:=t:T)$) denotes the local context
+notation $\Gamma::(y:T)$ (resp.\ $\Gamma::(y:=t:T)$) denotes the local context
$\Gamma$ enriched with the declaration $y:T$ (resp. $y:=t:T$). The
notation $[]$ denotes the empty local context.
@@ -1708,7 +1708,7 @@ The typing rule is the expected one for a fixpoint.
\end{description}
Any fixpoint definition cannot be accepted because non-normalizing terms
-will lead to proofs of absurdity.
+allow proofs of absurdity.
The basic scheme of recursion that should be allowed is the one needed for
defining primitive
--
cgit v1.2.3
From 33c0d3b95bdf0ff1fdd2d6dbe7088e48c2fa6f67 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Sat, 7 Nov 2015 16:01:27 +0100
Subject: GRAMMAR: added punctuation
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 2a4ccfed87..092dba46b4 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1738,7 +1738,7 @@ The first stage is to precise on which argument the fixpoint will be
decreasing. The type of this argument should be an inductive
definition.
-For doing this the syntax of fixpoints is extended and becomes
+For doing this, the syntax of fixpoints is extended and becomes
\[\Fix{f_i}{f_1/k_1:A_1:=t_1 \ldots f_n/k_n:A_n:=t_n}\]
where $k_i$ are positive integers.
Each $A_i$ should be a type (reducible to a term) starting with at least
--
cgit v1.2.3
From 2cb48a3fe5a8cd435e4e0ad6990e5ee5e6079fa5 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Sat, 7 Nov 2015 16:17:44 +0100
Subject: COMMENT: to do
---
doc/refman/RefMan-cic.tex | 2 ++
1 file changed, 2 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 092dba46b4..3d56dcac60 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1745,6 +1745,8 @@ Each $A_i$ should be a type (reducible to a term) starting with at least
$k_i$ products $\forall y_1:B_1,\ldots \forall y_{k_i}:B_{k_i}, A'_i$
and $B_{k_i}$
being an instance of an inductive definition.
+% TODO: We should probably define somewhere explicitely, what we mean by
+% "x is an instance of an inductive type I".
Now in the definition $t_i$, if $f_j$ occurs then it should be applied
to at least $k_j$ arguments and the $k_j$-th argument should be
--
cgit v1.2.3
From fc8e19c82a24fea551b47a99bb68f6f64fc16a01 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Sat, 7 Nov 2015 17:30:07 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 2 ++
1 file changed, 2 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 3d56dcac60..8c8537cfb2 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1747,6 +1747,8 @@ and $B_{k_i}$
being an instance of an inductive definition.
% TODO: We should probably define somewhere explicitely, what we mean by
% "x is an instance of an inductive type I".
+%
+% QUESTION: So, $k_i$ is the index of the argument on which $f_i$ is decreasing?
Now in the definition $t_i$, if $f_j$ occurs then it should be applied
to at least $k_j$ arguments and the $k_j$-th argument should be
--
cgit v1.2.3
From 02be0f4e071c12800177eecdb067949dcce3b174 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Sat, 7 Nov 2015 18:06:41 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 8c8537cfb2..1a17f3f35f 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1764,7 +1764,9 @@ $\forall p_1:P_1,\ldots \forall p_r:P_r,
\forall x_1:T_1, \ldots \forall x_r:T_r, (I_j~p_1\ldots
p_r~t_1\ldots t_s)$ the recursive arguments will correspond to $T_i$ in
which one of the $I_l$ occurs.
-
+% QUESTION: The last sentence above really fully make sense.
+% Isn't some word missing?
+% Maybe "if"?
The main rules for being structurally smaller are the following:\\
Given a variable $y$ of type an inductive
--
cgit v1.2.3
From 0f97c5d4429e1f191b89125caa1ed652b0f19c79 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Sat, 7 Nov 2015 18:08:01 +0100
Subject: TYPOGRAPHY
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 1a17f3f35f..66111fa708 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1776,7 +1776,7 @@ where $\Gamma_I$ is $[I_1:A_1;\ldots;I_k:A_k]$, and $\Gamma_C$ is
$[c_1:C_1;\ldots;c_n:C_n]$.
The terms structurally smaller than $y$ are:
\begin{itemize}
-\item $(t~u), \lb x:u \mto t$ when $t$ is structurally smaller than $y$ .
+\item $(t~u)$ and $\lb x:u \mto t$ when $t$ is structurally smaller than $y$.
\item \Case{P}{c}{f_1\ldots f_n} when each $f_i$ is structurally
smaller than $y$. \\
If $c$ is $y$ or is structurally smaller than $y$, its type is an inductive
--
cgit v1.2.3
From cbdceb06359e10a4cad7f9ec5a505d0afcd76677 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Sat, 7 Nov 2015 18:22:59 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 66111fa708..3cb0b95700 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1782,6 +1782,7 @@ The terms structurally smaller than $y$ are:
If $c$ is $y$ or is structurally smaller than $y$, its type is an inductive
definition $I_p$ part of the inductive
declaration corresponding to $y$.
+ % QUESTION: What does the above sentence mean?
Each $f_i$ corresponds to a type of constructor $C_q \equiv
\forall p_1:P_1,\ldots,\forall p_r:P_r, \forall y_1:B_1, \ldots \forall y_k:B_k, (I~a_1\ldots a_k)$
and can consequently be
--
cgit v1.2.3
From 6d5a8e69517276d1d13275533aee9fceb42b9d13 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Sat, 7 Nov 2015 18:26:59 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 3 +++
1 file changed, 3 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 3cb0b95700..736affe940 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1792,6 +1792,9 @@ The terms structurally smaller than $y$ are:
in $g_i$ corresponding to recursive arguments $B_i$ (the ones in
which one of the $I_l$ occurs) are structurally smaller than $y$.
\end{itemize}
+% QUESTION: How could one show, that some of the functions defined below are "guarded"
+% in a sense of the definition given above.
+% E.g., how could I show that "p" in "plus" below is structurally smaller than "n"?
The following definitions are correct, we enter them using the
{\tt Fixpoint} command as described in Section~\ref{Fixpoint} and show
the internal representation.
--
cgit v1.2.3
From 55fe005b2141a69ffd9589568f8b854075174d56 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Sat, 7 Nov 2015 18:49:37 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 736affe940..29e4f256bb 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1858,6 +1858,7 @@ reflexivity.
\begin{coq_eval}
Abort.
\end{coq_eval}
+% QUESTION: What are we trying to say with the above examples?
% La disparition de Program devrait rendre la construction Match obsolete
% \subsubsection{The {\tt Match \ldots with \ldots end} expression}
--
cgit v1.2.3
From 796c433f5da19511ddc5de3d2cbec878ac3d25fc Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Sat, 7 Nov 2015 23:59:30 +0100
Subject: COMMENT: question
---
doc/refman/RefMan-cic.tex | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 29e4f256bb..39b7d4f156 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1828,6 +1828,7 @@ The reduction for fixpoints is:
\[ (\Fix{f_i}{F}~a_1\ldots
a_{k_i}) \triangleright_{\iota} \substs{t_i}{f_k}{\Fix{f_k}{F}}{k=1\ldots n}
~a_1\ldots a_{k_i}\]
+% QUESTION: Is it wise to use \iota for twice with two different meanings?
when $a_{k_i}$ starts with a constructor.
This last restriction is needed in order to keep strong normalization
and corresponds to the reduction for primitive recursive operators.
--
cgit v1.2.3
From 67d0db55d55dd2c650a33f11794e8a6747fc518b Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 9 Nov 2015 16:33:12 +0100
Subject: DONE
---
doc/refman/RefMan-cic.tex | 216 ++++------------------------------------------
1 file changed, 16 insertions(+), 200 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 39b7d4f156..2f4016d71e 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -63,11 +63,6 @@ Their properties, such as:
{\Prop:\Type$(1)$}, {\Set:\Type$(1)$}, and {\Type$(i)$:\Type$(i+1)$},
are defined in Section~\ref{subtyping-rules}.
-% TODO: Somewhere in the document we should explain:
-% - what concrete actions (in *.v files) cause creation of new universes
-% - different kinds of relationships between universes (i.e. "max" and "succ")
-% - what are all the actions (in *.v files) from which those relationships arise
-
The user does not have to mention explicitly the index $i$ when referring to
the universe \Type$(i)$. One only writes \Type. The
system itself generates for each instance of \Type\ a new
@@ -94,17 +89,6 @@ constraints must remain acyclic. Typing expressions that violate the
acyclicity of the graph of constraints results in a \errindex{Universe
inconsistency} error (see also Section~\ref{PrintingUniverses}).
-% TODO: The concept of 'universe inconsistency' deserves more attention.
-% Somewhere in the document we should:
-% - give concrete examples when universe inconsistency arises
-% - explain why it arised
-% - how can a user identify the "vicious cycle".
-
-% QUESTION: Is the presentation of universes as totally ordered a necessary or advantageous step?
-
-% QUESTION: Shouldn't the explanation of universes in this chapter
-% be consolidatd with Chapter 29: Polymorphic Universes?
-
%% HH: This looks to me more like source of confusion than helpful
%% \subsection{Constants}
@@ -184,7 +168,6 @@ More precisely the language of the {\em Calculus of Inductive
The notion of free variables is defined as usual. In the expressions
$\lb x:T\mto U$ and $\forall x:T, U$ the occurrences of $x$ in $U$
are bound.
-% TODO: what is the best play to say that "terms are considered equal up to α-conversion"?
\paragraph[Substitution.]{Substitution.\index{Substitution}}
The notion of substituting a term $t$ to free occurrences of a
@@ -241,10 +224,11 @@ we write $x \in \Gamma$. By writing $(x:T) \in \Gamma$ we mean that
either $x:T$ is an assumption in $\Gamma$ or that there exists some $t$ such
that $x:=t:T$ is a definition in $\Gamma$. If $\Gamma$ defines some
$x:=t:T$, we also write $(x:=t:T) \in \Gamma$.
-For the rest of the chapter, the
-notation $\Gamma::(y:T)$ (resp.\ $\Gamma::(y:=t:T)$) denotes the local context
-$\Gamma$ enriched with the declaration $y:T$ (resp. $y:=t:T$). The
-notation $[]$ denotes the empty local context.
+For the rest of the chapter, the $\Gamma::(y:T)$ denotes the local context
+$\Gamma$ enriched with the local assumption $y:T$.
+Similarly, $\Gamma::(y:=t:T)$ denotes the local context
+$\Gamma$ enriched with the local definition $(y:=t:T)$.
+The notation $[]$ denotes the empty local context.
% Does not seem to be used further...
% Si dans l'explication WF(E)[Gamma] concernant les constantes
@@ -305,23 +289,16 @@ local context $\Gamma$ and a term $T$ such that the judgment \WTEG{t}{T} can
be derived from the following rules.
\begin{description}
\item[W-Empty] \inference{\WF{[]}{}}
-% QUESTION: Why in W-Local-Assum and W-Local-Def we do not need x ∉ E hypothesis?
\item[W-Local-Assum] % Ce n'est pas vrai : x peut apparaitre plusieurs fois dans Gamma
\inference{\frac{\WTEG{T}{s}~~~~s \in \Sort~~~~x \not\in \Gamma % \cup E
}{\WFE{\Gamma::(x:T)}}}
\item[W-Local-Def]
\inference{\frac{\WTEG{t}{T}~~~~x \not\in \Gamma % \cup E
}{\WFE{\Gamma::(x:=t:T)}}}
-% QUESTION: Why in W-Global-Assum and W-Global-Def we do not need x ∉ Γ hypothesis?
\item[W-Global-Assum] \inference{\frac{\WTE{}{T}{s}~~~~s \in \Sort~~~~c \notin E}
{\WF{E;c:T}{}}}
\item[W-Global-Def] \inference{\frac{\WTE{}{t}{T}~~~c \notin E}
{\WF{E;c:=t:T}{}}}
-% QUESTION: Why, in case of W-Local-Assum and W-Global-Assum we need s ∈ S hypothesis.
-% QUESTION: At the moment, enrichment of a local context is denoted with ∷
-% whereas enrichment of the global environment is denoted with ;
-% Is it necessary to use two different notations?
-% Couldn't we use ∷ also for enrichment of the global context?
\item[Ax-Prop] \index{Typing rules!Ax-Prop}
\inference{\frac{\WFE{\Gamma}}{\WTEG{\Prop}{\Type(1)}}}
\item[Ax-Set] \index{Typing rules!Ax-Set}
@@ -366,7 +343,6 @@ difference between {\Prop} and {\Set}:
well-typed without having $((\lb x:T\mto u)~t)$ well-typed (where
$T$ is a type of $t$). This is because the value $t$ associated to $x$
may be used in a conversion rule (see Section~\ref{conv-rules}).
-% QUESTION: I do not understand. How would that be possible?
\section[Conversion rules]{Conversion rules\index{Conversion rules}
\label{conv-rules}}
@@ -815,7 +791,6 @@ $\begin{array}{@{} l}
\subsection{Well-formed inductive definitions}
We cannot accept any inductive declaration because some of them lead
to inconsistent systems.
-% TODO: The statement above deserves explanation.
We restrict ourselves to definitions which
satisfy a syntactic criterion of positivity. Before giving the formal
rules, we need a few definitions:
@@ -843,9 +818,6 @@ in one of the following two cases:
\item $T$ is $(I~t_1\ldots ~t_n)$
\item $T$ is $\forall x:U,T^\prime$ where $T^\prime$ is also a type of constructor of $I$
\end{itemize}
-% QUESTION: Are we above sufficiently precise?
-% Shouldn't we say also what is "n"?
-% "n" couldn't be "0", could it?
\paragraph[Examples]{Examples}
$\nat$ and $\nat\ra\nat$ are types of constructors of $\nat$.\\
@@ -854,11 +826,9 @@ $\forall A:\Type,\List~A$ and $\forall A:\Type,A\ra\List~A\ra\List~A$ are constr
\paragraph[Definition]{Definition\index{Positivity}\label{Positivity}}
The type of constructor $T$ will be said to {\em satisfy the positivity
condition} for a constant $X$ in the following cases:
-% QUESTION: Why is this property called "positivity"?
\begin{itemize}
\item $T=(X~t_1\ldots ~t_n)$ and $X$ does not occur free in
-% QUESTIONS: What is the meaning of 'n' above?
any $t_i$
\item $T=\forall~x:U,V$ and $X$ occurs only strictly positively in $U$ and
the type $V$ satisfies the positivity condition for $X$
@@ -870,12 +840,10 @@ following cases:
\begin{itemize}
\item $X$ does not occur in $T$
\item $T$ converts to $(X~t_1 \ldots ~t_n)$ and $X$ does not occur in
-% QUESTIONS: What is the meaning of 'n' above?
any of $t_i$
\item $T$ converts to $\forall~x:U,V$ and $X$ does not occur in
type $U$ but occurs strictly positively in type $V$
\item $T$ converts to $(I~a_1 \ldots ~a_m ~ t_1 \ldots ~t_p)$ where
-% QUESTIONS: What is the meaning of 'p' above?
$I$ is the name of an inductive declaration of the form
$\Ind{\Gamma}{m}{I:A}{c_1:\forall p_1:P_1,\ldots \forall
p_m:P_m,C_1;\ldots;c_n:\forall p_1:P_1,\ldots \forall
@@ -898,7 +866,6 @@ cases:
\item $T=(I~b_1\ldots b_m~u_1\ldots ~u_{p})$, $I$ is an inductive
definition with $m$ parameters and $X$ does not occur in
any $u_i$
-% QUESTIONS: What is the meaning of 'p' above?
\item $T=\forall~x:U,V$ and $X$ occurs only strictly positively in $U$ and
the type $V$ satisfies the nested positivity condition for $X$
\end{itemize}
@@ -969,10 +936,6 @@ the type $V$ satisfies the nested positivity condition for $X$
\end{latexonly}
\paragraph{Correctness rules.}
-% QUESTION: For a related problem, in case of global definitions
-% and global assumptions, we used the term "well-formedness".
-% Couldn't we continue to use the term also here?
-% Does it make sense to use a different name, i.e. "correctness" in this case?
We shall now describe the rules allowing the introduction of a new
inductive definition.
@@ -999,7 +962,6 @@ provided that the following side conditions hold:
$I_{q_i}$ which satisfies the positivity condition for $I_1 \ldots I_k$
and $c_i \notin \Gamma \cup E$.
\end{itemize}
-% TODO: justify the above constraints
\end{description}
One can remark that there is a constraint between the sort of the
arity of the inductive type and the sort of the type of its
@@ -1007,7 +969,6 @@ constructors which will always be satisfied for the impredicative sort
{\Prop} but may fail to define inductive definition
on sort \Set{} and generate constraints between universes for
inductive definitions in the {\Type} hierarchy.
-% QUESTION: which 'constraint' are we above referring to?
\paragraph{Examples.}
It is well known that existential quantifier can be encoded as an
@@ -1025,7 +986,6 @@ The same definition on \Set{} is not allowed and fails:
Fail Inductive exSet (P:Set->Prop) : Set
:= exS_intro : forall X:Set, P X -> exSet P.
\end{coq_example}
-% TODO: add the description of the 'Fail' command to the reference manual
It is possible to declare the same inductive definition in the
universe \Type.
The \texttt{exType} inductive definition has type $(\Type_i \ra\Prop)\ra
@@ -1044,7 +1004,6 @@ Inductive exType (P:Type->Prop) : Type
Inductive types declared in {\Type} are
polymorphic over their arguments in {\Type}.
-% QUESTION: Just arguments? Not also over the parameters?
If $A$ is an arity of some sort and $s$ is a sort, we write $A_{/s}$ for the arity
obtained from $A$ by replacing its sort with $s$. Especially, if $A$
@@ -1093,13 +1052,10 @@ $P_l$ arity implies $P'_l$ arity since $\WTELECONV{}{P'_l}{ \subst{P_l}{p_u}{q_u
\Gamma_{P'},(A_1)_{/s_1};\ldots;I_k:\forall \Gamma_{P'},(A_k)_{/s_k}]$
we have $(\WTE{\Gamma_{I'};\Gamma_{P'}}{C_i}{s_{q_i}})_{i=1\ldots n}$;
\item the sorts are such that all eliminations, to {\Prop}, {\Set} and
- $\Type(j)$, are allowed (see section~\ref{elimdep}).
-% QUESTION: How should I interpret the above side-condition, when I am trying to show that 'list nat : Set'?
+ $\Type(j)$, are allowed (see Section~\ref{allowedeleminationofsorts}).
\end{itemize}
\end{description}
-% QUESTION: Do we need the following paragraph?
-% (I find it confusing.)
Notice that if $I_j\,q_1\,\ldots\,q_r$ is typable using the rules {\bf
Ind-Const} and {\bf App}, then it is typable using the rule {\bf
Ind-Family}. Conversely, the extended theory is not stronger than the
@@ -1142,7 +1098,6 @@ singleton -- see paragraph~\ref{singleton}) is set in
{\Prop}, a small non-singleton inductive type is set in {\Set} (even
in case {\Set} is impredicative -- see Section~\ref{impredicativity}),
and otherwise in the {\Type} hierarchy.
-% TODO: clarify the case of a partial application ??
Note that the side-condition about allowed elimination sorts in the
rule~{\bf Ind-Family} is just to avoid to recompute the allowed
@@ -1208,8 +1163,6 @@ Because we need to keep a consistent theory and also we prefer to keep
a strongly normalizing reduction, we cannot accept any sort of
recursion (even terminating). So the basic idea is to restrict
ourselves to primitive recursive functions and functionals.
-% TODO: it may be worthwhile to show the consequences of lifting
-% those restrictions.
For instance, assuming a parameter $A:\Set$ exists in the local context, we
want to build a function \length\ of type $\ListA\ra \nat$ which
@@ -1246,11 +1199,6 @@ same as proving:
$(\haslengthA~(\Nil~A)~\nO)$ and $\forall a:A, \forall l:\ListA,
(\haslengthA~l~(\length~l)) \ra
(\haslengthA~(\cons~A~a~l)~(\nS~(\length~l)))$.
-% QUESTION: Wouldn't something like:
-%
-% http://matej-kosik.github.io/www/doc/coq/notes/25__has_length.html
-%
-% be more comprehensible?
One conceptually simple way to do that, following the basic scheme
proposed by Martin-L\"of in his Intuitionistic Type Theory, is to
@@ -1263,11 +1211,6 @@ But this operator is rather tedious to implement and use. We choose in
this version of {\Coq} to factorize the operator for primitive recursion
into two more primitive operations as was first suggested by Th. Coquand
in~\cite{Coq92}. One is the definition by pattern-matching. The second one is a definition by guarded fixpoints.
-% QUESTION: Shouldn't we, instead, include a more straightforward argument:
-%
-% http://matej-kosik.github.io/www/doc/coq/notes/24__match_and_fix.html
-%
-% ?
\subsubsection[The {\tt match\ldots with \ldots end} construction.]{The {\tt match\ldots with \ldots end} construction.\label{Caseexpr}
\index{match@{\tt match\ldots with\ldots end}}}
@@ -1307,24 +1250,9 @@ omitted if the result type does not depend on the arguments of
$I$. Note that the arguments of $I$ corresponding to parameters
\emph{must} be \verb!_!, because the result type is not generalized to
all possible values of the parameters.
-% QUESTION: The last sentence above does not seem to be accurate.
-%
-% Imagine:
-%
-% Definition foo (A:Type) (a:A) (l : list A) :=
-% match l return A with
-% | nil => a
-% | cons _ _ _ => a
-% end.
-%
-% There, the term in the return-clause happily refer to the parameter of 'l'
-% and Coq does not protest.
-%
-% So I am not sure if I really understand why parameters cannot be bound
-% in as-clause.
The other arguments of $I$
(sometimes called indices in the literature)
-% QUESTION: in which literature?
+% NOTE: e.g. http://www.qatar.cmu.edu/~sacchini/papers/types08.pdf
have to be variables
($a$ above) and these variables can occur in $P$.
The expression after \kw{in}
@@ -1364,6 +1292,7 @@ compact notation:
% \mbox{\tt =>}~ \false}
\paragraph[Allowed elimination sorts.]{Allowed elimination sorts.\index{Elimination sorts}}
+\label{allowedeleminationofsorts}
An important question for building the typing rule for \kw{match} is
what can be the type of $\lb a x \mto P$ with respect to the type of the inductive
@@ -1373,34 +1302,26 @@ We define now a relation \compat{I:A}{B} between an inductive
definition $I$ of type $A$ and an arity $B$. This relation states that
an object in the inductive definition $I$ can be eliminated for
proving a property $\lb a x \mto P$ of arity $B$.
-% QUESTION: Is it necessary to explain the meaning of [I:A|B] in such a complicated way?
-% Couldn't we just say that: "relation [I:A|B] defines which types can we choose as 'result types'
-% with respect to the type of the matched object".
+% TODO: The meaning of [I:A|B] relation is not trivial,
+% but I do not think that we must explain it in as complicated way as we do above.
We use this concept to formulate the hypothesis of the typing rule for the match-construct.
-The case of inductive definitions in sorts \Set\ or \Type{} is simple.
-There is no restriction on the sort of the predicate to be
-eliminated.
-
\paragraph{Notations.}
The \compat{I:A}{B} is defined as the smallest relation satisfying the
following rules:
We write \compat{I}{B} for \compat{I:A}{B} where $A$ is the type of
$I$.
+The case of inductive definitions in sorts \Set\ or \Type{} is simple.
+There is no restriction on the sort of the predicate to be
+eliminated.
+
\begin{description}
\item[Prod] \inference{\frac{\compat{(I~x):A'}{B'}}
{\compat{I:\forall x:A, A'}{\forall x:A, B'}}}
\item[{\Set} \& \Type] \inference{\frac{
s_1 \in \{\Set,\Type(j)\}~~~~~~~~s_2 \in \Sort}{\compat{I:s_1}{I\ra s_2}}}
\end{description}
-% QUESTION: What kind of value is represented by "x" in the "numerator"?
-% There, "x" is unbound. Isn't it?
-% The rule does not fully justify the following (plausible) argument:
-%
-% http://matej-kosik.github.io/www/doc/coq/notes/26__allowed_elimination_sorts.html
-%
-% NOTE: Above, "Set" is subsumed in "Type(0)" so, strictly speaking, we wouldn't need to mention in explicitely.
The case of Inductive definitions of sort \Prop{} is a bit more
complicated, because of our interpretation of this sort. The only
@@ -1468,7 +1389,6 @@ predicate $P$ of type $I\ra \Type$ leads to a paradox when applied to
impredicative inductive definition like the second-order existential
quantifier \texttt{exProp} defined above, because it give access to
the two projections on this type.
-% QUESTION: I did not get the point of the paragraph above.
%\paragraph{Warning: strong elimination}
%\index{Elimination!Strong elimination}
@@ -1514,59 +1434,6 @@ Extraction eq_rec.
An empty definition has no constructors, in that case also,
elimination on any sort is allowed.
-% QUESTION:
-%
-% In Coq, this works:
-%
-% Check match 42 as x return match x with
-% | O => nat
-% | _ => bool
-% end
-% with
-% | O => 42
-% | _ => true
-% end.
-%
-% Also this works:
-%
-% Check let foo := 42 in
-% match foo return match foo with
-% | O => nat
-% | _ => bool
-% end
-% with
-% | O => 42
-% | _ => true
-% end.
-%
-% But here:
-%
-% Definition foo := 42.
-% Check match foo return match foo with
-% | O => nat
-% | _ => bool
-% end
-% with
-% | O => 42
-% | _ => true
-% end.
-%
-% Coq complains:
-%
-% Error:
-% The term "42" has type "nat" while it is expected to have type
-% "match foo with
-% | 0 => nat
-% | S _ => bool
-% end".
-%
-% However, the Reference Manual says that:
-%
-% "Remark that when the term being matched is a variable, the as clause can
-% be omitted and the term being matched can serve itself as binding name in the return type."
-%
-% so I do not understand why, in this case, Coq produces a given error message.
-
\paragraph{Type of branches.}
Let $c$ be a term of type $C$, we assume $C$ is a type of constructor
for an inductive type $I$. Let $P$ be a term that represents the
@@ -1741,14 +1608,10 @@ definition.
For doing this, the syntax of fixpoints is extended and becomes
\[\Fix{f_i}{f_1/k_1:A_1:=t_1 \ldots f_n/k_n:A_n:=t_n}\]
where $k_i$ are positive integers.
+Each $k_i$ represents the index of pararameter of $f_i$, on which $f_i$ is decreasing.
Each $A_i$ should be a type (reducible to a term) starting with at least
$k_i$ products $\forall y_1:B_1,\ldots \forall y_{k_i}:B_{k_i}, A'_i$
-and $B_{k_i}$
-being an instance of an inductive definition.
-% TODO: We should probably define somewhere explicitely, what we mean by
-% "x is an instance of an inductive type I".
-%
-% QUESTION: So, $k_i$ is the index of the argument on which $f_i$ is decreasing?
+and $B_{k_i}$ an is unductive type.
Now in the definition $t_i$, if $f_j$ occurs then it should be applied
to at least $k_j$ arguments and the $k_j$-th argument should be
@@ -1764,9 +1627,6 @@ $\forall p_1:P_1,\ldots \forall p_r:P_r,
\forall x_1:T_1, \ldots \forall x_r:T_r, (I_j~p_1\ldots
p_r~t_1\ldots t_s)$ the recursive arguments will correspond to $T_i$ in
which one of the $I_l$ occurs.
-% QUESTION: The last sentence above really fully make sense.
-% Isn't some word missing?
-% Maybe "if"?
The main rules for being structurally smaller are the following:\\
Given a variable $y$ of type an inductive
@@ -1782,7 +1642,6 @@ The terms structurally smaller than $y$ are:
If $c$ is $y$ or is structurally smaller than $y$, its type is an inductive
definition $I_p$ part of the inductive
declaration corresponding to $y$.
- % QUESTION: What does the above sentence mean?
Each $f_i$ corresponds to a type of constructor $C_q \equiv
\forall p_1:P_1,\ldots,\forall p_r:P_r, \forall y_1:B_1, \ldots \forall y_k:B_k, (I~a_1\ldots a_k)$
and can consequently be
@@ -1792,9 +1651,6 @@ The terms structurally smaller than $y$ are:
in $g_i$ corresponding to recursive arguments $B_i$ (the ones in
which one of the $I_l$ occurs) are structurally smaller than $y$.
\end{itemize}
-% QUESTION: How could one show, that some of the functions defined below are "guarded"
-% in a sense of the definition given above.
-% E.g., how could I show that "p" in "plus" below is structurally smaller than "n"?
The following definitions are correct, we enter them using the
{\tt Fixpoint} command as described in Section~\ref{Fixpoint} and show
the internal representation.
@@ -1828,7 +1684,6 @@ The reduction for fixpoints is:
\[ (\Fix{f_i}{F}~a_1\ldots
a_{k_i}) \triangleright_{\iota} \substs{t_i}{f_k}{\Fix{f_k}{F}}{k=1\ldots n}
~a_1\ldots a_{k_i}\]
-% QUESTION: Is it wise to use \iota for twice with two different meanings?
when $a_{k_i}$ starts with a constructor.
This last restriction is needed in order to keep strong normalization
and corresponds to the reduction for primitive recursive operators.
@@ -2030,45 +1885,6 @@ impredicative system for sort \Set{} become:
\{\Type(i)\}}
{\compat{I:\Set}{I\ra s}}}
\end{description}
-
-% QUESTION: Why, when I add this definition:
-%
-% Inductive foo : Type := .
-%
-% Coq claims that the type of 'foo' is 'Prop'?
-
-% QUESTION: If I add this definition:
-%
-% Inductive bar (A:Type) : Type := .
-%
-% then Coq claims that 'bar' has type 'Type → Prop' where I would expect 'Type → Type' with appropriate constraint.
-
-% QUESTION: If I add this definition:
-%
-% Inductive foo (A:Type) : Type :=
-% | foo1 : foo A
-%
-% then Coq claims that 'foo' has type 'Type → Prop'.
-% Why?
-
-% QUESTION: If I add this definition:
-%
-% Inductive foo (A:Type) : Type :=
-% | foo1 : foo A
-% | foo2 : foo A.
-%
-% then Coq claims that 'foo' has type 'Type → Set'.
-% Why?
-
-% NOTE: If I add this definition:
-%
-% Inductive foo (A:Type) : Type :=
-% | foo1 : foo A
-% | foo2 : A → foo A.
-%
-% then Coq claims, as expected, that:
-%
-% foo : Type → Type.
%%% Local Variables:
%%% mode: latex
--
cgit v1.2.3
From 15311e51c20e6edc3b97f12d483dd15bfbc1164c Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 9 Nov 2015 16:43:47 +0100
Subject: PROPOSITION: Example was simplified
---
doc/refman/RefMan-cic.tex | 35 ++++++++---------------------------
1 file changed, 8 insertions(+), 27 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 2f4016d71e..ac860b8276 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1688,33 +1688,14 @@ when $a_{k_i}$ starts with a constructor.
This last restriction is needed in order to keep strong normalization
and corresponds to the reduction for primitive recursive operators.
-We can illustrate this behavior on examples.
-\begin{coq_example}
-Goal forall n m:nat, plus (S n) m = S (plus n m).
-reflexivity.
-Abort.
-Goal forall f:forest, sizet (node f) = S (sizef f).
-reflexivity.
-Abort.
-\end{coq_example}
-But assuming the definition of a son function from \tree\ to \forest:
-\begin{coq_example}
-Definition sont (t:tree) : forest
- := let (f) := t in f.
-\end{coq_example}
-The following is not a conversion but can be proved after a case analysis.
-% (******************************************************************)
-% (** Error: Impossible to unify .... **)
-\begin{coq_example}
-Goal forall t:tree, sizet t = S (sizef (sont t)).
-Fail reflexivity.
-destruct t.
-reflexivity.
-\end{coq_example}
-\begin{coq_eval}
-Abort.
-\end{coq_eval}
-% QUESTION: What are we trying to say with the above examples?
+The following reductions are now possible:
+\def\plus{\mathsf{plus}}
+\def\tri{\triangleright_\iota}
+\begin{eqnarray*}
+ \plus~(\nS~(\nS~\nO))~(\nS~\nO) & \tri & \nS~(\plus~(\nS~\nO)~(\nS~\nO))\\
+ & \tri & \nS~(\nS~(\plus~\nO~(\nS~\nO)))\\
+ & \tri & \nS~(\nS~(\nS~\nO))\\
+\end{eqnarray*}
% La disparition de Program devrait rendre la construction Match obsolete
% \subsubsection{The {\tt Match \ldots with \ldots end} expression}
--
cgit v1.2.3
From 5e48f1aafb45d1c883e32e13a8458979663b04fb Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 9 Nov 2015 16:52:23 +0100
Subject: PROPOSITION: Added "if" and "then" words missing in the original
sentence.
---
doc/refman/RefMan-cic.tex | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index ac860b8276..6c1417a7f2 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1622,10 +1622,10 @@ The definition of being structurally smaller is a bit technical.
One needs first to define the notion of
{\em recursive arguments of a constructor}\index{Recursive arguments}.
For an inductive definition \Ind{}{r}{\Gamma_I}{\Gamma_C},
-the type of a constructor $c$ has the form
+if the type of a constructor $c$ has the form
$\forall p_1:P_1,\ldots \forall p_r:P_r,
\forall x_1:T_1, \ldots \forall x_r:T_r, (I_j~p_1\ldots
-p_r~t_1\ldots t_s)$ the recursive arguments will correspond to $T_i$ in
+p_r~t_1\ldots t_s)$, then the recursive arguments will correspond to $T_i$ in
which one of the $I_l$ occurs.
The main rules for being structurally smaller are the following:\\
--
cgit v1.2.3
From 32bd14114d5137b917601092730469db569d6385 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 10 Nov 2015 09:11:50 +0100
Subject: PROPOSITION: Added an explicit definition of the notation for
enriching the global environment (we use throughout the document)
---
doc/refman/RefMan-cic.tex | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 6c1417a7f2..2781b4cbe5 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -257,6 +257,10 @@ A {\em global definition} will
be represented in the global environment as $c:=t:T$ which defines
the name $c$ to have value $t$ and type $T$.
We shall call such names {\em constants}.
+For the rest of the chapter, the $E;c:T$ denotes the global environment
+$E$ enriched with the global assumption $c:T$.
+Similarly, $E;c:=t:T$ denotes the global environment
+$E$ enriched with the global definition $(c:=t:T)$.
The rules for inductive definitions (see Section
\ref{Cic-inductive-definitions}) have to be considered as assumption
--
cgit v1.2.3
From e90a1be62b9d26b1982e48d7bbd2a73b5bc54b0a Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 10 Nov 2015 13:08:20 +0100
Subject: PROPOSITION: rephrasing of the explanation of the meaning of
'[I:A|B]'
---
doc/refman/RefMan-cic.tex | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 2781b4cbe5..dd194d4eb9 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1299,16 +1299,12 @@ compact notation:
\label{allowedeleminationofsorts}
An important question for building the typing rule for \kw{match} is
-what can be the type of $\lb a x \mto P$ with respect to the type of the inductive
-definitions.
-
-We define now a relation \compat{I:A}{B} between an inductive
-definition $I$ of type $A$ and an arity $B$. This relation states that
-an object in the inductive definition $I$ can be eliminated for
-proving a property $\lb a x \mto P$ of arity $B$.
-% TODO: The meaning of [I:A|B] relation is not trivial,
-% but I do not think that we must explain it in as complicated way as we do above.
-We use this concept to formulate the hypothesis of the typing rule for the match-construct.
+what can be the type of $\lb a x \mto P$ with respect to the type of $m$. If
+$m:I$ and
+$I:A$ and
+$\lb a x \mto P : B$
+then by \compat{I:A}{B} we mean that one can use $\lb a x \mto P$ with $m$ in the above
+match-construct.
\paragraph{Notations.}
The \compat{I:A}{B} is defined as the smallest relation satisfying the
--
cgit v1.2.3
From 48431e5f7583f9fec3b776b07fac0f84f021a69e Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 10 Nov 2015 14:55:39 +0100
Subject: PROPOSITION: the side-condition was made more specific.
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index dd194d4eb9..dd9284e606 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -1055,7 +1055,7 @@ $P_l$ arity implies $P'_l$ arity since $\WTELECONV{}{P'_l}{ \subst{P_l}{p_u}{q_u
$\Gamma_{I'} = [I_1:\forall
\Gamma_{P'},(A_1)_{/s_1};\ldots;I_k:\forall \Gamma_{P'},(A_k)_{/s_k}]$
we have $(\WTE{\Gamma_{I'};\Gamma_{P'}}{C_i}{s_{q_i}})_{i=1\ldots n}$;
-\item the sorts are such that all eliminations, to {\Prop}, {\Set} and
+\item the sorts $s_i$ are such that all eliminations, to {\Prop}, {\Set} and
$\Type(j)$, are allowed (see Section~\ref{allowedeleminationofsorts}).
\end{itemize}
\end{description}
--
cgit v1.2.3
From 9959dd34dedf40c3be9a1fb1e08f04b79e0869c5 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Thu, 12 Nov 2015 11:36:00 +0100
Subject: TYPOGRAPHY: adjustments
---
doc/refman/RefMan-cic.tex | 123 ++++++++++++++++++++++------------------------
1 file changed, 58 insertions(+), 65 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index dd9284e606..dd3a059d7f 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -69,7 +69,6 @@ system itself generates for each instance of \Type\ a new
index for the universe and checks that the constraints between these
indexes can be solved. From the user point of view we consequently
have {\Type}:{\Type}.
-
We shall make precise in the typing rules the constraints between the
indexes.
@@ -125,13 +124,11 @@ Terms are built from sorts, variables, constants,
abstractions, applications, local definitions,
%case analysis, fixpoints, cofixpoints
and products.
-
From a syntactic point of view, types cannot be distinguished from terms,
except that they cannot start by an abstraction or a constructor.
-
More precisely the language of the {\em Calculus of Inductive
Constructions} is built from the following rules.
-
+%
\begin{enumerate}
\item the sorts {\Set}, {\Prop}, ${\Type(i)}$ are terms.
\item variables, hereafter ranged over by letters $x$, $y$, etc., are terms
@@ -414,31 +411,31 @@ $\eta$-expansion $\lb x:T\mto (t\ x)$ for $x$ an arbitrary variable
name fresh in $t$.
\Rem We deliberately do not define $\eta$-reduction:
-\begin{latexonly}
+\begin{latexonly}%
$$\lb x:T\mto (t\ x)\not\triangleright_\eta\hskip.3em t$$
-\end{latexonly}
+\end{latexonly}%
\begin{htmlonly}
$$\lb x:T\mto (t\ x)~\not\triangleright_\eta~t$$
\end{htmlonly}
This is because, in general, the type of $t$ need not to be convertible to the type of $\lb x:T\mto (t\ x)$.
E.g., if we take $f$ such that:
-\begin{latexonly}
+\begin{latexonly}%
$$f\hskip.5em:\hskip.5em\forall x:Type(2),Type(1)$$
-\end{latexonly}
+\end{latexonly}%
\begin{htmlonly}
$$f~:~\forall x:Type(2),Type(1)$$
\end{htmlonly}
then
-\begin{latexonly}
+\begin{latexonly}%
$$\lb x:Type(1),(f\, x)\hskip.5em:\hskip.5em\forall x:Type(1),Type(1)$$
-\end{latexonly}
+\end{latexonly}%
\begin{htmlonly}
$$\lb x:Type(1),(f\, x)~:~\forall x:Type(1),Type(1)$$
\end{htmlonly}
We could not allow
-\begin{latexonly}
+\begin{latexonly}%
$$\lb x:Type(1),(f\,x)\hskip.4em\not\triangleright_\eta\hskip.6em f$$
-\end{latexonly}
+\end{latexonly}%
\begin{htmlonly}
$$\lb x:Type(1),(f\,x)~\not\triangleright_\eta~f$$
\end{htmlonly}
@@ -514,7 +511,7 @@ term is no more an abstraction leads to the {\em $\beta$-head normal
where $v$ is not an abstraction (nor an application). Note that the
head normal form must not be confused with the normal form since some
$u_i$ can be reducible.
-
+%
Similar notions of head-normal forms involving $\delta$, $\iota$ and $\zeta$
reductions or any combination of those can also be defined.
@@ -529,14 +526,12 @@ Formally, we can represent any {\em inductive definition\index{definition!induct
\item $p$ determines the number of parameters of these inductive types.
\end{itemize}
These inductive definitions, together with global assumptions and global definitions, then form the global environment.
-
-\noindent Additionally, for any $p$ there always exists $\Gamma_P=[a_1:A_1;\dots;a_p:A_p]$
+%
+Additionally, for any $p$ there always exists $\Gamma_P=[a_1:A_1;\dots;a_p:A_p]$
such that each $(t:T)\in\Gamma_I\cup\Gamma_C$ can be written as:
-$\forall\Gamma_P, T^\prime$.
+$\forall\Gamma_P, T^\prime$ where $\Gamma_P$ is called the {\em context of parameters\index{context of parameters}}.
-\noindent $\Gamma_P$ is called {\em context of parameters\index{context of parameters}}.
-
-\begin{latexonly}
+\begin{latexonly}%
\subsection*{Examples}
If we take the following inductive definition (denoted in concrete syntax):
@@ -750,7 +745,7 @@ and thus it enriches the global environment with the following entry:
\ind{0}{\GammaI}{\GammaC}
\vskip.5em
\noindent In this case, $\Gamma_P=[\,]$.
-\end{latexonly}
+\end{latexonly}%
\subsection{Types of inductive objects}
We have to give the type of constants in a global environment $E$ which
@@ -763,7 +758,7 @@ contains an inductive declaration.
\inference{\frac{\WFE{\Gamma}\hskip2em\Ind{}{p}{\Gamma_I}{\Gamma_C} \in E\hskip2em(c:C)\in\Gamma_C}{\WTEG{c}{C}}}
\end{description}
-\begin{latexonly}
+\begin{latexonly}%
\paragraph{Example.}
Provided that our environment $E$ contains inductive definitions we showed before,
these two inference rules above enable us to conclude that:
@@ -776,7 +771,7 @@ $\begin{array}{@{} l}
\prefix\evenS : \forall~n:\nat, \odd~n \ra \even~(\nS~n)\\
\prefix\oddS : \forall~n:\nat, \even~n \ra \odd~(\nS~n)
\end{array}$
-\end{latexonly}
+\end{latexonly}%
%\paragraph{Parameters.}
%%The parameters introduce a distortion between the inside specification
@@ -837,10 +832,10 @@ any $t_i$
\item $T=\forall~x:U,V$ and $X$ occurs only strictly positively in $U$ and
the type $V$ satisfies the positivity condition for $X$
\end{itemize}
-
+%
The constant $X$ {\em occurs strictly positively} in $T$ in the
following cases:
-
+%
\begin{itemize}
\item $X$ does not occur in $T$
\item $T$ converts to $(X~t_1 \ldots ~t_n)$ and $X$ does not occur in
@@ -861,7 +856,7 @@ following cases:
%positively in $T[x:U]u$ if $X$ does not occur in $U$ but occurs
%strictly positively in $u$
\end{itemize}
-
+%
The type of constructor $T$ of $I$ {\em satisfies the nested
positivity condition} for a constant $X$ in the following
cases:
@@ -874,7 +869,7 @@ any $u_i$
the type $V$ satisfies the nested positivity condition for $X$
\end{itemize}
-\begin{latexonly}
+\begin{latexonly}%
\newcommand\vv{\textSFxi} % │
\newcommand\hh{\textSFx} % ─
\newcommand\vh{\textSFviii} % ├
@@ -937,7 +932,7 @@ the type $V$ satisfies the nested positivity condition for $X$
\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $\ListA$\ruleref3\\
\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $\ListA$\ruleref7
-\end{latexonly}
+\end{latexonly}%
\paragraph{Correctness rules.}
We shall now describe the rules allowing the introduction of a new
@@ -1008,7 +1003,6 @@ Inductive exType (P:Type->Prop) : Type
Inductive types declared in {\Type} are
polymorphic over their arguments in {\Type}.
-
If $A$ is an arity of some sort and $s$ is a sort, we write $A_{/s}$ for the arity
obtained from $A$ by replacing its sort with $s$. Especially, if $A$
is well-typed in some global environment and local context, then $A_{/s}$ is typable
@@ -1059,7 +1053,7 @@ we have $(\WTE{\Gamma_{I'};\Gamma_{P'}}{C_i}{s_{q_i}})_{i=1\ldots n}$;
$\Type(j)$, are allowed (see Section~\ref{allowedeleminationofsorts}).
\end{itemize}
\end{description}
-
+%
Notice that if $I_j\,q_1\,\ldots\,q_r$ is typable using the rules {\bf
Ind-Const} and {\bf App}, then it is typable using the rule {\bf
Ind-Family}. Conversely, the extended theory is not stronger than the
@@ -1106,15 +1100,14 @@ and otherwise in the {\Type} hierarchy.
Note that the side-condition about allowed elimination sorts in the
rule~{\bf Ind-Family} is just to avoid to recompute the allowed
elimination sorts at each instance of a pattern-matching (see
-section~\ref{elimdep}).
-
+section~\ref{elimdep}).
As an example, let us consider the following definition:
\begin{coq_example*}
Inductive option (A:Type) : Type :=
| None : option A
| Some : A -> option A.
\end{coq_example*}
-
+%
As the definition is set in the {\Type} hierarchy, it is used
polymorphically over its parameters whose types are arities of a sort
in the {\Type} hierarchy. Here, the parameter $A$ has this property,
@@ -1129,13 +1122,13 @@ section~\ref{singleton}) and it would lose the elimination to {\Set} and
Check (fun A:Set => option A).
Check (fun A:Prop => option A).
\end{coq_example}
-
+%
Here is another example.
-
+%
\begin{coq_example*}
Inductive prod (A B:Type) : Type := pair : A -> B -> prod A B.
\end{coq_example*}
-
+%
As \texttt{prod} is a singleton type, it will be in {\Prop} if applied
twice to propositions, in {\Set} if applied twice to at least one type
in {\Set} and none in {\Type}, and in {\Type} otherwise. In all cases,
@@ -1186,24 +1179,25 @@ In case the inductive definition is effectively a recursive one, we
want to capture the extra property that we have built the smallest
fixed point of this recursive equation. This says that we are only
manipulating finite objects. This analysis provides induction
-principles.
-
+principles.
For instance, in order to prove $\forall l:\ListA,(\haslengthA~l~(\length~l))$
it is enough to prove:
-
-\noindent $(\haslengthA~(\Nil~A)~(\length~(\Nil~A)))$ and
-
-\smallskip
-$\forall a:A, \forall l:\ListA, (\haslengthA~l~(\length~l)) \ra
-(\haslengthA~(\cons~A~a~l)~(\length~(\cons~A~a~l)))$.
-\smallskip
-
-\noindent which given the conversion equalities satisfied by \length\ is the
+%
+\begin{itemize}
+ \item $(\haslengthA~(\Nil~A)~(\length~(\Nil~A)))$
+ \item $\forall a:A, \forall l:\ListA, (\haslengthA~l~(\length~l)) \ra\\
+ \ra (\haslengthA~(\cons~A~a~l)~(\length~(\cons~A~a~l)))$
+\end{itemize}
+%
+which given the conversion equalities satisfied by \length\ is the
same as proving:
-$(\haslengthA~(\Nil~A)~\nO)$ and $\forall a:A, \forall l:\ListA,
-(\haslengthA~l~(\length~l)) \ra
-(\haslengthA~(\cons~A~a~l)~(\nS~(\length~l)))$.
-
+%
+\begin{itemize}
+ \item $(\haslengthA~(\Nil~A)~\nO)$
+ \item $\forall a:A, \forall l:\ListA, (\haslengthA~l~(\length~l)) \ra\\
+ \ra (\haslengthA~(\cons~A~a~l)~(\nS~(\length~l)))$
+\end{itemize}
+%
One conceptually simple way to do that, following the basic scheme
proposed by Martin-L\"of in his Intuitionistic Type Theory, is to
introduce for each inductive definition an elimination operator. At
@@ -1223,7 +1217,6 @@ The basic idea of this operator is that we have an object
$m$ in an inductive type $I$ and we want to prove a property
which possibly depends on $m$. For this, it is enough to prove the
property for $m = (c_i~u_1\ldots u_{p_i})$ for each constructor of $I$.
-
The \Coq{} term for this proof will be written:
\[\kw{match}~m~\kw{with}~ (c_1~x_{11}~...~x_{1p_1}) \Ra f_1 ~|~\ldots~|~
(c_n~x_{n1}~...~x_{np_n}) \Ra f_n~ \kw{end}\]
@@ -1262,7 +1255,7 @@ have to be variables
The expression after \kw{in}
must be seen as an \emph{inductive type pattern}. Notice that
expansion of implicit arguments and notations apply to this pattern.
-
+%
For the purpose of presenting the inference rules, we use a more
compact notation:
\[ \Case{(\lb a x \mto P)}{m}{ \lb x_{11}~...~x_{1p_1} \mto f_1 ~|~\ldots~|~
@@ -1315,14 +1308,14 @@ $I$.
The case of inductive definitions in sorts \Set\ or \Type{} is simple.
There is no restriction on the sort of the predicate to be
eliminated.
-
+%
\begin{description}
\item[Prod] \inference{\frac{\compat{(I~x):A'}{B'}}
{\compat{I:\forall x:A, A'}{\forall x:A, B'}}}
\item[{\Set} \& \Type] \inference{\frac{
s_1 \in \{\Set,\Type(j)\}~~~~~~~~s_2 \in \Sort}{\compat{I:s_1}{I\ra s_2}}}
\end{description}
-
+%
The case of Inductive definitions of sort \Prop{} is a bit more
complicated, because of our interpretation of this sort. The only
harmless allowed elimination, is the one when predicate $P$ is also of
@@ -1413,10 +1406,10 @@ eliminations are allowed.
definition}~~~s \in \Sort}{\compat{I:\Prop}{I\ra s}}
}
\end{description}
-
+%
% A {\em singleton definition} has always an informative content,
% even if it is a proposition.
-
+%
A {\em singleton
definition} has only one constructor and all the arguments of this
constructor have type \Prop. In that case, there is a canonical
@@ -1573,17 +1566,17 @@ The typing rule is the expected one for a fixpoint.
(\WTE{\Gamma,f_1:A_1,\ldots,f_n:A_n}{t_i}{A_i})_{i=1\ldots n}}
{\WTEG{\Fix{f_i}{f_1:A_1:=t_1 \ldots f_n:A_n:=t_n}}{A_i}}}
\end{description}
-
+%
Any fixpoint definition cannot be accepted because non-normalizing terms
allow proofs of absurdity.
-
+%
The basic scheme of recursion that should be allowed is the one needed for
defining primitive
recursive functionals. In that case the fixpoint enjoys a special
syntactic restriction, namely one of the arguments belongs to an
inductive type, the function starts with a case analysis and recursive
calls are done on variables coming from patterns and representing subterms.
-
+%
For instance in the case of natural numbers, a proof of the induction
principle of type
\[\forall P:\nat\ra\Prop, (P~\nO)\ra(\forall n:\nat, (P~n)\ra(P~(\nS~n)))\ra
@@ -1596,15 +1589,15 @@ can be represented by the term:
p:\nat\mto (g~p~(h~p))}}
\end{array}
\]
-
+%
Before accepting a fixpoint definition as being correctly typed, we
check that the definition is ``guarded''. A precise analysis of this
notion can be found in~\cite{Gim94}.
-
+%
The first stage is to precise on which argument the fixpoint will be
decreasing. The type of this argument should be an inductive
definition.
-
+%
For doing this, the syntax of fixpoints is extended and becomes
\[\Fix{f_i}{f_1/k_1:A_1:=t_1 \ldots f_n/k_n:A_n:=t_n}\]
where $k_i$ are positive integers.
@@ -1687,7 +1680,7 @@ a_{k_i}) \triangleright_{\iota} \substs{t_i}{f_k}{\Fix{f_k}{F}}{k=1\ldots n}
when $a_{k_i}$ starts with a constructor.
This last restriction is needed in order to keep strong normalization
and corresponds to the reduction for primitive recursive operators.
-
+%
The following reductions are now possible:
\def\plus{\mathsf{plus}}
\def\tri{\triangleright_\iota}
@@ -1785,7 +1778,7 @@ $\subst{\subst{E}{y_1}{(y_1~c)}\ldots}{y_n}{(y_n~c)}$.
\inference{\frac{\WF{E;c:U;E';\Ind{}{p}{\Gamma_I}{\Gamma_C};E''}{\Gamma}}
{\WFTWOLINES{E;c:U;E';\Ind{}{p+1}{\forall x:U,\subst{\Gamma_I}{c}{x}}{\forall x:U,\subst{\Gamma_C}{c}{x}};\subst{E''}{|\Gamma_I,\Gamma_C|}{|\Gamma_I,\Gamma_C|~c}}{\subst{\Gamma}{|\Gamma_I,\Gamma_C|}{|\Gamma_I,\Gamma_C|~c}}}}
-
+%
One can similarly modify a global declaration by generalizing it over
a previously defined constant~$c'$. Below, if $\Gamma$ is a context
of the form $[y_1:A_1;\ldots;y_n:A_n]$, we write $
@@ -1830,7 +1823,7 @@ in~\cite{Gimenez95b,Gim98,GimCas05}.
\Coq{} can be used as a type-checker for the
Calculus of Inductive Constructions with an impredicative sort \Set{}
by using the compiler option \texttt{-impredicative-set}.
-
+%
For example, using the ordinary \texttt{coqtop} command, the following
is rejected.
% (** This example should fail *******************************
--
cgit v1.2.3
From 89d033112607733ad0007638762bde326fc0eb8b Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Wed, 18 Nov 2015 16:11:27 +0100
Subject: ENH: The definition of the "_ ; _" operation on local context was
added.
---
doc/refman/RefMan-cic.tex | 2 ++
1 file changed, 2 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index dd3a059d7f..4066a108cd 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -226,6 +226,8 @@ $\Gamma$ enriched with the local assumption $y:T$.
Similarly, $\Gamma::(y:=t:T)$ denotes the local context
$\Gamma$ enriched with the local definition $(y:=t:T)$.
The notation $[]$ denotes the empty local context.
+By $\Gamma_1; \Gamma_2$ we mean concatenation of the local context $\Gamma_1$
+and the local context $\Gamma_2$.
% Does not seem to be used further...
% Si dans l'explication WF(E)[Gamma] concernant les constantes
--
cgit v1.2.3
From 6fa4d20b5208852ac468c28405e93bcb5288d774 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Mon, 23 Nov 2015 13:02:03 +0100
Subject: CLEANUP: putting examples inside "figure" environment
---
doc/refman/RefMan-cic.tex | 507 ++++++++++++++++++++--------------------
doc/refman/Reference-Manual.tex | 4 +
2 files changed, 262 insertions(+), 249 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 4066a108cd..ad711549b2 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -532,221 +532,221 @@ These inductive definitions, together with global assumptions and global definit
Additionally, for any $p$ there always exists $\Gamma_P=[a_1:A_1;\dots;a_p:A_p]$
such that each $(t:T)\in\Gamma_I\cup\Gamma_C$ can be written as:
$\forall\Gamma_P, T^\prime$ where $\Gamma_P$ is called the {\em context of parameters\index{context of parameters}}.
+Figures~\ref{fig:bool}--\ref{fig:even:odd} show formal representation of several inductive definitions.
\begin{latexonly}%
-\subsection*{Examples}
-
-If we take the following inductive definition (denoted in concrete syntax):
-\begin{coq_example*}
+ \newpage
+ \def\captionstrut{\vbox to 1.5em{}}
+ \newcommand\ind[3]{$\mathsf{Ind}~[#1]\left(\hskip-.4em
+ \begin{array}{r @{\mathrm{~:=~}} l}
+ #2 & #3 \\
+ \end{array}
+ \hskip-.4em
+ \right)$}
+
+ \def\colon{@{\hskip.5em:\hskip.5em}}
+
+ \begin{figure}[H]
+ \strut If we take the following inductive definition (denoted in concrete syntax):
+\begin{verbatim}
Inductive bool : Set :=
| true : bool
| false : bool.
-\end{coq_example*}
-then:
-\def\colon{@{\hskip.5em:\hskip.5em}}
-\newcommand\ind[3]{$\mathsf{Ind}~[#1]\left(\hskip-.4em
- \begin{array}{r @{\mathrm{~:=~}} l}
- #2 & #3 \\
- \end{array}
- \hskip-.4em
- \right)$}
- \def\GammaI{\left[\begin{array}{r \colon l}
- \bool & \Set
- \end{array}
- \right]}
- \def\GammaC{\left[\begin{array}{r \colon l}
- \true & \bool\\
- \false & \bool
- \end{array}
- \right]}
- \begin{itemize}
+\end{verbatim}
+ then:
+ \def\GammaI{\left[\begin{array}{r \colon l}
+ \bool & \Set
+ \end{array}
+ \right]}
+ \def\GammaC{\left[\begin{array}{r \colon l}
+ \true & \bool\\
+ \false & \bool
+ \end{array}
+ \right]}
+ \begin{itemize}
\item $p = 0$
\item $\Gamma_I = \GammaI$
\item $\Gamma_C = \GammaC$
- \end{itemize}
- and thus it enriches the global environment with the following entry:
- \vskip.5em
- \ind{p}{\Gamma_I}{\Gamma_C}
- \vskip.5em
- \noindent that is:
- \vskip.5em
- \ind{0}{\GammaI}{\GammaC}
- \vskip.5em
- \noindent In this case, $\Gamma_P=[\,]$.
-
-\vskip1em\hrule\vskip1em
-
-\noindent If we take the followig inductive definition:
-\begin{coq_example*}
+ \item $\Gamma_P=[\,]$.
+ \end{itemize}
+ and thus it enriches the global environment with the following entry:
+ \vskip.5em
+ \ind{p}{\Gamma_I}{\Gamma_C}
+ \vskip.5em
+ \noindent that is:
+ \vskip.5em
+ \ind{0}{\GammaI}{\GammaC}
+ \caption{\captionstrut Formal representation of the {\bool} inductive type.}
+ \label{fig:bool}
+ \end{figure}
+
+ \begin{figure}[H]
+ \strut If we take the followig inductive definition:
+\begin{verbatim}
Inductive nat : Set :=
| O : nat
| S : nat -> nat.
-\end{coq_example*}
-then:
-\def\GammaI{\left[\begin{array}{r \colon l}
- \nat & \Set
- \end{array}
- \right]}
-\def\GammaC{\left[\begin{array}{r \colon l}
- \nO & \nat\\
- \nS & \nat\ra\nat
- \end{array}
- \right]}
-\begin{itemize}
- \item $p = 0$
- \item $\Gamma_I = \GammaI$
- \item $\Gamma_C = \GammaC$
-\end{itemize}
-and thus it enriches the global environment with the following entry:
-\vskip.5em
-\ind{p}{\Gamma_I}{\Gamma_C}
-\vskip.5em
-\noindent that is:
-\vskip.5em
-\ind{0}{\GammaI}{\GammaC}
-\vskip.5em
-\noindent In this case, $\Gamma_P=[~]$.
-
-\vskip1em\hrule\vskip1em
-
-\noindent If we take the following inductive definition:
-\begin{coq_example*}
+\end{verbatim}
+ then:
+ \def\GammaI{\left[\begin{array}{r \colon l}
+ \nat & \Set
+ \end{array}
+ \right]}
+ \def\GammaC{\left[\begin{array}{r \colon l}
+ \nO & \nat\\
+ \nS & \nat\ra\nat
+ \end{array}
+ \right]}
+ \begin{itemize}
+ \item $p = 0$
+ \item $\Gamma_I = \GammaI$
+ \item $\Gamma_C = \GammaC$
+ \item $\Gamma_P=[\,]$.
+ \end{itemize}
+ and thus it enriches the global environment with the following entry:
+ \vskip.5em
+ \ind{p}{\Gamma_I}{\Gamma_C}
+ \vskip.5em
+ \noindent that is:
+ \vskip.5em
+ \ind{0}{\GammaI}{\GammaC}
+ \caption{\captionstrut Formal representation of the {\nat} inductive type.}
+ \label{fig:nat}
+ \end{figure}
+
+ \begin{figure}[H]
+ \strut If we take the following inductive definition:
+\begin{verbatim}
Inductive list (A : Type) : Type :=
| nil : list A
| cons : A -> list A -> list A.
-\end{coq_example*}
-then:
-\def\GammaI{\left[\begin{array}{r \colon l}
- \List & \Type\ra\Type
- \end{array}
- \right]}
-\def\GammaC{\left[\begin{array}{r \colon l}
- \Nil & \forall~A\!:\!\Type,~\List~A\\
- \cons & \forall~A\!:\!\Type,~A\ra\List~A\ra\List~A
- \end{array}
- \right]}
-\begin{itemize}
- \item $p = 1$
- \item $\Gamma_I = \GammaI$
- \item $\Gamma_C = \GammaC$
-\end{itemize}
-and thus it enriches the global environment with the following entry:
-\vskip.5em
-\ind{p}{\Gamma_I}{\Gamma_C}
-\vskip.5em
-\noindent that is:
-\vskip.5em
-\ind{1}{\GammaI}{\GammaC}
-\vskip.5em
-\noindent In this case, $\Gamma_P=[A:\Type]$.
-
-\vskip1em\hrule\vskip1em
-
-\noindent If we take the following inductive definition:
-\begin{coq_example*}
+\end{verbatim}
+ then:
+ \def\GammaI{\left[\begin{array}{r \colon l}
+ \List & \Type\ra\Type
+ \end{array}
+ \right]}
+ \def\GammaC{\left[\begin{array}{r \colon l}
+ \Nil & \forall~A\!:\!\Type,~\List~A\\
+ \cons & \forall~A\!:\!\Type,~A\ra\List~A\ra\List~A
+ \end{array}
+ \right]}
+ \begin{itemize}
+ \item $p = 1$
+ \item $\Gamma_I = \GammaI$
+ \item $\Gamma_C = \GammaC$
+ \item $\Gamma_P=[A:\Type]$
+ \end{itemize}
+ and thus it enriches the global environment with the following entry:
+ \vskip.5em
+ \ind{1}{\GammaI}{\GammaC}
+ \caption{\captionstrut Formal representation of the {\List} inductive type.}
+ \label{fig:list}
+ \end{figure}
+
+ \begin{figure}[H]
+ \strut If we take the following inductive definition:
+\begin{verbatim}
Inductive even : nat -> Prop :=
| even_O : even 0
| even_S : forall n, odd n -> even (S n)
with odd : nat -> Prop :=
| odd_S : forall n, even n -> odd (S n).
-\end{coq_example*}
-then:
-\def\GammaI{\left[\begin{array}{r \colon l}
- \even & \nat\ra\Prop \\
- \odd & \nat\ra\Prop
- \end{array}
- \right]}
-\def\GammaC{\left[\begin{array}{r \colon l}
- \evenO & \even~\nO \\
- \evenS & \forall n : \nat, \odd~n \ra \even~(\nS~n)
- \end{array}
- \right]}
-\begin{itemize}
- \item $p = 1$
- \item $\Gamma_I = \GammaI$
- \item $\Gamma_C = \GammaC$
-\end{itemize}
-and thus it enriches the global environment with the following entry:
-\vskip.5em
-\ind{p}{\Gamma_I}{\Gamma_C}
-\vskip.5em
-\noindent that is:
-\vskip.5em
-\ind{1}{\GammaI}{\GammaC}
-\vskip.5em
-\noindent In this case, $\Gamma_P=[A:\Type]$.
-
-\vskip1em\hrule\vskip1em
-
-\noindent If we take the following inductive definition:
-\begin{coq_example*}
+\end{verbatim}
+ then:
+ \def\GammaI{\left[\begin{array}{r \colon l}
+ \even & \nat\ra\Prop \\
+ \odd & \nat\ra\Prop
+ \end{array}
+ \right]}
+ \def\GammaC{\left[\begin{array}{r \colon l}
+ \evenO & \even~\nO \\
+ \evenS & \forall n : \nat, \odd~n \ra \even~(\nS~n)\\
+ \oddS & \forall n : \nat, \even~n \ra \odd~(\nS~n)
+ \end{array}
+ \right]}
+ \begin{itemize}
+ \item $p = 1$
+ \item $\Gamma_I = \GammaI$
+ \item $\Gamma_C = \GammaC$
+ \item $\Gamma_P=[A:\Type]$.
+ \end{itemize}
+ and thus it enriches the global environment with the following entry:
+ \vskip.5em
+ \ind{1}{\GammaI}{\GammaC}
+ \caption{\captionstrut Formal representation of the {\even} and {\odd} inductive types.}
+ \label{fig:even:odd}
+ \end{figure}
+
+ \begin{figure}[H]
+ \strut If we take the following inductive definition:
+\begin{verbatim}
Inductive has_length (A : Type) : list A -> nat -> Prop :=
| nil_hl : has_length A (nil A) O
| cons_hl : forall (a:A) (l:list A) (n:nat),
has_length A l n -> has_length A (cons A a l) (S n).
-\end{coq_example*}
-then:
-\def\GammaI{\left[\begin{array}{r \colon l}
- \haslength & \forall~A\!:\!\Type,~\List~A\ra\nat\ra\Prop
- \end{array}
- \right]}
-\def\GammaC{\left[\begin{array}{r c l}
- \nilhl & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\haslength~A~(\Nil~A)~\nO\\
- \conshl & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\forall~a\!:\!A,~\forall~l\!:\!\List~A,~\forall~n\!:\!\nat,\\
- & & \haslength~A~l~n\ra \haslength~A~(\cons~A~a~l)~(\nS~n)
- \end{array}
- \right]}
-\begin{itemize}
- \item $p = 1$
- \item $\Gamma_I = \GammaI$
- \item $\Gamma_C = \GammaC$
-\end{itemize}
-and thus it enriches the global environment with the following entry:
-\vskip.5em
-\ind{p}{\Gamma_I}{\Gamma_C}
-%\vskip.5em
-%\noindent that is:
-%\vskip.5em
-%\ind{1}{\GammaI}{\GammaC}
-\vskip.5em
-\noindent In this case, $\Gamma_P=[A:\Type]$.
-
-\vskip1em\hrule\vskip1em
-
-\noindent If we take the following inductive definition:
-\begin{coq_example*}
+\end{verbatim}
+ then:
+ \def\GammaI{\left[\begin{array}{r \colon l}
+ \haslength & \forall~A\!:\!\Type,~\List~A\ra\nat\ra\Prop
+ \end{array}
+ \right]}
+ \def\GammaC{\left[\begin{array}{r c l}
+ \nilhl & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\haslength~A~(\Nil~A)~\nO\\
+ \conshl & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\forall~a\!:\!A,~\forall~l\!:\!\List~A,~\forall~n\!:\!\nat,\\
+ & & \haslength~A~l~n\ra \haslength~A~(\cons~A~a~l)~(\nS~n)
+ \end{array}
+ \right]}
+ \begin{itemize}
+ \item $p = 1$
+ \item $\Gamma_I = \GammaI$
+ \item $\Gamma_C = \GammaC$
+ \item $\Gamma_P=[A:\Type]$.
+ \end{itemize}
+ and thus it enriches the global environment with the following entry:
+ \vskip.5em
+ \ind{p}{\Gamma_I}{\Gamma_C}
+ %\vskip.5em
+ %\noindent that is:
+ %\vskip.5em
+ %\ind{1}{\GammaI}{\GammaC}
+ \caption{\captionstrut Formal representation of the {\haslength} inductive type.}
+ \label{fig:haslength}
+ \end{figure}
+
+ \begin{figure}[H]
+ \strut If we take the following inductive definition:
+\begin{verbatim}
Inductive tree : Set :=
| node : forest -> tree
with forest : Set :=
| emptyf : forest
| consf : tree -> forest -> forest.
-\end{coq_example*}
-then:
-\def\GammaI{\left[\begin{array}{r \colon l}
- \tree & \Set\\
- \forest & \Set
- \end{array}
- \right]}
-\def\GammaC{\left[\begin{array}{r \colon l}
- \node & \forest\ra\tree\\
- \emptyf & \forest\\
- \consf & \tree\ra\forest\ra\forest
- \end{array}
- \right]}
-\begin{itemize}
- \item $p = 0$
- \item $\Gamma_I = \GammaI$
- \item $\Gamma_C = \GammaC$
-\end{itemize}
-and thus it enriches the global environment with the following entry:
-\vskip.5em
-\ind{p}{\Gamma_I}{\Gamma_C}
-\vskip.5em
-\noindent that is:
-\vskip.5em
-\ind{0}{\GammaI}{\GammaC}
-\vskip.5em
-\noindent In this case, $\Gamma_P=[\,]$.
+\end{verbatim}
+ then:
+ \def\GammaI{\left[\begin{array}{r \colon l}
+ \tree & \Set\\
+ \forest & \Set
+ \end{array}
+ \right]}
+ \def\GammaC{\left[\begin{array}{r \colon l}
+ \node & \forest\ra\tree\\
+ \emptyf & \forest\\
+ \consf & \tree\ra\forest\ra\forest
+ \end{array}
+ \right]}
+ \begin{itemize}
+ \item $p = 0$
+ \item $\Gamma_I = \GammaI$
+ \item $\Gamma_C = \GammaC$
+ \end{itemize}
+ and thus it enriches the global environment with the following entry:
+ \vskip.5em
+ \ind{0}{\GammaI}{\GammaC}
+ \caption{\captionstrut Formal representation of the {\tree} and {\forest} inductive types.}
+ \label{fig:tree:forest}
+ \end{figure}%
+ \newpage
\end{latexonly}%
\subsection{Types of inductive objects}
@@ -872,68 +872,77 @@ the type $V$ satisfies the nested positivity condition for $X$
\end{itemize}
\begin{latexonly}%
-\newcommand\vv{\textSFxi} % │
-\newcommand\hh{\textSFx} % ─
-\newcommand\vh{\textSFviii} % ├
-\newcommand\hv{\textSFii} % └
-\newlength\framecharacterwidth
-\settowidth\framecharacterwidth{\hh}
-\newcommand\ws{\hbox{}\hskip\the\framecharacterwidth}
-\newcommand\ruleref[1]{\hskip.25em\dots\hskip.2em{\em (bullet #1)}}
-\paragraph{Example}~\\
-\vskip-.5em
-\noindent$X$ occurs strictly positively in $A\ra X$\ruleref5\\
-\vv\\
-\vh\hh\ws $X$does not occur in $A$\ruleref3\\
-\vv\\
-\hv\hh\ws $X$ occurs strictly positively in $X$\ruleref4
-\paragraph{Example}~\\
-\vskip-.5em
-\noindent $X$ occurs strictly positively in $X*A$\\
-\vv\\
-\hv\hh $X$ occurs strictly positively in $(\Prod~X~A)$\ruleref6\\
-\ws\ws\vv\\
-\ws\ws\vv\ws\verb|Inductive prod (A B : Type) : Type :=|\\
-\ws\ws\vv\ws\verb| pair : A -> B -> prod A B.|\\
-\ws\ws\vv\\
-\ws\ws\vh\hh $X$ does not occur in any (real) arguments of $\Prod$ in the original term $(\Prod~X~A)$\\
-\ws\ws\vv\\
-\ws\ws\hv\ws the (instantiated) type $\Prod~X~A$ of constructor $\Pair$,\\
-\ws\ws\ws\ws satisfies the nested positivity condition for $X$\ruleref7\\
-\ws\ws\ws\ws\vv\\
-\ws\ws\ws\ws\hv\ws $X$ does not occur in any (real) arguments of $(\Prod~X~A)$
-\paragraph{Example}~\\
-\vskip-.5em
-\noindent $X$ occurs strictly positively in $\ListA$\ruleref6\\
-\vv\\
-\vv\ws\verb|Inductive list (A:Type) : Type :=|\\
-\vv\ws\verb$ | nil : list A$\\
-\vv\ws\verb$ | cons : A -> list A -> list A$\\
-\vv\\
-\vh\hh $X$ does not occur in any arguments of $\List$\\
-\vv\\
-\hv\hh\ws Every instantiated constructor of $\ListA$ satisfies the nested positivity condition for $X$\\
-\ws\ws\ws\vv\\
-\ws\ws\ws\vh\hh\ws concerning type $\ListA$ of constructor $\Nil$:\\
-\ws\ws\ws\vv\ws\ws Type $\ListA$ of constructor $\Nil$ satisfies the nested positivity condition for $X$\\
-\ws\ws\ws\vv\ws\ws because $X$ does not appear in any (real) arguments of the type of that constructor\\
-\ws\ws\ws\vv\ws\ws (primarily because $\List$ does not have any (real) arguments)\ruleref7\\
-\ws\ws\ws\vv\\
-\ws\ws\ws\hv\hh\ws concerning type $\forall~A\ra\ListA\ra\ListA$ of constructor $\cons$:\\
-\ws\ws\ws\ws\ws\ws Type $\forall~A:\Type,A\ra\ListA\ra\ListA$ of constructor $\cons$\\
-\ws\ws\ws\ws\ws\ws satisfies the nested positivity condition for $X$\ruleref8\\
-\ws\ws\ws\ws\ws\ws\vv\\
-\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $\Type$\ruleref3\\
-\ws\ws\ws\ws\ws\ws\vv\\
-\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $A\ra\ListA\ra\ListA$\ruleref8\\
-\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
-\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $A$\ruleref3\\
-\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
-\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $\ListA\ra\ListA$\ruleref8\\
-\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
-\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $\ListA$\ruleref3\\
-\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
-\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $\ListA$\ruleref7
+ \newpage
+ \newcommand\vv{\textSFxi} % │
+ \newcommand\hh{\textSFx} % ─
+ \newcommand\vh{\textSFviii} % ├
+ \newcommand\hv{\textSFii} % └
+ \newlength\framecharacterwidth
+ \settowidth\framecharacterwidth{\hh}
+ \newcommand\ws{\hbox{}\hskip\the\framecharacterwidth}
+ \newcommand\ruleref[1]{\hskip.25em\dots\hskip.2em{\em (bullet #1)}}
+ \def\captionstrut{\vbox to 1.5em{}}
+
+ \begin{figure}[H]
+ \ws\strut $X$ occurs strictly positively in $A\ra X$\ruleref5\\
+ \ws\vv\\
+ \ws\vh\hh\ws $X$does not occur in $A$\\
+ \ws\vv\\
+ \ws\hv\hh\ws $X$ occurs strictly positively in $X$\ruleref4
+ \caption{\captionstrut A proof that $X$ occurs strictly positively in $A\ra X$.}
+ \end{figure}
+
+% \begin{figure}[H]
+% \strut $X$ occurs strictly positively in $X*A$\\
+% \vv\\
+% \hv\hh $X$ occurs strictly positively in $(\Prod~X~A)$\ruleref6\\
+% \ws\ws\vv\\
+% \ws\ws\vv\ws\verb|Inductive prod (A B : Type) : Type :=|\\
+% \ws\ws\vv\ws\verb| pair : A -> B -> prod A B.|\\
+% \ws\ws\vv\\
+% \ws\ws\vh\hh $X$ does not occur in any (real) arguments of $\Prod$ in the original term $(\Prod~X~A)$\\
+% \ws\ws\vv\\
+% \ws\ws\hv\hh\ws the (instantiated) type $\Prod~X~A$ of constructor $\Pair$,\\
+% \ws\ws\ws\ws\ws satisfies the nested positivity condition for $X$\ruleref7\\
+% \ws\ws\ws\ws\ws\vv\\
+% \ws\ws\ws\ws\ws\hv\hh\ws $X$ does not occur in any (real) arguments of $(\Prod~X~A)$
+% \caption{\captionstrut A proof that $X$ occurs strictly positively in $X*A$}
+% \end{figure}
+
+ \begin{figure}[H]
+ \ws\strut $X$ occurs strictly positively in $\ListA$\ruleref6\\
+ \ws\vv\\
+ \ws\vv\ws\verb|Inductive list (A:Type) : Type :=|\\
+ \ws\vv\ws\verb$ | nil : list A$\\
+ \ws\vv\ws\verb$ | cons : A -> list A -> list A$\\
+ \ws\vv\\
+ \ws\vh\hh $X$ does not occur in any (real) arguments of $\List$\\
+ \ws\vv\\
+ \ws\hv\hh\ws Every instantiated constructor of $\ListA$ satisfies the nested positivity condition for $X$\\
+ \ws\ws\ws\ws\vv\\
+ \ws\ws\ws\ws\vh\hh\ws concerning type $\ListA$ of constructor $\Nil$:\\
+ \ws\ws\ws\ws\vv\ws\ws\ws\ws Type $\ListA$ of constructor $\Nil$ satisfies the nested positivity condition for $X$\\
+ \ws\ws\ws\ws\vv\ws\ws\ws\ws because $X$ does not appear in any (real) arguments of the type of that constructor\\
+ \ws\ws\ws\ws\vv\ws\ws\ws\ws (primarily because $\List$ does not have any (real) arguments)\ruleref7\\
+ \ws\ws\ws\ws\vv\\
+ \ws\ws\ws\ws\hv\hh\ws concerning type $\forall~A\ra\ListA\ra\ListA$ of constructor $\cons$:\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws Type $\forall~A:\Type,A\ra\ListA\ra\ListA$ of constructor $\cons$\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws satisfies the nested positivity condition for $X$\ruleref8\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $\Type$\ruleref3\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $A\ra\ListA\ra\ListA$\ruleref8\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $A$\ruleref3\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $\ListA\ra\ListA$\ruleref8\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $\ListA$\ruleref4\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $\ListA$\ruleref7
+ \caption{\captionstrut A proof that $X$ occurs strictly positively in $\ListA$}
+ \end{figure}
+ \newpage
\end{latexonly}%
\paragraph{Correctness rules.}
diff --git a/doc/refman/Reference-Manual.tex b/doc/refman/Reference-Manual.tex
index cb5d2ecb54..dcb98d96b3 100644
--- a/doc/refman/Reference-Manual.tex
+++ b/doc/refman/Reference-Manual.tex
@@ -21,6 +21,10 @@
\usepackage{multicol}
\usepackage{xspace}
\usepackage{pmboxdraw}
+\usepackage{float}
+
+\floatstyle{boxed}
+\restylefloat{figure}
% for coqide
\ifpdf % si on est pas en pdflatex
--
cgit v1.2.3
From f43f474fe3ba0b01115ef02b0032f706879ee521 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 24 Nov 2015 13:50:08 +0100
Subject: FIX: wrong reference to a figure
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index ad711549b2..1b461afcb2 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -532,7 +532,7 @@ These inductive definitions, together with global assumptions and global definit
Additionally, for any $p$ there always exists $\Gamma_P=[a_1:A_1;\dots;a_p:A_p]$
such that each $(t:T)\in\Gamma_I\cup\Gamma_C$ can be written as:
$\forall\Gamma_P, T^\prime$ where $\Gamma_P$ is called the {\em context of parameters\index{context of parameters}}.
-Figures~\ref{fig:bool}--\ref{fig:even:odd} show formal representation of several inductive definitions.
+Figures~\ref{fig:bool}--\ref{fig:tree:forest} show formal representation of several inductive definitions.
\begin{latexonly}%
\newpage
--
cgit v1.2.3
From 9e12f35ddf03dd47af99284fa9bfbb14759834b8 Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Tue, 24 Nov 2015 18:12:32 +0100
Subject: ENH: redundant examples were removed
---
doc/refman/RefMan-cic.tex | 198 ----------------------------------------------
1 file changed, 198 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 1b461afcb2..3e50ac0de0 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -532,10 +532,8 @@ These inductive definitions, together with global assumptions and global definit
Additionally, for any $p$ there always exists $\Gamma_P=[a_1:A_1;\dots;a_p:A_p]$
such that each $(t:T)\in\Gamma_I\cup\Gamma_C$ can be written as:
$\forall\Gamma_P, T^\prime$ where $\Gamma_P$ is called the {\em context of parameters\index{context of parameters}}.
-Figures~\ref{fig:bool}--\ref{fig:tree:forest} show formal representation of several inductive definitions.
\begin{latexonly}%
- \newpage
\def\captionstrut{\vbox to 1.5em{}}
\newcommand\ind[3]{$\mathsf{Ind}~[#1]\left(\hskip-.4em
\begin{array}{r @{\mathrm{~:=~}} l}
@@ -546,104 +544,6 @@ Figures~\ref{fig:bool}--\ref{fig:tree:forest} show formal representation of seve
\def\colon{@{\hskip.5em:\hskip.5em}}
- \begin{figure}[H]
- \strut If we take the following inductive definition (denoted in concrete syntax):
-\begin{verbatim}
-Inductive bool : Set :=
- | true : bool
- | false : bool.
-\end{verbatim}
- then:
- \def\GammaI{\left[\begin{array}{r \colon l}
- \bool & \Set
- \end{array}
- \right]}
- \def\GammaC{\left[\begin{array}{r \colon l}
- \true & \bool\\
- \false & \bool
- \end{array}
- \right]}
- \begin{itemize}
- \item $p = 0$
- \item $\Gamma_I = \GammaI$
- \item $\Gamma_C = \GammaC$
- \item $\Gamma_P=[\,]$.
- \end{itemize}
- and thus it enriches the global environment with the following entry:
- \vskip.5em
- \ind{p}{\Gamma_I}{\Gamma_C}
- \vskip.5em
- \noindent that is:
- \vskip.5em
- \ind{0}{\GammaI}{\GammaC}
- \caption{\captionstrut Formal representation of the {\bool} inductive type.}
- \label{fig:bool}
- \end{figure}
-
- \begin{figure}[H]
- \strut If we take the followig inductive definition:
-\begin{verbatim}
-Inductive nat : Set :=
- | O : nat
- | S : nat -> nat.
-\end{verbatim}
- then:
- \def\GammaI{\left[\begin{array}{r \colon l}
- \nat & \Set
- \end{array}
- \right]}
- \def\GammaC{\left[\begin{array}{r \colon l}
- \nO & \nat\\
- \nS & \nat\ra\nat
- \end{array}
- \right]}
- \begin{itemize}
- \item $p = 0$
- \item $\Gamma_I = \GammaI$
- \item $\Gamma_C = \GammaC$
- \item $\Gamma_P=[\,]$.
- \end{itemize}
- and thus it enriches the global environment with the following entry:
- \vskip.5em
- \ind{p}{\Gamma_I}{\Gamma_C}
- \vskip.5em
- \noindent that is:
- \vskip.5em
- \ind{0}{\GammaI}{\GammaC}
- \caption{\captionstrut Formal representation of the {\nat} inductive type.}
- \label{fig:nat}
- \end{figure}
-
- \begin{figure}[H]
- \strut If we take the following inductive definition:
-\begin{verbatim}
-Inductive list (A : Type) : Type :=
- | nil : list A
- | cons : A -> list A -> list A.
-\end{verbatim}
- then:
- \def\GammaI{\left[\begin{array}{r \colon l}
- \List & \Type\ra\Type
- \end{array}
- \right]}
- \def\GammaC{\left[\begin{array}{r \colon l}
- \Nil & \forall~A\!:\!\Type,~\List~A\\
- \cons & \forall~A\!:\!\Type,~A\ra\List~A\ra\List~A
- \end{array}
- \right]}
- \begin{itemize}
- \item $p = 1$
- \item $\Gamma_I = \GammaI$
- \item $\Gamma_C = \GammaC$
- \item $\Gamma_P=[A:\Type]$
- \end{itemize}
- and thus it enriches the global environment with the following entry:
- \vskip.5em
- \ind{1}{\GammaI}{\GammaC}
- \caption{\captionstrut Formal representation of the {\List} inductive type.}
- \label{fig:list}
- \end{figure}
-
\begin{figure}[H]
\strut If we take the following inductive definition:
\begin{verbatim}
@@ -677,76 +577,6 @@ with odd : nat -> Prop :=
\caption{\captionstrut Formal representation of the {\even} and {\odd} inductive types.}
\label{fig:even:odd}
\end{figure}
-
- \begin{figure}[H]
- \strut If we take the following inductive definition:
-\begin{verbatim}
-Inductive has_length (A : Type) : list A -> nat -> Prop :=
- | nil_hl : has_length A (nil A) O
- | cons_hl : forall (a:A) (l:list A) (n:nat),
- has_length A l n -> has_length A (cons A a l) (S n).
-\end{verbatim}
- then:
- \def\GammaI{\left[\begin{array}{r \colon l}
- \haslength & \forall~A\!:\!\Type,~\List~A\ra\nat\ra\Prop
- \end{array}
- \right]}
- \def\GammaC{\left[\begin{array}{r c l}
- \nilhl & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\haslength~A~(\Nil~A)~\nO\\
- \conshl & \hskip.1em:\hskip.1em & \forall~A\!:\!\Type,~\forall~a\!:\!A,~\forall~l\!:\!\List~A,~\forall~n\!:\!\nat,\\
- & & \haslength~A~l~n\ra \haslength~A~(\cons~A~a~l)~(\nS~n)
- \end{array}
- \right]}
- \begin{itemize}
- \item $p = 1$
- \item $\Gamma_I = \GammaI$
- \item $\Gamma_C = \GammaC$
- \item $\Gamma_P=[A:\Type]$.
- \end{itemize}
- and thus it enriches the global environment with the following entry:
- \vskip.5em
- \ind{p}{\Gamma_I}{\Gamma_C}
- %\vskip.5em
- %\noindent that is:
- %\vskip.5em
- %\ind{1}{\GammaI}{\GammaC}
- \caption{\captionstrut Formal representation of the {\haslength} inductive type.}
- \label{fig:haslength}
- \end{figure}
-
- \begin{figure}[H]
- \strut If we take the following inductive definition:
-\begin{verbatim}
-Inductive tree : Set :=
- | node : forest -> tree
-with forest : Set :=
- | emptyf : forest
- | consf : tree -> forest -> forest.
-\end{verbatim}
- then:
- \def\GammaI{\left[\begin{array}{r \colon l}
- \tree & \Set\\
- \forest & \Set
- \end{array}
- \right]}
- \def\GammaC{\left[\begin{array}{r \colon l}
- \node & \forest\ra\tree\\
- \emptyf & \forest\\
- \consf & \tree\ra\forest\ra\forest
- \end{array}
- \right]}
- \begin{itemize}
- \item $p = 0$
- \item $\Gamma_I = \GammaI$
- \item $\Gamma_C = \GammaC$
- \end{itemize}
- and thus it enriches the global environment with the following entry:
- \vskip.5em
- \ind{0}{\GammaI}{\GammaC}
- \caption{\captionstrut Formal representation of the {\tree} and {\forest} inductive types.}
- \label{fig:tree:forest}
- \end{figure}%
- \newpage
\end{latexonly}%
\subsection{Types of inductive objects}
@@ -872,7 +702,6 @@ the type $V$ satisfies the nested positivity condition for $X$
\end{itemize}
\begin{latexonly}%
- \newpage
\newcommand\vv{\textSFxi} % │
\newcommand\hh{\textSFx} % ─
\newcommand\vh{\textSFviii} % ├
@@ -883,32 +712,6 @@ the type $V$ satisfies the nested positivity condition for $X$
\newcommand\ruleref[1]{\hskip.25em\dots\hskip.2em{\em (bullet #1)}}
\def\captionstrut{\vbox to 1.5em{}}
- \begin{figure}[H]
- \ws\strut $X$ occurs strictly positively in $A\ra X$\ruleref5\\
- \ws\vv\\
- \ws\vh\hh\ws $X$does not occur in $A$\\
- \ws\vv\\
- \ws\hv\hh\ws $X$ occurs strictly positively in $X$\ruleref4
- \caption{\captionstrut A proof that $X$ occurs strictly positively in $A\ra X$.}
- \end{figure}
-
-% \begin{figure}[H]
-% \strut $X$ occurs strictly positively in $X*A$\\
-% \vv\\
-% \hv\hh $X$ occurs strictly positively in $(\Prod~X~A)$\ruleref6\\
-% \ws\ws\vv\\
-% \ws\ws\vv\ws\verb|Inductive prod (A B : Type) : Type :=|\\
-% \ws\ws\vv\ws\verb| pair : A -> B -> prod A B.|\\
-% \ws\ws\vv\\
-% \ws\ws\vh\hh $X$ does not occur in any (real) arguments of $\Prod$ in the original term $(\Prod~X~A)$\\
-% \ws\ws\vv\\
-% \ws\ws\hv\hh\ws the (instantiated) type $\Prod~X~A$ of constructor $\Pair$,\\
-% \ws\ws\ws\ws\ws satisfies the nested positivity condition for $X$\ruleref7\\
-% \ws\ws\ws\ws\ws\vv\\
-% \ws\ws\ws\ws\ws\hv\hh\ws $X$ does not occur in any (real) arguments of $(\Prod~X~A)$
-% \caption{\captionstrut A proof that $X$ occurs strictly positively in $X*A$}
-% \end{figure}
-
\begin{figure}[H]
\ws\strut $X$ occurs strictly positively in $\ListA$\ruleref6\\
\ws\vv\\
@@ -942,7 +745,6 @@ the type $V$ satisfies the nested positivity condition for $X$
\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $\ListA$\ruleref7
\caption{\captionstrut A proof that $X$ occurs strictly positively in $\ListA$}
\end{figure}
- \newpage
\end{latexonly}%
\paragraph{Correctness rules.}
--
cgit v1.2.3
From 006e1a5bf9e90fba3ba9fa1541e7ed8978c99441 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Thu, 10 Dec 2015 09:25:03 +0100
Subject: Refman, ch. 4: A few fixes.
---
doc/refman/RefMan-cic.tex | 155 ++++++++++++++++++++++++++--------------------
1 file changed, 89 insertions(+), 66 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index 3e50ac0de0..e3e49e115d 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -533,51 +533,76 @@ Additionally, for any $p$ there always exists $\Gamma_P=[a_1:A_1;\dots;a_p:A_p]$
such that each $(t:T)\in\Gamma_I\cup\Gamma_C$ can be written as:
$\forall\Gamma_P, T^\prime$ where $\Gamma_P$ is called the {\em context of parameters\index{context of parameters}}.
-\begin{latexonly}%
- \def\captionstrut{\vbox to 1.5em{}}
- \newcommand\ind[3]{$\mathsf{Ind}~[#1]\left(\hskip-.4em
+\paragraph{Examples}
+
+ \newcommand\ind[3]{$\mathsf{Ind}~[#1]\left(\hskip-.4em
\begin{array}{r @{\mathrm{~:=~}} l}
#2 & #3 \\
\end{array}
\hskip-.4em
\right)$}
+ \def\colon{@{\hskip.5em:\hskip.5em}}
- \def\colon{@{\hskip.5em:\hskip.5em}}
+The declaration for parameterized lists is:
+ \vskip.5em
- \begin{figure}[H]
- \strut If we take the following inductive definition:
-\begin{verbatim}
-Inductive even : nat -> Prop :=
- | even_O : even 0
- | even_S : forall n, odd n -> even (S n)
-with odd : nat -> Prop :=
- | odd_S : forall n, even n -> odd (S n).
-\end{verbatim}
- then:
- \def\GammaI{\left[\begin{array}{r \colon l}
+\ind{1}{\List:\Set\ra\Set}{\left[\begin{array}{r \colon l}
+ \Nil & \forall A:\Set,\List~A \\
+ \cons & \forall A:\Set, A \ra \List~A \ra \List~A
+ \end{array}\right]}
+ \vskip.5em
+
+which corresponds to the result of the \Coq\ declaration:
+\begin{coq_example*}
+Inductive list (A:Set) : Set :=
+ | nil : list A
+ | cons : A -> list A -> list A.
+\end{coq_example*}
+
+The declaration for a mutual inductive definition of forests and trees is:
+ \vskip.5em
+\ind{}{\left[\begin{array}{r \colon l}\tree&\Set\\\forest&\Set\end{array}\right]}
+ {\left[\begin{array}{r \colon l}
+ \node & \forest \ra \tree\\
+ \emptyf & \forest\\
+ \consf & \tree \ra \forest \ra \forest\\
+ \end{array}\right]}
+ \vskip.5em
+
+which corresponds to the result of the \Coq\
+declaration:
+\begin{coq_example*}
+Inductive tree : Set :=
+ node : forest -> tree
+with forest : Set :=
+ | emptyf : forest
+ | consf : tree -> forest -> forest.
+\end{coq_example*}
+
+The declaration for a mutual inductive definition of even and odd is:
+ \newcommand\GammaI{\left[\begin{array}{r \colon l}
\even & \nat\ra\Prop \\
\odd & \nat\ra\Prop
\end{array}
\right]}
- \def\GammaC{\left[\begin{array}{r \colon l}
+ \newcommand\GammaC{\left[\begin{array}{r \colon l}
\evenO & \even~\nO \\
\evenS & \forall n : \nat, \odd~n \ra \even~(\nS~n)\\
\oddS & \forall n : \nat, \even~n \ra \odd~(\nS~n)
\end{array}
\right]}
- \begin{itemize}
- \item $p = 1$
- \item $\Gamma_I = \GammaI$
- \item $\Gamma_C = \GammaC$
- \item $\Gamma_P=[A:\Type]$.
- \end{itemize}
- and thus it enriches the global environment with the following entry:
\vskip.5em
\ind{1}{\GammaI}{\GammaC}
- \caption{\captionstrut Formal representation of the {\even} and {\odd} inductive types.}
- \label{fig:even:odd}
- \end{figure}
-\end{latexonly}%
+ \vskip.5em
+which corresponds to the result of the \Coq\
+declaration:
+\begin{coq_example*}
+Inductive even : nat -> Prop :=
+ | even_O : even 0
+ | even_S : forall n, odd n -> even (S n)
+with odd : nat -> Prop :=
+ | odd_S : forall n, even n -> odd (S n).
+\end{coq_example*}
\subsection{Types of inductive objects}
We have to give the type of constants in a global environment $E$ which
@@ -595,7 +620,7 @@ contains an inductive declaration.
Provided that our environment $E$ contains inductive definitions we showed before,
these two inference rules above enable us to conclude that:
\vskip.5em
-\def\prefix{E[\Gamma]\vdash\hskip.25em}
+\newcommand\prefix{E[\Gamma]\vdash\hskip.25em}
$\begin{array}{@{} l}
\prefix\even : \nat\ra\Prop\\
\prefix\odd : \nat\ra\Prop\\
@@ -701,51 +726,49 @@ any $u_i$
the type $V$ satisfies the nested positivity condition for $X$
\end{itemize}
-\begin{latexonly}%
- \newcommand\vv{\textSFxi} % │
- \newcommand\hh{\textSFx} % ─
- \newcommand\vh{\textSFviii} % ├
- \newcommand\hv{\textSFii} % └
- \newlength\framecharacterwidth
- \settowidth\framecharacterwidth{\hh}
- \newcommand\ws{\hbox{}\hskip\the\framecharacterwidth}
- \newcommand\ruleref[1]{\hskip.25em\dots\hskip.2em{\em (bullet #1)}}
- \def\captionstrut{\vbox to 1.5em{}}
-
- \begin{figure}[H]
- \ws\strut $X$ occurs strictly positively in $\ListA$\ruleref6\\
- \ws\vv\\
- \ws\vv\ws\verb|Inductive list (A:Type) : Type :=|\\
- \ws\vv\ws\verb$ | nil : list A$\\
- \ws\vv\ws\verb$ | cons : A -> list A -> list A$\\
- \ws\vv\\
- \ws\vh\hh $X$ does not occur in any (real) arguments of $\List$\\
- \ws\vv\\
- \ws\hv\hh\ws Every instantiated constructor of $\ListA$ satisfies the nested positivity condition for $X$\\
+%% \begin{latexonly}%
+ \newcommand\vv{\textSFxi} % │
+ \newcommand\hh{\textSFx} % ─
+ \newcommand\vh{\textSFviii} % ├
+ \newcommand\hv{\textSFii} % └
+ \newlength\framecharacterwidth
+ \settowidth\framecharacterwidth{\hh}
+ \newcommand\ws{\hbox{}\hskip\the\framecharacterwidth}
+ \newcommand\ruleref[1]{\hskip.25em\dots\hskip.2em{\em (bullet #1)}}
+%% \def\captionstrut{\vbox to 1.5em{}}
+
+%% \begin{figure}[H]
+For instance, if one considers the type
+
+\begin{verbatim}
+Inductive tree (A:Type) : Type :=
+ | leaf : list A
+ | node : A -> (nat -> tree A) -> tree A
+\end{verbatim}
+
+Then every instantiated constructor of $\ListA$ satisfies the nested positivity condition for $\List$
+
+\noindent
\ws\ws\ws\ws\vv\\
\ws\ws\ws\ws\vh\hh\ws concerning type $\ListA$ of constructor $\Nil$:\\
- \ws\ws\ws\ws\vv\ws\ws\ws\ws Type $\ListA$ of constructor $\Nil$ satisfies the nested positivity condition for $X$\\
- \ws\ws\ws\ws\vv\ws\ws\ws\ws because $X$ does not appear in any (real) arguments of the type of that constructor\\
- \ws\ws\ws\ws\vv\ws\ws\ws\ws (primarily because $\List$ does not have any (real) arguments)\ruleref7\\
+ \ws\ws\ws\ws\vv\ws\ws\ws\ws Type $\ListA$ of constructor $\Nil$ satisfies the positivity condition for $\List$\\
+ \ws\ws\ws\ws\vv\ws\ws\ws\ws because $\List$ does not appear in any (real) arguments of the type of that constructor\\
+ \ws\ws\ws\ws\vv\ws\ws\ws\ws (primarily because $\List$ does not have any (real) arguments)\ruleref1\\
\ws\ws\ws\ws\vv\\
\ws\ws\ws\ws\hv\hh\ws concerning type $\forall~A\ra\ListA\ra\ListA$ of constructor $\cons$:\\
\ws\ws\ws\ws\ws\ws\ws\ws\ws Type $\forall~A:\Type,A\ra\ListA\ra\ListA$ of constructor $\cons$\\
- \ws\ws\ws\ws\ws\ws\ws\ws\ws satisfies the nested positivity condition for $X$\ruleref8\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws satisfies the positivity condition for $\List$ because:\\
\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
- \ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $\Type$\ruleref3\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $\List$ occurs only strictly positively in $\Type$\ruleref3\\
\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
- \ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $A\ra\ListA\ra\ListA$\ruleref8\\
- \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
- \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $A$\ruleref3\\
- \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
- \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $\ListA\ra\ListA$\ruleref8\\
- \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
- \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $X$ occurs only strictly positively in $\ListA$\ruleref4\\
- \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
- \ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $X$ satisfies the nested positivity condition for $\ListA$\ruleref7
- \caption{\captionstrut A proof that $X$ occurs strictly positively in $\ListA$}
- \end{figure}
-\end{latexonly}%
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $\List$ occurs only strictly positively in $A$\ruleref3\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\vh\hh\ws $\List$ occurs only strictly positively in $\ListA$\ruleref4\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\vv\\
+ \ws\ws\ws\ws\ws\ws\ws\ws\ws\hv\hh\ws $\List$ satisfies the positivity condition for $\ListA$\ruleref1
+%% \caption{\captionstrut A proof that $X$ occurs strictly positively in $\ListA$}
+%% \end{figure}
+%% \end{latexonly}%
\paragraph{Correctness rules.}
We shall now describe the rules allowing the introduction of a new
--
cgit v1.2.3
From fb77937a6ba0fe45e978911db08de57f931683e1 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Wed, 9 Dec 2015 23:38:00 +0100
Subject: Changing syntax of pat/constr1.../constrn into
pat%constr1...%constrn. Marking it as experimental.
---
doc/refman/RefMan-tac.tex | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index f367f04c43..3a3877105b 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -813,7 +813,7 @@ either:
\item the pattern \texttt{?\ident}
\item an identifier
\end{itemize}
-\item a {\em destructing introduction pattern} which itself classifies into:
+\item an {\em action introduction pattern} which itself classifies into:
\begin{itemize}
\item a {\em disjunctive/conjunctive introduction pattern}, i.e. either one of:
\begin{itemize}
@@ -828,9 +828,9 @@ either:
\item a pattern for decomposing an equality: {\tt [= $p_1$ \dots\ $p_n$]}
\item the rewriting orientations: {\tt ->} or {\tt <-}
\end{itemize}
- \item the on-the-fly application of lemmas: $p${\tt /{\term$_1$}}
- \ldots {\tt /{\term$_n$}} where $p$ itself is not an on-the-fly
- application of lemmas pattern
+ \item the on-the-fly application of lemmas: $p${\tt \%{\term$_1$}}
+ \ldots {\tt \%{\term$_n$}} where $p$ itself is not a pattern for
+ on-the-fly application of lemmas (note: syntax is in experimental stage)
\end{itemize}
\item the wildcard: {\tt \_}
\end{itemize}
@@ -898,10 +898,10 @@ introduction pattern~$p$:
itself is erased; if the term to substitute is a variable, it is
substituted also in the context of goal and the variable is removed
too;
-\item introduction over a pattern $p${\tt /{\term$_1$}} \ldots {\tt
- /{\term$_n$}} first applies {\term$_1$},\ldots, {\term$_n$} on the
+\item introduction over a pattern $p${\tt \%{\term$_1$}} \ldots {\tt
+ \%{\term$_n$}} first applies {\term$_1$},\ldots, {\term$_n$} on the
hypothesis to be introduced (as in {\tt apply }{\term}$_1$, \ldots,
- {\term}$_n$ {\tt in}), prior to the application of the introduction
+ {\term}$_n$ {\tt in}) prior to the application of the introduction
pattern $p$;
\item introduction on the wildcard depends on whether the product is
dependent or not: in the non-dependent case, it erases the
--
cgit v1.2.3
From ab3a1aed8fcaed3b0988b686b7f4cf7124b07ab2 Mon Sep 17 00:00:00 2001
From: Maxime Dénès
Date: Fri, 11 Dec 2015 12:15:17 +0100
Subject: Remove Set Virtual Machine from doc, since the command itself has
been removed.
---
doc/refman/RefMan-com.tex | 6 ------
doc/refman/RefMan-oth.tex | 20 --------------------
2 files changed, 26 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-com.tex b/doc/refman/RefMan-com.tex
index 9862abb533..8bb1cc331b 100644
--- a/doc/refman/RefMan-com.tex
+++ b/doc/refman/RefMan-com.tex
@@ -87,7 +87,6 @@ code. The list of highlight tags can be retrieved with the {\tt -list-tags}
command-line option of {\tt coqtop}.
\subsection{By command line options\index{Options of the command line}
-\label{vmoption}
\label{coqoptions}}
The following command-line options are recognized by the commands {\tt
@@ -224,11 +223,6 @@ Add physical path {\em directory} to the {\ocaml} loadpath.
\item[{\tt -no-hash-consing}] \mbox{}
-\item[{\tt -vm}]\
-
- This activates the use of the bytecode-based conversion algorithm
- for the current session (see Section~\ref{SetVirtualMachine}).
-
\item[{\tt -image} {\em file}]\
This option sets the binary image to be used by {\tt coqc} to be {\em file}
diff --git a/doc/refman/RefMan-oth.tex b/doc/refman/RefMan-oth.tex
index 4b2b8660c2..0a243308d5 100644
--- a/doc/refman/RefMan-oth.tex
+++ b/doc/refman/RefMan-oth.tex
@@ -1075,26 +1075,6 @@ perform a {\tt Ltac \ident\ := {\rm\sl convtactic}}.
\SeeAlso sections \ref{Conversion-tactics}
-\subsection{\tt Set Virtual Machine
-\label{SetVirtualMachine}
-\optindex{Virtual Machine}}
-
-This activates the bytecode-based conversion algorithm.
-
-\subsection{\tt Unset Virtual Machine
-\optindex{Virtual Machine}}
-
-This deactivates the bytecode-based conversion algorithm.
-
-\subsection{\tt Test Virtual Machine
-\optindex{Virtual Machine}}
-
-This tells if the bytecode-based conversion algorithm is
-activated. The default behavior is to have the bytecode-based
-conversion algorithm deactivated.
-
-\SeeAlso sections~\ref{vmcompute} and~\ref{vmoption}.
-
\section{Controlling the locality of commands}
\subsection{{\tt Local}, {\tt Global}
--
cgit v1.2.3
From 72bb3992d912df33bac34f3a1c21989edcf9aa02 Mon Sep 17 00:00:00 2001
From: Pierre-Marie Pédrot
Date: Sat, 12 Dec 2015 14:53:00 +0100
Subject: Indexing and documenting some options.
---
doc/refman/RefMan-ext.tex | 10 ++++++++++
doc/refman/RefMan-sch.tex | 6 ++++++
doc/refman/Universes.tex | 3 ++-
3 files changed, 18 insertions(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-ext.tex b/doc/refman/RefMan-ext.tex
index a718a26ea5..f2ab79dced 100644
--- a/doc/refman/RefMan-ext.tex
+++ b/doc/refman/RefMan-ext.tex
@@ -226,6 +226,7 @@ Definition c := {| y := 3; x := 5 |}.
This syntax can be disabled globally for printing by
\begin{quote}
{\tt Unset Printing Records.}
+\optindex{Printing Records}
\end{quote}
For a given type, one can override this using either
\begin{quote}
@@ -284,6 +285,9 @@ To deactivate the printing of projections, use
{\tt Unset Printing Projections}.
\subsection{Primitive Projections}
+\optindex{Primitive Projections}
+\optindex{Printing Primitive Projection Parameters}
+\optindex{Printing Primitive Projection Compatibility}
\index{Primitive projections}
\label{prim-proj}
@@ -314,6 +318,12 @@ for the usual defined ones.
% - [pattern x at n], [rewrite x at n] and in general abstraction and selection
% of occurrences may fail due to the disappearance of parameters.
+For compatibility, the parameters still appear to the user when printing terms
+even though they are absent in the actual AST manipulated by the kernel. This
+can be changed by unsetting the {\tt Printing Primitive Projection Parameters}
+flag. Further compatibility printing can be deactivated thanks to the
+{\tt Printing Primitive Projection Compatibility} option which governs the
+printing of pattern-matching over primitive records.
\section{Variants and extensions of {\mbox{\tt match}}
\label{Extensions-of-match}
diff --git a/doc/refman/RefMan-sch.tex b/doc/refman/RefMan-sch.tex
index 571e16d578..53aa6b86ab 100644
--- a/doc/refman/RefMan-sch.tex
+++ b/doc/refman/RefMan-sch.tex
@@ -126,6 +126,8 @@ conclusion is {\tt (n:nat)(even n)->(Q n)}.
\optindex{Boolean Equality Schemes}
\optindex{Elimination Schemes}
\optindex{Nonrecursive Elimination Schemes}
+\optindex{Case Analysis Schemes}
+\optindex{Decidable Equality Schemes}
\label{set-nonrecursive-elimination-schemes}
}
@@ -139,6 +141,10 @@ and {\tt Record} (see~\ref{Record}) do not have an automatic
declaration of the induction principles. It can be activated with the
command {\tt Set Nonrecursive Elimination Schemes}. It can be
deactivated again with {\tt Unset Nonrecursive Elimination Schemes}.
+
+In addition, the {\tt 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
diff --git a/doc/refman/Universes.tex b/doc/refman/Universes.tex
index ea3cca77ed..a08cd1475a 100644
--- a/doc/refman/Universes.tex
+++ b/doc/refman/Universes.tex
@@ -159,6 +159,7 @@ unification can have different unfolding behaviors on the same
development with universe polymorphism switched on or off.
\asection{Minimization}
+\optindex{Universe Minimization ToSet}
Universe polymorphism with cumulativity tends to generate many useless
inclusion constraints in general. Typically at each application of a
@@ -248,7 +249,7 @@ User-named universes are considered rigid for unification and are never
minimized.
\subsection{\tt Unset Strict Universe Declaration.
- \optindex{StrictUniverseDeclaration}
+ \optindex{Strict Universe Declaration}
\label{StrictUniverseDeclaration}}
The command \texttt{Unset Strict Universe Declaration} allows one to
--
cgit v1.2.3
From a275da6e67b91d9ccae0a952eb1feab2e122076e Mon Sep 17 00:00:00 2001
From: Pierre Letouzey
Date: Sun, 6 Dec 2015 12:41:55 +0100
Subject: Extraction: documentation of the new option Unset Extraction
SafeImplicits
---
doc/refman/Extraction.tex | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/Extraction.tex b/doc/refman/Extraction.tex
index 74c8374de4..a963662f64 100644
--- a/doc/refman/Extraction.tex
+++ b/doc/refman/Extraction.tex
@@ -198,6 +198,11 @@ this constant is not declared in the generated file.
\asubsection{Extra elimination of useless arguments}
+The following command provides some extra manual control on the
+code elimination performed during extraction, in a way which
+is independent but complementary to the main elimination
+principles of extraction (logical parts and types).
+
\begin{description}
\item \comindex{Extraction Implicit}
{\tt Extraction Implicit} \qualid\ [ \ident$_1$ \dots\ \ident$_n$ ].
@@ -207,12 +212,27 @@ This experimental command allows declaring some arguments of
be removed by extraction. Here \qualid\ can be any function or
inductive constructor, and \ident$_i$ are the names of the concerned
arguments. In fact, an argument can also be referred by a number
-indicating its position, starting from 1. When an actual extraction
-takes place, an error is raised if the {\tt Extraction Implicit}
+indicating its position, starting from 1.
+\end{description}
+
+When an actual extraction takes place, an error is normally raised if the
+{\tt Extraction Implicit}
declarations cannot be honored, that is if any of the implicited
-variables still occurs in the final code. This declaration of useless
-arguments is independent but complementary to the main elimination
-principles of extraction (logical parts and types).
+variables still occurs in the final code. This behavior can be relaxed
+via the following option:
+
+\begin{description}
+\item \optindex{Extraction SafeImplicits} {\tt Unset Extraction SafeImplicits.}
+
+Default is Set. When this option is Unset, a warning is emitted
+instead of an error if some implicited variables still occur in the
+final code of an extraction. This way, the extracted code may be
+obtained nonetheless and reviewed manually to locate the source of the issue
+(in the code, some comments mark the location of these remaining
+implicited variables).
+Note that this extracted code might not compile or run properly,
+depending of the use of these remaining implicited variables.
+
\end{description}
\asubsection{Realizing axioms}\label{extraction:axioms}
--
cgit v1.2.3
From 81ef6a6dc1bfc3db0e7df3e32b6446fc4d2c4008 Mon Sep 17 00:00:00 2001
From: Maxime Dénès
Date: Mon, 14 Dec 2015 11:22:54 +0100
Subject: Moved proof_admitted to its own file, named "AdmitAxiom.v".
---
doc/stdlib/index-list.html.template | 1 +
1 file changed, 1 insertion(+)
(limited to 'doc')
diff --git a/doc/stdlib/index-list.html.template b/doc/stdlib/index-list.html.template
index 866193ffb4..292b2b36cc 100644
--- a/doc/stdlib/index-list.html.template
+++ b/doc/stdlib/index-list.html.template
@@ -617,6 +617,7 @@ through the Require Import command.
Compatibility wrappers for previous versions of Coq
+ theories/Compat/AdmitAxiom.v
theories/Compat/Coq84.v
theories/Compat/Coq85.v
--
cgit v1.2.3
From 78c2ebe640e86e7357982e6e07b8121111a51fcc Mon Sep 17 00:00:00 2001
From: Maxime Dénès
Date: Mon, 14 Dec 2015 15:16:35 +0100
Subject: Remove a mention of Set Virtual Machine in doc.
---
doc/refman/RefMan-gal.tex | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-gal.tex b/doc/refman/RefMan-gal.tex
index 0e758bcab6..fcccd9cb4b 100644
--- a/doc/refman/RefMan-gal.tex
+++ b/doc/refman/RefMan-gal.tex
@@ -496,9 +496,8 @@ arguments is used for making explicit the value of implicit arguments
The expression ``{\term}~{\tt :}~{\type}'' is a type cast
expression. It enforces the type of {\term} to be {\type}.
-``{\term}~{\tt <:}~{\type}'' locally sets up the virtual machine (as if option
-{\tt Virtual Machine} were on, see \ref{SetVirtualMachine}) for checking that
-{\term} has type {\type}.
+``{\term}~{\tt <:}~{\type}'' locally sets up the virtual machine for checking
+that {\term} has type {\type}.
\subsection{Inferable subterms
\label{hole}
--
cgit v1.2.3
From 7c645566ef64f09bd6c80007c9e66305ccb90659 Mon Sep 17 00:00:00 2001
From: Maxime Dénès
Date: Mon, 14 Dec 2015 15:16:46 +0100
Subject: Fix \label which was meants to be \ref in doc of CIC terms.
---
doc/refman/RefMan-cic.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-cic.tex b/doc/refman/RefMan-cic.tex
index e3e49e115d..1554ee04d3 100644
--- a/doc/refman/RefMan-cic.tex
+++ b/doc/refman/RefMan-cic.tex
@@ -24,7 +24,7 @@ written {\it ``x:T''}. Informally, {\it ``x:T''} can be thought as
The types of types are {\em sorts}. Types and sorts are themselves
terms so that terms, types and sorts are all components of a common
syntactic language of terms which is described in
-Section~\label{cic:terms} but, first, we describe sorts.
+Section~\ref{cic:terms} but, first, we describe sorts.
\subsection[Sorts]{Sorts\label{Sorts}
\index{Sorts}}
--
cgit v1.2.3
From fa0b0bedf165812b170cedbce8a5b6cf94a5fadf Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Tue, 15 Dec 2015 04:31:01 +0100
Subject: Simplifying documentation of "assert form as pat".
---
doc/refman/RefMan-tac.tex | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index 18bcd1af62..34b974381a 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -1249,18 +1249,9 @@ in the list of subgoals remaining to prove.
introduction pattern (in particular, if {\intropattern} is {\ident},
the tactic behaves like \texttt{assert ({\ident} :\ {\form})}).
- If {\intropattern} is a disjunctive/conjunctive
- introduction pattern, the tactic behaves like \texttt{assert
- {\form}} followed by a {\tt destruct} using this introduction pattern.
-
- If {\intropattern} is a rewriting intropattern pattern, the tactic
- behaves like \texttt{assert {\form}} followed by a call to {\tt
- subst} on the resulting hypothesis, if applicable, or to {\tt
- rewrite} otherwise.
-
- If {\intropattern} is an injection intropattern pattern, the tactic
- behaves like \texttt{assert {\form}} followed by {\tt injection}
- using this introduction pattern.
+ If {\intropattern} is an action introduction pattern, the tactic
+ behaves like \texttt{assert {\form}} followed by the action done by
+ this introduction pattern.
\item \texttt{assert {\form} as {\intropattern} by {\tac}}
--
cgit v1.2.3
From 33742251e62a49c7996b96ca7077cf985627d14b Mon Sep 17 00:00:00 2001
From: Enrico Tassi
Date: Tue, 15 Dec 2015 23:15:02 +0100
Subject: Proof using: do not clear unused section hyps automatically
The option is still there, but not documented since it is too
dangerous. Hints and type classes instances are not taking cleared
variables into account.
---
doc/refman/RefMan-pro.tex | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-pro.tex b/doc/refman/RefMan-pro.tex
index 481afa8f87..ed1b79e56e 100644
--- a/doc/refman/RefMan-pro.tex
+++ b/doc/refman/RefMan-pro.tex
@@ -186,7 +186,7 @@ in Section~\ref{ProofWith}.
\subsubsection{{\tt Proof using} options}
\optindex{Default Proof Using}
\optindex{Suggest Proof Using}
-\optindex{Proof Using Clear Unused}
+% \optindex{Proof Using Clear Unused}
The following options modify the behavior of {\tt Proof using}.
@@ -201,12 +201,12 @@ The following options modify the behavior of {\tt Proof using}.
When {\tt Qed} is performed, suggest a {\tt using} annotation if
the user did not provide one.
-\variant{\tt Unset Proof Using Clear Unused.}
-
- When {\tt Proof using a} all section variables but for {\tt a} and
- the variables used in the type of {\tt a} are cleared.
- This option can be used to turn off this behavior.
-
+% \variant{\tt Unset Proof Using Clear Unused.}
+%
+% When {\tt Proof using a} all section variables but for {\tt a} and
+% the variables used in the type of {\tt a} are cleared.
+% This option can be used to turn off this behavior.
+%
\subsubsection[\tt Collection]{Name a set of section hypotheses for {\tt Proof using}}
\comindex{Collection}\label{Collection}
--
cgit v1.2.3
From b8d1e84e9326df34383e5e5c8c5842cb7013b935 Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Wed, 16 Dec 2015 18:30:32 +0100
Subject: Add a "simple refine" variant of "refine" that does not call
"shelve_unifiable".
---
doc/refman/RefMan-tac.tex | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index 3a3877105b..d90a027295 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -219,8 +219,10 @@ difference: the user can leave some holes (denoted by \texttt{\_} or
{\tt (\_:\type)}) in the term. {\tt refine} will generate as
many subgoals as there are holes in the term. The type of holes must be
either synthesized by the system or declared by an
-explicit cast like \verb|(_:nat->Prop)|. This low-level
-tactic can be useful to advanced users.
+explicit cast like \verb|(_:nat->Prop)|. Any subgoal that occurs in other
+subgoals is automatically shelved, as if calling {\tt shelve\_unifiable}
+(see Section~\ref{shelve}).
+This low-level tactic can be useful to advanced users.
\Example
@@ -256,6 +258,13 @@ Defined.
which type cannot be inferred. Put a cast around it.
\end{ErrMsgs}
+\begin{Variants}
+\item {\tt simple refine \term}\tacindex{simple refine}
+
+ This tactic behaves like {\tt refine}, but it does not shelve any
+ subgoal. It does not perform any beta-reduction either.
+\end{Variants}
+
\subsection{\tt apply \term}
\tacindex{apply}
\label{apply}
@@ -4964,8 +4973,8 @@ back into focus with the command {\tt Unshelve} (Section~\ref{unshelve}).
\begin{Variants}
\item \texttt{shelve\_unifiable}\tacindex{shelve\_unifiable}
- Shelves only these goals under focused which are mentioned in other goals.
- Goals which appear in the type of other goals can be solve by unification.
+ Shelves only the goals under focus that are mentioned in other goals.
+ Goals that appear in the type of other goals can be solved by unification.
\Example
\begin{coq_example}
--
cgit v1.2.3
From 04394d4f17bff1739930ddca5d31cb9bb031078b Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Wed, 16 Dec 2015 22:37:32 +0100
Subject: Updating credits.
---
doc/refman/RefMan-pre.tex | 73 +++++++++++++++++++++++++++++++++++------------
1 file changed, 54 insertions(+), 19 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-pre.tex b/doc/refman/RefMan-pre.tex
index f45072ca43..e0dc496666 100644
--- a/doc/refman/RefMan-pre.tex
+++ b/doc/refman/RefMan-pre.tex
@@ -956,20 +956,20 @@ Ltac language dependent subgoals, deep backtracking and multiple goal
handling, along with miscellaneous features and an improved potential
for future modifications. Dependent subgoals allow statements in a
goal to mention the proof of another. Proofs of unsolved subgoals
-appear as existential variables. Primitive backtracking make it
+appear as existential variables. Primitive backtracking makes it
possible to write a tactic with several possible outcomes which are
tried successively when subsequent tactics fail. Primitives are also
available to control the backtracking behavior of tactics. Multiple
goal handling paves the way for smarter automation tactics. It is
currently used for simple goal manipulation such as goal reordering.
-The way Coq processes a document in batch and interactive mode has
+The way {\Coq} processes a document in batch and interactive mode has
been redesigned by Enrico Tassi with help from Bruno Barras. Opaque
proofs, the text between Proof and Qed, can be processed
asynchronously, decoupling the checking of definitions and statements
from the checking of proofs. It improves the responsiveness of
interactive development, since proofs can be processed in the
-background. Similarly compilation of a file can be split into two
+background. Similarly, compilation of a file can be split into two
phases: the first one checking only definitions and statements and the
second one checking proofs. A file resulting from the first
phase~--~with the .vio extension~--~can be already Required. All .vio
@@ -977,13 +977,13 @@ files can be turned into complete .vo files in parallel. The same
infrastructure also allows terminating tactics to be run in parallel
on a set of goals via the \verb=par:= goal selector.
-CoqIDE was modified to cope with asynchronous checking of the
-document. Its source code was also made separate from that of Coq, so
-that CoqIDE no longer has a special status among user interfaces,
-paving the way for decoupling its release cycle from that of Coq in
+{\CoqIDE} was modified to cope with asynchronous checking of the
+document. Its source code was also made separate from that of {\Coq}, so
+that {\CoqIDE} no longer has a special status among user interfaces,
+paving the way for decoupling its release cycle from that of {\Coq} in
the future.
-Carst Tankink developed a Coq back end for user interfaces built on
+Carst Tankink developed a {\Coq} back-end for user interfaces built on
Makarius Wenzel's Prover IDE framework (PIDE), like PIDE/jEdit (with
help from Makarius Wenzel) or PIDE/Coqoon (with help from Alexander
Faithfull and Jesper Bengtson). The development of such features was
@@ -1017,7 +1017,7 @@ principles such as propositional extensionality and univalence, thanks to
Maxime Dénès and Bruno Barras. To ensure compatibility with the
univalence axiom, a new flag ``-indices-matter'' has been implemented,
taking into account the universe levels of indices when computing the
-levels of inductive types. This supports using Coq as a tool to explore
+levels of inductive types. This supports using {\Coq} as a tool to explore
the relations between homotopy theory and type theory.
Maxime Dénès and Benjamin Grégoire developed an implementation of
@@ -1025,17 +1025,23 @@ conversion test and normal form computation using the OCaml native
compiler. It complements the virtual machine conversion offering much
faster computation for expensive functions.
-{\Coq} 8.5 also comes with a bunch of many various smaller-scale changes
-and improvements regarding the different components of the system.
+{\Coq} 8.5 also comes with a bunch of many various smaller-scale
+changes and improvements regarding the different components of the
+system. We shall only list a few of them.
+
+Pierre Boutillier developed an improved tactic for simplification of
+expressions called {\tt cbn}.
-Maxime Dénès maintained the bytecode-based reduction machine.
+Maxime Dénès maintained the bytecode-based reduction machine. Pierre
+Letouzey maintained the extraction mechanism.
Pierre-Marie Pédrot has extended the syntax of terms to,
experimentally, allow holes in terms to be solved by a locally
specified tactic.
Existential variables are referred to by identifiers rather than mere
-numbers, thanks to Hugo Herbelin.
+numbers, thanks to Hugo Herbelin who also improved the tactic language
+here and there.
Error messages for universe inconsistencies have been improved by
Matthieu Sozeau. Error messages for unification and type inference
@@ -1043,14 +1049,43 @@ failures have been improved by Hugo Herbelin, Pierre-Marie Pédrot and
Arnaud Spiwack.
Pierre Courtieu contributed new features for using {\Coq} through Proof
-General and for better interactive experience (bullets, Search etc).
-
-A distribution channel for Coq packages using the Opam tool has been
-developed by Thomas Braibant and Guillaume Claret.
+General and for better interactive experience (bullets, Search, etc).
+
+The efficiency of the whole system has been significantly improved
+thanks to contributions from Pierre-Marie Pédrot.
+
+A distribution channel for {\Coq} packages using the OPAM tool has
+been initiated by Thomas Braibant and developed by Guillaume Claret,
+with contributions by Enrico Tassi and feedback from Hugo Herbelin.
+
+Packaging tools were provided by Pierre Letouzey and Enrico Tassi
+(Windows), Pierre Boutillier, Matthieu Sozeau and Maxime Dénès (MacOS
+X). Maxime Dénès improved significantly the testing and benchmarking
+support.
+
+Many power users helped to improve the design of the new features via
+the bug tracker, the coq development mailing list or the coq-club
+mailing list. Special thanks are going to the users who contributed
+patches and intensive brain-storming, starting with Jason Gross,
+Jonathan Leivent, Greg Malecha, Clément Pit-Claudel, Marc Lasson,
+Lionel Rieg. It would however be impossible to mention with precision
+all names of people who to some extent influenced the development.
+
+Version 8.5 is one of the most important release of {\Coq}. Its
+development spanned over about 3 years and a half with about one year
+of beta-testing. General maintenance during part or whole of this
+period has been done by Pierre Boutillier, Pierre Courtieu, Maxime
+Dénès, Hugo Herbelin, Pierre Letouzey, Guillaume Melquiond,
+Pierre-Marie Pédrot, Matthieu Sozeau, Arnaud Spiwack, Enrico Tassi as
+well as Bruno Barras, Yves Bertot, Frédéric Besson, Xavier Clerc,
+Pierre Corbineau, Jean-Christophe Filliâtre, Julien Forest, Sébastien
+Hinderer, Assia Mahboubi, Jean-Marc Notin, Yann Régis-Gianas, François
+Ripault, Carst Tankink. Maxime Dénès brilliantly coordinated the
+release process.
\begin{flushright}
-Paris, January 2015\\
-Hugo Herbelin \& Matthieu Sozeau\\
+Paris, January 2015, revised December 2015,\\
+Hugo Herbelin, Matthieu Sozeau and the {\Coq} development team\\
\end{flushright}
--
cgit v1.2.3
From 84f54fd0923c15109910123443348c193e37fe0f Mon Sep 17 00:00:00 2001
From: Matej Kosik
Date: Wed, 16 Dec 2015 15:44:14 +0100
Subject: TYPOGRAPHY: correction of one particular error in the Reference
Manual
---
doc/refman/RefMan-ltac.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-ltac.tex b/doc/refman/RefMan-ltac.tex
index 2f07beb725..cc7e6b53bf 100644
--- a/doc/refman/RefMan-ltac.tex
+++ b/doc/refman/RefMan-ltac.tex
@@ -1101,7 +1101,7 @@ using the syntax:
{\tt Ltac} {\qualid} {\ident}$_1$ ... {\ident}$_n$ {\tt ::=}
{\tacexpr}
\end{quote}
-A previous definition of \qualid must exist in the environment.
+A previous definition of {\qualid} must exist in the environment.
The new definition will always be used instead of the old one and
it goes accross module boundaries.
--
cgit v1.2.3
From 905e3dd364e8be20771c39393e7e114f2e4b8cd8 Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Wed, 6 Jan 2016 16:26:04 +0100
Subject: Fix description of command-line options in the manual.
---
doc/refman/RefMan-com.tex | 225 +++++++++++++++++++++++++++-------------------
1 file changed, 132 insertions(+), 93 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-com.tex b/doc/refman/RefMan-com.tex
index 8bb1cc331b..6f85849888 100644
--- a/doc/refman/RefMan-com.tex
+++ b/doc/refman/RefMan-com.tex
@@ -5,9 +5,9 @@
There are three \Coq~commands:
\begin{itemize}
-\item {\tt coqtop}: The \Coq\ toplevel (interactive mode) ;
-\item {\tt coqc} : The \Coq\ compiler (batch compilation).
-\item {\tt coqchk} : The \Coq\ checker (validation of compiled libraries)
+\item {\tt coqtop}: the \Coq\ toplevel (interactive mode);
+\item {\tt coqc}: the \Coq\ compiler (batch compilation);
+\item {\tt coqchk}: the \Coq\ checker (validation of compiled libraries).
\end{itemize}
The options are (basically) the same for the first two commands, and
roughly described below. You can also look at the \verb!man! pages of
@@ -39,11 +39,10 @@ The {\tt coqc} command takes a name {\em file} as argument. Then it
looks for a vernacular file named {\em file}{\tt .v}, and tries to
compile it into a {\em file}{\tt .vo} file (See ~\ref{compiled}).
-\Warning The name {\em file} must be a regular {\Coq} identifier, as
-defined in the Section~\ref{lexical}. It
-must only contain letters, digits or underscores
-(\_). Thus it can be \verb+/bar/foo/toto.v+ but cannot be
-\verb+/bar/foo/to-to.v+.
+\Warning The name {\em file} should be a regular {\Coq} identifier, as
+defined in Section~\ref{lexical}. It should contain only letters, digits
+or underscores (\_). For instance, \verb+/bar/foo/toto.v+ is valid, but
+\verb+/bar/foo/to-to.v+ is invalid.
\section[Customization]{Customization at launch time}
@@ -64,7 +63,7 @@ directories to the load path of \Coq.
It is possible to skip the loading of the resource file with the
option \verb:-q:.
-\section{By environment variables\label{EnvVariables}
+\subsection{By environment variables\label{EnvVariables}
\index{Environment variables}\label{envars}}
Load path can be specified to the \Coq\ system by setting up
@@ -93,13 +92,13 @@ The following command-line options are recognized by the commands {\tt
coqc} and {\tt coqtop}, unless stated otherwise:
\begin{description}
-\item[{\tt -I} {\em directory}, {\tt -include} {\em directory}]\
+\item[{\tt -I} {\em directory}, {\tt -include} {\em directory}]\ %
-Add physical path {\em directory} to the {\ocaml} loadpath.
+ Add physical path {\em directory} to the {\ocaml} loadpath.
\SeeAlso Section~\ref{Libraries} and the command {\tt Declare ML Module} Section \ref{compiled}.
-\item[\texttt{-Q} \emph{directory} {\dirpath}]\
+\item[{\tt -Q} {\em directory} {\dirpath}]\ %
Add physical path \emph{directory} to the list of directories where
{\Coq} looks for a file and bind it to the the logical directory
@@ -109,147 +108,184 @@ Add physical path {\em directory} to the {\ocaml} loadpath.
\SeeAlso Section~\ref{Libraries}.
-\item[{\tt -R} {\em directory} {\dirpath}]\
+\item[{\tt -R} {\em directory} {\dirpath}]\ %
Do as \texttt{-Q} \emph{directory} {\dirpath} but make the
subdirectory structure of \emph{directory} recursively visible so
that the recursive contents of physical \emph{directory} is available
from {\Coq} using short or partially qualified names.
-
+
\SeeAlso Section~\ref{Libraries}.
-\item[{\tt -top} {\dirpath}, {\tt -notop}]\
+\item[{\tt -top} {\dirpath}]\ %
+
+ Set the toplevel module name to {\dirpath} instead of {\tt Top}. Not
+ valid for {\tt coqc} as the toplevel module name is inferred from the
+ name of the output file.
+
+\item[{\tt -notop}]\ %
+
+ Use the empty logical path for the toplevel module name instead of {\tt
+ Top}. Not valid for {\tt coqc} as the toplevel module name is
+ inferred from the name of the output file.
+
+\item[{\tt -exclude-dir} {\em directory}]\ %
- This sets the toplevel module name to {\dirpath}/the empty logical path instead
- of {\tt Top}. Not valid for {\tt coqc}.
+ Exclude any subdirectory named {\em directory} while
+ processing options such as {\tt -R} and {\tt -Q}. By default, only the
+ conventional version control management directories named {\tt CVS} and
+ {\tt \_darcs} are excluded.
-\item[{\tt -exclude-dir} {\em subdirectory}]\
+\item[{\tt -nois}]\ %
- This tells to exclude any subdirectory named {\em subdirectory}
- while processing option {\tt -R}. Without this option only the
- conventional version control management subdirectories named {\tt
- CVS} and {\tt \_darcs} are excluded.
+ Start from an empty state instead of loading the {\tt Init.Prelude}
+ module.
-\item[{\tt -nois}]\
+\item[{\tt -init-file} {\em file}]\ %
- Cause \Coq~to begin with an empty state.
+ Load {\em file} as the resource file instead of loading the default
+ resource file from the standard configuration directories.
-\item[{\tt -init-file} {\em file}, {\tt -q}]\
+\item[{\tt -q}]\ %
- Take {\em file} as the resource file. /
- Cause \Coq~not to load the resource file.
+ Do not to load the default resource file.
-\item[{\tt -load-ml-source} {\em file}]\
+\item[{\tt -load-ml-source} {\em file}]\ %
Load the {\ocaml} source file {\em file}.
-\item[{\tt -load-ml-object} {\em file}]\
+\item[{\tt -load-ml-object} {\em file}]\ %
Load the {\ocaml} object file {\em file}.
-\item[{\tt -l[v]} {\em file}, {\tt -load-vernac-source[-verbose]} {\em file}]\
+\item[{\tt -l} {\em file}, {\tt -load-vernac-source} {\em file}]\ %
+
+ Load and execute the {\Coq} script from {\em file.v}.
+
+\item[{\tt -lv} {\em file}, {\tt -load-vernac-source-verbose} {\em
+ file}]\ %
+
+ Load and execute the {\Coq} script from {\em file.v}.
+ Output its content on the standard input as it is executed.
+
+\item[{\tt -load-vernac-object} {\dirpath}]\ %
+
+ Load \Coq~compiled library {\dirpath}. This is equivalent to running
+ {\tt Require} {\dirpath}.
- Load \Coq~file {\em file}{\tt .v} optionally with copy it contents on the
- standard input.
+\item[{\tt -require} {\dirpath}]\ %
-\item[{\tt -load-vernac-object} {\em path}]\
+ Load \Coq~compiled library {\dirpath} and import it. This is equivalent
+ to running {\tt Require Import} {\dirpath}.
- Load \Coq~compiled library {\em path} (equivalent to {\tt Require} {\em path}).
+\item[{\tt -batch}]\ %
-\item[{\tt -require} {\em path}]\
+ Exit just after argument parsing. Available for {\tt coqtop} only.
- Load \Coq~compiled library {\em path} and import it (equivalent to {\tt
- Require Import} {\em path}).
+\item[{\tt -compile} {\em file.v}]\ %
-\item[{\tt -compile} {\em file.v},{\tt -compile-verbose} {\em file.v}, {\tt -batch}]\
+ Compile file {\em file.v} into {\em file.vo}. This options imply {\tt
+ -batch} (exit just after argument parsing). It is available only
+ for {\tt coqtop}, as this behavior is the purpose of {\tt coqc}.
- {\tt coqtop} options only used internally by {\tt coqc}.
+\item[{\tt -compile-verbose} {\em file.v}]\ %
- This compiles file {\em file.v} into {\em file}{\tt .vo} without/with a
- copy of the contents of the file on standard input. This option implies options
- {\tt -batch} (exit just after arguments parsing). It is only
- available for {\tt coqtop}.
+ Same as {\tt -compile} but also output the content of {\em file.v} as
+ it is compiled.
-\item[{\tt -verbose}]\
+\item[{\tt -verbose}]\ %
- This option is only for {\tt coqc}. It tells to compile the file with
- a copy of its contents on standard input.
+ Output the content of the input file as it is compiled. This option is
+ available for {\tt coqc} only; it is the counterpart of {\tt
+ -compile-verbose}.
%Mostly unused in the code
-%\item[{\tt -debug}]\
+%\item[{\tt -debug}]\ %
%
% Switch on the debug flag.
-\item[{\tt -with-geoproof} (yes|no)]\
+\item[{\tt -with-geoproof} (yes|no)]\ %
- Activate or not special functions for Geoproof within {\CoqIDE} (default is yes).
+ Enable or not special functions for Geoproof within {\CoqIDE} (default
+ is yes).
-\item[{\tt -color} (on|off|auto)]\
+\item[{\tt -color} (on|off|auto)]\ %
- Activate or not the coloring of output of {\tt coqtop}. The default, auto,
- means that {\tt coqtop} will dynamically decide whether to activate it
- depending if the output channels of {\tt coqtop} can handle ANSI styles.
+ Enable or not the coloring of output of {\tt coqtop}. Default is auto,
+ meaning that {\tt coqtop} dynamically decides, depending on whether the
+ output channel supports ANSI escape sequences.
-\item[{\tt -beautify}]\
+\item[{\tt -beautify}]\ %
- While compiling {\em file}, pretty prints each command just after having parsing
- it in {\em file}{\tt .beautified} in order to get old-fashion
- syntax/definitions/notations.
+ Pretty-print each command to {\em file.beautified} when compiling {\em
+ file.v}, in order to get old-fashioned syntax/definitions/notations.
-\item[{\tt -emacs}, {\tt -ide-slave}]\
+\item[{\tt -emacs}, {\tt -ide-slave}]\ %
- Start a special main loop to communicate with ide.
+ Start a special toplevel to communicate with a specific IDE.
-\item[{\tt -impredicative-set}]\
+\item[{\tt -impredicative-set}]\ %
Change the logical theory of {\Coq} by declaring the sort {\tt Set}
- impredicative; warning: this is known to be inconsistent with
+ impredicative. Warning: this is known to be inconsistent with
some standard axioms of classical mathematics such as the functional
- axiom of choice or the principle of description
+ axiom of choice or the principle of description.
-\item[{\tt -type-in-type}]\
+\item[{\tt -type-in-type}]\ %
- This collapses the universe hierarchy of {\Coq} making the logic inconsistent.
+ Collapse the universe hierarchy of {\Coq}. Warning: this makes the
+ logic inconsistent.
-\item[{\tt -compat} {\em version}] \mbox{}
+\item[{\tt -compat} {\em version}]\ %
- Attempt to maintain some of the incompatible changes in their {\em version}
- behavior.
+ Attempt to maintain some backward-compatibility with a previous version.
-\item[{\tt -dump-glob} {\em file}]\
+\item[{\tt -dump-glob} {\em file}]\ %
- This dumps references for global names in file {\em file}
- (to be used by coqdoc, see~\ref{coqdoc})
+ Dump references for global names in file {\em file} (to be used
+ by {\tt coqdoc}, see~\ref{coqdoc}). By default, if {\em file.v} is being
+ compiled, {\em file.glob} is used.
-\item[{\tt -no-hash-consing}] \mbox{}
+\item[{\tt -no-glob}]\ %
-\item[{\tt -image} {\em file}]\
+ Disable the dumping of references for global names.
- This option sets the binary image to be used by {\tt coqc} to be {\em file}
+%\item[{\tt -no-hash-consing}]\ %
+
+\item[{\tt -image} {\em file}]\ %
+
+ Set the binary image to be used by {\tt coqc} to be {\em file}
instead of the standard one. Not of general use.
-\item[{\tt -bindir} {\em directory}]\
+\item[{\tt -bindir} {\em directory}]\ %
+
+ Set the directory containing {\Coq} binaries to be used by {\tt coqc}.
+ It is equivalent to doing \texttt{export COQBIN=}{\em directory} before
+ launching {\tt coqc}.
+
+\item[{\tt -where}]\ %
+
+ Print the location of \Coq's standard library and exit.
- Set for {\tt coqc} the directory containing \Coq\ binaries.
- It is equivalent to do \texttt{export COQBIN=}{\em directory}
- before launching {\tt coqc}.
+\item[{\tt -config}]\ %
-\item[{\tt -where}, {\tt -config}, {\tt -filteropts}]\
+ Print the locations of \Coq's binaries, dependencies, and libraries, then exit.
- Print the \Coq's standard library location or \Coq's binaries, dependencies,
- libraries locations or the list of command line arguments that {\tt coqtop} has
- recognize as options and exit.
+\item[{\tt -filteropts}]\ %
-\item[{\tt -v}]\
+ Print the list of command line arguments that {\tt coqtop} has
+ recognized as options and exit.
- Print the \Coq's version and exit.
+\item[{\tt -v}]\ %
-\item[{\tt -list-tags}]\
+ Print \Coq's version and exit.
- Print the highlight tags known by \Coq as well as their currently associated
- color.
+\item[{\tt -list-tags}]\ %
-\item[{\tt -h}, {\tt --help}]\
+ Print the highlight tags known by {\Coq} as well as their currently associated
+ color and exit.
+
+\item[{\tt -h}, {\tt --help}]\ %
Print a short usage and exit.
@@ -293,18 +329,21 @@ Command-line options {\tt -I}, {\tt -R}, {\tt -where} and
{\tt -impredicative-set} are supported by {\tt coqchk} and have the
same meaning as for {\tt coqtop}. Extra options are:
\begin{description}
-\item[{\tt -norec} $module$]\
+\item[{\tt -norec} {\em module}]\ %
+
+ Check {\em module} but do not check its dependencies.
- Check $module$ but do not force check of its dependencies.
-\item[{\tt -admit} $module$] \
+\item[{\tt -admit} {\em module}]\ %
- Do not check $module$ and any of its dependencies, unless
+ Do not check {\em module} and any of its dependencies, unless
explicitly required.
-\item[{\tt -o}]\
+
+\item[{\tt -o}]\ %
At exit, print a summary about the context. List the names of all
assumptions and variables (constants without body).
-\item[{\tt -silent}]\
+
+\item[{\tt -silent}]\ %
Do not write progress information in standard output.
\end{description}
--
cgit v1.2.3
From 4dbf44a47949adce5e538a7aacc670ec64c28d3f Mon Sep 17 00:00:00 2001
From: Enrico Tassi
Date: Tue, 12 Jan 2016 10:39:49 +0100
Subject: restore documentation of admit
---
doc/refman/RefMan-tac.tex | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index d90a027295..11d62b60a3 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -1468,6 +1468,24 @@ a hypothesis or in the body or the type of a local definition.
\end{Variants}
+\subsection{\tt admit}
+\tacindex{admit}
+\tacindex{give\_up}
+\label{admit}
+
+The {\tt admit} tactic allows temporarily skipping a subgoal so as to
+progress further in the rest of the proof. A proof containing
+admitted goals cannot be closed with {\tt Qed} but only with
+{\tt Admitted}.
+
+\begin{Variants}
+
+ \item {\tt give\_up}
+
+ Synonym of {\tt admit}.
+
+\end{Variants}
+
\subsection{\tt absurd \term}
\tacindex{absurd}
\label{absurd}
--
cgit v1.2.3
From 682ddc2d278b345c4c72da6c8a8d17cc82a076ec Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Tue, 12 Jan 2016 10:46:43 +0100
Subject: Documenting option 'Set Bracketing Last Introduction Pattern'.
---
doc/refman/RefMan-tac.tex | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index 11d62b60a3..ce934871f3 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -864,16 +864,17 @@ introduction pattern~$p$:
expects the product to be over an inductive type
whose number of constructors is $n$ (or more generally over a type
of conclusion an inductive type built from $n$ constructors,
- e.g. {\tt C -> A\textbackslash/B if $n=2$}): it destructs the introduced
+ e.g. {\tt C -> A\textbackslash/B} with $n=2$ since {\tt
+ A\textbackslash/B} has 2 constructors): it destructs the introduced
hypothesis as {\tt destruct} (see Section~\ref{destruct}) would and
applies on each generated subgoal the corresponding tactic;
\texttt{intros}~$p_{i1}$ {\ldots} $p_{im_i}$; if the disjunctive
- pattern is part of a sequence of patterns and is not the last
- pattern of the sequence, then {\Coq} completes the pattern so that all
- the argument of the constructors of the inductive type are
- introduced (for instance, the list of patterns {\tt [$\;$|$\;$] H}
- applied on goal {\tt forall x:nat, x=0 -> 0=x} behaves the same as
- the list of patterns {\tt [$\,$|$\,$?$\,$] H});
+ pattern is part of a sequence of patterns, then {\Coq} completes the
+ pattern so that all the arguments of the constructors of the
+ inductive type are introduced (for instance, the list of patterns
+ {\tt [$\;$|$\;$] H} applied on goal {\tt forall x:nat, x=0 -> 0=x}
+ behaves the same as the list of patterns {\tt [$\,$|$\,$?$\,$] H},
+ up to one exception explained in the Remark below);
\item introduction over a conjunction of patterns {\tt ($p_1$, \ldots,
$p_n$)} expects the goal to be a product over an inductive type $I$ with a
single constructor that itself has at least $n$ arguments: it
@@ -887,10 +888,10 @@ introduction pattern~$p$:
{\tt ($p_1$,(\ldots,(\dots,$p_n$)\ldots))}; it expects the
hypothesis to be a sequence of right-associative binary inductive
constructors such as {\tt conj} or {\tt ex\_intro}; for instance, an
- hypothesis with type {\tt A\verb|/\|exists x, B\verb|/\|C\verb|/\|D} can be
+ hypothesis with type {\tt A\verb|/\|(exists x, B\verb|/\|C\verb|/\|D)} can be
introduced via pattern {\tt (a \& x \& b \& c \& d)};
\item if the product is over an equality type, then a pattern of the
- form {\tt [=$p_{1}$ \dots\ $p_n$]} applies either {\tt injection}
+ form {\tt [= $p_{1}$ \dots\ $p_n$]} applies either {\tt injection}
(see Section~\ref{injection}) or {\tt discriminate} (see
Section~\ref{discriminate}) instead of {\tt destruct}; if {\tt
injection} is applicable, the patterns $p_1$, \ldots, $p_n$ are
@@ -950,6 +951,7 @@ Abort.
\Rem {\tt intros $p_1~\ldots~p_n$} is not fully equivalent to
\texttt{intros $p_1$;\ldots; intros $p_n$} for the following reasons:
+\label{bracketing-last}
\begin{itemize}
\item A wildcard pattern never succeeds when applied isolated on a
dependent product, while it succeeds as part of a list of
@@ -971,6 +973,13 @@ Show 2.
\end{itemize}
+This later behavior can be avoided by setting the following option:
+
+\begin{quote}
+\optindex{Bracketing Last Introduction Pattern}
+{\tt Set Bracketing Last Introduction Pattern}
+\end{quote}
+
\subsection{\tt clear \ident}
\tacindex{clear}
\label{clear}
--
cgit v1.2.3
From f5de32ad1600cd18a6f1f286729c979e868ad088 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Tue, 12 Jan 2016 11:32:54 +0100
Subject: Documenting options "Intuition Negation Unfolding", "Intuition Iff
Unfolding".
---
doc/refman/RefMan-tac.tex | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index ce934871f3..b07cfb7d59 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -4233,6 +4233,38 @@ incompatibilities.
Is equivalent to {\tt intuition auto with *}.
\end{Variants}
+\optindex{Intuition Negation Unfolding}
+\optindex{Intuition Iff Unfolding}
+
+Some aspects of the tactic {\tt intuition} can be
+controlled using options. To avoid that inner negations which do not
+need to be unfolded are unfolded, use:
+
+\begin{quote}
+{\tt Unset Intuition Negation Unfolding}
+\end{quote}
+
+To do that all negations of the goal are unfolded even inner ones
+(this is the default), use:
+
+\begin{quote}
+{\tt Set Intuition Negation Unfolding}
+\end{quote}
+
+To avoid that inner occurrence of {\tt iff} which do not need to be
+unfolded are unfolded (this is the default), use:
+
+\begin{quote}
+{\tt Unset Intuition Iff Unfolding}
+\end{quote}
+
+To do that all negations of the goal are unfolded even inner ones
+(this is the default), use:
+
+\begin{quote}
+{\tt Set Intuition Iff Unfolding}
+\end{quote}
+
% En attente d'un moyen de valoriser les fichiers de demos
%\SeeAlso file \texttt{contrib/Rocq/DEMOS/Demo\_tauto.v}
--
cgit v1.2.3
From e21e8c2804d047d4b80613e31bec0bc7320b7e8b Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Tue, 12 Jan 2016 11:48:45 +0100
Subject: Documenting dtauto and dintuition.
---
doc/refman/RefMan-tac.tex | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index b07cfb7d59..b3a730e675 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -4149,6 +4149,7 @@ The tactic {\tt exists (n // m)} did not fail. The hole was solved by
\subsection{\tt tauto}
\tacindex{tauto}
+\tacindex{dtauto}
\label{tauto}
This tactic implements a decision procedure for intuitionistic propositional
@@ -4197,8 +4198,21 @@ Abort.
because \verb=(forall x:nat, ~ A -> P x)= cannot be treated as atomic and an
instantiation of \verb=x= is necessary.
+\begin{Variants}
+
+\item {\tt dtauto}
+
+ While {\tt tauto} recognizes inductively defined connectives
+ isomorphic to the standard connective {\tt and}, {\tt prod}, {\tt
+ or}, {\tt sum}, {\tt False}, {\tt Empty\_set}, {\tt unit}, {\tt
+ True}, {\tt dtauto} recognizes also all inductive types with
+ one constructors and no indices, i.e. record-style connectives.
+
+\end{Variants}
+
\subsection{\tt intuition \tac}
\tacindex{intuition}
+\tacindex{dintuition}
\label{intuition}
The tactic \texttt{intuition} takes advantage of the search-tree built
@@ -4231,6 +4245,15 @@ incompatibilities.
\item {\tt intuition}
Is equivalent to {\tt intuition auto with *}.
+
+\item {\tt dintuition}
+
+ While {\tt intuition} recognizes inductively defined connectives
+ isomorphic to the standard connective {\tt and}, {\tt prod}, {\tt
+ or}, {\tt sum}, {\tt False}, {\tt Empty\_set}, {\tt unit}, {\tt
+ True}, {\tt dintuition} recognizes also all inductive types with
+ one constructors and no indices, i.e. record-style connectives.
+
\end{Variants}
\optindex{Intuition Negation Unfolding}
--
cgit v1.2.3
From 94b3068c688b289ec26005d13251fc1c3dae6998 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Tue, 12 Jan 2016 12:14:41 +0100
Subject: Referring to coq.inria.fr/stdlib for more on libraries and ltac-level
tactics.
---
doc/refman/RefMan-lib.tex | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-lib.tex b/doc/refman/RefMan-lib.tex
index 7227f4b7b6..4ebb484e7c 100644
--- a/doc/refman/RefMan-lib.tex
+++ b/doc/refman/RefMan-lib.tex
@@ -17,10 +17,11 @@ The \Coq\ library is structured into two parts:
In addition, user-provided libraries or developments are provided by
\Coq\ users' community. These libraries and developments are available
-for download at \texttt{http://coq.inria.fr} (see
+for download at \url{http://coq.inria.fr} (see
Section~\ref{Contributions}).
-The chapter briefly reviews the \Coq\ libraries.
+The chapter briefly reviews the \Coq\ libraries whose contents can
+also be browsed at \url{http://coq.inria.fr/stdlib}.
\section[The basic library]{The basic library\label{Prelude}}
@@ -799,7 +800,9 @@ At the end, it defines data-types at the {\Type} level.
\subsection{Tactics}
A few tactics defined at the user level are provided in the initial
-state\footnote{This is in module {\tt Tactics.v}}.
+state\footnote{This is in module {\tt Tactics.v}}. They are listed at
+\url{http://coq.inria.fr/stdlib} (paragraph {\tt Init}, link {\tt
+ Tactics}).
\section{The standard library}
@@ -842,7 +845,7 @@ Chapter~\ref{Other-commands}).
The different modules of the \Coq\ standard library are described in the
additional document \verb!Library.dvi!. They are also accessible on the WWW
through the \Coq\ homepage
-\footnote{\texttt{http://coq.inria.fr}}.
+\footnote{\url{http://coq.inria.fr}}.
\subsection[Notations for integer arithmetics]{Notations for integer arithmetics\index{Arithmetical notations}}
@@ -1035,7 +1038,7 @@ intros; split_Rmult.
\end{itemize}
-All this tactics has been written with the tactic language Ltac
+These tactics has been written with the tactic language Ltac
described in Chapter~\ref{TacticLanguage}.
\begin{coq_eval}
--
cgit v1.2.3
From 4b4a4b6b41e6b303d556638ed2a79b1493b1ecf4 Mon Sep 17 00:00:00 2001
From: Pierre Letouzey
Date: Wed, 13 Jan 2016 17:38:27 +0100
Subject: MMaps: remove it from final 8.5 release, since this new library isn't
mature enough
In particular, its interface might still change (in interaction with interested
colleagues). So let's not give it too much visibility yet. Instead, I'll turn
it as an opam packages for now.
---
doc/stdlib/index-list.html.template | 7 -------
1 file changed, 7 deletions(-)
(limited to 'doc')
diff --git a/doc/stdlib/index-list.html.template b/doc/stdlib/index-list.html.template
index 292b2b36cc..d6b1af797f 100644
--- a/doc/stdlib/index-list.html.template
+++ b/doc/stdlib/index-list.html.template
@@ -476,13 +476,6 @@ through the Require Import command.
theories/MSets/MSetPositive.v
theories/MSets/MSetToFiniteSet.v
(theories/MSets/MSets.v)
- theories/MMaps/MMapAVL.v
- theories/MMaps/MMapFacts.v
- theories/MMaps/MMapInterface.v
- theories/MMaps/MMapList.v
- theories/MMaps/MMapPositive.v
- theories/MMaps/MMapWeakList.v
- (theories/MMaps/MMaps.v)
FSets:
--
cgit v1.2.3
From 072aa1f8c4e3ff08d1343e1f068a41648c06b7fd Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Thu, 14 Jan 2016 10:07:31 +0100
Subject: Updating and improving the documentation of intros patterns.
In particular, documenting bracketing of last pattern on by default.
---
doc/common/macros.tex | 1 +
doc/refman/RefMan-tac.tex | 112 +++++++++++++++++++++-------------------------
2 files changed, 51 insertions(+), 62 deletions(-)
(limited to 'doc')
diff --git a/doc/common/macros.tex b/doc/common/macros.tex
index 3b12f259b6..077e2f0dfb 100644
--- a/doc/common/macros.tex
+++ b/doc/common/macros.tex
@@ -198,6 +198,7 @@
\newcommand{\pattern}{\nterm{pattern}} % pattern for pattern-matching
\newcommand{\orpattern}{\nterm{or\_pattern}}
\newcommand{\intropattern}{\nterm{intro\_pattern}}
+\newcommand{\intropatternlist}{\nterm{intro\_pattern\_list}}
\newcommand{\disjconjintropattern}{\nterm{disj\_conj\_intro\_pattern}}
\newcommand{\namingintropattern}{\nterm{naming\_intro\_pattern}}
\newcommand{\termpattern}{\nterm{term\_pattern}} % term with holes
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index 815594d8e9..36bd036a95 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -802,7 +802,7 @@ the tactic {\tt intro} applies the tactic {\tt hnf} until the tactic
\end{Variants}
-\subsection{\tt intros {\intropattern} \mbox{\dots} \intropattern}
+\subsection{\tt intros {\intropatternlist}}
\label{intros-pattern}
\tacindex{intros \intropattern}
\index{Introduction patterns}
@@ -811,9 +811,11 @@ the tactic {\tt intro} applies the tactic {\tt hnf} until the tactic
\index{Disjunctive/conjunctive introduction patterns}
\index{Equality introduction patterns}
-
-This extension of the tactic {\tt intros} combines introduction of
-variables or hypotheses and case analysis. An {\em introduction pattern} is
+This extension of the tactic {\tt intros} allows to apply tactics on
+the fly on the variables or hypotheses which have been introduced. An
+{\em introduction pattern list} {\intropatternlist} is a list of
+introduction patterns possibly containing the filling introduction
+patterns {\tt *} and {\tt **}. An {\em introduction pattern} is
either:
\begin{itemize}
\item a {\em naming introduction pattern}, i.e. either one of:
@@ -827,7 +829,7 @@ either:
\item a {\em disjunctive/conjunctive introduction pattern}, i.e. either one of:
\begin{itemize}
\item a disjunction of lists of patterns:
- {\tt [$p_{11}$ \dots\ $p_{1m_1}$ | \dots\ | $p_{11}$ \dots\ $p_{nm_n}$]}
+ {\tt [$\intropatternlist_1$ | \dots\ | $\intropatternlist_n$]}
\item a conjunction of patterns: {\tt ($p_1$ , \dots\ , $p_n$)}
\item a list of patterns {\tt ($p_1$ \&\ \dots\ \&\ $p_n$)}
for sequence of right-associative binary constructs
@@ -844,10 +846,6 @@ either:
\item the wildcard: {\tt \_}
\end{itemize}
-Introduction patterns can be combined into lists. An {\em introduction
- pattern list} is a list of introduction patterns possibly containing
-the filling introduction patterns {\tt *} and {\tt **}.
-
Assuming a goal of type $Q \to P$ (non-dependent product), or
of type $\forall x:T,~P$ (dependent product), the behavior of
{\tt intros $p$} is defined inductively over the structure of the
@@ -860,21 +858,22 @@ introduction pattern~$p$:
\item introduction on \texttt{\ident} behaves as described in
Section~\ref{intro};
\item introduction over a disjunction of list of patterns {\tt
- [$p_{11}$ \dots\ $p_{1m_1}$ | \dots\ | $p_{11}$ \dots\ $p_{nm_n}$]}
- expects the product to be over an inductive type
- whose number of constructors is $n$ (or more generally over a type
- of conclusion an inductive type built from $n$ constructors,
- e.g. {\tt C -> A\textbackslash/B} with $n=2$ since {\tt
- A\textbackslash/B} has 2 constructors): it destructs the introduced
- hypothesis as {\tt destruct} (see Section~\ref{destruct}) would and
- applies on each generated subgoal the corresponding tactic;
- \texttt{intros}~$p_{i1}$ {\ldots} $p_{im_i}$; if the disjunctive
- pattern is part of a sequence of patterns, then {\Coq} completes the
- pattern so that all the arguments of the constructors of the
- inductive type are introduced (for instance, the list of patterns
- {\tt [$\;$|$\;$] H} applied on goal {\tt forall x:nat, x=0 -> 0=x}
- behaves the same as the list of patterns {\tt [$\,$|$\,$?$\,$] H},
- up to one exception explained in the Remark below);
+ [$\intropatternlist_{1}$ | \dots\ | $\intropatternlist_n$]} expects
+ the product to be over an inductive type whose number of
+ constructors is $n$ (or more generally over a type of conclusion an
+ inductive type built from $n$ constructors, e.g. {\tt C ->
+ A\textbackslash/B} with $n=2$ since {\tt A\textbackslash/B} has 2
+ constructors): it destructs the introduced hypothesis as {\tt
+ destruct} (see Section~\ref{destruct}) would and applies on each
+ generated subgoal the corresponding tactic;
+ \texttt{intros}~$\intropatternlist_i$. The introduction patterns in
+ $\intropatternlist_i$ are expected to consume no more than the
+ number of arguments of the $i^{\mbox{\scriptsize th}}$
+ constructor. If it consumes less, then {\Coq} completes the pattern
+ so that all the arguments of the constructors of the inductive type
+ are introduced (for instance, the list of patterns {\tt [$\;$|$\;$]
+ H} applied on goal {\tt forall x:nat, x=0 -> 0=x} behaves the same
+ as the list of patterns {\tt [$\,$|$\,$?$\,$] H});
\item introduction over a conjunction of patterns {\tt ($p_1$, \ldots,
$p_n$)} expects the goal to be a product over an inductive type $I$ with a
single constructor that itself has at least $n$ arguments: it
@@ -926,19 +925,6 @@ introduction pattern~$p$:
not any more a quantification or an implication.
\end{itemize}
-Then, if $p_1$ ... $p_n$ is a list of introduction patterns possibly
-containing {\tt *} or {\tt **}, {\tt intros $p_1$ ... $p_n$}
-\begin{itemize}
-\item introduction over {\tt *} introduces all forthcoming quantified
- variables appearing in a row;
-\item introduction over {\tt **} introduces all forthcoming quantified
- variables or hypotheses until the goal is not any more a
- quantification or an implication;
-\item introduction over an introduction pattern $p$ introduces the
- forthcoming quantified variables or premise of the goal and applies
- the introduction pattern $p$ to it.
-\end{itemize}
-
\Example
\begin{coq_example}
@@ -949,37 +935,39 @@ intros * [a | (_,c)] f.
Abort.
\end{coq_eval}
-\Rem {\tt intros $p_1~\ldots~p_n$} is not fully equivalent to
-\texttt{intros $p_1$;\ldots; intros $p_n$} for the following reasons:
-\label{bracketing-last}
-\begin{itemize}
-\item A wildcard pattern never succeeds when applied isolated on a
- dependent product, while it succeeds as part of a list of
- introduction patterns if the hypotheses that depends on it are
- erased too.
-\item A disjunctive or conjunctive pattern followed by an introduction
- pattern forces the introduction in the context of all arguments of
- the constructors before applying the next pattern while a terminal
- disjunctive or conjunctive pattern does not. Here is an example
-
-\begin{coq_example}
-Goal forall n:nat, n = 0 -> n = 0.
-intros [ | ] H.
-Show 2.
-Undo.
-intros [ | ]; intros H.
-Show 2.
-\end{coq_example}
+\Rem {\tt intros $p_1~\ldots~p_n$} is not equivalent to \texttt{intros
+ $p_1$;\ldots; intros $p_n$} for the following reason: If one of the
+$p_i$ is a wildcard pattern, he might succeed in the first case
+because the further hypotheses it depends in are eventually erased too
+while it might fail in the second case because of dependencies in
+hypotheses which are not yet introduced (and a fortiori not yet
+erased).
+
+\Rem In {\tt intros $\intropatternlist$}, if the last introduction
+pattern is a disjunctive or conjunctive pattern {\tt
+ [$\intropatternlist_1$ | \dots\ | $\intropatternlist_n$]}, the
+completion of $\intropatternlist_i$ so that all the arguments of the
+$i^{\mbox{\scriptsize th}}$ constructors of the corresponding
+inductive type are introduced can be controlled with the
+following option:
+\optindex{Bracketing Last Introduction Pattern}
-\end{itemize}
+\begin{quote}
+{\tt Set Bracketing Last Introduction Pattern}
+\end{quote}
-This later behavior can be avoided by setting the following option:
+Force completion, if needed, when the last introduction pattern is a
+disjunctive or conjunctive pattern (this is the default).
\begin{quote}
-\optindex{Bracketing Last Introduction Pattern}
-{\tt Set Bracketing Last Introduction Pattern}
+{\tt Unset Bracketing Last Introduction Pattern}
\end{quote}
+Deactivate completion when the last introduction pattern is a disjunctive
+or conjunctive pattern.
+
+
+
\subsection{\tt clear \ident}
\tacindex{clear}
\label{clear}
--
cgit v1.2.3
From 13e969e644a6ad23f6d326f3e4a253ae0393da9c Mon Sep 17 00:00:00 2001
From: Maxime Dénès
Date: Fri, 15 Jan 2016 20:29:41 +0100
Subject: Thanks Hugo, but let's remain factual.
---
doc/refman/RefMan-pre.tex | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-pre.tex b/doc/refman/RefMan-pre.tex
index e0dc496666..cb2ab5dc2f 100644
--- a/doc/refman/RefMan-pre.tex
+++ b/doc/refman/RefMan-pre.tex
@@ -1080,8 +1080,7 @@ Pierre-Marie Pédrot, Matthieu Sozeau, Arnaud Spiwack, Enrico Tassi as
well as Bruno Barras, Yves Bertot, Frédéric Besson, Xavier Clerc,
Pierre Corbineau, Jean-Christophe Filliâtre, Julien Forest, Sébastien
Hinderer, Assia Mahboubi, Jean-Marc Notin, Yann Régis-Gianas, François
-Ripault, Carst Tankink. Maxime Dénès brilliantly coordinated the
-release process.
+Ripault, Carst Tankink. Maxime Dénès coordinated the release process.
\begin{flushright}
Paris, January 2015, revised December 2015,\\
--
cgit v1.2.3
From 281e4cb8b04c7fd13ec6416e4dcd05ffa1f48761 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Tue, 19 Jan 2016 16:56:11 +0100
Subject: Clarifying the documentation of tactics "cbv" and "lazy".
Following a discussion on coq-club on Jan 13, 2016.
---
doc/refman/RefMan-tac.tex | 40 +++++++++++++++++++++++++---------------
1 file changed, 25 insertions(+), 15 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index b3a730e675..9a365b8297 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -3047,23 +3047,33 @@ variables bound by a let-in construction inside the term itself (use
here the {\tt zeta} flag). In any cases, opaque constants are not
unfolded (see Section~\ref{Opaque}).
-The goal may be normalized with two strategies: {\em lazy} ({\tt lazy}
-tactic), or {\em call-by-value} ({\tt cbv} tactic). The lazy strategy
-is a call-by-need strategy, with sharing of reductions: the arguments of a
-function call are partially evaluated only when necessary, and if an
-argument is used several times then it is computed only once. This
-reduction is efficient for reducing expressions with dead code. For
-instance, the proofs of a proposition {\tt exists~$x$. $P(x)$} reduce to a
-pair of a witness $t$, and a proof that $t$ satisfies the predicate
-$P$. Most of the time, $t$ may be computed without computing the proof
-of $P(t)$, thanks to the lazy strategy.
+Normalization according to the flags is done by first evaluating the
+head of the expression into a {\em weak-head} normal form, i.e. until
+the evaluation is bloked by a variable (or an opaque constant, or an
+axiom), as e.g. in {\tt x\;u$_1$\;...\;u$_n$}, or {\tt match x with
+ ... end}, or {\tt (fix f x \{struct x\} := ...) x}, or is a
+constructed form (a $\lambda$-expression, a constructor, a cofixpoint,
+an inductive type, a product type, a sort), or is a redex that the
+flags prevent to reduce. Once a weak-head normal form is obtained,
+subterms are recursively reduced using the same strategy.
+
+Reduction to weak-head normal form can be done using two strategies:
+{\em lazy} ({\tt lazy} tactic), or {\em call-by-value} ({\tt cbv}
+tactic). The lazy strategy is a call-by-need strategy, with sharing of
+reductions: the arguments of a function call are weakly evaluated only
+when necessary, and if an argument is used several times then it is
+weakly computed only once. This reduction is efficient for reducing
+expressions with dead code. For instance, the proofs of a proposition
+{\tt exists~$x$. $P(x)$} reduce to a pair of a witness $t$, and a
+proof that $t$ satisfies the predicate $P$. Most of the time, $t$ may
+be computed without computing the proof of $P(t)$, thanks to the lazy
+strategy.
The call-by-value strategy is the one used in ML languages: the
-arguments of a function call are evaluated first, using a weak
-reduction (no reduction under the $\lambda$-abstractions). Despite the
-lazy strategy always performs fewer reductions than the call-by-value
-strategy, the latter is generally more efficient for evaluating purely
-computational expressions (i.e. with few dead code).
+arguments of a function call are systematically weakly evaluated
+first. Despite the lazy strategy always performs fewer reductions than
+the call-by-value strategy, the latter is generally more efficient for
+evaluating purely computational expressions (i.e. with few dead code).
\begin{Variants}
\item {\tt compute} \tacindex{compute}\\
--
cgit v1.2.3
From 1af878e0dac2198ae487d0b37438520772f28350 Mon Sep 17 00:00:00 2001
From: Hugo Herbelin
Date: Tue, 19 Jan 2016 17:07:32 +0100
Subject: Documenting Set Bullet Behavior.
This is useful for restoring bullets after e.g. loading ssreflect.
Hoping Arnaud is ok in documenting it.
---
doc/refman/RefMan-pro.tex | 13 +++++++++++++
1 file changed, 13 insertions(+)
(limited to 'doc')
diff --git a/doc/refman/RefMan-pro.tex b/doc/refman/RefMan-pro.tex
index ed1b79e56e..c37367de5b 100644
--- a/doc/refman/RefMan-pro.tex
+++ b/doc/refman/RefMan-pro.tex
@@ -407,6 +407,19 @@ Proof.
\end{ErrMsgs}
+The bullet behavior can be controlled by the following commands.
+
+\begin{quote}
+Set Bullet Behavior "None".
+\end{quote}
+
+This makes bullets inactive.
+
+\begin{quote}
+Set Bullet Behavior "Strict Subproofs".
+\end{quote}
+
+This makes bullets active (this is the default behavior).
\section{Requesting information}
--
cgit v1.2.3
From af5eafaee218935c35f0bd906727d2d2370bd136 Mon Sep 17 00:00:00 2001
From: Maxime Dénès
Date: Wed, 20 Jan 2016 15:57:24 +0100
Subject: Change $(...)$ to ltac:(...) in section 2.11. Fixes #4500.
---
doc/refman/RefMan-ext.tex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-ext.tex b/doc/refman/RefMan-ext.tex
index f2ab79dced..51e881bff4 100644
--- a/doc/refman/RefMan-ext.tex
+++ b/doc/refman/RefMan-ext.tex
@@ -2014,7 +2014,7 @@ variables, use
Instead of letting the unification engine try to solve an existential variable
by itself, one can also provide an explicit hole together with a tactic to solve
-it. Using the syntax {\tt \textdollar(\expr)\textdollar}, the user can put a
+it. Using the syntax {\tt ltac:(\expr)}, the user can put a
tactic anywhere a term is expected. The order of resolution is not specified and
is implementation-dependent. The inner tactic may use any variable defined in
its scope, including repeated alternations between variables introduced by term
--
cgit v1.2.3
From 86f5c0cbfa64c5d0949365369529c5b607878ef8 Mon Sep 17 00:00:00 2001
From: Maxime Dénès
Date: Wed, 20 Jan 2016 17:25:10 +0100
Subject: Update copyright headers.
---
doc/common/styles/html/coqremote/cover.html | 2 +-
doc/common/styles/html/simple/cover.html | 2 +-
doc/common/title.tex | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
(limited to 'doc')
diff --git a/doc/common/styles/html/coqremote/cover.html b/doc/common/styles/html/coqremote/cover.html
index db82717094..6ec4dc1af0 100644
--- a/doc/common/styles/html/coqremote/cover.html
+++ b/doc/common/styles/html/coqremote/cover.html
@@ -60,7 +60,7 @@
V8.2 © INRIA 2008-2011
V8.3 © INRIA 2010-2011
V8.4 © INRIA 2012-2014
- V8.5 © INRIA 2015
+ V8.5 © INRIA 2015-2016
This research was partly supported by IST
diff --git a/doc/common/styles/html/simple/cover.html b/doc/common/styles/html/simple/cover.html
index 1641a1ed37..328bd68daf 100644
--- a/doc/common/styles/html/simple/cover.html
+++ b/doc/common/styles/html/simple/cover.html
@@ -38,7 +38,7 @@
V8.2 © INRIA 2008-2011
V8.3 © INRIA 2010-2011
V8.4 © INRIA 2012-2014
- V8.5 © INRIA 2015
+ V8.5 © INRIA 2015-2016
This research was partly supported by IST
diff --git a/doc/common/title.tex b/doc/common/title.tex
index 4716c3156a..0e072b6b65 100644
--- a/doc/common/title.tex
+++ b/doc/common/title.tex
@@ -45,7 +45,7 @@ V\coqversion, \today
%END LATEX
\copyright INRIA 1999-2004 ({\Coq} versions 7.x)
-\copyright INRIA 2004-2015 ({\Coq} versions 8.x)
+\copyright INRIA 2004-2016 ({\Coq} versions 8.x)
#3
\end{flushleft}
--
cgit v1.2.3
From 20fe4afb53e2b68ffb06a5504a444e536d4b813e Mon Sep 17 00:00:00 2001
From: Matthieu Sozeau
Date: Wed, 24 Feb 2016 16:06:40 +0100
Subject: Document Hint Mode, cleanup Hint doc.
---
doc/refman/RefMan-tac.tex | 40 ++++++++++++++++++----------------------
1 file changed, 18 insertions(+), 22 deletions(-)
(limited to 'doc')
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex
index 9a365b8297..903e2e19af 100644
--- a/doc/refman/RefMan-tac.tex
+++ b/doc/refman/RefMan-tac.tex
@@ -3669,9 +3669,6 @@ The {\hintdef} is one of the following expressions:
the number of subgoals generated by {\tt simple apply {\term}}.
%{\tt auto} actually uses a slightly modified variant of {\tt simple apply} with use_metas_eagerly_in_conv_on_closed_terms set to false
- The cost of that hint is the number of subgoals generated by that
- tactic.
-
% Is it really needed?
%% In case the inferred type of \term\ does not start with a product
%% the tactic added in the hint list is {\tt exact {\term}}. In case
@@ -3869,7 +3866,25 @@ is to set the cut expression to $c | e$, the initial cut expression
being \texttt{emp}.
+\item \texttt{Mode} {\tt (+ | -)}$^*$ {\qualid}
+\label{HintMode}
+\comindex{Hint Mode}
+
+This sets an optional mode of use of the identifier {\qualid}. When
+proof-search faces a goal that ends in an application of {\qualid} to
+arguments {\tt \term$_1$ \mbox{\dots} \term$_n$}, the mode tells if the
+hints associated to qualid can be applied or not. A mode specification
+is a list of $n$ {\tt +} or {\tt -} items that specify if an argument is
+to be treated as an input {\tt +} or an output {\tt -} of the
+identifier. For a mode to match a list of arguments, input terms \emph{must
+not} contain existential variables, 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.
+{\tt 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.
\end{itemize}
@@ -3877,25 +3892,6 @@ being \texttt{emp}.
pattern-matching on hypotheses using \texttt{match goal with} inside
the tactic.
-\begin{Variants}
-\item {\tt Hint \hintdef}
-
- No database name is given: the hint is registered in the {\tt core}
- database.
-
-\item {\tt Hint Local {\hintdef} : \ident$_1$ \mbox{\dots} \ident$_n$}
-
- 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 {\tt Local} is useless since hints do not
- survive anyway to the closure of sections.
-
-\item {\tt Hint Local \hintdef}
-
- Idem for the {\tt core} database.
-
-\end{Variants}
-
% There are shortcuts that allow to define several goal at once:
% \begin{itemize}
--
cgit v1.2.3