Z3
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
C API

Algebraic Numbers API

Z3_bool Z3_API Z3_algebraic_is_value (__in Z3_context c, __in Z3_ast a)
 Return Z3_TRUE if can be used as value in the Z3 real algebraic number package. More...
 
Z3_bool Z3_API Z3_algebraic_is_pos (__in Z3_context c, __in Z3_ast a)
 Return the Z3_TRUE if a is positive, and Z3_FALSE otherwise. More...
 
Z3_bool Z3_API Z3_algebraic_is_neg (__in Z3_context c, __in Z3_ast a)
 Return the Z3_TRUE if a is negative, and Z3_FALSE otherwise. More...
 
Z3_bool Z3_API Z3_algebraic_is_zero (__in Z3_context c, __in Z3_ast a)
 Return the Z3_TRUE if a is zero, and Z3_FALSE otherwise. More...
 
int Z3_API Z3_algebraic_sign (__in Z3_context c, __in Z3_ast a)
 Return 1 if a is positive, 0 if a is zero, and -1 if a is negative. More...
 
Z3_ast Z3_API Z3_algebraic_add (__in Z3_context c, __in Z3_ast a, __in Z3_ast b)
 Return the value a + b. More...
 
Z3_ast Z3_API Z3_algebraic_sub (__in Z3_context c, __in Z3_ast a, __in Z3_ast b)
 Return the value a - b. More...
 
Z3_ast Z3_API Z3_algebraic_mul (__in Z3_context c, __in Z3_ast a, __in Z3_ast b)
 Return the value a * b. More...
 
Z3_ast Z3_API Z3_algebraic_div (__in Z3_context c, __in Z3_ast a, __in Z3_ast b)
 Return the value a / b. More...
 
Z3_ast Z3_API Z3_algebraic_root (__in Z3_context c, __in Z3_ast a, __in unsigned k)
 Return the a^(1/k) More...
 
Z3_ast Z3_API Z3_algebraic_power (__in Z3_context c, __in Z3_ast a, __in unsigned k)
 Return the a^k. More...
 
Z3_bool Z3_API Z3_algebraic_lt (__in Z3_context c, __in Z3_ast a, __in Z3_ast b)
 Return Z3_TRUE if a < b, and Z3_FALSE otherwise. More...
 
Z3_bool Z3_API Z3_algebraic_gt (__in Z3_context c, __in Z3_ast a, __in Z3_ast b)
 Return Z3_TRUE if a > b, and Z3_FALSE otherwise. More...
 
Z3_bool Z3_API Z3_algebraic_le (__in Z3_context c, __in Z3_ast a, __in Z3_ast b)
 Return Z3_TRUE if a <= b, and Z3_FALSE otherwise. More...
 
Z3_bool Z3_API Z3_algebraic_ge (__in Z3_context c, __in Z3_ast a, __in Z3_ast b)
 Return Z3_TRUE if a >= b, and Z3_FALSE otherwise. More...
 
Z3_bool Z3_API Z3_algebraic_eq (__in Z3_context c, __in Z3_ast a, __in Z3_ast b)
 Return Z3_TRUE if a == b, and Z3_FALSE otherwise. More...
 
Z3_bool Z3_API Z3_algebraic_neq (__in Z3_context c, __in Z3_ast a, __in Z3_ast b)
 Return Z3_TRUE if a != b, and Z3_FALSE otherwise. More...
 
Z3_ast_vector Z3_API Z3_algebraic_roots (__in Z3_context c, __in Z3_ast p, __in unsigned n, __in Z3_ast a[])
 Given a multivariate polynomial p(x_0, ..., x_{n-1}, x_n), returns the roots of the univariate polynomial p(a[0], ..., a[n-1], x_n). More...
 
int Z3_API Z3_algebraic_eval (__in Z3_context c, __in Z3_ast p, __in unsigned n, __in Z3_ast a[])
 Given a multivariate polynomial p(x_0, ..., x_{n-1}), return the sign of p(a[0], ..., a[n-1]). More...
 

Types

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

  • Z3_config: configuration object used to initialize logical contexts.

Z3_context: manager of all other Z3 objects, global configuration options, etc.

  • Z3_symbol: Lisp-like symbol used to name types, constants, and functions. A symbol can be created using string or integers.
  • Z3_ast: abstract syntax tree node. That is, the data-structure used in Z3 to represent terms, formulas and types.
  • Z3_sort: kind of AST used to represent types.
  • Z3_func_decl: kind of AST used to represent function symbols.
  • Z3_app: kind of AST used to represent function applications.
  • Z3_pattern: kind of AST used to represent pattern and multi-patterns used to guide quantifier instantiation.
    • Z3_constructor: type constructor for a (recursive) datatype.
  • Z3_params: parameter set used to configure many components such as: simplifiers, tactics, solvers, etc.
  • Z3_model: model for the constraints asserted into the logical context.
  • Z3_func_interp: interpretation of a function in a model.
  • Z3_func_entry: representation of the value of a Z3_func_interp at a particular point.
  • Z3_fixedpoint: context for the recursive predicate solver.
  • Z3_ast_vector: vector of Z3_ast objects.
  • Z3_ast_map: mapping from Z3_ast to Z3_ast objects.
  • Z3_goal: set of formulas that can be solved and/or transformed using tactics and solvers.
  • Z3_tactic: basic building block for creating custom solvers for specific problem domains.
  • Z3_probe: function/predicate used to inspect a goal and collect information that may be used to decide which solver and/or preprocessing step will be used.
  • Z3_apply_result: collection of subgoals resulting from applying of a tactic to a goal.
  • Z3_solver: (incremental) solver, possibly specialized by a particular tactic or logic.
  • Z3_stats: statistical data for a solver.
enum  Z3_lbool { Z3_L_FALSE = -1, Z3_L_UNDEF, Z3_L_TRUE }
 Lifted Boolean type: false, undefined, true. More...
 
enum  Z3_symbol_kind { Z3_INT_SYMBOL, Z3_STRING_SYMBOL }
 The different kinds of symbol. In Z3, a symbol can be represented using integers and strings (See Z3_get_symbol_kind). More...
 
enum  Z3_parameter_kind {
  Z3_PARAMETER_INT, Z3_PARAMETER_DOUBLE, Z3_PARAMETER_RATIONAL, Z3_PARAMETER_SYMBOL,
  Z3_PARAMETER_SORT, Z3_PARAMETER_AST, Z3_PARAMETER_FUNC_DECL
}
 The different kinds of parameters that can be associated with function symbols. More...
 
enum  Z3_sort_kind {
  Z3_UNINTERPRETED_SORT, Z3_BOOL_SORT, Z3_INT_SORT, Z3_REAL_SORT,
  Z3_BV_SORT, Z3_ARRAY_SORT, Z3_DATATYPE_SORT, Z3_RELATION_SORT,
  Z3_FINITE_DOMAIN_SORT, Z3_UNKNOWN_SORT = 1000
}
 The different kinds of Z3 types (See Z3_get_sort_kind). More...
 
enum  Z3_ast_kind {
  Z3_NUMERAL_AST, Z3_APP_AST, Z3_VAR_AST, Z3_QUANTIFIER_AST,
  Z3_SORT_AST, Z3_FUNC_DECL_AST, Z3_UNKNOWN_AST = 1000
}
 The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types. More...
 
enum  Z3_decl_kind {
  Z3_OP_TRUE = 0x100, Z3_OP_FALSE, Z3_OP_EQ, Z3_OP_DISTINCT,
  Z3_OP_ITE, Z3_OP_AND, Z3_OP_OR, Z3_OP_IFF,
  Z3_OP_XOR, Z3_OP_NOT, Z3_OP_IMPLIES, Z3_OP_OEQ,
  Z3_OP_INTERP, Z3_OP_ANUM = 0x200, Z3_OP_AGNUM, Z3_OP_LE,
  Z3_OP_GE, Z3_OP_LT, Z3_OP_GT, Z3_OP_ADD,
  Z3_OP_SUB, Z3_OP_UMINUS, Z3_OP_MUL, Z3_OP_DIV,
  Z3_OP_IDIV, Z3_OP_REM, Z3_OP_MOD, Z3_OP_TO_REAL,
  Z3_OP_TO_INT, Z3_OP_IS_INT, Z3_OP_POWER, Z3_OP_STORE = 0x300,
  Z3_OP_SELECT, Z3_OP_CONST_ARRAY, Z3_OP_ARRAY_MAP, Z3_OP_ARRAY_DEFAULT,
  Z3_OP_SET_UNION, Z3_OP_SET_INTERSECT, Z3_OP_SET_DIFFERENCE, Z3_OP_SET_COMPLEMENT,
  Z3_OP_SET_SUBSET, Z3_OP_AS_ARRAY, Z3_OP_BNUM = 0x400, Z3_OP_BIT1,
  Z3_OP_BIT0, Z3_OP_BNEG, Z3_OP_BADD, Z3_OP_BSUB,
  Z3_OP_BMUL, Z3_OP_BSDIV, Z3_OP_BUDIV, Z3_OP_BSREM,
  Z3_OP_BUREM, Z3_OP_BSMOD, Z3_OP_BSDIV0, Z3_OP_BUDIV0,
  Z3_OP_BSREM0, Z3_OP_BUREM0, Z3_OP_BSMOD0, Z3_OP_ULEQ,
  Z3_OP_SLEQ, Z3_OP_UGEQ, Z3_OP_SGEQ, Z3_OP_ULT,
  Z3_OP_SLT, Z3_OP_UGT, Z3_OP_SGT, Z3_OP_BAND,
  Z3_OP_BOR, Z3_OP_BNOT, Z3_OP_BXOR, Z3_OP_BNAND,
  Z3_OP_BNOR, Z3_OP_BXNOR, Z3_OP_CONCAT, Z3_OP_SIGN_EXT,
  Z3_OP_ZERO_EXT, Z3_OP_EXTRACT, Z3_OP_REPEAT, Z3_OP_BREDOR,
  Z3_OP_BREDAND, Z3_OP_BCOMP, Z3_OP_BSHL, Z3_OP_BLSHR,
  Z3_OP_BASHR, Z3_OP_ROTATE_LEFT, Z3_OP_ROTATE_RIGHT, Z3_OP_EXT_ROTATE_LEFT,
  Z3_OP_EXT_ROTATE_RIGHT, Z3_OP_INT2BV, Z3_OP_BV2INT, Z3_OP_CARRY,
  Z3_OP_XOR3, Z3_OP_PR_UNDEF = 0x500, Z3_OP_PR_TRUE, Z3_OP_PR_ASSERTED,
  Z3_OP_PR_GOAL, Z3_OP_PR_MODUS_PONENS, Z3_OP_PR_REFLEXIVITY, Z3_OP_PR_SYMMETRY,
  Z3_OP_PR_TRANSITIVITY, Z3_OP_PR_TRANSITIVITY_STAR, Z3_OP_PR_MONOTONICITY, Z3_OP_PR_QUANT_INTRO,
  Z3_OP_PR_DISTRIBUTIVITY, Z3_OP_PR_AND_ELIM, Z3_OP_PR_NOT_OR_ELIM, Z3_OP_PR_REWRITE,
  Z3_OP_PR_REWRITE_STAR, Z3_OP_PR_PULL_QUANT, Z3_OP_PR_PULL_QUANT_STAR, Z3_OP_PR_PUSH_QUANT,
  Z3_OP_PR_ELIM_UNUSED_VARS, Z3_OP_PR_DER, Z3_OP_PR_QUANT_INST, Z3_OP_PR_HYPOTHESIS,
  Z3_OP_PR_LEMMA, Z3_OP_PR_UNIT_RESOLUTION, Z3_OP_PR_IFF_TRUE, Z3_OP_PR_IFF_FALSE,
  Z3_OP_PR_COMMUTATIVITY, Z3_OP_PR_DEF_AXIOM, Z3_OP_PR_DEF_INTRO, Z3_OP_PR_APPLY_DEF,
  Z3_OP_PR_IFF_OEQ, Z3_OP_PR_NNF_POS, Z3_OP_PR_NNF_NEG, Z3_OP_PR_NNF_STAR,
  Z3_OP_PR_CNF_STAR, Z3_OP_PR_SKOLEMIZE, Z3_OP_PR_MODUS_PONENS_OEQ, Z3_OP_PR_TH_LEMMA,
  Z3_OP_PR_HYPER_RESOLVE, Z3_OP_RA_STORE = 0x600, Z3_OP_RA_EMPTY, Z3_OP_RA_IS_EMPTY,
  Z3_OP_RA_JOIN, Z3_OP_RA_UNION, Z3_OP_RA_WIDEN, Z3_OP_RA_PROJECT,
  Z3_OP_RA_FILTER, Z3_OP_RA_NEGATION_FILTER, Z3_OP_RA_RENAME, Z3_OP_RA_COMPLEMENT,
  Z3_OP_RA_SELECT, Z3_OP_RA_CLONE, Z3_OP_FD_LT, Z3_OP_LABEL = 0x700,
  Z3_OP_LABEL_LIT, Z3_OP_DT_CONSTRUCTOR =0x800, Z3_OP_DT_RECOGNISER, Z3_OP_DT_ACCESSOR,
  Z3_OP_UNINTERPRETED
}
 The different kinds of interpreted function kinds. More...
 
enum  Z3_param_kind {
  Z3_PK_UINT, Z3_PK_BOOL, Z3_PK_DOUBLE, Z3_PK_SYMBOL,
  Z3_PK_STRING, Z3_PK_OTHER, Z3_PK_INVALID
}
 The different kinds of parameters that can be associated with parameter sets. (see Z3_mk_params). More...
 
enum  Z3_search_failure {
  Z3_NO_FAILURE, Z3_UNKNOWN, Z3_TIMEOUT, Z3_MEMOUT_WATERMARK,
  Z3_CANCELED, Z3_NUM_CONFLICTS, Z3_THEORY, Z3_QUANTIFIERS
}
 The different kinds of search failure types. More...
 
enum  Z3_ast_print_mode { Z3_PRINT_SMTLIB_FULL, Z3_PRINT_LOW_LEVEL, Z3_PRINT_SMTLIB_COMPLIANT, Z3_PRINT_SMTLIB2_COMPLIANT }
 Z3 pretty printing modes (See Z3_set_ast_print_mode). More...
 
enum  Z3_error_code {
  Z3_OK, Z3_SORT_ERROR, Z3_IOB, Z3_INVALID_ARG,
  Z3_PARSER_ERROR, Z3_NO_PARSER, Z3_INVALID_PATTERN, Z3_MEMOUT_FAIL,
  Z3_FILE_ACCESS_ERROR, Z3_INTERNAL_FATAL, Z3_INVALID_USAGE, Z3_DEC_REF_ERROR,
  Z3_EXCEPTION
}
 Z3 error codes (See Z3_get_error_code). More...
 
enum  Z3_goal_prec { Z3_GOAL_PRECISE, Z3_GOAL_UNDER, Z3_GOAL_OVER, Z3_GOAL_UNDER_OVER }
 A Goal is essentially a set of formulas. Z3 provide APIs for building strategies/tactics for solving and transforming Goals. Some of these transformations apply under/over approximations. More...
 
typedef int Z3_bool
 Z3 Boolean type. It is just an alias for int. More...
 
typedef const char * Z3_string
 Z3 string type. It is just an alias for const char *. More...
 
typedef Z3_stringZ3_string_ptr
 
typedef void Z3_error_handler (Z3_context c, Z3_error_code e)
 Z3 custom error handler (See Z3_set_error_handler). More...
 
#define Z3_TRUE   1
 True value. It is just an alias for 1. More...
 
#define Z3_FALSE   0
 False value. It is just an alias for 0. More...
 

Configuration

void Z3_API Z3_global_param_set (__in Z3_string param_id, __in Z3_string param_value)
 Set a global (or module) parameter. This setting is shared by all Z3 contexts. More...
 
void Z3_API Z3_global_param_reset_all (void)
 Restore the value of all global (and module) parameters. This command will not affect already created objects (such as tactics and solvers). More...
 
Z3_bool Z3_API Z3_global_param_get (__in Z3_string param_id, __out Z3_string_ptr param_value)
 Get a global (or module) parameter. More...
 

Create configuration

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

Create context

Z3_context Z3_API Z3_mk_context (__in Z3_config c)
 Create a context using the given configuration. More...
 
Z3_context Z3_API Z3_mk_context_rc (__in Z3_config c)
 Create a context using the given configuration. This function is similar to Z3_mk_context. However, in the context returned by this function, the user is responsible for managing Z3_ast reference counters. Managing reference counters is a burden and error-prone, but allows the user to use the memory more efficiently. The user must invoke Z3_inc_ref for any Z3_ast returned by Z3, and Z3_dec_ref whenever the Z3_ast is not needed anymore. This idiom is similar to the one used in BDD (binary decision diagrams) packages such as CUDD. More...
 
void Z3_API Z3_del_context (__in Z3_context c)
 Delete the given logical context. More...
 
void Z3_API Z3_inc_ref (__in Z3_context c, __in Z3_ast a)
 Increment the reference counter of the given AST. The context c should have been created using Z3_mk_context_rc. This function is a NOOP if c was created using Z3_mk_context. More...
 
void Z3_API Z3_dec_ref (__in Z3_context c, __in Z3_ast a)
 Decrement the reference counter of the given AST. The context c should have been created using Z3_mk_context_rc. This function is a NOOP if c was created using Z3_mk_context. More...
 
void Z3_API Z3_update_param_value (__in Z3_context c, __in Z3_string param_id, __in Z3_string param_value)
 Set a value of a context parameter. More...
 
void Z3_API Z3_interrupt (__in Z3_context c)
 Interrupt the execution of a Z3 procedure. This procedure can be used to interrupt: solvers, simplifiers and tactics. More...
 

Parameters

Z3_params Z3_API Z3_mk_params (__in Z3_context c)
 Create a Z3 (empty) parameter set. Starting at Z3 4.0, parameter sets are used to configure many components such as: simplifiers, tactics, solvers, etc. More...
 
void Z3_API Z3_params_inc_ref (__in Z3_context c, __in Z3_params p)
 Increment the reference counter of the given parameter set. More...
 
void Z3_API Z3_params_dec_ref (__in Z3_context c, __in Z3_params p)
 Decrement the reference counter of the given parameter set. More...
 
void Z3_API Z3_params_set_bool (__in Z3_context c, __in Z3_params p, __in Z3_symbol k, __in Z3_bool v)
 Add a Boolean parameter k with value v to the parameter set p. More...
 
void Z3_API Z3_params_set_uint (__in Z3_context c, __in Z3_params p, __in Z3_symbol k, __in unsigned v)
 Add a unsigned parameter k with value v to the parameter set p. More...
 
void Z3_API Z3_params_set_double (__in Z3_context c, __in Z3_params p, __in Z3_symbol k, __in double v)
 Add a double parameter k with value v to the parameter set p. More...
 
void Z3_API Z3_params_set_symbol (__in Z3_context c, __in Z3_params p, __in Z3_symbol k, __in Z3_symbol v)
 Add a symbol parameter k with value v to the parameter set p. More...
 
Z3_string Z3_API Z3_params_to_string (__in Z3_context c, __in Z3_params p)
 Convert a parameter set into a string. This function is mainly used for printing the contents of a parameter set. More...
 
void Z3_API Z3_params_validate (__in Z3_context c, __in Z3_params p, __in Z3_param_descrs d)
 Validate the parameter set p against the parameter description set d. More...
 

Parameter Descriptions

void Z3_API Z3_param_descrs_inc_ref (__in Z3_context c, __in Z3_param_descrs p)
 Increment the reference counter of the given parameter description set. More...
 
void Z3_API Z3_param_descrs_dec_ref (__in Z3_context c, __in Z3_param_descrs p)
 Decrement the reference counter of the given parameter description set. More...
 
Z3_param_kind Z3_API Z3_param_descrs_get_kind (__in Z3_context c, __in Z3_param_descrs p, __in Z3_symbol n)
 Return the kind associated with the given parameter name n. More...
 
unsigned Z3_API Z3_param_descrs_size (__in Z3_context c, __in Z3_param_descrs p)
 Return the number of parameters in the given parameter description set. More...
 
Z3_symbol Z3_API Z3_param_descrs_get_name (__in Z3_context c, __in Z3_param_descrs p, __in unsigned i)
 Return the number of parameters in the given parameter description set. More...
 
Z3_string Z3_API Z3_param_descrs_to_string (__in Z3_context c, __in Z3_param_descrs p)
 Convert a parameter description set into a string. This function is mainly used for printing the contents of a parameter description set. More...
 

Symbols

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

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). More...
 
Z3_sort Z3_API Z3_mk_bool_sort (__in Z3_context c)
 Create the Boolean type. More...
 
Z3_sort Z3_API Z3_mk_int_sort (__in Z3_context c)
 Create the integer type. More...
 
Z3_sort Z3_API Z3_mk_real_sort (__in Z3_context c)
 Create the real type. More...
 
Z3_sort Z3_API Z3_mk_bv_sort (__in Z3_context c, __in unsigned sz)
 Create a bit-vector type of the given size. More...
 
Z3_sort Z3_API Z3_mk_finite_domain_sort (__in Z3_context c, __in Z3_symbol name, __in unsigned __int64 size)
 Create a named finite domain sort. More...
 
Z3_sort Z3_API Z3_mk_array_sort (__in Z3_context c, __in Z3_sort domain, __in Z3_sort range)
 Create an array type. More...
 
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. More...
 
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. More...
 
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. More...
 
BEGIN_MLAPI_EXCLUDE
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_opt const sorts[], __in_ecount(num_fields) unsigned sort_refs[])
 Create a constructor. More...
 
void Z3_API Z3_del_constructor (__in Z3_context c, __in Z3_constructor constr)
 Reclaim memory allocated to constructor. More...
 
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 datatype, such as lists, trees, records, enumerations or unions of records. The datatype may be recursive. Return the datatype sort. More...
 
Z3_constructor_list Z3_API Z3_mk_constructor_list (__in Z3_context c, __in unsigned num_constructors, __in_ecount(num_constructors) Z3_constructor const constructors[])
 Create list of constructors. More...
 
void Z3_API Z3_del_constructor_list (__in Z3_context c, __in Z3_constructor_list clist)
 Reclaim memory allocated for constructor list. More...
 
void Z3_API Z3_mk_datatypes (__in Z3_context c, __in unsigned num_sorts, __in_ecount(num_sorts) Z3_symbol const sort_names[], __out_ecount(num_sorts) Z3_sort sorts[], __inout_ecount(num_sorts) Z3_constructor_list constructor_lists[])
 Create mutually recursive datatypes. More...
 
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 functions. More...
 

Constants and Applications

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. More...
 
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. More...
 
Z3_ast Z3_API Z3_mk_const (__in Z3_context c, __in Z3_symbol s, __in Z3_sort ty)
 Declare and create a constant. More...
 
Z3_func_decl Z3_API Z3_mk_fresh_func_decl (__in Z3_context c, __in 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. More...
 
Z3_ast Z3_API Z3_mk_fresh_const (__in Z3_context c, __in Z3_string prefix, __in Z3_sort ty)
 Declare and create a fresh constant. More...
 

Propositional Logic and Equality

Z3_ast Z3_API Z3_mk_true (__in Z3_context c)
 Create an AST node representing true. More...
 
Z3_ast Z3_API Z3_mk_false (__in Z3_context c)
 Create an AST node representing false. More...
 
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. More...
 
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]. More...
 
Z3_ast Z3_API Z3_mk_not (__in Z3_context c, __in Z3_ast a)
 Create an AST node representing not(a). More...
 
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). More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Arithmetic: Integers and Reals

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. More...
 
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. More...
 
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. More...
 
Z3_ast Z3_API Z3_mk_unary_minus (__in Z3_context c, __in Z3_ast arg)
 Create an AST node representing -arg.The arguments must have int or real type. More...
 
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. More...
 
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. More...
 
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. More...
 
Z3_ast Z3_API Z3_mk_power (__in Z3_context c, __in Z3_ast arg1, __in Z3_ast arg2)
 Create an AST node representing arg1^arg2. More...
 
