module Z3

Defined in:

z3.cr
z3/api.cr
z3/bitvec_expr.cr
z3/bitvec_sort.cr
z3/bool_expr.cr
z3/bool_sort.cr
z3/char_expr.cr
z3/char_sort.cr
z3/int_expr.cr
z3/int_sort.cr
z3/model.cr
z3/range_indexing.cr
z3/real_expr.cr
z3/real_sort.cr
z3/seq_expr.cr
z3/seq_sort.cr
z3/solver.cr
z3/string_expr.cr
z3/string_sort.cr

Constant Summary

VERSION = "0.1.0"

Class Method Summary

Class Method Detail

def self.add(args : Array(IntExpr | Int32)) #

[View source]
def self.add(args : Array(RealExpr)) #

[View source]
def self.and(args : Array(BoolExpr | Bool)) #

[View source]
def self.and(args : Array(BitvecExpr)) #

Bitvec has no n-ary and/or in Z3, so reduce with the bitwise operators.


[View source]
def self.at_least(args : Array(BoolExpr), k : Int32) #

Native cardinality constraint: at least k of the given Bool exprs are true, or at least k units of weight when given {expr, weight} pairs


[View source]
def self.at_least(args : Array(Tuple(BoolExpr, Int32)), k : Int32) #

[View source]
def self.at_most(args : Array(BoolExpr), k : Int32) #

Native cardinality constraint: at most k of the given Bool exprs are true. An {expr, weight} pair list weighs them instead, so Z3.at_most([{a, 3}, {b, 2}], 4) allows either one but not both.

Ruby's z3 spells the weighted form as an expr => weight Hash. Exprs can't be Hash keys here - see the Limitations section of the README.


[View source]
def self.at_most(args : Array(Tuple(BoolExpr, Int32)), k : Int32) #

[View source]
def self.bitvec(name : String, size : UInt32) #

[View source]
def self.bool(name : String) #

[View source]
def self.char(name : String) #

[View source]
def self.distinct(args : Array(IntExpr)) #

[View source]
def self.distinct(args : Array(RealExpr)) #

[View source]
def self.distinct(args : Array(BoolExpr)) #

[View source]
def self.distinct(args : Array(BitvecExpr)) #

[View source]
def self.distinct(args : Array(CharExpr)) #

[View source]
def self.distinct(args : Array(StringExpr)) #

[View source]
def self.distinct(args : Array(SeqExpr)) #

[View source]
def self.exactly(args : Array(BoolExpr), k : Int32) #

Native cardinality constraint: exactly k of the given Bool exprs are true, or exactly k units of weight when given {expr, weight} pairs


[View source]
def self.exactly(args : Array(Tuple(BoolExpr, Int32)), k : Int32) #

[View source]
def self.int(name : String) #

[View source]
def self.mul(args : Array(IntExpr | Int32)) #

[View source]
def self.mul(args : Array(RealExpr)) #

[View source]
def self.or(args : Array(BoolExpr | Bool)) #

[View source]
def self.or(args : Array(BitvecExpr)) #

[View source]
def self.real(name : String) #

[View source]
def self.seq(name : String, element_sort) #

[View source]
def self.string(name : String) #

[View source]
def self.version #

[View source]