to_parity: Remove merge_states
* spot/twaalgos/toparity.cc: Remove merge_states. * tests/python/automata.ipynb, tests/python/toparity.py: Update tests.
This commit is contained in:
parent
142f1afab2
commit
527b62c5ff
3 changed files with 1140 additions and 1294 deletions
|
|
@ -1684,7 +1684,7 @@ run()
|
||||||
res_->set_named_prop("state-names", names);
|
res_->set_named_prop("state-names", names);
|
||||||
reduce_parity_here(res_);
|
reduce_parity_here(res_);
|
||||||
res_->purge_unreachable_states();
|
res_->purge_unreachable_states();
|
||||||
res_->merge_states();
|
// res_->merge_states();
|
||||||
return res_;
|
return res_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -195,7 +195,7 @@ State: 13
|
||||||
[0&1] 5
|
[0&1] 5
|
||||||
[!0&!1] 10 {0 1 3 5}
|
[!0&!1] 10 {0 1 3 5}
|
||||||
[0&!1] 13 {1 3}
|
[0&!1] 13 {1 3}
|
||||||
--END--"""), [31, 27, 23, 28, 28, 24, 22])
|
--END--"""), [35, 30, 23, 30, 34, 27, 22])
|
||||||
|
|
||||||
test(spot.automaton("""
|
test(spot.automaton("""
|
||||||
HOA: v1
|
HOA: v1
|
||||||
|
|
@ -213,7 +213,7 @@ State: 1
|
||||||
[0&!1] 1 {4}
|
[0&!1] 1 {4}
|
||||||
[!0&1] 1 {0 1 2 3}
|
[!0&1] 1 {0 1 2 3}
|
||||||
[!0&!1] 1 {0 3}
|
[!0&!1] 1 {0 3}
|
||||||
--END--"""), [7, 5, 3, 6, 5, 5, 3])
|
--END--"""), [7, 7, 3, 6, 10, 5, 3])
|
||||||
|
|
||||||
|
|
||||||
for i,f in enumerate(spot.randltl(10, 400)):
|
for i,f in enumerate(spot.randltl(10, 400)):
|
||||||
|
|
@ -288,7 +288,7 @@ State: 4
|
||||||
[0&!1] 4
|
[0&!1] 4
|
||||||
[0&1] 4 {1 2 4}
|
[0&1] 4 {1 2 4}
|
||||||
--END--
|
--END--
|
||||||
"""), [8, 6, 7, 7, 6, 6, 6])
|
"""), [9, 9, 8, 7, 9, 9, 6])
|
||||||
|
|
||||||
test(spot.automaton("""
|
test(spot.automaton("""
|
||||||
HOA: v1
|
HOA: v1
|
||||||
|
|
@ -310,7 +310,7 @@ State: 1
|
||||||
[0&!1] 1 {2 3}
|
[0&!1] 1 {2 3}
|
||||||
[0&1] 1 {1 2 4}
|
[0&1] 1 {1 2 4}
|
||||||
--END--
|
--END--
|
||||||
"""), [11, 6, 3, 7, 7, 4, 3])
|
"""), [11, 6, 4, 7, 11, 6, 3])
|
||||||
|
|
||||||
|
|
||||||
# Tests both the old and new version of to_parity
|
# Tests both the old and new version of to_parity
|
||||||
|
|
@ -341,7 +341,7 @@ explicit-labels trans-acc --BODY-- State: 0 [0&1] 2 {4 5} [0&1] 4 {0 4}
|
||||||
p = spot.to_parity_old(a, True)
|
p = spot.to_parity_old(a, True)
|
||||||
assert p.num_states() == 22
|
assert p.num_states() == 22
|
||||||
assert spot.are_equivalent(a, p)
|
assert spot.are_equivalent(a, p)
|
||||||
test(a, [6, 6, 6, 6, 6, 6, 6])
|
test(a, [8, 7, 8, 8, 8, 7, 6])
|
||||||
|
|
||||||
# Force a few edges to false, to make sure to_parity() is OK with that.
|
# Force a few edges to false, to make sure to_parity() is OK with that.
|
||||||
for e in a.out(2):
|
for e in a.out(2):
|
||||||
|
|
@ -355,7 +355,7 @@ for e in a.out(3):
|
||||||
p = spot.to_parity_old(a, True)
|
p = spot.to_parity_old(a, True)
|
||||||
assert p.num_states() == 22
|
assert p.num_states() == 22
|
||||||
assert spot.are_equivalent(a, p)
|
assert spot.are_equivalent(a, p)
|
||||||
test(a, [7, 6, 7, 7, 6, 6, 6])
|
test(a, [7, 6, 7, 7, 7, 6, 6])
|
||||||
|
|
||||||
for f in spot.randltl(4, 400):
|
for f in spot.randltl(4, 400):
|
||||||
d = spot.translate(f, "det", "G")
|
d = spot.translate(f, "det", "G")
|
||||||
|
|
@ -371,4 +371,4 @@ for f in spot.randltl(5, 2000):
|
||||||
a = spot.translate('!(GFa -> (GFb & GF(!b & !Xb)))', 'gen', 'det')
|
a = spot.translate('!(GFa -> (GFb & GF(!b & !Xb)))', 'gen', 'det')
|
||||||
b = spot.to_parity_old(a, True)
|
b = spot.to_parity_old(a, True)
|
||||||
assert a.equivalent_to(b)
|
assert a.equivalent_to(b)
|
||||||
test(a, [6, 6, 3, 6, 7, 6, 3])
|
test(a, [7, 7, 3, 7, 8, 7, 3])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue