author | wenzelm |
Sat, 07 Nov 2015 12:53:22 +0100 | |
changeset 61597 | 53e32a9b66b8 |
parent 61575 | f18f6e51e901 |
child 61656 | cfabbc083977 |
permissions | -rw-r--r-- |
61575 | 1 |
(*:wrap=hard:maxLineLen=78:*) |
2 |
||
28224 | 3 |
theory Misc |
43564
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
41512
diff
changeset
|
4 |
imports Base |
28224 | 5 |
begin |
6 |
||
58618 | 7 |
chapter \<open>Miscellaneous tools \label{ch:tools}\<close> |
28224 | 8 |
|
58618 | 9 |
text \<open> |
61575 | 10 |
Subsequently we describe various Isabelle related utilities, given in |
11 |
alphabetical order. |
|
58618 | 12 |
\<close> |
28224 | 13 |
|
14 |
||
58618 | 15 |
section \<open>Theory graph browser \label{sec:browse}\<close> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
16 |
|
61575 | 17 |
text \<open> |
18 |
The Isabelle graph browser is a general tool for visualizing dependency |
|
19 |
graphs. Certain nodes of the graph (i.e.\ theories) can be grouped together |
|
20 |
in ``directories'', whose contents may be hidden, thus enabling the user to |
|
21 |
collapse irrelevant portions of information. The browser is written in Java, |
|
22 |
it can be used both as a stand-alone application and as an applet. |
|
23 |
\<close> |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
24 |
|
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
25 |
|
58618 | 26 |
subsection \<open>Invoking the graph browser\<close> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
27 |
|
61575 | 28 |
text \<open> |
29 |
The stand-alone version of the graph browser is wrapped up as @{tool_def |
|
30 |
browser}: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
31 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
32 |
\<open>Usage: isabelle browser [OPTIONS] [GRAPHFILE] |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
33 |
|
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
34 |
Options are: |
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
35 |
-b Admin/build only |
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
36 |
-c cleanup -- remove GRAPHFILE after use |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
37 |
-o FILE output to FILE (ps, eps, pdf)\<close>} |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
38 |
|
61575 | 39 |
When no file name is specified, the browser automatically changes to the |
40 |
directory @{setting ISABELLE_BROWSER_INFO}. |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
41 |
|
61406 | 42 |
\<^medskip> |
61575 | 43 |
The \<^verbatim>\<open>-b\<close> option indicates that this is for administrative build only, i.e.\ |
44 |
no browser popup if no files are given. |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
45 |
|
61575 | 46 |
The \<^verbatim>\<open>-c\<close> option causes the input file to be removed after use. |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
47 |
|
61575 | 48 |
The \<^verbatim>\<open>-o\<close> option indicates batch-mode operation, with the output written to |
49 |
the indicated file; note that \<^verbatim>\<open>pdf\<close> produces an \<^verbatim>\<open>eps\<close> copy as well. |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
50 |
|
61406 | 51 |
\<^medskip> |
61575 | 52 |
The applet version of the browser is part of the standard WWW theory |
53 |
presentation, see the link ``theory dependencies'' within each session |
|
54 |
index. |
|
58618 | 55 |
\<close> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
56 |
|
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
57 |
|
58618 | 58 |
subsection \<open>Using the graph browser\<close> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
59 |
|
58618 | 60 |
text \<open> |
61575 | 61 |
The browser's main window, which is shown in \figref{fig:browserwindow}, |
62 |
consists of two sub-windows. In the left sub-window, the directory tree is |
|
63 |
displayed. The graph itself is displayed in the right sub-window. |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
64 |
|
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
65 |
\begin{figure}[ht] |
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
66 |
\includegraphics[width=\textwidth]{browser_screenshot} |
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
67 |
\caption{\label{fig:browserwindow} Browser main window} |
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
68 |
\end{figure} |
58618 | 69 |
\<close> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
70 |
|
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
71 |
|
58618 | 72 |
subsubsection \<open>The directory tree window\<close> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
73 |
|
58618 | 74 |
text \<open> |
61575 | 75 |
We describe the usage of the directory browser and the meaning of the |
76 |
different items in the browser window. |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
77 |
|
61575 | 78 |
\<^item> A red arrow before a directory name indicates that the directory is |
79 |
currently ``folded'', i.e.~the nodes in this directory are collapsed to one |
|
80 |
single node. In the right sub-window, the names of nodes corresponding to |
|
81 |
folded directories are enclosed in square brackets and displayed in red |
|
82 |
color. |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
83 |
|
61575 | 84 |
\<^item> A green downward arrow before a directory name indicates that the |
85 |
directory is currently ``unfolded''. It can be folded by clicking on the |
|
86 |
directory name. Clicking on the name for a second time unfolds the directory |
|
87 |
again. Alternatively, a directory can also be unfolded by clicking on the |
|
88 |
corresponding node in the right sub-window. |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
89 |
|
61575 | 90 |
\<^item> Blue arrows stand before ordinary node names. When clicking on such a name |
91 |
(i.e.\ that of a theory), the graph display window focuses to the |
|
92 |
corresponding node. Double clicking invokes a text viewer window in which |
|
93 |
the contents of the theory file are displayed. |
|
58618 | 94 |
\<close> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
95 |
|
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
96 |
|
58618 | 97 |
subsubsection \<open>The graph display window\<close> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
98 |
|
58618 | 99 |
text \<open> |
61575 | 100 |
When pointing on an ordinary node, an upward and a downward arrow is shown. |
101 |
Initially, both of these arrows are green. Clicking on the upward or |
|
102 |
downward arrow collapses all predecessor or successor nodes, respectively. |
|
103 |
The arrow's color then changes to red, indicating that the predecessor or |
|
104 |
successor nodes are currently collapsed. The node corresponding to the |
|
105 |
collapsed nodes has the name ``\<^verbatim>\<open>[....]\<close>''. To uncollapse the nodes again, |
|
106 |
simply click on the red arrow or on the node with the name ``\<^verbatim>\<open>[....]\<close>''. |
|
107 |
Similar to the directory browser, the contents of theory files can be |
|
108 |
displayed by double clicking on the corresponding node. |
|
58618 | 109 |
\<close> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
110 |
|
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
111 |
|
58618 | 112 |
subsubsection \<open>The ``File'' menu\<close> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
113 |
|
58618 | 114 |
text \<open> |
61575 | 115 |
Due to Java Applet security restrictions this menu is only available in the |
116 |
full application version. The meaning of the menu items is as follows: |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
117 |
|
61439 | 118 |
\<^descr>[Open \dots] Open a new graph file. |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
119 |
|
61575 | 120 |
\<^descr>[Export to PostScript] Outputs the current graph in Postscript format, |
121 |
appropriately scaled to fit on one single sheet of A4 paper. The resulting |
|
122 |
file can be printed directly. |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
123 |
|
61575 | 124 |
\<^descr>[Export to EPS] Outputs the current graph in Encapsulated Postscript |
125 |
format. The resulting file can be included in other documents. |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
126 |
|
61439 | 127 |
\<^descr>[Quit] Quit the graph browser. |
58618 | 128 |
\<close> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
129 |
|
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
130 |
|
58618 | 131 |
subsection \<open>Syntax of graph definition files\<close> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
132 |
|
58618 | 133 |
text \<open> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
134 |
A graph definition file has the following syntax: |
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
135 |
|
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
136 |
\begin{center}\small |
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
137 |
\begin{tabular}{rcl} |
61503 | 138 |
\<open>graph\<close> & \<open>=\<close> & \<open>{ vertex\<close>~\<^verbatim>\<open>;\<close>~\<open>}+\<close> \\ |
139 |
\<open>vertex\<close> & \<open>=\<close> & \<open>vertex_name vertex_ID dir_name [\<close>~\<^verbatim>\<open>+\<close>~\<open>] path [\<close>~\<^verbatim>\<open><\<close>~\<open>|\<close>~\<^verbatim>\<open>>\<close>~\<open>] { vertex_ID }*\<close> |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
140 |
\end{tabular} |
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
141 |
\end{center} |
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
142 |
|
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
143 |
The meaning of the items in a vertex description is as follows: |
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
144 |
|
61493 | 145 |
\<^descr>[\<open>vertex_name\<close>] The name of the vertex. |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
146 |
|
61575 | 147 |
\<^descr>[\<open>vertex_ID\<close>] The vertex identifier. Note that there may be several |
148 |
vertices with equal names, whereas identifiers must be unique. |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
149 |
|
61575 | 150 |
\<^descr>[\<open>dir_name\<close>] The name of the ``directory'' the vertex should be placed in. |
151 |
A ``\<^verbatim>\<open>+\<close>'' sign after \<open>dir_name\<close> indicates that the nodes in the directory |
|
152 |
are initially visible. Directories are initially invisible by default. |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
153 |
|
61575 | 154 |
\<^descr>[\<open>path\<close>] The path of the corresponding theory file. This is specified |
155 |
relatively to the path of the graph definition file. |
|
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
156 |
|
61575 | 157 |
\<^descr>[List of successor/predecessor nodes] A ``\<^verbatim>\<open><\<close>'' sign before the list means |
158 |
that successor nodes are listed, a ``\<^verbatim>\<open>>\<close>'' sign means that predecessor |
|
159 |
nodes are listed. If neither ``\<^verbatim>\<open><\<close>'' nor ``\<^verbatim>\<open>>\<close>'' is found, the browser |
|
160 |
assumes that successor nodes are listed. |
|
58618 | 161 |
\<close> |
57330
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
162 |
|
d8a64a4cbfca
clarified role of old user interfaces as misc tools;
wenzelm
parents:
56439
diff
changeset
|
163 |
|
58618 | 164 |
section \<open>Resolving Isabelle components \label{sec:tool-components}\<close> |
48844 | 165 |
|
58618 | 166 |
text \<open> |
48844 | 167 |
The @{tool_def components} tool resolves Isabelle components: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
168 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
169 |
\<open>Usage: isabelle components [OPTIONS] [COMPONENTS ...] |
48844 | 170 |
|
171 |
Options are: |
|
50653
5c85f8b80b95
simplified quick start via "isabelle components -I";
wenzelm
parents:
50132
diff
changeset
|
172 |
-I init user settings |
48844 | 173 |
-R URL component repository |
174 |
(default $ISABELLE_COMPONENT_REPOSITORY) |
|
53435 | 175 |
-a resolve all missing components |
48844 | 176 |
-l list status |
177 |
||
178 |
Resolve Isabelle components via download and installation. |
|
179 |
COMPONENTS are identified via base name. |
|
180 |
||
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
181 |
ISABELLE_COMPONENT_REPOSITORY="http://isabelle.in.tum.de/components"\<close>} |
48844 | 182 |
|
61575 | 183 |
Components are initialized as described in \secref{sec:components} in a |
184 |
permissive manner, which can mark components as ``missing''. This state is |
|
185 |
amended by letting @{tool "components"} download and unpack components that |
|
186 |
are published on the default component repository @{url |
|
187 |
"http://isabelle.in.tum.de/components/"} in particular. |
|
48844 | 188 |
|
61575 | 189 |
Option \<^verbatim>\<open>-R\<close> specifies an alternative component repository. Note that |
190 |
\<^verbatim>\<open>file:///\<close> URLs can be used for local directories. |
|
48844 | 191 |
|
61575 | 192 |
Option \<^verbatim>\<open>-a\<close> selects all missing components to be resolved. Explicit |
193 |
components may be named as command line-arguments as well. Note that |
|
194 |
components are uniquely identified by their base name, while the |
|
195 |
installation takes place in the location that was specified in the attempt |
|
196 |
to initialize the component before. |
|
48844 | 197 |
|
61575 | 198 |
Option \<^verbatim>\<open>-l\<close> lists the current state of available and missing components |
199 |
with their location (full name) within the file-system. |
|
50653
5c85f8b80b95
simplified quick start via "isabelle components -I";
wenzelm
parents:
50132
diff
changeset
|
200 |
|
61575 | 201 |
Option \<^verbatim>\<open>-I\<close> initializes the user settings file to subscribe to the standard |
202 |
components specified in the Isabelle repository clone --- this does not make |
|
203 |
any sense for regular Isabelle releases. If the file already exists, it |
|
204 |
needs to be edited manually according to the printed explanation. |
|
58618 | 205 |
\<close> |
48844 | 206 |
|
207 |
||
58618 | 208 |
section \<open>Raw ML console\<close> |
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
209 |
|
58618 | 210 |
text \<open> |
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
211 |
The @{tool_def console} tool runs the Isabelle process with raw ML console: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
212 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
213 |
\<open>Usage: isabelle console [OPTIONS] |
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
214 |
|
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
215 |
Options are: |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
216 |
-d DIR include session directory |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
217 |
-l NAME logic session name (default ISABELLE_LOGIC) |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
218 |
-m MODE add print mode for output |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
219 |
-n no build of session image on startup |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
220 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
221 |
-s system build mode for session image |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
222 |
|
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
223 |
Run Isabelle process with raw ML console and line editor |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
224 |
(default ISABELLE_LINE_EDITOR).\<close>} |
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
225 |
|
61575 | 226 |
The \<^verbatim>\<open>-l\<close> option specifies the logic session name. By default, its heap |
227 |
image is checked and built on demand, but the option \<^verbatim>\<open>-n\<close> skips that. |
|
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
228 |
|
61575 | 229 |
Options \<^verbatim>\<open>-d\<close>, \<^verbatim>\<open>-o\<close>, \<^verbatim>\<open>-s\<close> are passed directly to @{tool build} |
230 |
(\secref{sec:tool-build}). |
|
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
231 |
|
61575 | 232 |
Options \<^verbatim>\<open>-m\<close>, \<^verbatim>\<open>-o\<close> are passed directly to the underlying Isabelle process |
233 |
(\secref{sec:isabelle-process}). |
|
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
234 |
|
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
235 |
The Isabelle process is run through the line editor that is specified via |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
236 |
the settings variable @{setting ISABELLE_LINE_EDITOR} (e.g.\ |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
237 |
@{executable_def rlwrap} for GNU readline); the fall-back is to use plain |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
238 |
standard input/output. |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
239 |
|
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
240 |
Interaction works via the raw ML toplevel loop: this is neither |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
241 |
Isabelle/Isar nor Isabelle/ML within the usual formal context. Some useful |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
242 |
ML commands at this stage are @{ML cd}, @{ML pwd}, @{ML use}, @{ML use_thy}, |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
243 |
@{ML use_thys}. |
58618 | 244 |
\<close> |
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
245 |
|
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
246 |
|
58618 | 247 |
section \<open>Displaying documents \label{sec:tool-display}\<close> |
28224 | 248 |
|
61575 | 249 |
text \<open> |
250 |
The @{tool_def display} tool displays documents in DVI or PDF format: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
251 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
252 |
\<open>Usage: isabelle display DOCUMENT |
28224 | 253 |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
254 |
Display DOCUMENT (in DVI or PDF format).\<close>} |
28224 | 255 |
|
61406 | 256 |
\<^medskip> |
61575 | 257 |
The settings @{setting DVI_VIEWER} and @{setting PDF_VIEWER} determine the |
258 |
programs for viewing the corresponding file formats. Normally this opens the |
|
259 |
document via the desktop environment, potentially in an asynchronous manner |
|
260 |
with re-use of previews views. |
|
58618 | 261 |
\<close> |
28224 | 262 |
|
263 |
||
58618 | 264 |
section \<open>Viewing documentation \label{sec:tool-doc}\<close> |
28224 | 265 |
|
58618 | 266 |
text \<open> |
52444
2cfe6656d6d6
slightly improved "isabelle doc" based on Isabelle/Scala;
wenzelm
parents:
52052
diff
changeset
|
267 |
The @{tool_def doc} tool displays Isabelle documentation: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
268 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
269 |
\<open>Usage: isabelle doc [DOC ...] |
28224 | 270 |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
271 |
View Isabelle documentation.\<close>} |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
272 |
|
61575 | 273 |
If called without arguments, it lists all available documents. Each line |
274 |
starts with an identifier, followed by a short description. Any of these |
|
275 |
identifiers may be specified as arguments, in order to display the |
|
276 |
corresponding document (see also \secref{sec:tool-display}). |
|
28224 | 277 |
|
61406 | 278 |
\<^medskip> |
61575 | 279 |
The @{setting ISABELLE_DOCS} setting specifies the list of directories |
280 |
(separated by colons) to be scanned for documentations. |
|
58618 | 281 |
\<close> |
28224 | 282 |
|
283 |
||
58618 | 284 |
section \<open>Shell commands within the settings environment \label{sec:tool-env}\<close> |
47828 | 285 |
|
61575 | 286 |
text \<open> |
287 |
The @{tool_def env} tool is a direct wrapper for the standard |
|
288 |
\<^verbatim>\<open>/usr/bin/env\<close> command on POSIX systems, running within the Isabelle |
|
289 |
settings environment (\secref{sec:settings}). |
|
47828 | 290 |
|
61575 | 291 |
The command-line arguments are that of the underlying version of \<^verbatim>\<open>env\<close>. For |
292 |
example, the following invokes an instance of the GNU Bash shell within the |
|
293 |
Isabelle environment: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
294 |
@{verbatim [display] \<open>isabelle env bash\<close>} |
58618 | 295 |
\<close> |
47828 | 296 |
|
297 |
||
58618 | 298 |
section \<open>Inspecting the settings environment \label{sec:tool-getenv}\<close> |
28224 | 299 |
|
58618 | 300 |
text \<open>The Isabelle settings environment --- as provided by the |
28224 | 301 |
site-default and user-specific settings files --- can be inspected |
48602 | 302 |
with the @{tool_def getenv} tool: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
303 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
304 |
\<open>Usage: isabelle getenv [OPTIONS] [VARNAMES ...] |
28224 | 305 |
|
306 |
Options are: |
|
307 |
-a display complete environment |
|
308 |
-b print values only (doesn't work for -a) |
|
31497 | 309 |
-d FILE dump complete environment to FILE |
310 |
(null terminated entries) |
|
28224 | 311 |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
312 |
Get value of VARNAMES from the Isabelle settings.\<close>} |
28224 | 313 |
|
61575 | 314 |
With the \<^verbatim>\<open>-a\<close> option, one may inspect the full process environment that |
315 |
Isabelle related programs are run in. This usually contains much more |
|
316 |
variables than are actually Isabelle settings. Normally, output is a list of |
|
317 |
lines of the form \<open>name\<close>\<^verbatim>\<open>=\<close>\<open>value\<close>. The \<^verbatim>\<open>-b\<close> option causes only the values |
|
318 |
to be printed. |
|
31497 | 319 |
|
61575 | 320 |
Option \<^verbatim>\<open>-d\<close> produces a dump of the complete environment to the specified |
321 |
file. Entries are terminated by the ASCII null character, i.e.\ the C string |
|
322 |
terminator. |
|
58618 | 323 |
\<close> |
28224 | 324 |
|
325 |
||
58618 | 326 |
subsubsection \<open>Examples\<close> |
28224 | 327 |
|
61575 | 328 |
text \<open> |
329 |
Get the location of @{setting ISABELLE_HOME_USER} where user-specific |
|
330 |
information is stored: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
331 |
@{verbatim [display] \<open>isabelle getenv ISABELLE_HOME_USER\<close>} |
28224 | 332 |
|
61406 | 333 |
\<^medskip> |
61575 | 334 |
Get the value only of the same settings variable, which is particularly |
335 |
useful in shell scripts: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
336 |
@{verbatim [display] \<open>isabelle getenv -b ISABELLE_OUTPUT\<close>} |
58618 | 337 |
\<close> |
28224 | 338 |
|
339 |
||
58618 | 340 |
section \<open>Installing standalone Isabelle executables \label{sec:tool-install}\<close> |
28224 | 341 |
|
61575 | 342 |
text \<open> |
343 |
By default, the main Isabelle binaries (@{executable "isabelle"} etc.) are |
|
344 |
just run from their location within the distribution directory, probably |
|
345 |
indirectly by the shell through its @{setting PATH}. Other schemes of |
|
346 |
installation are supported by the @{tool_def install} tool: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
347 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
348 |
\<open>Usage: isabelle install [OPTIONS] BINDIR |
28224 | 349 |
|
350 |
Options are: |
|
50132 | 351 |
-d DISTDIR refer to DISTDIR as Isabelle distribution |
28224 | 352 |
(default ISABELLE_HOME) |
353 |
||
50132 | 354 |
Install Isabelle executables with absolute references to the |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
355 |
distribution directory.\<close>} |
28224 | 356 |
|
61575 | 357 |
The \<^verbatim>\<open>-d\<close> option overrides the current Isabelle distribution directory as |
358 |
determined by @{setting ISABELLE_HOME}. |
|
28224 | 359 |
|
61575 | 360 |
The \<open>BINDIR\<close> argument tells where executable wrapper scripts for |
361 |
@{executable "isabelle_process"} and @{executable isabelle} should be |
|
362 |
placed, which is typically a directory in the shell's @{setting PATH}, such |
|
363 |
as \<^verbatim>\<open>$HOME/bin\<close>. |
|
48815 | 364 |
|
61406 | 365 |
\<^medskip> |
61575 | 366 |
It is also possible to make symbolic links of the main Isabelle executables |
367 |
manually, but making separate copies outside the Isabelle distribution |
|
368 |
directory will not work! |
|
369 |
\<close> |
|
28224 | 370 |
|
371 |
||
58618 | 372 |
section \<open>Creating instances of the Isabelle logo\<close> |
28224 | 373 |
|
61575 | 374 |
text \<open> |
375 |
The @{tool_def logo} tool creates instances of the generic Isabelle logo as |
|
376 |
EPS and PDF, for inclusion in {\LaTeX} documents. |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
377 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
378 |
\<open>Usage: isabelle logo [OPTIONS] XYZ |
28224 | 379 |
|
49072
747835eb2782
"isabelle logo" produces EPS and PDF format simultaneously;
wenzelm
parents:
48985
diff
changeset
|
380 |
Create instance XYZ of the Isabelle logo (as EPS and PDF). |
28224 | 381 |
|
382 |
Options are: |
|
49072
747835eb2782
"isabelle logo" produces EPS and PDF format simultaneously;
wenzelm
parents:
48985
diff
changeset
|
383 |
-n NAME alternative output base name (default "isabelle_xyx") |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
384 |
-q quiet mode\<close>} |
48936 | 385 |
|
61575 | 386 |
Option \<^verbatim>\<open>-n\<close> specifies an alternative (base) name for the generated files. |
387 |
The default is \<^verbatim>\<open>isabelle_\<close>\<open>xyz\<close> in lower-case. |
|
48936 | 388 |
|
61503 | 389 |
Option \<^verbatim>\<open>-q\<close> omits printing of the result file name. |
48936 | 390 |
|
61406 | 391 |
\<^medskip> |
61575 | 392 |
Implementors of Isabelle tools and applications are encouraged to make |
393 |
derived Isabelle logos for their own projects using this template. |
|
394 |
\<close> |
|
28224 | 395 |
|
396 |
||
58618 | 397 |
section \<open>Output the version identifier of the Isabelle distribution\<close> |
28224 | 398 |
|
58618 | 399 |
text \<open> |
48602 | 400 |
The @{tool_def version} tool displays Isabelle version information: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
401 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
402 |
\<open>Usage: isabelle version [OPTIONS] |
41511 | 403 |
|
404 |
Options are: |
|
405 |
-i short identification (derived from Mercurial id) |
|
406 |
||
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
407 |
Display Isabelle version information.\<close>} |
41511 | 408 |
|
61406 | 409 |
\<^medskip> |
61575 | 410 |
The default is to output the full version string of the Isabelle |
411 |
distribution, e.g.\ ``\<^verbatim>\<open>Isabelle2012: May 2012\<close>. |
|
41511 | 412 |
|
61575 | 413 |
The \<^verbatim>\<open>-i\<close> option produces a short identification derived from the Mercurial |
414 |
id of the @{setting ISABELLE_HOME} directory. |
|
58618 | 415 |
\<close> |
28224 | 416 |
|
417 |
||
58618 | 418 |
section \<open>Convert XML to YXML\<close> |
28224 | 419 |
|
58618 | 420 |
text \<open> |
61575 | 421 |
The @{tool_def yxml} tool converts a standard XML document (stdin) to the |
422 |
much simpler and more efficient YXML format of Isabelle (stdout). The YXML |
|
423 |
format is defined as follows. |
|
28224 | 424 |
|
61575 | 425 |
\<^enum> The encoding is always UTF-8. |
28224 | 426 |
|
61575 | 427 |
\<^enum> Body text is represented verbatim (no escaping, no special treatment of |
428 |
white space, no named entities, no CDATA chunks, no comments). |
|
28224 | 429 |
|
61575 | 430 |
\<^enum> Markup elements are represented via ASCII control characters \<open>\<^bold>X = 5\<close> |
431 |
and \<open>\<^bold>Y = 6\<close> as follows: |
|
28224 | 432 |
|
61575 | 433 |
\begin{tabular}{ll} |
434 |
XML & YXML \\\hline |
|
435 |
\<^verbatim>\<open><\<close>\<open>name attribute\<close>\<^verbatim>\<open>=\<close>\<open>value \<dots>\<close>\<^verbatim>\<open>>\<close> & |
|
436 |
\<open>\<^bold>X\<^bold>Yname\<^bold>Yattribute\<close>\<^verbatim>\<open>=\<close>\<open>value\<dots>\<^bold>X\<close> \\ |
|
437 |
\<^verbatim>\<open></\<close>\<open>name\<close>\<^verbatim>\<open>>\<close> & \<open>\<^bold>X\<^bold>Y\<^bold>X\<close> \\ |
|
438 |
\end{tabular} |
|
28224 | 439 |
|
61575 | 440 |
There is no special case for empty body text, i.e.\ \<^verbatim>\<open><foo/>\<close> is treated |
441 |
like \<^verbatim>\<open><foo></foo>\<close>. Also note that \<open>\<^bold>X\<close> and \<open>\<^bold>Y\<close> may never occur in |
|
442 |
well-formed XML documents. |
|
28224 | 443 |
|
444 |
Parsing YXML is pretty straight-forward: split the text into chunks |
|
61575 | 445 |
separated by \<open>\<^bold>X\<close>, then split each chunk into sub-chunks separated by \<open>\<^bold>Y\<close>. |
446 |
Markup chunks start with an empty sub-chunk, and a second empty sub-chunk |
|
447 |
indicates close of an element. Any other non-empty chunk consists of plain |
|
448 |
text. For example, see @{file "~~/src/Pure/PIDE/yxml.ML"} or @{file |
|
449 |
"~~/src/Pure/PIDE/yxml.scala"}. |
|
28224 | 450 |
|
61575 | 451 |
YXML documents may be detected quickly by checking that the first two |
452 |
characters are \<open>\<^bold>X\<^bold>Y\<close>. |
|
58618 | 453 |
\<close> |
28224 | 454 |
|
455 |
end |