modernized rail diagrams using @{rail} antiquotation;
authorwenzelm
Mon, 02 May 2011 01:05:50 +0200
changeset 434676c621a9d612a
parent 43462 f139d0ac2d44
child 43468 20a99a0e65ed
modernized rail diagrams using @{rail} antiquotation;
doc-src/IsarRef/Thy/Document_Preparation.thy
doc-src/IsarRef/Thy/Generic.thy
doc-src/IsarRef/Thy/HOLCF_Specific.thy
doc-src/IsarRef/Thy/HOL_Specific.thy
doc-src/IsarRef/Thy/Inner_Syntax.thy
doc-src/IsarRef/Thy/Misc.thy
doc-src/IsarRef/Thy/Outer_Syntax.thy
doc-src/IsarRef/Thy/Proof.thy
doc-src/IsarRef/Thy/Spec.thy
doc-src/IsarRef/Thy/ZF_Specific.thy
doc-src/IsarRef/Thy/document/Document_Preparation.tex
doc-src/IsarRef/Thy/document/Generic.tex
doc-src/IsarRef/Thy/document/HOLCF_Specific.tex
doc-src/IsarRef/Thy/document/HOL_Specific.tex
doc-src/IsarRef/Thy/document/Inner_Syntax.tex
doc-src/IsarRef/Thy/document/Misc.tex
doc-src/IsarRef/Thy/document/Outer_Syntax.tex
doc-src/IsarRef/Thy/document/Proof.tex
doc-src/IsarRef/Thy/document/Spec.tex
doc-src/IsarRef/Thy/document/ZF_Specific.tex
     1.1 --- a/doc-src/IsarRef/Thy/Document_Preparation.thy	Sun May 01 18:57:45 2011 +0200
     1.2 +++ b/doc-src/IsarRef/Thy/Document_Preparation.thy	Mon May 02 01:05:50 2011 +0200
     1.3 @@ -81,12 +81,13 @@
     1.4    markup commands, but have a different status within Isabelle/Isar
     1.5    syntax.
     1.6  
     1.7 -  \begin{rail}
     1.8 -    ('chapter' | 'section' | 'subsection' | 'subsubsection' | 'text') target? text
     1.9 +  @{rail "
    1.10 +    (@@{command chapter} | @@{command section} | @@{command subsection} |
    1.11 +      @@{command subsubsection} | @@{command text}) @{syntax target}? @{syntax text}
    1.12      ;
    1.13 -    ('header' | 'text_raw' | 'sect' | 'subsect' | 'subsubsect' | 'txt' | 'txt_raw') text
    1.14 -    ;
    1.15 -  \end{rail}
    1.16 +    (@@{command header} | @@{command text_raw} | @@{command sect} | @@{command subsect} |
    1.17 +      @@{command subsubsect} | @@{command txt} | @@{command txt_raw}) @{syntax text}
    1.18 +  "}
    1.19  
    1.20    \begin{description}
    1.21  
    1.22 @@ -178,42 +179,40 @@
    1.23    antiquotations are checked within the current theory or proof
    1.24    context.
    1.25  
    1.26 -  \begin{rail}
    1.27 -    atsign lbrace antiquotation rbrace
    1.28 +  @{rail "
    1.29 +    '@{' antiquotation '}'
    1.30      ;
    1.31 -
    1.32 -    antiquotation:
    1.33 -      'theory' options name |
    1.34 -      'thm' options styles thmrefs |
    1.35 -      'lemma' options prop 'by' method |
    1.36 -      'prop' options styles prop |
    1.37 -      'term' options styles term |
    1.38 -      'term_type' options styles term |
    1.39 -      'typeof' options styles term |
    1.40 -      'const' options term |
    1.41 -      'abbrev' options term |
    1.42 -      'typ' options type |
    1.43 -      'type' options name |
    1.44 -      'class' options name |
    1.45 -      'text' options name |
    1.46 -      'goals' options |
    1.47 -      'subgoals' options |
    1.48 -      'prf' options thmrefs |
    1.49 -      'full_prf' options thmrefs |
    1.50 -      'ML' options name |
    1.51 -      'ML_type' options name |
    1.52 -      'ML_struct' options name |
    1.53 -      'file' options name
    1.54 +    @{syntax_def antiquotation}:
    1.55 +      @@{antiquotation theory} options @{syntax name} |
    1.56 +      @@{antiquotation thm} options styles @{syntax thmrefs} |
    1.57 +      @@{antiquotation lemma} options @{syntax prop} @'by' @{syntax method} |
    1.58 +      @@{antiquotation prop} options styles @{syntax prop} |
    1.59 +      @@{antiquotation term} options styles @{syntax term} |
    1.60 +      @@{antiquotation term_type} options styles @{syntax term} |
    1.61 +      @@{antiquotation typeof} options styles @{syntax term} |
    1.62 +      @@{antiquotation const} options @{syntax term} |
    1.63 +      @@{antiquotation abbrev} options @{syntax term} |
    1.64 +      @@{antiquotation typ} options @{syntax type} |
    1.65 +      @@{antiquotation type} options @{syntax name} |
    1.66 +      @@{antiquotation class} options @{syntax name} |
    1.67 +      @@{antiquotation text} options @{syntax name} |
    1.68 +      @@{antiquotation goals} options |
    1.69 +      @@{antiquotation subgoals} options |
    1.70 +      @@{antiquotation prf} options @{syntax thmrefs} |
    1.71 +      @@{antiquotation full_prf} options @{syntax thmrefs} |
    1.72 +      @@{antiquotation ML} options @{syntax name} |
    1.73 +      @@{antiquotation ML_type} options @{syntax name} |
    1.74 +      @@{antiquotation ML_struct} options @{syntax name} |
    1.75 +      @@{antiquotation \"file\"} options @{syntax name}
    1.76      ;
    1.77      options: '[' (option * ',') ']'
    1.78      ;
    1.79 -    option: name | name '=' name
    1.80 +    option: @{syntax name} | @{syntax name} '=' @{syntax name}
    1.81      ;
    1.82      styles: '(' (style + ',') ')'
    1.83      ;
    1.84 -    style: (name +)
    1.85 -    ;
    1.86 -  \end{rail}
    1.87 +    style: (@{syntax name} +)
    1.88 +  "} %% FIXME check lemma
    1.89  
    1.90    Note that the syntax of antiquotations may \emph{not} include source
    1.91    comments @{verbatim "(*"}~@{text "\<dots>"}~@{verbatim "*)"} nor verbatim
    1.92 @@ -420,12 +419,11 @@
    1.93    presentation tags, to indicate some modification in the way it is
    1.94    printed in the document.
    1.95  
    1.96 -  \indexouternonterm{tags}
    1.97 -  \begin{rail}
    1.98 -    tags: ( tag * )
    1.99 +  @{rail "
   1.100 +    @{syntax_def tags}: ( tag * )
   1.101      ;
   1.102 -    tag: '\%' (ident | string)
   1.103 -  \end{rail}
   1.104 +    tag: '%' (@{syntax ident} | @{syntax string})
   1.105 +  "}
   1.106  
   1.107    Some tags are pre-declared for certain classes of commands, serving
   1.108    as default markup if no tags are given in the text:
   1.109 @@ -475,10 +473,10 @@
   1.110      @{command_def "print_drafts"}@{text "\<^sup>*"} & : & @{text "any \<rightarrow>"} \\
   1.111    \end{matharray}
   1.112  
   1.113 -  \begin{rail}
   1.114 -    ('display_drafts' | 'print_drafts') (name +)
   1.115 -    ;
   1.116 -  \end{rail}
   1.117 +  @{rail "
   1.118 +    (@@{command display_drafts} | @@{command print_drafts}) (@{syntax name} +)
   1.119 +
   1.120 +  "}
   1.121  
   1.122    \begin{description}
   1.123  
     2.1 --- a/doc-src/IsarRef/Thy/Generic.thy	Sun May 01 18:57:45 2011 +0200
     2.2 +++ b/doc-src/IsarRef/Thy/Generic.thy	Mon May 02 01:05:50 2011 +0200
     2.3 @@ -25,9 +25,9 @@
     2.4      @{command_def "print_configs"} & : & @{text "context \<rightarrow>"} \\
     2.5    \end{matharray}
     2.6  
     2.7 -  \begin{rail}
     2.8 -    name ('=' ('true' | 'false' | int | float | name))?
     2.9 -  \end{rail}
    2.10 +  @{rail "
    2.11 +    @{syntax name} ('=' ('true' | 'false' | @{syntax int} | @{syntax float} | @{syntax name}))?
    2.12 +  "}
    2.13  
    2.14    \begin{description}
    2.15    
    2.16 @@ -59,12 +59,12 @@
    2.17      @{method_def fail} & : & @{text method} \\
    2.18    \end{matharray}
    2.19  
    2.20 -  \begin{rail}
    2.21 -    ('fold' | 'unfold' | 'insert') thmrefs
    2.22 +  @{rail "
    2.23 +    (@@{method fold} | @@{method unfold} | @@{method insert}) @{syntax thmrefs}
    2.24      ;
    2.25 -    ('erule' | 'drule' | 'frule') ('('nat')')? thmrefs
    2.26 -    ;
    2.27 -  \end{rail}
    2.28 +    (@@{method erule} | @@{method drule} | @@{method frule})
    2.29 +      ('(' @{syntax nat} ')')? @{syntax thmrefs}
    2.30 +  "}
    2.31  
    2.32    \begin{description}
    2.33    
    2.34 @@ -117,17 +117,17 @@
    2.35      @{attribute_def no_vars}@{text "\<^sup>*"} & : & @{text attribute} \\
    2.36    \end{matharray}
    2.37  
    2.38 -  \begin{rail}
    2.39 -    'tagged' name name
    2.40 +  @{rail "
    2.41 +    @@{attribute tagged} @{syntax name} @{syntax name}
    2.42      ;
    2.43 -    'untagged' name
    2.44 +    @@{attribute untagged} @{syntax name}
    2.45      ;
    2.46 -    ('THEN' | 'COMP') ('[' nat ']')? thmref
    2.47 +    (@@{attribute THEN} | @@{attribute COMP}) ('[' @{syntax nat} ']')? @{syntax thmref}
    2.48      ;
    2.49 -    ('unfolded' | 'folded') thmrefs
    2.50 +    (@@{attribute unfolded} | @@{attribute folded}) @{syntax thmrefs}
    2.51      ;
    2.52 -    'rotated' ( int )?
    2.53 -  \end{rail}
    2.54 +    @@{attribute rotated} @{syntax int}?
    2.55 +  "}
    2.56  
    2.57    \begin{description}
    2.58  
    2.59 @@ -179,12 +179,11 @@
    2.60      @{method_def split} & : & @{text method} \\
    2.61    \end{matharray}
    2.62  
    2.63 -  \begin{rail}
    2.64 -    'subst' ('(' 'asm' ')')? ('(' (nat+) ')')? thmref
    2.65 +  @{rail "
    2.66 +    @@{method subst} ('(' 'asm' ')')? ('(' (@{syntax nat}+) ')')? @{syntax thmref}
    2.67      ;
    2.68 -    'split' ('(' 'asm' ')')? thmrefs
    2.69 -    ;
    2.70 -  \end{rail}
    2.71 +    @@{method split} ('(' 'asm' ')')? @{syntax thmrefs}
    2.72 +  "}
    2.73  
    2.74    These methods provide low-level facilities for equational reasoning
    2.75    that are intended for specialized applications only.  Normally,
    2.76 @@ -282,22 +281,22 @@
    2.77      @{method_def raw_tactic}@{text "\<^sup>*"} & : & @{text method} \\
    2.78    \end{matharray}
    2.79  
    2.80 -  \begin{rail}
    2.81 -    ( 'rule_tac' | 'erule_tac' | 'drule_tac' | 'frule_tac' | 'cut_tac' | 'thin_tac' ) goalspec?
    2.82 -    ( insts thmref | thmrefs )
    2.83 +  @{rail "
    2.84 +    (@@{method rule_tac} | @@{method erule_tac} | @@{method drule_tac} |
    2.85 +      @@{method frule_tac} | @@{method cut_tac} | @@{method thin_tac}) @{syntax goalspec}?
    2.86 +    ( insts @{syntax thmref} | @{syntax thmrefs} )
    2.87      ;
    2.88 -    'subgoal_tac' goalspec? (prop +)
    2.89 +    @@{method subgoal_tac} @{syntax goalspec}? (@{syntax prop} +)
    2.90      ;
    2.91 -    'rename_tac' goalspec? (name +)
    2.92 +    @@{method rename_tac} @{syntax goalspec}? (@{syntax name} +)
    2.93      ;
    2.94 -    'rotate_tac' goalspec? int?
    2.95 +    @@{method rotate_tac} @{syntax goalspec}? @{syntax int}?
    2.96      ;
    2.97 -    ('tactic' | 'raw_tactic') text
    2.98 +    (@@{method tactic} | @@{method raw_tactic}) @{syntax text}
    2.99      ;
   2.100  
   2.101 -    insts: ((name '=' term) + 'and') 'in'
   2.102 -    ;
   2.103 -  \end{rail}
   2.104 +    insts: ((@{syntax name} '=' @{syntax term}) + @'and') @'in'
   2.105 +  "} % FIXME check use of insts
   2.106  
   2.107  \begin{description}
   2.108  
   2.109 @@ -361,31 +360,29 @@
   2.110      @{method_def simp_all} & : & @{text method} \\
   2.111    \end{matharray}
   2.112  
   2.113 -  \indexouternonterm{simpmod}
   2.114 -  \begin{rail}
   2.115 -    ('simp' | 'simp_all') opt? (simpmod *)
   2.116 +  @{rail "
   2.117 +    (@@{method simp} | @@{method simp_all}) opt? (@{syntax simpmod} * )
   2.118      ;
   2.119  
   2.120      opt: '(' ('no_asm' | 'no_asm_simp' | 'no_asm_use' | 'asm_lr' ) ')'
   2.121      ;
   2.122 -    simpmod: ('add' | 'del' | 'only' | 'cong' (() | 'add' | 'del') |
   2.123 -      'split' (() | 'add' | 'del')) ':' thmrefs
   2.124 -    ;
   2.125 -  \end{rail}
   2.126 +    @{syntax_def simpmod}: ('add' | 'del' | 'only' | 'cong' (() | 'add' | 'del') |
   2.127 +      'split' (() | 'add' | 'del')) ':' @{syntax thmrefs}
   2.128 +  "}
   2.129  
   2.130    \begin{description}
   2.131  
   2.132    \item @{method simp} invokes the Simplifier, after declaring
   2.133    additional rules according to the arguments given.  Note that the
   2.134 -  \railtterm{only} modifier first removes all other rewrite rules,
   2.135 +  @{text only} modifier first removes all other rewrite rules,
   2.136    congruences, and looper tactics (including splits), and then behaves
   2.137 -  like \railtterm{add}.
   2.138 +  like @{text add}.
   2.139  
   2.140 -  \medskip The \railtterm{cong} modifiers add or delete Simplifier
   2.141 +  \medskip The @{text cong} modifiers add or delete Simplifier
   2.142    congruence rules (see also \cite{isabelle-ref}), the default is to
   2.143    add.
   2.144  
   2.145 -  \medskip The \railtterm{split} modifiers add or delete rules for the
   2.146 +  \medskip The @{text split} modifiers add or delete rules for the
   2.147    Splitter (see also \cite{isabelle-ref}), the default is to add.
   2.148    This works only if the Simplifier method has been properly setup to
   2.149    include the Splitter (all major object logics such HOL, HOLCF, FOL,
   2.150 @@ -440,10 +437,9 @@
   2.151      @{attribute_def split} & : & @{text attribute} \\
   2.152    \end{matharray}
   2.153  
   2.154 -  \begin{rail}
   2.155 -    ('simp' | 'cong' | 'split') (() | 'add' | 'del')
   2.156 -    ;
   2.157 -  \end{rail}
   2.158 +  @{rail "
   2.159 +    (@@{attribute simp} | @@{attribute cong} | @@{attribute split}) (() | 'add' | 'del')
   2.160 +  "}
   2.161  
   2.162    \begin{description}
   2.163  
   2.164 @@ -469,13 +465,13 @@
   2.165      simproc & : & @{text attribute} \\
   2.166    \end{matharray}
   2.167  
   2.168 -  \begin{rail}
   2.169 -    'simproc_setup' name '(' (term + '|') ')' '=' text \\ ('identifier' (nameref+))?
   2.170 +  @{rail "
   2.171 +    @@{command simproc_setup} @{syntax name} '(' (@{syntax term} + '|') ')' '='
   2.172 +      @{syntax text} \\ (@'identifier' (@{syntax nameref}+))?
   2.173      ;
   2.174  
   2.175 -    'simproc' (('add' ':')? | 'del' ':') (name+)
   2.176 -    ;
   2.177 -  \end{rail}
   2.178 +    @@{attribute simproc} (('add' ':')? | 'del' ':') (@{syntax name}+)
   2.179 +  "}
   2.180  
   2.181    \begin{description}
   2.182  
   2.183 @@ -514,13 +510,12 @@
   2.184      @{attribute_def simplified} & : & @{text attribute} \\
   2.185    \end{matharray}
   2.186  
   2.187 -  \begin{rail}
   2.188 -    'simplified' opt? thmrefs?
   2.189 +  @{rail "
   2.190 +    @@{attribute simplified} opt? @{syntax thmrefs}?
   2.191      ;
   2.192  
   2.193      opt: '(' ('no_asm' | 'no_asm_simp' | 'no_asm_use') ')'
   2.194 -    ;
   2.195 -  \end{rail}
   2.196 +  "}
   2.197  
   2.198    \begin{description}
   2.199    
   2.200 @@ -553,10 +548,9 @@
   2.201      @{method_def elim} & : & @{text method} \\
   2.202    \end{matharray}
   2.203  
   2.204 -  \begin{rail}
   2.205 -    ('rule' | 'intro' | 'elim') thmrefs?
   2.206 -    ;
   2.207 -  \end{rail}
   2.208 +  @{rail "
   2.209 +    (@@{method rule} | @@{method intro} | @@{method elim}) @{syntax thmrefs}?
   2.210 +  "}
   2.211  
   2.212    \begin{description}
   2.213  
   2.214 @@ -598,16 +592,16 @@
   2.215      @{method_def clarify} & : & @{text method} \\
   2.216    \end{matharray}
   2.217  
   2.218 -  \indexouternonterm{clamod}
   2.219 -  \begin{rail}
   2.220 -    'blast' nat? (clamod *)
   2.221 +  @{rail "
   2.222 +    @@{method blast} @{syntax nat}? (@{syntax clamod} * )
   2.223      ;
   2.224 -    ('fast' | 'slow' | 'best' | 'safe' | 'clarify') (clamod *)
   2.225 +    (@@{method fast} | @@{method slow} | @@{method best} | @@{method safe} | @@{method clarify})
   2.226 +      (@{syntax clamod} * )
   2.227      ;
   2.228  
   2.229 -    clamod: (('intro' | 'elim' | 'dest') ('!' | () | '?') | 'del') ':' thmrefs
   2.230 -    ;
   2.231 -  \end{rail}
   2.232 +    @{syntax_def clamod}:
   2.233 +      (('intro' | 'elim' | 'dest') ('!' | () | '?') | 'del') ':' @{syntax thmrefs}
   2.234 +  "}
   2.235  
   2.236    \begin{description}
   2.237  
   2.238 @@ -642,18 +636,18 @@
   2.239      @{method_def bestsimp} & : & @{text method} \\
   2.240    \end{matharray}
   2.241  
   2.242 -  \indexouternonterm{clasimpmod}
   2.243 -  \begin{rail}
   2.244 -    'auto' (nat nat)? (clasimpmod *)
   2.245 +  @{rail "
   2.246 +    @@{method auto} (@{syntax nat} @{syntax nat})? (@{syntax clasimpmod} * )
   2.247      ;
   2.248 -    ('force' | 'clarsimp' | 'fastsimp' | 'slowsimp' | 'bestsimp') (clasimpmod *)
   2.249 +    (@@{method force} | @@{method clarsimp} | @@{method fastsimp} | @@{method slowsimp} |
   2.250 +      @@{method bestsimp}) (@{syntax clasimpmod} * )
   2.251      ;
   2.252  
   2.253 -    clasimpmod: ('simp' (() | 'add' | 'del' | 'only') |
   2.254 +    @{syntax_def clasimpmod}: ('simp' (() | 'add' | 'del' | 'only') |
   2.255        ('cong' | 'split') (() | 'add' | 'del') |
   2.256        'iff' (((() | 'add') '?'?) | 'del') |
   2.257 -      (('intro' | 'elim' | 'dest') ('!' | () | '?') | 'del')) ':' thmrefs
   2.258 -  \end{rail}
   2.259 +      (('intro' | 'elim' | 'dest') ('!' | () | '?') | 'del')) ':' @{syntax thmrefs}
   2.260 +  "}
   2.261  
   2.262    \begin{description}
   2.263  
   2.264 @@ -665,7 +659,7 @@
   2.265    added as wrapper, see \cite{isabelle-ref} for more information.  The
   2.266    modifier arguments correspond to those given in
   2.267    \secref{sec:simplifier} and \secref{sec:classical}.  Just note that
   2.268 -  the ones related to the Simplifier are prefixed by \railtterm{simp}
   2.269 +  the ones related to the Simplifier are prefixed by @{text simp}
   2.270    here.
   2.271  
   2.272    Facts provided by forward chaining are inserted into the goal before
   2.273 @@ -687,14 +681,13 @@
   2.274      @{attribute_def iff} & : & @{text attribute} \\
   2.275    \end{matharray}
   2.276  
   2.277 -  \begin{rail}
   2.278 -    ('intro' | 'elim' | 'dest') ('!' | () | '?') nat?
   2.279 +  @{rail "
   2.280 +    (@@{attribute intro} | @@{attribute elim} | @@{attribute dest}) ('!' | () | '?') @{syntax nat}?
   2.281      ;
   2.282 -    'rule' 'del'
   2.283 +    @@{attribute rule} 'del'
   2.284      ;
   2.285 -    'iff' (((() | 'add') '?'?) | 'del')
   2.286 -    ;
   2.287 -  \end{rail}
   2.288 +    @@{attribute iff} (((() | 'add') '?'?) | 'del')
   2.289 +  "}
   2.290  
   2.291    \begin{description}
   2.292  
   2.293 @@ -779,14 +772,13 @@
   2.294    Generic tools may refer to the information provided by object-logic
   2.295    declarations internally.
   2.296  
   2.297 -  \begin{rail}
   2.298 -    'judgment' constdecl
   2.299 +  @{rail "
   2.300 +    @@{command judgment} @{syntax constdecl}
   2.301      ;
   2.302 -    'atomize' ('(' 'full' ')')?
   2.303 +    @@{attribute atomize} ('(' 'full' ')')?
   2.304      ;
   2.305 -    'rule_format' ('(' 'noasm' ')')?
   2.306 -    ;
   2.307 -  \end{rail}
   2.308 +    @@{attribute rule_format} ('(' 'noasm' ')')?
   2.309 +  "}
   2.310  
   2.311    \begin{description}
   2.312    
     3.1 --- a/doc-src/IsarRef/Thy/HOLCF_Specific.thy	Sun May 01 18:57:45 2011 +0200
     3.2 +++ b/doc-src/IsarRef/Thy/HOLCF_Specific.thy	Mon May 02 01:05:50 2011 +0200
     3.3 @@ -34,16 +34,17 @@
     3.4      @{command_def (HOLCF) "domain"} & : & @{text "theory \<rightarrow> theory"} \\
     3.5    \end{matharray}
     3.6  
     3.7 -  \begin{rail}
     3.8 -    'domain' parname? (dmspec + 'and')
     3.9 +  @{rail "
    3.10 +    @@{command (HOLCF) domain} @{syntax parname}? (dmspec + @'and')
    3.11      ;
    3.12  
    3.13 -    dmspec: typespec '=' (cons + '|')
    3.14 +    dmspec: @{syntax typespec} '=' (cons + '|')
    3.15      ;
    3.16 -    cons: name (type *) mixfix?
    3.17 +    cons: @{syntax name} (@{syntax type} * ) @{syntax mixfix}?
    3.18      ;
    3.19 -    dtrules: 'distinct' thmrefs 'inject' thmrefs 'induction' thmrefs
    3.20 -  \end{rail}
    3.21 +    dtrules: @'distinct' @{syntax thmrefs} @'inject' @{syntax thmrefs}
    3.22 +      @'induction' @{syntax thmrefs}
    3.23 +  "}
    3.24  
    3.25    Recursive domains in HOLCF are analogous to datatypes in classical
    3.26    HOL (cf.\ \secref{sec:hol-datatype}).  Mutual recursion is
     4.1 --- a/doc-src/IsarRef/Thy/HOL_Specific.thy	Sun May 01 18:57:45 2011 +0200
     4.2 +++ b/doc-src/IsarRef/Thy/HOL_Specific.thy	Mon May 02 01:05:50 2011 +0200
     4.3 @@ -11,17 +11,16 @@
     4.4      @{command_def (HOL) "typedef"} & : & @{text "local_theory \<rightarrow> proof(prove)"} \\
     4.5    \end{matharray}
     4.6  
     4.7 -  \begin{rail}
     4.8 -    'typedef' altname? abstype '=' repset
     4.9 +  @{rail "
    4.10 +    @@{command (HOL) typedef} altname? abstype '=' repset
    4.11      ;
    4.12  
    4.13 -    altname: '(' (name | 'open' | 'open' name) ')'
    4.14 +    altname: '(' (@{syntax name} | @'open' | @'open' @{syntax name}) ')'
    4.15      ;
    4.16 -    abstype: typespecsorts mixfix?
    4.17 +    abstype: @{syntax typespecsorts} @{syntax mixfix}?
    4.18      ;
    4.19 -    repset: term ('morphisms' name name)?
    4.20 -    ;
    4.21 -  \end{rail}
    4.22 +    repset: @{syntax term} (@'morphisms' @{syntax name} @{syntax name})?
    4.23 +  "}
    4.24  
    4.25    \begin{description}
    4.26  
    4.27 @@ -68,13 +67,12 @@
    4.28  
    4.29  text {*
    4.30    \begin{matharray}{rcl}
    4.31 -    @{attribute (HOL) split_format}@{text "\<^sup>*"} & : & @{text attribute} \\
    4.32 +    @{attribute_def (HOL) split_format}@{text "\<^sup>*"} & : & @{text attribute} \\
    4.33    \end{matharray}
    4.34  
    4.35 -  \begin{rail}
    4.36 -    'split_format' '(' 'complete' ')'
    4.37 -    ;
    4.38 -  \end{rail}
    4.39 +  @{rail "
    4.40 +    @@{attribute (HOL) split_format} ('(' 'complete' ')')?
    4.41 +  "}
    4.42  
    4.43    \begin{description}
    4.44  
    4.45 @@ -173,10 +171,9 @@
    4.46      @{command_def (HOL) "record"} & : & @{text "theory \<rightarrow> theory"} \\
    4.47    \end{matharray}
    4.48  
    4.49 -  \begin{rail}
    4.50 -    'record' typespecsorts '=' (type '+')? (constdecl +)
    4.51 -    ;
    4.52 -  \end{rail}
    4.53 +  @{rail "
    4.54 +    @@{command (HOL) record} @{syntax typespecsorts} '=' (@{syntax type} '+')? (@{syntax constdecl} +)
    4.55 +  "}
    4.56  
    4.57    \begin{description}
    4.58  
    4.59 @@ -348,16 +345,16 @@
    4.60      @{command_def (HOL) "rep_datatype"} & : & @{text "theory \<rightarrow> proof(prove)"} \\
    4.61    \end{matharray}
    4.62  
    4.63 -  \begin{rail}
    4.64 -    'datatype' (dtspec + 'and')
    4.65 +  @{rail "
    4.66 +    @@{command (HOL) datatype} (dtspec + @'and')
    4.67      ;
    4.68 -    'rep_datatype' ('(' (name +) ')')? (term +)
    4.69 +    @@{command (HOL) rep_datatype} ('(' (@{syntax name} +) ')')? (@{syntax term} +)
    4.70      ;
    4.71  
    4.72 -    dtspec: parname? typespec mixfix? '=' (cons + '|')
    4.73 +    dtspec: @{syntax parname}? @{syntax typespec} @{syntax mixfix}? '=' (cons + '|')
    4.74      ;
    4.75 -    cons: name ( type * ) mixfix?
    4.76 -  \end{rail}
    4.77 +    cons: @{syntax name} (@{syntax type} * ) @{syntax mixfix}?
    4.78 +  "}
    4.79  
    4.80    \begin{description}
    4.81  
    4.82 @@ -391,10 +388,10 @@
    4.83      @{command_def (HOL) "enriched_type"} & : & @{text "local_theory \<rightarrow> proof(prove)"}
    4.84    \end{matharray}
    4.85  
    4.86 -  \begin{rail}
    4.87 -    'enriched_type' (prefix ':')? term
    4.88 +  @{rail "
    4.89 +    @@{command (HOL) enriched_type} (prefix ':')? @{syntax term}
    4.90      ;
    4.91 -  \end{rail}
    4.92 +  "} % FIXME check prefix
    4.93  
    4.94    \begin{description}
    4.95  
    4.96 @@ -437,17 +434,19 @@
    4.97      @{command_def (HOL) "termination"} & : & @{text "local_theory \<rightarrow> proof(prove)"} \\
    4.98    \end{matharray}
    4.99  
   4.100 -  \begin{rail}
   4.101 -    'primrec' target? fixes 'where' equations
   4.102 +  @{rail "
   4.103 +    @@{command (HOL) primrec} @{syntax target}? @{syntax \"fixes\"} @'where' equations
   4.104      ;
   4.105 -    ('fun' | 'function') target? functionopts? fixes \\ 'where' equations
   4.106 +    (@@{command (HOL) fun} | @@{command (HOL) function}) @{syntax target}? functionopts?
   4.107 +      @{syntax \"fixes\"} \\ @'where' equations
   4.108      ;
   4.109 -    equations: (thmdecl? prop + '|')
   4.110 +
   4.111 +    equations: (@{syntax thmdecl}? @{syntax prop} + '|')
   4.112      ;
   4.113      functionopts: '(' (('sequential' | 'domintros') + ',') ')'
   4.114      ;
   4.115 -    'termination' ( term )?
   4.116 -  \end{rail}
   4.117 +    @@{command (HOL) termination} @{syntax term}?
   4.118 +  "}
   4.119  
   4.120    \begin{description}
   4.121  
   4.122 @@ -529,15 +528,15 @@
   4.123      @{method_def (HOL) size_change} & : & @{text method} \\
   4.124    \end{matharray}
   4.125  
   4.126 -  \begin{rail}
   4.127 -    'relation' term
   4.128 +  @{rail "
   4.129 +    @@{method (HOL) relation} @{syntax term}
   4.130      ;
   4.131 -    'lexicographic_order' ( clasimpmod * )
   4.132 +    @@{method (HOL) lexicographic_order} (@{syntax clasimpmod} * )
   4.133      ;
   4.134 -    'size_change' ( orders ( clasimpmod * ) )
   4.135 +    @@{method (HOL) size_change} ( orders (@{syntax clasimpmod} * ) )
   4.136      ;
   4.137      orders: ( 'max' | 'min' | 'ms' ) *
   4.138 -  \end{rail}
   4.139 +  "}
   4.140  
   4.141    \begin{description}
   4.142  
   4.143 @@ -587,9 +586,10 @@
   4.144      @{attribute_def (HOL) "partial_function_mono"} & : & @{text attribute} \\
   4.145    \end{matharray}
   4.146  
   4.147 -  \begin{rail}
   4.148 -    'partial_function' target? '(' mode ')' fixes \\ 'where' thmdecl? prop
   4.149 -  \end{rail}
   4.150 +  @{rail "
   4.151 +    @@{command (HOL) partial_function} @{syntax target}?
   4.152 +      '(' mode ')' @{syntax \"fixes\"} \\ @'where' @{syntax thmdecl}? @{syntax prop}
   4.153 +  "} % FIXME check mode
   4.154  
   4.155    \begin{description}
   4.156  
   4.157 @@ -657,18 +657,19 @@
   4.158      @{command_def (HOL) "recdef_tc"}@{text "\<^sup>*"} & : & @{text "theory \<rightarrow> proof(prove)"} \\
   4.159    \end{matharray}
   4.160  
   4.161 -  \begin{rail}
   4.162 -    'recdef' ('(' 'permissive' ')')? \\ name term (prop +) hints?
   4.163 +  @{rail "
   4.164 +    @@{command (HOL) recdef} ('(' @'permissive' ')')? \\
   4.165 +      @{syntax name} @{syntax term} (@{syntax prop} +) hints?
   4.166      ;
   4.167 -    recdeftc thmdecl? tc
   4.168 +    recdeftc @{syntax thmdecl}? tc
   4.169      ;
   4.170 -    hints: '(' 'hints' ( recdefmod * ) ')'
   4.171 +    hints: '(' @'hints' ( recdefmod * ) ')'
   4.172      ;
   4.173 -    recdefmod: (('recdef_simp' | 'recdef_cong' | 'recdef_wf') (() | 'add' | 'del') ':' thmrefs) | clasimpmod
   4.174 +    recdefmod: (('recdef_simp' | 'recdef_cong' | 'recdef_wf')
   4.175 +      (() | 'add' | 'del') ':' @{syntax thmrefs}) | @{syntax clasimpmod}
   4.176      ;
   4.177 -    tc: nameref ('(' nat ')')?
   4.178 -    ;
   4.179 -  \end{rail}
   4.180 +    tc: @{syntax nameref} ('(' @{syntax nat} ')')?
   4.181 +  "}
   4.182  
   4.183    \begin{description}
   4.184  
   4.185 @@ -702,10 +703,10 @@
   4.186      @{attribute_def (HOL) recdef_wf} & : & @{text attribute} \\
   4.187    \end{matharray}
   4.188  
   4.189 -  \begin{rail}
   4.190 -    ('recdef_simp' | 'recdef_cong' | 'recdef_wf') (() | 'add' | 'del')
   4.191 -    ;
   4.192 -  \end{rail}
   4.193 +  @{rail "
   4.194 +    (@@{attribute (HOL) recdef_simp} | @@{attribute (HOL) recdef_cong} |
   4.195 +      @@{attribute (HOL) recdef_wf}) (() | 'add' | 'del')
   4.196 +  "}
   4.197  *}
   4.198  
   4.199  
   4.200 @@ -742,15 +743,16 @@
   4.201      @{attribute_def (HOL) mono} & : & @{text attribute} \\
   4.202    \end{matharray}
   4.203  
   4.204 -  \begin{rail}
   4.205 -    ('inductive' | 'inductive_set' | 'coinductive' | 'coinductive_set') target? fixes ('for' fixes)? \\
   4.206 -    ('where' clauses)? ('monos' thmrefs)?
   4.207 +  @{rail "
   4.208 +    (@@{command (HOL) inductive} | @@{command (HOL) inductive_set} |
   4.209 +      @@{command (HOL) coinductive} | @@{command (HOL) coinductive_set})
   4.210 +    @{syntax target}? @{syntax \"fixes\"} (@'for' @{syntax \"fixes\"})? \\
   4.211 +    (@'where' clauses)? (@'monos' @{syntax thmrefs})?
   4.212      ;
   4.213 -    clauses: (thmdecl? prop + '|')
   4.214 +    clauses: (@{syntax thmdecl}? @{syntax prop} + '|')
   4.215      ;
   4.216 -    'mono' (() | 'add' | 'del')
   4.217 -    ;
   4.218 -  \end{rail}
   4.219 +    @@{attribute (HOL) mono} (() | 'add' | 'del')
   4.220 +  "}
   4.221  
   4.222    \begin{description}
   4.223  
   4.224 @@ -879,10 +881,9 @@
   4.225      @{method_def (HOL) iprover} & : & @{text method} \\
   4.226    \end{matharray}
   4.227  
   4.228 -  \begin{rail}
   4.229 -    'iprover' ( rulemod * )
   4.230 -    ;
   4.231 -  \end{rail}
   4.232 +  @{rail "
   4.233 +    @@{method (HOL) iprover} ( @{syntax rulemod} * )
   4.234 +  "}
   4.235  
   4.236    The @{method (HOL) iprover} method performs intuitionistic proof
   4.237    search, depending on specifically declared rules from the context,
   4.238 @@ -907,10 +908,9 @@
   4.239      @{method_def (HOL) "coherent"} & : & @{text method} \\
   4.240    \end{matharray}
   4.241  
   4.242 -  \begin{rail}
   4.243 -    'coherent' thmrefs?
   4.244 -    ;
   4.245 -  \end{rail}
   4.246 +  @{rail "
   4.247 +    @@{method (HOL) coherent} @{syntax thmrefs}?
   4.248 +  "}
   4.249  
   4.250    The @{method (HOL) coherent} method solves problems of
   4.251    \emph{Coherent Logic} \cite{Bezem-Coquand:2005}, which covers
   4.252 @@ -934,25 +934,23 @@
   4.253      @{command_def (HOL) "sledgehammer_params"} & : & @{text "theory \<rightarrow> theory"}
   4.254    \end{matharray}
   4.255  
   4.256 -  \begin{rail}
   4.257 -    'solve_direct'
   4.258 +  @{rail "
   4.259 +    @@{command (HOL) try} ( ( ( 'simp' | 'intro' | 'elim' | 'dest' ) ':' @{syntax thmrefs} ) + ) ?
   4.260 +      @{syntax nat}?
   4.261 +    ;
   4.262 +    @@{command (HOL) sledgehammer} ( '[' args ']' )? facts? @{syntax nat}?
   4.263      ;
   4.264  
   4.265 -    'try' ( ( ( 'simp' | 'intro' | 'elim' | 'dest' ) ':' thmrefs ) + ) ? nat?
   4.266 +    @@{command (HOL) sledgehammer_params} ( ( '[' args ']' ) ? )
   4.267      ;
   4.268  
   4.269 -    'sledgehammer' ( '[' args ']' ) ? facts? nat?
   4.270 +    args: ( @{syntax name} '=' value + ',' )
   4.271      ;
   4.272  
   4.273 -    'sledgehammer_params' ( ( '[' args ']' ) ? )
   4.274 +    facts: '(' ( ( ( ( 'add' | 'del' ) ':' ) ? @{syntax thmrefs} ) + ) ? ')'
   4.275      ;
   4.276 -
   4.277 -    args: ( name '=' value + ',' )
   4.278 -    ;
   4.279 -
   4.280 -    facts: '(' ( ( ( ( 'add' | 'del' ) ':' ) ? thmrefs ) + ) ? ')'
   4.281 -    ;
   4.282 -  \end{rail}
   4.283 +  "} % FIXME try: proper clasimpmod!?
   4.284 +  % FIXME check args "value"
   4.285  
   4.286    \begin{description}
   4.287  
   4.288 @@ -994,22 +992,24 @@
   4.289      @{command_def (HOL) "nitpick_params"} & : & @{text "theory \<rightarrow> theory"}
   4.290    \end{matharray}
   4.291  
   4.292 -  \begin{rail}
   4.293 -    'value' ( ( '[' name ']' ) ? ) modes? term
   4.294 +  @{rail "
   4.295 +    @@{command (HOL) value} ( '[' name ']' )? modes? @{syntax term}
   4.296      ;
   4.297  
   4.298 -    ('quickcheck' | 'refute' | 'nitpick')  ( ( '[' args ']' ) ? ) nat?
   4.299 +    (@@{command (HOL) quickcheck} | @@{command (HOL) refute} | @@{command (HOL) nitpick})
   4.300 +      ( '[' args ']' )? @{syntax nat}?
   4.301      ;
   4.302  
   4.303 -    ('quickcheck_params' | 'refute_params' | 'nitpick_params') ( ( '[' args ']' ) ? )
   4.304 +    (@@{command (HOL) quickcheck_params} | @@{command (HOL) refute_params} |
   4.305 +      @@{command (HOL) nitpick_params}) ( '[' args ']' )?
   4.306      ;
   4.307  
   4.308 -    modes: '(' (name + ) ')'
   4.309 +    modes: '(' (@{syntax name} +) ')'
   4.310      ;
   4.311  
   4.312 -    args: ( name '=' value + ',' )
   4.313 +    args: ( @{syntax name} '=' value + ',' )
   4.314      ;
   4.315 -  \end{rail}
   4.316 +  "} % FIXME check "value"
   4.317  
   4.318    \begin{description}
   4.319  
   4.320 @@ -1133,19 +1133,18 @@
   4.321      @{command_def (HOL) "inductive_cases"}@{text "\<^sup>*"} & : & @{text "local_theory \<rightarrow> local_theory"} \\
   4.322    \end{matharray}
   4.323  
   4.324 -  \begin{rail}
   4.325 -    'case_tac' goalspec? term rule?
   4.326 +  @{rail "
   4.327 +    @@{method (HOL) case_tac} @{syntax goalspec}? @{syntax term} rule?
   4.328      ;
   4.329 -    'induct_tac' goalspec? (insts * 'and') rule?
   4.330 +    @@{method (HOL) induct_tac} @{syntax goalspec}? (@{syntax insts} * @'and') rule?
   4.331      ;
   4.332 -    'ind_cases' (prop +) ('for' (name +)) ?
   4.333 +    @@{method (HOL) ind_cases} (@{syntax prop}+) (@'for' (@{syntax name}+))?
   4.334      ;
   4.335 -    'inductive_cases' (thmdecl? (prop +) + 'and')
   4.336 +    @@{command (HOL) inductive_cases} (@{syntax thmdecl}? (@{syntax prop}+) + @'and')
   4.337      ;
   4.338  
   4.339 -    rule: ('rule' ':' thmref)
   4.340 -    ;
   4.341 -  \end{rail}
   4.342 +    rule: 'rule' ':' @{syntax thmref}
   4.343 +  "}
   4.344  
   4.345    \begin{description}
   4.346  
   4.347 @@ -1220,85 +1219,83 @@
   4.348      @{command_def (HOL) "code_reflect"} & : & @{text "theory \<rightarrow> theory"}
   4.349    \end{matharray}
   4.350  
   4.351 -  \begin{rail}
   4.352 -     'export_code' ( constexpr + ) \\
   4.353 -       ( ( 'in' target ( 'module_name' string ) ? \\
   4.354 -        ( 'file' ( string | '-' ) ) ? ( '(' args ')' ) ?) + ) ?
   4.355 +  @{rail "
   4.356 +    @@{command (HOL) export_code} ( constexpr + ) \\
   4.357 +       ( ( @'in' target ( @'module_name' @{syntax string} ) ? \\
   4.358 +        ( @'file' ( @{syntax string} | '-' ) ) ? ( '(' args ')' ) ?) + ) ?
   4.359      ;
   4.360  
   4.361 -    const: term
   4.362 +    const: @{syntax term}
   4.363      ;
   4.364  
   4.365      constexpr: ( const | 'name._' | '_' )
   4.366      ;
   4.367  
   4.368 -    typeconstructor: nameref
   4.369 +    typeconstructor: @{syntax nameref}
   4.370      ;
   4.371  
   4.372 -    class: nameref
   4.373 +    class: @{syntax nameref}
   4.374      ;
   4.375  
   4.376      target: 'SML' | 'OCaml' | 'Haskell' | 'Scala'
   4.377      ;
   4.378  
   4.379 -    'code' ( 'del' | 'abstype' | 'abstract' ) ?
   4.380 +    @@{attribute (HOL) code} ( 'del' | 'abstype' | 'abstract' )?
   4.381      ;
   4.382  
   4.383 -    'code_abort' ( const + )
   4.384 +    @@{command (HOL) code_abort} ( const + )
   4.385      ;
   4.386  
   4.387 -    'code_datatype' ( const + )
   4.388 +    @@{command (HOL) code_datatype} ( const + )
   4.389      ;
   4.390  
   4.391 -    'code_inline' ( 'del' ) ?
   4.392 +    @@{attribute (HOL) code_inline} ( 'del' ) ?
   4.393      ;
   4.394  
   4.395 -    'code_post' ( 'del' ) ?
   4.396 +    @@{attribute (HOL) code_post} ( 'del' ) ?
   4.397      ;
   4.398  
   4.399 -    'code_thms' ( constexpr + ) ?
   4.400 +    @@{command (HOL) code_thms} ( constexpr + ) ?
   4.401      ;
   4.402  
   4.403 -    'code_deps' ( constexpr + ) ?
   4.404 +    @@{command (HOL) code_deps} ( constexpr + ) ?
   4.405      ;
   4.406  
   4.407 -    'code_const' (const + 'and') \\
   4.408 -      ( ( '(' target ( syntax ? + 'and' ) ')' ) + )
   4.409 +    @@{command (HOL) code_const} (const + @'and') \\
   4.410 +      ( ( '(' target ( syntax ? + @'and' ) ')' ) + )
   4.411      ;
   4.412  
   4.413 -    'code_type' (typeconstructor + 'and') \\
   4.414 -      ( ( '(' target ( syntax ? + 'and' ) ')' ) + )
   4.415 +    @@{command (HOL) code_type} (typeconstructor + @'and') \\
   4.416 +      ( ( '(' target ( syntax ? + @'and' ) ')' ) + )
   4.417      ;
   4.418  
   4.419 -    'code_class' (class + 'and') \\
   4.420 -      ( ( '(' target \\ ( string ? + 'and' ) ')' ) + )
   4.421 +    @@{command (HOL) code_class} (class + @'and') \\
   4.422 +      ( ( '(' target \\ ( @{syntax string} ? + @'and' ) ')' ) + )
   4.423      ;
   4.424  
   4.425 -    'code_instance' (( typeconstructor '::' class ) + 'and') \\
   4.426 -      ( ( '(' target ( '-' ? + 'and' ) ')' ) + )
   4.427 +    @@{command (HOL) code_instance} (( typeconstructor '::' class ) + @'and') \\
   4.428 +      ( ( '(' target ( '-' ? + @'and' ) ')' ) + )
   4.429      ;
   4.430  
   4.431 -    'code_reserved' target ( string + )
   4.432 +    @@{command (HOL) code_reserved} target ( @{syntax string} + )
   4.433      ;
   4.434  
   4.435 -    'code_monad' const const target
   4.436 +    @@{command (HOL) code_monad} const const target
   4.437      ;
   4.438  
   4.439 -    'code_include' target ( string ( string | '-') )
   4.440 +    @@{command (HOL) code_include} target ( @{syntax string} ( @{syntax string} | '-') )
   4.441      ;
   4.442  
   4.443 -    'code_modulename' target ( ( string string ) + )
   4.444 +    @@{command (HOL) code_modulename} target ( ( @{syntax string} @{syntax string} ) + )
   4.445      ;
   4.446  
   4.447 -    'code_reflect' string \\
   4.448 -      ( 'datatypes' ( string '=' ( '_' | ( string + '|' ) + 'and' ) ) ) ? \\
   4.449 -      ( 'functions' ( string + ) ) ? ( 'file' string ) ?
   4.450 +    @@{command (HOL) code_reflect} @{syntax string} \\
   4.451 +      ( @'datatypes' ( @{syntax string} '=' ( '_' | ( @{syntax string} + '|' ) + @'and' ) ) ) ? \\
   4.452 +      ( @'functions' ( @{syntax string} + ) ) ? ( @'file' @{syntax string} ) ?
   4.453      ;
   4.454  
   4.455 -    syntax: string | ( 'infix' | 'infixl' | 'infixr' ) nat string
   4.456 -    ;
   4.457 -
   4.458 -  \end{rail}
   4.459 +    syntax: @{syntax string} | ( @'infix' | @'infixl' | @'infixr' ) @{syntax nat} @{syntax string}
   4.460 +  "}
   4.461  
   4.462    \begin{description}
   4.463  
   4.464 @@ -1424,40 +1421,38 @@
   4.465      @{attribute_def (HOL) code} & : & @{text attribute} \\
   4.466    \end{matharray}
   4.467  
   4.468 -  \begin{rail}
   4.469 -  ( 'code_module' | 'code_library' ) modespec ? name ? \\
   4.470 -    ( 'file' name ) ? ( 'imports' ( name + ) ) ? \\
   4.471 -    'contains' ( ( name '=' term ) + | term + )
   4.472 +  @{rail "
   4.473 +  ( @@{command (HOL) code_module} | @@{command (HOL) code_library} ) modespec? @{syntax name}? \\
   4.474 +    ( @'file' name ) ? ( @'imports' ( @{syntax name} + ) ) ? \\
   4.475 +    @'contains' ( ( @{syntax name} '=' @{syntax term} ) + | @{syntax term} + )
   4.476    ;
   4.477  
   4.478 -  modespec: '(' ( name * ) ')'
   4.479 +  modespec: '(' ( @{syntax name} * ) ')'
   4.480    ;
   4.481  
   4.482 -  'consts_code' (codespec +)
   4.483 +  @@{command (HOL) consts_code} (codespec +)
   4.484    ;
   4.485  
   4.486    codespec: const template attachment ?
   4.487    ;
   4.488  
   4.489 -  'types_code' (tycodespec +)
   4.490 +  @@{command (HOL) types_code} (tycodespec +)
   4.491    ;
   4.492  
   4.493 -  tycodespec: name template attachment ?
   4.494 +  tycodespec: @{syntax name} template attachment ?
   4.495    ;
   4.496  
   4.497 -  const: term
   4.498 +  const: @{syntax term}
   4.499    ;
   4.500  
   4.501 -  template: '(' string ')'
   4.502 +  template: '(' @{syntax string} ')'
   4.503    ;
   4.504  
   4.505 -  attachment: 'attach' modespec ? verblbrace text verbrbrace
   4.506 +  attachment: 'attach' modespec? '{' @{syntax text} '}'
   4.507    ;
   4.508  
   4.509 -  'code' (name)?
   4.510 -  ;
   4.511 -  \end{rail}
   4.512 -
   4.513 +  @@{attribute (HOL) code} (name)?
   4.514 +  "}
   4.515  *}
   4.516  
   4.517  
   4.518 @@ -1469,11 +1464,12 @@
   4.519      @{command_def (HOL) "ax_specification"} & : & @{text "theory \<rightarrow> proof(prove)"} \\
   4.520    \end{matharray}
   4.521  
   4.522 -  \begin{rail}
   4.523 -  ('specification' | 'ax_specification') '(' (decl +) ')' \\ (thmdecl? prop +)
   4.524 +  @{rail "
   4.525 +  (@@{command (HOL) specification} | @@{command (HOL) ax_specification})
   4.526 +    '(' (decl +) ')' \\ (@{syntax thmdecl}? @{syntax prop} +)
   4.527    ;
   4.528 -  decl: ((name ':')? term '(' 'overloaded' ')'?)
   4.529 -  \end{rail}
   4.530 +  decl: ((@{syntax name} ':')? @{syntax term} '(' @'overloaded' ')'?)
   4.531 +  "}
   4.532  
   4.533    \begin{description}
   4.534  
     5.1 --- a/doc-src/IsarRef/Thy/Inner_Syntax.thy	Sun May 01 18:57:45 2011 +0200
     5.2 +++ b/doc-src/IsarRef/Thy/Inner_Syntax.thy	Mon May 02 01:05:50 2011 +0200
     5.3 @@ -22,23 +22,22 @@
     5.4    These diagnostic commands assist interactive development by printing
     5.5    internal logical entities in a human-readable fashion.
     5.6  
     5.7 -  \begin{rail}
     5.8 -    'typ' modes? type
     5.9 +  @{rail "
    5.10 +    @@{command typ} @{syntax modes}? @{syntax type}
    5.11      ;
    5.12 -    'term' modes? term
    5.13 +    @@{command term} @{syntax modes}? @{syntax term}
    5.14      ;
    5.15 -    'prop' modes? prop
    5.16 +    @@{command prop} @{syntax modes}? @{syntax prop}
    5.17      ;
    5.18 -    'thm' modes? thmrefs
    5.19 +    @@{command thm} @{syntax modes}? @{syntax thmrefs}
    5.20      ;
    5.21 -    ( 'prf' | 'full_prf' ) modes? thmrefs?
    5.22 +    ( @@{command prf} | @@{command full_prf} ) @{syntax modes}? @{syntax thmrefs}?
    5.23      ;
    5.24 -    'pr' modes? nat?
    5.25 +    @@{command pr} @{syntax modes}? @{syntax nat}?
    5.26      ;
    5.27  
    5.28 -    modes: '(' (name + ) ')'
    5.29 -    ;
    5.30 -  \end{rail}
    5.31 +    @{syntax_def modes}: '(' (@{syntax name} + ) ')'
    5.32 +  "}
    5.33  
    5.34    \begin{description}
    5.35  
    5.36 @@ -247,20 +246,20 @@
    5.37    theorem statements, locale specifications etc.\ also admit mixfix
    5.38    annotations.
    5.39  
    5.40 -  \indexouternonterm{infix}\indexouternonterm{mixfix}\indexouternonterm{structmixfix}
    5.41 -  \begin{rail}
    5.42 -    infix: '(' ('infix' | 'infixl' | 'infixr') string nat ')'
    5.43 +  @{rail "
    5.44 +    @{syntax_def \"infix\"}: '(' (@'infix' | @'infixl' | @'infixr')
    5.45 +      @{syntax string} @{syntax nat} ')'
    5.46      ;
    5.47 -    mixfix: infix | '(' string prios? nat? ')' | '(' 'binder' string prios? nat ')'
    5.48 +    @{syntax_def mixfix}: @{syntax \"infix\"} | '(' @{syntax string} prios? @{syntax nat}? ')' |
    5.49 +    '(' @'binder' @{syntax string} prios? @{syntax nat} ')'
    5.50      ;
    5.51 -    structmixfix: mixfix | '(' 'structure' ')'
    5.52 +    @{syntax_def structmixfix}: @{syntax mixfix} | '(' @'structure' ')'
    5.53      ;
    5.54  
    5.55 -    prios: '[' (nat + ',') ']'
    5.56 -    ;
    5.57 -  \end{rail}
    5.58 +    prios: '[' (@{syntax nat} + ',') ']'
    5.59 +  "}
    5.60  
    5.61 -  Here the \railtok{string} specifications refer to the actual mixfix
    5.62 +  Here the @{syntax string} specifications refer to the actual mixfix
    5.63    template, which may include literal text, spacing, blocks, and
    5.64    arguments (denoted by ``@{text _}''); the special symbol
    5.65    ``@{verbatim "\<index>"}'' (printed as ``@{text "\<index>"}'') represents an index
    5.66 @@ -367,14 +366,15 @@
    5.67      @{command_def "write"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
    5.68    \end{matharray}
    5.69  
    5.70 -  \begin{rail}
    5.71 -    ('type_notation' | 'no_type_notation') target? mode? \\ (nameref mixfix + 'and')
    5.72 +  @{rail "
    5.73 +    (@@{command type_notation} | @@{command no_type_notation}) @{syntax target}?
    5.74 +      @{syntax mode}? \\ (@{syntax nameref} @{syntax mixfix} + @'and')
    5.75      ;
    5.76 -    ('notation' | 'no_notation') target? mode? \\ (nameref structmixfix + 'and')
    5.77 +    (@@{command notation} | @@{command no_notation}) @{syntax target}? @{syntax mode}? \\
    5.78 +      (@{syntax nameref} @{syntax structmixfix} + @'and')
    5.79      ;
    5.80 -    'write' mode? (nameref structmixfix + 'and')
    5.81 -    ;
    5.82 -  \end{rail}
    5.83 +    @@{command write} @{syntax mode}? (@{syntax nameref} @{syntax structmixfix} + @'and')
    5.84 +  "}
    5.85  
    5.86    \begin{description}
    5.87  
    5.88 @@ -730,19 +730,19 @@
    5.89      @{command_def "no_translations"} & : & @{text "theory \<rightarrow> theory"} \\
    5.90    \end{matharray}
    5.91  
    5.92 -  \begin{rail}
    5.93 -    'nonterminal' (name + 'and')
    5.94 +  @{rail "
    5.95 +    @@{command nonterminal} (@{syntax name} + @'and')
    5.96      ;
    5.97 -    ('syntax' | 'no_syntax') mode? (constdecl +)
    5.98 +    (@@{command syntax} | @@{command no_syntax}) @{syntax mode}? (@{syntax constdecl} +)
    5.99      ;
   5.100 -    ('translations' | 'no_translations') (transpat ('==' | '=>' | '<=' | rightleftharpoons | rightharpoonup | leftharpoondown) transpat +)
   5.101 +    (@@{command translations} | @@{command no_translations})
   5.102 +      (transpat ('==' | '=>' | '<=' | '\<rightleftharpoons>' | '\<rightharpoonup>' | '\<leftharpoondown>') transpat +)
   5.103      ;
   5.104  
   5.105 -    mode: ('(' ( name | 'output' | name 'output' ) ')')
   5.106 +    mode: ('(' ( @{syntax name} | @'output' | @{syntax name} @'output' ) ')')
   5.107      ;
   5.108 -    transpat: ('(' nameref ')')? string
   5.109 -    ;
   5.110 -  \end{rail}
   5.111 +    transpat: ('(' @{syntax nameref} ')')? @{syntax string}
   5.112 +  "}
   5.113  
   5.114    \begin{description}
   5.115    
   5.116 @@ -788,15 +788,15 @@
   5.117      @{command_def "print_ast_translation"} & : & @{text "theory \<rightarrow> theory"} \\
   5.118    \end{matharray}
   5.119  
   5.120 -  \begin{rail}
   5.121 -  ( 'parse_ast_translation' | 'parse_translation' | 'print_translation' |
   5.122 -    'typed_print_translation' | 'print_ast_translation' ) ('(advanced)')? text
   5.123 -  ;
   5.124 -  \end{rail}
   5.125 +  @{rail "
   5.126 +  ( @@{command parse_ast_translation} | @@{command parse_translation} |
   5.127 +    @@{command print_translation} | @@{command typed_print_translation} |
   5.128 +    @@{command print_ast_translation}) ('(' @'advanced' ')')? @{syntax text}
   5.129 +  "}
   5.130  
   5.131    Syntax translation functions written in ML admit almost arbitrary
   5.132    manipulations of Isabelle's inner syntax.  Any of the above commands
   5.133 -  have a single \railqtok{text} argument that refers to an ML
   5.134 +  have a single @{syntax text} argument that refers to an ML
   5.135    expression of appropriate type, which are as follows by default:
   5.136  
   5.137  %FIXME proper antiquotations
     6.1 --- a/doc-src/IsarRef/Thy/Misc.thy	Sun May 01 18:57:45 2011 +0200
     6.2 +++ b/doc-src/IsarRef/Thy/Misc.thy	Mon May 02 01:05:50 2011 +0200
     6.3 @@ -21,24 +21,24 @@
     6.4      @{command_def "print_binds"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
     6.5    \end{matharray}
     6.6  
     6.7 -  \begin{rail}
     6.8 -    ('print_theory' | 'print_theorems') ('!'?)
     6.9 +  @{rail "
    6.10 +    (@@{command print_theory} | @@{command print_theorems}) ('!'?)
    6.11      ;
    6.12  
    6.13 -    'find_theorems' (('(' (nat)? ('with_dups')? ')')?) (thmcriterion *)
    6.14 +    @@{command find_theorems} ('(' @{syntax nat}? 'with_dups'? ')')? \\ (thmcriterion * )
    6.15      ;
    6.16 -    thmcriterion: ('-'?) ('name' ':' nameref | 'intro' | 'elim' | 'dest' |
    6.17 -      'solves' | 'simp' ':' term | term)
    6.18 +    thmcriterion: ('-'?) ('name' ':' @{syntax nameref} | 'intro' | 'elim' | 'dest' |
    6.19 +      'solves' | 'simp' ':' @{syntax term} | @{syntax term})
    6.20      ;
    6.21 -    'find_consts' (constcriterion *)
    6.22 +    @@{command find_consts} (constcriterion * )
    6.23      ;
    6.24 -    constcriterion: ('-'?) ('name' ':' nameref | 'strict' ':' type | type)
    6.25 +    constcriterion: ('-'?)
    6.26 +      ('name' ':' @{syntax nameref} | 'strict' ':' @{syntax type} | @{syntax type})
    6.27      ;
    6.28 -    'thm_deps' thmrefs
    6.29 +    @@{command thm_deps} @{syntax thmrefs}
    6.30      ;
    6.31 -    'unused_thms' (('name'+) '-' ('name'*))?
    6.32 -    ;
    6.33 -  \end{rail}
    6.34 +    @@{command unused_thms} ((@{syntax name} +) '-' (@{syntax name} * ))?
    6.35 +  "}
    6.36  
    6.37    These commands print certain parts of the theory and proof context.
    6.38    Note that there are some further ones available, such as for the set
    6.39 @@ -152,10 +152,9 @@
    6.40      @{command_def "use_thy"}@{text "\<^sup>*"} & : & @{text "any \<rightarrow>"} \\
    6.41    \end{matharray}
    6.42  
    6.43 -  \begin{rail}
    6.44 -    ('cd' | 'use_thy') name
    6.45 -    ;
    6.46 -  \end{rail}
    6.47 +  @{rail "
    6.48 +    (@@{command cd} | @@{command use_thy}) @{syntax name}
    6.49 +  "}
    6.50  
    6.51    \begin{description}
    6.52  
     7.1 --- a/doc-src/IsarRef/Thy/Outer_Syntax.thy	Sun May 01 18:57:45 2011 +0200
     7.2 +++ b/doc-src/IsarRef/Thy/Outer_Syntax.thy	Mon May 02 01:05:50 2011 +0200
     7.3 @@ -187,24 +187,22 @@
     7.4  
     7.5  subsection {* Names *}
     7.6  
     7.7 -text {*
     7.8 -  Entity \railqtok{name} usually refers to any name of types,
     7.9 +text {* Entity @{syntax name} usually refers to any name of types,
    7.10    constants, theorems etc.\ that are to be \emph{declared} or
    7.11    \emph{defined} (so qualified identifiers are excluded here).  Quoted
    7.12    strings provide an escape for non-identifier names or those ruled
    7.13    out by outer syntax keywords (e.g.\ quoted @{verbatim "\"let\""}).
    7.14 -  Already existing objects are usually referenced by
    7.15 -  \railqtok{nameref}.
    7.16 +  Already existing objects are usually referenced by @{syntax
    7.17 +  nameref}.
    7.18  
    7.19 -  \indexoutertoken{name}\indexoutertoken{parname}\indexoutertoken{nameref}
    7.20 -  \begin{rail}
    7.21 -    name: ident | symident | string | nat
    7.22 +  @{rail "
    7.23 +    @{syntax_def name}: @{syntax ident} | @{syntax symident} |
    7.24 +      @{syntax string} | @{syntax nat}
    7.25      ;
    7.26 -    parname: '(' name ')'
    7.27 +    @{syntax_def parname}: '(' @{syntax name} ')'
    7.28      ;
    7.29 -    nameref: name | longident
    7.30 -    ;
    7.31 -  \end{rail}
    7.32 +    @{syntax_def nameref}: @{syntax name} | @{syntax longident}
    7.33 +  "}
    7.34  *}
    7.35  
    7.36  
    7.37 @@ -214,37 +212,32 @@
    7.38    natural numbers and floating point numbers.  These are combined as
    7.39    @{syntax int} and @{syntax real} as follows.
    7.40  
    7.41 -  \indexoutertoken{int}\indexoutertoken{real}
    7.42 -  \begin{rail}
    7.43 -    int: nat | '-' nat
    7.44 +  @{rail "
    7.45 +    @{syntax_def int}: @{syntax nat} | '-' @{syntax nat}
    7.46      ;
    7.47 -    real: float | int
    7.48 -    ;
    7.49 -  \end{rail}
    7.50 +    @{syntax_def real}: @{syntax float} | @{syntax int}
    7.51 +  "}
    7.52  
    7.53 -  Note that there is an overlap with the category \railqtok{name},
    7.54 +  Note that there is an overlap with the category @{syntax name},
    7.55    which also includes @{syntax nat}.
    7.56  *}
    7.57  
    7.58  
    7.59  subsection {* Comments \label{sec:comments} *}
    7.60  
    7.61 -text {*
    7.62 -  Large chunks of plain \railqtok{text} are usually given
    7.63 -  \railtok{verbatim}, i.e.\ enclosed in @{verbatim "{"}@{verbatim
    7.64 +text {* Large chunks of plain @{syntax text} are usually given
    7.65 +  @{syntax verbatim}, i.e.\ enclosed in @{verbatim "{"}@{verbatim
    7.66    "*"}~@{text "\<dots>"}~@{verbatim "*"}@{verbatim "}"}.  For convenience,
    7.67 -  any of the smaller text units conforming to \railqtok{nameref} are
    7.68 -  admitted as well.  A marginal \railnonterm{comment} is of the form
    7.69 -  @{verbatim "--"} \railqtok{text}.  Any number of these may occur
    7.70 +  any of the smaller text units conforming to @{syntax nameref} are
    7.71 +  admitted as well.  A marginal @{syntax comment} is of the form
    7.72 +  @{verbatim "--"}~@{syntax text}.  Any number of these may occur
    7.73    within Isabelle/Isar commands.
    7.74  
    7.75 -  \indexoutertoken{text}\indexouternonterm{comment}
    7.76 -  \begin{rail}
    7.77 -    text: verbatim | nameref
    7.78 +  @{rail "
    7.79 +    @{syntax_def text}: @{syntax verbatim} | @{syntax nameref}
    7.80      ;
    7.81 -    comment: '--' text
    7.82 -    ;
    7.83 -  \end{rail}
    7.84 +    @{syntax_def comment}: '--' @{syntax text}
    7.85 +  "}
    7.86  *}
    7.87  
    7.88  
    7.89 @@ -257,16 +250,13 @@
    7.90    intersection of these classes.  The syntax of type arities is given
    7.91    directly at the outer level.
    7.92  
    7.93 -  \indexouternonterm{sort}\indexouternonterm{arity}
    7.94 -  \indexouternonterm{classdecl}
    7.95 -  \begin{rail}
    7.96 -    classdecl: name (('<' | subseteq) (nameref + ','))?
    7.97 +  @{rail "
    7.98 +    @{syntax_def classdecl}: @{syntax name} (('<' | '\<subseteq>') (@{syntax nameref} + ','))?
    7.99      ;
   7.100 -    sort: nameref
   7.101 +    @{syntax_def sort}: @{syntax nameref}
   7.102      ;
   7.103 -    arity: ('(' (sort + ',') ')')? sort
   7.104 -    ;
   7.105 -  \end{rail}
   7.106 +    @{syntax_def arity}: ('(' (@{syntax sort} + ',') ')')? @{syntax sort}
   7.107 +  "}
   7.108  *}
   7.109  
   7.110  
   7.111 @@ -286,84 +276,74 @@
   7.112    by commands or other keywords already (such as @{verbatim "="} or
   7.113    @{verbatim "+"}).
   7.114  
   7.115 -  \indexoutertoken{type}\indexoutertoken{term}\indexoutertoken{prop}
   7.116 -  \begin{rail}
   7.117 -    type: nameref | typefree | typevar
   7.118 +  @{rail "
   7.119 +    @{syntax_def type}: @{syntax nameref} | @{syntax typefree} |
   7.120 +      @{syntax typevar}
   7.121      ;
   7.122 -    term: nameref | var
   7.123 +    @{syntax_def term}: @{syntax nameref} | @{syntax var}
   7.124      ;
   7.125 -    prop: term
   7.126 -    ;
   7.127 -  \end{rail}
   7.128 +    @{syntax_def prop}: @{syntax term}
   7.129 +  "}
   7.130  
   7.131    Positional instantiations are indicated by giving a sequence of
   7.132    terms, or the placeholder ``@{text _}'' (underscore), which means to
   7.133    skip a position.
   7.134  
   7.135 -  \indexoutertoken{inst}\indexoutertoken{insts}
   7.136 -  \begin{rail}
   7.137 -    inst: underscore | term
   7.138 +  @{rail "
   7.139 +    @{syntax_def inst}: '_' | @{syntax term}
   7.140      ;
   7.141 -    insts: (inst *)
   7.142 +    @{syntax_def insts}: (@{syntax inst} *)
   7.143 +  "}
   7.144 +
   7.145 +  Type declarations and definitions usually refer to @{syntax
   7.146 +  typespec} on the left-hand side.  This models basic type constructor
   7.147 +  application at the outer syntax level.  Note that only plain postfix
   7.148 +  notation is available here, but no infixes.
   7.149 +
   7.150 +  @{rail "
   7.151 +    @{syntax_def typespec}:
   7.152 +      (() | @{syntax typefree} | '(' ( @{syntax typefree} + ',' ) ')') @{syntax name}
   7.153      ;
   7.154 -  \end{rail}
   7.155 -
   7.156 -  Type declarations and definitions usually refer to
   7.157 -  \railnonterm{typespec} on the left-hand side.  This models basic
   7.158 -  type constructor application at the outer syntax level.  Note that
   7.159 -  only plain postfix notation is available here, but no infixes.
   7.160 -
   7.161 -  \indexouternonterm{typespec}
   7.162 -  \indexouternonterm{typespecsorts}
   7.163 -  \begin{rail}
   7.164 -    typespec: (() | typefree | '(' ( typefree + ',' ) ')') name
   7.165 -    ;
   7.166 -
   7.167 -    typespecsorts: (() | (typefree ('::' sort)?) | '(' ( (typefree ('::' sort)?) + ',' ) ')') name
   7.168 -    ;
   7.169 -  \end{rail}
   7.170 +    @{syntax_def typespecsorts}:
   7.171 +      (() | (@{syntax typefree} ('::' @{syntax sort})?) |
   7.172 +        '(' ( (@{syntax typefree} ('::' @{syntax sort})?) + ',' ) ')') @{syntax name}
   7.173 +  "}
   7.174  *}
   7.175  
   7.176  
   7.177  subsection {* Term patterns and declarations \label{sec:term-decls} *}
   7.178  
   7.179 -text {*
   7.180 -  Wherever explicit propositions (or term fragments) occur in a proof
   7.181 -  text, casual binding of schematic term variables may be given
   7.182 -  specified via patterns of the form ``@{text "(\<IS> p\<^sub>1 \<dots>
   7.183 -  p\<^sub>n)"}''.  This works both for \railqtok{term} and \railqtok{prop}.
   7.184 +text {* Wherever explicit propositions (or term fragments) occur in a
   7.185 +  proof text, casual binding of schematic term variables may be given
   7.186 +  specified via patterns of the form ``@{text "(\<IS> p\<^sub>1 \<dots> p\<^sub>n)"}''.
   7.187 +  This works both for @{syntax term} and @{syntax prop}.
   7.188  
   7.189 -  \indexouternonterm{termpat}\indexouternonterm{proppat}
   7.190 -  \begin{rail}
   7.191 -    termpat: '(' ('is' term +) ')'
   7.192 +  @{rail "
   7.193 +    @{syntax_def termpat}: '(' (@'is' @{syntax term} +) ')'
   7.194      ;
   7.195 -    proppat: '(' ('is' prop +) ')'
   7.196 -    ;
   7.197 -  \end{rail}
   7.198 +    @{syntax_def proppat}: '(' (@'is' @{syntax prop} +) ')'
   7.199 +  "}
   7.200  
   7.201    \medskip Declarations of local variables @{text "x :: \<tau>"} and
   7.202    logical propositions @{text "a : \<phi>"} represent different views on
   7.203    the same principle of introducing a local scope.  In practice, one
   7.204 -  may usually omit the typing of \railnonterm{vars} (due to
   7.205 +  may usually omit the typing of @{syntax vars} (due to
   7.206    type-inference), and the naming of propositions (due to implicit
   7.207    references of current facts).  In any case, Isar proof elements
   7.208    usually admit to introduce multiple such items simultaneously.
   7.209  
   7.210 -  \indexouternonterm{vars}\indexouternonterm{props}
   7.211 -  \begin{rail}
   7.212 -    vars: (name+) ('::' type)?
   7.213 +  @{rail "
   7.214 +    @{syntax_def vars}: (@{syntax name} +) ('::' @{syntax type})?
   7.215      ;
   7.216 -    props: thmdecl? (prop proppat? +)
   7.217 -    ;
   7.218 -  \end{rail}
   7.219 +    @{syntax_def props}: @{syntax thmdecl}? (@{syntax prop} @{syntax proppat}? +)
   7.220 +  "}
   7.221  
   7.222    The treatment of multiple declarations corresponds to the
   7.223 -  complementary focus of \railnonterm{vars} versus
   7.224 -  \railnonterm{props}.  In ``@{text "x\<^sub>1 \<dots> x\<^sub>n :: \<tau>"}''
   7.225 -  the typing refers to all variables, while in @{text "a: \<phi>\<^sub>1 \<dots>
   7.226 -  \<phi>\<^sub>n"} the naming refers to all propositions collectively.
   7.227 -  Isar language elements that refer to \railnonterm{vars} or
   7.228 -  \railnonterm{props} typically admit separate typings or namings via
   7.229 +  complementary focus of @{syntax vars} versus @{syntax props}.  In
   7.230 +  ``@{text "x\<^sub>1 \<dots> x\<^sub>n :: \<tau>"}'' the typing refers to all variables, while
   7.231 +  in @{text "a: \<phi>\<^sub>1 \<dots> \<phi>\<^sub>n"} the naming refers to all propositions
   7.232 +  collectively.  Isar language elements that refer to @{syntax vars}
   7.233 +  or @{syntax props} typically admit separate typings or namings via
   7.234    another level of iteration, with explicit @{keyword_ref "and"}
   7.235    separators; e.g.\ see @{command "fix"} and @{command "assume"} in
   7.236    \secref{sec:proof-context}.
   7.237 @@ -373,31 +353,30 @@
   7.238  subsection {* Attributes and theorems \label{sec:syn-att} *}
   7.239  
   7.240  text {* Attributes have their own ``semi-inner'' syntax, in the sense
   7.241 -  that input conforming to \railnonterm{args} below is parsed by the
   7.242 +  that input conforming to @{syntax args} below is parsed by the
   7.243    attribute a second time.  The attribute argument specifications may
   7.244    be any sequence of atomic entities (identifiers, strings etc.), or
   7.245 -  properly bracketed argument lists.  Below \railqtok{atom} refers to
   7.246 -  any atomic entity, including any \railtok{keyword} conforming to
   7.247 -  \railtok{symident}.
   7.248 +  properly bracketed argument lists.  Below @{syntax atom} refers to
   7.249 +  any atomic entity, including any @{syntax keyword} conforming to
   7.250 +  @{syntax symident}.
   7.251  
   7.252 -  \indexoutertoken{atom}\indexouternonterm{args}\indexouternonterm{attributes}
   7.253 -  \begin{rail}
   7.254 -    atom: nameref | typefree | typevar | var | nat | float | keyword
   7.255 +  @{rail "
   7.256 +    @{syntax_def atom}: @{syntax nameref} | @{syntax typefree} |
   7.257 +      @{syntax typevar} | @{syntax var} | @{syntax nat} | @{syntax float} |
   7.258 +      @{syntax keyword}
   7.259      ;
   7.260 -    arg: atom | '(' args ')' | '[' args ']'
   7.261 +    arg: @{syntax atom} | '(' @{syntax args} ')' | '[' @{syntax args} ']'
   7.262      ;
   7.263 -    args: arg *
   7.264 +    @{syntax_def args}: arg *
   7.265      ;
   7.266 -    attributes: '[' (nameref args * ',') ']'
   7.267 -    ;
   7.268 -  \end{rail}
   7.269 +    @{syntax_def attributes}: '[' (@{syntax nameref} @{syntax args} * ',') ']'
   7.270 +  "}
   7.271  
   7.272 -  Theorem specifications come in several flavors:
   7.273 -  \railnonterm{axmdecl} and \railnonterm{thmdecl} usually refer to
   7.274 -  axioms, assumptions or results of goal statements, while
   7.275 -  \railnonterm{thmdef} collects lists of existing theorems.  Existing
   7.276 -  theorems are given by \railnonterm{thmref} and
   7.277 -  \railnonterm{thmrefs}, the former requires an actual singleton
   7.278 +  Theorem specifications come in several flavors: @{syntax axmdecl}
   7.279 +  and @{syntax thmdecl} usually refer to axioms, assumptions or
   7.280 +  results of goal statements, while @{syntax thmdef} collects lists of
   7.281 +  existing theorems.  Existing theorems are given by @{syntax thmref}
   7.282 +  and @{syntax thmrefs}, the former requires an actual singleton
   7.283    result.
   7.284  
   7.285    There are three forms of theorem references:
   7.286 @@ -426,26 +405,24 @@
   7.287    This form of in-place declarations is particularly useful with
   7.288    commands like @{command "declare"} and @{command "using"}.
   7.289  
   7.290 -  \indexouternonterm{axmdecl}\indexouternonterm{thmdecl}
   7.291 -  \indexouternonterm{thmdef}\indexouternonterm{thmref}
   7.292 -  \indexouternonterm{thmrefs}\indexouternonterm{selection}
   7.293 -  \begin{rail}
   7.294 -    axmdecl: name attributes? ':'
   7.295 +  @{rail "
   7.296 +    @{syntax_def axmdecl}: @{syntax name} @{syntax attributes}? ':'
   7.297      ;
   7.298 -    thmdecl: thmbind ':'
   7.299 +    @{syntax_def thmdecl}: thmbind ':'
   7.300      ;
   7.301 -    thmdef: thmbind '='
   7.302 +    @{syntax_def thmdef}: thmbind '='
   7.303      ;
   7.304 -    thmref: (nameref selection? | altstring) attributes? | '[' attributes ']'
   7.305 +    @{syntax_def thmref}:
   7.306 +      (@{syntax nameref} selection? | @{syntax altstring}) @{syntax attributes}? |
   7.307 +      '[' @{syntax attributes} ']'
   7.308      ;
   7.309 -    thmrefs: thmref +
   7.310 +    @{syntax_def thmrefs}: @{syntax thmref} +
   7.311      ;
   7.312  
   7.313 -    thmbind: name attributes | name | attributes
   7.314 +    thmbind: @{syntax name} @{syntax attributes} | @{syntax name} | @{syntax attributes}
   7.315      ;
   7.316 -    selection: '(' ((nat | nat '-' nat?) + ',') ')'
   7.317 -    ;
   7.318 -  \end{rail}
   7.319 +    selection: '(' ((@{syntax nat} | @{syntax nat} '-' @{syntax nat}?) + ',') ')'
   7.320 +  "}
   7.321  *}
   7.322  
   7.323  end
     8.1 --- a/doc-src/IsarRef/Thy/Proof.thy	Sun May 01 18:57:45 2011 +0200
     8.2 +++ b/doc-src/IsarRef/Thy/Proof.thy	Mon May 02 01:05:50 2011 +0200
     8.3 @@ -53,12 +53,11 @@
     8.4      @{command_def "notepad"} & : & @{text "local_theory \<rightarrow> proof(state)"} \\
     8.5    \end{matharray}
     8.6  
     8.7 -  \begin{rail}
     8.8 -    'notepad' 'begin'
     8.9 +  @{rail "
    8.10 +    @@{command notepad} @'begin'
    8.11      ;
    8.12 -    'end'
    8.13 -    ;
    8.14 -  \end{rail}
    8.15 +    @@{command end}
    8.16 +  "}
    8.17  
    8.18    \begin{description}
    8.19  
    8.20 @@ -188,16 +187,15 @@
    8.21    exporting some result @{text "x \<equiv> t \<turnstile> \<phi>[x]"} yields @{text "\<turnstile>
    8.22    \<phi>[t]"}.
    8.23  
    8.24 -  \begin{rail}
    8.25 -    'fix' (vars + 'and')
    8.26 +  @{rail "
    8.27 +    @@{command fix} (@{syntax vars} + @'and')
    8.28      ;
    8.29 -    ('assume' | 'presume') (props + 'and')
    8.30 +    (@@{command assume} | @@{command presume}) (@{syntax props} + @'and')
    8.31      ;
    8.32 -    'def' (def + 'and')
    8.33 +    @@{command def} (def + @'and')
    8.34      ;
    8.35 -    def: thmdecl? \\ name ('==' | equiv) term termpat?
    8.36 -    ;
    8.37 -  \end{rail}
    8.38 +    def: @{syntax thmdecl}? \\ @{syntax name} ('==' | '\<equiv>') @{syntax term} @{syntax termpat}?
    8.39 +  "}
    8.40  
    8.41    \begin{description}
    8.42    
    8.43 @@ -267,13 +265,12 @@
    8.44    input process just after type checking.  Also note that @{command
    8.45    "def"} does not support polymorphism.
    8.46  
    8.47 -  \begin{rail}
    8.48 -    'let' ((term + 'and') '=' term + 'and')
    8.49 -    ;  
    8.50 -  \end{rail}
    8.51 +  @{rail "
    8.52 +    @@{command let} ((@{syntax term} + @'and') '=' @{syntax term} + @'and')
    8.53 +  "}
    8.54  
    8.55 -  The syntax of @{keyword "is"} patterns follows \railnonterm{termpat}
    8.56 -  or \railnonterm{proppat} (see \secref{sec:term-decls}).
    8.57 +  The syntax of @{keyword "is"} patterns follows @{syntax termpat} or
    8.58 +  @{syntax proppat} (see \secref{sec:term-decls}).
    8.59  
    8.60    \begin{description}
    8.61  
    8.62 @@ -324,12 +321,12 @@
    8.63    to the most recently established facts, but only \emph{before}
    8.64    issuing a follow-up claim.
    8.65  
    8.66 -  \begin{rail}
    8.67 -    'note' (thmdef? thmrefs + 'and')
    8.68 +  @{rail "
    8.69 +    @@{command note} (@{syntax thmdef}? @{syntax thmrefs} + @'and')
    8.70      ;
    8.71 -    ('from' | 'with' | 'using' | 'unfolding') (thmrefs + 'and')
    8.72 -    ;
    8.73 -  \end{rail}
    8.74 +    (@@{command from} | @@{command with} | @@{command using} | @@{command unfolding})
    8.75 +      (@{syntax thmrefs} + @'and')
    8.76 +  "}
    8.77  
    8.78    \begin{description}
    8.79  
    8.80 @@ -435,33 +432,33 @@
    8.81    contexts of (essentially a big disjunction of eliminated parameters
    8.82    and assumptions, cf.\ \secref{sec:obtain}).
    8.83  
    8.84 -  \begin{rail}
    8.85 -    ('lemma' | 'theorem' | 'corollary' |
    8.86 -     'schematic_lemma' | 'schematic_theorem' | 'schematic_corollary') target? (goal | longgoal)
    8.87 +  @{rail "
    8.88 +    (@@{command lemma} | @@{command theorem} | @@{command corollary} |
    8.89 +     @@{command schematic_lemma} | @@{command schematic_theorem} |
    8.90 +     @@{command schematic_corollary}) @{syntax target}? (goal | longgoal)
    8.91      ;
    8.92 -    ('have' | 'show' | 'hence' | 'thus') goal
    8.93 +    (@@{command have} | @@{command show} | @@{command hence} | @@{command thus}) goal
    8.94      ;
    8.95 -    'print_statement' modes? thmrefs
    8.96 +    @@{command print_statement} @{syntax modes}? @{syntax thmrefs}
    8.97      ;
    8.98    
    8.99 -    goal: (props + 'and')
   8.100 +    goal: (@{syntax props} + @'and')
   8.101      ;
   8.102 -    longgoal: thmdecl? (contextelem *) conclusion
   8.103 +    longgoal: @{syntax thmdecl}? (@{syntax contextelem} * ) conclusion
   8.104      ;
   8.105 -    conclusion: 'shows' goal | 'obtains' (parname? case + '|')
   8.106 +    conclusion: @'shows' goal | @'obtains' (@{syntax parname}? case + '|')
   8.107      ;
   8.108 -    case: (vars + 'and') 'where' (props + 'and')
   8.109 -    ;
   8.110 -  \end{rail}
   8.111 +    case: (@{syntax vars} + @'and') @'where' (@{syntax props} + @'and')
   8.112 +  "}
   8.113  
   8.114    \begin{description}
   8.115    
   8.116    \item @{command "lemma"}~@{text "a: \<phi>"} enters proof mode with
   8.117    @{text \<phi>} as main goal, eventually resulting in some fact @{text "\<turnstile>
   8.118 -  \<phi>"} to be put back into the target context.  An additional
   8.119 -  \railnonterm{context} specification may build up an initial proof
   8.120 -  context for the subsequent claim; this includes local definitions
   8.121 -  and syntax as well, see the definition of @{syntax contextelem} in
   8.122 +  \<phi>"} to be put back into the target context.  An additional @{syntax
   8.123 +  context} specification may build up an initial proof context for the
   8.124 +  subsequent claim; this includes local definitions and syntax as
   8.125 +  well, see the definition of @{syntax contextelem} in
   8.126    \secref{sec:locale}.
   8.127    
   8.128    \item @{command "theorem"}~@{text "a: \<phi>"} and @{command
   8.129 @@ -537,25 +534,22 @@
   8.130  
   8.131  subsection {* Proof method expressions \label{sec:proof-meth} *}
   8.132  
   8.133 -text {*
   8.134 -  Proof methods are either basic ones, or expressions composed of
   8.135 -  methods via ``@{verbatim ","}'' (sequential composition),
   8.136 -  ``@{verbatim "|"}'' (alternative choices), ``@{verbatim "?"}'' 
   8.137 +text {* Proof methods are either basic ones, or expressions composed
   8.138 +  of methods via ``@{verbatim ","}'' (sequential composition),
   8.139 +  ``@{verbatim "|"}'' (alternative choices), ``@{verbatim "?"}''
   8.140    (try), ``@{verbatim "+"}'' (repeat at least once), ``@{verbatim
   8.141    "["}@{text n}@{verbatim "]"}'' (restriction to first @{text n}
   8.142    sub-goals, with default @{text "n = 1"}).  In practice, proof
   8.143 -  methods are usually just a comma separated list of
   8.144 -  \railqtok{nameref}~\railnonterm{args} specifications.  Note that
   8.145 -  parentheses may be dropped for single method specifications (with no
   8.146 -  arguments).
   8.147 +  methods are usually just a comma separated list of @{syntax
   8.148 +  nameref}~@{syntax args} specifications.  Note that parentheses may
   8.149 +  be dropped for single method specifications (with no arguments).
   8.150  
   8.151 -  \indexouternonterm{method}
   8.152 -  \begin{rail}
   8.153 -    method: (nameref | '(' methods ')') (() | '?' | '+' | '[' nat? ']')
   8.154 +  @{rail "
   8.155 +    @{syntax_def method}:
   8.156 +      (@{syntax nameref} | '(' methods ')') (() | '?' | '+' | '[' @{syntax nat}? ']')
   8.157      ;
   8.158 -    methods: (nameref args | method) + (',' | '|')
   8.159 -    ;
   8.160 -  \end{rail}
   8.161 +    methods: (@{syntax nameref} @{syntax args} | @{syntax method}) + (',' | '|')
   8.162 +  "}
   8.163  
   8.164    Proper Isar proof methods do \emph{not} admit arbitrary goal
   8.165    addressing, but refer either to the first sub-goal or all sub-goals
   8.166 @@ -573,11 +567,10 @@
   8.167    all goals, and ``@{text "[n-]"}'' to all goals starting from @{text
   8.168    "n"}.
   8.169  
   8.170 -  \indexouternonterm{goalspec}
   8.171 -  \begin{rail}
   8.172 -    goalspec: '[' (nat '-' nat | nat '-' | nat | '!' ) ']'
   8.173 -    ;
   8.174 -  \end{rail}
   8.175 +  @{rail "
   8.176 +    @{syntax_def goalspec}:
   8.177 +      '[' (@{syntax nat} '-' @{syntax nat} | @{syntax nat} '-' | @{syntax nat} | '!' ) ']'
   8.178 +  "}
   8.179  *}
   8.180  
   8.181  
   8.182 @@ -630,16 +623,15 @@
   8.183    There is no separate default terminal method.  Any remaining goals
   8.184    are always solved by assumption in the very last step.
   8.185  
   8.186 -  \begin{rail}
   8.187 -    'proof' method?
   8.188 +  @{rail "
   8.189 +    @@{command proof} method?
   8.190      ;
   8.191 -    'qed' method?
   8.192 +    @@{command qed} method?
   8.193      ;
   8.194 -    'by' method method?
   8.195 +    @@{command \"by\"} method method?
   8.196      ;
   8.197 -    ('.' | '..' | 'sorry')
   8.198 -    ;
   8.199 -  \end{rail}
   8.200 +    (@@{command \".\"} | @@{command \"..\"} | @@{command sorry})
   8.201 +  "}
   8.202  
   8.203    \begin{description}
   8.204    
   8.205 @@ -715,24 +707,27 @@
   8.206      @{attribute_def "where"} & : & @{text attribute} \\
   8.207    \end{matharray}
   8.208  
   8.209 -  \begin{rail}
   8.210 -    'fact' thmrefs?
   8.211 +  @{rail "
   8.212 +    @@{method fact} @{syntax thmrefs}?
   8.213      ;
   8.214 -    'rule' thmrefs?
   8.215 +    @@{method rule} @{syntax thmrefs}?
   8.216      ;
   8.217 -    rulemod: ('intro' | 'elim' | 'dest') ((('!' | () | '?') nat?) | 'del') ':' thmrefs
   8.218 +    rulemod: ('intro' | 'elim' | 'dest')
   8.219 +      ((('!' | () | '?') @{syntax nat}?) | 'del') ':' @{syntax thmrefs}
   8.220      ;
   8.221 -    ('intro' | 'elim' | 'dest') ('!' | () | '?') nat?
   8.222 +    (@@{attribute intro} | @@{attribute elim} | @@{attribute dest})
   8.223 +      ('!' | () | '?') @{syntax nat}?
   8.224      ;
   8.225 -    'rule' 'del'
   8.226 +    @@{attribute rule} 'del'
   8.227      ;
   8.228 -    'OF' thmrefs
   8.229 +    @@{attribute OF} @{syntax thmrefs}
   8.230      ;
   8.231 -    'of' insts ('concl' ':' insts)?
   8.232 +    @@{attribute of} @{syntax insts} ('concl' ':' @{syntax insts})?
   8.233      ;
   8.234 -    'where' ((name | var | typefree | typevar) '=' (type | term) * 'and')
   8.235 -    ;
   8.236 -  \end{rail}
   8.237 +    @@{attribute \"where\"}
   8.238 +      ((@{syntax name} | @{syntax var} | @{syntax typefree} | @{syntax typevar}) '='
   8.239 +      (@{syntax type} | @{syntax term}) * @'and')
   8.240 +  "}
   8.241  
   8.242    \begin{description}
   8.243    
   8.244 @@ -838,14 +833,13 @@
   8.245      @{command_def "back"}@{text "\<^sup>*"} & : & @{text "proof \<rightarrow> proof"} \\
   8.246    \end{matharray}
   8.247  
   8.248 -  \begin{rail}
   8.249 -    ( 'apply' | 'apply_end' ) method
   8.250 +  @{rail "
   8.251 +    ( @@{command apply} | @@{command apply_end} ) @{syntax method}
   8.252      ;
   8.253 -    'defer' nat?
   8.254 +    @@{command defer} @{syntax nat}?
   8.255      ;
   8.256 -    'prefer' nat
   8.257 -    ;
   8.258 -  \end{rail}
   8.259 +    @@{command prefer} @{syntax nat}
   8.260 +  "}
   8.261  
   8.262    \begin{description}
   8.263  
   8.264 @@ -900,10 +894,10 @@
   8.265      @{command_def "method_setup"} & : & @{text "theory \<rightarrow> theory"} \\
   8.266    \end{matharray}
   8.267  
   8.268 -  \begin{rail}
   8.269 -    'method_setup' name '=' text text
   8.270 +  @{rail "
   8.271 +    @@{command method_setup} @{syntax name} '=' @{syntax text} @{syntax text}
   8.272      ;
   8.273 -  \end{rail}
   8.274 +  "}
   8.275  
   8.276    \begin{description}
   8.277  
   8.278 @@ -956,12 +950,12 @@
   8.279    later, provided that the corresponding parameters do \emph{not}
   8.280    occur in the conclusion.
   8.281  
   8.282 -  \begin{rail}
   8.283 -    'obtain' parname? (vars + 'and') 'where' (props + 'and')
   8.284 +  @{rail "
   8.285 +    @@{command obtain} @{syntax parname}? (@{syntax vars} + @'and')
   8.286 +      @'where' (@{syntax props} + @'and')
   8.287      ;
   8.288 -    'guess' (vars + 'and')
   8.289 -    ;
   8.290 -  \end{rail}
   8.291 +    @@{command guess} (@{syntax vars} + @'and')
   8.292 +  "}
   8.293  
   8.294    The derived Isar command @{command "obtain"} is defined as follows
   8.295    (where @{text "b\<^sub>1, \<dots>, b\<^sub>k"} shall refer to (optional)
   8.296 @@ -1071,12 +1065,11 @@
   8.297      @{command "ultimately"} & \equiv & @{command "moreover"}~@{command "from"}~@{text calculation} \\
   8.298    \end{matharray}
   8.299  
   8.300 -  \begin{rail}
   8.301 -    ('also' | 'finally') ('(' thmrefs ')')?
   8.302 +  @{rail "
   8.303 +    (@@{command also} | @@{command finally}) ('(' @{syntax thmrefs} ')')?
   8.304      ;
   8.305 -    'trans' (() | 'add' | 'del')
   8.306 -    ;
   8.307 -  \end{rail}
   8.308 +    @@{attribute trans} (() | 'add' | 'del')
   8.309 +  "}
   8.310  
   8.311    \begin{description}
   8.312  
   8.313 @@ -1189,21 +1182,20 @@
   8.314    derived manually become ready to use in advanced case analysis
   8.315    later.
   8.316  
   8.317 -  \begin{rail}
   8.318 -    'case' (caseref | '(' caseref ((name | underscore) +) ')')
   8.319 +  @{rail "
   8.320 +    @@{command case} (caseref | '(' caseref (('_' | @{syntax name}) +) ')')
   8.321      ;
   8.322      caseref: nameref attributes?
   8.323      ;
   8.324  
   8.325 -    'case_names' (name +)
   8.326 +    @@{attribute case_names} (@{syntax name} +)
   8.327      ;
   8.328 -    'case_conclusion' name (name *)
   8.329 +    @@{attribute case_conclusion} @{syntax name} (@{syntax name} * )
   8.330      ;
   8.331 -    'params' ((name *) + 'and')
   8.332 +    @@{attribute params} ((@{syntax name} * ) + @'and')
   8.333      ;
   8.334 -    'consumes' nat?
   8.335 -    ;
   8.336 -  \end{rail}
   8.337 +    @@{attribute consumes} @{syntax nat}?
   8.338 +  "}
   8.339  
   8.340    \begin{description}
   8.341    
   8.342 @@ -1281,25 +1273,24 @@
   8.343    and parameters separately).  This avoids cumbersome encoding of
   8.344    ``strengthened'' inductive statements within the object-logic.
   8.345  
   8.346 -  \begin{rail}
   8.347 -    'cases' '(no_simp)'? (insts * 'and') rule?
   8.348 +  @{rail "
   8.349 +    @@{method cases} ('(' 'no_simp' ')')? (@{syntax insts} * @'and') rule?
   8.350      ;
   8.351 -    'induct' '(no_simp)'? (definsts * 'and') \\ arbitrary? taking? rule?
   8.352 +    @@{method induct} ('(' 'no_simp' ')')? (definsts * @'and') \\ arbitrary? taking? rule?
   8.353      ;
   8.354 -    'coinduct' insts taking rule?
   8.355 +    @@{method coinduct} insts taking rule?
   8.356      ;
   8.357  
   8.358 -    rule: ('type' | 'pred' | 'set') ':' (nameref +) | 'rule' ':' (thmref +)
   8.359 +    rule: ('type' | 'pred' | 'set') ':' (@{syntax nameref} +) | 'rule' ':' (@{syntax thmref} +)
   8.360      ;
   8.361 -    definst: name ('==' | equiv) term | '(' term ')' | inst
   8.362 +    definst: @{syntax name} ('==' | '\<equiv>') @{syntax term} | '(' @{syntax term} ')' | @{syntax inst}
   8.363      ;
   8.364 -    definsts: ( definst *)
   8.365 +    definsts: ( definst * )
   8.366      ;
   8.367 -    arbitrary: 'arbitrary' ':' ((term *) 'and' +)
   8.368 +    arbitrary: 'arbitrary' ':' ((@{syntax term} * ) @'and' +)
   8.369      ;
   8.370      taking: 'taking' ':' insts
   8.371 -    ;
   8.372 -  \end{rail}
   8.373 +  "}
   8.374  
   8.375    \begin{description}
   8.376  
   8.377 @@ -1467,23 +1458,22 @@
   8.378      @{attribute_def coinduct} & : & @{text attribute} \\
   8.379    \end{matharray}
   8.380  
   8.381 -  \begin{rail}
   8.382 -    'cases' spec
   8.383 +  @{rail "
   8.384 +    @@{attribute cases} spec
   8.385      ;
   8.386 -    'induct' spec
   8.387 +    @@{attribute induct} spec
   8.388      ;
   8.389 -    'coinduct' spec
   8.390 +    @@{attribute coinduct} spec
   8.391      ;
   8.392  
   8.393 -    spec: (('type' | 'pred' | 'set') ':' nameref) | 'del'
   8.394 -    ;
   8.395 -  \end{rail}
   8.396 +    spec: (('type' | 'pred' | 'set') ':' @{syntax nameref}) | 'del'
   8.397 +  "}
   8.398  
   8.399    \begin{description}
   8.400  
   8.401    \item @{command "print_induct_rules"} prints cases and induct rules
   8.402    for predicates (or sets) and types of the current context.
   8.403 -  
   8.404 +
   8.405    \item @{attribute cases}, @{attribute induct}, and @{attribute
   8.406    coinduct} (as attributes) declare rules for reasoning about
   8.407    (co)inductive predicates (or sets) and types, using the
     9.1 --- a/doc-src/IsarRef/Thy/Spec.thy	Sun May 01 18:57:45 2011 +0200
     9.2 +++ b/doc-src/IsarRef/Thy/Spec.thy	Mon May 02 01:05:50 2011 +0200
     9.3 @@ -50,12 +50,12 @@
     9.4    although some user-interfaces might pretend that trailing input is
     9.5    admissible.
     9.6  
     9.7 -  \begin{rail}
     9.8 -    'theory' name 'imports' (name +) uses? 'begin'
     9.9 +  @{rail "
    9.10 +    @@{command theory} @{syntax name} @'imports' (@{syntax name} +) uses? @'begin'
    9.11      ;
    9.12  
    9.13 -    uses: 'uses' ((name | parname) +);
    9.14 -  \end{rail}
    9.15 +    uses: @'uses' ((@{syntax name} | @{syntax parname}) +)
    9.16 +  "}
    9.17  
    9.18    \begin{description}
    9.19  
    9.20 @@ -102,14 +102,12 @@
    9.21      @{command_def (local) "end"} & : & @{text "local_theory \<rightarrow> theory"} \\
    9.22    \end{matharray}
    9.23  
    9.24 -  \indexouternonterm{target}
    9.25 -  \begin{rail}
    9.26 -    'context' name 'begin'
    9.27 +  @{rail "
    9.28 +    @@{command context} @{syntax name} @'begin'
    9.29      ;
    9.30  
    9.31 -    target: '(' 'in' name ')'
    9.32 -    ;
    9.33 -  \end{rail}
    9.34 +    @{syntax_def target}: '(' @'in' @{syntax name} ')'
    9.35 +  "}
    9.36  
    9.37    \begin{description}
    9.38    
    9.39 @@ -172,21 +170,23 @@
    9.40    \secref{sec:axms-thms}).  In particular, type-inference is commonly
    9.41    available, and result names need not be given.
    9.42  
    9.43 -  \begin{rail}
    9.44 -    'axiomatization' target? fixes? ('where' specs)?
    9.45 +  @{rail "
    9.46 +    @@{command axiomatization} @{syntax target}? @{syntax \"fixes\"}? (@'where' specs)?
    9.47      ;
    9.48 -    'definition' target? (decl 'where')? thmdecl? prop
    9.49 +    @@{command definition} @{syntax target}? (decl @'where')?
    9.50 +      @{syntax thmdecl}? @{syntax prop}
    9.51      ;
    9.52 -    'abbreviation' target? mode? (decl 'where')? prop
    9.53 +    @@{command abbreviation} @{syntax target}? @{syntax mode}?
    9.54 +      (decl @'where')? @{syntax prop}
    9.55      ;
    9.56  
    9.57 -    fixes: ((name ('::' type)? mixfix? | vars) + 'and')
    9.58 +    @{syntax_def \"fixes\"}: ((@{syntax name} ('::' @{syntax type})?
    9.59 +      @{syntax mixfix}? | @{syntax vars}) + @'and')
    9.60      ;
    9.61 -    specs: (thmdecl? props + 'and')
    9.62 +    specs: (@{syntax thmdecl}? @{syntax props} + @'and')
    9.63      ;
    9.64 -    decl: name ('::' type)? mixfix?
    9.65 -    ;
    9.66 -  \end{rail}
    9.67 +    decl: @{syntax name} ('::' @{syntax type})? @{syntax mixfix}?
    9.68 +  "}
    9.69  
    9.70    \begin{description}
    9.71    
    9.72 @@ -257,12 +257,12 @@
    9.73      @{command_def "declare"} & : & @{text "local_theory \<rightarrow> local_theory"} \\
    9.74    \end{matharray}
    9.75  
    9.76 -  \begin{rail}
    9.77 -    ('declaration' | 'syntax_declaration') ('(pervasive)')? target? text
    9.78 +  @{rail "
    9.79 +    (@@{command declaration} | @@{command syntax_declaration})
    9.80 +      ('(' @'pervasive' ')')? @{syntax target}? @{syntax text}
    9.81      ;
    9.82 -    'declare' target? (thmrefs + 'and')
    9.83 -    ;
    9.84 -  \end{rail}
    9.85 +    @@{command declare} @{syntax target}? (@{syntax thmrefs} + @'and')
    9.86 +  "}
    9.87  
    9.88    \begin{description}
    9.89  
    9.90 @@ -310,19 +310,17 @@
    9.91    elements from equal instances are never repeated, thus avoiding
    9.92    duplicate declarations.
    9.93  
    9.94 -  \indexouternonterm{localeexpr}
    9.95 -  \begin{rail}
    9.96 -    localeexpr: (instance + '+') ('for' (fixes + 'and'))?
    9.97 +  @{rail "
    9.98 +    @{syntax_def localeexpr}: (instance + '+') (@'for' (@{syntax \"fixes\"} + @'and'))?
    9.99      ;
   9.100 -    instance: (qualifier ':')? nameref (posinsts | namedinsts)
   9.101 +    instance: (qualifier ':')? @{syntax nameref} (posinsts | namedinsts)
   9.102      ;
   9.103 -    qualifier: name ('?' | '!')?
   9.104 +    qualifier: @{syntax name} ('?' | '!')?
   9.105      ;
   9.106 -    posinsts: (term | '_')*
   9.107 +    posinsts: ('_' | @{syntax term})*
   9.108      ;
   9.109 -    namedinsts: 'where' (name '=' term + 'and')
   9.110 -    ;
   9.111 -  \end{rail}
   9.112 +    namedinsts: @'where' (@{syntax name} '=' @{syntax term} + @'and')
   9.113 +  "}
   9.114  
   9.115    A locale instance consists of a reference to a locale and either
   9.116    positional or named parameter instantiations.  Identical
   9.117 @@ -359,24 +357,23 @@
   9.118      @{method_def unfold_locales} & : & @{text method} \\
   9.119    \end{matharray}
   9.120  
   9.121 -  \indexouternonterm{contextelem}
   9.122    \indexisarelem{fixes}\indexisarelem{constrains}\indexisarelem{assumes}
   9.123    \indexisarelem{defines}\indexisarelem{notes}
   9.124 -  \begin{rail}
   9.125 -    'locale' name ('=' locale)? 'begin'?
   9.126 +  @{rail "
   9.127 +    @@{command locale} @{syntax name} ('=' @{syntax locale})? @'begin'?
   9.128      ;
   9.129 -    'print_locale' '!'? nameref
   9.130 +    @@{command print_locale} '!'? @{syntax nameref}
   9.131      ;
   9.132 -    locale: contextelem+ | localeexpr ('+' (contextelem+))?
   9.133 +    @{syntax_def locale}: @{syntax contextelem}+ |
   9.134 +      @{syntax localeexpr} ('+' (@{syntax contextelem}+))?
   9.135      ;
   9.136 -    contextelem:
   9.137 -    'fixes' (fixes + 'and')
   9.138 -    | 'constrains' (name '::' type + 'and')
   9.139 -    | 'assumes' (props + 'and')
   9.140 -    | 'defines' (thmdecl? prop proppat? + 'and')
   9.141 -    | 'notes' (thmdef? thmrefs + 'and')
   9.142 -    ;
   9.143 -  \end{rail}
   9.144 +    @{syntax_def contextelem}:
   9.145 +      @'fixes' (@{syntax \"fixes\"} + @'and') |
   9.146 +      @'constrains' (@{syntax name} '::' @{syntax type} + @'and') |
   9.147 +      @'assumes' (@{syntax props} + @'and') |
   9.148 +      @'defines' (@{syntax thmdecl}? @{syntax prop} @{syntax proppat}? + @'and') |
   9.149 +      @'notes' (@{syntax thmdef}? @{syntax thmrefs} + @'and')
   9.150 +  "}
   9.151  
   9.152    \begin{description}
   9.153    
   9.154 @@ -501,21 +498,20 @@
   9.155      @{command_def "print_interps"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
   9.156    \end{matharray}
   9.157  
   9.158 -  \indexouternonterm{interp}
   9.159 -  \begin{rail}
   9.160 -    'interpretation' localeexpr equations?
   9.161 +  @{rail "
   9.162 +    @@{command interpretation} @{syntax localeexpr} equations?
   9.163      ;
   9.164 -    'interpret' localeexpr equations?
   9.165 +    @@{command interpret} @{syntax localeexpr} equations?
   9.166      ;
   9.167 -    'sublocale' nameref ('<' | subseteq) localeexpr equations?
   9.168 +    @@{command sublocale} @{syntax nameref} ('<' | '\<subseteq>') @{syntax localeexpr} equations?
   9.169      ;
   9.170 -    'print_dependencies' '!'? localeexpr
   9.171 +    @@{command print_dependencies} '!'? @{syntax localeexpr}
   9.172      ;
   9.173 -    'print_interps' nameref
   9.174 +    @@{command print_interps} @{syntax nameref}
   9.175      ;
   9.176 -    equations: 'where' (thmdecl? prop + 'and')
   9.177 -    ;
   9.178 -  \end{rail}
   9.179 +
   9.180 +    equations: @'where' (@{syntax thmdecl}? @{syntax prop} + @'and')
   9.181 +  "}
   9.182  
   9.183    \begin{description}
   9.184  
   9.185 @@ -642,28 +638,29 @@
   9.186      @{method_def intro_classes} & : & @{text method} \\
   9.187    \end{matharray}
   9.188  
   9.189 -  \begin{rail}
   9.190 -    'class' name '=' ((superclassexpr '+' (contextelem+)) | superclassexpr | (contextelem+)) \\
   9.191 -      'begin'?
   9.192 +  @{rail "
   9.193 +    @@{command class} @{syntax name} '='
   9.194 +      ((superclassexpr '+' (@{syntax contextelem}+)) |
   9.195 +        superclassexpr | (@{syntax contextelem}+)) \\
   9.196 +      @'begin'?
   9.197      ;
   9.198 -    'instantiation' (nameref + 'and') '::' arity 'begin'
   9.199 +    @@{command instantiation} (@{syntax nameref} + @'and') '::' @{syntax arity} @'begin'
   9.200      ;
   9.201 -    'instance'
   9.202 +    @@{command instance}
   9.203      ;
   9.204 -    'instance' (nameref + 'and') '::' arity
   9.205 +    @@{command instance} (@{syntax nameref} + @'and') '::' @{syntax arity}
   9.206      ;
   9.207 -    'subclass' target? nameref
   9.208 +    @@{command subclass} @{syntax target}? @{syntax nameref}
   9.209      ;
   9.210 -    'instance' nameref ('<' | subseteq) nameref
   9.211 +    @@{command instance} @{syntax nameref} ('<' | '\<subseteq>') @{syntax nameref}
   9.212      ;
   9.213 -    'print_classes'
   9.214 +    @@{command print_classes}
   9.215      ;
   9.216 -    'class_deps'
   9.217 +    @@{command class_deps}
   9.218      ;
   9.219  
   9.220 -    superclassexpr: nameref | (nameref '+' superclassexpr)
   9.221 -    ;
   9.222 -  \end{rail}
   9.223 +    superclassexpr: @{syntax nameref} | (@{syntax nameref} '+' superclassexpr)
   9.224 +  "}  %% FIXME check superclassexpr
   9.225  
   9.226    \begin{description}
   9.227  
   9.228 @@ -822,10 +819,11 @@
   9.229      @{command_def "overloading"} & : & @{text "theory \<rightarrow> local_theory"} \\
   9.230    \end{matharray}
   9.231  
   9.232 -  \begin{rail}
   9.233 -    'overloading' \\
   9.234 -    ( string ( '==' | equiv ) term ( '(' 'unchecked' ')' )? + ) 'begin'
   9.235 -  \end{rail}
   9.236 +  @{rail "
   9.237 +    @@{command overloading} \\
   9.238 +    ( @{syntax string} ( '==' | '\<equiv>' ) @{syntax term}
   9.239 +    ( '(' @'unchecked' ')' )? +) @'begin'
   9.240 +  "}  %% FIXME check string vs. name
   9.241  
   9.242    \begin{description}
   9.243  
   9.244 @@ -863,14 +861,14 @@
   9.245      @{command_def "attribute_setup"} & : & @{text "theory \<rightarrow> theory"} \\
   9.246    \end{matharray}
   9.247  
   9.248 -  \begin{rail}
   9.249 -    'use' name
   9.250 +  @{rail "
   9.251 +    @@{command use} @{syntax name}
   9.252      ;
   9.253 -    ('ML' | 'ML_prf' | 'ML_val' | 'ML_command' | 'setup' | 'local_setup') text
   9.254 +    (@@{command ML} | @@{command ML_prf} | @@{command ML_val} |
   9.255 +      @@{command ML_command} | @@{command setup} | @@{command local_setup}) @{syntax text}
   9.256      ;
   9.257 -    'attribute_setup' name '=' text text
   9.258 -    ;
   9.259 -  \end{rail}
   9.260 +    @@{command attribute_setup} @{syntax name} '=' @{syntax text} @{syntax text}
   9.261 +  "}
   9.262  
   9.263    \begin{description}
   9.264  
   9.265 @@ -951,14 +949,13 @@
   9.266      @{command_def "default_sort"} & : & @{text "local_theory \<rightarrow> local_theory"}
   9.267    \end{matharray}
   9.268  
   9.269 -  \begin{rail}
   9.270 -    'classes' (classdecl +)
   9.271 +  @{rail "
   9.272 +    @@{command classes} (@{syntax classdecl} +)
   9.273      ;
   9.274 -    'classrel' (nameref ('<' | subseteq) nameref + 'and')
   9.275 +    @@{command classrel} (@{syntax nameref} ('<' | '\<subseteq>') @{syntax nameref} + @'and')
   9.276      ;
   9.277 -    'default_sort' sort
   9.278 -    ;
   9.279 -  \end{rail}
   9.280 +    @@{command default_sort} @{syntax sort}
   9.281 +  "}
   9.282  
   9.283    \begin{description}
   9.284  
   9.285 @@ -999,14 +996,13 @@
   9.286      @{command_def "arities"} & : & @{text "theory \<rightarrow> theory"} & (axiomatic!) \\
   9.287    \end{matharray}
   9.288  
   9.289 -  \begin{rail}
   9.290 -    'type_synonym' (typespec '=' type mixfix?)
   9.291 +  @{rail "
   9.292 +    @@{command type_synonym} (@{syntax typespec} '=' @{syntax type} @{syntax mixfix}?)
   9.293      ;
   9.294 -    'typedecl' typespec mixfix?
   9.295 +    @@{command typedecl} @{syntax typespec} @{syntax mixfix}?
   9.296      ;
   9.297 -    'arities' (nameref '::' arity +)
   9.298 -    ;
   9.299 -  \end{rail}
   9.300 +    @@{command arities} (@{syntax nameref} '::' @{syntax arity} +)
   9.301 +  "}
   9.302  
   9.303    \begin{description}
   9.304  
   9.305 @@ -1078,12 +1074,12 @@
   9.306      @{command_def "defs"} & : & @{text "theory \<rightarrow> theory"} \\
   9.307    \end{matharray}
   9.308  
   9.309 -  \begin{rail}
   9.310 -    'consts' ((name '::' type mixfix?) +)
   9.311 +  @{rail "
   9.312 +    @@{command consts} ((@{syntax name} '::' @{syntax type} @{syntax mixfix}?) +)
   9.313      ;
   9.314 -    'defs' ('(' 'unchecked'? 'overloaded'? ')')? \\ (axmdecl prop +)
   9.315 -    ;
   9.316 -  \end{rail}
   9.317 +    @@{command defs} ('(' @'unchecked'? @'overloaded'? ')')? \\
   9.318 +      (@{syntax axmdecl} @{syntax prop} +)
   9.319 +  "}
   9.320  
   9.321    \begin{description}
   9.322  
   9.323 @@ -1118,12 +1114,12 @@
   9.324      @{command_def "theorems"} & : & @{text "local_theory \<rightarrow> local_theory"} \\
   9.325    \end{matharray}
   9.326  
   9.327 -  \begin{rail}
   9.328 -    'axioms' (axmdecl prop +)
   9.329 +  @{rail "
   9.330 +    @@{command axioms} (@{syntax axmdecl} @{syntax prop} +)
   9.331      ;
   9.332 -    ('lemmas' | 'theorems') target? (thmdef? thmrefs + 'and')
   9.333 -    ;
   9.334 -  \end{rail}
   9.335 +    (@@{command lemmas} | @@{command theorems}) @{syntax target}?
   9.336 +      (@{syntax thmdef}? @{syntax thmrefs} + @'and')
   9.337 +  "}
   9.338  
   9.339    \begin{description}
   9.340    
   9.341 @@ -1169,10 +1165,9 @@
   9.342      @{command_def "oracle"} & : & @{text "theory \<rightarrow> theory"} & (axiomatic!) \\
   9.343    \end{matharray}
   9.344  
   9.345 -  \begin{rail}
   9.346 -    'oracle' name '=' text
   9.347 -    ;
   9.348 -  \end{rail}
   9.349 +  @{rail "
   9.350 +    @@{command oracle} @{syntax name} '=' @{syntax text}
   9.351 +  "}
   9.352  
   9.353    \begin{description}
   9.354  
   9.355 @@ -1201,10 +1196,10 @@
   9.356      @{command_def "hide_fact"} & : & @{text "theory \<rightarrow> theory"} \\
   9.357    \end{matharray}
   9.358  
   9.359 -  \begin{rail}
   9.360 -    ( 'hide_class' | 'hide_type' | 'hide_const' | 'hide_fact' ) ('(open)')? (nameref + )
   9.361 -    ;
   9.362 -  \end{rail}
   9.363 +  @{rail "
   9.364 +    ( @{command hide_class} | @{command hide_type} |
   9.365 +      @{command hide_const} | @{command hide_fact} ) ('(' @'open' ')')? (@{syntax nameref} + )
   9.366 +  "}
   9.367  
   9.368    Isabelle organizes any kind of name declarations (of types,
   9.369    constants, theorems etc.) by separate hierarchically structured name
    10.1 --- a/doc-src/IsarRef/Thy/ZF_Specific.thy	Sun May 01 18:57:45 2011 +0200
    10.2 +++ b/doc-src/IsarRef/Thy/ZF_Specific.thy	Mon May 02 01:05:50 2011 +0200
    10.3 @@ -19,10 +19,9 @@
    10.4      @{attribute_def (ZF) TC} & : & @{text attribute} \\
    10.5    \end{matharray}
    10.6  
    10.7 -  \begin{rail}
    10.8 -    'TC' (() | 'add' | 'del')
    10.9 -    ;
   10.10 -  \end{rail}
   10.11 +  @{rail "
   10.12 +    @@{attribute (ZF) TC} (() | 'add' | 'del')
   10.13 +  "}
   10.14  
   10.15    \begin{description}
   10.16    
   10.17 @@ -55,42 +54,40 @@
   10.18      @{command_def (ZF) "codatatype"} & : & @{text "theory \<rightarrow> theory"} \\
   10.19    \end{matharray}
   10.20  
   10.21 -  \begin{rail}
   10.22 -    ('inductive' | 'coinductive') domains intros hints
   10.23 +  @{rail "
   10.24 +    (@@{command (ZF) inductive} | @@{command (ZF) coinductive}) domains intros hints
   10.25      ;
   10.26  
   10.27 -    domains: 'domains' (term + '+') ('<=' | subseteq) term
   10.28 +    domains: @'domains' (@{syntax term} + '+') ('<=' | '\<subseteq>') @{syntax term}
   10.29      ;
   10.30 -    intros: 'intros' (thmdecl? prop +)
   10.31 +    intros: @'intros' (@{syntax thmdecl}? @{syntax prop} +)
   10.32      ;
   10.33 -    hints: monos? condefs? typeintros? typeelims?
   10.34 +    hints: @{syntax (ZF) \"monos\"}? condefs? @{syntax (ZF) typeintros}? @{syntax (ZF) typeelims}?
   10.35      ;
   10.36 -    monos: ('monos' thmrefs)?
   10.37 +    @{syntax_def (ZF) \"monos\"}: @'monos' @{syntax thmrefs}
   10.38      ;
   10.39 -    condefs: ('con_defs' thmrefs)?
   10.40 +    condefs: @'con_defs' @{syntax thmrefs}
   10.41      ;
   10.42 -    typeintros: ('type_intros' thmrefs)?
   10.43 +    @{syntax_def (ZF) typeintros}: @'type_intros' @{syntax thmrefs}
   10.44      ;
   10.45 -    typeelims: ('type_elims' thmrefs)?
   10.46 -    ;
   10.47 -  \end{rail}
   10.48 +    @{syntax_def (ZF) typeelims}: @'type_elims' @{syntax thmrefs}
   10.49 +  "}
   10.50  
   10.51    In the following syntax specification @{text "monos"}, @{text
   10.52    typeintros}, and @{text typeelims} are the same as above.
   10.53  
   10.54 -  \begin{rail}
   10.55 -    ('datatype' | 'codatatype') domain? (dtspec + 'and') hints
   10.56 +  @{rail "
   10.57 +    (@@{command (ZF) datatype} | @@{command (ZF) codatatype}) domain? (dtspec + @'and') hints
   10.58      ;
   10.59  
   10.60 -    domain: ('<=' | subseteq) term
   10.61 +    domain: ('<=' | '\<subseteq>') @{syntax term}
   10.62      ;
   10.63 -    dtspec: term '=' (con + '|')
   10.64 +    dtspec: @{syntax term} '=' (con + '|')
   10.65      ;
   10.66 -    con: name ('(' (term ',' +) ')')?  
   10.67 +    con: @{syntax name} ('(' (@{syntax term} ',' +) ')')?
   10.68      ;
   10.69 -    hints: monos? typeintros? typeelims?
   10.70 -    ;
   10.71 -  \end{rail}
   10.72 +    hints: @{syntax (ZF) \"monos\"}? @{syntax (ZF) typeintros}? @{syntax (ZF) typeelims}?
   10.73 +  "}
   10.74  
   10.75    See \cite{isabelle-ZF} for further information on inductive
   10.76    definitions in ZF, but note that this covers the old-style theory
   10.77 @@ -105,10 +102,9 @@
   10.78      @{command_def (ZF) "primrec"} & : & @{text "theory \<rightarrow> theory"} \\
   10.79    \end{matharray}
   10.80  
   10.81 -  \begin{rail}
   10.82 -    'primrec' (thmdecl? prop +)
   10.83 -    ;
   10.84 -  \end{rail}
   10.85 +  @{rail "
   10.86 +    @@{command (ZF) primrec} (@{syntax thmdecl}? @{syntax prop} +)
   10.87 +  "}
   10.88  *}
   10.89  
   10.90  
   10.91 @@ -125,14 +121,14 @@
   10.92      @{command_def (ZF) "inductive_cases"} & : & @{text "theory \<rightarrow> theory"} \\
   10.93    \end{matharray}
   10.94  
   10.95 -  \begin{rail}
   10.96 -    ('case_tac' | 'induct_tac') goalspec? name
   10.97 +  @{rail "
   10.98 +    (@@{method (ZF) case_tac} | @@{method (ZF) induct_tac}) @{syntax goalspec}? @{syntax name}
   10.99      ;
  10.100 -    indcases (prop +)
  10.101 +    @@{method (ZF) ind_cases} (@{syntax prop} +)
  10.102      ;
  10.103 -    inductivecases (thmdecl? (prop +) + 'and')
  10.104 +    @@{command (ZF) inductive_cases} (@{syntax thmdecl}? (@{syntax prop} +) + @'and')
  10.105      ;
  10.106 -  \end{rail}
  10.107 +  "}
  10.108  *}
  10.109  
  10.110  end
    11.1 --- a/doc-src/IsarRef/Thy/document/Document_Preparation.tex	Sun May 01 18:57:45 2011 +0200
    11.2 +++ b/doc-src/IsarRef/Thy/document/Document_Preparation.tex	Mon May 02 01:05:50 2011 +0200
    11.3 @@ -102,12 +102,45 @@
    11.4    markup commands, but have a different status within Isabelle/Isar
    11.5    syntax.
    11.6  
    11.7 -  \begin{rail}
    11.8 -    ('chapter' | 'section' | 'subsection' | 'subsubsection' | 'text') target? text
    11.9 -    ;
   11.10 -    ('header' | 'text_raw' | 'sect' | 'subsect' | 'subsubsect' | 'txt' | 'txt_raw') text
   11.11 -    ;
   11.12 -  \end{rail}
   11.13 +  \begin{railoutput}
   11.14 +\rail@begin{5}{\isa{}}
   11.15 +\rail@bar
   11.16 +\rail@term{\hyperlink{command.chapter}{\mbox{\isa{\isacommand{chapter}}}}}[]
   11.17 +\rail@nextbar{1}
   11.18 +\rail@term{\hyperlink{command.section}{\mbox{\isa{\isacommand{section}}}}}[]
   11.19 +\rail@nextbar{2}
   11.20 +\rail@term{\hyperlink{command.subsection}{\mbox{\isa{\isacommand{subsection}}}}}[]
   11.21 +\rail@nextbar{3}
   11.22 +\rail@term{\hyperlink{command.subsubsection}{\mbox{\isa{\isacommand{subsubsection}}}}}[]
   11.23 +\rail@nextbar{4}
   11.24 +\rail@term{\hyperlink{command.text}{\mbox{\isa{\isacommand{text}}}}}[]
   11.25 +\rail@endbar
   11.26 +\rail@bar
   11.27 +\rail@nextbar{1}
   11.28 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
   11.29 +\rail@endbar
   11.30 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
   11.31 +\rail@end
   11.32 +\rail@begin{7}{\isa{}}
   11.33 +\rail@bar
   11.34 +\rail@term{\hyperlink{command.header}{\mbox{\isa{\isacommand{header}}}}}[]
   11.35 +\rail@nextbar{1}
   11.36 +\rail@term{\hyperlink{command.text-raw}{\mbox{\isa{\isacommand{text{\isaliteral{5F}{\isacharunderscore}}raw}}}}}[]
   11.37 +\rail@nextbar{2}
   11.38 +\rail@term{\hyperlink{command.sect}{\mbox{\isa{\isacommand{sect}}}}}[]
   11.39 +\rail@nextbar{3}
   11.40 +\rail@term{\hyperlink{command.subsect}{\mbox{\isa{\isacommand{subsect}}}}}[]
   11.41 +\rail@nextbar{4}
   11.42 +\rail@term{\hyperlink{command.subsubsect}{\mbox{\isa{\isacommand{subsubsect}}}}}[]
   11.43 +\rail@nextbar{5}
   11.44 +\rail@term{\hyperlink{command.txt}{\mbox{\isa{\isacommand{txt}}}}}[]
   11.45 +\rail@nextbar{6}
   11.46 +\rail@term{\hyperlink{command.txt-raw}{\mbox{\isa{\isacommand{txt{\isaliteral{5F}{\isacharunderscore}}raw}}}}}[]
   11.47 +\rail@endbar
   11.48 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
   11.49 +\rail@end
   11.50 +\end{railoutput}
   11.51 +
   11.52  
   11.53    \begin{description}
   11.54  
   11.55 @@ -196,42 +229,142 @@
   11.56    antiquotations are checked within the current theory or proof
   11.57    context.
   11.58  
   11.59 -  \begin{rail}
   11.60 -    atsign lbrace antiquotation rbrace
   11.61 -    ;
   11.62 -
   11.63 -    antiquotation:
   11.64 -      'theory' options name |
   11.65 -      'thm' options styles thmrefs |
   11.66 -      'lemma' options prop 'by' method |
   11.67 -      'prop' options styles prop |
   11.68 -      'term' options styles term |
   11.69 -      'term_type' options styles term |
   11.70 -      'typeof' options styles term |
   11.71 -      'const' options term |
   11.72 -      'abbrev' options term |
   11.73 -      'typ' options type |
   11.74 -      'type' options name |
   11.75 -      'class' options name |
   11.76 -      'text' options name |
   11.77 -      'goals' options |
   11.78 -      'subgoals' options |
   11.79 -      'prf' options thmrefs |
   11.80 -      'full_prf' options thmrefs |
   11.81 -      'ML' options name |
   11.82 -      'ML_type' options name |
   11.83 -      'ML_struct' options name |
   11.84 -      'file' options name
   11.85 -    ;
   11.86 -    options: '[' (option * ',') ']'
   11.87 -    ;
   11.88 -    option: name | name '=' name
   11.89 -    ;
   11.90 -    styles: '(' (style + ',') ')'
   11.91 -    ;
   11.92 -    style: (name +)
   11.93 -    ;
   11.94 -  \end{rail}
   11.95 +  \begin{railoutput}
   11.96 +\rail@begin{1}{\isa{}}
   11.97 +\rail@term{\isa{{\isaliteral{40}{\isacharat}}{\isaliteral{7B}{\isacharbraceleft}}}}[]
   11.98 +\rail@nont{\isa{antiquotation}}[]
   11.99 +\rail@term{\isa{{\isaliteral{7D}{\isacharbraceright}}}}[]
  11.100 +\rail@end
  11.101 +\rail@begin{21}{\indexdef{}{syntax}{antiquotation}\hypertarget{syntax.antiquotation}{\hyperlink{syntax.antiquotation}{\mbox{\isa{antiquotation}}}}}
  11.102 +\rail@bar
  11.103 +\rail@term{\hyperlink{antiquotation.theory}{\mbox{\isa{theory}}}}[]
  11.104 +\rail@nont{\isa{options}}[]
  11.105 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  11.106 +\rail@nextbar{1}
  11.107 +\rail@term{\hyperlink{antiquotation.thm}{\mbox{\isa{thm}}}}[]
  11.108 +\rail@nont{\isa{options}}[]
  11.109 +\rail@nont{\isa{styles}}[]
  11.110 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  11.111 +\rail@nextbar{2}
  11.112 +\rail@term{\hyperlink{antiquotation.lemma}{\mbox{\isa{lemma}}}}[]
  11.113 +\rail@nont{\isa{options}}[]
  11.114 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  11.115 +\rail@term{\isa{\isakeyword{by}}}[]
  11.116 +\rail@nont{\hyperlink{syntax.method}{\mbox{\isa{method}}}}[]
  11.117 +\rail@nextbar{3}
  11.118 +\rail@term{\hyperlink{antiquotation.prop}{\mbox{\isa{prop}}}}[]
  11.119 +\rail@nont{\isa{options}}[]
  11.120 +\rail@nont{\isa{styles}}[]
  11.121 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  11.122 +\rail@nextbar{4}
  11.123 +\rail@term{\hyperlink{antiquotation.term}{\mbox{\isa{term}}}}[]
  11.124 +\rail@nont{\isa{options}}[]
  11.125 +\rail@nont{\isa{styles}}[]
  11.126 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  11.127 +\rail@nextbar{5}
  11.128 +\rail@term{\hyperlink{antiquotation.term-type}{\mbox{\isa{term{\isaliteral{5F}{\isacharunderscore}}type}}}}[]
  11.129 +\rail@nont{\isa{options}}[]
  11.130 +\rail@nont{\isa{styles}}[]
  11.131 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  11.132 +\rail@nextbar{6}
  11.133 +\rail@term{\hyperlink{antiquotation.typeof}{\mbox{\isa{typeof}}}}[]
  11.134 +\rail@nont{\isa{options}}[]
  11.135 +\rail@nont{\isa{styles}}[]
  11.136 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  11.137 +\rail@nextbar{7}
  11.138 +\rail@term{\hyperlink{antiquotation.const}{\mbox{\isa{const}}}}[]
  11.139 +\rail@nont{\isa{options}}[]
  11.140 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  11.141 +\rail@nextbar{8}
  11.142 +\rail@term{\hyperlink{antiquotation.abbrev}{\mbox{\isa{abbrev}}}}[]
  11.143 +\rail@nont{\isa{options}}[]
  11.144 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  11.145 +\rail@nextbar{9}
  11.146 +\rail@term{\hyperlink{antiquotation.typ}{\mbox{\isa{typ}}}}[]
  11.147 +\rail@nont{\isa{options}}[]
  11.148 +\rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
  11.149 +\rail@nextbar{10}
  11.150 +\rail@term{\hyperlink{antiquotation.type}{\mbox{\isa{type}}}}[]
  11.151 +\rail@nont{\isa{options}}[]
  11.152 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  11.153 +\rail@nextbar{11}
  11.154 +\rail@term{\hyperlink{antiquotation.class}{\mbox{\isa{class}}}}[]
  11.155 +\rail@nont{\isa{options}}[]
  11.156 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  11.157 +\rail@nextbar{12}
  11.158 +\rail@term{\hyperlink{antiquotation.text}{\mbox{\isa{text}}}}[]
  11.159 +\rail@nont{\isa{options}}[]
  11.160 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  11.161 +\rail@nextbar{13}
  11.162 +\rail@term{\hyperlink{antiquotation.goals}{\mbox{\isa{goals}}}}[]
  11.163 +\rail@nont{\isa{options}}[]
  11.164 +\rail@nextbar{14}
  11.165 +\rail@term{\hyperlink{antiquotation.subgoals}{\mbox{\isa{subgoals}}}}[]
  11.166 +\rail@nont{\isa{options}}[]
  11.167 +\rail@nextbar{15}
  11.168 +\rail@term{\hyperlink{antiquotation.prf}{\mbox{\isa{prf}}}}[]
  11.169 +\rail@nont{\isa{options}}[]
  11.170 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  11.171 +\rail@nextbar{16}
  11.172 +\rail@term{\hyperlink{antiquotation.full-prf}{\mbox{\isa{full{\isaliteral{5F}{\isacharunderscore}}prf}}}}[]
  11.173 +\rail@nont{\isa{options}}[]
  11.174 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  11.175 +\rail@nextbar{17}
  11.176 +\rail@term{\hyperlink{antiquotation.ML}{\mbox{\isa{ML}}}}[]
  11.177 +\rail@nont{\isa{options}}[]
  11.178 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  11.179 +\rail@nextbar{18}
  11.180 +\rail@term{\hyperlink{antiquotation.ML-type}{\mbox{\isa{ML{\isaliteral{5F}{\isacharunderscore}}type}}}}[]
  11.181 +\rail@nont{\isa{options}}[]
  11.182 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  11.183 +\rail@nextbar{19}
  11.184 +\rail@term{\hyperlink{antiquotation.ML-struct}{\mbox{\isa{ML{\isaliteral{5F}{\isacharunderscore}}struct}}}}[]
  11.185 +\rail@nont{\isa{options}}[]
  11.186 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  11.187 +\rail@nextbar{20}
  11.188 +\rail@term{\hyperlink{antiquotation.file}{\mbox{\isa{file}}}}[]
  11.189 +\rail@nont{\isa{options}}[]
  11.190 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  11.191 +\rail@endbar
  11.192 +\rail@end
  11.193 +\rail@begin{3}{\isa{options}}
  11.194 +\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
  11.195 +\rail@bar
  11.196 +\rail@nextbar{1}
  11.197 +\rail@plus
  11.198 +\rail@nont{\isa{option}}[]
  11.199 +\rail@nextplus{2}
  11.200 +\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  11.201 +\rail@endplus
  11.202 +\rail@endbar
  11.203 +\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
  11.204 +\rail@end
  11.205 +\rail@begin{2}{\isa{option}}
  11.206 +\rail@bar
  11.207 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  11.208 +\rail@nextbar{1}
  11.209 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  11.210 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  11.211 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  11.212 +\rail@endbar
  11.213 +\rail@end
  11.214 +\rail@begin{2}{\isa{styles}}
  11.215 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  11.216 +\rail@plus
  11.217 +\rail@nont{\isa{style}}[]
  11.218 +\rail@nextplus{1}
  11.219 +\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  11.220 +\rail@endplus
  11.221 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  11.222 +\rail@end
  11.223 +\rail@begin{2}{\isa{style}}
  11.224 +\rail@plus
  11.225 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  11.226 +\rail@nextplus{1}
  11.227 +\rail@endplus
  11.228 +\rail@end
  11.229 +\end{railoutput}
  11.230 + %% FIXME check lemma
  11.231  
  11.232    Note that the syntax of antiquotations may \emph{not} include source
  11.233    comments \verb|(*|~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}}~\verb|*)| nor verbatim
  11.234 @@ -439,12 +572,23 @@
  11.235    presentation tags, to indicate some modification in the way it is
  11.236    printed in the document.
  11.237  
  11.238 -  \indexouternonterm{tags}
  11.239 -  \begin{rail}
  11.240 -    tags: ( tag * )
  11.241 -    ;
  11.242 -    tag: '\%' (ident | string)
  11.243 -  \end{rail}
  11.244 +  \begin{railoutput}
  11.245 +\rail@begin{2}{\indexdef{}{syntax}{tags}\hypertarget{syntax.tags}{\hyperlink{syntax.tags}{\mbox{\isa{tags}}}}}
  11.246 +\rail@plus
  11.247 +\rail@nextplus{1}
  11.248 +\rail@cnont{\isa{tag}}[]
  11.249 +\rail@endplus
  11.250 +\rail@end
  11.251 +\rail@begin{2}{\isa{tag}}
  11.252 +\rail@term{\isa{{\isaliteral{25}{\isacharpercent}}}}[]
  11.253 +\rail@bar
  11.254 +\rail@nont{\hyperlink{syntax.ident}{\mbox{\isa{ident}}}}[]
  11.255 +\rail@nextbar{1}
  11.256 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
  11.257 +\rail@endbar
  11.258 +\rail@end
  11.259 +\end{railoutput}
  11.260 +
  11.261  
  11.262    Some tags are pre-declared for certain classes of commands, serving
  11.263    as default markup if no tags are given in the text:
  11.264 @@ -494,10 +638,20 @@
  11.265      \indexdef{}{command}{print\_drafts}\hypertarget{command.print-drafts}{\hyperlink{command.print-drafts}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}drafts}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}any\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
  11.266    \end{matharray}
  11.267  
  11.268 -  \begin{rail}
  11.269 -    ('display_drafts' | 'print_drafts') (name +)
  11.270 -    ;
  11.271 -  \end{rail}
  11.272 +  \begin{railoutput}
  11.273 +\rail@begin{2}{\isa{}}
  11.274 +\rail@bar
  11.275 +\rail@term{\hyperlink{command.display-drafts}{\mbox{\isa{\isacommand{display{\isaliteral{5F}{\isacharunderscore}}drafts}}}}}[]
  11.276 +\rail@nextbar{1}
  11.277 +\rail@term{\hyperlink{command.print-drafts}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}drafts}}}}}[]
  11.278 +\rail@endbar
  11.279 +\rail@plus
  11.280 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  11.281 +\rail@nextplus{1}
  11.282 +\rail@endplus
  11.283 +\rail@end
  11.284 +\end{railoutput}
  11.285 +
  11.286  
  11.287    \begin{description}
  11.288  
    12.1 --- a/doc-src/IsarRef/Thy/document/Generic.tex	Sun May 01 18:57:45 2011 +0200
    12.2 +++ b/doc-src/IsarRef/Thy/document/Generic.tex	Mon May 02 01:05:50 2011 +0200
    12.3 @@ -45,9 +45,27 @@
    12.4      \indexdef{}{command}{print\_configs}\hypertarget{command.print-configs}{\hyperlink{command.print-configs}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}configs}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
    12.5    \end{matharray}
    12.6  
    12.7 -  \begin{rail}
    12.8 -    name ('=' ('true' | 'false' | int | float | name))?
    12.9 -  \end{rail}
   12.10 +  \begin{railoutput}
   12.11 +\rail@begin{6}{\isa{}}
   12.12 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   12.13 +\rail@bar
   12.14 +\rail@nextbar{1}
   12.15 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
   12.16 +\rail@bar
   12.17 +\rail@term{\isa{true}}[]
   12.18 +\rail@nextbar{2}
   12.19 +\rail@term{\isa{false}}[]
   12.20 +\rail@nextbar{3}
   12.21 +\rail@nont{\hyperlink{syntax.int}{\mbox{\isa{int}}}}[]
   12.22 +\rail@nextbar{4}
   12.23 +\rail@nont{\hyperlink{syntax.float}{\mbox{\isa{float}}}}[]
   12.24 +\rail@nextbar{5}
   12.25 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   12.26 +\rail@endbar
   12.27 +\rail@endbar
   12.28 +\rail@end
   12.29 +\end{railoutput}
   12.30 +
   12.31  
   12.32    \begin{description}
   12.33    
   12.34 @@ -83,12 +101,35 @@
   12.35      \indexdef{}{method}{fail}\hypertarget{method.fail}{\hyperlink{method.fail}{\mbox{\isa{fail}}}} & : & \isa{method} \\
   12.36    \end{matharray}
   12.37  
   12.38 -  \begin{rail}
   12.39 -    ('fold' | 'unfold' | 'insert') thmrefs
   12.40 -    ;
   12.41 -    ('erule' | 'drule' | 'frule') ('('nat')')? thmrefs
   12.42 -    ;
   12.43 -  \end{rail}
   12.44 +  \begin{railoutput}
   12.45 +\rail@begin{3}{\isa{}}
   12.46 +\rail@bar
   12.47 +\rail@term{\hyperlink{method.fold}{\mbox{\isa{fold}}}}[]
   12.48 +\rail@nextbar{1}
   12.49 +\rail@term{\hyperlink{method.unfold}{\mbox{\isa{unfold}}}}[]
   12.50 +\rail@nextbar{2}
   12.51 +\rail@term{\hyperlink{method.insert}{\mbox{\isa{insert}}}}[]
   12.52 +\rail@endbar
   12.53 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
   12.54 +\rail@end
   12.55 +\rail@begin{3}{\isa{}}
   12.56 +\rail@bar
   12.57 +\rail@term{\hyperlink{method.erule}{\mbox{\isa{erule}}}}[]
   12.58 +\rail@nextbar{1}
   12.59 +\rail@term{\hyperlink{method.drule}{\mbox{\isa{drule}}}}[]
   12.60 +\rail@nextbar{2}
   12.61 +\rail@term{\hyperlink{method.frule}{\mbox{\isa{frule}}}}[]
   12.62 +\rail@endbar
   12.63 +\rail@bar
   12.64 +\rail@nextbar{1}
   12.65 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
   12.66 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
   12.67 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
   12.68 +\rail@endbar
   12.69 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
   12.70 +\rail@end
   12.71 +\end{railoutput}
   12.72 +
   12.73  
   12.74    \begin{description}
   12.75    
   12.76 @@ -138,17 +179,47 @@
   12.77      \indexdef{}{attribute}{no\_vars}\hypertarget{attribute.no-vars}{\hyperlink{attribute.no-vars}{\mbox{\isa{no{\isaliteral{5F}{\isacharunderscore}}vars}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{attribute} \\
   12.78    \end{matharray}
   12.79  
   12.80 -  \begin{rail}
   12.81 -    'tagged' name name
   12.82 -    ;
   12.83 -    'untagged' name
   12.84 -    ;
   12.85 -    ('THEN' | 'COMP') ('[' nat ']')? thmref
   12.86 -    ;
   12.87 -    ('unfolded' | 'folded') thmrefs
   12.88 -    ;
   12.89 -    'rotated' ( int )?
   12.90 -  \end{rail}
   12.91 +  \begin{railoutput}
   12.92 +\rail@begin{1}{\isa{}}
   12.93 +\rail@term{\hyperlink{attribute.tagged}{\mbox{\isa{tagged}}}}[]
   12.94 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   12.95 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   12.96 +\rail@end
   12.97 +\rail@begin{1}{\isa{}}
   12.98 +\rail@term{\hyperlink{attribute.untagged}{\mbox{\isa{untagged}}}}[]
   12.99 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  12.100 +\rail@end
  12.101 +\rail@begin{2}{\isa{}}
  12.102 +\rail@bar
  12.103 +\rail@term{\hyperlink{attribute.THEN}{\mbox{\isa{THEN}}}}[]
  12.104 +\rail@nextbar{1}
  12.105 +\rail@term{\hyperlink{attribute.COMP}{\mbox{\isa{COMP}}}}[]
  12.106 +\rail@endbar
  12.107 +\rail@bar
  12.108 +\rail@nextbar{1}
  12.109 +\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
  12.110 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  12.111 +\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
  12.112 +\rail@endbar
  12.113 +\rail@nont{\hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}}[]
  12.114 +\rail@end
  12.115 +\rail@begin{2}{\isa{}}
  12.116 +\rail@bar
  12.117 +\rail@term{\hyperlink{attribute.unfolded}{\mbox{\isa{unfolded}}}}[]
  12.118 +\rail@nextbar{1}
  12.119 +\rail@term{\hyperlink{attribute.folded}{\mbox{\isa{folded}}}}[]
  12.120 +\rail@endbar
  12.121 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  12.122 +\rail@end
  12.123 +\rail@begin{2}{\isa{}}
  12.124 +\rail@term{\hyperlink{attribute.rotated}{\mbox{\isa{rotated}}}}[]
  12.125 +\rail@bar
  12.126 +\rail@nextbar{1}
  12.127 +\rail@nont{\hyperlink{syntax.int}{\mbox{\isa{int}}}}[]
  12.128 +\rail@endbar
  12.129 +\rail@end
  12.130 +\end{railoutput}
  12.131 +
  12.132  
  12.133    \begin{description}
  12.134  
  12.135 @@ -199,12 +270,38 @@
  12.136      \indexdef{}{method}{split}\hypertarget{method.split}{\hyperlink{method.split}{\mbox{\isa{split}}}} & : & \isa{method} \\
  12.137    \end{matharray}
  12.138  
  12.139 -  \begin{rail}
  12.140 -    'subst' ('(' 'asm' ')')? ('(' (nat+) ')')? thmref
  12.141 -    ;
  12.142 -    'split' ('(' 'asm' ')')? thmrefs
  12.143 -    ;
  12.144 -  \end{rail}
  12.145 +  \begin{railoutput}
  12.146 +\rail@begin{3}{\isa{}}
  12.147 +\rail@term{\hyperlink{method.subst}{\mbox{\isa{subst}}}}[]
  12.148 +\rail@bar
  12.149 +\rail@nextbar{1}
  12.150 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  12.151 +\rail@term{\isa{asm}}[]
  12.152 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  12.153 +\rail@endbar
  12.154 +\rail@bar
  12.155 +\rail@nextbar{1}
  12.156 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  12.157 +\rail@plus
  12.158 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  12.159 +\rail@nextplus{2}
  12.160 +\rail@endplus
  12.161 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  12.162 +\rail@endbar
  12.163 +\rail@nont{\hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}}[]
  12.164 +\rail@end
  12.165 +\rail@begin{2}{\isa{}}
  12.166 +\rail@term{\hyperlink{method.split}{\mbox{\isa{split}}}}[]
  12.167 +\rail@bar
  12.168 +\rail@nextbar{1}
  12.169 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  12.170 +\rail@term{\isa{asm}}[]
  12.171 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  12.172 +\rail@endbar
  12.173 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  12.174 +\rail@end
  12.175 +\end{railoutput}
  12.176 +
  12.177  
  12.178    These methods provide low-level facilities for equational reasoning
  12.179    that are intended for specialized applications only.  Normally,
  12.180 @@ -302,22 +399,85 @@
  12.181      \indexdef{}{method}{raw\_tactic}\hypertarget{method.raw-tactic}{\hyperlink{method.raw-tactic}{\mbox{\isa{raw{\isaliteral{5F}{\isacharunderscore}}tactic}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
  12.182    \end{matharray}
  12.183  
  12.184 -  \begin{rail}
  12.185 -    ( 'rule_tac' | 'erule_tac' | 'drule_tac' | 'frule_tac' | 'cut_tac' | 'thin_tac' ) goalspec?
  12.186 -    ( insts thmref | thmrefs )
  12.187 -    ;
  12.188 -    'subgoal_tac' goalspec? (prop +)
  12.189 -    ;
  12.190 -    'rename_tac' goalspec? (name +)
  12.191 -    ;
  12.192 -    'rotate_tac' goalspec? int?
  12.193 -    ;
  12.194 -    ('tactic' | 'raw_tactic') text
  12.195 -    ;
  12.196 -
  12.197 -    insts: ((name '=' term) + 'and') 'in'
  12.198 -    ;
  12.199 -  \end{rail}
  12.200 +  \begin{railoutput}
  12.201 +\rail@begin{6}{\isa{}}
  12.202 +\rail@bar
  12.203 +\rail@term{\hyperlink{method.rule-tac}{\mbox{\isa{rule{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
  12.204 +\rail@nextbar{1}
  12.205 +\rail@term{\hyperlink{method.erule-tac}{\mbox{\isa{erule{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
  12.206 +\rail@nextbar{2}
  12.207 +\rail@term{\hyperlink{method.drule-tac}{\mbox{\isa{drule{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
  12.208 +\rail@nextbar{3}
  12.209 +\rail@term{\hyperlink{method.frule-tac}{\mbox{\isa{frule{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
  12.210 +\rail@nextbar{4}
  12.211 +\rail@term{\hyperlink{method.cut-tac}{\mbox{\isa{cut{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
  12.212 +\rail@nextbar{5}
  12.213 +\rail@term{\hyperlink{method.thin-tac}{\mbox{\isa{thin{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
  12.214 +\rail@endbar
  12.215 +\rail@bar
  12.216 +\rail@nextbar{1}
  12.217 +\rail@nont{\hyperlink{syntax.goalspec}{\mbox{\isa{goalspec}}}}[]
  12.218 +\rail@endbar
  12.219 +\rail@bar
  12.220 +\rail@nont{\isa{insts}}[]
  12.221 +\rail@nont{\hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}}[]
  12.222 +\rail@nextbar{1}
  12.223 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  12.224 +\rail@endbar
  12.225 +\rail@end
  12.226 +\rail@begin{2}{\isa{}}
  12.227 +\rail@term{\hyperlink{method.subgoal-tac}{\mbox{\isa{subgoal{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
  12.228 +\rail@bar
  12.229 +\rail@nextbar{1}
  12.230 +\rail@nont{\hyperlink{syntax.goalspec}{\mbox{\isa{goalspec}}}}[]
  12.231 +\rail@endbar
  12.232 +\rail@plus
  12.233 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  12.234 +\rail@nextplus{1}
  12.235 +\rail@endplus
  12.236 +\rail@end
  12.237 +\rail@begin{2}{\isa{}}
  12.238 +\rail@term{\hyperlink{method.rename-tac}{\mbox{\isa{rename{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
  12.239 +\rail@bar
  12.240 +\rail@nextbar{1}
  12.241 +\rail@nont{\hyperlink{syntax.goalspec}{\mbox{\isa{goalspec}}}}[]
  12.242 +\rail@endbar
  12.243 +\rail@plus
  12.244 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  12.245 +\rail@nextplus{1}
  12.246 +\rail@endplus
  12.247 +\rail@end
  12.248 +\rail@begin{2}{\isa{}}
  12.249 +\rail@term{\hyperlink{method.rotate-tac}{\mbox{\isa{rotate{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
  12.250 +\rail@bar
  12.251 +\rail@nextbar{1}
  12.252 +\rail@nont{\hyperlink{syntax.goalspec}{\mbox{\isa{goalspec}}}}[]
  12.253 +\rail@endbar
  12.254 +\rail@bar
  12.255 +\rail@nextbar{1}
  12.256 +\rail@nont{\hyperlink{syntax.int}{\mbox{\isa{int}}}}[]
  12.257 +\rail@endbar
  12.258 +\rail@end
  12.259 +\rail@begin{2}{\isa{}}
  12.260 +\rail@bar
  12.261 +\rail@term{\hyperlink{method.tactic}{\mbox{\isa{tactic}}}}[]
  12.262 +\rail@nextbar{1}
  12.263 +\rail@term{\hyperlink{method.raw-tactic}{\mbox{\isa{raw{\isaliteral{5F}{\isacharunderscore}}tactic}}}}[]
  12.264 +\rail@endbar
  12.265 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
  12.266 +\rail@end
  12.267 +\rail@begin{2}{\isa{insts}}
  12.268 +\rail@plus
  12.269 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  12.270 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  12.271 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  12.272 +\rail@nextplus{1}
  12.273 +\rail@cterm{\isa{\isakeyword{and}}}[]
  12.274 +\rail@endplus
  12.275 +\rail@term{\isa{\isakeyword{in}}}[]
  12.276 +\rail@end
  12.277 +\end{railoutput}
  12.278 + % FIXME check use of insts
  12.279  
  12.280  \begin{description}
  12.281  
  12.282 @@ -383,31 +543,78 @@
  12.283      \indexdef{}{method}{simp\_all}\hypertarget{method.simp-all}{\hyperlink{method.simp-all}{\mbox{\isa{simp{\isaliteral{5F}{\isacharunderscore}}all}}}} & : & \isa{method} \\
  12.284    \end{matharray}
  12.285  
  12.286 -  \indexouternonterm{simpmod}
  12.287 -  \begin{rail}
  12.288 -    ('simp' | 'simp_all') opt? (simpmod *)
  12.289 -    ;
  12.290 +  \begin{railoutput}
  12.291 +\rail@begin{2}{\isa{}}
  12.292 +\rail@bar
  12.293 +\rail@term{\hyperlink{method.simp}{\mbox{\isa{simp}}}}[]
  12.294 +\rail@nextbar{1}
  12.295 +\rail@term{\hyperlink{method.simp-all}{\mbox{\isa{simp{\isaliteral{5F}{\isacharunderscore}}all}}}}[]
  12.296 +\rail@endbar
  12.297 +\rail@bar
  12.298 +\rail@nextbar{1}
  12.299 +\rail@nont{\isa{opt}}[]
  12.300 +\rail@endbar
  12.301 +\rail@plus
  12.302 +\rail@nextplus{1}
  12.303 +\rail@cnont{\hyperlink{syntax.simpmod}{\mbox{\isa{simpmod}}}}[]
  12.304 +\rail@endplus
  12.305 +\rail@end
  12.306 +\rail@begin{4}{\isa{opt}}
  12.307 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  12.308 +\rail@bar
  12.309 +\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}asm}}[]
  12.310 +\rail@nextbar{1}
  12.311 +\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}asm{\isaliteral{5F}{\isacharunderscore}}simp}}[]
  12.312 +\rail@nextbar{2}
  12.313 +\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}asm{\isaliteral{5F}{\isacharunderscore}}use}}[]
  12.314 +\rail@nextbar{3}
  12.315 +\rail@term{\isa{asm{\isaliteral{5F}{\isacharunderscore}}lr}}[]
  12.316 +\rail@endbar
  12.317 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  12.318 +\rail@end
  12.319 +\rail@begin{9}{\indexdef{}{syntax}{simpmod}\hypertarget{syntax.simpmod}{\hyperlink{syntax.simpmod}{\mbox{\isa{simpmod}}}}}
  12.320 +\rail@bar
  12.321 +\rail@term{\isa{add}}[]
  12.322 +\rail@nextbar{1}
  12.323 +\rail@term{\isa{del}}[]
  12.324 +\rail@nextbar{2}
  12.325 +\rail@term{\isa{only}}[]
  12.326 +\rail@nextbar{3}
  12.327 +\rail@term{\isa{cong}}[]
  12.328 +\rail@bar
  12.329 +\rail@nextbar{4}
  12.330 +\rail@term{\isa{add}}[]
  12.331 +\rail@nextbar{5}
  12.332 +\rail@term{\isa{del}}[]
  12.333 +\rail@endbar
  12.334 +\rail@nextbar{6}
  12.335 +\rail@term{\isa{split}}[]
  12.336 +\rail@bar
  12.337 +\rail@nextbar{7}
  12.338 +\rail@term{\isa{add}}[]
  12.339 +\rail@nextbar{8}
  12.340 +\rail@term{\isa{del}}[]
  12.341 +\rail@endbar
  12.342 +\rail@endbar
  12.343 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  12.344 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  12.345 +\rail@end
  12.346 +\end{railoutput}
  12.347  
  12.348 -    opt: '(' ('no_asm' | 'no_asm_simp' | 'no_asm_use' | 'asm_lr' ) ')'
  12.349 -    ;
  12.350 -    simpmod: ('add' | 'del' | 'only' | 'cong' (() | 'add' | 'del') |
  12.351 -      'split' (() | 'add' | 'del')) ':' thmrefs
  12.352 -    ;
  12.353 -  \end{rail}
  12.354  
  12.355    \begin{description}
  12.356  
  12.357    \item \hyperlink{method.simp}{\mbox{\isa{simp}}} invokes the Simplifier, after declaring
  12.358    additional rules according to the arguments given.  Note that the
  12.359 -  \railtterm{only} modifier first removes all other rewrite rules,
  12.360 +  \isa{only} modifier first removes all other rewrite rules,
  12.361    congruences, and looper tactics (including splits), and then behaves
  12.362 -  like \railtterm{add}.
  12.363 +  like \isa{add}.
  12.364  
  12.365 -  \medskip The \railtterm{cong} modifiers add or delete Simplifier
  12.366 +  \medskip The \isa{cong} modifiers add or delete Simplifier
  12.367    congruence rules (see also \cite{isabelle-ref}), the default is to
  12.368    add.
  12.369  
  12.370 -  \medskip The \railtterm{split} modifiers add or delete rules for the
  12.371 +  \medskip The \isa{split} modifiers add or delete rules for the
  12.372    Splitter (see also \cite{isabelle-ref}), the default is to add.
  12.373    This works only if the Simplifier method has been properly setup to
  12.374    include the Splitter (all major object logics such HOL, HOLCF, FOL,
  12.375 @@ -459,10 +666,24 @@
  12.376      \indexdef{}{attribute}{split}\hypertarget{attribute.split}{\hyperlink{attribute.split}{\mbox{\isa{split}}}} & : & \isa{attribute} \\
  12.377    \end{matharray}
  12.378  
  12.379 -  \begin{rail}
  12.380 -    ('simp' | 'cong' | 'split') (() | 'add' | 'del')
  12.381 -    ;
  12.382 -  \end{rail}
  12.383 +  \begin{railoutput}
  12.384 +\rail@begin{3}{\isa{}}
  12.385 +\rail@bar
  12.386 +\rail@term{\hyperlink{attribute.simp}{\mbox{\isa{simp}}}}[]
  12.387 +\rail@nextbar{1}
  12.388 +\rail@term{\hyperlink{attribute.cong}{\mbox{\isa{cong}}}}[]
  12.389 +\rail@nextbar{2}
  12.390 +\rail@term{\hyperlink{attribute.split}{\mbox{\isa{split}}}}[]
  12.391 +\rail@endbar
  12.392 +\rail@bar
  12.393 +\rail@nextbar{1}
  12.394 +\rail@term{\isa{add}}[]
  12.395 +\rail@nextbar{2}
  12.396 +\rail@term{\isa{del}}[]
  12.397 +\rail@endbar
  12.398 +\rail@end
  12.399 +\end{railoutput}
  12.400 +
  12.401  
  12.402    \begin{description}
  12.403  
  12.404 @@ -490,13 +711,48 @@
  12.405      simproc & : & \isa{attribute} \\
  12.406    \end{matharray}
  12.407  
  12.408 -  \begin{rail}
  12.409 -    'simproc_setup' name '(' (term + '|') ')' '=' text \\ ('identifier' (nameref+))?
  12.410 -    ;
  12.411 +  \begin{railoutput}
  12.412 +\rail@begin{6}{\isa{}}
  12.413 +\rail@term{\hyperlink{command.simproc-setup}{\mbox{\isa{\isacommand{simproc{\isaliteral{5F}{\isacharunderscore}}setup}}}}}[]
  12.414 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  12.415 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  12.416 +\rail@plus
  12.417 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  12.418 +\rail@nextplus{1}
  12.419 +\rail@cterm{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
  12.420 +\rail@endplus
  12.421 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  12.422 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  12.423 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
  12.424 +\rail@cr{3}
  12.425 +\rail@bar
  12.426 +\rail@nextbar{4}
  12.427 +\rail@term{\isa{\isakeyword{identifier}}}[]
  12.428 +\rail@plus
  12.429 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  12.430 +\rail@nextplus{5}
  12.431 +\rail@endplus
  12.432 +\rail@endbar
  12.433 +\rail@end
  12.434 +\rail@begin{3}{\isa{}}
  12.435 +\rail@term{\hyperlink{attribute.simproc}{\mbox{\isa{simproc}}}}[]
  12.436 +\rail@bar
  12.437 +\rail@bar
  12.438 +\rail@nextbar{1}
  12.439 +\rail@term{\isa{add}}[]
  12.440 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  12.441 +\rail@endbar
  12.442 +\rail@nextbar{2}
  12.443 +\rail@term{\isa{del}}[]
  12.444 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  12.445 +\rail@endbar
  12.446 +\rail@plus
  12.447 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  12.448 +\rail@nextplus{1}
  12.449 +\rail@endplus
  12.450 +\rail@end
  12.451 +\end{railoutput}
  12.452  
  12.453 -    'simproc' (('add' ':')? | 'del' ':') (name+)
  12.454 -    ;
  12.455 -  \end{rail}
  12.456  
  12.457    \begin{description}
  12.458  
  12.459 @@ -535,13 +791,31 @@
  12.460      \indexdef{}{attribute}{simplified}\hypertarget{attribute.simplified}{\hyperlink{attribute.simplified}{\mbox{\isa{simplified}}}} & : & \isa{attribute} \\
  12.461    \end{matharray}
  12.462  
  12.463 -  \begin{rail}
  12.464 -    'simplified' opt? thmrefs?
  12.465 -    ;
  12.466 +  \begin{railoutput}
  12.467 +\rail@begin{2}{\isa{}}
  12.468 +\rail@term{\hyperlink{attribute.simplified}{\mbox{\isa{simplified}}}}[]
  12.469 +\rail@bar
  12.470 +\rail@nextbar{1}
  12.471 +\rail@nont{\isa{opt}}[]
  12.472 +\rail@endbar
  12.473 +\rail@bar
  12.474 +\rail@nextbar{1}
  12.475 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  12.476 +\rail@endbar
  12.477 +\rail@end
  12.478 +\rail@begin{3}{\isa{opt}}
  12.479 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  12.480 +\rail@bar
  12.481 +\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}asm}}[]
  12.482 +\rail@nextbar{1}
  12.483 +\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}asm{\isaliteral{5F}{\isacharunderscore}}simp}}[]
  12.484 +\rail@nextbar{2}
  12.485 +\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}asm{\isaliteral{5F}{\isacharunderscore}}use}}[]
  12.486 +\rail@endbar
  12.487 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  12.488 +\rail@end
  12.489 +\end{railoutput}
  12.490  
  12.491 -    opt: '(' ('no_asm' | 'no_asm_simp' | 'no_asm_use') ')'
  12.492 -    ;
  12.493 -  \end{rail}
  12.494  
  12.495    \begin{description}
  12.496    
  12.497 @@ -576,10 +850,22 @@
  12.498      \indexdef{}{method}{elim}\hypertarget{method.elim}{\hyperlink{method.elim}{\mbox{\isa{elim}}}} & : & \isa{method} \\
  12.499    \end{matharray}
  12.500  
  12.501 -  \begin{rail}
  12.502 -    ('rule' | 'intro' | 'elim') thmrefs?
  12.503 -    ;
  12.504 -  \end{rail}
  12.505 +  \begin{railoutput}
  12.506 +\rail@begin{3}{\isa{}}
  12.507 +\rail@bar
  12.508 +\rail@term{\hyperlink{method.rule}{\mbox{\isa{rule}}}}[]
  12.509 +\rail@nextbar{1}
  12.510 +\rail@term{\hyperlink{method.intro}{\mbox{\isa{intro}}}}[]
  12.511 +\rail@nextbar{2}
  12.512 +\rail@term{\hyperlink{method.elim}{\mbox{\isa{elim}}}}[]
  12.513 +\rail@endbar
  12.514 +\rail@bar
  12.515 +\rail@nextbar{1}
  12.516 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  12.517 +\rail@endbar
  12.518 +\rail@end
  12.519 +\end{railoutput}
  12.520 +
  12.521  
  12.522    \begin{description}
  12.523  
  12.524 @@ -623,16 +909,58 @@
  12.525      \indexdef{}{method}{clarify}\hypertarget{method.clarify}{\hyperlink{method.clarify}{\mbox{\isa{clarify}}}} & : & \isa{method} \\
  12.526    \end{matharray}
  12.527  
  12.528 -  \indexouternonterm{clamod}
  12.529 -  \begin{rail}
  12.530 -    'blast' nat? (clamod *)
  12.531 -    ;
  12.532 -    ('fast' | 'slow' | 'best' | 'safe' | 'clarify') (clamod *)
  12.533 -    ;
  12.534 +  \begin{railoutput}
  12.535 +\rail@begin{2}{\isa{}}
  12.536 +\rail@term{\hyperlink{method.blast}{\mbox{\isa{blast}}}}[]
  12.537 +\rail@bar
  12.538 +\rail@nextbar{1}
  12.539 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  12.540 +\rail@endbar
  12.541 +\rail@plus
  12.542 +\rail@nextplus{1}
  12.543 +\rail@cnont{\hyperlink{syntax.clamod}{\mbox{\isa{clamod}}}}[]
  12.544 +\rail@endplus
  12.545 +\rail@end
  12.546 +\rail@begin{5}{\isa{}}
  12.547 +\rail@bar
  12.548 +\rail@term{\hyperlink{method.fast}{\mbox{\isa{fast}}}}[]
  12.549 +\rail@nextbar{1}
  12.550 +\rail@term{\hyperlink{method.slow}{\mbox{\isa{slow}}}}[]
  12.551 +\rail@nextbar{2}
  12.552 +\rail@term{\hyperlink{method.best}{\mbox{\isa{best}}}}[]
  12.553 +\rail@nextbar{3}
  12.554 +\rail@term{\hyperlink{method.safe}{\mbox{\isa{safe}}}}[]
  12.555 +\rail@nextbar{4}
  12.556 +\rail@term{\hyperlink{method.clarify}{\mbox{\isa{clarify}}}}[]
  12.557 +\rail@endbar
  12.558 +\rail@plus
  12.559 +\rail@nextplus{1}
  12.560 +\rail@cnont{\hyperlink{syntax.clamod}{\mbox{\isa{clamod}}}}[]
  12.561 +\rail@endplus
  12.562 +\rail@end
  12.563 +\rail@begin{4}{\indexdef{}{syntax}{clamod}\hypertarget{syntax.clamod}{\hyperlink{syntax.clamod}{\mbox{\isa{clamod}}}}}
  12.564 +\rail@bar
  12.565 +\rail@bar
  12.566 +\rail@term{\isa{intro}}[]
  12.567 +\rail@nextbar{1}
  12.568 +\rail@term{\isa{elim}}[]
  12.569 +\rail@nextbar{2}
  12.570 +\rail@term{\isa{dest}}[]
  12.571 +\rail@endbar
  12.572 +\rail@bar
  12.573 +\rail@term{\isa{{\isaliteral{21}{\isacharbang}}}}[]
  12.574 +\rail@nextbar{1}
  12.575 +\rail@nextbar{2}
  12.576 +\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
  12.577 +\rail@endbar
  12.578 +\rail@nextbar{3}
  12.579 +\rail@term{\isa{del}}[]
  12.580 +\rail@endbar
  12.581 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  12.582 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  12.583 +\rail@end
  12.584 +\end{railoutput}
  12.585  
  12.586 -    clamod: (('intro' | 'elim' | 'dest') ('!' | () | '?') | 'del') ':' thmrefs
  12.587 -    ;
  12.588 -  \end{rail}
  12.589  
  12.590    \begin{description}
  12.591  
  12.592 @@ -667,18 +995,97 @@
  12.593      \indexdef{}{method}{bestsimp}\hypertarget{method.bestsimp}{\hyperlink{method.bestsimp}{\mbox{\isa{bestsimp}}}} & : & \isa{method} \\
  12.594    \end{matharray}
  12.595  
  12.596 -  \indexouternonterm{clasimpmod}
  12.597 -  \begin{rail}
  12.598 -    'auto' (nat nat)? (clasimpmod *)
  12.599 -    ;
  12.600 -    ('force' | 'clarsimp' | 'fastsimp' | 'slowsimp' | 'bestsimp') (clasimpmod *)
  12.601 -    ;
  12.602 +  \begin{railoutput}
  12.603 +\rail@begin{2}{\isa{}}
  12.604 +\rail@term{\hyperlink{method.auto}{\mbox{\isa{auto}}}}[]
  12.605 +\rail@bar
  12.606 +\rail@nextbar{1}
  12.607 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  12.608 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  12.609 +\rail@endbar
  12.610 +\rail@plus
  12.611 +\rail@nextplus{1}
  12.612 +\rail@cnont{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}[]
  12.613 +\rail@endplus
  12.614 +\rail@end
  12.615 +\rail@begin{5}{\isa{}}
  12.616 +\rail@bar
  12.617 +\rail@term{\hyperlink{method.force}{\mbox{\isa{force}}}}[]
  12.618 +\rail@nextbar{1}
  12.619 +\rail@term{\hyperlink{method.clarsimp}{\mbox{\isa{clarsimp}}}}[]
  12.620 +\rail@nextbar{2}
  12.621 +\rail@term{\hyperlink{method.fastsimp}{\mbox{\isa{fastsimp}}}}[]
  12.622 +\rail@nextbar{3}
  12.623 +\rail@term{\hyperlink{method.slowsimp}{\mbox{\isa{slowsimp}}}}[]
  12.624 +\rail@nextbar{4}
  12.625 +\rail@term{\hyperlink{method.bestsimp}{\mbox{\isa{bestsimp}}}}[]
  12.626 +\rail@endbar
  12.627 +\rail@plus
  12.628 +\rail@nextplus{1}
  12.629 +\rail@cnont{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}[]
  12.630 +\rail@endplus
  12.631 +\rail@end
  12.632 +\rail@begin{14}{\indexdef{}{syntax}{clasimpmod}\hypertarget{syntax.clasimpmod}{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}}
  12.633 +\rail@bar
  12.634 +\rail@term{\isa{simp}}[]
  12.635 +\rail@bar
  12.636 +\rail@nextbar{1}
  12.637 +\rail@term{\isa{add}}[]
  12.638 +\rail@nextbar{2}
  12.639 +\rail@term{\isa{del}}[]
  12.640 +\rail@nextbar{3}
  12.641 +\rail@term{\isa{only}}[]
  12.642 +\rail@endbar
  12.643 +\rail@nextbar{4}
  12.644 +\rail@bar
  12.645 +\rail@term{\isa{cong}}[]
  12.646 +\rail@nextbar{5}
  12.647 +\rail@term{\isa{split}}[]
  12.648 +\rail@endbar
  12.649 +\rail@bar
  12.650 +\rail@nextbar{5}
  12.651 +\rail@term{\isa{add}}[]
  12.652 +\rail@nextbar{6}
  12.653 +\rail@term{\isa{del}}[]
  12.654 +\rail@endbar
  12.655 +\rail@nextbar{7}
  12.656 +\rail@term{\isa{iff}}[]
  12.657 +\rail@bar
  12.658 +\rail@bar
  12.659 +\rail@nextbar{8}
  12.660 +\rail@term{\isa{add}}[]
  12.661 +\rail@endbar
  12.662 +\rail@bar
  12.663 +\rail@nextbar{8}
  12.664 +\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
  12.665 +\rail@endbar
  12.666 +\rail@nextbar{9}
  12.667 +\rail@term{\isa{del}}[]
  12.668 +\rail@endbar
  12.669 +\rail@nextbar{10}
  12.670 +\rail@bar
  12.671 +\rail@bar
  12.672 +\rail@term{\isa{intro}}[]
  12.673 +\rail@nextbar{11}
  12.674 +\rail@term{\isa{elim}}[]
  12.675 +\rail@nextbar{12}
  12.676 +\rail@term{\isa{dest}}[]
  12.677 +\rail@endbar
  12.678 +\rail@bar
  12.679 +\rail@term{\isa{{\isaliteral{21}{\isacharbang}}}}[]
  12.680 +\rail@nextbar{11}
  12.681 +\rail@nextbar{12}
  12.682 +\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
  12.683 +\rail@endbar
  12.684 +\rail@nextbar{13}
  12.685 +\rail@term{\isa{del}}[]
  12.686 +\rail@endbar
  12.687 +\rail@endbar
  12.688 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  12.689 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  12.690 +\rail@end
  12.691 +\end{railoutput}
  12.692  
  12.693 -    clasimpmod: ('simp' (() | 'add' | 'del' | 'only') |
  12.694 -      ('cong' | 'split') (() | 'add' | 'del') |
  12.695 -      'iff' (((() | 'add') '?'?) | 'del') |
  12.696 -      (('intro' | 'elim' | 'dest') ('!' | () | '?') | 'del')) ':' thmrefs
  12.697 -  \end{rail}
  12.698  
  12.699    \begin{description}
  12.700  
  12.701 @@ -688,7 +1095,7 @@
  12.702    added as wrapper, see \cite{isabelle-ref} for more information.  The
  12.703    modifier arguments correspond to those given in
  12.704    \secref{sec:simplifier} and \secref{sec:classical}.  Just note that
  12.705 -  the ones related to the Simplifier are prefixed by \railtterm{simp}
  12.706 +  the ones related to the Simplifier are prefixed by \isa{simp}
  12.707    here.
  12.708  
  12.709    Facts provided by forward chaining are inserted into the goal before
  12.710 @@ -712,14 +1119,47 @@
  12.711      \indexdef{}{attribute}{iff}\hypertarget{attribute.iff}{\hyperlink{attribute.iff}{\mbox{\isa{iff}}}} & : & \isa{attribute} \\
  12.712    \end{matharray}
  12.713  
  12.714 -  \begin{rail}
  12.715 -    ('intro' | 'elim' | 'dest') ('!' | () | '?') nat?
  12.716 -    ;
  12.717 -    'rule' 'del'
  12.718 -    ;
  12.719 -    'iff' (((() | 'add') '?'?) | 'del')
  12.720 -    ;
  12.721 -  \end{rail}
  12.722 +  \begin{railoutput}
  12.723 +\rail@begin{3}{\isa{}}
  12.724 +\rail@bar
  12.725 +\rail@term{\hyperlink{attribute.intro}{\mbox{\isa{intro}}}}[]
  12.726 +\rail@nextbar{1}
  12.727 +\rail@term{\hyperlink{attribute.elim}{\mbox{\isa{elim}}}}[]
  12.728 +\rail@nextbar{2}
  12.729 +\rail@term{\hyperlink{attribute.dest}{\mbox{\isa{dest}}}}[]
  12.730 +\rail@endbar
  12.731 +\rail@bar
  12.732 +\rail@term{\isa{{\isaliteral{21}{\isacharbang}}}}[]
  12.733 +\rail@nextbar{1}
  12.734 +\rail@nextbar{2}
  12.735 +\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
  12.736 +\rail@endbar
  12.737 +\rail@bar
  12.738 +\rail@nextbar{1}
  12.739 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  12.740 +\rail@endbar
  12.741 +\rail@end
  12.742 +\rail@begin{1}{\isa{}}
  12.743 +\rail@term{\hyperlink{attribute.rule}{\mbox{\isa{rule}}}}[]
  12.744 +\rail@term{\isa{del}}[]
  12.745 +\rail@end
  12.746 +\rail@begin{3}{\isa{}}
  12.747 +\rail@term{\hyperlink{attribute.iff}{\mbox{\isa{iff}}}}[]
  12.748 +\rail@bar
  12.749 +\rail@bar
  12.750 +\rail@nextbar{1}
  12.751 +\rail@term{\isa{add}}[]
  12.752 +\rail@endbar
  12.753 +\rail@bar
  12.754 +\rail@nextbar{1}
  12.755 +\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
  12.756 +\rail@endbar
  12.757 +\rail@nextbar{2}
  12.758 +\rail@term{\isa{del}}[]
  12.759 +\rail@endbar
  12.760 +\rail@end
  12.761 +\end{railoutput}
  12.762 +
  12.763  
  12.764    \begin{description}
  12.765  
  12.766 @@ -805,14 +1245,31 @@
  12.767    Generic tools may refer to the information provided by object-logic
  12.768    declarations internally.
  12.769  
  12.770 -  \begin{rail}
  12.771 -    'judgment' constdecl
  12.772 -    ;
  12.773 -    'atomize' ('(' 'full' ')')?
  12.774 -    ;
  12.775 -    'rule_format' ('(' 'noasm' ')')?
  12.776 -    ;
  12.777 -  \end{rail}
  12.778 +  \begin{railoutput}
  12.779 +\rail@begin{1}{\isa{}}
  12.780 +\rail@term{\hyperlink{command.judgment}{\mbox{\isa{\isacommand{judgment}}}}}[]
  12.781 +\rail@nont{\hyperlink{syntax.constdecl}{\mbox{\isa{constdecl}}}}[]
  12.782 +\rail@end
  12.783 +\rail@begin{2}{\isa{}}
  12.784 +\rail@term{\hyperlink{attribute.atomize}{\mbox{\isa{atomize}}}}[]
  12.785 +\rail@bar
  12.786 +\rail@nextbar{1}
  12.787 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  12.788 +\rail@term{\isa{full}}[]
  12.789 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  12.790 +\rail@endbar
  12.791 +\rail@end
  12.792 +\rail@begin{2}{\isa{}}
  12.793 +\rail@term{\hyperlink{attribute.rule-format}{\mbox{\isa{rule{\isaliteral{5F}{\isacharunderscore}}format}}}}[]
  12.794 +\rail@bar
  12.795 +\rail@nextbar{1}
  12.796 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  12.797 +\rail@term{\isa{noasm}}[]
  12.798 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  12.799 +\rail@endbar
  12.800 +\rail@end
  12.801 +\end{railoutput}
  12.802 +
  12.803  
  12.804    \begin{description}
  12.805    
    13.1 --- a/doc-src/IsarRef/Thy/document/HOLCF_Specific.tex	Sun May 01 18:57:45 2011 +0200
    13.2 +++ b/doc-src/IsarRef/Thy/document/HOLCF_Specific.tex	Mon May 02 01:05:50 2011 +0200
    13.3 @@ -54,16 +54,49 @@
    13.4      \indexdef{HOLCF}{command}{domain}\hypertarget{command.HOLCF.domain}{\hyperlink{command.HOLCF.domain}{\mbox{\isa{\isacommand{domain}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
    13.5    \end{matharray}
    13.6  
    13.7 -  \begin{rail}
    13.8 -    'domain' parname? (dmspec + 'and')
    13.9 -    ;
   13.10 +  \begin{railoutput}
   13.11 +\rail@begin{2}{\isa{}}
   13.12 +\rail@term{\hyperlink{command.HOLCF.domain}{\mbox{\isa{\isacommand{domain}}}}}[]
   13.13 +\rail@bar
   13.14 +\rail@nextbar{1}
   13.15 +\rail@nont{\hyperlink{syntax.parname}{\mbox{\isa{parname}}}}[]
   13.16 +\rail@endbar
   13.17 +\rail@plus
   13.18 +\rail@nont{\isa{dmspec}}[]
   13.19 +\rail@nextplus{1}
   13.20 +\rail@cterm{\isa{\isakeyword{and}}}[]
   13.21 +\rail@endplus
   13.22 +\rail@end
   13.23 +\rail@begin{2}{\isa{dmspec}}
   13.24 +\rail@nont{\hyperlink{syntax.typespec}{\mbox{\isa{typespec}}}}[]
   13.25 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
   13.26 +\rail@plus
   13.27 +\rail@nont{\isa{cons}}[]
   13.28 +\rail@nextplus{1}
   13.29 +\rail@cterm{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
   13.30 +\rail@endplus
   13.31 +\rail@end
   13.32 +\rail@begin{2}{\isa{cons}}
   13.33 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   13.34 +\rail@plus
   13.35 +\rail@nextplus{1}
   13.36 +\rail@cnont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
   13.37 +\rail@endplus
   13.38 +\rail@bar
   13.39 +\rail@nextbar{1}
   13.40 +\rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
   13.41 +\rail@endbar
   13.42 +\rail@end
   13.43 +\rail@begin{1}{\isa{dtrules}}
   13.44 +\rail@term{\isa{\isakeyword{distinct}}}[]
   13.45 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
   13.46 +\rail@term{\isa{\isakeyword{inject}}}[]
   13.47 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
   13.48 +\rail@term{\isa{\isakeyword{induction}}}[]
   13.49 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
   13.50 +\rail@end
   13.51 +\end{railoutput}
   13.52  
   13.53 -    dmspec: typespec '=' (cons + '|')
   13.54 -    ;
   13.55 -    cons: name (type *) mixfix?
   13.56 -    ;
   13.57 -    dtrules: 'distinct' thmrefs 'inject' thmrefs 'induction' thmrefs
   13.58 -  \end{rail}
   13.59  
   13.60    Recursive domains in HOLCF are analogous to datatypes in classical
   13.61    HOL (cf.\ \secref{sec:hol-datatype}).  Mutual recursion is
    14.1 --- a/doc-src/IsarRef/Thy/document/HOL_Specific.tex	Sun May 01 18:57:45 2011 +0200
    14.2 +++ b/doc-src/IsarRef/Thy/document/HOL_Specific.tex	Mon May 02 01:05:50 2011 +0200
    14.3 @@ -31,17 +31,47 @@
    14.4      \indexdef{HOL}{command}{typedef}\hypertarget{command.HOL.typedef}{\hyperlink{command.HOL.typedef}{\mbox{\isa{\isacommand{typedef}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
    14.5    \end{matharray}
    14.6  
    14.7 -  \begin{rail}
    14.8 -    'typedef' altname? abstype '=' repset
    14.9 -    ;
   14.10 +  \begin{railoutput}
   14.11 +\rail@begin{2}{\isa{}}
   14.12 +\rail@term{\hyperlink{command.HOL.typedef}{\mbox{\isa{\isacommand{typedef}}}}}[]
   14.13 +\rail@bar
   14.14 +\rail@nextbar{1}
   14.15 +\rail@nont{\isa{altname}}[]
   14.16 +\rail@endbar
   14.17 +\rail@nont{\isa{abstype}}[]
   14.18 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
   14.19 +\rail@nont{\isa{repset}}[]
   14.20 +\rail@end
   14.21 +\rail@begin{3}{\isa{altname}}
   14.22 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
   14.23 +\rail@bar
   14.24 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   14.25 +\rail@nextbar{1}
   14.26 +\rail@term{\isa{\isakeyword{open}}}[]
   14.27 +\rail@nextbar{2}
   14.28 +\rail@term{\isa{\isakeyword{open}}}[]
   14.29 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   14.30 +\rail@endbar
   14.31 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
   14.32 +\rail@end
   14.33 +\rail@begin{2}{\isa{abstype}}
   14.34 +\rail@nont{\hyperlink{syntax.typespecsorts}{\mbox{\isa{typespecsorts}}}}[]
   14.35 +\rail@bar
   14.36 +\rail@nextbar{1}
   14.37 +\rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
   14.38 +\rail@endbar
   14.39 +\rail@end
   14.40 +\rail@begin{2}{\isa{repset}}
   14.41 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
   14.42 +\rail@bar
   14.43 +\rail@nextbar{1}
   14.44 +\rail@term{\isa{\isakeyword{morphisms}}}[]
   14.45 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   14.46 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   14.47 +\rail@endbar
   14.48 +\rail@end
   14.49 +\end{railoutput}
   14.50  
   14.51 -    altname: '(' (name | 'open' | 'open' name) ')'
   14.52 -    ;
   14.53 -    abstype: typespecsorts mixfix?
   14.54 -    ;
   14.55 -    repset: term ('morphisms' name name)?
   14.56 -    ;
   14.57 -  \end{rail}
   14.58  
   14.59    \begin{description}
   14.60  
   14.61 @@ -89,13 +119,21 @@
   14.62  %
   14.63  \begin{isamarkuptext}%
   14.64  \begin{matharray}{rcl}
   14.65 -    \hyperlink{attribute.HOL.split-format}{\mbox{\isa{split{\isaliteral{5F}{\isacharunderscore}}format}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{attribute} \\
   14.66 +    \indexdef{HOL}{attribute}{split\_format}\hypertarget{attribute.HOL.split-format}{\hyperlink{attribute.HOL.split-format}{\mbox{\isa{split{\isaliteral{5F}{\isacharunderscore}}format}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{attribute} \\
   14.67    \end{matharray}
   14.68  
   14.69 -  \begin{rail}
   14.70 -    'split_format' '(' 'complete' ')'
   14.71 -    ;
   14.72 -  \end{rail}
   14.73 +  \begin{railoutput}
   14.74 +\rail@begin{2}{\isa{}}
   14.75 +\rail@term{\hyperlink{attribute.HOL.split-format}{\mbox{\isa{split{\isaliteral{5F}{\isacharunderscore}}format}}}}[]
   14.76 +\rail@bar
   14.77 +\rail@nextbar{1}
   14.78 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
   14.79 +\rail@term{\isa{complete}}[]
   14.80 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
   14.81 +\rail@endbar
   14.82 +\rail@end
   14.83 +\end{railoutput}
   14.84 +
   14.85  
   14.86    \begin{description}
   14.87  
   14.88 @@ -198,10 +236,23 @@
   14.89      \indexdef{HOL}{command}{record}\hypertarget{command.HOL.record}{\hyperlink{command.HOL.record}{\mbox{\isa{\isacommand{record}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
   14.90    \end{matharray}
   14.91  
   14.92 -  \begin{rail}
   14.93 -    'record' typespecsorts '=' (type '+')? (constdecl +)
   14.94 -    ;
   14.95 -  \end{rail}
   14.96 +  \begin{railoutput}
   14.97 +\rail@begin{2}{\isa{}}
   14.98 +\rail@term{\hyperlink{command.HOL.record}{\mbox{\isa{\isacommand{record}}}}}[]
   14.99 +\rail@nont{\hyperlink{syntax.typespecsorts}{\mbox{\isa{typespecsorts}}}}[]
  14.100 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  14.101 +\rail@bar
  14.102 +\rail@nextbar{1}
  14.103 +\rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
  14.104 +\rail@term{\isa{{\isaliteral{2B}{\isacharplus}}}}[]
  14.105 +\rail@endbar
  14.106 +\rail@plus
  14.107 +\rail@nont{\hyperlink{syntax.constdecl}{\mbox{\isa{constdecl}}}}[]
  14.108 +\rail@nextplus{1}
  14.109 +\rail@endplus
  14.110 +\rail@end
  14.111 +\end{railoutput}
  14.112 +
  14.113  
  14.114    \begin{description}
  14.115  
  14.116 @@ -358,16 +409,61 @@
  14.117      \indexdef{HOL}{command}{rep\_datatype}\hypertarget{command.HOL.rep-datatype}{\hyperlink{command.HOL.rep-datatype}{\mbox{\isa{\isacommand{rep{\isaliteral{5F}{\isacharunderscore}}datatype}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
  14.118    \end{matharray}
  14.119  
  14.120 -  \begin{rail}
  14.121 -    'datatype' (dtspec + 'and')
  14.122 -    ;
  14.123 -    'rep_datatype' ('(' (name +) ')')? (term +)
  14.124 -    ;
  14.125 +  \begin{railoutput}
  14.126 +\rail@begin{2}{\isa{}}
  14.127 +\rail@term{\hyperlink{command.HOL.datatype}{\mbox{\isa{\isacommand{datatype}}}}}[]
  14.128 +\rail@plus
  14.129 +\rail@nont{\isa{dtspec}}[]
  14.130 +\rail@nextplus{1}
  14.131 +\rail@cterm{\isa{\isakeyword{and}}}[]
  14.132 +\rail@endplus
  14.133 +\rail@end
  14.134 +\rail@begin{3}{\isa{}}
  14.135 +\rail@term{\hyperlink{command.HOL.rep-datatype}{\mbox{\isa{\isacommand{rep{\isaliteral{5F}{\isacharunderscore}}datatype}}}}}[]
  14.136 +\rail@bar
  14.137 +\rail@nextbar{1}
  14.138 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  14.139 +\rail@plus
  14.140 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  14.141 +\rail@nextplus{2}
  14.142 +\rail@endplus
  14.143 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  14.144 +\rail@endbar
  14.145 +\rail@plus
  14.146 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  14.147 +\rail@nextplus{1}
  14.148 +\rail@endplus
  14.149 +\rail@end
  14.150 +\rail@begin{2}{\isa{dtspec}}
  14.151 +\rail@bar
  14.152 +\rail@nextbar{1}
  14.153 +\rail@nont{\hyperlink{syntax.parname}{\mbox{\isa{parname}}}}[]
  14.154 +\rail@endbar
  14.155 +\rail@nont{\hyperlink{syntax.typespec}{\mbox{\isa{typespec}}}}[]
  14.156 +\rail@bar
  14.157 +\rail@nextbar{1}
  14.158 +\rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
  14.159 +\rail@endbar
  14.160 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  14.161 +\rail@plus
  14.162 +\rail@nont{\isa{cons}}[]
  14.163 +\rail@nextplus{1}
  14.164 +\rail@cterm{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
  14.165 +\rail@endplus
  14.166 +\rail@end
  14.167 +\rail@begin{2}{\isa{cons}}
  14.168 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  14.169 +\rail@plus
  14.170 +\rail@nextplus{1}
  14.171 +\rail@cnont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
  14.172 +\rail@endplus
  14.173 +\rail@bar
  14.174 +\rail@nextbar{1}
  14.175 +\rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
  14.176 +\rail@endbar
  14.177 +\rail@end
  14.178 +\end{railoutput}
  14.179  
  14.180 -    dtspec: parname? typespec mixfix? '=' (cons + '|')
  14.181 -    ;
  14.182 -    cons: name ( type * ) mixfix?
  14.183 -  \end{rail}
  14.184  
  14.185    \begin{description}
  14.186  
  14.187 @@ -402,10 +498,18 @@
  14.188      \indexdef{HOL}{command}{enriched\_type}\hypertarget{command.HOL.enriched-type}{\hyperlink{command.HOL.enriched-type}{\mbox{\isa{\isacommand{enriched{\isaliteral{5F}{\isacharunderscore}}type}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}
  14.189    \end{matharray}
  14.190  
  14.191 -  \begin{rail}
  14.192 -    'enriched_type' (prefix ':')? term
  14.193 -    ;
  14.194 -  \end{rail}
  14.195 +  \begin{railoutput}
  14.196 +\rail@begin{2}{\isa{}}
  14.197 +\rail@term{\hyperlink{command.HOL.enriched-type}{\mbox{\isa{\isacommand{enriched{\isaliteral{5F}{\isacharunderscore}}type}}}}}[]
  14.198 +\rail@bar
  14.199 +\rail@nextbar{1}
  14.200 +\rail@nont{\isa{prefix}}[]
  14.201 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  14.202 +\rail@endbar
  14.203 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  14.204 +\rail@end
  14.205 +\end{railoutput}
  14.206 + % FIXME check prefix
  14.207  
  14.208    \begin{description}
  14.209  
  14.210 @@ -447,17 +551,69 @@
  14.211      \indexdef{HOL}{command}{termination}\hypertarget{command.HOL.termination}{\hyperlink{command.HOL.termination}{\mbox{\isa{\isacommand{termination}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
  14.212    \end{matharray}
  14.213  
  14.214 -  \begin{rail}
  14.215 -    'primrec' target? fixes 'where' equations
  14.216 -    ;
  14.217 -    ('fun' | 'function') target? functionopts? fixes \\ 'where' equations
  14.218 -    ;
  14.219 -    equations: (thmdecl? prop + '|')
  14.220 -    ;
  14.221 -    functionopts: '(' (('sequential' | 'domintros') + ',') ')'
  14.222 -    ;
  14.223 -    'termination' ( term )?
  14.224 -  \end{rail}
  14.225 +  \begin{railoutput}
  14.226 +\rail@begin{2}{\isa{}}
  14.227 +\rail@term{\hyperlink{command.HOL.primrec}{\mbox{\isa{\isacommand{primrec}}}}}[]
  14.228 +\rail@bar
  14.229 +\rail@nextbar{1}
  14.230 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
  14.231 +\rail@endbar
  14.232 +\rail@nont{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}[]
  14.233 +\rail@term{\isa{\isakeyword{where}}}[]
  14.234 +\rail@nont{\isa{equations}}[]
  14.235 +\rail@end
  14.236 +\rail@begin{4}{\isa{}}
  14.237 +\rail@bar
  14.238 +\rail@term{\hyperlink{command.HOL.fun}{\mbox{\isa{\isacommand{fun}}}}}[]
  14.239 +\rail@nextbar{1}
  14.240 +\rail@term{\hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}}}[]
  14.241 +\rail@endbar
  14.242 +\rail@bar
  14.243 +\rail@nextbar{1}
  14.244 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
  14.245 +\rail@endbar
  14.246 +\rail@bar
  14.247 +\rail@nextbar{1}
  14.248 +\rail@nont{\isa{functionopts}}[]
  14.249 +\rail@endbar
  14.250 +\rail@nont{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}[]
  14.251 +\rail@cr{3}
  14.252 +\rail@term{\isa{\isakeyword{where}}}[]
  14.253 +\rail@nont{\isa{equations}}[]
  14.254 +\rail@end
  14.255 +\rail@begin{3}{\isa{equations}}
  14.256 +\rail@plus
  14.257 +\rail@bar
  14.258 +\rail@nextbar{1}
  14.259 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
  14.260 +\rail@endbar
  14.261 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  14.262 +\rail@nextplus{2}
  14.263 +\rail@cterm{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
  14.264 +\rail@endplus
  14.265 +\rail@end
  14.266 +\rail@begin{3}{\isa{functionopts}}
  14.267 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  14.268 +\rail@plus
  14.269 +\rail@bar
  14.270 +\rail@term{\isa{sequential}}[]
  14.271 +\rail@nextbar{1}
  14.272 +\rail@term{\isa{domintros}}[]
  14.273 +\rail@endbar
  14.274 +\rail@nextplus{2}
  14.275 +\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  14.276 +\rail@endplus
  14.277 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  14.278 +\rail@end
  14.279 +\rail@begin{2}{\isa{}}
  14.280 +\rail@term{\hyperlink{command.HOL.termination}{\mbox{\isa{\isacommand{termination}}}}}[]
  14.281 +\rail@bar
  14.282 +\rail@nextbar{1}
  14.283 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  14.284 +\rail@endbar
  14.285 +\rail@end
  14.286 +\end{railoutput}
  14.287 +
  14.288  
  14.289    \begin{description}
  14.290  
  14.291 @@ -539,15 +695,40 @@
  14.292      \indexdef{HOL}{method}{size\_change}\hypertarget{method.HOL.size-change}{\hyperlink{method.HOL.size-change}{\mbox{\isa{size{\isaliteral{5F}{\isacharunderscore}}change}}}} & : & \isa{method} \\
  14.293    \end{matharray}
  14.294  
  14.295 -  \begin{rail}
  14.296 -    'relation' term
  14.297 -    ;
  14.298 -    'lexicographic_order' ( clasimpmod * )
  14.299 -    ;
  14.300 -    'size_change' ( orders ( clasimpmod * ) )
  14.301 -    ;
  14.302 -    orders: ( 'max' | 'min' | 'ms' ) *
  14.303 -  \end{rail}
  14.304 +  \begin{railoutput}
  14.305 +\rail@begin{1}{\isa{}}
  14.306 +\rail@term{\hyperlink{method.HOL.relation}{\mbox{\isa{relation}}}}[]
  14.307 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  14.308 +\rail@end
  14.309 +\rail@begin{2}{\isa{}}
  14.310 +\rail@term{\hyperlink{method.HOL.lexicographic-order}{\mbox{\isa{lexicographic{\isaliteral{5F}{\isacharunderscore}}order}}}}[]
  14.311 +\rail@plus
  14.312 +\rail@nextplus{1}
  14.313 +\rail@cnont{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}[]
  14.314 +\rail@endplus
  14.315 +\rail@end
  14.316 +\rail@begin{2}{\isa{}}
  14.317 +\rail@term{\hyperlink{method.HOL.size-change}{\mbox{\isa{size{\isaliteral{5F}{\isacharunderscore}}change}}}}[]
  14.318 +\rail@nont{\isa{orders}}[]
  14.319 +\rail@plus
  14.320 +\rail@nextplus{1}
  14.321 +\rail@cnont{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}[]
  14.322 +\rail@endplus
  14.323 +\rail@end
  14.324 +\rail@begin{4}{\isa{orders}}
  14.325 +\rail@plus
  14.326 +\rail@nextplus{1}
  14.327 +\rail@bar
  14.328 +\rail@term{\isa{max}}[]
  14.329 +\rail@nextbar{2}
  14.330 +\rail@term{\isa{min}}[]
  14.331 +\rail@nextbar{3}
  14.332 +\rail@term{\isa{ms}}[]
  14.333 +\rail@endbar
  14.334 +\rail@endplus
  14.335 +\rail@end
  14.336 +\end{railoutput}
  14.337 +
  14.338  
  14.339    \begin{description}
  14.340  
  14.341 @@ -599,9 +780,27 @@
  14.342      \indexdef{HOL}{attribute}{partial\_function\_mono}\hypertarget{attribute.HOL.partial-function-mono}{\hyperlink{attribute.HOL.partial-function-mono}{\mbox{\isa{partial{\isaliteral{5F}{\isacharunderscore}}function{\isaliteral{5F}{\isacharunderscore}}mono}}}} & : & \isa{attribute} \\
  14.343    \end{matharray}
  14.344  
  14.345 -  \begin{rail}
  14.346 -    'partial_function' target? '(' mode ')' fixes \\ 'where' thmdecl? prop
  14.347 -  \end{rail}
  14.348 +  \begin{railoutput}
  14.349 +\rail@begin{5}{\isa{}}
  14.350 +\rail@term{\hyperlink{command.HOL.partial-function}{\mbox{\isa{\isacommand{partial{\isaliteral{5F}{\isacharunderscore}}function}}}}}[]
  14.351 +\rail@bar
  14.352 +\rail@nextbar{1}
  14.353 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
  14.354 +\rail@endbar
  14.355 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  14.356 +\rail@nont{\isa{mode}}[]
  14.357 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  14.358 +\rail@nont{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}[]
  14.359 +\rail@cr{3}
  14.360 +\rail@term{\isa{\isakeyword{where}}}[]
  14.361 +\rail@bar
  14.362 +\rail@nextbar{4}
  14.363 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
  14.364 +\rail@endbar
  14.365 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  14.366 +\rail@end
  14.367 +\end{railoutput}
  14.368 + % FIXME check mode
  14.369  
  14.370    \begin{description}
  14.371  
  14.372 @@ -666,18 +865,76 @@
  14.373      \indexdef{HOL}{command}{recdef\_tc}\hypertarget{command.HOL.recdef-tc}{\hyperlink{command.HOL.recdef-tc}{\mbox{\isa{\isacommand{recdef{\isaliteral{5F}{\isacharunderscore}}tc}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
  14.374    \end{matharray}
  14.375  
  14.376 -  \begin{rail}
  14.377 -    'recdef' ('(' 'permissive' ')')? \\ name term (prop +) hints?
  14.378 -    ;
  14.379 -    recdeftc thmdecl? tc
  14.380 -    ;
  14.381 -    hints: '(' 'hints' ( recdefmod * ) ')'
  14.382 -    ;
  14.383 -    recdefmod: (('recdef_simp' | 'recdef_cong' | 'recdef_wf') (() | 'add' | 'del') ':' thmrefs) | clasimpmod
  14.384 -    ;
  14.385 -    tc: nameref ('(' nat ')')?
  14.386 -    ;
  14.387 -  \end{rail}
  14.388 +  \begin{railoutput}
  14.389 +\rail@begin{5}{\isa{}}
  14.390 +\rail@term{\hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}}}[]
  14.391 +\rail@bar
  14.392 +\rail@nextbar{1}
  14.393 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  14.394 +\rail@term{\isa{\isakeyword{permissive}}}[]
  14.395 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  14.396 +\rail@endbar
  14.397 +\rail@cr{3}
  14.398 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  14.399 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  14.400 +\rail@plus
  14.401 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  14.402 +\rail@nextplus{4}
  14.403 +\rail@endplus
  14.404 +\rail@bar
  14.405 +\rail@nextbar{4}
  14.406 +\rail@nont{\isa{hints}}[]
  14.407 +\rail@endbar
  14.408 +\rail@end
  14.409 +\rail@begin{2}{\isa{}}
  14.410 +\rail@nont{\isa{recdeftc}}[]
  14.411 +\rail@bar
  14.412 +\rail@nextbar{1}
  14.413 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
  14.414 +\rail@endbar
  14.415 +\rail@nont{\isa{tc}}[]
  14.416 +\rail@end
  14.417 +\rail@begin{2}{\isa{hints}}
  14.418 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  14.419 +\rail@term{\isa{\isakeyword{hints}}}[]
  14.420 +\rail@plus
  14.421 +\rail@nextplus{1}
  14.422 +\rail@cnont{\isa{recdefmod}}[]
  14.423 +\rail@endplus
  14.424 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  14.425 +\rail@end
  14.426 +\rail@begin{4}{\isa{recdefmod}}
  14.427 +\rail@bar
  14.428 +\rail@bar
  14.429 +\rail@term{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}simp}}[]
  14.430 +\rail@nextbar{1}
  14.431 +\rail@term{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}cong}}[]
  14.432 +\rail@nextbar{2}
  14.433 +\rail@term{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}wf}}[]
  14.434 +\rail@endbar
  14.435 +\rail@bar
  14.436 +\rail@nextbar{1}
  14.437 +\rail@term{\isa{add}}[]
  14.438 +\rail@nextbar{2}
  14.439 +\rail@term{\isa{del}}[]
  14.440 +\rail@endbar
  14.441 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  14.442 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  14.443 +\rail@nextbar{3}
  14.444 +\rail@nont{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}[]
  14.445 +\rail@endbar
  14.446 +\rail@end
  14.447 +\rail@begin{2}{\isa{tc}}
  14.448 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  14.449 +\rail@bar
  14.450 +\rail@nextbar{1}
  14.451 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  14.452 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  14.453 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  14.454 +\rail@endbar
  14.455 +\rail@end
  14.456 +\end{railoutput}
  14.457 +
  14.458  
  14.459    \begin{description}
  14.460  
  14.461 @@ -710,10 +967,23 @@
  14.462      \indexdef{HOL}{attribute}{recdef\_wf}\hypertarget{attribute.HOL.recdef-wf}{\hyperlink{attribute.HOL.recdef-wf}{\mbox{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}wf}}}} & : & \isa{attribute} \\
  14.463    \end{matharray}
  14.464  
  14.465 -  \begin{rail}
  14.466 -    ('recdef_simp' | 'recdef_cong' | 'recdef_wf') (() | 'add' | 'del')
  14.467 -    ;
  14.468 -  \end{rail}%
  14.469 +  \begin{railoutput}
  14.470 +\rail@begin{3}{\isa{}}
  14.471 +\rail@bar
  14.472 +\rail@term{\hyperlink{attribute.HOL.recdef-simp}{\mbox{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}simp}}}}[]
  14.473 +\rail@nextbar{1}
  14.474 +\rail@term{\hyperlink{attribute.HOL.recdef-cong}{\mbox{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}cong}}}}[]
  14.475 +\rail@nextbar{2}
  14.476 +\rail@term{\hyperlink{attribute.HOL.recdef-wf}{\mbox{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}wf}}}}[]
  14.477 +\rail@endbar
  14.478 +\rail@bar
  14.479 +\rail@nextbar{1}
  14.480 +\rail@term{\isa{add}}[]
  14.481 +\rail@nextbar{2}
  14.482 +\rail@term{\isa{del}}[]
  14.483 +\rail@endbar
  14.484 +\rail@end
  14.485 +\end{railoutput}%
  14.486  \end{isamarkuptext}%
  14.487  \isamarkuptrue%
  14.488  %
  14.489 @@ -752,15 +1022,61 @@
  14.490      \indexdef{HOL}{attribute}{mono}\hypertarget{attribute.HOL.mono}{\hyperlink{attribute.HOL.mono}{\mbox{\isa{mono}}}} & : & \isa{attribute} \\
  14.491    \end{matharray}
  14.492  
  14.493 -  \begin{rail}
  14.494 -    ('inductive' | 'inductive_set' | 'coinductive' | 'coinductive_set') target? fixes ('for' fixes)? \\
  14.495 -    ('where' clauses)? ('monos' thmrefs)?
  14.496 -    ;
  14.497 -    clauses: (thmdecl? prop + '|')
  14.498 -    ;
  14.499 -    'mono' (() | 'add' | 'del')
  14.500 -    ;
  14.501 -  \end{rail}
  14.502 +  \begin{railoutput}
  14.503 +\rail@begin{7}{\isa{}}
  14.504 +\rail@bar
  14.505 +\rail@term{\hyperlink{command.HOL.inductive}{\mbox{\isa{\isacommand{inductive}}}}}[]
  14.506 +\rail@nextbar{1}
  14.507 +\rail@term{\hyperlink{command.HOL.inductive-set}{\mbox{\isa{\isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}set}}}}}[]
  14.508 +\rail@nextbar{2}
  14.509 +\rail@term{\hyperlink{command.HOL.coinductive}{\mbox{\isa{\isacommand{coinductive}}}}}[]
  14.510 +\rail@nextbar{3}
  14.511 +\rail@term{\hyperlink{command.HOL.coinductive-set}{\mbox{\isa{\isacommand{coinductive{\isaliteral{5F}{\isacharunderscore}}set}}}}}[]
  14.512 +\rail@endbar
  14.513 +\rail@bar
  14.514 +\rail@nextbar{1}
  14.515 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
  14.516 +\rail@endbar
  14.517 +\rail@nont{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}[]
  14.518 +\rail@bar
  14.519 +\rail@nextbar{1}
  14.520 +\rail@term{\isa{\isakeyword{for}}}[]
  14.521 +\rail@nont{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}[]
  14.522 +\rail@endbar
  14.523 +\rail@cr{5}
  14.524 +\rail@bar
  14.525 +\rail@nextbar{6}
  14.526 +\rail@term{\isa{\isakeyword{where}}}[]
  14.527 +\rail@nont{\isa{clauses}}[]
  14.528 +\rail@endbar
  14.529 +\rail@bar
  14.530 +\rail@nextbar{6}
  14.531 +\rail@term{\isa{\isakeyword{monos}}}[]
  14.532 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  14.533 +\rail@endbar
  14.534 +\rail@end
  14.535 +\rail@begin{3}{\isa{clauses}}
  14.536 +\rail@plus
  14.537 +\rail@bar
  14.538 +\rail@nextbar{1}
  14.539 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
  14.540 +\rail@endbar
  14.541 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  14.542 +\rail@nextplus{2}
  14.543 +\rail@cterm{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
  14.544 +\rail@endplus
  14.545 +\rail@end
  14.546 +\rail@begin{3}{\isa{}}
  14.547 +\rail@term{\hyperlink{attribute.HOL.mono}{\mbox{\isa{mono}}}}[]
  14.548 +\rail@bar
  14.549 +\rail@nextbar{1}
  14.550 +\rail@term{\isa{add}}[]
  14.551 +\rail@nextbar{2}
  14.552 +\rail@term{\isa{del}}[]
  14.553 +\rail@endbar
  14.554 +\rail@end
  14.555 +\end{railoutput}
  14.556 +
  14.557  
  14.558    \begin{description}
  14.559  
  14.560 @@ -893,10 +1209,16 @@
  14.561      \indexdef{HOL}{method}{iprover}\hypertarget{method.HOL.iprover}{\hyperlink{method.HOL.iprover}{\mbox{\isa{iprover}}}} & : & \isa{method} \\
  14.562    \end{matharray}
  14.563  
  14.564 -  \begin{rail}
  14.565 -    'iprover' ( rulemod * )
  14.566 -    ;
  14.567 -  \end{rail}
  14.568 +  \begin{railoutput}
  14.569 +\rail@begin{2}{\isa{}}
  14.570 +\rail@term{\hyperlink{method.HOL.iprover}{\mbox{\isa{iprover}}}}[]
  14.571 +\rail@plus
  14.572 +\rail@nextplus{1}
  14.573 +\rail@cnont{\hyperlink{syntax.rulemod}{\mbox{\isa{rulemod}}}}[]
  14.574 +\rail@endplus
  14.575 +\rail@end
  14.576 +\end{railoutput}
  14.577 +
  14.578  
  14.579    The \hyperlink{method.HOL.iprover}{\mbox{\isa{iprover}}} method performs intuitionistic proof
  14.580    search, depending on specifically declared rules from the context,
  14.581 @@ -923,10 +1245,16 @@
  14.582      \indexdef{HOL}{method}{coherent}\hypertarget{method.HOL.coherent}{\hyperlink{method.HOL.coherent}{\mbox{\isa{coherent}}}} & : & \isa{method} \\
  14.583    \end{matharray}
  14.584  
  14.585 -  \begin{rail}
  14.586 -    'coherent' thmrefs?
  14.587 -    ;
  14.588 -  \end{rail}
  14.589 +  \begin{railoutput}
  14.590 +\rail@begin{2}{\isa{}}
  14.591 +\rail@term{\hyperlink{method.HOL.coherent}{\mbox{\isa{coherent}}}}[]
  14.592 +\rail@bar
  14.593 +\rail@nextbar{1}
  14.594 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  14.595 +\rail@endbar
  14.596 +\rail@end
  14.597 +\end{railoutput}
  14.598 +
  14.599  
  14.600    The \hyperlink{method.HOL.coherent}{\mbox{\isa{coherent}}} method solves problems of
  14.601    \emph{Coherent Logic} \cite{Bezem-Coquand:2005}, which covers
  14.602 @@ -952,25 +1280,89 @@
  14.603      \indexdef{HOL}{command}{sledgehammer\_params}\hypertarget{command.HOL.sledgehammer-params}{\hyperlink{command.HOL.sledgehammer-params}{\mbox{\isa{\isacommand{sledgehammer{\isaliteral{5F}{\isacharunderscore}}params}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}}
  14.604    \end{matharray}
  14.605  
  14.606 -  \begin{rail}
  14.607 -    'solve_direct'
  14.608 -    ;
  14.609 -
  14.610 -    'try' ( ( ( 'simp' | 'intro' | 'elim' | 'dest' ) ':' thmrefs ) + ) ? nat?
  14.611 -    ;
  14.612 -
  14.613 -    'sledgehammer' ( '[' args ']' ) ? facts? nat?
  14.614 -    ;
  14.615 -
  14.616 -    'sledgehammer_params' ( ( '[' args ']' ) ? )
  14.617 -    ;
  14.618 -
  14.619 -    args: ( name '=' value + ',' )
  14.620 -    ;
  14.621 -
  14.622 -    facts: '(' ( ( ( ( 'add' | 'del' ) ':' ) ? thmrefs ) + ) ? ')'
  14.623 -    ;
  14.624 -  \end{rail}
  14.625 +  \begin{railoutput}
  14.626 +\rail@begin{6}{\isa{}}
  14.627 +\rail@term{\hyperlink{command.HOL.try}{\mbox{\isa{\isacommand{try}}}}}[]
  14.628 +\rail@bar
  14.629 +\rail@nextbar{1}
  14.630 +\rail@plus
  14.631 +\rail@bar
  14.632 +\rail@term{\isa{simp}}[]
  14.633 +\rail@nextbar{2}
  14.634 +\rail@term{\isa{intro}}[]
  14.635 +\rail@nextbar{3}
  14.636 +\rail@term{\isa{elim}}[]
  14.637 +\rail@nextbar{4}
  14.638 +\rail@term{\isa{dest}}[]
  14.639 +\rail@endbar
  14.640 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  14.641 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  14.642 +\rail@nextplus{5}
  14.643 +\rail@endplus
  14.644 +\rail@endbar
  14.645 +\rail@bar
  14.646 +\rail@nextbar{1}
  14.647 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  14.648 +\rail@endbar
  14.649 +\rail@end
  14.650 +\rail@begin{2}{\isa{}}
  14.651 +\rail@term{\hyperlink{command.HOL.sledgehammer}{\mbox{\isa{\isacommand{sledgehammer}}}}}[]
  14.652 +\rail@bar
  14.653 +\rail@nextbar{1}
  14.654 +\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
  14.655 +\rail@nont{\isa{args}}[]
  14.656 +\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
  14.657 +\rail@endbar
  14.658 +\rail@bar
  14.659 +\rail@nextbar{1}
  14.660 +\rail@nont{\isa{facts}}[]
  14.661 +\rail@endbar
  14.662 +\rail@bar
  14.663 +\rail@nextbar{1}
  14.664 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  14.665 +\rail@endbar
  14.666 +\rail@end
  14.667 +\rail@begin{2}{\isa{}}
  14.668 +\rail@term{\hyperlink{command.HOL.sledgehammer-params}{\mbox{\isa{\isacommand{sledgehammer{\isaliteral{5F}{\isacharunderscore}}params}}}}}[]
  14.669 +\rail@bar
  14.670 +\rail@nextbar{1}
  14.671 +\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
  14.672 +\rail@nont{\isa{args}}[]
  14.673 +\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
  14.674 +\rail@endbar
  14.675 +\rail@end
  14.676 +\rail@begin{2}{\isa{args}}
  14.677 +\rail@plus
  14.678 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  14.679 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  14.680 +\rail@nont{\isa{value}}[]
  14.681 +\rail@nextplus{1}
  14.682 +\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  14.683 +\rail@endplus
  14.684 +\rail@end
  14.685 +\rail@begin{5}{\isa{facts}}
  14.686 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  14.687 +\rail@bar
  14.688 +\rail@nextbar{1}
  14.689 +\rail@plus
  14.690 +\rail@bar
  14.691 +\rail@nextbar{2}
  14.692 +\rail@bar
  14.693 +\rail@term{\isa{add}}[]
  14.694 +\rail@nextbar{3}
  14.695 +\rail@term{\isa{del}}[]
  14.696 +\rail@endbar
  14.697 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  14.698 +\rail@endbar
  14.699 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  14.700 +\rail@nextplus{4}
  14.701 +\rail@endplus
  14.702 +\rail@endbar
  14.703 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  14.704 +\rail@end
  14.705 +\end{railoutput}
  14.706 + % FIXME try: proper clasimpmod!?
  14.707 +  % FIXME check args "value"
  14.708  
  14.709    \begin{description}
  14.710  
  14.711 @@ -1014,22 +1406,74 @@
  14.712      \indexdef{HOL}{command}{nitpick\_params}\hypertarget{command.HOL.nitpick-params}{\hyperlink{command.HOL.nitpick-params}{\mbox{\isa{\isacommand{nitpick{\isaliteral{5F}{\isacharunderscore}}params}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}}
  14.713    \end{matharray}
  14.714  
  14.715 -  \begin{rail}
  14.716 -    'value' ( ( '[' name ']' ) ? ) modes? term
  14.717 -    ;
  14.718 -
  14.719 -    ('quickcheck' | 'refute' | 'nitpick')  ( ( '[' args ']' ) ? ) nat?
  14.720 -    ;
  14.721 -
  14.722 -    ('quickcheck_params' | 'refute_params' | 'nitpick_params') ( ( '[' args ']' ) ? )
  14.723 -    ;
  14.724 -
  14.725 -    modes: '(' (name + ) ')'
  14.726 -    ;
  14.727 -
  14.728 -    args: ( name '=' value + ',' )
  14.729 -    ;
  14.730 -  \end{rail}
  14.731 +  \begin{railoutput}
  14.732 +\rail@begin{2}{\isa{}}
  14.733 +\rail@term{\hyperlink{command.HOL.value}{\mbox{\isa{\isacommand{value}}}}}[]
  14.734 +\rail@bar
  14.735 +\rail@nextbar{1}
  14.736 +\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
  14.737 +\rail@nont{\isa{name}}[]
  14.738 +\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
  14.739 +\rail@endbar
  14.740 +\rail@bar
  14.741 +\rail@nextbar{1}
  14.742 +\rail@nont{\isa{modes}}[]
  14.743 +\rail@endbar
  14.744 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  14.745 +\rail@end
  14.746 +\rail@begin{3}{\isa{}}
  14.747 +\rail@bar
  14.748 +\rail@term{\hyperlink{command.HOL.quickcheck}{\mbox{\isa{\isacommand{quickcheck}}}}}[]
  14.749 +\rail@nextbar{1}
  14.750 +\rail@term{\hyperlink{command.HOL.refute}{\mbox{\isa{\isacommand{refute}}}}}[]
  14.751 +\rail@nextbar{2}
  14.752 +\rail@term{\hyperlink{command.HOL.nitpick}{\mbox{\isa{\isacommand{nitpick}}}}}[]
  14.753 +\rail@endbar
  14.754 +\rail@bar
  14.755 +\rail@nextbar{1}
  14.756 +\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
  14.757 +\rail@nont{\isa{args}}[]
  14.758 +\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
  14.759 +\rail@endbar
  14.760 +\rail@bar
  14.761 +\rail@nextbar{1}
  14.762 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  14.763 +\rail@endbar
  14.764 +\rail@end
  14.765 +\rail@begin{3}{\isa{}}
  14.766 +\rail@bar
  14.767 +\rail@term{\hyperlink{command.HOL.quickcheck-params}{\mbox{\isa{\isacommand{quickcheck{\isaliteral{5F}{\isacharunderscore}}params}}}}}[]
  14.768 +\rail@nextbar{1}
  14.769 +\rail@term{\hyperlink{command.HOL.refute-params}{\mbox{\isa{\isacommand{refute{\isaliteral{5F}{\isacharunderscore}}params}}}}}[]
  14.770 +\rail@nextbar{2}
  14.771 +\rail@term{\hyperlink{command.HOL.nitpick-params}{\mbox{\isa{\isacommand{nitpick{\isaliteral{5F}{\isacharunderscore}}params}}}}}[]
  14.772 +\rail@endbar
  14.773 +\rail@bar
  14.774 +\rail@nextbar{1}
  14.775 +\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
  14.776 +\rail@nont{\isa{args}}[]
  14.777 +\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
  14.778 +\rail@endbar
  14.779 +\rail@end
  14.780 +\rail@begin{2}{\isa{modes}}
  14.781 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  14.782 +\rail@plus
  14.783 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  14.784 +\rail@nextplus{1}
  14.785 +\rail@endplus
  14.786 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  14.787 +\rail@end
  14.788 +\rail@begin{2}{\isa{args}}
  14.789 +\rail@plus
  14.790 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  14.791 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  14.792 +\rail@nont{\isa{value}}[]
  14.793 +\rail@nextplus{1}
  14.794 +\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  14.795 +\rail@endplus
  14.796 +\rail@end
  14.797 +\end{railoutput}
  14.798 + % FIXME check "value"
  14.799  
  14.800    \begin{description}
  14.801  
  14.802 @@ -1154,19 +1598,75 @@
  14.803      \indexdef{HOL}{command}{inductive\_cases}\hypertarget{command.HOL.inductive-cases}{\hyperlink{command.HOL.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}cases}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
  14.804    \end{matharray}
  14.805  
  14.806 -  \begin{rail}
  14.807 -    'case_tac' goalspec? term rule?
  14.808 -    ;
  14.809 -    'induct_tac' goalspec? (insts * 'and') rule?
  14.810 -    ;
  14.811 -    'ind_cases' (prop +) ('for' (name +)) ?
  14.812 -    ;
  14.813 -    'inductive_cases' (thmdecl? (prop +) + 'and')
  14.814 -    ;
  14.815 +  \begin{railoutput}
  14.816 +\rail@begin{2}{\isa{}}
  14.817 +\rail@term{\hyperlink{method.HOL.case-tac}{\mbox{\isa{case{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
  14.818 +\rail@bar
  14.819 +\rail@nextbar{1}
  14.820 +\rail@nont{\hyperlink{syntax.goalspec}{\mbox{\isa{goalspec}}}}[]
  14.821 +\rail@endbar
  14.822 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  14.823 +\rail@bar
  14.824 +\rail@nextbar{1}
  14.825 +\rail@nont{\isa{rule}}[]
  14.826 +\rail@endbar
  14.827 +\rail@end
  14.828 +\rail@begin{3}{\isa{}}
  14.829 +\rail@term{\hyperlink{method.HOL.induct-tac}{\mbox{\isa{induct{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
  14.830 +\rail@bar
  14.831 +\rail@nextbar{1}
  14.832 +\rail@nont{\hyperlink{syntax.goalspec}{\mbox{\isa{goalspec}}}}[]
  14.833 +\rail@endbar
  14.834 +\rail@bar
  14.835 +\rail@nextbar{1}
  14.836 +\rail@plus
  14.837 +\rail@nont{\hyperlink{syntax.insts}{\mbox{\isa{insts}}}}[]
  14.838 +\rail@nextplus{2}
  14.839 +\rail@cterm{\isa{\isakeyword{and}}}[]
  14.840 +\rail@endplus
  14.841 +\rail@endbar
  14.842 +\rail@bar
  14.843 +\rail@nextbar{1}
  14.844 +\rail@nont{\isa{rule}}[]
  14.845 +\rail@endbar
  14.846 +\rail@end
  14.847 +\rail@begin{3}{\isa{}}
  14.848 +\rail@term{\hyperlink{method.HOL.ind-cases}{\mbox{\isa{ind{\isaliteral{5F}{\isacharunderscore}}cases}}}}[]
  14.849 +\rail@plus
  14.850 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  14.851 +\rail@nextplus{1}
  14.852 +\rail@endplus
  14.853 +\rail@bar
  14.854 +\rail@nextbar{1}
  14.855 +\rail@term{\isa{\isakeyword{for}}}[]
  14.856 +\rail@plus
  14.857 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  14.858 +\rail@nextplus{2}
  14.859 +\rail@endplus
  14.860 +\rail@endbar
  14.861 +\rail@end
  14.862 +\rail@begin{3}{\isa{}}
  14.863 +\rail@term{\hyperlink{command.HOL.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}cases}}}}}[]
  14.864 +\rail@plus
  14.865 +\rail@bar
  14.866 +\rail@nextbar{1}
  14.867 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
  14.868 +\rail@endbar
  14.869 +\rail@plus
  14.870 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  14.871 +\rail@nextplus{1}
  14.872 +\rail@endplus
  14.873 +\rail@nextplus{2}
  14.874 +\rail@cterm{\isa{\isakeyword{and}}}[]
  14.875 +\rail@endplus
  14.876 +\rail@end
  14.877 +\rail@begin{1}{\isa{rule}}
  14.878 +\rail@term{\isa{rule}}[]
  14.879 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  14.880 +\rail@nont{\hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}}[]
  14.881 +\rail@end
  14.882 +\end{railoutput}
  14.883  
  14.884 -    rule: ('rule' ':' thmref)
  14.885 -    ;
  14.886 -  \end{rail}
  14.887  
  14.888    \begin{description}
  14.889  
  14.890 @@ -1237,85 +1737,317 @@
  14.891      \indexdef{HOL}{command}{code\_reflect}\hypertarget{command.HOL.code-reflect}{\hyperlink{command.HOL.code-reflect}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}reflect}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}}
  14.892    \end{matharray}
  14.893  
  14.894 -  \begin{rail}
  14.895 -     'export_code' ( constexpr + ) \\
  14.896 -       ( ( 'in' target ( 'module_name' string ) ? \\
  14.897 -        ( 'file' ( string | '-' ) ) ? ( '(' args ')' ) ?) + ) ?
  14.898 -    ;
  14.899 +  \begin{railoutput}
  14.900 +\rail@begin{11}{\isa{}}
  14.901 +\rail@term{\hyperlink{command.HOL.export-code}{\mbox{\isa{\isacommand{export{\isaliteral{5F}{\isacharunderscore}}code}}}}}[]
  14.902 +\rail@plus
  14.903 +\rail@nont{\isa{constexpr}}[]
  14.904 +\rail@nextplus{1}
  14.905 +\rail@endplus
  14.906 +\rail@cr{3}
  14.907 +\rail@bar
  14.908 +\rail@nextbar{4}
  14.909 +\rail@plus
  14.910 +\rail@term{\isa{\isakeyword{in}}}[]
  14.911 +\rail@nont{\isa{target}}[]
  14.912 +\rail@bar
  14.913 +\rail@nextbar{5}
  14.914 +\rail@term{\isa{\isakeyword{module{\isaliteral{5F}{\isacharunderscore}}name}}}[]
  14.915 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
  14.916 +\rail@endbar
  14.917 +\rail@cr{7}
  14.918 +\rail@bar
  14.919 +\rail@nextbar{8}
  14.920 +\rail@term{\isa{\isakeyword{file}}}[]
  14.921 +\rail@bar
  14.922 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
  14.923 +\rail@nextbar{9}
  14.924 +\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[]
  14.925 +\rail@endbar
  14.926 +\rail@endbar
  14.927 +\rail@bar
  14.928 +\rail@nextbar{8}
  14.929 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  14.930 +\rail@nont{\isa{args}}[]
  14.931 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  14.932 +\rail@endbar
  14.933 +\rail@nextplus{10}
  14.934 +\rail@endplus
  14.935 +\rail@endbar
  14.936 +\rail@end
  14.937 +\rail@begin{1}{\isa{const}}
  14.938 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  14.939 +\rail@end
  14.940 +\rail@begin{3}{\isa{constexpr}}
  14.941 +\rail@bar
  14.942 +\rail@nont{\isa{const}}[]
  14.943 +\rail@nextbar{1}
  14.944 +\rail@term{\isa{name{\isaliteral{2E}{\isachardot}}{\isaliteral{5F}{\isacharunderscore}}}}[]
  14.945 +\rail@nextbar{2}
  14.946 +\rail@term{\isa{{\isaliteral{5F}{\isacharunderscore}}}}[]
  14.947 +\rail@endbar
  14.948 +\rail@end
  14.949 +\rail@begin{1}{\isa{typeconstructor}}
  14.950 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  14.951 +\rail@end
  14.952 +\rail@begin{1}{\isa{class}}
  14.953 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  14.954 +\rail@end
  14.955 +\rail@begin{4}{\isa{target}}
  14.956 +\rail@bar
  14.957 +\rail@term{\isa{SML}}[]
  14.958 +\rail@nextbar{1}
  14.959 +\rail@term{\isa{OCaml}}[]
  14.960 +\rail@nextbar{2}
  14.961 +\rail@term{\isa{Haskell}}[]
  14.962 +\rail@nextbar{3}
  14.963 +\rail@term{\isa{Scala}}[]
  14.964 +\rail@endbar
  14.965 +\rail@end
  14.966 +\rail@begin{4}{\isa{}}
  14.967 +\rail@term{\hyperlink{attribute.HOL.code}{\mbox{\isa{code}}}}[]
  14.968 +\rail@bar
  14.969 +\rail@nextbar{1}
  14.970 +\rail@bar
  14.971 +\rail@term{\isa{del}}[]
  14.972 +\rail@nextbar{2}
  14.973 +\rail@term{\isa{abstype}}[]
  14.974 +\rail@nextbar{3}
  14.975 +\rail@term{\isa{abstract}}[]
  14.976 +\rail@endbar
  14.977 +\rail@endbar
  14.978 +\rail@end
  14.979 +\rail@begin{2}{\isa{}}
  14.980 +\rail@term{\hyperlink{command.HOL.code-abort}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}abort}}}}}[]
  14.981 +\rail@plus
  14.982 +\rail@nont{\isa{const}}[]
  14.983 +\rail@nextplus{1}
  14.984 +\rail@endplus
  14.985 +\rail@end
  14.986 +\rail@begin{2}{\isa{}}
  14.987 +\rail@term{\hyperlink{command.HOL.code-datatype}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}datatype}}}}}[]
  14.988 +\rail@plus
  14.989 +\rail@nont{\isa{const}}[]
  14.990 +\rail@nextplus{1}
  14.991 +\rail@endplus
  14.992 +\rail@end
  14.993 +\rail@begin{2}{\isa{}}
  14.994 +\rail@term{\hyperlink{attribute.HOL.code-inline}{\mbox{\isa{code{\isaliteral{5F}{\isacharunderscore}}inline}}}}[]
  14.995 +\rail@bar
  14.996 +\rail@nextbar{1}
  14.997 +\rail@term{\isa{del}}[]
  14.998 +\rail@endbar
  14.999 +\rail@end
 14.1000 +\rail@begin{2}{\isa{}}
 14.1001 +\rail@term{\hyperlink{attribute.HOL.code-post}{\mbox{\isa{code{\isaliteral{5F}{\isacharunderscore}}post}}}}[]
 14.1002 +\rail@bar
 14.1003 +\rail@nextbar{1}
 14.1004 +\rail@term{\isa{del}}[]
 14.1005 +\rail@endbar
 14.1006 +\rail@end
 14.1007 +\rail@begin{3}{\isa{}}
 14.1008 +\rail@term{\hyperlink{command.HOL.code-thms}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}thms}}}}}[]
 14.1009 +\rail@bar
 14.1010 +\rail@nextbar{1}
 14.1011 +\rail@plus
 14.1012 +\rail@nont{\isa{constexpr}}[]
 14.1013 +\rail@nextplus{2}
 14.1014 +\rail@endplus
 14.1015 +\rail@endbar
 14.1016 +\rail@end
 14.1017 +\rail@begin{3}{\isa{}}
 14.1018 +\rail@term{\hyperlink{command.HOL.code-deps}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}deps}}}}}[]
 14.1019 +\rail@bar
 14.1020 +\rail@nextbar{1}
 14.1021 +\rail@plus
 14.1022 +\rail@nont{\isa{constexpr}}[]
 14.1023 +\rail@nextplus{2}
 14.1024 +\rail@endplus
 14.1025 +\rail@endbar
 14.1026 +\rail@end
 14.1027 +\rail@begin{7}{\isa{}}
 14.1028 +\rail@term{\hyperlink{command.HOL.code-const}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}const}}}}}[]
 14.1029 +\rail@plus
 14.1030 +\rail@nont{\isa{const}}[]
 14.1031 +\rail@nextplus{1}
 14.1032 +\rail@cterm{\isa{\isakeyword{and}}}[]
 14.1033 +\rail@endplus
 14.1034 +\rail@cr{3}
 14.1035 +\rail@plus
 14.1036 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 14.1037 +\rail@nont{\isa{target}}[]
 14.1038 +\rail@plus
 14.1039 +\rail@bar
 14.1040 +\rail@nextbar{4}
 14.1041 +\rail@nont{\isa{syntax}}[]
 14.1042 +\rail@endbar
 14.1043 +\rail@nextplus{5}
 14.1044 +\rail@cterm{\isa{\isakeyword{and}}}[]
 14.1045 +\rail@endplus
 14.1046 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 14.1047 +\rail@nextplus{6}
 14.1048 +\rail@endplus
 14.1049 +\rail@end
 14.1050 +\rail@begin{7}{\isa{}}
 14.1051 +\rail@term{\hyperlink{command.HOL.code-type}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}type}}}}}[]
 14.1052 +\rail@plus
 14.1053 +\rail@nont{\isa{typeconstructor}}[]
 14.1054 +\rail@nextplus{1}
 14.1055 +\rail@cterm{\isa{\isakeyword{and}}}[]
 14.1056 +\rail@endplus
 14.1057 +\rail@cr{3}
 14.1058 +\rail@plus
 14.1059 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 14.1060 +\rail@nont{\isa{target}}[]
 14.1061 +\rail@plus
 14.1062 +\rail@bar
 14.1063 +\rail@nextbar{4}
 14.1064 +\rail@nont{\isa{syntax}}[]
 14.1065 +\rail@endbar
 14.1066 +\rail@nextplus{5}
 14.1067 +\rail@cterm{\isa{\isakeyword{and}}}[]
 14.1068 +\rail@endplus
 14.1069 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 14.1070 +\rail@nextplus{6}
 14.1071 +\rail@endplus
 14.1072 +\rail@end
 14.1073 +\rail@begin{9}{\isa{}}
 14.1074 +\rail@term{\hyperlink{command.HOL.code-class}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}class}}}}}[]
 14.1075 +\rail@plus
 14.1076 +\rail@nont{\isa{class}}[]
 14.1077 +\rail@nextplus{1}
 14.1078 +\rail@cterm{\isa{\isakeyword{and}}}[]
 14.1079 +\rail@endplus
 14.1080 +\rail@cr{3}
 14.1081 +\rail@plus
 14.1082 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 14.1083 +\rail@nont{\isa{target}}[]
 14.1084 +\rail@cr{5}
 14.1085 +\rail@plus
 14.1086 +\rail@bar
 14.1087 +\rail@nextbar{6}
 14.1088 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1089 +\rail@endbar
 14.1090 +\rail@nextplus{7}
 14.1091 +\rail@cterm{\isa{\isakeyword{and}}}[]
 14.1092 +\rail@endplus
 14.1093 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 14.1094 +\rail@nextplus{8}
 14.1095 +\rail@endplus
 14.1096 +\rail@end
 14.1097 +\rail@begin{7}{\isa{}}
 14.1098 +\rail@term{\hyperlink{command.HOL.code-instance}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}instance}}}}}[]
 14.1099 +\rail@plus
 14.1100 +\rail@nont{\isa{typeconstructor}}[]
 14.1101 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
 14.1102 +\rail@nont{\isa{class}}[]
 14.1103 +\rail@nextplus{1}
 14.1104 +\rail@cterm{\isa{\isakeyword{and}}}[]
 14.1105 +\rail@endplus
 14.1106 +\rail@cr{3}
 14.1107 +\rail@plus
 14.1108 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 14.1109 +\rail@nont{\isa{target}}[]
 14.1110 +\rail@plus
 14.1111 +\rail@bar
 14.1112 +\rail@nextbar{4}
 14.1113 +\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[]
 14.1114 +\rail@endbar
 14.1115 +\rail@nextplus{5}
 14.1116 +\rail@cterm{\isa{\isakeyword{and}}}[]
 14.1117 +\rail@endplus
 14.1118 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 14.1119 +\rail@nextplus{6}
 14.1120 +\rail@endplus
 14.1121 +\rail@end
 14.1122 +\rail@begin{2}{\isa{}}
 14.1123 +\rail@term{\hyperlink{command.HOL.code-reserved}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}reserved}}}}}[]
 14.1124 +\rail@nont{\isa{target}}[]
 14.1125 +\rail@plus
 14.1126 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1127 +\rail@nextplus{1}
 14.1128 +\rail@endplus
 14.1129 +\rail@end
 14.1130 +\rail@begin{1}{\isa{}}
 14.1131 +\rail@term{\hyperlink{command.HOL.code-monad}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}monad}}}}}[]
 14.1132 +\rail@nont{\isa{const}}[]
 14.1133 +\rail@nont{\isa{const}}[]
 14.1134 +\rail@nont{\isa{target}}[]
 14.1135 +\rail@end
 14.1136 +\rail@begin{2}{\isa{}}
 14.1137 +\rail@term{\hyperlink{command.HOL.code-include}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}include}}}}}[]
 14.1138 +\rail@nont{\isa{target}}[]
 14.1139 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1140 +\rail@bar
 14.1141 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1142 +\rail@nextbar{1}
 14.1143 +\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[]
 14.1144 +\rail@endbar
 14.1145 +\rail@end
 14.1146 +\rail@begin{2}{\isa{}}
 14.1147 +\rail@term{\hyperlink{command.HOL.code-modulename}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}modulename}}}}}[]
 14.1148 +\rail@nont{\isa{target}}[]
 14.1149 +\rail@plus
 14.1150 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1151 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1152 +\rail@nextplus{1}
 14.1153 +\rail@endplus
 14.1154 +\rail@end
 14.1155 +\rail@begin{11}{\isa{}}
 14.1156 +\rail@term{\hyperlink{command.HOL.code-reflect}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}reflect}}}}}[]
 14.1157 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1158 +\rail@cr{2}
 14.1159 +\rail@bar
 14.1160 +\rail@nextbar{3}
 14.1161 +\rail@term{\isa{\isakeyword{datatypes}}}[]
 14.1162 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1163 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
 14.1164 +\rail@bar
 14.1165 +\rail@term{\isa{{\isaliteral{5F}{\isacharunderscore}}}}[]
 14.1166 +\rail@nextbar{4}
 14.1167 +\rail@plus
 14.1168 +\rail@plus
 14.1169 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1170 +\rail@nextplus{5}
 14.1171 +\rail@cterm{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
 14.1172 +\rail@endplus
 14.1173 +\rail@nextplus{6}
 14.1174 +\rail@cterm{\isa{\isakeyword{and}}}[]
 14.1175 +\rail@endplus
 14.1176 +\rail@endbar
 14.1177 +\rail@endbar
 14.1178 +\rail@cr{8}
 14.1179 +\rail@bar
 14.1180 +\rail@nextbar{9}
 14.1181 +\rail@term{\isa{\isakeyword{functions}}}[]
 14.1182 +\rail@plus
 14.1183 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1184 +\rail@nextplus{10}
 14.1185 +\rail@endplus
 14.1186 +\rail@endbar
 14.1187 +\rail@bar
 14.1188 +\rail@nextbar{9}
 14.1189 +\rail@term{\isa{\isakeyword{file}}}[]
 14.1190 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1191 +\rail@endbar
 14.1192 +\rail@end
 14.1193 +\rail@begin{4}{\isa{syntax}}
 14.1194 +\rail@bar
 14.1195 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1196 +\rail@nextbar{1}
 14.1197 +\rail@bar
 14.1198 +\rail@term{\isa{\isakeyword{infix}}}[]
 14.1199 +\rail@nextbar{2}
 14.1200 +\rail@term{\isa{\isakeyword{infixl}}}[]
 14.1201 +\rail@nextbar{3}
 14.1202 +\rail@term{\isa{\isakeyword{infixr}}}[]
 14.1203 +\rail@endbar
 14.1204 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
 14.1205 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1206 +\rail@endbar
 14.1207 +\rail@end
 14.1208 +\end{railoutput}
 14.1209  
 14.1210 -    const: term
 14.1211 -    ;
 14.1212 -
 14.1213 -    constexpr: ( const | 'name._' | '_' )
 14.1214 -    ;
 14.1215 -
 14.1216 -    typeconstructor: nameref
 14.1217 -    ;
 14.1218 -
 14.1219 -    class: nameref
 14.1220 -    ;
 14.1221 -
 14.1222 -    target: 'SML' | 'OCaml' | 'Haskell' | 'Scala'
 14.1223 -    ;
 14.1224 -
 14.1225 -    'code' ( 'del' | 'abstype' | 'abstract' ) ?
 14.1226 -    ;
 14.1227 -
 14.1228 -    'code_abort' ( const + )
 14.1229 -    ;
 14.1230 -
 14.1231 -    'code_datatype' ( const + )
 14.1232 -    ;
 14.1233 -
 14.1234 -    'code_inline' ( 'del' ) ?
 14.1235 -    ;
 14.1236 -
 14.1237 -    'code_post' ( 'del' ) ?
 14.1238 -    ;
 14.1239 -
 14.1240 -    'code_thms' ( constexpr + ) ?
 14.1241 -    ;
 14.1242 -
 14.1243 -    'code_deps' ( constexpr + ) ?
 14.1244 -    ;
 14.1245 -
 14.1246 -    'code_const' (const + 'and') \\
 14.1247 -      ( ( '(' target ( syntax ? + 'and' ) ')' ) + )
 14.1248 -    ;
 14.1249 -
 14.1250 -    'code_type' (typeconstructor + 'and') \\
 14.1251 -      ( ( '(' target ( syntax ? + 'and' ) ')' ) + )
 14.1252 -    ;
 14.1253 -
 14.1254 -    'code_class' (class + 'and') \\
 14.1255 -      ( ( '(' target \\ ( string ? + 'and' ) ')' ) + )
 14.1256 -    ;
 14.1257 -
 14.1258 -    'code_instance' (( typeconstructor '::' class ) + 'and') \\
 14.1259 -      ( ( '(' target ( '-' ? + 'and' ) ')' ) + )
 14.1260 -    ;
 14.1261 -
 14.1262 -    'code_reserved' target ( string + )
 14.1263 -    ;
 14.1264 -
 14.1265 -    'code_monad' const const target
 14.1266 -    ;
 14.1267 -
 14.1268 -    'code_include' target ( string ( string | '-') )
 14.1269 -    ;
 14.1270 -
 14.1271 -    'code_modulename' target ( ( string string ) + )
 14.1272 -    ;
 14.1273 -
 14.1274 -    'code_reflect' string \\
 14.1275 -      ( 'datatypes' ( string '=' ( '_' | ( string + '|' ) + 'and' ) ) ) ? \\
 14.1276 -      ( 'functions' ( string + ) ) ? ( 'file' string ) ?
 14.1277 -    ;
 14.1278 -
 14.1279 -    syntax: string | ( 'infix' | 'infixl' | 'infixr' ) nat string
 14.1280 -    ;
 14.1281 -
 14.1282 -  \end{rail}
 14.1283  
 14.1284    \begin{description}
 14.1285  
 14.1286 @@ -1438,39 +2170,115 @@
 14.1287      \indexdef{HOL}{attribute}{code}\hypertarget{attribute.HOL.code}{\hyperlink{attribute.HOL.code}{\mbox{\isa{code}}}} & : & \isa{attribute} \\
 14.1288    \end{matharray}
 14.1289  
 14.1290 -  \begin{rail}
 14.1291 -  ( 'code_module' | 'code_library' ) modespec ? name ? \\
 14.1292 -    ( 'file' name ) ? ( 'imports' ( name + ) ) ? \\
 14.1293 -    'contains' ( ( name '=' term ) + | term + )
 14.1294 -  ;
 14.1295 -
 14.1296 -  modespec: '(' ( name * ) ')'
 14.1297 -  ;
 14.1298 -
 14.1299 -  'consts_code' (codespec +)
 14.1300 -  ;
 14.1301 -
 14.1302 -  codespec: const template attachment ?
 14.1303 -  ;
 14.1304 -
 14.1305 -  'types_code' (tycodespec +)
 14.1306 -  ;
 14.1307 -
 14.1308 -  tycodespec: name template attachment ?
 14.1309 -  ;
 14.1310 -
 14.1311 -  const: term
 14.1312 -  ;
 14.1313 -
 14.1314 -  template: '(' string ')'
 14.1315 -  ;
 14.1316 -
 14.1317 -  attachment: 'attach' modespec ? verblbrace text verbrbrace
 14.1318 -  ;
 14.1319 -
 14.1320 -  'code' (name)?
 14.1321 -  ;
 14.1322 -  \end{rail}%
 14.1323 +  \begin{railoutput}
 14.1324 +\rail@begin{11}{\isa{}}
 14.1325 +\rail@bar
 14.1326 +\rail@term{\hyperlink{command.HOL.code-module}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}module}}}}}[]
 14.1327 +\rail@nextbar{1}
 14.1328 +\rail@term{\hyperlink{command.HOL.code-library}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}library}}}}}[]
 14.1329 +\rail@endbar
 14.1330 +\rail@bar
 14.1331 +\rail@nextbar{1}
 14.1332 +\rail@nont{\isa{modespec}}[]
 14.1333 +\rail@endbar
 14.1334 +\rail@bar
 14.1335 +\rail@nextbar{1}
 14.1336 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 14.1337 +\rail@endbar
 14.1338 +\rail@cr{3}
 14.1339 +\rail@bar
 14.1340 +\rail@nextbar{4}
 14.1341 +\rail@term{\isa{\isakeyword{file}}}[]
 14.1342 +\rail@nont{\isa{name}}[]
 14.1343 +\rail@endbar
 14.1344 +\rail@bar
 14.1345 +\rail@nextbar{4}
 14.1346 +\rail@term{\isa{\isakeyword{imports}}}[]
 14.1347 +\rail@plus
 14.1348 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 14.1349 +\rail@nextplus{5}
 14.1350 +\rail@endplus
 14.1351 +\rail@endbar
 14.1352 +\rail@cr{7}
 14.1353 +\rail@term{\isa{\isakeyword{contains}}}[]
 14.1354 +\rail@bar
 14.1355 +\rail@plus
 14.1356 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 14.1357 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
 14.1358 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 14.1359 +\rail@nextplus{8}
 14.1360 +\rail@endplus
 14.1361 +\rail@nextbar{9}
 14.1362 +\rail@plus
 14.1363 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 14.1364 +\rail@nextplus{10}
 14.1365 +\rail@endplus
 14.1366 +\rail@endbar
 14.1367 +\rail@end
 14.1368 +\rail@begin{2}{\isa{modespec}}
 14.1369 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 14.1370 +\rail@plus
 14.1371 +\rail@nextplus{1}
 14.1372 +\rail@cnont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 14.1373 +\rail@endplus
 14.1374 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 14.1375 +\rail@end
 14.1376 +\rail@begin{2}{\isa{}}
 14.1377 +\rail@term{\hyperlink{command.HOL.consts-code}{\mbox{\isa{\isacommand{consts{\isaliteral{5F}{\isacharunderscore}}code}}}}}[]
 14.1378 +\rail@plus
 14.1379 +\rail@nont{\isa{codespec}}[]
 14.1380 +\rail@nextplus{1}
 14.1381 +\rail@endplus
 14.1382 +\rail@end
 14.1383 +\rail@begin{2}{\isa{codespec}}
 14.1384 +\rail@nont{\isa{const}}[]
 14.1385 +\rail@nont{\isa{template}}[]
 14.1386 +\rail@bar
 14.1387 +\rail@nextbar{1}
 14.1388 +\rail@nont{\isa{attachment}}[]
 14.1389 +\rail@endbar
 14.1390 +\rail@end
 14.1391 +\rail@begin{2}{\isa{}}
 14.1392 +\rail@term{\hyperlink{command.HOL.types-code}{\mbox{\isa{\isacommand{types{\isaliteral{5F}{\isacharunderscore}}code}}}}}[]
 14.1393 +\rail@plus
 14.1394 +\rail@nont{\isa{tycodespec}}[]
 14.1395 +\rail@nextplus{1}
 14.1396 +\rail@endplus
 14.1397 +\rail@end
 14.1398 +\rail@begin{2}{\isa{tycodespec}}
 14.1399 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 14.1400 +\rail@nont{\isa{template}}[]
 14.1401 +\rail@bar
 14.1402 +\rail@nextbar{1}
 14.1403 +\rail@nont{\isa{attachment}}[]
 14.1404 +\rail@endbar
 14.1405 +\rail@end
 14.1406 +\rail@begin{1}{\isa{const}}
 14.1407 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 14.1408 +\rail@end
 14.1409 +\rail@begin{1}{\isa{template}}
 14.1410 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 14.1411 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 14.1412 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 14.1413 +\rail@end
 14.1414 +\rail@begin{2}{\isa{attachment}}
 14.1415 +\rail@term{\isa{attach}}[]
 14.1416 +\rail@bar
 14.1417 +\rail@nextbar{1}
 14.1418 +\rail@nont{\isa{modespec}}[]
 14.1419 +\rail@endbar
 14.1420 +\rail@term{\isa{{\isaliteral{7B}{\isacharbraceleft}}}}[]
 14.1421 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
 14.1422 +\rail@term{\isa{{\isaliteral{7D}{\isacharbraceright}}}}[]
 14.1423 +\rail@end
 14.1424 +\rail@begin{2}{\isa{}}
 14.1425 +\rail@term{\hyperlink{attribute.HOL.code}{\mbox{\isa{code}}}}[]
 14.1426 +\rail@bar
 14.1427 +\rail@nextbar{1}
 14.1428 +\rail@nont{\isa{name}}[]
 14.1429 +\rail@endbar
 14.1430 +\rail@end
 14.1431 +\end{railoutput}%
 14.1432  \end{isamarkuptext}%
 14.1433  \isamarkuptrue%
 14.1434  %
 14.1435 @@ -1484,11 +2292,45 @@
 14.1436      \indexdef{HOL}{command}{ax\_specification}\hypertarget{command.HOL.ax-specification}{\hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isaliteral{5F}{\isacharunderscore}}specification}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 14.1437    \end{matharray}
 14.1438  
 14.1439 -  \begin{rail}
 14.1440 -  ('specification' | 'ax_specification') '(' (decl +) ')' \\ (thmdecl? prop +)
 14.1441 -  ;
 14.1442 -  decl: ((name ':')? term '(' 'overloaded' ')'?)
 14.1443 -  \end{rail}
 14.1444 +  \begin{railoutput}
 14.1445 +\rail@begin{6}{\isa{}}
 14.1446 +\rail@bar
 14.1447 +\rail@term{\hyperlink{command.HOL.specification}{\mbox{\isa{\isacommand{specification}}}}}[]
 14.1448 +\rail@nextbar{1}
 14.1449 +\rail@term{\hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isaliteral{5F}{\isacharunderscore}}specification}}}}}[]
 14.1450 +\rail@endbar
 14.1451 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 14.1452 +\rail@plus
 14.1453 +\rail@nont{\isa{decl}}[]
 14.1454 +\rail@nextplus{1}
 14.1455 +\rail@endplus
 14.1456 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 14.1457 +\rail@cr{3}
 14.1458 +\rail@plus
 14.1459 +\rail@bar
 14.1460 +\rail@nextbar{4}
 14.1461 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
 14.1462 +\rail@endbar
 14.1463 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
 14.1464 +\rail@nextplus{5}
 14.1465 +\rail@endplus
 14.1466 +\rail@end
 14.1467 +\rail@begin{2}{\isa{decl}}
 14.1468 +\rail@bar
 14.1469 +\rail@nextbar{1}
 14.1470 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 14.1471 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
 14.1472 +\rail@endbar
 14.1473 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 14.1474 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 14.1475 +\rail@term{\isa{\isakeyword{overloaded}}}[]
 14.1476 +\rail@bar
 14.1477 +\rail@nextbar{1}
 14.1478 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 14.1479 +\rail@endbar
 14.1480 +\rail@end
 14.1481 +\end{railoutput}
 14.1482 +
 14.1483  
 14.1484    \begin{description}
 14.1485  
    15.1 --- a/doc-src/IsarRef/Thy/document/Inner_Syntax.tex	Sun May 01 18:57:45 2011 +0200
    15.2 +++ b/doc-src/IsarRef/Thy/document/Inner_Syntax.tex	Mon May 02 01:05:50 2011 +0200
    15.3 @@ -44,23 +44,75 @@
    15.4    These diagnostic commands assist interactive development by printing
    15.5    internal logical entities in a human-readable fashion.
    15.6  
    15.7 -  \begin{rail}
    15.8 -    'typ' modes? type
    15.9 -    ;
   15.10 -    'term' modes? term
   15.11 -    ;
   15.12 -    'prop' modes? prop
   15.13 -    ;
   15.14 -    'thm' modes? thmrefs
   15.15 -    ;
   15.16 -    ( 'prf' | 'full_prf' ) modes? thmrefs?
   15.17 -    ;
   15.18 -    'pr' modes? nat?
   15.19 -    ;
   15.20 +  \begin{railoutput}
   15.21 +\rail@begin{2}{\isa{}}
   15.22 +\rail@term{\hyperlink{command.typ}{\mbox{\isa{\isacommand{typ}}}}}[]
   15.23 +\rail@bar
   15.24 +\rail@nextbar{1}
   15.25 +\rail@nont{\hyperlink{syntax.modes}{\mbox{\isa{modes}}}}[]
   15.26 +\rail@endbar
   15.27 +\rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
   15.28 +\rail@end
   15.29 +\rail@begin{2}{\isa{}}
   15.30 +\rail@term{\hyperlink{command.term}{\mbox{\isa{\isacommand{term}}}}}[]
   15.31 +\rail@bar
   15.32 +\rail@nextbar{1}
   15.33 +\rail@nont{\hyperlink{syntax.modes}{\mbox{\isa{modes}}}}[]
   15.34 +\rail@endbar
   15.35 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
   15.36 +\rail@end
   15.37 +\rail@begin{2}{\isa{}}
   15.38 +\rail@term{\hyperlink{command.prop}{\mbox{\isa{\isacommand{prop}}}}}[]
   15.39 +\rail@bar
   15.40 +\rail@nextbar{1}
   15.41 +\rail@nont{\hyperlink{syntax.modes}{\mbox{\isa{modes}}}}[]
   15.42 +\rail@endbar
   15.43 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
   15.44 +\rail@end
   15.45 +\rail@begin{2}{\isa{}}
   15.46 +\rail@term{\hyperlink{command.thm}{\mbox{\isa{\isacommand{thm}}}}}[]
   15.47 +\rail@bar
   15.48 +\rail@nextbar{1}
   15.49 +\rail@nont{\hyperlink{syntax.modes}{\mbox{\isa{modes}}}}[]
   15.50 +\rail@endbar
   15.51 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
   15.52 +\rail@end
   15.53 +\rail@begin{2}{\isa{}}
   15.54 +\rail@bar
   15.55 +\rail@term{\hyperlink{command.prf}{\mbox{\isa{\isacommand{prf}}}}}[]
   15.56 +\rail@nextbar{1}
   15.57 +\rail@term{\hyperlink{command.full-prf}{\mbox{\isa{\isacommand{full{\isaliteral{5F}{\isacharunderscore}}prf}}}}}[]
   15.58 +\rail@endbar
   15.59 +\rail@bar
   15.60 +\rail@nextbar{1}
   15.61 +\rail@nont{\hyperlink{syntax.modes}{\mbox{\isa{modes}}}}[]
   15.62 +\rail@endbar
   15.63 +\rail@bar
   15.64 +\rail@nextbar{1}
   15.65 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
   15.66 +\rail@endbar
   15.67 +\rail@end
   15.68 +\rail@begin{2}{\isa{}}
   15.69 +\rail@term{\hyperlink{command.pr}{\mbox{\isa{\isacommand{pr}}}}}[]
   15.70 +\rail@bar
   15.71 +\rail@nextbar{1}
   15.72 +\rail@nont{\hyperlink{syntax.modes}{\mbox{\isa{modes}}}}[]
   15.73 +\rail@endbar
   15.74 +\rail@bar
   15.75 +\rail@nextbar{1}
   15.76 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
   15.77 +\rail@endbar
   15.78 +\rail@end
   15.79 +\rail@begin{2}{\indexdef{}{syntax}{modes}\hypertarget{syntax.modes}{\hyperlink{syntax.modes}{\mbox{\isa{modes}}}}}
   15.80 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
   15.81 +\rail@plus
   15.82 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   15.83 +\rail@nextplus{1}
   15.84 +\rail@endplus
   15.85 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
   15.86 +\rail@end
   15.87 +\end{railoutput}
   15.88  
   15.89 -    modes: '(' (name + ) ')'
   15.90 -    ;
   15.91 -  \end{rail}
   15.92  
   15.93    \begin{description}
   15.94  
   15.95 @@ -269,20 +321,69 @@
   15.96    theorem statements, locale specifications etc.\ also admit mixfix
   15.97    annotations.
   15.98  
   15.99 -  \indexouternonterm{infix}\indexouternonterm{mixfix}\indexouternonterm{structmixfix}
  15.100 -  \begin{rail}
  15.101 -    infix: '(' ('infix' | 'infixl' | 'infixr') string nat ')'
  15.102 -    ;
  15.103 -    mixfix: infix | '(' string prios? nat? ')' | '(' 'binder' string prios? nat ')'
  15.104 -    ;
  15.105 -    structmixfix: mixfix | '(' 'structure' ')'
  15.106 -    ;
  15.107 +  \begin{railoutput}
  15.108 +\rail@begin{3}{\indexdef{}{syntax}{infix}\hypertarget{syntax.infix}{\hyperlink{syntax.infix}{\mbox{\isa{infix}}}}}
  15.109 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  15.110 +\rail@bar
  15.111 +\rail@term{\isa{\isakeyword{infix}}}[]
  15.112 +\rail@nextbar{1}
  15.113 +\rail@term{\isa{\isakeyword{infixl}}}[]
  15.114 +\rail@nextbar{2}
  15.115 +\rail@term{\isa{\isakeyword{infixr}}}[]
  15.116 +\rail@endbar
  15.117 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
  15.118 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  15.119 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  15.120 +\rail@end
  15.121 +\rail@begin{5}{\indexdef{}{syntax}{mixfix}\hypertarget{syntax.mixfix}{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}}
  15.122 +\rail@bar
  15.123 +\rail@nont{\hyperlink{syntax.infix}{\mbox{\isa{infix}}}}[]
  15.124 +\rail@nextbar{1}
  15.125 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  15.126 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
  15.127 +\rail@bar
  15.128 +\rail@nextbar{2}
  15.129 +\rail@nont{\isa{prios}}[]
  15.130 +\rail@endbar
  15.131 +\rail@bar
  15.132 +\rail@nextbar{2}
  15.133 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  15.134 +\rail@endbar
  15.135 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  15.136 +\rail@nextbar{3}
  15.137 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  15.138 +\rail@term{\isa{\isakeyword{binder}}}[]
  15.139 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
  15.140 +\rail@bar
  15.141 +\rail@nextbar{4}
  15.142 +\rail@nont{\isa{prios}}[]
  15.143 +\rail@endbar
  15.144 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  15.145 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  15.146 +\rail@endbar
  15.147 +\rail@end
  15.148 +\rail@begin{2}{\indexdef{}{syntax}{structmixfix}\hypertarget{syntax.structmixfix}{\hyperlink{syntax.structmixfix}{\mbox{\isa{structmixfix}}}}}
  15.149 +\rail@bar
  15.150 +\rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
  15.151 +\rail@nextbar{1}
  15.152 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  15.153 +\rail@term{\isa{\isakeyword{structure}}}[]
  15.154 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  15.155 +\rail@endbar
  15.156 +\rail@end
  15.157 +\rail@begin{2}{\isa{prios}}
  15.158 +\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
  15.159 +\rail@plus
  15.160 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  15.161 +\rail@nextplus{1}
  15.162 +\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  15.163 +\rail@endplus
  15.164 +\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
  15.165 +\rail@end
  15.166 +\end{railoutput}
  15.167  
  15.168 -    prios: '[' (nat + ',') ']'
  15.169 -    ;
  15.170 -  \end{rail}
  15.171  
  15.172 -  Here the \railtok{string} specifications refer to the actual mixfix
  15.173 +  Here the \hyperlink{syntax.string}{\mbox{\isa{string}}} specifications refer to the actual mixfix
  15.174    template, which may include literal text, spacing, blocks, and
  15.175    arguments (denoted by ``\isa{{\isaliteral{5F}{\isacharunderscore}}}''); the special symbol
  15.176    ``\verb|\<index>|'' (printed as ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C696E6465783E}{\isasymindex}}{\isaliteral{22}{\isachardoublequote}}}'') represents an index
  15.177 @@ -390,14 +491,66 @@
  15.178      \indexdef{}{command}{write}\hypertarget{command.write}{\hyperlink{command.write}{\mbox{\isa{\isacommand{write}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}proof{\isaliteral{28}{\isacharparenleft}}state{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}state{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
  15.179    \end{matharray}
  15.180  
  15.181 -  \begin{rail}
  15.182 -    ('type_notation' | 'no_type_notation') target? mode? \\ (nameref mixfix + 'and')
  15.183 -    ;
  15.184 -    ('notation' | 'no_notation') target? mode? \\ (nameref structmixfix + 'and')
  15.185 -    ;
  15.186 -    'write' mode? (nameref structmixfix + 'and')
  15.187 -    ;
  15.188 -  \end{rail}
  15.189 +  \begin{railoutput}
  15.190 +\rail@begin{5}{\isa{}}
  15.191 +\rail@bar
  15.192 +\rail@term{\hyperlink{command.type-notation}{\mbox{\isa{\isacommand{type{\isaliteral{5F}{\isacharunderscore}}notation}}}}}[]
  15.193 +\rail@nextbar{1}
  15.194 +\rail@term{\hyperlink{command.no-type-notation}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}type{\isaliteral{5F}{\isacharunderscore}}notation}}}}}[]
  15.195 +\rail@endbar
  15.196 +\rail@bar
  15.197 +\rail@nextbar{1}
  15.198 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
  15.199 +\rail@endbar
  15.200 +\rail@bar
  15.201 +\rail@nextbar{1}
  15.202 +\rail@nont{\hyperlink{syntax.mode}{\mbox{\isa{mode}}}}[]
  15.203 +\rail@endbar
  15.204 +\rail@cr{3}
  15.205 +\rail@plus
  15.206 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  15.207 +\rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
  15.208 +\rail@nextplus{4}
  15.209 +\rail@cterm{\isa{\isakeyword{and}}}[]
  15.210 +\rail@endplus
  15.211 +\rail@end
  15.212 +\rail@begin{5}{\isa{}}
  15.213 +\rail@bar
  15.214 +\rail@term{\hyperlink{command.notation}{\mbox{\isa{\isacommand{notation}}}}}[]
  15.215 +\rail@nextbar{1}
  15.216 +\rail@term{\hyperlink{command.no-notation}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}notation}}}}}[]
  15.217 +\rail@endbar
  15.218 +\rail@bar
  15.219 +\rail@nextbar{1}
  15.220 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
  15.221 +\rail@endbar
  15.222 +\rail@bar
  15.223 +\rail@nextbar{1}
  15.224 +\rail@nont{\hyperlink{syntax.mode}{\mbox{\isa{mode}}}}[]
  15.225 +\rail@endbar
  15.226 +\rail@cr{3}
  15.227 +\rail@plus
  15.228 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  15.229 +\rail@nont{\hyperlink{syntax.structmixfix}{\mbox{\isa{structmixfix}}}}[]
  15.230 +\rail@nextplus{4}
  15.231 +\rail@cterm{\isa{\isakeyword{and}}}[]
  15.232 +\rail@endplus
  15.233 +\rail@end
  15.234 +\rail@begin{2}{\isa{}}
  15.235 +\rail@term{\hyperlink{command.write}{\mbox{\isa{\isacommand{write}}}}}[]
  15.236 +\rail@bar
  15.237 +\rail@nextbar{1}
  15.238 +\rail@nont{\hyperlink{syntax.mode}{\mbox{\isa{mode}}}}[]
  15.239 +\rail@endbar
  15.240 +\rail@plus
  15.241 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  15.242 +\rail@nont{\hyperlink{syntax.structmixfix}{\mbox{\isa{structmixfix}}}}[]
  15.243 +\rail@nextplus{1}
  15.244 +\rail@cterm{\isa{\isakeyword{and}}}[]
  15.245 +\rail@endplus
  15.246 +\rail@end
  15.247 +\end{railoutput}
  15.248 +
  15.249  
  15.250    \begin{description}
  15.251  
  15.252 @@ -749,19 +902,78 @@
  15.253      \indexdef{}{command}{no\_translations}\hypertarget{command.no-translations}{\hyperlink{command.no-translations}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}translations}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
  15.254    \end{matharray}
  15.255  
  15.256 -  \begin{rail}
  15.257 -    'nonterminal' (name + 'and')
  15.258 -    ;
  15.259 -    ('syntax' | 'no_syntax') mode? (constdecl +)
  15.260 -    ;
  15.261 -    ('translations' | 'no_translations') (transpat ('==' | '=>' | '<=' | rightleftharpoons | rightharpoonup | leftharpoondown) transpat +)
  15.262 -    ;
  15.263 +  \begin{railoutput}
  15.264 +\rail@begin{2}{\isa{}}
  15.265 +\rail@term{\hyperlink{command.nonterminal}{\mbox{\isa{\isacommand{nonterminal}}}}}[]
  15.266 +\rail@plus
  15.267 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  15.268 +\rail@nextplus{1}
  15.269 +\rail@cterm{\isa{\isakeyword{and}}}[]
  15.270 +\rail@endplus
  15.271 +\rail@end
  15.272 +\rail@begin{2}{\isa{}}
  15.273 +\rail@bar
  15.274 +\rail@term{\hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}}}[]
  15.275 +\rail@nextbar{1}
  15.276 +\rail@term{\hyperlink{command.no-syntax}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}syntax}}}}}[]
  15.277 +\rail@endbar
  15.278 +\rail@bar
  15.279 +\rail@nextbar{1}
  15.280 +\rail@nont{\hyperlink{syntax.mode}{\mbox{\isa{mode}}}}[]
  15.281 +\rail@endbar
  15.282 +\rail@plus
  15.283 +\rail@nont{\hyperlink{syntax.constdecl}{\mbox{\isa{constdecl}}}}[]
  15.284 +\rail@nextplus{1}
  15.285 +\rail@endplus
  15.286 +\rail@end
  15.287 +\rail@begin{7}{\isa{}}
  15.288 +\rail@bar
  15.289 +\rail@term{\hyperlink{command.translations}{\mbox{\isa{\isacommand{translations}}}}}[]
  15.290 +\rail@nextbar{1}
  15.291 +\rail@term{\hyperlink{command.no-translations}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}translations}}}}}[]
  15.292 +\rail@endbar
  15.293 +\rail@plus
  15.294 +\rail@nont{\isa{transpat}}[]
  15.295 +\rail@bar
  15.296 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}{\isaliteral{3D}{\isacharequal}}}}[]
  15.297 +\rail@nextbar{1}
  15.298 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}}}[]
  15.299 +\rail@nextbar{2}
  15.300 +\rail@term{\isa{{\isaliteral{3C}{\isacharless}}{\isaliteral{3D}{\isacharequal}}}}[]
  15.301 +\rail@nextbar{3}
  15.302 +\rail@term{\isa{{\isaliteral{5C3C72696768746C656674686172706F6F6E733E}{\isasymrightleftharpoons}}}}[]
  15.303 +\rail@nextbar{4}
  15.304 +\rail@term{\isa{{\isaliteral{5C3C7269676874686172706F6F6E75703E}{\isasymrightharpoonup}}}}[]
  15.305 +\rail@nextbar{5}
  15.306 +\rail@term{\isa{{\isaliteral{5C3C6C656674686172706F6F6E646F776E3E}{\isasymleftharpoondown}}}}[]
  15.307 +\rail@endbar
  15.308 +\rail@nont{\isa{transpat}}[]
  15.309 +\rail@nextplus{6}
  15.310 +\rail@endplus
  15.311 +\rail@end
  15.312 +\rail@begin{3}{\isa{mode}}
  15.313 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  15.314 +\rail@bar
  15.315 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  15.316 +\rail@nextbar{1}
  15.317 +\rail@term{\isa{\isakeyword{output}}}[]
  15.318 +\rail@nextbar{2}
  15.319 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  15.320 +\rail@term{\isa{\isakeyword{output}}}[]
  15.321 +\rail@endbar
  15.322 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  15.323 +\rail@end
  15.324 +\rail@begin{2}{\isa{transpat}}
  15.325 +\rail@bar
  15.326 +\rail@nextbar{1}
  15.327 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  15.328 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  15.329 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  15.330 +\rail@endbar
  15.331 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
  15.332 +\rail@end
  15.333 +\end{railoutput}
  15.334  
  15.335 -    mode: ('(' ( name | 'output' | name 'output' ) ')')
  15.336 -    ;
  15.337 -    transpat: ('(' nameref ')')? string
  15.338 -    ;
  15.339 -  \end{rail}
  15.340  
  15.341    \begin{description}
  15.342    
  15.343 @@ -808,15 +1020,33 @@
  15.344      \indexdef{}{command}{print\_ast\_translation}\hypertarget{command.print-ast-translation}{\hyperlink{command.print-ast-translation}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}ast{\isaliteral{5F}{\isacharunderscore}}translation}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
  15.345    \end{matharray}
  15.346  
  15.347 -  \begin{rail}
  15.348 -  ( 'parse_ast_translation' | 'parse_translation' | 'print_translation' |
  15.349 -    'typed_print_translation' | 'print_ast_translation' ) ('(advanced)')? text
  15.350 -  ;
  15.351 -  \end{rail}
  15.352 +  \begin{railoutput}
  15.353 +\rail@begin{5}{\isa{}}
  15.354 +\rail@bar
  15.355 +\rail@term{\hyperlink{command.parse-ast-translation}{\mbox{\isa{\isacommand{parse{\isaliteral{5F}{\isacharunderscore}}ast{\isaliteral{5F}{\isacharunderscore}}translation}}}}}[]
  15.356 +\rail@nextbar{1}
  15.357 +\rail@term{\hyperlink{command.parse-translation}{\mbox{\isa{\isacommand{parse{\isaliteral{5F}{\isacharunderscore}}translation}}}}}[]
  15.358 +\rail@nextbar{2}
  15.359 +\rail@term{\hyperlink{command.print-translation}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}translation}}}}}[]
  15.360 +\rail@nextbar{3}
  15.361 +\rail@term{\hyperlink{command.typed-print-translation}{\mbox{\isa{\isacommand{typed{\isaliteral{5F}{\isacharunderscore}}print{\isaliteral{5F}{\isacharunderscore}}translation}}}}}[]
  15.362 +\rail@nextbar{4}
  15.363 +\rail@term{\hyperlink{command.print-ast-translation}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}ast{\isaliteral{5F}{\isacharunderscore}}translation}}}}}[]
  15.364 +\rail@endbar
  15.365 +\rail@bar
  15.366 +\rail@nextbar{1}
  15.367 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  15.368 +\rail@term{\isa{\isakeyword{advanced}}}[]
  15.369 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  15.370 +\rail@endbar
  15.371 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
  15.372 +\rail@end
  15.373 +\end{railoutput}
  15.374 +
  15.375  
  15.376    Syntax translation functions written in ML admit almost arbitrary
  15.377    manipulations of Isabelle's inner syntax.  Any of the above commands
  15.378 -  have a single \railqtok{text} argument that refers to an ML
  15.379 +  have a single \hyperlink{syntax.text}{\mbox{\isa{text}}} argument that refers to an ML
  15.380    expression of appropriate type, which are as follows by default:
  15.381  
  15.382  %FIXME proper antiquotations
    16.1 --- a/doc-src/IsarRef/Thy/document/Misc.tex	Sun May 01 18:57:45 2011 +0200
    16.2 +++ b/doc-src/IsarRef/Thy/document/Misc.tex	Mon May 02 01:05:50 2011 +0200
    16.3 @@ -41,24 +41,109 @@
    16.4      \indexdef{}{command}{print\_binds}\hypertarget{command.print-binds}{\hyperlink{command.print-binds}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}binds}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
    16.5    \end{matharray}
    16.6  
    16.7 -  \begin{rail}
    16.8 -    ('print_theory' | 'print_theorems') ('!'?)
    16.9 -    ;
   16.10 +  \begin{railoutput}
   16.11 +\rail@begin{2}{\isa{}}
   16.12 +\rail@bar
   16.13 +\rail@term{\hyperlink{command.print-theory}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}theory}}}}}[]
   16.14 +\rail@nextbar{1}
   16.15 +\rail@term{\hyperlink{command.print-theorems}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}theorems}}}}}[]
   16.16 +\rail@endbar
   16.17 +\rail@bar
   16.18 +\rail@nextbar{1}
   16.19 +\rail@term{\isa{{\isaliteral{21}{\isacharbang}}}}[]
   16.20 +\rail@endbar
   16.21 +\rail@end
   16.22 +\rail@begin{6}{\isa{}}
   16.23 +\rail@term{\hyperlink{command.find-theorems}{\mbox{\isa{\isacommand{find{\isaliteral{5F}{\isacharunderscore}}theorems}}}}}[]
   16.24 +\rail@bar
   16.25 +\rail@nextbar{1}
   16.26 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
   16.27 +\rail@bar
   16.28 +\rail@nextbar{2}
   16.29 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
   16.30 +\rail@endbar
   16.31 +\rail@bar
   16.32 +\rail@nextbar{2}
   16.33 +\rail@term{\isa{with{\isaliteral{5F}{\isacharunderscore}}dups}}[]
   16.34 +\rail@endbar
   16.35 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
   16.36 +\rail@endbar
   16.37 +\rail@cr{4}
   16.38 +\rail@plus
   16.39 +\rail@nextplus{5}
   16.40 +\rail@cnont{\isa{thmcriterion}}[]
   16.41 +\rail@endplus
   16.42 +\rail@end
   16.43 +\rail@begin{7}{\isa{thmcriterion}}
   16.44 +\rail@bar
   16.45 +\rail@nextbar{1}
   16.46 +\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[]
   16.47 +\rail@endbar
   16.48 +\rail@bar
   16.49 +\rail@term{\isa{name}}[]
   16.50 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
   16.51 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
   16.52 +\rail@nextbar{1}
   16.53 +\rail@term{\isa{intro}}[]
   16.54 +\rail@nextbar{2}
   16.55 +\rail@term{\isa{elim}}[]
   16.56 +\rail@nextbar{3}
   16.57 +\rail@term{\isa{dest}}[]
   16.58 +\rail@nextbar{4}
   16.59 +\rail@term{\isa{solves}}[]
   16.60 +\rail@nextbar{5}
   16.61 +\rail@term{\isa{simp}}[]
   16.62 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
   16.63 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
   16.64 +\rail@nextbar{6}
   16.65 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
   16.66 +\rail@endbar
   16.67 +\rail@end
   16.68 +\rail@begin{2}{\isa{}}
   16.69 +\rail@term{\hyperlink{command.find-consts}{\mbox{\isa{\isacommand{find{\isaliteral{5F}{\isacharunderscore}}consts}}}}}[]
   16.70 +\rail@plus
   16.71 +\rail@nextplus{1}
   16.72 +\rail@cnont{\isa{constcriterion}}[]
   16.73 +\rail@endplus
   16.74 +\rail@end
   16.75 +\rail@begin{3}{\isa{constcriterion}}
   16.76 +\rail@bar
   16.77 +\rail@nextbar{1}
   16.78 +\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[]
   16.79 +\rail@endbar
   16.80 +\rail@bar
   16.81 +\rail@term{\isa{name}}[]
   16.82 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
   16.83 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
   16.84 +\rail@nextbar{1}
   16.85 +\rail@term{\isa{strict}}[]
   16.86 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
   16.87 +\rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
   16.88 +\rail@nextbar{2}
   16.89 +\rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
   16.90 +\rail@endbar
   16.91 +\rail@end
   16.92 +\rail@begin{1}{\isa{}}
   16.93 +\rail@term{\hyperlink{command.thm-deps}{\mbox{\isa{\isacommand{thm{\isaliteral{5F}{\isacharunderscore}}deps}}}}}[]
   16.94 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
   16.95 +\rail@end
   16.96 +\rail@begin{3}{\isa{}}
   16.97 +\rail@term{\hyperlink{command.unused-thms}{\mbox{\isa{\isacommand{unused{\isaliteral{5F}{\isacharunderscore}}thms}}}}}[]
   16.98 +\rail@bar
   16.99 +\rail@nextbar{1}
  16.100 +\rail@plus
  16.101 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  16.102 +\rail@nextplus{2}
  16.103 +\rail@endplus
  16.104 +\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[]
  16.105 +\rail@plus
  16.106 +\rail@nextplus{2}
  16.107 +\rail@cnont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  16.108 +\rail@endplus
  16.109 +\rail@endbar
  16.110 +\rail@end
  16.111 +\end{railoutput}
  16.112  
  16.113 -    'find_theorems' (('(' (nat)? ('with_dups')? ')')?) (thmcriterion *)
  16.114 -    ;
  16.115 -    thmcriterion: ('-'?) ('name' ':' nameref | 'intro' | 'elim' | 'dest' |
  16.116 -      'solves' | 'simp' ':' term | term)
  16.117 -    ;
  16.118 -    'find_consts' (constcriterion *)
  16.119 -    ;
  16.120 -    constcriterion: ('-'?) ('name' ':' nameref | 'strict' ':' type | type)
  16.121 -    ;
  16.122 -    'thm_deps' thmrefs
  16.123 -    ;
  16.124 -    'unused_thms' (('name'+) '-' ('name'*))?
  16.125 -    ;
  16.126 -  \end{rail}
  16.127  
  16.128    These commands print certain parts of the theory and proof context.
  16.129    Note that there are some further ones available, such as for the set
  16.130 @@ -173,10 +258,17 @@
  16.131      \indexdef{}{command}{use\_thy}\hypertarget{command.use-thy}{\hyperlink{command.use-thy}{\mbox{\isa{\isacommand{use{\isaliteral{5F}{\isacharunderscore}}thy}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}any\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
  16.132    \end{matharray}
  16.133  
  16.134 -  \begin{rail}
  16.135 -    ('cd' | 'use_thy') name
  16.136 -    ;
  16.137 -  \end{rail}
  16.138 +  \begin{railoutput}
  16.139 +\rail@begin{2}{\isa{}}
  16.140 +\rail@bar
  16.141 +\rail@term{\hyperlink{command.cd}{\mbox{\isa{\isacommand{cd}}}}}[]
  16.142 +\rail@nextbar{1}
  16.143 +\rail@term{\hyperlink{command.use-thy}{\mbox{\isa{\isacommand{use{\isaliteral{5F}{\isacharunderscore}}thy}}}}}[]
  16.144 +\rail@endbar
  16.145 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  16.146 +\rail@end
  16.147 +\end{railoutput}
  16.148 +
  16.149  
  16.150    \begin{description}
  16.151  
    17.1 --- a/doc-src/IsarRef/Thy/document/Outer_Syntax.tex	Sun May 01 18:57:45 2011 +0200
    17.2 +++ b/doc-src/IsarRef/Thy/document/Outer_Syntax.tex	Mon May 02 01:05:50 2011 +0200
    17.3 @@ -207,23 +207,38 @@
    17.4  \isamarkuptrue%
    17.5  %
    17.6  \begin{isamarkuptext}%
    17.7 -Entity \railqtok{name} usually refers to any name of types,
    17.8 +Entity \hyperlink{syntax.name}{\mbox{\isa{name}}} usually refers to any name of types,
    17.9    constants, theorems etc.\ that are to be \emph{declared} or
   17.10    \emph{defined} (so qualified identifiers are excluded here).  Quoted
   17.11    strings provide an escape for non-identifier names or those ruled
   17.12    out by outer syntax keywords (e.g.\ quoted \verb|"let"|).
   17.13 -  Already existing objects are usually referenced by
   17.14 -  \railqtok{nameref}.
   17.15 +  Already existing objects are usually referenced by \hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}.
   17.16  
   17.17 -  \indexoutertoken{name}\indexoutertoken{parname}\indexoutertoken{nameref}
   17.18 -  \begin{rail}
   17.19 -    name: ident | symident | string | nat
   17.20 -    ;
   17.21 -    parname: '(' name ')'
   17.22 -    ;
   17.23 -    nameref: name | longident
   17.24 -    ;
   17.25 -  \end{rail}%
   17.26 +  \begin{railoutput}
   17.27 +\rail@begin{4}{\indexdef{}{syntax}{name}\hypertarget{syntax.name}{\hyperlink{syntax.name}{\mbox{\isa{name}}}}}
   17.28 +\rail@bar
   17.29 +\rail@nont{\hyperlink{syntax.ident}{\mbox{\isa{ident}}}}[]
   17.30 +\rail@nextbar{1}
   17.31 +\rail@nont{\hyperlink{syntax.symident}{\mbox{\isa{symident}}}}[]
   17.32 +\rail@nextbar{2}
   17.33 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
   17.34 +\rail@nextbar{3}
   17.35 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
   17.36 +\rail@endbar
   17.37 +\rail@end
   17.38 +\rail@begin{1}{\indexdef{}{syntax}{parname}\hypertarget{syntax.parname}{\hyperlink{syntax.parname}{\mbox{\isa{parname}}}}}
   17.39 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
   17.40 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   17.41 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
   17.42 +\rail@end
   17.43 +\rail@begin{2}{\indexdef{}{syntax}{nameref}\hypertarget{syntax.nameref}{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}}
   17.44 +\rail@bar
   17.45 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   17.46 +\rail@nextbar{1}
   17.47 +\rail@nont{\hyperlink{syntax.longident}{\mbox{\isa{longident}}}}[]
   17.48 +\rail@endbar
   17.49 +\rail@end
   17.50 +\end{railoutput}%
   17.51  \end{isamarkuptext}%
   17.52  \isamarkuptrue%
   17.53  %
   17.54 @@ -236,15 +251,26 @@
   17.55    natural numbers and floating point numbers.  These are combined as
   17.56    \hyperlink{syntax.int}{\mbox{\isa{int}}} and \hyperlink{syntax.real}{\mbox{\isa{real}}} as follows.
   17.57  
   17.58 -  \indexoutertoken{int}\indexoutertoken{real}
   17.59 -  \begin{rail}
   17.60 -    int: nat | '-' nat
   17.61 -    ;
   17.62 -    real: float | int
   17.63 -    ;
   17.64 -  \end{rail}
   17.65 +  \begin{railoutput}
   17.66 +\rail@begin{2}{\indexdef{}{syntax}{int}\hypertarget{syntax.int}{\hyperlink{syntax.int}{\mbox{\isa{int}}}}}
   17.67 +\rail@bar
   17.68 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
   17.69 +\rail@nextbar{1}
   17.70 +\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[]
   17.71 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
   17.72 +\rail@endbar
   17.73 +\rail@end
   17.74 +\rail@begin{2}{\indexdef{}{syntax}{real}\hypertarget{syntax.real}{\hyperlink{syntax.real}{\mbox{\isa{real}}}}}
   17.75 +\rail@bar
   17.76 +\rail@nont{\hyperlink{syntax.float}{\mbox{\isa{float}}}}[]
   17.77 +\rail@nextbar{1}
   17.78 +\rail@nont{\hyperlink{syntax.int}{\mbox{\isa{int}}}}[]
   17.79 +\rail@endbar
   17.80 +\rail@end
   17.81 +\end{railoutput}
   17.82  
   17.83 -  Note that there is an overlap with the category \railqtok{name},
   17.84 +
   17.85 +  Note that there is an overlap with the category \hyperlink{syntax.name}{\mbox{\isa{name}}},
   17.86    which also includes \hyperlink{syntax.nat}{\mbox{\isa{nat}}}.%
   17.87  \end{isamarkuptext}%
   17.88  \isamarkuptrue%
   17.89 @@ -254,20 +280,26 @@
   17.90  \isamarkuptrue%
   17.91  %
   17.92  \begin{isamarkuptext}%
   17.93 -Large chunks of plain \railqtok{text} are usually given
   17.94 -  \railtok{verbatim}, i.e.\ enclosed in \verb|{|\verb|*|~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}}~\verb|*|\verb|}|.  For convenience,
   17.95 -  any of the smaller text units conforming to \railqtok{nameref} are
   17.96 -  admitted as well.  A marginal \railnonterm{comment} is of the form
   17.97 -  \verb|--| \railqtok{text}.  Any number of these may occur
   17.98 +Large chunks of plain \hyperlink{syntax.text}{\mbox{\isa{text}}} are usually given
   17.99 +  \hyperlink{syntax.verbatim}{\mbox{\isa{verbatim}}}, i.e.\ enclosed in \verb|{|\verb|*|~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}}~\verb|*|\verb|}|.  For convenience,
  17.100 +  any of the smaller text units conforming to \hyperlink{syntax.nameref}{\mbox{\isa{nameref}}} are
  17.101 +  admitted as well.  A marginal \hyperlink{syntax.comment}{\mbox{\isa{comment}}} is of the form
  17.102 +  \verb|--|~\hyperlink{syntax.text}{\mbox{\isa{text}}}.  Any number of these may occur
  17.103    within Isabelle/Isar commands.
  17.104  
  17.105 -  \indexoutertoken{text}\indexouternonterm{comment}
  17.106 -  \begin{rail}
  17.107 -    text: verbatim | nameref
  17.108 -    ;
  17.109 -    comment: '--' text
  17.110 -    ;
  17.111 -  \end{rail}%
  17.112 +  \begin{railoutput}
  17.113 +\rail@begin{2}{\indexdef{}{syntax}{text}\hypertarget{syntax.text}{\hyperlink{syntax.text}{\mbox{\isa{text}}}}}
  17.114 +\rail@bar
  17.115 +\rail@nont{\hyperlink{syntax.verbatim}{\mbox{\isa{verbatim}}}}[]
  17.116 +\rail@nextbar{1}
  17.117 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  17.118 +\rail@endbar
  17.119 +\rail@end
  17.120 +\rail@begin{1}{\indexdef{}{syntax}{comment}\hypertarget{syntax.comment}{\hyperlink{syntax.comment}{\mbox{\isa{comment}}}}}
  17.121 +\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}{\isaliteral{2D}{\isacharminus}}}}[]
  17.122 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
  17.123 +\rail@end
  17.124 +\end{railoutput}%
  17.125  \end{isamarkuptext}%
  17.126  \isamarkuptrue%
  17.127  %
  17.128 @@ -282,16 +314,40 @@
  17.129    intersection of these classes.  The syntax of type arities is given
  17.130    directly at the outer level.
  17.131  
  17.132 -  \indexouternonterm{sort}\indexouternonterm{arity}
  17.133 -  \indexouternonterm{classdecl}
  17.134 -  \begin{rail}
  17.135 -    classdecl: name (('<' | subseteq) (nameref + ','))?
  17.136 -    ;
  17.137 -    sort: nameref
  17.138 -    ;
  17.139 -    arity: ('(' (sort + ',') ')')? sort
  17.140 -    ;
  17.141 -  \end{rail}%
  17.142 +  \begin{railoutput}
  17.143 +\rail@begin{3}{\indexdef{}{syntax}{classdecl}\hypertarget{syntax.classdecl}{\hyperlink{syntax.classdecl}{\mbox{\isa{classdecl}}}}}
  17.144 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  17.145 +\rail@bar
  17.146 +\rail@nextbar{1}
  17.147 +\rail@bar
  17.148 +\rail@term{\isa{{\isaliteral{3C}{\isacharless}}}}[]
  17.149 +\rail@nextbar{2}
  17.150 +\rail@term{\isa{{\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}}}[]
  17.151 +\rail@endbar
  17.152 +\rail@plus
  17.153 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  17.154 +\rail@nextplus{2}
  17.155 +\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  17.156 +\rail@endplus
  17.157 +\rail@endbar
  17.158 +\rail@end
  17.159 +\rail@begin{1}{\indexdef{}{syntax}{sort}\hypertarget{syntax.sort}{\hyperlink{syntax.sort}{\mbox{\isa{sort}}}}}
  17.160 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  17.161 +\rail@end
  17.162 +\rail@begin{3}{\indexdef{}{syntax}{arity}\hypertarget{syntax.arity}{\hyperlink{syntax.arity}{\mbox{\isa{arity}}}}}
  17.163 +\rail@bar
  17.164 +\rail@nextbar{1}
  17.165 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  17.166 +\rail@plus
  17.167 +\rail@nont{\hyperlink{syntax.sort}{\mbox{\isa{sort}}}}[]
  17.168 +\rail@nextplus{2}
  17.169 +\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  17.170 +\rail@endplus
  17.171 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  17.172 +\rail@endbar
  17.173 +\rail@nont{\hyperlink{syntax.sort}{\mbox{\isa{sort}}}}[]
  17.174 +\rail@end
  17.175 +\end{railoutput}%
  17.176  \end{isamarkuptext}%
  17.177  \isamarkuptrue%
  17.178  %
  17.179 @@ -312,42 +368,96 @@
  17.180    by commands or other keywords already (such as \verb|=| or
  17.181    \verb|+|).
  17.182  
  17.183 -  \indexoutertoken{type}\indexoutertoken{term}\indexoutertoken{prop}
  17.184 -  \begin{rail}
  17.185 -    type: nameref | typefree | typevar
  17.186 -    ;
  17.187 -    term: nameref | var
  17.188 -    ;
  17.189 -    prop: term
  17.190 -    ;
  17.191 -  \end{rail}
  17.192 +  \begin{railoutput}
  17.193 +\rail@begin{3}{\indexdef{}{syntax}{type}\hypertarget{syntax.type}{\hyperlink{syntax.type}{\mbox{\isa{type}}}}}
  17.194 +\rail@bar
  17.195 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  17.196 +\rail@nextbar{1}
  17.197 +\rail@nont{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}}[]
  17.198 +\rail@nextbar{2}
  17.199 +\rail@nont{\hyperlink{syntax.typevar}{\mbox{\isa{typevar}}}}[]
  17.200 +\rail@endbar
  17.201 +\rail@end
  17.202 +\rail@begin{2}{\indexdef{}{syntax}{term}\hypertarget{syntax.term}{\hyperlink{syntax.term}{\mbox{\isa{term}}}}}
  17.203 +\rail@bar
  17.204 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  17.205 +\rail@nextbar{1}
  17.206 +\rail@nont{\hyperlink{syntax.var}{\mbox{\isa{var}}}}[]
  17.207 +\rail@endbar
  17.208 +\rail@end
  17.209 +\rail@begin{1}{\indexdef{}{syntax}{prop}\hypertarget{syntax.prop}{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}}
  17.210 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  17.211 +\rail@end
  17.212 +\end{railoutput}
  17.213 +
  17.214  
  17.215    Positional instantiations are indicated by giving a sequence of
  17.216    terms, or the placeholder ``\isa{{\isaliteral{5F}{\isacharunderscore}}}'' (underscore), which means to
  17.217    skip a position.
  17.218  
  17.219 -  \indexoutertoken{inst}\indexoutertoken{insts}
  17.220 -  \begin{rail}
  17.221 -    inst: underscore | term
  17.222 -    ;
  17.223 -    insts: (inst *)
  17.224 -    ;
  17.225 -  \end{rail}
  17.226 +  \begin{railoutput}
  17.227 +\rail@begin{2}{\indexdef{}{syntax}{inst}\hypertarget{syntax.inst}{\hyperlink{syntax.inst}{\mbox{\isa{inst}}}}}
  17.228 +\rail@bar
  17.229 +\rail@term{\isa{{\isaliteral{5F}{\isacharunderscore}}}}[]
  17.230 +\rail@nextbar{1}
  17.231 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  17.232 +\rail@endbar
  17.233 +\rail@end
  17.234 +\rail@begin{2}{\indexdef{}{syntax}{insts}\hypertarget{syntax.insts}{\hyperlink{syntax.insts}{\mbox{\isa{insts}}}}}
  17.235 +\rail@plus
  17.236 +\rail@nextplus{1}
  17.237 +\rail@cnont{\hyperlink{syntax.inst}{\mbox{\isa{inst}}}}[]
  17.238 +\rail@endplus
  17.239 +\rail@end
  17.240 +\end{railoutput}
  17.241  
  17.242 -  Type declarations and definitions usually refer to
  17.243 -  \railnonterm{typespec} on the left-hand side.  This models basic
  17.244 -  type constructor application at the outer syntax level.  Note that
  17.245 -  only plain postfix notation is available here, but no infixes.
  17.246  
  17.247 -  \indexouternonterm{typespec}
  17.248 -  \indexouternonterm{typespecsorts}
  17.249 -  \begin{rail}
  17.250 -    typespec: (() | typefree | '(' ( typefree + ',' ) ')') name
  17.251 -    ;
  17.252 +  Type declarations and definitions usually refer to \hyperlink{syntax.typespec}{\mbox{\isa{typespec}}} on the left-hand side.  This models basic type constructor
  17.253 +  application at the outer syntax level.  Note that only plain postfix
  17.254 +  notation is available here, but no infixes.
  17.255  
  17.256 -    typespecsorts: (() | (typefree ('::' sort)?) | '(' ( (typefree ('::' sort)?) + ',' ) ')') name
  17.257 -    ;
  17.258 -  \end{rail}%
  17.259 +  \begin{railoutput}
  17.260 +\rail@begin{4}{\indexdef{}{syntax}{typespec}\hypertarget{syntax.typespec}{\hyperlink{syntax.typespec}{\mbox{\isa{typespec}}}}}
  17.261 +\rail@bar
  17.262 +\rail@nextbar{1}
  17.263 +\rail@nont{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}}[]
  17.264 +\rail@nextbar{2}
  17.265 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  17.266 +\rail@plus
  17.267 +\rail@nont{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}}[]
  17.268 +\rail@nextplus{3}
  17.269 +\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  17.270 +\rail@endplus
  17.271 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  17.272 +\rail@endbar
  17.273 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  17.274 +\rail@end
  17.275 +\rail@begin{6}{\indexdef{}{syntax}{typespecsorts}\hypertarget{syntax.typespecsorts}{\hyperlink{syntax.typespecsorts}{\mbox{\isa{typespecsorts}}}}}
  17.276 +\rail@bar
  17.277 +\rail@nextbar{1}
  17.278 +\rail@nont{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}}[]
  17.279 +\rail@bar
  17.280 +\rail@nextbar{2}
  17.281 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
  17.282 +\rail@nont{\hyperlink{syntax.sort}{\mbox{\isa{sort}}}}[]
  17.283 +\rail@endbar
  17.284 +\rail@nextbar{3}
  17.285 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  17.286 +\rail@plus
  17.287 +\rail@nont{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}}[]
  17.288 +\rail@bar
  17.289 +\rail@nextbar{4}
  17.290 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
  17.291 +\rail@nont{\hyperlink{syntax.sort}{\mbox{\isa{sort}}}}[]
  17.292 +\rail@endbar
  17.293 +\rail@nextplus{5}
  17.294 +\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  17.295 +\rail@endplus
  17.296 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  17.297 +\rail@endbar
  17.298 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  17.299 +\rail@end
  17.300 +\end{railoutput}%
  17.301  \end{isamarkuptext}%
  17.302  \isamarkuptrue%
  17.303  %
  17.304 @@ -356,40 +466,76 @@
  17.305  \isamarkuptrue%
  17.306  %
  17.307  \begin{isamarkuptext}%
  17.308 -Wherever explicit propositions (or term fragments) occur in a proof
  17.309 -  text, casual binding of schematic term variables may be given
  17.310 -  specified via patterns of the form ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C49533E}{\isasymIS}}\ p\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ p\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}''.  This works both for \railqtok{term} and \railqtok{prop}.
  17.311 +Wherever explicit propositions (or term fragments) occur in a
  17.312 +  proof text, casual binding of schematic term variables may be given
  17.313 +  specified via patterns of the form ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C49533E}{\isasymIS}}\ p\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ p\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}''.
  17.314 +  This works both for \hyperlink{syntax.term}{\mbox{\isa{term}}} and \hyperlink{syntax.prop}{\mbox{\isa{prop}}}.
  17.315  
  17.316 -  \indexouternonterm{termpat}\indexouternonterm{proppat}
  17.317 -  \begin{rail}
  17.318 -    termpat: '(' ('is' term +) ')'
  17.319 -    ;
  17.320 -    proppat: '(' ('is' prop +) ')'
  17.321 -    ;
  17.322 -  \end{rail}
  17.323 +  \begin{railoutput}
  17.324 +\rail@begin{2}{\indexdef{}{syntax}{termpat}\hypertarget{syntax.termpat}{\hyperlink{syntax.termpat}{\mbox{\isa{termpat}}}}}
  17.325 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  17.326 +\rail@plus
  17.327 +\rail@term{\isa{\isakeyword{is}}}[]
  17.328 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  17.329 +\rail@nextplus{1}
  17.330 +\rail@endplus
  17.331 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  17.332 +\rail@end
  17.333 +\rail@begin{2}{\indexdef{}{syntax}{proppat}\hypertarget{syntax.proppat}{\hyperlink{syntax.proppat}{\mbox{\isa{proppat}}}}}
  17.334 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  17.335 +\rail@plus
  17.336 +\rail@term{\isa{\isakeyword{is}}}[]
  17.337 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  17.338 +\rail@nextplus{1}
  17.339 +\rail@endplus
  17.340 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  17.341 +\rail@end
  17.342 +\end{railoutput}
  17.343 +
  17.344  
  17.345    \medskip Declarations of local variables \isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}} and
  17.346    logical propositions \isa{{\isaliteral{22}{\isachardoublequote}}a\ {\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{22}{\isachardoublequote}}} represent different views on
  17.347    the same principle of introducing a local scope.  In practice, one
  17.348 -  may usually omit the typing of \railnonterm{vars} (due to
  17.349 +  may usually omit the typing of \hyperlink{syntax.vars}{\mbox{\isa{vars}}} (due to
  17.350    type-inference), and the naming of propositions (due to implicit
  17.351    references of current facts).  In any case, Isar proof elements
  17.352    usually admit to introduce multiple such items simultaneously.
  17.353  
  17.354 -  \indexouternonterm{vars}\indexouternonterm{props}
  17.355 -  \begin{rail}
  17.356 -    vars: (name+) ('::' type)?
  17.357 -    ;
  17.358 -    props: thmdecl? (prop proppat? +)
  17.359 -    ;
  17.360 -  \end{rail}
  17.361 +  \begin{railoutput}
  17.362 +\rail@begin{2}{\indexdef{}{syntax}{vars}\hypertarget{syntax.vars}{\hyperlink{syntax.vars}{\mbox{\isa{vars}}}}}
  17.363 +\rail@plus
  17.364 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  17.365 +\rail@nextplus{1}
  17.366 +\rail@endplus
  17.367 +\rail@bar
  17.368 +\rail@nextbar{1}
  17.369 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
  17.370 +\rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
  17.371 +\rail@endbar
  17.372 +\rail@end
  17.373 +\rail@begin{3}{\indexdef{}{syntax}{props}\hypertarget{syntax.props}{\hyperlink{syntax.props}{\mbox{\isa{props}}}}}
  17.374 +\rail@bar
  17.375 +\rail@nextbar{1}
  17.376 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
  17.377 +\rail@endbar
  17.378 +\rail@plus
  17.379 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  17.380 +\rail@bar
  17.381 +\rail@nextbar{1}
  17.382 +\rail@nont{\hyperlink{syntax.proppat}{\mbox{\isa{proppat}}}}[]
  17.383 +\rail@endbar
  17.384 +\rail@nextplus{2}
  17.385 +\rail@endplus
  17.386 +\rail@end
  17.387 +\end{railoutput}
  17.388 +
  17.389  
  17.390    The treatment of multiple declarations corresponds to the
  17.391 -  complementary focus of \railnonterm{vars} versus
  17.392 -  \railnonterm{props}.  In ``\isa{{\isaliteral{22}{\isachardoublequote}}x\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}}''
  17.393 -  the typing refers to all variables, while in \isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} the naming refers to all propositions collectively.
  17.394 -  Isar language elements that refer to \railnonterm{vars} or
  17.395 -  \railnonterm{props} typically admit separate typings or namings via
  17.396 +  complementary focus of \hyperlink{syntax.vars}{\mbox{\isa{vars}}} versus \hyperlink{syntax.props}{\mbox{\isa{props}}}.  In
  17.397 +  ``\isa{{\isaliteral{22}{\isachardoublequote}}x\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}}'' the typing refers to all variables, while
  17.398 +  in \isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} the naming refers to all propositions
  17.399 +  collectively.  Isar language elements that refer to \hyperlink{syntax.vars}{\mbox{\isa{vars}}}
  17.400 +  or \hyperlink{syntax.props}{\mbox{\isa{props}}} typically admit separate typings or namings via
  17.401    another level of iteration, with explicit \indexref{}{keyword}{and}\hyperlink{keyword.and}{\mbox{\isa{\isakeyword{and}}}}
  17.402    separators; e.g.\ see \hyperlink{command.fix}{\mbox{\isa{\isacommand{fix}}}} and \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}} in
  17.403    \secref{sec:proof-context}.%
  17.404 @@ -402,31 +548,71 @@
  17.405  %
  17.406  \begin{isamarkuptext}%
  17.407  Attributes have their own ``semi-inner'' syntax, in the sense
  17.408 -  that input conforming to \railnonterm{args} below is parsed by the
  17.409 +  that input conforming to \hyperlink{syntax.args}{\mbox{\isa{args}}} below is parsed by the
  17.410    attribute a second time.  The attribute argument specifications may
  17.411    be any sequence of atomic entities (identifiers, strings etc.), or
  17.412 -  properly bracketed argument lists.  Below \railqtok{atom} refers to
  17.413 -  any atomic entity, including any \railtok{keyword} conforming to
  17.414 -  \railtok{symident}.
  17.415 +  properly bracketed argument lists.  Below \hyperlink{syntax.atom}{\mbox{\isa{atom}}} refers to
  17.416 +  any atomic entity, including any \hyperlink{syntax.keyword}{\mbox{\isa{keyword}}} conforming to
  17.417 +  \hyperlink{syntax.symident}{\mbox{\isa{symident}}}.
  17.418  
  17.419 -  \indexoutertoken{atom}\indexouternonterm{args}\indexouternonterm{attributes}
  17.420 -  \begin{rail}
  17.421 -    atom: nameref | typefree | typevar | var | nat | float | keyword
  17.422 -    ;
  17.423 -    arg: atom | '(' args ')' | '[' args ']'
  17.424 -    ;
  17.425 -    args: arg *
  17.426 -    ;
  17.427 -    attributes: '[' (nameref args * ',') ']'
  17.428 -    ;
  17.429 -  \end{rail}
  17.430 +  \begin{railoutput}
  17.431 +\rail@begin{7}{\indexdef{}{syntax}{atom}\hypertarget{syntax.atom}{\hyperlink{syntax.atom}{\mbox{\isa{atom}}}}}
  17.432 +\rail@bar
  17.433 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  17.434 +\rail@nextbar{1}
  17.435 +\rail@nont{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}}[]
  17.436 +\rail@nextbar{2}
  17.437 +\rail@nont{\hyperlink{syntax.typevar}{\mbox{\isa{typevar}}}}[]
  17.438 +\rail@nextbar{3}
  17.439 +\rail@nont{\hyperlink{syntax.var}{\mbox{\isa{var}}}}[]
  17.440 +\rail@nextbar{4}
  17.441 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  17.442 +\rail@nextbar{5}
  17.443 +\rail@nont{\hyperlink{syntax.float}{\mbox{\isa{float}}}}[]
  17.444 +\rail@nextbar{6}
  17.445 +\rail@nont{\hyperlink{syntax.keyword}{\mbox{\isa{keyword}}}}[]
  17.446 +\rail@endbar
  17.447 +\rail@end
  17.448 +\rail@begin{3}{\isa{arg}}
  17.449 +\rail@bar
  17.450 +\rail@nont{\hyperlink{syntax.atom}{\mbox{\isa{atom}}}}[]
  17.451 +\rail@nextbar{1}
  17.452 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  17.453 +\rail@nont{\hyperlink{syntax.args}{\mbox{\isa{args}}}}[]
  17.454 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  17.455 +\rail@nextbar{2}
  17.456 +\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
  17.457 +\rail@nont{\hyperlink{syntax.args}{\mbox{\isa{args}}}}[]
  17.458 +\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
  17.459 +\rail@endbar
  17.460 +\rail@end
  17.461 +\rail@begin{2}{\indexdef{}{syntax}{args}\hypertarget{syntax.args}{\hyperlink{syntax.args}{\mbox{\isa{args}}}}}
  17.462 +\rail@plus
  17.463 +\rail@nextplus{1}
  17.464 +\rail@cnont{\isa{arg}}[]
  17.465 +\rail@endplus
  17.466 +\rail@end
  17.467 +\rail@begin{3}{\indexdef{}{syntax}{attributes}\hypertarget{syntax.attributes}{\hyperlink{syntax.attributes}{\mbox{\isa{attributes}}}}}
  17.468 +\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
  17.469 +\rail@bar
  17.470 +\rail@nextbar{1}
  17.471 +\rail@plus
  17.472 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  17.473 +\rail@nont{\hyperlink{syntax.args}{\mbox{\isa{args}}}}[]
  17.474 +\rail@nextplus{2}
  17.475 +\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  17.476 +\rail@endplus
  17.477 +\rail@endbar
  17.478 +\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
  17.479 +\rail@end
  17.480 +\end{railoutput}
  17.481  
  17.482 -  Theorem specifications come in several flavors:
  17.483 -  \railnonterm{axmdecl} and \railnonterm{thmdecl} usually refer to
  17.484 -  axioms, assumptions or results of goal statements, while
  17.485 -  \railnonterm{thmdef} collects lists of existing theorems.  Existing
  17.486 -  theorems are given by \railnonterm{thmref} and
  17.487 -  \railnonterm{thmrefs}, the former requires an actual singleton
  17.488 +
  17.489 +  Theorem specifications come in several flavors: \hyperlink{syntax.axmdecl}{\mbox{\isa{axmdecl}}}
  17.490 +  and \hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}} usually refer to axioms, assumptions or
  17.491 +  results of goal statements, while \hyperlink{syntax.thmdef}{\mbox{\isa{thmdef}}} collects lists of
  17.492 +  existing theorems.  Existing theorems are given by \hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}
  17.493 +  and \hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}, the former requires an actual singleton
  17.494    result.
  17.495  
  17.496    There are three forms of theorem references:
  17.497 @@ -454,26 +640,79 @@
  17.498    This form of in-place declarations is particularly useful with
  17.499    commands like \hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}} and \hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}.
  17.500  
  17.501 -  \indexouternonterm{axmdecl}\indexouternonterm{thmdecl}
  17.502 -  \indexouternonterm{thmdef}\indexouternonterm{thmref}
  17.503 -  \indexouternonterm{thmrefs}\indexouternonterm{selection}
  17.504 -  \begin{rail}
  17.505 -    axmdecl: name attributes? ':'
  17.506 -    ;
  17.507 -    thmdecl: thmbind ':'
  17.508 -    ;
  17.509 -    thmdef: thmbind '='
  17.510 -    ;
  17.511 -    thmref: (nameref selection? | altstring) attributes? | '[' attributes ']'
  17.512 -    ;
  17.513 -    thmrefs: thmref +
  17.514 -    ;
  17.515 -
  17.516 -    thmbind: name attributes | name | attributes
  17.517 -    ;
  17.518 -    selection: '(' ((nat | nat '-' nat?) + ',') ')'
  17.519 -    ;
  17.520 -  \end{rail}%
  17.521 +  \begin{railoutput}
  17.522 +\rail@begin{2}{\indexdef{}{syntax}{axmdecl}\hypertarget{syntax.axmdecl}{\hyperlink{syntax.axmdecl}{\mbox{\isa{axmdecl}}}}}
  17.523 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  17.524 +\rail@bar
  17.525 +\rail@nextbar{1}
  17.526 +\rail@nont{\hyperlink{syntax.attributes}{\mbox{\isa{attributes}}}}[]
  17.527 +\rail@endbar
  17.528 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  17.529 +\rail@end
  17.530 +\rail@begin{1}{\indexdef{}{syntax}{thmdecl}\hypertarget{syntax.thmdecl}{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}}
  17.531 +\rail@nont{\isa{thmbind}}[]
  17.532 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  17.533 +\rail@end
  17.534 +\rail@begin{1}{\indexdef{}{syntax}{thmdef}\hypertarget{syntax.thmdef}{\hyperlink{syntax.thmdef}{\mbox{\isa{thmdef}}}}}
  17.535 +\rail@nont{\isa{thmbind}}[]
  17.536 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  17.537 +\rail@end
  17.538 +\rail@begin{4}{\indexdef{}{syntax}{thmref}\hypertarget{syntax.thmref}{\hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}}}
  17.539 +\rail@bar
  17.540 +\rail@bar
  17.541 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  17.542 +\rail@bar
  17.543 +\rail@nextbar{1}
  17.544 +\rail@nont{\isa{selection}}[]
  17.545 +\rail@endbar
  17.546 +\rail@nextbar{2}
  17.547 +\rail@nont{\hyperlink{syntax.altstring}{\mbox{\isa{altstring}}}}[]
  17.548 +\rail@endbar
  17.549 +\rail@bar
  17.550 +\rail@nextbar{1}
  17.551 +\rail@nont{\hyperlink{syntax.attributes}{\mbox{\isa{attributes}}}}[]
  17.552 +\rail@endbar
  17.553 +\rail@nextbar{3}
  17.554 +\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
  17.555 +\rail@nont{\hyperlink{syntax.attributes}{\mbox{\isa{attributes}}}}[]
  17.556 +\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
  17.557 +\rail@endbar
  17.558 +\rail@end
  17.559 +\rail@begin{2}{\indexdef{}{syntax}{thmrefs}\hypertarget{syntax.thmrefs}{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}}
  17.560 +\rail@plus
  17.561 +\rail@nont{\hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}}[]
  17.562 +\rail@nextplus{1}
  17.563 +\rail@endplus
  17.564 +\rail@end
  17.565 +\rail@begin{3}{\isa{thmbind}}
  17.566 +\rail@bar
  17.567 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  17.568 +\rail@nont{\hyperlink{syntax.attributes}{\mbox{\isa{attributes}}}}[]
  17.569 +\rail@nextbar{1}
  17.570 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  17.571 +\rail@nextbar{2}
  17.572 +\rail@nont{\hyperlink{syntax.attributes}{\mbox{\isa{attributes}}}}[]
  17.573 +\rail@endbar
  17.574 +\rail@end
  17.575 +\rail@begin{4}{\isa{selection}}
  17.576 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  17.577 +\rail@plus
  17.578 +\rail@bar
  17.579 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  17.580 +\rail@nextbar{1}
  17.581 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  17.582 +\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[]
  17.583 +\rail@bar
  17.584 +\rail@nextbar{2}
  17.585 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  17.586 +\rail@endbar
  17.587 +\rail@endbar
  17.588 +\rail@nextplus{3}
  17.589 +\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  17.590 +\rail@endplus
  17.591 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  17.592 +\rail@end
  17.593 +\end{railoutput}%
  17.594  \end{isamarkuptext}%
  17.595  \isamarkuptrue%
  17.596  %
    18.1 --- a/doc-src/IsarRef/Thy/document/Proof.tex	Sun May 01 18:57:45 2011 +0200
    18.2 +++ b/doc-src/IsarRef/Thy/document/Proof.tex	Mon May 02 01:05:50 2011 +0200
    18.3 @@ -74,12 +74,16 @@
    18.4      \indexdef{}{command}{notepad}\hypertarget{command.notepad}{\hyperlink{command.notepad}{\mbox{\isa{\isacommand{notepad}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}state{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
    18.5    \end{matharray}
    18.6  
    18.7 -  \begin{rail}
    18.8 -    'notepad' 'begin'
    18.9 -    ;
   18.10 -    'end'
   18.11 -    ;
   18.12 -  \end{rail}
   18.13 +  \begin{railoutput}
   18.14 +\rail@begin{1}{\isa{}}
   18.15 +\rail@term{\hyperlink{command.notepad}{\mbox{\isa{\isacommand{notepad}}}}}[]
   18.16 +\rail@term{\isa{\isakeyword{begin}}}[]
   18.17 +\rail@end
   18.18 +\rail@begin{1}{\isa{}}
   18.19 +\rail@term{\hyperlink{command.end}{\mbox{\isa{\isacommand{end}}}}}[]
   18.20 +\rail@end
   18.21 +\end{railoutput}
   18.22 +
   18.23  
   18.24    \begin{description}
   18.25  
   18.26 @@ -215,16 +219,55 @@
   18.27    \isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t{\isaliteral{22}{\isachardoublequote}}} to be eliminated by the reflexivity rule.  Thus,
   18.28    exporting some result \isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{5B}{\isacharbrackleft}}x{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}} yields \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{5B}{\isacharbrackleft}}t{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}}.
   18.29  
   18.30 -  \begin{rail}
   18.31 -    'fix' (vars + 'and')
   18.32 -    ;
   18.33 -    ('assume' | 'presume') (props + 'and')
   18.34 -    ;
   18.35 -    'def' (def + 'and')
   18.36 -    ;
   18.37 -    def: thmdecl? \\ name ('==' | equiv) term termpat?
   18.38 -    ;
   18.39 -  \end{rail}
   18.40 +  \begin{railoutput}
   18.41 +\rail@begin{2}{\isa{}}
   18.42 +\rail@term{\hyperlink{command.fix}{\mbox{\isa{\isacommand{fix}}}}}[]
   18.43 +\rail@plus
   18.44 +\rail@nont{\hyperlink{syntax.vars}{\mbox{\isa{vars}}}}[]
   18.45 +\rail@nextplus{1}
   18.46 +\rail@cterm{\isa{\isakeyword{and}}}[]
   18.47 +\rail@endplus
   18.48 +\rail@end
   18.49 +\rail@begin{2}{\isa{}}
   18.50 +\rail@bar
   18.51 +\rail@term{\hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}}[]
   18.52 +\rail@nextbar{1}
   18.53 +\rail@term{\hyperlink{command.presume}{\mbox{\isa{\isacommand{presume}}}}}[]
   18.54 +\rail@endbar
   18.55 +\rail@plus
   18.56 +\rail@nont{\hyperlink{syntax.props}{\mbox{\isa{props}}}}[]
   18.57 +\rail@nextplus{1}
   18.58 +\rail@cterm{\isa{\isakeyword{and}}}[]
   18.59 +\rail@endplus
   18.60 +\rail@end
   18.61 +\rail@begin{2}{\isa{}}
   18.62 +\rail@term{\hyperlink{command.def}{\mbox{\isa{\isacommand{def}}}}}[]
   18.63 +\rail@plus
   18.64 +\rail@nont{\isa{def}}[]
   18.65 +\rail@nextplus{1}
   18.66 +\rail@cterm{\isa{\isakeyword{and}}}[]
   18.67 +\rail@endplus
   18.68 +\rail@end
   18.69 +\rail@begin{5}{\isa{def}}
   18.70 +\rail@bar
   18.71 +\rail@nextbar{1}
   18.72 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
   18.73 +\rail@endbar
   18.74 +\rail@cr{3}
   18.75 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   18.76 +\rail@bar
   18.77 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}{\isaliteral{3D}{\isacharequal}}}}[]
   18.78 +\rail@nextbar{4}
   18.79 +\rail@term{\isa{{\isaliteral{5C3C65717569763E}{\isasymequiv}}}}[]
   18.80 +\rail@endbar
   18.81 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
   18.82 +\rail@bar
   18.83 +\rail@nextbar{4}
   18.84 +\rail@nont{\hyperlink{syntax.termpat}{\mbox{\isa{termpat}}}}[]
   18.85 +\rail@endbar
   18.86 +\rail@end
   18.87 +\end{railoutput}
   18.88 +
   18.89  
   18.90    \begin{description}
   18.91    
   18.92 @@ -287,13 +330,26 @@
   18.93    logic as actual equations, while abbreviations disappear during the
   18.94    input process just after type checking.  Also note that \hyperlink{command.def}{\mbox{\isa{\isacommand{def}}}} does not support polymorphism.
   18.95  
   18.96 -  \begin{rail}
   18.97 -    'let' ((term + 'and') '=' term + 'and')
   18.98 -    ;  
   18.99 -  \end{rail}
  18.100 +  \begin{railoutput}
  18.101 +\rail@begin{3}{\isa{}}
  18.102 +\rail@term{\hyperlink{command.let}{\mbox{\isa{\isacommand{let}}}}}[]
  18.103 +\rail@plus
  18.104 +\rail@plus
  18.105 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  18.106 +\rail@nextplus{1}
  18.107 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.108 +\rail@endplus
  18.109 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  18.110 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  18.111 +\rail@nextplus{2}
  18.112 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.113 +\rail@endplus
  18.114 +\rail@end
  18.115 +\end{railoutput}
  18.116  
  18.117 -  The syntax of \hyperlink{keyword.is}{\mbox{\isa{\isakeyword{is}}}} patterns follows \railnonterm{termpat}
  18.118 -  or \railnonterm{proppat} (see \secref{sec:term-decls}).
  18.119 +
  18.120 +  The syntax of \hyperlink{keyword.is}{\mbox{\isa{\isakeyword{is}}}} patterns follows \hyperlink{syntax.termpat}{\mbox{\isa{termpat}}} or
  18.121 +  \hyperlink{syntax.proppat}{\mbox{\isa{proppat}}} (see \secref{sec:term-decls}).
  18.122  
  18.123    \begin{description}
  18.124  
  18.125 @@ -346,12 +402,37 @@
  18.126    to the most recently established facts, but only \emph{before}
  18.127    issuing a follow-up claim.
  18.128  
  18.129 -  \begin{rail}
  18.130 -    'note' (thmdef? thmrefs + 'and')
  18.131 -    ;
  18.132 -    ('from' | 'with' | 'using' | 'unfolding') (thmrefs + 'and')
  18.133 -    ;
  18.134 -  \end{rail}
  18.135 +  \begin{railoutput}
  18.136 +\rail@begin{3}{\isa{}}
  18.137 +\rail@term{\hyperlink{command.note}{\mbox{\isa{\isacommand{note}}}}}[]
  18.138 +\rail@plus
  18.139 +\rail@bar
  18.140 +\rail@nextbar{1}
  18.141 +\rail@nont{\hyperlink{syntax.thmdef}{\mbox{\isa{thmdef}}}}[]
  18.142 +\rail@endbar
  18.143 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  18.144 +\rail@nextplus{2}
  18.145 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.146 +\rail@endplus
  18.147 +\rail@end
  18.148 +\rail@begin{4}{\isa{}}
  18.149 +\rail@bar
  18.150 +\rail@term{\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}}[]
  18.151 +\rail@nextbar{1}
  18.152 +\rail@term{\hyperlink{command.with}{\mbox{\isa{\isacommand{with}}}}}[]
  18.153 +\rail@nextbar{2}
  18.154 +\rail@term{\hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}}[]
  18.155 +\rail@nextbar{3}
  18.156 +\rail@term{\hyperlink{command.unfolding}{\mbox{\isa{\isacommand{unfolding}}}}}[]
  18.157 +\rail@endbar
  18.158 +\rail@plus
  18.159 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  18.160 +\rail@nextplus{1}
  18.161 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.162 +\rail@endplus
  18.163 +\rail@end
  18.164 +\end{railoutput}
  18.165 +
  18.166  
  18.167    \begin{description}
  18.168  
  18.169 @@ -456,32 +537,108 @@
  18.170    contexts of (essentially a big disjunction of eliminated parameters
  18.171    and assumptions, cf.\ \secref{sec:obtain}).
  18.172  
  18.173 -  \begin{rail}
  18.174 -    ('lemma' | 'theorem' | 'corollary' |
  18.175 -     'schematic_lemma' | 'schematic_theorem' | 'schematic_corollary') target? (goal | longgoal)
  18.176 -    ;
  18.177 -    ('have' | 'show' | 'hence' | 'thus') goal
  18.178 -    ;
  18.179 -    'print_statement' modes? thmrefs
  18.180 -    ;
  18.181 -  
  18.182 -    goal: (props + 'and')
  18.183 -    ;
  18.184 -    longgoal: thmdecl? (contextelem *) conclusion
  18.185 -    ;
  18.186 -    conclusion: 'shows' goal | 'obtains' (parname? case + '|')
  18.187 -    ;
  18.188 -    case: (vars + 'and') 'where' (props + 'and')
  18.189 -    ;
  18.190 -  \end{rail}
  18.191 +  \begin{railoutput}
  18.192 +\rail@begin{6}{\isa{}}
  18.193 +\rail@bar
  18.194 +\rail@term{\hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}}}[]
  18.195 +\rail@nextbar{1}
  18.196 +\rail@term{\hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}}}[]
  18.197 +\rail@nextbar{2}
  18.198 +\rail@term{\hyperlink{command.corollary}{\mbox{\isa{\isacommand{corollary}}}}}[]
  18.199 +\rail@nextbar{3}
  18.200 +\rail@term{\hyperlink{command.schematic-lemma}{\mbox{\isa{\isacommand{schematic{\isaliteral{5F}{\isacharunderscore}}lemma}}}}}[]
  18.201 +\rail@nextbar{4}
  18.202 +\rail@term{\hyperlink{command.schematic-theorem}{\mbox{\isa{\isacommand{schematic{\isaliteral{5F}{\isacharunderscore}}theorem}}}}}[]
  18.203 +\rail@nextbar{5}
  18.204 +\rail@term{\hyperlink{command.schematic-corollary}{\mbox{\isa{\isacommand{schematic{\isaliteral{5F}{\isacharunderscore}}corollary}}}}}[]
  18.205 +\rail@endbar
  18.206 +\rail@bar
  18.207 +\rail@nextbar{1}
  18.208 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
  18.209 +\rail@endbar
  18.210 +\rail@bar
  18.211 +\rail@nont{\isa{goal}}[]
  18.212 +\rail@nextbar{1}
  18.213 +\rail@nont{\isa{longgoal}}[]
  18.214 +\rail@endbar
  18.215 +\rail@end
  18.216 +\rail@begin{4}{\isa{}}
  18.217 +\rail@bar
  18.218 +\rail@term{\hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}}[]
  18.219 +\rail@nextbar{1}
  18.220 +\rail@term{\hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}}}[]
  18.221 +\rail@nextbar{2}
  18.222 +\rail@term{\hyperlink{command.hence}{\mbox{\isa{\isacommand{hence}}}}}[]
  18.223 +\rail@nextbar{3}
  18.224 +\rail@term{\hyperlink{command.thus}{\mbox{\isa{\isacommand{thus}}}}}[]
  18.225 +\rail@endbar
  18.226 +\rail@nont{\isa{goal}}[]
  18.227 +\rail@end
  18.228 +\rail@begin{2}{\isa{}}
  18.229 +\rail@term{\hyperlink{command.print-statement}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}statement}}}}}[]
  18.230 +\rail@bar
  18.231 +\rail@nextbar{1}
  18.232 +\rail@nont{\hyperlink{syntax.modes}{\mbox{\isa{modes}}}}[]
  18.233 +\rail@endbar
  18.234 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  18.235 +\rail@end
  18.236 +\rail@begin{2}{\isa{goal}}
  18.237 +\rail@plus
  18.238 +\rail@nont{\hyperlink{syntax.props}{\mbox{\isa{props}}}}[]
  18.239 +\rail@nextplus{1}
  18.240 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.241 +\rail@endplus
  18.242 +\rail@end
  18.243 +\rail@begin{2}{\isa{longgoal}}
  18.244 +\rail@bar
  18.245 +\rail@nextbar{1}
  18.246 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
  18.247 +\rail@endbar
  18.248 +\rail@plus
  18.249 +\rail@nextplus{1}
  18.250 +\rail@cnont{\hyperlink{syntax.contextelem}{\mbox{\isa{contextelem}}}}[]
  18.251 +\rail@endplus
  18.252 +\rail@nont{\isa{conclusion}}[]
  18.253 +\rail@end
  18.254 +\rail@begin{4}{\isa{conclusion}}
  18.255 +\rail@bar
  18.256 +\rail@term{\isa{\isakeyword{shows}}}[]
  18.257 +\rail@nont{\isa{goal}}[]
  18.258 +\rail@nextbar{1}
  18.259 +\rail@term{\isa{\isakeyword{obtains}}}[]
  18.260 +\rail@plus
  18.261 +\rail@bar
  18.262 +\rail@nextbar{2}
  18.263 +\rail@nont{\hyperlink{syntax.parname}{\mbox{\isa{parname}}}}[]
  18.264 +\rail@endbar
  18.265 +\rail@nont{\isa{case}}[]
  18.266 +\rail@nextplus{3}
  18.267 +\rail@cterm{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
  18.268 +\rail@endplus
  18.269 +\rail@endbar
  18.270 +\rail@end
  18.271 +\rail@begin{2}{\isa{case}}
  18.272 +\rail@plus
  18.273 +\rail@nont{\hyperlink{syntax.vars}{\mbox{\isa{vars}}}}[]
  18.274 +\rail@nextplus{1}
  18.275 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.276 +\rail@endplus
  18.277 +\rail@term{\isa{\isakeyword{where}}}[]
  18.278 +\rail@plus
  18.279 +\rail@nont{\hyperlink{syntax.props}{\mbox{\isa{props}}}}[]
  18.280 +\rail@nextplus{1}
  18.281 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.282 +\rail@endplus
  18.283 +\rail@end
  18.284 +\end{railoutput}
  18.285 +
  18.286  
  18.287    \begin{description}
  18.288    
  18.289    \item \hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{22}{\isachardoublequote}}} enters proof mode with
  18.290 -  \isa{{\isaliteral{5C3C7068693E}{\isasymphi}}} as main goal, eventually resulting in some fact \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{22}{\isachardoublequote}}} to be put back into the target context.  An additional
  18.291 -  \railnonterm{context} specification may build up an initial proof
  18.292 -  context for the subsequent claim; this includes local definitions
  18.293 -  and syntax as well, see the definition of \hyperlink{syntax.contextelem}{\mbox{\isa{contextelem}}} in
  18.294 +  \isa{{\isaliteral{5C3C7068693E}{\isasymphi}}} as main goal, eventually resulting in some fact \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{22}{\isachardoublequote}}} to be put back into the target context.  An additional \hyperlink{syntax.context}{\mbox{\isa{context}}} specification may build up an initial proof context for the
  18.295 +  subsequent claim; this includes local definitions and syntax as
  18.296 +  well, see the definition of \hyperlink{syntax.contextelem}{\mbox{\isa{contextelem}}} in
  18.297    \secref{sec:locale}.
  18.298    
  18.299    \item \hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{22}{\isachardoublequote}}} and \hyperlink{command.corollary}{\mbox{\isa{\isacommand{corollary}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{22}{\isachardoublequote}}} are essentially the same as \hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{22}{\isachardoublequote}}}, but the facts are internally marked as
  18.300 @@ -557,23 +714,55 @@
  18.301  \isamarkuptrue%
  18.302  %
  18.303  \begin{isamarkuptext}%
  18.304 -Proof methods are either basic ones, or expressions composed of
  18.305 -  methods via ``\verb|,|'' (sequential composition),
  18.306 -  ``\verb||\verb,|,\verb||'' (alternative choices), ``\verb|?|'' 
  18.307 +Proof methods are either basic ones, or expressions composed
  18.308 +  of methods via ``\verb|,|'' (sequential composition),
  18.309 +  ``\verb||\verb,|,\verb||'' (alternative choices), ``\verb|?|''
  18.310    (try), ``\verb|+|'' (repeat at least once), ``\verb|[|\isa{n}\verb|]|'' (restriction to first \isa{n}
  18.311    sub-goals, with default \isa{{\isaliteral{22}{\isachardoublequote}}n\ {\isaliteral{3D}{\isacharequal}}\ {\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}}).  In practice, proof
  18.312 -  methods are usually just a comma separated list of
  18.313 -  \railqtok{nameref}~\railnonterm{args} specifications.  Note that
  18.314 -  parentheses may be dropped for single method specifications (with no
  18.315 -  arguments).
  18.316 +  methods are usually just a comma separated list of \hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}~\hyperlink{syntax.args}{\mbox{\isa{args}}} specifications.  Note that parentheses may
  18.317 +  be dropped for single method specifications (with no arguments).
  18.318  
  18.319 -  \indexouternonterm{method}
  18.320 -  \begin{rail}
  18.321 -    method: (nameref | '(' methods ')') (() | '?' | '+' | '[' nat? ']')
  18.322 -    ;
  18.323 -    methods: (nameref args | method) + (',' | '|')
  18.324 -    ;
  18.325 -  \end{rail}
  18.326 +  \begin{railoutput}
  18.327 +\rail@begin{5}{\indexdef{}{syntax}{method}\hypertarget{syntax.method}{\hyperlink{syntax.method}{\mbox{\isa{method}}}}}
  18.328 +\rail@bar
  18.329 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  18.330 +\rail@nextbar{1}
  18.331 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  18.332 +\rail@nont{\isa{methods}}[]
  18.333 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  18.334 +\rail@endbar
  18.335 +\rail@bar
  18.336 +\rail@nextbar{1}
  18.337 +\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
  18.338 +\rail@nextbar{2}
  18.339 +\rail@term{\isa{{\isaliteral{2B}{\isacharplus}}}}[]
  18.340 +\rail@nextbar{3}
  18.341 +\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
  18.342 +\rail@bar
  18.343 +\rail@nextbar{4}
  18.344 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  18.345 +\rail@endbar
  18.346 +\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
  18.347 +\rail@endbar
  18.348 +\rail@end
  18.349 +\rail@begin{4}{\isa{methods}}
  18.350 +\rail@plus
  18.351 +\rail@bar
  18.352 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  18.353 +\rail@nont{\hyperlink{syntax.args}{\mbox{\isa{args}}}}[]
  18.354 +\rail@nextbar{1}
  18.355 +\rail@nont{\hyperlink{syntax.method}{\mbox{\isa{method}}}}[]
  18.356 +\rail@endbar
  18.357 +\rail@nextplus{2}
  18.358 +\rail@bar
  18.359 +\rail@term{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  18.360 +\rail@nextbar{3}
  18.361 +\rail@term{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
  18.362 +\rail@endbar
  18.363 +\rail@endplus
  18.364 +\rail@end
  18.365 +\end{railoutput}
  18.366 +
  18.367  
  18.368    Proper Isar proof methods do \emph{not} admit arbitrary goal
  18.369    addressing, but refer either to the first sub-goal or all sub-goals
  18.370 @@ -590,11 +779,24 @@
  18.371    individual tactic being involved.  Here ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{21}{\isacharbang}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}}'' refers to
  18.372    all goals, and ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5B}{\isacharbrackleft}}n{\isaliteral{2D}{\isacharminus}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}}'' to all goals starting from \isa{{\isaliteral{22}{\isachardoublequote}}n{\isaliteral{22}{\isachardoublequote}}}.
  18.373  
  18.374 -  \indexouternonterm{goalspec}
  18.375 -  \begin{rail}
  18.376 -    goalspec: '[' (nat '-' nat | nat '-' | nat | '!' ) ']'
  18.377 -    ;
  18.378 -  \end{rail}%
  18.379 +  \begin{railoutput}
  18.380 +\rail@begin{4}{\indexdef{}{syntax}{goalspec}\hypertarget{syntax.goalspec}{\hyperlink{syntax.goalspec}{\mbox{\isa{goalspec}}}}}
  18.381 +\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
  18.382 +\rail@bar
  18.383 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  18.384 +\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[]
  18.385 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  18.386 +\rail@nextbar{1}
  18.387 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  18.388 +\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[]
  18.389 +\rail@nextbar{2}
  18.390 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  18.391 +\rail@nextbar{3}
  18.392 +\rail@term{\isa{{\isaliteral{21}{\isacharbang}}}}[]
  18.393 +\rail@endbar
  18.394 +\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
  18.395 +\rail@end
  18.396 +\end{railoutput}%
  18.397  \end{isamarkuptext}%
  18.398  \isamarkuptrue%
  18.399  %
  18.400 @@ -646,16 +848,40 @@
  18.401    There is no separate default terminal method.  Any remaining goals
  18.402    are always solved by assumption in the very last step.
  18.403  
  18.404 -  \begin{rail}
  18.405 -    'proof' method?
  18.406 -    ;
  18.407 -    'qed' method?
  18.408 -    ;
  18.409 -    'by' method method?
  18.410 -    ;
  18.411 -    ('.' | '..' | 'sorry')
  18.412 -    ;
  18.413 -  \end{rail}
  18.414 +  \begin{railoutput}
  18.415 +\rail@begin{2}{\isa{}}
  18.416 +\rail@term{\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}}[]
  18.417 +\rail@bar
  18.418 +\rail@nextbar{1}
  18.419 +\rail@nont{\isa{method}}[]
  18.420 +\rail@endbar
  18.421 +\rail@end
  18.422 +\rail@begin{2}{\isa{}}
  18.423 +\rail@term{\hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}}[]
  18.424 +\rail@bar
  18.425 +\rail@nextbar{1}
  18.426 +\rail@nont{\isa{method}}[]
  18.427 +\rail@endbar
  18.428 +\rail@end
  18.429 +\rail@begin{2}{\isa{}}
  18.430 +\rail@term{\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}}[]
  18.431 +\rail@nont{\isa{method}}[]
  18.432 +\rail@bar
  18.433 +\rail@nextbar{1}
  18.434 +\rail@nont{\isa{method}}[]
  18.435 +\rail@endbar
  18.436 +\rail@end
  18.437 +\rail@begin{3}{\isa{}}
  18.438 +\rail@bar
  18.439 +\rail@term{\hyperlink{command.dot}{\mbox{\isa{\isacommand{{\isaliteral{2E}{\isachardot}}}}}}}[]
  18.440 +\rail@nextbar{1}
  18.441 +\rail@term{\hyperlink{command.ddot}{\mbox{\isa{\isacommand{{\isaliteral{2E}{\isachardot}}{\isaliteral{2E}{\isachardot}}}}}}}[]
  18.442 +\rail@nextbar{2}
  18.443 +\rail@term{\hyperlink{command.sorry}{\mbox{\isa{\isacommand{sorry}}}}}[]
  18.444 +\rail@endbar
  18.445 +\rail@end
  18.446 +\end{railoutput}
  18.447 +
  18.448  
  18.449    \begin{description}
  18.450    
  18.451 @@ -727,24 +953,110 @@
  18.452      \indexdef{}{attribute}{where}\hypertarget{attribute.where}{\hyperlink{attribute.where}{\mbox{\isa{where}}}} & : & \isa{attribute} \\
  18.453    \end{matharray}
  18.454  
  18.455 -  \begin{rail}
  18.456 -    'fact' thmrefs?
  18.457 -    ;
  18.458 -    'rule' thmrefs?
  18.459 -    ;
  18.460 -    rulemod: ('intro' | 'elim' | 'dest') ((('!' | () | '?') nat?) | 'del') ':' thmrefs
  18.461 -    ;
  18.462 -    ('intro' | 'elim' | 'dest') ('!' | () | '?') nat?
  18.463 -    ;
  18.464 -    'rule' 'del'
  18.465 -    ;
  18.466 -    'OF' thmrefs
  18.467 -    ;
  18.468 -    'of' insts ('concl' ':' insts)?
  18.469 -    ;
  18.470 -    'where' ((name | var | typefree | typevar) '=' (type | term) * 'and')
  18.471 -    ;
  18.472 -  \end{rail}
  18.473 +  \begin{railoutput}
  18.474 +\rail@begin{2}{\isa{}}
  18.475 +\rail@term{\hyperlink{method.fact}{\mbox{\isa{fact}}}}[]
  18.476 +\rail@bar
  18.477 +\rail@nextbar{1}
  18.478 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  18.479 +\rail@endbar
  18.480 +\rail@end
  18.481 +\rail@begin{2}{\isa{}}
  18.482 +\rail@term{\hyperlink{method.rule}{\mbox{\isa{rule}}}}[]
  18.483 +\rail@bar
  18.484 +\rail@nextbar{1}
  18.485 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  18.486 +\rail@endbar
  18.487 +\rail@end
  18.488 +\rail@begin{4}{\isa{rulemod}}
  18.489 +\rail@bar
  18.490 +\rail@term{\isa{intro}}[]
  18.491 +\rail@nextbar{1}
  18.492 +\rail@term{\isa{elim}}[]
  18.493 +\rail@nextbar{2}
  18.494 +\rail@term{\isa{dest}}[]
  18.495 +\rail@endbar
  18.496 +\rail@bar
  18.497 +\rail@bar
  18.498 +\rail@term{\isa{{\isaliteral{21}{\isacharbang}}}}[]
  18.499 +\rail@nextbar{1}
  18.500 +\rail@nextbar{2}
  18.501 +\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
  18.502 +\rail@endbar
  18.503 +\rail@bar
  18.504 +\rail@nextbar{1}
  18.505 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  18.506 +\rail@endbar
  18.507 +\rail@nextbar{3}
  18.508 +\rail@term{\isa{del}}[]
  18.509 +\rail@endbar
  18.510 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  18.511 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  18.512 +\rail@end
  18.513 +\rail@begin{3}{\isa{}}
  18.514 +\rail@bar
  18.515 +\rail@term{\hyperlink{attribute.intro}{\mbox{\isa{intro}}}}[]
  18.516 +\rail@nextbar{1}
  18.517 +\rail@term{\hyperlink{attribute.elim}{\mbox{\isa{elim}}}}[]
  18.518 +\rail@nextbar{2}
  18.519 +\rail@term{\hyperlink{attribute.dest}{\mbox{\isa{dest}}}}[]
  18.520 +\rail@endbar
  18.521 +\rail@bar
  18.522 +\rail@term{\isa{{\isaliteral{21}{\isacharbang}}}}[]
  18.523 +\rail@nextbar{1}
  18.524 +\rail@nextbar{2}
  18.525 +\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
  18.526 +\rail@endbar
  18.527 +\rail@bar
  18.528 +\rail@nextbar{1}
  18.529 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  18.530 +\rail@endbar
  18.531 +\rail@end
  18.532 +\rail@begin{1}{\isa{}}
  18.533 +\rail@term{\hyperlink{attribute.rule}{\mbox{\isa{rule}}}}[]
  18.534 +\rail@term{\isa{del}}[]
  18.535 +\rail@end
  18.536 +\rail@begin{1}{\isa{}}
  18.537 +\rail@term{\hyperlink{attribute.OF}{\mbox{\isa{OF}}}}[]
  18.538 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  18.539 +\rail@end
  18.540 +\rail@begin{2}{\isa{}}
  18.541 +\rail@term{\hyperlink{attribute.of}{\mbox{\isa{of}}}}[]
  18.542 +\rail@nont{\hyperlink{syntax.insts}{\mbox{\isa{insts}}}}[]
  18.543 +\rail@bar
  18.544 +\rail@nextbar{1}
  18.545 +\rail@term{\isa{concl}}[]
  18.546 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  18.547 +\rail@nont{\hyperlink{syntax.insts}{\mbox{\isa{insts}}}}[]
  18.548 +\rail@endbar
  18.549 +\rail@end
  18.550 +\rail@begin{6}{\isa{}}
  18.551 +\rail@term{\hyperlink{attribute.where}{\mbox{\isa{where}}}}[]
  18.552 +\rail@bar
  18.553 +\rail@nextbar{1}
  18.554 +\rail@plus
  18.555 +\rail@bar
  18.556 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  18.557 +\rail@nextbar{2}
  18.558 +\rail@nont{\hyperlink{syntax.var}{\mbox{\isa{var}}}}[]
  18.559 +\rail@nextbar{3}
  18.560 +\rail@nont{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}}[]
  18.561 +\rail@nextbar{4}
  18.562 +\rail@nont{\hyperlink{syntax.typevar}{\mbox{\isa{typevar}}}}[]
  18.563 +\rail@endbar
  18.564 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  18.565 +\rail@bar
  18.566 +\rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
  18.567 +\rail@nextbar{2}
  18.568 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  18.569 +\rail@endbar
  18.570 +\rail@nextplus{5}
  18.571 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.572 +\rail@endplus
  18.573 +\rail@endbar
  18.574 +\rail@end
  18.575 +\end{railoutput}
  18.576 +
  18.577  
  18.578    \begin{description}
  18.579    
  18.580 @@ -847,14 +1159,28 @@
  18.581      \indexdef{}{command}{back}\hypertarget{command.back}{\hyperlink{command.back}{\mbox{\isa{\isacommand{back}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}proof\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{22}{\isachardoublequote}}} \\
  18.582    \end{matharray}
  18.583  
  18.584 -  \begin{rail}
  18.585 -    ( 'apply' | 'apply_end' ) method
  18.586 -    ;
  18.587 -    'defer' nat?
  18.588 -    ;
  18.589 -    'prefer' nat
  18.590 -    ;
  18.591 -  \end{rail}
  18.592 +  \begin{railoutput}
  18.593 +\rail@begin{2}{\isa{}}
  18.594 +\rail@bar
  18.595 +\rail@term{\hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}}}[]
  18.596 +\rail@nextbar{1}
  18.597 +\rail@term{\hyperlink{command.apply-end}{\mbox{\isa{\isacommand{apply{\isaliteral{5F}{\isacharunderscore}}end}}}}}[]
  18.598 +\rail@endbar
  18.599 +\rail@nont{\hyperlink{syntax.method}{\mbox{\isa{method}}}}[]
  18.600 +\rail@end
  18.601 +\rail@begin{2}{\isa{}}
  18.602 +\rail@term{\hyperlink{command.defer}{\mbox{\isa{\isacommand{defer}}}}}[]
  18.603 +\rail@bar
  18.604 +\rail@nextbar{1}
  18.605 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  18.606 +\rail@endbar
  18.607 +\rail@end
  18.608 +\rail@begin{1}{\isa{}}
  18.609 +\rail@term{\hyperlink{command.prefer}{\mbox{\isa{\isacommand{prefer}}}}}[]
  18.610 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  18.611 +\rail@end
  18.612 +\end{railoutput}
  18.613 +
  18.614  
  18.615    \begin{description}
  18.616  
  18.617 @@ -907,10 +1233,16 @@
  18.618      \indexdef{}{command}{method\_setup}\hypertarget{command.method-setup}{\hyperlink{command.method-setup}{\mbox{\isa{\isacommand{method{\isaliteral{5F}{\isacharunderscore}}setup}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
  18.619    \end{matharray}
  18.620  
  18.621 -  \begin{rail}
  18.622 -    'method_setup' name '=' text text
  18.623 -    ;
  18.624 -  \end{rail}
  18.625 +  \begin{railoutput}
  18.626 +\rail@begin{1}{\isa{}}
  18.627 +\rail@term{\hyperlink{command.method-setup}{\mbox{\isa{\isacommand{method{\isaliteral{5F}{\isacharunderscore}}setup}}}}}[]
  18.628 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  18.629 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  18.630 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
  18.631 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
  18.632 +\rail@end
  18.633 +\end{railoutput}
  18.634 +
  18.635  
  18.636    \begin{description}
  18.637  
  18.638 @@ -976,12 +1308,35 @@
  18.639    later, provided that the corresponding parameters do \emph{not}
  18.640    occur in the conclusion.
  18.641  
  18.642 -  \begin{rail}
  18.643 -    'obtain' parname? (vars + 'and') 'where' (props + 'and')
  18.644 -    ;
  18.645 -    'guess' (vars + 'and')
  18.646 -    ;
  18.647 -  \end{rail}
  18.648 +  \begin{railoutput}
  18.649 +\rail@begin{2}{\isa{}}
  18.650 +\rail@term{\hyperlink{command.obtain}{\mbox{\isa{\isacommand{obtain}}}}}[]
  18.651 +\rail@bar
  18.652 +\rail@nextbar{1}
  18.653 +\rail@nont{\hyperlink{syntax.parname}{\mbox{\isa{parname}}}}[]
  18.654 +\rail@endbar
  18.655 +\rail@plus
  18.656 +\rail@nont{\hyperlink{syntax.vars}{\mbox{\isa{vars}}}}[]
  18.657 +\rail@nextplus{1}
  18.658 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.659 +\rail@endplus
  18.660 +\rail@term{\isa{\isakeyword{where}}}[]
  18.661 +\rail@plus
  18.662 +\rail@nont{\hyperlink{syntax.props}{\mbox{\isa{props}}}}[]
  18.663 +\rail@nextplus{1}
  18.664 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.665 +\rail@endplus
  18.666 +\rail@end
  18.667 +\rail@begin{2}{\isa{}}
  18.668 +\rail@term{\hyperlink{command.guess}{\mbox{\isa{\isacommand{guess}}}}}[]
  18.669 +\rail@plus
  18.670 +\rail@nont{\hyperlink{syntax.vars}{\mbox{\isa{vars}}}}[]
  18.671 +\rail@nextplus{1}
  18.672 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.673 +\rail@endplus
  18.674 +\rail@end
  18.675 +\end{railoutput}
  18.676 +
  18.677  
  18.678    The derived Isar command \hyperlink{command.obtain}{\mbox{\isa{\isacommand{obtain}}}} is defined as follows
  18.679    (where \isa{{\isaliteral{22}{\isachardoublequote}}b\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ b\isaliteral{5C3C5E7375623E}{}\isactrlsub k{\isaliteral{22}{\isachardoublequote}}} shall refer to (optional)
  18.680 @@ -1085,12 +1440,31 @@
  18.681      \hyperlink{command.ultimately}{\mbox{\isa{\isacommand{ultimately}}}} & \equiv & \hyperlink{command.moreover}{\mbox{\isa{\isacommand{moreover}}}}~\hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}~\isa{calculation} \\
  18.682    \end{matharray}
  18.683  
  18.684 -  \begin{rail}
  18.685 -    ('also' | 'finally') ('(' thmrefs ')')?
  18.686 -    ;
  18.687 -    'trans' (() | 'add' | 'del')
  18.688 -    ;
  18.689 -  \end{rail}
  18.690 +  \begin{railoutput}
  18.691 +\rail@begin{2}{\isa{}}
  18.692 +\rail@bar
  18.693 +\rail@term{\hyperlink{command.also}{\mbox{\isa{\isacommand{also}}}}}[]
  18.694 +\rail@nextbar{1}
  18.695 +\rail@term{\hyperlink{command.finally}{\mbox{\isa{\isacommand{finally}}}}}[]
  18.696 +\rail@endbar
  18.697 +\rail@bar
  18.698 +\rail@nextbar{1}
  18.699 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  18.700 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  18.701 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  18.702 +\rail@endbar
  18.703 +\rail@end
  18.704 +\rail@begin{3}{\isa{}}
  18.705 +\rail@term{\hyperlink{attribute.trans}{\mbox{\isa{trans}}}}[]
  18.706 +\rail@bar
  18.707 +\rail@nextbar{1}
  18.708 +\rail@term{\isa{add}}[]
  18.709 +\rail@nextbar{2}
  18.710 +\rail@term{\isa{del}}[]
  18.711 +\rail@endbar
  18.712 +\rail@end
  18.713 +\end{railoutput}
  18.714 +
  18.715  
  18.716    \begin{description}
  18.717  
  18.718 @@ -1191,21 +1565,67 @@
  18.719    derived manually become ready to use in advanced case analysis
  18.720    later.
  18.721  
  18.722 -  \begin{rail}
  18.723 -    'case' (caseref | '(' caseref ((name | underscore) +) ')')
  18.724 -    ;
  18.725 -    caseref: nameref attributes?
  18.726 -    ;
  18.727 +  \begin{railoutput}
  18.728 +\rail@begin{4}{\isa{}}
  18.729 +\rail@term{\hyperlink{command.case}{\mbox{\isa{\isacommand{case}}}}}[]
  18.730 +\rail@bar
  18.731 +\rail@nont{\isa{caseref}}[]
  18.732 +\rail@nextbar{1}
  18.733 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  18.734 +\rail@nont{\isa{caseref}}[]
  18.735 +\rail@plus
  18.736 +\rail@bar
  18.737 +\rail@term{\isa{{\isaliteral{5F}{\isacharunderscore}}}}[]
  18.738 +\rail@nextbar{2}
  18.739 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  18.740 +\rail@endbar
  18.741 +\rail@nextplus{3}
  18.742 +\rail@endplus
  18.743 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  18.744 +\rail@endbar
  18.745 +\rail@end
  18.746 +\rail@begin{2}{\isa{caseref}}
  18.747 +\rail@nont{\isa{nameref}}[]
  18.748 +\rail@bar
  18.749 +\rail@nextbar{1}
  18.750 +\rail@nont{\isa{attributes}}[]
  18.751 +\rail@endbar
  18.752 +\rail@end
  18.753 +\rail@begin{2}{\isa{}}
  18.754 +\rail@term{\hyperlink{attribute.case-names}{\mbox{\isa{case{\isaliteral{5F}{\isacharunderscore}}names}}}}[]
  18.755 +\rail@plus
  18.756 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  18.757 +\rail@nextplus{1}
  18.758 +\rail@endplus
  18.759 +\rail@end
  18.760 +\rail@begin{2}{\isa{}}
  18.761 +\rail@term{\hyperlink{attribute.case-conclusion}{\mbox{\isa{case{\isaliteral{5F}{\isacharunderscore}}conclusion}}}}[]
  18.762 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  18.763 +\rail@plus
  18.764 +\rail@nextplus{1}
  18.765 +\rail@cnont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  18.766 +\rail@endplus
  18.767 +\rail@end
  18.768 +\rail@begin{3}{\isa{}}
  18.769 +\rail@term{\hyperlink{attribute.params}{\mbox{\isa{params}}}}[]
  18.770 +\rail@plus
  18.771 +\rail@plus
  18.772 +\rail@nextplus{1}
  18.773 +\rail@cnont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  18.774 +\rail@endplus
  18.775 +\rail@nextplus{2}
  18.776 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.777 +\rail@endplus
  18.778 +\rail@end
  18.779 +\rail@begin{2}{\isa{}}
  18.780 +\rail@term{\hyperlink{attribute.consumes}{\mbox{\isa{consumes}}}}[]
  18.781 +\rail@bar
  18.782 +\rail@nextbar{1}
  18.783 +\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
  18.784 +\rail@endbar
  18.785 +\rail@end
  18.786 +\end{railoutput}
  18.787  
  18.788 -    'case_names' (name +)
  18.789 -    ;
  18.790 -    'case_conclusion' name (name *)
  18.791 -    ;
  18.792 -    'params' ((name *) + 'and')
  18.793 -    ;
  18.794 -    'consumes' nat?
  18.795 -    ;
  18.796 -  \end{rail}
  18.797  
  18.798    \begin{description}
  18.799    
  18.800 @@ -1279,25 +1699,132 @@
  18.801    and parameters separately).  This avoids cumbersome encoding of
  18.802    ``strengthened'' inductive statements within the object-logic.
  18.803  
  18.804 -  \begin{rail}
  18.805 -    'cases' '(no_simp)'? (insts * 'and') rule?
  18.806 -    ;
  18.807 -    'induct' '(no_simp)'? (definsts * 'and') \\ arbitrary? taking? rule?
  18.808 -    ;
  18.809 -    'coinduct' insts taking rule?
  18.810 -    ;
  18.811 +  \begin{railoutput}
  18.812 +\rail@begin{3}{\isa{}}
  18.813 +\rail@term{\hyperlink{method.cases}{\mbox{\isa{cases}}}}[]
  18.814 +\rail@bar
  18.815 +\rail@nextbar{1}
  18.816 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  18.817 +\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}simp}}[]
  18.818 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  18.819 +\rail@endbar
  18.820 +\rail@bar
  18.821 +\rail@nextbar{1}
  18.822 +\rail@plus
  18.823 +\rail@nont{\hyperlink{syntax.insts}{\mbox{\isa{insts}}}}[]
  18.824 +\rail@nextplus{2}
  18.825 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.826 +\rail@endplus
  18.827 +\rail@endbar
  18.828 +\rail@bar
  18.829 +\rail@nextbar{1}
  18.830 +\rail@nont{\isa{rule}}[]
  18.831 +\rail@endbar
  18.832 +\rail@end
  18.833 +\rail@begin{6}{\isa{}}
  18.834 +\rail@term{\hyperlink{method.induct}{\mbox{\isa{induct}}}}[]
  18.835 +\rail@bar
  18.836 +\rail@nextbar{1}
  18.837 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  18.838 +\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}simp}}[]
  18.839 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  18.840 +\rail@endbar
  18.841 +\rail@bar
  18.842 +\rail@nextbar{1}
  18.843 +\rail@plus
  18.844 +\rail@nont{\isa{definsts}}[]
  18.845 +\rail@nextplus{2}
  18.846 +\rail@cterm{\isa{\isakeyword{and}}}[]
  18.847 +\rail@endplus
  18.848 +\rail@endbar
  18.849 +\rail@cr{4}
  18.850 +\rail@bar
  18.851 +\rail@nextbar{5}
  18.852 +\rail@nont{\isa{arbitrary}}[]
  18.853 +\rail@endbar
  18.854 +\rail@bar
  18.855 +\rail@nextbar{5}
  18.856 +\rail@nont{\isa{taking}}[]
  18.857 +\rail@endbar
  18.858 +\rail@bar
  18.859 +\rail@nextbar{5}
  18.860 +\rail@nont{\isa{rule}}[]
  18.861 +\rail@endbar
  18.862 +\rail@end
  18.863 +\rail@begin{2}{\isa{}}
  18.864 +\rail@term{\hyperlink{method.coinduct}{\mbox{\isa{coinduct}}}}[]
  18.865 +\rail@nont{\isa{insts}}[]
  18.866 +\rail@nont{\isa{taking}}[]
  18.867 +\rail@bar
  18.868 +\rail@nextbar{1}
  18.869 +\rail@nont{\isa{rule}}[]
  18.870 +\rail@endbar
  18.871 +\rail@end
  18.872 +\rail@begin{5}{\isa{rule}}
  18.873 +\rail@bar
  18.874 +\rail@bar
  18.875 +\rail@term{\isa{type}}[]
  18.876 +\rail@nextbar{1}
  18.877 +\rail@term{\isa{pred}}[]
  18.878 +\rail@nextbar{2}
  18.879 +\rail@term{\isa{set}}[]
  18.880 +\rail@endbar
  18.881 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  18.882 +\rail@plus
  18.883 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  18.884 +\rail@nextplus{1}
  18.885 +\rail@endplus
  18.886 +\rail@nextbar{3}
  18.887 +\rail@term{\isa{rule}}[]
  18.888 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  18.889 +\rail@plus
  18.890 +\rail@nont{\hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}}[]
  18.891 +\rail@nextplus{4}
  18.892 +\rail@endplus
  18.893 +\rail@endbar
  18.894 +\rail@end
  18.895 +\rail@begin{4}{\isa{definst}}
  18.896 +\rail@bar
  18.897 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  18.898 +\rail@bar
  18.899 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}{\isaliteral{3D}{\isacharequal}}}}[]
  18.900 +\rail@nextbar{1}
  18.901 +\rail@term{\isa{{\isaliteral{5C3C65717569763E}{\isasymequiv}}}}[]
  18.902 +\rail@endbar
  18.903 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  18.904 +\rail@nextbar{2}
  18.905 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  18.906 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  18.907 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  18.908 +\rail@nextbar{3}
  18.909 +\rail@nont{\hyperlink{syntax.inst}{\mbox{\isa{inst}}}}[]
  18.910 +\rail@endbar
  18.911 +\rail@end
  18.912 +\rail@begin{2}{\isa{definsts}}
  18.913 +\rail@plus
  18.914 +\rail@nextplus{1}
  18.915 +\rail@cnont{\isa{definst}}[]
  18.916 +\rail@endplus
  18.917 +\rail@end
  18.918 +\rail@begin{3}{\isa{arbitrary}}
  18.919 +\rail@term{\isa{arbitrary}}[]
  18.920 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  18.921 +\rail@plus
  18.922 +\rail@plus
  18.923 +\rail@nextplus{1}
  18.924 +\rail@cnont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  18.925 +\rail@endplus
  18.926 +\rail@term{\isa{\isakeyword{and}}}[]
  18.927 +\rail@nextplus{2}
  18.928 +\rail@endplus
  18.929 +\rail@end
  18.930 +\rail@begin{1}{\isa{taking}}
  18.931 +\rail@term{\isa{taking}}[]
  18.932 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  18.933 +\rail@nont{\isa{insts}}[]
  18.934 +\rail@end
  18.935 +\end{railoutput}
  18.936  
  18.937 -    rule: ('type' | 'pred' | 'set') ':' (nameref +) | 'rule' ':' (thmref +)
  18.938 -    ;
  18.939 -    definst: name ('==' | equiv) term | '(' term ')' | inst
  18.940 -    ;
  18.941 -    definsts: ( definst *)
  18.942 -    ;
  18.943 -    arbitrary: 'arbitrary' ':' ((term *) 'and' +)
  18.944 -    ;
  18.945 -    taking: 'taking' ':' insts
  18.946 -    ;
  18.947 -  \end{rail}
  18.948  
  18.949    \begin{description}
  18.950  
  18.951 @@ -1459,23 +1986,42 @@
  18.952      \indexdef{}{attribute}{coinduct}\hypertarget{attribute.coinduct}{\hyperlink{attribute.coinduct}{\mbox{\isa{coinduct}}}} & : & \isa{attribute} \\
  18.953    \end{matharray}
  18.954  
  18.955 -  \begin{rail}
  18.956 -    'cases' spec
  18.957 -    ;
  18.958 -    'induct' spec
  18.959 -    ;
  18.960 -    'coinduct' spec
  18.961 -    ;
  18.962 +  \begin{railoutput}
  18.963 +\rail@begin{1}{\isa{}}
  18.964 +\rail@term{\hyperlink{attribute.cases}{\mbox{\isa{cases}}}}[]
  18.965 +\rail@nont{\isa{spec}}[]
  18.966 +\rail@end
  18.967 +\rail@begin{1}{\isa{}}
  18.968 +\rail@term{\hyperlink{attribute.induct}{\mbox{\isa{induct}}}}[]
  18.969 +\rail@nont{\isa{spec}}[]
  18.970 +\rail@end
  18.971 +\rail@begin{1}{\isa{}}
  18.972 +\rail@term{\hyperlink{attribute.coinduct}{\mbox{\isa{coinduct}}}}[]
  18.973 +\rail@nont{\isa{spec}}[]
  18.974 +\rail@end
  18.975 +\rail@begin{4}{\isa{spec}}
  18.976 +\rail@bar
  18.977 +\rail@bar
  18.978 +\rail@term{\isa{type}}[]
  18.979 +\rail@nextbar{1}
  18.980 +\rail@term{\isa{pred}}[]
  18.981 +\rail@nextbar{2}
  18.982 +\rail@term{\isa{set}}[]
  18.983 +\rail@endbar
  18.984 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  18.985 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  18.986 +\rail@nextbar{3}
  18.987 +\rail@term{\isa{del}}[]
  18.988 +\rail@endbar
  18.989 +\rail@end
  18.990 +\end{railoutput}
  18.991  
  18.992 -    spec: (('type' | 'pred' | 'set') ':' nameref) | 'del'
  18.993 -    ;
  18.994 -  \end{rail}
  18.995  
  18.996    \begin{description}
  18.997  
  18.998    \item \hyperlink{command.print-induct-rules}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}induct{\isaliteral{5F}{\isacharunderscore}}rules}}}} prints cases and induct rules
  18.999    for predicates (or sets) and types of the current context.
 18.1000 -  
 18.1001 +
 18.1002    \item \hyperlink{attribute.cases}{\mbox{\isa{cases}}}, \hyperlink{attribute.induct}{\mbox{\isa{induct}}}, and \hyperlink{attribute.coinduct}{\mbox{\isa{coinduct}}} (as attributes) declare rules for reasoning about
 18.1003    (co)inductive predicates (or sets) and types, using the
 18.1004    corresponding methods of the same name.  Certain definitional
    19.1 --- a/doc-src/IsarRef/Thy/document/Spec.tex	Sun May 01 18:57:45 2011 +0200
    19.2 +++ b/doc-src/IsarRef/Thy/document/Spec.tex	Mon May 02 01:05:50 2011 +0200
    19.3 @@ -68,12 +68,34 @@
    19.4    although some user-interfaces might pretend that trailing input is
    19.5    admissible.
    19.6  
    19.7 -  \begin{rail}
    19.8 -    'theory' name 'imports' (name +) uses? 'begin'
    19.9 -    ;
   19.10 +  \begin{railoutput}
   19.11 +\rail@begin{2}{\isa{}}
   19.12 +\rail@term{\hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}}[]
   19.13 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   19.14 +\rail@term{\isa{\isakeyword{imports}}}[]
   19.15 +\rail@plus
   19.16 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   19.17 +\rail@nextplus{1}
   19.18 +\rail@endplus
   19.19 +\rail@bar
   19.20 +\rail@nextbar{1}
   19.21 +\rail@nont{\isa{uses}}[]
   19.22 +\rail@endbar
   19.23 +\rail@term{\isa{\isakeyword{begin}}}[]
   19.24 +\rail@end
   19.25 +\rail@begin{3}{\isa{uses}}
   19.26 +\rail@term{\isa{\isakeyword{uses}}}[]
   19.27 +\rail@plus
   19.28 +\rail@bar
   19.29 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   19.30 +\rail@nextbar{1}
   19.31 +\rail@nont{\hyperlink{syntax.parname}{\mbox{\isa{parname}}}}[]
   19.32 +\rail@endbar
   19.33 +\rail@nextplus{2}
   19.34 +\rail@endplus
   19.35 +\rail@end
   19.36 +\end{railoutput}
   19.37  
   19.38 -    uses: 'uses' ((name | parname) +);
   19.39 -  \end{rail}
   19.40  
   19.41    \begin{description}
   19.42  
   19.43 @@ -122,14 +144,20 @@
   19.44      \indexdef{local}{command}{end}\hypertarget{command.local.end}{\hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
   19.45    \end{matharray}
   19.46  
   19.47 -  \indexouternonterm{target}
   19.48 -  \begin{rail}
   19.49 -    'context' name 'begin'
   19.50 -    ;
   19.51 +  \begin{railoutput}
   19.52 +\rail@begin{1}{\isa{}}
   19.53 +\rail@term{\hyperlink{command.context}{\mbox{\isa{\isacommand{context}}}}}[]
   19.54 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   19.55 +\rail@term{\isa{\isakeyword{begin}}}[]
   19.56 +\rail@end
   19.57 +\rail@begin{1}{\indexdef{}{syntax}{target}\hypertarget{syntax.target}{\hyperlink{syntax.target}{\mbox{\isa{target}}}}}
   19.58 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
   19.59 +\rail@term{\isa{\isakeyword{in}}}[]
   19.60 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   19.61 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
   19.62 +\rail@end
   19.63 +\end{railoutput}
   19.64  
   19.65 -    target: '(' 'in' name ')'
   19.66 -    ;
   19.67 -  \end{rail}
   19.68  
   19.69    \begin{description}
   19.70    
   19.71 @@ -191,21 +219,102 @@
   19.72    \secref{sec:axms-thms}).  In particular, type-inference is commonly
   19.73    available, and result names need not be given.
   19.74  
   19.75 -  \begin{rail}
   19.76 -    'axiomatization' target? fixes? ('where' specs)?
   19.77 -    ;
   19.78 -    'definition' target? (decl 'where')? thmdecl? prop
   19.79 -    ;
   19.80 -    'abbreviation' target? mode? (decl 'where')? prop
   19.81 -    ;
   19.82 +  \begin{railoutput}
   19.83 +\rail@begin{2}{\isa{}}
   19.84 +\rail@term{\hyperlink{command.axiomatization}{\mbox{\isa{\isacommand{axiomatization}}}}}[]
   19.85 +\rail@bar
   19.86 +\rail@nextbar{1}
   19.87 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
   19.88 +\rail@endbar
   19.89 +\rail@bar
   19.90 +\rail@nextbar{1}
   19.91 +\rail@nont{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}[]
   19.92 +\rail@endbar
   19.93 +\rail@bar
   19.94 +\rail@nextbar{1}
   19.95 +\rail@term{\isa{\isakeyword{where}}}[]
   19.96 +\rail@nont{\isa{specs}}[]
   19.97 +\rail@endbar
   19.98 +\rail@end
   19.99 +\rail@begin{2}{\isa{}}
  19.100 +\rail@term{\hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}}[]
  19.101 +\rail@bar
  19.102 +\rail@nextbar{1}
  19.103 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
  19.104 +\rail@endbar
  19.105 +\rail@bar
  19.106 +\rail@nextbar{1}
  19.107 +\rail@nont{\isa{decl}}[]
  19.108 +\rail@term{\isa{\isakeyword{where}}}[]
  19.109 +\rail@endbar
  19.110 +\rail@bar
  19.111 +\rail@nextbar{1}
  19.112 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
  19.113 +\rail@endbar
  19.114 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  19.115 +\rail@end
  19.116 +\rail@begin{2}{\isa{}}
  19.117 +\rail@term{\hyperlink{command.abbreviation}{\mbox{\isa{\isacommand{abbreviation}}}}}[]
  19.118 +\rail@bar
  19.119 +\rail@nextbar{1}
  19.120 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
  19.121 +\rail@endbar
  19.122 +\rail@bar
  19.123 +\rail@nextbar{1}
  19.124 +\rail@nont{\hyperlink{syntax.mode}{\mbox{\isa{mode}}}}[]
  19.125 +\rail@endbar
  19.126 +\rail@bar
  19.127 +\rail@nextbar{1}
  19.128 +\rail@nont{\isa{decl}}[]
  19.129 +\rail@term{\isa{\isakeyword{where}}}[]
  19.130 +\rail@endbar
  19.131 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  19.132 +\rail@end
  19.133 +\rail@begin{4}{\indexdef{}{syntax}{fixes}\hypertarget{syntax.fixes}{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}}
  19.134 +\rail@plus
  19.135 +\rail@bar
  19.136 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  19.137 +\rail@bar
  19.138 +\rail@nextbar{1}
  19.139 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
  19.140 +\rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
  19.141 +\rail@endbar
  19.142 +\rail@bar
  19.143 +\rail@nextbar{1}
  19.144 +\rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
  19.145 +\rail@endbar
  19.146 +\rail@nextbar{2}
  19.147 +\rail@nont{\hyperlink{syntax.vars}{\mbox{\isa{vars}}}}[]
  19.148 +\rail@endbar
  19.149 +\rail@nextplus{3}
  19.150 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.151 +\rail@endplus
  19.152 +\rail@end
  19.153 +\rail@begin{3}{\isa{specs}}
  19.154 +\rail@plus
  19.155 +\rail@bar
  19.156 +\rail@nextbar{1}
  19.157 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
  19.158 +\rail@endbar
  19.159 +\rail@nont{\hyperlink{syntax.props}{\mbox{\isa{props}}}}[]
  19.160 +\rail@nextplus{2}
  19.161 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.162 +\rail@endplus
  19.163 +\rail@end
  19.164 +\rail@begin{2}{\isa{decl}}
  19.165 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  19.166 +\rail@bar
  19.167 +\rail@nextbar{1}
  19.168 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
  19.169 +\rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
  19.170 +\rail@endbar
  19.171 +\rail@bar
  19.172 +\rail@nextbar{1}
  19.173 +\rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
  19.174 +\rail@endbar
  19.175 +\rail@end
  19.176 +\end{railoutput}
  19.177  
  19.178 -    fixes: ((name ('::' type)? mixfix? | vars) + 'and')
  19.179 -    ;
  19.180 -    specs: (thmdecl? props + 'and')
  19.181 -    ;
  19.182 -    decl: name ('::' type)? mixfix?
  19.183 -    ;
  19.184 -  \end{rail}
  19.185  
  19.186    \begin{description}
  19.187    
  19.188 @@ -277,12 +386,39 @@
  19.189      \indexdef{}{command}{declare}\hypertarget{command.declare}{\hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
  19.190    \end{matharray}
  19.191  
  19.192 -  \begin{rail}
  19.193 -    ('declaration' | 'syntax_declaration') ('(pervasive)')? target? text
  19.194 -    ;
  19.195 -    'declare' target? (thmrefs + 'and')
  19.196 -    ;
  19.197 -  \end{rail}
  19.198 +  \begin{railoutput}
  19.199 +\rail@begin{2}{\isa{}}
  19.200 +\rail@bar
  19.201 +\rail@term{\hyperlink{command.declaration}{\mbox{\isa{\isacommand{declaration}}}}}[]
  19.202 +\rail@nextbar{1}
  19.203 +\rail@term{\hyperlink{command.syntax-declaration}{\mbox{\isa{\isacommand{syntax{\isaliteral{5F}{\isacharunderscore}}declaration}}}}}[]
  19.204 +\rail@endbar
  19.205 +\rail@bar
  19.206 +\rail@nextbar{1}
  19.207 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  19.208 +\rail@term{\isa{\isakeyword{pervasive}}}[]
  19.209 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  19.210 +\rail@endbar
  19.211 +\rail@bar
  19.212 +\rail@nextbar{1}
  19.213 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
  19.214 +\rail@endbar
  19.215 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
  19.216 +\rail@end
  19.217 +\rail@begin{2}{\isa{}}
  19.218 +\rail@term{\hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}}}[]
  19.219 +\rail@bar
  19.220 +\rail@nextbar{1}
  19.221 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
  19.222 +\rail@endbar
  19.223 +\rail@plus
  19.224 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  19.225 +\rail@nextplus{1}
  19.226 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.227 +\rail@endplus
  19.228 +\rail@end
  19.229 +\end{railoutput}
  19.230 +
  19.231  
  19.232    \begin{description}
  19.233  
  19.234 @@ -333,19 +469,69 @@
  19.235    elements from equal instances are never repeated, thus avoiding
  19.236    duplicate declarations.
  19.237  
  19.238 -  \indexouternonterm{localeexpr}
  19.239 -  \begin{rail}
  19.240 -    localeexpr: (instance + '+') ('for' (fixes + 'and'))?
  19.241 -    ;
  19.242 -    instance: (qualifier ':')? nameref (posinsts | namedinsts)
  19.243 -    ;
  19.244 -    qualifier: name ('?' | '!')?
  19.245 -    ;
  19.246 -    posinsts: (term | '_')*
  19.247 -    ;
  19.248 -    namedinsts: 'where' (name '=' term + 'and')
  19.249 -    ;
  19.250 -  \end{rail}
  19.251 +  \begin{railoutput}
  19.252 +\rail@begin{3}{\indexdef{}{syntax}{localeexpr}\hypertarget{syntax.localeexpr}{\hyperlink{syntax.localeexpr}{\mbox{\isa{localeexpr}}}}}
  19.253 +\rail@plus
  19.254 +\rail@nont{\isa{instance}}[]
  19.255 +\rail@nextplus{1}
  19.256 +\rail@cterm{\isa{{\isaliteral{2B}{\isacharplus}}}}[]
  19.257 +\rail@endplus
  19.258 +\rail@bar
  19.259 +\rail@nextbar{1}
  19.260 +\rail@term{\isa{\isakeyword{for}}}[]
  19.261 +\rail@plus
  19.262 +\rail@nont{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}[]
  19.263 +\rail@nextplus{2}
  19.264 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.265 +\rail@endplus
  19.266 +\rail@endbar
  19.267 +\rail@end
  19.268 +\rail@begin{2}{\isa{instance}}
  19.269 +\rail@bar
  19.270 +\rail@nextbar{1}
  19.271 +\rail@nont{\isa{qualifier}}[]
  19.272 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
  19.273 +\rail@endbar
  19.274 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.275 +\rail@bar
  19.276 +\rail@nont{\isa{posinsts}}[]
  19.277 +\rail@nextbar{1}
  19.278 +\rail@nont{\isa{namedinsts}}[]
  19.279 +\rail@endbar
  19.280 +\rail@end
  19.281 +\rail@begin{3}{\isa{qualifier}}
  19.282 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  19.283 +\rail@bar
  19.284 +\rail@nextbar{1}
  19.285 +\rail@bar
  19.286 +\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
  19.287 +\rail@nextbar{2}
  19.288 +\rail@term{\isa{{\isaliteral{21}{\isacharbang}}}}[]
  19.289 +\rail@endbar
  19.290 +\rail@endbar
  19.291 +\rail@end
  19.292 +\rail@begin{3}{\isa{posinsts}}
  19.293 +\rail@plus
  19.294 +\rail@nextplus{1}
  19.295 +\rail@bar
  19.296 +\rail@term{\isa{{\isaliteral{5F}{\isacharunderscore}}}}[]
  19.297 +\rail@nextbar{2}
  19.298 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  19.299 +\rail@endbar
  19.300 +\rail@endplus
  19.301 +\rail@end
  19.302 +\rail@begin{2}{\isa{namedinsts}}
  19.303 +\rail@term{\isa{\isakeyword{where}}}[]
  19.304 +\rail@plus
  19.305 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  19.306 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  19.307 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  19.308 +\rail@nextplus{1}
  19.309 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.310 +\rail@endplus
  19.311 +\rail@end
  19.312 +\end{railoutput}
  19.313 +
  19.314  
  19.315    A locale instance consists of a reference to a locale and either
  19.316    positional or named parameter instantiations.  Identical
  19.317 @@ -383,24 +569,102 @@
  19.318      \indexdef{}{method}{unfold\_locales}\hypertarget{method.unfold-locales}{\hyperlink{method.unfold-locales}{\mbox{\isa{unfold{\isaliteral{5F}{\isacharunderscore}}locales}}}} & : & \isa{method} \\
  19.319    \end{matharray}
  19.320  
  19.321 -  \indexouternonterm{contextelem}
  19.322    \indexisarelem{fixes}\indexisarelem{constrains}\indexisarelem{assumes}
  19.323    \indexisarelem{defines}\indexisarelem{notes}
  19.324 -  \begin{rail}
  19.325 -    'locale' name ('=' locale)? 'begin'?
  19.326 -    ;
  19.327 -    'print_locale' '!'? nameref
  19.328 -    ;
  19.329 -    locale: contextelem+ | localeexpr ('+' (contextelem+))?
  19.330 -    ;
  19.331 -    contextelem:
  19.332 -    'fixes' (fixes + 'and')
  19.333 -    | 'constrains' (name '::' type + 'and')
  19.334 -    | 'assumes' (props + 'and')
  19.335 -    | 'defines' (thmdecl? prop proppat? + 'and')
  19.336 -    | 'notes' (thmdef? thmrefs + 'and')
  19.337 -    ;
  19.338 -  \end{rail}
  19.339 +  \begin{railoutput}
  19.340 +\rail@begin{2}{\isa{}}
  19.341 +\rail@term{\hyperlink{command.locale}{\mbox{\isa{\isacommand{locale}}}}}[]
  19.342 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  19.343 +\rail@bar
  19.344 +\rail@nextbar{1}
  19.345 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  19.346 +\rail@nont{\hyperlink{syntax.locale}{\mbox{\isa{locale}}}}[]
  19.347 +\rail@endbar
  19.348 +\rail@bar
  19.349 +\rail@nextbar{1}
  19.350 +\rail@term{\isa{\isakeyword{begin}}}[]
  19.351 +\rail@endbar
  19.352 +\rail@end
  19.353 +\rail@begin{2}{\isa{}}
  19.354 +\rail@term{\hyperlink{command.print-locale}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}locale}}}}}[]
  19.355 +\rail@bar
  19.356 +\rail@nextbar{1}
  19.357 +\rail@term{\isa{{\isaliteral{21}{\isacharbang}}}}[]
  19.358 +\rail@endbar
  19.359 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.360 +\rail@end
  19.361 +\rail@begin{5}{\indexdef{}{syntax}{locale}\hypertarget{syntax.locale}{\hyperlink{syntax.locale}{\mbox{\isa{locale}}}}}
  19.362 +\rail@bar
  19.363 +\rail@plus
  19.364 +\rail@nont{\hyperlink{syntax.contextelem}{\mbox{\isa{contextelem}}}}[]
  19.365 +\rail@nextplus{1}
  19.366 +\rail@endplus
  19.367 +\rail@nextbar{2}
  19.368 +\rail@nont{\hyperlink{syntax.localeexpr}{\mbox{\isa{localeexpr}}}}[]
  19.369 +\rail@bar
  19.370 +\rail@nextbar{3}
  19.371 +\rail@term{\isa{{\isaliteral{2B}{\isacharplus}}}}[]
  19.372 +\rail@plus
  19.373 +\rail@nont{\hyperlink{syntax.contextelem}{\mbox{\isa{contextelem}}}}[]
  19.374 +\rail@nextplus{4}
  19.375 +\rail@endplus
  19.376 +\rail@endbar
  19.377 +\rail@endbar
  19.378 +\rail@end
  19.379 +\rail@begin{12}{\indexdef{}{syntax}{contextelem}\hypertarget{syntax.contextelem}{\hyperlink{syntax.contextelem}{\mbox{\isa{contextelem}}}}}
  19.380 +\rail@bar
  19.381 +\rail@term{\isa{\isakeyword{fixes}}}[]
  19.382 +\rail@plus
  19.383 +\rail@nont{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}[]
  19.384 +\rail@nextplus{1}
  19.385 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.386 +\rail@endplus
  19.387 +\rail@nextbar{2}
  19.388 +\rail@term{\isa{\isakeyword{constrains}}}[]
  19.389 +\rail@plus
  19.390 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  19.391 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
  19.392 +\rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
  19.393 +\rail@nextplus{3}
  19.394 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.395 +\rail@endplus
  19.396 +\rail@nextbar{4}
  19.397 +\rail@term{\isa{\isakeyword{assumes}}}[]
  19.398 +\rail@plus
  19.399 +\rail@nont{\hyperlink{syntax.props}{\mbox{\isa{props}}}}[]
  19.400 +\rail@nextplus{5}
  19.401 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.402 +\rail@endplus
  19.403 +\rail@nextbar{6}
  19.404 +\rail@term{\isa{\isakeyword{defines}}}[]
  19.405 +\rail@plus
  19.406 +\rail@bar
  19.407 +\rail@nextbar{7}
  19.408 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
  19.409 +\rail@endbar
  19.410 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  19.411 +\rail@bar
  19.412 +\rail@nextbar{7}
  19.413 +\rail@nont{\hyperlink{syntax.proppat}{\mbox{\isa{proppat}}}}[]
  19.414 +\rail@endbar
  19.415 +\rail@nextplus{8}
  19.416 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.417 +\rail@endplus
  19.418 +\rail@nextbar{9}
  19.419 +\rail@term{\isa{\isakeyword{notes}}}[]
  19.420 +\rail@plus
  19.421 +\rail@bar
  19.422 +\rail@nextbar{10}
  19.423 +\rail@nont{\hyperlink{syntax.thmdef}{\mbox{\isa{thmdef}}}}[]
  19.424 +\rail@endbar
  19.425 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  19.426 +\rail@nextplus{11}
  19.427 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.428 +\rail@endplus
  19.429 +\rail@endbar
  19.430 +\rail@end
  19.431 +\end{railoutput}
  19.432 +
  19.433  
  19.434    \begin{description}
  19.435    
  19.436 @@ -522,21 +786,63 @@
  19.437      \indexdef{}{command}{print\_interps}\hypertarget{command.print-interps}{\hyperlink{command.print-interps}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}interps}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
  19.438    \end{matharray}
  19.439  
  19.440 -  \indexouternonterm{interp}
  19.441 -  \begin{rail}
  19.442 -    'interpretation' localeexpr equations?
  19.443 -    ;
  19.444 -    'interpret' localeexpr equations?
  19.445 -    ;
  19.446 -    'sublocale' nameref ('<' | subseteq) localeexpr equations?
  19.447 -    ;
  19.448 -    'print_dependencies' '!'? localeexpr
  19.449 -    ;
  19.450 -    'print_interps' nameref
  19.451 -    ;
  19.452 -    equations: 'where' (thmdecl? prop + 'and')
  19.453 -    ;
  19.454 -  \end{rail}
  19.455 +  \begin{railoutput}
  19.456 +\rail@begin{2}{\isa{}}
  19.457 +\rail@term{\hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}}}[]
  19.458 +\rail@nont{\hyperlink{syntax.localeexpr}{\mbox{\isa{localeexpr}}}}[]
  19.459 +\rail@bar
  19.460 +\rail@nextbar{1}
  19.461 +\rail@nont{\isa{equations}}[]
  19.462 +\rail@endbar
  19.463 +\rail@end
  19.464 +\rail@begin{2}{\isa{}}
  19.465 +\rail@term{\hyperlink{command.interpret}{\mbox{\isa{\isacommand{interpret}}}}}[]
  19.466 +\rail@nont{\hyperlink{syntax.localeexpr}{\mbox{\isa{localeexpr}}}}[]
  19.467 +\rail@bar
  19.468 +\rail@nextbar{1}
  19.469 +\rail@nont{\isa{equations}}[]
  19.470 +\rail@endbar
  19.471 +\rail@end
  19.472 +\rail@begin{2}{\isa{}}
  19.473 +\rail@term{\hyperlink{command.sublocale}{\mbox{\isa{\isacommand{sublocale}}}}}[]
  19.474 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.475 +\rail@bar
  19.476 +\rail@term{\isa{{\isaliteral{3C}{\isacharless}}}}[]
  19.477 +\rail@nextbar{1}
  19.478 +\rail@term{\isa{{\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}}}[]
  19.479 +\rail@endbar
  19.480 +\rail@nont{\hyperlink{syntax.localeexpr}{\mbox{\isa{localeexpr}}}}[]
  19.481 +\rail@bar
  19.482 +\rail@nextbar{1}
  19.483 +\rail@nont{\isa{equations}}[]
  19.484 +\rail@endbar
  19.485 +\rail@end
  19.486 +\rail@begin{2}{\isa{}}
  19.487 +\rail@term{\hyperlink{command.print-dependencies}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}dependencies}}}}}[]
  19.488 +\rail@bar
  19.489 +\rail@nextbar{1}
  19.490 +\rail@term{\isa{{\isaliteral{21}{\isacharbang}}}}[]
  19.491 +\rail@endbar
  19.492 +\rail@nont{\hyperlink{syntax.localeexpr}{\mbox{\isa{localeexpr}}}}[]
  19.493 +\rail@end
  19.494 +\rail@begin{1}{\isa{}}
  19.495 +\rail@term{\hyperlink{command.print-interps}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}interps}}}}}[]
  19.496 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.497 +\rail@end
  19.498 +\rail@begin{3}{\isa{equations}}
  19.499 +\rail@term{\isa{\isakeyword{where}}}[]
  19.500 +\rail@plus
  19.501 +\rail@bar
  19.502 +\rail@nextbar{1}
  19.503 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
  19.504 +\rail@endbar
  19.505 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  19.506 +\rail@nextplus{2}
  19.507 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.508 +\rail@endplus
  19.509 +\rail@end
  19.510 +\end{railoutput}
  19.511 +
  19.512  
  19.513    \begin{description}
  19.514  
  19.515 @@ -662,28 +968,91 @@
  19.516      \indexdef{}{method}{intro\_classes}\hypertarget{method.intro-classes}{\hyperlink{method.intro-classes}{\mbox{\isa{intro{\isaliteral{5F}{\isacharunderscore}}classes}}}} & : & \isa{method} \\
  19.517    \end{matharray}
  19.518  
  19.519 -  \begin{rail}
  19.520 -    'class' name '=' ((superclassexpr '+' (contextelem+)) | superclassexpr | (contextelem+)) \\
  19.521 -      'begin'?
  19.522 -    ;
  19.523 -    'instantiation' (nameref + 'and') '::' arity 'begin'
  19.524 -    ;
  19.525 -    'instance'
  19.526 -    ;
  19.527 -    'instance' (nameref + 'and') '::' arity
  19.528 -    ;
  19.529 -    'subclass' target? nameref
  19.530 -    ;
  19.531 -    'instance' nameref ('<' | subseteq) nameref
  19.532 -    ;
  19.533 -    'print_classes'
  19.534 -    ;
  19.535 -    'class_deps'
  19.536 -    ;
  19.537 -
  19.538 -    superclassexpr: nameref | (nameref '+' superclassexpr)
  19.539 -    ;
  19.540 -  \end{rail}
  19.541 +  \begin{railoutput}
  19.542 +\rail@begin{8}{\isa{}}
  19.543 +\rail@term{\hyperlink{command.class}{\mbox{\isa{\isacommand{class}}}}}[]
  19.544 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  19.545 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  19.546 +\rail@bar
  19.547 +\rail@nont{\isa{superclassexpr}}[]
  19.548 +\rail@term{\isa{{\isaliteral{2B}{\isacharplus}}}}[]
  19.549 +\rail@plus
  19.550 +\rail@nont{\hyperlink{syntax.contextelem}{\mbox{\isa{contextelem}}}}[]
  19.551 +\rail@nextplus{1}
  19.552 +\rail@endplus
  19.553 +\rail@nextbar{2}
  19.554 +\rail@nont{\isa{superclassexpr}}[]
  19.555 +\rail@nextbar{3}
  19.556 +\rail@plus
  19.557 +\rail@nont{\hyperlink{syntax.contextelem}{\mbox{\isa{contextelem}}}}[]
  19.558 +\rail@nextplus{4}
  19.559 +\rail@endplus
  19.560 +\rail@endbar
  19.561 +\rail@cr{6}
  19.562 +\rail@bar
  19.563 +\rail@nextbar{7}
  19.564 +\rail@term{\isa{\isakeyword{begin}}}[]
  19.565 +\rail@endbar
  19.566 +\rail@end
  19.567 +\rail@begin{2}{\isa{}}
  19.568 +\rail@term{\hyperlink{command.instantiation}{\mbox{\isa{\isacommand{instantiation}}}}}[]
  19.569 +\rail@plus
  19.570 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.571 +\rail@nextplus{1}
  19.572 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.573 +\rail@endplus
  19.574 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
  19.575 +\rail@nont{\hyperlink{syntax.arity}{\mbox{\isa{arity}}}}[]
  19.576 +\rail@term{\isa{\isakeyword{begin}}}[]
  19.577 +\rail@end
  19.578 +\rail@begin{1}{\isa{}}
  19.579 +\rail@term{\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}}[]
  19.580 +\rail@end
  19.581 +\rail@begin{2}{\isa{}}
  19.582 +\rail@term{\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}}[]
  19.583 +\rail@plus
  19.584 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.585 +\rail@nextplus{1}
  19.586 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.587 +\rail@endplus
  19.588 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
  19.589 +\rail@nont{\hyperlink{syntax.arity}{\mbox{\isa{arity}}}}[]
  19.590 +\rail@end
  19.591 +\rail@begin{2}{\isa{}}
  19.592 +\rail@term{\hyperlink{command.subclass}{\mbox{\isa{\isacommand{subclass}}}}}[]
  19.593 +\rail@bar
  19.594 +\rail@nextbar{1}
  19.595 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
  19.596 +\rail@endbar
  19.597 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.598 +\rail@end
  19.599 +\rail@begin{2}{\isa{}}
  19.600 +\rail@term{\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}}[]
  19.601 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.602 +\rail@bar
  19.603 +\rail@term{\isa{{\isaliteral{3C}{\isacharless}}}}[]
  19.604 +\rail@nextbar{1}
  19.605 +\rail@term{\isa{{\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}}}[]
  19.606 +\rail@endbar
  19.607 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.608 +\rail@end
  19.609 +\rail@begin{1}{\isa{}}
  19.610 +\rail@term{\hyperlink{command.print-classes}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}classes}}}}}[]
  19.611 +\rail@end
  19.612 +\rail@begin{1}{\isa{}}
  19.613 +\rail@term{\hyperlink{command.class-deps}{\mbox{\isa{\isacommand{class{\isaliteral{5F}{\isacharunderscore}}deps}}}}}[]
  19.614 +\rail@end
  19.615 +\rail@begin{2}{\isa{superclassexpr}}
  19.616 +\rail@bar
  19.617 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.618 +\rail@nextbar{1}
  19.619 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.620 +\rail@term{\isa{{\isaliteral{2B}{\isacharplus}}}}[]
  19.621 +\rail@nont{\isa{superclassexpr}}[]
  19.622 +\rail@endbar
  19.623 +\rail@end
  19.624 +\end{railoutput}
  19.625 +  %% FIXME check superclassexpr
  19.626  
  19.627    \begin{description}
  19.628  
  19.629 @@ -840,10 +1209,30 @@
  19.630      \indexdef{}{command}{overloading}\hypertarget{command.overloading}{\hyperlink{command.overloading}{\mbox{\isa{\isacommand{overloading}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
  19.631    \end{matharray}
  19.632  
  19.633 -  \begin{rail}
  19.634 -    'overloading' \\
  19.635 -    ( string ( '==' | equiv ) term ( '(' 'unchecked' ')' )? + ) 'begin'
  19.636 -  \end{rail}
  19.637 +  \begin{railoutput}
  19.638 +\rail@begin{5}{\isa{}}
  19.639 +\rail@term{\hyperlink{command.overloading}{\mbox{\isa{\isacommand{overloading}}}}}[]
  19.640 +\rail@cr{2}
  19.641 +\rail@plus
  19.642 +\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
  19.643 +\rail@bar
  19.644 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}{\isaliteral{3D}{\isacharequal}}}}[]
  19.645 +\rail@nextbar{3}
  19.646 +\rail@term{\isa{{\isaliteral{5C3C65717569763E}{\isasymequiv}}}}[]
  19.647 +\rail@endbar
  19.648 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  19.649 +\rail@bar
  19.650 +\rail@nextbar{3}
  19.651 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  19.652 +\rail@term{\isa{\isakeyword{unchecked}}}[]
  19.653 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  19.654 +\rail@endbar
  19.655 +\rail@nextplus{4}
  19.656 +\rail@endplus
  19.657 +\rail@term{\isa{\isakeyword{begin}}}[]
  19.658 +\rail@end
  19.659 +\end{railoutput}
  19.660 +  %% FIXME check string vs. name
  19.661  
  19.662    \begin{description}
  19.663  
  19.664 @@ -882,14 +1271,36 @@
  19.665      \indexdef{}{command}{attribute\_setup}\hypertarget{command.attribute-setup}{\hyperlink{command.attribute-setup}{\mbox{\isa{\isacommand{attribute{\isaliteral{5F}{\isacharunderscore}}setup}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
  19.666    \end{matharray}
  19.667  
  19.668 -  \begin{rail}
  19.669 -    'use' name
  19.670 -    ;
  19.671 -    ('ML' | 'ML_prf' | 'ML_val' | 'ML_command' | 'setup' | 'local_setup') text
  19.672 -    ;
  19.673 -    'attribute_setup' name '=' text text
  19.674 -    ;
  19.675 -  \end{rail}
  19.676 +  \begin{railoutput}
  19.677 +\rail@begin{1}{\isa{}}
  19.678 +\rail@term{\hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}}}[]
  19.679 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  19.680 +\rail@end
  19.681 +\rail@begin{6}{\isa{}}
  19.682 +\rail@bar
  19.683 +\rail@term{\hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}}}[]
  19.684 +\rail@nextbar{1}
  19.685 +\rail@term{\hyperlink{command.ML-prf}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}prf}}}}}[]
  19.686 +\rail@nextbar{2}
  19.687 +\rail@term{\hyperlink{command.ML-val}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}val}}}}}[]
  19.688 +\rail@nextbar{3}
  19.689 +\rail@term{\hyperlink{command.ML-command}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}command}}}}}[]
  19.690 +\rail@nextbar{4}
  19.691 +\rail@term{\hyperlink{command.setup}{\mbox{\isa{\isacommand{setup}}}}}[]
  19.692 +\rail@nextbar{5}
  19.693 +\rail@term{\hyperlink{command.local-setup}{\mbox{\isa{\isacommand{local{\isaliteral{5F}{\isacharunderscore}}setup}}}}}[]
  19.694 +\rail@endbar
  19.695 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
  19.696 +\rail@end
  19.697 +\rail@begin{1}{\isa{}}
  19.698 +\rail@term{\hyperlink{command.attribute-setup}{\mbox{\isa{\isacommand{attribute{\isaliteral{5F}{\isacharunderscore}}setup}}}}}[]
  19.699 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  19.700 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  19.701 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
  19.702 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
  19.703 +\rail@end
  19.704 +\end{railoutput}
  19.705 +
  19.706  
  19.707    \begin{description}
  19.708  
  19.709 @@ -984,14 +1395,34 @@
  19.710      \indexdef{}{command}{default\_sort}\hypertarget{command.default-sort}{\hyperlink{command.default-sort}{\mbox{\isa{\isacommand{default{\isaliteral{5F}{\isacharunderscore}}sort}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}}
  19.711    \end{matharray}
  19.712  
  19.713 -  \begin{rail}
  19.714 -    'classes' (classdecl +)
  19.715 -    ;
  19.716 -    'classrel' (nameref ('<' | subseteq) nameref + 'and')
  19.717 -    ;
  19.718 -    'default_sort' sort
  19.719 -    ;
  19.720 -  \end{rail}
  19.721 +  \begin{railoutput}
  19.722 +\rail@begin{2}{\isa{}}
  19.723 +\rail@term{\hyperlink{command.classes}{\mbox{\isa{\isacommand{classes}}}}}[]
  19.724 +\rail@plus
  19.725 +\rail@nont{\hyperlink{syntax.classdecl}{\mbox{\isa{classdecl}}}}[]
  19.726 +\rail@nextplus{1}
  19.727 +\rail@endplus
  19.728 +\rail@end
  19.729 +\rail@begin{3}{\isa{}}
  19.730 +\rail@term{\hyperlink{command.classrel}{\mbox{\isa{\isacommand{classrel}}}}}[]
  19.731 +\rail@plus
  19.732 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.733 +\rail@bar
  19.734 +\rail@term{\isa{{\isaliteral{3C}{\isacharless}}}}[]
  19.735 +\rail@nextbar{1}
  19.736 +\rail@term{\isa{{\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}}}[]
  19.737 +\rail@endbar
  19.738 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.739 +\rail@nextplus{2}
  19.740 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.741 +\rail@endplus
  19.742 +\rail@end
  19.743 +\rail@begin{1}{\isa{}}
  19.744 +\rail@term{\hyperlink{command.default-sort}{\mbox{\isa{\isacommand{default{\isaliteral{5F}{\isacharunderscore}}sort}}}}}[]
  19.745 +\rail@nont{\hyperlink{syntax.sort}{\mbox{\isa{sort}}}}[]
  19.746 +\rail@end
  19.747 +\end{railoutput}
  19.748 +
  19.749  
  19.750    \begin{description}
  19.751  
  19.752 @@ -1034,14 +1465,36 @@
  19.753      \indexdef{}{command}{arities}\hypertarget{command.arities}{\hyperlink{command.arities}{\mbox{\isa{\isacommand{arities}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} & (axiomatic!) \\
  19.754    \end{matharray}
  19.755  
  19.756 -  \begin{rail}
  19.757 -    'type_synonym' (typespec '=' type mixfix?)
  19.758 -    ;
  19.759 -    'typedecl' typespec mixfix?
  19.760 -    ;
  19.761 -    'arities' (nameref '::' arity +)
  19.762 -    ;
  19.763 -  \end{rail}
  19.764 +  \begin{railoutput}
  19.765 +\rail@begin{2}{\isa{}}
  19.766 +\rail@term{\hyperlink{command.type-synonym}{\mbox{\isa{\isacommand{type{\isaliteral{5F}{\isacharunderscore}}synonym}}}}}[]
  19.767 +\rail@nont{\hyperlink{syntax.typespec}{\mbox{\isa{typespec}}}}[]
  19.768 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  19.769 +\rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
  19.770 +\rail@bar
  19.771 +\rail@nextbar{1}
  19.772 +\rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
  19.773 +\rail@endbar
  19.774 +\rail@end
  19.775 +\rail@begin{2}{\isa{}}
  19.776 +\rail@term{\hyperlink{command.typedecl}{\mbox{\isa{\isacommand{typedecl}}}}}[]
  19.777 +\rail@nont{\hyperlink{syntax.typespec}{\mbox{\isa{typespec}}}}[]
  19.778 +\rail@bar
  19.779 +\rail@nextbar{1}
  19.780 +\rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
  19.781 +\rail@endbar
  19.782 +\rail@end
  19.783 +\rail@begin{2}{\isa{}}
  19.784 +\rail@term{\hyperlink{command.arities}{\mbox{\isa{\isacommand{arities}}}}}[]
  19.785 +\rail@plus
  19.786 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.787 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
  19.788 +\rail@nont{\hyperlink{syntax.arity}{\mbox{\isa{arity}}}}[]
  19.789 +\rail@nextplus{1}
  19.790 +\rail@endplus
  19.791 +\rail@end
  19.792 +\end{railoutput}
  19.793 +
  19.794  
  19.795    \begin{description}
  19.796  
  19.797 @@ -1112,12 +1565,44 @@
  19.798      \indexdef{}{command}{defs}\hypertarget{command.defs}{\hyperlink{command.defs}{\mbox{\isa{\isacommand{defs}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
  19.799    \end{matharray}
  19.800  
  19.801 -  \begin{rail}
  19.802 -    'consts' ((name '::' type mixfix?) +)
  19.803 -    ;
  19.804 -    'defs' ('(' 'unchecked'? 'overloaded'? ')')? \\ (axmdecl prop +)
  19.805 -    ;
  19.806 -  \end{rail}
  19.807 +  \begin{railoutput}
  19.808 +\rail@begin{3}{\isa{}}
  19.809 +\rail@term{\hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}}}[]
  19.810 +\rail@plus
  19.811 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  19.812 +\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
  19.813 +\rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
  19.814 +\rail@bar
  19.815 +\rail@nextbar{1}
  19.816 +\rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
  19.817 +\rail@endbar
  19.818 +\rail@nextplus{2}
  19.819 +\rail@endplus
  19.820 +\rail@end
  19.821 +\rail@begin{6}{\isa{}}
  19.822 +\rail@term{\hyperlink{command.defs}{\mbox{\isa{\isacommand{defs}}}}}[]
  19.823 +\rail@bar
  19.824 +\rail@nextbar{1}
  19.825 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  19.826 +\rail@bar
  19.827 +\rail@nextbar{2}
  19.828 +\rail@term{\isa{\isakeyword{unchecked}}}[]
  19.829 +\rail@endbar
  19.830 +\rail@bar
  19.831 +\rail@nextbar{2}
  19.832 +\rail@term{\isa{\isakeyword{overloaded}}}[]
  19.833 +\rail@endbar
  19.834 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  19.835 +\rail@endbar
  19.836 +\rail@cr{4}
  19.837 +\rail@plus
  19.838 +\rail@nont{\hyperlink{syntax.axmdecl}{\mbox{\isa{axmdecl}}}}[]
  19.839 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  19.840 +\rail@nextplus{5}
  19.841 +\rail@endplus
  19.842 +\rail@end
  19.843 +\end{railoutput}
  19.844 +
  19.845  
  19.846    \begin{description}
  19.847  
  19.848 @@ -1153,12 +1638,37 @@
  19.849      \indexdef{}{command}{theorems}\hypertarget{command.theorems}{\hyperlink{command.theorems}{\mbox{\isa{\isacommand{theorems}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
  19.850    \end{matharray}
  19.851  
  19.852 -  \begin{rail}
  19.853 -    'axioms' (axmdecl prop +)
  19.854 -    ;
  19.855 -    ('lemmas' | 'theorems') target? (thmdef? thmrefs + 'and')
  19.856 -    ;
  19.857 -  \end{rail}
  19.858 +  \begin{railoutput}
  19.859 +\rail@begin{2}{\isa{}}
  19.860 +\rail@term{\hyperlink{command.axioms}{\mbox{\isa{\isacommand{axioms}}}}}[]
  19.861 +\rail@plus
  19.862 +\rail@nont{\hyperlink{syntax.axmdecl}{\mbox{\isa{axmdecl}}}}[]
  19.863 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  19.864 +\rail@nextplus{1}
  19.865 +\rail@endplus
  19.866 +\rail@end
  19.867 +\rail@begin{3}{\isa{}}
  19.868 +\rail@bar
  19.869 +\rail@term{\hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}}}[]
  19.870 +\rail@nextbar{1}
  19.871 +\rail@term{\hyperlink{command.theorems}{\mbox{\isa{\isacommand{theorems}}}}}[]
  19.872 +\rail@endbar
  19.873 +\rail@bar
  19.874 +\rail@nextbar{1}
  19.875 +\rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
  19.876 +\rail@endbar
  19.877 +\rail@plus
  19.878 +\rail@bar
  19.879 +\rail@nextbar{1}
  19.880 +\rail@nont{\hyperlink{syntax.thmdef}{\mbox{\isa{thmdef}}}}[]
  19.881 +\rail@endbar
  19.882 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  19.883 +\rail@nextplus{2}
  19.884 +\rail@cterm{\isa{\isakeyword{and}}}[]
  19.885 +\rail@endplus
  19.886 +\rail@end
  19.887 +\end{railoutput}
  19.888 +
  19.889  
  19.890    \begin{description}
  19.891    
  19.892 @@ -1206,10 +1716,15 @@
  19.893      \indexdef{}{command}{oracle}\hypertarget{command.oracle}{\hyperlink{command.oracle}{\mbox{\isa{\isacommand{oracle}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} & (axiomatic!) \\
  19.894    \end{matharray}
  19.895  
  19.896 -  \begin{rail}
  19.897 -    'oracle' name '=' text
  19.898 -    ;
  19.899 -  \end{rail}
  19.900 +  \begin{railoutput}
  19.901 +\rail@begin{1}{\isa{}}
  19.902 +\rail@term{\hyperlink{command.oracle}{\mbox{\isa{\isacommand{oracle}}}}}[]
  19.903 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  19.904 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  19.905 +\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
  19.906 +\rail@end
  19.907 +\end{railoutput}
  19.908 +
  19.909  
  19.910    \begin{description}
  19.911  
  19.912 @@ -1240,10 +1755,30 @@
  19.913      \indexdef{}{command}{hide\_fact}\hypertarget{command.hide-fact}{\hyperlink{command.hide-fact}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}fact}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
  19.914    \end{matharray}
  19.915  
  19.916 -  \begin{rail}
  19.917 -    ( 'hide_class' | 'hide_type' | 'hide_const' | 'hide_fact' ) ('(open)')? (nameref + )
  19.918 -    ;
  19.919 -  \end{rail}
  19.920 +  \begin{railoutput}
  19.921 +\rail@begin{4}{\isa{}}
  19.922 +\rail@bar
  19.923 +\rail@nont{\hyperlink{command.hide-class}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}class}}}}}[]
  19.924 +\rail@nextbar{1}
  19.925 +\rail@nont{\hyperlink{command.hide-type}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}type}}}}}[]
  19.926 +\rail@nextbar{2}
  19.927 +\rail@nont{\hyperlink{command.hide-const}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}const}}}}}[]
  19.928 +\rail@nextbar{3}
  19.929 +\rail@nont{\hyperlink{command.hide-fact}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}fact}}}}}[]
  19.930 +\rail@endbar
  19.931 +\rail@bar
  19.932 +\rail@nextbar{1}
  19.933 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  19.934 +\rail@term{\isa{\isakeyword{open}}}[]
  19.935 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  19.936 +\rail@endbar
  19.937 +\rail@plus
  19.938 +\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
  19.939 +\rail@nextplus{1}
  19.940 +\rail@endplus
  19.941 +\rail@end
  19.942 +\end{railoutput}
  19.943 +
  19.944  
  19.945    Isabelle organizes any kind of name declarations (of types,
  19.946    constants, theorems etc.) by separate hierarchically structured name
    20.1 --- a/doc-src/IsarRef/Thy/document/ZF_Specific.tex	Sun May 01 18:57:45 2011 +0200
    20.2 +++ b/doc-src/IsarRef/Thy/document/ZF_Specific.tex	Mon May 02 01:05:50 2011 +0200
    20.3 @@ -39,10 +39,18 @@
    20.4      \indexdef{ZF}{attribute}{TC}\hypertarget{attribute.ZF.TC}{\hyperlink{attribute.ZF.TC}{\mbox{\isa{TC}}}} & : & \isa{attribute} \\
    20.5    \end{matharray}
    20.6  
    20.7 -  \begin{rail}
    20.8 -    'TC' (() | 'add' | 'del')
    20.9 -    ;
   20.10 -  \end{rail}
   20.11 +  \begin{railoutput}
   20.12 +\rail@begin{3}{\isa{}}
   20.13 +\rail@term{\hyperlink{attribute.ZF.TC}{\mbox{\isa{TC}}}}[]
   20.14 +\rail@bar
   20.15 +\rail@nextbar{1}
   20.16 +\rail@term{\isa{add}}[]
   20.17 +\rail@nextbar{2}
   20.18 +\rail@term{\isa{del}}[]
   20.19 +\rail@endbar
   20.20 +\rail@end
   20.21 +\end{railoutput}
   20.22 +
   20.23  
   20.24    \begin{description}
   20.25    
   20.26 @@ -79,41 +87,145 @@
   20.27      \indexdef{ZF}{command}{codatatype}\hypertarget{command.ZF.codatatype}{\hyperlink{command.ZF.codatatype}{\mbox{\isa{\isacommand{codatatype}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
   20.28    \end{matharray}
   20.29  
   20.30 -  \begin{rail}
   20.31 -    ('inductive' | 'coinductive') domains intros hints
   20.32 -    ;
   20.33 +  \begin{railoutput}
   20.34 +\rail@begin{2}{\isa{}}
   20.35 +\rail@bar
   20.36 +\rail@term{\hyperlink{command.ZF.inductive}{\mbox{\isa{\isacommand{inductive}}}}}[]
   20.37 +\rail@nextbar{1}
   20.38 +\rail@term{\hyperlink{command.ZF.coinductive}{\mbox{\isa{\isacommand{coinductive}}}}}[]
   20.39 +\rail@endbar
   20.40 +\rail@nont{\isa{domains}}[]
   20.41 +\rail@nont{\isa{intros}}[]
   20.42 +\rail@nont{\isa{hints}}[]
   20.43 +\rail@end
   20.44 +\rail@begin{2}{\isa{domains}}
   20.45 +\rail@term{\isa{\isakeyword{domains}}}[]
   20.46 +\rail@plus
   20.47 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
   20.48 +\rail@nextplus{1}
   20.49 +\rail@cterm{\isa{{\isaliteral{2B}{\isacharplus}}}}[]
   20.50 +\rail@endplus
   20.51 +\rail@bar
   20.52 +\rail@term{\isa{{\isaliteral{3C}{\isacharless}}{\isaliteral{3D}{\isacharequal}}}}[]
   20.53 +\rail@nextbar{1}
   20.54 +\rail@term{\isa{{\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}}}[]
   20.55 +\rail@endbar
   20.56 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
   20.57 +\rail@end
   20.58 +\rail@begin{3}{\isa{intros}}
   20.59 +\rail@term{\isa{\isakeyword{intros}}}[]
   20.60 +\rail@plus
   20.61 +\rail@bar
   20.62 +\rail@nextbar{1}
   20.63 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
   20.64 +\rail@endbar
   20.65 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
   20.66 +\rail@nextplus{2}
   20.67 +\rail@endplus
   20.68 +\rail@end
   20.69 +\rail@begin{2}{\isa{hints}}
   20.70 +\rail@bar
   20.71 +\rail@nextbar{1}
   20.72 +\rail@nont{\hyperlink{syntax.ZF.monos}{\mbox{\isa{monos}}}}[]
   20.73 +\rail@endbar
   20.74 +\rail@bar
   20.75 +\rail@nextbar{1}
   20.76 +\rail@nont{\isa{condefs}}[]
   20.77 +\rail@endbar
   20.78 +\rail@bar
   20.79 +\rail@nextbar{1}
   20.80 +\rail@nont{\hyperlink{syntax.ZF.typeintros}{\mbox{\isa{typeintros}}}}[]
   20.81 +\rail@endbar
   20.82 +\rail@bar
   20.83 +\rail@nextbar{1}
   20.84 +\rail@nont{\hyperlink{syntax.ZF.typeelims}{\mbox{\isa{typeelims}}}}[]
   20.85 +\rail@endbar
   20.86 +\rail@end
   20.87 +\rail@begin{1}{\indexdef{ZF}{syntax}{monos}\hypertarget{syntax.ZF.monos}{\hyperlink{syntax.ZF.monos}{\mbox{\isa{monos}}}}}
   20.88 +\rail@term{\isa{\isakeyword{monos}}}[]
   20.89 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
   20.90 +\rail@end
   20.91 +\rail@begin{1}{\isa{condefs}}
   20.92 +\rail@term{\isa{\isakeyword{con{\isaliteral{5F}{\isacharunderscore}}defs}}}[]
   20.93 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
   20.94 +\rail@end
   20.95 +\rail@begin{1}{\indexdef{ZF}{syntax}{typeintros}\hypertarget{syntax.ZF.typeintros}{\hyperlink{syntax.ZF.typeintros}{\mbox{\isa{typeintros}}}}}
   20.96 +\rail@term{\isa{\isakeyword{type{\isaliteral{5F}{\isacharunderscore}}intros}}}[]
   20.97 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
   20.98 +\rail@end
   20.99 +\rail@begin{1}{\indexdef{ZF}{syntax}{typeelims}\hypertarget{syntax.ZF.typeelims}{\hyperlink{syntax.ZF.typeelims}{\mbox{\isa{typeelims}}}}}
  20.100 +\rail@term{\isa{\isakeyword{type{\isaliteral{5F}{\isacharunderscore}}elims}}}[]
  20.101 +\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
  20.102 +\rail@end
  20.103 +\end{railoutput}
  20.104  
  20.105 -    domains: 'domains' (term + '+') ('<=' | subseteq) term
  20.106 -    ;
  20.107 -    intros: 'intros' (thmdecl? prop +)
  20.108 -    ;
  20.109 -    hints: monos? condefs? typeintros? typeelims?
  20.110 -    ;
  20.111 -    monos: ('monos' thmrefs)?
  20.112 -    ;
  20.113 -    condefs: ('con_defs' thmrefs)?
  20.114 -    ;
  20.115 -    typeintros: ('type_intros' thmrefs)?
  20.116 -    ;
  20.117 -    typeelims: ('type_elims' thmrefs)?
  20.118 -    ;
  20.119 -  \end{rail}
  20.120  
  20.121    In the following syntax specification \isa{{\isaliteral{22}{\isachardoublequote}}monos{\isaliteral{22}{\isachardoublequote}}}, \isa{typeintros}, and \isa{typeelims} are the same as above.
  20.122  
  20.123 -  \begin{rail}
  20.124 -    ('datatype' | 'codatatype') domain? (dtspec + 'and') hints
  20.125 -    ;
  20.126 +  \begin{railoutput}
  20.127 +\rail@begin{2}{\isa{}}
  20.128 +\rail@bar
  20.129 +\rail@term{\hyperlink{command.ZF.datatype}{\mbox{\isa{\isacommand{datatype}}}}}[]
  20.130 +\rail@nextbar{1}
  20.131 +\rail@term{\hyperlink{command.ZF.codatatype}{\mbox{\isa{\isacommand{codatatype}}}}}[]
  20.132 +\rail@endbar
  20.133 +\rail@bar
  20.134 +\rail@nextbar{1}
  20.135 +\rail@nont{\isa{domain}}[]
  20.136 +\rail@endbar
  20.137 +\rail@plus
  20.138 +\rail@nont{\isa{dtspec}}[]
  20.139 +\rail@nextplus{1}
  20.140 +\rail@cterm{\isa{\isakeyword{and}}}[]
  20.141 +\rail@endplus
  20.142 +\rail@nont{\isa{hints}}[]
  20.143 +\rail@end
  20.144 +\rail@begin{2}{\isa{domain}}
  20.145 +\rail@bar
  20.146 +\rail@term{\isa{{\isaliteral{3C}{\isacharless}}{\isaliteral{3D}{\isacharequal}}}}[]
  20.147 +\rail@nextbar{1}
  20.148 +\rail@term{\isa{{\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}}}[]
  20.149 +\rail@endbar
  20.150 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  20.151 +\rail@end
  20.152 +\rail@begin{2}{\isa{dtspec}}
  20.153 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  20.154 +\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
  20.155 +\rail@plus
  20.156 +\rail@nont{\isa{con}}[]
  20.157 +\rail@nextplus{1}
  20.158 +\rail@cterm{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
  20.159 +\rail@endplus
  20.160 +\rail@end
  20.161 +\rail@begin{3}{\isa{con}}
  20.162 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  20.163 +\rail@bar
  20.164 +\rail@nextbar{1}
  20.165 +\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
  20.166 +\rail@plus
  20.167 +\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
  20.168 +\rail@term{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
  20.169 +\rail@nextplus{2}
  20.170 +\rail@endplus
  20.171 +\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
  20.172 +\rail@endbar
  20.173 +\rail@end
  20.174 +\rail@begin{2}{\isa{hints}}
  20.175 +\rail@bar
  20.176 +\rail@nextbar{1}
  20.177 +\rail@nont{\hyperlink{syntax.ZF.monos}{\mbox{\isa{monos}}}}[]
  20.178 +\rail@endbar
  20.179 +\rail@bar
  20.180 +\rail@nextbar{1}
  20.181 +\rail@nont{\hyperlink{syntax.ZF.typeintros}{\mbox{\isa{typeintros}}}}[]
  20.182 +\rail@endbar
  20.183 +\rail@bar
  20.184 +\rail@nextbar{1}
  20.185 +\rail@nont{\hyperlink{syntax.ZF.typeelims}{\mbox{\isa{typeelims}}}}[]
  20.186 +\rail@endbar
  20.187 +\rail@end
  20.188 +\end{railoutput}
  20.189  
  20.190 -    domain: ('<=' | subseteq) term
  20.191 -    ;
  20.192 -    dtspec: term '=' (con + '|')
  20.193 -    ;
  20.194 -    con: name ('(' (term ',' +) ')')?  
  20.195 -    ;
  20.196 -    hints: monos? typeintros? typeelims?
  20.197 -    ;
  20.198 -  \end{rail}
  20.199  
  20.200    See \cite{isabelle-ZF} for further information on inductive
  20.201    definitions in ZF, but note that this covers the old-style theory
  20.202 @@ -130,10 +242,19 @@
  20.203      \indexdef{ZF}{command}{primrec}\hypertarget{command.ZF.primrec}{\hyperlink{command.ZF.primrec}{\mbox{\isa{\isacommand{primrec}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
  20.204    \end{matharray}
  20.205  
  20.206 -  \begin{rail}
  20.207 -    'primrec' (thmdecl? prop +)
  20.208 -    ;
  20.209 -  \end{rail}%
  20.210 +  \begin{railoutput}
  20.211 +\rail@begin{3}{\isa{}}
  20.212 +\rail@term{\hyperlink{command.ZF.primrec}{\mbox{\isa{\isacommand{primrec}}}}}[]
  20.213 +\rail@plus
  20.214 +\rail@bar
  20.215 +\rail@nextbar{1}
  20.216 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
  20.217 +\rail@endbar
  20.218 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  20.219 +\rail@nextplus{2}
  20.220 +\rail@endplus
  20.221 +\rail@end
  20.222 +\end{railoutput}%
  20.223  \end{isamarkuptext}%
  20.224  \isamarkuptrue%
  20.225  %
  20.226 @@ -152,14 +273,42 @@
  20.227      \indexdef{ZF}{command}{inductive\_cases}\hypertarget{command.ZF.inductive-cases}{\hyperlink{command.ZF.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}cases}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
  20.228    \end{matharray}
  20.229  
  20.230 -  \begin{rail}
  20.231 -    ('case_tac' | 'induct_tac') goalspec? name
  20.232 -    ;
  20.233 -    indcases (prop +)
  20.234 -    ;
  20.235 -    inductivecases (thmdecl? (prop +) + 'and')
  20.236 -    ;
  20.237 -  \end{rail}%
  20.238 +  \begin{railoutput}
  20.239 +\rail@begin{2}{\isa{}}
  20.240 +\rail@bar
  20.241 +\rail@term{\hyperlink{method.ZF.case-tac}{\mbox{\isa{case{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
  20.242 +\rail@nextbar{1}
  20.243 +\rail@term{\hyperlink{method.ZF.induct-tac}{\mbox{\isa{induct{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
  20.244 +\rail@endbar
  20.245 +\rail@bar
  20.246 +\rail@nextbar{1}
  20.247 +\rail@nont{\hyperlink{syntax.goalspec}{\mbox{\isa{goalspec}}}}[]
  20.248 +\rail@endbar
  20.249 +\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
  20.250 +\rail@end
  20.251 +\rail@begin{2}{\isa{}}
  20.252 +\rail@term{\hyperlink{method.ZF.ind-cases}{\mbox{\isa{ind{\isaliteral{5F}{\isacharunderscore}}cases}}}}[]
  20.253 +\rail@plus
  20.254 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  20.255 +\rail@nextplus{1}
  20.256 +\rail@endplus
  20.257 +\rail@end
  20.258 +\rail@begin{3}{\isa{}}
  20.259 +\rail@term{\hyperlink{command.ZF.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}cases}}}}}[]
  20.260 +\rail@plus
  20.261 +\rail@bar
  20.262 +\rail@nextbar{1}
  20.263 +\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
  20.264 +\rail@endbar
  20.265 +\rail@plus
  20.266 +\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
  20.267 +\rail@nextplus{1}
  20.268 +\rail@endplus
  20.269 +\rail@nextplus{2}
  20.270 +\rail@cterm{\isa{\isakeyword{and}}}[]
  20.271 +\rail@endplus
  20.272 +\rail@end
  20.273 +\end{railoutput}%
  20.274  \end{isamarkuptext}%
  20.275  \isamarkuptrue%
  20.276  %