~ubuntu-branches/ubuntu/wily/coq-doc/wily

« back to all changes in this revision

Viewing changes to doc/refman/RefMan-pro.tex

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu, Stéphane Glondu, Samuel Mimram
  • Date: 2010-01-07 22:50:39 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100107225039-n3cq82589u0qt0s2
Tags: 8.2pl1-1
[ Stéphane Glondu ]
* New upstream release (Closes: #563669)
  - remove patches
* Packaging overhaul:
  - use git, advertise it in Vcs-* fields of debian/control
  - use debhelper 7 and dh with override
  - use source format 3.0 (quilt)
* debian/control:
  - set Maintainer to d-o-m, set Uploaders to Sam and myself
  - add Homepage field
  - bump Standards-Version to 3.8.3
* Register PDF documentation into doc-base
* Add debian/watch
* Update debian/copyright

[ Samuel Mimram ]
* Change coq-doc's description to mention that it provides documentation in
  pdf format, not postscript, closes: #543545.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\chapter[Proof handling]{Proof handling\index{Proof editing}
 
2
\label{Proof-handling}}
 
3
 
 
4
In \Coq's proof editing mode all top-level commands documented in 
 
5
Chapter~\ref{Vernacular-commands} remain available
 
6
and the user has access to specialized commands dealing with proof
 
7
development pragmas documented in this section. He can also use some
 
8
other specialized commands called {\em tactics}.  They are the very
 
9
tools allowing the user to deal with logical reasoning. They are
 
10
documented in Chapter~\ref{Tactics}.\\ 
 
11
When switching in editing proof mode, the prompt
 
12
\index{Prompt} 
 
13
{\tt Coq <} is changed into {\tt {\ident} <} where {\ident} is the
 
14
declared name of the theorem currently edited.
 
15
 
 
16
At each stage of a proof development, one has a list of goals to
 
17
prove. Initially, the list consists only in the theorem itself. After
 
18
having applied some tactics, the list of goals contains the subgoals
 
19
generated by the tactics.
 
20
 
 
21
To each subgoal is associated  a number of
 
22
hypotheses we call the {\em \index*{local context}} of the goal.
 
23
Initially, the local context is empty. It is enriched by the use of
 
24
certain tactics (see mainly Section~\ref{intro}).
 
25
 
 
26
When a proof is achieved the message {\tt Proof completed} is
 
27
displayed. One can then store this proof as a defined constant in the
 
28
environment. Because there exists a correspondence between proofs and
 
29
terms of $\lambda$-calculus, known as the {\em Curry-Howard
 
30
isomorphism} \cite{How80,Bar91,Gir89,Hue89}, \Coq~ stores proofs as
 
31
terms of {\sc Cic}. Those terms are called {\em proof
 
32
  terms}\index{Proof term}.
 
33
 
 
34
It is possible to edit several proofs at the same time: see section
 
35
\ref{Resume}
 
36
 
 
37
\ErrMsg When one attempts to use a proof editing command out of the
 
38
proof editing mode, \Coq~ raises the error message : \errindex{No focused
 
39
  proof}.
 
40
 
 
41
\section{Switching on/off the proof editing mode}
 
42
 
 
43
\subsection[\tt Goal {\form}.]{\tt Goal {\form}.\comindex{Goal}\label{Goal}}
 
44
This command switches \Coq~ to editing proof mode and sets {\form} as
 
45
the original goal. It associates the name {\tt Unnamed\_thm} to
 
46
that goal.
 
47
 
 
48
\begin{ErrMsgs}
 
49
\item \errindex{the term \form\ has type \ldots{} which should be Set,
 
50
    Prop or Type}
 
51
%\item \errindex{Proof objects can only be abstracted}
 
52
%\item \errindex{A goal should be a type}
 
53
%\item \errindex{repeated goal not permitted in refining mode}
 
54
%the command {\tt Goal} cannot be used while a proof is already being edited.
 
55
\end{ErrMsgs}
 
56
 
 
57
\SeeAlso Section~\ref{Theorem}
 
