doc-src/isar.sty
author wenzelm
Fri, 02 May 2008 16:38:01 +0200
changeset 26769 5b8382d495be
parent 26755 84408d6ff180
child 26783 1651ff6a34b5
permissions -rw-r--r--
added begin and imports;


%% $Id$
%%
%% Isar language elements
%%

\usepackage{ifthen}

\newcommand{\indexdef}[3]%
{\ifthenelse{\equal{}{#1}}{\index{#3 (#2)|bold}}{\index{#3 (#1\ #2)|bold}}}
\newcommand{\indexref}[3]{\ifthenelse{\equal{}{#1}}{\index{#3 (#2)}}{\index{#3 (#1\ #2)}}}

\newcommand{\indexoutertoken}[1]{\indexdef{}{syntax}{#1}}
\newcommand{\indexouternonterm}[1]{\indexdef{}{syntax}{#1}}
\newcommand{\indexisarcmd}[1]{\indexdef{}{command}{#1}}
\newcommand{\indexisarelem}[1]{\indexdef{}{element}{#1}}
\newcommand{\indexisarmeth}[1]{\indexdef{}{method}{#1}}
\newcommand{\indexisaratt}[1]{\indexdef{}{attribute}{#1}}
\newcommand{\indexisarthm}[1]{\indexdef{}{fact}{#1}}
\newcommand{\indexisarvar}[1]{\indexdef{}{term}{#1}}
\newcommand{\indexisarcase}[1]{\indexdef{}{case}{#1}}
\newcommand{\indexisarant}[1]{\indexdef{}{antiquotation}{#1}}
\newcommand{\indexisarcmdof}[2]{\indexdef{#1}{command}{#2}}
\newcommand{\indexisarmethof}[2]{\indexdef{#1}{method}{#2}}
\newcommand{\indexisarattof}[2]{\indexdef{#1}{attribute}{#2}}

\newcommand{\isasymAND}{\isakeyword{and}}
\newcommand{\isasymIS}{\isakeyword{is}}
\newcommand{\isasymWHERE}{\isakeyword{where}}
\newcommand{\isasymBEGIN}{\isakeyword{begin}}
\newcommand{\isasymIMPORTS}{\isakeyword{imports}}

\newcommand{\isarkeyword}[1]{{\mathord{\mathbf{#1}}}}
\newcommand{\isarcmd}[1]{\isarkeyword{#1}}
\newcommand{\isartrans}[2]{#1 \mathbin{\,\to\,} #2}
\newcommand{\isarkeep}[1]{#1 \mathbin{\,\to\,} #1}
\newcommand{\isarantiq}{antiquotation}
\newcommand{\isarmeth}{method}
\newcommand{\isaratt}{attribute}

\newcommand{\I@optname}[1]{\ifthenelse{\equal{}{#1}}{}{~#1\colon}}
\newcommand{\I@optmeth}[1]{\ifthenelse{\equal{}{#1}}{}{~#1}}

\newcommand{\AND}{\isarkeyword{and}}
\newcommand{\IN}{\isarkeyword{in}}
\newcommand{\COROLLARYNAME}{\isarkeyword{corollary}}
\newcommand{\LEMMANAME}{\isarkeyword{lemma}}
\newcommand{\THEOREMNAME}{\isarkeyword{theorem}}
\newcommand{\NOTENAME}{\isarkeyword{note}}
\newcommand{\FROMNAME}{\isarkeyword{from}}
\newcommand{\WITHNAME}{\isarkeyword{with}}
\newcommand{\USINGNAME}{\isarkeyword{using}}
\newcommand{\UNFOLDINGNAME}{\isarkeyword{unfolding}}
\newcommand{\FIXESNAME}{\isarkeyword{fixes}}
\newcommand{\CONSTRAINSNAME}{\isarkeyword{constrains}}
\newcommand{\ASSUMESNAME}{\isarkeyword{assumes}}
\newcommand{\DEFINESNAME}{\isarkeyword{defines}}
\newcommand{\NOTESNAME}{\isarkeyword{notes}}
\newcommand{\INCLUDESNAME}{\isarkeyword{includes}}
\newcommand{\FIXNAME}{\isarkeyword{fix}}
\newcommand{\ASSUMENAME}{\isarkeyword{assume}}
\newcommand{\PRESUMENAME}{\isarkeyword{presume}}
\newcommand{\CASENAME}{\isarkeyword{case}}
\newcommand{\HAVENAME}{\isarkeyword{have}}
\newcommand{\SHOWNAME}{\isarkeyword{show}}
\newcommand{\HENCENAME}{\isarkeyword{hence}}
\newcommand{\THUSNAME}{\isarkeyword{thus}}
\newcommand{\PROOFNAME}{\isarkeyword{proof}}
\newcommand{\QEDNAME}{\isarkeyword{qed}}
\newcommand{\BYNAME}{\isarkeyword{by}}
\newcommand{\APPLYNAME}{\isarkeyword{apply}}
\newcommand{\ISNAME}{\isarkeyword{is}}
\newcommand{\CONCLNAME}{\isarkeyword{concl}}
\newcommand{\LETNAME}{\isarkeyword{let}}
\newcommand{\DEFNAME}{\isarkeyword{def}}
\newcommand{\OBTAINNAME}{\isarkeyword{obtain}}
\newcommand{\CMTNAME}{\textbf{---}}

\newcommand{\THEORY}{\isarkeyword{theory}}
\newcommand{\CONTEXT}{\isarkeyword{context}}
\newcommand{\END}{\isarkeyword{end}}

\newcommand{\TYPES}{\isarkeyword{types}}
\newcommand{\CONSTS}{\isarkeyword{consts}}
\newcommand{\CONSTDEFS}{\isarkeyword{constdefs}}
\newcommand{\DEFS}{\isarkeyword{defs}}
\newcommand{\AXCLASS}{\isarkeyword{axclass}}
\newcommand{\INSTANCE}{\isarkeyword{instance}}
\newcommand{\INSTANTIATION}{\isarkeyword{instantiation}}
\newcommand{\OVERLOADING}{\isarkeyword{overloading}}
\newcommand{\DECLARE}{\isarkeyword{declare}}
\newcommand{\LEMMAS}{\isarkeyword{lemmas}}
\newcommand{\THEOREMS}{\isarkeyword{theorems}}
\newcommand{\LOCALE}{\isarkeyword{locale}}
\newcommand{\CLASS}{\isarkeyword{class}}
\newcommand{\SUBCLASS}{\isarkeyword{subclass}}
\newcommand{\TEXT}{\isarkeyword{text}}
\newcommand{\TXT}{\isarkeyword{txt}}
\newcommand{\NOTE}[2]{\NOTENAME~\ifthenelse{\equal{}{#1}}{}{#1=}#2}
\newcommand{\FROM}[1]{\FROMNAME~#1}
\newcommand{\WITH}[1]{\WITHNAME~#1}
\newcommand{\USING}[1]{\USINGNAME~#1}
\newcommand{\UNFOLDING}[1]{\UNFOLDINGNAME~#1}
\newcommand{\FIXES}[1]{\FIXESNAME~#1}
\newcommand{\CONSTRAINS}[1]{\CONSTRAINSNAME~#1}
\newcommand{\ASSUMES}[2]{\ASSUMESNAME\I@optname{#1}~#2}
\newcommand{\DEFINES}[2]{\DEFINESNAME\I@optname{#1}~#2}
\newcommand{\NOTES}[2]{\NOTESNAME~\ifthenelse{\equal{}{#1}}{}{#1=}#2}
\newcommand{\INCLUDES}[1]{\INCLUDESNAME~#1}
\newcommand{\SHOWS}[2]{\isarkeyword{shows}\I@optname{#1}~#2}
\newcommand{\FIX}[1]{\FIXNAME~#1}
\newcommand{\ASSUME}[2]{\ASSUMENAME\I@optname{#1}~#2}
\newcommand{\PRESUME}[2]{\PRESUMENAME\I@optname{#1}~#2}
\newcommand{\CASE}[1]{\CASENAME~#1}
\newcommand{\THEN}{\isarkeyword{then}}
\newcommand{\HAVE}[2]{\isarkeyword{have}\I@optname{#1}~#2}
\newcommand{\SHOW}[2]{\isarkeyword{show}\I@optname{#1}~#2}
\newcommand{\HENCE}[2]{\isarkeyword{hence}\I@optname{#1}~#2}
\newcommand{\THUS}[2]{\isarkeyword{thus}\I@optname{#1}~#2}
\newcommand{\COROLLARY}[2]{\COROLLARYNAME\I@optname{#1}~#2}
\newcommand{\LEMMA}[2]{\LEMMANAME\I@optname{#1}~#2}
\newcommand{\THEOREM}[2]{\THEOREMNAME\I@optname{#1}~#2}
\newcommand{\PROOF}[1]{\PROOFNAME\I@optmeth{#1}}
\newcommand{\QED}[1]{\QEDNAME\I@optmeth{#1}}
\newcommand{\BY}[1]{\BYNAME\I@optmeth{#1}}
\newcommand{\BYY}[2]{\BYNAME\I@optmeth{#1}\I@optmeth{#2}}
\newcommand{\APPLY}[1]{\APPLYNAME\I@optmeth{#1}}
\newcommand{\DONE}{\isarkeyword{done}}
\newcommand{\DOT}{\textbf{.}}
\newcommand{\DDOT}{\textbf{.\,.}}
\newcommand{\DDDOT}{\dots}
\newcommand{\IS}[1]{(\ISNAME~#1)}
\newcommand{\ISS}[2]{(\ISNAME~#1~\ISNAME~#2)}
\newcommand{\LET}[1]{\LETNAME~#1}
\newcommand{\DEF}[2]{\DEFNAME\I@optname{#1}~#2}
\newcommand{\ATT}[1]{\ap [#1]}
\newcommand{\CMT}[1]{\CMTNAME~\Text{#1}}
\newcommand{\ALSO}{\isarkeyword{also}}
\newcommand{\FINALLY}{\isarkeyword{finally}}
\newcommand{\MOREOVER}{\isarkeyword{moreover}}
\newcommand{\ULTIMATELY}{\isarkeyword{ultimately}}
\newcommand{\OBTAIN}[3]{\OBTAINNAME~#1~\isarkeyword{where}\I@optname{#2}~#3}
\newcommand{\BG}{\isarkeyword{\textbf{\{}}}
\newcommand{\EN}{\isarkeyword{\textbf{\}}}}
\newcommand{\NEXT}{\isarkeyword{next}}
\newcommand{\SORRY}{\isarkeyword{sorry}}
\newcommand{\OOPS}{\isarkeyword{oops}}