module

Z3::API

Constants

Context = begin context = LibZ3.mk_context(LibZ3.mk_config) LibZ3.set_error_handler(context, ->(_context : LibZ3::Context, _code : LibZ3::ErrorCode) do end) context end

Z3's own error handler prints the message to stderr and lets the failed call hand back a null pointer, so the program carries on with a null AST inside an expression. This one does nothing at all, leaving the error code set for checked to raise on - a Crystal exception can't be thrown out of a C callback and back through Z3's own frames.

Instance methods

add_rec_def(decl, args, body)
Source
app_args(ast)

The arguments of an application, so a term like a == 2 can be taken apart. Anything which isn't an application has no arguments. TODO: this becomes much less ad hoc once we have a real printer

Source
ast_to_string(*args)
Source
const_decl(expr)

The decl of a variable - a in a + 1 - which is what Z3 wants wherever it talks about one. Anything else is a term rather than a variable, and the two calls which take one (set_initial_value, model_has_interp) both mean this.

Source
fpa_get_ebits(*args)
Source
fpa_get_numeral_exponent_bv(*args)
Source
fpa_get_numeral_exponent_string(*args)
Source
fpa_get_numeral_sign_bv(*args)
Source
fpa_get_numeral_significand_bv(*args)
Source
fpa_get_numeral_significand_string(*args)
Source
fpa_get_sbits(*args)
Source
fpa_is_numeral(*args)
Source
fpa_is_numeral_inf(*args)
Source
fpa_is_numeral_nan(*args)
Source
fpa_is_numeral_negative(*args)
Source
fpa_is_numeral_zero(*args)
Source
func_entry_dec_ref(*args)
Source
func_entry_get_arg(*args)
Source
func_entry_get_num_args(*args)
Source
func_entry_get_value(*args)
Source
func_entry_inc_ref(*args)
Source
func_interp_dec_ref(*args)
Source
func_interp_get_arity(*args)
Source
func_interp_get_else(*args)
Source
func_interp_get_entry(*args)
Source
func_interp_get_num_entries(*args)
Source
func_interp_inc_ref(*args)
Source
get_algebraic_number_lower(*args)
Source
get_algebraic_number_upper(*args)
Source
get_app_decl(*args)
Source
get_arity(*args)
Source
get_ast_kind(*args)
Source
get_bool_value(*args)
Source
get_decl_kind(*args)
Source
get_decl_name(decl)
Source
get_domain(*args)
Source
get_numeral_string(*args)
Source
get_range(*args)
Source
get_string(ast)
Source
is_algebraic_number(*args)
Source
is_eq_ast(*args)
Source
is_string(*args)
Source
mk_abs(*args)
Source
mk_add(asts)
Source
mk_and(asts)
Source
mk_app(decl, args)
Source
mk_atleast(asts, k : UInt32)
Source
mk_atmost(asts, k : UInt32)
Source
mk_bit2bool(*args)
Source
mk_bv2int(*args)
Source
mk_bvadd(*args)
Source
mk_bvadd_no_overflow(*args)
Source
mk_bvadd_no_underflow(*args)
Source
mk_bvand(*args)
Source
mk_bvashr(*args)
Source
mk_bvlshr(*args)
Source
mk_bvmul(*args)
Source
mk_bvmul_no_overflow(*args)
Source
mk_bvmul_no_underflow(*args)
Source
mk_bvnand(*args)
Source
mk_bvneg(*args)
Source
mk_bvneg_no_overflow(*args)
Source
mk_bvnor(*args)
Source
mk_bvnot(*args)
Source
mk_bvor(*args)
Source
mk_bvredand(*args)
Source
mk_bvredor(*args)
Source
mk_bvsdiv(*args)
Source
mk_bvsdiv_no_overflow(*args)
Source
mk_bvsge(*args)
Source
mk_bvsgt(*args)
Source
mk_bvshl(*args)
Source
mk_bvsle(*args)
Source
mk_bvslt(*args)
Source
mk_bvsmod(*args)
Source
mk_bvsrem(*args)
Source
mk_bvsub(*args)
Source
mk_bvsub_no_overflow(*args)
Source
mk_bvsub_no_underflow(*args)
Source
mk_bvudiv(*args)
Source
mk_bvuge(*args)
Source
mk_bvugt(*args)
Source
mk_bvule(*args)
Source
mk_bvult(*args)
Source
mk_bvurem(*args)
Source
mk_bvxnor(*args)
Source
mk_bvxor(*args)
Source
mk_char(*args)
Source
mk_char_from_bv(*args)
Source
mk_char_is_digit(*args)
Source
mk_char_le(*args)
Source
mk_char_to_bv(*args)
Source
mk_char_to_int(*args)
Source
mk_concat(*args)
Source
mk_const(name, sort)
Source
mk_distinct(asts)
Source
mk_div(*args)
Source
mk_divides(*args)
Source
mk_eq(*args)
Source
mk_ext_rotate_left(*args)
Source
mk_ext_rotate_right(*args)
Source
mk_extract(*args)
Source
mk_false(*args)
Source
mk_fpa_abs(*args)
Source
mk_fpa_add(*args)
Source
mk_fpa_div(*args)
Source
mk_fpa_eq(*args)
Source
mk_fpa_fma(*args)
Source
mk_fpa_fp(*args)
Source
mk_fpa_geq(*args)
Source
mk_fpa_gt(*args)
Source
mk_fpa_inf(*args)
Source
mk_fpa_is_infinite(*args)
Source
mk_fpa_is_nan(*args)
Source
mk_fpa_is_negative(*args)
Source
mk_fpa_is_normal(*args)
Source
mk_fpa_is_positive(*args)
Source
mk_fpa_is_subnormal(*args)
Source
mk_fpa_is_zero(*args)
Source
mk_fpa_leq(*args)
Source
mk_fpa_lt(*args)
Source
mk_fpa_max(*args)
Source
mk_fpa_min(*args)
Source
mk_fpa_mul(*args)
Source
mk_fpa_nan(*args)
Source
mk_fpa_neg(*args)
Source
mk_fpa_numeral_double(*args)
Source
mk_fpa_rem(*args)
Source
mk_fpa_round_nearest_ties_to_away(*args)
Source
mk_fpa_round_nearest_ties_to_even(*args)
Source
mk_fpa_round_to_integral(*args)
Source
mk_fpa_round_toward_negative(*args)
Source
mk_fpa_round_toward_positive(*args)
Source
mk_fpa_round_toward_zero(*args)
Source
mk_fpa_sort(*args)
Source
mk_fpa_sqrt(*args)
Source
mk_fpa_sub(*args)
Source
mk_fpa_to_fp_bv(*args)
Source
mk_fpa_to_fp_float(*args)
Source
mk_fpa_to_fp_int_real(*args)
Source
mk_fpa_to_fp_real(*args)
Source
mk_fpa_to_fp_signed(*args)
Source
mk_fpa_to_fp_unsigned(*args)
Source
mk_fpa_to_ieee_bv(*args)
Source
mk_fpa_to_real(*args)
Source
mk_fpa_to_sbv(*args)
Source
mk_fpa_to_ubv(*args)
Source
mk_fpa_zero(*args)
Source
mk_fresh_const(prefix : String, sort)
Source
mk_fresh_func_decl(prefix : String, domain : Array(LibZ3::Sort), range : LibZ3::Sort)
Source
mk_func_decl(name : String, domain : Array(LibZ3::Sort), range : LibZ3::Sort)
Source
mk_ge(*args)
Source
mk_gt(*args)
Source
mk_iff(*args)
Source
mk_implies(*args)
Source
mk_int2bv(*args)
Source
mk_int2real(*args)
Source
mk_int_to_str(*args)
Source
mk_is_int(*args)
Source
mk_ite(*args)
Source
mk_le(*args)
Source
mk_lt(*args)
Source
mk_mod(*args)
Source
mk_mul(asts)
Source
mk_ne(a, b)

Not a real Z3 function

Source
mk_not(*args)
Source
mk_numeral(num : Int | BigRational | Float, sort)
Source
mk_optimize(*args)
Source
mk_or(asts)
Source
mk_pbeq(asts, coeffs : Array(Int32), k : Int32)
Source
mk_pbge(asts, coeffs : Array(Int32), k : Int32)
Source
mk_pble(asts, coeffs : Array(Int32), k : Int32)
Source
mk_power(*args)
Source
mk_real2int(*args)
Source
mk_rec_func_decl(name : String, domain : Array(LibZ3::Sort), range : LibZ3::Sort)
Source
mk_rem(*args)
Source
mk_repeat(*args)
Source
mk_rotate_left(*args)
Source
mk_rotate_right(*args)
Source
mk_sbv_to_str(*args)
Source
mk_seq_at(*args)
Source
mk_seq_concat(asts)
Source
mk_seq_contains(*args)
Source
mk_seq_empty(*args)
Source
mk_seq_extract(*args)
Source
mk_seq_index(*args)
Source
mk_seq_last_index(*args)
Source
mk_seq_length(*args)
Source
mk_seq_nth(*args)
Source
mk_seq_prefix(*args)
Source
mk_seq_replace(*args)
Source
mk_seq_replace_all(*args)
Source
mk_seq_suffix(*args)
Source
mk_seq_unit(*args)
Source
mk_sign_ext(*args)
Source
mk_simple_solver(*args)
Source
mk_solver(*args)
Source
mk_solver_for_logic(logic : String)
Source
mk_str_le(*args)
Source
mk_str_lt(*args)
Source
mk_str_to_int(*args)
Source
mk_string_from_code(*args)
Source
mk_string_to_code(*args)
Source
mk_sub(asts)
Source
mk_symbol(name : String)
Source
mk_true(*args)
Source
mk_u32string(code_points : Array(UInt32))

