more doc handling of prop_universal for fused initial states
Fixes #560. * spot/parseaut/parseaut.yy: Add more comments about handling of prop_universal in present of multiple initial states. It took me time to figure out that it was done correctly. Also only reset prop_complete() in the case an initial state is reused. * tests/core/det.test: Add a test case for the deterministic property. * tests/python/parsetgba.py: Add tests for complete. * doc/org/hoa.org: Add more text about the effect of fusing initial states. * doc/org/concepts.org (properties): Replace "deterministic" by "universal". The former was obsoleted in Spot 2.4.
This commit is contained in:
parent
a735c2b72d
commit
a6f79c6211
5 changed files with 159 additions and 54 deletions
|
|
@ -293,3 +293,31 @@ State: 1
|
|||
EOF
|
||||
autfilt -q --is-deterministic in.hoa && exit 1
|
||||
autfilt --merge-transitions in.hoa | autfilt --is-deterministic
|
||||
|
||||
|
||||
|
||||
# This is a peculiarity of Spot: because it supports only one initial
|
||||
# state, but the HOA format allows for more, Spot's automaton parser
|
||||
# will fuse multiple initial states to fit into the Spot definition of
|
||||
# an automaton. While this is preserving the original language, this
|
||||
# fusing of initial states may turn a non-deterministic automaton
|
||||
# (because of the multiple declared initial states) into a
|
||||
# deterministic one. (Issue #560.)
|
||||
cat >560.hoa <<EOF
|
||||
HOA: v1.1
|
||||
States: 3
|
||||
Start: 1
|
||||
Start: 2
|
||||
AP: 1 "a"
|
||||
Acceptance: 0 t
|
||||
properties: !deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[t] 0
|
||||
State: 1
|
||||
[0] 0
|
||||
State: 2
|
||||
[!0] 0
|
||||
--END--
|
||||
EOF
|
||||
test "1 2 1" = "`autfilt --stats='%d %[r]s %[u]s' 560.hoa`"
|
||||
|
|
|
|||
|
|
@ -191,3 +191,34 @@ State: 3
|
|||
[!0&2] 0
|
||||
[!0&!2] 3
|
||||
--END--""")
|
||||
|
||||
|
||||
# Spot supports only one initial state, but the HOA format allows for
|
||||
# more. Spot's automaton parser will fuse multiple initial states to
|
||||
# fit into the Spot definition of an automaton. Depending on how the
|
||||
# fusing is done, this can turn a complete automaton into a incomplete
|
||||
# one, and vice-versa. See Issue #560.
|
||||
a = spot.automaton("""HOA: v1 States: 8 Start: 0 Start: 1 AP: 0
|
||||
acc-name: generalized-Buchi 2 properties: complete Acceptance: 2
|
||||
Inf(0)&Inf(1) --BODY-- State: 0 {0} [t] 2 [t] 3 [t] 0 State: 1 {0} [t]
|
||||
4 [t] 5 State: 2 {0} [t] 2 [t] 3 State: 3 {0} [t] 6 [t] 7 State: 4 {1}
|
||||
[t] 4 [t] 5 State: 5 {1} [t] 6 [t] 7 State: 6 [t] 6 [t] 7 State: 7 [t]
|
||||
6 [t] 7 --END--""")
|
||||
tc.assertTrue(a.prop_complete().is_true())
|
||||
|
||||
a = spot.automaton("""HOA: v1 States: 8 Start: 0 Start: 1 AP: 0
|
||||
acc-name: generalized-Buchi 2 properties: complete Acceptance: 2
|
||||
Inf(0)&Inf(1) --BODY-- State: 0 {0} [t] 2 [t] 3 State: 1 {0} [t] 4 [t]
|
||||
5 State: 2 {0} [t] 2 [t] 3 State: 3 {0} [t] 6 [t] 7 State: 4 {1} [t] 4
|
||||
[t] 5 State: 5 {1} [t] 6 [t] 7 State: 6 [t] 6 [t] 7 State: 7 [t] 6 [t]
|
||||
7 --END--""")
|
||||
tc.assertTrue(a.prop_complete().is_false())
|
||||
|
||||
a = spot.automaton("""HOA: v1.1 States: 8 Start: 0 Start: 1 AP: 1 "a"
|
||||
acc-name: generalized-Buchi 2 properties: !complete Acceptance: 2
|
||||
Inf(0)&Inf(1) --BODY-- State: 0 {0} [0] 2 [0] 3 State: 1 {0} [t] 1 [t]
|
||||
5 State: 2 {0} [t] 2 [t] 3 State: 3 {0} [t] 6 [t] 7 State: 4 {1} [t] 4
|
||||
[t] 5 State: 5 {1} [t] 6 [t] 7 State: 6 [t] 6 [t] 7 State: 7 [t] 6 [t]
|
||||
7 --END--""")
|
||||
tc.assertTrue(a.prop_complete().is_maybe())
|
||||
tc.assertTrue(spot.is_complete(a))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue