mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 11:15:43 -05:00
Better proof output for dot format
This commit is contained in:
parent
6995cf90e1
commit
676ed7eed9
5 changed files with 23 additions and 3 deletions
|
|
@ -17,6 +17,9 @@ module Tsmt = struct
|
||||||
|
|
||||||
type proof = unit
|
type proof = unit
|
||||||
|
|
||||||
|
let proof_debug () =
|
||||||
|
"Proof", ["..."], Some "PURPLE"
|
||||||
|
|
||||||
type assumption =
|
type assumption =
|
||||||
| Lit of formula
|
| Lit of formula
|
||||||
| Assign of term * term
|
| Assign of term * term
|
||||||
|
|
|
||||||
|
|
@ -346,10 +346,14 @@ module Make(St : Mcsolver_types.S) = struct
|
||||||
print_clause p.conclusion St.(p.conclusion.name)
|
print_clause p.conclusion St.(p.conclusion.name)
|
||||||
in
|
in
|
||||||
print_dot_rule "BGCOLOR=\"LIGHTBLUE\"" aux () fmt p.conclusion
|
print_dot_rule "BGCOLOR=\"LIGHTBLUE\"" aux () fmt p.conclusion
|
||||||
| Lemma _ ->
|
| Lemma proof ->
|
||||||
|
let name, args, color = St.proof_debug proof in
|
||||||
|
assert (args <> []);
|
||||||
|
let color = match color with None -> "YELLOW" | Some c -> c in
|
||||||
let aux fmt () =
|
let aux fmt () =
|
||||||
Format.fprintf fmt "<TR><TD colspan=\"2\">%a</TD></TR><TR><TD BGCOLOR=\"YELLOW\">Lemma</TD><TD>%s</TD></TR>"
|
Format.fprintf fmt "<TR><TD colspan=\"2\">%a</TD></TR><TR><TD BGCOLOR=\"%s\" rowspan=\"%d\">%s</TD>%a</TR>"
|
||||||
print_clause p.conclusion St.(p.conclusion.name)
|
print_clause p.conclusion color (List.length args) name
|
||||||
|
(fun fmt -> List.iter (fun v -> Format.fprintf fmt "<TD>%a</TD>" St.print_semantic_var v)) args
|
||||||
in
|
in
|
||||||
print_dot_rule "BGCOLOR=\"LIGHTBLUE\"" aux () fmt p.conclusion
|
print_dot_rule "BGCOLOR=\"LIGHTBLUE\"" aux () fmt p.conclusion
|
||||||
| Resolution (proof1, proof2, a) ->
|
| Resolution (proof1, proof2, a) ->
|
||||||
|
|
|
||||||
|
|
@ -212,6 +212,11 @@ module Make (E : Expr_intf.S)(Th : Plugin_intf.S with
|
||||||
iter_map := Mi.add v.vid !l !iter_map;
|
iter_map := Mi.add v.vid !l !iter_map;
|
||||||
List.iter f !l
|
List.iter f !l
|
||||||
|
|
||||||
|
(* Proof debug info *)
|
||||||
|
let proof_debug p =
|
||||||
|
let name, l, color = Th.proof_debug p in
|
||||||
|
name, (List.map add_term l), color
|
||||||
|
|
||||||
(* Pretty printing for atoms and clauses *)
|
(* Pretty printing for atoms and clauses *)
|
||||||
let print_semantic_var fmt v = E.Term.print fmt v.tag.term
|
let print_semantic_var fmt v = E.Term.print fmt v.tag.term
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,9 @@ module type S = sig
|
||||||
val fresh_dname : unit -> string
|
val fresh_dname : unit -> string
|
||||||
(** Fresh names for clauses *)
|
(** Fresh names for clauses *)
|
||||||
|
|
||||||
|
val proof_debug : proof -> string * (semantic var list) * (string option)
|
||||||
|
(** Debugging info for proofs (see Plugin_intf). *)
|
||||||
|
|
||||||
val print_atom : Format.formatter -> atom -> unit
|
val print_atom : Format.formatter -> atom -> unit
|
||||||
val print_semantic_var : Format.formatter -> semantic var -> unit
|
val print_semantic_var : Format.formatter -> semantic var -> unit
|
||||||
val print_clause : Format.formatter -> clause -> unit
|
val print_clause : Format.formatter -> clause -> unit
|
||||||
|
|
|
||||||
|
|
@ -78,5 +78,10 @@ module type S = sig
|
||||||
val eval : formula -> eval_res
|
val eval : formula -> eval_res
|
||||||
(** Returns the evaluation of the formula in the current assignment *)
|
(** Returns the evaluation of the formula in the current assignment *)
|
||||||
|
|
||||||
|
val proof_debug : proof -> string * (term list) * (string option)
|
||||||
|
(** Returns debugging information on a proof, as a triplet consisting of
|
||||||
|
a name/identification string associated with the proof, arguments of the proof,
|
||||||
|
and an optional color for the proof background *)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue