in
let log q r =
let och = open_out_gen mode perm ! log_file in
- if ! query_num = 1 then output_string och (time () ^ nl);
- let str =
- "Query: " ^ string_of_int ! query_num ^ nl ^ Util.text_of_query q ^ nl ^
- "Result:" ^ nl ^ Util.text_of_result r nl in
- output_string och str;
+ let out = output_string och in
+ if ! query_num = 1 then out (time () ^ nl);
+ out ("Query: " ^ string_of_int ! query_num ^ nl); Util.text_of_query out q nl;
+ out ("Result:" ^ nl); Util.text_of_result out r nl;
flush och
in
let execute q =
(*let q_let_po = M.LetVVar ("obj_positions", M.Const opos, q_let_pr) in*)
-print_endline ("### " ^ MQueryUtil.text_of_query (q_let_po opos 1)) ; flush stdout;
+print_endline "### "; MQueryUtil.text_of_query print_string (q_let_po opos 1) "\n"; flush stdout;
execute_query (q_let_po opos 1)