let x = 1;; let x1 : !alice int = 42;; let x2 : !bob int = 53;; let succ = function x -> x + 1;; let half = function x -> x lsr 1;; let l1 = [1; 2; 3; 4];; let l2 = [x1; x2];; let rec length = function [] -> 0 | _ :: tl -> 1 + length tl;; let rec mem0 = function [] -> false | hd :: tl -> hd = 0 || mem0 tl ;; let rec rev_append l1 l2 = match l1 with [] -> l2 | hd :: tl -> rev_append tl (hd :: l2) ;; let rev l = rev_append l [];; type ('a, 'b) list = [] | :: of 'a * ('a, 'b) list # 'b ;; let f1 x = (x + 1, x + x1);; let f2 x y z = (x + y, y + z, x + z) ;; let r1 : (!alice int, 'a) ref = ref 0;; let reset_r1 () = r1 := 0 ;; let reset r = r := false ;; let length' list = let counter = ref 0 in let rec loop = function [] -> () | _ :: tl -> incr counter; loop tl in loop list; !counter ;; exception X;; exception Y;; let raise_X () = raise X ;; let raise_X' y = if y then raise X;; let raise_X_or_Y x y = if x then raise X; if y then raise Y ;; let test_zero x = if x = 0 then raise X; false ;;