Skip to main content

Dynamic

Struct Dynamic 

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

A dynamically typed Ast node.

Implementations§

Source§

impl Dynamic

Source

pub fn from_ast(ast: &dyn Ast) -> Self

Source

pub fn new_const<S: Into<Symbol>>(name: S, sort: &Sort) -> Self

Source

pub fn fresh_const(prefix: &str, sort: &Sort) -> Self

Source

pub fn sort_kind(&self) -> SortKind

Source

pub fn as_bool(&self) -> Option<Bool>

Returns None if the Dynamic is not actually a Bool

Source

pub fn as_int(&self) -> Option<Int>

Returns None if the Dynamic is not actually an Int

Source

pub fn as_real(&self) -> Option<Real>

Returns None if the Dynamic is not actually a Real

Source

pub fn as_float(&self) -> Option<Float>

Returns None if the Dynamic is not actually a Float

Source

pub fn as_string(&self) -> Option<String>

Returns None if the Dynamic is not actually a String

Source

pub fn as_bv(&self) -> Option<BV>

Returns None if the Dynamic is not actually a BV

Source

pub fn as_array(&self) -> Option<Array>

Returns None if the Dynamic is not actually an Array

Source

pub fn as_set(&self) -> Option<Set>

Returns None if the Dynamic is not actually a Set

Source

pub fn as_seq(&self) -> Option<Seq>

Returns None if the Dynamic is not actually a Seq.

Source

pub fn as_datatype(&self) -> Option<Datatype>

Returns None if the Dynamic is not actually a Datatype

Source§

impl Dynamic

Source

pub fn ast_eq<T: IntoAst<Self>>(&self, other: T) -> bool
where Self: Sized,

Source

pub fn _eq<T: IntoAst<Self>>(&self, other: T) -> Bool
where Self: Sized,

👎Deprecated: Please use eq instead
Source

pub fn ne<T: IntoAst<Self>>(&self, other: T) -> Bool
where Self: Sized,

Source

pub fn eq<T: IntoAst<Self>>(&self, other: T) -> Bool
where Self: Sized,

Compare this Ast with another Ast, and get a Bool representing the result.

This operation works with all possible Asts (int, real, BV, etc), but the two Asts being compared must be the same type.

Source

pub fn _safe_eq<T: IntoAst<Self>>(&self, other: T) -> Result<Bool, SortDiffers>
where Self: Sized,

👎Deprecated: Please use safe_eq instead
Source

pub fn safe_eq<T: IntoAst<Self>>(&self, other: T) -> Result<Bool, SortDiffers>
where Self: Sized,

Compare this Ast with another Ast, and get a Result. Errors if the sort does not match for the two values.

Trait Implementations§

Source§

impl Ast for Dynamic

Source§

unsafe fn wrap(ctx: &Context, ast: Z3_ast) -> Self

Wrap a raw Z3_ast. Read more
Source§

fn eq<T: IntoAst<Self>>(&self, other: T) -> Bool
where Self: Sized,

Source§

fn ne<T: IntoAst<Self>>(&self, other: T) -> Bool
where Self: Sized,

Source§

fn get_ctx(&self) -> &Context

Source§

fn get_z3_ast(&self) -> Z3_ast

Source§

fn distinct(values: &[impl Borrow<Self>]) -> Bool
where Self: Sized,

Compare this Ast with a list of other Asts, and get a Bool which is true only if all arguments (including Self) are pairwise distinct. Read more
Source§

fn get_sort(&self) -> Sort

Get the Sort of the Ast.
Source§

fn simplify(&self) -> Self
where Self: Sized,

Simplify the Ast. Returns a new Ast which is equivalent, but simplified using algebraic simplification rules, such as constant propagation.
Source§

fn substitute<T: Ast>(&self, substitutions: &[(&T, &T)]) -> Self
where Self: Sized,

Performs substitution on the Ast. The slice substitutions contains a list of pairs with a “from” Ast that will be substituted by a “to” Ast.
Source§

fn num_children(&self) -> usize

Return the number of children of this Ast. Read more
Source§

fn nth_child(&self, idx: usize) -> Option<Dynamic>

Return the nth child of this Ast. Read more
Source§

fn children(&self) -> Vec<Dynamic>

Return the children of this node as a Vec<Dynamic>.
Source§

fn kind(&self) -> AstKind

Return the AstKind for this Ast.
Source§

fn is_app(&self) -> bool

Return true if this is a Z3 function application. Read more
Source§

fn is_const(&self) -> bool

Return true if this is a Z3 constant. Read more
Source§

fn decl(&self) -> FuncDecl

Return the FuncDecl of the Ast. Read more
Source§

fn safe_decl(&self) -> Result<FuncDecl, IsNotApp>

Source§

fn check_ctx(&self, ctx: &Context)

Source§

impl Clone for Dynamic

Source§

fn clone(&self) -> Self

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

impl Debug for Dynamic

Source§

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

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

impl Display for Dynamic

Source§

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

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

impl Drop for Dynamic

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<&Array> for Dynamic

Source§

fn from(ast: &Array) -> Self

Converts to this type from the input type.
Source§

impl From<&BV> for Dynamic

Source§

fn from(ast: &BV) -> Self

Converts to this type from the input type.
Source§

impl From<&Bool> for Dynamic

Source§

fn from(ast: &Bool) -> Self

Converts to this type from the input type.
Source§

impl From<&Datatype> for Dynamic

Source§

fn from(ast: &Datatype) -> Self

Converts to this type from the input type.
Source§

impl From<&Dynamic> for Dynamic

Source§

fn from(value: &Self) -> Self

Converts to this type from the input type.
Source§

impl From<&Float> for Dynamic

Source§

fn from(ast: &Float) -> Self

Converts to this type from the input type.
Source§

impl From<&Int> for Dynamic

Source§

fn from(ast: &Int) -> Self

Converts to this type from the input type.
Source§

impl From<&Real> for Dynamic

Source§

fn from(ast: &Real) -> Self

Converts to this type from the input type.
Source§

impl From<&Seq> for Dynamic

Source§

fn from(ast: &Seq) -> Self

Converts to this type from the input type.
Source§

impl From<&Set> for Dynamic

Source§

fn from(ast: &Set) -> Self

Converts to this type from the input type.
Source§

impl From<&String> for Dynamic

Source§

fn from(ast: &String) -> Self

Converts to this type from the input type.
Source§

impl From<Array> for Dynamic

Source§

fn from(ast: Array) -> Self

Converts to this type from the input type.
Source§

impl From<BV> for Dynamic

Source§

fn from(ast: BV) -> Self

Converts to this type from the input type.
Source§

impl From<Bool> for Dynamic

Source§

fn from(ast: Bool) -> Self

Converts to this type from the input type.
Source§

impl From<Datatype> for Dynamic

Source§

fn from(ast: Datatype) -> Self

Converts to this type from the input type.
Source§

impl From<Dynamic> for Z3_ast

Source§

fn from(ast: Dynamic) -> Self

Converts to this type from the input type.
Source§

impl From<Float> for Dynamic

Source§

fn from(ast: Float) -> Self

Converts to this type from the input type.
Source§

impl From<Int> for Dynamic

Source§

fn from(ast: Int) -> Self

Converts to this type from the input type.
Source§

impl From<Real> for Dynamic

Source§

fn from(ast: Real) -> Self

Converts to this type from the input type.
Source§

impl From<Seq> for Dynamic

Source§

fn from(ast: Seq) -> Self

Converts to this type from the input type.
Source§

impl From<Set> for Dynamic

Source§

fn from(ast: Set) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Dynamic

Source§

fn from(ast: String) -> Self

Converts to this type from the input type.
Source§

impl Hash for Dynamic

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: IntoAst<Dynamic> + Clone> PartialEq<T> for Dynamic

Source§

fn eq(&self, other: &T) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Solvable for Dynamic

Source§

type ModelInstance = Dynamic

The type to be extracted from the Solver’s Model. Read more
Source§

fn read_from_model( &self, model: &Model, model_completion: bool, ) -> Option<Self::ModelInstance>

Defines how to derive data derived from the implementing type (usually just a Self) and a given Model. Read more
Source§

fn generate_constraint(&self, model: &Self::ModelInstance) -> Bool

Produce a Bool assertion ruling out the given model from the valuation of self. Read more
Source§

impl TryFrom<Dynamic> for Array

Source§

type Error = String

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

fn try_from(ast: Dynamic) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<Dynamic> for BV

Source§

type Error = String

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

fn try_from(ast: Dynamic) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<Dynamic> for Bool

Source§

type Error = String

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

fn try_from(ast: Dynamic) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<Dynamic> for Datatype

Source§

type Error = String

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

fn try_from(ast: Dynamic) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<Dynamic> for Float

Source§

type Error = String

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

fn try_from(ast: Dynamic) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<Dynamic> for Int

Source§

type Error = String

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

fn try_from(ast: Dynamic) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<Dynamic> for Real

Source§

type Error = String

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

fn try_from(ast: Dynamic) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<Dynamic> for Seq

Source§

type Error = String

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

fn try_from(ast: Dynamic) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<Dynamic> for Set

Source§

type Error = String

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

fn try_from(ast: Dynamic) -> Result<Self, String>

Performs the conversion.
Source§

impl TryFrom<Dynamic> for String

Source§

type Error = String

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

fn try_from(ast: Dynamic) -> Result<Self, String>

Performs the conversion.
Source§

impl Eq for Dynamic

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<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, A> IntoAst<A> for T
where T: Into<A>, A: Ast,

Source§

fn into_ast(self, _a: &A) -> A

Source§

impl<T> PrepareSynchronized for T
where T: Translate,

Source§

type Inner = T

Source§

fn synchronized(&self) -> Synchronized<<T as PrepareSynchronized>::Inner>

Creates a thread-safe wrapper that is both Send and Sync. 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> Translate for T
where T: Ast,

Source§

fn translate(&self, dest: &Context) -> T

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.