doc-src/isar.sty
author wenzelm
Fri May 02 16:38:01 2008 +0200 (2008-05-02)
changeset 26769 5b8382d495be
parent 26755 84408d6ff180
child 26783 1651ff6a34b5
permissions -rw-r--r--
added begin and imports;
     1 
     2 %% $Id$
     3 %%
     4 %% Isar language elements
     5 %%
     6 
     7 \usepackage{ifthen}
     8 
     9 \newcommand{\indexdef}[3]%
    10 {\ifthenelse{\equal{}{#1}}{\index{#3 (#2)|bold}}{\index{#3 (#1\ #2)|bold}}}
    11 \newcommand{\indexref}[3]{\ifthenelse{\equal{}{#1}}{\index{#3 (#2)}}{\index{#3 (#1\ #2)}}}
    12 
    13 \newcommand{\indexoutertoken}[1]{\indexdef{}{syntax}{#1}}
    14 \newcommand{\indexouternonterm}[1]{\indexdef{}{syntax}{#1}}
    15 \newcommand{\indexisarcmd}[1]{\indexdef{}{command}{#1}}
    16 \newcommand{\indexisarelem}[1]{\indexdef{}{element}{#1}}
    17 \newcommand{\indexisarmeth}[1]{\indexdef{}{method}{#1}}
    18 \newcommand{\indexisaratt}[1]{\indexdef{}{attribute}{#1}}
    19 \newcommand{\indexisarthm}[1]{\indexdef{}{fact}{#1}}
    20 \newcommand{\indexisarvar}[1]{\indexdef{}{term}{#1}}
    21 \newcommand{\indexisarcase}[1]{\indexdef{}{case}{#1}}
    22 \newcommand{\indexisarant}[1]{\indexdef{}{antiquotation}{#1}}
    23 \newcommand{\indexisarcmdof}[2]{\indexdef{#1}{command}{#2}}
    24 \newcommand{\indexisarmethof}[2]{\indexdef{#1}{method}{#2}}
    25 \newcommand{\indexisarattof}[2]{\indexdef{#1}{attribute}{#2}}
    26 
    27 \newcommand{\isasymAND}{\isakeyword{and}}
    28 \newcommand{\isasymIS}{\isakeyword{is}}
    29 \newcommand{\isasymWHERE}{\isakeyword{where}}
    30 \newcommand{\isasymBEGIN}{\isakeyword{begin}}
    31 \newcommand{\isasymIMPORTS}{\isakeyword{imports}}
    32 
    33 \newcommand{\isarkeyword}[1]{{\mathord{\mathbf{#1}}}}
    34 \newcommand{\isarcmd}[1]{\isarkeyword{#1}}
    35 \newcommand{\isartrans}[2]{#1 \mathbin{\,\to\,} #2}
    36 \newcommand{\isarkeep}[1]{#1 \mathbin{\,\to\,} #1}
    37 \newcommand{\isarantiq}{antiquotation}
    38 \newcommand{\isarmeth}{method}
    39 \newcommand{\isaratt}{attribute}
    40 
    41 \newcommand{\I@optname}[1]{\ifthenelse{\equal{}{#1}}{}{~#1\colon}}
    42 \newcommand{\I@optmeth}[1]{\ifthenelse{\equal{}{#1}}{}{~#1}}
    43 
    44 \newcommand{\AND}{\isarkeyword{and}}
    45 \newcommand{\IN}{\isarkeyword{in}}
    46 \newcommand{\COROLLARYNAME}{\isarkeyword{corollary}}
    47 \newcommand{\LEMMANAME}{\isarkeyword{lemma}}
    48 \newcommand{\THEOREMNAME}{\isarkeyword{theorem}}
    49 \newcommand{\NOTENAME}{\isarkeyword{note}}
    50 \newcommand{\FROMNAME}{\isarkeyword{from}}
    51 \newcommand{\WITHNAME}{\isarkeyword{with}}
    52 \newcommand{\USINGNAME}{\isarkeyword{using}}
    53 \newcommand{\UNFOLDINGNAME}{\isarkeyword{unfolding}}
    54 \newcommand{\FIXESNAME}{\isarkeyword{fixes}}
    55 \newcommand{\CONSTRAINSNAME}{\isarkeyword{constrains}}
    56 \newcommand{\ASSUMESNAME}{\isarkeyword{assumes}}
    57 \newcommand{\DEFINESNAME}{\isarkeyword{defines}}
    58 \newcommand{\NOTESNAME}{\isarkeyword{notes}}
    59 \newcommand{\INCLUDESNAME}{\isarkeyword{includes}}
    60 \newcommand{\FIXNAME}{\isarkeyword{fix}}
    61 \newcommand{\ASSUMENAME}{\isarkeyword{assume}}
    62 \newcommand{\PRESUMENAME}{\isarkeyword{presume}}
    63 \newcommand{\CASENAME}{\isarkeyword{case}}
    64 \newcommand{\HAVENAME}{\isarkeyword{have}}
    65 \newcommand{\SHOWNAME}{\isarkeyword{show}}
    66 \newcommand{\HENCENAME}{\isarkeyword{hence}}
    67 \newcommand{\THUSNAME}{\isarkeyword{thus}}
    68 \newcommand{\PROOFNAME}{\isarkeyword{proof}}
    69 \newcommand{\QEDNAME}{\isarkeyword{qed}}
    70 \newcommand{\BYNAME}{\isarkeyword{by}}
    71 \newcommand{\APPLYNAME}{\isarkeyword{apply}}
    72 \newcommand{\ISNAME}{\isarkeyword{is}}
    73 \newcommand{\CONCLNAME}{\isarkeyword{concl}}
    74 \newcommand{\LETNAME}{\isarkeyword{let}}
    75 \newcommand{\DEFNAME}{\isarkeyword{def}}
    76 \newcommand{\OBTAINNAME}{\isarkeyword{obtain}}
    77 \newcommand{\CMTNAME}{\textbf{---}}
    78 
    79 \newcommand{\THEORY}{\isarkeyword{theory}}
    80 \newcommand{\CONTEXT}{\isarkeyword{context}}
    81 \newcommand{\END}{\isarkeyword{end}}
    82 
    83 \newcommand{\TYPES}{\isarkeyword{types}}
    84 \newcommand{\CONSTS}{\isarkeyword{consts}}
    85 \newcommand{\CONSTDEFS}{\isarkeyword{constdefs}}
    86 \newcommand{\DEFS}{\isarkeyword{defs}}
    87 \newcommand{\AXCLASS}{\isarkeyword{axclass}}
    88 \newcommand{\INSTANCE}{\isarkeyword{instance}}
    89 \newcommand{\INSTANTIATION}{\isarkeyword{instantiation}}
    90 \newcommand{\OVERLOADING}{\isarkeyword{overloading}}
    91 \newcommand{\DECLARE}{\isarkeyword{declare}}
    92 \newcommand{\LEMMAS}{\isarkeyword{lemmas}}
    93 \newcommand{\THEOREMS}{\isarkeyword{theorems}}
    94 \newcommand{\LOCALE}{\isarkeyword{locale}}
    95 \newcommand{\CLASS}{\isarkeyword{class}}
    96 \newcommand{\SUBCLASS}{\isarkeyword{subclass}}
    97 \newcommand{\TEXT}{\isarkeyword{text}}
    98 \newcommand{\TXT}{\isarkeyword{txt}}
    99 \newcommand{\NOTE}[2]{\NOTENAME~\ifthenelse{\equal{}{#1}}{}{#1=}#2}
   100 \newcommand{\FROM}[1]{\FROMNAME~#1}
   101 \newcommand{\WITH}[1]{\WITHNAME~#1}
   102 \newcommand{\USING}[1]{\USINGNAME~#1}
   103 \newcommand{\UNFOLDING}[1]{\UNFOLDINGNAME~#1}
   104 \newcommand{\FIXES}[1]{\FIXESNAME~#1}
   105 \newcommand{\CONSTRAINS}[1]{\CONSTRAINSNAME~#1}
   106 \newcommand{\ASSUMES}[2]{\ASSUMESNAME\I@optname{#1}~#2}
   107 \newcommand{\DEFINES}[2]{\DEFINESNAME\I@optname{#1}~#2}
   108 \newcommand{\NOTES}[2]{\NOTESNAME~\ifthenelse{\equal{}{#1}}{}{#1=}#2}
   109 \newcommand{\INCLUDES}[1]{\INCLUDESNAME~#1}
   110 \newcommand{\SHOWS}[2]{\isarkeyword{shows}\I@optname{#1}~#2}
   111 \newcommand{\FIX}[1]{\FIXNAME~#1}
   112 \newcommand{\ASSUME}[2]{\ASSUMENAME\I@optname{#1}~#2}
   113 \newcommand{\PRESUME}[2]{\PRESUMENAME\I@optname{#1}~#2}
   114 \newcommand{\CASE}[1]{\CASENAME~#1}
   115 \newcommand{\THEN}{\isarkeyword{then}}
   116 \newcommand{\HAVE}[2]{\isarkeyword{have}\I@optname{#1}~#2}
   117 \newcommand{\SHOW}[2]{\isarkeyword{show}\I@optname{#1}~#2}
   118 \newcommand{\HENCE}[2]{\isarkeyword{hence}\I@optname{#1}~#2}
   119 \newcommand{\THUS}[2]{\isarkeyword{thus}\I@optname{#1}~#2}
   120 \newcommand{\COROLLARY}[2]{\COROLLARYNAME\I@optname{#1}~#2}
   121 \newcommand{\LEMMA}[2]{\LEMMANAME\I@optname{#1}~#2}
   122 \newcommand{\THEOREM}[2]{\THEOREMNAME\I@optname{#1}~#2}
   123 \newcommand{\PROOF}[1]{\PROOFNAME\I@optmeth{#1}}
   124 \newcommand{\QED}[1]{\QEDNAME\I@optmeth{#1}}
   125 \newcommand{\BY}[1]{\BYNAME\I@optmeth{#1}}
   126 \newcommand{\BYY}[2]{\BYNAME\I@optmeth{#1}\I@optmeth{#2}}
   127 \newcommand{\APPLY}[1]{\APPLYNAME\I@optmeth{#1}}
   128 \newcommand{\DONE}{\isarkeyword{done}}
   129 \newcommand{\DOT}{\textbf{.}}
   130 \newcommand{\DDOT}{\textbf{.\,.}}
   131 \newcommand{\DDDOT}{\dots}
   132 \newcommand{\IS}[1]{(\ISNAME~#1)}
   133 \newcommand{\ISS}[2]{(\ISNAME~#1~\ISNAME~#2)}
   134 \newcommand{\LET}[1]{\LETNAME~#1}
   135 \newcommand{\DEF}[2]{\DEFNAME\I@optname{#1}~#2}
   136 \newcommand{\ATT}[1]{\ap [#1]}
   137 \newcommand{\CMT}[1]{\CMTNAME~\Text{#1}}
   138 \newcommand{\ALSO}{\isarkeyword{also}}
   139 \newcommand{\FINALLY}{\isarkeyword{finally}}
   140 \newcommand{\MOREOVER}{\isarkeyword{moreover}}
   141 \newcommand{\ULTIMATELY}{\isarkeyword{ultimately}}
   142 \newcommand{\OBTAIN}[3]{\OBTAINNAME~#1~\isarkeyword{where}\I@optname{#2}~#3}
   143 \newcommand{\BG}{\isarkeyword{\textbf{\{}}}
   144 \newcommand{\EN}{\isarkeyword{\textbf{\}}}}
   145 \newcommand{\NEXT}{\isarkeyword{next}}
   146 \newcommand{\SORRY}{\isarkeyword{sorry}}
   147 \newcommand{\OOPS}{\isarkeyword{oops}}