Module sampling

Module sampling 

Source

Enums§

SampleResult
The result of sampling from a regex or automaton.

Functions§

sample_nfa
Tries to sample a word that is accepted or not accepted by the NFA. Randomly picks transitions to follow until a final state is reached. Once a final state is reached, the function returns the word that was sampled. The function aborts if no word is found after max_depth transitions. If comp is set to true, the function will return a word that is not accepted by the NFA. In other words, the function will sample a word from the complement of the NFA’s language.
sample_regex
Tries to sample a word that is accepted by the regex. The function aborts if no word is found after max_depth steps. If comp is set to true, the function will return a word that is not accepted by the regex. In other words, the function will sample a word from the complement of the regex’s language.