restructure the complementation code

The previous code was sometime doing the work of remove_fin() in
addition to complementing the acceptance conditions.  This separate
the two operations clearly.  Also the specialized code for
complementing weak automata is now a specialized code for remove_fin()
on weak automata.

* src/twaalgos/dtgbacomp.hh, src/twaalgos/dtgbacomp.cc: Rename as ...
* src/twaalgos/complement.hh, src/twaalgos/complement.cc: ... these.
* src/twaalgos/Makefile.am: Adjust.
* src/twaalgos/complement.hh (dtgba_complement): Rename as ...
(dtwa_complement): ... this, and restrict the purpose to completion
and accetance complementation.  Further acceptance simplification
can be done with remove_fin() and to_generalized_buchi().
* src/twaalgos/remfin.cc (remove_fin): Specialize handling of weak
automata using the code that was originally in dtgba_complement().
Also mark the output as state-based when the input has to Inf.
* src/twaalgos/postproc.cc, src/twaalgos/postproc.hh: Make sure
scc_filter is always called after to_generalized_buchi().
* bench/stutter/stutter_invariance_randomgraph.cc,
src/bin/ltlcross.cc, src/tests/ikwiad.cc, src/twaalgos/minimize.cc,
src/twaalgos/powerset.cc, src/twaalgos/stutter.cc: Adjust usage.
* src/tests/dstar.test, src/tests/ltl2dstar4.test,
src/tests/remfin.test: Adjust expected outputs.
* wrap/python/spot_impl.i: Export dtwa_complement().
This commit is contained in:
Alexandre Duret-Lutz 2015-10-13 19:30:26 +02:00
parent fb642c6df5
commit 06d3bc67ea
18 changed files with 336 additions and 448 deletions

View file

