fix degeneralize_tba after accepting transition

* spot/twaalgos/degen.cc (degeneralize_tba): Here.
* tests/python/simstate.py: Adjust expected values.
* NEWS: Mention the bug.
This commit is contained in:
Alexandre Duret-Lutz 2020-02-03 15:38:51 +01:00
parent abab62dd3e
commit e7ae3d3ae0
3 changed files with 11 additions and 4 deletions

7
NEWS
View file

@ -1,6 +1,11 @@
New in spot 2.8.5.dev (not yet released) New in spot 2.8.5.dev (not yet released)
Nothing yet. Bugs fixed:
- degeneralize_tba() was incorrectly not honnoring the "skip_level"
optimization after creating an accepting transition; as a
consequence, some correct output could be larger than necessary
(but still correct).
New in spot 2.8.5 (2020-01-04) New in spot 2.8.5 (2020-01-04)

View file

@ -580,7 +580,7 @@ namespace spot
{ {
d.second = 0; // Make it go to the first level. d.second = 0; // Make it go to the first level.
// Skip as many levels as possible. // Skip as many levels as possible.
if (!a->acc().accepting(acc) && !skip_levels) if (!a->acc().accepting(acc) && skip_levels)
{ {
if (use_cust_acc_orders) if (use_cust_acc_orders)
{ {

View file

@ -1,5 +1,5 @@
# -*- mode: python; coding: utf-8 -*- # -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2015, 2017-2018 Laboratoire de Recherche et Développement # Copyright (C) 2015, 2017-2018, 2020 Laboratoire de Recherche et Développement
# de l'Epita # de l'Epita
# #
# This file is part of Spot, a model checking library. # This file is part of Spot, a model checking library.
@ -169,7 +169,9 @@ State: 11 "{₀[1#1]{₁[0#0,0#1]{₂[1#0]₂}₁}₀}"
a = spot.translate('!Gp0 xor FG((p0 W Gp1) M p1)') a = spot.translate('!Gp0 xor FG((p0 W Gp1) M p1)')
a = spot.degeneralize_tba(a) a = spot.degeneralize_tba(a)
assert a.num_states() == 8
b = spot.simulation(a) b = spot.simulation(a)
assert b.num_states() == 3
b.set_init_state(1) b.set_init_state(1)
b.purge_unreachable_states() b.purge_unreachable_states()
b.copy_state_names_from(a) b.copy_state_names_from(a)
@ -182,7 +184,7 @@ Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc complete properties: trans-labels explicit-labels trans-acc complete
properties: deterministic stutter-invariant properties: deterministic stutter-invariant
--BODY-- --BODY--
State: 0 "[1,8,9]" State: 0 "[1,7]"
[!1] 0 {0} [!1] 0 {0}
[1] 0 [1] 0
--END--""" --END--"""