A Z3 string is a sequence of code points, and these two are the only calls which pass one either way without escaping it into ASCII first

Source
mk_ubv_to_str(*args)
Source
mk_unary_minus(*args)
Source
mk_xor(*args)
Source
mk_zero_ext(*args)
Source
model_eval(model, ast, complete)
Source
model_get_const_decl(*args)
Source
model_get_const_interp(model, decl)
Source
model_get_func_decl(*args)
Source
model_get_func_interp(model, decl)

What a model says a function does: the argument lists it had to pin down, and the else branch which answers for every other one.

Source
model_get_num_consts(*args)
Source
model_get_num_funcs(*args)
Source
model_has_interp(*args)
Source
model_inc_ref(*args)
Source
model_to_string(*args)
Source
new_ast_vector(exprs)

A vector we build ourselves, for the calls which take one. It comes back at refcount 1 and the caller has to release_ast_vector it.

Source
new_from_ast_pointer(_ast) : AnyExpr
Source
optimize_assert(*args)
Source
optimize_assert_and_track(*args)
Source
optimize_assert_soft(optimize, expr, weight : String)
Source
optimize_check(target, assumptions)
Source
optimize_from_file(*args)
Source
optimize_from_string(*args)
Source
optimize_get_assertions(*args)
Source
optimize_get_help(*args)
Source
optimize_get_model(*args)
Source
optimize_get_reason_unknown(*args)
Source
optimize_get_statistics(*args)
Source
optimize_get_unsat_core(*args)
Source
optimize_inc_ref(*args)
Source
optimize_maximize(*args)
Source
optimize_minimize(*args)
Source
optimize_pop(*args)
Source
optimize_push(*args)
Source
optimize_set_initial_value(*args)
Source
optimize_to_string(*args)
Source
read_ast_vector(vec)
Source
release_ast_vector(vec)
Source
simplify(*args)
Source
solver_assert(*args)
Source
solver_assert_and_track(*args)
Source
solver_check(*args)
Source
solver_check_assumptions(target, assumptions)
Source
solver_cube(solver, variables, backtrack_level : UInt32)
Source
solver_from_file(*args)
Source
solver_from_string(*args)
Source
solver_get_assertions(*args)
Source
solver_get_consequences(solver, assumptions, variables)

Answers the check result along with the consequences it found, since an :unsat or :unknown means there are none to speak of

Source
solver_get_help(*args)
Source
solver_get_model(*args)
Source
solver_get_non_units(*args)
Source
solver_get_num_scopes(*args)
Source
solver_get_reason_unknown(*args)
Source
solver_get_statistics(*args)
Source
solver_get_trail(*args)
Source
solver_get_units(*args)
Source
solver_get_unsat_core(*args)
Source
solver_inc_ref(*args)
Source
solver_interrupt(*args)
Source
solver_pop(*args)
Source
solver_push(*args)
Source
solver_reset(*args)
Source
solver_set_initial_value(*args)
Source
solver_to_dimacs_string(*args)
Source
solver_to_string(*args)
Source
sort_from_pointer(_sort) : AnySort
Source