58
 
 
59
\subsection[\tt Qed.]{\tt Qed.\comindex{Qed}\label{Qed}}
 
60
This command is available in interactive editing proof mode when the
 
61
proof is completed.  Then {\tt Qed} extracts a proof term from the
 
62
proof script, switches back to {\Coq} top-level and attaches the
 
63
extracted proof term to the declared name of the original goal. This
 
64
name is added to the environment as an {\tt Opaque} constant.
 
65
 
 
66
\begin{ErrMsgs}
 
67
\item \errindex{Attempt to save an incomplete proof}
 
68
%\item \ident\ \errindex{already exists}\\ 
 
69
%  The implicit name is already defined. You have then to provide
 
70
%  explicitly a new name (see variant 3 below).
 
71
\item Sometimes an error occurs when building the proof term,
 
72
because tactics do not enforce completely the term construction
 
73
constraints.
 
74
 
 
75
The user should also be aware of the fact that since the proof term is
 
76
completely rechecked at this point, one may have to wait a while when
 
77
the proof is large. In some exceptional cases one may even incur a
 
78
memory overflow.
 
79
\end{ErrMsgs}
 
80
 
 
81
\begin{Variants}
 
82
 
 
83
\item {\tt Defined.}
 
84
\comindex{Defined} 
 
85
\label{Defined} 
 
86
 
 
87
  Defines the proved term as a transparent constant.
 
88
 
 
89
\item {\tt Save.}
 
90
\comindex{Save}
 
91
 
 
92
  Is equivalent to {\tt Qed}.
 
93
 
 
94
\item {\tt Save {\ident}.}
 
95
  
 
96
  Forces the name of the original goal to be {\ident}.  This command
 
97
  (and the following ones) can only be used if the original goal has
 
98
  been opened using the {\tt Goal} command.
 
99
 
 
100
\item {\tt Save Theorem {\ident}.} \\
 
101
 {\tt Save Lemma {\ident}.} \\
 
102
 {\tt Save Remark {\ident}.}\\
 
103
 {\tt Save Fact {\ident}.}
 
104
 
 
105
  Are equivalent to {\tt Save {\ident}.} 
 
106
\end{Variants}
 
107
 
 
108
\subsection[\tt Admitted.]{\tt Admitted.\comindex{Admitted}\label{Admitted}}
 
109
This command is available in interactive editing proof mode to give up
 
110
the current proof and declare the initial goal as an axiom.
 
111
 
 
112
\subsection[\tt Theorem {\ident} : {\form}.]{\tt Theorem {\ident} : {\form}.\comindex{Theorem}
 
113
\label{Theorem}}
 
114
 
 
115
This command switches to interactive editing proof mode and declares
 
116
{\ident} as being the name of the original goal {\form}. When declared
 
117
as a {\tt Theorem}, the name {\ident} is known at all section levels:
 
118
{\tt Theorem} is a {\sl global} lemma.
 
119
 
 
120
%\ErrMsg (see Section~\ref{Goal})
 
121
 
 
122
\begin{ErrMsgs}
 
123
 
 
124
\item \errindex{the term \form\ has type \ldots{} which should be Set,
 
125
    Prop or Type}
 
126
 
 
127
\item \errindexbis{\ident already exists}{already exists}
 
128
 
 
129
  The name you provided already defined. You have then to choose
 
130
  another name.
 
131
 
 
132
\end{ErrMsgs}
 
133
 
 
134
 
 
135
\begin{Variants}
 
136
 
 
137
\item {\tt Lemma {\ident} : {\form}.}
 
138
\comindex{Lemma}
 
139
 
 
140
  It is equivalent to {\tt Theorem {\ident} : {\form}.}
 
141
 
 
142
\item {\tt Remark {\ident} : {\form}.}\comindex{Remark}\\
 
143
  {\tt Fact {\ident} : {\form}.}\comindex{Fact}
 
144
 
 
145
  Used to have a different meaning, but are now equivalent to {\tt
 
146
  Theorem {\ident} : {\form}.} They are kept for compatibility.
 
147
 
 
148
\item {\tt Definition {\ident} : {\form}.}
 
149
\comindex{Definition}
 
150
 
 
151
  Analogous to {\tt Theorem}, intended to be used in conjunction with
 
152
  {\tt Defined} (see \ref{Defined}) in order to define a
 
153
  transparent constant.
 
154
 
 
155
\item {\tt Let {\ident} : {\form}.}
 
156
\comindex{Let}
 
157
 
 
158
  Analogous to {\tt Definition} except that the definition is turned
 
159
  into a local definition on objects depending on it after closing the
 
160
  current section.
 
161
\end{Variants}
 
162
 
 
163
\subsection[\tt Proof {\term}.]{\tt Proof {\term}.\comindex{Proof}
 
164
\label{BeginProof}}
 
165
This command applies in proof editing mode. It is equivalent to {\tt
 
166
  exact {\term}; Save.} That is, you have to give the full proof in
 
167
one gulp, as a proof term (see Section~\ref{exact}).
 
168
 
 
169
\variant {\tt Proof.}
 
170
  
 
171
  Is a noop which is useful to delimit the sequence of tactic commands
 
172
  which start a proof, after a {\tt Theorem} command.  It is a good
 
173
  practice to use {\tt Proof.} as an opening parenthesis, closed in
 
174
  the script with a closing {\tt Qed.}
 
175
 
 
176
\SeeAlso {\tt Proof with {\tac}.} in Section~\ref{ProofWith}.
 
177
 
 
178
\subsection[\tt Abort.]{\tt Abort.\comindex{Abort}}
 
179
 
 
180
This command cancels the current proof development, switching back to
 
181
the previous proof development, or to the \Coq\ toplevel if no other
 
182
proof was edited.
 
183
 
 
184
\begin{ErrMsgs}
 
185
\item \errindex{No focused proof (No proof-editing in progress)}
 
186
\end{ErrMsgs}
 
187
 
 
188
\begin{Variants}
 
189
 
 
190
\item {\tt Abort {\ident}.}
 
191
 
 
192
  Aborts the editing of the proof named {\ident}.
 
193
 
 
194
\item {\tt Abort All.}
 
195
 
 
196
  Aborts all current goals, switching back to the \Coq\ toplevel.
 
197
 
 
198
\end{Variants}
 
199
 
 
200
%%%%
 
201
\subsection[\tt Suspend.]{\tt Suspend.\comindex{Suspend}}
 
202
 
 
203
This command applies in proof editing mode. It switches back to the
 
204
\Coq\ toplevel, but without canceling the current proofs.
 
205
 
 
206
%%%%
 
207
\subsection[\tt Resume.]{\tt Resume.\comindex{Resume}\label{Resume}}
 
208
 
 
209
This commands switches back to the editing of the last edited proof.
 
210
 
 
211
\begin{ErrMsgs}
 
212
\item \errindex{No proof-editing in progress}
 
213
\end{ErrMsgs}
 
214
 
 
215
\begin{Variants}
 
216
 
 
217
\item {\tt Resume {\ident}.}
 
218
 
 
219
  Restarts the editing of the proof named {\ident}. This can be used
 
220
  to navigate between currently edited proofs.
 
221
 
 
222
\end{Variants}
 
223
 
 
224
\begin{ErrMsgs}
 
225
\item \errindex{No such proof}
 
226
\end{ErrMsgs}
 
227
 
 
228
 
 
229
%%%%
 
230
\subsection[\tt Existential {\num} := {\term}.]{\tt Existential  {\num} := {\term}.\comindex{Existential}
 
231
\label{Existential}}
 
232
 
 
233
This command allows to instantiate an existential variable. {\tt \num}
 
234
is an index in the list of uninstantiated existential variables
 
235
displayed by {\tt Show Existentials.} (described in Section~\ref{Show})
 
236
 
 
237
This command is intented to be used to instantiate existential
 
238
variables when the proof is completed but some uninstantiated
 
239
existential variables remain. To instantiate existential variables
 
240
during proof edition, you should use the tactic {\tt instantiate}.
 
241
 
 
242
\SeeAlso {\tt instantiate (\num:= \term).} in Section~\ref{instantiate}.
 
243
 
 
244
 
 
245
%%%%%%%%
 
246
\section{Navigation in the proof tree}
 
247
%%%%%%%%
 
248
 
 
249
\subsection[\tt Undo.]{\tt Undo.\comindex{Undo}}
 
250
 
 
251
This command cancels the effect of the last tactic command.  Thus, it
 
252
backtracks one step.
 
253
 
 
254
\begin{ErrMsgs}
 
255
\item \errindex{No focused proof (No proof-editing in progress)}
 
256
\item \errindex{Undo stack would be exhausted}
 
257
\end{ErrMsgs}
 
258
 
 
259
\begin{Variants}
 
260
 
 
261
\item {\tt Undo {\num}.}
 
262
 
 
263
  Repeats {\tt Undo} {\num} times.
 
264
 
 
265
\end{Variants}
 
266
 
 
267
\subsection[\tt Set Undo {\num}.]{\tt Set Undo {\num}.\comindex{Set Undo}}
 
268
 
 
269
This command changes the maximum number of {\tt Undo}'s that will be
 
270
possible when doing a proof. It only affects proofs started after
 
271
this command, such that if you want to change the current undo limit
 
272
inside a proof, you should first restart this proof.
 
273
 
 
274
\subsection[\tt Unset Undo.]{\tt Unset Undo.\comindex{Unset Undo}}
 
275
 
 
276
This command resets the default number of possible {\tt Undo} commands
 
277
(which is currently 12).
 
278
 
 
279
\subsection[\tt Restart.]{\tt Restart.\comindex{Restart}}
 
280
This command restores the proof editing process to the original goal.
 
281
 
 
282
\begin{ErrMsgs}
 
283
\item \errindex{No focused proof to restart}
 
284
\end{ErrMsgs}
 
285
 
 
286
\subsection[\tt Focus.]{\tt Focus.\comindex{Focus}}
 
287
This focuses the attention on the first subgoal to prove and the printing
 
288
of the other subgoals is suspended until the focused subgoal is
 
289
solved or unfocused. This is useful when there are many current
 
290
subgoals which clutter your screen.
 
291
 
 
292
\begin{Variant}
 
293
\item {\tt Focus {\num}.}\\ 
 
294
This focuses the attention on the $\num^{th}$ subgoal to prove.
 
295
 
 
296
\end{Variant}
 
297
 
 
298
\subsection[\tt Unfocus.]{\tt Unfocus.\comindex{Unfocus}}
 
299
Turns off the focus mode.
 
300
 
 
301
 
 
302
\section{Requesting information}
 
303
 
 
304
\subsection[\tt Show.]{\tt Show.\comindex{Show}\label{Show}}
 
305
This command displays the current goals.
 
306
 
 
307
\begin{Variants}
 
308
\item {\tt Show {\num}.}\\ 
 
309
  Displays only the {\num}-th subgoal.\\ 
 
310
\begin{ErrMsgs}
 
311
\item \errindex{No such goal}
 
312
\item \errindex{No focused proof}
 
313
\end{ErrMsgs}
 
314
 
 
315
\item {\tt Show Implicits.}\comindex{Show Implicits}\\
 
316
  Displays the current goals, printing the implicit arguments of
 
317
  constants.
 
318
 
 
319
\item {\tt Show Implicits {\num}.}\\
 
320
  Same as above, only displaying the {\num}-th subgoal.
 
321
 
 
322
\item {\tt Show Script.}\comindex{Show Script}\\
 
323
  Displays the whole list of tactics applied from the beginning
 
324
  of the current proof. 
 
325
  This tactics script may contain some holes (subgoals not yet proved).
 
326
  They are printed under the form \verb!<Your Tactic Text here>!.
 
327
 
 
328
\item {\tt Show Tree.}\comindex{Show Tree}\\
 
329
This command can be seen as a more structured way of
 
330
displaying the state of the proof than that 
 
