Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cool
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hans-Peter Deifel
cool
Commits
de84f40d
Commit
de84f40d
authored
8 years ago
by
Christoph
Browse files
Options
Downloads
Patches
Plain Diff
Mark deferrals bold in graphviz export
parent
0a6a3df5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib/CoAlgMisc.ml
+25
-8
25 additions, 8 deletions
src/lib/CoAlgMisc.ml
with
25 additions
and
8 deletions
src/lib/CoAlgMisc.ml
+
25
−
8
View file @
de84f40d
...
@@ -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
)
[(
"<"
,
"<"
)
;
(
">"
,
">"
)
;
(
"&"
,
"&"
)]
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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment