author | wenzelm |
Mon, 27 Aug 2012 16:10:54 +0200 | |
changeset 48936 | e6d9e46ff7bc |
parent 48814 | d488a5f25bf6 |
permissions | -rw-r--r-- |
28222 | 1 |
% |
2 |
\begin{isabellebody}% |
|
3 |
\def\isabellecontext{Presentation}% |
|
4 |
% |
|
5 |
\isadelimtheory |
|
6 |
% |
|
7 |
\endisadelimtheory |
|
8 |
% |
|
9 |
\isatagtheory |
|
10 |
\isacommand{theory}\isamarkupfalse% |
|
11 |
\ Presentation\isanewline |
|
43564
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42009
diff
changeset
|
12 |
\isakeyword{imports}\ Base\isanewline |
28222 | 13 |
\isakeyword{begin}% |
14 |
\endisatagtheory |
|
15 |
{\isafoldtheory}% |
|
16 |
% |
|
17 |
\isadelimtheory |
|
18 |
% |
|
19 |
\endisadelimtheory |
|
20 |
% |
|
21 |
\isamarkupchapter{Presenting theories \label{ch:present}% |
|
22 |
} |
|
23 |
\isamarkuptrue% |
|
24 |
% |
|
25 |
\begin{isamarkuptext}% |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
26 |
Isabelle provides several ways to present the outcome of |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
27 |
formal developments, including WWW-based browsable libraries or |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
28 |
actual printable documents. Presentation is centered around the |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
29 |
concept of \emph{sessions} (\chref{ch:session}). The global session |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
30 |
structure is that of a tree, with Isabelle Pure at its root, further |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
31 |
object-logics derived (e.g.\ HOLCF from HOL, and HOL from Pure), and |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
32 |
application sessions further on in the hierarchy. |
28222 | 33 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
34 |
The tools \indexref{}{tool}{mkroot}\hyperlink{tool.mkroot}{\mbox{\isa{\isatool{mkroot}}}} and \indexref{}{tool}{build}\hyperlink{tool.build}{\mbox{\isa{\isatool{build}}}} provide the |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
35 |
primary means for managing Isabelle sessions, including proper setup |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
36 |
for presentation; \hyperlink{tool.build}{\mbox{\isa{\isatool{build}}}} takes care to have \indexref{}{executable}{isabelle-process}\hyperlink{executable.isabelle-process}{\mbox{\isa{\isatt{isabelle{\isaliteral{2D}{\isacharminus}}process}}}} run any additional stages required for document |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
37 |
preparation, notably the \indexref{}{tool}{document}\hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}} and \indexref{}{tool}{latex}\hyperlink{tool.latex}{\mbox{\isa{\isatool{latex}}}}. |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
38 |
The complete tool chain for managing batch-mode Isabelle sessions is |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
39 |
illustrated in \figref{fig:session-tools}. |
28222 | 40 |
|
41 |
\begin{figure}[htbp] |
|
42 |
\begin{center} |
|
43 |
\begin{tabular}{lp{0.6\textwidth}} |
|
44 |
||
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
45 |
\indexref{}{tool}{mkroot}\hyperlink{tool.mkroot}{\mbox{\isa{\isatool{mkroot}}}} & invoked once by the user to initialize the |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
46 |
session \verb|ROOT| with optional \verb|document| |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
47 |
directory; \\ |
28222 | 48 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
49 |
\indexref{}{tool}{build}\hyperlink{tool.build}{\mbox{\isa{\isatool{build}}}} & invoked repeatedly by the user to keep |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
50 |
session output up-to-date (HTML, documents etc.); \\ |
28222 | 51 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
52 |
\hyperlink{executable.isabelle-process}{\mbox{\isa{\isatt{isabelle{\isaliteral{2D}{\isacharminus}}process}}}} & run through \indexref{}{tool}{build}\hyperlink{tool.build}{\mbox{\isa{\isatool{build}}}}; \\ |
28222 | 53 |
|
48602 | 54 |
\indexref{}{tool}{document}\hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}} & run by the Isabelle process if document |
55 |
preparation is enabled; \\ |
|
28222 | 56 |
|
48602 | 57 |
\indexref{}{tool}{latex}\hyperlink{tool.latex}{\mbox{\isa{\isatool{latex}}}} & universal {\LaTeX} tool wrapper invoked |
58 |
multiple times by \indexref{}{tool}{document}\hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}}; also useful for manual |
|
59 |
experiments; \\ |
|
28222 | 60 |
|
61 |
\end{tabular} |
|
62 |
\caption{The tool chain of Isabelle session presentation} \label{fig:session-tools} |
|
63 |
\end{center} |
|
64 |
\end{figure}% |
|
65 |
\end{isamarkuptext}% |
|
66 |
\isamarkuptrue% |
|
67 |
% |
|
68 |
\isamarkupsection{Generating theory browser information \label{sec:info}% |
|
69 |
} |
|
70 |
\isamarkuptrue% |
|
71 |
% |
|
72 |
\begin{isamarkuptext}% |
|
73 |
\index{theory browsing information|bold} |
|
74 |
||
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
75 |
As a side-effect of building sessions, Isabelle is able to generate |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
76 |
theory browsing information, including HTML documents that show the |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
77 |
theory sources and the relationship with its ancestors and |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
78 |
descendants. Besides the HTML file that is generated for every |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
79 |
theory, Isabelle stores links to all theories in an index |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
80 |
file. These indexes are linked with other indexes to represent the |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
81 |
overall tree structure of the sessions. |
28222 | 82 |
|
83 |
Isabelle also generates graph files that represent the theory |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
84 |
dependencies within a session. There is a graph browser Java applet |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
85 |
embedded in the generated HTML pages, and also a stand-alone |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
86 |
application that allows browsing theory graphs without having to |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
87 |
start a WWW client first. The latter version also includes features |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
88 |
such as generating Postscript files, which are not available in the |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
89 |
applet version. See \secref{sec:browse} for further information. |
28222 | 90 |
|
91 |
\medskip |
|
92 |
||
93 |
The easiest way to let Isabelle generate theory browsing information |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
94 |
for existing sessions is to invoke \hyperlink{tool.build}{\mbox{\isa{\isatool{build}}}} with suitable |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
95 |
options: |
28222 | 96 |
|
97 |
\begin{ttbox} |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
98 |
isabelle build -o browser_info -v -c FOL |
28222 | 99 |
\end{ttbox} |
100 |
||
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
101 |
The presentation output will appear in \verb|$ISABELLE_BROWSER_INFO/FOL| as reported by the above verbose |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
102 |
invocation of the build process. |
28222 | 103 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
104 |
Many Isabelle sessions (such as \verb|HOL-Library| in \verb|~~/src/HOL/Library|) also provide actual printable documents. |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
105 |
These are prepared automatically as well if enabled like this: |
28222 | 106 |
\begin{ttbox} |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
107 |
isabelle build -o browser_info -o document=pdf -v -c HOL-Library |
28222 | 108 |
\end{ttbox} |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
109 |
|
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
110 |
Enabling both browser info and document preparation simultaneously |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
111 |
causes an appropriate ``document'' link to be included in the HTML |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
112 |
index. Documents may be generated independently of browser |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
113 |
information as well, see \secref{sec:tool-document} for further |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
114 |
details. |
28222 | 115 |
|
116 |
\bigskip The theory browsing information is stored in a |
|
40406 | 117 |
sub-directory directory determined by the \indexref{}{setting}{ISABELLE\_BROWSER\_INFO}\hyperlink{setting.ISABELLE-BROWSER-INFO}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}BROWSER{\isaliteral{5F}{\isacharunderscore}}INFO}}}} setting plus a prefix corresponding to the |
28222 | 118 |
session identifier (according to the tree structure of sub-sessions |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
119 |
by default). In order to present Isabelle applications on the web, |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
120 |
the corresponding subdirectory from \hyperlink{setting.ISABELLE-BROWSER-INFO}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}BROWSER{\isaliteral{5F}{\isacharunderscore}}INFO}}}} |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
121 |
can be put on a WWW server.% |
28222 | 122 |
\end{isamarkuptext}% |
123 |
\isamarkuptrue% |
|
124 |
% |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
125 |
\isamarkupsection{Preparing session root directories \label{sec:tool-mkroot}% |
28222 | 126 |
} |
127 |
\isamarkuptrue% |
|
128 |
% |
|
129 |
\begin{isamarkuptext}% |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
130 |
The \indexdef{}{tool}{mkroot}\hypertarget{tool.mkroot}{\hyperlink{tool.mkroot}{\mbox{\isa{\isatool{mkroot}}}}} tool configures a given directory as |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
131 |
session root, with some \verb|ROOT| file and optional document |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
132 |
source directory. Its usage is: |
28222 | 133 |
\begin{ttbox} |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
134 |
Usage: isabelle mkroot [OPTIONS] [DIR] |
28222 | 135 |
|
136 |
Options are: |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
137 |
-d enable document preparation |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
138 |
-n NAME alternative session name (default: DIR base name) |
28222 | 139 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
140 |
Prepare session root DIR (default: current directory). |
28222 | 141 |
\end{ttbox} |
142 |
||
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
143 |
The results are placed in the given directory \isa{dir}, which |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
144 |
refers to the current directory by default. The \hyperlink{tool.mkroot}{\mbox{\isa{\isatool{mkroot}}}} tool |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
145 |
is conservative in the sense that it does not overwrite existing |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
146 |
files or directories. Earlier attempts to generate a session root |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
147 |
need to be deleted manually. |
28222 | 148 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
149 |
\medskip Option \verb|-d| indicates that the session shall be |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
150 |
accompanied by a formal document, with \isa{dir}\verb|/document/root.tex| as its {\LaTeX} entry point (see also |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
151 |
\chref{ch:present}). |
28222 | 152 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
153 |
Option \verb|-n| allows to specify an alternative session |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
154 |
name; otherwise the base name of the given directory is used. |
28222 | 155 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
156 |
\medskip The implicit Isabelle settings variable \hyperlink{setting.ISABELLE-LOGIC}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}LOGIC}}}} specifies the parent session, and \hyperlink{setting.ISABELLE-DOCUMENT-FORMAT}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}DOCUMENT{\isaliteral{5F}{\isacharunderscore}}FORMAT}}}} the document format to be filled filled |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
157 |
into the generated \verb|ROOT| file.% |
28222 | 158 |
\end{isamarkuptext}% |
159 |
\isamarkuptrue% |
|
160 |
% |
|
161 |
\isamarkupsubsubsection{Examples% |
|
162 |
} |
|
163 |
\isamarkuptrue% |
|
164 |
% |
|
165 |
\begin{isamarkuptext}% |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
166 |
Produce session \verb|Test| (with document preparation) |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
167 |
within a separate directory of the same name: |
28222 | 168 |
\begin{ttbox} |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
169 |
isabelle mkroot -d Test && isabelle build -D Test |
28222 | 170 |
\end{ttbox} |
171 |
||
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
172 |
\medskip Upgrade the current directory into a session ROOT with |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
173 |
document preparation, and build it: |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
174 |
\begin{ttbox} |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
175 |
isabelle mkroot -d && isabelle build -D . |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
176 |
\end{ttbox}% |
28222 | 177 |
\end{isamarkuptext}% |
178 |
\isamarkuptrue% |
|
179 |
% |
|
180 |
\isamarkupsection{Preparing Isabelle session documents |
|
181 |
\label{sec:tool-document}% |
|
182 |
} |
|
183 |
\isamarkuptrue% |
|
184 |
% |
|
185 |
\begin{isamarkuptext}% |
|
48602 | 186 |
The \indexdef{}{tool}{document}\hypertarget{tool.document}{\hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}}} tool prepares logic session |
187 |
documents, processing the sources both as provided by the user and |
|
188 |
generated by Isabelle. Its usage is: |
|
28222 | 189 |
\begin{ttbox} |
48602 | 190 |
Usage: isabelle document [OPTIONS] [DIR] |
28222 | 191 |
|
192 |
Options are: |
|
193 |
-c cleanup -- be aggressive in removing old stuff |
|
194 |
-n NAME specify document name (default 'document') |
|
195 |
-o FORMAT specify output format: dvi (default), dvi.gz, ps, |
|
196 |
ps.gz, pdf |
|
197 |
-t TAGS specify tagged region markup |
|
198 |
||
199 |
Prepare the theory session document in DIR (default 'document') |
|
200 |
producing the specified output format. |
|
201 |
\end{ttbox} |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
202 |
This tool is usually run automatically as part of the Isabelle build |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
203 |
process, provided document preparation has been enabled via suitable |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
204 |
options. It may be manually invoked on the generated browser |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
205 |
information document output as well, e.g.\ in case of errors |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
206 |
encountered in the batch run. |
28222 | 207 |
|
48602 | 208 |
\medskip The \verb|-c| option tells \hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}} to |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
209 |
dispose the document sources after successful operation! This is |
28222 | 210 |
the right thing to do for sources generated by an Isabelle process, |
211 |
but take care of your files in manual document preparation! |
|
212 |
||
213 |
\medskip The \verb|-n| and \verb|-o| option specify |
|
214 |
the final output file name and format, the default is ``\verb|document.dvi|''. Note that the result will appear in the parent of |
|
215 |
the target \verb|DIR|. |
|
216 |
||
217 |
\medskip The \verb|-t| option tells {\LaTeX} how to interpret |
|
218 |
tagged Isabelle command regions. Tags are specified as a comma |
|
219 |
separated list of modifier/name pairs: ``\verb|+|\isa{foo}'' (or just ``\isa{foo}'') means to keep, ``\verb|-|\isa{foo}'' to drop, and ``\verb|/|\isa{foo}'' to |
|
220 |
fold text tagged as \isa{foo}. The builtin default is equivalent |
|
30114 | 221 |
to the tag specification ``\verb|+theory,+proof,+ML,+visible,-invisible|''; see also the {\LaTeX} |
28222 | 222 |
macros \verb|\isakeeptag|, \verb|\isadroptag|, and |
40802 | 223 |
\verb|\isafoldtag|, in \verb|~~/lib/texinputs/isabelle.sty|. |
28222 | 224 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
225 |
\medskip Document preparation requires a \verb|document| |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
226 |
directory within the session sources. This directory is supposed to |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
227 |
contain all the files needed to produce the final document --- apart |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
228 |
from the actual theories which are generated by Isabelle. |
28222 | 229 |
|
48602 | 230 |
\medskip For most practical purposes, \hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}} is smart |
231 |
enough to create any of the specified output formats, taking |
|
28222 | 232 |
\verb|root.tex| supplied by the user as a starting point. This |
233 |
even includes multiple runs of {\LaTeX} to accommodate references |
|
234 |
and bibliographies (the latter assumes \verb|root.bib| within |
|
235 |
the same directory). |
|
236 |
||
48657
63ef2f0cf8bb
simplified custom document/build script, instead of old-style document/IsaMakefile;
wenzelm
parents:
48616
diff
changeset
|
237 |
In more complex situations, a separate \verb|build| script for |
63ef2f0cf8bb
simplified custom document/build script, instead of old-style document/IsaMakefile;
wenzelm
parents:
48616
diff
changeset
|
238 |
the document sources may be given. It is invoked with command-line |
63ef2f0cf8bb
simplified custom document/build script, instead of old-style document/IsaMakefile;
wenzelm
parents:
48616
diff
changeset
|
239 |
arguments for the document format and the document variant name. |
63ef2f0cf8bb
simplified custom document/build script, instead of old-style document/IsaMakefile;
wenzelm
parents:
48616
diff
changeset
|
240 |
The script needs to produce corresponding output files, e.g.\ |
63ef2f0cf8bb
simplified custom document/build script, instead of old-style document/IsaMakefile;
wenzelm
parents:
48616
diff
changeset
|
241 |
\verb|root.pdf| for target format \verb|pdf| (and default |
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
242 |
default variants). The main work can be again delegated to \hyperlink{tool.latex}{\mbox{\isa{\isatool{latex}}}}, but it is also possible to harvest generated {\LaTeX} |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
243 |
sources and copy them elsewhere, for example. |
28222 | 244 |
|
42009
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
245 |
\medskip When running the session, Isabelle copies the content of |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
246 |
the original \verb|document| directory into its proper place |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
247 |
within \hyperlink{setting.ISABELLE-BROWSER-INFO}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}BROWSER{\isaliteral{5F}{\isacharunderscore}}INFO}}}}, according to the session |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
248 |
path and document variant. Then, for any processed theory \isa{A} |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
249 |
some {\LaTeX} source is generated and put there as \isa{A}\verb|.tex|. Furthermore, a list of all generated theory |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
250 |
files is put into \verb|session.tex|. Typically, the root |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
251 |
{\LaTeX} file provided by the user would include \verb|session.tex| to get a document containing all the theories. |
28222 | 252 |
|
253 |
The {\LaTeX} versions of the theories require some macros defined in |
|
40802 | 254 |
\verb|~~/lib/texinputs/isabelle.sty|. Doing \verb|\usepackage{isabelle}| in \verb|root.tex| should be fine; |
48602 | 255 |
the underlying \hyperlink{tool.latex}{\mbox{\isa{\isatool{latex}}}} already includes an appropriate path |
256 |
specification for {\TeX} inputs. |
|
28222 | 257 |
|
258 |
If the text contains any references to Isabelle symbols (such as |
|
28238 | 259 |
\verb|\|\verb|<forall>|) then \verb|isabellesym.sty| should be included as well. This package |
28838
d5db6dfcb34a
moved table of standard Isabelle symbols to isar-ref manual;
wenzelm
parents:
28505
diff
changeset
|
260 |
contains a standard set of {\LaTeX} macro definitions \verb|\isasym|\isa{foo} corresponding to \verb|\|\verb|<|\isa{foo}\verb|>|, see \cite{isabelle-implementation} for a |
d5db6dfcb34a
moved table of standard Isabelle symbols to isar-ref manual;
wenzelm
parents:
28505
diff
changeset
|
261 |
complete list of predefined Isabelle symbols. Users may invent |
28222 | 262 |
further symbols as well, just by providing {\LaTeX} macros in a |
40802 | 263 |
similar fashion as in \verb|~~/lib/texinputs/isabellesym.sty| of |
28238 | 264 |
the distribution. |
28222 | 265 |
|
266 |
For proper setup of DVI and PDF documents (with hyperlinks and |
|
40802 | 267 |
bookmarks), we recommend to include \verb|~~/lib/texinputs/pdfsetup.sty| as well. |
28222 | 268 |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
269 |
\medskip As a final step of Isabelle document preparation, \hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}}~\verb|-c| is run on the resulting copy of the |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
270 |
\verb|document| directory. Thus the actual output document is |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
271 |
built and installed in its proper place. The generated sources are |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
272 |
deleted after successful run of {\LaTeX} and friends. |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
273 |
|
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
274 |
Some care is needed if the document output location is configured |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
275 |
differently, say within a directory whose content is still required |
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
276 |
afterwards!% |
28222 | 277 |
\end{isamarkuptext}% |
278 |
\isamarkuptrue% |
|
279 |
% |
|
280 |
\isamarkupsection{Running {\LaTeX} within the Isabelle environment |
|
281 |
\label{sec:tool-latex}% |
|
282 |
} |
|
283 |
\isamarkuptrue% |
|
284 |
% |
|
285 |
\begin{isamarkuptext}% |
|
48602 | 286 |
The \indexdef{}{tool}{latex}\hypertarget{tool.latex}{\hyperlink{tool.latex}{\mbox{\isa{\isatool{latex}}}}} tool provides the basic interface for |
28222 | 287 |
Isabelle document preparation. Its usage is: |
288 |
\begin{ttbox} |
|
48602 | 289 |
Usage: isabelle latex [OPTIONS] [FILE] |
28222 | 290 |
|
291 |
Options are: |
|
292 |
-o FORMAT specify output format: dvi (default), dvi.gz, ps, |
|
293 |
ps.gz, pdf, bbl, idx, sty, syms |
|
294 |
||
295 |
Run LaTeX (and related tools) on FILE (default root.tex), |
|
296 |
producing the specified output format. |
|
297 |
\end{ttbox} |
|
298 |
||
299 |
Appropriate {\LaTeX}-related programs are run on the input file, |
|
300 |
according to the given output format: \hyperlink{executable.latex}{\mbox{\isa{\isatt{latex}}}}, |
|
301 |
\hyperlink{executable.pdflatex}{\mbox{\isa{\isatt{pdflatex}}}}, \hyperlink{executable.dvips}{\mbox{\isa{\isatt{dvips}}}}, \hyperlink{executable.bibtex}{\mbox{\isa{\isatt{bibtex}}}} |
|
302 |
(for \verb|bbl|), and \hyperlink{executable.makeindex}{\mbox{\isa{\isatt{makeindex}}}} (for \verb|idx|). The actual commands are determined from the settings |
|
40406 | 303 |
environment (\hyperlink{setting.ISABELLE-LATEX}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}LATEX}}}} etc.). |
28222 | 304 |
|
305 |
The \verb|sty| output format causes the Isabelle style files to |
|
306 |
be updated from the distribution. This is useful in special |
|
307 |
situations where the document sources are to be processed another |
|
48814
d488a5f25bf6
some updates of "Presenting theories", using mkroot/build instead of former mkdir/make/usedir (which are still present in "Misc");
wenzelm
parents:
48722
diff
changeset
|
308 |
time by separate tools. |
28222 | 309 |
|
310 |
The \verb|syms| output is for internal use; it generates lists |
|
311 |
of symbols that are available without loading additional {\LaTeX} |
|
312 |
packages.% |
|
313 |
\end{isamarkuptext}% |
|
314 |
\isamarkuptrue% |
|
315 |
% |
|
316 |
\isamarkupsubsubsection{Examples% |
|
317 |
} |
|
318 |
\isamarkuptrue% |
|
319 |
% |
|
320 |
\begin{isamarkuptext}% |
|
48602 | 321 |
Invoking \hyperlink{tool.latex}{\mbox{\isa{\isatool{latex}}}} by hand may be occasionally useful when |
322 |
debugging failed attempts of the automatic document preparation |
|
323 |
stage of batch-mode Isabelle. The abortive process leaves the |
|
324 |
sources at a certain place within \hyperlink{setting.ISABELLE-BROWSER-INFO}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}BROWSER{\isaliteral{5F}{\isacharunderscore}}INFO}}}}, |
|
325 |
see the runtime error message for details. This enables users to |
|
326 |
inspect {\LaTeX} runs in further detail, e.g.\ like this: |
|
327 |
||
28222 | 328 |
\begin{ttbox} |
40387
e4c9e0dad473
moved ISABELLE_IDENTIFIER from ISABELLE_OUTPUT further up to ISABELLE_HOME_USER;
wenzelm
parents:
35587
diff
changeset
|
329 |
cd ~/.isabelle/IsabelleXXXX/browser_info/HOL/Test/document |
28505 | 330 |
isabelle latex -o pdf |
28222 | 331 |
\end{ttbox}% |
332 |
\end{isamarkuptext}% |
|
333 |
\isamarkuptrue% |
|
334 |
% |
|
335 |
\isadelimtheory |
|
336 |
% |
|
337 |
\endisadelimtheory |
|
338 |
% |
|
339 |
\isatagtheory |
|
340 |
\isacommand{end}\isamarkupfalse% |
|
341 |
% |
|
342 |
\endisatagtheory |
|
343 |
{\isafoldtheory}% |
|
344 |
% |
|
345 |
\isadelimtheory |
|
346 |
% |
|
347 |
\endisadelimtheory |
|
348 |
\end{isabellebody}% |
|
349 |
%%% Local Variables: |
|
350 |
%%% mode: latex |
|
351 |
%%% TeX-master: "root" |
|
352 |
%%% End: |