fix complete

Alexandre Lewkowicz reported a case where complete() would peek an
existing state that is accepting, and wrongly use it as a sink.

* spot/twaalgos/complete.cc: Fix the function.
* tests/core/complete.test: Add two more tests.
* NEWS: Mention the bug.
This commit is contained in:
Alexandre Duret-Lutz 2016-01-14 17:14:01 +01:00
parent 6c62362fe9
commit 51483b9b7f
3 changed files with 85 additions and 14 deletions

View file

@ -1,7 +1,7 @@
#! /bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Laboratoire de Recherche et Développement de
# l'Epita (LRDE).
# Copyright (C) 2015, 2016 Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
#
@ -57,6 +57,31 @@ State: 0
State: 1
[0] 1
--END--
/* This example comes from Alexandre Lewkowicz */
HOA: v1
States: 2
Start: 0
AP: 1 "a"
Acceptance: 2 Fin(0)&Inf(1)
--BODY--
State: 0
[0] 1
State: 1
[0] 1 {0}
[!0] 1 {1}
--END--
HOA: v1
States: 2
Start: 0
AP: 1 "a"
Acceptance: 2 Fin(0)&Inf(1)
--BODY--
State: 0
[0] 1
State: 1
[0] 1 {0}
[!0] 1 {0}
--END--
EOF
cat >expected <<EOF
@ -112,6 +137,40 @@ State: 1
[0] 1
[!0] 1
--END--
HOA: v1
States: 3
Start: 0
AP: 1 "a"
acc-name: Rabin 1
Acceptance: 2 Fin(0) & Inf(1)
properties: trans-labels explicit-labels trans-acc complete
properties: deterministic
--BODY--
State: 0
[0] 1
[!0] 2
State: 1
[0] 1 {0}
[!0] 1 {1}
State: 2
[t] 2
--END--
HOA: v1
States: 2
Start: 0
AP: 1 "a"
acc-name: Rabin 1
Acceptance: 2 Fin(0) & Inf(1)
properties: trans-labels explicit-labels state-acc complete
properties: deterministic
--BODY--
State: 0
[0] 1
[!0] 1
State: 1 {0}
[0] 1
[!0] 1
--END--
EOF
run 0 autfilt -CH automaton >out