Skip to main content

Model

Struct Model 

Source
pub struct Model<'s, 'ev, B> { /* private fields */ }
Expand description

A model, as parsed from the SMT solver output, contains a list of function declarations (which can have arity 0 for constants) for each declare-const and declare-fun in the model. A model can also be parameterised by a set of events. The two lifetime parameters correspond to the underlying smtlib model 's and the events 'ev.

Implementations§

Source§

impl<'s, 'ev, B: BV> Model<'s, 'ev, B>

Source

pub fn parse(events: &[&'ev str], model: &'s str) -> Option<Self>

Parse a model from a string of the form (model (define-fun …) (define-fun …) …)

Source

pub fn interpret( &mut self, f: &str, args: &[SexpVal<'ev, B>], ) -> Result<SexpVal<'ev, B>, InterpretError>

Interprets a function in the model

Source

pub fn interpret_rel( &mut self, rel: &str, events: &[&'ev str], ) -> Result<Vec<(&'ev str, &'ev str)>, InterpretError>

Inteprets a relation (an Event * Event -> Bool function) over a set of events. Note that all events in this set must have been used to parameterise the model in Model::parse.

Source

pub fn interpret_bits(&mut self, val: &Val<B>) -> Result<B, InterpretError>

Interpret either a bitvector symbol in the model, or just return the bitvector directory if the val is concrete

Auto Trait Implementations§

§

impl<'s, 'ev, B> Freeze for Model<'s, 'ev, B>

§

impl<'s, 'ev, B> RefUnwindSafe for Model<'s, 'ev, B>
where B: RefUnwindSafe,

§

impl<'s, 'ev, B> Send for Model<'s, 'ev, B>
where B: Send,

§

impl<'s, 'ev, B> Sync for Model<'s, 'ev, B>
where B: Sync,

§

impl<'s, 'ev, B> Unpin for Model<'s, 'ev, B>
where B: Unpin,

§

impl<'s, 'ev, B> UnsafeUnpin for Model<'s, 'ev, B>

§

impl<'s, 'ev, B> UnwindSafe for Model<'s, 'ev, B>
where B: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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.