Skip to main content

RoundingMode

Struct RoundingMode 

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

Ast node representing a rounding mode for Float operations.

Implementations§

Source§

impl RoundingMode

Source

pub fn round_towards_zero() -> RoundingMode

Create a numeral of RoundingMode sort which represents the TowardZero rounding mode.

Source

pub fn round_towards_negative() -> RoundingMode

Create a numeral of RoundingMode sort which represents the TowardNegative rounding mode.

Source

pub fn round_towards_positive() -> RoundingMode

Create a numeral of RoundingMode sort which represents the TowardPositive rounding mode.

Source

pub fn round_nearest_ties_to_away() -> RoundingMode

Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.

Source

pub fn round_nearest_ties_to_even() -> RoundingMode

Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.

Source

pub fn add<A: Into<Float>, B: IntoAst<Float>>(&self, a: A, b: B) -> Float

Source

pub fn sub<A: Into<Float>, B: IntoAst<Float>>(&self, a: A, b: B) -> Float

Source

pub fn mul<A: Into<Float>, B: IntoAst<Float>>(&self, a: A, b: B) -> Float

Source

pub fn div<A: Into<Float>, B: IntoAst<Float>>(&self, a: A, b: B) -> Float

Source§

impl RoundingMode

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 RoundingMode

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 RoundingMode

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 RoundingMode

Source§

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

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

impl Display for RoundingMode

Source§

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

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

impl Drop for RoundingMode

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<&RoundingMode> for RoundingMode

Source§

fn from(value: &Self) -> Self

Converts to this type from the input type.
Source§

impl From<RoundingMode> for Z3_ast

Source§

fn from(ast: RoundingMode) -> Self

Converts to this type from the input type.
Source§

impl Hash for RoundingMode

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<RoundingMode> + Clone> PartialEq<T> for RoundingMode

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 RoundingMode

Source§

type ModelInstance = RoundingMode

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 Eq for RoundingMode

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.