add intersection checks between words and automata

Several people have asked for a way to check whether a word is
accepted by an automaton, including at least Jonah Romero and Scott
Buckley.  So it's time we have it.

* spot/twa/twa.hh, spot/twa/twa.cc,
spot/twaalgos/word.hh (intersects): Add the new variant.
* spot/twa/fwd.hh: Forward declare twa_word, so that
we can use it in twa.hh.
* spot/twaalgos/forq_contains.cc: Use the new intersection check.
* tests/python/word.ipynb, NEWS: Mention it.
* THANKS: Add Scott Buckley.
This commit is contained in:
Alexandre Duret-Lutz 2024-02-29 16:54:14 +01:00
parent 83cabfa6f9
commit 60f046a574
8 changed files with 78 additions and 12 deletions

5
NEWS
View file

@ -114,6 +114,11 @@ New in spot 2.11.6.dev (not yet released)
The above also impacts autfilt --included-in option.
- Given a twa_word_ptr W and a twa_ptr A both sharing the same
alphabet, one can now write W->intersects(A) or A->intersects(W)
instead of the longuer W->as_automaton()->intersects(A) or
A->intersects(W->as_automaton()).
- spot::scc_info has a new option PROCESS_UNREACHABLE_STATES that
causes it to enumerate even unreachable SCCs.