(** Other real code **)
(*****************************************************************************)
-exception UniverseInconsistency of string
+exception UniverseInconsistency of string Lazy.t
let error arc node1 closure_type node2 closure =
- let s = "\n ===== Universe Inconsistency detected =====\n\n" ^
- " Unable to add\n" ^
- "\t" ^ (string_of_arc arc) ^ "\n" ^
- " cause\n" ^
- "\t" ^ (string_of_universe node1) ^ "\n" ^
- " is in the " ^ closure_type ^ " closure\n" ^
- "\t{" ^ (string_of_universe_set closure) ^ "}\n" ^
- " of\n" ^
- "\t" ^ (string_of_universe node2) ^ "\n\n" ^
- " ===== Universe Inconsistency detected =====\n" in
- prerr_endline s;
+ let s =
+ lazy
+ ("\n ===== Universe Inconsistency detected =====\n\n" ^
+ " Unable to add\n" ^
+ "\t" ^ (string_of_arc arc) ^ "\n" ^
+ " cause\n" ^
+ "\t" ^ (string_of_universe node1) ^ "\n" ^
+ " is in the " ^ closure_type ^ " closure\n" ^
+ "\t{" ^ (string_of_universe_set closure) ^ "}\n" ^
+ " of\n" ^
+ "\t" ^ (string_of_universe node2) ^ "\n\n" ^
+ " ===== Universe Inconsistency detected =====\n") in
+ prerr_endline (Lazy.force s);
raise (UniverseInconsistency s)
end_spending ();
rc,already_contained
+(* profiling code
let profiler_eq = HExtlib.profile "CicUniv.add_eq"
let profiler_ge = HExtlib.profile "CicUniv.add_ge"
let profiler_gt = HExtlib.profile "CicUniv.add_gt"
profiler_ge.HExtlib.profile (fun _ -> add_ge ?fast u v b) ()
let add_eq ?fast u v b =
profiler_eq.HExtlib.profile (fun _ -> add_eq ?fast u v b) ()
+*)
(*****************************************************************************)
(** END: Decomment this for performance comparisons **)
let assert_univ u =
match u with
- | (_,None) -> raise (UniverseInconsistency "This universe graph has a hole")
+ | (_,None) ->
+ raise (UniverseInconsistency (lazy "This universe graph has a hole"))
| _ -> ()
let assert_univs_have_uri (graph,_) univlist =