class Z3::BitvecExpr

Defined in:

z3/bitvec_expr.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(expr : LibZ3::Ast, sort : BitvecSort) #

[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) #

[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) #

[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 >>(other) #

[View source]
def ^(other) #

[View source]
def |(other) #

[View source]
def ~ #

[View source]
def abs #

Inherently signed


[View source]
def add_no_overflow?(other) #

[View source]
def add_no_underflow?(other) #

[View source]
def all_bits_set? #

[View source]
def any_bits_set? #

[View source]
def bit(index : Int) #

A single bit, as a Bool. Deliberately not #[] - that would read like #extract with a one-bit range, which gives a Bitvec(1) instead


[View source]
def concat(other : BitvecExpr) #

[View source]
def const? #

[View source]
def div_no_overflow?(other) #

[View source]
def extract(hi : Int, lo : Int) #

[View source]
def inspect(io) #

[View source]
def lshift(other) #

[View source]
def mul_no_overflow?(other) #

[View source]
def mul_no_underflow?(other) #

[View source]
def nand(other) #

[View source]
def neg_no_overflow? #

[View source]
def negative? #

Inherently signed


[View source]
def nonzero? #

[View source]
def nor(other) #

[View source]
def positive? #

Inherently signed


[View source]
def redand #

Z3 answers these with a one-bit Bitvec rather than a Bool, which is what #all_bits_set? and #any_bits_set? are for


[View source]
def redor #

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

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

An Int rotates by a fixed amount, a Bitvec of the same size by whatever it turns out to be - Z3 has a separate operation for each, and the fixed one gives the solver much more to work with, so a literal never goes through the other


[View source]
def rotate_left(n : BitvecExpr) #

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

[View source]
def rotate_right(n : BitvecExpr) #

[View source]
def rshift(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 sign_ext(n : Int) #

[View source]
def signed_add_no_overflow?(other) #

[View source]
def signed_add_no_underflow?(other) #

[View source]
def signed_div(other) #

[View source]
def signed_div_no_overflow?(other) #

[View source]
def signed_ge(other) #

[View source]
def signed_gt(other) #

[View source]
def signed_le(other) #

[View source]
def signed_lshift(other) #

[View source]
def signed_lt(other) #

[View source]
def signed_mod(other) #

[View source]
def signed_mul_no_overflow?(other) #

[View source]
def signed_mul_no_underflow?(other) #

[View source]
def signed_neg_no_overflow? #

[View source]
def signed_rem(other) #

[View source]
def signed_rshift(other) #

[View source]
def signed_sub_no_overflow?(other) #

[View source]
def signed_sub_no_underflow?(other) #

[View source]
def signed_to_i #

[View source]
def signed_value : BigInt #

[View source]
def simplify #

[View source]
def size #

[View source]
def sort : Z3::BitvecSort #

[View source]
def sub_no_overflow?(other) #

Subtraction is addition's mirror image: only signed can overflow, and both signs can underflow - so which of these takes a sign is the other way round


[View source]
def sub_no_underflow?(other) #

[View source]
def to_i #

#to_i and friends build a Z3 Int expression out of this one. #value and friends leave Z3 and give back a Crystal Integer, which only works on a literal. Both come in pairs because a Bitvec carries no sign of its own - the same eight bits are 200 read one way and -56 read the other.


[View source]
def to_s(io) #

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

[View source]
def unsigned_add_no_overflow?(other) #

[View source]
def unsigned_add_no_underflow?(other) #

[View source]
def unsigned_div(other) #

[View source]
def unsigned_div_no_overflow?(other) #

[View source]
def unsigned_ge(other) #

[View source]
def unsigned_gt(other) #

[View source]
def unsigned_le(other) #

[View source]
def unsigned_lshift(other) #

[View source]
def unsigned_lt(other) #

[View source]
def unsigned_mul_no_overflow?(other) #

[View source]
def unsigned_mul_no_underflow?(other) #

[View source]
def unsigned_neg_no_overflow? #

[View source]
def unsigned_rem(other) #

[View source]
def unsigned_rshift(other) #

[View source]
def unsigned_sub_no_overflow?(other) #

[View source]
def unsigned_sub_no_underflow?(other) #

[View source]
def unsigned_to_i #

[View source]
def unsigned_value : BigInt #

Z3 prints a Bitvec numeral as its unsigned value, so this is the one it gives us


[View source]
def value #

[View source]
def xnor(other) #

[View source]
def zero? #

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

[View source]