doc-src/IsarRef/logics.tex
changeset 13039 cfcc1f6f21df
parent 13027 ddf235f2384a
child 13041 6faccf7d0f25
equal deleted inserted replaced
13038:e968745986f1 13039:cfcc1f6f21df
     1 
     1 
     2 \chapter{Object-logic specific elements}\label{ch:logics}
     2 \chapter{Object-logic Specific Elements}\label{ch:logics}
     3 
     3 
     4 \section{General logic setup}\label{sec:object-logic}
     4 \section{General logic setup}\label{sec:object-logic}
     5 
     5 
     6 \indexisarcmd{judgment}
     6 \indexisarcmd{judgment}
     7 \indexisarmeth{atomize}\indexisaratt{atomize}
     7 \indexisarmeth{atomize}\indexisaratt{atomize}
    80 \end{descr}
    80 \end{descr}
    81 
    81 
    82 
    82 
    83 \section{HOL}
    83 \section{HOL}
    84 
    84 
    85 \subsection{Primitive types}\label{sec:typedef}
    85 \subsection{Primitive types}\label{sec:hol-typedef}
    86 
    86 
    87 \indexisarcmdof{HOL}{typedecl}\indexisarcmdof{HOL}{typedef}
    87 \indexisarcmdof{HOL}{typedecl}\indexisarcmdof{HOL}{typedef}
    88 \begin{matharray}{rcl}
    88 \begin{matharray}{rcl}
    89   \isarcmd{typedecl} & : & \isartrans{theory}{theory} \\
    89   \isarcmd{typedecl} & : & \isartrans{theory}{theory} \\
    90   \isarcmd{typedef} & : & \isartrans{theory}{proof(prove)} \\
    90   \isarcmd{typedef} & : & \isartrans{theory}{proof(prove)} \\
   165   parameters to be introduced.
   165   parameters to be introduced.
   166 
   166 
   167 \end{descr}
   167 \end{descr}
   168 
   168 
   169 
   169 
   170 \section{Records}\label{sec:hol-record}
   170 \subsection{Records}\label{sec:hol-record}
   171 
   171 
   172 In principle, records merely generalize the concept of tuples where components
   172 In principle, records merely generalize the concept of tuples where components
   173 may be addressed by labels instead of just position.  The logical
   173 may be addressed by labels instead of just position.  The logical
   174 infrastructure of records in Isabelle/HOL is slightly more advanced, though,
   174 infrastructure of records in Isabelle/HOL is slightly more advanced, though,
   175 supporting truly extensible record schemes.  This admits operations that are
   175 supporting truly extensible record schemes.  This admits operations that are
   176 polymorphic with respect to record extension, yielding ``object-oriented''
   176 polymorphic with respect to record extension, yielding ``object-oriented''
   177 effects like (single) inheritance.  See also \cite{NaraschewskiW-TPHOLs98} for
   177 effects like (single) inheritance.  See also \cite{NaraschewskiW-TPHOLs98} for
   178 more details on object-oriented verification and record subtyping in HOL.
   178 more details on object-oriented verification and record subtyping in HOL.
   179 
   179 
   180 
   180 
   181 \subsection{Basic concepts}
   181 \subsubsection{Basic concepts}
   182 
   182 
   183 Isabelle/HOL supports both \emph{fixed} and \emph{schematic} records at the
   183 Isabelle/HOL supports both \emph{fixed} and \emph{schematic} records at the
   184 level of terms and types.  The notation is as follows:
   184 level of terms and types.  The notation is as follows:
   185 
   185 
   186 \begin{center}
   186 \begin{center}
   233 {\S}\ref{sec:hol-record-thms}).  See also the Isabelle/HOL tutorial
   233 {\S}\ref{sec:hol-record-thms}).  See also the Isabelle/HOL tutorial
   234 \cite{isabelle-hol-book} for further instructions on using records in
   234 \cite{isabelle-hol-book} for further instructions on using records in
   235 practice.
   235 practice.
   236 
   236 
   237 
   237 
   238 \subsection{Record specifications}\label{sec:hol-record-def}
   238 \subsubsection{Record specifications}\label{sec:hol-record-def}
   239 
   239 
   240 \indexisarcmdof{HOL}{record}
   240 \indexisarcmdof{HOL}{record}
   241 \begin{matharray}{rcl}
   241 \begin{matharray}{rcl}
   242   \isarcmd{record} & : & \isartrans{theory}{theory} \\
   242   \isarcmd{record} & : & \isartrans{theory}{theory} \\
   243 \end{matharray}
   243 \end{matharray}
   269   $(\vec\alpha, \zeta) \, t_scheme$ made an abbreviation for $\record{\vec c
   269   $(\vec\alpha, \zeta) \, t_scheme$ made an abbreviation for $\record{\vec c
   270     \ty \vec\sigma\fs \more \ty \zeta}$.
   270     \ty \vec\sigma\fs \more \ty \zeta}$.
   271 
   271 
   272 \end{descr}
   272 \end{descr}
   273 
   273 
   274 \subsection{Record operations}\label{sec:hol-record-ops}
   274 \subsubsection{Record operations}\label{sec:hol-record-ops}
   275 
   275 
   276 Any record definition of the form presented above produces certain standard
   276 Any record definition of the form presented above produces certain standard
   277 operations.  Selectors and updates are provided for any field, including the
   277 operations.  Selectors and updates are provided for any field, including the
   278 improper one ``$more$''.  There are also cumulative record constructor
   278 improper one ``$more$''.  There are also cumulative record constructor
   279 functions.  To simplify the presentation below, we assume for now that
   279 functions.  To simplify the presentation below, we assume for now that
   337 \end{matharray}
   337 \end{matharray}
   338 
   338 
   339 \noindent Note that $t{\dtt}make$ and $t{\dtt}fields$ are actually coincide for root records.
   339 \noindent Note that $t{\dtt}make$ and $t{\dtt}fields$ are actually coincide for root records.
   340 
   340 
   341 
   341 
   342 \subsection{Derived rules and proof tools}\label{sec:hol-record-thms}
   342 \subsubsection{Derived rules and proof tools}\label{sec:hol-record-thms}
   343 
   343 
   344 The record package proves several results internally, declaring these facts to
   344 The record package proves several results internally, declaring these facts to
   345 appropriate proof tools.  This enables users to reason about record structures
   345 appropriate proof tools.  This enables users to reason about record structures
   346 quite comfortably.  Assume that $t$ is a record type as specified above.
   346 quite comfortably.  Assume that $t$ is a record type as specified above.
   347 
   347 
   640   elimination rules, $\isarkeyword{inductive_cases}$ provides case split
   640   elimination rules, $\isarkeyword{inductive_cases}$ provides case split
   641   theorems at the theory level for later use,
   641   theorems at the theory level for later use,
   642 \end{descr}
   642 \end{descr}
   643 
   643 
   644 
   644 
   645 \subsection{Generating executable code}
   645 \subsection{Executable code}
   646 
   646 
   647 Isabelle/Pure provides a generic infrastructure to support code generation
   647 Isabelle/Pure provides a generic infrastructure to support code generation
   648 from executable specifications, both functional and relational programs.
   648 from executable specifications, both functional and relational programs.
   649 Isabelle/HOL instantiates these mechanisms in a way that is amenable to
   649 Isabelle/HOL instantiates these mechanisms in a way that is amenable to
   650 end-user applications.  See \cite{isabelle-HOL} for further information (this
   650 end-user applications.  See \cite{isabelle-HOL} for further information (this