| 26840 |      1 | %
 | 
|  |      2 | \begin{isabellebody}%
 | 
|  |      3 | \def\isabellecontext{ZF{\isacharunderscore}Specific}%
 | 
|  |      4 | %
 | 
|  |      5 | \isadelimtheory
 | 
|  |      6 | %
 | 
|  |      7 | \endisadelimtheory
 | 
|  |      8 | %
 | 
|  |      9 | \isatagtheory
 | 
|  |     10 | \isacommand{theory}\isamarkupfalse%
 | 
|  |     11 | \ ZF{\isacharunderscore}Specific\isanewline
 | 
| 26895 |     12 | \isakeyword{imports}\ Main\isanewline
 | 
| 26845 |     13 | \isakeyword{begin}%
 | 
|  |     14 | \endisatagtheory
 | 
|  |     15 | {\isafoldtheory}%
 | 
|  |     16 | %
 | 
|  |     17 | \isadelimtheory
 | 
|  |     18 | %
 | 
|  |     19 | \endisadelimtheory
 | 
|  |     20 | %
 | 
| 26852 |     21 | \isamarkupchapter{Isabelle/ZF \label{ch:zf}%
 | 
| 26845 |     22 | }
 | 
|  |     23 | \isamarkuptrue%
 | 
|  |     24 | %
 | 
|  |     25 | \isamarkupsection{Type checking%
 | 
|  |     26 | }
 | 
|  |     27 | \isamarkuptrue%
 | 
|  |     28 | %
 | 
|  |     29 | \begin{isamarkuptext}%
 | 
|  |     30 | The ZF logic is essentially untyped, so the concept of ``type
 | 
|  |     31 |   checking'' is performed as logical reasoning about set-membership
 | 
|  |     32 |   statements.  A special method assists users in this task; a version
 | 
|  |     33 |   of this is already declared as a ``solver'' in the standard
 | 
|  |     34 |   Simplifier setup.
 | 
|  |     35 | 
 | 
|  |     36 |   \begin{matharray}{rcl}
 | 
| 28788 |     37 |     \indexdef{ZF}{command}{print\_tcset}\hypertarget{command.ZF.print-tcset}{\hyperlink{command.ZF.print-tcset}{\mbox{\isa{\isacommand{print{\isacharunderscore}tcset}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
 | 
|  |     38 |     \indexdef{ZF}{method}{typecheck}\hypertarget{method.ZF.typecheck}{\hyperlink{method.ZF.typecheck}{\mbox{\isa{typecheck}}}} & : & \isa{method} \\
 | 
|  |     39 |     \indexdef{ZF}{attribute}{TC}\hypertarget{attribute.ZF.TC}{\hyperlink{attribute.ZF.TC}{\mbox{\isa{TC}}}} & : & \isa{attribute} \\
 | 
| 26845 |     40 |   \end{matharray}
 | 
|  |     41 | 
 | 
|  |     42 |   \begin{rail}
 | 
|  |     43 |     'TC' (() | 'add' | 'del')
 | 
|  |     44 |     ;
 | 
|  |     45 |   \end{rail}
 | 
|  |     46 | 
 | 
| 28788 |     47 |   \begin{description}
 | 
| 26845 |     48 |   
 | 
| 28788 |     49 |   \item \hyperlink{command.ZF.print-tcset}{\mbox{\isa{\isacommand{print{\isacharunderscore}tcset}}}} prints the collection of
 | 
| 26845 |     50 |   typechecking rules of the current context.
 | 
|  |     51 |   
 | 
| 28788 |     52 |   \item \hyperlink{method.ZF.typecheck}{\mbox{\isa{typecheck}}} attempts to solve any pending
 | 
| 26845 |     53 |   type-checking problems in subgoals.
 | 
|  |     54 |   
 | 
| 28788 |     55 |   \item \hyperlink{attribute.ZF.TC}{\mbox{\isa{TC}}} adds or deletes type-checking rules from
 | 
|  |     56 |   the context.
 | 
| 26845 |     57 | 
 | 
| 28788 |     58 |   \end{description}%
 | 
| 26845 |     59 | \end{isamarkuptext}%
 | 
|  |     60 | \isamarkuptrue%
 | 
|  |     61 | %
 | 
|  |     62 | \isamarkupsection{(Co)Inductive sets and datatypes%
 | 
|  |     63 | }
 | 
|  |     64 | \isamarkuptrue%
 | 
|  |     65 | %
 | 
|  |     66 | \isamarkupsubsection{Set definitions%
 | 
|  |     67 | }
 | 
|  |     68 | \isamarkuptrue%
 | 
|  |     69 | %
 | 
|  |     70 | \begin{isamarkuptext}%
 | 
|  |     71 | In ZF everything is a set.  The generic inductive package also
 | 
|  |     72 |   provides a specific view for ``datatype'' specifications.
 | 
|  |     73 |   Coinductive definitions are available in both cases, too.
 | 
|  |     74 | 
 | 
|  |     75 |   \begin{matharray}{rcl}
 | 
| 28788 |     76 |     \indexdef{ZF}{command}{inductive}\hypertarget{command.ZF.inductive}{\hyperlink{command.ZF.inductive}{\mbox{\isa{\isacommand{inductive}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
 | 
|  |     77 |     \indexdef{ZF}{command}{coinductive}\hypertarget{command.ZF.coinductive}{\hyperlink{command.ZF.coinductive}{\mbox{\isa{\isacommand{coinductive}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
 | 
|  |     78 |     \indexdef{ZF}{command}{datatype}\hypertarget{command.ZF.datatype}{\hyperlink{command.ZF.datatype}{\mbox{\isa{\isacommand{datatype}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
 | 
|  |     79 |     \indexdef{ZF}{command}{codatatype}\hypertarget{command.ZF.codatatype}{\hyperlink{command.ZF.codatatype}{\mbox{\isa{\isacommand{codatatype}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
 | 
| 26845 |     80 |   \end{matharray}
 | 
|  |     81 | 
 | 
|  |     82 |   \begin{rail}
 | 
|  |     83 |     ('inductive' | 'coinductive') domains intros hints
 | 
|  |     84 |     ;
 | 
|  |     85 | 
 | 
|  |     86 |     domains: 'domains' (term + '+') ('<=' | subseteq) term
 | 
|  |     87 |     ;
 | 
|  |     88 |     intros: 'intros' (thmdecl? prop +)
 | 
|  |     89 |     ;
 | 
|  |     90 |     hints: monos? condefs? typeintros? typeelims?
 | 
|  |     91 |     ;
 | 
|  |     92 |     monos: ('monos' thmrefs)?
 | 
|  |     93 |     ;
 | 
|  |     94 |     condefs: ('con\_defs' thmrefs)?
 | 
|  |     95 |     ;
 | 
|  |     96 |     typeintros: ('type\_intros' thmrefs)?
 | 
|  |     97 |     ;
 | 
|  |     98 |     typeelims: ('type\_elims' thmrefs)?
 | 
|  |     99 |     ;
 | 
|  |    100 |   \end{rail}
 | 
|  |    101 | 
 | 
|  |    102 |   In the following syntax specification \isa{{\isachardoublequote}monos{\isachardoublequote}}, \isa{typeintros}, and \isa{typeelims} are the same as above.
 | 
|  |    103 | 
 | 
|  |    104 |   \begin{rail}
 | 
|  |    105 |     ('datatype' | 'codatatype') domain? (dtspec + 'and') hints
 | 
|  |    106 |     ;
 | 
|  |    107 | 
 | 
|  |    108 |     domain: ('<=' | subseteq) term
 | 
|  |    109 |     ;
 | 
|  |    110 |     dtspec: term '=' (con + '|')
 | 
|  |    111 |     ;
 | 
|  |    112 |     con: name ('(' (term ',' +) ')')?  
 | 
|  |    113 |     ;
 | 
|  |    114 |     hints: monos? typeintros? typeelims?
 | 
|  |    115 |     ;
 | 
|  |    116 |   \end{rail}
 | 
|  |    117 | 
 | 
|  |    118 |   See \cite{isabelle-ZF} for further information on inductive
 | 
|  |    119 |   definitions in ZF, but note that this covers the old-style theory
 | 
|  |    120 |   format.%
 | 
|  |    121 | \end{isamarkuptext}%
 | 
|  |    122 | \isamarkuptrue%
 | 
|  |    123 | %
 | 
|  |    124 | \isamarkupsubsection{Primitive recursive functions%
 | 
|  |    125 | }
 | 
|  |    126 | \isamarkuptrue%
 | 
|  |    127 | %
 | 
|  |    128 | \begin{isamarkuptext}%
 | 
|  |    129 | \begin{matharray}{rcl}
 | 
| 28788 |    130 |     \indexdef{ZF}{command}{primrec}\hypertarget{command.ZF.primrec}{\hyperlink{command.ZF.primrec}{\mbox{\isa{\isacommand{primrec}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
 | 
| 26845 |    131 |   \end{matharray}
 | 
|  |    132 | 
 | 
|  |    133 |   \begin{rail}
 | 
|  |    134 |     'primrec' (thmdecl? prop +)
 | 
|  |    135 |     ;
 | 
|  |    136 |   \end{rail}%
 | 
|  |    137 | \end{isamarkuptext}%
 | 
|  |    138 | \isamarkuptrue%
 | 
|  |    139 | %
 | 
|  |    140 | \isamarkupsubsection{Cases and induction: emulating tactic scripts%
 | 
|  |    141 | }
 | 
|  |    142 | \isamarkuptrue%
 | 
|  |    143 | %
 | 
|  |    144 | \begin{isamarkuptext}%
 | 
|  |    145 | The following important tactical tools of Isabelle/ZF have been
 | 
|  |    146 |   ported to Isar.  These should not be used in proper proof texts.
 | 
|  |    147 | 
 | 
|  |    148 |   \begin{matharray}{rcl}
 | 
| 28788 |    149 |     \indexdef{ZF}{method}{case\_tac}\hypertarget{method.ZF.case-tac}{\hyperlink{method.ZF.case-tac}{\mbox{\isa{case{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
 | 
|  |    150 |     \indexdef{ZF}{method}{induct\_tac}\hypertarget{method.ZF.induct-tac}{\hyperlink{method.ZF.induct-tac}{\mbox{\isa{induct{\isacharunderscore}tac}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
 | 
|  |    151 |     \indexdef{ZF}{method}{ind\_cases}\hypertarget{method.ZF.ind-cases}{\hyperlink{method.ZF.ind-cases}{\mbox{\isa{ind{\isacharunderscore}cases}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{method} \\
 | 
|  |    152 |     \indexdef{ZF}{command}{inductive\_cases}\hypertarget{command.ZF.inductive-cases}{\hyperlink{command.ZF.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isacharunderscore}cases}}}}} & : & \isa{{\isachardoublequote}theory\ {\isasymrightarrow}\ theory{\isachardoublequote}} \\
 | 
| 26845 |    153 |   \end{matharray}
 | 
|  |    154 | 
 | 
|  |    155 |   \begin{rail}
 | 
|  |    156 |     ('case\_tac' | 'induct\_tac') goalspec? name
 | 
|  |    157 |     ;
 | 
|  |    158 |     indcases (prop +)
 | 
|  |    159 |     ;
 | 
|  |    160 |     inductivecases (thmdecl? (prop +) + 'and')
 | 
|  |    161 |     ;
 | 
|  |    162 |   \end{rail}%
 | 
|  |    163 | \end{isamarkuptext}%
 | 
|  |    164 | \isamarkuptrue%
 | 
|  |    165 | %
 | 
|  |    166 | \isadelimtheory
 | 
|  |    167 | %
 | 
|  |    168 | \endisadelimtheory
 | 
|  |    169 | %
 | 
|  |    170 | \isatagtheory
 | 
| 26840 |    171 | \isacommand{end}\isamarkupfalse%
 | 
|  |    172 | %
 | 
|  |    173 | \endisatagtheory
 | 
|  |    174 | {\isafoldtheory}%
 | 
|  |    175 | %
 | 
|  |    176 | \isadelimtheory
 | 
|  |    177 | %
 | 
|  |    178 | \endisadelimtheory
 | 
| 26845 |    179 | \isanewline
 | 
| 26840 |    180 | \end{isabellebody}%
 | 
|  |    181 | %%% Local Variables:
 | 
|  |    182 | %%% mode: latex
 | 
|  |    183 | %%% TeX-master: "root"
 | 
|  |    184 | %%% End:
 |