VeriFIT / mata

A fast and simple automata library
MIT License
20 stars 13 forks source link

Add function to return arbitrary accepting word #411

Closed jurajsic closed 3 months ago

jurajsic commented 3 months ago

For model generation in Z3-Noodler I sometimes need some random accepting word from NFA. We have the function aut.get_words(max_length), but that can be slow if aut has too many states (you need to call it with aut.get_words(aut.num_of_states()) to be sure you will get at least one word).

The implementation would probably be some simple DFS that finishes after reaching final state (assuming we have trimmed automaton).