let fact = (letrec f = fun n -> letrec g = fun x -> if (x = 0) then 1 else x*((f) (x-1)) in if (n = 0) then 1 else n *((g) (n-1)) in f) in (fact) 5