doc-src/IsarRef/Thy/Spec.thy
changeset 30240 5b25fee0362c
parent 29706 10e6f2faa1e5
child 30242 aea5d7fa7ef5
equal deleted inserted replaced
30239:179ff9cb160b 30240:5b25fee0362c
     1 theory Spec
     1 theory Spec
     2 imports Main
     2 imports Main
     3 begin
     3 begin
     4 
     4 
     5 chapter {* Theory specifications *}
     5 chapter {* Theory specifications *}
       
     6 
       
     7 text {*
       
     8   The Isabelle/Isar theory format integrates specifications and
       
     9   proofs, supporting interactive development with unlimited undo
       
    10   operation.  There is an integrated document preparation system (see
       
    11   \chref{ch:document-prep}), for typesetting formal developments
       
    12   together with informal text.  The resulting hyper-linked PDF
       
    13   documents can be used both for WWW presentation and printed copies.
       
    14 
       
    15   The Isar proof language (see \chref{ch:proofs}) is embedded into the
       
    16   theory language as a proper sub-language.  Proof mode is entered by
       
    17   stating some @{command theorem} or @{command lemma} at the theory
       
    18   level, and left again with the final conclusion (e.g.\ via @{command
       
    19   qed}).  Some theory specification mechanisms also require a proof,
       
    20   such as @{command typedef} in HOL, which demands non-emptiness of
       
    21   the representing sets.
       
    22 *}
       
    23 
     6 
    24 
     7 section {* Defining theories \label{sec:begin-thy} *}
    25 section {* Defining theories \label{sec:begin-thy} *}
     8 
    26 
     9 text {*
    27 text {*
    10   \begin{matharray}{rcl}
    28   \begin{matharray}{rcl}
   104   \item @{command (local) "end"} concludes the current local theory
   122   \item @{command (local) "end"} concludes the current local theory
   105   and continues the enclosing global theory.  Note that a global
   123   and continues the enclosing global theory.  Note that a global
   106   @{command (global) "end"} has a different meaning: it concludes the
   124   @{command (global) "end"} has a different meaning: it concludes the
   107   theory itself (\secref{sec:begin-thy}).
   125   theory itself (\secref{sec:begin-thy}).
   108   
   126   
   109   \item @{text "(\<IN> c)"} given after any local theory command
   127   \item @{text "("}@{keyword_def "in"}~@{text "c)"} given after any
   110   specifies an immediate target, e.g.\ ``@{command
   128   local theory command specifies an immediate target, e.g.\
   111   "definition"}~@{text "(\<IN> c) \<dots>"}'' or ``@{command
   129   ``@{command "definition"}~@{text "(\<IN> c) \<dots>"}'' or ``@{command
   112   "theorem"}~@{text "(\<IN> c) \<dots>"}''.  This works both in a local or
   130   "theorem"}~@{text "(\<IN> c) \<dots>"}''.  This works both in a local or
   113   global theory context; the current target context will be suspended
   131   global theory context; the current target context will be suspended
   114   for this command only.  Note that ``@{text "(\<IN> -)"}'' will
   132   for this command only.  Note that ``@{text "(\<IN> -)"}'' will
   115   always produce a global result independently of the current target
   133   always produce a global result independently of the current target
   116   context.
   134   context.
  1162   specification of axioms!  Invoking the oracle only works within the
  1180   specification of axioms!  Invoking the oracle only works within the
  1163   scope of the resulting theory.
  1181   scope of the resulting theory.
  1164 
  1182 
  1165   \end{description}
  1183   \end{description}
  1166 
  1184 
  1167   See @{"file" "~~/src/FOL/ex/IffOracle.thy"} for a worked example of
  1185   See @{"file" "~~/src/FOL/ex/Iff_Oracle.thy"} for a worked example of
  1168   defining a new primitive rule as oracle, and turning it into a proof
  1186   defining a new primitive rule as oracle, and turning it into a proof
  1169   method.
  1187   method.
  1170 *}
  1188 *}
  1171 
  1189 
  1172 
  1190