ZCSErrorGraphBuilder

Struct ZCSErrorGraphBuilder 

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

Source

pub fn new(cs: ZCS<'a>, err_states: ZCSStates) -> Self

creates a new symbolic error graph builder

Source

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

pub fn compute_reachable_initial_states(&mut self)

extracts all initial states that are reached in the error graph

Source

pub fn build(self) -> ZCSErrorGraph<'a>

builds the symbolic error graph

Trait Implementations§

Source§

impl<'a> Debug for ZCSErrorGraphBuilder<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> 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, 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.