mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-07 11:45:41 -05:00
wip: better progress bar
This commit is contained in:
parent
f556fe58ab
commit
534fc45783
1 changed files with 6 additions and 3 deletions
|
|
@ -123,17 +123,20 @@ let check_smt_model (solver:Solver.Sat_solver.t) (hyps:_ Vec.t) (m:Model.t) : un
|
|||
Vec.iter check_c hyps
|
||||
*)
|
||||
|
||||
let mk_progress () : _ -> unit =
|
||||
let mk_progress (_s:Solver.t) : _ -> unit =
|
||||
let start = Sys.time() in
|
||||
let n = ref 0 in
|
||||
let syms = "|\\-/" in
|
||||
fun _s ->
|
||||
let diff = Sys.time() -. start in
|
||||
incr n;
|
||||
(* TODO: print some core stats in the progress bar
|
||||
let n_cl = Solver.pp_stats
|
||||
*)
|
||||
(* limit frequency *)
|
||||
if float !n > 6. *. diff then (
|
||||
let sym = String.get syms (!n mod String.length syms) in
|
||||
Printf.printf "\r [%.2fs %c]" diff sym;
|
||||
Printf.printf "\r[%.2fs %c]" diff sym;
|
||||
n := 0;
|
||||
flush stdout
|
||||
)
|
||||
|
|
@ -151,7 +154,7 @@ let solve
|
|||
s : unit =
|
||||
let t1 = Sys.time() in
|
||||
let on_progress =
|
||||
if progress then Some (mk_progress()) else None in
|
||||
if progress then Some (mk_progress s) else None in
|
||||
let res =
|
||||
Solver.solve ~assumptions ?on_progress s
|
||||
(* ?gc ?restarts ?time ?memory ?progress *)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue