equal
deleted
inserted
replaced
118 about @{term map}. Unfortunately inductive proofs about type |
118 about @{term map}. Unfortunately inductive proofs about type |
119 @{text term} are still awkward because they expect a conjunction. One |
119 @{text term} are still awkward because they expect a conjunction. One |
120 could derive a new induction principle as well (see |
120 could derive a new induction principle as well (see |
121 \S\ref{sec:derive-ind}), but simpler is to stop using \isacommand{primrec} |
121 \S\ref{sec:derive-ind}), but simpler is to stop using \isacommand{primrec} |
122 and to define functions with \isacommand{recdef} instead. |
122 and to define functions with \isacommand{recdef} instead. |
123 The details are explained in \S\ref{sec:nested-recdef} below. |
123 Simple uses of \isacommand{recdef} are described in \S\ref{sec:recdef} below, |
|
124 and later (\S\ref{sec:nested-recdef}) we shall see how \isacommand{recdef} can |
|
125 handle nested recursion. |
124 |
126 |
125 Of course, you may also combine mutual and nested recursion of datatypes. For example, |
127 Of course, you may also combine mutual and nested recursion of datatypes. For example, |
126 constructor @{text Sum} in \S\ref{sec:datatype-mut-rec} could take a list of |
128 constructor @{text Sum} in \S\ref{sec:datatype-mut-rec} could take a list of |
127 expressions as its argument: @{text Sum}~@{typ[quotes]"'a aexp list"}. |
129 expressions as its argument: @{text Sum}~@{typ[quotes]"'a aexp list"}. |
128 *} |
130 *} |