open Algo type t = { pid:string; input:int; sub:int; res:int } let (_to_string: (t -> string)) = fun s -> Printf.sprintf "input=%d sub=%d res=%d" s.input s.sub s.res let (to_string: (t -> string)) = fun s -> Printf.sprintf "{pid=%s ; input=%d}" s.pid s.input let of_string: (string -> t) option = Some (fun s -> Scanf.sscanf s "{pid=%s ; input=%d}" (fun pid input -> {pid = pid; input = input; sub = 0; res = 0}) ) let (copy : ('v -> 'v)) = fun x -> x let actions = ["S";"Rr";"Rp"]