powerset: fix segfault when the initial state is a sink
Reported by Raven Beutner. * spot/twaalgos/minimize.cc: Improve comment. * spot/twaalgos/powerset.cc: Fix handling of an initial state that is also a sink. * tests/core/wdba2.test: Add test case. * NEWS: Mention the bug.
This commit is contained in:
parent
ae10361bdd
commit
0e54a85310
4 changed files with 55 additions and 17 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2010-2020 Laboratoire de Recherche et Développement
|
||||
// Copyright (C) 2010-2020, 2023 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -394,8 +394,8 @@ namespace spot
|
|||
else
|
||||
{
|
||||
// Find any accepting sink state, to speed up the
|
||||
// determinization by merging all states containing a sink
|
||||
// state.
|
||||
// determinization by merging all macro-states containing a
|
||||
// sink state.
|
||||
std::vector<unsigned> acc_sinks;
|
||||
unsigned ns = a->num_states();
|
||||
if (!a->prop_terminal().is_true())
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009-2011, 2013-2019, 2021 Laboratoire de Recherche et
|
||||
// Copyright (C) 2009-2011, 2013-2019, 2021, 2023 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
|
|
@ -217,17 +217,19 @@ namespace spot
|
|||
pm.map_.emplace_back(std::move(ps));
|
||||
}
|
||||
|
||||
{
|
||||
unsigned init_num = aut->get_init_state_number();
|
||||
auto bvi = make_bitvect(ns);
|
||||
bvi->set(init_num);
|
||||
power_state ps{init_num};
|
||||
unsigned num = res->new_state();
|
||||
res->set_init_state(num);
|
||||
seen[bvi] = num;
|
||||
assert(pm.map_.size() == num);
|
||||
pm.map_.emplace_back(std::move(ps));
|
||||
toclean.emplace_back(bvi);
|
||||
// Add the initial state unless it's a sink.
|
||||
if (unsigned init_num = aut->get_init_state_number();
|
||||
!acc_sinks || !acc_sinks->get(init_num))
|
||||
{
|
||||
auto bvi = make_bitvect(ns);
|
||||
bvi->set(init_num);
|
||||
power_state ps{init_num};
|
||||
unsigned num = res->new_state();
|
||||
res->set_init_state(num);
|
||||
seen[bvi] = num;
|
||||
assert(pm.map_.size() == num);
|
||||
pm.map_.emplace_back(std::move(ps));
|
||||
toclean.emplace_back(bvi);
|
||||
}
|
||||
|
||||
// outgoing map
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue