reduce_parity: fix to work on automata with deleted edges

* spot/twaalgos/parity.cc (reduce_parity): Use the
size of the edge vector to initialize piprime1 and piprime2,
not the number of edges.
* tests/python/parity.py: Add test case, based on a report
by Yann Thierry-Mieg.
This commit is contained in:
Alexandre Duret-Lutz 2022-02-13 18:37:34 +01:00
parent 58f33deeca
commit 3f9f6029e7
3 changed files with 25 additions and 5 deletions

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2016, 2018, 2019 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2016, 2018, 2019, 2022 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -465,8 +465,9 @@ namespace spot
// using k=0 or k=1.
//
// -2 means the edge was never assigned a color.
std::vector<int> piprime1(aut->num_edges() + 1, -2); // k=1
std::vector<int> piprime2(aut->num_edges() + 1, -2); // k=0
unsigned evs = aut->edge_vector().size();
std::vector<int> piprime1(evs, -2); // k=1
std::vector<int> piprime2(evs, -2); // k=0
bool sba = aut->prop_state_acc().is_true();
auto rec =