%%% Assignment 5 %%% Extra Credit %%% Out: Wed 24 Oct %%% Due: Mon 29 Oct %%% Author : Brigitte Pientka % % (25 points) Implement the maximum function max : nat -> nat -> nat % that returns the maximum of two natural numbers. % auxiliary function % x greater or equal to y % geq 0 y = true % geq (s x) (s y) = geq x y val geq : nat -> nat -> bool = fn x => rec x of g 0 => fn y => true | g (s x') => fn y => rec y of g' 0 => false | g' (s y') => g x' y' end end; % maximum function val max : nat -> nat -> nat = fn x => fn y => if (geq x y) then x else y;