remfin: Use tra2tba as new rabin strategy in remove_fin
Move implementation of tra2tba to remfin. * python/spot/impl.i: Remove tra2tba python bindings * spot/twaalgos/Makefile.am: Remove tra2tba * spot/twaalgos/remfin.cc: Update rabin_strategy * spot/twaalgos/tra2tba.cc: Delete the file * spot/twaalgos/tra2tba.hh: Delete the file * tests/core/remfin.test: Update tests * tests/python/tra2tba.py: Update tests
This commit is contained in:
parent
2019315213
commit
d45b60a4e5
7 changed files with 363 additions and 726 deletions
|
|
@ -353,8 +353,7 @@ State: 0
|
|||
[!0] 0
|
||||
[0] 1
|
||||
State: 1 {0}
|
||||
[!0] 1
|
||||
[0] 1
|
||||
[t] 1
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 10
|
||||
|
|
@ -402,80 +401,72 @@ Acceptance: 1 Inf(0)
|
|||
properties: trans-labels explicit-labels state-acc
|
||||
--BODY--
|
||||
State: 0 {0}
|
||||
[!0&!1] 12
|
||||
[0&!1] 11
|
||||
[!0&1] 1
|
||||
[0&1] 0
|
||||
[!0&1] 1
|
||||
[0&!1] 11
|
||||
[!0&!1] 12
|
||||
State: 1 {0}
|
||||
[!0&!1] 12
|
||||
[0&!1] 11
|
||||
[!0&1] 1
|
||||
[0&1] 0
|
||||
State: 2 {0}
|
||||
[!0&!1] 10
|
||||
[!0&1] 1
|
||||
[0&!1] 11
|
||||
[!0&!1] 12
|
||||
State: 2 {0}
|
||||
[!0&1] 2
|
||||
[0&1] 9
|
||||
[!0&!1] 10
|
||||
[0&!1] 11
|
||||
State: 3 {0}
|
||||
[!0&!1] 12
|
||||
[0&!1] 11
|
||||
[!0&1] 1
|
||||
[0&1] 3
|
||||
[0&!1] 11
|
||||
[!0&!1] 12
|
||||
State: 4 {0}
|
||||
[!0&!1] 12
|
||||
[0&!1] 12
|
||||
[!0&1] 4
|
||||
[0&1] 7
|
||||
[!1] 12
|
||||
State: 5 {0}
|
||||
[!0&!1] 10
|
||||
[0&!1] 12
|
||||
[!0&1] 5
|
||||
[0&1] 8
|
||||
[!0&!1] 10
|
||||
[0&!1] 12
|
||||
State: 6 {0}
|
||||
[!0&!1] 12
|
||||
[0&!1] 11
|
||||
[!0&1] 4
|
||||
[0&1] 6
|
||||
State: 7 {0}
|
||||
[0&!1] 11
|
||||
[!0&!1] 12
|
||||
[0&!1] 12
|
||||
State: 7 {0}
|
||||
[!0&1] 4
|
||||
[0&1] 7
|
||||
[!1] 12
|
||||
State: 8
|
||||
[!0&!1] 12
|
||||
[0&!1] 12
|
||||
[!0&1] 8
|
||||
[0&1] 8
|
||||
[!0&1] 14
|
||||
[0&1] 14
|
||||
[1] 8
|
||||
[!1] 12
|
||||
[1] 14
|
||||
State: 9
|
||||
[!0&!1] 12
|
||||
[0&!1] 11
|
||||
[!0&1] 1
|
||||
[0&1] 3
|
||||
[0&!1] 11
|
||||
[!0&!1] 12
|
||||
State: 10 {0}
|
||||
[!0&!1] 10
|
||||
[0&!1] 12
|
||||
[!0&1] 5
|
||||
[0&1] 8
|
||||
State: 11 {0}
|
||||
[!0&!1] 12
|
||||
[0&!1] 11
|
||||
[!0&1] 8
|
||||
[0&1] 6
|
||||
State: 12
|
||||
[!0&!1] 12
|
||||
[0&!1] 12
|
||||
[!0&1] 8
|
||||
[0&1] 8
|
||||
State: 13
|
||||
[!0&!1] 10
|
||||
[0&!1] 12
|
||||
State: 11 {0}
|
||||
[0&1] 6
|
||||
[!0&1] 8
|
||||
[0&!1] 11
|
||||
[!0&!1] 12
|
||||
State: 12
|
||||
[1] 8
|
||||
[!1] 12
|
||||
State: 13
|
||||
[!0&1] 2
|
||||
[0&1] 3
|
||||
[!0&!1] 10
|
||||
[0&!1] 11
|
||||
State: 14 {0}
|
||||
[!0&1] 14
|
||||
[0&1] 14
|
||||
[1] 14
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 4
|
||||
|
|
@ -511,35 +502,21 @@ properties: trans-labels explicit-labels state-acc complete
|
|||
properties: deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&!1] 0
|
||||
[0&!1] 0
|
||||
[!0&1] 0
|
||||
[0&1] 0
|
||||
[t] 0
|
||||
State: 1
|
||||
[!0&!1] 0
|
||||
[0&!1] 2
|
||||
[!0&1] 0
|
||||
[0&1] 2
|
||||
[!0] 0
|
||||
[0] 2
|
||||
State: 2 {0}
|
||||
[!0&!1] 2
|
||||
[0&!1] 2
|
||||
[!0&1] 2
|
||||
[0&1] 2
|
||||
[t] 2
|
||||
State: 3 {0}
|
||||
[!0&!1] 3
|
||||
[0&!1] 2
|
||||
[!0&1] 1
|
||||
[0&1] 2
|
||||
[0] 2
|
||||
[!0&!1] 3
|
||||
State: 4
|
||||
[!0&!1] 3
|
||||
[0&!1] 3
|
||||
[!0&1] 1
|
||||
[0&1] 1
|
||||
[1] 1
|
||||
[!1] 3
|
||||
State: 5
|
||||
[!0&!1] 4
|
||||
[0&!1] 4
|
||||
[!0&1] 4
|
||||
[0&1] 4
|
||||
[t] 4
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 5
|
||||
|
|
@ -550,24 +527,18 @@ Acceptance: 1 Inf(0)
|
|||
properties: trans-labels explicit-labels state-acc
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&!1] 2
|
||||
[0&!1] 0
|
||||
[!0&1] 2
|
||||
[!0] 2
|
||||
[0&1] 3
|
||||
State: 1
|
||||
[!0&!1] 2
|
||||
[0&!1] 1
|
||||
[!0&1] 2
|
||||
[0&1] 2
|
||||
[!0 | 1] 2
|
||||
State: 2 {0}
|
||||
[!0&!1] 2
|
||||
[0&!1] 0
|
||||
[!0&1] 2
|
||||
[0&1] 2
|
||||
[!0 | 1] 2
|
||||
State: 3
|
||||
[!0&!1] 2
|
||||
[0&!1] 0
|
||||
[!0&1] 2
|
||||
[!0] 2
|
||||
[0&1] 3
|
||||
[0&1] 4
|
||||
State: 4 {0}
|
||||
|
|
@ -578,7 +549,8 @@ States: 37
|
|||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: generalized-Buchi 12
|
||||
Acceptance: 12 $acctwelve
|
||||
Acceptance: 12 Inf(0)&Inf(1)&Inf(2)&Inf(3)&Inf(4)&Inf(5)&Inf(6)\
|
||||
&Inf(7)&Inf(8)&Inf(9)&Inf(10)&Inf(11)
|
||||
properties: trans-labels explicit-labels state-acc complete
|
||||
--BODY--
|
||||
State: 0
|
||||
|
|
@ -737,11 +709,11 @@ properties: trans-labels explicit-labels state-acc complete
|
|||
properties: deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[0] 1
|
||||
[!0] 0
|
||||
[0] 1
|
||||
State: 1 {0}
|
||||
[0] 1
|
||||
[!0] 0
|
||||
[0] 1
|
||||
--END--
|
||||
EOF
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ State: 1
|
|||
[0] 1
|
||||
--END--"""
|
||||
|
||||
res = spot.tra_to_tba(aut)
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
||||
# Test 2.
|
||||
|
|
@ -51,7 +51,6 @@ State: 2
|
|||
[!0] 1 {}
|
||||
[0] 2 {1}
|
||||
--END--
|
||||
EOF
|
||||
""")
|
||||
|
||||
exp = """HOA: v1
|
||||
|
|
@ -72,7 +71,7 @@ State: 2
|
|||
[0] 2 {0}
|
||||
--END--"""
|
||||
|
||||
res = spot.tra_to_tba(aut)
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
||||
# Test 3.
|
||||
|
|
@ -106,7 +105,7 @@ State: 1
|
|||
[0] 1
|
||||
--END--"""
|
||||
|
||||
res = spot.tra_to_tba(aut)
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
||||
# Test 4.
|
||||
|
|
@ -146,7 +145,7 @@ State: 2 {0}
|
|||
[t] 2
|
||||
--END--"""
|
||||
|
||||
res = spot.tra_to_tba(aut)
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
||||
# Test 5.
|
||||
|
|
@ -192,7 +191,7 @@ State: 3 {0}
|
|||
[t] 3
|
||||
--END--"""
|
||||
|
||||
res = spot.tra_to_tba(aut)
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
||||
# Test 6.
|
||||
|
|
@ -222,26 +221,26 @@ Start: 0
|
|||
AP: 2 "p3" "p2"
|
||||
acc-name: Buchi
|
||||
Acceptance: 1 Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc
|
||||
properties: trans-labels explicit-labels state-acc
|
||||
--BODY--
|
||||
State: 0
|
||||
[!1] 0
|
||||
[1] 1
|
||||
[0&!1] 2
|
||||
State: 1
|
||||
[!1] 0 {0}
|
||||
[1] 1 {0}
|
||||
State: 1 {0}
|
||||
[!1] 0
|
||||
[1] 1
|
||||
[0&!1] 2
|
||||
[0&1] 3
|
||||
State: 2 {0}
|
||||
[0&!1] 2
|
||||
[0&1] 3
|
||||
State: 3 {0}
|
||||
[0&!1] 2
|
||||
[0&1] 3
|
||||
State: 2
|
||||
[0&!1] 2 {0}
|
||||
[0&1] 3 {0}
|
||||
State: 3
|
||||
[0&!1] 2 {0}
|
||||
[0&1] 3 {0}
|
||||
--END--"""
|
||||
|
||||
res = spot.tra_to_tba(aut)
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
||||
# Test 7.
|
||||
|
|
@ -276,7 +275,7 @@ State: 1 {0}
|
|||
[0] 1
|
||||
--END--"""
|
||||
|
||||
res = spot.tra_to_tba(aut)
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
||||
# Test 8.
|
||||
|
|
@ -355,7 +354,7 @@ State: 7
|
|||
[0&2] 7 {0}
|
||||
--END--"""
|
||||
|
||||
res = spot.tra_to_tba(aut)
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
||||
# Test 9.
|
||||
|
|
@ -391,7 +390,7 @@ State: 1
|
|||
[1&!2] 1
|
||||
--END--"""
|
||||
|
||||
res = spot.tra_to_tba(aut)
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
||||
# Test 10.
|
||||
|
|
@ -430,7 +429,7 @@ State: 2 {0}
|
|||
[0&1] 2
|
||||
--END--"""
|
||||
|
||||
res = spot.tra_to_tba(aut)
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
||||
# Test 11.
|
||||
|
|
@ -467,7 +466,8 @@ State: 1
|
|||
[0] 1 {0}
|
||||
--END--"""
|
||||
|
||||
res = spot.tra_to_tba(aut)
|
||||
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
||||
# Test 12.
|
||||
|
|
@ -506,13 +506,13 @@ State: 1
|
|||
[!0] 0
|
||||
[0] 1
|
||||
[!0] 3
|
||||
State: 2
|
||||
State: 2 {0}
|
||||
[!0] 2
|
||||
State: 3 {0}
|
||||
[!0] 3
|
||||
--END--"""
|
||||
|
||||
res = spot.tra_to_tba(aut)
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
||||
# Test 13.
|
||||
|
|
@ -538,8 +538,57 @@ State: 0 "F(Gp3|GFp2)"
|
|||
--END--
|
||||
""")
|
||||
|
||||
res = spot.tra_to_tba(aut)
|
||||
tba = spot.tgba_determinize(res)
|
||||
a = spot.dtwa_complement(aut).intersects(tba)
|
||||
b = spot.dtwa_complement(tba).intersects(aut)
|
||||
assert(a == b)
|
||||
exp = """HOA: v1
|
||||
States: 2
|
||||
Start: 0
|
||||
AP: 2 "p3" "p2"
|
||||
acc-name: Buchi
|
||||
Acceptance: 1 Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[!1] 0 {0}
|
||||
[1] 1
|
||||
State: 1
|
||||
[!1] 0 {0}
|
||||
[1] 1 {0}
|
||||
--END--"""
|
||||
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
||||
# Test 14.
|
||||
aut = spot.automaton("""
|
||||
HOA: v1
|
||||
States: 1
|
||||
Start: 0
|
||||
Acceptance: 4 (Fin(0)&Inf(1)) | (Fin(2)&Inf(3))
|
||||
AP: 2 "b" "a"
|
||||
--BODY--
|
||||
State: 0
|
||||
0 {3} /*{}*/
|
||||
0 {1 3} /*{b}*/
|
||||
0 {2} /*{a}*/
|
||||
0 {2 1} /*{b, a}*/
|
||||
--END--""")
|
||||
|
||||
exp = """HOA: v1
|
||||
States: 2
|
||||
Start: 0
|
||||
AP: 2 "b" "a"
|
||||
acc-name: Buchi
|
||||
Acceptance: 1 Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc
|
||||
--BODY--
|
||||
State: 0
|
||||
[0] 0 {0}
|
||||
[!0] 0
|
||||
[0&!1] 1 {0}
|
||||
[!0&!1] 1
|
||||
State: 1
|
||||
[!1] 1 {0}
|
||||
--END--"""
|
||||
|
||||
res = spot.remove_fin(aut)
|
||||
assert(res.to_str('hoa') == exp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue