Struct typestate_automata::DeterministicFiniteAutomata [−][src]
pub struct DeterministicFiniteAutomata<State, Transition> where
State: Eq + Hash + Clone,
Transition: Eq + Hash + Clone, { pub states: HashSet<State>, pub initial_states: HashMap<State, HashSet<Transition>>, pub final_states: HashMap<State, HashSet<Transition>>, // some fields omitted }
A representation for a deterministic finite automata.
Fields
states: HashSet<State>
Deterministic finite automata states.
initial_states: HashMap<State, HashSet<Transition>>
Deterministic finite automata initial state-indexes.
final_states: HashMap<State, HashSet<Transition>>
Deterministic finite automata final state-indexes.
Implementations
impl<State, Transition> DeterministicFiniteAutomata<State, Transition> where
State: Eq + Hash + Clone,
Transition: Eq + Hash + Clone,
[src]
State: Eq + Hash + Clone,
Transition: Eq + Hash + Clone,
pub fn new() -> Self
[src]
Construct a new deterministic finite automata.
pub fn add_state(&mut self, state: State)
[src]
Add a state to the automata.
pub fn add_initial(&mut self, state: State, symbol: Transition)
[src]
Add an initial state to the automata.
pub fn add_final(&mut self, state: State, symbol: Transition)
[src]
Add a final state to the automata.
pub fn add_sigma(&mut self, sigma: Transition)
[src]
Add a new symbol to the automata alphabet.
pub fn add_transition(
&mut self,
source: State,
symbol: Transition,
destination: State
)
[src]
&mut self,
source: State,
symbol: Transition,
destination: State
)
pub fn productive_states(&self) -> HashSet<State>
[src]
Compute the automata productive states.
pub fn non_productive_states(&self) -> HashSet<State>
[src]
Compute the automata non-productive states.
This is done by calling DeterministicFiniteAutomata::productive_states and performing a diference against the full state set.
pub fn useful_states(&self) -> HashSet<State>
[src]
Compute the automata useful states.
pub fn non_useful_states(&self) -> HashSet<State>
[src]
Compute the automata non-useful states.
This is done by calling DeterministicFiniteAutomata::useful_states and performing a diference against the full state set.
Trait Implementations
impl<State: Clone, Transition: Clone> Clone for DeterministicFiniteAutomata<State, Transition> where
State: Eq + Hash + Clone,
Transition: Eq + Hash + Clone,
[src]
State: Eq + Hash + Clone,
Transition: Eq + Hash + Clone,
fn clone(&self) -> DeterministicFiniteAutomata<State, Transition>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<State: Debug, Transition: Debug> Debug for DeterministicFiniteAutomata<State, Transition> where
State: Eq + Hash + Clone,
Transition: Eq + Hash + Clone,
[src]
State: Eq + Hash + Clone,
Transition: Eq + Hash + Clone,
impl<State, Transition> Default for DeterministicFiniteAutomata<State, Transition> where
State: Eq + Hash + Clone,
Transition: Eq + Hash + Clone,
[src]
State: Eq + Hash + Clone,
Transition: Eq + Hash + Clone,
Implementation of the Default trait for a DeterministicFiniteAutomata.
fn default() -> Self
[src]
This function is equivalent to DeterministicFiniteAutomata::new.
Auto Trait Implementations
impl<State, Transition> RefUnwindSafe for DeterministicFiniteAutomata<State, Transition> where
State: RefUnwindSafe,
Transition: RefUnwindSafe,
State: RefUnwindSafe,
Transition: RefUnwindSafe,
impl<State, Transition> Send for DeterministicFiniteAutomata<State, Transition> where
State: Send,
Transition: Send,
State: Send,
Transition: Send,
impl<State, Transition> Sync for DeterministicFiniteAutomata<State, Transition> where
State: Sync,
Transition: Sync,
State: Sync,
Transition: Sync,
impl<State, Transition> Unpin for DeterministicFiniteAutomata<State, Transition> where
State: Unpin,
Transition: Unpin,
State: Unpin,
Transition: Unpin,
impl<State, Transition> UnwindSafe for DeterministicFiniteAutomata<State, Transition> where
State: UnwindSafe,
Transition: UnwindSafe,
State: UnwindSafe,
Transition: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,