simplify_acceptance: Use color inclusions to simplify a condition

This fixes #406.

* spot/twaalgos/cleanacc.cc: Add the simplification.
* tests/core/remfin.test, tests/python/automata.ipynb,
tests/python/remfin.py: Update tests.
* tests/python/simplacc.py: Update and add tests.
This commit is contained in:
Florian Renkin 2020-07-25 19:15:17 +02:00
parent 05e6e08859
commit 5ec9d55fea
5 changed files with 395 additions and 273 deletions

View file

@ -60,6 +60,11 @@ HOA: v1 States: 2 Start: 0 AP: 2 "p0" "p1" Acceptance: 5 Fin(0) &
(((Fin(1)|Fin(2)|Fin(3))&Inf(4)|Fin(3))) properties: trans-labels
explicit-labels trans-acc --BODY-- State: 0 [!0&!1] 0 {0 1 3} [0&1] 1
{0 2} [0&!1] 0 {2} State: 1 [0&1] 0 {0 2} [0&1] 1 {1} [0&!1] 1 {4} --END--
/* Issue #406 */
HOA: v1 States: 2 Start: 0 AP: 2 "p0" "p1" Acceptance: 4
(Fin(3) & (Inf(1) | Fin(0))) | (Inf(0)&Inf(2)&Inf(3)) properties: trans-labels
explicit-labels trans-acc deterministic --BODY-- State: 0 [0&!1] 0 {2 3}
[!0&!1] 1 {0 1} State: 1 [!0&!1] 0 {0 1} [0&1] 1 {1 2} --END--
"""))
res = []
@ -90,8 +95,10 @@ assert res == [
'((Inf(1) & Fin(2)) | Fin(5)) & (Inf(0) | (Inf(1) & (Inf(3) | Fin(4))))',
'Inf(0)',
'Fin(0)',
'Fin(0)|Fin(1)|Fin(2)',
'Inf(0)&Inf(1)&Inf(2)',
'((Fin(0)|Fin(1)) & Inf(3)) | Fin(2)',
'((Inf(0)&Inf(1)) | Fin(3)) & Inf(2)',
'Fin(0)',
'Inf(0)',
'(Fin(0) & Inf(2)) | Fin(1)',
'(Inf(0) | Fin(2)) & Inf(1)',
'(Fin(2) & (Inf(1) | Fin(0))) | (Inf(0)&Inf(2))',
'(Inf(2) | (Fin(1) & Inf(0))) & (Fin(0)|Fin(2))',
]