open Mp1common (* Problem 1 *) let greetings = "Hi there.";; (* Problem 2 *) let pi = 3.1415926;; (* Problem 3 *) let square n = n * n;; (* Problem 4 *) let plus_pi_times_3 y = 3.0 *. (y +. pi);; (* Problem 5 *) let salute name = match name with "Elsa" -> print_string "Halt! Who goes there!\n" | _ -> print_string ("Hail, "^name^". We warmly welcome you!\n");; (* Problem 6 *) let has_smallest_square m n = let mm = square m in let nn = square n in if mm < nn || (mm = nn & m < n) then m else n;; (* Problem 7 *) let pivot (x,y) = (x,y,x);; (* Problem 8 *) let app_pair (x,y) f = (f x, f y);;