mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 11:15:43 -05:00
fix spurious \r
This commit is contained in:
parent
f0041f9dae
commit
5f91d0bd76
2 changed files with 3 additions and 5 deletions
|
|
@ -33,7 +33,6 @@ let p_progress = ref false
|
|||
let proof_file = ref ""
|
||||
let proof_store_memory = ref false
|
||||
let proof_store_file = ref ""
|
||||
let reset_line = "\x1b[2K\r"
|
||||
|
||||
(* Arguments parsing *)
|
||||
let int_arg r arg =
|
||||
|
|
@ -184,7 +183,7 @@ let main_smt ~config () : _ result =
|
|||
in
|
||||
|
||||
let finally () =
|
||||
if !p_stat then Format.printf "%s%a@." reset_line Solver.pp_stats solver
|
||||
if !p_stat then Format.printf "%a@." Solver.pp_stats solver
|
||||
in
|
||||
CCFun.protect ~finally @@ fun () ->
|
||||
(* FIXME: emit an actual proof *)
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ let solve ?gc:_ ?restarts:_ ?proof_file ?(pp_model = false) ?(check = false)
|
|||
Some (mk_progress s)
|
||||
else
|
||||
None
|
||||
in
|
||||
and clear_line () = if progress then Printf.printf "%s%!" reset_line in
|
||||
|
||||
let should_stop =
|
||||
match time, memory with
|
||||
|
|
@ -181,7 +181,6 @@ let solve ?gc:_ ?restarts:_ ?proof_file ?(pp_model = false) ?(check = false)
|
|||
(* ?gc ?restarts ?time ?memory ?progress *)
|
||||
in
|
||||
let t2 = Sys.time () in
|
||||
Printf.printf "\r";
|
||||
flush stdout;
|
||||
(match res with
|
||||
| Solver.Sat m ->
|
||||
|
|
@ -234,7 +233,7 @@ let solve ?gc:_ ?restarts:_ ?proof_file ?(pp_model = false) ?(check = false)
|
|||
Fmt.printf "unknown@.";
|
||||
Fmt.printf "; @[<h>:reason %a@]@." Solver.Unknown.pp reas
|
||||
| exception exn ->
|
||||
Printf.printf "%s%!" reset_line;
|
||||
clear_line ();
|
||||
raise exn);
|
||||
res
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue