pub struct Dfa<A: Alphabet> { /* private fields */ }
Implementations
sourceimpl<A: Alphabet> Dfa<A>
impl<A: Alphabet> Dfa<A>
sourcepub fn from_edges<I, V>(edge_iter: I, finals: V) -> Dfa<A>where
I: IntoIterator<Item = (usize, A, usize)>,
V: IntoIterator<Item = usize>,
A: Clone + Debug,
pub fn from_edges<I, V>(edge_iter: I, finals: V) -> Dfa<A>where
I: IntoIterator<Item = (usize, A, usize)>,
V: IntoIterator<Item = usize>,
A: Clone + Debug,
Build a dfa from the connecting edges and final states.
States are numbered in an arbitrary order, except the start label 0. The automaton will deduce the used alphabet subset automatically and test whether it has been used consistently.
sourcepub fn contains<I: IntoIterator<Item = A>>(&self, sequence: I) -> bool
pub fn contains<I: IntoIterator<Item = A>>(&self, sequence: I) -> bool
Checks if the input word is contained in the language.
pub fn to_regex(self) -> Regex<A>
pub fn write_to(&self, output: &mut dyn Write) -> Result<()>where
for<'a> &'a A: Display,
sourcepub fn minimized(&self) -> Self
pub fn minimized(&self) -> Self
Minimize the automata into its language partition.
Contrary to NFAs, the resulting automaton is guaranteed to be a minimal automaton exactly equivalent to the languages minimal DFA.
Auto Trait Implementations
impl<A> RefUnwindSafe for Dfa<A>where
A: RefUnwindSafe,
impl<A> Send for Dfa<A>where
A: Send,
impl<A> Sync for Dfa<A>where
A: Sync,
impl<A> Unpin for Dfa<A>where
A: Unpin,
impl<A> UnwindSafe for Dfa<A>where
A: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more