Skip to main content

Dfa

Struct Dfa 

Source
pub struct Dfa { /* private fields */ }
Expand description

Lazily built deterministic automaton over symbol classes.

Implementations§

Source§

impl Dfa

Source

pub fn new( store: &mut TermStore, start: TermId, alphabet: &'static str, budget: &mut Budget, ) -> Result<Dfa, ErrorCode>

Start an automaton at start. The symbol classes are those of start.

Source

pub fn num_states(&self) -> usize

Number of states created so far.

Source

pub fn num_classes(&self) -> usize

Number of symbol classes.

Source

pub fn class_of(&self, c: u32) -> Option<usize>

Class index of a symbol, or None when outside the universe.

Source

pub fn step( &mut self, store: &mut TermStore, s: u32, class: usize, budget: &mut Budget, ) -> Result<u32, ErrorCode>

Transition from s on class, computed once and cached.

Source

pub fn matches( &mut self, store: &mut TermStore, input: &[u32], budget: &mut Budget, ) -> Result<bool, ErrorCode>

Full-match test: does the whole input belong to the language?

Source

pub fn explore( &mut self, store: &mut TermStore, budget: &mut Budget, ) -> Result<(), ErrorCode>

Build every reachable state and transition.

Source

pub fn minimize( &mut self, store: &mut TermStore, budget: &mut Budget, ) -> Result<MinDfa, ErrorCode>

Minimal complete automaton in canonical numbering.

Auto Trait Implementations§

§

impl Forget for Dfa

§

impl Freeze for Dfa

§

impl RefUnwindSafe for Dfa

§

impl Send for Dfa

§

impl Sync for Dfa

§

impl Unpin for Dfa

§

impl UnsafeUnpin for Dfa

§

impl UnwindSafe for Dfa

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.