%% $Id$
%%
%% Isar language elements
%%
\usepackage{ifthen}
\newcommand{\isarkeyword}[1]{{\mathord{\mathbf{#1}}}}
\newcommand{\indexoutertoken}[1]{\index{#1 (syntax)|bold}\index{Syntax!#1|bold}}
\newcommand{\indexouternonterm}[1]{\index{#1 (syntax)|bold}\index{Syntax!#1|bold}}
\newcommand{\indexisarcmd}[1]{\index{#1 (command)|bold}\index{Commands!#1|bold}}
\newcommand{\indexisarmeth}[1]{\index{#1 (method)|bold}\index{Methods!#1|bold}}
\newcommand{\indexisaratt}[1]{\index{#1 (attribute)|bold}\index{Attributes!#1|bold}}
\newcommand{\indexisarthm}[1]{\index{#1 (theorem)|bold}\index{Theorems!#1|bold}}
\newcommand{\indexisarvar}[1]{\index{#1 (variable)|bold}\index{Variables!#1|bold}}
\newcommand{\indexisarcase}[1]{\index{#1 (case)|bold}\index{Cases!#1|bold}}
\newcommand{\indexisarant}[1]{\index{#1 (antiquotation)|bold}\index{Antiquotations!#1|bold}}
\newcommand{\indexisarcmdof}[2]{\index{#2 (#1 command)|bold}\index{Commands!#2 (#1)|bold}}
\newcommand{\indexisarmethof}[2]{\index{#2 (#1 method)|bold}\index{Methods!#2 (#1)|bold}}
\newcommand{\indexisarattof}[2]{\index{#2 (#1 attribute)|bold}\index{Attributes!#2 (#1)|bold}}
\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{\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{\DECLARE}{\isarkeyword{declare}}
\newcommand{\LEMMAS}{\isarkeyword{lemmas}}
\newcommand{\THEOREMS}{\isarkeyword{theorems}}
\newcommand{\LOCALE}{\isarkeyword{locale}}
\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{\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}}