1782 |
1782 |
1783 \section{Datatype definitions} |
1783 \section{Datatype definitions} |
1784 \label{sec:HOL:datatype} |
1784 \label{sec:HOL:datatype} |
1785 \index{*datatype|(} |
1785 \index{*datatype|(} |
1786 |
1786 |
1787 Inductive datatypes, similar to those of \ML, frequently appear in |
1787 Inductive datatypes, similar to those of \ML, frequently appear in |
1788 applications of Isabelle/HOL. In principle, such types could be defined by |
1788 applications of Isabelle/HOL. In principle, such types could be defined by |
1789 hand via \texttt{typedef} (see \S\ref{sec:typedef}), but this would be far too |
1789 hand via \texttt{typedef} (see \S\ref{sec:typedef}), but this would be far too |
1790 tedious. The \ttindex{datatype} definition package of \HOL\ automates such |
1790 tedious. The \ttindex{datatype} definition package of Isabelle/HOL (cf.\ |
1791 chores. It generates an appropriate \texttt{typedef} based on a least |
1791 \cite{Berghofer-Wenzel:1999:TPHOL}) automates such chores. It generates an |
1792 fixed-point construction, and proves freeness theorems and induction rules, as |
1792 appropriate \texttt{typedef} based on a least fixed-point construction, and |
1793 well as theorems for recursion and case combinators. The user just has to |
1793 proves freeness theorems and induction rules, as well as theorems for |
1794 give a simple specification of new inductive types using a notation similar to |
1794 recursion and case combinators. The user just has to give a simple |
1795 {\ML} or Haskell. |
1795 specification of new inductive types using a notation similar to {\ML} or |
|
1796 Haskell. |
1796 |
1797 |
1797 The current datatype package can handle both mutual and indirect recursion. |
1798 The current datatype package can handle both mutual and indirect recursion. |
1798 It also offers to represent existing types as datatypes giving the advantage |
1799 It also offers to represent existing types as datatypes giving the advantage |
1799 of a more uniform view on standard theories. |
1800 of a more uniform view on standard theories. |
1800 |
1801 |