15934
|
1 |
%title%
|
|
2 |
Isabelle on Windows
|
|
3 |
|
|
4 |
%body%
|
|
5 |
|
|
6 |
<h2>Preconditions and restrictions</h2>
|
|
7 |
|
|
8 |
<p>Please notice before you go ahead:
|
|
9 |
<ul>
|
|
10 |
<li>The ML system these notes apply to is
|
|
11 |
<a href="http://www.smlnj.org/">Standard ML of New Jersey</a>;
|
|
12 |
it is <em>not</em> known yet how to get Isabelle run completely with
|
|
13 |
<a href="www.polyml.org/">Poly/ML</a>. See <a href="#polyml">a note
|
|
14 |
on Poly/ML</a> down this page.</li>
|
|
15 |
<li>It is assumed you have some experience with an Unix operating
|
|
16 |
system (e. g. what a shell is for and how to use it basically).
|
|
17 |
This is neccessary since the ML system has to be compiled from scratch.</li>
|
|
18 |
</ul>
|
|
19 |
</p>
|
|
20 |
|
|
21 |
<p>Thanks to
|
|
22 |
<a href="http://cswww.essex.ac.uk/Research/FSS/projects/isawin/">Norbert Vöker</a>
|
|
23 |
and <a href="http://www.abo.fi/~viorel.preoteasa/isabelle/">Viorel Preoteasa</a>
|
|
24 |
whose efforts helped a lot to get Isabelle run this way.</p>
|
|
25 |
|
|
26 |
<h2>Installing Cygwin</h2>
|
|
27 |
|
|
28 |
<p>Cygwin is a POSIX emulation layer for windows; it contains ports of a large
|
|
29 |
collection of common Unix software (shells, perl, gcc, X11, latex, ImageMagick,
|
|
30 |
…).</p>
|
|
31 |
|
|
32 |
<p>To install it, get the installer from the
|
|
33 |
<a href="http://www.cygwin.com">Cygwin website</a> and run it. It will ask you
|
|
34 |
which packages to install, and then downloads and installs them.
|
|
35 |
Please make sure you install everything needed by Isabelle; it is hard to give
|
|
36 |
a concise list of packages here since the bundling of Cygwin packages may vary
|
|
37 |
over time, but installing the base packages, perl, make, xemacs and x-server
|
|
38 |
should be a good choice for the beginning.</p>
|
|
39 |
|
|
40 |
<p>By default, cygwin installs to <tt>c:\cygwin</tt>; you may choose an arbitrary
|
|
41 |
location, but it is recommended that it does not include any space or exotic
|
|
42 |
characters. This directory will then become the root directory of the Cygwin
|
|
43 |
filesystem tree, i. e. the Cygwin path <tt>/opt/smlnj</tt>
|
|
44 |
will be mapped to Windows path <tt>c:\cygwin\opt\smlnj</tt>.</p>
|
|
45 |
|
|
46 |
<p>After installation, open a Cygwin shell window (normally the installer
|
|
47 |
makes a shortcut for you).</p>
|
|
48 |
|
|
49 |
<h2>Getting and building SML/NJ</h2>
|
|
50 |
|
|
51 |
<p>Now we are ready to get and build <a href="http://www.smlnj.org/">SML/NJ</a>;
|
|
52 |
before this, set the environment variable SMLNJ_CYGWIN_RUNTIME to 1:
|
|
53 |
|
|
54 |
<blockquote>
|
|
55 |
<tt>
|
|
56 |
export SMLNJ_CYGWIN_RUNTIME=1
|
|
57 |
</tt>
|
|
58 |
</blockquote>
|
|
59 |
|
|
60 |
<blockquote>
|
|
61 |
(or
|
|
62 |
<tt>
|
|
63 |
setenv SMLNJ_CYGWIN_RUNTIME 1
|
|
64 |
</tt>
|
|
65 |
for c shells).
|
|
66 |
</blockquote>
|
|
67 |
|
|
68 |
This setting will tell the build process that it should <em>not</em> attempt
|
|
69 |
to build SML/NJ natively for Win32 but for Cygwin instead (see further
|
|
70 |
<a href="http://smlnj.cs.uchicago.edu/dist/working/110.53/CYGWININSTALL">CYGWININSTALL</a>).</p>
|
|
71 |
|
|
72 |
<p>So far, this whole setup was tested using the latest working version (110.53)
|
|
73 |
of SML/NJ from <a href="http://smlnj.cs.uchicago.edu/dist/working/110.53/">http://smlnj.cs.uchicago.edu/dist/working/110.53/</a>.
|
|
74 |
SML/NJ provides a nice installer enabling you to download and build it.
|
|
75 |
Read <a href="http://smlnj.cs.uchicago.edu/dist/working/110.53/INSTALL">INSTALL</a>
|
|
76 |
to learn about the different possibilites to do this. The default packages
|
|
77 |
should be sufficient.</p>
|
|
78 |
|
|
79 |
<p>In the following, it is assumed that you install SML/NJ to Cygwin path <tt>/opt/smlnj</tt>;
|
|
80 |
if you choose an other
|
|
81 |
location, some tweaking in the <a href="#config"><tt>etc/settings</tt> file</a>
|
|
82 |
may be neccessary later.</p>
|
|
83 |
|
|
84 |
<p>Whenever SMLNJ is used, the SMLNJ_CYGWIN_RUNTIME environment variable
|
|
85 |
must be set to 1 (lateron a convenient mechanism to make this the default
|
|
86 |
is proposed).</p>
|
|
87 |
|
|
88 |
<h2>Installing Isabelle</h2>
|
|
89 |
|
|
90 |
<p>Download the latest Isabelle and ProofGeneral release packages from
|
|
91 |
<a href="http://isabelle.in.tum.de/dist/packages.html">http://isabelle.in.tum.de/dist/packages.html</a>.
|
|
92 |
Assuming that you are in the directory where
|
|
93 |
you downloaded the files, install them into <tt>/opt</tt> by typing into the
|
|
94 |
bash shell:
|
|
95 |
|
|
96 |
<blockquote>
|
|
97 |
<tt>
|
|
98 |
tar -C /usr/opt -xvzf <a href="http://isabelle.in.tum.de/dist/Isabelle2004.tar.gz">Isabelle2004.tar.gz</a><br />
|
|
99 |
tar -C /usr/opt -xvzf <a href="http://isabelle.in.tum.de/dist/ProofGeneral-3.5.tar.gz">ProofGeneral-3.5.tar.gz</a>
|
|
100 |
</tt>
|
|
101 |
</blockquote>
|
|
102 |
|
|
103 |
During extracting, one inconvenience may occur, see <a href="inconvenience">below</a>.</p>
|
|
104 |
|
|
105 |
<p>The location <tt>/opt</tt> again is just a proposal; if you choose other
|
|
106 |
locations, some tweaking in the <a href="#config"><tt>etc/settings</tt> file</a>
|
|
107 |
may be neccessary later.</p>
|
|
108 |
|
|
109 |
<h2 id="config">Configuring Isabelle</h2>
|
|
110 |
|
|
111 |
<p>Edit the file <tt>/opt/Isabelle/etc/settings</tt>; first, uncomment the lines
|
|
112 |
about SMLNJ. Also set the variable SMLNJ_CYGWIN_RUNTIME to 1, in order the
|
|
113 |
cygwin version of SMLNJ is used. As mentioned above, the path variables for
|
|
114 |
the ML system and ProofGeneral may need adjustions, depending on your different
|
|
115 |
installation locations.</p>
|
|
116 |
|
|
117 |
<p>Take heed of the setting of ISABELLE_HOME_USER; by default, this is
|
|
118 |
<tt>~/isabelle</tt>. To detect to which Windows path this will be mapped,
|
|
119 |
type into the Cygwin bash shell:
|
|
120 |
|
|
121 |
<blockquote>
|
|
122 |
<tt>
|
|
123 |
cygpath --windows ~/isabelle
|
|
124 |
</tt>
|
|
125 |
</blockquote>
|
|
126 |
|
|
127 |
If you don't like this location to be the isabelle home directory, consider
|
|
128 |
setting of ISABELLE_HOME_USER to another value; use <tt>cygpath --unix
|
|
129 |
<winpath></tt> to detect which Cygwin path a given Windows path is mapped to.</p>
|
|
130 |
|
|
131 |
<p>A typical change could look like this:
|
|
132 |
|
|
133 |
<blockquote>
|
|
134 |
from<br/>
|
|
135 |
<tt>
|
|
136 |
# Standard ML of New Jersey 110 or later<br>
|
|
137 |
#ML_SYSTEM=smlnj-110<br>
|
|
138 |
#ML_HOME="$ISABELLE_HOME/../smlnj/bin"<br>
|
|
139 |
#ML_OPTIONS="@SMLdebug=/dev/null"<br>
|
|
140 |
#ML_PLATFORM=$(eval $("$ML_HOME/.arch-n-opsys" 2>/dev/null); echo "$HEAP_SUFFIX")<br>
|
|
141 |
</tt>
|
|
142 |
</blockquote>
|
|
143 |
|
|
144 |
<blockquote>
|
|
145 |
to<br/>
|
|
146 |
<tt>
|
|
147 |
# Standard ML of New Jersey 110 or later<br>
|
|
148 |
SMLNJ_CYGWIN_RUNTIME=1<br>
|
|
149 |
ML_SYSTEM=smlnj-110<br>
|
|
150 |
ML_HOME="$ISABELLE_HOME/../smlnj/bin"<br>
|
|
151 |
ML_OPTIONS="@SMLdebug=/dev/null"<br>
|
|
152 |
ML_PLATFORM=$(eval $("$ML_HOME/.arch-n-opsys" 2>/dev/null); echo "$HEAP_SUFFIX")
|
|
153 |
</tt>
|
|
154 |
</blockquote>
|
|
155 |
|
|
156 |
</p>
|
|
157 |
|
|
158 |
<h2>Building logics</h2>
|
|
159 |
|
|
160 |
<p>Now we can compile some logics. Start the cygwin shell (if not still
|
|
161 |
running) and type:
|
|
162 |
|
|
163 |
<blockquote>
|
|
164 |
<tt>
|
|
165 |
cd /opt/Isabelle<br>
|
|
166 |
build HOL<br>
|
|
167 |
build ZF
|
|
168 |
</tt>
|
|
169 |
</blockquote>
|
|
170 |
</p>
|
|
171 |
|
|
172 |
<p>The compilation process may take quite a lot of time (depending also on
|
|
173 |
how fast the computer is). When starting building some logic the build
|
|
174 |
program shows some variables and expects the user input – just hit enter.
|
|
175 |
|
|
176 |
<h2>Running Isabelle with ProofGeneral</h2>
|
|
177 |
|
|
178 |
<p>On Linux Isabelle can be started by two scripts located in <tt>Isabelle/bin</tt>:
|
|
179 |
<tt>Isabelle</tt> and <tt>isabelle</tt>. <tt>Isabelle</tt> attempts to start
|
|
180 |
ProofGeneral with XEmacs, and isabelle starts it in an SML shell session.
|
|
181 |
However Windows treats the two names as one. To get around this just copy
|
|
182 |
<tt>/opt/Isabelle/bin/isabelle</tt> to <tt>/opt/Isabelle/bin/Isabell</tt>.
|
|
183 |
The script <tt>/opt/Isabelle/bin/Isabell</tt> will start Isabelle with ProofGeneral.</p>
|
|
184 |
|
|
185 |
<p>How everything is ready to test some theory. Start the cygwin shell
|
|
186 |
(if not already running) and type
|
|
187 |
|
|
188 |
<blockquote>
|
|
189 |
<tt>startx &</tt>
|
|
190 |
</blockquote>
|
|
191 |
|
|
192 |
This will start the cygwin X server and an X shell window. In the X shell window,
|
|
193 |
type
|
|
194 |
|
|
195 |
<blockquote>
|
|
196 |
<tt>/opt/Isabelle/bin/Isabell &</tt>.
|
|
197 |
</blockquote>
|
|
198 |
|
|
199 |
This will start the ProofGeneral interface for Isabelle. After a while an empty buffer
|
|
200 |
<tt>scratch.thy</tt> is created. You can turn on X-Symbol and Electric Terminator
|
|
201 |
from the menu Proof-General &rarrow; Options.</p>
|
|
202 |
|
|
203 |
<p>Load one of your favorite theory and test your Isabelle installation
|
|
204 |
by proving something.</p>
|
|
205 |
|
|
206 |
<p>To simplify starting ProofGeneral, consider writing a Windows command script,
|
|
207 |
e. g.
|
|
208 |
|
|
209 |
<blockquote>
|
|
210 |
<tt>@bash startx -geometry 30x4 -iconic -e Isabell</tt>
|
|
211 |
</blockquote>
|
|
212 |
|
|
213 |
and assigning a shortcut in the start menu to it.</p>
|
|
214 |
|
|
215 |
<h2 id="inconvenience">Inconveniencies with the current version of Isabelle</h2>
|
|
216 |
|
|
217 |
<p>With the current Isabelle release (Isabelle 2004), there are two inconveniencies:
|
|
218 |
<ul>
|
|
219 |
<li>During extraction you will get a warning that file <tt>Real/HahnBanach/Aux.thy</tt>
|
|
220 |
can not be created. This is because <tt>Aux</tt> is not allowed as a
|
|
221 |
filename under Windows. If you do not want to run the HahnBanach example,
|
|
222 |
you might simply want to ignore this warning.</li>
|
|
223 |
<li>The tool <tt>isatool mkdir</tt> tries to detect the name of the current
|
|
224 |
user, to put it into the generated <tt>root.tex</tt>. Alas, on Windows, this
|
|
225 |
leads to an unquoted <tt>\</tt> in the TeX file. So you either must edit
|
|
226 |
your <tt>root.tex</tt> manually to fix this, or directly patch <tt>/opt/Isabelle/lib/Tools/mkdir</tt>
|
|
227 |
by replacing
|
|
228 |
|
|
229 |
<blockquote>
|
|
230 |
<tt>
|
|
231 |
AUTHOR=$("$AUTO_PERL" -e "@pw = getpwnam(\"$USER\"); print @pw[6]" | tr _ -)
|
|
232 |
</tt>
|
|
233 |
</blockquote>
|
|
234 |
|
|
235 |
with
|
|
236 |
|
|
237 |
<blockquote>
|
|
238 |
<tt>
|
|
239 |
AUTHOR="default author name"
|
|
240 |
</tt>
|
|
241 |
</blockquote>
|
|
242 |
|
|
243 |
</li>
|
|
244 |
</ul>
|
|
245 |
|
|
246 |
<p>To get around both inconveniencies, consider using a recent developer snapshot
|
|
247 |
of Isabelle; either, both inconveniencies won't be alive anymore in the next
|
|
248 |
Isabelle release.</p>
|
|
249 |
|
|
250 |
<h2 id="polyml">A note on Poly/ML</h2>
|
|
251 |
|
|
252 |
<p>As indicated above, Isabelle does <em>not</em> run
|
|
253 |
neatlessly with <a href="www.polyml.org/">Poly/ML</a> on Windows, due to two
|
|
254 |
reasons:
|
|
255 |
<ul>
|
|
256 |
<li>The native port of Poly/ML for windows does not, for what reason
|
|
257 |
ever, support shell-like stdin and stdout; instead, it implements
|
|
258 |
its own »terminal«. Alas, all »higher«
|
|
259 |
Isabelle features (Isar, ProofGeneral, …) depend on stdin and stdout.
|
|
260 |
So, though on the pure ML level Isabelle may run, its usability will be
|
|
261 |
very restricted.</li>
|
|
262 |
<li>It is not clear how Poly/ML has to be compiled for Cygwin.</li>
|
|
263 |
</ul>
|
|
264 |
</p>
|
|
265 |
|
|
266 |
<p>If you know how to circumvent (fully or partially) any of these problems,
|
|
267 |
please let us know.</p>
|
|
268 |
|