@ -218,20 +218,13 @@ Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc
--BODY--
State: 0
[0&1] 0
[!0&!1] 0
[!0&1] 0
[0&!1] 0
[!0&!1] 1
[!0&1] 1
[!0&!1] 2
[0&!1] 2
[t] 0
[!0] 1
[!1] 2
State: 1 {0}
[!0&!1] 1
[!0&1] 1
[!0] 1
State: 2 {0}
[!0&!1] 2
[0&!1] 2
[!1] 2
--END--
HOA: v1
States: 4
@ -275,7 +268,7 @@ State: 2
[!1] 0
[0&!1] 1 {0}
[!0&!1] 2 {0}
[!0&!1] 3 {0}
[!0&!1] 3
State: 3
[!0&!1] 3 {0 1 4}
--END--
@ -325,31 +318,30 @@ Acceptance: 2 Inf(1) | Inf(0)
properties: trans-labels explicit-labels state-acc
--BODY--
State: 0
[!0] 6
[0] 0
[!0] 6
[0] 8
[0] 9
State: 1 {0 1}
[!0] 3
[0] 3
[t] 3
State: 2 {0 1}
[!0] 5
[0] 1
[!0] 5
State: 3 {0 1}
[!0] 6
[0] 0
[!0] 6
State: 4 {0 1}
[!0] 6
[0] 4
[!0] 6
State: 5 {0 1}
[!0] 7
[0] 3
[!0] 7
State: 6
[!0] 6
[0] 0
State: 7 {1}
[!0] 6
State: 7 {1}
[0] 4
[!0] 6
State: 8
[0] 8
State: 9 {1}
@ -547,68 +539,61 @@ Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc
--BODY--
State: 0
[0&1] 0
[!0&!1] 0
[!0&1] 0
[0&!1] 0
[!0&!1] 1
[!0&1] 1
[!0&!1] 2
[0&!1] 2
[t] 0
[!0] 1
[!1] 2
State: 1 {0}
[!0&!1] 1
[!0&1] 1
[!0] 1
State: 2 {0}
[!0&!1] 2
[0&!1] 2
[!1] 2
--END--
HOA: v1
States: 4
Start: 0
AP: 2 "a" "b"
acc-name: generalized-Buchi 2
Acceptance: 2 Inf(0)&Inf(1)
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[t] 0 {0 1}
[0] 1 {0 1}
[!0] 2 {0 1}
[t] 0 {0}
[0] 1 {0}
[!0] 2 {0}
State: 1
[1] 0 {1}
[0&1] 1 {1}
[!0&1] 2 {0 1}
[1] 0
[0&1] 1
[!0&1] 2 {0}
State: 2
[!1] 0
[0&!1] 1
[!0&!1] 2
[!0&!1] 3
State: 3
[!0&!1] 3 {0 1}
[!0&!1] 3 {0}
--END--
HOA: v1
States: 4
Start: 0
AP: 2 "a" "b"
acc-name: generalized-Buchi 2
Acceptance: 2 Inf(0)&Inf(1)
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[t] 0 {1}
[0] 1 {1}
[!0] 2 {0 1}
[t] 0
[0] 1
[!0] 2 {0}
State: 1
[1] 0 {1}
[0&1] 1 {0 1}
[!0&1] 2 {0 1}
[1] 0
[0&1] 1 {0}
[!0&1] 2 {0}
State: 2
[!1] 0
[0&!1] 1 {0 1}
[!0&!1] 2 {0 1}
[!0&!1] 3 {0 1}
[0&!1] 1 {0}
[!0&!1] 2 {0}
[!0&!1] 3
State: 3
[!0&!1] 3 {0 1}
[!0&!1] 3 {0}
--END--
HOA: v1
States: 1
@ -646,47 +631,42 @@ State: 0
[!0] 0
[0] 1
State: 1 {0}
[!0] 1
[0] 1
[t] 1
--END--
HOA: v1
States: 10
States: 9
Start: 2
AP: 1 "p1"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[!0] 6
[0] 0
[!0] 6
[0] 8
[0] 9
State: 1 {0}
[!0] 3
[0] 3
State: 2 {0}
[!0] 5
State: 1
[t] 3
State: 2
[0] 1
State: 3 {0}
[!0] 6
[!0] 5
State: 3
[0] 0
State: 4 {0}
[!0] 6
[0] 4
State: 5 {0}
[!0] 7
State: 4
[0] 4 {0}
[!0] 6
State: 5
[0] 3
[!0] 7
State: 6
[!0] 6
[0] 0
State: 7 {0}
[!0] 6
[0] 4
State: 7
[0] 4 {0}
[!0] 6
State: 8
[0] 8
State: 9 {0}
[0] 9
[0] 8 {0}
--END--
HOA: v1
States: 15
@ -694,83 +674,75 @@ Start: 13
AP: 2 "p1" "p0"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0 {0}
State: 0
[0&1] 0 {0}
[!0&1] 1 {0}
[0&!1] 11 {0}
[!0&!1] 12
[0&!1] 11
[!0&1] 1
[0&1] 0
State: 1 {0}
State: 1
[0&1] 0 {0}
[!0&1] 1 {0}
[0&!1] 11 {0}
[!0&!1] 12
[0&!1] 11
[!0&1] 1
[0&1] 0
State: 2 {0}
[!0&!1] 10
[0&!1] 11
[!0&1] 2
State: 2
[!0&1] 2 {0}
[0&1] 9
State: 3 {0}
[!0&!1] 10 {0}
[0&!1] 11 {0}
State: 3
[!0&1] 1 {0}
[0&1] 3 {0}
[0&!1] 11 {0}
[!0&!1] 12
[0&!1] 11
[!0&1] 1
[0&1] 3
State: 4 {0}
[!0&!1] 12
[0&!1] 12
[!0&1] 4
[0&1] 7
State: 5 {0}
[!0&!1] 10
[0&!1] 12
[!0&1] 5
State: 4
[!0&1] 4 {0}
[0&1] 7 {0}
[!1] 12
State: 5
[!0&1] 5 {0}
[0&1] 8
State: 6 {0}
[!0&!1] 12
[0&!1] 11
[!0&1] 4
[0&1] 6
State: 7 {0}
[!0&!1] 12
[!0&!1] 10 {0}
[0&!1] 12
[!0&1] 4
[0&1] 7
State: 6
[!0&1] 4 {0}
[0&1] 6 {0}
[0&!1] 11 {0}
[!0&!1] 12
State: 7
[!0&1] 4 {0}
[0&1] 7 {0}
[!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
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] 12
State: 10
[!0&1] 5 {0}
[0&1] 8
[!0&!1] 10 {0}
[0&!1] 12
State: 11
[0&1] 6 {0}
[!0&1] 8
[0&1] 6
[0&!1] 11 {0}
[!0&!1] 12
State: 12
[!0&!1] 12
[0&!1] 12
[!0&1] 8
[0&1] 8
[1] 8
[!1] 12
State: 13
[!0&!1] 10
[0&!1] 11
[!0&1] 2
[0&1] 3
State: 14 {0}
[!0&1] 14
[0&1] 14
[!0&!1] 10
[0&!1] 11
State: 14
[1] 14 {0}
--END--
HOA: v1
States: 4
@ -797,44 +769,26 @@ State: 3 {0}
[!0&1] 3
--END--
HOA: v1
States: 6
Start: 5
States: 5
Start: 4
AP: 2 "p0" "p1"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc complete
properties: deterministic
properties: trans-labels explicit-labels trans-acc deterministic
--BODY--
State: 0
[!0&!1] 0
[0&!1] 0
[!0&1] 0
[0&1] 0
[0] 1
State: 1
[!0&!1] 0
[0&!1] 2
[t] 1 {0}
State: 2
[!0&1] 0
[0&1] 2
State: 2 {0}
[!0&!1] 2
[0&!1] 2
[!0&1] 2
[0&1] 2
State: 3 {0}
[!0&!1] 3
[0&!1] 2
[!0&1] 1
[0&1] 2
[0] 1 {0}
[!0&!1] 2 {0}
State: 3
[1] 0
[!1] 2
State: 4
[!0&!1] 3
[0&!1] 3
[!0&1] 1
[0&1] 1
State: 5
[!0&!1] 4
[0&!1] 4
[!0&1] 4
[0&1] 4
[t] 3
--END--
HOA: v1
States: 5
@ -845,24 +799,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}