parseaut: better merge of multiple initial states

If an initial states without incoming transition has to be merged into
another one, its outgoing edges can be reused by just changing their
source.

* spot/parseaut/parseaut.yy (fix_initial_state): Implement this here.
* tests/core/522.test: Add more tests.
* tests/core/readsave.test: Adjust one expected output.
* doc/org/hoa.org: Mention the completeness change.
* NEWS: Mention the new feature.
This commit is contained in:
Alexandre Duret-Lutz 2023-01-05 15:09:26 +01:00
parent daf797b9d4
commit 396009c014
5 changed files with 72 additions and 15 deletions

View file

@ -38,6 +38,40 @@ State: 0 {0} [t] 2 [t] 3 State: 1 {0} [t] 4 [t] 5 State: 2
State: 5 {1} [t] 6 [t] 7 State: 6 [t] 6 [t] 7 State: 7 [t] 6 [t] 7
--END--
EOF
# This command, even without --remove-dead, used to break during print_hoa()
autfilt --remove-dead 552.hoa > out.hoa
grep 'States: 7' out.hoa
# This command used to break during print_hoa()
autfilt 552.hoa > out.hoa
test "8 1 16 0" = "`autfilt --stats='%[a]s %[u]s %[a]e %[u]e' out.hoa`"
cat >552loop1.hoa <<EOF
HOA: v1
States: 8
Start: 0
Start: 1
AP: 0
acc-name: generalized-Buchi 2
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--
EOF
autfilt 552loop1.hoa > out.hoa
test "8 0 20 0" = "`autfilt --stats='%[a]s %[u]s %[a]e %[u]e' out.hoa`"
cat >552loop2.hoa <<EOF
HOA: v1
States: 8
Start: 0
Start: 1
AP: 0
acc-name: generalized-Buchi 2
Acceptance: 2 Inf(0)&Inf(1)
--BODY--
State: 0 {0} [t] 2 [t] 3 [t] 0 State: 1 {0} [t] 4 [t] 5 [t] 1 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--
EOF
autfilt 552loop2.hoa > out.hoa
test "9 0 24 0" = "`autfilt --stats='%[a]s %[u]s %[a]e %[u]e' out.hoa`"

View file

@ -1,6 +1,6 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2009, 2010, 2012, 2014-2022 Laboratoire de
# Copyright (C) 2009, 2010, 2012, 2014-2023 Laboratoire de
# Recherche et Développement de l'Epita (LRDE).
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -346,9 +346,8 @@ digraph "" {
0 -> 0 [label="b", id="E1", tooltip="\\\\E\n#1"]
1 -> 1 [label="a", id="E2", tooltip="\\\\E\n#2"]
2 [label="s2"]
2 -> 0 [label="b", id="E3", tooltip="\\\\E\n#3"]
3 -> 1 [label="a", id="E4", tooltip="\\\\E\n#4"]
3 -> 0 [label="b", id="E5", tooltip="\\\\E\n#5"]
3 -> 1 [label="a", id="E3", tooltip="\\\\E\n#3"]
3 -> 0 [label="b", id="E4", tooltip="\\\\E\n#4"]
}
EOF