[][src]Struct tree_automata::bottom_up::Automaton

pub struct Automaton<F, Q: State, L: Label> { /* fields omitted */ }

Tree automaton.

Implementations

impl<F: Symbol, Q: State, L: Label> Automaton<F, Q, L>[src]

pub fn new() -> Automaton<F, Q, L>[src]

Create a new empty automaton.

pub fn len(&self) -> usize[src]

Return the number of states in the automaton.

pub fn states(&self) -> States<'_, F, Q, L>[src]

pub fn final_states(&self) -> Iter<'_, Q>[src]

Return an iterator to the final states of the automaton.

pub fn set_final(&mut self, q: Q) -> bool[src]

Set the given state a final state. Return true if the state was not already final. Return false if the state was already a final state.

pub fn includes(&self, q: &Q) -> bool[src]

Checks if the given state is in the automaton. Return true if at least one configuration is attached to the state in the automaton.

pub fn transitions(&self) -> Transifions<'_, F, Q, L>

Notable traits for Transifions<'a, F, Q, L>

impl<'a, F, Q: State, L: Label> Iterator for Transifions<'a, F, Q, L> type Item = (&'a Configuration<F, Q>, &'a L, &'a Q);
[src]

pub fn configurations_for_state(&self, q: &Q) -> Configurations<'_, F, Q, L>[src]

Return an iterator over the configurations connected to the given state.

pub fn states_for_configuration(
    &self,
    conf: &Configuration<F, Q>
) -> Iter<'_, Labeled<Q, L>>
[src]

Return an iterator over the states connected to the given configuration.

pub fn add(&mut self, conf: Configuration<F, Q>, label: L, state: Q)[src]

Add a new transition to the automaton.

pub fn add_normalized<P: PatternLike<F, Q>, N>(
    &mut self,
    pattern: &P,
    normalizer: &mut N
) -> Q where
    N: FnMut(&Configuration<F, Q>) -> Labeled<Q, L>, 
[src]

Add new transitions in the automaton by adding and normalizing the given configuration, label and state.

pub fn common_configurations<'a>(
    automata: &'a [&'a Automaton<F, Q, L>],
    positions: &'a [Q]
) -> CommonConfigurations<'a, F, Q, L>

Notable traits for CommonConfigurations<'a, F, Q, L>

impl<'a, F: Symbol, Q: State, L: Label> Iterator for CommonConfigurations<'a, F, Q, L> type Item = Vec<Labeled<Configuration<F, Q>, L>>;
[src]

Automata common configurations.

pub fn representatives(&self) -> Representatives<'_, F, Q, L>

Notable traits for Representatives<'a, F, Q, L>

impl<'a, F: Symbol, Q: State, L: Label> Iterator for Representatives<'a, F, Q, L> type Item = Term<F>;
[src]

Return an iterator over the representative terms of the automaton. The representatives terms are all the terms recognized by the automaton without cycle. Together they trigger every transition of the automaton.

pub fn complement(&mut self)[src]

Complement the automaton. This will invert the set of final and non-final states. If the automaton is complete, then self becomes its own complement.

pub fn alphabet(&self) -> HashSet<F>[src]

Return the alphabet on which this automaton is defined.

pub fn map_states<R: State, M>(&self, g: M) -> Automaton<F, R, L> where
    M: Fn(&Q) -> R, 
[src]

impl<F: Symbol, Q: State> Automaton<F, Q, NoLabel>[src]

pub fn complete_with<'a, A: Iterator<Item = &'a F>, R: State>(
    &mut self,
    alphabet: A,
    lang: &Automaton<F, R, NoLabel>
) where
    F: 'a + Ranked,
    R: From<Q>,
    Q: From<R>, 
[src]

Complete the language with the given automaton. Each state of self must be mappable into a state of lang, and each state of lang must be transformed into a dead state of self.

Trait Implementations

impl<F: Clone, Q: Clone + State, L: Clone + Label> Clone for Automaton<F, Q, L>[src]

impl<F: Symbol + Display, Q: State + Display, L: Label + Display> Display for Automaton<F, Q, L>[src]

impl<'a, F: Symbol, Q: State, L: Label> From<&'a Automaton<F, Q, L>> for Automaton<F, Q, u32>[src]

impl<'a, F: Symbol, E, Q: LanguageState<F, E>> From<(Q, &'a E)> for Automaton<F, Q, NoLabel>[src]

impl<'a, F: Symbol, Q: LanguageState<F, ()>> From<Q> for Automaton<F, Q, NoLabel>[src]

impl<F: Symbol, Q: State, L: Label> Language<F> for Automaton<F, Q, L>[src]

impl<F: Symbol, Q: State> LanguageState<F, Automaton<F, Q, NoLabel>> for Q[src]

Auto Trait Implementations

impl<F, Q, L> RefUnwindSafe for Automaton<F, Q, L> where
    F: RefUnwindSafe,
    L: RefUnwindSafe,
    Q: RefUnwindSafe

impl<F, Q, L> Send for Automaton<F, Q, L> where
    F: Send,
    L: Send,
    Q: Send

impl<F, Q, L> Sync for Automaton<F, Q, L> where
    F: Sync,
    L: Sync,
    Q: Sync

impl<F, Q, L> Unpin for Automaton<F, Q, L> where
    F: Unpin,
    L: Unpin,
    Q: Unpin

impl<F, Q, L> UnwindSafe for Automaton<F, Q, L> where
    F: UnwindSafe,
    L: UnwindSafe,
    Q: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<F, Q> LanguageState<F, Automaton<F, Q, NoLabel>> for Q where
    F: Symbol,
    Q: State, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,