From 755d93e13cb4f05e987406d8702567ad7af09dd9 Mon Sep 17 00:00:00 2001 From: acondolu Date: Mon, 28 May 2018 10:56:07 +0200 Subject: [PATCH] Added variable convergent_dummy --- ocaml/lambda4.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ocaml/lambda4.ml b/ocaml/lambda4.ml index 2b08e72..62837b2 100644 --- a/ocaml/lambda4.ml +++ b/ocaml/lambda4.ml @@ -12,6 +12,8 @@ let bomb = ref(`Var(-1,-666));; *) let num_more_args = 2;; +let convergent_dummy = `N ~-1; + type problem = { freshno: int ; div: i_var option (* None = bomb *) @@ -68,7 +70,7 @@ let print_problem label ({freshno; div; conv; ps; deltas} as p) = ^"(* DIVERGENT *)" ^ nl ^" "^ (match div with None -> "None" | Some div -> "(Some\""^ print ~l (div :> nf) ^"\")") ^ nl ^" (* CONVERGENT *) [" ^ nl ^ " " - ^ String.concat "\n " (List.map (fun t -> "(* _ *) " ^ (if t = `N (-1) then "" else "\""^ print ~l (t :> nf) ^"\";")) conv) ^ + ^ String.concat "\n " (List.map (fun t -> "(* _ *) " ^ (if t = convergent_dummy then "" else "\""^ print ~l (t :> nf) ^"\";")) conv) ^ (if conv = [] then "" else nl) ^ "] (* NUMERIC *) [" ^ nl ^ " " ^ String.concat "\n " (List.mapi (fun i t -> " (* "^ string_of_int i ^" *) \"" ^ print ~l (t :> nf) ^ "\";") ps) @@ -430,10 +432,10 @@ List.iter (fun l -> prerr_endline (String.concat " " (List.map string_of_var l)) let _ = List.find (fun h -> hd_of t = Some h) showstoppers in t) with Not_found -> match hd_of t with - | None -> assert (t = `N ~-1); t + | None -> assert (t = convergent_dummy); t | Some h -> prerr_endline ("FREEZING " ^ string_of_var h); - `N ~-1 (* convergent dummy*) + convergent_dummy ) (List.combine showstoppers_conv p.conv) in List.iter (fun bs -> -- 2.39.2