relabel: fix handling of concat and fusion

* spot/tl/relabel.cc (formula_to_fgraph): Do not assume that n-ary
operators are Boolean operators.
* tests/python/relabel.py: Add a test case found while discussing
some expression with Antoine Martin.
* NEWS: Mention it.
This commit is contained in:
Alexandre Duret-Lutz 2022-10-13 11:34:38 +02:00
parent 666d78d499
commit 179672fe3b
3 changed files with 18 additions and 3 deletions

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2016, 2018-2020 Laboratoire de Recherche et
// Copyright (C) 2012-2016, 2018-2020, 2022 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
@ -363,7 +363,7 @@ namespace spot
goto done;
}
}
if (sz > 2 && !f.is_boolean())
if (sz > 2 && !f.is_boolean() && f.is(op::And, op::Or))
{
/// If we have a formula like (a & b & Xc), consider
/// it as ((a & b) & Xc) in the graph to isolate the
@ -384,7 +384,7 @@ namespace spot
for (i = 1; i < sz; ++i)
{
formula next = f[i];
// Note that we only add an edge in both directions,
// Note that we add an edge in both directions,
// as the cut point algorithm really need undirected
// graphs. (We used to do only one direction, and
// that turned out to be a bug.)
@ -581,6 +581,14 @@ namespace spot
conv.visit(f);
}
//// Uncomment to print the graph.
// for (auto& [f, sv]: g)
// {
// std::cerr << f << ":\n";
// for (auto& s: sv)
// std::cerr << " " << s << '\n';
// }
// Compute its cut-points
fset c;
cut_points(g, c, f);