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:
parent
8360c4e856
commit
897a6ddc04
3 changed files with 34 additions and 30 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue