pub struct Compiled<I: Clone + Ord> { /* private fields */ }
Expand description
Deterministic finite automata.
Implementations§
Source§impl<I: Clone + Ord> Graph<I>
impl<I: Clone + Ord> Graph<I>
Sourcepub fn accept<Iter: IntoIterator<Item = I>>(&self, iter: Iter) -> bool
pub fn accept<Iter: IntoIterator<Item = I>>(&self, iter: Iter) -> bool
Decide whether an input belongs to the regular langage this NFA accepts.
Sourcepub fn reject<Iter: IntoIterator<Item = I>>(&self, iter: Iter) -> bool
pub fn reject<Iter: IntoIterator<Item = I>>(&self, iter: Iter) -> bool
Decide whether an input belongs to the regular langage this NFA accepts.
Sourcepub fn generalize(&self) -> Graph<I>
pub fn generalize(&self) -> Graph<I>
Generalize to an identical NFA.
Sourcepub fn fuzz(&self) -> Result<Fuzzer<I>, NeverAccepts>
pub fn fuzz(&self) -> Result<Fuzzer<I>, NeverAccepts>
Randomly generate inputs that are all guaranteed to be accepted.
NOTE: returns an infinite iterator! for input in automaton.fuzz()?
will loop forever . . .
§Errors
If this automaton never accepts any input.
Sourcepub fn would_ever_accept(&self) -> bool
pub fn would_ever_accept(&self) -> bool
Check if there exists a string this DFA will accept.
Sourcepub fn into_source(self, name: &str) -> Stringwhere
I: Expression,
pub fn into_source(self, name: &str) -> Stringwhere
I: Expression,
Print as a set of Rust source-code functions.
Sourcepub fn to_ast(&self, name: &str) -> (ItemFn, ItemMod)where
I: Expression,
pub fn to_ast(&self, name: &str) -> (ItemFn, ItemMod)where
I: Expression,
Print as a set of Rust source-code functions.
Sourcepub fn to_fuzz_ast(&self, name: &str) -> (ItemFn, ItemMod)where
I: Expression,
pub fn to_fuzz_ast(&self, name: &str) -> (ItemFn, ItemMod)where
I: Expression,
Print as a set of Rust source-code functions.
Trait Implementations§
Source§impl<I: Ord + Clone + Ord> Ord for Graph<I>
impl<I: Ord + Clone + Ord> Ord for Graph<I>
Source§impl<I: PartialOrd + Clone + Ord> PartialOrd for Graph<I>
impl<I: PartialOrd + Clone + Ord> PartialOrd for Graph<I>
impl<I: Eq + Clone + Ord> Eq for Graph<I>
impl<I: Clone + Ord> StructuralPartialEq for Graph<I>
Auto Trait Implementations§
impl<I> Freeze for Graph<I>
impl<I> RefUnwindSafe for Graph<I>where
I: RefUnwindSafe,
impl<I> Send for Graph<I>where
I: Send,
impl<I> Sync for Graph<I>where
I: Sync,
impl<I> Unpin for Graph<I>
impl<I> UnwindSafe for Graph<I>where
I: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more