FiniteStateTransitionSystem

Struct FiniteStateTransitionSystem 

Source
pub struct FiniteStateTransitionSystem { /* private fields */ }
Expand description

Struct that describes memory layout of the finite state transition system.

implementations of many additional features can be found in sub-modules.

Implementations§

Source§

impl FiniteStateTransitionSystem

Source

pub fn from_aig(aig: &AndInverterGraph, assume_output_is_bad: bool) -> Self

Function that converts an AndInverterGraph into a FiniteStateTransitionSystem.

§Arguments
  • aig: &AndInverterGraph - the AndInverterGraph desired.
§Examples
use rust_formal_verification::models::{AndInverterGraph, FiniteStateTransitionSystem};
let file_path = "tests/examples/ours/counter.aig";
let aig = AndInverterGraph::from_aig_path(file_path);
let fsts = FiniteStateTransitionSystem::from_aig(&aig, false);
assert_eq!(fsts.get_initial_relation().to_string(), "p cnf 3 3\n-1 0\n-2 0\n-3 0");
Source§

impl FiniteStateTransitionSystem

Source

pub fn add_tags_to_relation( &self, relation: &CNF, number_of_tags: VariableType, ) -> CNF

Source

pub fn add_tags_to_cube( &self, cube: &Cube, number_of_tags: VariableType, ) -> Cube

Source

pub fn add_tags_to_clause( &self, clause: &Clause, number_of_tags: VariableType, ) -> Clause

Source

pub fn is_cube_initial(&self, cube: &Cube) -> bool

Source

pub fn extract_state_from_assignment(&self, assignment: &Assignment) -> Cube

Source

pub fn extract_input_from_assignment(&self, assignment: &Assignment) -> Cube

Source

pub fn intersect_cube_with_cone_of_safety(&self, c: &Cube) -> Cube

Source

pub fn intersect_cube_with_cone_of_transition(&self, c: &Cube) -> Cube

Source

pub fn check_invariant<T: StatelessSatSolver>(&self, inv_candidate: &CNF)

Source§

impl FiniteStateTransitionSystem

Source

pub fn get_max_literal_number(&self) -> VariableType

Source

pub fn get_state_literal_numbers(&self) -> Vec<VariableType>

Source

pub fn get_input_literal_numbers(&self) -> Vec<VariableType>

Source

pub fn get_initial_relation(&self) -> Cube

Source

pub fn get_transition_relation(&self) -> CNF

Function that gets the transition relation for the FiniteStateTransitionSystem.

§Arguments
  • self: &FiniteStateTransitionSystem - the FiniteStateTransitionSystem desired.
§Examples
use rust_formal_verification::models::{AndInverterGraph, FiniteStateTransitionSystem};
use rust_formal_verification::formulas::CNF;
let file_path = "tests/examples/ours/counter.aig";
let aig = AndInverterGraph::from_aig_path(file_path);
let fsts = FiniteStateTransitionSystem::from_aig(&aig, false);
let mut tr_x_x_tag = CNF::default();
let tr_x_x_tag = fsts.get_transition_relation();
assert_eq!(
    tr_x_x_tag.to_string(),
    "p cnf 8 12\n1 -7 0\n-1 -5 0\n-1 7 0\n2 -8 0\n-2 -4 0\n-2 8 0\n-3 -4 0\n4 -5 0\n5 -6 0\n-5 6 0\n1 -4 5 0\n2 3 4 0"
);
Source

pub fn get_state_to_safety_translation(&self) -> CNF

Source

pub fn get_safety_property(&self) -> Cube

Source

pub fn get_unsafety_property(&self) -> Clause

Source§

impl FiniteStateTransitionSystem

Source

pub fn simplify_unsafe_cube_using_trinary_simulation( &self, cube: &Cube, input: &Cube, rng: &mut ThreadRng, ) -> Cube

Source

pub fn simplify_predecessor_cube_using_trinary_simulation( &self, predecessor_cube: &Cube, successor_cube: &Cube, input: &Cube, rng: &mut ThreadRng, ) -> Cube

Trait Implementations§

Source§

impl Clone for FiniteStateTransitionSystem

Source§

fn clone(&self) -> FiniteStateTransitionSystem

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

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> 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<Reference, Outer, OuterFieldType, Inner> HasPart<Nested<Outer, Inner>> for Reference
where Reference: HasPart<Outer> + ?Sized, Outer: Part<PartType = Field<OuterFieldType>>, Inner: Part, OuterFieldType: HasPart<Inner, RawTarget = OuterFieldType> + PartialRefTarget + ?Sized,

Source§

unsafe fn part_ptr( ptr: *const <Reference as PartialRefTarget>::RawTarget, ) -> <<Inner as Part>::PartType as PartType>::Ptr

Given a constant pointer to a target, produce a constant pointer to a part of it. Read more
Source§

unsafe fn part_ptr_mut( ptr: *mut <Reference as PartialRefTarget>::RawTarget, ) -> <<Inner as Part>::PartType as PartType>::PtrMut

Given a mutable pointer to a target, produce a mutable pointer to a part of it. Read more
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
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V