Define a length function over $A^{*} \leftarrow{N}$ such that $length(l)$ outputs the length of $l$
-
05-11-2019 - |
문제
Consider the following definitions
LIST:
$\overline{nil} \ \ \ \ \ \frac{l}{a \ l}$ $a \in A$
$A^* = \mu \widehat{LIST}, \ A^{\infty} = v \widehat{LIST}$
NAT:
$\overline{0} \ \ \ \ \ \frac{x}{s(x)}$
$ N = \mu \widehat{NAT}, \ N^{\infty} = v \widehat{NAT}$
Given those definitions I have to define a length function over $A^{*} \leftarrow{N}$ such that $length(l)$ outputs the length of $l$.
I have tried to do this problem using structural induction on a given $l$ but I don't seem to get any relevant result.
In general, how would you approach this kind of problem?
올바른 솔루션이 없습니다
제휴하지 않습니다 cs.stackexchange