InnerAutomata

Struct InnerAutomata 

Source
pub struct InnerAutomata<'a, T, V>
where T: Eq + Hash + Clone,
{ /* private fields */ }
Expand description

Internal data structure for automaton management

Implementations§

Source§

impl<'a, T, V> InnerAutomata<'a, T, V>
where T: Eq + Hash + Clone,

Source

pub fn dfs( &self, order: Vec<RefState<'a, T, V>>, backward: bool, ) -> DFSInfo<RefState<'a, T, V>>

Returns the depth first search information. This route is done with the follows if “backward” is false and otherwise with the previous

Source§

impl<'a, T, V> InnerAutomata<'a, T, V>
where T: Eq + Hash + Clone,

Source

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>
where T: Eq + Hash + Clone + Display, V: Display,

Source

pub fn to_dot(&self, inverse: bool) -> Result<String, Error>

Returns the DOT representation of the automaton with inverted colors if “inverse” is true

Source§

impl<'a, T, V> InnerAutomata<'a, T, V>
where T: Eq + Hash + Clone,

Source

pub fn is_standard(&self) -> bool

Returns if the automaton is standard

Source

pub fn is_deterministic(&self) -> bool

Returns if the automaton is deterministic

Source

pub fn is_fully_deterministic(&self) -> bool

Returns if the automaton is fully deterministic

Source

pub fn is_homogeneous(&self) -> bool

Returns if the automaton is homogeneous

Source

pub fn is_accessible(&self) -> bool

Returns if the automaton is accessible

Source

pub fn is_coaccessible(&self) -> bool

Returns if the automaton is coaccessible

Source

pub fn is_strongly_connected(&self) -> bool

Returns whether the automaton is strongly connected

Source

pub fn is_orbit(&self) -> bool

Returns whether the automaton is a orbit

Source

pub fn is_stable(&self) -> bool

Returns whether the orbit is stable

Source

pub fn is_strongly_stable(&self) -> bool
where V: Clone + Eq,

Returns whether the orbit is strongly stable

Source

pub fn is_transverse(&self) -> bool

Returns whether the orbit is transverse

Source

pub fn is_strongly_transverse(&self) -> bool
where V: Clone + Eq,

Returns whether the orbit is strongly transverse

Source§

impl<'a, T, V> InnerAutomata<'a, T, V>
where T: Eq + Hash + Clone,

Source

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.

Source

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>
where T: Eq + Hash + Clone, V: Eq + Clone,

Source

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>
where T: Eq + Hash + Clone,

Source

pub fn new() -> Self

Returns an empty automaton

Source

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

Source

pub fn states_count(&self) -> usize

Returns the number of states

Source

pub fn inputs_count(&self) -> usize

Returns the number of inputs

Source

pub fn is_input(&self, value: &RefState<'a, T, V>) -> bool

Returns if the state referenced by “value” is an input

Source

pub fn outputs_count(&self) -> usize

Returns the number of outputs

Source

pub fn is_output(&self, value: &RefState<'a, T, V>) -> bool

Returns if the state referenced by “value” is an output

Source

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>

Source

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>

Source

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>

Source

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, true is returned
  • If the set already contained this state, false is returned, and the set is not modified: original state is not replaced, and the state passed as argument is dropped
Source

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, true is returned
  • If the set already contained this state, false is returned, and the set is not modified: original state is not replaced, and the state passed as argument is dropped
Source

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, true is returned
  • If the set already contained this state, false is returned, and the set is not modified: original state is not replaced, and the state passed as argument is dropped
Source

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.

Source

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.

Source

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

pub fn mirror(&mut self)

Transform the automaton into its mirror

Source§

impl<'a, T, V> InnerAutomata<'a, T, V>
where T: Eq + Hash + Clone, V: Eq,

Source

pub fn get_state(&self, value: &V) -> Option<RefState<'a, T, V>>

Returns the state reference with the value “value”.

Source

pub fn get_input(&self, value: &V) -> Option<RefState<'a, T, V>>

Returns the input reference with the value “value”.

Source

pub fn get_output(&self, value: &V) -> Option<RefState<'a, T, V>>

Returns the output reference with the value “value”.

Trait Implementations§

Source§

impl<'a, T, V> Clone for InnerAutomata<'a, T, V>
where T: Eq + Hash + Clone, V: Eq + Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, T, V: Debug> Debug for InnerAutomata<'a, T, V>
where T: Eq + Hash + Clone + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, T, V> Default for InnerAutomata<'a, T, V>
where T: Eq + Hash + Clone,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, 'a, T, V> Deserialize<'de> for InnerAutomata<'a, T, V>
where T: Deserialize<'de> + Eq + Hash + Clone + 'a, V: Deserialize<'de> + Eq + 'a,

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'a, T, V> Serialize for InnerAutomata<'a, T, V>
where T: Serialize + Eq + Hash + Clone, V: Serialize,

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a, T, V> Freeze for InnerAutomata<'a, T, V>

§

impl<'a, T, V> RefUnwindSafe for InnerAutomata<'a, T, V>

§

impl<'a, T, V> !Send for InnerAutomata<'a, T, V>

§

impl<'a, T, V> !Sync for InnerAutomata<'a, T, V>

§

impl<'a, T, V> Unpin for InnerAutomata<'a, T, V>

§

impl<'a, T, V> UnwindSafe for InnerAutomata<'a, T, V>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,