acc: better Rabin/Streett detection

* src/twa/acc.cc: Allow duplicate and reordered pairs.  Also recognize
the single-pair cases.
* src/twaalgos/hoa.cc: When Rabin or Streett is detected, canonicalize
the Acceptance: line.
* src/tests/hoaparse.test, wrap/python/tests/accparse2.py: More tests.
* src/tests/sbacc.test: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2015-05-21 08:07:13 +02:00
parent 04171207e6
commit e04b4eb9fb
5 changed files with 280 additions and 50 deletions

View file

@ -1769,6 +1769,21 @@ HOA: v1
States: 1
Start: 0
AP: 2 "a" "b"
/* This is Streett, but badly ordered */
Acceptance: 4 (Inf(3) | Fin(2)) & (Fin(0) | Inf(1))
properties: trans-labels explicit-labels trans-acc complete
properties: deterministic
--BODY--
State: 0
[!0&!1] 0 {2}
[0&!1] 0 {1 2}
[!0&1] 0 {3}
[0&1] 0 {1 3}
--END--
HOA: v1
States: 1
Start: 0
AP: 2 "a" "b"
Acceptance: 6 Fin(0) | (Fin(1) & Inf(2) & Inf(3)) | (Fin(4) & Inf(5))
--BODY--
State: 0
@ -1781,6 +1796,19 @@ HOA: v1
States: 1
Start: 0
AP: 2 "a" "b"
/* generalized-Rabin, but badely ordered */
Acceptance: 6 (Inf(5) & Fin(4)) | Fin(0) | (Inf(2) & Fin(1) & Inf(3))
--BODY--
State: 0
[!0&!1] 0 {0 1 4}
[0&!1] 0 {2 4}
[!0&1] 0 {3 5}
[0&1] 0 {1 3}
--END--
HOA: v1
States: 1
Start: 0
AP: 2 "a" "b"
Acceptance: 3 Fin(0)|Fin(1)|Fin(2)
--BODY--
State: 0
@ -1875,6 +1903,36 @@ HOA: v1
States: 1
Start: 0
AP: 2 "a" "b"
acc-name: Streett 2
Acceptance: 4 (Fin(0) | Inf(1)) & (Fin(2) | Inf(3))
properties: trans-labels explicit-labels trans-acc complete
properties: deterministic
--BODY--
State: 0
[!0&!1] 0 {2}
[0&!1] 0 {1 2}
[!0&1] 0 {3}
[0&1] 0 {1 3}
--END--
HOA: v1
States: 1
Start: 0
AP: 2 "a" "b"
acc-name: generalized-Rabin 3 0 2 1
Acceptance: 6 Fin(0) | (Fin(1) & (Inf(2)&Inf(3))) | (Fin(4) & Inf(5))
properties: trans-labels explicit-labels trans-acc complete
properties: deterministic
--BODY--
State: 0
[!0&!1] 0 {0 1 4}
[0&!1] 0 {2 4}
[!0&1] 0 {3 5}
[0&1] 0 {1 3}
--END--
HOA: v1
States: 1
Start: 0
AP: 2 "a" "b"
acc-name: generalized-Rabin 3 0 2 1
Acceptance: 6 Fin(0) | (Fin(1) & (Inf(2)&Inf(3))) | (Fin(4) & Inf(5))
properties: trans-labels explicit-labels trans-acc complete
@ -2000,6 +2058,20 @@ HOA: v1
States: 1
Start: 0
AP: 2 "a" "b"
Acceptance: 4 (Fin(3) & Inf(2)) | (Fin(1) & Inf(0))
properties: trans-labels explicit-labels trans-acc complete
properties: deterministic
--BODY--
State: 0
[!0&!1] 0 {2}
[0&!1] 0 {1 2}
[!0&1] 0 {3}
[0&1] 0 {1 3}
--END--
HOA: v1
States: 1
Start: 0
AP: 2 "a" "b"
Acceptance: 6 (Inf(1) | (Fin(2)|Fin(3))) & (Inf(4) | Fin(5)) & Inf(0)
properties: trans-labels explicit-labels trans-acc complete
properties: deterministic
@ -2014,6 +2086,20 @@ HOA: v1
States: 1
Start: 0
AP: 2 "a" "b"
Acceptance: 6 (Inf(4) | Fin(5)) & (Inf(1) | (Fin(2)|Fin(3))) & Inf(0)
properties: trans-labels explicit-labels trans-acc complete
properties: deterministic
--BODY--
State: 0
[!0&!1] 0 {0 1 4}
[0&!1] 0 {2 4}
[!0&1] 0 {3 5}
[0&1] 0 {1 3}
--END--
HOA: v1
States: 1
Start: 0
AP: 2 "a" "b"
acc-name: generalized-Buchi 3
Acceptance: 3 Inf(0)&Inf(1)&Inf(2)
properties: trans-labels explicit-labels trans-acc complete

View file

@ -85,6 +85,7 @@ HOA: v1
States: 3
Start: 0
AP: 1 "a"
acc-name: Streett 1
Acceptance: 2 Fin(0) | Inf(1)
properties: trans-labels explicit-labels state-acc deterministic
--BODY--