parseaut: diagnose states that are unused and undefined

Reported by Pierre Ganty.

* spot/parseaut/parseaut.yy: Add diagnostics.
* tests/core/parseaut.test: Adjust expected output, and add a test
case.
* NEWS: Mention the bug.
This commit is contained in:
Alexandre Duret-Lutz 2022-12-02 14:44:03 +01:00
parent cfe1b0b70d
commit a032abf0c5
3 changed files with 53 additions and 10 deletions

View file

@ -230,6 +230,7 @@ input:3.1-8: initial state number is larger than state count...
input:4.1-9: ... declared here.
input:1.1-4.9: missing 'Acceptance:' header
input:3.1-8: initial state 1 has no definition
input:4.1-9: state 0 is unused and undefined
EOF
cat >input <<EOF
@ -2096,8 +2097,8 @@ input:46.30-33: 'properties: weak' contradicts...
input:46.13-28: ... 'properties: !inherently-weak' given here
input:55.22-26: 'properties: !weak' contradicts...
input:55.28-36: ... 'properties: very-weak' given here
input:51.1-9: state 1 has no definition...
input:55.13-20: ... despite 'properties: complete'
input:51.1-9: state 1 is unused and undefined
input:55.13-20: automaton is incomplete because it has undefined states
EOF
@ -2281,6 +2282,15 @@ State: 0
[!0&1] 2
[0&1] 0&1
--END--
HOA: v1
Start: 2
States: 10
AP: 2 "a" "b"
Acceptance: 1 Fin(0)
--BODY--
State: 2
[!0&!1] 6
--END--
EOF
expecterr input<<EOF
@ -2299,6 +2309,8 @@ input:26.11: state 1 has no definition
input:28.8: state 2 has no definition
input:32.1-10: initial state 1 has no definition
input:42.8: state 2 has no definition
input:52.9: state 6 has no definition
input:47.1-10: states 0-1,3-5,7-9 are unused and undefined
EOF