pub struct InnerAutomata<'a, T, V>{ /* private fields */ }Expand description
Internal data structure for automaton management
Implementations§
Source§impl<'a, T, V> InnerAutomata<'a, T, V>
impl<'a, T, V> InnerAutomata<'a, T, V>
Source§impl<'a, T, V> InnerAutomata<'a, T, V>
impl<'a, T, V> InnerAutomata<'a, T, V>
Sourcepub fn get_door(&self) -> Vec<Vec<(RefState<'a, T, V>, DoorType)>>
pub fn get_door(&self) -> Vec<Vec<(RefState<'a, T, V>, DoorType)>>
Returns the result of the kosaraju algorithm on the automaton, i.e. the set of strongly connected components. Where each element of the strongly connected components is a pair between the reference of the state and the type of gate it is.
Source§impl<'a, T, V> InnerAutomata<'a, T, V>
impl<'a, T, V> InnerAutomata<'a, T, V>
Source§impl<'a, T, V> InnerAutomata<'a, T, V>
impl<'a, T, V> InnerAutomata<'a, T, V>
Sourcepub fn is_standard(&self) -> bool
pub fn is_standard(&self) -> bool
Returns if the automaton is standard
Sourcepub fn is_deterministic(&self) -> bool
pub fn is_deterministic(&self) -> bool
Returns if the automaton is deterministic
Sourcepub fn is_fully_deterministic(&self) -> bool
pub fn is_fully_deterministic(&self) -> bool
Returns if the automaton is fully deterministic
Sourcepub fn is_homogeneous(&self) -> bool
pub fn is_homogeneous(&self) -> bool
Returns if the automaton is homogeneous
Sourcepub fn is_accessible(&self) -> bool
pub fn is_accessible(&self) -> bool
Returns if the automaton is accessible
Sourcepub fn is_coaccessible(&self) -> bool
pub fn is_coaccessible(&self) -> bool
Returns if the automaton is coaccessible
Sourcepub fn is_strongly_connected(&self) -> bool
pub fn is_strongly_connected(&self) -> bool
Returns whether the automaton is strongly connected
Sourcepub fn is_strongly_stable(&self) -> bool
pub fn is_strongly_stable(&self) -> bool
Returns whether the orbit is strongly stable
Sourcepub fn is_transverse(&self) -> bool
pub fn is_transverse(&self) -> bool
Returns whether the orbit is transverse
Sourcepub fn is_strongly_transverse(&self) -> bool
pub fn is_strongly_transverse(&self) -> bool
Returns whether the orbit is strongly transverse
Source§impl<'a, T, V> InnerAutomata<'a, T, V>
impl<'a, T, V> InnerAutomata<'a, T, V>
Sourcepub fn kosaraju(&self) -> Vec<Vec<RefState<'a, T, V>>>
pub fn kosaraju(&self) -> Vec<Vec<RefState<'a, T, V>>>
Returns the result of the kosaraju algorithm on the graph, the set of strongly connected components.
Sourcepub fn extract_scc(&self) -> Vec<InnerAutomata<'a, T, V>>
pub fn extract_scc(&self) -> Vec<InnerAutomata<'a, T, V>>
Returns the automata representing the strongly connected components of the automaton
Source§impl<'a, T, V> InnerAutomata<'a, T, V>
impl<'a, T, V> InnerAutomata<'a, T, V>
Sourcepub fn homogenize(&self) -> InnerAutomata<'a, T, Couple<Union<T, Epsilon>, V>>
pub fn homogenize(&self) -> InnerAutomata<'a, T, Couple<Union<T, Epsilon>, V>>
Creates a homogeneous automaton that recognizes the same language as the current automaton
Source§impl<'a, T, V> InnerAutomata<'a, T, V>
impl<'a, T, V> InnerAutomata<'a, T, V>
Sourcepub fn create(
states: HashSet<RefState<'a, T, V>>,
inputs: HashSet<RefState<'a, T, V>>,
outputs: HashSet<RefState<'a, T, V>>,
) -> Self
pub fn create( states: HashSet<RefState<'a, T, V>>, inputs: HashSet<RefState<'a, T, V>>, outputs: HashSet<RefState<'a, T, V>>, ) -> Self
Return the automate composed of “state”“ states with “inputs”“ and “outputs” as inputs and outputs, respectively
Sourcepub fn states_count(&self) -> usize
pub fn states_count(&self) -> usize
Returns the number of states
Sourcepub fn inputs_count(&self) -> usize
pub fn inputs_count(&self) -> usize
Returns the number of inputs
Sourcepub fn is_input(&self, value: &RefState<'a, T, V>) -> bool
pub fn is_input(&self, value: &RefState<'a, T, V>) -> bool
Returns if the state referenced by “value” is an input
Sourcepub fn outputs_count(&self) -> usize
pub fn outputs_count(&self) -> usize
Returns the number of outputs
Sourcepub fn is_output(&self, value: &RefState<'a, T, V>) -> bool
pub fn is_output(&self, value: &RefState<'a, T, V>) -> bool
Returns if the state referenced by “value” is an output
Sourcepub fn states(&self) -> impl Iterator<Item = &RefState<'a, T, V>>
pub fn states(&self) -> impl Iterator<Item = &RefState<'a, T, V>>
An iterator visiting all states in arbitrary order. The iterator
element type is &RefState<T, V>
Sourcepub fn inputs(&self) -> impl Iterator<Item = &RefState<'a, T, V>>
pub fn inputs(&self) -> impl Iterator<Item = &RefState<'a, T, V>>
An iterator visiting all inputs in arbitrary order. The iterator
element type is &RefState<T, V>
Sourcepub fn outputs(&self) -> impl Iterator<Item = &RefState<'a, T, V>>
pub fn outputs(&self) -> impl Iterator<Item = &RefState<'a, T, V>>
An iterator visiting all outputs in arbitrary order. The iterator
element type is &RefState<T, V>
Sourcepub fn add_state(&mut self, value: RefState<'a, T, V>) -> bool
pub fn add_state(&mut self, value: RefState<'a, T, V>) -> bool
Adds a state to the set of states.
Returns whether the value was newly inserted. That is:
- If the set did not previously contain this state,
trueis returned - If the set already contained this state,
falseis returned, and the set is not modified: original state is not replaced, and the state passed as argument is dropped
Sourcepub fn add_input(&mut self, value: RefState<'a, T, V>) -> bool
pub fn add_input(&mut self, value: RefState<'a, T, V>) -> bool
Adds a state to the set of inputs.
Returns whether the value was newly inserted. That is:
- If the set did not previously contain this state,
trueis returned - If the set already contained this state,
falseis returned, and the set is not modified: original state is not replaced, and the state passed as argument is dropped
Sourcepub fn add_output(&mut self, value: RefState<'a, T, V>) -> bool
pub fn add_output(&mut self, value: RefState<'a, T, V>) -> bool
Adds a state to the set of outputs.
Returns whether the value was newly inserted. That is:
- If the set did not previously contain this state,
trueis returned - If the set already contained this state,
falseis returned, and the set is not modified: original state is not replaced, and the state passed as argument is dropped
Sourcepub fn remove_state(&mut self, value: &RefState<'a, T, V>) -> bool
pub fn remove_state(&mut self, value: &RefState<'a, T, V>) -> bool
Removes a state from the set of states. Returns whether the state was present in the set.
Sourcepub fn remove_input(&mut self, value: &RefState<'a, T, V>) -> bool
pub fn remove_input(&mut self, value: &RefState<'a, T, V>) -> bool
Removes a input from the set of states. Returns whether the input was present in the set.
Sourcepub fn remove_output(&mut self, value: &RefState<'a, T, V>) -> bool
pub fn remove_output(&mut self, value: &RefState<'a, T, V>) -> bool
Removes a output from the set of states. Returns whether the output was present in the set.
Source§impl<'a, T, V> InnerAutomata<'a, T, V>
impl<'a, T, V> InnerAutomata<'a, T, V>
Sourcepub fn get_state(&self, value: &V) -> Option<RefState<'a, T, V>>
pub fn get_state(&self, value: &V) -> Option<RefState<'a, T, V>>
Returns the state reference with the value “value”.
Sourcepub fn get_input(&self, value: &V) -> Option<RefState<'a, T, V>>
pub fn get_input(&self, value: &V) -> Option<RefState<'a, T, V>>
Returns the input reference with the value “value”.
Sourcepub fn get_output(&self, value: &V) -> Option<RefState<'a, T, V>>
pub fn get_output(&self, value: &V) -> Option<RefState<'a, T, V>>
Returns the output reference with the value “value”.