Theory ABexpr
theory ABexpr imports Main begin
text‹
\index{datatypes!mutually recursive}%
Sometimes it is necessary to define two datatypes that depend on each
other. This is called \textbf{mutual recursion}. As an example consider a
language of arithmetic and boolean expressions where
\begin{itemize}
\item arithmetic expressions contain boolean expressions because there are
conditional expressions like ``if $m<n$ then $n-m$ else $m-n$'',
and
\item boolean expressions contain arithmetic expressions because of
comparisons like ``$m<n$''.
\end{itemize}
In Isabelle this becomes
›