Home Docs Download Mail FAQ Awards Status MSR

Z3 An Efficient SMT Solver

C API


Types

Most of the types in the C API are opaque pointers.

  • Z3_config: a configuration object used to initialize logical contexts.
  • Z3_context: logical context. This is the main Z3 data-structure.
  • Z3_symbol: a Lisp-link symbol. It is used to name types, constants, and functions. A symbol can be created using string or integers.
  • Z3_ast: abstract syntax tree node. That is, the data-structure used in Z3 to represent terms, formulas and types.
  • Z3_sort: a kind of AST used to represent types.
  • Z3_app: a kind of AST used to represent constant and function declarations.
  • Z3_pattern: a kind of AST used to represent pattern and multi-patterns used to guide quantifier instantiation.
  • Z3_model: a model for the constraints asserted into the logical context.


enum  Z3_lbool
 Lifted Boolean type: false, undefined, true. More...
enum  Z3_symbol_kind
 In Z3, a symbol can be represented using integers and strings (See Z3_get_symbol_kind). More...
enum  Z3_parameter_kind
 The different kinds of parameters that can be associated with function symbols. More...
enum  Z3_sort_kind
 The different kinds of Z3 types (See Z3_get_sort_kind). More...
enum  Z3_ast_kind
 The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types. More...
enum  Z3_decl_kind
 The different kinds of interpreted function kinds. More...
enum  Z3_search_failure
 The different kinds of search failure types. More...
enum  Z3_ast_print_mode
 Z3 pretty printing modes (See Z3_set_ast_print_mode). More...
enum  Z3_error_code
 Z3 error codes (See Z3_get_error_code). More...
typedef int Z3_bool
 Z3 Boolean type. It is just an alias for int.
typedef const char * Z3_string
 Z3 string type. It is just an alias for const char *.
typedef void Z3_error_handler (Z3_error_code e)
 Z3 custom error handler (See Z3_set_error_handler).
#define Z3_TRUE   1
 True value. It is just an alias for 1.
#define Z3_FALSE   0
 False value. It is just an alias for 0.

Create configuration

Z3_config Z3_API Z3_mk_config ()
 Create a configuration.
void Z3_API Z3_del_config (__in Z3_config c)
 Delete the given configuration object.
void Z3_API Z3_set_param_value (__in Z3_config c, __in_z Z3_string param_id, __in_z Z3_string param_value)
 Set a configuration parameter.

Create context

Z3_context Z3_API Z3_mk_context (__in Z3_config c)
 Create a logical context using the given configuration.
void Z3_API Z3_del_context (__in Z3_context c)
 Delete the given logical context.
Z3_bool Z3_API Z3_trace_to_file (__in Z3_context c, __in_z Z3_string trace_file)
 Enable trace messages to a file.
void Z3_API Z3_trace_to_stderr (__in Z3_context c)
 Enable trace messages to a standard error.
void Z3_API Z3_trace_to_stdout (__in Z3_context c)
 Enable trace messages to a standard output.
void Z3_API Z3_trace_off (__in Z3_context c)
 Disable trace messages.

Symbols

Z3_symbol Z3_API Z3_mk_int_symbol (__in Z3_context c, __in int i)
 Create a Z3 symbol using an integer.
Z3_symbol Z3_API Z3_mk_string_symbol (__in Z3_context c, __in_z Z3_string s)
 Create a Z3 symbol using a C string.

Sorts

Z3_bool Z3_API Z3_is_eq_sort (__in Z3_context c, __in Z3_sort s1, __in Z3_sort s2)
 compare sorts.
Z3_sort Z3_API Z3_mk_uninterpreted_sort (__in Z3_context c, __in Z3_symbol s)
 Create a free (uninterpreted) type using the given name (symbol).
Z3_sort Z3_API Z3_mk_bool_sort (__in Z3_context c)
 Create the Boolean type.
Z3_sort Z3_API Z3_mk_int_sort (__in Z3_context c)
 Create an integer type.
Z3_sort Z3_API Z3_mk_real_sort (__in Z3_context c)
 Create a real type.
Z3_sort Z3_API Z3_mk_bv_sort (__in Z3_context c, __in unsigned sz)
 Create a bit-vector type of the given size.
Z3_sort Z3_API Z3_mk_array_sort (__in Z3_context c, __in Z3_sort domain, __in Z3_sort range)
 Create an array type.
Z3_sort Z3_API Z3_mk_tuple_sort (__in Z3_context c, __in Z3_symbol mk_tuple_name, __in unsigned num_fields, __in_ecount(num_fields) Z3_symbol const field_names[], __in_ecount(num_fields) Z3_sort const field_sorts[], __out Z3_func_decl *mk_tuple_decl, __out_ecount(num_fields) Z3_func_decl proj_decl[])
 Create a tuple type.
Z3_sort Z3_API Z3_mk_enumeration_sort (__in Z3_context c, __in Z3_symbol name, __in unsigned n, __in_ecount(n) Z3_symbol const enum_names[], __out_ecount(n) Z3_func_decl enum_consts[], __out_ecount(n) Z3_func_decl enum_testers[])
 Create a enumeration sort.
Z3_sort Z3_API Z3_mk_list_sort (__in Z3_context c, __in Z3_symbol name, __in Z3_sort elem_sort, __out Z3_func_decl *nil_decl, __out Z3_func_decl *is_nil_decl, __out Z3_func_decl *cons_decl, __out Z3_func_decl *is_cons_decl, __out Z3_func_decl *head_decl, __out Z3_func_decl *tail_decl)
 Create a list sort.
Z3_constructor Z3_API Z3_mk_constructor (__in Z3_context c, __in Z3_symbol name, __in Z3_symbol recognizer, __in unsigned num_fields, __in_ecount(num_fields) Z3_symbol const field_names[], __in_ecount(num_fields) Z3_sort const sorts[], __in_ecount(num_fields) unsigned sort_refs[])
 Create a constructor.
void Z3_API Z3_query_constructor (__in Z3_context c, __in Z3_constructor constr, __in unsigned num_fields, __out Z3_func_decl *constructor, __out Z3_func_decl *tester, __out_ecount(num_fields) Z3_func_decl accessors[])
 Query constructor for declared funcions.
void Z3_API Z3_del_constructor (__in Z3_context c, __in Z3_constructor constr)
 Reclaim memory allocated to constructor.
Z3_sort Z3_API Z3_mk_datatype (__in Z3_context c, __in Z3_symbol name, __in unsigned num_constructors, __inout_ecount(num_constructors) Z3_constructor constructors[])
 Create recursive datatype. Return the datatype sort.
Z3_constructor_list Z3_API Z3_mk_constructor_list (__in Z3_context c, __in unsigned num_constructors, __in_ecount(num_constructors) Z3_constructor constructors[])
 Create list of constructors.
void Z3_API Z3_del_constructor_list (__in Z3_context c, __in Z3_constructor_list clist)
 reclaim memory allocated for constructor list.
void Z3_API Z3_mk_datatypes (__in Z3_context c, __in unsigned num_sorts, __in_ecount(num_sorts) Z3_symbol sort_names[], __out_ecount(num_sorts) Z3_sort sorts[], __inout_ecount(num_sorts) Z3_constructor_list constructor_lists[])
 Create mutually recursive datatypes.

Injective functions

Z3_func_decl Z3_API Z3_mk_injective_function (__in Z3_context c, __in Z3_symbol s, unsigned domain_size, __in_ecount(domain_size) Z3_sort const domain[], __in Z3_sort range)
 Create injective function declaration.

Constants and Applications

Z3_bool Z3_API Z3_is_eq_ast (__in Z3_context c, __in Z3_ast t1, Z3_ast t2)
 compare terms.
Z3_func_decl Z3_API Z3_mk_func_decl (__in Z3_context c, __in Z3_symbol s, __in unsigned domain_size, __in_ecount(domain_size) Z3_sort const domain[], __in Z3_sort range)
 Declare a constant or function.
Z3_ast Z3_API Z3_mk_app (__in Z3_context c, __in Z3_func_decl d, __in unsigned num_args, __in_ecount(num_args) Z3_ast const args[])
 Create a constant or function application.
Z3_ast Z3_API Z3_mk_const (__in Z3_context c, __in Z3_symbol s, __in Z3_sort ty)
 Declare and create a constant.
Z3_ast Z3_API Z3_mk_label (__in Z3_context c, __in Z3_symbol s, Z3_bool is_pos, Z3_ast f)
 Create a labeled formula.
Z3_func_decl Z3_API Z3_mk_fresh_func_decl (__in Z3_context c, __in_z Z3_string prefix, __in unsigned domain_size, __in_ecount(domain_size) Z3_sort const domain[], __in Z3_sort range)
 Declare a fresh constant or function.
Z3_ast Z3_API Z3_mk_fresh_const (__in Z3_context c, __in_z Z3_string prefix, __in Z3_sort ty)
 Declare and create a fresh constant.
Z3_ast Z3_API Z3_mk_true (__in Z3_context c)
 Create an AST node representing true.
Z3_ast Z3_API Z3_mk_false (__in Z3_context c)
 Create an AST node representing false.
Z3_ast Z3_API Z3_mk_eq (__in Z3_context c, __in Z3_ast l, __in Z3_ast r)
 Create an AST node representing l = r.
Z3_ast Z3_API Z3_mk_distinct (__in Z3_context c, __in unsigned num_args, __in_ecount(num_args) Z3_ast const args[])
 Create an AST node representing distinct(args[0], ..., args[num_args-1]).
Z3_ast Z3_API Z3_mk_not (__in Z3_context c, __in Z3_ast a)
 Create an AST node representing not(a).
Z3_ast Z3_API Z3_mk_ite (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2, __in Z3_ast t3)
 Create an AST node representing an if-then-else: ite(t1, t2, t3).
