pub struct ZCSErrorGraph<'a> {
error_states: ZCSStates,
explored_states: Vec<ZCSStates>,
initial_states: ZCSStates,
cs: ZCS<'a>,
}Expand description
Type representing a symbolic error graph (ZCS error graph)
Fields§
§error_states: ZCSStatesset of error states
explored_states: Vec<ZCSStates>all iteratively explored states, these states contain bdd variables for transitions the first entry is equal to the error states
initial_states: ZCSStatesset of reached initial states of the error graph
cs: ZCS<'a>underlying 01-CS (ZCS)
Implementations§
Source§impl ZCSErrorGraph<'_>
impl ZCSErrorGraph<'_>
Sourcepub fn initial_states(&self) -> ZCSStates
pub fn initial_states(&self) -> ZCSStates
reachable initial_states
Sourcepub fn compute_successors(
&self,
from: ZCSStates,
with: SymbolicTransition,
) -> ZCSStates
pub fn compute_successors( &self, from: ZCSStates, with: SymbolicTransition, ) -> ZCSStates
computes the set of successors reachable in the symbolic error graph (ZCS error graph) for a given symbolic transition
Sourcepub fn get_non_error_intersection(&self, states: ZCSStates) -> (bool, ZCSStates)
pub fn get_non_error_intersection(&self, states: ZCSStates) -> (bool, ZCSStates)
for set of states, it removes the error states additionally returns false, if the intersection is empty
Sourcepub fn get_error_intersection(&self, states: ZCSStates) -> (bool, ZCSStates)
pub fn get_error_intersection(&self, states: ZCSStates) -> (bool, ZCSStates)
computes the intersection of a set of states with the set of error states additionally returns, if the intersection is empty
Sourcepub fn get_sym_state_for_loc(&self, loc: &Location) -> ZCSStates
pub fn get_sym_state_for_loc(&self, loc: &Location) -> ZCSStates
returns the set of states where a given location is occupied
returns the set of states where the given shared variable is in the given interval
Sourcepub fn get_sym_state_for_rule(&self, rule: &IntervalTARule) -> ZCSStates
pub fn get_sym_state_for_rule(&self, rule: &IntervalTARule) -> ZCSStates
returns the set of states where the rule_id of a given rule is applied
Sourcepub fn transitions(&self) -> impl Iterator<Item = &SymbolicTransition>
pub fn transitions(&self) -> impl Iterator<Item = &SymbolicTransition>
returns an iterator over the encoded transition rules in the underlying 01-cs
Sourcepub fn new_empty_sym_state(&self) -> ZCSStates
pub fn new_empty_sym_state(&self) -> ZCSStates
returns a new empty Symbolic State
Sourcepub fn contains_non_spurious_error_path(
&self,
smc_ctx: &ZCSModelCheckerContext<'_>,
) -> SpuriousResult
pub fn contains_non_spurious_error_path( &self, smc_ctx: &ZCSModelCheckerContext<'_>, ) -> SpuriousResult
checks if the error graph contains a non-spurious error path
spurious_checker is used to check if a path is spurious
returns None if every path is spurious
Note that this function is a semi-decision procedure if the underlying threshold automaton contains decrements or resets, i.e., it might not terminate.
queue ← Queue::new()
queue.push(SteadyPath::new(initial_states))
while (queue ≠ ∅) {
steady_path ← queue.pop()
for rule in transitions {
successor_states ← compute_successors(steady_path.last_states, rule)
// check if an error state can be reached
error_intersection ← get_error_intersection(successor_states)
if (error_intersection ≠ ∅) {
foreach assignment {
if ((error_intersecion ∧ assignment) ≠ ∅) {
updated_steady_path ← steady_path.add_successor(rule, error_intersection ∧ assignment)
if updated_steady_path.is_non_spurious() {
return "Found non spurious counter example"
}
}
}
}
// check all other reachable steady paths which do not lead to an error state for spuriousness
non_error_intersection ← get_non_error_intersection(successor_states)
if (non_error_intersection ≠ ∅) {
foreach assignment {
if ((non_error_intersection ∧ assignment) ≠ ∅) {
// construct steady path for the given assignment
successor_steady_path ← construct_steady_path(non_error_intersection ∧ assignment, assignment)
updated_steady_path ← steady_path.add_successor(rule, successor_steady_path)
if updated_steady_path.is_non_spurious() {
queue.push(updated_steady_path)
}
}
}
}
}
}
return "All error paths are spurious"Sourcefn get_all_possible_variable_assignments(
&self,
) -> Vec<SymbolicVariableAssignment>
fn get_all_possible_variable_assignments( &self, ) -> Vec<SymbolicVariableAssignment>
returns all possible variable assignments
Sourcefn compute_reachable_variable_assignments(
&self,
) -> Vec<SymbolicVariableAssignment>
fn compute_reachable_variable_assignments( &self, ) -> Vec<SymbolicVariableAssignment>
computes all reachable variable assignments of the error graph (except for error states)
Sourcefn construct_steady_path(
&self,
sym_state: ZCSStates,
assignment: SymbolicVariableAssignment,
) -> SteadyPath
fn construct_steady_path( &self, sym_state: ZCSStates, assignment: SymbolicVariableAssignment, ) -> SteadyPath
constructs the steady path for a given ‘SymbolicState’ and a ‘SymbolicVariableAssignment’
i.e., it computes all reachable states and possible transitions to stay in the same variable assignment
Note that it only computes reachable states that are not an error state
Sourcepub fn locations(&self) -> impl Iterator<Item = &Location>
pub fn locations(&self) -> impl Iterator<Item = &Location>
returns an iterator over the locations of the underlying threshold automaton
Sourcepub fn variables(&self) -> impl Iterator<Item = &Variable>
pub fn variables(&self) -> impl Iterator<Item = &Variable>
returns an iterator over the shared variables of the underlying threshold automaton
returns an iterator over the ordered intervals for a given shared variable
Trait Implementations§
Source§impl<'a> Clone for ZCSErrorGraph<'a>
impl<'a> Clone for ZCSErrorGraph<'a>
Source§fn clone(&self) -> ZCSErrorGraph<'a>
fn clone(&self) -> ZCSErrorGraph<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for ZCSErrorGraph<'a>
impl<'a> !RefUnwindSafe for ZCSErrorGraph<'a>
impl<'a> !Send for ZCSErrorGraph<'a>
impl<'a> !Sync for ZCSErrorGraph<'a>
impl<'a> Unpin for ZCSErrorGraph<'a>
impl<'a> !UnwindSafe for ZCSErrorGraph<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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