correct to_finite

This fixes issue #596.

* spot/twaalgos/remprop.cc: Rewrite main loop.
* tests/core/ltlf.test: Add test case.
* tests/python/game.py: Remove a test that appears
to make incorrect assumptions about to_finite.
* NEWS: Mention the bug.
This commit is contained in:
Alexandre Duret-Lutz 2024-12-02 23:24:30 +01:00
parent 4a33f0fe65
commit 82401b3254
4 changed files with 39 additions and 159 deletions

View file

@ -19,6 +19,7 @@
#include "config.h"
#include <spot/twaalgos/remprop.hh>
#include <spot/twaalgos/mask.hh>
#include <spot/twaalgos/sccinfo.hh>
#include <ctype.h>
#include <sstream>
@ -180,6 +181,8 @@ namespace spot
make_twa_graph(aut,
{ false, false, true, false, false, false });
scc_info si(aut, scc_info_options::TRACK_SUCCS);
bdd rem = bddtrue;
bdd neg = bddfalse;
int v = res->get_dict()->
@ -194,18 +197,18 @@ namespace spot
unsigned ns = res->num_states();
std::vector<bool> isacc(ns, false);
for (unsigned s = 0; s < ns; ++s)
{
for (auto& e: res->out(s))
if (bdd_implies(e.cond, neg))
for (auto& e: res->out(s))
{
if (!si.is_useful_state(e.dst))
{
isacc[e.src] = true;
e.cond = bddfalse;
continue;
}
else
{
e.cond = bdd_restrict(e.cond, rem);
}
}
if (bdd_have_common_assignment(e.cond, neg))
isacc[e.src] = true;
e.cond = bdd_restrict(e.cond, rem);
}
res->set_buchi();
res->prop_state_acc(true);