doc-src/IsarRef/Thy/document/Spec.tex
changeset 30130 e23770bc97c8
parent 29754 2203ef9b55ce
child 30121 5c7bcb296600
equal deleted inserted replaced
30129:419116f1157a 30130:e23770bc97c8
    20 %
    20 %
    21 \isamarkupchapter{Theory specifications%
    21 \isamarkupchapter{Theory specifications%
    22 }
    22 }
    23 \isamarkuptrue%
    23 \isamarkuptrue%
    24 %
    24 %
       
    25 \begin{isamarkuptext}%
       
    26 The Isabelle/Isar theory format integrates specifications and
       
    27   proofs, supporting interactive development with unlimited undo
       
    28   operation.  There is an integrated document preparation system (see
       
    29   \chref{ch:document-prep}), for typesetting formal developments
       
    30   together with informal text.  The resulting hyper-linked PDF
       
    31   documents can be used both for WWW presentation and printed copies.
       
    32 
       
    33   The Isar proof language (see \chref{ch:proofs}) is embedded into the
       
    34   theory language as a proper sub-language.  Proof mode is entered by
       
    35   stating some \hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}} or \hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}} at the theory
       
    36   level, and left again with the final conclusion (e.g.\ via \hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}).  Some theory specification mechanisms also require a proof,
       
    37   such as \hyperlink{command.typedef}{\mbox{\isa{\isacommand{typedef}}}} in HOL, which demands non-emptiness of
       
    38   the representing sets.%
       
    39 \end{isamarkuptext}%
       
    40 \isamarkuptrue%
       
    41 %
    25 \isamarkupsection{Defining theories \label{sec:begin-thy}%
    42 \isamarkupsection{Defining theories \label{sec:begin-thy}%
    26 }
    43 }
    27 \isamarkuptrue%
    44 \isamarkuptrue%
    28 %
    45 %
    29 \begin{isamarkuptext}%
    46 \begin{isamarkuptext}%
   125   \item \hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}} concludes the current local theory
   142   \item \hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}} concludes the current local theory
   126   and continues the enclosing global theory.  Note that a global
   143   and continues the enclosing global theory.  Note that a global
   127   \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}} has a different meaning: it concludes the
   144   \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}} has a different meaning: it concludes the
   128   theory itself (\secref{sec:begin-thy}).
   145   theory itself (\secref{sec:begin-thy}).
   129   
   146   
   130   \item \isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}{\isachardoublequote}} given after any local theory command
   147   \item \isa{{\isachardoublequote}{\isacharparenleft}{\isachardoublequote}}\indexdef{}{keyword}{in}\hypertarget{keyword.in}{\hyperlink{keyword.in}{\mbox{\isa{\isakeyword{in}}}}}~\isa{{\isachardoublequote}c{\isacharparenright}{\isachardoublequote}} given after any
   131   specifies an immediate target, e.g.\ ``\hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}\ {\isasymdots}{\isachardoublequote}}'' or ``\hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}\ {\isasymdots}{\isachardoublequote}}''.  This works both in a local or
   148   local theory command specifies an immediate target, e.g.\
       
   149   ``\hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}\ {\isasymdots}{\isachardoublequote}}'' or ``\hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}\ {\isasymdots}{\isachardoublequote}}''.  This works both in a local or
   132   global theory context; the current target context will be suspended
   150   global theory context; the current target context will be suspended
   133   for this command only.  Note that ``\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ {\isacharminus}{\isacharparenright}{\isachardoublequote}}'' will
   151   for this command only.  Note that ``\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ {\isacharminus}{\isacharparenright}{\isachardoublequote}}'' will
   134   always produce a global result independently of the current target
   152   always produce a global result independently of the current target
   135   context.
   153   context.
   136 
   154 
  1176   specification of axioms!  Invoking the oracle only works within the
  1194   specification of axioms!  Invoking the oracle only works within the
  1177   scope of the resulting theory.
  1195   scope of the resulting theory.
  1178 
  1196 
  1179   \end{description}
  1197   \end{description}
  1180 
  1198 
  1181   See \hyperlink{file.~~/src/FOL/ex/IffOracle.thy}{\mbox{\isa{\isatt{{\isachartilde}{\isachartilde}{\isacharslash}src{\isacharslash}FOL{\isacharslash}ex{\isacharslash}IffOracle{\isachardot}thy}}}} for a worked example of
  1199   See \hyperlink{file.~~/src/FOL/ex/Iff-Oracle.thy}{\mbox{\isa{\isatt{{\isachartilde}{\isachartilde}{\isacharslash}src{\isacharslash}FOL{\isacharslash}ex{\isacharslash}Iff{\isacharunderscore}Oracle{\isachardot}thy}}}} for a worked example of
  1182   defining a new primitive rule as oracle, and turning it into a proof
  1200   defining a new primitive rule as oracle, and turning it into a proof
  1183   method.%
  1201   method.%
  1184 \end{isamarkuptext}%
  1202 \end{isamarkuptext}%
  1185 \isamarkuptrue%
  1203 \isamarkuptrue%
  1186 %
  1204 %