mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-08 20:25:31 -05:00
feat: ability to produce .gz proof files
This commit is contained in:
parent
8c780e3ed5
commit
a8a851a7de
1 changed files with 13 additions and 5 deletions
|
|
@ -129,6 +129,15 @@ let mk_progress (_s:Solver.t) : _ -> unit =
|
||||||
flush stdout
|
flush stdout
|
||||||
)
|
)
|
||||||
|
|
||||||
|
let with_file_out (file:string) (f:out_channel -> 'a): 'a =
|
||||||
|
if Filename.extension file = ".gz" then (
|
||||||
|
let p =
|
||||||
|
Unix.open_process_out
|
||||||
|
(Printf.sprintf "gzip -c - > \"%s\"" (String.escaped file))
|
||||||
|
in
|
||||||
|
CCFun.finally1 ~h:(fun () -> Unix.close_process_out p) f p
|
||||||
|
) else CCIO.with_out file f
|
||||||
|
|
||||||
(* call the solver to check-sat *)
|
(* call the solver to check-sat *)
|
||||||
let solve
|
let solve
|
||||||
?gc:_
|
?gc:_
|
||||||
|
|
@ -186,11 +195,10 @@ let solve
|
||||||
Profile.with_ "proof.to-quip" @@ fun () ->
|
Profile.with_ "proof.to-quip" @@ fun () ->
|
||||||
Proof_quip.of_proof proof ~unsat:unsat_step
|
Proof_quip.of_proof proof ~unsat:unsat_step
|
||||||
in
|
in
|
||||||
Profile.with_ "proof.write-file"
|
Profile.with_ "proof.write-file" @@ fun () ->
|
||||||
(fun () ->
|
with_file_out file @@ fun oc ->
|
||||||
CCIO.with_out file @@ fun oc ->
|
Proof_quip.output oc proof_quip;
|
||||||
Proof_quip.output oc proof_quip;
|
flush oc
|
||||||
flush oc);
|
|
||||||
end
|
end
|
||||||
| _ -> ()
|
| _ -> ()
|
||||||
end;
|
end;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue