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

« back to all changes in this revision

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