]> matita.cs.unibo.it Git - fireball-separation.git/blobdiff - ocaml/util.ml
Simple algorithm by Andrea
[fireball-separation.git] / ocaml / util.ml
index a4af2dd2b01d4532657e5c2249c571a7f989be23..05b952651f4691fd47336241c2f5555b1a1b360f 100644 (file)
@@ -14,6 +14,11 @@ let option_map f = function
  | Some x -> Some (f x)
 ;;
 
+let option_get = function
+ | Some x -> x
+ | None -> failwith "option_get: None"
+;;
+
 let rec find_opt f =
  function
     [] -> None
@@ -108,6 +113,7 @@ let var_of_string s =
 let print_name l n =
  if n = -1
   then "*"
+  else if n < 0 then "c" ^ string_of_int n
   else if n >= List.length l then "x" ^ string_of_int (List.length l - n - 1) else List.nth l n
 
 end