Z3_ast Z3_API Z3_mk_lt (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Create less than. More...
 
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. More...
 
Z3_ast Z3_API Z3_mk_gt (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Create greater than. More...
 
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. More...
 
Z3_ast Z3_API Z3_mk_int2real (__in Z3_context c, __in Z3_ast t1)
 Coerce an integer to a real. More...
 
Z3_ast Z3_API Z3_mk_real2int (__in Z3_context c, __in Z3_ast t1)
 Coerce a real to an integer. More...
 
Z3_ast Z3_API Z3_mk_is_int (__in Z3_context c, __in Z3_ast t1)
 Check if a real number is an integer. More...
 

Bit-vectors

Z3_ast Z3_API Z3_mk_bvnot (__in Z3_context c, __in Z3_ast t1)
 Bitwise negation. More...
 
Z3_ast Z3_API Z3_mk_bvredand (__in Z3_context c, __in Z3_ast t1)
 Take conjunction of bits in vector, return vector of length 1. More...
 
Z3_ast Z3_API Z3_mk_bvredor (__in Z3_context c, __in Z3_ast t1)
 Take disjunction of bits in vector, return vector of length 1. More...
 
Z3_ast Z3_API Z3_mk_bvand (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Bitwise and. More...
 
Z3_ast Z3_API Z3_mk_bvor (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Bitwise or. More...
 
Z3_ast Z3_API Z3_mk_bvxor (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Bitwise exclusive-or. More...
 
Z3_ast Z3_API Z3_mk_bvnand (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Bitwise nand. More...
 
Z3_ast Z3_API Z3_mk_bvnor (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Bitwise nor. More...
 
Z3_ast Z3_API Z3_mk_bvxnor (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Bitwise xnor. More...
 
Z3_ast Z3_API Z3_mk_bvneg (__in Z3_context c, __in Z3_ast t1)
 Standard two's complement unary minus. More...
 
Z3_ast Z3_API Z3_mk_bvadd (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Standard two's complement addition. More...
 
Z3_ast Z3_API Z3_mk_bvsub (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Standard two's complement subtraction. More...
 
Z3_ast Z3_API Z3_mk_bvmul (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Standard two's complement multiplication. More...
 
Z3_ast Z3_API Z3_mk_bvudiv (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Unsigned division. More...
 
Z3_ast Z3_API Z3_mk_bvsdiv (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Two's complement signed division. More...
 
Z3_ast Z3_API Z3_mk_bvurem (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Unsigned remainder. More...
 
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). More...
 
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). More...
 
Z3_ast Z3_API Z3_mk_bvult (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Unsigned less than. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
Z3_ast Z3_API Z3_mk_bvugt (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Unsigned greater than. More...
 
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. More...
 
Z3_ast Z3_API Z3_mk_concat (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Concatenate the given bit-vectors. More...
 
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. More...
 
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. More...
 
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. More...
 
Z3_ast Z3_API Z3_mk_repeat (__in Z3_context c, __in unsigned i, __in Z3_ast t1)
 Repeat the given bit-vector up length i. More...
 
Z3_ast Z3_API Z3_mk_bvshl (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Shift left. More...
 
Z3_ast Z3_API Z3_mk_bvlshr (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Logical shift right. More...
 
Z3_ast Z3_API Z3_mk_bvashr (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Arithmetic shift right. More...
 
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. More...
 
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. More...
 
Z3_ast Z3_API Z3_mk_ext_rotate_left (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Rotate bits of t1 to the left t2 times. More...
 
Z3_ast Z3_API Z3_mk_ext_rotate_right (__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2)
 Rotate bits of t1 to the right t2 times. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Arrays

Z3_ast Z3_API Z3_mk_select (__in Z3_context c, __in Z3_ast a, __in Z3_ast i)
 Array read. The argument a is the array and i is the index of the array that gets read. More...
 
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. More...
 
Z3_ast Z3_API Z3_mk_const_array (__in Z3_context c, __in Z3_sort domain, __in Z3_ast v)
 Create the constant array. More...
 
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. More...
 
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. More...
 

Sets

Z3_sort Z3_API Z3_mk_set_sort (__in Z3_context c, __in Z3_sort ty)
 Create Set type. More...
 
Z3_ast Z3_API Z3_mk_empty_set (__in Z3_context c, __in Z3_sort domain)
 Create the empty set. More...
 
Z3_ast Z3_API Z3_mk_full_set (__in Z3_context c, __in Z3_sort domain)
 Create the full set. More...
 
Z3_ast Z3_API Z3_mk_set_add (__in Z3_context c, __in Z3_ast set, __in Z3_ast elem)
 Add an element to a set. More...
 
Z3_ast Z3_API Z3_mk_set_del (__in Z3_context c, __in Z3_ast set, __in Z3_ast elem)
 Remove an element to a set. More...
 
Z3_ast Z3_API Z3_mk_set_union (__in Z3_context c, __in unsigned num_args, __in_ecount(num_args) Z3_ast const args[])
 Take the union of a list of sets. More...
 
Z3_ast Z3_API Z3_mk_set_intersect (__in Z3_context c, __in unsigned num_args, __in_ecount(num_args) Z3_ast const args[])
 Take the intersection of a list of sets. More...
 
Z3_ast Z3_API Z3_mk_set_difference (__in Z3_context c, __in Z3_ast arg1, __in Z3_ast arg2)
 Take the set difference between two sets. More...
 
Z3_ast Z3_API Z3_mk_set_complement (__in Z3_context c, __in Z3_ast arg)
 Take the complement of a set. More...
 
Z3_ast Z3_API Z3_mk_set_member (__in Z3_context c, __in Z3_ast elem, __in Z3_ast set)
 Check for set membership. More...
 
Z3_ast Z3_API Z3_mk_set_subset (__in Z3_context c, __in Z3_ast arg1, __in Z3_ast arg2)
 Check for subsetness of sets. More...
 

Numerals

Z3_ast Z3_API Z3_mk_numeral (__in Z3_context c, __in Z3_string numeral, __in Z3_sort ty)
 Create a numeral of a given sort. More...
 
Z3_ast Z3_API Z3_mk_real (__in Z3_context c, __in int num, __in int den)
 Create a real from a fraction. More...
 
Z3_ast Z3_API Z3_mk_int (__in Z3_context c, __in int v, __in Z3_sort ty)
 Create a numeral of an int, bit-vector, or finite-domain sort. More...
 
Z3_ast Z3_API Z3_mk_unsigned_int (__in Z3_context c, __in unsigned v, __in Z3_sort ty)
 Create a numeral of a int, bit-vector, or finite-domain sort. More...
 
Z3_ast Z3_API Z3_mk_int64 (__in Z3_context c, __in __int64 v, __in Z3_sort ty)
 Create a numeral of a int, bit-vector, or finite-domain sort. More...
 
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 int, bit-vector, or finite-domain sort. More...
 

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. More...
 
Z3_ast Z3_API Z3_mk_bound (__in Z3_context c, __in unsigned index, __in Z3_sort ty)
 Create a bound variable. More...
 
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. It takes an expression body that contains bound variables of the same sorts as the sorts listed in the array sorts. The bound variables are de-Bruijn indices created using Z3_mk_bound. The array decl_names contains the names that the quantified formula uses for the bound variables. Z3 applies the convention that the last element in the decl_names and sorts array refers to the variable with index 0, the second to last element of decl_names and sorts refers to the variable with index 1, etc. More...
 
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. More...
 
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. See the documentation for Z3_mk_forall for an explanation of the parameters. More...
 
Z3_ast Z3_API Z3_mk_quantifier_ex (__in Z3_context c, __in Z3_bool is_forall, __in unsigned weight, __in Z3_symbol quantifier_id, __in Z3_symbol skolem_id, __in unsigned num_patterns, __in_ecount(num_patterns) Z3_pattern const patterns[], __in unsigned num_no_patterns, __in_ecount(num_no_patterns) Z3_ast const no_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, no patterns, and attributes. More...
 
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 const patterns[], __in Z3_ast body)
 Create a universal quantifier using a list of constants that will form the set of bound variables. More...
 
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 const patterns[], __in Z3_ast body)
 Similar to Z3_mk_forall_const. More...
 
Z3_ast Z3_API Z3_mk_quantifier_const (__in Z3_context c, Z3_bool is_forall, unsigned weight, unsigned num_bound, __in_ecount(num_bound) Z3_app const bound[], unsigned num_patterns, __in_ecount(num_patterns) Z3_pattern const patterns[], __in Z3_ast body)
 Create a universal or existential quantifier using a list of constants that will form the set of bound variables. More...
 
Z3_ast Z3_API Z3_mk_quantifier_const_ex (__in Z3_context c, Z3_bool is_forall, unsigned weight, __in Z3_symbol quantifier_id, __in Z3_symbol skolem_id, unsigned num_bound, __in_ecount(num_bound) Z3_app const bound[], unsigned num_patterns, __in_ecount(num_patterns) Z3_pattern const patterns[], unsigned num_no_patterns, __in_ecount(num_no_patterns) Z3_ast const no_patterns[], __in Z3_ast body)
 Create a universal or existential quantifier using a list of constants that will form the set of bound variables. More...
 

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. More...
 
int Z3_API Z3_get_symbol_int (__in Z3_context c, __in Z3_symbol s)
 Return the symbol int value. More...
 
Z3_string Z3_API Z3_get_symbol_string (__in Z3_context c, __in Z3_symbol s)
 Return the symbol name. More...
 
Z3_symbol Z3_API Z3_get_sort_name (__in Z3_context c, __in Z3_sort d)
 Return the sort name as a symbol. More...
 
unsigned Z3_API Z3_get_sort_id (__in Z3_context c, Z3_sort s)
 Return a unique identifier for s. More...
 
Z3_ast Z3_API Z3_sort_to_ast (__in Z3_context c, __in Z3_sort s)
 Convert a Z3_sort into Z3_ast. This is just type casting. More...
 
Z3_bool Z3_API Z3_is_eq_sort (__in Z3_context c, __in Z3_sort s1, __in Z3_sort s2)
 compare sorts. More...
 
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). More...
 
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. More...
 
Z3_bool Z3_API Z3_get_finite_domain_sort_size (__in Z3_context c, __in Z3_sort s, __out unsigned __int64 *r)
 Store the size of the sort in r. Return Z3_FALSE if the call failed. That is, Z3_get_sort_kind(s) == Z3_FINITE_DOMAIN_SORT. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
unsigned Z3_API Z3_get_datatype_sort_num_constructors (__in Z3_context c, __in Z3_sort t)
 Return number of constructors for datatype. More...
 
Z3_func_decl Z3_API Z3_get_datatype_sort_constructor (__in Z3_context c, __in Z3_sort t, unsigned idx)
 Return idx'th constructor. More...
 
Z3_func_decl Z3_API Z3_get_datatype_sort_recognizer (__in Z3_context c, __in Z3_sort t, unsigned idx)
 Return idx'th recognizer. More...
 
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. More...
 
unsigned Z3_API Z3_get_relation_arity (__in Z3_context c, __in Z3_sort s)
 Return arity of relation. More...
 
Z3_sort Z3_API Z3_get_relation_column (__in Z3_context c, __in Z3_sort s, unsigned col)
 Return sort at i'th column of relation sort. More...
 
Z3_ast Z3_API Z3_func_decl_to_ast (__in Z3_context c, __in Z3_func_decl f)
 Convert a Z3_func_decl into Z3_ast. This is just type casting. More...
 
Z3_bool Z3_API Z3_is_eq_func_decl (__in Z3_context c, __in Z3_func_decl f1, Z3_func_decl f2)
 compare terms. More...
 
unsigned Z3_API Z3_get_func_decl_id (__in Z3_context c, Z3_func_decl f)
 Return a unique identifier for f. More...
 
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. More...
 
Z3_decl_kind Z3_API Z3_get_decl_kind (__in Z3_context c, __in Z3_func_decl d)
 Return declaration kind corresponding to declaration. More...
 
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. More...
 
unsigned Z3_API Z3_get_arity (__in Z3_context c, __in Z3_func_decl d)
 Alias for Z3_get_domain_size. More...
 
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. More...
 
Z3_sort Z3_API Z3_get_range (__in Z3_context c, __in Z3_func_decl d)
 Return the range of the given declaration. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
Z3_ast Z3_API Z3_app_to_ast (__in Z3_context c, __in Z3_app a)
 Convert a Z3_app into Z3_ast. This is just type casting. More...
 
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. More...
 
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. More...
 
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. More...
 
Z3_bool Z3_API Z3_is_eq_ast (__in Z3_context c, __in Z3_ast t1, Z3_ast t2)
 compare terms. More...
 
unsigned Z3_API Z3_get_ast_id (__in Z3_context c, Z3_ast t)
 Return a unique identifier for t. More...
 
unsigned Z3_API Z3_get_ast_hash (__in Z3_context c, __in Z3_ast a)
 Return a hash code for the given AST. More...
 
Z3_sort Z3_API Z3_get_sort (__in Z3_context c, __in Z3_ast a)
 Return the sort of an AST node. More...
 
Z3_bool Z3_API Z3_is_well_sorted (__in Z3_context c, __in Z3_ast t)
 Return true if the given expression t is well sorted. More...
 
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. More...
 
Z3_ast_kind Z3_API Z3_get_ast_kind (__in Z3_context c, __in Z3_ast a)
 Return the kind of the given AST. More...
 
Z3_bool Z3_API Z3_is_app (__in Z3_context c, __in Z3_ast a)
 
Z3_bool Z3_API Z3_is_numeral_ast (__in Z3_context c, __in Z3_ast a)
 
Z3_bool Z3_API Z3_is_algebraic_number (__in Z3_context c, __in Z3_ast a)
 Return true if the give AST is a real algebraic number. More...
 
Z3_app Z3_API Z3_to_app (__in Z3_context c, __in Z3_ast a)
 Convert an ast into an APP_AST. This is just type casting. More...
 
Z3_func_decl Z3_API Z3_to_func_decl (__in Z3_context c, __in Z3_ast a)
 Convert an AST into a FUNC_DECL_AST. This is just type casting. More...
 
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. More...
 
Z3_string Z3_API Z3_get_numeral_decimal_string (__in Z3_context c, __in Z3_ast a, __in unsigned precision)
 Return numeral as a string in decimal notation. The result has at most precision decimal places. More...
 
Z3_ast Z3_API Z3_get_numerator (__in Z3_context c, __in Z3_ast a)
 Return the numerator (as a numeral AST) of a numeral AST of sort Real. More...
 
Z3_ast Z3_API Z3_get_denominator (__in Z3_context c, __in Z3_ast a)
 Return the denominator (as a numeral AST) of a numeral AST of sort Real. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
Z3_bool Z3_API Z3_get_numeral_rational_int64 (__in Z3_context c, __in Z3_ast v, __out __int64 *num, __out __int64 *den)
 Similar to Z3_get_numeral_string, but only succeeds if the value can fit as a rational number as machine __int64 int. Return Z3_TRUE if the call succeeded. More...
 
Z3_ast Z3_API Z3_get_algebraic_number_lower (__in Z3_context c, __in Z3_ast a, __in unsigned precision)
 Return a lower bound for the given real algebraic number. The interval isolating the number is smaller than 1/10^precision. The result is a numeral AST of sort Real. More...
 
Z3_ast Z3_API Z3_get_algebraic_number_upper (Z3_context c, Z3_ast a, unsigned precision)
 Return a upper bound for the given real algebraic number. The interval isolating the number is smaller than 1/10^precision. The result is a numeral AST of sort Real. More...
 
Z3_ast Z3_API Z3_pattern_to_ast (__in Z3_context c, __in Z3_pattern p)
 Convert a Z3_pattern into Z3_ast. This is just type casting. More...
 
unsigned Z3_API Z3_get_pattern_num_terms (__in Z3_context c, __in Z3_pattern p)
 Return number of terms in pattern. More...
 
Z3_ast Z3_API Z3_get_pattern (__in Z3_context c, __in Z3_pattern p, __in unsigned idx)
 Return i'th ast in pattern. More...
 
unsigned Z3_API Z3_get_index_value (__in Z3_context c, __in Z3_ast a)
 Return index of de-Brujin bound variable. More...
 
Z3_bool Z3_API Z3_is_quantifier_forall (__in Z3_context c, __in Z3_ast a)
 Determine if quantifier is universal. More...
 
unsigned Z3_API Z3_get_quantifier_weight (__in Z3_context c, __in Z3_ast a)
 Obtain weight of quantifier. More...
 
unsigned Z3_API Z3_get_quantifier_num_patterns (__in Z3_context c, __in Z3_ast a)
 Return number of patterns used in quantifier. More...
 
Z3_pattern Z3_API Z3_get_quantifier_pattern_ast (__in Z3_context c, __in Z3_ast a, unsigned i)
 Return i'th pattern. More...
 
unsigned Z3_API Z3_get_quantifier_num_no_patterns (__in Z3_context c, __in Z3_ast a)
 Return number of no_patterns used in quantifier. More...
 
Z3_ast Z3_API Z3_get_quantifier_no_pattern_ast (__in Z3_context c, __in Z3_ast a, unsigned i)
 Return i'th no_pattern. More...
 
unsigned Z3_API Z3_get_quantifier_num_bound (__in Z3_context c, __in Z3_ast a)
 Return number of bound variables of quantifier. More...
 
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. More...
 
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. More...
 
Z3_ast Z3_API Z3_get_quantifier_body (__in Z3_context c, __in Z3_ast a)
 Return body of quantifier. More...
 
Z3_ast Z3_API Z3_simplify (__in Z3_context c, __in Z3_ast a)
 Interface to simplifier. More...
 
Z3_ast Z3_API Z3_simplify_ex (__in Z3_context c, __in Z3_ast a, __in Z3_params p)
 Interface to simplifier. More...
 
Z3_string Z3_API Z3_simplify_get_help (__in Z3_context c)
 Return a string describing all available parameters. More...
 
Z3_param_descrs Z3_API Z3_simplify_get_param_descrs (__in Z3_context c)
 Return the parameter description set for the simplify procedure. More...
 

Modifiers

Z3_ast Z3_API Z3_update_term (__in Z3_context c, __in Z3_ast a, __in unsigned num_args, __in_ecount(num_args) Z3_ast const args[])
 Update the arguments of term a using the arguments args. The number of arguments num_args should coincide with the number of arguments to a. If a is a quantifier, then num_args has to be 1. More...
 
Z3_ast Z3_API Z3_substitute (__in Z3_context c, __in Z3_ast a, __in unsigned num_exprs, __in_ecount(num_exprs) Z3_ast const from[], __in_ecount(num_exprs) Z3_ast const to[])
 Substitute every occurrence of from[i] in a with to[i], for i smaller than num_exprs. The result is the new AST. The arrays from and to must have size num_exprs. For every i smaller than num_exprs, we must have that sort of from[i] must be equal to sort of to[i]. More...
 
Z3_ast Z3_API Z3_substitute_vars (__in Z3_context c, __in Z3_ast a, __in unsigned num_exprs, __in_ecount(num_exprs) Z3_ast const to[])
 Substitute the free variables in a with the expressions in to. For every i smaller than num_exprs, the variable with de-Bruijn index i is replaced with term to[i]. More...
 
Z3_ast Z3_API Z3_translate (__in Z3_context source, __in Z3_ast a, __in Z3_context target)
 Translate/Copy the AST a from context source to context target. AST a must have been created using context source. More...
 

Models

void Z3_API Z3_model_inc_ref (__in Z3_context c, __in Z3_model m)
 Increment the reference counter of the given model. More...
 
void Z3_API Z3_model_dec_ref (__in Z3_context c, __in Z3_model m)
 Decrement the reference counter of the given model. More...
 
Z3_bool Z3_API Z3_model_eval (__in Z3_context c, __in Z3_model m, __in Z3_ast t, __in Z3_bool model_completion, __out Z3_ast *v)
 Evaluate the AST node t in the given model. Return Z3_TRUE if succeeded, and store the result in v.If model_completion is Z3_TRUE, then Z3 will assign an interpretation for any constant or function that does not have an interpretation in m. These constants and functions were essentially don't cares. More...
 
Z3_ast Z3_API Z3_model_get_const_interp (__in Z3_context c, __in Z3_model m, __in Z3_func_decl a)
 Return the interpretation (i.e., assignment) of constant a in the model m. Return NULL, if the model does not assign an interpretation for a. That should be interpreted as: the value of a does not matter. More...
 
Z3_bool Z3_API Z3_model_has_interp (__in Z3_context c, __in Z3_model m, __in Z3_func_decl a)
 Test if there exists an interpretation (i.e., assignment) for a in the model m. More...
 
Z3_func_interp Z3_API Z3_model_get_func_interp (__in Z3_context c, __in Z3_model m, __in Z3_func_decl f)
 Return the interpretation of the function f in the model m. Return NULL, if the model does not assign an interpretation for f. That should be interpreted as: the f does not matter. More...
 
unsigned Z3_API Z3_model_get_num_consts (__in Z3_context c, __in Z3_model m)
 Return the number of constants assigned by the given model. More...
 
Z3_func_decl Z3_API Z3_model_get_const_decl (__in Z3_context c, __in Z3_model m, __in unsigned i)
 Return the i-th constant in the given model. More...
 
unsigned Z3_API Z3_model_get_num_funcs (__in Z3_context c, __in Z3_model m)
 Return the number of function interpretations in the given model. More...
 
Z3_func_decl Z3_API Z3_model_get_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. More...
 
unsigned Z3_API Z3_model_get_num_sorts (__in Z3_context c, __in Z3_model m)
 Return the number of uninterpreted sorts that m assigs an interpretation to. More...
 
Z3_sort Z3_API Z3_model_get_sort (__in Z3_context c, __in Z3_model m, __in unsigned i)
 Return a uninterpreted sort that m assigns an interpretation. More...
 
Z3_ast_vector Z3_API Z3_model_get_sort_universe (__in Z3_context c, __in Z3_model m, __in Z3_sort s)
 Return the finite set of distinct values that represent the interpretation for sort s. More...
 
Z3_bool Z3_API Z3_is_as_array (__in Z3_context c, __in Z3_ast a)
 The (_ as-array f) AST node is a construct for assigning interpretations for arrays in Z3. It is the array such that forall indices i we have that (select (_ as-array f) i) is equal to (f i). This procedure returns Z3_TRUE if the a is an as-array AST node. More...
 
Z3_func_decl Z3_API Z3_get_as_array_func_decl (__in Z3_context c, __in Z3_ast a)
 Return the function declaration f associated with a (_ as_array f) node. More...
 
void Z3_API Z3_func_interp_inc_ref (__in Z3_context c, __in Z3_func_interp f)
 Increment the reference counter of the given Z3_func_interp object. More...
 
void Z3_API Z3_func_interp_dec_ref (__in Z3_context c, __in Z3_func_interp f)
 Decrement the reference counter of the given Z3_func_interp object. More...
 
unsigned Z3_API Z3_func_interp_get_num_entries (__in Z3_context c, __in Z3_func_interp f)
 Return the number of entries in the given function interpretation. More...
 
Z3_func_entry Z3_API Z3_func_interp_get_entry (__in Z3_context c, __in Z3_func_interp f, unsigned i)
 Return a "point" of the given function intepretation. It represents the value of f in a particular point. More...
 
Z3_ast Z3_API Z3_func_interp_get_else (__in Z3_context c, __in Z3_func_interp f)
 Return the 'else' value of the given function interpretation. More...
 
unsigned Z3_API Z3_func_interp_get_arity (__in Z3_context c, __in Z3_func_interp f)
 Return the arity (number of arguments) of the given function interpretation. More...
 
void Z3_API Z3_func_entry_inc_ref (__in Z3_context c, __in Z3_func_entry e)
 Increment the reference counter of the given Z3_func_entry object. More...
 
void Z3_API Z3_func_entry_dec_ref (__in Z3_context c, __in Z3_func_entry e)
 Decrement the reference counter of the given Z3_func_entry object. More...
 
Z3_ast Z3_API Z3_func_entry_get_value (__in Z3_context c, __in Z3_func_entry e)
 Return the value of this point. More...
 
unsigned Z3_API Z3_func_entry_get_num_args (__in Z3_context c, __in Z3_func_entry e)
 Return the number of arguments in a Z3_func_entry object. More...
 
Z3_ast Z3_API Z3_func_entry_get_arg (__in Z3_context c, __in Z3_func_entry e, __in unsigned i)
 Return an argument of a Z3_func_entry object. More...
 

Interaction logging.

Z3_bool Z3_API Z3_open_log (__in Z3_string filename)
 Log interaction to a file. More...
 
void Z3_API Z3_append_log (__in Z3_string string)
 Append user-defined string to interaction log. More...
 
void Z3_API Z3_close_log (void)
 Close interaction log. More...
 
void Z3_API Z3_toggle_warning_messages (__in Z3_bool enabled)
 Enable/disable printing warning messages to the console. More...
 

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. More...
 
Z3_string Z3_API Z3_ast_to_string (__in Z3_context c, __in Z3_ast a)
 Convert the given AST node into a string. More...
 
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. More...
 
Z3_string Z3_API Z3_benchmark_to_smtlib_string (__in Z3_context c, __in Z3_string name, __in Z3_string logic, __in Z3_string status, __in Z3_string attributes, __in unsigned num_assumptions, __in_ecount(num_assumptions) Z3_ast const assumptions[], __in Z3_ast formula)
 Convert the given benchmark into SMT-LIB formatted string. More...
 

Parser interface

Z3_ast Z3_API Z3_parse_smtlib2_string (__in Z3_context c, __in Z3_string str, __in unsigned num_sorts, __in_ecount(num_sorts) Z3_symbol const sort_names[], __in_ecount(num_sorts) Z3_sort const sorts[], __in unsigned num_decls, __in_ecount(num_decls) Z3_symbol const decl_names[], __in_ecount(num_decls) Z3_func_decl const decls[])
 Parse the given string using the SMT-LIB2 parser. More...
 
Z3_ast Z3_API Z3_parse_smtlib2_file (__in Z3_context c, __in Z3_string file_name, __in unsigned num_sorts, __in_ecount(num_sorts) Z3_symbol const sort_names[], __in_ecount(num_sorts) Z3_sort const sorts[], __in unsigned num_decls, __in_ecount(num_decls) Z3_symbol const decl_names[], __in_ecount(num_decls) Z3_func_decl const decls[])
 Similar to Z3_parse_smtlib2_string, but reads the benchmark from a file. More...
 
void Z3_API Z3_parse_smtlib_string (__in Z3_context c, __in Z3_string str, __in unsigned num_sorts, __in_ecount(num_sorts) Z3_symbol const sort_names[], __in_ecount(num_sorts) Z3_sort const sorts[], __in unsigned num_decls, __in_ecount(num_decls) Z3_symbol const decl_names[], __in_ecount(num_decls) Z3_func_decl const decls[])
 Parse the given string using the SMT-LIB parser. More...
 
void Z3_API Z3_parse_smtlib_file (__in Z3_context c, __in Z3_string file_name, __in unsigned num_sorts, __in_ecount(num_sorts) Z3_symbol const sort_names[], __in_ecount(num_sorts) Z3_sort const sorts[], __in unsigned num_decls, __in_ecount(num_decls) Z3_symbol const decl_names[], __in_ecount(num_decls) Z3_func_decl const decls[])
 Similar to Z3_parse_smtlib_string, but reads the benchmark from a file. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
BEGIN_MLAPI_EXCLUDE Z3_string
Z3_API 
Z3_get_smtlib_error (__in Z3_context c)
 Retrieve that last error message information generated from parsing. More...
 

Error Handling

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

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. More...
 
void Z3_API Z3_enable_trace (__in Z3_string tag)
 Enable tracing messages tagged as tag when Z3 is compiled in debug mode. It is a NOOP otherwise. More...
 
void Z3_API Z3_disable_trace (__in Z3_string tag)
 Disable tracing messages tagged as tag when Z3 is compiled in debug mode. It is a NOOP otherwise. More...
 
void Z3_API Z3_reset_memory (void)
 Reset all allocated resources. More...
 

External Theory Plugins

typedef Z3_bool Z3_reduce_eq_callback_fptr (__in Z3_theory t, __in Z3_ast a, __in Z3_ast b, __out Z3_ast *r)
 
typedef Z3_bool Z3_reduce_app_callback_fptr (__in Z3_theory, __in Z3_func_decl, __in unsigned, __in Z3_ast const [], __out Z3_ast *)
 
typedef Z3_bool Z3_reduce_distinct_callback_fptr (__in Z3_theory, __in unsigned, __in Z3_ast const [], __out Z3_ast *)
 
typedef void Z3_theory_callback_fptr (__in Z3_theory t)
 
typedef Z3_bool Z3_theory_final_check_callback_fptr (__in Z3_theory)
 
typedef void Z3_theory_ast_callback_fptr (__in Z3_theory, __in Z3_ast)
 
typedef void Z3_theory_ast_bool_callback_fptr (__in Z3_theory, __in Z3_ast, __in Z3_bool)
 
typedef void Z3_theory_ast_ast_callback_fptr (__in Z3_theory, __in Z3_ast, __in Z3_ast)
 
Z3_theory Z3_API Z3_mk_theory (__in Z3_context c, __in Z3_string th_name, __in Z3_theory_data data)
 Create a new user defined theory. The new theory will be identified by the name th_name. A theory must be created before asserting any assertion to the given context. Return NULL in case of failure. More...
 
Z3_theory_data Z3_API Z3_theory_get_ext_data (__in Z3_theory t)
 Return a pointer to the external data-structure supplied to the function Z3_mk_theory. More...
 
Z3_sort Z3_API Z3_theory_mk_sort (__in Z3_context c, __in Z3_theory t, __in Z3_symbol s)
 Create an interpreted theory sort. More...
 
Z3_ast Z3_API Z3_theory_mk_value (__in Z3_context c, __in Z3_theory t, __in Z3_symbol n, __in Z3_sort s)
 Create an interpreted theory constant value. Values are assumed to be different from each other. More...
 
Z3_ast Z3_API Z3_theory_mk_constant (__in Z3_context c, __in Z3_theory t, __in Z3_symbol n, __in Z3_sort s)
 Create an interpreted constant for the given theory. More...
 
Z3_func_decl Z3_API Z3_theory_mk_func_decl (__in Z3_context c, __in Z3_theory t, __in Z3_symbol n, __in unsigned domain_size, __in_ecount(domain_size) Z3_sort const domain[], __in Z3_sort range)
 Create an interpreted function declaration for the given theory. More...
 
Z3_context Z3_API Z3_theory_get_context (__in Z3_theory t)
 Return the context where the given theory is installed. More...
 
void Z3_API Z3_set_delete_callback (__in Z3_theory t, __in Z3_theory_callback_fptr f)
 Set a callback that is invoked when theory t is deleted. This callback should be used to delete external data-structures associated with the given theory. More...
 
void Z3_API Z3_set_reduce_app_callback (__in Z3_theory t, __in Z3_reduce_app_callback_fptr f)
 Set a callback for simplifying operators of the given theory. The callback f is invoked by Z3's simplifier. More...
 
void Z3_API Z3_set_reduce_eq_callback (__in Z3_theory t, __in Z3_reduce_eq_callback_fptr f)
 Set a callback for simplifying the atom s_1 = s_2, when the sort of s_1 and s_2 is an interpreted sort of the given theory. The callback f is invoked by Z3's simplifier. More...
 
void Z3_API Z3_set_reduce_distinct_callback (__in Z3_theory t, __in Z3_reduce_distinct_callback_fptr f)
 Set a callback for simplifying the atom distinct(s_1, ..., s_n), when the sort of s_1, ..., s_n is an interpreted sort of the given theory. The callback f is invoked by Z3's simplifier. More...
 
void Z3_API Z3_set_new_app_callback (__in Z3_theory t, __in Z3_theory_ast_callback_fptr f)
 Set a callback that is invoked when a theory application is finally added into the logical context. Note that, not every application contained in an asserted expression is actually added into the logical context because it may be simplified during a preprocessing step. More...
 
void Z3_API Z3_set_new_elem_callback (__in Z3_theory t, __in Z3_theory_ast_callback_fptr f)
 Set a callback that is invoked when an expression of sort s, where s is an interpreted sort of the theory t, is finally added into the logical context. Note that, not every expression contained in an asserted expression is actually added into the logical context because it may be simplified during a preprocessing step. More...
 
void Z3_API Z3_set_init_search_callback (__in Z3_theory t, __in Z3_theory_callback_fptr f)
 Set a callback that is invoked when Z3 starts searching for a satisfying assignment. More...
 
void Z3_API Z3_set_push_callback (__in Z3_theory t, __in Z3_theory_callback_fptr f)
 Set a callback that is invoked when Z3 creates a case-split (aka backtracking point). More...
 
void Z3_API Z3_set_pop_callback (__in Z3_theory t, __in Z3_theory_callback_fptr f)
 Set a callback that is invoked when Z3 backtracks a case-split. More...
 
void Z3_API Z3_set_restart_callback (__in Z3_theory t, __in Z3_theory_callback_fptr f)
 Set a callback that is invoked when Z3 restarts the search for a satisfying assignment. More...
 
void Z3_API Z3_set_reset_callback (__in Z3_theory t, __in Z3_theory_callback_fptr f)
 Set a callback that is invoked when the logical context is reset by the user. This callback is useful for reseting any data-structure maintained by the user theory solver. More...
 
void Z3_API Z3_set_final_check_callback (__in Z3_theory t, __in Z3_theory_final_check_callback_fptr f)
 Set a callback that is invoked before Z3 starts building a model. A theory may use this callback to perform expensive operations. More...
 
void Z3_API Z3_set_new_eq_callback (__in Z3_theory t, __in Z3_theory_ast_ast_callback_fptr f)
 Set a callback that is invoked when an equality s_1 = s_2 is found by the logical context. More...
 
void Z3_API Z3_set_new_diseq_callback (__in Z3_theory t, __in Z3_theory_ast_ast_callback_fptr f)
 Set a callback that is invoked when a disequality s_1 != s_2 is found by the logical context. More...
 
void Z3_API Z3_set_new_assignment_callback (__in Z3_theory t, __in Z3_theory_ast_bool_callback_fptr f)
 Set a callback that is invoked when a theory predicate is assigned to true/false by Z3. More...
 
void Z3_API Z3_set_new_relevant_callback (__in Z3_theory t, __in Z3_theory_ast_callback_fptr f)
 Set a callback that is invoked when an expression is marked as relevant during the search. This callback is only invoked when relevancy propagation is enabled. More...
 
void Z3_API Z3_theory_assert_axiom (__in Z3_theory t, __in Z3_ast ax)
 Assert a theory axiom/lemmas during the search. More...
 
void Z3_API Z3_theory_assume_eq (__in Z3_theory t, __in Z3_ast lhs, __in Z3_ast rhs)
 Inform to the logical context that lhs and rhs have the same interpretation in the model being built by theory t. If lhs = rhs is inconsistent with other theories, then the logical context will backtrack. More...
 
void Z3_API Z3_theory_enable_axiom_simplification (__in Z3_theory t, __in Z3_bool flag)
 Enable/disable the simplification of theory axioms asserted using Z3_theory_assert_axiom. By default, the simplification of theory specific operators is disabled. That is, the reduce theory callbacks are not invoked for theory axioms. The default behavior is useful when asserting axioms stating properties of theory operators. More...
 
Z3_ast Z3_API Z3_theory_get_eqc_root (__in Z3_theory t, __in Z3_ast n)
 Return the root of the equivalence class containing n. More...
 
Z3_ast Z3_API Z3_theory_get_eqc_next (__in Z3_theory t, __in Z3_ast n)
 Return the next element in the equivalence class containing n. More...
 
unsigned Z3_API Z3_theory_get_num_parents (__in Z3_theory t, __in Z3_ast n)
 Return the number of parents of n that are operators of the given theory. More...
 
Z3_ast Z3_API Z3_theory_get_parent (__in Z3_theory t, __in Z3_ast n, __in unsigned i)
 Return the i-th parent of n. See Z3_theory_get_num_parents. More...
 
Z3_bool Z3_API Z3_theory_is_value (__in Z3_theory t, __in Z3_ast n)
 Return Z3_TRUE if n is an interpreted theory value. More...
 
Z3_bool Z3_API Z3_theory_is_decl (__in Z3_theory t, __in Z3_func_decl d)
 Return Z3_TRUE if d is an interpreted theory declaration. More...
 
unsigned Z3_API Z3_theory_get_num_elems (__in Z3_theory t)
 Return the number of expressions of the given theory in the logical context. These are the expressions notified using the callback Z3_set_new_elem_callback. More...
 
Z3_ast Z3_API Z3_theory_get_elem (__in Z3_theory t, __in unsigned i)
 Return the i-th elem of the given theory in the logical context. More...
 
unsigned Z3_API Z3_theory_get_num_apps (__in Z3_theory t)
 Return the number of theory applications in the logical context. These are the expressions notified using the callback Z3_set_new_app_callback. More...
 
Z3_ast Z3_API Z3_theory_get_app (__in Z3_theory t, __in unsigned i)
 Return the i-th application of the given theory in the logical context. More...
 

Fixedpoint facilities

typedef void Z3_fixedpoint_reduce_assign_callback_fptr (__in void *, __in Z3_func_decl, __in unsigned, __in Z3_ast const [], __in unsigned, __in Z3_ast const [])
 The following utilities allows adding user-defined domains. More...
 
typedef void Z3_fixedpoint_reduce_app_callback_fptr (__in void *, __in Z3_func_decl, __in unsigned, __in Z3_ast const [], __out Z3_ast *)
 
Z3_fixedpoint Z3_API Z3_mk_fixedpoint (__in Z3_context c)
 Create a new fixedpoint context. More...
 
void Z3_API Z3_fixedpoint_inc_ref (__in Z3_context c, __in Z3_fixedpoint d)
 Increment the reference counter of the given fixedpoint context. More...
 
void Z3_API Z3_fixedpoint_dec_ref (__in Z3_context c, __in Z3_fixedpoint d)
 Decrement the reference counter of the given fixedpoint context. More...
 
void Z3_API Z3_fixedpoint_add_rule (__in Z3_context c, __in Z3_fixedpoint d, __in Z3_ast rule, __in Z3_symbol name)
 Add a universal Horn clause as a named rule. The horn_rule should be of the form: More...
 
void Z3_API Z3_fixedpoint_add_fact (__in Z3_context c, __in Z3_fixedpoint d, __in Z3_func_decl r, __in unsigned num_args, __in_ecount(num_args) unsigned args[])
 Add a Database fact. More...
 
void Z3_API Z3_fixedpoint_assert (__in Z3_context c, __in Z3_fixedpoint d, __in Z3_ast axiom)
 Assert a constraint to the fixedpoint context. More...
 
Z3_lbool Z3_API Z3_fixedpoint_query (__in Z3_context c, __in Z3_fixedpoint d, __in Z3_ast query)
 Pose a query against the asserted rules. More...
 
Z3_lbool Z3_API Z3_fixedpoint_query_relations (__in Z3_context c, __in Z3_fixedpoint d, __in unsigned num_relations, __in_ecount(num_relations) Z3_func_decl const relations[])
 Pose multiple queries against the asserted rules. More...
 
Z3_ast Z3_API Z3_fixedpoint_get_answer (__in Z3_context c, __in Z3_fixedpoint d)
 Retrieve a formula that encodes satisfying answers to the query. More...
 
Z3_string Z3_API Z3_fixedpoint_get_reason_unknown (__in Z3_context c, __in Z3_fixedpoint d)
 Retrieve a string that describes the last status returned by Z3_fixedpoint_query. More...
 
void Z3_API Z3_fixedpoint_update_rule (__in Z3_context c, __in Z3_fixedpoint d, __in Z3_ast a, __in Z3_symbol name)
 Update a named rule. A rule with the same name must have been previously created. More...
 
unsigned Z3_API Z3_fixedpoint_get_num_levels (Z3_context c, Z3_fixedpoint d, Z3_func_decl pred)
 Query the PDR engine for the maximal levels properties are known about predicate. More...
 
Z3_ast Z3_API Z3_fixedpoint_get_cover_delta (Z3_context c, Z3_fixedpoint d, int level, Z3_func_decl pred)
 
void Z3_API Z3_fixedpoint_add_cover (Z3_context c, Z3_fixedpoint d, int level, Z3_func_decl pred, Z3_ast property)
 Add property about the predicate pred. Add a property of predicate pred at level. It gets pushed forward when possible. More...
 
Z3_stats Z3_API Z3_fixedpoint_get_statistics (__in Z3_context c, __in Z3_fixedpoint d)
 Retrieve statistics information from the last call to Z3_fixedpoint_query. More...
 
void Z3_API Z3_fixedpoint_register_relation (__in Z3_context c, __in Z3_fixedpoint d, __in Z3_func_decl f)
 Register relation as Fixedpoint defined. Fixedpoint defined relations have least-fixedpoint semantics. For example, the relation is empty if it does not occur in a head or a fact. More...
 
void Z3_API Z3_fixedpoint_set_predicate_representation (__in Z3_context c, __in Z3_fixedpoint d, __in Z3_func_decl f, __in unsigned num_relations, __in_ecount(num_relations) Z3_symbol const relation_kinds[])
 Configure the predicate representation. More...
 
Z3_ast_vector Z3_API Z3_fixedpoint_get_rules (__in Z3_context c, __in Z3_fixedpoint f)
 Retrieve set of rules from fixedpoint context. More...
 
Z3_ast_vector Z3_API Z3_fixedpoint_get_assertions (__in Z3_context c, __in Z3_fixedpoint f)
 Retrieve set of background assertions from fixedpoint context. More...
 
void Z3_API Z3_fixedpoint_set_params (__in Z3_context c, __in Z3_fixedpoint f, __in Z3_params p)
 Set parameters on fixedpoint context. More...
 
Z3_string Z3_API Z3_fixedpoint_get_help (__in Z3_context c, __in Z3_fixedpoint f)
 Return a string describing all fixedpoint available parameters. More...
 
Z3_param_descrs Z3_API Z3_fixedpoint_get_param_descrs (__in Z3_context c, __in Z3_fixedpoint f)
 Return the parameter description set for the given fixedpoint object. More...
 
Z3_string Z3_API Z3_fixedpoint_to_string (__in Z3_context c, __in Z3_fixedpoint f, __in unsigned num_queries, __in_ecount(num_queries) Z3_ast queries[])
 Print the current rules and background axioms as a string. More...
 
Z3_ast_vector Z3_API Z3_fixedpoint_from_string (__in Z3_context c, __in Z3_fixedpoint f, __in Z3_string s)
 Parse an SMT-LIB2 string with fixedpoint rules. Add the rules to the current fixedpoint context. Return the set of queries in the file. More...
 
Z3_ast_vector Z3_API Z3_fixedpoint_from_file (__in Z3_context c, __in Z3_fixedpoint f, __in Z3_string s)
 Parse an SMT-LIB2 file with fixedpoint rules. Add the rules to the current fixedpoint context. Return the set of queries in the file. More...
 
void Z3_API Z3_fixedpoint_push (Z3_context c, Z3_fixedpoint d)
 Create a backtracking point. More...
 
void Z3_API Z3_fixedpoint_pop (Z3_context c, Z3_fixedpoint d)
 Backtrack one backtracking point. More...
 
void Z3_API Z3_fixedpoint_init (__in Z3_context c, __in Z3_fixedpoint d, __in void *state)
 Initialize the context with a user-defined state. More...
 
void Z3_API Z3_fixedpoint_set_reduce_assign_callback (__in Z3_context c, __in Z3_fixedpoint d, __in Z3_fixedpoint_reduce_assign_callback_fptr cb)
 Register a callback to destructive updates. More...
 
void Z3_API Z3_fixedpoint_set_reduce_app_callback (__in Z3_context c, __in Z3_fixedpoint d, __in Z3_fixedpoint_reduce_app_callback_fptr cb)
 Register a callback for buildling terms based on the relational operators. More...
 

AST vectors

Z3_ast_vector Z3_API Z3_mk_ast_vector (__in Z3_context c)
 Return an empty AST vector. More...
 
void Z3_API Z3_ast_vector_inc_ref (__in Z3_context c, __in Z3_ast_vector v)
 Increment the reference counter of the given AST vector. More...
 
void Z3_API Z3_ast_vector_dec_ref (__in Z3_context c, __in Z3_ast_vector v)
 Decrement the reference counter of the given AST vector. More...
 
unsigned Z3_API Z3_ast_vector_size (__in Z3_context c, __in Z3_ast_vector v)
 Return the size of the given AST vector. More...
 
Z3_ast Z3_API Z3_ast_vector_get (__in Z3_context c, __in Z3_ast_vector v, __in unsigned i)
 Return the AST at position i in the AST vector v. More...
 
void Z3_API Z3_ast_vector_set (__in Z3_context c, __in Z3_ast_vector v, __in unsigned i, __in Z3_ast a)
 Update position i of the AST vector v with the AST a. More...
 
void Z3_API Z3_ast_vector_resize (__in Z3_context c, __in Z3_ast_vector v, __in unsigned n)
 Resize the AST vector v. More...
 
void Z3_API Z3_ast_vector_push (__in Z3_context c, __in Z3_ast_vector v, __in Z3_ast a)
 Add the AST a in the end of the AST vector v. The size of v is increased by one. More...
 
Z3_ast_vector Z3_API Z3_ast_vector_translate (__in Z3_context s, __in Z3_ast_vector v, __in Z3_context t)
 Translate the AST vector v from context s into an AST vector in context t. More...
 
Z3_string Z3_API Z3_ast_vector_to_string (__in Z3_context c, __in Z3_ast_vector v)
 Convert AST vector into a string. More...
 

AST maps

Z3_ast_map Z3_API Z3_mk_ast_map (__in Z3_context c)
 Return an empty mapping from AST to AST. More...
 
void Z3_API Z3_ast_map_inc_ref (__in Z3_context c, __in Z3_ast_map m)
 Increment the reference counter of the given AST map. More...
 
void Z3_API Z3_ast_map_dec_ref (__in Z3_context c, __in Z3_ast_map m)
 Decrement the reference counter of the given AST map. More...
 
Z3_bool Z3_API Z3_ast_map_contains (__in Z3_context c, __in Z3_ast_map m, __in Z3_ast k)
 Return true if the map m contains the AST key k. More...
 
Z3_ast Z3_API Z3_ast_map_find (__in Z3_context c, __in Z3_ast_map m, __in Z3_ast k)
 Return the value associated with the key k. More...
 
void Z3_API Z3_ast_map_insert (__in Z3_context c, __in Z3_ast_map m, __in Z3_ast k, __in Z3_ast v)
 Store/Replace a new key, value pair in the given map. More...
 
void Z3_API Z3_ast_map_erase (__in Z3_context c, __in Z3_ast_map m, __in Z3_ast k)
 Erase a key from the map. More...
 
void Z3_API Z3_ast_map_reset (__in Z3_context c, __in Z3_ast_map m)
 Remove all keys from the given map. More...
 
unsigned Z3_API Z3_ast_map_size (__in Z3_context c, __in Z3_ast_map m)
 Return the size of the given map. More...
 
Z3_ast_vector Z3_API Z3_ast_map_keys (__in Z3_context c, __in Z3_ast_map m)
 Return the keys stored in the given map. More...
 
Z3_string Z3_API Z3_ast_map_to_string (__in Z3_context c, __in Z3_ast_map m)
 Convert the given map into a string. More...
 

Goals

Z3_goal Z3_API Z3_mk_goal (__in Z3_context c, __in Z3_bool models, __in Z3_bool unsat_cores, __in Z3_bool proofs)
 Create a goal (aka problem). A goal is essentially a set of formulas, that can be solved and/or transformed using tactics and solvers. More...
 
void Z3_API Z3_goal_inc_ref (__in Z3_context c, __in Z3_goal g)
 Increment the reference counter of the given goal. More...
 
void Z3_API Z3_goal_dec_ref (__in Z3_context c, __in Z3_goal g)
 Decrement the reference counter of the given goal. More...
 
Z3_goal_prec Z3_API Z3_goal_precision (__in Z3_context c, __in Z3_goal g)
 Return the "precision" of the given goal. Goals can be transformed using over and under approximations. A under approximation is applied when the objective is to find a model for a given goal. An over approximation is applied when the objective is to find a proof for a given goal. More...
 
void Z3_API Z3_goal_assert (__in Z3_context c, __in Z3_goal g, __in Z3_ast a)
 Add a new formula a to the given goal. More...
 
Z3_bool Z3_API Z3_goal_inconsistent (__in Z3_context c, __in Z3_goal g)
 Return true if the given goal contains the formula false. More...
 
unsigned Z3_API Z3_goal_depth (__in Z3_context c, __in Z3_goal g)
 Return the depth of the given goal. It tracks how many transformations were applied to it. More...
 
void Z3_API Z3_goal_reset (__in Z3_context c, __in Z3_goal g)
 Erase all formulas from the given goal. More...
 
unsigned Z3_API Z3_goal_size (__in Z3_context c, __in Z3_goal g)
 Return the number of formulas in the given goal. More...
 
Z3_ast Z3_API Z3_goal_formula (__in Z3_context c, __in Z3_goal g, __in unsigned idx)
 Return a formula from the given goal. More...
 
unsigned Z3_API Z3_goal_num_exprs (__in Z3_context c, __in Z3_goal g)
 Return the number of formulas, subformulas and terms in the given goal. More...
 
Z3_bool Z3_API Z3_goal_is_decided_sat (__in Z3_context c, __in Z3_goal g)
 Return true if the goal is empty, and it is precise or the product of a under approximation. More...
 
Z3_bool Z3_API Z3_goal_is_decided_unsat (__in Z3_context c, __in Z3_goal g)
 Return true if the goal contains false, and it is precise or the product of an over approximation. More...
 
Z3_goal Z3_API Z3_goal_translate (__in Z3_context source, __in Z3_goal g, __in Z3_context target)
 Copy a goal g from the context source to a the context target. More...
 
Z3_string Z3_API Z3_goal_to_string (__in Z3_context c, __in Z3_goal g)
 Convert a goal into a string. More...
 

Tactics and Probes

Z3_tactic Z3_API Z3_mk_tactic (__in Z3_context c, __in Z3_string name)
 Return a tactic associated with the given name. The complete list of tactics may be obtained using the procedures Z3_get_num_tactics and Z3_get_tactic_name. It may also be obtained using the command (help-tactics) in the SMT 2.0 front-end. More...
 
void Z3_API Z3_tactic_inc_ref (__in Z3_context c, __in Z3_tactic t)
 Increment the reference counter of the given tactic. More...
 
void Z3_API Z3_tactic_dec_ref (__in Z3_context c, __in Z3_tactic g)
 Decrement the reference counter of the given tactic. More...
 
Z3_probe Z3_API Z3_mk_probe (__in Z3_context c, __in Z3_string name)
 Return a probe associated with the given name. The complete list of probes may be obtained using the procedures Z3_get_num_probes and Z3_get_probe_name. It may also be obtained using the command (help-tactics) in the SMT 2.0 front-end. More...
 
void Z3_API Z3_probe_inc_ref (__in Z3_context c, __in Z3_probe p)
 Increment the reference counter of the given probe. More...
 
void Z3_API Z3_probe_dec_ref (__in Z3_context c, __in Z3_probe p)
 Decrement the reference counter of the given probe. More...
 
Z3_tactic Z3_API Z3_tactic_and_then (__in Z3_context c, __in Z3_tactic t1, __in Z3_tactic t2)
 Return a tactic that applies t1 to a given goal and t2 to every subgoal produced by t1. More...
 
Z3_tactic Z3_API Z3_tactic_or_else (__in Z3_context c, __in Z3_tactic t1, __in Z3_tactic t2)
 Return a tactic that first applies t1 to a given goal, if it fails then returns the result of t2 applied to the given goal. More...
 
Z3_tactic Z3_API Z3_tactic_par_or (__in Z3_context c, __in unsigned num, __in_ecount(num) Z3_tactic const ts[])
 Return a tactic that applies the given tactics in parallel. More...
 
Z3_tactic Z3_API Z3_tactic_par_and_then (__in Z3_context c, __in Z3_tactic t1, __in Z3_tactic t2)
 Return a tactic that applies t1 to a given goal and then t2 to every subgoal produced by t1. The subgoals are processed in parallel. More...
 
Z3_tactic Z3_API Z3_tactic_try_for (__in Z3_context c, __in Z3_tactic t, __in unsigned ms)
 Return a tactic that applies t to a given goal for ms milliseconds. If t does not terminate in ms milliseconds, then it fails. More...
 
Z3_tactic Z3_API Z3_tactic_when (__in Z3_context c, __in Z3_probe p, __in Z3_tactic t)
 Return a tactic that applies t to a given goal is the probe p evaluates to true. If p evaluates to false, then the new tactic behaves like the skip tactic. More...
 
Z3_tactic Z3_API Z3_tactic_cond (__in Z3_context c, __in Z3_probe p, __in Z3_tactic t1, __in Z3_tactic t2)
 Return a tactic that applies t1 to a given goal if the probe p evaluates to true, and t2 if p evaluates to false. More...
 
Z3_tactic Z3_API Z3_tactic_repeat (__in Z3_context c, __in Z3_tactic t, unsigned max)
 Return a tactic that keeps applying t until the goal is not modified anymore or the maximum number of iterations max is reached. More...
 
Z3_tactic Z3_API Z3_tactic_skip (__in Z3_context c)
 Return a tactic that just return the given goal. More...
 
Z3_tactic Z3_API Z3_tactic_fail (__in Z3_context c)
 Return a tactic that always fails. More...
 
Z3_tactic Z3_API Z3_tactic_fail_if (__in Z3_context c, __in Z3_probe p)
 Return a tactic that fails if the probe p evaluates to false. More...
 
Z3_tactic Z3_API Z3_tactic_fail_if_not_decided (__in Z3_context c)
 Return a tactic that fails if the goal is not trivially satisfiable (i.e., empty) or trivially unsatisfiable (i.e., contains false). More...
 
Z3_tactic Z3_API Z3_tactic_using_params (__in Z3_context c, __in Z3_tactic t, __in Z3_params p)
 Return a tactic that applies t using the given set of parameters. More...
 
Z3_probe Z3_API Z3_probe_const (__in Z3_context x, __in double val)
 Return a probe that always evaluates to val. More...
 
Z3_probe Z3_API Z3_probe_lt (__in Z3_context x, __in Z3_probe p1, __in Z3_probe p2)
 Return a probe that evaluates to "true" when the value returned by p1 is less than the value returned by p2. More...
 
Z3_probe Z3_API Z3_probe_gt (__in Z3_context x, __in Z3_probe p1, __in Z3_probe p2)
 Return a probe that evaluates to "true" when the value returned by p1 is greater than the value returned by p2. More...
 
Z3_probe Z3_API Z3_probe_le (__in Z3_context x, __in Z3_probe p1, __in Z3_probe p2)
 Return a probe that evaluates to "true" when the value returned by p1 is less than or equal to the value returned by p2. More...
 
Z3_probe Z3_API Z3_probe_ge (__in Z3_context x, __in Z3_probe p1, __in Z3_probe p2)
 Return a probe that evaluates to "true" when the value returned by p1 is greater than or equal to the value returned by p2. More...
 
Z3_probe Z3_API Z3_probe_eq (__in Z3_context x, __in Z3_probe p1, __in Z3_probe p2)
 Return a probe that evaluates to "true" when the value returned by p1 is equal to the value returned by p2. More...
 
Z3_probe Z3_API Z3_probe_and (__in Z3_context x, __in Z3_probe p1, __in Z3_probe p2)
 Return a probe that evaluates to "true" when p1 and p2 evaluates to true. More...
 
Z3_probe Z3_API Z3_probe_or (__in Z3_context x, __in Z3_probe p1, __in Z3_probe p2)
 Return a probe that evaluates to "true" when p1 or p2 evaluates to true. More...
 
Z3_probe Z3_API Z3_probe_not (__in Z3_context x, __in Z3_probe p)
 Return a probe that evaluates to "true" when p does not evaluate to true. More...
 
unsigned Z3_API Z3_get_num_tactics (__in Z3_context c)
 Return the number of builtin tactics available in Z3. More...
 
Z3_string Z3_API Z3_get_tactic_name (__in Z3_context c, unsigned i)
 Return the name of the idx tactic. More...
 
unsigned Z3_API Z3_get_num_probes (__in Z3_context c)
 Return the number of builtin probes available in Z3. More...
 
Z3_string Z3_API Z3_get_probe_name (__in Z3_context c, unsigned i)
 Return the name of the i probe. More...
 
Z3_string Z3_API Z3_tactic_get_help (__in Z3_context c, __in Z3_tactic t)
 Return a string containing a description of parameters accepted by the given tactic. More...
 
Z3_param_descrs Z3_API Z3_tactic_get_param_descrs (__in Z3_context c, __in Z3_tactic t)
 Return the parameter description set for the given tactic object. More...
 
Z3_string Z3_API Z3_tactic_get_descr (__in Z3_context c, __in Z3_string name)
 Return a string containing a description of the tactic with the given name. More...
 
Z3_string Z3_API Z3_probe_get_descr (__in Z3_context c, __in Z3_string name)
 Return a string containing a description of the probe with the given name. More...
 
double Z3_API Z3_probe_apply (__in Z3_context c, __in Z3_probe p, __in Z3_goal g)
 Execute the probe over the goal. The probe always produce a double value. "Boolean" probes return 0.0 for false, and a value different from 0.0 for true. More...
 
Z3_apply_result Z3_API Z3_tactic_apply (__in Z3_context c, __in Z3_tactic t, __in Z3_goal g)
 Apply tactic t to the goal g. More...
 
Z3_apply_result Z3_API Z3_tactic_apply_ex (Z3_context c, Z3_tactic t, Z3_goal g, Z3_params p)
 Apply tactic t to the goal g using the parameter set p. More...
 
void Z3_API Z3_apply_result_inc_ref (__in Z3_context c, __in Z3_apply_result r)
 Increment the reference counter of the given Z3_apply_result object. More...
 
void Z3_API Z3_apply_result_dec_ref (__in Z3_context c, __in Z3_apply_result r)
 Decrement the reference counter of the given Z3_apply_result object. More...
 
Z3_string Z3_API Z3_apply_result_to_string (__in Z3_context c, __in Z3_apply_result r)
 Convert the Z3_apply_result object returned by Z3_tactic_apply into a string. More...
 
unsigned Z3_API Z3_apply_result_get_num_subgoals (__in Z3_context c, __in Z3_apply_result r)
 Return the number of subgoals in the Z3_apply_result object returned by Z3_tactic_apply. More...
 
Z3_goal Z3_API Z3_apply_result_get_subgoal (__in Z3_context c, __in Z3_apply_result r, __in unsigned i)
 Return one of the subgoals in the Z3_apply_result object returned by Z3_tactic_apply. More...
 
Z3_model Z3_API Z3_apply_result_convert_model (__in Z3_context c, __in Z3_apply_result r, __in unsigned i, __in Z3_model m)
 Convert a model for the subgoal Z3_apply_result_get_subgoal(c, r, i) into a model for the original goal g. Where g is the goal used to create r using Z3_tactic_apply(c, t, g). More...
 

Solvers

Z3_solver Z3_API Z3_mk_solver (__in Z3_context c)
 Create a new (incremental) solver. This solver also uses a set of builtin tactics for handling the first check-sat command, and check-sat commands that take more than a given number of milliseconds to be solved. More...
 
Z3_solver Z3_API Z3_mk_simple_solver (__in Z3_context c)
 Create a new (incremental) solver. More...
 
Z3_solver Z3_API Z3_mk_solver_for_logic (__in Z3_context c, __in Z3_symbol logic)
 Create a new solver customized for the given logic. It behaves like Z3_mk_solver if the logic is unknown or unsupported. More...
 
Z3_solver Z3_API Z3_mk_solver_from_tactic (__in Z3_context c, __in Z3_tactic t)
 Create a new solver that is implemented using the given tactic. The solver supports the commands Z3_solver_push and Z3_solver_pop, but it will always solve each Z3_solver_check from scratch. More...
 
Z3_string Z3_API Z3_solver_get_help (__in Z3_context c, __in Z3_solver s)
 Return a string describing all solver available parameters. More...
 
Z3_param_descrs Z3_API Z3_solver_get_param_descrs (__in Z3_context c, __in Z3_solver s)
 Return the parameter description set for the given solver object. More...
 
void Z3_API Z3_solver_set_params (__in Z3_context c, __in Z3_solver s, __in Z3_params p)
 Set the given solver using the given parameters. More...
 
void Z3_API Z3_solver_inc_ref (__in Z3_context c, __in Z3_solver s)
 Increment the reference counter of the given solver. More...
 
void Z3_API Z3_solver_dec_ref (__in Z3_context c, __in Z3_solver s)
 Decrement the reference counter of the given solver. More...
 
void Z3_API Z3_solver_push (__in Z3_context c, __in Z3_solver s)
 Create a backtracking point. More...
 
void Z3_API Z3_solver_pop (__in Z3_context c, __in Z3_solver s, unsigned n)
 Backtrack n backtracking points. More...
 
void Z3_API Z3_solver_reset (__in Z3_context c, __in Z3_solver s)
 Remove all assertions from the solver. More...
 
unsigned Z3_API Z3_solver_get_num_scopes (__in Z3_context c, __in Z3_solver s)
 Return the number of backtracking points. More...
 
void Z3_API Z3_solver_assert (__in Z3_context c, __in Z3_solver s, __in Z3_ast a)
 Assert a constraint into the solver. More...
 
void Z3_API Z3_solver_assert_and_track (__in Z3_context c, __in Z3_solver s, __in Z3_ast a, __in Z3_ast p)
 Assert a constraint a into the solver, and track it (in the unsat) core using the Boolean constant p. More...
 
Z3_ast_vector Z3_API Z3_solver_get_assertions (__in Z3_context c, __in Z3_solver s)
 Return the set of asserted formulas as a goal object. More...
 
Z3_lbool Z3_API Z3_solver_check (__in Z3_context c, __in Z3_solver s)
 Check whether the assertions in a given solver are consistent or not. More...
 
Z3_lbool Z3_API Z3_solver_check_assumptions (__in Z3_context c, __in Z3_solver s, __in unsigned num_assumptions, __in_ecount(num_assumptions) Z3_ast const assumptions[])
 Check whether the assertions in the given solver and optional assumptions are consistent or not. More...
 
Z3_model Z3_API Z3_solver_get_model (__in Z3_context c, __in Z3_solver s)
 Retrieve the model for the last Z3_solver_check or Z3_solver_check_assumptions. More...
 
Z3_ast Z3_API Z3_solver_get_proof (__in Z3_context c, __in Z3_solver s)
 Retrieve the proof for the last Z3_solver_check or Z3_solver_check_assumptions. More...
 
Z3_ast_vector Z3_API Z3_solver_get_unsat_core (__in Z3_context c, __in Z3_solver s)
 Retrieve the unsat core for the last Z3_solver_check_assumptions The unsat core is a subset of the assumptions a. More...
 
Z3_string Z3_API Z3_solver_get_reason_unknown (__in Z3_context c, __in Z3_solver s)
 Return a brief justification for an "unknown" result (i.e., Z3_L_UNDEF) for the commands Z3_solver_check and Z3_solver_check_assumptions. More...
 
Z3_stats Z3_API Z3_solver_get_statistics (__in Z3_context c, __in Z3_solver s)
 Return statistics for the given solver. More...
 
Z3_string Z3_API Z3_solver_to_string (__in Z3_context c, __in Z3_solver s)
 Convert a solver into a string. More...
 

Statistics

Z3_string Z3_API Z3_stats_to_string (__in Z3_context c, __in Z3_stats s)
 Convert a statistics into a string. More...
 
void Z3_API Z3_stats_inc_ref (__in Z3_context c, __in Z3_stats s)
 Increment the reference counter of the given statistics object. More...
 
void Z3_API Z3_stats_dec_ref (__in Z3_context c, __in Z3_stats s)
 Decrement the reference counter of the given statistics object. More...
 
unsigned Z3_API Z3_stats_size (__in Z3_context c, __in Z3_stats s)
 Return the number of statistical data in s. More...
 
Z3_string Z3_API Z3_stats_get_key (__in Z3_context c, __in Z3_stats s, __in unsigned idx)
 Return the key (a string) for a particular statistical data. More...
 
Z3_bool Z3_API Z3_stats_is_uint (__in Z3_context c, __in Z3_stats s, __in unsigned idx)
 Return Z3_TRUE if the given statistical data is a unsigned integer. More...
 
Z3_bool Z3_API Z3_stats_is_double (__in Z3_context c, __in Z3_stats s, __in unsigned idx)
 Return Z3_TRUE if the given statistical data is a double. More...
 
unsigned Z3_API Z3_stats_get_uint_value (__in Z3_context c, __in Z3_stats s, __in unsigned idx)
 Return the unsigned value of the given statistical data. More...
 
double Z3_API Z3_stats_get_double_value (__in Z3_context c, __in Z3_stats s, __in unsigned idx)
 Return the double value of the given statistical data. More...
 

Deprecated Injective functions API

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. More...
 

Deprecated Constraints API

Z3_bool Z3_API Z3_set_logic (__in Z3_context c, __in Z3_string logic)
 Set the SMTLIB logic to be used in the given logical context. It is incorrect to invoke this function after invoking Z3_check, Z3_check_and_get_model, Z3_check_assumptions and Z3_push. Return Z3_TRUE if the logic was changed successfully, and Z3_FALSE otherwise. More...
 
void Z3_API Z3_push (__in Z3_context c)
 Create a backtracking point. More...
 
void Z3_API Z3_pop (__in Z3_context c, __in unsigned num_scopes)
 Backtrack. More...
 
unsigned Z3_API Z3_get_num_scopes (__in Z3_context c)
 Retrieve the current scope level. More...
 
void Z3_API Z3_persist_ast (__in Z3_context c, __in Z3_ast a, __in unsigned num_scopes)
 Persist AST through num_scopes pops. This function is only relevant if c was created using Z3_mk_context. If c was created using Z3_mk_context_rc, this function is a NOOP. More...
 
void Z3_API Z3_assert_cnstr (__in Z3_context c, __in Z3_ast a)
 Assert a constraint into the logical context. More...
 
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. More...
 
Z3_lbool Z3_API Z3_check (__in Z3_context c)
 Check whether the given logical context is consistent or not. More...
 
Z3_lbool Z3_API Z3_check_assumptions (__in Z3_context c, __in unsigned num_assumptions, __in_ecount(num_assumptions) Z3_ast const 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. More...
 
Z3_lbool Z3_API Z3_get_implied_equalities (__in Z3_context c, __in Z3_solver s, __in unsigned num_terms, __in_ecount(num_terms) Z3_ast const terms[], __out_ecount(num_terms) unsigned class_ids[])
 Retrieve congruence class representatives for terms. More...
 
void Z3_API Z3_del_model (__in Z3_context c, __in Z3_model m)
 Delete a model object. More...
 

Deprecated Search control API

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

Deprecated Labels API

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. More...
 
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. More...
 
Z3_literals Z3_API Z3_get_relevant_literals (__in Z3_context c)
 Retrieve the set of literals that satisfy the current context. More...
 
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. More...
 
void Z3_API Z3_del_literals (__in Z3_context c, __in Z3_literals lbls)
 Delete a labels context. More...
 
unsigned Z3_API Z3_get_num_literals (__in Z3_context c, __in Z3_literals lbls)
 Retrieve the number of label symbols that were returned. More...
 
Z3_symbol Z3_API Z3_get_label_symbol (__in Z3_context c, __in Z3_literals lbls, __in unsigned idx)
 Retrieve label symbol at idx. More...
 
Z3_ast Z3_API Z3_get_literal (__in Z3_context c, __in Z3_literals lbls, __in unsigned idx)
 Retrieve literal expression at idx. More...
 
void Z3_API Z3_disable_literal (__in Z3_context c, __in Z3_literals lbls, __in unsigned idx)
 Disable label. More...
 
void Z3_API Z3_block_literals (__in Z3_context c, __in Z3_literals lbls)
 Block subsequent checks using the remaining enabled labels. More...
 

Deprecated Model API

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
Z3_bool Z3_API Z3_is_array_value (__in Z3_context c, __in Z3_model m, __in Z3_ast v, __out unsigned *num_entries)
 Determine whether the term encodes an array value. A term encodes an array value if it is a nested sequence of applications of store on top of a constant array. The indices to the stores have to be values (for example, integer constants) so that equality between the indices can be evaluated. Array values are useful for representing interpretations for arrays. More...
 
void Z3_API Z3_get_array_value (__in Z3_context c, __in Z3_model m, __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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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: More...
 
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 const args[], __out Z3_ast *v)
 Evaluate declaration given values. More...
 

Deprecated String conversion API

Z3_string Z3_API Z3_context_to_string (__in Z3_context c)
 Convert the given logical context into a string. More...
 
Z3_string Z3_API Z3_statistics_to_string (__in Z3_context c)
 Return runtime statistics as a string. More...
 
Z3_ast Z3_API Z3_get_context_assignment (__in Z3_context c)
 Extract satisfying assignment from context as a conjunction. More...
 

Interpolation API

Z3_ast Z3_API Z3_mk_interpolant (__in Z3_context c, __in Z3_ast a)
 Create an AST node marking a formula position for interpolation. More...
 
Z3_context Z3_API Z3_mk_interpolation_context (__in Z3_config cfg)
 This function generates a Z3 context suitable for generation of interpolants. Formulas can be generated as abstract syntax trees in this context using the Z3 C API. More...
 
Z3_ast_vector Z3_API Z3_get_interpolant (__in Z3_context c, __in Z3_ast pf, __in Z3_ast pat, __in Z3_params p)
 
Z3_lbool Z3_API Z3_compute_interpolant (__in Z3_context c, __in Z3_ast pat, __in Z3_params p, __out Z3_ast_vector *interp, __out Z3_model *model)
 
Z3_string Z3_API Z3_interpolation_profile (__in Z3_context ctx)
 
int Z3_API Z3_read_interpolation_problem (__in Z3_context ctx, __out unsigned *num, __out Z3_ast *cnsts[], __out unsigned *parents[], __in Z3_string filename, __out Z3_string_ptr error, __out unsigned *num_theory, __out Z3_ast *theory[])
 Read an interpolation problem from file. More...
 
int Z3_API Z3_check_interpolant (__in Z3_context ctx, __in unsigned num, __in_ecount(num) Z3_ast cnsts[], __in_ecount(num) unsigned parents[], __in_ecount(num-1) Z3_ast *interps, __out Z3_string_ptr error, __in unsigned num_theory, __in_ecount(num_theory) Z3_ast theory[])
 
void Z3_API Z3_write_interpolation_problem (__in Z3_context ctx, __in unsigned num, __in_ecount(num) Z3_ast cnsts[], __in_ecount(num) unsigned parents[], __in Z3_string filename, __in unsigned num_theory, __in_ecount(num_theory) Z3_ast theory[])
 

Polynomials API

Z3_ast_vector Z3_API Z3_polynomial_subresultants (__in Z3_context c, __in Z3_ast p, __in Z3_ast q, __in Z3_ast x)
 Return the nonzero subresultants of p and q with respect to the "variable" x. More...
 

Real Closed Fields API

void Z3_API Z3_rcf_del (__in Z3_context c, __in Z3_rcf_num a)
 Delete a RCF numeral created using the RCF API. More...
 
Z3_rcf_num Z3_API Z3_rcf_mk_rational (__in Z3_context c, __in Z3_string val)
 Return a RCF rational using the given string. More...
 
Z3_rcf_num Z3_API Z3_rcf_mk_small_int (__in Z3_context c, __in int val)
 Return a RCF small integer. More...
 
Z3_rcf_num Z3_API Z3_rcf_mk_pi (__in Z3_context c)
 Return Pi. More...
 
Z3_rcf_num Z3_API Z3_rcf_mk_e (__in Z3_context c)
 Return e (Euler's constant) More...
 
Z3_rcf_num Z3_API Z3_rcf_mk_infinitesimal (__in Z3_context c)
 Return a new infinitesimal that is smaller than all elements in the Z3 field. More...
 
unsigned Z3_API Z3_rcf_mk_roots (__in Z3_context c, __in unsigned n, __in_ecount(n) Z3_rcf_num const a[], __out_ecount(n) Z3_rcf_num roots[])
 Store in roots the roots of the polynomial a[n-1]*x^{n-1} + ... + a[0]. The output vector roots must have size n. It returns the number of roots of the polynomial. More...
 
Z3_rcf_num Z3_API Z3_rcf_add (__in Z3_context c, __in Z3_rcf_num a, __in Z3_rcf_num b)
 Return the value a + b. More...
 
Z3_rcf_num Z3_API Z3_rcf_sub (__in Z3_context c, __in Z3_rcf_num a, __in Z3_rcf_num b)
 Return the value a - b. More...
 
Z3_rcf_num Z3_API Z3_rcf_mul (__in Z3_context c, __in Z3_rcf_num a, __in Z3_rcf_num b)
 Return the value a * b. More...
 
Z3_rcf_num Z3_API Z3_rcf_div (__in Z3_context c, __in Z3_rcf_num a, __in Z3_rcf_num b)
 Return the value a / b. More...
 
Z3_rcf_num Z3_API Z3_rcf_neg (__in Z3_context c, __in Z3_rcf_num a)
 Return the value -a. More...
 
Z3_rcf_num Z3_API Z3_rcf_inv (__in Z3_context c, __in Z3_rcf_num a)
 Return the value 1/a. More...
 
Z3_rcf_num Z3_API Z3_rcf_power (__in Z3_context c, __in Z3_rcf_num a, __in unsigned k)
 Return the value a^k. More...
 
Z3_bool Z3_API Z3_rcf_lt (__in Z3_context c, __in Z3_rcf_num a, __in Z3_rcf_num b)
 Return Z3_TRUE if a < b. More...
 
Z3_bool Z3_API Z3_rcf_gt (__in Z3_context c, __in Z3_rcf_num a, __in Z3_rcf_num b)
 Return Z3_TRUE if a > b. More...
 
Z3_bool Z3_API Z3_rcf_le (__in Z3_context c, __in Z3_rcf_num a, __in Z3_rcf_num b)
 Return Z3_TRUE if a <= b. More...
 
Z3_bool Z3_API Z3_rcf_ge (__in Z3_context c, __in Z3_rcf_num a, __in Z3_rcf_num b)
 Return Z3_TRUE if a >= b. More...
 
Z3_bool Z3_API Z3_rcf_eq (__in Z3_context c, __in Z3_rcf_num a, __in Z3_rcf_num b)
 Return Z3_TRUE if a == b. More...
 
Z3_bool Z3_API Z3_rcf_neq (__in Z3_context c, __in Z3_rcf_num a, __in Z3_rcf_num b)
 Return Z3_TRUE if a != b. More...
 
Z3_string Z3_API Z3_rcf_num_to_string (__in Z3_context c, __in Z3_rcf_num a, __in Z3_bool compact, __in Z3_bool html)
 Convert the RCF numeral into a string. More...
 
Z3_string Z3_API Z3_rcf_num_to_decimal_string (__in Z3_context c, __in Z3_rcf_num a, __in unsigned prec)
 Convert the RCF numeral into a string in decimal notation. More...
 
void Z3_API Z3_rcf_get_numerator_denominator (__in Z3_context c, __in Z3_rcf_num a, __out Z3_rcf_num *n, __out Z3_rcf_num *d)
 Extract the "numerator" and "denominator" of the given RCF numeral. We have that a = n/d, moreover n and d are not represented using rational functions. More...
 

Detailed Description

Macro Definition Documentation

#define Z3_FALSE   0

False value. It is just an alias for 0.

Definition at line 127 of file z3_api.h.

Referenced by model::eval().

#define Z3_TRUE   1

True value. It is just an alias for 1.

Definition at line 122 of file z3_api.h.

Typedef Documentation

typedef int Z3_bool

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

Definition at line 102 of file z3_api.h.

typedef void Z3_error_handler(Z3_context c, Z3_error_code e)

Z3 custom error handler (See Z3_set_error_handler).

Definitions for update_api.py

def_Type('CONFIG', 'Z3_config', 'Config') def_Type('CONTEXT', 'Z3_context', 'ContextObj') def_Type('AST', 'Z3_ast', 'Ast') def_Type('APP', 'Z3_app', 'Ast') def_Type('SORT', 'Z3_sort', 'Sort') def_Type('FUNC_DECL', 'Z3_func_decl', 'FuncDecl') def_Type('PATTERN', 'Z3_pattern', 'Pattern') def_Type('MODEL', 'Z3_model', 'Model') def_Type('LITERALS', 'Z3_literals', 'Literals') def_Type('CONSTRUCTOR', 'Z3_constructor', 'Constructor') def_Type('CONSTRUCTOR_LIST', 'Z3_constructor_list', 'ConstructorList') def_Type('THEORY', 'Z3_theory', 'ctypes.c_void_p') def_Type('THEORY_DATA', 'Z3_theory_data', 'ctypes.c_void_p') def_Type('SOLVER', 'Z3_solver', 'SolverObj') def_Type('GOAL', 'Z3_goal', 'GoalObj') def_Type('TACTIC', 'Z3_tactic', 'TacticObj') def_Type('PARAMS', 'Z3_params', 'Params') def_Type('PROBE', 'Z3_probe', 'ProbeObj') def_Type('STATS', 'Z3_stats', 'StatsObj') def_Type('AST_VECTOR', 'Z3_ast_vector', 'AstVectorObj') def_Type('AST_MAP', 'Z3_ast_map', 'AstMapObj') def_Type('APPLY_RESULT', 'Z3_apply_result', 'ApplyResultObj') def_Type('FUNC_INTERP', 'Z3_func_interp', 'FuncInterpObj') def_Type('FUNC_ENTRY', 'Z3_func_entry', 'FuncEntryObj') def_Type('FIXEDPOINT', 'Z3_fixedpoint', 'FixedpointObj') def_Type('PARAM_DESCRS', 'Z3_param_descrs', 'ParamDescrs') def_Type('RCF_NUM', 'Z3_rcf_num', 'RCFNumObj')

Definition at line 1203 of file z3_api.h.

typedef void Z3_fixedpoint_reduce_app_callback_fptr(__in void *, __in Z3_func_decl, __in unsigned, __in Z3_ast const [], __out Z3_ast *)

Definition at line 5546 of file z3_api.h.

typedef void Z3_fixedpoint_reduce_assign_callback_fptr(__in void *, __in Z3_func_decl, __in unsigned, __in Z3_ast const [], __in unsigned, __in Z3_ast const [])

The following utilities allows adding user-defined domains.

Definition at line 5541 of file z3_api.h.

typedef Z3_bool Z3_reduce_app_callback_fptr(__in Z3_theory, __in Z3_func_decl, __in unsigned, __in Z3_ast const [], __out Z3_ast *)

Definition at line 4869 of file z3_api.h.

typedef Z3_bool Z3_reduce_distinct_callback_fptr(__in Z3_theory, __in unsigned, __in Z3_ast const [], __out Z3_ast *)

Definition at line 4871 of file z3_api.h.

typedef Z3_bool Z3_reduce_eq_callback_fptr(__in Z3_theory t, __in Z3_ast a, __in Z3_ast b, __out Z3_ast *r)

Definition at line 4867 of file z3_api.h.

typedef const char* Z3_string

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

Definition at line 111 of file z3_api.h.

Definition at line 112 of file z3_api.h.

typedef void Z3_theory_ast_ast_callback_fptr(__in Z3_theory, __in Z3_ast, __in Z3_ast)

Definition at line 4881 of file z3_api.h.

typedef void Z3_theory_ast_bool_callback_fptr(__in Z3_theory, __in Z3_ast, __in Z3_bool)

Definition at line 4879 of file z3_api.h.

typedef void Z3_theory_ast_callback_fptr(__in Z3_theory, __in Z3_ast)

Definition at line 4877 of file z3_api.h.

typedef void Z3_theory_callback_fptr(__in Z3_theory t)

Definition at line 4873 of file z3_api.h.

typedef Z3_bool Z3_theory_final_check_callback_fptr(__in Z3_theory)

Definition at line 4875 of file z3_api.h.

Enumeration Type Documentation

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

  • Z3_APP_AST: constant and applications
  • Z3_NUMERAL_AST: numeral constants
  • Z3_VAR_AST: bound variables
  • Z3_QUANTIFIER_AST: quantifiers
  • Z3_SORT_AST: sort
  • Z3_FUNC_DECL_AST: function declaration
  • Z3_UNKNOWN_AST: internal
Enumerator
Z3_NUMERAL_AST 
Z3_APP_AST 
Z3_VAR_AST 
Z3_QUANTIFIER_AST 
Z3_SORT_AST 
Z3_FUNC_DECL_AST 
Z3_UNKNOWN_AST 

Definition at line 212 of file z3_api.h.

213 {
215  Z3_APP_AST,
216  Z3_VAR_AST,
218  Z3_SORT_AST,
220  Z3_UNKNOWN_AST = 1000
221 } Z3_ast_kind;
Z3_ast_kind
The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types...
Definition: z3_api.h:212

Z3 pretty printing modes (See Z3_set_ast_print_mode).

  • Z3_PRINT_SMTLIB_FULL: Print AST nodes in SMTLIB verbose format.
  • Z3_PRINT_LOW_LEVEL: Print AST nodes using a low-level format.
  • Z3_PRINT_SMTLIB_COMPLIANT: Print AST nodes in SMTLIB 1.x compliant format.
  • Z3_PRINT_SMTLIB2_COMPLIANT: Print AST nodes in SMTLIB 2.x compliant format.
Enumerator
Z3_PRINT_SMTLIB_FULL 
Z3_PRINT_LOW_LEVEL 
Z3_PRINT_SMTLIB_COMPLIANT 
Z3_PRINT_SMTLIB2_COMPLIANT 

Definition at line 1121 of file z3_api.h.

1121  {
Z3_ast_print_mode
Z3 pretty printing modes (See Z3_set_ast_print_mode).
Definition: z3_api.h:1121

The different kinds of interpreted function kinds.

  • Z3_OP_TRUE The constant true.
  • Z3_OP_FALSE The constant false.
  • Z3_OP_EQ The equality predicate.
  • Z3_OP_DISTINCT The n-ary distinct predicate (every argument is mutually distinct).
  • Z3_OP_ITE The ternary if-then-else term.
  • Z3_OP_AND n-ary conjunction.
  • Z3_OP_OR n-ary disjunction.
  • Z3_OP_IFF equivalence (binary).
  • Z3_OP_XOR Exclusive or.
  • Z3_OP_NOT Negation.
  • Z3_OP_IMPLIES Implication.
  • Z3_OP_OEQ Binary equivalence modulo namings. This binary predicate is used in proof terms. It captures equisatisfiability and equivalence modulo renamings.
  • Z3_OP_INTERP Marks a sub-formula for interpolation.
  • Z3_OP_ANUM Arithmetic numeral.
  • Z3_OP_AGNUM Arithmetic algebraic numeral. Algebraic numbers are used to represent irrational numbers in Z3.
  • Z3_OP_LE <=.
  • Z3_OP_GE >=.
  • Z3_OP_LT <.
  • Z3_OP_GT >.
  • Z3_OP_ADD Addition - Binary.
  • Z3_OP_SUB Binary subtraction.
  • Z3_OP_UMINUS Unary minus.
  • Z3_OP_MUL Multiplication - Binary.
  • Z3_OP_DIV Division - Binary.
  • Z3_OP_IDIV Integer division - Binary.
  • Z3_OP_REM Remainder - Binary.
  • Z3_OP_MOD Modulus - Binary.
  • Z3_OP_TO_REAL Coercion of integer to real - Unary.
  • Z3_OP_TO_INT Coercion of real to integer - Unary.
  • Z3_OP_IS_INT Check if real is also an integer - Unary.
  • Z3_OP_POWER Power operator x^y.
  • Z3_OP_STORE Array store. It satisfies select(store(a,i,v),j) = if i = j then v else select(a,j). Array store takes at least 3 arguments.
  • Z3_OP_SELECT Array select.
  • Z3_OP_CONST_ARRAY The constant array. For example, select(const(v),i) = v holds for every v and i. The function is unary.
  • Z3_OP_ARRAY_DEFAULT Default value of arrays. For example default(const(v)) = v. The function is unary.
  • Z3_OP_ARRAY_MAP Array map operator. It satisfies mapf[i] = f(a1[i],...,a_n[i]) for every i.
  • Z3_OP_SET_UNION Set union between two Booelan arrays (two arrays whose range type is Boolean). The function is binary.
  • Z3_OP_SET_INTERSECT Set intersection between two Boolean arrays. The function is binary.
  • Z3_OP_SET_DIFFERENCE Set difference between two Boolean arrays. The function is binary.
  • Z3_OP_SET_COMPLEMENT Set complement of a Boolean array. The function is unary.
  • Z3_OP_SET_SUBSET Subset predicate between two Boolean arrays. The relation is binary.
  • Z3_OP_AS_ARRAY An array value that behaves as the function graph of the function passed as parameter.
  • Z3_OP_BNUM Bit-vector numeral.
  • Z3_OP_BIT1 One bit bit-vector.
  • Z3_OP_BIT0 Zero bit bit-vector.
  • Z3_OP_BNEG Unary minus.
  • Z3_OP_BADD Binary addition.
  • Z3_OP_BSUB Binary subtraction.
  • Z3_OP_BMUL Binary multiplication.
  • Z3_OP_BSDIV Binary signed division.
  • Z3_OP_BUDIV Binary unsigned division.
  • Z3_OP_BSREM Binary signed remainder.
  • Z3_OP_BUREM Binary unsigned remainder.
  • Z3_OP_BSMOD Binary signed modulus.
  • Z3_OP_BSDIV0 Unary function. bsdiv(x,0) is congruent to bsdiv0(x).
  • Z3_OP_BUDIV0 Unary function. budiv(x,0) is congruent to budiv0(x).
  • Z3_OP_BSREM0 Unary function. bsrem(x,0) is congruent to bsrem0(x).
  • Z3_OP_BUREM0 Unary function. burem(x,0) is congruent to burem0(x).
  • Z3_OP_BSMOD0 Unary function. bsmod(x,0) is congruent to bsmod0(x).
  • Z3_OP_ULEQ Unsigned bit-vector <= - Binary relation.
  • Z3_OP_SLEQ Signed bit-vector <= - Binary relation.
  • Z3_OP_UGEQ Unsigned bit-vector >= - Binary relation.
  • Z3_OP_SGEQ Signed bit-vector >= - Binary relation.
  • Z3_OP_ULT Unsigned bit-vector < - Binary relation.
  • Z3_OP_SLT Signed bit-vector < - Binary relation.
  • Z3_OP_UGT Unsigned bit-vector > - Binary relation.
  • Z3_OP_SGT Signed bit-vector > - Binary relation.
  • Z3_OP_BAND Bit-wise and - Binary.
  • Z3_OP_BOR Bit-wise or - Binary.
  • Z3_OP_BNOT Bit-wise not - Unary.
  • Z3_OP_BXOR Bit-wise xor - Binary.
  • Z3_OP_BNAND Bit-wise nand - Binary.
  • Z3_OP_BNOR Bit-wise nor - Binary.
  • Z3_OP_BXNOR Bit-wise xnor - Binary.
  • Z3_OP_CONCAT Bit-vector concatenation - Binary.
  • Z3_OP_SIGN_EXT Bit-vector sign extension.
  • Z3_OP_ZERO_EXT Bit-vector zero extension.
  • Z3_OP_EXTRACT Bit-vector extraction.
  • Z3_OP_REPEAT Repeat bit-vector n times.
  • Z3_OP_BREDOR Bit-vector reduce or - Unary.
  • Z3_OP_BREDAND Bit-vector reduce and - Unary.
  • Z3_OP_BCOMP .
  • Z3_OP_BSHL Shift left.
  • Z3_OP_BLSHR Logical shift right.
  • Z3_OP_BASHR Arithmetical shift right.
  • Z3_OP_ROTATE_LEFT Left rotation.
  • Z3_OP_ROTATE_RIGHT Right rotation.
  • Z3_OP_EXT_ROTATE_LEFT (extended) Left rotation. Similar to Z3_OP_ROTATE_LEFT, but it is a binary operator instead of a parametric one.
  • Z3_OP_EXT_ROTATE_RIGHT (extended) Right rotation. Similar to Z3_OP_ROTATE_RIGHT, but it is a binary operator instead of a parametric one.
  • Z3_OP_INT2BV Coerce integer to bit-vector. NB. This function is not supported by the decision procedures. Only the most rudimentary simplification rules are applied to this function.
  • Z3_OP_BV2INT Coerce bit-vector to integer. NB. This function is not supported by the decision procedures. Only the most rudimentary simplification rules are applied to this function.
  • Z3_OP_CARRY Compute the carry bit in a full-adder. The meaning is given by the equivalence (carry l1 l2 l3) <=> (or (and l1 l2) (and l1 l3) (and l2 l3)))
  • Z3_OP_XOR3 Compute ternary XOR. The meaning is given by the equivalence (xor3 l1 l2 l3) <=> (xor (xor l1 l2) l3)
  • Z3_OP_PR_UNDEF: Undef/Null proof object.
  • Z3_OP_PR_TRUE: Proof for the expression 'true'.
  • Z3_OP_PR_ASSERTED: Proof for a fact asserted by the user.
  • Z3_OP_PR_GOAL: Proof for a fact (tagged as goal) asserted by the user.
  • Z3_OP_PR_MODUS_PONENS: Given a proof for p and a proof for (implies p q), produces a proof for q.

           T1: p
           T2: (implies p q)
           

    The second antecedents may also be a proof for (iff p q).

  • Z3_OP_PR_REFLEXIVITY: A proof for (R t t), where R is a reflexive relation. This proof object has no antecedents. The only reflexive relations that are used are equivalence modulo namings, equality and equivalence. That is, R is either '~', '=' or 'iff'.
  • Z3_OP_PR_SYMMETRY: Given an symmetric relation R and a proof for (R t s), produces a proof for (R s t).
           T1: (R t s)
           [symmetry T1]: (R s t)
           
    T1 is the antecedent of this proof object.
  • Z3_OP_PR_TRANSITIVITY: Given a transitive relation R, and proofs for (R t s) and (R s u), produces a proof for (R t u).
        T1: (R t s)
        T2: (R s u)
        [trans T1 T2]: (R t u)
        
  • Z3_OP_PR_TRANSITIVITY_STAR: Condensed transitivity proof. This proof object is only used if the parameter PROOF_MODE is 1. It combines several symmetry and transitivity proofs.
     Example:
     <div class="fragment"><pre class="fragment">
     T1: (R a b)
     T2: (R c b)
     T3: (R c d)
     [trans* T1 T2 T3]: (R a d)
     </pre></div>
     R must be a symmetric and transitive relation.
    
     Assuming that this proof object is a proof for (R s t), then
     a proof checker must check if it is possible to prove (R s t)
     using the antecedents, symmetry and transitivity.  That is, 
     if there is a path from s to t, if we view every
     antecedent (R a b) as an edge between a and b.
    
  • Z3_OP_PR_MONOTONICITY: Monotonicity proof object.

           T1: (R t_1 s_1)
           ...
           Tn: (R t_n s_n)
           

    Remark: if t_i == s_i, then the antecedent Ti is suppressed. That is, reflexivity proofs are supressed to save space.

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

    T1: (~ p q)

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

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

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

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

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

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

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

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

        T1: (not (or l_1 ... l_n))
        [not-or-elim T1]: (not l_i)
        
  • Z3_OP_PR_REWRITE: A proof for a local rewriting step (= t s). The head function symbol of t is interpreted.

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

   Examples:
   <div class="fragment"><pre class="fragment">
   (= (+ x 0) x)
   (= (+ x 1 2) (+ 3 x))
   (iff (or x false) x)
   </pre></div>
  • Z3_OP_PR_REWRITE_STAR: A proof for rewriting an expression t into an expression s. This proof object is used if the parameter PROOF_MODE is 1. This proof object can have n antecedents. The antecedents are proofs for equalities used as substitution rules. The object is also used in a few cases if the parameter PROOF_MODE is 2. The cases are:
    • When applying contextual simplification (CONTEXT_SIMPLIFIER=true)
    • When converting bit-vectors to Booleans (BIT2BOOL=true)
    • When pulling ite expression up (PULL_CHEAP_ITE_TREES=true)
  • Z3_OP_PR_PULL_QUANT: A proof for (iff (f (forall (x) q(x)) r) (forall (x) (f (q x) r))). This proof object has no antecedents.
  • Z3_OP_PR_PULL_QUANT_STAR: A proof for (iff P Q) where Q is in prenex normal form. This proof object is only used if the parameter PROOF_MODE is 1. This proof object has no antecedents.
  • Z3_OP_PR_PUSH_QUANT: A proof for:

           (iff (forall (x_1 ... x_m) (and p_1[x_1 ... x_m] ... p_n[x_1 ... x_m]))
                (and (forall (x_1 ... x_m) p_1[x_1 ... x_m])
                  ... 
                (forall (x_1 ... x_m) p_n[x_1 ... x_m])))
                

    This proof object has no antecedents.

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

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

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

    This proof object has no antecedents.

    Several variables can be eliminated simultaneously.

  • Z3_OP_PR_QUANT_INST: A proof of (or (not (forall (x) (P x))) (P a))
  • Z3_OP_PR_HYPOTHESIS: Mark a hypothesis in a natural deduction style proof.
  • Z3_OP_PR_LEMMA:

           T1: false
           

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

  • Z3_OP_PR_UNIT_RESOLUTION:
           T1:      (or l_1 ... l_n l_1' ... l_m')
           T2:      (not l_1)
           ...
           T(n+1):  (not l_n)
           [unit-resolution T1 ... T(n+1)]: (or l_1' ... l_m')
           
  • Z3_OP_PR_IFF_TRUE:
        T1: p
        [iff-true T1]: (iff p true)
        
  • Z3_OP_PR_IFF_FALSE:
        T1: (not p)
        [iff-false T1]: (iff p false)
        
  • Z3_OP_PR_COMMUTATIVITY:
     [comm]: (= (f a b) (f b a))
    
     f is a commutative operator.
    
     This proof object has no antecedents.
     Remark: if f is bool, then = is iff.
    
  • Z3_OP_PR_DEF_AXIOM: Proof object used to justify Tseitin's like axioms:
     <div class="fragment"><pre class="fragment">
     (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)
     </pre></div>
     This proof object has no antecedents.
     Note: all axioms are propositional tautologies.
     Note also that 'and' and 'or' can take multiple arguments.
     You can recover the propositional tautologies by
     unfolding the Boolean connectives in the axioms a small
     bounded number of steps (=3).
    
  • Z3_OP_PR_DEF_INTRO: Introduces a name for a formula/term. Suppose e is an expression with free variables x, and def-intro introduces the name n(x). The possible cases are:

    When e is of Boolean type:

    or:

    when e only occurs positively.

    When e is of the form (ite cond th el):

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

  • Z3_OP_PR_APPLY_DEF: [apply-def T1]: F ~ n F is 'equivalent' to n, given that T1 is a proof that n is a name for F.
  • Z3_OP_PR_IFF_OEQ: T1: (iff p q) [iff~ T1]: (~ p q)
  • Z3_OP_PR_NNF_POS: Proof for a (positive) NNF step. Example:

           T1: (not s_1) ~ r_1
           T2: (not s_2) ~ r_2
           T3: s_1 ~ r_1'
           T4: s_2 ~ r_2'
                                     (and (or r_1 r_2') (or r_1' r_2)))
           

    The negation normal form steps NNF_POS and NNF_NEG are used in the following cases: (a) When creating the NNF of a positive force quantifier. The quantifier is retained (unless the bound variables are eliminated). Example

            T1: q ~ q_new
         

    (b) When recursively creating NNF over Boolean formulas, where the top-level connective is changed during NNF conversion. The relevant Boolean connectives for NNF_POS are 'implies', 'iff', 'xor', 'ite'. NNF_NEG furthermore handles the case where negation is pushed over Boolean connectives 'and' and 'or'.

  • Z3_OP_PR_NNF_NEG: Proof for a (negative) NNF step. Examples:

           T1: (not s_1) ~ r_1
           ...
           Tn: (not s_n) ~ r_n
       and
           T1: (not s_1) ~ r_1
           ...
           Tn: (not s_n) ~ 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'
                                    (and (or r_1 r_2) (or r_1' r_2')))
        
  • Z3_OP_PR_NNF_STAR: A proof for (~ P Q) where Q is in negation normal form.

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

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

  • Z3_OP_PR_CNF_STAR: A proof for (~ P Q) where Q is in conjunctive normal form. This proof object is only used if the parameter PROOF_MODE is 1. This proof object may have n antecedents. Each antecedent is a PR_DEF_INTRO.
  • Z3_OP_PR_SKOLEMIZE: Proof for:
     <div class="fragment"><pre class="fragment">
     [sk]: (~ (not (forall x (p x y))) (not (p (sk y) y)))
     [sk]: (~ (exists x (p x y)) (p (sk y) y))
     </pre></div>
    
     This proof object has no antecedents.
    
  • Z3_OP_PR_MODUS_PONENS_OEQ: Modus ponens style rule for equi-satisfiability.

           T1: p
           T2: (~ p q)
           
    • Z3_OP_PR_TH_LEMMA: Generic proof for theory lemmas.

      The theory lemma function comes with one or more parameters. The first parameter indicates the name of the theory. For the theory of arithmetic, additional parameters provide hints for checking the theory lemma. The hints for arithmetic are:

      • farkas - followed by rational coefficients. Multiply the coefficients to the inequalities in the lemma, add the (negated) inequalities and obtain a contradiction.
      • triangle-eq - Indicates a lemma related to the equivalence:
                 (iff (= t1 t2) (and (<= t1 t2) (<= t2 t1)))
              
      • gcd-test - Indicates an integer linear arithmetic lemma that uses a gcd test.

Z3_OP_PR_HYPER_RESOLVE: Hyper-resolution rule.

The premises of the rules is a sequence of clauses. The first clause argument is the main clause of the rule. with a literal from the first (main) clause.

Premises of the rules are of the form

             (or l0 l1 l2 .. ln)
     

or

          (=> (and l1 l2 .. ln) l0)
     

or in the most general (ground) form:

          (=> (and ln+1 ln+2 .. ln+m) (or l0 l1 .. ln))
     

In other words we use the following (Prolog style) convention for Horn implications: The head of a Horn implication is position 0, the first conjunct in the body of an implication is position 1 the second conjunct in the body of an implication is position 2

For general implications where the head is a disjunction, the first n positions correspond to the n disjuncts in the head. The next m positions correspond to the m conjuncts in the body.

The premises can be universally quantified so that the most general non-ground form is:

          (forall (vars) (=> (and ln+1 ln+2 .. ln+m) (or l0 l1 .. ln)))
     

The hyper-resolution rule takes a sequence of parameters. The parameters are substitutions of bound variables separated by pairs of literal positions from the main clause and side clause.

  • Z3_OP_RA_STORE: Insert a record into a relation. The function takes n+1 arguments, where the first argument is the relation and the remaining n elements correspond to the n columns of the relation.
  • Z3_OP_RA_EMPTY: Creates the empty relation.
  • Z3_OP_RA_IS_EMPTY: Tests if the relation is empty.
  • Z3_OP_RA_JOIN: Create the relational join.
  • Z3_OP_RA_UNION: Create the union or convex hull of two relations. The function takes two arguments.
  • Z3_OP_RA_WIDEN: Widen two relations. The function takes two arguments.
  • Z3_OP_RA_PROJECT: Project the columns (provided as numbers in the parameters). The function takes one argument.
  • Z3_OP_RA_FILTER: Filter (restrict) a relation with respect to a predicate. The first argument is a relation. The second argument is a predicate with free de-Brujin indices corresponding to the columns of the relation. So the first column in the relation has index 0.
  • Z3_OP_RA_NEGATION_FILTER: Intersect the first relation with respect to negation of the second relation (the function takes two arguments). Logically, the specification can be described by a function

    target = filter_by_negation(pos, neg, columns)

    where columns are pairs c1, d1, .., cN, dN of columns from pos and neg, such that target are elements in x in pos, such that there is no y in neg that agrees with x on the columns c1, d1, .., cN, dN.

  • Z3_OP_RA_RENAME: rename columns in the relation. The function takes one argument. The parameters contain the renaming as a cycle.
  • Z3_OP_RA_COMPLEMENT: Complement the relation.
  • Z3_OP_RA_SELECT: Check if a record is an element of the relation. The function takes n+1 arguments, where the first argument is a relation, and the remaining n arguments correspond to a record.
  • Z3_OP_RA_CLONE: Create a fresh copy (clone) of a relation. The function is logically the identity, but in the context of a register machine allows for Z3_OP_RA_UNION to perform destructive updates to the first argument.
  • Z3_OP_FD_LT: A less than predicate over the finite domain Z3_FINITE_DOMAIN_SORT.
  • Z3_OP_LABEL: A label (used by the Boogie Verification condition generator). The label has two parameters, a string and a Boolean polarity. It takes one argument, a formula.
  • Z3_OP_LABEL_LIT: A label literal (used by the Boogie Verification condition generator). A label literal has a set of string parameters. It takes no arguments.
  • Z3_OP_DT_CONSTRUCTOR: datatype constructor.
  • Z3_OP_DT_RECOGNISER: datatype recognizer.
  • Z3_OP_DT_ACCESSOR: datatype accessor.
  • Z3_OP_UNINTERPRETED: kind used for uninterpreted symbols.
Enumerator
Z3_OP_TRUE 
Z3_OP_FALSE 
Z3_OP_EQ 
Z3_OP_DISTINCT 
Z3_OP_ITE 
Z3_OP_AND 
Z3_OP_OR 
Z3_OP_IFF 
Z3_OP_XOR 
Z3_OP_NOT 
Z3_OP_IMPLIES 
Z3_OP_OEQ 
Z3_OP_INTERP 
Z3_OP_ANUM 
Z3_OP_AGNUM 
Z3_OP_LE 
Z3_OP_GE 
Z3_OP_LT 
Z3_OP_GT 
Z3_OP_ADD 
Z3_OP_SUB 
Z3_OP_UMINUS 
Z3_OP_MUL 
Z3_OP_DIV 
Z3_OP_IDIV 
Z3_OP_REM 
Z3_OP_MOD 
Z3_OP_TO_REAL 
Z3_OP_TO_INT 
Z3_OP_IS_INT 
Z3_OP_POWER 
Z3_OP_STORE 
Z3_OP_SELECT 
Z3_OP_CONST_ARRAY 
Z3_OP_ARRAY_MAP 
Z3_OP_ARRAY_DEFAULT 
Z3_OP_SET_UNION 
Z3_OP_SET_INTERSECT 
Z3_OP_SET_DIFFERENCE 
Z3_OP_SET_COMPLEMENT 
Z3_OP_SET_SUBSET 
Z3_OP_AS_ARRAY 
Z3_OP_BNUM 
Z3_OP_BIT1 
Z3_OP_BIT0 
Z3_OP_BNEG 
Z3_OP_BADD 
Z3_OP_BSUB 
Z3_OP_BMUL 
Z3_OP_BSDIV 
Z3_OP_BUDIV 
Z3_OP_BSREM 
Z3_OP_BUREM 
Z3_OP_BSMOD 
Z3_OP_BSDIV0 
Z3_OP_BUDIV0 
Z3_OP_BSREM0 
Z3_OP_BUREM0 
Z3_OP_BSMOD0 
Z3_OP_ULEQ 
Z3_OP_SLEQ 
Z3_OP_UGEQ 
Z3_OP_SGEQ 
Z3_OP_ULT 
Z3_OP_SLT 
Z3_OP_UGT 
Z3_OP_SGT 
Z3_OP_BAND 
Z3_OP_BOR 
Z3_OP_BNOT 
Z3_OP_BXOR 
Z3_OP_BNAND 
Z3_OP_BNOR 
Z3_OP_BXNOR 
Z3_OP_CONCAT 
Z3_OP_SIGN_EXT 
Z3_OP_ZERO_EXT 
Z3_OP_EXTRACT 
Z3_OP_REPEAT 
Z3_OP_BREDOR 
Z3_OP_BREDAND 
Z3_OP_BCOMP 
Z3_OP_BSHL 
Z3_OP_BLSHR 
Z3_OP_BASHR 
Z3_OP_ROTATE_LEFT 
Z3_OP_ROTATE_RIGHT 
Z3_OP_EXT_ROTATE_LEFT 
Z3_OP_EXT_ROTATE_RIGHT 
Z3_OP_INT2BV 
Z3_OP_BV2INT 
Z3_OP_CARRY 
Z3_OP_XOR3 
Z3_OP_PR_UNDEF 
Z3_OP_PR_TRUE 
Z3_OP_PR_ASSERTED 
Z3_OP_PR_GOAL 
Z3_OP_PR_MODUS_PONENS 
Z3_OP_PR_REFLEXIVITY 
Z3_OP_PR_SYMMETRY 
Z3_OP_PR_TRANSITIVITY 
Z3_OP_PR_TRANSITIVITY_STAR 
Z3_OP_PR_MONOTONICITY 
Z3_OP_PR_QUANT_INTRO 
Z3_OP_PR_DISTRIBUTIVITY 
Z3_OP_PR_AND_ELIM 
Z3_OP_PR_NOT_OR_ELIM 
Z3_OP_PR_REWRITE 
Z3_OP_PR_REWRITE_STAR 
Z3_OP_PR_PULL_QUANT 
Z3_OP_PR_PULL_QUANT_STAR 
Z3_OP_PR_PUSH_QUANT 
Z3_OP_PR_ELIM_UNUSED_VARS 
Z3_OP_PR_DER 
Z3_OP_PR_QUANT_INST 
Z3_OP_PR_HYPOTHESIS 
Z3_OP_PR_LEMMA 
Z3_OP_PR_UNIT_RESOLUTION 
Z3_OP_PR_IFF_TRUE 
Z3_OP_PR_IFF_FALSE 
Z3_OP_PR_COMMUTATIVITY 
Z3_OP_PR_DEF_AXIOM 
Z3_OP_PR_DEF_INTRO 
Z3_OP_PR_APPLY_DEF 
Z3_OP_PR_IFF_OEQ 
Z3_OP_PR_NNF_POS 
Z3_OP_PR_NNF_NEG 
Z3_OP_PR_NNF_STAR 
Z3_OP_PR_CNF_STAR 
Z3_OP_PR_SKOLEMIZE 
Z3_OP_PR_MODUS_PONENS_OEQ 
Z3_OP_PR_TH_LEMMA 
Z3_OP_PR_HYPER_RESOLVE 
Z3_OP_RA_STORE 
Z3_OP_RA_EMPTY 
Z3_OP_RA_IS_EMPTY 
Z3_OP_RA_JOIN 
Z3_OP_RA_UNION 
Z3_OP_RA_WIDEN 
Z3_OP_RA_PROJECT 
Z3_OP_RA_FILTER 
Z3_OP_RA_NEGATION_FILTER 
Z3_OP_RA_RENAME 
Z3_OP_RA_COMPLEMENT 
Z3_OP_RA_SELECT 
Z3_OP_RA_CLONE 
Z3_OP_FD_LT 
Z3_OP_LABEL 
Z3_OP_LABEL_LIT 
Z3_OP_DT_CONSTRUCTOR 
Z3_OP_DT_RECOGNISER 
Z3_OP_DT_ACCESSOR 
Z3_OP_UNINTERPRETED 

Definition at line 880 of file z3_api.h.

880  {
881  // Basic
882  Z3_OP_TRUE = 0x100,
883  Z3_OP_FALSE,
884  Z3_OP_EQ,
886  Z3_OP_ITE,
887  Z3_OP_AND,
888  Z3_OP_OR,
889  Z3_OP_IFF,
890  Z3_OP_XOR,
891  Z3_OP_NOT,
893  Z3_OP_OEQ,
894  Z3_OP_INTERP,
895 
896  // Arithmetic
897  Z3_OP_ANUM = 0x200,
898  Z3_OP_AGNUM,
899  Z3_OP_LE,
900  Z3_OP_GE,
901  Z3_OP_LT,
902  Z3_OP_GT,
903  Z3_OP_ADD,
904  Z3_OP_SUB,
905  Z3_OP_UMINUS,
906  Z3_OP_MUL,
907  Z3_OP_DIV,
908  Z3_OP_IDIV,
909  Z3_OP_REM,
910  Z3_OP_MOD,
912  Z3_OP_TO_INT,
913  Z3_OP_IS_INT,
914  Z3_OP_POWER,
915 
916  // Arrays & Sets
917  Z3_OP_STORE = 0x300,
918  Z3_OP_SELECT,
928 
929  // Bit-vectors
930  Z3_OP_BNUM = 0x400,
931  Z3_OP_BIT1,
932  Z3_OP_BIT0,
933  Z3_OP_BNEG,
934  Z3_OP_BADD,
935  Z3_OP_BSUB,
936  Z3_OP_BMUL,
937 
938  Z3_OP_BSDIV,
939  Z3_OP_BUDIV,
940  Z3_OP_BSREM,
941  Z3_OP_BUREM,
942  Z3_OP_BSMOD,
943 
944  // special functions to record the division by 0 cases
945  // these are internal functions
946  Z3_OP_BSDIV0,
947  Z3_OP_BUDIV0,
948  Z3_OP_BSREM0,
949  Z3_OP_BUREM0,
950  Z3_OP_BSMOD0,
951 
952  Z3_OP_ULEQ,
953  Z3_OP_SLEQ,
954  Z3_OP_UGEQ,
955  Z3_OP_SGEQ,
956  Z3_OP_ULT,
957  Z3_OP_SLT,
958  Z3_OP_UGT,
959  Z3_OP_SGT,
960 
961  Z3_OP_BAND,
962  Z3_OP_BOR,
963  Z3_OP_BNOT,
964  Z3_OP_BXOR,
965  Z3_OP_BNAND,
966  Z3_OP_BNOR,
967  Z3_OP_BXNOR,
968 
969  Z3_OP_CONCAT,
973  Z3_OP_REPEAT,
974 
975  Z3_OP_BREDOR,
977  Z3_OP_BCOMP,
978 
979  Z3_OP_BSHL,
980  Z3_OP_BLSHR,
981  Z3_OP_BASHR,
986 
987  Z3_OP_INT2BV,
988  Z3_OP_BV2INT,
989  Z3_OP_CARRY,
990  Z3_OP_XOR3,
991 
992  // Proofs
993  Z3_OP_PR_UNDEF = 0x500,
996  Z3_OP_PR_GOAL,
1013  Z3_OP_PR_DER,
1016  Z3_OP_PR_LEMMA,
1033 
1034  // Sequences
1035  Z3_OP_RA_STORE = 0x600,
1038  Z3_OP_RA_JOIN,
1048  Z3_OP_FD_LT,
1049 
1050  // Auxiliary
1051  Z3_OP_LABEL = 0x700,
1053 
1054  // Datatypes
1055  Z3_OP_DT_CONSTRUCTOR=0x800,
1058 
1060 } Z3_decl_kind;
Z3_decl_kind
The different kinds of interpreted function kinds.
Definition: z3_api.h:880

Z3 error codes (See Z3_get_error_code).

  • Z3_OK: No error.
  • Z3_SORT_ERROR: User tried to build an invalid (type incorrect) AST.
  • Z3_IOB: Index out of bounds.
  • Z3_INVALID_ARG: Invalid argument was provided.
  • Z3_PARSER_ERROR: An error occurred when parsing a string or file.
  • Z3_NO_PARSER: Parser output is not available, that is, user didn't invoke Z3_parse_smtlib_string or Z3_parse_smtlib_file.
  • Z3_INVALID_PATTERN: Invalid pattern was used to build a quantifier.
  • Z3_MEMOUT_FAIL: A memory allocation failure was encountered.
  • Z3_FILE_ACCESS_ERRROR: A file could not be accessed.
  • Z3_INVALID_USAGE: API call is invalid in the current state.
  • Z3_INTERNAL_FATAL: An error internal to Z3 occurred.
  • Z3_DEC_REF_ERROR: Trying to decrement the reference counter of an AST that was deleted or the reference counter was not initialized with Z3_inc_ref.
  • Z3_EXCEPTION: Internal Z3 exception. Additional details can be retrieved using Z3_get_error_msg.
Enumerator
Z3_OK 
Z3_SORT_ERROR 
Z3_IOB 
Z3_INVALID_ARG 
Z3_PARSER_ERROR 
Z3_NO_PARSER 
Z3_INVALID_PATTERN 
Z3_MEMOUT_FAIL 
Z3_FILE_ACCESS_ERROR 
Z3_INTERNAL_FATAL 
Z3_INVALID_USAGE 
Z3_DEC_REF_ERROR 
Z3_EXCEPTION 

Definition at line 1148 of file z3_api.h.

A Goal is essentially a set of formulas. Z3 provide APIs for building strategies/tactics for solving and transforming Goals. Some of these transformations apply under/over approximations.

  • Z3_GOAL_PRECISE: Approximations/Relaxations were not applied on the goal (sat and unsat answers were preserved).
  • Z3_GOAL_UNDER: Goal is the product of a under-approximation (sat answers are preserved).
  • Z3_GOAL_OVER: Goal is the product of an over-approximation (unsat answers are preserved).
  • Z3_GOAL_UNDER_OVER: Goal is garbage (it is the product of over- and under-approximations, sat and unsat answers are not preserved).
Enumerator
Z3_GOAL_PRECISE 
Z3_GOAL_UNDER 
Z3_GOAL_OVER 
Z3_GOAL_UNDER_OVER 

Definition at line 1221 of file z3_api.h.

1222 {
1223  Z3_GOAL_PRECISE,
1224  Z3_GOAL_UNDER,
1225  Z3_GOAL_OVER,
1227 } Z3_goal_prec;
Z3_goal_prec
A Goal is essentially a set of formulas. Z3 provide APIs for building strategies/tactics for solving ...
Definition: z3_api.h:1221
enum Z3_lbool

Lifted Boolean type: false, undefined, true.

Enumerator
Z3_L_FALSE 
Z3_L_UNDEF 
Z3_L_TRUE 

Definition at line 135 of file z3_api.h.

136 {
137  Z3_L_FALSE = -1,
138  Z3_L_UNDEF,
139  Z3_L_TRUE
140 } Z3_lbool;
Z3_lbool
Lifted Boolean type: false, undefined, true.
Definition: z3_api.h:135

The different kinds of parameters that can be associated with parameter sets. (see Z3_mk_params).

  • Z3_PK_UINT integer parameters.
  • Z3_PK_BOOL boolean parameters.
  • Z3_PK_DOUBLE double parameters.
  • Z3_PK_SYMBOL symbol parameters.
  • Z3_PK_STRING string parameters.
  • Z3_PK_OTHER all internal parameter kinds which are not exposed in the API.
  • Z3_PK_INVALID invalid parameter.
Enumerator
Z3_PK_UINT 
Z3_PK_BOOL 
Z3_PK_DOUBLE 
Z3_PK_SYMBOL 
Z3_PK_STRING 
Z3_PK_OTHER 
Z3_PK_INVALID 

Definition at line 1076 of file z3_api.h.

1076  {
1077  Z3_PK_UINT,
1078  Z3_PK_BOOL,
1079  Z3_PK_DOUBLE,
1080  Z3_PK_SYMBOL,
1081  Z3_PK_STRING,
1082  Z3_PK_OTHER,
1084 } Z3_param_kind;
Z3_param_kind
The different kinds of parameters that can be associated with parameter sets. (see Z3_mk_params)...
Definition: z3_api.h:1076

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

See also
Z3_get_decl_num_parameters
Z3_get_decl_parameter_kind
  • Z3_PARAMETER_INT is used for integer parameters.
  • Z3_PARAMETER_DOUBLE is used for double parameters.
  • Z3_PARAMETER_RATIONAL is used for parameters that are rational numbers.
  • Z3_PARAMETER_SYMBOL is used for parameters that are symbols.
  • Z3_PARAMETER_SORT is used for sort parameters.
  • Z3_PARAMETER_AST is used for expression parameters.
  • Z3_PARAMETER_FUNC_DECL is used for function declaration parameters.
Enumerator
Z3_PARAMETER_INT 
Z3_PARAMETER_DOUBLE 
Z3_PARAMETER_RATIONAL 
Z3_PARAMETER_SYMBOL 
Z3_PARAMETER_SORT 
Z3_PARAMETER_AST 
Z3_PARAMETER_FUNC_DECL 

Definition at line 171 of file z3_api.h.

172 {
Z3_parameter_kind
The different kinds of parameters that can be associated with function symbols.
Definition: z3_api.h:171

The different kinds of search failure types.

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

Definition at line 1100 of file z3_api.h.

1100  {
1101  Z3_NO_FAILURE,
1102  Z3_UNKNOWN,
1103  Z3_TIMEOUT,
1105  Z3_CANCELED,
1107  Z3_THEORY,
Z3_search_failure
The different kinds of search failure types.
Definition: z3_api.h:1100

The different kinds of Z3 types (See Z3_get_sort_kind).

Enumerator
Z3_UNINTERPRETED_SORT 
Z3_BOOL_SORT 
Z3_INT_SORT 
Z3_REAL_SORT 
Z3_BV_SORT 
Z3_ARRAY_SORT 
Z3_DATATYPE_SORT 
Z3_RELATION_SORT 
Z3_FINITE_DOMAIN_SORT 
Z3_UNKNOWN_SORT 

Definition at line 186 of file z3_api.h.

187 {
189  Z3_BOOL_SORT,
190  Z3_INT_SORT,
191  Z3_REAL_SORT,
192  Z3_BV_SORT,
197  Z3_UNKNOWN_SORT = 1000
198 } Z3_sort_kind;
Z3_sort_kind
The different kinds of Z3 types (See Z3_get_sort_kind).
Definition: z3_api.h:186

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

See also
Z3_mk_int_symbol
Z3_mk_string_symbol
Enumerator
Z3_INT_SYMBOL 
Z3_STRING_SYMBOL 

Definition at line 150 of file z3_api.h.

151 {
Z3_symbol_kind
The different kinds of symbol. In Z3, a symbol can be represented using integers and strings (See Z3_...
Definition: z3_api.h:150

Function Documentation

Z3_ast Z3_API Z3_algebraic_add ( __in Z3_context  c,
__in Z3_ast  a,
__in Z3_ast  b 
)

Return the value a + b.

Precondition
Z3_algebraic_is_value(c, a)
Z3_algebraic_is_value(c, b)
Postcondition
Z3_algebraic_is_value(c, result)
Z3_ast Z3_API Z3_algebraic_div ( __in Z3_context  c,
__in Z3_ast  a,
__in Z3_ast  b 
)

Return the value a / b.

Precondition
Z3_algebraic_is_value(c, a)
Z3_algebraic_is_value(c, b)
!Z3_algebraic_is_zero(c, b)
Postcondition
Z3_algebraic_is_value(c, result)
Z3_bool Z3_API Z3_algebraic_eq ( __in Z3_context  c,
__in Z3_ast  a,
__in Z3_ast  b 
)

Return Z3_TRUE if a == b, and Z3_FALSE otherwise.

Precondition
Z3_algebraic_is_value(c, a)
Z3_algebraic_is_value(c, b)
int Z3_API Z3_algebraic_eval ( __in Z3_context  c,
__in Z3_ast  p,
__in unsigned  n,
__in Z3_ast  a[] 
)

Given a multivariate polynomial p(x_0, ..., x_{n-1}), return the sign of p(a[0], ..., a[n-1]).

Precondition
p is a Z3 expression that contains only arithmetic terms and free variables.
forall i in [0, n) Z3_algebraic_is_value(c, a[i])
Z3_bool Z3_API Z3_algebraic_ge ( __in Z3_context  c,
__in Z3_ast  a,
__in Z3_ast  b 
)

Return Z3_TRUE if a >= b, and Z3_FALSE otherwise.

Precondition
Z3_algebraic_is_value(c, a)
Z3_algebraic_is_value(c, b)
Z3_bool Z3_API Z3_algebraic_gt ( __in Z3_context  c,
__in Z3_ast  a,
__in Z3_ast  b 
)

Return Z3_TRUE if a > b, and Z3_FALSE otherwise.

Precondition
Z3_algebraic_is_value(c, a)
Z3_algebraic_is_value(c, b)
Z3_bool Z3_API Z3_algebraic_is_neg ( __in Z3_context  c,
__in Z3_ast  a 
)

Return the Z3_TRUE if a is negative, and Z3_FALSE otherwise.

Precondition
Z3_algebraic_is_value(c, a)
Z3_bool Z3_API Z3_algebraic_is_pos ( __in Z3_context  c,
__in Z3_ast  a 
)

Return the Z3_TRUE if a is positive, and Z3_FALSE otherwise.

Precondition
Z3_algebraic_is_value(c, a)
Z3_bool Z3_API Z3_algebraic_is_value ( __in Z3_context  c,
__in Z3_ast  a 
)

Return Z3_TRUE if can be used as value in the Z3 real algebraic number package.

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

Return the Z3_TRUE if a is zero, and Z3_FALSE otherwise.

Precondition
Z3_algebraic_is_value(c, a)
Z3_bool Z3_API Z3_algebraic_le ( __in Z3_context  c,
__in Z3_ast  a,
__in Z3_ast  b 
)

Return Z3_TRUE if a <= b, and Z3_FALSE otherwise.

Precondition
Z3_algebraic_is_value(c, a)
Z3_algebraic_is_value(c, b)
Z3_bool Z3_API Z3_algebraic_lt ( __in Z3_context  c,
__in Z3_ast  a,
__in Z3_ast  b 
)

Return Z3_TRUE if a < b, and Z3_FALSE otherwise.

Precondition
Z3_algebraic_is_value(c, a)
Z3_algebraic_is_value(c, b)
Z3_ast Z3_API Z3_algebraic_mul ( __in Z3_context  c,
__in Z3_ast  a,
__in Z3_ast  b 
)

Return the value a * b.

Precondition
Z3_algebraic_is_value(c, a)
Z3_algebraic_is_value(c, b)
Postcondition
Z3_algebraic_is_value(c, result)
Z3_bool Z3_API Z3_algebraic_neq ( __in Z3_context  c,
__in Z3_ast  a,
__in Z3_ast  b 
)

Return Z3_TRUE if a != b, and Z3_FALSE otherwise.

Precondition
Z3_algebraic_is_value(c, a)
Z3_algebraic_is_value(c, b)
Z3_ast Z3_API Z3_algebraic_power ( __in Z3_context  c,
__in Z3_ast  a,
__in unsigned  k 
)

Return the a^k.

Precondition
Z3_algebraic_is_value(c, a)
Postcondition
Z3_algebraic_is_value(c, result)
Z3_ast Z3_API Z3_algebraic_root ( __in Z3_context  c,
__in Z3_ast  a,
__in unsigned  k 
)

Return the a^(1/k)

Precondition
Z3_algebraic_is_value(c, a)
k is even => !Z3_algebraic_is_neg(c, a)
Postcondition
Z3_algebraic_is_value(c, result)
Z3_ast_vector Z3_API Z3_algebraic_roots ( __in Z3_context  c,
__in Z3_ast  p,
__in unsigned  n,
__in Z3_ast  a[] 
)

Given a multivariate polynomial p(x_0, ..., x_{n-1}, x_n), returns the roots of the univariate polynomial p(a[0], ..., a[n-1], x_n).

Precondition
p is a Z3 expression that contains only arithmetic terms and free variables.
forall i in [0, n) Z3_algebraic_is_value(c, a[i])
Postcondition
forall r in result Z3_algebraic_is_value(c, result)
int Z3_API Z3_algebraic_sign ( __in Z3_context  c,
__in Z3_ast  a 
)

Return 1 if a is positive, 0 if a is zero, and -1 if a is negative.

Precondition
Z3_algebraic_is_value(c, a)
Z3_ast Z3_API Z3_algebraic_sub ( __in Z3_context  c,
__in Z3_ast  a,
__in Z3_ast  b 
)

Return the value a - b.

Precondition
Z3_algebraic_is_value(c, a)
Z3_algebraic_is_value(c, b)
Postcondition
Z3_algebraic_is_value(c, result)
Z3_ast Z3_API Z3_app_to_ast ( __in Z3_context  c,
__in Z3_app  a 
)

Convert a Z3_app into Z3_ast. This is just type casting.

void Z3_API Z3_append_log ( __in Z3_string  string)

Append user-defined string to interaction log.

The interaction log is opened using Z3_open_log. It contains the formulas that are checked using Z3. You can use this command to append comments, for instance.

Referenced by z3py::append_log().

Z3_model Z3_API Z3_apply_result_convert_model ( __in Z3_context  c,
__in Z3_apply_result  r,
__in unsigned  i,
__in Z3_model  m 
)

Convert a model for the subgoal Z3_apply_result_get_subgoal(c, r, i) into a model for the original goal g. Where g is the goal used to create r using Z3_tactic_apply(c, t, g).

Referenced by apply_result::convert_model(), and ApplyResult::convert_model().

void Z3_API Z3_apply_result_dec_ref ( __in Z3_context  c,
__in Z3_apply_result  r 
)

Decrement the reference counter of the given Z3_apply_result object.

Referenced by ApplyResult::__del__(), apply_result::operator=(), and apply_result::~apply_result().

unsigned Z3_API Z3_apply_result_get_num_subgoals ( __in Z3_context  c,
__in Z3_apply_result  r 
)

Return the number of subgoals in the Z3_apply_result object returned by Z3_tactic_apply.

Referenced by ApplyResult::__len__(), and apply_result::size().

Z3_goal Z3_API Z3_apply_result_get_subgoal ( __in Z3_context  c,
__in Z3_apply_result  r,
__in unsigned  i 
)

Return one of the subgoals in the Z3_apply_result object returned by Z3_tactic_apply.

Precondition
i < Z3_apply_result_get_num_subgoals(c, r)

Referenced by ApplyResult::__getitem__(), and apply_result::operator[]().

void Z3_API Z3_apply_result_inc_ref ( __in Z3_context  c,
__in Z3_apply_result  r 
)

Increment the reference counter of the given Z3_apply_result object.

Referenced by apply_result::operator=().

Z3_string Z3_API Z3_apply_result_to_string ( __in Z3_context  c,
__in Z3_apply_result  r 
)

Convert the Z3_apply_result object returned by Z3_tactic_apply into a string.

Referenced by ApplyResult::sexpr().

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

Assert a constraint into the logical context.

After one assertion, the logical context may become inconsistent.

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

See also
Z3_check
Z3_check_and_get_model
Deprecated:
Subsumed by Z3_solver_assert
Z3_bool Z3_API Z3_ast_map_contains ( __in Z3_context  c,
__in Z3_ast_map  m,
__in Z3_ast  k 
)

Return true if the map m contains the AST key k.

void Z3_API Z3_ast_map_dec_ref ( __in Z3_context  c,
__in Z3_ast_map  m 
)

Decrement the reference counter of the given AST map.

void Z3_API Z3_ast_map_erase ( __in Z3_context  c,
__in Z3_ast_map  m,
__in Z3_ast  k 
)

Erase a key from the map.

Z3_ast Z3_API Z3_ast_map_find ( __in Z3_context  c,
__in Z3_ast_map  m,
__in Z3_ast  k 
)

Return the value associated with the key k.

The procedure invokes the error handler if k is not in the map.

void Z3_API Z3_ast_map_inc_ref ( __in Z3_context  c,
__in Z3_ast_map  m 
)

Increment the reference counter of the given AST map.

void Z3_API Z3_ast_map_insert ( __in Z3_context  c,
__in Z3_ast_map  m,
__in Z3_ast  k,
__in Z3_ast  v 
)

Store/Replace a new key, value pair in the given map.

Z3_ast_vector Z3_API Z3_ast_map_keys ( __in Z3_context  c,
__in Z3_ast_map  m 
)

Return the keys stored in the given map.

void Z3_API Z3_ast_map_reset ( __in Z3_context  c,
__in Z3_ast_map  m 
)

Remove all keys from the given map.

unsigned Z3_API Z3_ast_map_size ( __in Z3_context  c,
__in Z3_ast_map  m 
)

Return the size of the given map.

Z3_string Z3_API Z3_ast_map_to_string ( __in Z3_context  c,
__in Z3_ast_map  m 
)

Convert the given map into a string.

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

Convert the given AST node into a string.

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

Referenced by AstRef::sexpr().

void Z3_API Z3_ast_vector_dec_ref ( __in Z3_context  c,
__in Z3_ast_vector  v 
)

Decrement the reference counter of the given AST vector.

Referenced by ast_vector_tpl< T >::operator=(), and ast_vector_tpl< T >::~ast_vector_tpl().

Z3_ast Z3_API Z3_ast_vector_get ( __in Z3_context  c,
__in Z3_ast_vector  v,
__in unsigned  i 
)

Return the AST at position i in the AST vector v.

Precondition
i < Z3_ast_vector_size(c, v)

Referenced by ast_vector_tpl< T >::operator[]().

void Z3_API Z3_ast_vector_inc_ref ( __in Z3_context  c,
__in Z3_ast_vector  v 
)

Increment the reference counter of the given AST vector.

Referenced by ast_vector_tpl< T >::ast_vector_tpl(), and ast_vector_tpl< T >::operator=().

void Z3_API Z3_ast_vector_push ( __in Z3_context  c,
__in Z3_ast_vector  v,
__in Z3_ast  a 
)

Add the AST a in the end of the AST vector v. The size of v is increased by one.

Referenced by ast_vector_tpl< T >::push_back().

void Z3_API Z3_ast_vector_resize ( __in Z3_context  c,
__in Z3_ast_vector  v,
__in unsigned  n 
)

Resize the AST vector v.

Referenced by ast_vector_tpl< T >::resize().

void Z3_API Z3_ast_vector_set ( __in Z3_context  c,
__in Z3_ast_vector  v,
__in unsigned  i,
__in Z3_ast  a 
)

Update position i of the AST vector v with the AST a.

Precondition
i < Z3_ast_vector_size(c, v)
unsigned Z3_API Z3_ast_vector_size ( __in Z3_context  c,
__in Z3_ast_vector  v 
)

Return the size of the given AST vector.

Referenced by ast_vector_tpl< T >::size().

Z3_string Z3_API Z3_ast_vector_to_string ( __in Z3_context  c,
__in Z3_ast_vector  v 
)

Convert AST vector into a string.

Z3_ast_vector Z3_API Z3_ast_vector_translate ( __in Z3_context  s,
__in Z3_ast_vector  v,
__in Z3_context  t 
)

Translate the AST vector v from context s into an AST vector in context t.

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

Convert the given benchmark into SMT-LIB formatted string.

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

Referenced by Solver::to_smt2().

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

Block subsequent checks using the remaining enabled labels.

Deprecated:
This procedure is based on the old Solver API.
Z3_lbool Z3_API Z3_check ( __in Z3_context  c)

Check whether the given logical context is consistent or not.

The function Z3_check_and_get_model should be used when models are needed.

See also
Z3_check_and_get_model
Deprecated:
Subsumed by Z3_solver_check
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 NULL is stored in m. The caller is responsible for deleting the model using the function Z3_del_model.

Remarks
In contrast with the rest of the Z3 API, the reference counter of the model is incremented. This is to guarantee backward compatibility. In previous versions, models did not support reference counting.
Model construction must be enabled using configuration parameters (See, Z3_mk_config).
See also
Z3_check
Z3_del_model
Deprecated:
Subsumed by Z3_solver_check
Z3_lbool Z3_API Z3_check_assumptions ( __in Z3_context  c,
__in unsigned  num_assumptions,
__in_ecount(num_assumptions) Z3_ast const  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-NULL model argument is passed in, and model construction is enabled (see Z3_mk_config), then a model is stored in m. Otherwise, m is left unchanged. The caller is responsible for deleting the model using the function Z3_del_model.

Remarks
If the model argument is non-NULL, then model construction must be enabled using configuration parameters (See, Z3_mk_config).
Parameters
clogical context.
num_assumptionsnumber of auxiliary assumptions.
assumptionsarray of auxiliary assumptions
moptional pointer to a model.
proofoptional pointer to a proof term.
core_sizesize of unsatisfiable core.
corepointer to an array receiving 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.
Precondition
assumptions comprises of propositional literals. In other words, you cannot use compound formulas for assumptions, but should use propositional variables or negations of propositional variables.
Remarks
In constrast with the rest of the Z3 API, the reference counter of the model is incremented. This is to guarantee backward compatibility. In previous versions, models did not support reference counting.
See also
Z3_check
Z3_del_model
Deprecated:
Subsumed by Z3_solver_check_assumptions
int Z3_API Z3_check_interpolant ( __in Z3_context  ctx,
__in unsigned  num,
__in_ecount(num) Z3_ast  cnsts[],
__in_ecount(num) unsigned  parents[],
__in_ecount(num-1) Z3_ast *  interps,
__out Z3_string_ptr  error,
__in unsigned  num_theory,
__in_ecount(num_theory) Z3_ast  theory[] 
)

Check the correctness of an interpolant. The Z3 context must have no constraints asserted when this call is made. That means that after interpolating, you must first fully pop the Z3 context before calling this. See Z3_interpolate for meaning of parameters.

Parameters
ctxThe Z3 context. Must be generated by Z3_mk_interpolation_context
numThe number of constraints in the sequence
cnstsArray of constraints (AST's in context ctx)
parentsThe parents vector (or NULL for sequence)
interpsThe interpolant to check
errorReturns an error message if interpolant incorrect (do not free the string)
num_theoryNumber of theory terms
theoryTheory terms

Return value is Z3_L_TRUE if interpolant is verified, Z3_L_FALSE if incorrect, and Z3_L_UNDEF if unknown.

void Z3_API Z3_close_log ( void  )

Close interaction log.

Z3_lbool Z3_API Z3_compute_interpolant ( __in Z3_context  c,
__in Z3_ast  pat,
__in Z3_params  p,
__out Z3_ast_vector *  interp,
__out Z3_model *  model 
)
Z3_string Z3_API Z3_context_to_string ( __in Z3_context  c)

Convert the given logical context into a string.

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

Warning
The result buffer is statically allocated by Z3. It will be automatically deallocated when Z3_del_context is invoked. So, the buffer is invalidated in the next call to Z3_context_to_string.
Deprecated:
This method is obsolete. It just displays the internal representation of the global solver available for backward compatibility reasons.
void Z3_API Z3_dec_ref ( __in Z3_context  c,
__in Z3_ast  a 
)

Decrement the reference counter of the given AST. The context c should have been created using Z3_mk_context_rc. This function is a NOOP if c was created using Z3_mk_context.

Referenced by AstRef::__del__(), ast::operator=(), and ast::~ast().

void Z3_API Z3_del_config ( __in Z3_config  c)

Delete the given configuration object.

See also
Z3_mk_config

Referenced by config::~config().

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

Reclaim memory allocated to constructor.

Parameters
clogical context.
constrconstructor.
void Z3_API Z3_del_constructor_list ( __in Z3_context  c,
__in Z3_constructor_list  clist 
)

Reclaim memory allocated for constructor list.

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

Parameters
clogical context.
clistconstructor list container.
void Z3_API Z3_del_context ( __in Z3_context  c)

Delete the given logical context.

See also
Z3_mk_context

Referenced by context::~context().

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

Delete a labels context.

See also
Z3_get_relevant_labels
Deprecated:
This procedure is based on the old Solver API.
void Z3_API Z3_del_model ( __in Z3_context  c,
__in Z3_model  m 
)

Delete a model object.

See also
Z3_check_and_get_model
Remarks
The Z3_check_and_get_model automatically increments a reference count on the model. The expected usage is that models created by that method are deleted using Z3_del_model. This is for backwards compatibility and in contrast to the rest of the API where callers are responsible for managing reference counts.
Deprecated:
Subsumed by Z3_solver API
void Z3_API Z3_disable_literal ( __in Z3_context  c,
__in Z3_literals  lbls,
__in unsigned  idx 
)

Disable label.

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

See also
Z3_block_literals
Deprecated:
This procedure is based on the old Solver API.
void Z3_API Z3_disable_trace ( __in Z3_string  tag)

Disable tracing messages tagged as tag when Z3 is compiled in debug mode. It is a NOOP otherwise.

Referenced by z3py::disable_trace().

void Z3_API Z3_enable_trace ( __in Z3_string  tag)

Enable tracing messages tagged as tag when Z3 is compiled in debug mode. It is a NOOP otherwise.

Referenced by z3py::enable_trace().

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.
  • the model m is partial, that is, it doesn't have a complete interpretation for uninterpreted functions. That is, the option MODEL_PARTIAL=true was used.
  • t is type incorrect.
Deprecated:
Use Z3_model_eval
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 const  args[],
__out Z3_ast *  v 
)

Evaluate declaration given values.

Provides direct way to evaluate declarations without going over terms.

Deprecated:
Consider using Z3_model_eval and Z3_substitute_vars
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.

Deprecated:
Consider using Z3_model_eval or Z3_model_get_func_interp
void Z3_API Z3_fixedpoint_add_cover ( Z3_context  c,
Z3_fixedpoint  d,
int  level,
Z3_func_decl  pred,
Z3_ast  property 
)

Add property about the predicate pred. Add a property of predicate pred at level. It gets pushed forward when possible.

Note: level = -1 is treated as the fixedpoint. So passing -1 for the level means that the property is true of the fixed-point unfolding with respect to pred.

Note: this functionality is PDR specific.

Referenced by Fixedpoint::add_cover().

void Z3_API Z3_fixedpoint_add_fact ( __in Z3_context  c,
__in Z3_fixedpoint  d,
__in Z3_func_decl  r,
__in unsigned  num_args,
__in_ecount(num_args) unsigned  args[] 
)

Add a Database fact.

Parameters
c- context
d- fixed point context
r- relation signature for the row.
num_args- number of columns for the given row.
args- array of the row elements.

The number of arguments num_args should be equal to the number of sorts in the domain of r. Each sort in the domain should be an integral (bit-vector, Boolean or or finite domain sort).

The call has the same effect as adding a rule where r is applied to the arguments.

void Z3_API Z3_fixedpoint_add_rule ( __in Z3_context  c,
__in Z3_fixedpoint  d,
__in Z3_ast  rule,
__in Z3_symbol  name 
)

Add a universal Horn clause as a named rule. The horn_rule should be of the form:

1 horn_rule ::= (forall (bound-vars) horn_rule)
2  | (=> atoms horn_rule)
3  | atom

Referenced by Fixedpoint::add_rule().

void Z3_API Z3_fixedpoint_assert ( __in Z3_context  c,
__in Z3_fixedpoint  d,
__in Z3_ast  axiom 
)

Assert a constraint to the fixedpoint context.

The constraints are used as background axioms when the fixedpoint engine uses the PDR mode. They are ignored for standard Datalog mode.

Referenced by Fixedpoint::assert_exprs().

void Z3_API Z3_fixedpoint_dec_ref ( __in Z3_context  c,
__in Z3_fixedpoint  d 
)

Decrement the reference counter of the given fixedpoint context.

Referenced by Fixedpoint::__del__().

Z3_ast_vector Z3_API Z3_fixedpoint_from_file ( __in Z3_context  c,
__in Z3_fixedpoint  f,
__in Z3_string  s 
)

Parse an SMT-LIB2 file with fixedpoint rules. Add the rules to the current fixedpoint context. Return the set of queries in the file.

Parameters
c- context.
f- fixedpoint context.
s- string containing SMT2 specification.

Referenced by Fixedpoint::parse_file().

Z3_ast_vector Z3_API Z3_fixedpoint_from_string ( __in Z3_context  c,
__in Z3_fixedpoint  f,
__in Z3_string  s 
)

Parse an SMT-LIB2 string with fixedpoint rules. Add the rules to the current fixedpoint context. Return the set of queries in the file.

Parameters
c- context.
f- fixedpoint context.
s- string containing SMT2 specification.

Referenced by Fixedpoint::parse_string().

Z3_ast Z3_API Z3_fixedpoint_get_answer ( __in Z3_context  c,
__in Z3_fixedpoint  d 
)

Retrieve a formula that encodes satisfying answers to the query.

When used in Datalog mode, the returned answer is a disjunction of conjuncts. Each conjunct encodes values of the bound variables of the query that are satisfied. In PDR mode, the returned answer is a single conjunction.

When used in Datalog mode the previous call to Z3_fixedpoint_query must have returned Z3_L_TRUE. When used with the PDR engine, the previous call must have been either Z3_L_TRUE or Z3_L_FALSE.

Referenced by Fixedpoint::get_answer().

Z3_ast_vector Z3_API Z3_fixedpoint_get_assertions ( __in Z3_context  c,
__in Z3_fixedpoint  f 
)

Retrieve set of background assertions from fixedpoint context.

Referenced by Fixedpoint::get_assertions().

Z3_ast Z3_API Z3_fixedpoint_get_cover_delta ( Z3_context  c,
Z3_fixedpoint  d,
int  level,
Z3_func_decl  pred 
)

Retrieve the current cover of pred up to level unfoldings. Return just the delta that is known at level. To obtain the full set of properties of pred one should query at level+1 , level+2 etc, and include level=-1.

Note: this functionality is PDR specific.

Referenced by Fixedpoint::get_cover_delta().

Z3_string Z3_API Z3_fixedpoint_get_help ( __in Z3_context  c,
__in Z3_fixedpoint  f 
)

Return a string describing all fixedpoint available parameters.

Referenced by Fixedpoint::help().

unsigned Z3_API Z3_fixedpoint_get_num_levels ( Z3_context  c,
Z3_fixedpoint  d,
Z3_func_decl  pred 
)

Query the PDR engine for the maximal levels properties are known about predicate.

This call retrieves the maximal number of relevant unfoldings of pred with respect to the current exploration state. Note: this functionality is PDR specific.

Referenced by Fixedpoint::get_num_levels().

Z3_param_descrs Z3_API Z3_fixedpoint_get_param_descrs ( __in Z3_context  c,
__in Z3_fixedpoint  f 
)

Return the parameter description set for the given fixedpoint object.

Referenced by Fixedpoint::param_descrs().

Z3_string Z3_API Z3_fixedpoint_get_reason_unknown ( __in Z3_context  c,
__in Z3_fixedpoint  d 
)

Retrieve a string that describes the last status returned by Z3_fixedpoint_query.

Use this method when Z3_fixedpoint_query returns Z3_L_UNDEF.

Referenced by Fixedpoint::reason_unknown().

Z3_ast_vector Z3_API Z3_fixedpoint_get_rules ( __in Z3_context  c,
__in Z3_fixedpoint  f 
)

Retrieve set of rules from fixedpoint context.

Referenced by Fixedpoint::get_rules().

Z3_stats Z3_API Z3_fixedpoint_get_statistics ( __in Z3_context  c,
__in Z3_fixedpoint  d 
)

Retrieve statistics information from the last call to Z3_fixedpoint_query.

Referenced by Fixedpoint::statistics().

void Z3_API Z3_fixedpoint_inc_ref ( __in Z3_context  c,
__in Z3_fixedpoint  d 
)

Increment the reference counter of the given fixedpoint context.

void Z3_API Z3_fixedpoint_init ( __in Z3_context  c,
__in Z3_fixedpoint  d,
__in void *  state 
)

Initialize the context with a user-defined state.

void Z3_API Z3_fixedpoint_pop ( Z3_context  c,
Z3_fixedpoint  d 
)

Backtrack one backtracking point.

See also
Z3_fixedpoint_push
Precondition
The number of calls to pop cannot exceed calls to push.

Referenced by Fixedpoint::pop().

void Z3_API Z3_fixedpoint_push ( Z3_context  c,
Z3_fixedpoint  d 
)

Create a backtracking point.

The fixedpoint solver contains a set of rules, added facts and assertions. The set of rules, facts and assertions are restored upon calling Z3_fixedpoint_pop.

See also
Z3_fixedpoint_pop

Referenced by Fixedpoint::push().

Z3_lbool Z3_API Z3_fixedpoint_query ( __in Z3_context  c,
__in Z3_fixedpoint  d,
__in Z3_ast  query 
)

Pose a query against the asserted rules.

1 query ::= (exists (bound-vars) query)
2  | literals

query returns

  • Z3_L_FALSE if the query is unsatisfiable.
  • Z3_L_TRUE if the query is satisfiable. Obtain the answer by calling Z3_fixedpoint_get_answer.
  • Z3_L_UNDEF if the query was interrupted, timed out or otherwise failed.

Referenced by Fixedpoint::query().

Z3_lbool Z3_API Z3_fixedpoint_query_relations ( __in Z3_context  c,
__in Z3_fixedpoint  d,
__in unsigned  num_relations,
__in_ecount(num_relations) Z3_func_decl const  relations[] 
)

Pose multiple queries against the asserted rules.

The queries are encoded as relations (function declarations).

query returns

  • Z3_L_FALSE if the query is unsatisfiable.
  • Z3_L_TRUE if the query is satisfiable. Obtain the answer by calling Z3_fixedpoint_get_answer.
  • Z3_L_UNDEF if the query was interrupted, timed out or otherwise failed.

Referenced by Fixedpoint::query().

void Z3_API Z3_fixedpoint_register_relation ( __in Z3_context  c,
__in Z3_fixedpoint  d,
__in Z3_func_decl  f 
)

Register relation as Fixedpoint defined. Fixedpoint defined relations have least-fixedpoint semantics. For example, the relation is empty if it does not occur in a head or a fact.

Referenced by Fixedpoint::register_relation().

void Z3_API Z3_fixedpoint_set_params ( __in Z3_context  c,
__in Z3_fixedpoint  f,
__in Z3_params  p 
)

Set parameters on fixedpoint context.

Referenced by Fixedpoint::set().

void Z3_API Z3_fixedpoint_set_predicate_representation ( __in Z3_context  c,
__in Z3_fixedpoint  d,
__in Z3_func_decl  f,
__in unsigned  num_relations,
__in_ecount(num_relations) Z3_symbol const  relation_kinds[] 
)

Configure the predicate representation.

It sets the predicate to use a set of domains given by the list of symbols. The domains given by the list of symbols must belong to a set of built-in domains.

Referenced by Fixedpoint::set_predicate_representation().

void Z3_API Z3_fixedpoint_set_reduce_app_callback ( __in Z3_context  c,
__in Z3_fixedpoint  d,
__in Z3_fixedpoint_reduce_app_callback_fptr  cb 
)

Register a callback for buildling terms based on the relational operators.

void Z3_API Z3_fixedpoint_set_reduce_assign_callback ( __in Z3_context  c,
__in Z3_fixedpoint  d,
__in Z3_fixedpoint_reduce_assign_callback_fptr  cb 
)

Register a callback to destructive updates.

Registers are identified with terms encoded as fresh constants,

Z3_string Z3_API Z3_fixedpoint_to_string ( __in Z3_context  c,
__in Z3_fixedpoint  f,
__in unsigned  num_queries,
__in_ecount(num_queries) Z3_ast  queries[] 
)

Print the current rules and background axioms as a string.

Parameters
c- context.
f- fixedpoint context.
num_queries- number of additional queries to print.
queries- additional queries.

Referenced by Fixedpoint::sexpr(), and Fixedpoint::to_string().

void Z3_API Z3_fixedpoint_update_rule ( __in Z3_context  c,
__in Z3_fixedpoint  d,
__in Z3_ast  a,
__in Z3_symbol  name 
)

Update a named rule. A rule with the same name must have been previously created.

Referenced by Fixedpoint::update_rule().

Z3_ast Z3_API Z3_func_decl_to_ast ( __in Z3_context  c,
__in Z3_func_decl  f 
)

Convert a Z3_func_decl into Z3_ast. This is just type casting.

Referenced by FuncDeclRef::as_ast().

Z3_string Z3_API Z3_func_decl_to_string ( __in Z3_context  c,
__in Z3_func_decl  d 
)
void Z3_API Z3_func_entry_dec_ref ( __in Z3_context  c,
__in Z3_func_entry  e 
)

Decrement the reference counter of the given Z3_func_entry object.

Referenced by func_entry::operator=(), and func_entry::~func_entry().

Z3_ast Z3_API Z3_func_entry_get_arg ( __in Z3_context  c,
__in Z3_func_entry  e,
__in unsigned  i 
)

Return an argument of a Z3_func_entry object.

Precondition
i < Z3_func_entry_get_num_args(c, e)
See also
Z3_func_interp_get_entry

Referenced by func_entry::arg().

unsigned Z3_API Z3_func_entry_get_num_args ( __in Z3_context  c,
__in Z3_func_entry  e 
)

Return the number of arguments in a Z3_func_entry object.

See also
Z3_func_interp_get_entry

Referenced by func_entry::num_args().

Z3_ast Z3_API Z3_func_entry_get_value ( __in Z3_context  c,
__in Z3_func_entry  e 
)

Return the value of this point.

A Z3_func_entry object represents an element in the finite map used to encode a function interpretation.

See also
Z3_func_interp_get_entry

Referenced by func_entry::value().

void Z3_API Z3_func_entry_inc_ref ( __in Z3_context  c,
__in Z3_func_entry  e 
)

Increment the reference counter of the given Z3_func_entry object.

Referenced by func_entry::operator=().

void Z3_API Z3_func_interp_dec_ref ( __in Z3_context  c,
__in Z3_func_interp  f 
)

Decrement the reference counter of the given Z3_func_interp object.

Referenced by func_interp::operator=(), and func_interp::~func_interp().

unsigned Z3_API Z3_func_interp_get_arity ( __in Z3_context  c,
__in Z3_func_interp  f 
)

Return the arity (number of arguments) of the given function interpretation.

Z3_ast Z3_API Z3_func_interp_get_else ( __in Z3_context  c,
__in Z3_func_interp  f 
)

Return the 'else' value of the given function interpretation.

A function interpretation is represented as a finite map and an 'else' value. This procedure returns the 'else' value.

Referenced by func_interp::else_value().

Z3_func_entry Z3_API Z3_func_interp_get_entry ( __in Z3_context  c,
__in Z3_func_interp  f,
unsigned  i 
)

Return a "point" of the given function intepretation. It represents the value of f in a particular point.

Precondition
i < Z3_func_interp_get_num_entries(c, f)
See also
Z3_func_interp_get_num_entries

Referenced by func_interp::entry().

unsigned Z3_API Z3_func_interp_get_num_entries ( __in Z3_context  c,
__in Z3_func_interp  f 
)

Return the number of entries in the given function interpretation.

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. This procedure return the number of element in the finite map of f.

Referenced by func_interp::num_entries().

void Z3_API Z3_func_interp_inc_ref ( __in Z3_context  c,
__in Z3_func_interp  f 
)

Increment the reference counter of the given Z3_func_interp object.

Referenced by func_interp::operator=().

Z3_ast Z3_API Z3_get_algebraic_number_lower ( __in Z3_context  c,
__in Z3_ast  a,
__in unsigned  precision 
)

Return a lower bound for the given real algebraic number. The interval isolating the number is smaller than 1/10^precision. The result is a numeral AST of sort Real.

Precondition
Z3_is_algebraic_number(c, a)
Z3_ast Z3_API Z3_get_algebraic_number_upper ( Z3_context  c,
Z3_ast  a,
unsigned  precision 
)

Return a upper bound for the given real algebraic number. The interval isolating the number is smaller than 1/10^precision. The result is a numeral AST of sort Real.

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

Return the i-th argument of the given application.

Precondition
i < Z3_get_num_args(c, a)

Referenced by expr::arg(), and ExprRef::arg().

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 expr::decl(), and ExprRef::decl().

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 expr::num_args(), and ExprRef::num_args().

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

Alias for Z3_get_domain_size.

See also
Z3_get_domain_size

Referenced by func_decl::arity(), and FuncDeclRef::arity().

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

Return the domain of the given array sort.

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

Referenced by sort::array_domain().

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

Return the range of the given array sort.

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

Referenced by sort::array_range().

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

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

Precondition
Z3_TRUE == Z3_is_array_value(c, v, &num_entries)
Deprecated:
Use Z3_func_interp objects and Z3_get_as_array_func_decl
Z3_func_decl Z3_API Z3_get_as_array_func_decl ( __in Z3_context  c,
__in Z3_ast  a 
)

Return the function declaration f associated with a (_ as_array f) node.

See also
Z3_is_as_array
unsigned Z3_API Z3_get_ast_hash ( __in Z3_context  c,
__in Z3_ast  a 
)

Return a hash code for the given AST.

Referenced by ast::hash(), and AstRef::hash().

unsigned Z3_API Z3_get_ast_id ( __in Z3_context  c,
Z3_ast  t 
)

Return a unique identifier for t.

Referenced by AstRef::get_id(), SortRef::get_id(), FuncDeclRef::get_id(), and ExprRef::get_id().

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.

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

Referenced by sort::bv_size().

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.

Deprecated:
This method is based on the old solver API.
Z3_func_decl Z3_API Z3_get_datatype_sort_constructor ( __in Z3_context  c,
__in Z3_sort  t,
unsigned  idx 
)

Return idx'th constructor.

Precondition
Z3_get_sort_kind(t) == Z3_DATATYPE_SORT
idx < Z3_get_datatype_sort_num_constructors(c, t)
See also
Z3_get_datatype_sort_num_constructors
Z3_get_datatype_sort_recognizer
Z3_get_datatype_sort_constructor_accessor
Z3_func_decl Z3_API Z3_get_datatype_sort_constructor_accessor ( __in Z3_context  c,
__in Z3_sort  t,
unsigned  idx_c,
unsigned  idx_a 
)

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

Precondition
Z3_get_sort_kind(t) == Z3_DATATYPE_SORT
idx_c < Z3_get_datatype_sort_num_constructors(c, t)
idx_a < Z3_get_domain_size(c, Z3_get_datatype_sort_constructor(c, idx_c))
See also
Z3_get_datatype_sort_num_constructors
Z3_get_datatype_sort_constructor
Z3_get_datatype_sort_recognizer
unsigned Z3_API Z3_get_datatype_sort_num_constructors ( __in Z3_context  c,
__in Z3_sort  t 
)

Return number of constructors for datatype.

Precondition
Z3_get_sort_kind(t) == Z3_DATATYPE_SORT
See also
Z3_get_datatype_sort_constructor
Z3_get_datatype_sort_recognizer
Z3_get_datatype_sort_constructor_accessor
Z3_func_decl Z3_API Z3_get_datatype_sort_recognizer ( __in Z3_context  c,
__in Z3_sort  t,
unsigned  idx 
)

Return idx'th recognizer.

Precondition
Z3_get_sort_kind(t) == Z3_DATATYPE_SORT
idx < Z3_get_datatype_sort_num_constructors(c, t)
See also
Z3_get_datatype_sort_num_constructors
Z3_get_datatype_sort_constructor
Z3_get_datatype_sort_constructor_accessor
Z3_ast Z3_API Z3_get_decl_ast_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the expresson value associated with an expression parameter.

Precondition
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_AST
double Z3_API Z3_get_decl_double_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the double value associated with an double parameter.

Precondition
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_DOUBLE
Z3_func_decl Z3_API Z3_get_decl_func_decl_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the expresson value associated with an expression parameter.

Precondition
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_FUNC_DECL
int Z3_API Z3_get_decl_int_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the integer value associated with an integer parameter.

Precondition
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_INT
Z3_decl_kind Z3_API Z3_get_decl_kind ( __in Z3_context  c,
__in Z3_func_decl  d 
)

Return declaration kind corresponding to declaration.

Referenced by func_decl::decl_kind(), and FuncDeclRef::kind().

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 func_decl::name(), and FuncDeclRef::name().

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

Return the number of parameters associated with a declaration.

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

Return the parameter type associated with a declaration.

Parameters
cthe context
dthe function declaration
idxis the index of the named parameter it should be between 0 and the number of parameters.
Z3_string Z3_API Z3_get_decl_rational_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

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

Precondition
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_RATIONAL
Z3_sort Z3_API Z3_get_decl_sort_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the sort value associated with a sort parameter.

Precondition
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_SORT
Z3_symbol Z3_API Z3_get_decl_symbol_parameter ( __in Z3_context  c,
__in Z3_func_decl  d,
unsigned  idx 
)

Return the double value associated with an double parameter.

Precondition
Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_SYMBOL
Z3_ast Z3_API Z3_get_denominator ( __in Z3_context  c,
__in Z3_ast  a 
)

Return the denominator (as a numeral AST) of a numeral AST of sort Real.

Precondition
Z3_get_ast_kind(c, a) == Z3_NUMERAL_AST
Z3_sort Z3_API Z3_get_domain ( __in Z3_context  c,
__in Z3_func_decl  d,
__in unsigned  i 
)

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

Precondition
i < Z3_get_domain_size(d)
See also
Z3_get_domain_size

Referenced by func_decl::domain(), and FuncDeclRef::domain().

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

Return the number of parameters of the given declaration.

See also
Z3_get_arity
Z3_error_code Z3_API Z3_get_error_code ( __in Z3_context  c)

Return the error code for the last API call.

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

See also
Z3_set_error_handler

Referenced by context::check_error().

Z3_string Z3_API Z3_get_error_msg ( __in Z3_error_code  err)

Return a string describing the given error code.

Deprecated:
Use Z3_get_error_msg_ex instead.
BEGIN_MLAPI_EXCLUDE Z3_string Z3_API Z3_get_error_msg_ex ( __in Z3_context  c,
__in Z3_error_code  err 
)

Return a string describing the given error code.

Referenced by context::check_error().

Z3_bool Z3_API Z3_get_finite_domain_sort_size ( __in Z3_context  c,
__in Z3_sort  s,
__out unsigned __int64 r 
)

Store the size of the sort in r. Return Z3_FALSE if the call failed. That is, Z3_get_sort_kind(s) == Z3_FINITE_DOMAIN_SORT.

unsigned Z3_API Z3_get_func_decl_id ( __in Z3_context  c,
Z3_func_decl  f 
)

Return a unique identifier for f.

Z3_literals Z3_API Z3_get_guessed_literals ( __in Z3_context  c)

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

See also
Z3_del_literals
Z3_get_num_literals
Z3_get_label_symbol
Z3_get_literal
Deprecated:
This procedure is based on the old Solver API.
Z3_lbool Z3_API Z3_get_implied_equalities ( __in Z3_context  c,
__in Z3_solver  s,
__in unsigned  num_terms,
__in_ecount(num_terms) Z3_ast const  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). All implied equalities are returned by this call. This means that two terms map to the same class identifier if and only if the current context implies that they are equal.

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

See also
Z3_check_and_get_model
Z3_check
Deprecated:
To be moved outside of API.
unsigned Z3_API Z3_get_index_value ( __in Z3_context  c,
__in Z3_ast  a 
)

Return index of de-Brujin bound variable.

Precondition
Z3_get_ast_kind(a) == Z3_VAR_AST

Referenced by z3py::get_var_index().

Z3_ast_vector Z3_API Z3_get_interpolant ( __in Z3_context  c,
__in Z3_ast  pf,
__in Z3_ast  pat,
__in Z3_params  p 
)

Compute an interpolant from a refutation. This takes a proof of "false" from a set of formulas C, and an interpolation pattern. The pattern pat is a formula combining the formulas in C using logical conjunction and the "interp" operator (see Z3_mk_interpolant). This interp operator is logically the identity operator. It marks the sub-formulas of the pattern for which interpolants should be computed. The interpolant is a map sigma from marked subformulas to formulas, such that, for each marked subformula phi of pat (where phi sigma is phi with sigma(psi) substituted for each subformula psi of phi such that psi in dom(sigma)):

1) phi sigma implies sigma(phi), and

2) sigma(phi) is in the common uninterpreted vocabulary between the formulas of C occurring in phi and those not occurring in phi

and moreover pat sigma implies false. In the simplest case an interpolant for the pattern "(and (interp A) B)" maps A to an interpolant for A /\ B.

The return value is a vector of formulas representing sigma. The vector contains sigma(phi) for each marked subformula of pat, in pre-order traversal. This means that subformulas of phi occur before phi in the vector. Also, subformulas that occur multiply in pat will occur multiply in the result vector.

In particular, calling Z3_get_interpolant on a pattern of the form (interp ... (interp (and (interp A_1) A_2)) ... A_N) will result in a sequence interpolant for A_1, A_2,... A_N.

Neglecting interp markers, the pattern must be a conjunction of formulas in C, the set of premises of the proof. Otherwise an error is flagged.

Any premises of the proof not present in the pattern are treated as "background theory". Predicate and function symbols occurring in the background theory are treated as interpreted and thus always allowed in the interpolant.

Interpolant may not necessarily be computable from all proofs. To be sure an interpolant can be computed, the proof must be generated by an SMT solver for which interpoaltion is supported, and the premises must be expressed using only theories and operators for which interpolation is supported.

Currently, the only SMT solver that is supported is the legacy SMT solver. Such a solver is available as the default solver in #Z3_context objects produced by Z3_mk_interpolation_context. Currently, the theories supported are equality with uninterpreted functions, linear integer arithmetic, and the theory of arrays (in SMT-LIB terms, this is AUFLIA). Quantifiers are allowed. Use of any other operators (including "labels") may result in failure to compute an interpolant from a proof.

Parameters:

Parameters
clogical context.
pfa refutation from premises (assertions) C
patan interpolation pattern over C
pparameters
Z3_symbol Z3_API Z3_get_label_symbol ( __in Z3_context  c,
__in Z3_literals  lbls,
__in unsigned  idx 
)

Retrieve label symbol at idx.

Deprecated:
This procedure is based on the old Solver API.
Z3_ast Z3_API Z3_get_literal ( __in Z3_context  c,
__in Z3_literals  lbls,
__in unsigned  idx 
)

Retrieve literal expression at idx.

Deprecated:
This procedure is based on the old Solver API.
Z3_func_decl Z3_API Z3_get_model_constant ( __in Z3_context  c,
__in Z3_model  m,
__in unsigned  i 
)

Return the i-th constant in the given model.

Precondition
i < Z3_get_model_num_constants(c, m)
Deprecated:
use Z3_model_get_const_decl
Z3_func_decl Z3_API Z3_get_model_func_decl ( __in Z3_context  c,
__in Z3_model  m,
__in unsigned  i 
)

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

Precondition
i < Z3_get_model_num_funcs(c, m)
See also
Z3_get_model_num_funcs
Deprecated:
use Z3_model_get_func_decl
Z3_ast Z3_API Z3_get_model_func_else ( __in Z3_context  c,
__in Z3_model  m,
__in unsigned  i 
)

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

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

Precondition
i < Z3_get_model_num_funcs(c, m)
See also
Z3_get_model_num_funcs
Z3_get_model_func_num_entries
Z3_get_model_func_entry_num_args
Z3_get_model_func_entry_arg
Deprecated:
Use Z3_func_interp objects
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 f(args[0],...,args[num_args - 1]) = val.

Precondition
i < Z3_get_model_num_funcs(c, m)
j < Z3_get_model_func_num_entries(c, m, i)
k < Z3_get_model_func_entry_num_args(c, m, i, j)
See also
Z3_get_model_num_funcs
Z3_get_model_func_num_entries
Z3_get_model_func_entry_num_args
Deprecated:
Use Z3_func_interp objects
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 f(args[0],...,args[num_args - 1]) = val.

Precondition
i < Z3_get_model_num_funcs(c, m)
j < Z3_get_model_func_num_entries(c, m, i)
See also
Z3_get_model_num_funcs
Z3_get_model_func_num_entries
Z3_get_model_func_entry_arg
Deprecated:
Use Z3_func_interp objects
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 f(args[0],...,args[num_args - 1]) = val.

Precondition
i < Z3_get_model_num_funcs(c, m)
j < Z3_get_model_func_num_entries(c, m, i)
See also
Z3_get_model_num_funcs
Z3_get_model_func_num_entries
Deprecated:
Use Z3_func_interp objects
unsigned Z3_API Z3_get_model_func_num_entries ( __in Z3_context  c,
__in Z3_model  m,
__in unsigned  i 
)

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

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

Precondition
i < Z3_get_model_num_funcs(c, m)
See also
Z3_get_model_num_funcs
Z3_get_model_func_else
Z3_get_model_func_entry_num_args
Z3_get_model_func_entry_arg
Deprecated:
Use Z3_func_interp objects
unsigned Z3_API Z3_get_model_num_constants ( __in Z3_context  c,
__in Z3_model  m 
)

Return the number of constants assigned by the given model.

See also
Z3_get_model_constant
Deprecated:
use Z3_model_get_num_consts
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.

Deprecated:
use Z3_model_get_num_funcs
unsigned Z3_API Z3_get_num_literals ( __in Z3_context  c,
__in Z3_literals  lbls 
)

Retrieve the number of label symbols that were returned.

See also
Z3_get_relevant_labels
Deprecated:
This procedure is based on the old Solver API.
unsigned Z3_API Z3_get_num_probes ( __in Z3_context  c)

Return the number of builtin probes available in Z3.

Referenced by z3py::probes().

unsigned Z3_API Z3_get_num_scopes ( __in Z3_context  c)

Retrieve the current scope level.

It retrieves the number of scopes that have been pushed, but not yet popped.

See also
Z3_push
Z3_pop
Deprecated:
Subsumed by Z3_solver_get_num_scopes.
unsigned Z3_API Z3_get_num_tactics ( __in Z3_context  c)

Return the number of builtin tactics available in Z3.

Referenced by z3py::tactics().

Z3_string Z3_API Z3_get_numeral_decimal_string ( __in Z3_context  c,
__in Z3_ast  a,
__in unsigned  precision 
)

Return numeral as a string in decimal notation. The result has at most precision decimal places.

Precondition
Z3_get_ast_kind(c, a) == Z3_NUMERAL_AST || Z3_is_algebraic_number(c, a)
Z3_bool Z3_API Z3_get_numeral_int ( __in Z3_context  c,
__in Z3_ast  v,
__out int *  i 
)

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

Precondition
Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
See also
Z3_get_numeral_string
Z3_bool Z3_API Z3_get_numeral_int64 ( __in Z3_context  c,
__in Z3_ast  v,
__out __int64 i 
)

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

Precondition
Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
See also
Z3_get_numeral_string
Z3_bool Z3_API Z3_get_numeral_rational_int64 ( __in Z3_context  c,
__in Z3_ast  v,
__out __int64 num,
__out __int64 den 
)

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

Precondition
Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
See also
Z3_get_numeral_string
Z3_bool Z3_API Z3_get_numeral_small ( __in Z3_context  c,
__in Z3_ast  a,
__out __int64 num,
__out __int64 den 
)

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

Parameters
clogical context.
aterm.
numnumerator.
dendenominator.

Return Z3_TRUE if the numeral value fits in 64 bit numerals, Z3_FALSE otherwise.

Precondition
Z3_get_ast_kind(a) == Z3_NUMERAL_AST
Z3_string Z3_API Z3_get_numeral_string ( __in Z3_context  c,
__in Z3_ast  a 
)

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

Precondition
Z3_get_ast_kind(c, a) == Z3_NUMERAL_AST
Z3_bool Z3_API Z3_get_numeral_uint ( __in Z3_context  c,
__in Z3_ast  v,
__out unsigned *  u 
)

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

Precondition
Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
See also
Z3_get_numeral_string
Z3_bool Z3_API Z3_get_numeral_uint64 ( __in Z3_context  c,
__in Z3_ast  v,
__out unsigned __int64 u 
)

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

Precondition
Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
See also
Z3_get_numeral_string
Z3_ast Z3_API Z3_get_numerator ( __in Z3_context  c,
__in Z3_ast  a 
)

Return the numerator (as a numeral AST) of a numeral AST of sort Real.

Precondition
Z3_get_ast_kind(c, a) == Z3_NUMERAL_AST
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_string Z3_API Z3_get_probe_name ( __in Z3_context  c,
unsigned  i 
)

Return the name of the i probe.

Precondition
i < Z3_get_num_probes(c)

Referenced by z3py::probes().

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

Return body of quantifier.

Precondition
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST

Referenced by expr::body().

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

Return symbol of the i'th bound variable.

Precondition
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST
Z3_sort Z3_API Z3_get_quantifier_bound_sort ( __in Z3_context  c,
__in Z3_ast  a,
unsigned  i 
)

Return sort of the i'th bound variable.

Precondition
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST
Z3_ast Z3_API Z3_get_quantifier_no_pattern_ast ( __in Z3_context  c,
__in Z3_ast  a,
unsigned  i 
)

Return i'th no_pattern.

Precondition
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST
unsigned Z3_API Z3_get_quantifier_num_bound ( __in Z3_context  c,
__in Z3_ast  a 
)

Return number of bound variables of quantifier.

Precondition
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST
unsigned Z3_API Z3_get_quantifier_num_no_patterns ( __in Z3_context  c,
__in Z3_ast  a 
)

Return number of no_patterns used in quantifier.

Precondition
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST
unsigned Z3_API Z3_get_quantifier_num_patterns ( __in Z3_context  c,
__in Z3_ast  a 
)

Return number of patterns used in quantifier.

Precondition
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST
Z3_pattern Z3_API Z3_get_quantifier_pattern_ast ( __in Z3_context  c,
__in Z3_ast  a,
unsigned  i 
)

Return i'th pattern.

Precondition
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST
unsigned Z3_API Z3_get_quantifier_weight ( __in Z3_context  c,
__in Z3_ast  a 
)

Obtain weight of quantifier.

Precondition
Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST
Z3_sort Z3_API Z3_get_range ( __in Z3_context  c,
__in Z3_func_decl  d 
)

Return the range of the given declaration.

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

Referenced by func_decl::range(), and FuncDeclRef::range().

unsigned Z3_API Z3_get_relation_arity ( __in Z3_context  c,
__in Z3_sort  s 
)

Return arity of relation.

Precondition
Z3_get_sort_kind(s) == Z3_RELATION_SORT
See also
Z3_get_relation_column
Z3_sort Z3_API Z3_get_relation_column ( __in Z3_context  c,
__in Z3_sort  s,
unsigned  col 
)

Return sort at i'th column of relation sort.

Precondition
Z3_get_sort_kind(c, s) == Z3_RELATION_SORT
col < Z3_get_relation_arity(c, s)
See also
Z3_get_relation_arity
Z3_literals Z3_API Z3_get_relevant_labels ( __in Z3_context  c)

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

See also
Z3_del_literals
Z3_get_num_literals
Z3_get_label_symbol
Z3_get_literal
Deprecated:
This procedure is based on the old Solver API.
Z3_literals Z3_API Z3_get_relevant_literals ( __in Z3_context  c)

Retrieve the set of literals that satisfy the current context.

See also
Z3_del_literals
Z3_get_num_literals
Z3_get_label_symbol
Z3_get_literal
Deprecated:
This procedure is based on the old Solver API.
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.

Deprecated:
Subsumed by Z3_solver_get_reason_unknown
Z3_ast Z3_API Z3_get_smtlib_assumption ( __in Z3_context  c,
__in unsigned  i 
)

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

Precondition
i < Z3_get_smtlib_num_assumptions(c)
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