class Z3::IntExpr

Defined in:

z3/int_expr.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(expr : LibZ3::Ast) #

[View source]

Instance Method Detail

def !=(other) #
Description copied from class Object

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.


[View source]
def %(other) #

It doesn't match Crystal on a negative right side, but nobody does modulo a negative anyway, and the Python Z3 API does the same thing


[View source]
def *(other) #

[View source]
def **(other) #

[View source]
def +(other) #

[View source]
def -(other) #

[View source]
def - #

[View source]
def /(other) #

[View source]
def <(other) #

[View source]
def <=(other) #

[View source]
def ==(other) #
Description copied from class Reference

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


[View source]
def >(other) #

[View source]
def >=(other) #

[View source]
def abs #

[View source]
def const? #

[View source]
def divisible_by?(other) #

Z3 spells this the other way round, as "other divides self"


[View source]
def inspect(io) #

[View source]
def mod(other) #

[View source]
def negative? #

[View source]
def nonzero? #

[View source]
def positive? #

[View source]
def rem(other) #

[View source]
def 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.


[View source]
def simplify #

[View source]
def sort #

[View source]
def to_big_i : BigInt #

[View source]
def to_bitvec(n : Int) #

[View source]
def to_bv(n : Int) #

Takes the low n bits, so it wraps rather than failing on values which don't fit - Z3.int("a").to_bv(8) of 256 is 0. Which Integer comes back out depends on how you read it again: BitvecExpr#signed_value or #unsigned_value.


[View source]
def to_i : Int32 #

[View source]
def to_i64 : Int64 #

[View source]
def to_real #

[View source]
def to_s(io) #

[View source]
def to_unsafe : LibZ3::Ast #

[View source]
def value : BigInt #

Every sort which can hand back a Crystal object spells it #value. Z3 Ints are unbounded, so this is a BigInt - #to_i is the Int32 one, as everywhere else in Crystal.


[View source]
def zero? #

[View source]