Skip to content
Snippets Groups Projects
Commit de84f40d authored by Christoph's avatar Christoph
Browse files

Mark deferrals bold in graphviz export

parent 0a6a3df5
No related branches found
No related tags found
No related merge requests found
...@@ -727,6 +727,11 @@ let lfToInt lf = lf ...@@ -727,6 +727,11 @@ let lfToInt lf = lf
let lfFromInt num = num let lfFromInt num = num
let lfGetFormula sort f = !arrayFormula.(sort).(f) let lfGetFormula sort f = !arrayFormula.(sort).(f)
let escapeHtml (input : string) : string =
List.fold_right (fun (x, y) (str : string) -> Str.global_replace (Str.regexp x) y str)
[("<", "&lt;") ; (">", "&gt;") ; ("&", "&amp;")]
input
let bsetToString sort bset : string = let bsetToString sort bset : string =
let toFormula (lf:localFormula) (lst: string list) : string list = let toFormula (lf:localFormula) (lst: string list) : string list =
let formula: C.formula = lfGetFormula sort lf in let formula: C.formula = lfGetFormula sort lf in
...@@ -797,6 +802,13 @@ let stateToDot (state:state): string = ...@@ -797,6 +802,13 @@ let stateToDot (state:state): string =
| Open -> "yellow" | Open -> "yellow"
| Expandable -> "white" | Expandable -> "white"
in in
let toFormula (lf:localFormula) (lst: string list) : string list =
let formula: C.formula = lfGetFormula state.sortS lf in
if (bsetMem state.deferralS lf)
then ("<B>"^(escapeHtml (C.string_of_formula formula))^"</B>") :: lst
else (escapeHtml (C.string_of_formula formula)) :: lst
in
let formulaList = bsetFold toFormula state.bsS [] in
let ownidx = (string_of_int state.idx) in let ownidx = (string_of_int state.idx) in
let parents = let parents =
List.map (fun (co:core) -> List.map (fun (co:core) ->
...@@ -804,10 +816,9 @@ let stateToDot (state:state): string = ...@@ -804,10 +816,9 @@ let stateToDot (state:state): string =
state.parentsS state.parentsS
in in
"Node" ^ ownidx ^ " [shape=ellipse,style=filled,fillcolor=" ^ color "Node" ^ ownidx ^ " [shape=ellipse,style=filled,fillcolor=" ^ color
^ ",label=\"State " ^ ownidx ^ ",label=<State " ^ ownidx
^ "\\n" ^ (Str.global_replace (Str.regexp ", ") "\\n" ^ "<BR/>" ^ (String.concat "<BR/>" formulaList)
(bsetToString state.sortS state.bsS)) ^ ">];\n"
^ "\"];\n"
^ (String.concat "\n" parents) ^ (String.concat "\n" parents)
...@@ -818,6 +829,13 @@ let coreToDot (core:core): string = ...@@ -818,6 +829,13 @@ let coreToDot (core:core): string =
| Open -> "yellow" | Open -> "yellow"
| Expandable -> "white" | Expandable -> "white"
in in
let toFormula (lf:localFormula) (lst: string list) : string list =
let formula: C.formula = lfGetFormula core.sortC lf in
if (bsetMem core.deferralC lf)
then ("<B>"^(escapeHtml (C.string_of_formula formula))^"</B>") :: lst
else (escapeHtml (C.string_of_formula formula)) :: lst
in
let formulaList = bsetFold toFormula core.bsC [] in
let ownidx = (string_of_int core.idx) in let ownidx = (string_of_int core.idx) in
let parents = let parents =
List.map (fun (st,_:state*int) -> List.map (fun (st,_:state*int) ->
...@@ -825,10 +843,9 @@ let coreToDot (core:core): string = ...@@ -825,10 +843,9 @@ let coreToDot (core:core): string =
core.parentsC core.parentsC
in in
"Node" ^ ownidx ^ " [shape=ellipse,style=filled,fillcolor=" ^ color "Node" ^ ownidx ^ " [shape=ellipse,style=filled,fillcolor=" ^ color
^ ",label=\"Core " ^ ownidx ^ ",label=<Core " ^ ownidx
^ "\\n" ^ (Str.global_replace (Str.regexp ", ") "\\n" ^ "<BR/>" ^ (String.concat "<BR/>" formulaList)
(bsetToString core.sortC core.bsC)) ^ ">];\n"
^ "\"];\n"
^ (String.concat "\n" parents) ^ (String.concat "\n" parents)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment