autfilt: fix --accept-word

* bin/autfilt.cc: Translate each word as an automaton once,
and do not make a global product of all of them.
* spot/twaalgos/word.cc: Register the atomic propositions used by the
word when converting it into an automaton.
* tests/core/acc_word.test: Add a test case that used to fail, and
another test that make sure some words are not accepted.
This commit is contained in:
Alexandre Duret-Lutz 2016-03-07 21:38:59 +01:00
parent 8360c4e856
commit 897a6ddc04
3 changed files with 34 additions and 30 deletions

View file

@ -227,6 +227,21 @@ namespace spot
aut->prop_weak(true);
aut->prop_deterministic(true);
// Register the atomic propositions used in the word.
{
bdd support = bddtrue;
for (auto b: prefix)
support &= bdd_support(b);
for (auto b: cycle)
support &= bdd_support(b);
while (support != bddtrue)
{
int v = bdd_var(support);
support = bdd_high(support);
aut->register_ap(dict_->bdd_map[v].f);
}
}
size_t i = 0;
aut->new_states(prefix.size() + cycle.size());
for (auto b: prefix)