add[n_, z] := n
add[n_, s[m_]] := s[add[n, m]]

mult[n_, z] := z
mult[n_, s[m_]] := add[mult[n, m], n]
