diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/refman/CanonicalStructures.tex | 2 | ||||
| -rw-r--r-- | doc/refman/RefMan-ltac.tex | 2 | ||||
| -rw-r--r-- | doc/refman/RefMan-syn.tex | 2 | ||||
| -rw-r--r-- | doc/refman/RefMan-tac.tex | 53 | ||||
| -rw-r--r-- | doc/stdlib/index-list.html.template | 2 | ||||
| -rw-r--r-- | doc/tutorial/Tutorial.tex | 56 |
6 files changed, 73 insertions, 44 deletions
diff --git a/doc/refman/CanonicalStructures.tex b/doc/refman/CanonicalStructures.tex index a3372c2965..275e1c2d55 100644 --- a/doc/refman/CanonicalStructures.tex +++ b/doc/refman/CanonicalStructures.tex @@ -4,7 +4,7 @@ \label{CS-full} \index{Canonical Structures!presentation} -This chapter explains the basics of Canonical Structure and how thy can be used +\noindent This chapter explains the basics of Canonical Structure and how they can be used to overload notations and build a hierarchy of algebraic structures. The examples are taken from~\cite{CSwcu}. We invite the interested reader to refer to this paper for all the details that are omitted here for brevity. diff --git a/doc/refman/RefMan-ltac.tex b/doc/refman/RefMan-ltac.tex index cc7e6b53bf..12dea9a306 100644 --- a/doc/refman/RefMan-ltac.tex +++ b/doc/refman/RefMan-ltac.tex @@ -1116,6 +1116,8 @@ Defined {\ltac} functions can be displayed using the command {\tt Print Ltac {\qualid}.} \end{quote} +The command {\tt Print Ltac Signatures\comindex{Print Ltac Signatures}} displays a list of all user-defined tactics, with their arguments. + \section{Debugging {\ltac} tactics} \subsection[Info trace]{Info trace\comindex{Info}\optindex{Info Level}} diff --git a/doc/refman/RefMan-syn.tex b/doc/refman/RefMan-syn.tex index 3af72db78e..1f08b6a2f1 100644 --- a/doc/refman/RefMan-syn.tex +++ b/doc/refman/RefMan-syn.tex @@ -358,7 +358,7 @@ state of {\Coq}. Reserved Notation "x = y" (at level 70, no associativity). \end{coq_example} -Reserving a notation is also useful for simultaneously defined an +Reserving a notation is also useful for simultaneously defining an inductive type or a recursive constant and a notation for it. \Rem The notations mentioned on Figure~\ref{init-notations} are diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex index f5a1bf3b22..54450fe7dc 100644 --- a/doc/refman/RefMan-tac.tex +++ b/doc/refman/RefMan-tac.tex @@ -2833,42 +2833,57 @@ This tactic is deprecated. It can be replaced by {\tt enough} \tacindex{subst} \optindex{Regular Subst Tactic} -This tactic applies to a goal that has \ident\ in its context and -(at least) one hypothesis, say {\tt H}, of type {\tt - \ident=t} or {\tt t=\ident}. Then it replaces -\ident\ by {\tt t} everywhere in the goal (in the hypotheses -and in the conclusion) and clears \ident\ and {\tt H} from the context. +This tactic applies to a goal that has \ident\ in its context and (at +least) one hypothesis, say $H$, of type {\tt \ident} = $t$ or $t$ +{\tt = \ident} with {\ident} not occurring in $t$. Then it replaces +{\ident} by $t$ everywhere in the goal (in the hypotheses and in the +conclusion) and clears {\ident} and $H$ from the context. + +If {\ident} is a local definition of the form {\ident} := $t$, it is +also unfolded and cleared. + +\Rem +When several hypotheses have the form {\tt \ident} = $t$ or {\tt + $t$ = \ident}, the first one is used. \Rem -When several hypotheses have the form {\tt \ident=t} or {\tt - t=\ident}, the first one is used. +If $H$ is itself dependent in the goal, it is replaced by the +proof of reflexivity of equality. \begin{Variants} - \item {\tt subst \ident$_1$ \dots \ident$_n$} + \item {\tt subst \ident$_1$ {\dots} \ident$_n$} - Is equivalent to {\tt subst \ident$_1$; \dots; subst \ident$_n$}. + This is equivalent to {\tt subst \ident$_1$; \dots; subst \ident$_n$}. \item {\tt subst} - Applies {\tt subst} repeatedly to all identifiers from the context - for which an equality exists. + This applies {\tt subst} repeatedly from top to bottom to all + identifiers of the context for which an equality of the form {\tt + \ident} = $t$ or $t$ {\tt = \ident} or {\tt \ident} := $t$ exists, with + {\ident} not occurring in $t$. -\noindent {\bf Remark: } The behavior of {\tt subst} can be controlled using option {\tt Set - Regular Subst Tactic}. When this option is activated, {\tt subst} - manages the following corner cases which otherwise it - does not: +\noindent {\bf Remark: } The behavior of {\tt subst} can be controlled +using option {\tt Set Regular Subst Tactic}. When this option is +activated, {\tt subst} also deals with the following corner cases: \begin{itemize} \item A context with ordered hypotheses {\tt \ident$_1$ = \ident$_2$} and {\tt \ident$_1$ = $t$}, or {$t'$ = \ident$_1$} with $t'$ not a variable, and no other hypotheses of the form {\tt \ident$_2$ = $u$} - or {\tt $u$ = \ident$_2$} + or {\tt $u$ = \ident$_2$}; without the option, a second call to {\tt + subst} would be necessary to replace {\ident$_2$} by $t$ or $t'$ + respectively. + \item A context with cyclic dependencies as with hypotheses {\tt - \ident$_1$ = f~\ident$_2$} and {\tt \ident$_2$ = g~\ident$_1$} + \ident$_1$ = f~\ident$_2$} and {\tt \ident$_2$ = g~\ident$_1$} which + without the option would be a cause of failure of {\tt subst}. \end{itemize} -Additionally, it prevents a local definition such as {\tt \ident := - $t$} to be unfolded which otherwise it would exceptionally unfold in +Additionally, it prevents a local definition such as {\tt \ident} := + $t$ to be unfolded which otherwise it would exceptionally unfold in configurations containing hypotheses of the form {\tt {\ident} = $u$}, or {\tt $u'$ = \ident} with $u'$ not a variable. +Finally, it preserves the initial order of hypotheses, which without +the option it may break. + The option is on by default. \end{Variants} diff --git a/doc/stdlib/index-list.html.template b/doc/stdlib/index-list.html.template index a12983ab84..fb45777e7f 100644 --- a/doc/stdlib/index-list.html.template +++ b/doc/stdlib/index-list.html.template @@ -21,6 +21,7 @@ through the <tt>Require Import</tt> command.</p> theories/Init/Peano.v theories/Init/Specif.v theories/Init/Tactics.v + theories/Init/Tauto.v theories/Init/Wf.v (theories/Init/Prelude.v) </dd> @@ -203,6 +204,7 @@ through the <tt>Require Import</tt> command.</p> (theories/QArith/QArith.v) theories/QArith/Qreals.v theories/QArith/Qcanon.v + theories/QArith/Qcabs.v theories/QArith/Qround.v theories/QArith/QOrderedType.v theories/QArith/Qminmax.v diff --git a/doc/tutorial/Tutorial.tex b/doc/tutorial/Tutorial.tex index e09feeb8eb..973a0b75e0 100644 --- a/doc/tutorial/Tutorial.tex +++ b/doc/tutorial/Tutorial.tex @@ -248,11 +248,14 @@ explicitly the type of the quantified variable. We check: \begin{coq_example} Check (forall m:nat, gt m 0). \end{coq_example} -We may clean-up the development by removing the contents of the -current section: +We may revert to the clean state of +our initial session using the \Coq~ \verb:Reset: command: \begin{coq_example} -Reset Declaration. +Reset Initial. \end{coq_example} +\begin{coq_eval} +Set Printing Width 60. +\end{coq_eval} \section{Introduction to the proof engine: Minimal Logic} @@ -658,10 +661,8 @@ respectively 1 and 2. Such abstract entities may be entered in the context as global variables. But we must be careful about the pollution of our global environment by such declarations. For instance, we have already polluted our \Coq~ session by declaring the variables -\verb:n:, \verb:Pos_n:, \verb:A:, \verb:B:, and \verb:C:. If we want to revert to the clean state of -our initial session, we may use the \Coq~ \verb:Reset: command, which returns -to the state just prior the given global notion as we did before to -remove a section, or we may return to the initial state using~: +\verb:n:, \verb:Pos_n:, \verb:A:, \verb:B:, and \verb:C:. + \begin{coq_example} Reset Initial. \end{coq_example} @@ -770,7 +771,7 @@ Let us now close the current section. End R_sym_trans. \end{coq_example} -Here \Coq's printout is a warning that all local hypotheses have been +All the local hypotheses have been discharged in the statement of \verb:refl_if:, which now becomes a general theorem in the first-order language declared in section \verb:Predicate_calculus:. In this particular example, the use of section @@ -1105,8 +1106,14 @@ mathematical justification of a logical development relies only on Conversely, ordinary mathematical definitions can be unfolded at will, they are {\sl transparent}. + \chapter{Induction} +\begin{coq_eval} +Reset Initial. +Set Printing Width 60. +\end{coq_eval} + \section{Data Types as Inductively Defined Mathematical Collections} All the notions which were studied until now pertain to traditional @@ -1195,7 +1202,7 @@ That is, instead of computing for natural \verb:i: an element of the indexed \verb:Set: \verb:(P i):, \verb:prim_rec: computes uniformly an element of \verb:nat:. Let us check the type of \verb:prim_rec:: \begin{coq_example} -Check prim_rec. +About prim_rec. \end{coq_example} Oops! Instead of the expected type \verb+nat->(nat->nat->nat)->nat->nat+ we @@ -1241,22 +1248,16 @@ Fixpoint plus (n m:nat) {struct n} : nat := For the rest of the session, we shall clean up what we did so far with types \verb:bool: and \verb:nat:, in order to use the initial definitions given in \Coq's \verb:Prelude: module, and not to get confusing error -messages due to our redefinitions. We thus revert to the state before -our definition of \verb:bool: with the \verb:Reset: command: +messages due to our redefinitions. We thus revert to the initial state: \begin{coq_example} -Reset bool. -\end{coq_example} - - -\subsection{Simple proofs by induction} - -\begin{coq_eval} Reset Initial. -\end{coq_eval} +\end{coq_example} \begin{coq_eval} Set Printing Width 60. \end{coq_eval} +\subsection{Simple proofs by induction} + Let us now show how to do proofs by structural induction. We start with easy properties of the \verb:plus: function we just defined. Let us first show that $n=n+0$. @@ -1480,6 +1481,11 @@ Qed. \chapter{Modules} +\begin{coq_eval} +Reset Initial. +Set Printing Width 60. +\end{coq_eval} + \section{Opening library modules} When you start \Coq~ without further requirements in the command line, @@ -1543,9 +1549,13 @@ definitions available in the current context, especially if large libraries have been loaded. A convenient \verb:Search: command is available to lookup all known facts concerning a given predicate. For instance, if you want to know all the -known lemmas about the less or equal relation, just ask: +known lemmas about both the successor and the less or equal relation, just ask: +\begin{coq_eval} +Reset Initial. +Set Printing Width 60. +\end{coq_eval} \begin{coq_example} -Search le. +Search S le. \end{coq_example} Another command \verb:SearchHead: displays only lemmas where the searched predicate appears at the head position in the conclusion. @@ -1553,9 +1563,9 @@ predicate appears at the head position in the conclusion. SearchHead le. \end{coq_example} -A new and more convenient search tool is \textsf{SearchPattern} +A new and more convenient search tool is \verb:SearchPattern: developed by Yves Bertot. It allows finding the theorems with a -conclusion matching a given pattern, where \verb:\_: can be used in +conclusion matching a given pattern, where \verb:_: can be used in place of an arbitrary term. We remark in this example, that \Coq{} provides usual infix notations for arithmetic operators. |
