ZCSErrorGraph

Struct ZCSErrorGraph 

Source
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: ZCSStates

set 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: ZCSStates

set of reached initial states of the error graph

§cs: ZCS<'a>

underlying 01-CS (ZCS)

Implementations§

Source§

impl ZCSErrorGraph<'_>

Source

pub fn is_empty(&self) -> bool

checks if an initial state has been reached

Source

pub fn initial_states(&self) -> ZCSStates

reachable initial_states

Source

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

Source

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

Source

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

Source

pub fn get_sym_state_for_loc(&self, loc: &Location) -> ZCSStates

returns the set of states where a given location is occupied

Source

pub fn get_sym_state_for_shared_interval( &self, shared: &Variable, interval: &Interval, ) -> ZCSStates

returns the set of states where the given shared variable is in the given interval

Source

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

Source

pub fn transitions(&self) -> impl Iterator<Item = &SymbolicTransition>

returns an iterator over the encoded transition rules in the underlying 01-cs

Source

pub fn new_empty_sym_state(&self) -> ZCSStates

returns a new empty Symbolic State

Source

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"
Source

fn get_all_possible_variable_assignments( &self, ) -> Vec<SymbolicVariableAssignment>

returns all possible variable assignments

Source

fn compute_reachable_variable_assignments( &self, ) -> Vec<SymbolicVariableAssignment>

computes all reachable variable assignments of the error graph (except for error states)

Source

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

Source

pub fn locations(&self) -> impl Iterator<Item = &Location>

returns an iterator over the locations of the underlying threshold automaton

Source

pub fn variables(&self) -> impl Iterator<Item = &Variable>

returns an iterator over the shared variables of the underlying threshold automaton

Source

pub fn get_ordered_intervals_for_shared( &self, shared: &Variable, ) -> &Vec<Interval>

returns an iterator over the ordered intervals for a given shared variable

Trait Implementations§

Source§

impl<'a> Clone for ZCSErrorGraph<'a>

Source§

fn clone(&self) -> ZCSErrorGraph<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ZCSErrorGraph<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.