Skip to main content

FloatingPoint

Struct FloatingPoint 

Source
pub struct FloatingPoint<'st, const EB: usize, const SB: usize>(/* private fields */);
Expand description

A floating-point number, parameterized by exponent bits (EB) and significand bits (SB). Significand bits include the sign bit.

Implementations§

Source§

impl<'st, const EB: usize, const SB: usize> FloatingPoint<'st, EB, SB>

Source

pub fn new( st: &'st Storage, value: impl IntoWithStorage<'st, FloatingPoint<'st, EB, SB>>, ) -> FloatingPoint<'st, EB, SB>

Construct a new bit-vec.

Source

pub fn fp<const SB_1: usize>( st: &'st Storage, sign: BitVec<'st, 1>, exponent: BitVec<'st, EB>, significand: BitVec<'st, SB_1>, ) -> Self

Creates a floating-point value from sign, exponent, and significand bit-vectors. i = sb - 1

Note: The SB_1 parameter is a workaround for #![feature(generic_const_exprs)].

Source

pub fn plus_oo(st: &'st Storage) -> Self

Positive infinity

Source

pub fn minus_oo(st: &'st Storage) -> Self

Negative infinity

Source

pub fn plus_zero(st: &'st Storage) -> Self

Positive zero

Source

pub fn minus_zero(st: &'st Storage) -> Self

Negative zero

Source

pub fn nan(st: &'st Storage) -> Self

Not a Number

Source

pub fn fp_abs(self) -> Self

Absolute value (fp.abs)

Source

pub fn fp_neg(self) -> Self

Negation (fp.neg)

Source

pub fn fp_add(self, rm: RoundingMode<'st>, other: Self) -> Self

Addition (fp.add)

Source

pub fn fp_sub(self, rm: RoundingMode<'st>, other: Self) -> Self

Subtraction (fp.sub)

Source

pub fn fp_mul(self, rm: RoundingMode<'st>, other: Self) -> Self

Multiplication (fp.mul)

Source

pub fn fp_div(self, rm: RoundingMode<'st>, other: Self) -> Self

Division (fp.div)

Source

pub fn fp_fma(self, rm: RoundingMode<'st>, other1: Self, other2: Self) -> Self

Fused multiplication and addition: (self * other1) + other2 (fp.fma)

Source

pub fn fp_sqrt(self, rm: RoundingMode<'st>) -> Self

Square root (fp.sqrt)

Source

pub fn fp_rem(self, other: Self) -> Self

Remainder: self - other * n, where n in Z is nearest to self/other (fp.rem)

Source

pub fn fp_round_to_integral(self, rm: RoundingMode<'st>) -> Self

Rounding to integral (fp.roundToIntegral)

Source

pub fn fp_min(self, other: Self) -> Self

Minimum (fp.min)

Source

pub fn fp_max(self, other: Self) -> Self

Maximum (fp.max)

Source

pub fn fp_leq(self, other: Self) -> Bool<'st>

Less than or equal (fp.leq)

Source

pub fn fp_lt(self, other: Self) -> Bool<'st>

Less than (fp.lt)

Source

pub fn fp_geq(self, other: Self) -> Bool<'st>

Greater than or equal (fp.geq)

Source

pub fn fp_gt(self, other: Self) -> Bool<'st>

Greater than (fp.gt)

Source

pub fn fp_eq(self, other: Self) -> Bool<'st>

IEEE 754-2008 equality (fp.eq)

Source

pub fn fp_is_normal(self) -> Bool<'st>

Is normal (fp.isNormal)

Source

pub fn fp_is_subnormal(self) -> Bool<'st>

Is subnormal (fp.isSubnormal)

Source

pub fn fp_is_zero(self) -> Bool<'st>

Is zero (fp.isZero)

Source

pub fn fp_is_infinite(self) -> Bool<'st>

Is infinite (fp.isInfinite)

Source

pub fn fp_is_nan(self) -> Bool<'st>

Is NaN (fp.isNaN)

Source

pub fn fp_is_negative(self) -> Bool<'st>

Is negative (fp.isNegative)

Source

pub fn fp_is_positive(self) -> Bool<'st>

Is positive (fp.isPositive)

Source

pub fn to_fp_from_bits<const M: usize>( st: &'st Storage, bv: BitVec<'st, M>, ) -> Self

From single bitstring representation in IEEE 754-2008 interchange format. M = EB + SB (to_fp)

Source

pub fn to_fp_from_fp<const MB: usize, const NB: usize>( st: &'st Storage, rm: RoundingMode<'st>, fp_other: FloatingPoint<'st, MB, NB>, ) -> Self

From another floating point sort (to_fp)

Source

pub fn to_fp_from_real( st: &'st Storage, rm: RoundingMode<'st>, real: Real<'st>, ) -> Self

From real (to_fp)

Source

pub fn to_fp_from_signed_bit_vec<const M: usize>( st: &'st Storage, rm: RoundingMode<'st>, bv: BitVec<'st, M>, ) -> Self

From signed machine integer, represented as a 2’s complement bit vector (to_fp)

Source

pub fn to_fp_from_unsigned_bit_vec<const M: usize>( st: &'st Storage, rm: RoundingMode<'st>, bv: BitVec<'st, M>, ) -> Self

From unsigned machine integer, represented as bit vector (to_fp_unsigned)

Source

pub fn fp_to_ubv<const M: usize>(self, rm: RoundingMode<'st>) -> BitVec<'st, M>

To unsigned machine integer, represented as a bit vector (fp.to_ubv)

Source

pub fn fp_to_sbv<const M: usize>(self, rm: RoundingMode<'st>) -> BitVec<'st, M>

To signed machine integer, represented as a 2’s complement bit vector (fp.to_sbv)

Source

pub fn fp_to_real(self) -> Real<'st>

To real (fp.to_real)

Trait Implementations§

Source§

impl<'st, const EB: usize, const SB: usize> Clone for FloatingPoint<'st, EB, SB>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'st, const EB: usize, const SB: usize> Copy for FloatingPoint<'st, EB, SB>

Source§

impl<'st, const EB: usize, const SB: usize> Debug for FloatingPoint<'st, EB, SB>

Source§

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

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

impl<const EB: usize, const SB: usize> Display for FloatingPoint<'_, EB, SB>

Source§

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

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

impl<'st, const EB: usize, const SB: usize> From<(STerm<'st>, Sort<'st>)> for FloatingPoint<'st, EB, SB>

Source§

fn from((t, _): (STerm<'st>, Sort<'st>)) -> Self

Converts to this type from the input type.
Source§

impl<'st, const EB: usize, const SB: usize> From<Const<'st, FloatingPoint<'st, EB, SB>>> for FloatingPoint<'st, EB, SB>

Source§

fn from(c: Const<'st, FloatingPoint<'st, EB, SB>>) -> Self

Converts to this type from the input type.
Source§

impl<'st, const EB: usize, const SB: usize> From<FloatingPoint<'st, EB, SB>> for Dynamic<'st>

Source§

fn from(i: FloatingPoint<'st, EB, SB>) -> Self

Converts to this type from the input type.
Source§

impl<'st, const EB: usize, const SB: usize> From<FloatingPoint<'st, EB, SB>> for STerm<'st>

Source§

fn from(i: FloatingPoint<'st, EB, SB>) -> Self

Converts to this type from the input type.
Source§

impl<'st, const EB: usize, const SB: usize> From<STerm<'st>> for FloatingPoint<'st, EB, SB>

Source§

fn from(t: STerm<'st>) -> Self

Converts to this type from the input type.
Source§

impl<'st> IntoWithStorage<'st, FloatingPoint<'st, 8, 24>> for f32

Source§

fn into_with_storage(self, st: &'st Storage) -> Float32<'st>

Construct a STerm with the presence of Storage
Source§

impl<'st> IntoWithStorage<'st, FloatingPoint<'st, 11, 53>> for f64

Source§

fn into_with_storage(self, st: &'st Storage) -> Float64<'st>

Construct a STerm with the presence of Storage
Source§

impl<'st, const EB: usize, const SB: usize> StaticSorted<'st> for FloatingPoint<'st, EB, SB>

Source§

const AST_SORT: Sort<'static>

The sort of this sort.
Source§

type Inner = FloatingPoint<'st, EB, SB>

The inner type of the term. This is used for Const<'st, T> where the inner type is T.
Source§

fn static_st(&self) -> &'st Storage

The storage associated with the term.
Source§

fn sort() -> Sort<'st>

The sort of this sort.
Source§

fn new_const(st: &'st Storage, name: &str) -> Const<'st, Self>

Construct a new constante of this sort.
Source§

impl<'st> TryFrom<FloatingPoint<'st, 8, 24>> for f32

Source§

type Error = ParseIntError

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

fn try_from(value: Float32<'st>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'st> TryFrom<FloatingPoint<'st, 11, 53>> for f64

Source§

type Error = ParseIntError

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

fn try_from(value: Float64<'st>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'st, const EB: usize, const SB: usize> !RefUnwindSafe for FloatingPoint<'st, EB, SB>

§

impl<'st, const EB: usize, const SB: usize> !Send for FloatingPoint<'st, EB, SB>

§

impl<'st, const EB: usize, const SB: usize> !Sync for FloatingPoint<'st, EB, SB>

§

impl<'st, const EB: usize, const SB: usize> !UnwindSafe for FloatingPoint<'st, EB, SB>

§

impl<'st, const EB: usize, const SB: usize> Freeze for FloatingPoint<'st, EB, SB>

§

impl<'st, const EB: usize, const SB: usize> Unpin for FloatingPoint<'st, EB, SB>

§

impl<'st, const EB: usize, const SB: usize> UnsafeUnpin for FloatingPoint<'st, EB, SB>

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> ErasedDestructor for T
where T: 'static,

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<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<'st, T> Sorted<'st> for T
where T: StaticSorted<'st>,

Source§

type Inner = <T as StaticSorted<'st>>::Inner

The inner type of the term. This is used for Const<'st, T> where the inner type is T.
Source§

fn sort(&self) -> Sort<'st>

The sort of the term.
Source§

fn is_sort(sort: Sort<'st>) -> bool

Check if a sort is of this type.
Source§

fn st(&self) -> &'st Storage

The storage associated with any term of this sort.
Source§

fn sterm(self) -> STerm<'st>

Constructy the smtlib AST representation of the term with associated storage.
Source§

fn term(self) -> &'st Term<'st>

Construct the smtlib AST representation of term.
Source§

fn from_dynamic(d: Dynamic<'st>) -> Self
where Self: From<(STerm<'st>, Sort<'st>)>,

Casts a dynamically typed term into a concrete type
Source§

fn try_from_dynamic(d: Dynamic<'st>) -> Option<Self>
where Self: From<(STerm<'st>, Sort<'st>)>,

Casts a dynamically typed term into a concrete type iff the dynamic sort matches
Source§

fn into_dynamic(self) -> Dynamic<'st>

Casts the term into a dynamic term which looses static types and stores the sort dynamically.
Source§

fn _eq(self, other: impl IntoWithStorage<'st, Self::Inner>) -> Bool<'st>

Construct the term representing (= self other)
Source§

fn _neq(self, other: impl IntoWithStorage<'st, Self::Inner>) -> Bool<'st>

Construct the term representing (distinct self other)
Source§

fn labeled(self) -> (Label<Self>, Self::Inner)
where Self::Inner: From<STerm<'st>>,

Wraps the term in a a label, which can be used to extract information from models at a later point.
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, 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.