acc: recognize parity acceptance
It has two modes: strict or not. In strict mode (tested in hoaparse.test), the acceptance formula has to match exactly the one given in the HOA spec. In non-strict mode (tested in accparse2.py) any equivalent formula is accepted. * src/twa/acc.cc, src/twa/acc.hh (acc_cond::is_parity): New method. * src/twaalgos/hoa.cc: Use it. * src/tests/hoaparse.test: Test it. * wrap/python/spot_impl.i: Bind it. * wrap/python/tests/accparse2.py: New file. * wrap/python/tests/Makefile.am: Add it.
This commit is contained in:
parent
704eaf26c2
commit
04171207e6
7 changed files with 287 additions and 0 deletions
|
|
@ -1789,6 +1789,54 @@ State: 0
|
|||
[!0&1] 0 {2}
|
||||
[0&1] 0 {}
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
Acceptance: 4 Inf(0)|Fin(1)&Inf(2) /* min even 4 */
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&!1] 0 {0 1}
|
||||
[0&!1] 0 {1}
|
||||
[!0&1] 0 {2}
|
||||
[0&1] 0 {}
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
Acceptance: 4 Inf(3)|Fin(2)&Inf(1) /* max odd 4 */
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&!1] 0 {0 1}
|
||||
[0&!1] 0 {1}
|
||||
[!0&1] 0 {2}
|
||||
[0&1] 0 {}
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
Acceptance: 4 Fin(3) & (Inf(2) | (Fin(1) & Inf(0))) /* max even 4 */
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&!1] 0 {0 1}
|
||||
[0&!1] 0 {1}
|
||||
[!0&1] 0 {2}
|
||||
[0&1] 0 {}
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
Acceptance: 4 Inf(0) | (Fin(1) & Inf(2)) /* min even 4 (reorderd) */
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&!1] 0 {0 1}
|
||||
[0&!1] 0 {1}
|
||||
[!0&1] 0 {2}
|
||||
[0&1] 0 {}
|
||||
--END--
|
||||
EOF
|
||||
|
||||
expectok input <<EOF
|
||||
|
|
@ -1853,6 +1901,66 @@ State: 0
|
|||
[!0&1] 0 {2}
|
||||
[0&1] 0
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: parity min even 4
|
||||
Acceptance: 4 Inf(0) | (Fin(1) & Inf(2))
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&!1] 0 {0 1}
|
||||
[0&!1] 0 {1}
|
||||
[!0&1] 0 {2}
|
||||
[0&1] 0
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: parity max odd 4
|
||||
Acceptance: 4 Inf(3) | (Fin(2) & Inf(1))
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&!1] 0 {0 1}
|
||||
[0&!1] 0 {1}
|
||||
[!0&1] 0 {2}
|
||||
[0&1] 0
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: parity max even 4
|
||||
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 {0 1}
|
||||
[0&!1] 0 {1}
|
||||
[!0&1] 0 {2}
|
||||
[0&1] 0
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: parity min even 4
|
||||
Acceptance: 4 Inf(0) | (Fin(1) & Inf(2))
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&!1] 0 {0 1}
|
||||
[0&!1] 0 {1}
|
||||
[!0&1] 0 {2}
|
||||
[0&1] 0
|
||||
--END--
|
||||
EOF
|
||||
|
||||
# The complements are Streett and Rabin, but the acceptance set are
|
||||
|
|
@ -1917,4 +2025,60 @@ State: 0
|
|||
[!0&1] 0 {2}
|
||||
[0&1] 0
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
Acceptance: 4 Fin(0) & (Inf(1) | Fin(2))
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&!1] 0 {0 1}
|
||||
[0&!1] 0 {1}
|
||||
[!0&1] 0 {2}
|
||||
[0&1] 0
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
Acceptance: 4 Fin(3) & (Inf(2) | Fin(1))
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&!1] 0 {0 1}
|
||||
[0&!1] 0 {1}
|
||||
[!0&1] 0 {2}
|
||||
[0&1] 0
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
Acceptance: 4 Inf(3) | (Fin(2) & (Inf(1) | Fin(0)))
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&!1] 0 {0 1}
|
||||
[0&!1] 0 {1}
|
||||
[!0&1] 0 {2}
|
||||
[0&1] 0
|
||||
--END--
|
||||
HOA: v1
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
Acceptance: 4 Fin(0) & (Inf(1) | Fin(2))
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&!1] 0 {0 1}
|
||||
[0&!1] 0 {1}
|
||||
[!0&1] 0 {2}
|
||||
[0&1] 0
|
||||
--END--
|
||||
EOF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue