pub struct ZCSErrorGraphBuilder<'a> {
error_graph: ZCSErrorGraph<'a>,
}Expand description
Builder for constructing a symbolic error graph (ZCS error graph)
This builder takes a symnbolic 01-CS (ZCS) and a set of error states and derives the corresponding symbolic error graph.
The builder performs backwards reachability of all states in the 01-CS starting from the set of error states.
Fields§
§error_graph: ZCSErrorGraph<'a>symbolic error graph that is constructed by the builder
Implementations§
Source§impl<'a> ZCSErrorGraphBuilder<'a>
impl<'a> ZCSErrorGraphBuilder<'a>
Sourcepub fn new(cs: ZCS<'a>, err_states: ZCSStates) -> Self
pub fn new(cs: ZCS<'a>, err_states: ZCSStates) -> Self
creates a new symbolic error graph builder
Sourcepub fn compute_explored_states(&mut self)
pub fn compute_explored_states(&mut self)
predecessor computation to compute the reachable states
§Pseudocode
unexplored ← error_states
visited ← unexplored
while (unexplored ≠ ∅) {
// 1. add new reachable states
explored_states.push(unexplored)
// 2. update unexplored
unexplored ← Pred(∃ rule_vars: unexplored) ∧ ¬visited
// 3. update visited
visited ← visited ∨ unexplored
abstract_unexplored ← ∃_rule_vars: unexplored
for i in 0..|explored_states| {
// 4. for each level i, check if a state `s` has already been reached with a different rule
already_explored ← explored_states(i) ∧ abstract_unexplored
if (already_explored ≠ ∅) {
abstract_already_explored ← ∃ rule_vars: already_explored
// 5. add state `s` with new outgoing rule `r` to the set of already explored states
error_states(i) ← error_states(i) ∨ (unexplored ∧ abstract_already_explored)
// 6. remove `s` from the set of unexplored states
abstract_unexplored ← abstract_unexplored ∧ ¬abstract_already_explored
unexplored ← unexplored ∧ ¬abstract_already_explored
}
}
}Sourcepub fn compute_reachable_initial_states(&mut self)
pub fn compute_reachable_initial_states(&mut self)
extracts all initial states that are reached in the error graph
Sourcepub fn build(self) -> ZCSErrorGraph<'a>
pub fn build(self) -> ZCSErrorGraph<'a>
builds the symbolic error graph
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ZCSErrorGraphBuilder<'a>
impl<'a> !RefUnwindSafe for ZCSErrorGraphBuilder<'a>
impl<'a> !Send for ZCSErrorGraphBuilder<'a>
impl<'a> !Sync for ZCSErrorGraphBuilder<'a>
impl<'a> Unpin for ZCSErrorGraphBuilder<'a>
impl<'a> !UnwindSafe for ZCSErrorGraphBuilder<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more