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