mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 11:15:43 -05:00
Better dot backend
This commit is contained in:
parent
aed3aeb17c
commit
434697ea47
6 changed files with 15 additions and 12 deletions
|
|
@ -8,7 +8,7 @@ module type Arg = sig
|
|||
|
||||
val clause_name : clause -> string
|
||||
val print_atom : Format.formatter -> atom -> unit
|
||||
val lemma_info : lemma -> string * string option * atom list
|
||||
val lemma_info : lemma -> string * string option * (Format.formatter -> unit -> unit) list
|
||||
end
|
||||
|
||||
module Make(S : Res.S)(A : Arg with type atom := S.atom and type clause := S.clause and type lemma := S.lemma) = struct
|
||||
|
|
@ -57,9 +57,8 @@ module Make(S : Res.S)(A : Arg with type atom := S.atom and type clause := S.cla
|
|||
print_dot_node fmt (node_id n) "LIGHTBLUE" S.(n.conclusion) "Hypothesis" "LIGHTBLUE"
|
||||
[(fun fmt () -> (Format.fprintf fmt "%s" (A.clause_name n.S.conclusion)))];
|
||||
| S.Lemma lemma ->
|
||||
let rule, color, args = A.lemma_info lemma in
|
||||
let rule, color, l = A.lemma_info lemma in
|
||||
let color = match color with None -> "YELLOW" | Some c -> c in
|
||||
let l = List.map (ttify A.print_atom) args in
|
||||
print_dot_node fmt (node_id n) "LIGHTBLUE" S.(n.conclusion) rule color l
|
||||
| S.Resolution (_, _, a) ->
|
||||
print_dot_node fmt (node_id n) "GREY" S.(n.conclusion) "Resolution" "GREY"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ module type Arg = sig
|
|||
|
||||
val clause_name : clause -> string
|
||||
val print_atom : Format.formatter -> atom -> unit
|
||||
val lemma_info : lemma -> string * string option * atom list
|
||||
val lemma_info : lemma -> string * string option * (Format.formatter -> unit -> unit) list
|
||||
end
|
||||
|
||||
module Make(S : Res.S)(A : Arg with type atom := S.atom and type clause := S.clause and type lemma := S.lemma) :
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ Plugin_intf
|
|||
Expr_intf
|
||||
Tseitin_intf
|
||||
Res_intf
|
||||
Solver_types_intf
|
||||
|
||||
# Solver Modules
|
||||
Internal
|
||||
|
|
|
|||
2
opam
2
opam
|
|
@ -1,6 +1,6 @@
|
|||
opam-version: "1.2"
|
||||
license: "Apache"
|
||||
version: "1.1"
|
||||
version: "dev"
|
||||
author: ["Sylvain Conchon" "Alain Mebsout" "Stephane Lecuyer" "Simon Cruanes" "Guillaume Bury"]
|
||||
maintainer: ["guillaume.bury@gmail.com" "simon.cruanes@inria.fr"]
|
||||
build: [
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ solvertest () {
|
|||
for f in `find -L $1 -type f -name '*.cnf' -o -name '*.smt2'`
|
||||
do
|
||||
echo -ne "\r\033[KTesting $f..."
|
||||
"$SOLVER" -s $3 -check -time 30s -size 1G $f | grep $2 > /dev/null 2> /dev/null
|
||||
"$SOLVER" -s $3 -check -time 30s -size 1G $f | grep $2
|
||||
RET=$?
|
||||
if [ $RET -ne 0 ];
|
||||
then
|
||||
|
|
|
|||
|
|
@ -91,8 +91,11 @@ let parse_input file =
|
|||
let std = Format.std_formatter
|
||||
|
||||
let print format = match !output with
|
||||
| Standard -> Format.fprintf std "%( fmt %)@." format
|
||||
| Dot -> Format.fprintf std "/* %( fmt %) */@." format
|
||||
| Standard ->
|
||||
Format.kfprintf (fun fmt -> Format.fprintf fmt "@.") std format
|
||||
| Dot ->
|
||||
Format.fprintf std "/* ";
|
||||
Format.kfprintf (fun fmt -> Format.fprintf fmt " */@.") std format
|
||||
|
||||
let print_proof proof = match !output with
|
||||
| Standard -> ()
|
||||
|
|
@ -225,12 +228,12 @@ let main () =
|
|||
Gc.delete_alarm al;
|
||||
begin match res with
|
||||
| Smt.Sat ->
|
||||
print "Sat";
|
||||
print "Sat (%f)" (Sys.time ());
|
||||
if !p_check then
|
||||
if not (List.for_all (List.exists Smt.eval) cnf) then
|
||||
raise Incorrect_model
|
||||
| Smt.Unsat ->
|
||||
print "Unsat";
|
||||
print "Unsat (%f)" (Sys.time ());
|
||||
if !p_check then begin
|
||||
let p = Smt.get_proof () in
|
||||
print_proof p;
|
||||
|
|
@ -244,12 +247,12 @@ let main () =
|
|||
Gc.delete_alarm al;
|
||||
begin match res with
|
||||
| Mcsat.Sat ->
|
||||
print "Sat";
|
||||
print "Sat (%f)" (Sys.time ());
|
||||
if !p_check then
|
||||
if not (List.for_all (List.exists Mcsat.eval) cnf) then
|
||||
raise Incorrect_model
|
||||
| Mcsat.Unsat ->
|
||||
print "Unsat";
|
||||
print "Unsat (%f)" (Sys.time ());
|
||||
if !p_check then begin
|
||||
let p = Mcsat.get_proof () in
|
||||
print_mcproof p;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue