(* natural numbers *) type nat = Z | S of nat (* should return a nat n2 that is one more than the argument n1 *) let incr n1 = match n1 with Z -> S Z | S Z -> S (S Z) (* should return a nat n2 that is twice the argument n1 *) let double n1 = match n1 with Z -> 0 | S n1' -> S (S (double n1')) (* should return an integer representation of the nat n1 *) let toint n1 = match n1 with Z -> 0 | S n1' -> 1 + toint let zero = Z let one = S Z let two = S S Z let three = incr (incr one) let four = double two let five = S four let i5 = toint five