λ-calculus 新手留学生求助
consider the natural numbers defined by the following BNFm,n::=Z|S(n)
and the function add defined inductively as follows:
add(Z,m)= m
add(S(n),m)=S(add(n,m))
(1)compute add(S(S(Z)),S(Z));
(2)prove that Z is the left unit of add, i.e., add(n,Z)=n for all natural numbers n;
(3)prove by induction that Z is the right unit of add, i.e., add(Z,n)=n for all natural numbers n;
(4)prove by induction that add(n,S(m))=S(add(n,m)) for all natural numbers n and m;
(5)prove by induction that add is associative.