pub struct LTS<S: Clone + Eq + Hash> {
pub states: HashSet<S>,
pub initial: S,
pub transitions: HashMap<S, Vec<(String, S)>>,
}Expand description
A labeled transition system for refinement checking.
Fields§
§states: HashSet<S>States.
initial: SInitial state.
transitions: HashMap<S, Vec<(String, S)>>Transition relation: state → (label, successor state).
Implementations§
Source§impl<S: Clone + Eq + Hash + Debug> LTS<S>
impl<S: Clone + Eq + Hash + Debug> LTS<S>
Sourcepub fn add_transition(&mut self, from: S, label: impl Into<String>, to: S)
pub fn add_transition(&mut self, from: S, label: impl Into<String>, to: S)
Add a transition.
Sourcepub fn reachable_states(&self) -> HashSet<S>
pub fn reachable_states(&self) -> HashSet<S>
Compute the set of states reachable from the initial state.
Sourcepub fn labels_subset_of(&self, allowed: &HashSet<String>) -> bool
pub fn labels_subset_of(&self, allowed: &HashSet<String>) -> bool
Check whether every label produced by this LTS is in the given allowed set.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for LTS<S>where
S: Freeze,
impl<S> RefUnwindSafe for LTS<S>where
S: RefUnwindSafe,
impl<S> Send for LTS<S>where
S: Send,
impl<S> Sync for LTS<S>where
S: Sync,
impl<S> Unpin for LTS<S>where
S: Unpin,
impl<S> UnsafeUnpin for LTS<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for LTS<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more