Struct Fun

Source
pub struct Fun<'st> {
    pub st: &'st Storage,
    pub name: &'st str,
    pub vars: &'st [Sort<'st>],
    pub return_sort: Sort<'st>,
}
Expand description

A function declaration.

Fields§

§st: &'st Storage

smtlib storage

§name: &'st str

The name of the function.

§vars: &'st [Sort<'st>]

The sorts of the arguments.

§return_sort: Sort<'st>

The sort of the return value.

Implementations§

Source§

impl<'st> Fun<'st>

Source

pub fn new( st: &'st Storage, name: impl Into<String>, vars: Vec<Sort<'st>>, return_ty: Sort<'st>, ) -> Self

Create a new function declaration.

Source

pub fn call(&self, args: &[Dynamic<'st>]) -> Result<Dynamic<'st>, Error>

Call the function with the given arguments.

The arguments must be sorted in the same order as the function declaration and checked for both arity and sort.

Source

pub fn ast(&self) -> FunctionDec<'_>

Get the lowlevel AST representation of the function declaration.

Trait Implementations§

Source§

impl<'st> Debug for Fun<'st>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'st> Freeze for Fun<'st>

§

impl<'st> !RefUnwindSafe for Fun<'st>

§

impl<'st> !Send for Fun<'st>

§

impl<'st> !Sync for Fun<'st>

§

impl<'st> Unpin for Fun<'st>

§

impl<'st> !UnwindSafe for Fun<'st>

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

impl<'st, T> IntoWithStorage<'st, T> for T

Source§

fn into_with_storage(self, _st: &'st Storage) -> T

Construct a STerm with the presence of Storage
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.