doc-src/IsarRef/Thy/document/Spec.tex
changeset 47114 7c9e31ffcd9e
parent 46999 1c3c185bab4e
child 47482 a83b25e5bad3
equal deleted inserted replaced
47113:b5a5662528fb 47114:7c9e31ffcd9e
    70 
    70 
    71   \begin{railoutput}
    71   \begin{railoutput}
    72 \rail@begin{4}{}
    72 \rail@begin{4}{}
    73 \rail@term{\hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}}[]
    73 \rail@term{\hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}}[]
    74 \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
    74 \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
       
    75 \rail@nont{\isa{imports}}[]
    75 \rail@cr{2}
    76 \rail@cr{2}
    76 \rail@term{\isa{\isakeyword{imports}}}[]
    77 \rail@bar
    77 \rail@plus
    78 \rail@nextbar{3}
    78 \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
    79 \rail@nont{\isa{keywords}}[]
    79 \rail@nextplus{3}
    80 \rail@endbar
    80 \rail@endplus
       
    81 \rail@bar
    81 \rail@bar
    82 \rail@nextbar{3}
    82 \rail@nextbar{3}
    83 \rail@nont{\isa{uses}}[]
    83 \rail@nont{\isa{uses}}[]
    84 \rail@endbar
    84 \rail@endbar
    85 \rail@term{\isa{\isakeyword{begin}}}[]
    85 \rail@term{\isa{\isakeyword{begin}}}[]
    86 \rail@end
    86 \rail@end
       
    87 \rail@begin{2}{\isa{imports}}
       
    88 \rail@term{\isa{\isakeyword{imports}}}[]
       
    89 \rail@plus
       
    90 \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
       
    91 \rail@nextplus{1}
       
    92 \rail@endplus
       
    93 \rail@end
       
    94 \rail@begin{3}{\isa{keywords}}
       
    95 \rail@term{\isa{\isakeyword{keywords}}}[]
       
    96 \rail@plus
       
    97 \rail@plus
       
    98 \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
       
    99 \rail@nextplus{1}
       
   100 \rail@endplus
       
   101 \rail@bar
       
   102 \rail@nextbar{1}
       
   103 \rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
       
   104 \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
       
   105 \rail@nont{\hyperlink{syntax.tags}{\mbox{\isa{tags}}}}[]
       
   106 \rail@endbar
       
   107 \rail@nextplus{2}
       
   108 \rail@cterm{\isa{\isakeyword{and}}}[]
       
   109 \rail@endplus
       
   110 \rail@end
    87 \rail@begin{3}{\isa{uses}}
   111 \rail@begin{3}{\isa{uses}}
    88 \rail@term{\isa{\isakeyword{uses}}}[]
   112 \rail@term{\isa{\isakeyword{uses}}}[]
    89 \rail@plus
   113 \rail@plus
    90 \rail@bar
   114 \rail@bar
    91 \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   115 \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
   100 
   124 
   101   \begin{description}
   125   \begin{description}
   102 
   126 
   103   \item \hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}A\ {\isaliteral{5C3C494D504F5254533E}{\isasymIMPORTS}}\ B\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ B\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{5C3C424547494E3E}{\isasymBEGIN}}{\isaliteral{22}{\isachardoublequote}}}
   127   \item \hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}A\ {\isaliteral{5C3C494D504F5254533E}{\isasymIMPORTS}}\ B\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ B\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{5C3C424547494E3E}{\isasymBEGIN}}{\isaliteral{22}{\isachardoublequote}}}
   104   starts a new theory \isa{A} based on the merge of existing
   128   starts a new theory \isa{A} based on the merge of existing
   105   theories \isa{{\isaliteral{22}{\isachardoublequote}}B\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ B\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}.
   129   theories \isa{{\isaliteral{22}{\isachardoublequote}}B\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ B\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}.  Due to the possibility to import more
   106   
   130   than one ancestor, the resulting theory structure of an Isabelle
   107   Due to the possibility to import more than one ancestor, the
   131   session forms a directed acyclic graph (DAG).  Isabelle takes care
   108   resulting theory structure of an Isabelle session forms a directed
   132   that sources contributing to the development graph are always
   109   acyclic graph (DAG).  Isabelle's theory loader ensures that the
   133   up-to-date: changed files are automatically rechecked whenever a
   110   sources contributing to the development graph are always up-to-date:
   134   theory header specification is processed.
   111   changed files are automatically reloaded whenever a theory header
   135 
   112   specification is processed.
   136   The optional \indexdef{}{keyword}{keywords}\hypertarget{keyword.keywords}{\hyperlink{keyword.keywords}{\mbox{\isa{\isakeyword{keywords}}}}} specification declares outer
       
   137   syntax (\chref{ch:outer-syntax}) that is introduced in this theory
       
   138   later on (rare in end-user applications).  Both minor keywords and
       
   139   major keywords of the Isar command language need to be specified, in
       
   140   order to make parsing of proof documents work properly.  Command
       
   141   keywords need to be classified according to their structural role in
       
   142   the formal text.  Examples may be seen in Isabelle/HOL sources
       
   143   itself, such as \hyperlink{keyword.keywords}{\mbox{\isa{\isakeyword{keywords}}}}~\verb|"typedef"|
       
   144   \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ thy{\isaliteral{5F}{\isacharunderscore}}goal{\isaliteral{22}{\isachardoublequote}}} or \hyperlink{keyword.keywords}{\mbox{\isa{\isakeyword{keywords}}}}~\verb|"datatype"| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ thy{\isaliteral{5F}{\isacharunderscore}}decl{\isaliteral{22}{\isachardoublequote}}} for theory-level declarations
       
   145   with and without proof, respectively.  Additional \hyperlink{syntax.tags}{\mbox{\isa{tags}}}
       
   146   provide defaults for document preparation (\secref{sec:tags}).
   113   
   147   
   114   The optional \indexdef{}{keyword}{uses}\hypertarget{keyword.uses}{\hyperlink{keyword.uses}{\mbox{\isa{\isakeyword{uses}}}}} specification declares additional
   148   The optional \indexdef{}{keyword}{uses}\hypertarget{keyword.uses}{\hyperlink{keyword.uses}{\mbox{\isa{\isakeyword{uses}}}}} specification declares additional
   115   dependencies on extra files (usually ML sources).  Files will be
   149   dependencies on external files (notably ML sources).  Files will be
   116   loaded immediately (as ML), unless the name is parenthesized.  The
   150   loaded immediately (as ML), unless the name is parenthesized.  The
   117   latter case records a dependency that needs to be resolved later in
   151   latter case records a dependency that needs to be resolved later in
   118   the text, usually via explicit \indexref{}{command}{use}\hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}} for ML files;
   152   the text, usually via explicit \indexref{}{command}{use}\hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}} for ML files;
   119   other file formats require specific load commands defined by the
   153   other file formats require specific load commands defined by the
   120   corresponding tools or packages.
   154   corresponding tools or packages.
   121   
   155   
   122   \item \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}} concludes the current theory
   156   \item \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}} concludes the current theory
   123   definition.  Note that local theory targets involve a local
   157   definition.  Note that some other commands, e.g.\ local theory
   124   \hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}}, which is clear from the nesting.
   158   targets \hyperlink{command.locale}{\mbox{\isa{\isacommand{locale}}}} or \hyperlink{command.class}{\mbox{\isa{\isacommand{class}}}} may involve a
       
   159   \hyperlink{keyword.begin}{\mbox{\isa{\isakeyword{begin}}}} that needs to be matched by \hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}}, according to the usual rules for nested blocks.
   125 
   160 
   126   \end{description}%
   161   \end{description}%
   127 \end{isamarkuptext}%
   162 \end{isamarkuptext}%
   128 \isamarkuptrue%
   163 \isamarkuptrue%
   129 %
   164 %