Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
f29de22b
Commit
f29de22b
authored
Jun 06, 2015
by
Alexandre Lewkowicz
Committed by
Alexandre Duret-Lutz
Feb 12, 2016
Browse files
safra: Add bisimulation option
* src/tests/safra.cc, src/twaalgos/safra.cc, src/twaalgos/safra.hh: Here.
parent
64b27a9a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/tests/safra.cc
View file @
f29de22b
...
...
@@ -42,6 +42,7 @@ int help()
int
main
(
int
argc
,
char
*
argv
[])
{
bool
sim
=
false
;
bool
in_hoa
=
false
;
bool
in_ltl
=
false
;
bool
out_dot
=
true
;
...
...
@@ -74,6 +75,8 @@ int main(int argc, char* argv[])
}
else
if
(
!
strncmp
(
argv
[
i
],
"-p"
,
2
))
pretty_print
=
true
;
else
if
(
!
strncmp
(
argv
[
i
],
"-b"
,
2
))
sim
=
true
;
}
if
(
!
input
)
...
...
@@ -92,7 +95,7 @@ int main(int argc, char* argv[])
spot
::
translator
trans
(
dict
);
trans
.
set_pref
(
spot
::
postprocessor
::
Deterministic
);
auto
tmp
=
trans
.
run
(
f
);
res
=
spot
::
tgba_determinisation
(
tmp
,
pretty_print
);
res
=
spot
::
tgba_determinisation
(
tmp
,
sim
,
pretty_print
);
f
->
destroy
();
}
else
if
(
in_hoa
)
...
...
@@ -101,7 +104,7 @@ int main(int argc, char* argv[])
auto
aut
=
spot
::
hoa_parse
(
input
,
pel
,
dict
);
if
(
spot
::
format_hoa_parse_errors
(
std
::
cerr
,
input
,
pel
))
return
2
;
res
=
tgba_determinisation
(
aut
->
aut
,
pretty_print
);
res
=
tgba_determinisation
(
aut
->
aut
,
sim
,
pretty_print
);
}
res
->
merge_transitions
();
...
...
src/twaalgos/safra.cc
View file @
f29de22b
...
...
@@ -24,6 +24,7 @@
#include "safra.hh"
#include "twaalgos/degen.hh"
#include "twaalgos/simulation.hh"
namespace
spot
{
...
...
@@ -60,7 +61,7 @@ namespace spot
std
::
ostringstream
&
os
,
std
::
vector
<
unsigned
>&
idx
)
{
std
::
string
s
=
subscript
(
start
);
os
<<
'
[
'
<<
s
;
os
<<
'
{
'
<<
s
;
std
::
vector
<
unsigned
>
new_idx
;
std
::
vector
<
unsigned
>
todo
;
unsigned
next
=
-
1U
;
...
...
@@ -117,7 +118,7 @@ namespace spot
todo_next
.
clear
();
}
}
os
<<
s
<<
'
]
'
;
os
<<
s
<<
'
}
'
;
}
// Returns true if lhs has a smaller nesting pattern than rhs
...
...
@@ -367,7 +368,8 @@ namespace spot
}
twa_graph_ptr
tgba_determinisation
(
const
const_twa_graph_ptr
&
a
,
bool
pretty_print
)
tgba_determinisation
(
const
const_twa_graph_ptr
&
a
,
bool
bisimulation
,
bool
pretty_print
)
{
// Degeneralize
const_twa_graph_ptr
aut
;
...
...
@@ -473,6 +475,8 @@ namespace spot
res
->
set_acceptance
(
sets
,
acc_cond
::
acc_code
::
parity
(
false
,
false
,
sets
));
res
->
prop_deterministic
(
true
);
res
->
prop_state_based_acc
(
false
);
if
(
bisimulation
)
res
=
simulation
(
res
);
if
(
pretty_print
)
res
->
set_named_prop
(
"state-names"
,
print_debug
(
seen
));
return
res
;
...
...
src/twaalgos/safra.hh
View file @
f29de22b
...
...
@@ -73,5 +73,6 @@ namespace spot
SPOT_API
twa_graph_ptr
tgba_determinisation
(
const
const_twa_graph_ptr
&
aut
,
bool
bisimulation
=
false
,
bool
pretty_print
=
false
);
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment