Skip to main content

Model

Struct Model 

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

Everything the rules are allowed to say, and what each of it means.

Implementations§

Source§

impl Model

Source

pub fn read(path: &str, text: &str) -> Result<Model, Vec<Error>>

Read a model from text.

§Errors

Anything that is not a well formed (semantics (head params) body) form, and any head given a meaning twice.

Source

pub fn write( &self, path: &str, term: &Term, widths: &Widths, ) -> Result<(String, Sort), Error>

Write one term out as SMT-LIB, expanding everything the model defines, and say how wide what it computes is.

§Errors

A head that is neither a builtin nor in the model, since that is a term nobody has said the meaning of, an application of the wrong number of arguments, and anything whose widths do not fit together.

Source

pub fn touches_memory(&self, term: &Term) -> bool

Whether reading this term reaches memory, following every head the model defines.

A rule that reads memory needs a solver told about arrays and a constant to stand for the memory it starts from, and neither is worth putting in a query that does not. Nothing in a rule says (mem) directly: a load says load.i32, and it is the model entry for that head which reaches memory, so this expands what the model says rather than reading the surface.

Trait Implementations§

Source§

impl Debug for Model

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Model

Source§

fn default() -> Model

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Model

§

impl RefUnwindSafe for Model

§

impl Send for Model

§

impl Sync for Model

§

impl Unpin for Model

§

impl UnsafeUnpin for Model

§

impl UnwindSafe for Model

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.