Z3_ast Z3_API Z3_mk_iff (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Create an AST node representing t1 iff t2.
Z3_ast Z3_API Z3_mk_implies (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Create an AST node representing t1 implies t2.
Z3_ast Z3_API Z3_mk_xor (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Create an AST node representing t1 xor t2.
Z3_ast Z3_API Z3_mk_and (__in Z3_context c, __in unsigned num_args, __in_ecount(num_args) Z3_ast const args[])
 Create an AST node representing args[0] and ... and args[num_args-1].
Z3_ast Z3_API Z3_mk_or (__in Z3_context c, __in unsigned num_args, __in_ecount(num_args) Z3_ast const args[])
 Create an AST node representing args[0] or ... or args[num_args-1].
Z3_ast Z3_API Z3_mk_add (__in Z3_context c, __in unsigned num_args, __in_ecount(num_args) Z3_ast const args[])
 Create an AST node representing args[0] + ... + args[num_args-1].
Z3_ast Z3_API Z3_mk_mul (__in Z3_context c, __in unsigned num_args, __in_ecount(num_args) Z3_ast const args[])
 Create an AST node representing args[0] * ... * args[num_args-1].
Z3_ast Z3_API Z3_mk_sub (__in Z3_context c, __in unsigned num_args, __in_ecount(num_args) Z3_ast const args[])
 Create an AST node representing args[0] - ... - args[num_args - 1].
Z3_ast Z3_API Z3_mk_unary_minus (__in Z3_context c, __in Z3_ast arg)
 Create an AST node representing -arg.
Z3_ast Z3_API Z3_mk_div (__in Z3_context c, __in Z3_ast arg1, __in Z3_ast arg2)
 Create an AST node representing arg1 div arg2.
Z3_ast Z3_API Z3_mk_mod (__in Z3_context c, __in Z3_ast arg1, __in Z3_ast arg2)
 Create an AST node representing arg1 mod arg2.
Z3_ast Z3_API Z3_mk_rem (__in Z3_context c, __in Z3_ast arg1, __in Z3_ast arg2)
 Create an AST node representing arg1 rem arg2.
Z3_ast Z3_API Z3_mk_lt (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Create less than.
Z3_ast Z3_API Z3_mk_le (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Create less than or equal to.
Z3_ast Z3_API Z3_mk_gt (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Create greater than.
Z3_ast Z3_API Z3_mk_ge (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Create greater than or equal to.
Z3_ast Z3_API Z3_mk_int2real (__in Z3_context c, __in Z3_ast t1)
 Coerce an integer to a real.
Z3_ast Z3_API Z3_mk_bvnot (__in Z3_context c, __in Z3_ast t1)
 Bitwise negation.
Z3_ast Z3_API Z3_mk_bvand (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Bitwise and.
Z3_ast Z3_API Z3_mk_bvor (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Bitwise or.
Z3_ast Z3_API Z3_mk_bvxor (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Bitwise exclusive-or.
Z3_ast Z3_API Z3_mk_bvnand (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Bitwise nand.
Z3_ast Z3_API Z3_mk_bvnor (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Bitwise nor.
Z3_ast Z3_API Z3_mk_bvxnor (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Bitwise xnor.
Z3_ast Z3_API Z3_mk_bvneg (__in Z3_context c, __in Z3_ast t1)
 Standard two's complement unary minus.
Z3_ast Z3_API Z3_mk_bvadd (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Standard two's complement addition.
Z3_ast Z3_API Z3_mk_bvsub (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Standard two's complement subtraction.
Z3_ast Z3_API Z3_mk_bvmul (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Standard two's complement multiplication.
Z3_ast Z3_API Z3_mk_bvudiv (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Unsigned division.
Z3_ast Z3_API Z3_mk_bvsdiv (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Two's complement signed division.
Z3_ast Z3_API Z3_mk_bvurem (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Unsigned remainder.
Z3_ast Z3_API Z3_mk_bvsrem (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Two's complement signed remainder (sign follows dividend).
Z3_ast Z3_API Z3_mk_bvsmod (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Two's complement signed remainder (sign follows divisor).
Z3_ast Z3_API Z3_mk_bvult (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Unsigned less than.
Z3_ast Z3_API Z3_mk_bvslt (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Two's complement signed less than.
Z3_ast Z3_API Z3_mk_bvule (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Unsigned less than or equal to.
Z3_ast Z3_API Z3_mk_bvsle (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Two's complement signed less than or equal to.
Z3_ast Z3_API Z3_mk_bvuge (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Unsigned greater than or equal to.
Z3_ast Z3_API Z3_mk_bvsge (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Two's complement signed greater than or equal to.
Z3_ast Z3_API Z3_mk_bvugt (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Unsigned greater than.
Z3_ast Z3_API Z3_mk_bvsgt (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Two's complement signed greater than.
Z3_ast Z3_API Z3_mk_concat (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Concatenate the given bit-vectors.
Z3_ast Z3_API Z3_mk_extract (__in Z3_context c, __in unsigned high, __in unsigned low, __in Z3_ast t1)
 Extract the bits high down to low from a bitvector of size m to yield a new bitvector of size n, where n = high - low + 1.
Z3_ast Z3_API Z3_mk_sign_ext (__in Z3_context c, __in unsigned i, __in Z3_ast t1)
 Sign-extend of the given bit-vector to the (signed) equivalent bitvector of size m+i, where m is the size of the given bit-vector.
Z3_ast Z3_API Z3_mk_zero_ext (__in Z3_context c, __in unsigned i, __in Z3_ast t1)
 Extend the given bit-vector with zeros to the (unsigned) equivalent bitvector of size m+i, where m is the size of the given bit-vector.
Z3_ast Z3_API Z3_mk_bvshl (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Shift left.
Z3_ast Z3_API Z3_mk_bvlshr (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Logical shift right.
Z3_ast Z3_API Z3_mk_bvashr (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Arithmetic shift right.
Z3_ast Z3_API Z3_mk_rotate_left (__in Z3_context c, __in unsigned i, __in Z3_ast t1)
 Rotate bits of t1 to the left i times.
Z3_ast Z3_API Z3_mk_rotate_right (__in Z3_context c, __in unsigned i, __in Z3_ast t1)
 Rotate bits of t1 to the right i times.
Z3_ast Z3_API Z3_mk_int2bv (__in Z3_context c, __in unsigned n, __in Z3_ast t1)
 Create an n bit bit-vector from the integer argument t1.
Z3_ast Z3_API Z3_mk_bv2int (__in Z3_context c, __in Z3_ast t1, Z3_bool is_signed)
 Create an integer from the bit-vector argument t1. If is_signed is false, then the bit-vector t1 is treated as unsigned. So the result is non-negative and in the range [0..2^N-1], where N are the number of bits in t1. If is_signed is true, t1 is treated as a signed bit-vector.
Z3_ast Z3_API Z3_mk_bvadd_no_overflow (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2, Z3_bool is_signed)
 Create a predicate that checks that the bit-wise addition of t1 and t2 does not overflow.
Z3_ast Z3_API Z3_mk_bvadd_no_underflow (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Create a predicate that checks that the bit-wise signed addition of t1 and t2 does not underflow.
Z3_ast Z3_API Z3_mk_bvsub_no_overflow (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Create a predicate that checks that the bit-wise signed subtraction of t1 and t2 does not overflow.
Z3_ast Z3_API Z3_mk_bvsub_no_underflow (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2, Z3_bool is_signed)
 Create a predicate that checks that the bit-wise subtraction of t1 and t2 does not underflow.
Z3_ast Z3_API Z3_mk_bvsdiv_no_overflow (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Create a predicate that checks that the bit-wise signed division of t1 and t2 does not overflow.
Z3_ast Z3_API Z3_mk_bvneg_no_overflow (__in Z3_context c, __in Z3_ast t1)
 Check that bit-wise negation does not overflow when t1 is interpreted as a signed bit-vector.
Z3_ast Z3_API Z3_mk_bvmul_no_overflow (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2, Z3_bool is_signed)
 Create a predicate that checks that the bit-wise multiplication of t1 and t2 does not overflow.
Z3_ast Z3_API Z3_mk_bvmul_no_underflow (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Create a predicate that checks that the bit-wise signed multiplication of t1 and t2 does not underflow.
Z3_ast Z3_API Z3_mk_select (__in Z3_context c, __in Z3_ast a, __in Z3_ast i)
 Array read.
Z3_ast Z3_API Z3_mk_store (__in Z3_context c, __in Z3_ast a, __in Z3_ast i, __in Z3_ast v)
 Array update.
Z3_ast Z3_API Z3_mk_const_array (__in Z3_context c, __in Z3_sort domain, __in Z3_ast v)
 Create the constant array.
Z3_ast Z3_API Z3_mk_map (__in Z3_context c, __in Z3_func_decl f, unsigned n, __in Z3_ast const *args)
 map f on the the argument arrays.
Z3_ast Z3_API Z3_mk_array_default (__in Z3_context c, __in Z3_ast array)
 Access the array default value. Produces the default range value, for arrays that can be represented as finite maps with a default range value.

Numerals

Z3_ast Z3_API Z3_mk_numeral (__in Z3_context c, __in_z Z3_string numeral, __in Z3_sort ty)
 Create a numeral of a given sort.
Z3_ast Z3_API Z3_mk_real (__in Z3_context c, __in_z int num, __in_z int den)
 Create a real from a fraction.
Z3_ast Z3_API Z3_mk_int (__in Z3_context c, __in int v, __in Z3_sort ty)
 Create a numeral of a given sort.
Z3_ast Z3_API Z3_mk_unsigned_int (__in Z3_context c, __in unsigned v, __in Z3_sort ty)
 Create a numeral of a given sort.
Z3_ast Z3_API Z3_mk_int64 (__in Z3_context c, __in __int64 v, __in Z3_sort ty)
 Create a numeral of a given sort.
Z3_ast Z3_API Z3_mk_unsigned_int64 (__in Z3_context c, __in unsigned __int64 v, __in Z3_sort ty)
 Create a numeral of a given sort.

Quantifiers

Z3_pattern Z3_API Z3_mk_pattern (__in Z3_context c, __in unsigned num_patterns, __in_ecount(num_patterns) Z3_ast const terms[])
 Create a pattern for quantifier instantiation.
Z3_ast Z3_API Z3_mk_bound (__in Z3_context c, __in unsigned index, __in Z3_sort ty)
 Create a bound variable.
Z3_ast Z3_API Z3_mk_forall (__in Z3_context c, __in unsigned weight, __in unsigned num_patterns, __in_ecount(num_patterns) Z3_pattern const patterns[], __in unsigned num_decls, __in_ecount(num_decls) Z3_sort const sorts[], __in_ecount(num_decls) Z3_symbol const decl_names[], __in Z3_ast body)
 Create a forall formula.
Z3_ast Z3_API Z3_mk_exists (__in Z3_context c, __in unsigned weight, __in unsigned num_patterns, __in_ecount(num_patterns) Z3_pattern const patterns[], __in unsigned num_decls, __in_ecount(num_decls) Z3_sort const sorts[], __in_ecount(num_decls) Z3_symbol const decl_names[], __in Z3_ast body)
 Create an exists formula. Similar to Z3_mk_forall.
Z3_ast Z3_API Z3_mk_quantifier (__in Z3_context c, __in Z3_bool is_forall, __in unsigned weight, __in unsigned num_patterns, __in_ecount(num_patterns) Z3_pattern const *patterns, __in unsigned num_decls, __in_ecount(num_decls) Z3_sort const *sorts, __in_ecount(num_decls) Z3_symbol const *decl_names, __in Z3_ast body)
 Create a quantifier - universal or existential, with pattern hints.
Z3_ast Z3_API Z3_mk_forall_const (__in Z3_context c, unsigned weight, unsigned num_bound, __in_ecount(num_bound) Z3_app const *bound, unsigned num_patterns, __in_ecount(num_patterns) Z3_pattern_ast const *patterns, __in Z3_ast body)
 Create a universal quantifier using a list of constants that will form the set of bound variables.
Z3_ast Z3_API Z3_mk_exists_const (__in Z3_context c, unsigned weight, unsigned num_bound, __in_ecount(num_bound) Z3_app const *bound, unsigned num_patterns, __in_ecount(num_patterns) Z3_pattern_ast const *patterns, __in Z3_ast body)
 Similar to Z3_mk_forall_const.

Accessors

Z3_symbol_kind Z3_API Z3_get_symbol_kind (__in Z3_context c, __in Z3_symbol s)
 Return Z3_INT_SYMBOL if the symbol was constructed using Z3_mk_int_symbol, and Z3_STRING_SYMBOL if the symbol was constructed using Z3_mk_string_symbol.
int Z3_API Z3_get_symbol_int (__in Z3_context c, __in Z3_symbol s)
 Return the symbol int value.
Z3_string Z3_API Z3_get_symbol_string (__in Z3_context c, __in Z3_symbol s)
 Return the symbol name.
Z3_ast_kind Z3_API Z3_get_ast_kind (__in Z3_context c, __in Z3_ast a)
 Return the kind of the given AST.
Z3_string Z3_API Z3_get_numeral_string (__in Z3_context c, __in Z3_ast a)
 Return numeral value, as a string of a numeric constant term.
Z3_bool Z3_API Z3_get_numeral_small (__in Z3_context c, __in Z3_ast a, __out __int64 *num, __out __int64 *den)
 Return numeral value, as a pair of 64 bit numbers if the representation fits.
Z3_bool Z3_API Z3_get_numeral_int (__in Z3_context c, __in Z3_ast v, __out int *i)
 Similar to Z3_get_numeral_string, but only succeeds if the value can fit in a machine int. Return Z3_TRUE if the call succeeded.
Z3_bool Z3_API Z3_get_numeral_uint (__in Z3_context c, __in Z3_ast v, __out unsigned *u)
 Similar to Z3_get_numeral_string, but only succeeds if the value can fit in a machine unsigned int. Return Z3_TRUE if the call succeeded.
Z3_bool Z3_API Z3_get_numeral_uint64 (__in Z3_context c, __in Z3_ast v, __out unsigned __int64 *u)
 Similar to Z3_get_numeral_string, but only succeeds if the value can fit in a machine unsigned __int64 int. Return Z3_TRUE if the call succeeded.
Z3_bool Z3_API Z3_get_numeral_int64 (__in Z3_context c, __in Z3_ast v, __out __int64 *i)
 Similar to Z3_get_numeral_string, but only succeeds if the value can fit in a machine __int64 int. Return Z3_TRUE if the call succeeded.
Z3_lbool Z3_API Z3_get_bool_value (__in Z3_context c, __in Z3_ast a)
 Return Z3_L_TRUE if a is true, Z3_L_FALSE if it is false, and Z3_L_UNDEF otherwise.
Z3_func_decl Z3_API Z3_get_app_decl (__in Z3_context c, __in Z3_app a)
 Return the declaration of a constant or function application.
unsigned Z3_API Z3_get_app_num_args (__in Z3_context c, __in Z3_app a)
 Return the number of argument of an application. If t is an constant, then the number of arguments is 0.
Z3_ast Z3_API Z3_get_app_arg (__in Z3_context c, __in Z3_app a, __in unsigned i)
 Return the i-th argument of the given application.
unsigned Z3_API Z3_get_index_value (__in Z3_context c, __in Z3_ast a)
 Return index of de-Brujin bound variable.
Z3_bool Z3_API Z3_is_quantifier_forall (__in Z3_context c, __in Z3_ast a)
 Determine if quantifier is universal.
unsigned Z3_API Z3_get_quantifier_weight (__in Z3_context c, __in Z3_ast a)
 Obtain weight of quantifier.
unsigned Z3_API Z3_get_quantifier_num_patterns (__in Z3_context c, __in Z3_ast a)
 Return number of patterns used in quantifier.
Z3_pattern Z3_API Z3_get_quantifier_pattern_ast (__in Z3_context c, __in Z3_ast a, unsigned i)
 Return i'th pattern.
Z3_symbol Z3_API Z3_get_quantifier_bound_name (__in Z3_context c, __in Z3_ast a, unsigned i)
 Return symbol of the i'th bound variable.
Z3_sort Z3_API Z3_get_quantifier_bound_sort (__in Z3_context c, __in Z3_ast a, unsigned i)
 Return sort of the i'th bound variable.
Z3_ast Z3_API Z3_get_quantifier_body (__in Z3_context c, __in Z3_ast a)
 Return body of quantifier.
unsigned Z3_API Z3_get_quantifier_num_bound (__in Z3_context c, __in Z3_ast a)
 Return number of bound variables of quantifier.
Z3_symbol Z3_API Z3_get_decl_name (__in Z3_context c, __in Z3_func_decl d)
 Return the constant declaration name as a symbol.
unsigned Z3_API Z3_get_decl_num_parameters (__in Z3_context c, __in Z3_func_decl d)
 Return the number of parameters associated with a declaration.
Z3_parameter_kind Z3_API Z3_get_decl_parameter_kind (__in Z3_context c, __in Z3_func_decl d, unsigned idx)
 Return the parameter type associated with a declaration.
int Z3_API Z3_get_decl_int_parameter (__in Z3_context c, __in Z3_func_decl d, unsigned idx)
 Return the integer value associated with an integer parameter.
double Z3_API Z3_get_decl_double_parameter (__in Z3_context c, __in Z3_func_decl d, unsigned idx)
 Return the double value associated with an double parameter.
Z3_symbol Z3_API Z3_get_decl_symbol_parameter (__in Z3_context c, __in Z3_func_decl d, unsigned idx)
 Return the double value associated with an double parameter.
Z3_sort Z3_API Z3_get_decl_sort_parameter (__in Z3_context c, __in Z3_func_decl d, unsigned idx)
 Return the sort value associated with a sort parameter.
Z3_ast Z3_API Z3_get_decl_ast_parameter (__in Z3_context c, __in Z3_func_decl d, unsigned idx)
 Return the expresson value associated with an expression parameter.
Z3_func_decl Z3_API Z3_get_decl_func_decl_parameter (__in Z3_context c, __in Z3_func_decl d, unsigned idx)
 Return the expresson value associated with an expression parameter.
Z3_string Z3_API Z3_get_decl_rational_parameter (__in Z3_context c, __in Z3_func_decl d, unsigned idx)
 Return the rational value, as a string, associated with a rational parameter.
Z3_symbol Z3_API Z3_get_sort_name (__in Z3_context c, __in Z3_sort d)
 Return the sort name as a symbol.
Z3_sort Z3_API Z3_get_sort (__in Z3_context c, __in Z3_ast a)
 Return the sort of an AST node.
unsigned Z3_API Z3_get_domain_size (__in Z3_context c, __in Z3_func_decl d)
 Return the number of parameters of the given declaration.
Z3_sort Z3_API Z3_get_domain (__in Z3_context c, __in Z3_func_decl d, __in unsigned i)
 Return the sort of the i-th parameter of the given function declaration.
Z3_sort Z3_API Z3_get_range (__in Z3_context c, __in Z3_func_decl d)
 Return the range of the given declaration.
Z3_sort_kind Z3_API Z3_get_sort_kind (__in Z3_context c, __in Z3_sort t)
 Return the sort kind (e.g., array, tuple, int, bool, etc).
unsigned Z3_API Z3_get_bv_sort_size (__in Z3_context c, __in Z3_sort t)
 Return the size of the given bit-vector sort.
Z3_sort Z3_API Z3_get_array_sort_domain (__in Z3_context c, __in Z3_sort t)
 Return the domain of the given array sort.
Z3_sort Z3_API Z3_get_array_sort_range (__in Z3_context c, __in Z3_sort t)
 Return the range of the given array sort.
Z3_func_decl Z3_API Z3_get_tuple_sort_mk_decl (__in Z3_context c, __in Z3_sort t)
 Return the constructor declaration of the given tuple sort.
Z3_decl_kind Z3_API Z3_get_decl_kind (__in Z3_context c, __in Z3_func_decl d)
 Return declaration kind corresponding to declaration.
unsigned Z3_API Z3_get_tuple_sort_num_fields (__in Z3_context c, __in Z3_sort t)
 Return the number of fields of the given tuple sort.
Z3_func_decl Z3_API Z3_get_tuple_sort_field_decl (__in Z3_context c, __in Z3_sort t, __in unsigned i)
 Return the i-th field declaration (i.e., projection function declaration) of the given tuple sort.
unsigned Z3_API Z3_get_datatype_sort_num_constructors (__in Z3_context c, __in Z3_sort t)
 Return number of constructors for datatype.
Z3_func_decl Z3_API Z3_get_datatype_sort_constructor (__in Z3_context c, __in Z3_sort t, unsigned idx)
 Return idx'th constructor.
Z3_func_decl Z3_API Z3_get_datatype_sort_recognizer (__in Z3_context c, __in Z3_sort t, unsigned idx)
 Return idx'th recognizer.
Z3_func_decl Z3_API Z3_get_datatype_sort_constructor_accessor (__in Z3_context c, __in Z3_sort t, unsigned idx_c, unsigned idx_a)
 Return idx_a'th accessor for the idx_c'th constructor.
unsigned Z3_API Z3_get_pattern_num_terms (__in Z3_context c, __in Z3_pattern p)
 Return number of terms in pattern.
Z3_ast Z3_API Z3_get_pattern (__in Z3_context c, __in Z3_pattern p, __in unsigned idx)
 Return i'th ast in pattern.
Z3_ast Z3_API Z3_simplify (__in Z3_context c, __in Z3_ast a)
 Interface to simplifier.

Coercions

Z3_ast Z3_API Z3_app_to_ast (__in Z3_context c, __in Z3_app a)
 Convert a APP_AST into an AST. This is just type casting.
Z3_app Z3_API Z3_to_app (__in Z3_context c, __in Z3_ast a)
 Convert an AST into a APP_AST. This is just type casting.

Constraints

void Z3_API Z3_push (__in Z3_context c)
 Create a backtracking point.
void Z3_API Z3_pop (__in Z3_context c, __in unsigned num_scopes)
 Backtrack.
void Z3_API Z3_persist_ast (__in Z3_context c, __in Z3_ast a, __in unsigned num_scopes)
 Persist AST through num_scopes pops.
void Z3_API Z3_assert_cnstr (__in Z3_context c, __in Z3_ast a)
 Assert a constraing into the logical context.
Z3_lbool Z3_API Z3_check_and_get_model (__in Z3_context c, __out Z3_model *m)
 Check whether the given logical context is consistent or not.
Z3_lbool Z3_API Z3_check (__in Z3_context c)
 Check whether the given logical context is consistent or not.
Z3_lbool Z3_API Z3_check_assumptions (__in Z3_context c, __in unsigned num_assumptions, __in_ecount(num_assumptions) Z3_ast assumptions[], __out Z3_model *m, __out Z3_ast *proof, __inout unsigned *core_size, __inout_ecount(num_assumptions) Z3_ast core[])
 Check whether the given logical context and optional assumptions is consistent or not.
Z3_lbool Z3_API Z3_get_implied_equalities (__in Z3_context c, __in unsigned num_terms, __in_ecount(num_terms) Z3_ast terms[], __out_ecount(num_terms) unsigned class_ids[])
 Retrieve congruence class representatives for terms.
void Z3_API Z3_del_model (__in Z3_context c, __in Z3_model m)
 Delete a model object.

Search control.

void Z3_API Z3_soft_check_cancel (__in Z3_context c)
 Cancel an ongoing check.
Z3_search_failure Z3_API Z3_get_search_failure (__in Z3_context c)
 Retrieve reason for search failure.

Labels.

Z3_literals Z3_API Z3_get_relevant_labels (__in Z3_context c)
 Retrieve the set of labels that were relevant in the context of the current satisfied context.
Z3_literals Z3_API Z3_get_relevant_literals (__in Z3_context c)
 Retrieve the set of literals that satisfy the current context.
Z3_literals Z3_API Z3_get_guessed_literals (__in Z3_context c)
 Retrieve the set of literals that whose assignment were guess, but not propagated during the search.
void Z3_API Z3_del_literals (__in Z3_context c, __in Z3_literals lbls)
 Delete a labels context.
unsigned Z3_API Z3_get_num_literals (__in Z3_context c, __in Z3_literals lbls)
 Retrieve the number of label symbols that were returned.
Z3_symbol Z3_API Z3_get_label_symbol (__in Z3_context c, __in Z3_literals lbls, __in unsigned idx)
 Retrieve label symbol at idx.
Z3_ast Z3_API Z3_get_literal (__in Z3_context c, __in Z3_literals lbls, __in unsigned idx)
 Retrieve literal expression at idx.
void Z3_API Z3_disable_literal (__in Z3_context c, __in Z3_literals lbls, __in unsigned idx)
 Disable label.
void Z3_API Z3_block_literals (__in Z3_context c, __in Z3_literals lbls)
 Block subsequent checks using the remaining enabled labels.

Model navigation

unsigned Z3_API Z3_get_model_num_constants (__in Z3_context c, __in Z3_model m)
 Return the number of constants assigned by the given model.
Z3_func_decl Z3_API Z3_get_model_constant (__in Z3_context c, __in Z3_model m, __in unsigned i)
 Return the i-th constant in the given model.
Z3_bool Z3_API Z3_eval_func_decl (__in Z3_context c, __in Z3_model m, __in Z3_func_decl decl, __out Z3_ast *v)
 Return the value of the given constant or function in the given model.
Z3_bool Z3_API Z3_is_array_value (__in Z3_context c, __in Z3_ast v, __out unsigned *num_entries)
 Determine whether the term encodes an array value. Return the number of entries mapping to non-default values of the array.
void Z3_API Z3_get_array_value (__in Z3_context c, __in Z3_ast v, __in unsigned num_entries, __inout_ecount(num_entries) Z3_ast indices[], __inout_ecount(num_entries) Z3_ast values[], __out Z3_ast *else_value)
 An array values is represented as a dictionary plus a default (else) value. This function returns the array graph.
unsigned Z3_API Z3_get_model_num_funcs (__in Z3_context c, __in Z3_model m)
 Return the number of function interpretations in the given model.
Z3_func_decl Z3_API Z3_get_model_func_decl (__in Z3_context c, __in Z3_model m, __in unsigned i)
 Return the declaration of the i-th function in the given model.
Z3_ast Z3_API Z3_get_model_func_else (__in Z3_context c, __in Z3_model m, __in unsigned i)
 Return the 'else' value of the i-th function interpretation in the given model.
unsigned Z3_API Z3_get_model_func_num_entries (__in Z3_context c, __in Z3_model m, __in unsigned i)
 Return the number of entries of the i-th function interpretation in the given model.
unsigned Z3_API Z3_get_model_func_entry_num_args (__in Z3_context c, __in Z3_model m, __in unsigned i, __in unsigned j)
 Return the number of arguments of the j-th entry of the i-th function interpretation in the given model.
Z3_ast Z3_API Z3_get_model_func_entry_arg (__in Z3_context c, __in Z3_model m, __in unsigned i, __in unsigned j, __in unsigned k)
 Return the k-th argument of the j-th entry of the i-th function interpretation in the given model.
Z3_ast Z3_API Z3_get_model_func_entry_value (__in Z3_context c, __in Z3_model m, __in unsigned i, __in unsigned j)
 Return the return value of the j-th entry of the i-th function interpretation in the given model.
Z3_bool Z3_API Z3_eval (__in Z3_context c, __in Z3_model m, __in Z3_ast t, __out Z3_ast *v)
 Evaluate the AST node t in the given model. Return Z3_TRUE if succeeded, and store the result in v.
Z3_bool Z3_API Z3_eval_decl (__in Z3_context c, __in Z3_model m, __in Z3_func_decl d, __in unsigned num_args, __in_ecount(num_args) Z3_ast args[], __out Z3_ast *v)
 Evaluate declaration given values.

Interaction logging.

Z3_bool Z3_API Z3_open_log (__in Z3_context c, __in_z Z3_string filename)
 Log interaction to a file.
void Z3_API Z3_close_log (__in Z3_context c)
 Close interaction log.

String conversion

void Z3_API Z3_set_ast_print_mode (__in Z3_context c, __in Z3_ast_print_mode mode)
 Select mode for the format used for pretty-printing AST nodes.
Z3_string Z3_API Z3_ast_to_string (__in Z3_context c, __in Z3_ast a)
 Convert the given AST node into a string.
Z3_string Z3_API Z3_pattern_to_string (__in Z3_context c, __in Z3_pattern p)
Z3_string Z3_API Z3_sort_to_string (__in Z3_context c, __in Z3_sort s)
Z3_string Z3_API Z3_func_decl_to_string (__in Z3_context c, __in Z3_func_decl d)
Z3_string Z3_API Z3_model_to_string (__in Z3_context c, __in Z3_model m)
 Convert the given model into a string.
Z3_string Z3_API Z3_benchmark_to_smtlib_string (__in Z3_context c, __in_z Z3_string name, __in_z Z3_string logic, __in_z Z3_string status, __in_z Z3_string attributes, __in unsigned num_assumptions, __in_ecount(num_assumptions) Z3_ast assumptions[], __in Z3_ast formula)
 Convert the given benchmark into SMT-LIB formatted string.
Z3_string Z3_API Z3_context_to_string (__in Z3_context c)
 Convert the given logical context into a string.
Z3_ast Z3_API Z3_get_context_assignment (__in Z3_context c)
 Extract satisfying assignment from context as a conjunction.

Parser interface

void Z3_API Z3_parse_smtlib_string (__in Z3_context c, __in_z Z3_string str, __in unsigned num_sorts, __in_ecount(num_sorts) Z3_symbol sort_names[], __in_ecount(num_sorts) Z3_sort sorts[], __in unsigned num_decls, __in_ecount(num_decls) Z3_symbol decl_names[], __in_ecount(num_decls) Z3_func_decl decls[])
 Parse the given string using the SMT-LIB parser.
void Z3_API Z3_parse_smtlib_file (__in Z3_context c, __in_z Z3_string file_name, __in unsigned num_sorts, __in_ecount(num_sorts) Z3_symbol sort_names[], __in_ecount(num_sorts) Z3_sort sorts[], __in unsigned num_decls, __in_ecount(num_decls) Z3_symbol decl_names[], __in_ecount(num_decls) Z3_func_decl decls[])
 Similar to Z3_parse_smtlib_string, but reads the benchmark from a file.
unsigned Z3_API Z3_get_smtlib_num_formulas (__in Z3_context c)
 Return the number of SMTLIB formulas parsed by the last call to Z3_parse_smtlib_string or Z3_parse_smtlib_file.
Z3_ast Z3_API Z3_get_smtlib_formula (__in Z3_context c, __in unsigned i)
 Return the i-th formula parsed by the last call to Z3_parse_smtlib_string or Z3_parse_smtlib_file.
unsigned Z3_API Z3_get_smtlib_num_assumptions (__in Z3_context c)
 Return the number of SMTLIB assumptions parsed by Z3_parse_smtlib_string or Z3_parse_smtlib_file.
Z3_ast Z3_API Z3_get_smtlib_assumption (__in Z3_context c, __in unsigned i)
 Return the i-th assumption parsed by the last call to Z3_parse_smtlib_string or Z3_parse_smtlib_file.
unsigned Z3_API Z3_get_smtlib_num_decls (__in Z3_context c)
 Return the number of declarations parsed by Z3_parse_smtlib_string or Z3_parse_smtlib_file.
Z3_func_decl Z3_API Z3_get_smtlib_decl (__in Z3_context c, __in unsigned i)
 Return the i-th declaration parsed by the last call to Z3_parse_smtlib_string or Z3_parse_smtlib_file.
unsigned Z3_API Z3_get_smtlib_num_sorts (__in Z3_context c)
 Return the number of sorts parsed by Z3_parse_smtlib_string or Z3_parse_smtlib_file.
Z3_sort Z3_API Z3_get_smtlib_sort (__in Z3_context c, __in unsigned i)
 Return the i-th sort parsed by the last call to Z3_parse_smtlib_string or Z3_parse_smtlib_file.
Z3_string Z3_API Z3_get_smtlib_error (__in Z3_context c)
 Retrieve that last error message information generated from parsing.
Z3_ast Z3_API Z3_parse_z3_string (__in Z3_context c, __in_z Z3_string str)
 Parse the given string using the Z3 native parser.
Z3_ast Z3_API Z3_parse_z3_file (__in Z3_context c, __in_z Z3_string file_name)
 Similar to Z3_parse_z3_string, but reads the benchmark from a file.
Z3_ast Z3_API Z3_parse_simplify_string (__in Z3_context c, __in_z Z3_string str, __out Z3_string *parser_output)
 Parse the given string using the Simplify parser.
Z3_ast Z3_API Z3_parse_simplify_file (__in Z3_context c, __in_z Z3_string file_name, __out Z3_string *parser_output)
 Similar to Z3_parse_simplify_string, but reads the benchmark from a file.

Error Handling

Z3_error_code Z3_API Z3_get_error_code (__in Z3_context c)
 Return the error code for the last API call.
void Z3_API Z3_set_error_handler (__in Z3_context c, __in Z3_error_handler h)
 Register a Z3 error handler.
void Z3_API Z3_set_error (__in Z3_context c, __in Z3_error_code e)
 Set an error.
Z3_string Z3_API Z3_get_error_msg (__in Z3_error_code err)
 Return a string describing the given error code.

Miscellaneous

void Z3_API Z3_get_version (__out unsigned *major, __out unsigned *minor, __out unsigned *build_number, __out unsigned *revision_number)
 Return Z3 version number information.
void Z3_API Z3_reset_memory (void)
 Reset all allocated resources.

Define Documentation

#define Z3_FALSE   0

False value. It is just an alias for 0.

Definition at line 108 of file z3_api.h.

Referenced by bitvector_example1(), enum_example(), list_example(), prove_example1(), prove_example2(), tree_example(), and tuple_example1().

#define Z3_TRUE   1


Typedef Documentation

typedef int Z3_bool

Z3 Boolean type. It is just an alias for int.

Definition at line 79 of file z3_api.h.

Z3 custom error handler (See Z3_set_error_handler).

Definition at line 905 of file z3_api.h.

typedef const char* Z3_string

Z3 string type. It is just an alias for const char *.

Definition at line 91 of file z3_api.h.


Enumeration Type Documentation

The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types.

  • Z3_APP_AST: constant and applications
  • Z3_NUMERAL_AST: numeral constants
  • Z3_VAR_AST: bound variables
  • Z3_QUANTIFIER_AST: quantifiers
  • Z3_UNKNOWN_AST: internal

Definition at line 182 of file z3_api.h.

00183 {
00184     Z3_NUMERAL_AST,
00185     Z3_APP_AST,         
00186     Z3_VAR_AST,          
00187     Z3_QUANTIFIER_AST,    
00188     Z3_UNKNOWN_AST = 1000 
00189 } Z3_ast_kind;

Z3 pretty printing modes (See Z3_set_ast_print_mode).

  • Z3_PRINT_SMTLIB_FULL: Print AST nodes in SMTLIB verbose format.
  • Z3_PRINT_LOW_LEVEL: Print AST nodes using a low-level format.

Definition at line 869 of file z3_api.h.

00869              {
00870     Z3_PRINT_SMTLIB_FULL,
00871     Z3_PRINT_LOW_LEVEL
00872 } Z3_ast_print_mode;

The different kinds of interpreted function kinds.

(*

  • Z3_OP_TRUE The constant true.

  • Z3_OP_FALSE The constant false.

  • Z3_OP_EQ The equality predicate.

  • Z3_OP_DISTINCT The n-ary distinct predicate (every argument is mutually distinct).

  • Z3_OP_ITE The ternary if-then-else term.

  • Z3_OP_AND n-ary conjunction.

  • Z3_OP_OR n-ary disjunction.

  • Z3_OP_IFF equivalence (binary).

  • Z3_OP_XOR Exclusive or.

  • Z3_OP_NOT Negation.

  • Z3_OP_IMPLIES Implication.

  • Z3_OP_OEQ Binary equivalence modulo namings. This binary predicate is used in proof terms. It captures equisatisfiability and equivalence modulo renamings.

  • Z3_OP_ANUM Arithmetic numeral.

  • Z3_OP_LE <=.

  • Z3_OP_GE >=.

  • Z3_OP_LT <.

  • Z3_OP_GT >.

  • Z3_OP_ADD Addition - Binary.

  • Z3_OP_SUB Binary subtraction.

  • Z3_OP_UMINUS Unary minus.

  • Z3_OP_MUL Multiplication - Binary.

  • Z3_OP_DIV Division - Binary.

  • Z3_OP_IDIV Integer division - Binary.

  • Z3_OP_REM Remainder - Binary.

  • Z3_OP_MOD Modulus - Binary.

  • Z3_OP_TO_REAL Coercion of integer to real - Unary.

  • Z3_OP_STORE Array store. It satisfies select(store(a,i,v),j) = if i = j then v else select(a,j). Array store takes at least 3 arguments.

  • Z3_OP_SELECT Array select.

  • Z3_OP_CONST_ARRAY The constant array. For example, select(const(v),i) = v holds for every v and i. The function is unary.

  • Z3_OP_ARRAY_DEFAULT Default value of arrays. For example default(const(v)) = v. The function is unary.

  • Z3_OP_ARRAY_MAP Array map operator. It satisfies map[f](a1,..,a_n)[i] = f(a1[i],...,a_n[i]) for every i.

  • Z3_OP_SET_UNION Set union between two Booelan arrays (two arrays whose range type is Boolean). The function is binary.

  • Z3_OP_SET_INTERSECT Set intersection between two Boolean arrays. The function is binary.

  • Z3_OP_SET_DIFFERENCE Set difference between two Boolean arrays. The function is binary.

  • Z3_OP_SET_COMPLEMENT Set complement of a Boolean array. The function is unary.

  • Z3_OP_SET_SUBSET Subset predicate between two Boolean arrays. The relation is binary.

  • Z3_OP_BNUM Bit-vector numeral.

  • Z3_OP_BIT1 One bit bit-vector.

  • Z3_OP_BIT0 Zero bit bit-vector.

  • Z3_OP_BNEG Unary minus.

  • Z3_OP_BADD Binary addition.

  • Z3_OP_BSUB Binary subtraction.

  • Z3_OP_BMUL Binary multiplication.

  • Z3_OP_BSDIV Binary signed division.

  • Z3_OP_BUDIV Binary unsigned division.

  • Z3_OP_BSREM Binary signed remainder.

  • Z3_OP_BUREM Binary unsigned remainder.

  • Z3_OP_BSMOD Binary signed modulus.

  • Z3_OP_BSDIV0 Unary function. bsdiv(x,0) is congruent to bsdiv0(x).

  • Z3_OP_BUDIV0 Unary function. budiv(x,0) is congruent to budiv0(x).

  • Z3_OP_BSREM0 Unary function. bsrem(x,0) is congruent to bsrem0(x).

  • Z3_OP_BUREM0 Unary function. burem(x,0) is congruent to burem0(x).

  • Z3_OP_BSMOD0 Unary function. bsmod(x,0) is congruent to bsmod0(x).

  • Z3_OP_ULEQ Unsigned bit-vector <= - Binary relation.

  • Z3_OP_SLEQ Signed bit-vector <= - Binary relation.

  • Z3_OP_UGEQ Unsigned bit-vector >= - Binary relation.

  • Z3_OP_SGEQ Signed bit-vector >= - Binary relation.

  • Z3_OP_ULT Unsigned bit-vector < - Binary relation.

  • Z3_OP_SLT Signed bit-vector < - Binary relation.

  • Z3_OP_UGT Unsigned bit-vector > - Binary relation.

  • Z3_OP_SGT Signed bit-vector > - Binary relation.

  • Z3_OP_BAND Bit-wise and - Binary.

  • Z3_OP_BOR Bit-wise or - Binary.

  • Z3_OP_BNOT Bit-wise not - Unary.

  • Z3_OP_BXOR Bit-wise xor - Binary.

  • Z3_OP_BNAND Bit-wise nand - Binary.

  • Z3_OP_BNOR Bit-wise nor - Binary.

  • Z3_OP_BXNOR Bit-wise xnor - Binary.

  • Z3_OP_CONCAT Bit-vector concatenation - Binary.

  • Z3_OP_SIGN_EXT Bit-vector sign extension.

  • Z3_OP_ZERO_EXT Bit-vector zero extension.

  • Z3_OP_EXTRACT Bit-vector extraction.

  • Z3_OP_REPEAT Repeat bit-vector n times.

  • Z3_OP_BREDOR Bit-vector reduce or - Unary.

  • Z3_OP_BREDAND Bit-vector reduce and - Unary.

  • Z3_OP_BCOMP .

  • Z3_OP_BSHL Shift left.

  • Z3_OP_BLSHR Logical shift right.

  • Z3_OP_BASHR Arithmetical shift right.

  • Z3_OP_ROTATE_LEFT Left rotation.

  • Z3_OP_ROTATE_RIGHT Right rotation.

  • Z3_OP_INT2BV Coerce integer to bit-vector. NB. This function is not supported by the decision procedures. Only the most rudimentary simplification rules are applied to this function.

  • Z3_OP_BV2INT Coerce bit-vector to integer. NB. This function is not supported by the decision procedures. Only the most rudimentary simplification rules are applied to this function.

  • Z3_OP_PR_TRUE: Proof for the expression 'true'.

  • Z3_OP_PR_ASSERTED: Proof for a fact asserted by the user.

  • Z3_OP_PR_GOAL: Proof for a fact (tagged as goal) asserted by the user.

  • Z3_OP_PR_MODUS_PONENS: Given a proof for p and a proof for (implies p q), produces a proof for q.
              T1: p
              T2: (implies p q)
              [mp T1 T2]: q
              
    The second antecedents may also be a proof for (iff p q).

  • Z3_OP_PR_REFLEXIVITY: A proof for (R t t), where R is a reflexive relation. This proof object has no antecedents. The only reflexive relations that are used are equivalence modulo namings, equality and equivalence. That is, R is either '~', '=' or 'iff'.

  • Z3_OP_PR_SYMMETRY: Given an symmetric relation R and a proof for (R t s), produces a proof for (R s t).
              T1: (R t s)
              [symmetry T1]: (R s t)
              
    T1 is the antecedent of this proof object.

  • Z3_OP_PR_TRANSITIVITY: Given a transitive relation R, and proofs for (R t s) and (R s u), produces a proof for (R t u).
           T1: (R t s)
           T2: (R s u)
           [trans T1 T2]: (R t u)
           

  • Z3_OP_PR_TRANSITIVITY_STAR: Condensed transitivity proof. This proof object is only used if the parameter PROOF_MODE is 1. It combines several symmetry and transitivity proofs.

Example:

          T1: (R a b)
          T2: (R c b)
          T3: (R c d)
          [trans* T1 T2 T3]: (R a d)
          
R must be a symmetric and transitive relation.

Assuming that this proof object is a proof for (R s t), then a proof checker must check if it is possible to prove (R s t) using the antecedents, symmetry and transitivity. That is, if there is a path from s to t, if we view every antecedent (R a b) as an edge between a and b.

  • Z3_OP_PR_MONOTONICITY: Monotonicity proof object.
              T1: (R t_1 s_1)
              ...
              Tn: (R t_n s_n)
              [monotonicity T1 ... Tn]: (R (f t_1 ... t_n) (f s_1 ... s_n))
              
    Remark: if t_i == s_i, then the antecedent Ti is suppressed. That is, reflexivity proofs are supressed to save space.

  • Z3_OP_PR_QUANT_INTRO: Given a proof for (~ p q), produces a proof for (~ (forall (x) p) (forall (x) q)).

T1: (~ p q) [quant-intro T1]: (~ (forall (x) p) (forall (x) q))

  • Z3_OP_PR_DISTRIBUTIVITY: Distributivity proof object. Given that f (= or) distributes over g (= and), produces a proof for

(= (f a (g c d)) (g (f a c) (f a d)))

If f and g are associative, this proof also justifies the following equality:

(= (f (g a b) (g c d)) (g (f a c) (f a d) (f b c) (f b d)))

where each f and g can have arbitrary number of arguments.

This proof object has no antecedents. Remark. This rule is used by the CNF conversion pass and instantiated by f = or, and g = and.

  • Z3_OP_PR_AND_ELIM: Given a proof for (and l_1 ... l_n), produces a proof for l_i

       T1: (and l_1 ... l_n)
       [and-elim T1]: l_i
       
  • Z3_OP_PR_NOT_OR_ELIM: Given a proof for (not (or l_1 ... l_n)), produces a proof for (not l_i).

       T1: (not (or l_1 ... l_n))
       [not-or-elim T1]: (not l_i)
       

  • Z3_OP_PR_REWRITE: A proof for a local rewriting step (= t s). The head function symbol of t is interpreted.

This proof object has no antecedents. The conclusion of a rewrite rule is either an equality (= t s), an equivalence (iff t s), or equi-satisfiability (~ t s). Remark: if f is bool, then = is iff.

Examples:

          (= (+ x 0) x)
          (= (+ x 1 2) (+ 3 x))
          (iff (or x false) x)
          

  • Z3_OP_PR_REWRITE_STAR: A proof for rewriting an expression t into an expression s. This proof object is used if the parameter PROOF_MODE is 1. This proof object can have n antecedents. The antecedents are proofs for equalities used as substitution rules. The object is also used in a few cases if the parameter PROOF_MODE is 2. The cases are:
    • When applying contextual simplification (CONTEXT_SIMPLIFIER=true)
    • When converting bit-vectors to Booleans (BIT2BOOL=true)
    • When pulling ite expression up (PULL_CHEAP_ITE_TREES=true)

  • Z3_OP_PR_PULL_QUANT: A proof for (iff (f (forall (x) q(x)) r) (forall (x) (f (q x) r))). This proof object has no antecedents.

  • Z3_OP_PR_PULL_QUANT_STAR: A proof for (iff P Q) where Q is in prenex normal form. This proof object is only used if the parameter PROOF_MODE is 1. This proof object has no antecedents.

  • Z3_OP_PR_PUSH_QUANT: A proof for:

          (iff (forall (x_1 ... x_m) (and p_1[x_1 ... x_m] ... p_n[x_1 ... x_m]))
               (and (forall (x_1 ... x_m) p_1[x_1 ... x_m])
                 ... 
               (forall (x_1 ... x_m) p_n[x_1 ... x_m])))
               
This proof object has no antecedents.

  • Z3_OP_PR_ELIM_UNUSED_VARS: A proof for (iff (forall (x_1 ... x_n y_1 ... y_m) p[x_1 ... x_n]) (forall (x_1 ... x_n) p[x_1 ... x_n]))

It is used to justify the elimination of unused variables. This proof object has no antecedents.

  • Z3_OP_PR_DER: A proof for destructive equality resolution: (iff (forall (x) (or (not (= x t)) P[x])) P[t]) if x does not occur in t.

This proof object has no antecedents.

Several variables can be eliminated simultaneously.

  • Z3_OP_PR_QUANT_INST: A proof of (or (not (forall (x) (P x))) (P a))

  • Z3_OP_PR_HYPOTHESIS: Mark a hypothesis in a natural deduction style proof.

  • Z3_OP_PR_LEMMA:

          T1: false
          [lemma T1]: (or (not l_1) ... (not l_n))
          
This proof object has one antecedent: a hypothetical proof for false. It converts the proof in a proof for (or (not l_1) ... (not l_n)), when T1 contains the hypotheses: l_1, ..., l_n.

  • Z3_OP_PR_UNIT_RESOLUTION:
              T1:      (or l_1 ... l_n l_1' ... l_m')
              T2:      (not l_1)
              ...
              T(n+1):  (not l_n)
              [unit-resolution T1 ... T(n+1)]: (or l_1' ... l_m')
              

  • Z3_OP_PR_IFF_TRUE:
           T1: p
           [iff-true T1]: (iff p true)
           

  • Z3_OP_PR_IFF_FALSE:
           T1: (not p)
           [iff-false T1]: (iff p false)
           

  • Z3_OP_PR_COMMUTATIVITY:

[comm]: (= (f a b) (f b a))

f is a commutative operator.

This proof object has no antecedents. Remark: if f is bool, then = is iff.

  • Z3_OP_PR_DEF_AXIOM: Proof object used to justify Tseitin's like axioms:

          (or (not (and p q)) p)
          (or (not (and p q)) q)
          (or (not (and p q r)) p)
          (or (not (and p q r)) q)
          (or (not (and p q r)) r)
          ...
          (or (and p q) (not p) (not q))
          (or (not (or p q)) p q)
          (or (or p q) (not p))
          (or (or p q) (not q))
          (or (not (iff p q)) (not p) q)
          (or (not (iff p q)) p (not q))
          (or (iff p q) (not p) (not q))
          (or (iff p q) p q)
          (or (not (ite a b c)) (not a) b)
          (or (not (ite a b c)) a c)
          (or (ite a b c) (not a) (not b))
          (or (ite a b c) a (not c))
          (or (not (not a)) (not a))
          (or (not a) a)
          
This proof object has no antecedents. Note: all axioms are propositional tautologies. Note also that 'and' and 'or' can take multiple arguments. You can recover the propositional tautologies by unfolding the Boolean connectives in the axioms a small bounded number of steps (=3).

  • Z3_OP_PR_DEF_INTRO: Introduces a name for a formula/term. Suppose e is an expression with free variables x, and def-intro introduces the name n(x). The possible cases are:

When e is of Boolean type: [def-intro]: (and (or n (not e)) (or (not n) e))

or: [def-intro]: (or (not n) e) when e only occurs positively.

When e is of the form (ite cond th el): [def-intro]: (and (or (not cond) (= n th)) (or cond (= n el)))

Otherwise: [def-intro]: (= n e)

  • Z3_OP_PR_APPLY_DEF: [apply-def T1]: F ~ n F is 'equivalent' to n, given that T1 is a proof that n is a name for F.

  • Z3_OP_PR_IFF_OEQ: T1: (iff p q) [iff~ T1]: (~ p q)

  • Z3_OP_PR_NNF_POS: Proof for a (positive) NNF step. Example:
              T1: (not s_1) ~ r_1
              T2: (not s_2) ~ r_2
              T3: s_1 ~ r_1'
              T4: s_2 ~ r_2'
              [nnf-pos T1 T2 T3 T4]: (~ (iff s_1 s_2)
                                        (and (or r_1 r_2') (or r_1' r_2)))
              
    The negation normal form steps NNF_POS and NNF_NEG are used in the following cases: (a) When creating the NNF of a positive force quantifier. The quantifier is retained (unless the bound variables are eliminated). Example
               T1: q ~ q_new 
               [nnf-pos T1]: (~ (forall (x T) q) (forall (x T) q_new))
            
    (b) When recursively creating NNF over Boolean formulas, where the top-level connective is changed during NNF conversion. The relevant Boolean connectives for NNF_POS are 'implies', 'iff', 'xor', 'ite'. NNF_NEG furthermore handles the case where negation is pushed over Boolean connectives 'and' and 'or'.

  • Z3_OP_PR_NFF_NEG: Proof for a (negative) NNF step. Examples:
              T1: (not s_1) ~ r_1
              ...
              Tn: (not s_n) ~ r_n
             [nnf-neg T1 ... Tn]: (not (and s_1 ... s_n)) ~ (or r_1 ... r_n)
          and
              T1: (not s_1) ~ r_1
              ...
              Tn: (not s_n) ~ r_n
             [nnf-neg T1 ... Tn]: (not (or s_1 ... s_n)) ~ (and r_1 ... r_n)
          and
              T1: (not s_1) ~ r_1
              T2: (not s_2) ~ r_2
              T3: s_1 ~ r_1'
              T4: s_2 ~ r_2'
             [nnf-neg T1 T2 T3 T4]: (~ (not (iff s_1 s_2))
                                       (and (or r_1 r_2) (or r_1' r_2')))
           
  • Z3_OP_PR_NNF_STAR: A proof for (~ P Q) where Q is in negation normal form.

This proof object is only used if the parameter PROOF_MODE is 1.

This proof object may have n antecedents. Each antecedent is a PR_DEF_INTRO.

  • Z3_OP_PR_CNF_STAR: A proof for (~ P Q) where Q is in conjunctive normal form. This proof object is only used if the parameter PROOF_MODE is 1. This proof object may have n antecedents. Each antecedent is a PR_DEF_INTRO.

  • Z3_OP_PR_SKOLEMIZE: Proof for:

          [sk]: (~ (not (forall x (p x y))) (not (p (sk y) y)))
          [sk]: (~ (exists x (p x y)) (p (sk y) y))
          

This proof object has no antecedents.

  • Z3_OP_PR_MODUS_PONENS_OEQ: Modus ponens style rule for equi-satisfiability.
              T1: p
              T2: (~ p q)
              [mp~ T1 T2]: q
              

  • Z3_OP_PR_TH_LEMMA: Generic proof for theory lemmas.

)

Definition at line 697 of file z3_api.h.

00697              {
00698     Z3_OP_TRUE = 0x100,
00699     Z3_OP_FALSE,
00700     Z3_OP_EQ,
00701     Z3_OP_DISTINCT,
00702     Z3_OP_ITE,
00703     Z3_OP_AND,
00704     Z3_OP_OR,
00705     Z3_OP_IFF,
00706     Z3_OP_XOR,
00707     Z3_OP_NOT,
00708     Z3_OP_IMPLIES,
00709     Z3_OP_OEQ,
00710 
00711 
00712     Z3_OP_ANUM = 0x200,
00713     Z3_OP_LE,
00714     Z3_OP_GE,
00715     Z3_OP_LT,
00716     Z3_OP_GT,
00717     Z3_OP_ADD,
00718     Z3_OP_SUB,
00719     Z3_OP_UMINUS,
00720     Z3_OP_MUL,
00721     Z3_OP_DIV,
00722     Z3_OP_IDIV,
00723     Z3_OP_REM,
00724     Z3_OP_MOD,
00725     Z3_OP_TO_REAL,
00726     Z3_OP_STORE = 0x300,
00727     Z3_OP_SELECT,
00728     Z3_OP_CONST_ARRAY,
00729     Z3_OP_ARRAY_MAP,
00730     Z3_OP_ARRAY_DEFAULT,
00731     Z3_OP_SET_UNION,
00732     Z3_OP_SET_INTERSECT,
00733     Z3_OP_SET_DIFFERENCE,
00734     Z3_OP_SET_COMPLEMENT,
00735     Z3_OP_SET_SUBSET,
00736 
00737     Z3_OP_BNUM = 0x400,
00738     Z3_OP_BIT1,
00739     Z3_OP_BIT0,
00740     Z3_OP_BNEG,
00741     Z3_OP_BADD,
00742     Z3_OP_BSUB,
00743     Z3_OP_BMUL,
00744     
00745     Z3_OP_BSDIV,
00746     Z3_OP_BUDIV,
00747     Z3_OP_BSREM,
00748     Z3_OP_BUREM,
00749     Z3_OP_BSMOD,
00750 
00751     // special functions to record the division by 0 cases
00752     // these are internal functions 
00753     Z3_OP_BSDIV0, 
00754     Z3_OP_BUDIV0,
00755     Z3_OP_BSREM0,
00756     Z3_OP_BUREM0,
00757     Z3_OP_BSMOD0,
00758     
00759     Z3_OP_ULEQ,
00760     Z3_OP_SLEQ,
00761     Z3_OP_UGEQ,
00762     Z3_OP_SGEQ,
00763     Z3_OP_ULT,
00764     Z3_OP_SLT,
00765     Z3_OP_UGT,
00766     Z3_OP_SGT,
00767 
00768     Z3_OP_BAND,
00769     Z3_OP_BOR,
00770     Z3_OP_BNOT,
00771     Z3_OP_BXOR,
00772     Z3_OP_BNAND,
00773     Z3_OP_BNOR,
00774     Z3_OP_BXNOR,
00775 
00776     Z3_OP_CONCAT,
00777     Z3_OP_SIGN_EXT,
00778     Z3_OP_ZERO_EXT,
00779     Z3_OP_EXTRACT,
00780     Z3_OP_REPEAT,
00781 
00782     Z3_OP_BREDOR,
00783     Z3_OP_BREDAND,
00784     Z3_OP_BCOMP,
00785 
00786     Z3_OP_BSHL,
00787     Z3_OP_BLSHR,
00788     Z3_OP_BASHR,
00789     Z3_OP_ROTATE_LEFT,
00790     Z3_OP_ROTATE_RIGHT,
00791 
00792     Z3_OP_INT2BV,
00793     Z3_OP_BV2INT,
00794 
00795     Z3_OP_PR_UNDEF = 0x500, 
00796     Z3_OP_PR_TRUE,
00797     Z3_OP_PR_ASSERTED, 
00798     Z3_OP_PR_GOAL, 
00799     Z3_OP_PR_MODUS_PONENS, 
00800     Z3_OP_PR_REFLEXIVITY, 
00801     Z3_OP_PR_SYMMETRY, 
00802     Z3_OP_PR_TRANSITIVITY, 
00803     Z3_OP_PR_TRANSITIVITY_STAR, 
00804     Z3_OP_PR_MONOTONICITY, 
00805     Z3_OP_PR_QUANT_INTRO,
00806     Z3_OP_PR_DISTRIBUTIVITY, 
00807     Z3_OP_PR_AND_ELIM, 
00808     Z3_OP_PR_NOT_OR_ELIM, 
00809     Z3_OP_PR_REWRITE, 
00810     Z3_OP_PR_REWRITE_STAR, 
00811     Z3_OP_PR_PULL_QUANT, 
00812     Z3_OP_PR_PULL_QUANT_STAR, 
00813     Z3_OP_PR_PUSH_QUANT, 
00814     Z3_OP_PR_ELIM_UNUSED_VARS, 
00815     Z3_OP_PR_DER, 
00816     Z3_OP_PR_QUANT_INST,
00817     Z3_OP_PR_HYPOTHESIS, 
00818     Z3_OP_PR_LEMMA, 
00819     Z3_OP_PR_UNIT_RESOLUTION, 
00820     Z3_OP_PR_IFF_TRUE, 
00821     Z3_OP_PR_IFF_FALSE, 
00822     Z3_OP_PR_COMMUTATIVITY, 
00823     Z3_OP_PR_DEF_AXIOM,
00824     Z3_OP_PR_DEF_INTRO, 
00825     Z3_OP_PR_APPLY_DEF, 
00826     Z3_OP_PR_IFF_OEQ, 
00827     Z3_OP_PR_NNF_POS, 
00828     Z3_OP_PR_NNF_NEG, 
00829     Z3_OP_PR_NNF_STAR, 
00830     Z3_OP_PR_CNF_STAR, 
00831     Z3_OP_PR_SKOLEMIZE,
00832     Z3_OP_PR_MODUS_PONENS_OEQ, 
00833     Z3_OP_PR_TH_LEMMA, 
00834 
00835     Z3_OP_UNINTERPRETED
00836 } Z3_decl_kind;

Z3 error codes (See Z3_get_error_code).

  • Z3_OK,
  • Z3_SORT_ERROR: User tried to build an invalid (type incorrect) AST.
  • Z3_IOB: Index out of bounds
  • Z3_INVALID_ARG: Invalid argument was provided
  • Z3_PARSER_ERROR: An error occurred when parsing a string or file.
  • Z3_NO_PARSER: Parser output is not available, that is, user didn't invoke Z3_parse_smtlib_string or Z3_parse_smtlib_file.
  • Z3_INVALID_PATTERN: Invalid pattern was used to build a quantifier.
  • Z3_MEMOUT_FAIL: A memory allocation failure was encountered.

Definition at line 888 of file z3_api.h.

00889 {
00890     Z3_OK,            
00891     Z3_SORT_ERROR,    
00892     Z3_IOB,           
00893     Z3_INVALID_ARG,   
00894     Z3_PARSER_ERROR,  
00895     Z3_NO_PARSER,
00896     Z3_INVALID_PATTERN,
00897     Z3_MEMOUT_FAIL
00898 } Z3_error_code;

enum Z3_lbool

Lifted Boolean type: false, undefined, true.

Definition at line 115 of file z3_api.h.

00116 {
00117     Z3_L_FALSE = -1,
00118     Z3_L_UNDEF,
00119     Z3_L_TRUE
00120 } Z3_lbool;

The different kinds of parameters that can be associated with function symbols.

See also:
Z3_get_decl_num_parameters

Z3_get_decl_parameter_kind

  • Z3_PARAMETER_INT is used for integer parameters.
  • Z3_PARAMETER_DOUBLE is used for double parameters.
  • Z3_PARAMETER_RATIONAL is used for parameters that are rational numbers.
  • Z3_PARAMETER_SORT is used for sort parameters.
  • Z3_PARAMETER_AST is used for expression parameters.
  • Z3_PARAMETER_FUNC_DECL is used for function declaration parameters.

Definition at line 147 of file z3_api.h.

00148 {
00149     Z3_PARAMETER_INT,
00150     Z3_PARAMETER_DOUBLE,
00151     Z3_PARAMETER_RATIONAL,
00152     Z3_PARAMETER_SYMBOL,
00153     Z3_PARAMETER_SORT,
00154     Z3_PARAMETER_AST,
00155     Z3_PARAMETER_FUNC_DECL,
00156 } Z3_parameter_kind;

The different kinds of search failure types.

  • Z3_NO_FAILURE: The last search was successful
  • Z3_UNKNOWN: Undocumented failure reason
  • Z3_TIMEOUT: Timeout
  • Z3_MEMOUT_WATERMAK: Search hit a memory high-watermak limit
  • Z3_CANCELED: External cancel flag was set
  • Z3_NUM_CONFLICTS: Maximum number of conflicts was reached
  • Z3_THEORY: Theory is incomplete
  • Z3_QUANTIFIERS: Logical context contains universal quantifiers

Definition at line 852 of file z3_api.h.

00852              {
00853     Z3_NO_FAILURE,
00854     Z3_UNKNOWN,
00855     Z3_TIMEOUT,
00856     Z3_MEMOUT_WATERMARK,     
00857     Z3_CANCELED,      
00858     Z3_NUM_CONFLICTS, 
00859     Z3_THEORY,        
00860     Z3_QUANTIFIERS    
00861 } Z3_search_failure;

The different kinds of Z3 types (See Z3_get_sort_kind).

Definition at line 161 of file z3_api.h.

00162 {
00163     Z3_UNINTERPRETED_SORT,
00164     Z3_BOOL_SORT,
00165     Z3_INT_SORT,
00166     Z3_REAL_SORT,
00167     Z3_BV_SORT,
00168     Z3_ARRAY_SORT,
00169     Z3_DATATYPE_SORT,
00170     Z3_UNKNOWN_SORT = 1000
00171 } Z3_sort_kind;

In Z3, a symbol can be represented using integers and strings (See Z3_get_symbol_kind).

See also:
Z3_mk_int_symbol

Z3_mk_string_symbol

Definition at line 128 of file z3_api.h.

00129 {
00130     Z3_INT_SYMBOL,
00131     Z3_STRING_SYMBOL 
00132 } Z3_symbol_kind;


Function Documentation

Z3_ast Z3_API Z3_app_to_ast ( __in Z3_context  c,
__in Z3_app  a 
)

Convert a APP_AST into an AST. This is just type casting.

void Z3_API Z3_assert_cnstr ( __in Z3_context  c,
__in Z3_ast  a 
)

Assert a constraing into the logical context.

After one assertion, the logical context may become inconsistent.

The functions Z3_check or Z3_check_and_get_model should be used to check whether the logical context is consistent or not.

See also:
Z3_check

Z3_check_and_get_model

Referenced by array_example2(), assert_comm_axiom(), assert_inj_axiom(), bitvector_example2(), demorgan(), error_code_example1(), eval_example1(), find_model_example1(), find_model_example2(), get_implied_equalities_example(), parser_example1(), parser_example2(), prove(), prove_example1(), prove_example2(), push_pop_example1(), quantifier_example1(), and unsat_core_and_proof_example().

Z3_string Z3_API Z3_ast_to_string ( __in Z3_context  c,
__in Z3_ast  a 
)

Convert the given AST node into a string.

Warning:
The result buffer is statically allocated by Z3. It will be automatically deallocated when Z3_del_context is invoked. So, the buffer is invalidated in the next call to Z3_ast_to_string.
See also:
Z3_pattern_to_string

Z3_sort_to_string

Referenced by array_example1(), array_example2(), assert_comm_axiom(), assert_inj_axiom(), get_implied_equalities_example(), ite_example(), list_example(), parser_example1(), parser_example2(), parser_example3(), parser_example4(), tree_example(), two_contexts_example1(), and unsat_core_and_proof_example().

Z3_string Z3_API Z3_benchmark_to_smtlib_string ( __in Z3_context  c,
__in_z Z3_string  name,
__in_z Z3_string  logic,
__in_z Z3_string  status,
__in_z Z3_string  attributes,
__in unsigned  num_assumptions,
__in_ecount(num_assumptions) Z3_ast  assumptions[],
__in Z3_ast  formula 
)

Convert the given benchmark into SMT-LIB formatted string.

Warning:
The result buffer is statically allocated by Z3. It will be automatically deallocated when Z3_del_context is invoked. So, the buffer is invalidated in the next call to Z3_benchmark_to_smtlib_string.
Parameters:
c - context.
name - name of benchmark. The argument is optional.
logic - the benchmark logic.
status - the status string (sat, unsat, or unknown)
attributes - other attributes, such as source, difficulty or category.
num_assumptions - number of assumptions.
assumptions - auxiliary assumptions.
formula - formula to be checked for consistency in conjunction with assumptions.

void Z3_API Z3_block_literals ( __in Z3_context  c,
__in Z3_literals  lbls 
)

Block subsequent checks using the remaining enabled labels.

Z3_lbool Z3_API Z3_check ( __in Z3_context  c  ) 

Check whether the given logical context is consistent or not.

The function Z3_check_and_get_model should be used when models are needed.

See also:
Z3_check_and_get_model

Referenced by demorgan().

Z3_lbool Z3_API Z3_check_and_get_model ( __in Z3_context  c,
__out Z3_model *  m 
)

Check whether the given logical context is consistent or not.

If the logical context is not unsatisfiable (i.e., the return value is different from Z3_L_FALSE) and model construction is enabled (see Z3_mk_config), then a model is stored in m. Otherwise, the value 0 is stored in m. The caller is responsible for deleting the model using the function Z3_del_model.

Remarks:
Model construction must be enabled using configuration parameters (See, Z3_mk_config).
See also:
Z3_check

Z3_del_model

Referenced by check(), check2(), error_code_example1(), eval_example1(), and prove().

Z3_lbool Z3_API Z3_check_assumptions ( __in Z3_context  c,
__in unsigned  num_assumptions,
__in_ecount(num_assumptions) Z3_ast  assumptions[],
__out Z3_model *  m,
__out Z3_ast *  proof,
__inout unsigned *  core_size,
__inout_ecount(num_assumptions) Z3_ast  core[] 
)

Check whether the given logical context and optional assumptions is consistent or not.

If the logical context is not unsatisfiable (i.e., the return value is different from Z3_L_FALSE), a non-0 model argument is passed in, and model construction is enabled (see Z3_mk_config), then a model is stored in m. Otherwise, m is left unchanged. The caller is responsible for deleting the model using the function Z3_del_model.

Remarks:
If the model argument is non-0, then model construction must be enabled using configuration parameters (See, Z3_mk_config).
Parameters:
c logical context.
num_assumptions number of auxiliary assumptions.
assumptions array of auxiliary assumptions
m optional pointer to a model.
proof optional pointer to a proof term.
core_size size of unsatisfiable core.
core pointer to an array receiveing unsatisfiable core. The unsatisfiable core is a subset of the assumptions, so the array has the same size as the assumptions. The core array is not populated if core_size is set to 0.
See also:
Z3_check

Z3_del_model

Referenced by unsat_core_and_proof_example().

void Z3_API Z3_close_log ( __in Z3_context  c  ) 

Close interaction log.

Z3_string Z3_API Z3_context_to_string ( __in Z3_context  c  ) 

Convert the given logical context into a string.

This function is mainly used for debugging purposes. It displays the internal structure of a logical context.

Warning:
The result buffer is statically allocated by Z3. It will be automatically deallocated when Z3_del_context is invoked. So, the buffer is invalidated in the next call to Z3_context_to_string.

Referenced by simple_example().

void Z3_API Z3_del_config ( __in Z3_config  c  ) 

void Z3_API Z3_del_constructor ( __in Z3_context  c,
__in Z3_constructor  constr 
)

Reclaim memory allocated to constructor.

Parameters:
c logical context.
constr constructor.

Referenced by forest_example(), and tree_example().

void Z3_API Z3_del_constructor_list ( __in Z3_context  c,
__in Z3_constructor_list  clist 
)

reclaim memory allocated for constructor list.

Each constructor inside the constructor list must be independently reclaimed using Z3_del_constructor.

Parameters:
c logical context.
clist constructor list container.

Referenced by forest_example().

void Z3_API Z3_del_context ( __in Z3_context  c  ) 

void Z3_API Z3_del_literals ( __in Z3_context  c,
__in Z3_literals  lbls 
)

Delete a labels context.

See also:
Z3_get_relevant_labels

void Z3_API Z3_del_model ( __in Z3_context  c,
__in Z3_model  m 
)

void Z3_API Z3_disable_literal ( __in Z3_context  c,
__in Z3_literals  lbls,
__in unsigned  idx 
)

Disable label.

The disabled label is not going to be used when blocking the subsequent search.

See also:
Z3_block_literals

Z3_bool Z3_API Z3_eval ( __in Z3_context  c,
__in Z3_model  m,
__in Z3_ast  t,
__out Z3_ast *  v 
)

Evaluate the AST node t in the given model. Return Z3_TRUE if succeeded, and store the result in v.

The evaluation may fail for the following reasons:

  • t contains a quantifier or bound variable.

  • the model m is partial, that is, it doesn't have a complete interpretation for free functions. That is, the option PARTIAL_MODELS=true was used.

  • the evaluator doesn't have support for some interpreted operator.

  • t is type incorrect.

  • The result of an intepreted operator in t is undefined (e.g. division by zero).

Referenced by display_model(), and eval_example1().

Z3_bool Z3_API Z3_eval_decl ( __in Z3_context  c,
__in Z3_model  m,
__in Z3_func_decl  d,
__in unsigned  num_args,
__in_ecount(num_args) Z3_ast  args[],
__out Z3_ast *  v 
)

Evaluate declaration given values.

Provides direct way to evaluate declarations without going over terms.

Z3_bool Z3_API Z3_eval_func_decl ( __in Z3_context  c,
__in Z3_model  m,
__in Z3_func_decl  decl,
__out Z3_ast *  v 
)

Return the value of the given constant or function in the given model.

Referenced by error_code_example1().

Z3_ast Z3_API Z3_get_app_arg ( __in Z3_context  c,
__in Z3_app  a,
__in unsigned  i 
)

Return the i-th argument of the given application.

Precondition:
i < Z3_get_num_args(c, a)

Referenced by display_ast().

Z3_func_decl Z3_API Z3_get_app_decl ( __in Z3_context  c,
__in Z3_app  a 
)

Return the declaration of a constant or function application.

Referenced by display_ast(), error_code_example1(), and parser_example2().

unsigned Z3_API Z3_get_app_num_args ( __in Z3_context  c,
__in Z3_app  a 
)

Return the number of argument of an application. If t is an constant, then the number of arguments is 0.

Referenced by display_ast().

Z3_sort Z3_API Z3_get_array_sort_domain ( __in Z3_context  c,
__in Z3_sort  t 
)

Return the domain of the given array sort.

Precondition:
Z3_get_sort_kind(c, t) == Z3_ARRAY_SORT
See also:
Z3_mk_array_sort

Z3_get_sort_kind

Referenced by array_example3(), and display_sort().

Z3_sort Z3_API Z3_get_array_sort_range ( __in Z3_context  c,
__in Z3_sort  t 
)

Return the range of the given array sort.

Precondition:
Z3_get_sort_kind(c, t) == Z3_ARRAY_SORT
See also:
Z3_mk_array_sort

Z3_get_sort_kind

Referenced by array_example3(), and display_sort().

void Z3_API Z3_get_array_value ( __in Z3_context  c,
__in Z3_ast  v,
__in unsigned  num_entries,
__inout_ecount(num_entries) Z3_ast  indices[],
__inout_ecount(num_entries) Z3_ast  values[],
__out Z3_ast *  else_value 
)

An array values is represented as a dictionary plus a default (else) value. This function returns the array graph.

Precondition:
Z3_TRUE == Z3_is_array_value(c, v, &num_entries)

Z3_ast_kind Z3_API Z3_get_ast_kind ( __in Z3_context  c,
__in Z3_ast  a 
)

Return the kind of the given AST.

Referenced by display_ast().

Z3_lbool Z3_API Z3_get_bool_value ( __in Z3_context  c,
__in Z3_ast  a 
)

Return Z3_L_TRUE if a is true, Z3_L_FALSE if it is false, and Z3_L_UNDEF otherwise.

unsigned Z3_API Z3_get_bv_sort_size ( __in Z3_context  c,
__in Z3_sort  t 
)

Return the size of the given bit-vector sort.

Precondition:
Z3_get_sort_kind(c, t) == Z3_BV_SORT
See also:
Z3_mk_bv_sort

Z3_get_sort_kind

Referenced by display_sort().

Z3_ast Z3_API Z3_get_context_assignment ( __in Z3_context  c  ) 

Extract satisfying assignment from context as a conjunction.

This function can be used for debugging purposes. It returns a conjunction of formulas that are assigned to true in the current context. This conjunction will contain not only the assertions that are set to true under the current assignment, but will also include additional literals if there has been a call to Z3_check or Z3_check_and_get_model.

Z3_func_decl Z3_API Z3_get_datatype_sort_constructor ( __in Z3_context  c,
__in Z3_sort  t,
unsigned  idx 
)

Return idx'th constructor.

Precondition:
Z3_get_sort_kind(t) == Z3_DATATYPE_SORT

idx < Z3_get_datatype_sort_num_constructors(c, t)

See also:
Z3_get_datatype_sort_num_constructors

Z3_get_datatype_sort_recognizer

Z3_get_datatype_sort_constructor_accessor

Z3_func_decl Z3_API Z3_get_datatype_sort_constructor_accessor ( __in Z3_context  c,
__in Z3_sort  t,
unsigned  idx_c,
unsigned  idx_a 
)

Return idx_a'th accessor for the idx_c'th constructor.

Precondition:
Z3_get_sort_kind(t) == Z3_DATATYPE_SORT

idx_c < Z3_get_datatype_sort_num_constructors(c, t)

idx_a < Z3_get_domain_size(c, Z3_get_datatype_sort_constructor(c, idx_c))

See also:
Z3_get_datatype_sort_num_constructors

Z3_get_datatype_sort_constructor

Z3_get_datatype_sort_recognizer

unsigned Z3_API Z3_get_datatype_sort_num_constructors ( __in Z3_context  c,
__in Z3_sort  t 
)

Return number of constructors for datatype.

Precondition:
Z3_get_sort_kind(t) == Z3_DATATYPE_SORT
See also:
Z3_get_datatype_sort_constructor

Z3_get_datatype_sort_recognizer

Z3_get_datatype_sort_constructor_accessor

Referenced by display_sort().

Z3_func_decl Z3_API Z3_get_datatype_sort_recognizer ( __in Z3_context  c,
__in Z3_sort  t,
unsigned  idx 
)

Return idx'th recognizer.

Precondition:
Z3_get_sort_kind(t) == Z3_DATATYPE_SORT

idx < Z3_get_datatype_sort_num_constructors(c, t)

See also:
Z3_get_datatype_sort_num_constructors

Z3_get_datatype_sort_constructor

Z3_get_datatype_sort_constructor_accessor

Z3_ast Z3_API Z3_get_decl_ast_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the expresson value associated with an expression parameter.

Precondition:
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_AST

double Z3_API Z3_get_decl_double_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the double value associated with an double parameter.

Precondition:
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_DOUBLE

Z3_func_decl Z3_API Z3_get_decl_func_decl_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the expresson value associated with an expression parameter.

Precondition:
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_FUNC_DECL

int Z3_API Z3_get_decl_int_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the integer value associated with an integer parameter.

Precondition:
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_INT

Z3_decl_kind Z3_API Z3_get_decl_kind ( __in Z3_context  c,
__in Z3_func_decl  d 
)

Return declaration kind corresponding to declaration.

Z3_symbol Z3_API Z3_get_decl_name ( __in Z3_context  c,
__in Z3_func_decl  d 
)

Return the constant declaration name as a symbol.

Referenced by display_function_interpretations(), and display_model().

unsigned Z3_API Z3_get_decl_num_parameters ( __in Z3_context  c,
__in Z3_func_decl  d 
)

Return the number of parameters associated with a declaration.

Z3_parameter_kind Z3_API Z3_get_decl_parameter_kind ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the parameter type associated with a declaration.

Parameters:
c the context
d the function declaration
idx is the index of the named parameter it should be between 0 and the number of parameters.

Z3_string Z3_API Z3_get_decl_rational_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the rational value, as a string, associated with a rational parameter.

Precondition:
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_RATIONAL

Z3_sort Z3_API Z3_get_decl_sort_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the sort value associated with a sort parameter.

Precondition:
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_SORT

Z3_symbol Z3_API Z3_get_decl_symbol_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the double value associated with an double parameter.

Precondition:
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_SYMBOL

Z3_sort Z3_API Z3_get_domain ( __in Z3_context  c,
__in Z3_func_decl  d,
__in unsigned  i 
)

Return the sort of the i-th parameter of the given function declaration.

Precondition:
i < Z3_get_domain_size(d)
See also:
Z3_get_domain_size

Referenced by assert_comm_axiom(), and assert_inj_axiom().

unsigned Z3_API Z3_get_domain_size ( __in Z3_context  c,
__in Z3_func_decl  d 
)

Return the number of parameters of the given declaration.

See also:
Z3_get_domain_size

Referenced by assert_comm_axiom(), and assert_inj_axiom().

Z3_error_code Z3_API Z3_get_error_code ( __in Z3_context  c  ) 

Return the error code for the last API call.

A call to a Z3 function may return a non Z3_OK error code, when it is not used correctly.

See also:
Z3_set_error_handler

Referenced by error_code_example1().

Z3_string Z3_API Z3_get_error_msg ( __in Z3_error_code  err  ) 

Return a string describing the given error code.

Referenced by error_code_example2(), and parser_example5().

Z3_literals Z3_API Z3_get_guessed_literals ( __in Z3_context  c  ) 

Retrieve the set of literals that whose assignment were guess, but not propagated during the search.

See also:
Z3_del_literals

Z3_get_num_literals

Z3_get_label_symbol

Z3_get_literal

Z3_lbool Z3_API Z3_get_implied_equalities ( __in Z3_context  c,
__in unsigned  num_terms,
__in_ecount(num_terms) Z3_ast  terms[],
__out_ecount(num_terms) unsigned  class_ids[] 
)

Retrieve congruence class representatives for terms.

The function can be used for relying on Z3 to identify equal terms under the current set of assumptions. The array of terms and array of class identifiers should have the same length. The class identifiers are numerals that are assigned to the same value for their corresponding terms if the current context forces the terms to be equal. You cannot deduce that terms corresponding to different numerals must be all different, (especially when using non-convex theories). Since Z3 does not rely on exhaustive equality propagation, it is the case that that not all implied equalities are returned by this call. Only implied equalities that follow from simple constraint and equality propagation is discovered.

A side-effect of the function is a satisfiability check. The function return Z3_L_FALSE if the current assertions are not satisfiable.

See also:
Z3_check_and_get_model

Z3_check

Referenced by get_implied_equalities_example().

unsigned Z3_API Z3_get_index_value ( __in Z3_context  c,
__in Z3_ast  a 
)

Return index of de-Brujin bound variable.

Precondition:
Z3_get_ast_kind(a) == Z3_VAR_AST

Referenced by RawContext::GetVarIndex().

Z3_symbol Z3_API Z3_get_label_symbol ( __in Z3_context  c,
__in Z3_literals  lbls,
__in unsigned  idx 
)

Retrieve label symbol at idx.

Z3_ast Z3_API Z3_get_literal ( __in Z3_context  c,
__in Z3_literals  lbls,
__in unsigned  idx 
)

Retrieve literal expression at idx.

Z3_func_decl Z3_API Z3_get_model_constant ( __in Z3_context  c,
__in Z3_model  m,
__in unsigned  i 
)

Return the i-th constant in the given model.

Precondition:
i < Z3_get_model_num_constants(c, m)
See also:
Z3_eval

Referenced by display_model().

Z3_func_decl Z3_API Z3_get_model_func_decl ( __in Z3_context  c,
__in Z3_model  m,
__in unsigned  i 
)

Return the declaration of the i-th function in the given model.

Precondition:
i < Z3_get_model_num_funcs(c, m)
See also:
Z3_get_model_num_funcs

Referenced by display_function_interpretations().

Z3_ast Z3_API Z3_get_model_func_else ( __in Z3_context  c,
__in Z3_model  m,
__in unsigned  i 
)

Return the 'else' value of the i-th function interpretation in the given model.

A function interpretation is represented as a finite map and an 'else' value.

Precondition:
i < Z3_get_model_num_funcs(c, m)
See also:
Z3_get_model_num_funcs

Z3_get_model_func_num_entries

Z3_get_model_func_entry_num_args

Z3_get_model_func_entry_arg

Referenced by display_function_interpretations().

Z3_ast Z3_API Z3_get_model_func_entry_arg ( __in Z3_context  c,
__in Z3_model  m,
__in unsigned  i,
__in unsigned  j,
__in unsigned  k 
)

Return the k-th argument of the j-th entry of the i-th function interpretation in the given model.

A function interpretation is represented as a finite map and an 'else' value. This function returns the j-th entry of this map.

An entry represents the value of a function given a set of arguments. That is: it has the following format <tt>f(args[0],...,args[num_args - 1]) = val.

Precondition:
i < Z3_get_model_num_funcs(c, m)

j < Z3_get_model_func_num_entries(c, m, i)

k < Z3_get_model_func_entry_num_args(c, m, i, j)

See also:
Z3_get_model_num_funcs

Z3_get_model_func_num_entries

Z3_get_model_func_entry_num_args

Referenced by display_function_interpretations().

unsigned Z3_API Z3_get_model_func_entry_num_args ( __in Z3_context  c,
__in Z3_model  m,
__in unsigned  i,
__in unsigned  j 
)

Return the number of arguments of the j-th entry of the i-th function interpretation in the given model.

A function interpretation is represented as a finite map and an 'else' value. This function returns the j-th entry of this map.

An entry represents the value of a function given a set of arguments. That is: it has the following format <tt>f(args[0],...,args[num_args - 1]) = val.

Precondition:
i < Z3_get_model_num_funcs(c, m)

j < Z3_get_model_func_num_entries(c, m, i)

See also:
Z3_get_model_num_funcs

Z3_get_model_func_num_entries

Z3_get_model_func_entry_arg

Referenced by display_function_interpretations().

Z3_ast Z3_API Z3_get_model_func_entry_value ( __in Z3_context  c,
__in Z3_model  m,
__in unsigned  i,
__in unsigned  j 
)

Return the return value of the j-th entry of the i-th function interpretation in the given model.

A function interpretation is represented as a finite map and an 'else' value. This function returns the j-th entry of this map.

An entry represents the value of a function given a set of arguments. That is: it has the following format <tt>f(args[0],...,args[num_args - 1]) = val.

Precondition:
i < Z3_get_model_num_funcs(c, m)

j < Z3_get_model_func_num_entries(c, m, i)

See also:
Z3_get_model_num_funcs

Z3_get_model_func_num_entries

Referenced by display_function_interpretations().

unsigned Z3_API Z3_get_model_func_num_entries ( __in Z3_context  c,
__in Z3_model  m,
__in unsigned  i 
)

Return the number of entries of the i-th function interpretation in the given model.

A function interpretation is represented as a finite map and an 'else' value.

Precondition:
i < Z3_get_model_num_funcs(c, m)
See also:
Z3_get_model_num_funcs

Z3_get_model_func_else

Z3_get_model_func_entry_num_args

Z3_get_model_func_entry_arg

Referenced by display_function_interpretations().

unsigned Z3_API Z3_get_model_num_constants ( __in Z3_context  c,
__in Z3_model  m 
)

Return the number of constants assigned by the given model.

See also:
Z3_get_model_constant

Referenced by display_model().

unsigned Z3_API Z3_get_model_num_funcs ( __in Z3_context  c,
__in Z3_model  m 
)

Return the number of function interpretations in the given model.

A function interpretation is represented as a finite map and an 'else' value. Each entry in the finite map represents the value of a function given a set of arguments.

See also:
Z3_get_model_func_decl

Z3_get_model_func_else

Z3_get_model_func_num_entries

Z3_get_model_func_entry_num_args

Z3_get_model_func_entry_arg

Referenced by display_function_interpretations().

unsigned Z3_API Z3_get_num_literals ( __in Z3_context  c,
__in Z3_literals  lbls 
)

Retrieve the number of label symbols that were returned.

See also:
Z3_get_relevant_labels

Z3_bool Z3_API Z3_get_numeral_int ( __in Z3_context  c,
__in Z3_ast  v,
__out int *  i 
)

Similar to Z3_get_numeral_string, but only succeeds if the value can fit in a machine int. Return Z3_TRUE if the call succeeded.

Precondition:
Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
See also:
Z3_get_numeral_string

Z3_bool Z3_API Z3_get_numeral_int64 ( __in Z3_context  c,
__in Z3_ast  v,
__out __int64 *  i 
)

Similar to Z3_get_numeral_string, but only succeeds if the value can fit in a machine __int64 int. Return Z3_TRUE if the call succeeded.

Precondition:
Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
See also:
Z3_get_numeral_string

Z3_bool Z3_API Z3_get_numeral_small ( __in Z3_context  c,
__in Z3_ast  a,
__out __int64 *  num,
__out __int64 *  den 
)

Return numeral value, as a pair of 64 bit numbers if the representation fits.

Parameters:
c logical context.
a term.
num numerator.
den denominator.
Preturn Z3_TRUE if the numeral value fits in 64 bit numerals, Z3_FALSE otherwise.

Precondition:
Z3_get_ast_kind(a) == Z3_NUMERAL_AST

Z3_string Z3_API Z3_get_numeral_string ( __in Z3_context  c,
__in Z3_ast  a 
)

Return numeral value, as a string of a numeric constant term.

Precondition:
Z3_get_ast_kind(c, a) == Z3_NUMERAL_AST

Referenced by display_ast(), and error_code_example1().

Z3_bool Z3_API Z3_get_numeral_uint ( __in Z3_context  c,
__in Z3_ast  v,
__out unsigned *  u 
)

Similar to Z3_get_numeral_string, but only succeeds if the value can fit in a machine unsigned int. Return Z3_TRUE if the call succeeded.

Precondition:
Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
See also:
Z3_get_numeral_string

Z3_bool Z3_API Z3_get_numeral_uint64 ( __in Z3_context  c,
__in Z3_ast  v,
__out unsigned __int64 *  u 
)

Similar to Z3_get_numeral_string, but only succeeds if the value can fit in a machine unsigned __int64 int. Return Z3_TRUE if the call succeeded.

Precondition:
Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
See also:
Z3_get_numeral_string

Z3_ast Z3_API Z3_get_pattern ( __in Z3_context  c,
__in Z3_pattern  p,
__in unsigned  idx 
)

Return i'th ast in pattern.

unsigned Z3_API Z3_get_pattern_num_terms ( __in Z3_context  c,
__in Z3_pattern  p 
)

Return number of terms in pattern.

Z3_ast Z3_API Z3_get_quantifier_body ( __in Z3_context  c,
__in Z3_ast  a 
)

Return body of quantifier.

Precondition:
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST

Z3_symbol Z3_API Z3_get_quantifier_bound_name ( __in Z3_context  c,
__in Z3_ast  a,
unsigned  i 
)

Return symbol of the i'th bound variable.

Precondition:
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST

Z3_sort Z3_API Z3_get_quantifier_bound_sort ( __in Z3_context  c,
__in Z3_ast  a,
unsigned  i 
)

Return sort of the i'th bound variable.

Precondition:
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST

unsigned Z3_API Z3_get_quantifier_num_bound ( __in Z3_context  c,
__in Z3_ast  a 
)

Return number of bound variables of quantifier.

Precondition:
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST

unsigned Z3_API Z3_get_quantifier_num_patterns ( __in Z3_context  c,
__in Z3_ast  a 
)

Return number of patterns used in quantifier.

Precondition:
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST

Z3_pattern Z3_API Z3_get_quantifier_pattern_ast ( __in Z3_context  c,
__in Z3_ast  a,
unsigned  i 
)

Return i'th pattern.

Precondition:
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST

unsigned Z3_API Z3_get_quantifier_weight ( __in Z3_context  c,
__in Z3_ast  a 
)

Obtain weight of quantifier.

Precondition:
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST

Z3_sort Z3_API Z3_get_range ( __in Z3_context  c,
__in Z3_func_decl  d 
)

Return the range of the given declaration.

If d is a constant (i.e., has zero arguments), then this function returns the sort of the constant.

Referenced by assert_comm_axiom(), assert_inj_axiom(), and display_sort().

Z3_literals Z3_API Z3_get_relevant_labels ( __in Z3_context  c  ) 

Retrieve the set of labels that were relevant in the context of the current satisfied context.

See also:
Z3_del_literals

Z3_get_num_literals

Z3_get_label_symbol

Z3_get_literal

Z3_literals Z3_API Z3_get_relevant_literals ( __in Z3_context  c  ) 

Retrieve the set of literals that satisfy the current context.

See also:
Z3_del_literals

Z3_get_num_literals

Z3_get_label_symbol

Z3_get_literal

Z3_search_failure Z3_API Z3_get_search_failure ( __in Z3_context  c  ) 

Retrieve reason for search failure.

If a call to Z3_check or Z3_check_and_get_model returns Z3_L_UNDEF, use this facility to determine the more detailed cause of search failure.

Referenced by quantifier_example1().

Z3_ast Z3_API Z3_get_smtlib_assumption ( __in Z3_context  c,
__in unsigned  i 
)

Return the i-th assumption parsed by the last call to Z3_parse_smtlib_string or Z3_parse_smtlib_file.

Precondition:
i < Z3_get_smtlib_num_assumptions(c)

Referenced by parser_example4().

Z3_func_decl Z3_API Z3_get_smtlib_decl ( __in Z3_context  c,
__in unsigned  i 
)

Return the i-th declaration parsed by the last call to Z3_parse_smtlib_string or Z3_parse_smtlib_file.

Precondition:
i < Z3_get_smtlib_num_decls(c)

Referenced by parser_example4().

Z3_string Z3_API Z3_get_smtlib_error ( __in Z3_context  c  ) 

Retrieve that last error message information generated from parsing.

Referenced by parser_example5().

Z3_ast Z3_API Z3_get_smtlib_formula ( __in Z3_context  c,
__in unsigned  i 
)

Return the i-th formula parsed by the last call to Z3_parse_smtlib_string or Z3_parse_smtlib_file.

Precondition:
i < Z3_get_smtlib_num_formulas(c)

Referenced by assert_comm_axiom(), parser_example1(), parser_example2(), parser_example3(), and parser_example4().

unsigned Z3_API Z3_get_smtlib_num_assumptions ( __in Z3_context  c  ) 

Return the number of SMTLIB assumptions parsed by Z3_parse_smtlib_string or Z3_parse_smtlib_file.

Referenced by parser_example4().

unsigned Z3_API Z3_get_smtlib_num_decls ( __in Z3_context  c  ) 

Return the number of declarations parsed by Z3_parse_smtlib_string or Z3_parse_smtlib_file.

Referenced by parser_example4().

unsigned Z3_API Z3_get_smtlib_num_formulas ( __in Z3_context  c  ) 

Return the number of SMTLIB formulas parsed by the last call to Z3_parse_smtlib_string or Z3_parse_smtlib_file.

Referenced by parser_example1(), and parser_example4().

unsigned Z3_API Z3_get_smtlib_num_sorts ( __in Z3_context  c  ) 

Return the number of sorts parsed by Z3_parse_smtlib_string or Z3_parse_smtlib_file.

Z3_sort Z3_API Z3_get_smtlib_sort ( __in Z3_context  c,
__in unsigned  i 
)

Return the i-th sort parsed by the last call to Z3_parse_smtlib_string or Z3_parse_smtlib_file.

Precondition:
i < Z3_get_smtlib_num_sorts(c)

Z3_sort Z3_API Z3_get_sort ( __in Z3_context  c,
__in Z3_ast  a 
)

Return the sort of an AST node.

The AST node must be a constant, application, numeral, bound variable, or quantifier.

Referenced by display_ast(), and mk_tuple_update().

Z3_sort_kind Z3_API Z3_get_sort_kind ( __in Z3_context  c,
__in Z3_sort  t 
)

Return the sort kind (e.g., array, tuple, int, bool, etc).

See also:
Z3_sort_kind

Referenced by array_example3(), display_sort(), and mk_tuple_update().

Z3_symbol Z3_API Z3_get_sort_name ( __in Z3_context  c,
__in Z3_sort  d 
)

Return the sort name as a symbol.

Referenced by display_sort().

int Z3_API Z3_get_symbol_int ( __in Z3_context  c,
__in Z3_symbol  s 
)

Return the symbol int value.

Precondition:
Z3_get_symbol_kind(s) == Z3_INT_SYMBOL
See also:
Z3_mk_int_symbol

Referenced by display_symbol().

Z3_symbol_kind Z3_API Z3_get_symbol_kind ( __in Z3_context  c,
__in Z3_symbol  s 
)

Return Z3_INT_SYMBOL if the symbol was constructed using Z3_mk_int_symbol, and Z3_STRING_SYMBOL if the symbol was constructed using Z3_mk_string_symbol.

Referenced by display_symbol().

Z3_string Z3_API Z3_get_symbol_string ( __in Z3_context  c,
__in Z3_symbol  s 
)

Return the symbol name.

Precondition:
Z3_get_symbol_string(s) == Z3_STRING_SYMBOL
Warning:
The returned buffer is statically allocated by Z3. It will be automatically deallocated when Z3_del_context is invoked. So, the buffer is invalidated in the next call to Z3_get_symbol_string.
See also:
Z3_mk_string_symbol

Referenced by display_symbol().

Z3_func_decl Z3_API Z3_get_tuple_sort_field_decl ( __in Z3_context  c,
__in Z3_sort  t,
__in unsigned  i 
)

Return the i-th field declaration (i.e., projection function declaration) of the given tuple sort.

Precondition:
Z3_get_sort_kind(t) == Z3_DATATYPE_SORT

i < Z3_get_tuple_sort_num_fields(c, t)

See also:
Z3_mk_tuple_sort

Z3_get_sort_kind

Referenced by display_sort(), and mk_tuple_update().

Z3_func_decl Z3_API Z3_get_tuple_sort_mk_decl ( __in Z3_context  c,
__in Z3_sort  t 
)

Return the constructor declaration of the given tuple sort.

Precondition:
Z3_get_sort_kind(c, t) == Z3_DATATYPE_SORT
See also:
Z3_mk_tuple_sort

Z3_get_sort_kind

Referenced by mk_tuple_update().

unsigned Z3_API Z3_get_tuple_sort_num_fields ( __in Z3_context  c,
__in Z3_sort  t 
)

Return the number of fields of the given tuple sort.

Precondition:
Z3_get_sort_kind(c, t) == Z3_DATATYPE_SORT
See also:
Z3_mk_tuple_sort

Z3_get_sort_kind

Referenced by display_sort(), and mk_tuple_update().

void Z3_API Z3_get_version ( __out unsigned *  major,
__out unsigned *  minor,
__out unsigned *  build_number,
__out unsigned *  revision_number 
)

Return Z3 version number information.

Referenced by display_version().

Z3_bool Z3_API Z3_is_array_value ( __in Z3_context  c,
__in Z3_ast  v,
__out unsigned *  num_entries 
)

Determine whether the term encodes an array value. Return the number of entries mapping to non-default values of the array.

Z3_bool Z3_API Z3_is_eq_ast ( __in Z3_context  c,
__in Z3_ast  t1,
Z3_ast  t2 
)

compare terms.

Z3_bool Z3_API Z3_is_eq_sort ( __in Z3_context  c,
__in Z3_sort  s1,
__in Z3_sort  s2 
)

compare sorts.

Z3_bool Z3_API Z3_is_quantifier_forall ( __in Z3_context  c,
__in Z3_ast  a 
)

Determine if quantifier is universal.

Precondition:
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST

Z3_ast Z3_API Z3_mk_add ( __in Z3_context  c,
__in unsigned  num_args,
__in_ecount(num_args) Z3_ast const   args[] 
)

Create an AST node representing args[0] + ... + args[num_args-1].

The array args must have num_args elements. All arguments must have int or real sort.

Remarks:
The number of arguments must be greater than zero.

Referenced by eval_example1(), find_model_example2(), and prove_example2().

Z3_ast Z3_API Z3_mk_and ( __in Z3_context  c,
__in unsigned  num_args,
__in_ecount(num_args) Z3_ast const   args[] 
)

Create an AST node representing args[0] and ... and args[num_args-1].

The array args must have num_args elements. All arguments must have Boolean sort.

Remarks:
The number of arguments must be greater than zero.

Referenced by demorgan(), tuple_example1(), and unsat_core_and_proof_example().

Z3_ast Z3_API Z3_mk_app ( __in Z3_context  c,
__in Z3_func_decl  d,
__in unsigned  num_args,
__in_ecount(num_args) Z3_ast const   args[] 
)

Z3_ast Z3_API Z3_mk_array_default ( __in Z3_context  c,
__in Z3_ast  array 
)

Access the array default value. Produces the default range value, for arrays that can be represented as finite maps with a default range value.

Parameters:
c logical context.
array array value whose default range value is accessed.

Z3_sort Z3_API Z3_mk_array_sort ( __in Z3_context  c,
__in Z3_sort  domain,
__in Z3_sort  range 
)

Create an array type.

We usually represent the array type as: [domain -> range]. Arrays are usually used to model the heap/memory in software verification.

See also:
Z3_mk_select

Z3_mk_store

Referenced by array_example1(), array_example2(), and array_example3().

Z3_sort Z3_API Z3_mk_bool_sort ( __in Z3_context  c  ) 

Create the Boolean type.

This type is used to create propositional variables and predicates.

Referenced by array_example2(), array_example3(), demorgan(), mk_bool_var(), and two_contexts_example1().

Z3_ast Z3_API Z3_mk_bound ( __in Z3_context  c,
__in unsigned  index,
__in Z3_sort  ty 
)

Create a bound variable.

Bound variables are indexed by de-Bruijn indices. It is perhaps easiest to explain the meaning of de-Bruijn indices by indicating the compilation process from non-de-Bruijn formulas to de-Bruijn format.

       abs(forall (x1) phi) = forall (x1) abs1(phi, x1, 0)
       abs(forall (x1, x2) phi) = abs(forall (x1) abs(forall (x2) phi))
       abs1(x, x, n) = b_n
       abs1(y, x, n) = y
       abs1(f(t1,...,tn), x, n) = f(abs1(t1,x,n), ..., abs1(tn,x,n))
       abs1(forall (x1) phi, x, n) = forall (x1) (abs1(phi, x, n+1))
       

The last line is significant: the index of a bound variable is different depending on the scope in which it appears. The deeper x appears, the higher is its index.

Parameters:
c logical context
index de-Bruijn index
ty sort of the bound variable
See also:
Z3_mk_forall

Z3_mk_exists

Referenced by assert_inj_axiom().

Z3_ast Z3_API Z3_mk_bv2int ( __in Z3_context  c,
__in Z3_ast  t1,
Z3_bool  is_signed 
)

Create an integer from the bit-vector argument t1. If is_signed is false, then the bit-vector t1 is treated as unsigned. So the result is non-negative and in the range [0..2^N-1], where N are the number of bits in t1. If is_signed is true, t1 is treated as a signed bit-vector.

NB. This function is essentially treated as uninterpreted. So you cannot expect Z3 to precisely reflect the semantics of this function when solving constraints with this function.

The node t1 must have a bit-vector sort.

Z3_sort Z3_API Z3_mk_bv_sort ( __in Z3_context  c,
__in unsigned  sz 
)

Create a bit-vector type of the given size.

This type can also be seen as a machine integer.

Remarks:
The size of the bitvector type must be greater than zero.

Referenced by bitvector_example1(), and bitvector_example2().

Z3_ast Z3_API Z3_mk_bvadd ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Standard two's complement addition.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvadd_no_overflow ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2,
Z3_bool  is_signed 
)

Create a predicate that checks that the bit-wise addition of t1 and t2 does not overflow.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvadd_no_underflow ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Create a predicate that checks that the bit-wise signed addition of t1 and t2 does not underflow.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvand ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Bitwise and.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvashr ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Arithmetic shift right.

It is like logical shift right except that the most significant bits of the result always copy the most significant bit of the second argument.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvlshr ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Logical shift right.

It is equivalent to unsigned division by 2^x where x is the value of the third argument.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvmul ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Standard two's complement multiplication.

The nodes t1 and t2 must have the same bit-vector sort.

Referenced by bitvector_example2().

Z3_ast Z3_API Z3_mk_bvmul_no_overflow ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2,
Z3_bool  is_signed 
)

Create a predicate that checks that the bit-wise multiplication of t1 and t2 does not overflow.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvmul_no_underflow ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Create a predicate that checks that the bit-wise signed multiplication of t1 and t2 does not underflow.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvnand ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Bitwise nand.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvneg ( __in Z3_context  c,
__in Z3_ast  t1 
)

Standard two's complement unary minus.

The node t1 must have bit-vector sort.

Z3_ast Z3_API Z3_mk_bvneg_no_overflow ( __in Z3_context  c,
__in Z3_ast  t1 
)

Check that bit-wise negation does not overflow when t1 is interpreted as a signed bit-vector.

The node t1 must have bit-vector sort.

Z3_ast Z3_API Z3_mk_bvnor ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Bitwise nor.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvnot ( __in Z3_context  c,
__in Z3_ast  t1 
)

Bitwise negation.

The node t1 must have a bit-vector sort.

Z3_ast Z3_API Z3_mk_bvor ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Bitwise or.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvsdiv ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Two's complement signed division.

It is defined in the following way:

  • The floor of t1/t2 if t2 is different from zero, and t1*t2 >= 0.

  • The ceiling of t1/t2 if t2 is different from zero, and t1*t2 < 0.

If t2 is zero, then the result is undefined.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvsdiv_no_overflow ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Create a predicate that checks that the bit-wise signed division of t1 and t2 does not overflow.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvsge ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Two's complement signed greater than or equal to.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvsgt ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Two's complement signed greater than.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvshl ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Shift left.

It is equivalent to multiplication by 2^x where x is the value of the third argument.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvsle ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Two's complement signed less than or equal to.

The nodes t1 and t2 must have the same bit-vector sort.

Referenced by bitvector_example1().

Z3_ast Z3_API Z3_mk_bvslt ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Two's complement signed less than.

It abbreviates:

      (or (and (= (extract[|m-1|:|m-1|] s) bit1)
               (= (extract[|m-1|:|m-1|] t) bit0))
          (and (= (extract[|m-1|:|m-1|] s) (extract[|m-1|:|m-1|] t))
               (bvult s t)))

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvsmod ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Two's complement signed remainder (sign follows divisor).

If t2 is zero, then the result is undefined.

The nodes t1 and t2 must have the same bit-vector sort.

See also:
Z3_mk_bvsrem

Z3_ast Z3_API Z3_mk_bvsrem ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Two's complement signed remainder (sign follows dividend).

It is defined as t1 - (t1 /s t2) * t2, where /s represents signed division. The most significant bit (sign) of the result is equal to the most significant bit of t1.

If t2 is zero, then the result is undefined.

The nodes t1 and t2 must have the same bit-vector sort.

See also:
Z3_mk_bvsmod

Z3_ast Z3_API Z3_mk_bvsub ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Standard two's complement subtraction.

The nodes t1 and t2 must have the same bit-vector sort.

Referenced by bitvector_example1(), and bitvector_example2().

Z3_ast Z3_API Z3_mk_bvsub_no_overflow ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Create a predicate that checks that the bit-wise signed subtraction of t1 and t2 does not overflow.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvsub_no_underflow ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2,
Z3_bool  is_signed 
)

Create a predicate that checks that the bit-wise subtraction of t1 and t2 does not underflow.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvudiv ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Unsigned division.

It is defined as the floor of t1/t2 if t2 is different from zero. If t2 is zero, then the result is undefined.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvuge ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Unsigned greater than or equal to.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvugt ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Unsigned greater than.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvule ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Unsigned less than or equal to.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvult ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Unsigned less than.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvurem ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Unsigned remainder.

It is defined as t1 - (t1 /u t2) * t2, where /u represents unsigned division.

If t2 is zero, then the result is undefined.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvxnor ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Bitwise xnor.

The nodes t1 and t2 must have the same bit-vector sort.

Z3_ast Z3_API Z3_mk_bvxor ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Bitwise exclusive-or.

The nodes t1 and t2 must have the same bit-vector sort.

Referenced by bitvector_example2().

Z3_ast Z3_API Z3_mk_concat ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Concatenate the given bit-vectors.

The nodes t1 and t2 must have (possibly different) bit-vector sorts

The result is a bit-vector of size n1+n2, where n1 (n2) is the size of t1 (t2).

Z3_config Z3_API Z3_mk_config (  ) 

Create a configuration.

Configurations are created in order to assign parameters prior to creating contexts for Z3 interaction. For example, if the users whishes to use model generation, then call:

Z3_set_param_value(cfg, "MODEL", "true")

See also:
Z3_set_param_value

Z3_del_config

Referenced by demorgan(), error_code_example1(), error_code_example2(), get_implied_equalities_example(), mk_context(), mk_proof_context(), parser_example3(), parser_example5(), and quantifier_example1().

Z3_ast Z3_API Z3_mk_const ( __in Z3_context  c,
__in Z3_symbol  s,
__in Z3_sort  ty 
)

Declare and create a constant.

This function is a shorthand for:

       \conly Z3_func_decl d = Z3_mk_func_decl(c, s, 0, 0, ty);
       \conly Z3_ast n            = Z3_mk_app(c, d, 0, 0);
       \conly 

See also:
Z3_mk_func_decl

Z3_mk_app

Referenced by array_example2(), demorgan(), mk_var(), prove_example1(), push_pop_example1(), and two_contexts_example1().

Z3_ast Z3_API Z3_mk_const_array ( __in Z3_context  c,
__in Z3_sort  domain,
__in Z3_ast  v 
)

Create the constant array.

Parameters:
c logical context.
domain domain sort for the array.
v value that the array maps to.

Z3_constructor Z3_API Z3_mk_constructor ( __in Z3_context  c,
__in Z3_symbol  name,
__in Z3_symbol  recognizer,
__in unsigned  num_fields,
__in_ecount(num_fields) Z3_symbol const   field_names[],
__in_ecount(num_fields) Z3_sort const   sorts[],
__in_ecount(num_fields) unsigned  sort_refs[] 
)

Create a constructor.

Parameters:
c logical context.
name constructor name.
recognizer name of recognizer function.
num_fields number of fields in constructor.
field_names names of the constructor fields.
sorts field sorts, 0 if the field sort refers to a recursive sort.
sort_refs reference to datatype sort that is an argument to the constructor; if the corresponding sort reference is 0, then the value in sort_refs should be an index referring to one of the recursive datatypes that is declared.

Referenced by forest_example(), and tree_example().

Z3_constructor_list Z3_API Z3_mk_constructor_list ( __in Z3_context  c,
__in unsigned  num_constructors,
__in_ecount(num_constructors) Z3_constructor  constructors[] 
)

Create list of constructors.

Parameters:
c logical context.
num_constructors number of constructors in list.
constructors list of constructors.

Referenced by forest_example().

Z3_context Z3_API Z3_mk_context ( __in Z3_config  c  ) 

Create a logical context using the given configuration.

After a context is created, the configuration cannot be changed. All main interaction with Z3 happens in the context of a Z3_context.

See also:
Z3_del_context

Referenced by demorgan(), get_implied_equalities_example(), and mk_context_custom().

Z3_sort Z3_API Z3_mk_datatype ( __in Z3_context  c,
__in Z3_symbol  name,
__in unsigned  num_constructors,
__inout_ecount(num_constructors) Z3_constructor  constructors[] 
)

Create recursive datatype. Return the datatype sort.

Parameters:
c logical context.
name name of datatype.
num_constructors number of constructors passed in.
constructors array of constructor containers.

Referenced by tree_example().

void Z3_API Z3_mk_datatypes ( __in Z3_context  c,
__in unsigned  num_sorts,
__in_ecount(num_sorts) Z3_symbol  sort_names[],
__out_ecount(num_sorts) Z3_sort  sorts[],
__inout_ecount(num_sorts) Z3_constructor_list  constructor_lists[] 
)

Create mutually recursive datatypes.

Parameters:
c logical context.
num_sorts number of datatype sorts.
sort_names names of datatype sorts.
sorts array of datattype sorts.
constructor_lists list of constructors, one list per sort.

Referenced by forest_example().

Z3_ast Z3_API Z3_mk_distinct ( __in Z3_context  c,
__in unsigned  num_args,
__in_ecount(num_args) Z3_ast const   args[] 
)

Create an AST node representing distinct(args[0], ..., args[num_args-1]).

The distinct construct is used for declaring the arguments pairwise distinct. That is, Forall 0 <= i < j < num_args. not args[i] = args[j].

All arguments must have the same sort.

Remarks:
The number of arguments of a distinct construct must be greater than one.

Referenced by array_example2().

Z3_ast Z3_API Z3_mk_div ( __in Z3_context  c,
__in Z3_ast  arg1,
__in Z3_ast  arg2 
)

Create an AST node representing arg1 div arg2.

The arguments must either both have int type or both have real type. If the arguments have int type, then the result type is an int type, otherwise the the result type is real.

Z3_sort Z3_API Z3_mk_enumeration_sort ( __in Z3_context  c,
__in Z3_symbol  name,
__in unsigned  n,
__in_ecount(n) Z3_symbol const   enum_names[],
__out_ecount(n) Z3_func_decl  enum_consts[],
__out_ecount(n) Z3_func_decl  enum_testers[] 
)

Create a enumeration sort.

An enumeration sort with n elements. This function will also declare the functions corresponding to the enumerations.

Parameters:
c logical context
name name of the enumeration sort.
n number of elemenets in enumeration sort.
enum_names names of the enumerated elements.
enum_consts constants corresponding to the enumerated elements.
enum_testers predicates testing if terms of the enumeration sort correspond to an enumeration.

Referenced by enum_example().

Z3_ast Z3_API Z3_mk_eq ( __in Z3_context  c,
__in Z3_ast  l,
__in Z3_ast  r 
)

Z3_ast Z3_API Z3_mk_exists ( __in Z3_context  c,
__in unsigned  weight,
__in unsigned  num_patterns,
__in_ecount(num_patterns) Z3_pattern const   patterns[],
__in unsigned  num_decls,
__in_ecount(num_decls) Z3_sort const   sorts[],
__in_ecount(num_decls) Z3_symbol const   decl_names[],
__in Z3_ast  body 
)

Create an exists formula. Similar to Z3_mk_forall.

See also:
Z3_mk_pattern

Z3_mk_bound

Z3_mk_forall

Z3_ast Z3_API Z3_mk_exists_const ( __in Z3_context  c,
unsigned  weight,
unsigned  num_bound,
__in_ecount(num_bound) Z3_app const *  bound,
unsigned  num_patterns,
__in_ecount(num_patterns) Z3_pattern_ast const *  patterns,
__in Z3_ast  body 
)

Similar to Z3_mk_forall_const.

Create an existential quantifier using a list of constants that will form the set of bound variables.

Parameters:
c logical context.
weight quantifiers are associated with weights indicating the importance of using the quantifier during instantiation. By default, pass the weight 0.
num_bound number of constants to be abstracted into bound variables.
bound array of constants to be abstracted into bound variables.
num_patterns number of patterns.
patterns array containing the patterns created using Z3_mk_pattern.
body the body of the quantifier.
See also:
Z3_mk_pattern

Z3_mk_forall_const

Z3_ast Z3_API Z3_mk_extract ( __in Z3_context  c,
__in unsigned  high,
__in unsigned  low,
__in Z3_ast  t1 
)

Extract the bits high down to low from a bitvector of size m to yield a new bitvector of size n, where n = high - low + 1.

The node t1 must have a bit-vector sort.

Z3_ast Z3_API Z3_mk_false ( __in Z3_context  c  ) 

Create an AST node representing false.

Referenced by ite_example(), and RawContext::MkFalse().

Z3_ast Z3_API Z3_mk_forall ( __in Z3_context  c,
__in unsigned  weight,
__in unsigned  num_patterns,
__in_ecount(num_patterns) Z3_pattern const   patterns[],
__in unsigned  num_decls,
__in_ecount(num_decls) Z3_sort const   sorts[],
__in_ecount(num_decls) Z3_symbol const   decl_names[],
__in Z3_ast  body 
)

Create a forall formula.

Parameters:
c logical context.
weight quantifiers are associated with weights indicating the importance of using the quantifier during instantiation. By default, pass the weight 0.
num_patterns number of patterns.
patterns array containing the patterns created using Z3_mk_pattern.
num_decls number of variables to be bound.
sorts the sorts of the bound variables.
decl_names names of the bound variables
body the body of the quantifier.
See also:
Z3_mk_pattern

Z3_mk_bound

Z3_mk_exists

Referenced by assert_inj_axiom().

Z3_ast Z3_API Z3_mk_forall_const ( __in Z3_context  c,
unsigned  weight,
unsigned  num_bound,
__in_ecount(num_bound) Z3_app const *  bound,
unsigned  num_patterns,
__in_ecount(num_patterns) Z3_pattern_ast const *  patterns,
__in Z3_ast  body 
)

Create a universal quantifier using a list of constants that will form the set of bound variables.

Parameters:
c logical context.
weight quantifiers are associated with weights indicating the importance of using the quantifier during instantiation. By default, pass the weight 0.
num_bound number of constants to be abstracted into bound variables.
bound array of constants to be abstracted into bound variables.
num_patterns number of patterns.
patterns array containing the patterns created using Z3_mk_pattern.
body the body of the quantifier.
See also:
Z3_mk_pattern

Z3_mk_exists_const

Z3_ast Z3_API Z3_mk_fresh_const ( __in Z3_context  c,
__in_z Z3_string  prefix,
__in Z3_sort  ty 
)

Declare and create a fresh constant.

This function is a shorthand for:

       \conly Z3_func_decl d = Z3_mk_fresh_func_decl(c, prefix, 0, 0, ty);
       \conly Z3_ast n            = Z3_mk_app(c, d, 0, 0);
       \conly 

Remarks:
If prefix is NULL, then it is assumed to be the empty string.
See also:
Z3_mk_func_decl

Z3_mk_app

Z3_func_decl Z3_API Z3_mk_fresh_func_decl ( __in Z3_context  c,
__in_z Z3_string  prefix,
__in unsigned  domain_size,
__in_ecount(domain_size) Z3_sort const   domain[],
__in Z3_sort  range 
)

Declare a fresh constant or function.

Z3 will generate an unique name for this function declaration. If prefix is different from NULL, then the name generate by Z3 will start with prefix.

Remarks:
If prefix is NULL, then it is assumed to be the empty string.
See also:
Z3_mk_func_decl

Referenced by assert_inj_axiom().

Z3_func_decl Z3_API Z3_mk_func_decl ( __in Z3_context  c,
__in Z3_symbol  s,
__in unsigned  domain_size,
__in_ecount(domain_size) Z3_sort const   domain[],
__in Z3_sort  range 
)

Declare a constant or function.

Parameters:
c logical context.
s name of the constant or function.
domain_size number of arguments. It is 0 when declaring a constant.
domain array containing the sort of each argument. The array must contain domain_size elements. It is 0 whe declaring a constant.
range sort of the constant or the return sort of the function.
After declaring a constant or function, the function Z3_mk_app can be used to create a constant or function application.

See also:
Z3_mk_app

Referenced by get_implied_equalities_example(), parser_example3(), prove_example1(), prove_example2(), and quantifier_example1().

Z3_ast Z3_API Z3_mk_ge ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Create greater than or equal to.

The nodes t1 and t2 must have the same sort, and must be int or real.

Referenced by push_pop_example1().

Z3_ast Z3_API Z3_mk_gt ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Create greater than.

The nodes t1 and t2 must have the same sort, and must be int or real.

Referenced by eval_example1(), find_model_example2(), and push_pop_example1().

Z3_ast Z3_API Z3_mk_iff ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Create an AST node representing t1 iff t2.

The nodes t1 and t2 must have Boolean sort.

Referenced by bitvector_example1(), demorgan(), and error_code_example2().

Z3_ast Z3_API Z3_mk_implies ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Create an AST node representing t1 implies t2.

The nodes t1 and t2 must have Boolean sort.

Referenced by array_example1(), forest_example(), list_example(), tree_example(), and tuple_example1().

Z3_func_decl Z3_API Z3_mk_injective_function ( __in Z3_context  c,
__in Z3_symbol  s,
unsigned  domain_size,
__in_ecount(domain_size) Z3_sort const   domain[],
__in Z3_sort  range 
)

Create injective function declaration.

Z3_ast Z3_API Z3_mk_int ( __in Z3_context  c,
__in int  v,
__in Z3_sort  ty 
)

Create a numeral of a given sort.

This function can be use to create numerals that fit in a machine integer. It is slightly faster than Z3_mk_numeral since it is not necessary to parse a string.

See also:
Z3_mk_numeral

Referenced by mk_int().

Z3_ast Z3_API Z3_mk_int2bv ( __in Z3_context  c,
__in unsigned  n,
__in Z3_ast  t1 
)

Create an n bit bit-vector from the integer argument t1.

NB. This function is essentially treated as uninterpreted. So you cannot expect Z3 to precisely reflect the semantics of this function when solving constraints with this function.

The node t1 must have integer sort.

Z3_ast Z3_API Z3_mk_int2real ( __in Z3_context  c,
__in Z3_ast  t1 
)

Coerce an integer to a real.

There is no converse operation exposed, but you can take the floor of a real by creating an auxiliary integer constant k and and asserting mk_int2real(k) <= t1 < mk_int2real(k)+1.

The node t1 must have sort integer.

Z3_ast Z3_API Z3_mk_int64 ( __in Z3_context  c,
__in __int64  v,
__in Z3_sort  ty 
)

Create a numeral of a given sort.

This function can be use to create numerals that fit in a machine __int64 integer. It is slightly faster than Z3_mk_numeral since it is not necessary to parse a string.

See also:
Z3_mk_numeral

Z3_sort Z3_API Z3_mk_int_sort ( __in Z3_context  c  ) 

Create an integer type.

This type is not the int type found in programming languages. A machine integer can be represented using bit-vectors. The function Z3_mk_bv_sort creates a bit-vector type.

See also:
Z3_mk_bv_sort

Referenced by array_example1(), array_example3(), get_implied_equalities_example(), list_example(), mk_int(), mk_int_var(), parser_example3(), prove_example2(), push_pop_example1(), and quantifier_example1().

Z3_symbol Z3_API Z3_mk_int_symbol ( __in Z3_context  c,
__in int  i 
)

Create a Z3 symbol using an integer.

Symbols are used to name several term and type constructors.

See also:
Z3_mk_string_symbol

Referenced by array_example2(), assert_inj_axiom(), demorgan(), and two_contexts_example1().

Z3_ast Z3_API Z3_mk_ite ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2,
__in Z3_ast  t3 
)

Create an AST node representing an if-then-else: ite(t1, t2, t3).

The node t1 must have Boolean sort, t2 and t3 must have the same sort. The sort of the new node is equal to the sort of t2 and t3.

Referenced by ite_example().

Z3_ast Z3_API Z3_mk_label ( __in Z3_context  c,
__in Z3_symbol  s,
Z3_bool  is_pos,
Z3_ast  f 
)

Create a labeled formula.

Parameters:
c logical context.
s name of the label.
is_pos label polarity.
f formula being labeled.
A label behaves as an identity function, so the truth value of the labeled formula is unchanged. Labels are used for identifying useful sub-formulas when generating counter-examples.

Z3_ast Z3_API Z3_mk_le ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Create less than or equal to.

The nodes t1 and t2 must have the same sort, and must be int or real.

Referenced by get_implied_equalities_example(), prove_example2(), and push_pop_example1().

Z3_sort Z3_API Z3_mk_list_sort ( __in Z3_context  c,
__in Z3_symbol  name,
__in Z3_sort  elem_sort,
__out Z3_func_decl *  nil_decl,
__out Z3_func_decl *  is_nil_decl,
__out Z3_func_decl *  cons_decl,
__out Z3_func_decl *  is_cons_decl,
__out Z3_func_decl *  head_decl,
__out Z3_func_decl *  tail_decl 
)

Create a list sort.

A list sort over elem_sort This function declares the corresponding constructors and testers for lists.

Parameters:
c logical context
name name of the list sort.
elem_sort sort of list elements.
nil_decl declaration for the empty list.
is_nil_decl test for the empty list.
cons_decl declaration for a cons cell.
is_cons_decl cons cell test.
head_decl list head.
tail_decl list tail.

Referenced by list_example().

Z3_ast Z3_API Z3_mk_lt ( __in Z3_context  c,
__in Z3_ast  t1,
__in Z3_ast  t2 
)

Create less than.

The nodes t1 and t2 must have the same sort, and must be int or real.

Referenced by eval_example1(), find_model_example2(), and prove_example2().

Z3_ast Z3_API Z3_mk_map ( __in Z3_context  c,
__in Z3_func_decl  f,
unsigned  n,
__in Z3_ast const *  args 
)

map f on the the argument arrays.

The n nodes args must be of array sorts [domain_i -> range_i]. The function declaration f must have type range_1 .. range_n -> range. v must have sort range. The sort of the result is [domain_i -> range].

See also:
Z3_mk_array_sort

Z3_mk_store

Z3_mk_select

Z3_ast Z3_API Z3_mk_mod ( __in Z3_context  c,
__in Z3_ast  arg1,
__in Z3_ast  arg2 
)

Create an AST node representing arg1 mod arg2.

The arguments must have int type.

Z3_ast Z3_API Z3_mk_mul ( __in Z3_context  c,
__in unsigned  num_args,
__in_ecount(num_args) Z3_ast const   args[] 
)

Create an AST node representing args[0] * ... * args[num_args-1].

The array args must have num_args elements. All arguments must have int or real sort.

Remarks:
Z3 has limited support for non-linear arithmetic.

The number of arguments must be greater than zero.

Z3_ast Z3_API Z3_mk_not ( __in Z3_context  c,
__in Z3_ast  a 
)

Create an AST node representing not(a).

The node a must have Boolean sort.

Referenced by demorgan(), enum_example(), find_model_example2(), forest_example(), list_example(), prove(), prove_example2(), quantifier_example1(), tree_example(), and unsat_core_and_proof_example().

Z3_ast Z3_API Z3_mk_numeral ( __in Z3_context  c,
__in_z Z3_string  numeral,
__in Z3_sort  ty 
)

Create a numeral of a given sort.

Parameters:
c logical context.
numeral A string representing the numeral value in decimal notation. If the given sort is a real, then the numeral can be a rational, that is, a string of the form [num]* / [num]*.
ty The sort of the numeral. In the current implementation, the given sort can be an int, real, or bit-vectors of arbitrary size.
See also:
Z3_mk_int

Z3_mk_unsigned_int

Referenced by bitvector_example1(), bitvector_example2(), push_pop_example1(), and tuple_example1().

Z3_ast Z3_API Z3_mk_or ( __in Z3_context  c,
__in unsigned  num_args,
__in_ecount(num_args) Z3_ast const   args[] 
)

Create an AST node representing args[0] or ... or args[num_args-1].

The array args must have num_args elements. All arguments must have Boolean sort.

Remarks:
The number of arguments must be greater than zero.

Referenced by array_example1(), demorgan(), enum_example(), forest_example(), list_example(), tree_example(), and unsat_core_and_proof_example().

Z3_pattern Z3_API Z3_mk_pattern ( __in Z3_context  c,
__in unsigned  num_patterns,
__in_ecount(num_patterns) Z3_ast const   terms[] 
)

Create a pattern for quantifier instantiation.

Z3 uses pattern matching to instantiate quantifiers. If a pattern is not provided for a quantifier, then Z3 will automatically compute a set of patterns for it. However, for optimal performance, the user should provide the patterns.

Patterns comprise a list of terms. The list should be non-empty. If the list comprises of more than one term, it is a called a multi-pattern.

In general, one can pass in a list of (multi-)patterns in the quantifier constructor.

See also:
Z3_mk_forall

Z3_mk_exists

Referenced by assert_inj_axiom().

Z3_ast Z3_API Z3_mk_quantifier ( __in Z3_context  c,
__in Z3_bool  is_forall,
__in unsigned  weight,
__in unsigned  num_patterns,
__in_ecount(num_patterns) Z3_pattern const *  patterns,
__in unsigned  num_decls,
__in_ecount(num_decls) Z3_sort const *  sorts,
__in_ecount(num_decls) Z3_symbol const *  decl_names,
__in Z3_ast  body 
)

Create a quantifier - universal or existential, with pattern hints.

Parameters:
c logical context.
is_forall flag to indicate if this is a universal or existential quantifier.
weight quantifiers are associated with weights indicating the importance of using the quantifier during instantiation. By default, pass the weight 0.
num_patterns number of patterns.
patterns array containing the patterns created using Z3_mk_pattern.
num_decls number of variables to be bound.
sorts array of sorts of the bound variables.
decl_names names of the bound variables.
body the body of the quantifier.
See also:
Z3_mk_pattern

Z3_mk_bound

Z3_mk_forall

Z3_mk_exists

Z3_ast Z3_API Z3_mk_real ( __in Z3_context  c,
__in_z int  num,
__in_z int  den 
)

Create a real from a fraction.

Parameters:
c logical context.
nom nominator of rational
denom. 
Precondition:
den != 0
See also:
Z3_mk_numeral

Z3_mk_int

Z3_mk_unsigned_int

Z3_sort Z3_API Z3_mk_real_sort ( __in Z3_context  c  ) 

Create a real type.

This type is not a floating point number. Z3 does not have support for floating point numbers yet.

Referenced by mk_real_var(), and tuple_example1().

Z3_ast Z3_API Z3_mk_rem ( __in Z3_context  c,
__in Z3_ast  arg1,
__in Z3_ast  arg2 
)

Create an AST node representing arg1 rem arg2.

The arguments must have int type.

Z3_ast Z3_API Z3_mk_rotate_left ( __in Z3_context  c,
__in unsigned  i,
__in Z3_ast  t1 
)

Rotate bits of t1 to the left i times.

The node t1 must have a bit-vector sort.

Z3_ast Z3_API Z3_mk_rotate_right ( __in Z3_context  c,
__in unsigned  i,
__in Z3_ast  t1 
)

Rotate bits of t1 to the right i times.

The node t1 must have a bit-vector sort.

Z3_ast Z3_API Z3_mk_select ( __in Z3_context  c,
__in Z3_ast  a,
__in Z3_ast  i 
)

Array read.

The node a must have an array sort [domain -> range], and i must have the sort domain. The sort of the result is range.

See also:
Z3_mk_array_sort

Z3_mk_store

Referenced by array_example1().

Z3_ast Z3_API Z3_mk_sign_ext ( __in Z3_context  c,
__in unsigned  i,
__in Z3_ast  t1 
)

Sign-extend of the given bit-vector to the (signed) equivalent bitvector of size m+i, where m is the size of the given bit-vector.

The node t1 must have a bit-vector sort.

Z3_ast Z3_API Z3_mk_store ( __in Z3_context  c,
__in Z3_ast  a,
__in Z3_ast  i,
__in Z3_ast  v 
)

Array update.

The node a must have an array sort [domain -> range], i must have sort domain, v must have sort range. The sort of the result is [domain -> range].

See also:
Z3_mk_array_sort

Z3_mk_select

Referenced by array_example1().

Z3_symbol Z3_API Z3_mk_string_symbol ( __in Z3_context  c,
__in_z Z3_string  s 
)

Z3_ast Z3_API Z3_mk_sub ( __in Z3_context  c,
__in unsigned  num_args,
__in_ecount(num_args) Z3_ast const   args[] 
)

Create an AST node representing args[0] - ... - args[num_args - 1].

The array args must have num_args elements. All arguments must have int or real sort.

Remarks:
The number of arguments must be greater than zero.

Referenced by prove_example2().

Z3_ast Z3_API Z3_mk_true ( __in Z3_context  c  ) 

Create an AST node representing true.

Referenced by RawContext::MkTrue().

Z3_sort Z3_API Z3_mk_tuple_sort ( __in Z3_context  c,
__in Z3_symbol  mk_tuple_name,
__in unsigned  num_fields,
__in_ecount(num_fields) Z3_symbol const   field_names[],
__in_ecount(num_fields) Z3_sort const   field_sorts[],
__out Z3_func_decl *  mk_tuple_decl,
__out_ecount(num_fields) Z3_func_decl  proj_decl[] 
)