doc-src/IsarRef/hol.tex
changeset 10549 5e19ae8d9582
parent 10456 166fc12ce153
child 10771 662727d4ecac
equal deleted inserted replaced
10548:e8c774c12105 10549:5e19ae8d9582
   206   (recdefsimp | recdefcong | recdefwf) (() | 'add' | 'del')
   206   (recdefsimp | recdefcong | recdefwf) (() | 'add' | 'del')
   207   ;
   207   ;
   208 \end{rail}
   208 \end{rail}
   209 
   209 
   210 
   210 
   211 \section{(Co)Inductive sets}
   211 \section{(Co)Inductive sets}\label{sec:inductive}
   212 
   212 
   213 \indexisarcmd{inductive}\indexisarcmd{coinductive}\indexisaratt{mono}
   213 \indexisarcmd{inductive}\indexisarcmd{coinductive}\indexisaratt{mono}
   214 \begin{matharray}{rcl}
   214 \begin{matharray}{rcl}
   215   \isarcmd{inductive} & : & \isartrans{theory}{theory} \\
   215   \isarcmd{inductive} & : & \isartrans{theory}{theory} \\
   216   \isarcmd{coinductive} & : & \isartrans{theory}{theory} \\
   216   \isarcmd{coinductive} & : & \isartrans{theory}{theory} \\
   365 meta-level rule statements, i.e.\ $\All{\vec x} \vec\phi \Imp \psi$ to
   365 meta-level rule statements, i.e.\ $\All{\vec x} \vec\phi \Imp \psi$ to
   366 indicate ``variable'' parameters $\vec x$ and ``recursive'' assumptions
   366 indicate ``variable'' parameters $\vec x$ and ``recursive'' assumptions
   367 $\vec\phi$.  Also note that local definitions may be expressed as $\All{\vec
   367 $\vec\phi$.  Also note that local definitions may be expressed as $\All{\vec
   368   x} n \equiv t[\vec x] \Imp \phi[n]$, with induction over $n$.
   368   x} n \equiv t[\vec x] \Imp \phi[n]$, with induction over $n$.
   369 
   369 
   370 
   370 \medskip
   371 \subsection{Declaring rules}
   371 
       
   372 Facts presented to either method are consumed according to the number of
       
   373 ``major premises'' of the rule involved (see also \S\ref{sec:induct-att} and
       
   374 \S\ref{sec:cases}), which is usually $0$ for plain cases and induction rules
       
   375 of datatypes etc.\ and $1$ for rules of inductive sets and the like.  The
       
   376 remaining facts are inserted into the goal verbatim before the actual $cases$
       
   377 or $induct$ rule is applied (thus facts may be even passed through an
       
   378 induction).
       
   379 
       
   380 Note that whenever facts are present, the default rule selection scheme would
       
   381 provide a ``set'' rule only, with the first fact consumed and the rest
       
   382 inserted into the goal.  In order to pass all facts into a ``type'' rule
       
   383 instead, one would have to specify this explicitly, e.g.\ by appending
       
   384 ``$type: name$'' to the method argument.
       
   385 
       
   386 
       
   387 \subsection{Declaring rules}\label{sec:induct-att}
   372 
   388 
   373 \indexisaratt{cases}\indexisaratt{induct}
   389 \indexisaratt{cases}\indexisaratt{induct}
   374 \begin{matharray}{rcl}
   390 \begin{matharray}{rcl}
   375   cases & : & \isaratt \\
   391   cases & : & \isaratt \\
   376   induct & : & \isaratt \\
   392   induct & : & \isaratt \\
   391 declared by HOL definitional packages.  For special applications, these may be
   407 declared by HOL definitional packages.  For special applications, these may be
   392 replaced manually by variant versions.
   408 replaced manually by variant versions.
   393 
   409 
   394 Refer to the $case_names$ and $params$ attributes (see \S\ref{sec:cases}) to
   410 Refer to the $case_names$ and $params$ attributes (see \S\ref{sec:cases}) to
   395 adjust names of cases and parameters of a rule.
   411 adjust names of cases and parameters of a rule.
       
   412 
       
   413 The $consumes$ declaration (cf.\ \S\ref{sec:cases}) is taken care of
       
   414 automatically (if none had been given already): $consumes~0$ is specified for
       
   415 ``type'' rules and $consumes~1$ for ``set'' rules.
   396 
   416 
   397 
   417 
   398 \subsection{Emulating tactic scripts}\label{sec:induct_tac}
   418 \subsection{Emulating tactic scripts}\label{sec:induct_tac}
   399 
   419 
   400 \indexisarmeth{case-tac}\indexisarmeth{induct-tac}
   420 \indexisarmeth{case-tac}\indexisarmeth{induct-tac}