Commit 69a3e848 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

stutter: fix closure() on Fin-acceptance

From a report by Anton Pirogov.

* NEWS: Mention the bug.
* spot/twaalgos/stutter.cc: Fix it.
* tests/core/stutter-tgba.test: Test it.
* THANKS: Add Anton.
parent b25ec6fe
Pipeline #1135 failed with stages
in 123 minutes and 58 seconds
...@@ -42,6 +42,14 @@ New in spot 2.5.1.dev (not yet released) ...@@ -42,6 +42,14 @@ New in spot 2.5.1.dev (not yet released)
- twa_run methods will now diagnose cases where the cycle is - twa_run methods will now diagnose cases where the cycle is
unexpectedly empty instead of segfaulting. unexpectedly empty instead of segfaulting.
- spot::closure(), used by default for testing stutter-invariance,
was using an optimization incorrect if the acceptance condition
had some Fin(x). Consequently stutter-invariance tests for
automata, for instance with "autfilt --is-stutter-invariant",
could be to be wrong (even if the input does not use Fin(x), its
complement, used in the stutter-invariance test likely will).
Stutter-invariance checks of LTL formulas are not affected.
New in spot 2.5.1 (2018-02-20) New in spot 2.5.1 (2018-02-20)
Library: Library:
......
...@@ -2,6 +2,7 @@ We are grateful to these people for their comments, help, or ...@@ -2,6 +2,7 @@ We are grateful to these people for their comments, help, or
suggestions. suggestions.
Akim Demaille Akim Demaille
Anton Pirogov
Ayrat Khalimov Ayrat Khalimov
Caroline Lemieux Caroline Lemieux
Christian Dax Christian Dax
......
...@@ -410,6 +410,11 @@ namespace spot ...@@ -410,6 +410,11 @@ namespace spot
twa_graph_ptr twa_graph_ptr
closure_inplace(twa_graph_ptr a) closure_inplace(twa_graph_ptr a)
{ {
// In the fin-less version of the closure, we can merge edges that
// have the same src, letter, and destination by taking the union
// of their marks. If some Fin() is used, we cannot do that.
bool fin_less = !a->acc().uses_fin_acceptance();
a->prop_keep({false, // state_based a->prop_keep({false, // state_based
false, // inherently_weak false, // inherently_weak
false, false, // deterministic false, false, // deterministic
...@@ -458,7 +463,7 @@ namespace spot ...@@ -458,7 +463,7 @@ namespace spot
need_new_trans = false; need_new_trans = false;
break; break;
} }
else if (cond == ts.cond) else if (fin_less && cond == ts.cond)
{ {
acc |= ts.acc; acc |= ts.acc;
if (ts.acc != acc) if (ts.acc != acc)
......
#! /bin/sh #! /bin/sh
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Laboratoire de Recherche et # Copyright (C) 2014-2018 Laboratoire de Recherche et
# Développement de l'Epita (LRDE). # Développement de l'Epita (LRDE).
# #
# This file is part of Spot, a model checking library. # This file is part of Spot, a model checking library.
...@@ -102,3 +102,28 @@ run 0 autfilt -H1.1 --check=stutter input > input.2 ...@@ -102,3 +102,28 @@ run 0 autfilt -H1.1 --check=stutter input > input.2
test `autfilt -c --is-stutter-invariant input` = 0 test `autfilt -c --is-stutter-invariant input` = 0
grep '!deterministic' input.2 grep '!deterministic' input.2
grep '!stutter-invariant' input.2 grep '!stutter-invariant' input.2
# From an email by Anton Pirogov
cat >pirogov <<EOF
HOA: v1
name: "Evil(1)"
States: 2
Start: 0
AP: 1 "p"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc
--BODY--
State: 0
[t] 0
[0] 1
State: 1 {0}
[0] 0
--END--
EOF
for i in 1 2 3 4 5 6 7 8; do
test 0 = `SPOT_STUTTER_CHECK=$i \
autfilt pirogov --is-stutter-invariant -c` || exit 1
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment