use std::collections::HashSet;
use std::hash::Hash;
use crate::labeled::arbitrary::LabeledAutomaton;
pub trait FiniteLabeledAutomaton<Label: Eq + Clone>: LabeledAutomaton<Label> + Sized {
fn alphabet_set(&self) -> HashSet<Self::Input> {
self.alphabet().collect()
}
fn states_set(&self) -> HashSet<Self::State> {
self.states().collect()
}
fn labels_set(&self) -> HashSet<Label>
where
Label: Hash,
{
self.labels().collect()
}
fn common_alphabet(&self, other: &Self) -> HashSet<Self::Input> {
let alphabet1: HashSet<Self::Input> = self.alphabet_set();
let alphabet2: HashSet<Self::Input> = other.alphabet_set();
alphabet1.intersection(&alphabet2).cloned().collect()
}
}