14575
|
1 |
%title%
|
|
2 |
Isabelle FAQ
|
|
3 |
|
|
4 |
%meta%
|
|
5 |
<style type="text/css">
|
|
6 |
<!--
|
|
7 |
.question { background-color:#C0C0C0; color:#000001; padding:3px; margin-top:12px; font-weight: bold; }
|
|
8 |
.answer { background-color:#E0E0E0; padding:3px; margin-top:3px; }
|
|
9 |
-->
|
|
10 |
</style>
|
|
11 |
|
|
12 |
|
|
13 |
%body%
|
|
14 |
<h2>General Questions</h2>
|
|
15 |
<table class="question" width="100%">
|
|
16 |
<tr>
|
|
17 |
<td>What is Isabelle?</td>
|
|
18 |
</tr>
|
|
19 |
</table>
|
|
20 |
|
|
21 |
<table class="answer" width="100%">
|
|
22 |
<tr><td>Isabelle is a popular generic theorem proving
|
|
23 |
environment developed at Cambridge University (<a
|
|
24 |
href="http://www.cl.cam.ac.uk/users/lcp/">Larry Paulson</a>)
|
|
25 |
and TU Munich (<a href="http://www.in.tum.de/~nipkow/">Tobias
|
|
26 |
Nipkow</a>). See the <a
|
|
27 |
href="http://isabelle.in.tum.de/">Isabelle homepage</a> for
|
|
28 |
more information.</td></tr>
|
|
29 |
</table>
|
|
30 |
|
|
31 |
|
|
32 |
<table class="question" width="100%">
|
|
33 |
<tr>
|
|
34 |
<td>Where can I find documentation?</td>
|
|
35 |
</tr>
|
|
36 |
</table>
|
|
37 |
<table class="answer" width="100%">
|
|
38 |
<tr><td><a href="http://isabelle.in.tum.de/docs.html">This
|
|
39 |
way, please</a>. Also have a look at the <a
|
|
40 |
href="http://isabelle.in.tum.de/library/">theory
|
|
41 |
library</a>.</td></tr>
|
|
42 |
</table>
|
|
43 |
|
|
44 |
<table class="question" width="100%">
|
|
45 |
<tr>
|
|
46 |
<td>Is it available for download?</td>
|
|
47 |
</tr>
|
|
48 |
</table> <table class="answer" width="100%"> <tr><td>Yes, it is
|
|
49 |
available from <a
|
|
50 |
href="http://isabelle.in.tum.de/dist/">several mirror
|
|
51 |
sites</a>. It should run on most recent Unix systems (Solaris,
|
|
52 |
Linux, MacOS X, etc.).</td></tr>
|
|
53 |
</table>
|
|
54 |
|
|
55 |
|
|
56 |
<h2>Syntax</h2>
|
|
57 |
<table class="question" width="100%">
|
|
58 |
<tr>
|
|
59 |
<td>There are lots of arrows in Isabelle. What's the
|
14582
|
60 |
difference between <tt>-></tt>, <tt>=></tt>, <tt>--></tt>,
|
|
61 |
and <tt>==></tt> ?</td>
|
14575
|
62 |
</tr>
|
|
63 |
</table>
|
|
64 |
<table class="answer" width="100%">
|
14582
|
65 |
<tr><td>Isabelle uses the <tt>=></tt> arrow for the function
|
14575
|
66 |
type (contrary to most functional languages which use
|
14582
|
67 |
<tt>-></tt>). So <tt>a => b</tt> is the type of a function
|
14575
|
68 |
that takes an element of <tt>a</tt> as input and gives you an
|
14582
|
69 |
element of <tt>b</tt> as output. The long arrow <tt>--></tt>
|
|
70 |
and <tt>==></tt> are object and meta level
|
14581
|
71 |
implication. Roughly speaking, the meta level implication
|
|
72 |
should only be used when stating theorems where it separates
|
|
73 |
the assumptions from the conclusion. Whenever you need an
|
14582
|
74 |
implication inside a HOL formula, use <code>--></code>.
|
14581
|
75 |
</td></tr>
|
14575
|
76 |
</table>
|
|
77 |
|
|
78 |
<table class="question" width="100%"><tr><td>Where do I have to put those double quotes?</td></tr></table>
|
|
79 |
|
|
80 |
<table class="answer" width="100%"><tr><td>Isabelle distinguishes between <em>inner</em>
|
|
81 |
and <em>outer</em> syntax. The outer syntax comes from the
|
|
82 |
Isabelle framework, the inner syntax is the one in between
|
|
83 |
quotation marks and comes from the object logic (in this case HOL).
|
|
84 |
With time the distinction between the two becomes obvious, but in
|
|
85 |
the beginning the following rules of thumb may work: types should
|
|
86 |
be inside quotation marks, formulas and lemmas should be inside
|
|
87 |
quotation marks, rules and equations (e.g. for definitions) should
|
|
88 |
be inside quotation marks, commands like <tt>lemma</tt>,
|
|
89 |
<tt>consts</tt>, <tt>primrec</tt>, <tt>constdefs</tt>,
|
|
90 |
<tt>apply</tt>, <tt>done</tt> are without quotation marks, as are
|
|
91 |
the names of constants in constant definitions (<tt>consts</tt>
|
|
92 |
and <tt>constdefs</tt>)
|
|
93 |
</td></tr></table>
|
|
94 |
|
14581
|
95 |
<table class="question" width="100%"><tr><td>What is <tt>"No such
|
|
96 |
constant: _case_syntax"</tt> supposed to tell
|
14575
|
97 |
me?</td></tr></table>
|
|
98 |
|
|
99 |
<table class="answer" width="100%"><tr><td>You get this message if
|
|
100 |
you use a case construct on a datatype and have a typo in the
|
|
101 |
names of the constructor patterns or if the order of the
|
|
102 |
constructors in the case pattern is different from the order in
|
|
103 |
which they where defined (in the datatype definition).
|
|
104 |
</td></tr></table>
|
|
105 |
|
|
106 |
<table class="question" width="100%"><tr><td>Why doesn't Isabelle understand my
|
|
107 |
equation?</td></tr></table>
|
|
108 |
|
|
109 |
<table class="answer" width="100%"><tr><td>Isabelle's equality <tt>=</tt> binds
|
|
110 |
relatively strongly, so an equation like <tt>a = b & c</tt> might
|
|
111 |
not be what you intend. Isabelle parses it as <tt>(a = b) &
|
|
112 |
c</tt>. If you want it the other way around, you must set
|
|
113 |
explicit parentheses as in <tt>a = (b & c)</tt>. This also applies
|
|
114 |
to e.g. <tt>primrec</tt> definitions (see below).</td></tr></table>
|
|
115 |
|
|
116 |
<table class="question" width="100%"><tr><td>What does it mean "not a proper
|
|
117 |
equation"?</td></tr></table>
|
|
118 |
|
|
119 |
<table class="answer" width="100%"><tr><td>Most commonly this is an instance of the
|
|
120 |
question above. The <tt>primrec</tt> command (and others) expect
|
|
121 |
equations as input, and since equality binds strongly in Isabelle,
|
|
122 |
something like <tt>f x = b & c</tt> is not what you might expect
|
|
123 |
it to be: Isabelle parses it as <tt>(f x = b) & c</tt> (which is
|
|
124 |
indeed not a proper equation). To turn it into an equation you
|
|
125 |
must set explicit parentheses: <tt>f x = (b & c)</tt>.</td></tr></table>
|
|
126 |
|
|
127 |
<table class="question" width="100%"><tr><td>What does it mean
|
|
128 |
"<tt>Not a meta-equality (==)</tt>"?</td></tr></table>
|
|
129 |
|
|
130 |
<table class="answer" width="100%"><tr><td>This usually occurs if
|
|
131 |
you use <tt>=</tt> for <tt>constdefs</tt>. The <tt>constdefs</tt>
|
|
132 |
and <tt>defs</tt> commands expect not equations, but meta
|
|
133 |
equivalences. Just use the <tt>\<equiv></tt> or <tt>==</tt>
|
|
134 |
signs instead of <tt>=</tt>. </td></tr></table>
|
|
135 |
|
|
136 |
|
|
137 |
<h2>Proving</h2>
|
|
138 |
|
|
139 |
<table class="question" width="100%"><tr><td>What does "empty result sequence"
|
|
140 |
mean?</td></tr></table>
|
|
141 |
|
|
142 |
<table class="answer" width="100%"><tr><td>It means that the applied proof method (or
|
|
143 |
tactic) was unsuccessful. It did not transform the goal in any
|
|
144 |
way, or simply just failed to do anything. You must try another
|
|
145 |
tactic (or give the one you used more hints or lemmas to work
|
|
146 |
with)</td></tr></table>
|
|
147 |
|
|
148 |
|
|
149 |
<table class="question" width="100%"><tr><td>The Simplifier doesn't want to apply my
|
|
150 |
rule, what's wrong?</td></tr></table>
|
|
151 |
|
|
152 |
<table class="answer" width="100%"><tr><td>
|
|
153 |
Most commonly this is a typing problem. The rule you want to apply
|
|
154 |
may require a more special (or just plain different) type from
|
|
155 |
what you have in the current goal. Use the ProofGeneral menu
|
14582
|
156 |
<tt>Isabelle/Isar -> Settings -> Show Types</tt> and the
|
14575
|
157 |
<tt>thm</tt> command on the rule you want to apply to find out if
|
|
158 |
the types are what you expect them to be (also take a look at the
|
|
159 |
types in your goal). <tt>Show Sorts</tt>, <tt>Show Constants</tt>,
|
|
160 |
and <tt>Trace Simplifier</tt> in the same menu may also be
|
|
161 |
helpful.
|
|
162 |
</td></tr></table>
|
|
163 |
|
|
164 |
|
|
165 |
<table class="question" width="100%"><tr><td>If I do <tt>auto</tt>, it leaves me a goal
|
|
166 |
<tt>False</tt>. Is my theorem wrong?</td></tr></table>
|
|
167 |
|
|
168 |
<table class="answer" width="100%"><tr><td>Not necessarily. It just means that
|
|
169 |
<tt>auto</tt> transformed the goal into something that is not
|
|
170 |
provable any more. That could be due to <tt>auto</tt> doing
|
|
171 |
something stupid, or e.g. due to some earlier step in the proof
|
|
172 |
that lost important information. It is of course also possible
|
|
173 |
that the goal was never provable in the first place.</td></tr></table>
|
|
174 |
|
|
175 |
|
|
176 |
<table class="question" width="100%"><tr><td>Why does <tt>lemma
|
|
177 |
"1+1=2"</tt> fail?</td></tr></table>
|
|
178 |
|
|
179 |
<table class="answer" width="100%"><tr><td>Because it is not
|
|
180 |
necessarily true. Isabelle does not assume that 1 and 2 are
|
|
181 |
natural numbers. Try <tt>"(1::nat)+1=2"</tt>
|
|
182 |
instead.</td></tr></table>
|
|
183 |
|
|
184 |
|
14581
|
185 |
<table class="question" width="100%"><tr><td>Can Isabelle find
|
|
186 |
counterexamples?</td></tr></table>
|
14575
|
187 |
|
|
188 |
<table class="answer" width="100%"><tr><td>
|
14581
|
189 |
<p>
|
|
190 |
For arithmetic goals, <code>arith</code> finds counterexamples.
|
|
191 |
For executable goals, <code>quickcheck</code> tries to find a
|
|
192 |
counterexample. For goals of a more logical nature (including
|
|
193 |
quantifiers, sets and inductive definitions) <code>refute</code>
|
|
194 |
searches for a countermodel.
|
|
195 |
</p>
|
|
196 |
<p>
|
14575
|
197 |
Otherwise, negate the proposition
|
|
198 |
and instantiate (some) variables with concrete values. You may
|
|
199 |
also need additional assumptions about these values. For example,
|
|
200 |
<tt>True & False ~= True | False</tt> is a counterexample of <tt>A
|
14582
|
201 |
& B = A | B</tt>, and <tt>A = ~B ==> A & B ~= A | B</tt> is
|
14575
|
202 |
another one. Sometimes Isabelle can help you to find the
|
14581
|
203 |
counterexample: just negate the proposition and do <tt>auto</tt>
|
14575
|
204 |
or <tt>simp</tt>. If lucky, you are left with the assumptions you
|
14581
|
205 |
need for the counterexample to work.
|
|
206 |
</p>
|
|
207 |
</td></tr></table>
|
14575
|
208 |
|
|
209 |
|
|
210 |
<h2>Interface</h2>
|
|
211 |
|
15812
|
212 |
<table class="question" width="100%"><tr><td>ProofGeneral appears to hang when Isabelle is started.</td></tr></table>
|
|
213 |
|
|
214 |
<table class="answer" width="100%"><tr>This may be because of UTF-8 issues e.g. in Red Hat 8.0/9.0, Suse 9.0/9.1
|
|
215 |
<p>
|
|
216 |
RedHat 8 and later has glibc 2.2 and UTF8 encoded output may be
|
|
217 |
turned on in default locale. Unfortunately Proof General relies on
|
|
218 |
8-bit characters which are UTF8 prefixes in the output of proof
|
|
219 |
assistants (inc Coq, Isabelle). These prefix characters are not
|
|
220 |
flushed to stdout individually. As a workaround we must find a way
|
|
221 |
to disable interpretation of UTF8 in the C libraries that Coq and
|
|
222 |
friends use.
|
|
223 |
<p>
|
|
224 |
Doing this inside PG/Emacs seems tricky; locale settings are
|
|
225 |
set/inherited in strange ways. One solution is to run the Emacs
|
|
226 |
process itself with an altered locale setting, for example,
|
|
227 |
starting XEmacs by typing:
|
|
228 |
<p>
|
|
229 |
<tt>$ LC_CTYPE=en_GB Isabelle &</tt>
|
|
230 |
<p>
|
|
231 |
The supplied proofgeneral script makes this setting if it sees
|
|
232 |
the string UTF in the current value of LC_CTYPE. Depending on your
|
|
233 |
distribution, this variable might also be called <tt>LANG</tt>.
|
|
234 |
<p>
|
|
235 |
Alternatively you can set LC_CTYPE or LANG inside a file ~/.i18n, which will
|
|
236 |
be read by the shell. This will affect all applications, though.
|
|
237 |
[ suggestions for a better workaround inside Emacs would be welcome ]
|
|
238 |
<p>
|
|
239 |
NB: a related issue is warnings from x-symbol: "Emacs language
|
|
240 |
environment and system locale specify different encoding, I'll
|
|
241 |
assume `iso-8859-1'". This warning appears to be mainly harmless.
|
|
242 |
Notice that the variable `buffer-file-coding-system' may determine
|
|
243 |
the format that files are saved in.<td></td></tr></table>
|
|
244 |
|
14575
|
245 |
<table class="question" width="100%"><tr><td>X-Symbol doesn't seem to work. What can I
|
|
246 |
do?</td></tr></table>
|
|
247 |
|
|
248 |
<table class="answer" width="100%"><tr><td>The most common reason why X-Symbol doesn't
|
|
249 |
work is: it's not switched on yet. Assuming you are using
|
|
250 |
ProofGeneral and have installed the X-Symbol package, you still
|
|
251 |
need to turn X-Symbol on in ProofGeneral: select the menu items
|
14582
|
252 |
<tt>Proof-General -> Options -> X-Symbol</tt> and (if you want to
|
|
253 |
save the setting for future sessions) select <tt>Options -> Save
|
14575
|
254 |
Options</tt> in XEmacs.</td></tr></table>
|
|
255 |
|
|
256 |
<table class="question" width="100%"><tr><td>How do I input those X-Symbols anyway?</td></tr></table>
|
|
257 |
|
|
258 |
<table class="answer" width="100%"><tr><td>
|
|
259 |
There are lots of ways to input x-symbols. The one that always
|
|
260 |
works is writing it out in plain text (e.g. for the 'and' symbol
|
|
261 |
type <tt>\<and></tt>). For common symbols you can try to "paint
|
|
262 |
them in ASCII" and if the xsymbol package recognizes them it will
|
|
263 |
automatically convert them into their graphical
|
14582
|
264 |
representation. Examples: <tt>--></tt> is converted into the long
|
14575
|
265 |
single arrow, <tt>/\</tt> is converted into the 'and' symbol, the
|
14582
|
266 |
sequence <tt>=_</tt> into the equivalence sign, <tt><_</tt> into
|
14575
|
267 |
less-or-equal, <tt>[|</tt> into opening semantic brackets, and so
|
|
268 |
on. For greek characters, the <code>rotate</code> command works well:
|
|
269 |
to input α type <code>a</code> and then <code>C-.</code>
|
|
270 |
(control and <code>.</code>). You can also display the
|
|
271 |
grid-of-characters in the x-symbol menu to get an overview of the
|
|
272 |
available graphical representations (not all of them already have
|
|
273 |
a meaning in Isabelle, though).
|
|
274 |
</td></tr></table>
|
|
275 |
|
|
276 |
<h2>System</h2>
|
|
277 |
|
|
278 |
<table class="question" width="100%"><tr><td>I want to generate one of those flashy LaTeX
|
|
279 |
documents. How?</td></tr></table>
|
|
280 |
|
|
281 |
<table class="answer" width="100%"><tr><td>You will need to work with the
|
|
282 |
<tt>isatool</tt> command for this (in a Unix shell). The easiest
|
|
283 |
way to get to a document is the following: use <tt>isatool
|
|
284 |
mkdir</tt> to set up a new directory. The command will also create
|
|
285 |
a file called <tt>IsaMakefile</tt> in the current directory. Put
|
|
286 |
your theory file(s) into the new directory and edit the file
|
|
287 |
<tt>ROOT.ML</tt> in there (following the comments) to tell
|
|
288 |
Isabelle which of the theories to load (and in which order). Go
|
|
289 |
back to the parent directory (where the <tt>IsaMakefile</tt> is)
|
|
290 |
and type <tt>isatool make</tt>. Isabelle should then process your
|
|
291 |
theories and tell you where to find the finished document. For
|
|
292 |
more information on generating documents see the Isabelle Tutorial, Chapter 4.
|
|
293 |
</td></tr></table>
|
|
294 |
|
|
295 |
|
|
296 |
<table class="question" width="100%"><tr><td>I have a large formalization with many
|
|
297 |
theories. Must I process all of them all of the time?</td></tr></table>
|
|
298 |
|
|
299 |
<table class="answer" width="100%"><tr><td>No, you can tell Isabelle to build a so-called
|
|
300 |
heap image. This heap image can contain your preloaded
|
|
301 |
theories. To get one, set up a directory with a <tt>ROOT.ML</tt>
|
|
302 |
file (as for generating a document) and use the command
|
|
303 |
<tt>isatool usedir -b HOL MyImage</tt> in that directory to create
|
|
304 |
an image <tt>MyImage</tt> using the parent logic <tt>HOL</tt>.
|
|
305 |
You should then be able to invoke Isabelle with <tt>Isabelle -l
|
|
306 |
MyImage</tt> and have everything that is loaded in ROOT.ML
|
|
307 |
instantly available.</td></tr></table>
|
|
308 |
|
|
309 |
<table class="question" width="100%"><tr><td>Does Isabelle run on Windows?</td></tr></table>
|
|
310 |
|
|
311 |
<table class="answer" width="100%"><tr><td> After a fashion, yes,
|
|
312 |
but Isabelle is not being developed for Windows. A friendly user
|
|
313 |
(Norbert Völker) has managed to get a minimal Isabelle environment
|
|
314 |
to work on it. See the description on <a
|
|
315 |
href="http://cswww.essex.ac.uk/Research/FSS/projects/isawin/">his
|
|
316 |
website</a>. Be warned, though: emphasis is on <em>minimal</em>,
|
|
317 |
working with Windows is no fun at all. To enjoy Isabelle in its
|
|
318 |
full beauty it is recommended to get a Linux distribution (they
|
|
319 |
are inexpensive, any reasonably recent one should work, dualboot
|
|
320 |
Windows/Linux should pose no problems).
|
|
321 |
</td></tr></table>
|
|
322 |
|