| Home | • | Docs | • | Download | • | • | FAQ | • | Awards | • | Status | • | MSR |
|---|
An Efficient SMT Solver
Types | |
| Most of the types in the C API are opaque pointers.
| |
| 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 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 |
True value. It is just an alias for 1.
Definition at line 103 of file z3_api.h.
Referenced by array_example1(), enum_example(), forest_example(), list_example(), parser_example3(), prove_example1(), prove_example2(), quantifier_example1(), tree_example(), and tuple_example1().
| typedef int Z3_bool |
| typedef void Z3_error_handler(Z3_error_code e) |
| typedef const char* Z3_string |
| enum Z3_ast_kind |
The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types.
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;
| enum Z3_ast_print_mode |
Z3 pretty printing modes (See Z3_set_ast_print_mode).
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;
| enum Z3_decl_kind |
The different kinds of interpreted function kinds.
(*
T1: p
T2: (implies p q)
[mp T1 T2]: q
T1: (R t s)
[symmetry T1]: (R s t)
T1: (R t s)
T2: (R s u)
[trans T1 T2]: (R t u)
Example:
T1: (R a b)
T2: (R c b)
T3: (R c d)
[trans* T1 T2 T3]: (R a d)
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.
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))
T1: (~ p q) [quant-intro T1]: (~ (forall (x) p) (forall (x) q))
(= (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.
T1: (and l_1 ... l_n)
[and-elim T1]: l_i
T1: (not (or l_1 ... l_n))
[not-or-elim T1]: (not l_i)
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)
(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])))
It is used to justify the elimination of unused variables. This proof object has no antecedents.
This proof object has no antecedents.
Several variables can be eliminated simultaneously.
T1: false
[lemma T1]: (or (not l_1) ... (not l_n))
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')
T1: p
[iff-true T1]: (iff p true)
T1: (not p)
[iff-false T1]: (iff p false)
[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.
(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)
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)
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)))
T1: q ~ q_new
[nnf-pos T1]: (~ (forall (x T) q) (forall (x T) q_new))
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')))
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.
[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.
T1: p
T2: (~ p q)
[mp~ T1 T2]: q
)
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;
| enum Z3_error_code |
Z3 error codes (See Z3_get_error_code).
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 |
| enum Z3_parameter_kind |
The different kinds of parameters that can be associated with function symbols.
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;
| enum Z3_search_failure |
The different kinds of search failure types.
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;
| enum Z3_sort_kind |
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;
| enum Z3_symbol_kind |
In Z3, a symbol can be represented using integers and strings (See Z3_get_symbol_kind).
Definition at line 128 of file z3_api.h.
00129 { 00130 Z3_INT_SYMBOL, 00131 Z3_STRING_SYMBOL 00132 } Z3_symbol_kind;
| 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.
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.
Z3_ast_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.
Z3_benchmark_to_smtlib_string.| 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.
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.
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.
| 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. |
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.
Z3_context_to_string. Referenced by simple_example().
| void Z3_API Z3_del_config | ( | __in Z3_config | c | ) |
Delete the given configuration object.
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().
| void Z3_API Z3_del_constructor | ( | __in Z3_context | c, | |
| __in Z3_constructor | constr | |||
| ) |
Reclaim memory allocated to constructor.
| 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.
| c | logical context. | |
| clist | constructor list container. |
Referenced by forest_example().
| void Z3_API Z3_del_context | ( | __in Z3_context | c | ) |
Delete the given logical context.
Referenced by array_example1(), array_example2(), array_example3(), bitvector_example1(), bitvector_example2(), demorgan(), enum_example(), error_code_example1(), error_code_example2(), eval_example1(), find_model_example1(), find_model_example2(), forest_example(), get_implied_equalities_example(), ite_example(), list_example(), parser_example1(), parser_example2(), parser_example3(), parser_example4(), parser_example5(), prove_example1(), prove_example2(), push_pop_example1(), quantifier_example1(), simple_example(), tree_example(), tuple_example1(), two_contexts_example1(), and unsat_core_and_proof_example().
| void Z3_API Z3_del_literals | ( | __in Z3_context | c, | |
| __in Z3_literals | lbls | |||
| ) |
| void Z3_API Z3_del_model | ( | __in Z3_context | c, | |
| __in Z3_model | m | |||
| ) |
Delete a model object.
Referenced by check(), check2(), error_code_example1(), eval_example1(), prove(), and unsat_core_and_proof_example().
| 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.
| 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.
m is partial, that is, it doesn't have a complete interpretation for free functions. That is, the option PARTIAL_MODELS=true was used.
t is type incorrect.
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.
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.
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.
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.
| Z3_ast_kind Z3_API Z3_get_ast_kind | ( | __in Z3_context | c, | |
| __in Z3_ast | a | |||
| ) |
| 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.
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.
idx < Z3_get_datatype_sort_num_constructors(c, t)
| 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.
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))
| unsigned Z3_API Z3_get_datatype_sort_num_constructors | ( | __in Z3_context | c, | |
| __in Z3_sort | t | |||
| ) |
Return number of constructors for datatype.
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.
idx < Z3_get_datatype_sort_num_constructors(c, t)
| 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.
| 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_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.
| 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.
| 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.
| 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.
| 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_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_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.
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.
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.
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.
| 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.
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.
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.
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.
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.
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.
j < Z3_get_model_func_num_entries(c, m, i)
k < Z3_get_model_func_entry_num_args(c, m, i, j)
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.
j < Z3_get_model_func_num_entries(c, m, i)
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.
j < Z3_get_model_func_num_entries(c, m, i)
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.
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.
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.
Referenced by display_function_interpretations().
| unsigned Z3_API Z3_get_num_literals | ( | __in Z3_context | c, | |
| __in Z3_literals | lbls | |||
| ) |
| 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_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_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.
| c | logical context. | |
| a | term. | |
| num | numerator. | |
| den | denominator. |
Z3_TRUE if the numeral value fits in 64 bit numerals, Z3_FALSE otherwise.
| 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.
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.
| 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_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.
| 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.
| unsigned Z3_API Z3_get_quantifier_num_bound | ( | __in Z3_context | c, | |
| __in Z3_ast | a | |||
| ) |
Return number of bound variables 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.
| unsigned Z3_API Z3_get_quantifier_weight | ( | __in Z3_context | c, | |
| __in Z3_ast | a | |||
| ) |
Obtain weight of quantifier.
| 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.
| Z3_literals Z3_API Z3_get_relevant_literals | ( | __in Z3_context | c | ) |
Retrieve the set of literals that satisfy the current context.
| 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.
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.
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.
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.
| 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).
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 | |||
| ) |
| int Z3_API Z3_get_symbol_int | ( | __in Z3_context | c, | |
| __in Z3_symbol | s | |||
| ) |
Return the symbol int value.
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.
Z3_get_symbol_string.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.
i < Z3_get_tuple_sort_num_fields(c, t)
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.
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.
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 | |||
| ) |
| 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.
| 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.
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.
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[] | |||
| ) |
Create a constant or function application.
Referenced by assert_inj_axiom(), display_model(), enum_example(), forest_example(), get_implied_equalities_example(), list_example(), mk_binary_app(), mk_tuple_update(), mk_unary_app(), and tree_example().
| 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.
| 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.
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.
| c | logical context | |
| index | de-Bruijn index | |
| ty | sort of the bound variable |
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.
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:
floor of t1/t2 if t2 is different from zero, and t1*t2 >= 0.
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.
| 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.
| 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")
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
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.
| 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.
| 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.
| 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.
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.
| 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.
| 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.
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.
| 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 | |||
| ) |
Create an AST node representing l = r.
The nodes l and r must have the same type.
Referenced by array_example1(), assert_inj_axiom(), bitvector_example2(), enum_example(), find_model_example2(), forest_example(), get_implied_equalities_example(), list_example(), prove_example1(), prove_example2(), quantifier_example1(), tree_example(), and tuple_example1().
| 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 | |||
| ) |
| 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.
| 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. |
| 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 | ) |
| 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.
| 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. |
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.
| 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. |
| 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
prefix is NULL, then it is assumed to be the empty string.| 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.
prefix is NULL, then it is assumed to be the empty string.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.
| 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. |
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.
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.
| 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.
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.
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.
| c | logical context. | |
| s | name of the label. | |
| is_pos | label polarity. | |
| f | formula being labeled. |
| 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.
| 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].
| 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.
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.
| 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. |
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.
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.
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.
| 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. |
| 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.
| c | logical context. | |
| nom | nominator of rational | |
| denom. |
| 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.
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].
Referenced by array_example1().
| 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.
Symbols are used to name several term and type constructors.
Referenced by assert_comm_axiom(), enum_example(), forest_example(), get_implied_equalities_example(), list_example(), mk_var(), parser_example2(), parser_example3(), prove_example1(), prove_example2(), push_pop_example1(), quantifier_example1(), tree_example(), and tuple_example1().
| 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.
Referenced by prove_example2().
| Z3_ast Z3_API Z3_mk_true | ( | __in Z3_context | c | ) |
| 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[] | |||
| ) |