331
provided by {\tt Show Script}. Instead of just giving
 
332
the list of tactics that have been applied, it 
 
333
shows the derivation tree constructed by then. 
 
334
Each node of the tree contains the conclusion
 
335
of the corresponding sub-derivation (i.e. a
 
336
goal with its corresponding local context) and 
 
337
the tactic that has generated all the 
 
338
sub-derivations. The leaves of this tree are
 
339
the goals which still remain to be proved.
 
340
 
 
341
%\item {\tt Show Node}\comindex{Show Node}\\
 
342
%        Not yet documented
 
343
 
 
344
\item {\tt Show Proof.}\comindex{Show Proof}\\
 
345
It displays the proof term generated by the 
 
346
tactics that have been applied. 
 
347
If the proof is not completed, this term contain holes,
 
348
which correspond to the sub-terms which are still to be 
 
349
constructed. These holes appear as a question mark indexed 
 
350
by an integer, and applied to the list of variables in 
 
351
the context, since it may depend on them. 
 
352
The types obtained by abstracting away the context from the
 
353
type of each hole-placer are also printed.
 
354
 
 
355
\item {\tt Show Conjectures.}\comindex{Show Conjectures}\\
 
356
It prints the list of the names of all the theorems that 
 
357
are currently being proved.
 
358
As it is possible to start proving a previous lemma during
 
359
the proof of a theorem, this list may contain several 
 
360
names. 
 
361
 
 
362
\item{\tt Show Intro.}\comindex{Show Intro}\\
 
363
If the current goal begins by at least one product, this command
 
364
prints the name of the first product, as it would be generated by 
 
365
an anonymous {\tt Intro}. The aim of this command is to ease the
 
366
writing of more robust scripts. For example, with an appropriate 
 
367
Proof General macro, it is possible to transform any anonymous {\tt
 
368
  Intro} into a qualified one such as {\tt Intro y13}.
 
369
In the case of a non-product goal, it prints nothing. 
 
370
 
 
371
\item{\tt Show Intros.}\comindex{Show Intros}\\
 
372
This command is similar to the previous one, it simulates the naming 
 
373
process of an {\tt Intros}.
 
374
 
 
375
\item{\tt Show Existentials}\comindex{Show Existentials}\\ It displays
 
376
the set of all uninstantiated existential variables in the current proof tree, 
 
377
along with the type and the context of each variable.
 
378
 
 
379
\end{Variants}
 
380
 
 
381
 
 
382
\subsection[\tt Guarded.]{\tt Guarded.\comindex{Guarded}\label{Guarded}}
 
383
 
 
384
Some tactics (e.g. refine \ref{refine}) allow to build proofs using
 
385
fixpoint or co-fixpoint constructions. Due to the incremental nature
 
386
of interactive proof construction, the check of the termination (or
 
387
guardedness) of the recursive calls in the fixpoint or cofixpoint
 
388
constructions is postponed to the time of the completion of the proof.
 
389
 
 
390
The command \verb!Guarded! allows to verify if the guard condition for
 
391
fixpoint and cofixpoint is violated at some time of the construction
 
392
of the proof without having to wait the completion of the proof."
 
393
 
 
394
 
 
395
\subsection[\tt Set Hyps Limit {\num}.]{\tt Set Hyps Limit {\num}.\comindex{Set Hyps Limit}}
 
396
This command sets the maximum number of hypotheses displayed in
 
397
goals after the application of a tactic. 
 
398
All the hypotheses remains usable in the proof development.
 
399
 
 
400
 
 
401
\subsection[\tt Unset Hyps Limit.]{\tt Unset Hyps Limit.\comindex{Unset Hyps Limit}}
 
402
This command goes back to the default mode which is to print all
 
403
available hypotheses.
 
404
 
 
405
% $Id: RefMan-pro.tex 10479 2008-01-29 16:51:14Z corbinea $
 
406
 
 
407
%%% Local Variables: 
 
408
%%% mode: latex
 
409
%%% TeX-master: "Reference-Manual"
 
410
%%% End: