class

Z3::RealExpr

Inherits Reference < Object

Constructors

new(expr : LibZ3::Ast)
Source

Instance methods

!=(other)

Returns true if this object is not equal to other.

By default this method is implemented as !(self == other) so there's no need to override this unless there's a more efficient way to do it.

Source
*(other)
Source
**(other)
Source
+(other)
Source
-(other)
Source
/(other)
Source
<(other)
Source
<=(other)
Source
==(other)

Returns false (other can only be a Value here).

Source
>(other)
Source
>=(other)
Source
algebraic?

Z3 answers an irrational root with an algebraic number rather than giving up, and those are apps rather than numerals, so #const? won't spot them

Source
const?
Source
floor

SMT-LIB's to_int rounds towards negative infinity, so this is Crystal's Float#floor. Deliberately not #to_i, which truncates towards zero instead - (-2.5).to_i is -2 in Crystal, but this is -3.

Source
inspect(io)
Source
integer?

A Z3 Bool, like #zero? and the other predicates, not a Crystal one

Source
lower_bound(precision = 20) : BigRational

Rationals bracketing the value, as tightly as precision asks for. An exact value is its own bound.

Source
negative?
Source
nonzero?
Source
positive?
Source
same_term?(other : AnyExpr)

Whether this is the same term as other. Z3 hash-conses its expressions, so this is structural equality - Z3.int("a") + 1 built twice is one term. It is a named method rather than == because == builds a Z3 expression instead of answering a Crystal Bool - see the Limitations section of the README.

Source
simplify
Source
sort
Source
to_f

Always available, because a Float is allowed to be approximate

Source
to_int
Source
to_r

There's no #value here, unlike every other sort which can hand back a Crystal object. Z3's Reals include the algebraic numbers, and √2 has no exact Crystal equivalent at all - so instead there's #to_r, which is exact and refuses when it can't be, and #to_f, which is an approximation and says so by being a Float64.

Source
to_s(io)
Source
to_unsafe
Source
upper_bound(precision = 20) : BigRational
Source
zero?
Source