started to add records;
authorwenzelm
Fri, 23 Oct 1998 12:31:23 +0200
changeset 5735 6b8bb85c3848
parent 5734 bebd10cb7a8d
child 5736 8a1be8e50d9f
started to add records;
doc-src/Logics/HOL.tex
doc-src/Logics/logics.rao
--- a/doc-src/Logics/HOL.tex	Fri Oct 23 11:03:35 1998 +0200
+++ b/doc-src/Logics/HOL.tex	Fri Oct 23 12:31:23 1998 +0200
@@ -1539,6 +1539,42 @@
 class of all \HOL\ types.
 \end{warn}
 
+
+\section{Record types}
+
+At a first approximation, records are just a minor generalization of tuples,
+where components may be addressed by labels instead of just position.  The
+version of records offered by Isabelle/HOL is slightly more advanced, though,
+supporting \emph{extensible record schemes}.  This admits polymorphic
+operations wrt.\ record extensions, yielding ``object-oriented'' effects like
+(single) inheritance.  See also \cite{Naraschewski-Wenzel:1998:TPHOL} for more
+details on object-oriented verification and record subtyping in HOL.
+
+\subsection{Defining records}
+
+\begin{figure}[htbp]
+\begin{rail}
+record  : 'record' typevarlist name '=' parent (field +);
+parent  : ( () | type '+');
+field   : name '::' type;
+\end{rail}
+\caption{Syntax of record type definitions}
+\label{fig:HOL:record}
+\end{figure}
+
+Records have to be defined explicitely, fixing their field names and types,
+and (optional) parent record scheme.  The theory syntax for record type
+definitions is shown in Fig.~\ref{fig:HOL:record}.  For the definition of
+`typevarlist' and `type' see \iflabelundefined{chap:classical}
+{the appendix of the {\em Reference Manual\/}}%
+{Appendix~\ref{app:TheorySyntax}}.
+
+
+\subsection{Record operations and syntax}
+
+\subsection{Proof tools}
+
+
 \section{Datatype declarations}
 \label{sec:HOL:datatype}
 \index{*datatype|(}
@@ -2538,3 +2574,8 @@
 \ttindex{set_current_thy}~{\tt"Set"}.  Otherwise the default claset may not
 contain the rules for set theory.
 \index{higher-order logic|)}
+
+%%% Local Variables: 
+%%% mode: latex
+%%% TeX-master: "logics"
+%%% End: 
--- a/doc-src/Logics/logics.rao	Fri Oct 23 11:03:35 1998 +0200
+++ b/doc-src/Logics/logics.rao	Fri Oct 23 12:31:23 1998 +0200
@@ -36,8 +36,34 @@
 \rail@endbar
 \rail@end
 }
-\rail@i {2}{ typedecl : typevarlist id '=' (cons + '|') ; cons : name (typ *) ( () | mixfix ) ; typ : id | tid | ('(' typevarlist id ')') ; }
+\rail@i {2}{ record : 'record' typevarlist name '=' parent (field +); parent : ( () | type '+'); field : name '::' type; }
 \rail@o {2}{
+\rail@begin{2}{record}
+\rail@term{record}[]
+\rail@nont{typevarlist}[]
+\rail@nont{name}[]
+\rail@term{=}[]
+\rail@nont{parent}[]
+\rail@plus
+\rail@nont{field}[]
+\rail@nextplus{1}
+\rail@endplus
+\rail@end
+\rail@begin{2}{parent}
+\rail@bar
+\rail@nextbar{1}
+\rail@nont{type}[]
+\rail@term{+}[]
+\rail@endbar
+\rail@end
+\rail@begin{1}{field}
+\rail@nont{name}[]
+\rail@term{::}[]
+\rail@nont{type}[]
+\rail@end
+}
+\rail@i {3}{ typedecl : typevarlist id '=' (cons + '|') ; cons : name (typ *) ( () | mixfix ) ; typ : id | tid | ('(' typevarlist id ')') ; }
+\rail@o {3}{
 \rail@begin{2}{typedecl}
 \rail@nont{typevarlist}[]
 \rail@nont{id}[]