paulson@11403: % tutorial.sty : Isabelle Tutorial Page Layout paulson@11403: % paulson@11403: \typeout{Document Style tutorial. Released 9 July 2001} paulson@11403: paulson@11403: \hyphenation{Isa-belle man-u-script man-u-scripts ap-pen-dix mut-u-al-ly} paulson@11403: \hyphenation{data-type data-types co-data-type co-data-types } paulson@11403: paulson@11403: %usage: \iflabelundefined{LABEL}{if not defined}{if defined} paulson@11403: \newcommand{\iflabelundefined}[1]{\@ifundefined{r@#1}} paulson@11403: paulson@11403: paulson@11403: %%%INDEXING use isa-index to process the index paulson@11403: paulson@11403: \newcommand\seealso[2]{\emph{see also} #1} paulson@11403: \usepackage{makeidx} paulson@11403: paulson@11403: %index, putting page numbers of definitions in boldface paulson@11403: \def\bold#1{\textbf{#1}} paulson@11403: \newcommand\fnote[1]{#1n} paulson@11403: \newcommand\indexbold[1]{\index{#1|bold}} paulson@11403: paulson@11403: % The alternative to \protect\isa in the indexing macros is paulson@11403: % \noexpand\noexpand \noexpand\isa paulson@11403: % need TWO levels of \noexpand to delay the expansion of \isa: paulson@11403: % the \noexpand\noexpand will leave one \noexpand, to be given to the paulson@11403: % (still unexpanded) \isa token. See TeX by Topic, page 122. paulson@11403: paulson@11403: %%%% for indexing constants, symbols, theorems, ... paulson@11403: \newcommand\cdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (constant)}} paulson@11403: \newcommand\sdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (symbol)}} nipkow@15364: \newcommand\sdxpos[2]{\isa{#1}\index{#2@\protect\isa{#1} (symbol)}} paulson@11403: paulson@11403: \newcommand\tdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (theorem)}} paulson@11422: \newcommand\tdxbold[1]{\isa{#1}\index{#1@\protect\isa{#1} (theorem)|bold}} paulson@11403: paulson@11403: \newcommand\cldx[1]{\isa{#1}\index{#1@\protect\isa{#1} (class)}} paulson@11457: \newcommand\tydx[1]{\isa{#1}\index{#1@\protect\isa{#1} (type)}} paulson@14400: \newcommand\tcdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (type class)}} paulson@11403: \newcommand\thydx[1]{\isa{#1}\index{#1@\protect\isa{#1} (theory)}} paulson@11403: paulson@11403: \newcommand\attrdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (attribute)}} nipkow@13111: \newcommand\cmmdx[1]{\index{#1@\protect\isacommand{#1} (command)}} nipkow@13111: \newcommand\commdx[1]{\isacommand{#1}\index{#1@\protect\isacommand{#1} (command)}} paulson@11403: \newcommand\methdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (method)}} paulson@11403: \newcommand\tooldx[1]{\isa{#1}\index{#1@\protect\isa{#1} (tool)}} paulson@11403: \newcommand\settdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (setting)}} nipkow@16523: \newcommand\pgdx[1]{\pgmenu{#1}\index{#1@\protect\pgmenu{#1} (Proof General)}} paulson@11403: paulson@11403: %set argument in \bf font and index in ROMAN font (for definitions in text!) paulson@11403: \newcommand\bfindex[1]{{\bf#1}\index{#1|bold}\@} paulson@11403: paulson@11403: \newcommand\rmindex[1]{{#1}\index{#1}\@} paulson@11403: \newcommand\ttindex[1]{\texttt{#1}\index{#1@\texttt{#1}}\@} paulson@11403: \newcommand\ttindexbold[1]{\texttt{#1}\index{#1@\texttt{#1}|bold}\@} paulson@11403: nipkow@15364: \newcommand{\isadxpos}[2]{\isa{#1}\index{#2@\protect\isa{#1}}\@} nipkow@15364: \newcommand{\isadxboldpos}[2]{\isa{#1}\index{#2@\protect\isa{#1}|bold}\@} nipkow@15364: paulson@11456: %Commented-out the original versions to see what the index looks like without them. paulson@11456: % In any event, they need to use \isa or \protect\isa rather than \texttt. paulson@11456: %%\newcommand{\indexboldpos}[2]{#1\index{#2@#1|bold}\@} paulson@11456: %%\newcommand{\ttindexboldpos}[2]{\texttt{#1}\index{#2@\texttt{#1}|bold}\@} paulson@11456: \newcommand{\indexboldpos}[2]{#1\@} paulson@11456: \newcommand{\ttindexboldpos}[2]{\isa{#1}\@} paulson@11403: paulson@11403: %\newtheorem{theorem}{Theorem}[section] paulson@11403: \newtheorem{Exercise}{Exercise}[section] paulson@11403: \newenvironment{exercise}{\begin{Exercise}\rm}{\end{Exercise}} paulson@11403: \newcommand{\ttlbr}{\texttt{[|}} paulson@11403: \newcommand{\ttrbr}{\texttt{|]}} paulson@11403: \newcommand{\ttor}{\texttt{|}} paulson@11403: \newcommand{\ttall}{\texttt{!}} paulson@11403: \newcommand{\ttuniquex}{\texttt{?!}} paulson@11403: \newcommand{\ttEXU}{\texttt{EX!}} paulson@11403: \newcommand{\ttAnd}{\texttt{!!}} paulson@11403: wenzelm@12638: \newcommand{\isasymignore}{} paulson@11403: \newcommand{\isasymimp}{\isasymlongrightarrow} paulson@11403: \newcommand{\isasymImp}{\isasymLongrightarrow} paulson@11403: \newcommand{\isasymFun}{\isasymRightarrow} paulson@11403: \newcommand{\isasymuniqex}{\isamath{\exists!\,}} paulson@11403: \renewcommand{\S}{Sect.\ts} paulson@11403: paulson@11403: \renewenvironment{isamarkuptxt}{\begin{isamarkuptext}}{\end{isamarkuptext}} paulson@11403: paulson@11403: \newif\ifremarks paulson@11403: \newcommand{\REMARK}[1]{\ifremarks\marginpar{\raggedright\footnotesize#1}\fi} paulson@11422: paulson@11403: %names of Isabelle rules paulson@11422: \newcommand{\rulename}[1]{\hfill(#1)} paulson@11422: \newcommand{\rulenamedx}[1]{\hfill(#1\index{#1@\protect\isa{#1} (theorem)|bold})} paulson@11403: paulson@11403: %%%% meta-logical connectives paulson@11403: paulson@11403: \let\Forall=\bigwedge paulson@11403: \let\Imp=\Longrightarrow paulson@11403: \let\To=\Rightarrow paulson@11403: \newcommand{\Var}[1]{{?\!#1}} paulson@11403: paulson@11403: %%% underscores as ordinary characters, not for subscripting paulson@11403: %% use @ or \sb for subscripting; use \at for @ paulson@11403: %% only works in \tt font paulson@11403: %% must not make _ an active char; would make \ttindex fail! paulson@11403: \gdef\underscoreoff{\catcode`\@=8\catcode`\_=\other} paulson@11403: \gdef\underscoreon{\catcode`\_=8\makeatother} paulson@11403: \chardef\other=12 paulson@11403: \chardef\at=`\@ paulson@11403: paulson@11403: % alternative underscore paulson@11403: \def\_{\leavevmode\kern.06em\vbox{\hrule height.2ex width.3em}\hskip0.1em} paulson@11403: paulson@11403: paulson@16072: %%%% ``WARNING'' environment: 2 ! characters separated by negative thin space paulson@16072: \def\warnbang{\vtop to 0pt{\vss\hbox{\Huge\bf!\!!}\vss}} paulson@11403: \newenvironment{warn}{\medskip\medbreak\begingroup \clubpenalty=10000 paulson@11403: \small %%WAS\baselineskip=0.9\baselineskip paulson@11403: \noindent \hangindent\parindent \hangafter=-2 paulson@16072: \hbox to0pt{\hskip-\hangindent\warnbang\hfill}\ignorespaces}% paulson@11403: {\par\endgroup\medbreak} paulson@11403: paulson@16087: %%%% ``PROOF GENERAL'' environment paulson@16087: \def\pghead{\lower3pt\vbox to 0pt{\vss\hbox{\includegraphics[width=12pt]{pghead}}\vss}} paulson@16072: \newenvironment{pgnote}{\medskip\medbreak\begingroup \clubpenalty=10000 paulson@16072: \small \noindent \hangindent\parindent \hangafter=-2 paulson@16072: \hbox to0pt{\hskip-\hangindent \pghead\hfill}\ignorespaces}% paulson@16072: {\par\endgroup\medbreak} nipkow@16523: \newcommand{\pgmenu}[1]{\textsf{#1}} paulson@16072: paulson@11403: paulson@11403: %%%% Standard logical symbols paulson@11403: \let\turn=\vdash paulson@11403: \let\conj=\wedge paulson@11403: \let\disj=\vee paulson@11403: \let\imp=\rightarrow paulson@11403: \let\bimp=\leftrightarrow paulson@11403: \newcommand\all[1]{\forall#1.} %quantification paulson@11403: \newcommand\ex[1]{\exists#1.} paulson@11403: \newcommand{\pair}[1]{\langle#1\rangle} paulson@11403: paulson@11403: \newcommand{\lparr}{\mathopen{(\!|}} paulson@11403: \newcommand{\rparr}{\mathclose{|\!)}} paulson@11403: \newcommand{\fs}{\mathpunct{,\,}} paulson@11403: \newcommand{\ty}{\mathrel{::}} paulson@11403: \newcommand{\asn}{\mathrel{:=}} paulson@11403: \newcommand{\more}{\ldots} paulson@11403: \newcommand{\record}[1]{\lparr #1 \rparr} paulson@11403: \newcommand{\dtt}{\mathord.} paulson@11403: paulson@11403: \newcommand\lbrakk{\mathopen{[\![}} paulson@11403: \newcommand\rbrakk{\mathclose{]\!]}} paulson@11403: \newcommand\List[1]{\lbrakk#1\rbrakk} %was \obj paulson@11403: \newcommand\vpile[1]{\begin{array}{c}#1\end{array}} paulson@11403: \newenvironment{matharray}[1]{\[\begin{array}{#1}}{\end{array}\]} paulson@11403: \newcommand{\Text}[1]{\mbox{#1}} paulson@11403: paulson@11403: \DeclareMathSymbol{\dshsym}{\mathalpha}{letters}{"2D} paulson@11403: \newcommand{\dsh}{\mathit{\dshsym}} paulson@11403: paulson@11403: \let\int=\cap paulson@11403: \let\un=\cup paulson@11403: \let\inter=\bigcap paulson@11403: \let\union=\bigcup paulson@11403: paulson@11403: \def\ML{{\sc ml}} paulson@11403: \def\AST{{\sc ast}} paulson@11403: paulson@11403: %macros to change the treatment of symbols paulson@11403: \def\relsemicolon{\mathcode`\;="303B} %treat ; like a relation paulson@11403: \def\binperiod{\mathcode`\.="213A} %treat . like a binary operator paulson@11403: \def\binvert{\mathcode`\|="226A} %treat | like a binary operator paulson@11403: paulson@11403: %redefinition of \sloppy and \fussy to use \emergencystretch paulson@11403: \def\sloppy{\tolerance2000 \hfuzz.5pt \vfuzz.5pt \emergencystretch=15pt} paulson@11403: \def\fussy{\tolerance200 \hfuzz.1pt \vfuzz.1pt \emergencystretch=0pt} paulson@11403: paulson@11403: %non-bf version of description paulson@11403: \def\descrlabel#1{\hspace\labelsep #1} paulson@11403: \def\descr{\list{}{\labelwidth\z@ \itemindent-\leftmargin\let\makelabel\descrlabel}} paulson@11403: \let\enddescr\endlist paulson@11403: paulson@11403: % The mathcodes for the letters A, ..., Z, a, ..., z are changed to paulson@11403: % generate text italic rather than math italic by default. This makes paulson@11403: % multi-letter identifiers look better. The mathcode for character c paulson@11403: % is set to |"7000| (variable family) + |"400| (text italic) + |c|. paulson@11403: % paulson@11403: \DeclareSymbolFont{italics}{\encodingdefault}{\rmdefault}{m}{it}% paulson@11403: \def\@setmcodes#1#2#3{{\count0=#1 \count1=#3 paulson@11403: \loop \global\mathcode\count0=\count1 \ifnum \count0<#2 paulson@11403: \advance\count0 by1 \advance\count1 by1 \repeat}} paulson@11403: \@setmcodes{`A}{`Z}{"7\hexnumber@\symitalics41} paulson@11403: \@setmcodes{`a}{`z}{"7\hexnumber@\symitalics61}