255
ef1da1abee46
added infrastructure for index; antiquotations have now the options [index] and [indexc]
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
1 |
\documentclass[11pt,a4paper]{book}
|
62
|
2 |
\usepackage[latin1]{inputenc}
|
0
|
3 |
\usepackage{amsmath,amsthm}
|
2
|
4 |
\usepackage{isabelle}
|
|
5 |
\usepackage{isabellesym}
|
|
6 |
\usepackage{charter}
|
|
7 |
\usepackage[pdftex]{graphicx}
|
21
|
8 |
\usepackage{proof}
|
31
|
9 |
\usepackage{url}
|
38
|
10 |
\usepackage[a4paper,hscale=0.67,vscale=0.76]{geometry}
|
51
|
11 |
\usepackage{lineno}
|
69
|
12 |
\usepackage{xcolor}
|
77
|
13 |
\usepackage{framed}
|
173
|
14 |
\usepackage{boxedminipage}
|
89
|
15 |
\usepackage{mathpartir}
|
218
7ff7325e3b4e
started to adapt the rest of chapter 5 to the simplified version without parameters (they will be described in the extension section)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
16 |
\usepackage{flafter}
|
342
|
17 |
\usepackage{index}
|
257
|
18 |
\usepackage{tocbibind}
|
358
|
19 |
\usepackage{tikz}
|
|
20 |
\usetikzlibrary{shadows}
|
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
21 |
\usepackage{pdfsetup}
|
0
|
22 |
|
339
c588e8422737
used a better implementation of \index in Latex; added more to the theorem section
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
23 |
|
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
24 |
\urlstyle{rm}
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
25 |
\renewcommand{\isastyletxt}{\isastyletext}% use same formatting for txt and text
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
26 |
\renewcommand{\isastyleminor}{\tt\slshape}%
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
27 |
\renewcommand{\isastyle}{\small\tt\slshape}%
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
28 |
\isadroptag{theory}
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
29 |
|
71
|
30 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
255
ef1da1abee46
added infrastructure for index; antiquotations have now the options [index] and [indexc]
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
31 |
% indexing
|
373
|
32 |
\newindex{default}{idx}{ind}{Index}
|
|
33 |
\newindex{str}{str}{stu}{Structure Index}
|
255
ef1da1abee46
added infrastructure for index; antiquotations have now the options [index] and [indexc]
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
34 |
|
ef1da1abee46
added infrastructure for index; antiquotations have now the options [index] and [indexc]
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
35 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
36 |
% For cross references to the other manuals:
|
7
d7cebb2c5105
added an explicit file containing references in the Implementation manual (should be replaced by antiquotations)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
37 |
\usepackage{xr}
|
d7cebb2c5105
added an explicit file containing references in the Implementation manual (should be replaced by antiquotations)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
38 |
\externaldocument[I-]{implementation}
|
d7cebb2c5105
added an explicit file containing references in the Implementation manual (should be replaced by antiquotations)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
39 |
\newcommand{\impref}[1]{\ref{I-#1}}
|
13
|
40 |
\newcommand{\ichcite}[1]{[Impl.\,Man., Ch.~\impref{#1}]}
|
|
41 |
\newcommand{\isccite}[1]{[Impl.\,Man., Sec.~\impref{#1}]}
|
44
dee4b3e66dfe
added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
42 |
\externaldocument[R-]{isar-ref}
|
dee4b3e66dfe
added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
43 |
\newcommand{\isarref}[1]{\ref{R-#1}}
|
dee4b3e66dfe
added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
44 |
\newcommand{\rchcite}[1]{[Isar Ref.\,Man., Ch.~\isarref{#1}]}
|
dee4b3e66dfe
added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
45 |
\newcommand{\rsccite}[1]{[Isar Ref.\,Man., Sec.~\isarref{#1}]}
|
0
|
46 |
|
71
|
47 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
5
|
48 |
% sane default for proof documents
|
77
|
49 |
\parindent 0pt
|
|
50 |
\parskip 0.6ex
|
173
|
51 |
\abovecaptionskip 1mm
|
77
|
52 |
\belowcaptionskip 10mm
|
71
|
53 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
54 |
\hyphenation{Isabelle}
|
121
|
55 |
\renewcommand{\isasymiota}{}
|
211
d5accbc67e1b
more work on simple inductive and marked all sections that are still seriously incomplete with TBD
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
56 |
\renewcommand{\isamarkupsubsection}[1]{\subsection*{#1}}
|
71
|
57 |
|
|
58 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
59 |
% to work around a problem with \isanewline
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
60 |
\renewcommand{\isanewline}{{\parindent0pt\parskip0pt\mbox{}\par\mbox{}}}
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
61 |
|
71
|
62 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
63 |
% for exercises, comments and readmores
|
329
|
64 |
\newtheoremstyle{exercisestyle}{\topsep}{\topsep}{\small\it}{}{\small\bfseries}{:}{1ex}{}
|
|
65 |
\theoremstyle{exercisestyle}
|
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
66 |
\newtheorem{exercise}{Exercise}[section]
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
67 |
\newcommand{\solution}[1]{{\bf Solution for Exercise~\ref{#1}.}}
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
68 |
|
5
|
69 |
\newcommand{\readmoremarginpar}[1]%
|
|
70 |
{\marginpar[\raggedleft\small{#1}]{\raggedright\small{#1}}}
|
|
71 |
|
97
|
72 |
\newenvironment{leftrightbar}{%
|
|
73 |
\def\FrameCommand##1{\vrule width 2pt \hspace{8pt}##1\hspace{8pt}\vrule width 2pt}%
|
|
74 |
\MakeFramed {\advance\hsize-\width \FrameRestore}}%
|
|
75 |
{\endMakeFramed}
|
|
76 |
|
5
|
77 |
\newenvironment{readmore}%
|
101
|
78 |
{\begin{leftrightbar}\small\it{\textbf{Read More}}\\}{\end{leftrightbar}}
|
347
|
79 |
\newenvironment{conventions}%
|
368
|
80 |
{\begin{leftrightbar}\small\it{\textbf{Coding Conventions / Rules of Thumb}}}{\end{leftrightbar}}
|
312
|
81 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
82 |
% some mathematical notation
|
|
83 |
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}
|
0
|
84 |
|
71
|
85 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
86 |
% this is to draw a gray box around code
|
77
|
87 |
%(FIXME redefine pagebreak so that it includes a \smallskip)
|
|
88 |
\newenvironment{graybox}
|
|
89 |
{\def\FrameCommand{\fboxsep=1pt\colorbox{gray!20}}\MakeFramed{\smallskip\FrameRestore}}
|
|
90 |
{\smallskip\endMakeFramed}
|
31
|
91 |
|
71
|
92 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
93 |
% this hack is for getting rid of the ML {* ... *}
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
94 |
% scaffolding around function definitions
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
95 |
\newenvironment{vanishML}{%
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
96 |
\renewcommand{\isacommand}[1]{}%
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
97 |
\renewcommand{\isacharverbatimopen}{}%
|
69
|
98 |
\renewcommand{\isacharverbatimclose}{}}{}
|
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
99 |
|
106
bdd82350cf22
renamed in the pdf all instances of cookbook to tutorial (in order to sound more serious)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
100 |
\isakeeptag{TutorialML}
|
bdd82350cf22
renamed in the pdf all instances of cookbook to tutorial (in order to sound more serious)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
101 |
\renewcommand{\isatagTutorialML}{\begin{vanishML}\begin{graybox}}
|
bdd82350cf22
renamed in the pdf all instances of cookbook to tutorial (in order to sound more serious)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
102 |
\renewcommand{\endisatagTutorialML}{\end{graybox}\end{vanishML}}
|
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
103 |
|
71
|
104 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
72
7b8c4fe235aa
added an antiquotation option [gray] for gray boxes around displays
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
105 |
% for code that has line numbers
|
118
|
106 |
\newenvironment{linenos}{\resetlinenumber\internallinenumbers}{\par\nolinenumbers}
|
117
|
107 |
|
114
|
108 |
\isakeeptag{linenos}
|
117
|
109 |
\renewcommand{\isataglinenos}{\begin{linenos}}
|
118
|
110 |
\renewcommand{\endisataglinenos}{\end{linenos}}
|
114
|
111 |
|
|
112 |
% should only be used in ML code
|
|
113 |
\isakeeptag{linenosgray}
|
117
|
114 |
\renewcommand{\isataglinenosgray}{\begin{vanishML}\begin{graybox}\begin{linenos}}
|
118
|
115 |
\renewcommand{\endisataglinenosgray}{\end{linenos}\end{graybox}\end{vanishML}}
|
71
|
116 |
|
177
|
117 |
\isakeeptag{gray}
|
|
118 |
\renewcommand{\isataggray}{\begin{graybox}}
|
|
119 |
\renewcommand{\endisataggray}{\end{graybox}}
|
|
120 |
|
115
|
121 |
\isakeeptag{small}
|
|
122 |
\renewcommand{\isatagsmall}{\begingroup\small}
|
|
123 |
\renewcommand{\endisatagsmall}{\endgroup}
|
|
124 |
|
244
|
125 |
% for code that should not be printed
|
|
126 |
\isakeeptag{no}
|
|
127 |
\renewcommand{\isatagno}{}
|
|
128 |
\renewcommand{\endisatagno}{}
|
|
129 |
|
72
7b8c4fe235aa
added an antiquotation option [gray] for gray boxes around displays
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
130 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
7b8c4fe235aa
added an antiquotation option [gray] for gray boxes around displays
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
131 |
\renewenvironment{isabelle}
|
7b8c4fe235aa
added an antiquotation option [gray] for gray boxes around displays
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
132 |
{\begin{trivlist}\begin{isabellebody}\small\item\relax}
|
7b8c4fe235aa
added an antiquotation option [gray] for gray boxes around displays
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
133 |
{\end{isabellebody}\end{trivlist}}
|
85
|
134 |
|
|
135 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
136 |
% for {* *} in antiquotations
|
|
137 |
\newcommand{\isasymverbopen}{\isacharverbatimopen}
|
|
138 |
\newcommand{\isasymverbclose}{\isacharverbatimclose}
|
240
|
139 |
\newcommand{\isasymfoo}{\isa{{\isacharbackslash}{\isacharless}foo{\isachargreater}}}
|
85
|
140 |
|
71
|
141 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
108
8bea3f74889d
added to the tactical chapter; polished; added the tabularstar environment (which is just tabular*)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
142 |
% since * cannot be used in text {*...*}
|
8bea3f74889d
added to the tactical chapter; polished; added the tabularstar environment (which is just tabular*)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
143 |
\newenvironment{tabularstar}[2]
|
8bea3f74889d
added to the tactical chapter; polished; added the tabularstar environment (which is just tabular*)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
144 |
{\begin{tabular*}{#1}{#2}}{\end{tabular*}}
|
8bea3f74889d
added to the tactical chapter; polished; added the tabularstar environment (which is just tabular*)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
145 |
|
8bea3f74889d
added to the tactical chapter; polished; added the tabularstar environment (which is just tabular*)
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
146 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
116
|
147 |
% short hands
|
|
148 |
\def\simpleinductive{\isacommand{simple\isacharunderscore{}inductive}}
|
|
149 |
|
|
150 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
0
|
151 |
\begin{document}
|
|
152 |
|
2
|
153 |
\title{\mbox{}\\[-10ex]
|
297
|
154 |
\includegraphics[scale=0.5]{tutorial-logo.jpg}\\[3ex]
|
427
|
155 |
{\huge\bf The Isabelle Cookbook}\\
|
|
156 |
\mbox{A Tutorial for Programming on the ML-Level of Isabelle}\\ (draft)}
|
71
|
157 |
|
119
|
158 |
\author{by Christian Urban with contributions from:\\[2ex]
|
62
|
159 |
\begin{tabular}{r@{\hspace{1.8mm}}l}
|
|
160 |
Stefan & Berghofer\\
|
248
11851b20fb78
added more to the pretty section and updated the acknowledgements
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
161 |
Jasmin & Blanchette\\
|
62
|
162 |
Sascha & Böhme\\
|
390
|
163 |
Lukas & Bulwahn\\
|
62
|
164 |
Jeremy & Dawson\\
|
293
|
165 |
Alexander & Krauss\\
|
427
|
166 |
Tobias & Nipkow\\
|
293
|
167 |
Christian & Sternagel\\
|
2
|
168 |
\end{tabular}}
|
71
|
169 |
|
0
|
170 |
\maketitle
|
255
ef1da1abee46
added infrastructure for index; antiquotations have now the options [index] and [indexc]
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
171 |
|
ef1da1abee46
added infrastructure for index; antiquotations have now the options [index] and [indexc]
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
172 |
% table of contents
|
257
|
173 |
\frontmatter
|
210
|
174 |
\setcounter{tocdepth}{1}
|
0
|
175 |
\tableofcontents
|
|
176 |
|
|
177 |
% generated text of all theories
|
257
|
178 |
\mainmatter
|
0
|
179 |
\input{session}
|
|
180 |
|
255
ef1da1abee46
added infrastructure for index; antiquotations have now the options [index] and [indexc]
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
181 |
% bibliography
|
257
|
182 |
\backmatter
|
2
|
183 |
\bibliographystyle{abbrv}
|
17
|
184 |
\bibliography{root}
|
0
|
185 |
|
373
|
186 |
% indices
|
|
187 |
\setindexname{Structure Index}
|
|
188 |
\printindex[str]
|
|
189 |
\setindexname{Index}
|
255
ef1da1abee46
added infrastructure for index; antiquotations have now the options [index] and [indexc]
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
190 |
\printindex
|
ef1da1abee46
added infrastructure for index; antiquotations have now the options [index] and [indexc]
Christian Urban <urbanc@in.tum.de>
diff
changeset
|
191 |
|
0
|
192 |
\end{document}
|
|
193 |
|
|
194 |
%%% Local Variables:
|
|
195 |
%%% mode: latex
|
|
196 |
%%% TeX-master: t
|
|
197 |
%%% End:
|