use std::hash::Hash;
pub trait LabeledAutomaton<Label: Eq + Clone> {
type State: Hash + Eq + Copy;
type Input: Hash + Eq + Clone;
fn states<'a>(&'a self) -> impl Iterator<Item = Self::State> + 'a;
fn alphabet<'a>(&'a self) -> impl Iterator<Item = Self::Input> + 'a;
fn is_valid_state(&self, state: Self::State) -> bool;
fn is_initial_state(&self, state: Self::State) -> bool;
fn get_label(&self, state: Self::State) -> Option<Label>;
fn has_label(&self, state: Self::State) -> bool {
self.get_label(state).is_some()
}
fn labels<'a>(&'a self) -> impl Iterator<Item = Label> + 'a
where
Label: 'a,
{
self.states().flat_map(|s| self.get_label(s))
}
}