Low-Level C API Reference (z3_mojo.c, Z3 5.3.3)¶
z3_mojo.c exposes a verified 1-to-1 binding of all 817 functions across Z3 5.3.3's nine C headers, all 29 raw Z3_* handle types, all 10 enums, and low-level FFI helpers. Every function is called as api[].Z3_*(...) after var api = c_api(). See the Low-level C API guide for manual refcounting (Z3_mk_context_rc) and raw callbacks.
from z3_mojo.c import c_api, null
var api = c_api()
var cfg = api[].Z3_mk_config()
var ctx = api[].Z3_mk_context_rc(cfg)
api[].Z3_del_config(cfg)
api[].Z3_set_error_handler(ctx, null[NoneType]())
Commonly Used C API Groups¶
Sorts Constants and Applications Propositional Logic and Equality Integers and Reals Bit-vectors Arrays Sequences and regular expressions Quantifiers Solvers Models Goals Tactics, Simplifiers and Probes Optimization facilities Floating-Point Arithmetic Fixedpoint facilities Real Closed Fields Algebraic Numbers
Entry Point & FFI Helpers¶
| Symbol | Role |
|---|---|
c_api() raises -> CApiPtr |
Loads libz3 once per process and returns the cached pointer to CApi. |
CApi / CApiPtr |
Struct holding resolved function pointers for all 817 Z3_* C functions; checks Z3_get_error_code(ctx) after context calls and raises Mojo Error. |
c_bytes(s: String) raises -> List[Int8] |
Copies a Mojo String into a NUL-terminated C byte buffer (rejects embedded NULs). |
to_string(p: CChars) raises -> String |
Copies a const char* returned by Z3 into an owned Mojo String ("" on NULL). |
null[T]() -> Pointer[T, MutUntrackedOrigin] |
Constructs a typed NULL pointer for optional C parameters (such as Z3_set_error_handler(ctx, null[NoneType]())). |
to_c_uint32(v: Int) raises -> UInt32 |
Checked conversion to C unsigned. |
to_c_int32(v: Int) raises -> Int32 |
Checked conversion to C int. |
Raw Handle Structs (29)¶
Every raw handle is a thin ImplicitlyCopyable wrapper around an opaque Ptr with .is_null() and == comparison:
| Raw C Handle | Safe Mojo Counterpart | Ownership Policy |
|---|---|---|
Z3_app |
App |
context_managed |
Z3_apply_result |
ApplyResult |
refcounted |
Z3_ast |
Ast |
context_managed |
Z3_ast_map |
AstMap |
refcounted |
Z3_ast_vector |
AstVector |
refcounted |
Z3_config |
Config |
explicit_del |
Z3_constructor |
Constructor |
explicit_del |
Z3_constructor_list |
ConstructorList |
explicit_del |
Z3_context |
Context |
explicit_del |
Z3_fixedpoint |
Fixedpoint |
refcounted |
Z3_func_decl |
FuncDecl |
context_managed |
Z3_func_entry |
FuncEntry |
refcounted |
Z3_func_interp |
FuncInterp |
refcounted |
Z3_goal |
Goal |
refcounted |
Z3_model |
Model |
refcounted |
Z3_optimize |
Optimize |
refcounted |
Z3_param_descrs |
ParamDescrs |
refcounted |
Z3_params |
Params |
refcounted |
Z3_parser_context |
ParserContext |
refcounted |
Z3_pattern |
Pattern |
context_managed |
Z3_probe |
Probe |
refcounted |
Z3_rcf_num |
RcfNum |
explicit_del |
Z3_simplifier |
Simplifier |
refcounted |
Z3_solver |
Solver |
refcounted |
Z3_solver_callback |
SolverCallback |
borrowed |
Z3_sort |
Sort |
context_managed |
Z3_stats |
Stats |
refcounted |
Z3_symbol |
Symbol |
context_managed |
Z3_tactic |
Tactic |
refcounted |
z3_api.h (585 functions)¶
Global Parameters (3) Create configuration (2) Context and AST Reference Counting (9) Parameters (7) Parameter Descriptions (5) Symbols (2) Sorts (30) Constants and Applications (7) Propositional Logic and Equality (11) Integers and Reals (17) Bit-vectors (49) Arrays (8) Sets (12) Finite Sets (14) Numerals (8) Sequences and regular expressions (69) Special relations (5) Quantifiers (12) Accessors (102) Modifiers (5) Models (26) Interaction logging (4) String conversion (7) Parser interface (7) Error Handling (3) Miscellaneous (6) Goals (15) Tactics, Simplifiers and Probes (47) Solvers (54) Statistics (8)
Global Parameters (3)¶
Z3_global_param_get¶
def Z3_global_param_get(self, param_id: Pointer[Int8, _], param_value: Pointer[mut=True, Pointer[Int8, MutUntrackedOrigin], _]) -> Bool
Get a global (or module) parameter.
Returns false if the parameter value does not exist.
Z3_global_param_reset_all¶
def Z3_global_param_reset_all(self)
Restore the value of all global (and module) parameters. This command will not affect already created objects (such as tactics and solvers).
Z3_global_param_set¶
def Z3_global_param_set(self, param_id: Pointer[Int8, _], param_value: Pointer[Int8, _])
Set a global (or module) parameter. This setting is shared by all Z3 contexts.
When a Z3 module is initialized it will use the value of these parameters when Z3_params objects are not provided.
The name of parameter can be composed of characters [a-z][A-Z], digits [0-9], '-' and '_'. The character '.' is a delimiter (more later).
The parameter names are case-insensitive. The character '-' should be viewed as an "alias" for '_'. Thus, the following parameter names are considered equivalent: "pp.decimal-precision" and "PP.DECIMAL_PRECISION".
This function can be used to set parameters for a specific Z3 module. This can be done by using <module-name>.<parameter-name>. For example: Z3_global_param_set('pp.decimal', 'true') will set the parameter "decimal" in the module "pp" to true.
Create configuration (2)¶
Z3_mk_config¶
def Z3_mk_config(self) -> Z3_config
Create a configuration object for the Z3 context object.
Configurations are created in order to assign parameters prior to creating contexts for Z3 interaction. For example, if the users wishes to use proof generation, then call:
Z3_set_param_value(cfg, "proof", "true")
The following parameters can be set:
- proof (Boolean) Enable proof generation
- debug_ref_count (Boolean) Enable debug support for Z3_ast reference counting
- trace (Boolean) Tracing support for VCC
- trace_file_name (String) Trace out file for VCC traces
- timeout (unsigned) default timeout (in milliseconds) used for solvers
- well_sorted_check type checker
- auto_config use heuristics to automatically select solver and configure it
- model model generation for solvers, this parameter can be overwritten when creating a solver
- model_validate validate models produced by solvers
- unsat_core unsat-core generation for solvers, this parameter can be overwritten when creating a solver
- encoding the string encoding used internally (must be either "unicode" - 18 bit, "bmp" - 16 bit or "ascii" - 8 bit)
Z3_set_param_value¶
def Z3_set_param_value(self, c: Z3_config, param_id: Pointer[Int8, _], param_value: Pointer[Int8, _])
Set a configuration parameter.
The following parameters can be set for
Context and AST Reference Counting (9)¶
Z3_dec_ref¶
def Z3_dec_ref(self, c: Z3_context, a: Z3_ast)
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.
Z3_enable_concurrent_dec_ref¶
def Z3_enable_concurrent_dec_ref(self, c: Z3_context) raises
use concurrency control for dec-ref. Reference counting decrements are allowed in separate threads from the context. If this setting is not invoked, reference counting decrements are not going to be thread safe.
Z3_get_global_param_descrs¶
def Z3_get_global_param_descrs(self, c: Z3_context) raises -> Z3_param_descrs
Retrieve description of global parameters.
Z3_inc_ref¶
def Z3_inc_ref(self, c: Z3_context, a: Z3_ast) raises
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.
Z3_interrupt¶
def Z3_interrupt(self, c: Z3_context) raises
Interrupt the execution of a Z3 procedure. This procedure can be used to interrupt: solvers, simplifiers and tactics.
Z3_mk_context¶
def Z3_mk_context(self, c: Z3_config) -> Z3_context
Create a context using the given configuration.
After a context is created, the configuration cannot be changed, although some parameters can be changed using Z3_update_param_value. All main interaction with Z3 happens in the context of a Z3_context.
In contrast to Z3_mk_context_rc the life time of Z3_ast objects persists with the life time of the context.
Note that all other reference counted objects, including Z3_model, Z3_solver, Z3_func_interp have to be managed by the caller. Their reference counts are not handled by the context.
Z3_mk_context_rc¶
def Z3_mk_context_rc(self, c: Z3_config) -> Z3_context
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.
Remarks:
Z3_sort,Z3_func_decl,Z3_app,Z3_patternareZ3_ast's.- After a context is created, the configuration cannot be changed.
- All main interaction with Z3 happens in the context of a
Z3_context. - Z3 uses hash-consing, i.e., when the same
Z3_astis created twice, Z3 will return the same pointer twice.
Z3_set_proof_check_callback¶
def Z3_set_proof_check_callback(self, c: Z3_context, user_context: Pointer[mut=True, NoneType, _], callback: Ptr) raises
Register a client proof checker for c.
Replaces the previous callback and user data. Passing a null callback unregisters it. The client owns the callback and user data and must keep them alive until replacement, unregistration, or context destruction.
SMT-LIB evaluation through Z3_eval_smtlib2_string invokes the callback after an unsatisfiable check-sat, check-sat-assuming, or check-sat-using command. Automatic reports go to the command context's diagnostic stream, included in the returned evaluation text. Ordinary Z3_solver_check calls do not invoke it automatically.
Automatic checking requires proof production to be enabled before assertions are added. An unavailable proof is reported as a command error. The automatic assertion vector contains the active input assertions and current check assumptions. Named assertions tracked for unsat cores are represented by their guarded assertions and tracking literals, matching the proof premises.
Registration survives SMT-LIB reset commands. The report is opaque: Z3 does not interpret it or change the solver's satisfiability result.
Z3_update_param_value¶
def Z3_update_param_value(self, c: Z3_context, param_id: Pointer[Int8, _], param_value: Pointer[Int8, _]) raises
Set a value of a context parameter.
Parameters (7)¶
Z3_mk_params¶
def Z3_mk_params(self, c: Z3_context) raises -> Z3_params
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.
Z3_params_set_bool¶
def Z3_params_set_bool(self, c: Z3_context, p: Z3_params, k: Z3_symbol, v: Bool) raises
Add a Boolean parameter k with value v to the parameter set p.
Z3_params_set_double¶
def Z3_params_set_double(self, c: Z3_context, p: Z3_params, k: Z3_symbol, v: Float64) raises
Add a double parameter k with value v to the parameter set p.
Z3_params_set_symbol¶
def Z3_params_set_symbol(self, c: Z3_context, p: Z3_params, k: Z3_symbol, v: Z3_symbol) raises
Add a symbol parameter k with value v to the parameter set p.
Z3_params_set_uint¶
def Z3_params_set_uint(self, c: Z3_context, p: Z3_params, k: Z3_symbol, v: UInt32) raises
Add a unsigned parameter k with value v to the parameter set p.
Z3_params_to_string¶
def Z3_params_to_string(self, c: Z3_context, p: Z3_params) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert a parameter set into a string. This function is mainly used for printing the contents of a parameter set.
Z3_params_validate¶
def Z3_params_validate(self, c: Z3_context, p: Z3_params, d: Z3_param_descrs) raises
Validate the parameter set p against the parameter description set d.
The procedure invokes the error handler if p is invalid.
Parameter Descriptions (5)¶
Z3_param_descrs_get_documentation¶
def Z3_param_descrs_get_documentation(self, c: Z3_context, p: Z3_param_descrs, s: Z3_symbol) raises -> Pointer[Int8, MutUntrackedOrigin]
Retrieve documentation string corresponding to parameter name s.
Z3_param_descrs_get_kind¶
def Z3_param_descrs_get_kind(self, c: Z3_context, p: Z3_param_descrs, n: Z3_symbol) raises -> ParamKind
Return the kind associated with the given parameter name n.
Z3_param_descrs_get_name¶
def Z3_param_descrs_get_name(self, c: Z3_context, p: Z3_param_descrs, i: UInt32) raises -> Z3_symbol
Return the name of the parameter at given index i.
Z3_param_descrs_size¶
def Z3_param_descrs_size(self, c: Z3_context, p: Z3_param_descrs) raises -> UInt32
Return the number of parameters in the given parameter description set.
Z3_param_descrs_to_string¶
def Z3_param_descrs_to_string(self, c: Z3_context, p: Z3_param_descrs) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert a parameter description set into a string. This function is mainly used for printing the contents of a parameter description set.
Symbols (2)¶
Z3_mk_int_symbol¶
def Z3_mk_int_symbol(self, c: Z3_context, i: Int32) raises -> Z3_symbol
Create a Z3 symbol using an integer.
Symbols are used to name several term and type constructors.
NB. Not all integers can be passed to this function. The legal range of unsigned integers is 0 to 2^30-1.
Z3_mk_string_symbol¶
def Z3_mk_string_symbol(self, c: Z3_context, s: Pointer[Int8, _]) raises -> Z3_symbol
Create a Z3 symbol using a C string.
Symbols are used to name several term and type constructors.
Sorts (30)¶
Z3_constructor_num_fields¶
def Z3_constructor_num_fields(self, c: Z3_context, constr: Z3_constructor) raises -> UInt32
Retrieve the number of fields of a constructor
Z3_get_finite_field_sort_size¶
def Z3_get_finite_field_sort_size(self, c: Z3_context, s: Z3_sort) raises -> Pointer[Int8, MutUntrackedOrigin]
Return the decimal modulus of a finite-field sort.
Z3_mk_array_sort¶
def Z3_mk_array_sort(self, c: Z3_context, domain: Z3_sort, range: Z3_sort) raises -> Z3_sort
Create an array type.
We usually represent the array type as: [domain -> range]. Arrays are usually used to model the heap/memory in software verification.
Z3_mk_array_sort_n¶
def Z3_mk_array_sort_n(self, c: Z3_context, n: UInt32, domain: Pointer[Z3_sort, _], range: Z3_sort) raises -> Z3_sort
Create an array type with N arguments
Z3_mk_bool_sort¶
def Z3_mk_bool_sort(self, c: Z3_context) raises -> Z3_sort
Create the Boolean type.
This type is used to create propositional variables and predicates.
Z3_mk_bv_sort¶
def Z3_mk_bv_sort(self, c: Z3_context, sz: UInt32) raises -> Z3_sort
Create a bit-vector type of the given size.
This type can also be seen as a machine integer.
Z3_mk_complex¶
def Z3_mk_complex(self, c: Z3_context, re: Z3_ast, im: Z3_ast) raises -> Z3_ast
Create a complex number with the given real and imaginary components. Integer components are coerced to Real.
Z3_mk_complex_sort¶
def Z3_mk_complex_sort(self, c: Z3_context) raises -> Z3_sort
Create the Complex sort. Complex numbers are pairs of Reals.
Use Z3_mk_complex to construct values and Z3_mk_real_part and Z3_mk_imag_part to access their components. The arithmetic APIs for addition, subtraction, multiplication, negation, and division accept Complex expressions. Ordering and exponentiation do not.
Z3_mk_constructor¶
def Z3_mk_constructor(self, c: Z3_context, name: Z3_symbol, recognizer: Z3_symbol, num_fields: UInt32, field_names: Pointer[Z3_symbol, _], sorts: Pointer[Z3_sort, _], sort_refs: Pointer[mut=True, UInt32, _]) raises -> Z3_constructor
Create a constructor.
Z3_mk_constructor_list¶
def Z3_mk_constructor_list(self, c: Z3_context, num_constructors: UInt32, constructors: Pointer[Z3_constructor, _]) raises -> Z3_constructor_list
Create list of constructors.
Z3_mk_datatype¶
def Z3_mk_datatype(self, c: Z3_context, name: Z3_symbol, num_constructors: UInt32, constructors: Pointer[mut=True, Z3_constructor, _]) raises -> Z3_sort
Create datatype, such as lists, trees, records, enumerations or unions of records. The datatype may be recursive. Return the datatype sort.
Z3_mk_datatype_sort¶
def Z3_mk_datatype_sort(self, c: Z3_context, name: Z3_symbol, num_params: UInt32, params: Pointer[Z3_sort, _]) raises -> Z3_sort
create a forward reference to a recursive datatype being declared. The forward reference can be used in a nested occurrence: the range of an array or as element sort of a sequence. The forward reference should only be used when used in an accessor for a recursive datatype that gets declared.
Forward references can replace the use sort references, that are unsigned integers in the Z3_mk_constructor call
Z3_mk_datatypes¶
def Z3_mk_datatypes(self, c: Z3_context, num_sorts: UInt32, sort_names: Pointer[Z3_symbol, _], sorts: Pointer[mut=True, Z3_sort, _], constructor_lists: Pointer[mut=True, Z3_constructor_list, _]) raises
Create mutually recursive datatypes.
Z3_mk_enumeration_sort¶
def Z3_mk_enumeration_sort(self, c: Z3_context, name: Z3_symbol, n: UInt32, enum_names: Pointer[Z3_symbol, _], enum_consts: Pointer[mut=True, Z3_func_decl, _], enum_testers: Pointer[mut=True, Z3_func_decl, _]) raises -> Z3_sort
Create a enumeration sort.
An enumeration sort with n elements. This function will also declare the functions corresponding to the enumerations.
For example, if this function is called with three symbols A, B, C and the name S, then s is a sort whose name is S, and the function returns three terms corresponding to A, B, C in enum_consts. The array enum_testers has three predicates of type (s -> Bool). The first predicate (corresponding to A) is true when applied to A, and false otherwise. Similarly for the other predicates.
Z3_mk_ff_add¶
def Z3_mk_ff_add(self, c: Z3_context, n: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Sum at least two elements of the same prime field.
Z3_mk_ff_bitsum¶
def Z3_mk_ff_bitsum(self, c: Z3_context, n: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Weighted sum a0 + 2a1 + 4a2 + ... (does not constrain arguments to bits).
Z3_mk_ff_mul¶
def Z3_mk_ff_mul(self, c: Z3_context, n: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Multiply at least two elements of the same prime field.
Z3_mk_ff_neg¶
def Z3_mk_ff_neg(self, c: Z3_context, a: Z3_ast) raises -> Z3_ast
Additive inverse in a prime field.
Z3_mk_finite_domain_sort¶
def Z3_mk_finite_domain_sort(self, c: Z3_context, name: Z3_symbol, size: UInt64) raises -> Z3_sort
Create a named finite domain sort.
To create constants that belong to the finite domain, use the APIs for creating numerals and pass a numeric constant together with the sort returned by this call. The numeric constant should be between 0 and the less than the size of the domain.
Z3_mk_finite_field_sort¶
def Z3_mk_finite_field_sort(self, c: Z3_context, prime: Pointer[Int8, _]) raises -> Z3_sort
Create a prime-field sort. Large moduli undergo probable-prime screening.
Z3_mk_imag_part¶
def Z3_mk_imag_part(self, c: Z3_context, z: Z3_ast) raises -> Z3_ast
Return the imaginary component of a Complex expression.
Z3_mk_int_sort¶
def Z3_mk_int_sort(self, c: Z3_context) raises -> Z3_sort
Create the integer type.
This type is not the int type found in programming languages. A machine integer can be represented using bit-vectors. The function Z3_mk_bv_sort creates a bit-vector type.
Z3_mk_list_sort¶
def Z3_mk_list_sort(self, c: Z3_context, name: Z3_symbol, elem_sort: Z3_sort, nil_decl: Pointer[mut=True, Z3_func_decl, _], is_nil_decl: Pointer[mut=True, Z3_func_decl, _], cons_decl: Pointer[mut=True, Z3_func_decl, _], is_cons_decl: Pointer[mut=True, Z3_func_decl, _], head_decl: Pointer[mut=True, Z3_func_decl, _], tail_decl: Pointer[mut=True, Z3_func_decl, _]) raises -> Z3_sort
Create a list sort
A list sort over elem_sort This function declares the corresponding constructors and testers for lists.
Z3_mk_polymorphic_datatype¶
def Z3_mk_polymorphic_datatype(self, c: Z3_context, name: Z3_symbol, num_parameters: UInt32, parameters: Pointer[mut=True, Z3_sort, _], num_constructors: UInt32, constructors: Pointer[mut=True, Z3_constructor, _]) raises -> Z3_sort
Create a parametric datatype with explicit type parameters.
This function is similar to Z3_mk_datatype, except it takes an explicit set of type parameters. The parameters can be type variables created with Z3_mk_type_variable, allowing the definition of polymorphic datatypes that can be instantiated with different concrete types.
Z3_mk_real_part¶
def Z3_mk_real_part(self, c: Z3_context, z: Z3_ast) raises -> Z3_ast
Return the real component of a Complex expression.
Z3_mk_real_sort¶
def Z3_mk_real_sort(self, c: Z3_context) raises -> Z3_sort
Create the real type.
Note that this type is not a floating point number.
Z3_mk_tuple_sort¶
def Z3_mk_tuple_sort(self, c: Z3_context, mk_tuple_name: Z3_symbol, num_fields: UInt32, field_names: Pointer[Z3_symbol, _], field_sorts: Pointer[Z3_sort, _], mk_tuple_decl: Pointer[mut=True, Z3_func_decl, _], proj_decl: Pointer[mut=True, Z3_func_decl, _]) raises -> Z3_sort
Create a tuple type.
A tuple with n fields has a constructor and n projections. This function will also declare the constructor and projection functions.
Z3_mk_type_variable¶
def Z3_mk_type_variable(self, c: Z3_context, s: Z3_symbol) raises -> Z3_sort
Create a type variable.
Functions using type variables can be applied to instantiations that match the signature of the function. Assertions using type variables correspond to assertions over all possible instantiations.
Z3_mk_uninterpreted_sort¶
def Z3_mk_uninterpreted_sort(self, c: Z3_context, s: Z3_symbol) raises -> Z3_sort
Create a free (uninterpreted) type using the given name (symbol).
Two free types are considered the same iff the have the same name.
Z3_query_constructor¶
def Z3_query_constructor(self, c: Z3_context, constr: Z3_constructor, num_fields: UInt32, constructor: Pointer[mut=True, Z3_func_decl, _], tester: Pointer[mut=True, Z3_func_decl, _], accessors: Pointer[mut=True, Z3_func_decl, _]) raises
Query constructor for declared functions.
Constants and Applications (7)¶
Z3_add_rec_def¶
def Z3_add_rec_def(self, c: Z3_context, f: Z3_func_decl, n: UInt32, args: Pointer[mut=True, Z3_ast, _], body: Z3_ast) raises
Define the body of a recursive function.
After declaring a recursive function or a collection of mutually recursive functions, use this function to provide the definition for the recursive function.
Z3_mk_app¶
def Z3_mk_app(self, c: Z3_context, d: Z3_func_decl, num_args: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Create a constant or function application.
Z3_mk_const¶
def Z3_mk_const(self, c: Z3_context, s: Z3_symbol, ty: Z3_sort) raises -> Z3_ast
Declare and create a constant.
This function is a shorthand for:
Z3_func_decl d = Z3_mk_func_decl(c, s, 0, 0, ty);
Z3_ast n = Z3_mk_app(c, d, 0, 0);
Z3_mk_fresh_const¶
def Z3_mk_fresh_const(self, c: Z3_context, prefix: Pointer[Int8, _], ty: Z3_sort) raises -> Z3_ast
Declare and create a fresh constant.
This function is a shorthand for:
Z3_func_decl d = Z3_mk_fresh_func_decl(c, prefix, 0, 0, ty); Z3_ast n = Z3_mk_app(c, d, 0, 0);
Z3_mk_fresh_func_decl¶
def Z3_mk_fresh_func_decl(self, c: Z3_context, prefix: Pointer[Int8, _], domain_size: UInt32, domain: Pointer[Z3_sort, _], range: Z3_sort) raises -> Z3_func_decl
Declare a fresh constant or function.
Z3 will generate an unique name for this function declaration. If prefix is different from NULL, then the name generate by Z3 will start with prefix.
Z3_mk_func_decl¶
def Z3_mk_func_decl(self, c: Z3_context, s: Z3_symbol, domain_size: UInt32, domain: Pointer[Z3_sort, _], range: Z3_sort) raises -> Z3_func_decl
Declare a constant or function.
After declaring a constant or function, the function Z3_mk_app can be used to create a constant or function application.
Z3_mk_rec_func_decl¶
def Z3_mk_rec_func_decl(self, c: Z3_context, s: Z3_symbol, domain_size: UInt32, domain: Pointer[Z3_sort, _], range: Z3_sort) raises -> Z3_func_decl
Declare a recursive function
After declaring recursive function, it should be associated with a recursive definition Z3_add_rec_def. The function Z3_mk_app can be used to create a constant or function application.
Propositional Logic and Equality (11)¶
Z3_mk_and¶
def Z3_mk_and(self, c: Z3_context, num_args: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
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.
Z3_mk_distinct¶
def Z3_mk_distinct(self, c: Z3_context, num_args: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Create an AST node representing distinct(args[0], ..., args[num_args-1]).
The distinct construct is used for declaring the arguments pairwise distinct. That is, Forall 0 <= i < j < num_args. not args[i] = args[j].
All arguments must have the same sort.
Z3_mk_eq¶
def Z3_mk_eq(self, c: Z3_context, l: Z3_ast, r: Z3_ast) raises -> Z3_ast
Create an AST node representing l = r.
The nodes l and r must have the same type.
Z3_mk_false¶
def Z3_mk_false(self, c: Z3_context) raises -> Z3_ast
Create an AST node representing false.
Z3_mk_iff¶
def Z3_mk_iff(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Create an AST node representing t1 iff t2.
The nodes t1 and t2 must have Boolean sort.
Z3_mk_implies¶
def Z3_mk_implies(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Create an AST node representing t1 implies t2.
The nodes t1 and t2 must have Boolean sort.
Z3_mk_ite¶
def Z3_mk_ite(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast, t3: Z3_ast) raises -> Z3_ast
Create an AST node representing an if-then-else: ite(t1, t2, t3).
The node t1 must have Boolean sort, t2 and t3 must have the same sort. The sort of the new node is equal to the sort of t2 and t3.
Z3_mk_not¶
def Z3_mk_not(self, c: Z3_context, a: Z3_ast) raises -> Z3_ast
Create an AST node representing not(a).
The node a must have Boolean sort.
Z3_mk_or¶
def Z3_mk_or(self, c: Z3_context, num_args: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
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.
Z3_mk_true¶
def Z3_mk_true(self, c: Z3_context) raises -> Z3_ast
Create an AST node representing true.
Z3_mk_xor¶
def Z3_mk_xor(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Create an AST node representing t1 xor t2.
The nodes t1 and t2 must have Boolean sort.
Integers and Reals (17)¶
Z3_mk_abs¶
def Z3_mk_abs(self, c: Z3_context, arg: Z3_ast) raises -> Z3_ast
Take the absolute value of an integer
Z3_mk_add¶
def Z3_mk_add(self, c: Z3_context, num_args: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Create an AST node representing args[0] + ... + args[num_args-1].
The array args must have num_args elements. All arguments must have Int, Real, or Complex sort.
Z3_mk_div¶
def Z3_mk_div(self, c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) raises -> Z3_ast
Create an AST node representing arg1 div arg2.
The arguments must have Int, Real, or Complex sort. Int arguments use integer division. Real and Complex arguments use their respective division operations, with Int embedded in Real and Int/Real embedded in Complex. Complex division is lowered to Real component division; at a zero Complex denominator, both components are the same totalized Real 0/0 value.
Z3_mk_divides¶
def Z3_mk_divides(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Create division predicate.
The nodes t1 and t2 must be of integer sort. The predicate is true when t1 divides t2. For the predicate to be part of linear integer arithmetic, the first argument t1 must be a non-zero integer.
Z3_mk_ge¶
def Z3_mk_ge(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Create greater than or equal to.
The nodes t1 and t2 must have the same sort, and must be int or real.
Z3_mk_gt¶
def Z3_mk_gt(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Create greater than.
The nodes t1 and t2 must have the same sort, and must be int or real.
Z3_mk_int2real¶
def Z3_mk_int2real(self, c: Z3_context, t1: Z3_ast) raises -> Z3_ast
Coerce an integer to a real.
There is also a converse operation exposed. It follows the semantics prescribed by the SMT-LIB standard.
You can take the floor of a real by creating an auxiliary integer constant k and and asserting mk_int2real(k) <= t1 < mk_int2real(k)+1.
The node t1 must have sort integer.
Z3_mk_is_int¶
def Z3_mk_is_int(self, c: Z3_context, t1: Z3_ast) raises -> Z3_ast
Check if a real number is an integer.
Z3_mk_le¶
def Z3_mk_le(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Create less than or equal to.
The nodes t1 and t2 must have the same sort, and must be int or real.
Z3_mk_lt¶
def Z3_mk_lt(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Create less than.
The nodes t1 and t2 must have the same sort, and must be int or real.
Z3_mk_mod¶
def Z3_mk_mod(self, c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) raises -> Z3_ast
Create an AST node representing arg1 mod arg2.
The arguments must have int type.
Z3_mk_mul¶
def Z3_mk_mul(self, c: Z3_context, num_args: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Create an AST node representing args[0] * ... * args[num_args-1].
The array args must have num_args elements. All arguments must have Int, Real, or Complex sort.
Z3_mk_power¶
def Z3_mk_power(self, c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) raises -> Z3_ast
Create an AST node representing arg1 ^ arg2.
The arguments must have int or real type.
Z3_mk_real2int¶
def Z3_mk_real2int(self, c: Z3_context, t1: Z3_ast) raises -> Z3_ast
Coerce a real to an integer.
The semantics of this function follows the SMT-LIB standard for the function to_int
Z3_mk_rem¶
def Z3_mk_rem(self, c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) raises -> Z3_ast
Create an AST node representing arg1 rem arg2.
The arguments must have int type.
Z3_mk_sub¶
def Z3_mk_sub(self, c: Z3_context, num_args: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Create an AST node representing args[0] - ... - args[num_args - 1].
The array args must have num_args elements. All arguments must have Int, Real, or Complex sort.
Z3_mk_unary_minus¶
def Z3_mk_unary_minus(self, c: Z3_context, arg: Z3_ast) raises -> Z3_ast
Create an AST node representing - arg.
The argument must have Int, Real, or Complex sort.
Bit-vectors (49)¶
Z3_mk_bit2bool¶
def Z3_mk_bit2bool(self, c: Z3_context, i: UInt32, t1: Z3_ast) raises -> Z3_ast
Extracts the bit at position i of a bit-vector and yields a boolean.
The node t1 must have a bit-vector sort.
Z3_mk_bv2int¶
def Z3_mk_bv2int(self, c: Z3_context, t1: Z3_ast, is_signed: Bool) raises -> Z3_ast
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.
The node t1 must have a bit-vector sort.
Z3_mk_bvadd¶
def Z3_mk_bvadd(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Standard two's complement addition.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvadd_no_overflow¶
def Z3_mk_bvadd_no_overflow(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast, is_signed: Bool) raises -> Z3_ast
Create a predicate that checks that the bit-wise addition of t1 and t2 does not overflow.
The nodes t1 and t2 must have the same bit-vector sort. The returned node is of sort Bool.
Z3_mk_bvadd_no_underflow¶
def Z3_mk_bvadd_no_underflow(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Create a predicate that checks that the bit-wise signed addition of t1 and t2 does not underflow.
The nodes t1 and t2 must have the same bit-vector sort. The returned node is of sort Bool.
Z3_mk_bvand¶
def Z3_mk_bvand(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Bitwise and.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvashr¶
def Z3_mk_bvashr(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Arithmetic shift right.
It is like logical shift right except that the most significant bits of the result always copy the most significant bit of the second argument.
The semantics of shift operations varies between environments. This definition does not necessarily capture directly the semantics of the programming language or assembly architecture you are modeling.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvlshr¶
def Z3_mk_bvlshr(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Logical shift right.
It is equivalent to unsigned division by 2^x where x is the value of the third argument.
NB. The semantics of shift operations varies between environments. This definition does not necessarily capture directly the semantics of the programming language or assembly architecture you are modeling.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvmul¶
def Z3_mk_bvmul(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Standard two's complement multiplication.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvmul_no_overflow¶
def Z3_mk_bvmul_no_overflow(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast, is_signed: Bool) raises -> Z3_ast
Create a predicate that checks that the bit-wise multiplication of t1 and t2 does not overflow.
The nodes t1 and t2 must have the same bit-vector sort. The returned node is of sort Bool.
Z3_mk_bvmul_no_underflow¶
def Z3_mk_bvmul_no_underflow(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Create a predicate that checks that the bit-wise signed multiplication of t1 and t2 does not underflow.
The nodes t1 and t2 must have the same bit-vector sort. The returned node is of sort Bool.
Z3_mk_bvnand¶
def Z3_mk_bvnand(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Bitwise nand.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvneg¶
def Z3_mk_bvneg(self, c: Z3_context, t1: Z3_ast) raises -> Z3_ast
Standard two's complement unary minus.
The node t1 must have bit-vector sort.
Z3_mk_bvneg_no_overflow¶
def Z3_mk_bvneg_no_overflow(self, c: Z3_context, t1: Z3_ast) raises -> Z3_ast
Check that bit-wise negation does not overflow when t1 is interpreted as a signed bit-vector.
The node t1 must have bit-vector sort. The returned node is of sort Bool.
Z3_mk_bvnor¶
def Z3_mk_bvnor(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Bitwise nor.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvnot¶
def Z3_mk_bvnot(self, c: Z3_context, t1: Z3_ast) raises -> Z3_ast
Bitwise negation.
The node t1 must have a bit-vector sort.
Z3_mk_bvor¶
def Z3_mk_bvor(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Bitwise or.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvredand¶
def Z3_mk_bvredand(self, c: Z3_context, t1: Z3_ast) raises -> Z3_ast
Take conjunction of bits in vector, return vector of length 1.
The node t1 must have a bit-vector sort.
Z3_mk_bvredor¶
def Z3_mk_bvredor(self, c: Z3_context, t1: Z3_ast) raises -> Z3_ast
Take disjunction of bits in vector, return vector of length 1.
The node t1 must have a bit-vector sort.
Z3_mk_bvsdiv¶
def Z3_mk_bvsdiv(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Two's complement signed division.
It is defined in the following way:
-
The
flooroft1/t2ift2is different from zero, andt1*t2 >= 0. -
The
ceilingoft1/t2ift2is different from zero, andt1*t2 < 0.
If t2 is zero, then the result is undefined.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvsdiv_no_overflow¶
def Z3_mk_bvsdiv_no_overflow(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Create a predicate that checks that the bit-wise signed division of t1 and t2 does not overflow.
The nodes t1 and t2 must have the same bit-vector sort. The returned node is of sort Bool.
Z3_mk_bvsge¶
def Z3_mk_bvsge(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Two's complement signed greater than or equal to.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvsgt¶
def Z3_mk_bvsgt(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Two's complement signed greater than.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvshl¶
def Z3_mk_bvshl(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Shift left.
It is equivalent to multiplication by 2^x where x is the value of the third argument.
NB. The semantics of shift operations varies between environments. This definition does not necessarily capture directly the semantics of the programming language or assembly architecture you are modeling.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvsle¶
def Z3_mk_bvsle(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Two's complement signed less than or equal to.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvslt¶
def Z3_mk_bvslt(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Two's complement signed less than.
It abbreviates:
(or (and (= (extract[|m-1|:|m-1|] t1) bit1)
(= (extract[|m-1|:|m-1|] t2) bit0))
(and (= (extract[|m-1|:|m-1|] t1) (extract[|m-1|:|m-1|] t2))
(bvult t1 t2)))
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvsmod¶
def Z3_mk_bvsmod(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Two's complement signed remainder (sign follows divisor).
If t2 is zero, then the result is undefined.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvsrem¶
def Z3_mk_bvsrem(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Two's complement signed remainder (sign follows dividend).
It is defined as t1 - (t1 /s t2) * t2, where /s represents signed division. The most significant bit (sign) of the result is equal to the most significant bit of t1.
If t2 is zero, then the result is undefined.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvsub¶
def Z3_mk_bvsub(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Standard two's complement subtraction.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvsub_no_overflow¶
def Z3_mk_bvsub_no_overflow(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Create a predicate that checks that the bit-wise signed subtraction of t1 and t2 does not overflow.
The nodes t1 and t2 must have the same bit-vector sort. The returned node is of sort Bool.
Z3_mk_bvsub_no_underflow¶
def Z3_mk_bvsub_no_underflow(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast, is_signed: Bool) raises -> Z3_ast
Create a predicate that checks that the bit-wise subtraction of t1 and t2 does not underflow.
The nodes t1 and t2 must have the same bit-vector sort. The returned node is of sort Bool.
Z3_mk_bvudiv¶
def Z3_mk_bvudiv(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Unsigned division.
It is defined as the floor of t1/t2 if t2 is different from zero. If t2 is zero, then the result is undefined.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvuge¶
def Z3_mk_bvuge(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Unsigned greater than or equal to.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvugt¶
def Z3_mk_bvugt(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Unsigned greater than.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvule¶
def Z3_mk_bvule(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Unsigned less than or equal to.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvult¶
def Z3_mk_bvult(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Unsigned less than.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvurem¶
def Z3_mk_bvurem(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Unsigned remainder.
It is defined as t1 - (t1 /u t2) * t2, where /u represents unsigned division.
If t2 is zero, then the result is undefined.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvxnor¶
def Z3_mk_bvxnor(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Bitwise xnor.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_bvxor¶
def Z3_mk_bvxor(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Bitwise exclusive-or.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_concat¶
def Z3_mk_concat(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Concatenate the given bit-vectors.
The nodes t1 and t2 must have (possibly different) bit-vector sorts
The result is a bit-vector of size n1+n2, where n1 (n2) is the size of t1 (t2).
Z3_mk_ext_rotate_left¶
def Z3_mk_ext_rotate_left(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Rotate bits of t1 to the left t2 times.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_ext_rotate_right¶
def Z3_mk_ext_rotate_right(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Rotate bits of t1 to the right t2 times.
The nodes t1 and t2 must have the same bit-vector sort.
Z3_mk_extract¶
def Z3_mk_extract(self, c: Z3_context, high: UInt32, low: UInt32, t1: Z3_ast) raises -> Z3_ast
Extract the bits high down to low from a bit-vector of size m to yield a new bit-vector of size n, where n = high - low + 1.
The node t1 must have a bit-vector sort.
Z3_mk_int2bv¶
def Z3_mk_int2bv(self, c: Z3_context, n: UInt32, t1: Z3_ast) raises -> Z3_ast
Create an n bit bit-vector from the integer argument t1.
The resulting bit-vector has n bits, where the i'th bit (counting from 0 to n-1) is 1 if (t1 div 2^i) mod 2 is 1.
The node t1 must have integer sort.
Z3_mk_repeat¶
def Z3_mk_repeat(self, c: Z3_context, i: UInt32, t1: Z3_ast) raises -> Z3_ast
Repeat the given bit-vector up length i.
The node t1 must have a bit-vector sort.
Z3_mk_rotate_left¶
def Z3_mk_rotate_left(self, c: Z3_context, i: UInt32, t1: Z3_ast) raises -> Z3_ast
Rotate bits of t1 to the left i times.
The node t1 must have a bit-vector sort.
Z3_mk_rotate_right¶
def Z3_mk_rotate_right(self, c: Z3_context, i: UInt32, t1: Z3_ast) raises -> Z3_ast
Rotate bits of t1 to the right i times.
The node t1 must have a bit-vector sort.
Z3_mk_sign_ext¶
def Z3_mk_sign_ext(self, c: Z3_context, i: UInt32, t1: Z3_ast) raises -> Z3_ast
Sign-extend of the given bit-vector to the (signed) equivalent bit-vector of size m+i, where m is the size of the given bit-vector.
The node t1 must have a bit-vector sort.
Z3_mk_zero_ext¶
def Z3_mk_zero_ext(self, c: Z3_context, i: UInt32, t1: Z3_ast) raises -> Z3_ast
Extend the given bit-vector with zeros to the (unsigned) equivalent bit-vector of size m+i, where m is the size of the given bit-vector.
The node t1 must have a bit-vector sort.
Arrays (8)¶
Z3_mk_array_default¶
def Z3_mk_array_default(self, c: Z3_context, array: Z3_ast) raises -> Z3_ast
Access the array default value. Produces the default range value, for arrays that can be represented as finite maps with a default range value.
Z3_mk_as_array¶
def Z3_mk_as_array(self, c: Z3_context, f: Z3_func_decl) raises -> Z3_ast
Create array with the same interpretation as a function. The array satisfies the property (f x) = (select (_ as-array f) x) for every argument x.
Z3_mk_const_array¶
def Z3_mk_const_array(self, c: Z3_context, domain: Z3_sort, v: Z3_ast) raises -> Z3_ast
Create the constant array.
The resulting term is an array, such that a select on an arbitrary index produces the value v.
Z3_mk_map¶
def Z3_mk_map(self, c: Z3_context, f: Z3_func_decl, n: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Map f on the argument arrays.
The n nodes args must be of array sorts [domain_i -> range_i]. The function declaration f must have type range_1 .. range_n -> range. v must have sort range. The sort of the result is [domain_i -> range].
Z3_mk_select¶
def Z3_mk_select(self, c: Z3_context, a: Z3_ast, i: Z3_ast) raises -> Z3_ast
Array read. The argument a is the array and i is the index of the array that gets read.
The node a must have an array sort [domain -> range], and i must have the sort domain. The sort of the result is range.
Z3_mk_select_n¶
def Z3_mk_select_n(self, c: Z3_context, a: Z3_ast, n: UInt32, idxs: Pointer[Z3_ast, _]) raises -> Z3_ast
n-ary Array read. The argument a is the array and idxs are the indices of the array that gets read.
Z3_mk_store¶
def Z3_mk_store(self, c: Z3_context, a: Z3_ast, i: Z3_ast, v: Z3_ast) raises -> Z3_ast
Array update.
The node a must have an array sort [domain -> range], i must have sort domain, v must have sort range. The sort of the result is [domain -> range]. The semantics of this function is given by the theory of arrays described in the SMT-LIB standard. See http://smtlib.org for more details. The result of this function is an array that is equal to a (with respect to select) on all indices except for i, where it maps to v (and the select of a with respect to i may be a different value).
Z3_mk_store_n¶
def Z3_mk_store_n(self, c: Z3_context, a: Z3_ast, n: UInt32, idxs: Pointer[Z3_ast, _], v: Z3_ast) raises -> Z3_ast
n-ary Array update.
Sets (12)¶
Z3_mk_array_ext¶
def Z3_mk_array_ext(self, c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) raises -> Z3_ast
Create array extensionality index given two arrays with the same sort. The meaning is given by the axiom: (=> (= (select A (array-ext A B)) (select B (array-ext A B))) (= A B))
Z3_mk_empty_set¶
def Z3_mk_empty_set(self, c: Z3_context, domain: Z3_sort) raises -> Z3_ast
Create the empty set.
Z3_mk_full_set¶
def Z3_mk_full_set(self, c: Z3_context, domain: Z3_sort) raises -> Z3_ast
Create the full set.
Z3_mk_set_add¶
def Z3_mk_set_add(self, c: Z3_context, set: Z3_ast, elem: Z3_ast) raises -> Z3_ast
Add an element to a set.
The first argument must be a set, the second an element.
Z3_mk_set_complement¶
def Z3_mk_set_complement(self, c: Z3_context, arg: Z3_ast) raises -> Z3_ast
Take the complement of a set.
Z3_mk_set_del¶
def Z3_mk_set_del(self, c: Z3_context, set: Z3_ast, elem: Z3_ast) raises -> Z3_ast
Remove an element to a set.
The first argument must be a set, the second an element.
Z3_mk_set_difference¶
def Z3_mk_set_difference(self, c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) raises -> Z3_ast
Take the set difference between two sets.
Z3_mk_set_intersect¶
def Z3_mk_set_intersect(self, c: Z3_context, num_args: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Take the intersection of a list of sets.
Z3_mk_set_member¶
def Z3_mk_set_member(self, c: Z3_context, elem: Z3_ast, set: Z3_ast) raises -> Z3_ast
Check for set membership.
The first argument should be an element type of the set.
Z3_mk_set_sort¶
def Z3_mk_set_sort(self, c: Z3_context, ty: Z3_sort) raises -> Z3_sort
Create Set type.
Z3_mk_set_subset¶
def Z3_mk_set_subset(self, c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) raises -> Z3_ast
Check for subsetness of sets.
Z3_mk_set_union¶
def Z3_mk_set_union(self, c: Z3_context, num_args: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Take the union of a list of sets.
Finite Sets (14)¶
Z3_get_finite_set_sort_basis¶
def Z3_get_finite_set_sort_basis(self, c: Z3_context, s: Z3_sort) raises -> Z3_sort
Get the element sort of a finite set sort.
Z3_is_finite_set_sort¶
def Z3_is_finite_set_sort(self, c: Z3_context, s: Z3_sort) raises -> Bool
Check if a sort is a finite set sort.
Z3_mk_finite_set_difference¶
def Z3_mk_finite_set_difference(self, c: Z3_context, s1: Z3_ast, s2: Z3_ast) raises -> Z3_ast
Create the set difference of two finite sets.
Z3_mk_finite_set_empty¶
def Z3_mk_finite_set_empty(self, c: Z3_context, set_sort: Z3_sort) raises -> Z3_ast
Create an empty finite set of the given sort.
Z3_mk_finite_set_filter¶
def Z3_mk_finite_set_filter(self, c: Z3_context, f: Z3_ast, set: Z3_ast) raises -> Z3_ast
Filter a finite set using a predicate.
Z3_mk_finite_set_intersect¶
def Z3_mk_finite_set_intersect(self, c: Z3_context, s1: Z3_ast, s2: Z3_ast) raises -> Z3_ast
Create the intersection of two finite sets.
Z3_mk_finite_set_map¶
def Z3_mk_finite_set_map(self, c: Z3_context, f: Z3_ast, set: Z3_ast) raises -> Z3_ast
Apply a function to all elements of a finite set.
Z3_mk_finite_set_member¶
def Z3_mk_finite_set_member(self, c: Z3_context, elem: Z3_ast, set: Z3_ast) raises -> Z3_ast
Check if an element is a member of a finite set.
Z3_mk_finite_set_range¶
def Z3_mk_finite_set_range(self, c: Z3_context, low: Z3_ast, high: Z3_ast) raises -> Z3_ast
Create a finite set of integers in the range [low, high].
Z3_mk_finite_set_singleton¶
def Z3_mk_finite_set_singleton(self, c: Z3_context, elem: Z3_ast) raises -> Z3_ast
Create a singleton finite set.
Z3_mk_finite_set_size¶
def Z3_mk_finite_set_size(self, c: Z3_context, set: Z3_ast) raises -> Z3_ast
Get the size (cardinality) of a finite set.
Z3_mk_finite_set_sort¶
def Z3_mk_finite_set_sort(self, c: Z3_context, elem_sort: Z3_sort) raises -> Z3_sort
Create a finite set sort.
Z3_mk_finite_set_subset¶
def Z3_mk_finite_set_subset(self, c: Z3_context, s1: Z3_ast, s2: Z3_ast) raises -> Z3_ast
Check if one finite set is a subset of another.
Z3_mk_finite_set_union¶
def Z3_mk_finite_set_union(self, c: Z3_context, s1: Z3_ast, s2: Z3_ast) raises -> Z3_ast
Create the union of two finite sets.
Numerals (8)¶
Z3_mk_bv_numeral¶
def Z3_mk_bv_numeral(self, c: Z3_context, sz: UInt32, bits: Pointer[UInt8, _]) raises -> Z3_ast
create a bit-vector numeral from a vector of Booleans.
Z3_mk_int¶
def Z3_mk_int(self, c: Z3_context, v: Int32, ty: Z3_sort) raises -> Z3_ast
Create a numeral of an int, bit-vector, or finite-domain sort.
This function can be used to create numerals that fit in a machine integer. It is slightly faster than Z3_mk_numeral since it is not necessary to parse a string.
Z3_mk_int64¶
def Z3_mk_int64(self, c: Z3_context, v: Int64, ty: Z3_sort) raises -> Z3_ast
Create a numeral of a int, bit-vector, or finite-domain sort.
This function can be used to create numerals that fit in a machine int64_t integer. It is slightly faster than Z3_mk_numeral since it is not necessary to parse a string.
Z3_mk_numeral¶
def Z3_mk_numeral(self, c: Z3_context, numeral: Pointer[Int8, _], ty: Z3_sort) raises -> Z3_ast
Create a numeral of a given sort.
Z3_mk_real¶
def Z3_mk_real(self, c: Z3_context, num: Int32, den: Int32) raises -> Z3_ast
Create a real from a fraction.
Z3_mk_real_int64¶
def Z3_mk_real_int64(self, c: Z3_context, num: Int64, den: Int64) raises -> Z3_ast
Create a real from a fraction of int64.
Z3_mk_unsigned_int¶
def Z3_mk_unsigned_int(self, c: Z3_context, v: UInt32, ty: Z3_sort) raises -> Z3_ast
Create a numeral of a int, bit-vector, or finite-domain sort.
This function can be used to create numerals that fit in a machine unsigned integer. It is slightly faster than Z3_mk_numeral since it is not necessary to parse a string.
Z3_mk_unsigned_int64¶
def Z3_mk_unsigned_int64(self, c: Z3_context, v: UInt64, ty: Z3_sort) raises -> Z3_ast
Create a numeral of a int, bit-vector, or finite-domain sort.
This function can be used to create numerals that fit in a machine uint64_t integer. It is slightly faster than Z3_mk_numeral since it is not necessary to parse a string.
Sequences and regular expressions (69)¶
Z3_get_lstring¶
def Z3_get_lstring(self, c: Z3_context, s: Z3_ast, length: Pointer[mut=True, UInt32, _]) raises -> Pointer[Int8, MutUntrackedOrigin]
Retrieve the string constant stored in s. The string can contain escape sequences. Characters in the range 1 to 255 are literal. Characters in the range 0, and 256 above are escaped.
Z3_get_re_sort_basis¶
def Z3_get_re_sort_basis(self, c: Z3_context, s: Z3_sort) raises -> Z3_sort
Retrieve basis sort for regex sort.
Z3_get_seq_sort_basis¶
def Z3_get_seq_sort_basis(self, c: Z3_context, s: Z3_sort) raises -> Z3_sort
Retrieve basis sort for sequence sort.
Z3_get_string¶
def Z3_get_string(self, c: Z3_context, s: Z3_ast) raises -> Pointer[Int8, MutUntrackedOrigin]
Retrieve the string constant stored in s. Characters outside the basic printable ASCII range are escaped.
Z3_get_string_contents¶
def Z3_get_string_contents(self, c: Z3_context, s: Z3_ast, length: UInt32, contents: Pointer[mut=True, UInt32, _]) raises
Retrieve the unescaped string constant stored in s.
Z3_get_string_length¶
def Z3_get_string_length(self, c: Z3_context, s: Z3_ast) raises -> UInt32
Retrieve the length of the unescaped string constant stored in s.
Z3_is_char_sort¶
def Z3_is_char_sort(self, c: Z3_context, s: Z3_sort) raises -> Bool
Check if s is a character sort.
Z3_is_re_sort¶
def Z3_is_re_sort(self, c: Z3_context, s: Z3_sort) raises -> Bool
Check if s is a regular expression sort.
Z3_is_seq_sort¶
def Z3_is_seq_sort(self, c: Z3_context, s: Z3_sort) raises -> Bool
Check if s is a sequence sort.
Z3_is_string¶
def Z3_is_string(self, c: Z3_context, s: Z3_ast) raises -> Bool
Determine if s is a string constant.
Z3_is_string_sort¶
def Z3_is_string_sort(self, c: Z3_context, s: Z3_sort) raises -> Bool
Check if s is a string sort.
Z3_mk_char¶
def Z3_mk_char(self, c: Z3_context, ch: UInt32) raises -> Z3_ast
Create a character literal
Z3_mk_char_from_bv¶
def Z3_mk_char_from_bv(self, c: Z3_context, bv: Z3_ast) raises -> Z3_ast
Create a character from a bit-vector (code point).
Z3_mk_char_is_digit¶
def Z3_mk_char_is_digit(self, c: Z3_context, ch: Z3_ast) raises -> Z3_ast
Create a check if the character is a digit.
Z3_mk_char_le¶
def Z3_mk_char_le(self, c: Z3_context, ch1: Z3_ast, ch2: Z3_ast) raises -> Z3_ast
Create less than or equal to between two characters.
Z3_mk_char_sort¶
def Z3_mk_char_sort(self, c: Z3_context) raises -> Z3_sort
Create a sort for unicode characters.
The sort for characters can be changed to ASCII by setting the global parameter encoding to ascii, or alternative to 16 bit characters by setting encoding to bmp.
Z3_mk_char_to_bv¶
def Z3_mk_char_to_bv(self, c: Z3_context, ch: Z3_ast) raises -> Z3_ast
Create a bit-vector (code point) from character.
Z3_mk_char_to_int¶
def Z3_mk_char_to_int(self, c: Z3_context, ch: Z3_ast) raises -> Z3_ast
Create an integer (code point) from character.
Z3_mk_int_to_str¶
def Z3_mk_int_to_str(self, c: Z3_context, s: Z3_ast) raises -> Z3_ast
Integer to string conversion.
Z3_mk_lstring¶
def Z3_mk_lstring(self, c: Z3_context, len: UInt32, s: Pointer[Int8, _]) raises -> Z3_ast
Create a string constant out of the string that is passed in It takes the length of the string as well to take into account 0 characters. The string is treated as if it is unescaped so a sequence of characters \u{0} is treated as 5 characters and not the character 0.
Z3_mk_re_allchar¶
def Z3_mk_re_allchar(self, c: Z3_context, regex_sort: Z3_sort) raises -> Z3_ast
Create a regular expression that accepts all singleton sequences of the regular expression sort
Z3_mk_re_complement¶
def Z3_mk_re_complement(self, c: Z3_context, re: Z3_ast) raises -> Z3_ast
Create the complement of the regular language re.
Z3_mk_re_concat¶
def Z3_mk_re_concat(self, c: Z3_context, n: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Create the concatenation of the regular languages.
Z3_mk_re_diff¶
def Z3_mk_re_diff(self, c: Z3_context, re1: Z3_ast, re2: Z3_ast) raises -> Z3_ast
Create the difference of regular expressions.
Z3_mk_re_empty¶
def Z3_mk_re_empty(self, c: Z3_context, re: Z3_sort) raises -> Z3_ast
Create an empty regular expression of sort re.
Z3_mk_re_full¶
def Z3_mk_re_full(self, c: Z3_context, re: Z3_sort) raises -> Z3_ast
Create an universal regular expression of sort re.
Z3_mk_re_intersect¶
def Z3_mk_re_intersect(self, c: Z3_context, n: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Create the intersection of the regular languages.
Z3_mk_re_loop¶
def Z3_mk_re_loop(self, c: Z3_context, r: Z3_ast, lo: UInt32, hi: UInt32) raises -> Z3_ast
Create a regular expression loop. The supplied regular expression r is repeated between lo and hi times. The lo should be below hi with one exception: when supplying the value hi as 0, the meaning is to repeat the argument r at least lo number of times, and with an unbounded upper bound.
Z3_mk_re_option¶
def Z3_mk_re_option(self, c: Z3_context, re: Z3_ast) raises -> Z3_ast
Create the regular language [re].
Z3_mk_re_plus¶
def Z3_mk_re_plus(self, c: Z3_context, re: Z3_ast) raises -> Z3_ast
Create the regular language re+.
Z3_mk_re_power¶
def Z3_mk_re_power(self, c: Z3_context, re: Z3_ast, n: UInt32) raises -> Z3_ast
Create a power regular expression.
Z3_mk_re_range¶
def Z3_mk_re_range(self, c: Z3_context, lo: Z3_ast, hi: Z3_ast) raises -> Z3_ast
Create the range regular expression over two sequences of length 1.
Z3_mk_re_sort¶
def Z3_mk_re_sort(self, c: Z3_context, seq: Z3_sort) raises -> Z3_sort
Create a regular expression sort out of a sequence sort.
Z3_mk_re_star¶
def Z3_mk_re_star(self, c: Z3_context, re: Z3_ast) raises -> Z3_ast
Create the regular language re*.
Z3_mk_re_union¶
def Z3_mk_re_union(self, c: Z3_context, n: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Create the union of the regular languages.
Z3_mk_sbv_to_str¶
def Z3_mk_sbv_to_str(self, c: Z3_context, s: Z3_ast) raises -> Z3_ast
Signed bit-vector to string conversion.
Z3_mk_seq_at¶
def Z3_mk_seq_at(self, c: Z3_context, s: Z3_ast, index: Z3_ast) raises -> Z3_ast
Retrieve from s the unit sequence positioned at position index. The sequence is empty if the index is out of bounds.
Z3_mk_seq_concat¶
def Z3_mk_seq_concat(self, c: Z3_context, n: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
Concatenate sequences.
Z3_mk_seq_contains¶
def Z3_mk_seq_contains(self, c: Z3_context, container: Z3_ast, containee: Z3_ast) raises -> Z3_ast
Check if container contains containee.
Z3_mk_seq_empty¶
def Z3_mk_seq_empty(self, c: Z3_context, seq: Z3_sort) raises -> Z3_ast
Create an empty sequence of the sequence sort seq.
Z3_mk_seq_extract¶
def Z3_mk_seq_extract(self, c: Z3_context, s: Z3_ast, offset: Z3_ast, length: Z3_ast) raises -> Z3_ast
Extract subsequence starting at offset of length.
Z3_mk_seq_foldl¶
def Z3_mk_seq_foldl(self, c: Z3_context, f: Z3_ast, a: Z3_ast, s: Z3_ast) raises -> Z3_ast
Create a fold of the function f over the sequence s with accumulator a.
Z3_mk_seq_foldli¶
def Z3_mk_seq_foldli(self, c: Z3_context, f: Z3_ast, i: Z3_ast, a: Z3_ast, s: Z3_ast) raises -> Z3_ast
Create a fold with index tracking of the function f over the sequence s with accumulator a starting at index i.
Z3_mk_seq_in_re¶
def Z3_mk_seq_in_re(self, c: Z3_context, seq: Z3_ast, re: Z3_ast) raises -> Z3_ast
Check if seq is in the language generated by the regular expression re.
Z3_mk_seq_index¶
def Z3_mk_seq_index(self, c: Z3_context, s: Z3_ast, substr: Z3_ast, offset: Z3_ast) raises -> Z3_ast
Return index of the first occurrence of substr in s starting from offset offset. If s does not contain substr, then the value is -1, if offset is the length of s, then the value is -1 as well. The value is -1 if offset is negative or larger than the length of s.
Z3_mk_seq_last_index¶
def Z3_mk_seq_last_index(self, c: Z3_context, s: Z3_ast, substr: Z3_ast) raises -> Z3_ast
Return index of the last occurrence of substr in s. If s does not contain substr, then the value is -1,
Z3_mk_seq_length¶
def Z3_mk_seq_length(self, c: Z3_context, s: Z3_ast) raises -> Z3_ast
Return the length of the sequence s.
Z3_mk_seq_map¶
def Z3_mk_seq_map(self, c: Z3_context, f: Z3_ast, s: Z3_ast) raises -> Z3_ast
Create a map of the function f over the sequence s.
Z3_mk_seq_mapi¶
def Z3_mk_seq_mapi(self, c: Z3_context, f: Z3_ast, i: Z3_ast, s: Z3_ast) raises -> Z3_ast
Create a map of the function f over the sequence s starting at index i.
Z3_mk_seq_nth¶
def Z3_mk_seq_nth(self, c: Z3_context, s: Z3_ast, index: Z3_ast) raises -> Z3_ast
Retrieve from s the element positioned at position index. The function is under-specified if the index is out of bounds.
Z3_mk_seq_power¶
def Z3_mk_seq_power(self, c: Z3_context, s: Z3_ast, n: Z3_ast) raises -> Z3_ast
Create the sequence s concatenated n times with itself. The result is the empty sequence when n is not positive.
Z3_mk_seq_prefix¶
def Z3_mk_seq_prefix(self, c: Z3_context, prefix: Z3_ast, s: Z3_ast) raises -> Z3_ast
Check if prefix is a prefix of s.
Z3_mk_seq_replace¶
def Z3_mk_seq_replace(self, c: Z3_context, s: Z3_ast, src: Z3_ast, dst: Z3_ast) raises -> Z3_ast
Replace the first occurrence of src with dst in s.
Z3_mk_seq_replace_all¶
def Z3_mk_seq_replace_all(self, c: Z3_context, s: Z3_ast, src: Z3_ast, dst: Z3_ast) raises -> Z3_ast
Replace all occurrences of src with dst in s.
Z3_mk_seq_replace_re¶
def Z3_mk_seq_replace_re(self, c: Z3_context, s: Z3_ast, re: Z3_ast, dst: Z3_ast) raises -> Z3_ast
Replace the first occurrence of regular expression re with dst in s.
Z3_mk_seq_replace_re_all¶
def Z3_mk_seq_replace_re_all(self, c: Z3_context, s: Z3_ast, re: Z3_ast, dst: Z3_ast) raises -> Z3_ast
Replace all occurrences of regular expression re with dst in s.
Z3_mk_seq_sort¶
def Z3_mk_seq_sort(self, c: Z3_context, s: Z3_sort) raises -> Z3_sort
Create a sequence sort out of the sort for the elements.
Z3_mk_seq_suffix¶
def Z3_mk_seq_suffix(self, c: Z3_context, suffix: Z3_ast, s: Z3_ast) raises -> Z3_ast
Check if suffix is a suffix of s.
Z3_mk_seq_to_re¶
def Z3_mk_seq_to_re(self, c: Z3_context, seq: Z3_ast) raises -> Z3_ast
Create a regular expression that accepts the sequence seq.
Z3_mk_seq_unit¶
def Z3_mk_seq_unit(self, c: Z3_context, a: Z3_ast) raises -> Z3_ast
Create a unit sequence of a.
Z3_mk_str_le¶
def Z3_mk_str_le(self, c: Z3_context, prefix: Z3_ast, s: Z3_ast) raises -> Z3_ast
Check if s1 is equal or lexicographically strictly less than s2.
Z3_mk_str_lt¶
def Z3_mk_str_lt(self, c: Z3_context, prefix: Z3_ast, s: Z3_ast) raises -> Z3_ast
Check if s1 is lexicographically strictly less than s2.
Z3_mk_str_to_int¶
def Z3_mk_str_to_int(self, c: Z3_context, s: Z3_ast) raises -> Z3_ast
Convert string to integer.
Z3_mk_string¶
def Z3_mk_string(self, c: Z3_context, s: Pointer[Int8, _]) raises -> Z3_ast
Create a string constant out of the string that is passed in The string may contain escape encoding for non-printable characters or characters outside of the basic printable ASCII range. For example, the escape encoding \u{0} represents the character 0 and the encoding \u{100} represents the character 256.
Z3_mk_string_from_code¶
def Z3_mk_string_from_code(self, c: Z3_context, a: Z3_ast) raises -> Z3_ast
Code to string conversion.
Z3_mk_string_sort¶
def Z3_mk_string_sort(self, c: Z3_context) raises -> Z3_sort
Create a sort for unicode strings.
The sort for characters can be changed to ASCII by setting the global parameter encoding to ascii, or alternative to 16 bit characters by setting encoding to bmp.
Z3_mk_string_to_code¶
def Z3_mk_string_to_code(self, c: Z3_context, a: Z3_ast) raises -> Z3_ast
String to code conversion.
Z3_mk_u32string¶
def Z3_mk_u32string(self, c: Z3_context, len: UInt32, chars: Pointer[UInt32, _]) raises -> Z3_ast
Create a string constant out of the string that is passed in It takes the length of the string as well to take into account 0 characters. The string is unescaped.
Z3_mk_ubv_to_str¶
def Z3_mk_ubv_to_str(self, c: Z3_context, s: Z3_ast) raises -> Z3_ast
Unsigned bit-vector to string conversion.
Special relations (5)¶
Z3_mk_linear_order¶
def Z3_mk_linear_order(self, c: Z3_context, a: Z3_sort, id: UInt32) raises -> Z3_func_decl
create a linear ordering relation over signature a. The relation is identified by the index id.
Z3_mk_partial_order¶
def Z3_mk_partial_order(self, c: Z3_context, a: Z3_sort, id: UInt32) raises -> Z3_func_decl
create a partial ordering relation over signature a and index id.
Z3_mk_piecewise_linear_order¶
def Z3_mk_piecewise_linear_order(self, c: Z3_context, a: Z3_sort, id: UInt32) raises -> Z3_func_decl
create a piecewise linear ordering relation over signature a and index id.
Z3_mk_transitive_closure¶
def Z3_mk_transitive_closure(self, c: Z3_context, f: Z3_func_decl) raises -> Z3_func_decl
create transitive closure of binary relation.
The resulting relation f+ represents the transitive closure of f.
Z3_mk_tree_order¶
def Z3_mk_tree_order(self, c: Z3_context, a: Z3_sort, id: UInt32) raises -> Z3_func_decl
create a tree ordering relation over signature a identified using index id.
Quantifiers (12)¶
Z3_mk_bound¶
def Z3_mk_bound(self, c: Z3_context, index: UInt32, ty: Z3_sort) raises -> Z3_ast
Create a variable.
Variables are intended to be bound by a scope created by a quantifier. So we call them bound variables even if they appear as free variables in the expression produced by Z3_mk_bound.
Bound variables are indexed by de-Bruijn indices. It is perhaps easiest to explain the meaning of de-Bruijn indices by indicating the compilation process from non-de-Bruijn formulas to de-Bruijn format.
abs(forall (x1) phi) = forall (x1) abs1(phi, x1, 0)
abs(forall (x1, x2) phi) = abs(forall (x1) abs(forall (x2) phi))
abs1(x, x, n) = b_n
abs1(y, x, n) = y
abs1(f(t1,...,tn), x, n) = f(abs1(t1,x,n), ..., abs1(tn,x,n))
abs1(forall (x1) phi, x, n) = forall (x1) (abs1(phi, x, n+1))
The last line is significant: the index of a bound variable is different depending on the scope in which it appears. The deeper x appears, the higher is its index.
Z3_mk_exists¶
def Z3_mk_exists(self, c: Z3_context, weight: UInt32, num_patterns: UInt32, patterns: Pointer[Z3_pattern, _], num_decls: UInt32, sorts: Pointer[Z3_sort, _], decl_names: Pointer[Z3_symbol, _], body: Z3_ast) raises -> Z3_ast
Create an exists formula. Similar to Z3_mk_forall.
Z3_mk_exists_const¶
def Z3_mk_exists_const(self, c: Z3_context, weight: UInt32, num_bound: UInt32, bound: Pointer[Z3_app, _], num_patterns: UInt32, patterns: Pointer[Z3_pattern, _], body: Z3_ast) raises -> Z3_ast
Similar to Z3_mk_forall_const.
Create an existential quantifier using a list of constants that will form the set of bound variables.
Z3_mk_forall¶
def Z3_mk_forall(self, c: Z3_context, weight: UInt32, num_patterns: UInt32, patterns: Pointer[Z3_pattern, _], num_decls: UInt32, sorts: Pointer[Z3_sort, _], decl_names: Pointer[Z3_symbol, _], body: Z3_ast) raises -> Z3_ast
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.
Z3_mk_forall_const¶
def Z3_mk_forall_const(self, c: Z3_context, weight: UInt32, num_bound: UInt32, bound: Pointer[Z3_app, _], num_patterns: UInt32, patterns: Pointer[Z3_pattern, _], body: Z3_ast) raises -> Z3_ast
Create a universal quantifier using a list of constants that will form the set of bound variables.
Z3_mk_lambda¶
def Z3_mk_lambda(self, c: Z3_context, num_decls: UInt32, sorts: Pointer[Z3_sort, _], decl_names: Pointer[Z3_symbol, _], body: Z3_ast) raises -> Z3_ast
Create a lambda expression. 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. The sort of the resulting expression is (Array sorts range) where range is the sort of body. For example, if the lambda binds two variables of sort Int and Bool, and the body has sort Real, the sort of the expression is (Array Int Bool Real).
Z3_mk_lambda_const¶
def Z3_mk_lambda_const(self, c: Z3_context, num_bound: UInt32, bound: Pointer[Z3_app, _], body: Z3_ast) raises -> Z3_ast
Create a lambda expression using a list of constants that form the set of bound variables
Z3_mk_pattern¶
def Z3_mk_pattern(self, c: Z3_context, num_patterns: UInt32, terms: Pointer[Z3_ast, _]) raises -> Z3_pattern
Create a pattern for quantifier instantiation.
Z3 uses pattern matching to instantiate quantifiers. If a pattern is not provided for a quantifier, then Z3 will automatically compute a set of patterns for it. However, for optimal performance, the user should provide the patterns.
Patterns comprise a list of terms. The list should be non-empty. If the list comprises of more than one term, it is a called a multi-pattern.
In general, one can pass in a list of (multi-)patterns in the quantifier constructor.
Z3_mk_quantifier¶
def Z3_mk_quantifier(self, c: Z3_context, is_forall: Bool, weight: UInt32, num_patterns: UInt32, patterns: Pointer[Z3_pattern, _], num_decls: UInt32, sorts: Pointer[Z3_sort, _], decl_names: Pointer[Z3_symbol, _], body: Z3_ast) raises -> Z3_ast
Create a quantifier - universal or existential, with pattern hints. See the documentation for Z3_mk_forall for an explanation of the parameters.
Z3_mk_quantifier_const¶
def Z3_mk_quantifier_const(self, c: Z3_context, is_forall: Bool, weight: UInt32, num_bound: UInt32, bound: Pointer[Z3_app, _], num_patterns: UInt32, patterns: Pointer[Z3_pattern, _], body: Z3_ast) raises -> Z3_ast
Create a universal or existential quantifier using a list of constants that will form the set of bound variables.
Z3_mk_quantifier_const_ex¶
def Z3_mk_quantifier_const_ex(self, c: Z3_context, is_forall: Bool, weight: UInt32, quantifier_id: Z3_symbol, skolem_id: Z3_symbol, num_bound: UInt32, bound: Pointer[Z3_app, _], num_patterns: UInt32, patterns: Pointer[Z3_pattern, _], num_no_patterns: UInt32, no_patterns: Pointer[Z3_ast, _], body: Z3_ast) raises -> Z3_ast
Create a universal or existential quantifier using a list of constants that will form the set of bound variables.
Z3_mk_quantifier_ex¶
def Z3_mk_quantifier_ex(self, c: Z3_context, is_forall: Bool, weight: UInt32, quantifier_id: Z3_symbol, skolem_id: Z3_symbol, num_patterns: UInt32, patterns: Pointer[Z3_pattern, _], num_no_patterns: UInt32, no_patterns: Pointer[Z3_ast, _], num_decls: UInt32, sorts: Pointer[Z3_sort, _], decl_names: Pointer[Z3_symbol, _], body: Z3_ast) raises -> Z3_ast
Create a quantifier - universal or existential, with pattern hints, no patterns, and attributes
Accessors (102)¶
Z3_app_to_ast¶
def Z3_app_to_ast(self, c: Z3_context, a: Z3_app) raises -> Z3_ast
Convert a Z3_app into Z3_ast. This is just type casting.
Z3_datatype_update_field¶
def Z3_datatype_update_field(self, c: Z3_context, field_access: Z3_func_decl, t: Z3_ast, value: Z3_ast) raises -> Z3_ast
Update record field with a value.
This corresponds to the 'with' construct in OCaml. It has the effect of updating a record field with a given value. The remaining fields are left unchanged. It is the record equivalent of an array store (see Z3_mk_store). If the datatype has more than one constructor, then the update function behaves as identity if there is a mismatch between the accessor and constructor. For example ((_ update-field car) nil 1) is nil, while ((_ update-field car) (cons 2 nil) 1) is (cons 1 nil).
Z3_func_decl_to_ast¶
def Z3_func_decl_to_ast(self, c: Z3_context, f: Z3_func_decl) raises -> Z3_ast
Convert a Z3_func_decl into Z3_ast. This is just type casting.
Z3_get_algebraic_number_lower¶
def Z3_get_algebraic_number_lower(self, c: Z3_context, a: Z3_ast, precision: UInt32) raises -> Z3_ast
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.
Z3_get_algebraic_number_upper¶
def Z3_get_algebraic_number_upper(self, c: Z3_context, a: Z3_ast, precision: UInt32) raises -> Z3_ast
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.
Z3_get_app_arg¶
def Z3_get_app_arg(self, c: Z3_context, a: Z3_app, i: UInt32) raises -> Z3_ast
Return the i-th argument of the given application.
Z3_get_app_decl¶
def Z3_get_app_decl(self, c: Z3_context, a: Z3_app) raises -> Z3_func_decl
Return the declaration of a constant or function application.
Z3_get_app_num_args¶
def Z3_get_app_num_args(self, c: Z3_context, a: Z3_app) raises -> UInt32
Return the number of argument of an application. If t is an constant, then the number of arguments is 0.
Z3_get_arity¶
def Z3_get_arity(self, c: Z3_context, d: Z3_func_decl) raises -> UInt32
Alias for Z3_get_domain_size.
Z3_get_array_arity¶
def Z3_get_array_arity(self, c: Z3_context, s: Z3_sort) raises -> UInt32
Return the arity (number of dimensions) of the given array sort.
Z3_get_array_sort_domain¶
def Z3_get_array_sort_domain(self, c: Z3_context, t: Z3_sort) raises -> Z3_sort
Return the domain of the given array sort. In the case of a multi-dimensional array, this function returns the sort of the first dimension.
Z3_get_array_sort_domain_n¶
def Z3_get_array_sort_domain_n(self, c: Z3_context, t: Z3_sort, idx: UInt32) raises -> Z3_sort
Return the i'th domain sort of an n-dimensional array.
Z3_get_array_sort_range¶
def Z3_get_array_sort_range(self, c: Z3_context, t: Z3_sort) raises -> Z3_sort
Return the range of the given array sort.
Z3_get_ast_hash¶
def Z3_get_ast_hash(self, c: Z3_context, a: Z3_ast) raises -> UInt32
Return a hash code for the given AST. The hash code is structural but two different AST objects can map to the same hash. The result of Z3_get_ast_id returns an identifier that is unique over the set of live AST objects.
Z3_get_ast_id¶
def Z3_get_ast_id(self, c: Z3_context, t: Z3_ast) raises -> UInt32
Return a unique identifier for t. The identifier is unique up to structural equality. Thus, two ast nodes created by the same context and having the same children and same function symbols have the same identifiers. Ast nodes created in the same context, but having different children or different functions have different identifiers. Variables and quantifiers are also assigned different identifiers according to their structure.
Z3_get_ast_kind¶
def Z3_get_ast_kind(self, c: Z3_context, a: Z3_ast) raises -> AstKind
Return the kind of the given AST.
Z3_get_bool_value¶
def Z3_get_bool_value(self, c: Z3_context, a: Z3_ast) raises -> Lbool
Return Z3_L_TRUE if a is true, Z3_L_FALSE if it is false, and Z3_L_UNDEF otherwise.
Z3_get_bv_sort_size¶
def Z3_get_bv_sort_size(self, c: Z3_context, t: Z3_sort) raises -> UInt32
Return the size of the given bit-vector sort.
Z3_get_datatype_sort_constructor¶
def Z3_get_datatype_sort_constructor(self, c: Z3_context, t: Z3_sort, idx: UInt32) raises -> Z3_func_decl
Return idx'th constructor.
Z3_get_datatype_sort_constructor_accessor¶
def Z3_get_datatype_sort_constructor_accessor(self, c: Z3_context, t: Z3_sort, idx_c: UInt32, idx_a: UInt32) raises -> Z3_func_decl
Return idx_a'th accessor for the idx_c'th constructor.
Z3_get_datatype_sort_num_constructors¶
def Z3_get_datatype_sort_num_constructors(self, c: Z3_context, t: Z3_sort) raises -> UInt32
Return number of constructors for datatype.
Z3_get_datatype_sort_recognizer¶
def Z3_get_datatype_sort_recognizer(self, c: Z3_context, t: Z3_sort, idx: UInt32) raises -> Z3_func_decl
Return idx'th recognizer.
Z3_get_decl_ast_parameter¶
def Z3_get_decl_ast_parameter(self, c: Z3_context, d: Z3_func_decl, idx: UInt32) raises -> Z3_ast
Return the expression value associated with an expression parameter.
Z3_get_decl_double_parameter¶
def Z3_get_decl_double_parameter(self, c: Z3_context, d: Z3_func_decl, idx: UInt32) raises -> Float64
Return the double value associated with an double parameter.
Z3_get_decl_func_decl_parameter¶
def Z3_get_decl_func_decl_parameter(self, c: Z3_context, d: Z3_func_decl, idx: UInt32) raises -> Z3_func_decl
Return the expression value associated with an expression parameter.
Z3_get_decl_int_parameter¶
def Z3_get_decl_int_parameter(self, c: Z3_context, d: Z3_func_decl, idx: UInt32) raises -> Int32
Return the integer value associated with an integer parameter.
Z3_get_decl_kind¶
def Z3_get_decl_kind(self, c: Z3_context, d: Z3_func_decl) raises -> DeclKind
Return declaration kind corresponding to declaration.
Z3_get_decl_name¶
def Z3_get_decl_name(self, c: Z3_context, d: Z3_func_decl) raises -> Z3_symbol
Return the constant declaration name as a symbol.
Z3_get_decl_num_parameters¶
def Z3_get_decl_num_parameters(self, c: Z3_context, d: Z3_func_decl) raises -> UInt32
Return the number of parameters associated with a declaration.
Z3_get_decl_parameter_kind¶
def Z3_get_decl_parameter_kind(self, c: Z3_context, d: Z3_func_decl, idx: UInt32) raises -> ParameterKind
Return the parameter type associated with a declaration.
Z3_get_decl_rational_parameter¶
def Z3_get_decl_rational_parameter(self, c: Z3_context, d: Z3_func_decl, idx: UInt32) raises -> Pointer[Int8, MutUntrackedOrigin]
Return the rational value, as a string, associated with a rational parameter.
Z3_get_decl_sort_parameter¶
def Z3_get_decl_sort_parameter(self, c: Z3_context, d: Z3_func_decl, idx: UInt32) raises -> Z3_sort
Return the sort value associated with a sort parameter.
Z3_get_decl_symbol_parameter¶
def Z3_get_decl_symbol_parameter(self, c: Z3_context, d: Z3_func_decl, idx: UInt32) raises -> Z3_symbol
Return the double value associated with an double parameter.
Z3_get_denominator¶
def Z3_get_denominator(self, c: Z3_context, a: Z3_ast) raises -> Z3_ast
Return the denominator (as a numeral AST) of a numeral AST of sort Real.
Z3_get_depth¶
def Z3_get_depth(self, c: Z3_context, a: Z3_ast) raises -> UInt32
Z3_get_domain¶
def Z3_get_domain(self, c: Z3_context, d: Z3_func_decl, i: UInt32) raises -> Z3_sort
Return the sort of the i-th parameter of the given function declaration.
Z3_get_domain_size¶
def Z3_get_domain_size(self, c: Z3_context, d: Z3_func_decl) raises -> UInt32
Return the number of parameters of the given declaration.
Z3_get_finite_domain_sort_size¶
def Z3_get_finite_domain_sort_size(self, c: Z3_context, s: Z3_sort, r: Pointer[mut=True, UInt64, _]) raises -> Bool
Store the size of the sort in r. Return false if the call failed. That is, Z3_get_sort_kind(s) == Z3_FINITE_DOMAIN_SORT
Z3_get_func_decl_id¶
def Z3_get_func_decl_id(self, c: Z3_context, f: Z3_func_decl) raises -> UInt32
Return a unique identifier for f.
Z3_get_index_value¶
def Z3_get_index_value(self, c: Z3_context, a: Z3_ast) raises -> UInt32
Return index of de-Bruijn bound variable.
Z3_get_numeral_binary_string¶
def Z3_get_numeral_binary_string(self, c: Z3_context, a: Z3_ast) raises -> Pointer[Int8, MutUntrackedOrigin]
Return numeral value, as a binary string of a numeric constant term
Z3_get_numeral_decimal_string¶
def Z3_get_numeral_decimal_string(self, c: Z3_context, a: Z3_ast, precision: UInt32) raises -> Pointer[Int8, MutUntrackedOrigin]
Return numeral as a string in decimal notation. The result has at most precision decimal places.
Z3_get_numeral_double¶
def Z3_get_numeral_double(self, c: Z3_context, a: Z3_ast) raises -> Float64
Return numeral as a double.
Z3_get_numeral_int¶
def Z3_get_numeral_int(self, c: Z3_context, v: Z3_ast, i: Pointer[mut=True, Int32, _]) raises -> Bool
Similar to Z3_get_numeral_string, but only succeeds if the value can fit in a machine int. Return true if the call succeeded.
Z3_get_numeral_int64¶
def Z3_get_numeral_int64(self, c: Z3_context, v: Z3_ast, i: Pointer[mut=True, Int64, _]) raises -> Bool
Similar to Z3_get_numeral_string, but only succeeds if the value can fit in a machine int64_t int. Return true if the call succeeded.
Z3_get_numeral_rational_int64¶
def Z3_get_numeral_rational_int64(self, c: Z3_context, v: Z3_ast, num: Pointer[mut=True, Int64, _], den: Pointer[mut=True, Int64, _]) raises -> Bool
Similar to Z3_get_numeral_string, but only succeeds if the value can fit as a rational number as machine int64_t int. Return true if the call succeeded.
Z3_get_numeral_small¶
def Z3_get_numeral_small(self, c: Z3_context, a: Z3_ast, num: Pointer[mut=True, Int64, _], den: Pointer[mut=True, Int64, _]) raises -> Bool
Return numeral value, as a pair of 64 bit numbers if the representation fits.
Return true if the numeral value fits in 64 bit numerals, false otherwise.
Equivalent to Z3_get_numeral_rational_int64 except that for unsupported expression arguments Z3_get_numeral_small signals an error while Z3_get_numeral_rational_int64 returns false.
Z3_get_numeral_string¶
def Z3_get_numeral_string(self, c: Z3_context, a: Z3_ast) raises -> Pointer[Int8, MutUntrackedOrigin]
Return numeral value, as a decimal string of a numeric constant term
Z3_get_numeral_uint¶
def Z3_get_numeral_uint(self, c: Z3_context, v: Z3_ast, u: Pointer[mut=True, UInt32, _]) raises -> Bool
Similar to Z3_get_numeral_string, but only succeeds if the value can fit in a machine unsigned int. Return true if the call succeeded.
Z3_get_numeral_uint64¶
def Z3_get_numeral_uint64(self, c: Z3_context, v: Z3_ast, u: Pointer[mut=True, UInt64, _]) raises -> Bool
Similar to Z3_get_numeral_string, but only succeeds if the value can fit in a machine uint64_t int. Return true if the call succeeded.
Z3_get_numerator¶
def Z3_get_numerator(self, c: Z3_context, a: Z3_ast) raises -> Z3_ast
Return the numerator (as a numeral AST) of a numeral AST of sort Real.
Z3_get_pattern¶
def Z3_get_pattern(self, c: Z3_context, p: Z3_pattern, idx: UInt32) raises -> Z3_ast
Return i'th ast in pattern.
Z3_get_pattern_num_terms¶
def Z3_get_pattern_num_terms(self, c: Z3_context, p: Z3_pattern) raises -> UInt32
Return number of terms in pattern.
Z3_get_quantifier_body¶
def Z3_get_quantifier_body(self, c: Z3_context, a: Z3_ast) raises -> Z3_ast
Return body of quantifier.
Z3_get_quantifier_bound_name¶
def Z3_get_quantifier_bound_name(self, c: Z3_context, a: Z3_ast, i: UInt32) raises -> Z3_symbol
Return symbol of the i'th bound variable.
Z3_get_quantifier_bound_sort¶
def Z3_get_quantifier_bound_sort(self, c: Z3_context, a: Z3_ast, i: UInt32) raises -> Z3_sort
Return sort of the i'th bound variable.
Z3_get_quantifier_id¶
def Z3_get_quantifier_id(self, c: Z3_context, a: Z3_ast) raises -> Z3_symbol
Obtain id of quantifier.
Z3_get_quantifier_no_pattern_ast¶
def Z3_get_quantifier_no_pattern_ast(self, c: Z3_context, a: Z3_ast, i: UInt32) raises -> Z3_ast
Return i'th no_pattern.
Z3_get_quantifier_num_bound¶
def Z3_get_quantifier_num_bound(self, c: Z3_context, a: Z3_ast) raises -> UInt32
Return number of bound variables of quantifier.
Z3_get_quantifier_num_no_patterns¶
def Z3_get_quantifier_num_no_patterns(self, c: Z3_context, a: Z3_ast) raises -> UInt32
Return number of no_patterns used in quantifier.
Z3_get_quantifier_num_patterns¶
def Z3_get_quantifier_num_patterns(self, c: Z3_context, a: Z3_ast) raises -> UInt32
Return number of patterns used in quantifier.
Z3_get_quantifier_pattern_ast¶
def Z3_get_quantifier_pattern_ast(self, c: Z3_context, a: Z3_ast, i: UInt32) raises -> Z3_pattern
Return i'th pattern.
Z3_get_quantifier_skolem_id¶
def Z3_get_quantifier_skolem_id(self, c: Z3_context, a: Z3_ast) raises -> Z3_symbol
Obtain skolem id of quantifier.
Z3_get_quantifier_weight¶
def Z3_get_quantifier_weight(self, c: Z3_context, a: Z3_ast) raises -> UInt32
Obtain weight of quantifier.
Z3_get_range¶
def Z3_get_range(self, c: Z3_context, d: Z3_func_decl) raises -> Z3_sort
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.
Z3_get_relation_arity¶
def Z3_get_relation_arity(self, c: Z3_context, s: Z3_sort) raises -> UInt32
Return arity of relation.
Z3_get_relation_column¶
def Z3_get_relation_column(self, c: Z3_context, s: Z3_sort, col: UInt32) raises -> Z3_sort
Return sort at i'th column of relation sort.
Z3_get_sort¶
def Z3_get_sort(self, c: Z3_context, a: Z3_ast) raises -> Z3_sort
Return the sort of an AST node.
The AST node must be a constant, application, numeral, bound variable, or quantifier.
Z3_get_sort_id¶
def Z3_get_sort_id(self, c: Z3_context, s: Z3_sort) raises -> UInt32
Return a unique identifier for s.
Z3_get_sort_kind¶
def Z3_get_sort_kind(self, c: Z3_context, t: Z3_sort) raises -> SortKind
Return the sort kind (e.g., array, tuple, int, bool, etc).
Z3_get_sort_name¶
def Z3_get_sort_name(self, c: Z3_context, d: Z3_sort) raises -> Z3_symbol
Return the sort name as a symbol.
Z3_get_symbol_int¶
def Z3_get_symbol_int(self, c: Z3_context, s: Z3_symbol) raises -> Int32
Return the symbol int value.
Z3_get_symbol_kind¶
def Z3_get_symbol_kind(self, c: Z3_context, s: Z3_symbol) raises -> SymbolKind
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.
Z3_get_symbol_string¶
def Z3_get_symbol_string(self, c: Z3_context, s: Z3_symbol) raises -> Pointer[Int8, MutUntrackedOrigin]
Return the symbol name.
Z3_get_tuple_sort_field_decl¶
def Z3_get_tuple_sort_field_decl(self, c: Z3_context, t: Z3_sort, i: UInt32) raises -> Z3_func_decl
Return the i-th field declaration (i.e., projection function declaration) of the given tuple sort.
Z3_get_tuple_sort_mk_decl¶
def Z3_get_tuple_sort_mk_decl(self, c: Z3_context, t: Z3_sort) raises -> Z3_func_decl
Return the constructor declaration of the given tuple sort.
Z3_get_tuple_sort_num_fields¶
def Z3_get_tuple_sort_num_fields(self, c: Z3_context, t: Z3_sort) raises -> UInt32
Return the number of fields of the given tuple sort.
Z3_is_algebraic_number¶
def Z3_is_algebraic_number(self, c: Z3_context, a: Z3_ast) raises -> Bool
Return true if the given AST is a real algebraic number.
Z3_is_app¶
def Z3_is_app(self, c: Z3_context, a: Z3_ast) raises -> Bool
Z3_is_eq_ast¶
def Z3_is_eq_ast(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Bool
Compare terms.
Z3_is_eq_func_decl¶
def Z3_is_eq_func_decl(self, c: Z3_context, f1: Z3_func_decl, f2: Z3_func_decl) raises -> Bool
Compare terms.
Z3_is_eq_sort¶
def Z3_is_eq_sort(self, c: Z3_context, s1: Z3_sort, s2: Z3_sort) raises -> Bool
compare sorts.
Z3_is_ground¶
def Z3_is_ground(self, c: Z3_context, a: Z3_ast) raises -> Bool
Z3_is_lambda¶
def Z3_is_lambda(self, c: Z3_context, a: Z3_ast) raises -> Bool
Determine if ast is a lambda expression.
Z3_is_numeral_ast¶
def Z3_is_numeral_ast(self, c: Z3_context, a: Z3_ast) raises -> Bool
Z3_is_quantifier_exists¶
def Z3_is_quantifier_exists(self, c: Z3_context, a: Z3_ast) raises -> Bool
Determine if ast is an existential quantifier.
Z3_is_quantifier_forall¶
def Z3_is_quantifier_forall(self, c: Z3_context, a: Z3_ast) raises -> Bool
Determine if an ast is a universal quantifier.
Z3_is_recursive_datatype_sort¶
def Z3_is_recursive_datatype_sort(self, c: Z3_context, s: Z3_sort) raises -> Bool
Check if s is a recursive datatype sort.
Z3_is_well_sorted¶
def Z3_is_well_sorted(self, c: Z3_context, t: Z3_ast) raises -> Bool
Return true if the given expression t is well sorted.
Z3_mk_atleast¶
def Z3_mk_atleast(self, c: Z3_context, num_args: UInt32, args: Pointer[Z3_ast, _], k: UInt32) raises -> Z3_ast
Pseudo-Boolean relations.
Encode p1 + p2 + ... + pn >= k
Z3_mk_atmost¶
def Z3_mk_atmost(self, c: Z3_context, num_args: UInt32, args: Pointer[Z3_ast, _], k: UInt32) raises -> Z3_ast
Pseudo-Boolean relations.
Encode p1 + p2 + ... + pn <= k
Z3_mk_pbeq¶
def Z3_mk_pbeq(self, c: Z3_context, num_args: UInt32, args: Pointer[Z3_ast, _], coeffs: Pointer[Int32, _], k: Int32) raises -> Z3_ast
Pseudo-Boolean relations.
Encode k1p1 + k2p2 + ... + kn*pn = k
Z3_mk_pbge¶
def Z3_mk_pbge(self, c: Z3_context, num_args: UInt32, args: Pointer[Z3_ast, _], coeffs: Pointer[Int32, _], k: Int32) raises -> Z3_ast
Pseudo-Boolean relations.
Encode k1p1 + k2p2 + ... + kn*pn >= k
Z3_mk_pble¶
def Z3_mk_pble(self, c: Z3_context, num_args: UInt32, args: Pointer[Z3_ast, _], coeffs: Pointer[Int32, _], k: Int32) raises -> Z3_ast
Pseudo-Boolean relations.
Encode k1p1 + k2p2 + ... + kn*pn <= k
Z3_pattern_to_ast¶
def Z3_pattern_to_ast(self, c: Z3_context, p: Z3_pattern) raises -> Z3_ast
Convert a Z3_pattern into Z3_ast. This is just type casting.
Z3_simplify¶
def Z3_simplify(self, c: Z3_context, a: Z3_ast) raises -> Z3_ast
Interface to simplifier.
Provides an interface to the AST simplifier used by Z3. It returns an AST object which is equal to the argument. The returned AST is simplified using algebraic simplification rules, such as constant propagation (propagating true/false over logical connectives).
Z3_simplify_ex¶
def Z3_simplify_ex(self, c: Z3_context, a: Z3_ast, p: Z3_params) raises -> Z3_ast
Interface to simplifier.
Provides an interface to the AST simplifier used by Z3. This procedure is similar to Z3_simplify, but the behavior of the simplifier can be configured using the given parameter set.
Z3_simplify_get_help¶
def Z3_simplify_get_help(self, c: Z3_context) raises -> Pointer[Int8, MutUntrackedOrigin]
Return a string describing all available parameters.
Z3_simplify_get_param_descrs¶
def Z3_simplify_get_param_descrs(self, c: Z3_context) raises -> Z3_param_descrs
Return the parameter description set for the simplify procedure.
Z3_sort_to_ast¶
def Z3_sort_to_ast(self, c: Z3_context, s: Z3_sort) raises -> Z3_ast
Convert a Z3_sort into Z3_ast. This is just type casting.
Z3_to_app¶
def Z3_to_app(self, c: Z3_context, a: Z3_ast) raises -> Z3_app
Convert an ast into an APP_AST. This is just type casting.
Z3_to_func_decl¶
def Z3_to_func_decl(self, c: Z3_context, a: Z3_ast) raises -> Z3_func_decl
Convert an AST into a FUNC_DECL_AST. This is just type casting.
Modifiers (5)¶
Z3_substitute¶
def Z3_substitute(self, c: Z3_context, a: Z3_ast, num_exprs: UInt32, from_: Pointer[Z3_ast, _], to: Pointer[Z3_ast, _]) raises -> Z3_ast
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].
Z3_substitute_funs¶
def Z3_substitute_funs(self, c: Z3_context, a: Z3_ast, num_funs: UInt32, from_: Pointer[Z3_func_decl, _], to: Pointer[Z3_ast, _]) raises -> Z3_ast
Substitute functions in from with new expressions in to.
The expressions in to can have free variables. The free variable in to at index 0 refers to the first argument of from, the free variable at index 1 corresponds to the second argument.
Z3_substitute_vars¶
def Z3_substitute_vars(self, c: Z3_context, a: Z3_ast, num_exprs: UInt32, to: Pointer[Z3_ast, _]) raises -> Z3_ast
Substitute the 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]. Note that a variable is created using the function Z3_mk_bound.
Z3_translate¶
def Z3_translate(self, source: Z3_context, a: Z3_ast, target: Z3_context) raises -> Z3_ast
Translate/Copy the AST a from context source to context target. AST a must have been created using context source.
Z3_update_term¶
def Z3_update_term(self, c: Z3_context, a: Z3_ast, num_args: UInt32, args: Pointer[Z3_ast, _]) raises -> Z3_ast
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.
Models (26)¶
Z3_add_const_interp¶
def Z3_add_const_interp(self, c: Z3_context, m: Z3_model, f: Z3_func_decl, a: Z3_ast) raises
Add a constant interpretation.
Z3_add_func_interp¶
def Z3_add_func_interp(self, c: Z3_context, m: Z3_model, f: Z3_func_decl, default_value: Z3_ast) raises -> Z3_func_interp
Create a fresh func_interp object, add it to a model for a specified function. It has reference count 0.
Z3_func_entry_get_arg¶
def Z3_func_entry_get_arg(self, c: Z3_context, e: Z3_func_entry, i: UInt32) raises -> Z3_ast
Return an argument of a Z3_func_entry object.
Z3_func_entry_get_num_args¶
def Z3_func_entry_get_num_args(self, c: Z3_context, e: Z3_func_entry) raises -> UInt32
Return the number of arguments in a Z3_func_entry object.
Z3_func_entry_get_value¶
def Z3_func_entry_get_value(self, c: Z3_context, e: Z3_func_entry) raises -> Z3_ast
Return the value of this point.
A Z3_func_entry object represents an element in the finite map used to encode a function interpretation.
Z3_func_interp_add_entry¶
def Z3_func_interp_add_entry(self, c: Z3_context, fi: Z3_func_interp, args: Z3_ast_vector, value: Z3_ast) raises
add a function entry to a function interpretation.
It is assumed that entries added to a function cover disjoint arguments. If an two entries are added with the same arguments, only the second insertion survives and the first inserted entry is removed.
Z3_func_interp_get_arity¶
def Z3_func_interp_get_arity(self, c: Z3_context, f: Z3_func_interp) raises -> UInt32
Return the arity (number of arguments) of the given function interpretation.
Z3_func_interp_get_else¶
def Z3_func_interp_get_else(self, c: Z3_context, f: Z3_func_interp) raises -> Z3_ast
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.
Z3_func_interp_get_entry¶
def Z3_func_interp_get_entry(self, c: Z3_context, f: Z3_func_interp, i: UInt32) raises -> Z3_func_entry
Return a "point" of the given function interpretation. It represents the value of f in a particular point.
Z3_func_interp_get_num_entries¶
def Z3_func_interp_get_num_entries(self, c: Z3_context, f: Z3_func_interp) raises -> UInt32
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.
Z3_func_interp_set_else¶
def Z3_func_interp_set_else(self, c: Z3_context, f: Z3_func_interp, else_value: Z3_ast) raises
Return the 'else' value of the given function interpretation.
A function interpretation is represented as a finite map and an 'else' value. This procedure can be used to update the 'else' value.
Z3_get_as_array_func_decl¶
def Z3_get_as_array_func_decl(self, c: Z3_context, a: Z3_ast) raises -> Z3_func_decl
Return the function declaration f associated with a (_ as_array f) node.
Z3_is_as_array¶
def Z3_is_as_array(self, c: Z3_context, a: Z3_ast) raises -> Bool
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 true if the a is an as-array AST node.
Z3 current solvers have minimal support for as_array nodes.
Z3_mk_model¶
def Z3_mk_model(self, c: Z3_context) raises -> Z3_model
Create a fresh model object. It has reference count 0.
Z3_model_eval¶
def Z3_model_eval(self, c: Z3_context, m: Z3_model, t: Z3_ast, model_completion: Bool, v: Pointer[mut=True, Z3_ast, _]) raises -> Bool
Evaluate the AST node t in the given model. Return true if succeeded, and store the result in v.
If model_completion is 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.
If model_completion is false, then Z3 will not assign interpretations to constants for functions that do not have interpretations in m. Evaluation behaves as the identify function in this case.
The evaluation may fail for the following reasons:
-
tcontains a quantifier. -
the model
mis partial, that is, it doesn't have a complete interpretation for uninterpreted functions. That is, the optionMODEL_PARTIAL=truewas used. -
tis type incorrect. -
Z3_interruptwas invoked during evaluation.
Z3_model_get_const_decl¶
def Z3_model_get_const_decl(self, c: Z3_context, m: Z3_model, i: UInt32) raises -> Z3_func_decl
Return the i-th constant in the given model.
Z3_model_get_const_interp¶
def Z3_model_get_const_interp(self, c: Z3_context, m: Z3_model, a: Z3_func_decl) raises -> Z3_ast
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.
Z3_model_get_func_decl¶
def Z3_model_get_func_decl(self, c: Z3_context, m: Z3_model, i: UInt32) raises -> Z3_func_decl
Return the declaration of the i-th function in the given model.
Z3_model_get_func_interp¶
def Z3_model_get_func_interp(self, c: Z3_context, m: Z3_model, f: Z3_func_decl) raises -> Z3_func_interp
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.
Z3_model_get_num_consts¶
def Z3_model_get_num_consts(self, c: Z3_context, m: Z3_model) raises -> UInt32
Return the number of constants assigned by the given model.
Z3_model_get_num_funcs¶
def Z3_model_get_num_funcs(self, c: Z3_context, m: Z3_model) raises -> UInt32
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.
Z3_model_get_num_sorts¶
def Z3_model_get_num_sorts(self, c: Z3_context, m: Z3_model) raises -> UInt32
Return the number of uninterpreted sorts that m assigns an interpretation to.
Z3 also provides an interpretation for uninterpreted sorts used in a formula. The interpretation for a sort s is a finite set of distinct values. We say this finite set is the "universe" of s.
Z3_model_get_sort¶
def Z3_model_get_sort(self, c: Z3_context, m: Z3_model, i: UInt32) raises -> Z3_sort
Return a uninterpreted sort that m assigns an interpretation.
Z3_model_get_sort_universe¶
def Z3_model_get_sort_universe(self, c: Z3_context, m: Z3_model, s: Z3_sort) raises -> Z3_ast_vector
Return the finite set of distinct values that represent the interpretation for sort s.
Z3_model_has_interp¶
def Z3_model_has_interp(self, c: Z3_context, m: Z3_model, a: Z3_func_decl) raises -> Bool
Test if there exists an interpretation (i.e., assignment) for a in the model m.
Z3_model_translate¶
def Z3_model_translate(self, c: Z3_context, m: Z3_model, dst: Z3_context) raises -> Z3_model
translate model from context c to context dst.
Interaction logging (4)¶
Z3_append_log¶
def Z3_append_log(self, string: Pointer[Int8, _])
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.
Z3_close_log¶
def Z3_close_log(self)
Close interaction log.
Z3_open_log¶
def Z3_open_log(self, filename: Pointer[Int8, _]) -> Bool
Log interaction to a file.
Z3_toggle_warning_messages¶
def Z3_toggle_warning_messages(self, enabled: Bool)
Enable/disable printing warning messages to the console.
Warnings are printed after passing true, warning messages are suppressed after calling this method with false.
String conversion (7)¶
Z3_ast_to_string¶
def Z3_ast_to_string(self, c: Z3_context, a: Z3_ast) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert the given AST node into a string.
Z3_benchmark_to_smtlib_string¶
def Z3_benchmark_to_smtlib_string(self, c: Z3_context, name: Pointer[Int8, _], logic: Pointer[Int8, _], status: Pointer[Int8, _], attributes: Pointer[Int8, _], num_assumptions: UInt32, assumptions: Pointer[Z3_ast, _], formula: Z3_ast) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert the given benchmark into SMT-LIB formatted string.
Z3_func_decl_to_string¶
def Z3_func_decl_to_string(self, c: Z3_context, d: Z3_func_decl) raises -> Pointer[Int8, MutUntrackedOrigin]
Z3_model_to_string¶
def Z3_model_to_string(self, c: Z3_context, m: Z3_model) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert the given model into a string.
Z3_pattern_to_string¶
def Z3_pattern_to_string(self, c: Z3_context, p: Z3_pattern) raises -> Pointer[Int8, MutUntrackedOrigin]
Z3_set_ast_print_mode¶
def Z3_set_ast_print_mode(self, c: Z3_context, mode: AstPrintMode) raises
Select mode for the format used for pretty-printing AST nodes.
The default mode for pretty printing AST nodes is to produce SMT-LIB style output where common subexpressions are printed at each occurrence. The mode is called Z3_PRINT_SMTLIB_FULL. To print shared common subexpressions only once, use the Z3_PRINT_LOW_LEVEL mode. To print in way that conforms to SMT-LIB standards and uses let expressions to share common sub-expressions use Z3_PRINT_SMTLIB2_COMPLIANT.
Z3_sort_to_string¶
def Z3_sort_to_string(self, c: Z3_context, s: Z3_sort) raises -> Pointer[Int8, MutUntrackedOrigin]
Parser interface (7)¶
Z3_eval_smtlib2_string¶
def Z3_eval_smtlib2_string(self, c: Z3_context, str: Pointer[Int8, _]) raises -> Pointer[Int8, MutUntrackedOrigin]
Parse and evaluate and SMT-LIB2 command sequence. The state from a previous call is saved so the next evaluation builds on top of the previous call.
Z3_mk_parser_context¶
def Z3_mk_parser_context(self, c: Z3_context) raises -> Z3_parser_context
Create a parser context.
A parser context maintains state between calls to Z3_parser_context_parse_string where the caller can pass in a set of SMTLIB2 commands. It maintains all the declarations from previous calls together with of sorts and function declarations (including 0-ary) that are added directly to the context.
Z3_parse_smtlib2_file¶
def Z3_parse_smtlib2_file(self, c: Z3_context, file_name: Pointer[Int8, _], num_sorts: UInt32, sort_names: Pointer[Z3_symbol, _], sorts: Pointer[Z3_sort, _], num_decls: UInt32, decl_names: Pointer[Z3_symbol, _], decls: Pointer[Z3_func_decl, _]) raises -> Z3_ast_vector
Similar to Z3_parse_smtlib2_string, but reads the benchmark from a file.
Z3_parse_smtlib2_string¶
def Z3_parse_smtlib2_string(self, c: Z3_context, str: Pointer[Int8, _], num_sorts: UInt32, sort_names: Pointer[Z3_symbol, _], sorts: Pointer[Z3_sort, _], num_decls: UInt32, decl_names: Pointer[Z3_symbol, _], decls: Pointer[Z3_func_decl, _]) raises -> Z3_ast_vector
Parse the given string using the SMT-LIB2 parser.
It returns a formula comprising of the conjunction of assertions in the scope (up to push/pop) at the end of the string.
Z3_parser_context_add_decl¶
def Z3_parser_context_add_decl(self, c: Z3_context, pc: Z3_parser_context, f: Z3_func_decl) raises
Add a function declaration.
Z3_parser_context_add_sort¶
def Z3_parser_context_add_sort(self, c: Z3_context, pc: Z3_parser_context, s: Z3_sort) raises
Add a sort declaration.
Z3_parser_context_from_string¶
def Z3_parser_context_from_string(self, c: Z3_context, pc: Z3_parser_context, s: Pointer[Int8, _]) raises -> Z3_ast_vector
Parse a string of SMTLIB2 commands. Return assertions.
Error Handling (3)¶
Z3_get_error_code¶
def Z3_get_error_code(self, c: Z3_context) -> ErrorCode
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.
Z3_get_error_msg¶
def Z3_get_error_msg(self, c: Z3_context, err: ErrorCode) -> Pointer[Int8, MutUntrackedOrigin]
Return a string describing the given error code.
Z3_set_error¶
def Z3_set_error(self, c: Z3_context, e: ErrorCode)
Set an error.
Miscellaneous (6)¶
Z3_disable_trace¶
def Z3_disable_trace(self, tag: Pointer[Int8, _])
Disable tracing messages tagged as tag when Z3 is compiled in debug mode. It is a NOOP otherwise
Z3_enable_trace¶
def Z3_enable_trace(self, tag: Pointer[Int8, _])
Enable tracing messages tagged as tag when Z3 is compiled in debug mode. It is a NOOP otherwise
Z3_finalize_memory¶
def Z3_finalize_memory(self)
Destroy all allocated resources.
Any pointers previously returned by the API become invalid. Can be used for memory leak detection.
Z3_get_full_version¶
def Z3_get_full_version(self) -> Pointer[Int8, MutUntrackedOrigin]
Return a string that fully describes the version of Z3 in use.
Z3_get_version¶
def Z3_get_version(self, major: Pointer[mut=True, UInt32, _], minor: Pointer[mut=True, UInt32, _], build_number: Pointer[mut=True, UInt32, _], revision_number: Pointer[mut=True, UInt32, _])
Return Z3 version number information.
Z3_reset_memory¶
def Z3_reset_memory(self)
Reset all allocated resources.
Use this facility on out-of memory errors. It allows discharging the previous state and resuming afresh. Any pointers previously returned by the API become invalid.
Goals (15)¶
Z3_goal_assert¶
def Z3_goal_assert(self, c: Z3_context, g: Z3_goal, a: Z3_ast) raises
Add a new formula a to the given goal. The formula is split according to the following procedure that is applied until a fixed-point: Conjunctions are split into separate formulas. Negations are distributed over disjunctions, resulting in separate formulas. If the goal is false, adding new formulas is a no-op. If the formula a is true, then nothing is added. If the formula a is false, then the entire goal is replaced by the formula false.
Z3_goal_convert_model¶
def Z3_goal_convert_model(self, c: Z3_context, g: Z3_goal, m: Z3_model) raises -> Z3_model
Convert a model of the formulas of a goal to a model of an original goal. The model may be null, in which case the returned model is valid if the goal was established satisfiable.
When using this feature it is advisable to set the parameter model.compact to false. It is by default true, which erases variables created by the solver from models. Without access to model values for intermediary variables, values of other variables may end up having the wrong values.
Z3_goal_depth¶
def Z3_goal_depth(self, c: Z3_context, g: Z3_goal) raises -> UInt32
Return the depth of the given goal. It tracks how many transformations were applied to it.
Z3_goal_formula¶
def Z3_goal_formula(self, c: Z3_context, g: Z3_goal, idx: UInt32) raises -> Z3_ast
Return a formula from the given goal.
Z3_goal_inconsistent¶
def Z3_goal_inconsistent(self, c: Z3_context, g: Z3_goal) raises -> Bool
Return true if the given goal contains the formula false.
Z3_goal_is_decided_sat¶
def Z3_goal_is_decided_sat(self, c: Z3_context, g: Z3_goal) raises -> Bool
Return true if the goal is empty, and it is precise or the product of a under approximation.
Z3_goal_is_decided_unsat¶
def Z3_goal_is_decided_unsat(self, c: Z3_context, g: Z3_goal) raises -> Bool
Return true if the goal contains false, and it is precise or the product of an over approximation.
Z3_goal_num_exprs¶
def Z3_goal_num_exprs(self, c: Z3_context, g: Z3_goal) raises -> UInt32
Return the number of formulas, subformulas and terms in the given goal.
Z3_goal_precision¶
def Z3_goal_precision(self, c: Z3_context, g: Z3_goal) raises -> GoalPrec
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.
Z3_goal_reset¶
def Z3_goal_reset(self, c: Z3_context, g: Z3_goal) raises
Erase all formulas from the given goal.
Z3_goal_size¶
def Z3_goal_size(self, c: Z3_context, g: Z3_goal) raises -> UInt32
Return the number of formulas in the given goal.
Z3_goal_to_dimacs_string¶
def Z3_goal_to_dimacs_string(self, c: Z3_context, g: Z3_goal, include_names: Bool) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert a goal into a DIMACS formatted string. The goal must be in CNF. You can convert a goal to CNF by applying the tseitin-cnf tactic. Bit-vectors are not automatically converted to Booleans either, so if the caller intends to preserve satisfiability, it should apply bit-blasting tactics. Quantifiers and theory atoms will not be encoded.
Z3_goal_to_string¶
def Z3_goal_to_string(self, c: Z3_context, g: Z3_goal) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert a goal into a string.
Z3_goal_translate¶
def Z3_goal_translate(self, source: Z3_context, g: Z3_goal, target: Z3_context) raises -> Z3_goal
Copy a goal g from the context source to the context target.
Z3_mk_goal¶
def Z3_mk_goal(self, c: Z3_context, models: Bool, unsat_cores: Bool, proofs: Bool) raises -> Z3_goal
Create a goal (aka problem). A goal is essentially a set of formulas, that can be solved and/or transformed using tactics and solvers.
If models is true, then model generation is enabled for the new goal.
If unsat_cores is true, then unsat core generation is enabled for the new goal.
If proofs is true, then proof generation is enabled for the new goal. Remark, the Z3 context c must have been created with proof generation support.
Tactics, Simplifiers and Probes (47)¶
Z3_apply_result_get_num_subgoals¶
def Z3_apply_result_get_num_subgoals(self, c: Z3_context, r: Z3_apply_result) raises -> UInt32
Return the number of subgoals in the Z3_apply_result object returned by Z3_tactic_apply.
Z3_apply_result_get_subgoal¶
def Z3_apply_result_get_subgoal(self, c: Z3_context, r: Z3_apply_result, i: UInt32) raises -> Z3_goal
Return one of the subgoals in the Z3_apply_result object returned by Z3_tactic_apply.
Z3_apply_result_to_string¶
def Z3_apply_result_to_string(self, c: Z3_context, r: Z3_apply_result) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert the Z3_apply_result object returned by Z3_tactic_apply into a string.
Z3_get_num_probes¶
def Z3_get_num_probes(self, c: Z3_context) raises -> UInt32
Return the number of builtin probes available in Z3.
Z3_get_num_simplifiers¶
def Z3_get_num_simplifiers(self, c: Z3_context) raises -> UInt32
Return the number of builtin simplifiers available in Z3.
Z3_get_num_tactics¶
def Z3_get_num_tactics(self, c: Z3_context) raises -> UInt32
Return the number of builtin tactics available in Z3.
Z3_get_probe_name¶
def Z3_get_probe_name(self, c: Z3_context, i: UInt32) raises -> Pointer[Int8, MutUntrackedOrigin]
Return the name of the i probe.
Z3_get_simplifier_name¶
def Z3_get_simplifier_name(self, c: Z3_context, i: UInt32) raises -> Pointer[Int8, MutUntrackedOrigin]
Return the name of the idx simplifier.
Z3_get_tactic_name¶
def Z3_get_tactic_name(self, c: Z3_context, i: UInt32) raises -> Pointer[Int8, MutUntrackedOrigin]
Return the name of the idx tactic.
Z3_mk_probe¶
def Z3_mk_probe(self, c: Z3_context, name: Pointer[Int8, _]) raises -> Z3_probe
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-tactic) in the SMT 2.0 front-end.
Probes are used to inspect a goal (aka problem) and collect information that may be used to decide which solver and/or preprocessing step will be used.
Z3_mk_simplifier¶
def Z3_mk_simplifier(self, c: Z3_context, name: Pointer[Int8, _]) raises -> Z3_simplifier
Return a simplifier associated with the given name. The complete list of simplifiers may be obtained using the procedures Z3_get_num_simplifiers and Z3_get_simplifier_name. It may also be obtained using the command (help-simplifier) in the SMT 2.0 front-end.
Simplifiers are the basic building block for creating custom solvers for specific problem domains.
Z3_mk_tactic¶
def Z3_mk_tactic(self, c: Z3_context, name: Pointer[Int8, _]) raises -> Z3_tactic
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-tactic) in the SMT 2.0 front-end.
Tactics are the basic building block for creating custom solvers for specific problem domains.
Z3_probe_and¶
def Z3_probe_and(self, x: Z3_context, p1: Z3_probe, p2: Z3_probe) raises -> Z3_probe
Return a probe that evaluates to "true" when p1 and p2 evaluates to true.
Z3_probe_apply¶
def Z3_probe_apply(self, c: Z3_context, p: Z3_probe, g: Z3_goal) raises -> Float64
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.
Z3_probe_const¶
def Z3_probe_const(self, x: Z3_context, val: Float64) raises -> Z3_probe
Return a probe that always evaluates to val.
Z3_probe_eq¶
def Z3_probe_eq(self, x: Z3_context, p1: Z3_probe, p2: Z3_probe) raises -> Z3_probe
Return a probe that evaluates to "true" when the value returned by p1 is equal to the value returned by p2.
Z3_probe_ge¶
def Z3_probe_ge(self, x: Z3_context, p1: Z3_probe, p2: Z3_probe) raises -> Z3_probe
Return a probe that evaluates to "true" when the value returned by p1 is greater than or equal to the value returned by p2.
Z3_probe_get_descr¶
def Z3_probe_get_descr(self, c: Z3_context, name: Pointer[Int8, _]) raises -> Pointer[Int8, MutUntrackedOrigin]
Return a string containing a description of the probe with the given name.
Z3_probe_gt¶
def Z3_probe_gt(self, x: Z3_context, p1: Z3_probe, p2: Z3_probe) raises -> Z3_probe
Return a probe that evaluates to "true" when the value returned by p1 is greater than the value returned by p2.
Z3_probe_le¶
def Z3_probe_le(self, x: Z3_context, p1: Z3_probe, p2: Z3_probe) raises -> Z3_probe
Return a probe that evaluates to "true" when the value returned by p1 is less than or equal to the value returned by p2.
Z3_probe_lt¶
def Z3_probe_lt(self, x: Z3_context, p1: Z3_probe, p2: Z3_probe) raises -> Z3_probe
Return a probe that evaluates to "true" when the value returned by p1 is less than the value returned by p2.
Z3_probe_not¶
def Z3_probe_not(self, x: Z3_context, p: Z3_probe) raises -> Z3_probe
Return a probe that evaluates to "true" when p does not evaluate to true.
Z3_probe_or¶
def Z3_probe_or(self, x: Z3_context, p1: Z3_probe, p2: Z3_probe) raises -> Z3_probe
Return a probe that evaluates to "true" when p1 or p2 evaluates to true.
Z3_simplifier_and_then¶
def Z3_simplifier_and_then(self, c: Z3_context, t1: Z3_simplifier, t2: Z3_simplifier) raises -> Z3_simplifier
Return a simplifier that applies t1 to a given goal and t2 to every subgoal produced by t1.
Z3_simplifier_get_descr¶
def Z3_simplifier_get_descr(self, c: Z3_context, name: Pointer[Int8, _]) raises -> Pointer[Int8, MutUntrackedOrigin]
Return a string containing a description of the simplifier with the given name.
Z3_simplifier_get_help¶
def Z3_simplifier_get_help(self, c: Z3_context, t: Z3_simplifier) raises -> Pointer[Int8, MutUntrackedOrigin]
Return a string containing a description of parameters accepted by the given simplifier.
Z3_simplifier_get_param_descrs¶
def Z3_simplifier_get_param_descrs(self, c: Z3_context, t: Z3_simplifier) raises -> Z3_param_descrs
Return the parameter description set for the given simplifier object.
Z3_simplifier_using_params¶
def Z3_simplifier_using_params(self, c: Z3_context, t: Z3_simplifier, p: Z3_params) raises -> Z3_simplifier
Return a simplifier that applies t using the given set of parameters.
Z3_solver_add_simplifier¶
def Z3_solver_add_simplifier(self, c: Z3_context, solver: Z3_solver, simplifier: Z3_simplifier) raises -> Z3_solver
Attach simplifier to a solver. The solver will use the simplifier for incremental pre-processing.
Z3_tactic_and_then¶
def Z3_tactic_and_then(self, c: Z3_context, t1: Z3_tactic, t2: Z3_tactic) raises -> Z3_tactic
Return a tactic that applies t1 to a given goal and t2 to every subgoal produced by t1.
Z3_tactic_apply¶
def Z3_tactic_apply(self, c: Z3_context, t: Z3_tactic, g: Z3_goal) raises -> Z3_apply_result
Apply tactic t to the goal g.
Z3_tactic_apply_ex¶
def Z3_tactic_apply_ex(self, c: Z3_context, t: Z3_tactic, g: Z3_goal, p: Z3_params) raises -> Z3_apply_result
Apply tactic t to the goal g using the parameter set p.
Z3_tactic_cond¶
def Z3_tactic_cond(self, c: Z3_context, p: Z3_probe, t1: Z3_tactic, t2: Z3_tactic) raises -> Z3_tactic
Return a tactic that applies t1 to a given goal if the probe p evaluates to true, and t2 if p evaluates to false.
Z3_tactic_fail¶
def Z3_tactic_fail(self, c: Z3_context) raises -> Z3_tactic
Return a tactic that always fails.
Z3_tactic_fail_if¶
def Z3_tactic_fail_if(self, c: Z3_context, p: Z3_probe) raises -> Z3_tactic
Return a tactic that fails if the probe p evaluates to false.
Z3_tactic_fail_if_not_decided¶
def Z3_tactic_fail_if_not_decided(self, c: Z3_context) raises -> Z3_tactic
Return a tactic that fails if the goal is not trivially satisfiable (i.e., empty) or trivially unsatisfiable (i.e., contains false).
Z3_tactic_get_descr¶
def Z3_tactic_get_descr(self, c: Z3_context, name: Pointer[Int8, _]) raises -> Pointer[Int8, MutUntrackedOrigin]
Return a string containing a description of the tactic with the given name.
Z3_tactic_get_help¶
def Z3_tactic_get_help(self, c: Z3_context, t: Z3_tactic) raises -> Pointer[Int8, MutUntrackedOrigin]
Return a string containing a description of parameters accepted by the given tactic.
Z3_tactic_get_param_descrs¶
def Z3_tactic_get_param_descrs(self, c: Z3_context, t: Z3_tactic) raises -> Z3_param_descrs
Return the parameter description set for the given tactic object.
Z3_tactic_or_else¶
def Z3_tactic_or_else(self, c: Z3_context, t1: Z3_tactic, t2: Z3_tactic) raises -> Z3_tactic
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.
Z3_tactic_par_and_then¶
def Z3_tactic_par_and_then(self, c: Z3_context, t1: Z3_tactic, t2: Z3_tactic) raises -> Z3_tactic
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.
Z3_tactic_par_or¶
def Z3_tactic_par_or(self, c: Z3_context, num: UInt32, ts: Pointer[Z3_tactic, _]) raises -> Z3_tactic
Return a tactic that applies the given tactics in parallel.
Z3_tactic_repeat¶
def Z3_tactic_repeat(self, c: Z3_context, t: Z3_tactic, max: UInt32) raises -> Z3_tactic
Return a tactic that keeps applying t until the goal is not modified anymore or the maximum number of iterations max is reached.
Z3_tactic_skip¶
def Z3_tactic_skip(self, c: Z3_context) raises -> Z3_tactic
Return a tactic that just return the given goal.
Z3_tactic_try_for¶
def Z3_tactic_try_for(self, c: Z3_context, t: Z3_tactic, ms: UInt32) raises -> Z3_tactic
Return a tactic that applies t to a given goal for ms milliseconds. If t does not terminate in ms milliseconds, then it fails.
Z3_tactic_using_params¶
def Z3_tactic_using_params(self, c: Z3_context, t: Z3_tactic, p: Z3_params) raises -> Z3_tactic
Return a tactic that applies t using the given set of parameters.
Z3_tactic_when¶
def Z3_tactic_when(self, c: Z3_context, p: Z3_probe, t: Z3_tactic) raises -> Z3_tactic
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.
Solvers (54)¶
Z3_get_implied_equalities¶
def Z3_get_implied_equalities(self, c: Z3_context, s: Z3_solver, num_terms: UInt32, terms: Pointer[Z3_ast, _], class_ids: Pointer[mut=True, UInt32, _]) raises -> Lbool
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.
Z3_mk_simple_solver¶
def Z3_mk_simple_solver(self, c: Z3_context) raises -> Z3_solver
Create a new incremental solver.
This is equivalent to applying the "smt" tactic.
Unlike Z3_mk_solver() this solver
- Does not attempt to apply any logic specific tactics.
- Does not change its behaviour based on whether it used incrementally/non-incrementally.
Note that these differences can result in very different performance compared to Z3_mk_solver().
The function Z3_solver_get_model retrieves a model if the assertions is satisfiable (i.e., the result is Z3_L_TRUE) and model construction is enabled. The function Z3_solver_get_model can also be used even if the result is Z3_L_UNDEF, but the returned model is not guaranteed to satisfy quantified assertions.
Z3_mk_solver¶
def Z3_mk_solver(self, c: Z3_context) raises -> Z3_solver
Create a new solver. This solver is a "combined solver" (see combined_solver module) that internally uses a non-incremental (solver1) and an incremental solver (solver2). This combined solver changes its behaviour based on how it is used and how its parameters are set.
If the solver is used in a non incremental way (i.e. no calls to Z3_solver_push() or Z3_solver_pop(), and no calls to Z3_solver_assert() or Z3_solver_assert_and_track() after checking satisfiability without an intervening Z3_solver_reset()) then solver1 will be used. This solver will apply Z3's "default" tactic.
The "default" tactic will attempt to probe the logic used by the assertions and will apply a specialized tactic if one is supported. Otherwise the general (and-then simplify smt) tactic will be used.
If the solver is used in an incremental way then the combined solver will switch to using solver2 (which behaves similarly to the general "smt" tactic).
Note however it is possible to set the solver2_timeout, solver2_unknown, and ignore_solver1 parameters of the combined solver to change its behaviour.
The function Z3_solver_get_model retrieves a model if the assertions is satisfiable (i.e., the result is Z3_L_TRUE) and model construction is enabled. The function Z3_solver_get_model can also be used even if the result is Z3_L_UNDEF, but the returned model is not guaranteed to satisfy quantified assertions.
Z3_mk_solver_for_logic¶
def Z3_mk_solver_for_logic(self, c: Z3_context, logic: Z3_symbol) raises -> Z3_solver
Create a new solver customized for the given logic. It behaves like Z3_mk_solver if the logic is unknown or unsupported.
Z3_mk_solver_from_tactic¶
def Z3_mk_solver_from_tactic(self, c: Z3_context, t: Z3_tactic) raises -> Z3_solver
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.
Z3_solver_assert¶
def Z3_solver_assert(self, c: Z3_context, s: Z3_solver, a: Z3_ast) raises
Assert a constraint into the solver.
The functions Z3_solver_check and Z3_solver_check_assumptions should be used to check whether the logical context is consistent or not.
Z3_solver_assert_and_track¶
def Z3_solver_assert_and_track(self, c: Z3_context, s: Z3_solver, a: Z3_ast, p: Z3_ast) raises
Assert a constraint a into the solver, and track it (in the unsat) core using the Boolean constant p.
This API is an alternative to Z3_solver_check_assumptions for extracting unsat cores. Both APIs can be used in the same solver. The unsat core will contain a combination of the Boolean variables provided using Z3_solver_assert_and_track and the Boolean literals provided using Z3_solver_check_assumptions.
Z3_solver_check¶
def Z3_solver_check(self, c: Z3_context, s: Z3_solver) raises -> Lbool
Check whether the assertions in a given solver are consistent or not.
The function Z3_solver_get_model retrieves a model if the assertions is satisfiable (i.e., the result is Z3_L_TRUE) and model construction is enabled. Note that if the call returns Z3_L_UNDEF, Z3 does not ensure that calls to Z3_solver_get_model succeed and any models produced in this case are not guaranteed to satisfy the assertions.
The function Z3_solver_get_proof retrieves a proof if proof generation was enabled when the context was created, and the assertions are unsatisfiable (i.e., the result is Z3_L_FALSE).
Z3_solver_check_assumptions¶
def Z3_solver_check_assumptions(self, c: Z3_context, s: Z3_solver, num_assumptions: UInt32, assumptions: Pointer[Z3_ast, _]) raises -> Lbool
Check whether the assertions in the given solver and optional assumptions are consistent or not.
The function Z3_solver_get_unsat_core retrieves the subset of the assumptions used in the unsatisfiability proof produced by Z3.
Z3_solver_congruence_explain¶
def Z3_solver_congruence_explain(self, c: Z3_context, s: Z3_solver, a: Z3_ast, b: Z3_ast) raises -> Z3_ast
retrieve explanation for congruence.
Z3_solver_congruence_next¶
def Z3_solver_congruence_next(self, c: Z3_context, s: Z3_solver, a: Z3_ast) raises -> Z3_ast
retrieve the next expression in the congruence class. The set of congruent siblings form a cyclic list. Repeated calls on the siblings will result in returning to the original expression.
Z3_solver_congruence_root¶
def Z3_solver_congruence_root(self, c: Z3_context, s: Z3_solver, a: Z3_ast) raises -> Z3_ast
retrieve the congruence closure root of an expression. The root is retrieved relative to the state where the solver was in when it completed. If it completed during a set of case splits, the congruence roots are relative to these case splits. That is, the congruences are not consequences but they are true under the current state.
Z3_solver_cube¶
def Z3_solver_cube(self, c: Z3_context, s: Z3_solver, vars: Z3_ast_vector, backtrack_level: UInt32) raises -> Z3_ast_vector
extract a next cube for a solver. The last cube is the constant true or false. The number of (non-constant) cubes is by default 1. For the sat solver cubing is controlled using parameters sat.lookahead.cube.cutoff and sat.lookahead.cube.fraction.
The third argument is a vector of variables that may be used for cubing. The contents of the vector is only used in the first call. The initial list of variables is used in subsequent calls until it returns the unsatisfiable cube. The vector is modified to contain a set of Autarky variables that occur in clauses that are affected by the (last literal in the) cube. These variables could be used by a different cuber (on a different solver object) for further recursive cubing.
The last argument is a backtracking level. It instructs the cube process to backtrack below the indicated level for the next cube.
Z3_solver_from_file¶
def Z3_solver_from_file(self, c: Z3_context, s: Z3_solver, file_name: Pointer[Int8, _]) raises
load solver assertions from a file.
Z3_solver_from_string¶
def Z3_solver_from_string(self, c: Z3_context, s: Z3_solver, str: Pointer[Int8, _]) raises
load solver assertions from a string.
Z3_solver_get_assertions¶
def Z3_solver_get_assertions(self, c: Z3_context, s: Z3_solver) raises -> Z3_ast_vector
Return the set of asserted formulas on the solver.
Z3_solver_get_consequences¶
def Z3_solver_get_consequences(self, c: Z3_context, s: Z3_solver, assumptions: Z3_ast_vector, variables: Z3_ast_vector, consequences: Z3_ast_vector) raises -> Lbool
retrieve consequences from solver that determine values of the supplied function symbols.
Z3_solver_get_help¶
def Z3_solver_get_help(self, c: Z3_context, s: Z3_solver) raises -> Pointer[Int8, MutUntrackedOrigin]
Return a string describing all solver available parameters.
Z3_solver_get_levels¶
def Z3_solver_get_levels(self, c: Z3_context, s: Z3_solver, literals: Z3_ast_vector, sz: UInt32, levels: Pointer[mut=True, UInt32, _]) raises
retrieve the decision depth of Boolean literals (variables or their negations). Assumes a check-sat call and no other calls (to extract models) have been invoked.
Z3_solver_get_model¶
def Z3_solver_get_model(self, c: Z3_context, s: Z3_solver) raises -> Z3_model
Retrieve the model for the last Z3_solver_check or Z3_solver_check_assumptions
The error handler is invoked if a model is not available because the commands above were not invoked for the given solver, or if the result was Z3_L_FALSE.
Z3_solver_get_non_units¶
def Z3_solver_get_non_units(self, c: Z3_context, s: Z3_solver) raises -> Z3_ast_vector
Return the set of non units in the solver state.
Z3_solver_get_num_scopes¶
def Z3_solver_get_num_scopes(self, c: Z3_context, s: Z3_solver) raises -> UInt32
Return the number of backtracking points.
Z3_solver_get_param_descrs¶
def Z3_solver_get_param_descrs(self, c: Z3_context, s: Z3_solver) raises -> Z3_param_descrs
Return the parameter description set for the given solver object.
Z3_solver_get_proof¶
def Z3_solver_get_proof(self, c: Z3_context, s: Z3_solver) raises -> Z3_ast
Retrieve the proof for the last Z3_solver_check or Z3_solver_check_assumptions
The error handler is invoked if proof generation is not enabled, or if the commands above were not invoked for the given solver, or if the result was different from Z3_L_FALSE.
Z3_solver_get_reason_unknown¶
def Z3_solver_get_reason_unknown(self, c: Z3_context, s: Z3_solver) raises -> Pointer[Int8, MutUntrackedOrigin]
Return a brief justification for an "unknown" result (i.e., Z3_L_UNDEF) for the commands Z3_solver_check and Z3_solver_check_assumptions
Z3_solver_get_statistics¶
def Z3_solver_get_statistics(self, c: Z3_context, s: Z3_solver) raises -> Z3_stats
Return statistics for the given solver.
Z3_solver_get_trail¶
def Z3_solver_get_trail(self, c: Z3_context, s: Z3_solver) raises -> Z3_ast_vector
Return the trail modulo model conversion, in order of decision level The decision level can be retrieved using Z3_solver_get_level based on the trail.
Z3_solver_get_units¶
def Z3_solver_get_units(self, c: Z3_context, s: Z3_solver) raises -> Z3_ast_vector
Return the set of units modulo model conversion.
Z3_solver_get_unsat_core¶
def Z3_solver_get_unsat_core(self, c: Z3_context, s: Z3_solver) raises -> Z3_ast_vector
Retrieve the unsat core for the last Z3_solver_check_assumptions The unsat core is a subset of the assumptions a.
By default, the unsat core will not be minimized. Generation of a minimized unsat core can be enabled via the "sat.core.minimize" and "smt.core.minimize" settings for SAT and SMT cores respectively. Generation of minimized unsat cores will be more expensive.
Z3_solver_import_model_converter¶
def Z3_solver_import_model_converter(self, ctx: Z3_context, src: Z3_solver, dst: Z3_solver) raises
Ad-hoc method for importing model conversion from solver.
This method is used for scenarios where src has been used to solve a set of formulas and was interrupted. The dst solver may be a strengthening of src obtained from cubing (assigning a subset of literals or adding constraints over the assertions available in src). If dst ends up being satisfiable, the model for dst may not correspond to a model of the original formula due to inprocessing in src. This method is used to take the side-effect of inprocessing into account when returning a model for dst.
Z3_solver_interrupt¶
def Z3_solver_interrupt(self, c: Z3_context, s: Z3_solver) raises
Solver local interrupt. Normally you should use Z3_interrupt to cancel solvers because only one solver is enabled concurrently per context. However, per GitHub issue #1006, there are use cases where it is more convenient to cancel a specific solver. Solvers that are not selected for interrupts are left alone.
Z3_solver_next_split¶
def Z3_solver_next_split(self, c: Z3_context, cb: Z3_solver_callback, t: Z3_ast, idx: UInt32, phase: Lbool) raises -> Bool
Sets the next (registered) expression to split on. The function returns false and ignores the given expression in case the expression is already assigned internally (due to relevancy propagation, this assignments might not have been reported yet by the fixed callback). In case the function is called in the decide callback, it overrides the currently selected variable and phase.
Z3_solver_pop¶
def Z3_solver_pop(self, c: Z3_context, s: Z3_solver, n: UInt32) raises
Backtrack n backtracking points.
Z3_solver_propagate_consequence¶
def Z3_solver_propagate_consequence(self, c: Z3_context, cb: Z3_solver_callback, num_fixed: UInt32, fixed: Pointer[Z3_ast, _], num_eqs: UInt32, eq_lhs: Pointer[Z3_ast, _], eq_rhs: Pointer[Z3_ast, _], conseq: Z3_ast) raises -> Bool
propagate a consequence based on fixed values and equalities. A client may invoke it during the propagate_fixed, propagate_eq, propagate_diseq, and propagate_final callbacks. The callback adds a propagation consequence based on the fixed values passed in fixed and equalities between eq_lhs and eq_rhs.
The solver might discard the propagation in case it is true in the current state. The function returns false in this case; otw. the function returns true. At least one propagation in the final callback has to return true in order to prevent the solver from finishing.
Z3_solver_propagate_created¶
def Z3_solver_propagate_created(self, c: Z3_context, s: Z3_solver, created_eh: Ptr) raises
register a callback when a new expression with a registered function is used by the solver The registered function appears at the top level and is created using Z3_solver_propagate_declare.
Z3_solver_propagate_decide¶
def Z3_solver_propagate_decide(self, c: Z3_context, s: Z3_solver, decide_eh: Ptr) raises
register a callback when the solver decides to split on a registered expression. The callback may change the arguments by providing other values by calling Z3_solver_next_split
Z3_solver_propagate_declare¶
def Z3_solver_propagate_declare(self, c: Z3_context, name: Z3_symbol, n: UInt32, domain: Pointer[mut=True, Z3_sort, _], range: Z3_sort) raises -> Z3_func_decl
Create uninterpreted function declaration for the user propagator. When expressions using the function are created by the solver invoke a callback to Z3_solver_propagate_created with arguments
- context and callback solve
- declared_expr: expression using function that was used as the top-level symbol
- declared_id: a unique identifier (unique within the current scope) to track the expression.
Z3_solver_propagate_diseq¶
def Z3_solver_propagate_diseq(self, c: Z3_context, s: Z3_solver, eq_eh: Ptr) raises
register a callback on expression dis-equalities.
Z3_solver_propagate_eq¶
def Z3_solver_propagate_eq(self, c: Z3_context, s: Z3_solver, eq_eh: Ptr) raises
register a callback on expression equalities.
Z3_solver_propagate_final¶
def Z3_solver_propagate_final(self, c: Z3_context, s: Z3_solver, final_eh: Ptr) raises
register a callback on final check. This provides freedom to the propagator to delay actions or implement a branch-and bound solver. The final check is invoked when all decision variables have been assigned by the solver.
The final_eh callback takes as argument the original user_context that was used when calling Z3_solver_propagate_init, and it takes a callback context with the opaque type Z3_solver_callback. The callback context is passed as argument to invoke the Z3_solver_propagate_consequence function. The callback context can only be accessed (for propagation and for dynamically registering expressions) within a callback. If the callback context gets used for propagation or conflicts, those propagations take effect and may trigger new decision variables to be set.
Z3_solver_propagate_fixed¶
def Z3_solver_propagate_fixed(self, c: Z3_context, s: Z3_solver, fixed_eh: Ptr) raises
register a callback for when an expression is bound to a fixed value. The supported expression types are - Booleans - Bit-vectors
Z3_solver_propagate_init¶
def Z3_solver_propagate_init(self, c: Z3_context, s: Z3_solver, user_context: Pointer[mut=True, NoneType, _], push_eh: Ptr, pop_eh: Ptr, fresh_eh: Ptr) raises
register a user-propagator with the solver.
Z3_solver_propagate_on_binding¶
def Z3_solver_propagate_on_binding(self, c: Z3_context, s: Z3_solver, on_binding_eh: Ptr) raises
register a callback when the solver instantiates a quantifier. If the callback returns false, the actual instantiation of the quantifier is blocked. This allows the user propagator selectively prioritize instantiations without relying on default or configured weights.
Z3_solver_propagate_register¶
def Z3_solver_propagate_register(self, c: Z3_context, s: Z3_solver, e: Z3_ast) raises
register an expression to propagate on with the solver. Only expressions of type Bool and type Bit-Vector can be registered for propagation.
Z3_solver_propagate_register_cb¶
def Z3_solver_propagate_register_cb(self, c: Z3_context, cb: Z3_solver_callback, e: Z3_ast) raises
register an expression to propagate on with the solver. Only expressions of type Bool and type Bit-Vector can be registered for propagation. Unlike Z3_solver_propagate_register, this function takes a solver callback context as argument. It can be invoked during a callback to register new expressions.
Z3_solver_push¶
def Z3_solver_push(self, c: Z3_context, s: Z3_solver) raises
Create a backtracking point.
The solver contains a stack of assertions.
Z3_solver_register_on_clause¶
def Z3_solver_register_on_clause(self, c: Z3_context, s: Z3_solver, user_context: Pointer[mut=True, NoneType, _], on_clause_eh: Ptr) raises
register a callback to that retrieves assumed, inferred and deleted clauses during search.
Z3_solver_reset¶
def Z3_solver_reset(self, c: Z3_context, s: Z3_solver) raises
Remove all assertions from the solver.
Z3_solver_set_initial_value¶
def Z3_solver_set_initial_value(self, c: Z3_context, s: Z3_solver, v: Z3_ast, val: Z3_ast) raises
provide an initialization hint to the solver. The initialization hint is used to calibrate an initial value of the expression that represents a variable. If the variable is Boolean, the initial phase is set according to value. If the variable is an integer or real, the initial Simplex tableau is recalibrated to attempt to follow the value assignment.
Z3_solver_set_params¶
def Z3_solver_set_params(self, c: Z3_context, s: Z3_solver, p: Z3_params) raises
Set the given solver using the given parameters.
Z3_solver_solve_for¶
def Z3_solver_solve_for(self, c: Z3_context, s: Z3_solver, variables: Z3_ast_vector, terms: Z3_ast_vector, guards: Z3_ast_vector) raises
retrieve a 'solution' for variables as defined by equalities in maintained by solvers. At this point, only linear solution are supported. The solution to variables may be presented in triangular form, such that variables used in solutions themselves have solutions.
Z3_solver_to_dimacs_string¶
def Z3_solver_to_dimacs_string(self, c: Z3_context, s: Z3_solver, include_names: Bool) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert a solver into a DIMACS formatted string.
Z3_solver_to_string¶
def Z3_solver_to_string(self, c: Z3_context, s: Z3_solver) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert a solver into a string.
Z3_solver_translate¶
def Z3_solver_translate(self, source: Z3_context, s: Z3_solver, target: Z3_context) raises -> Z3_solver
Copy a solver s from the context source to the context target.
Statistics (8)¶
Z3_get_estimated_alloc_size¶
def Z3_get_estimated_alloc_size(self) -> UInt64
Return the estimated allocated memory in bytes.
Z3_stats_get_double_value¶
def Z3_stats_get_double_value(self, c: Z3_context, s: Z3_stats, idx: UInt32) raises -> Float64
Return the double value of the given statistical data.
Z3_stats_get_key¶
def Z3_stats_get_key(self, c: Z3_context, s: Z3_stats, idx: UInt32) raises -> Pointer[Int8, MutUntrackedOrigin]
Return the key (a string) for a particular statistical data.
Z3_stats_get_uint_value¶
def Z3_stats_get_uint_value(self, c: Z3_context, s: Z3_stats, idx: UInt32) raises -> UInt32
Return the unsigned value of the given statistical data.
Z3_stats_is_double¶
def Z3_stats_is_double(self, c: Z3_context, s: Z3_stats, idx: UInt32) raises -> Bool
Return true if the given statistical data is a double.
Z3_stats_is_uint¶
def Z3_stats_is_uint(self, c: Z3_context, s: Z3_stats, idx: UInt32) raises -> Bool
Return true if the given statistical data is a unsigned integer.
Z3_stats_size¶
def Z3_stats_size(self, c: Z3_context, s: Z3_stats) raises -> UInt32
Return the number of statistical data in s.
Z3_stats_to_string¶
def Z3_stats_to_string(self, c: Z3_context, s: Z3_stats) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert a statistics into a string.
Lifecycle & refcounting (31 functions — handled automatically by RAII)
| C Function | Mojo CApi Signature |
|---|---|
Z3_apply_result_dec_ref |
def Z3_apply_result_dec_ref(self, c: Z3_context, r: Z3_apply_result) |
Z3_apply_result_inc_ref |
def Z3_apply_result_inc_ref(self, c: Z3_context, r: Z3_apply_result) raises |
Z3_del_config |
def Z3_del_config(self, c: Z3_config) |
Z3_del_constructor |
def Z3_del_constructor(self, c: Z3_context, constr: Z3_constructor) |
Z3_del_constructor_list |
def Z3_del_constructor_list(self, c: Z3_context, clist: Z3_constructor_list) |
Z3_del_context |
def Z3_del_context(self, c: Z3_context) |
Z3_func_entry_dec_ref |
def Z3_func_entry_dec_ref(self, c: Z3_context, e: Z3_func_entry) |
Z3_func_entry_inc_ref |
def Z3_func_entry_inc_ref(self, c: Z3_context, e: Z3_func_entry) raises |
Z3_func_interp_dec_ref |
def Z3_func_interp_dec_ref(self, c: Z3_context, f: Z3_func_interp) |
Z3_func_interp_inc_ref |
def Z3_func_interp_inc_ref(self, c: Z3_context, f: Z3_func_interp) raises |
Z3_goal_dec_ref |
def Z3_goal_dec_ref(self, c: Z3_context, g: Z3_goal) |
Z3_goal_inc_ref |
def Z3_goal_inc_ref(self, c: Z3_context, g: Z3_goal) raises |
Z3_model_dec_ref |
def Z3_model_dec_ref(self, c: Z3_context, m: Z3_model) |
Z3_model_inc_ref |
def Z3_model_inc_ref(self, c: Z3_context, m: Z3_model) raises |
Z3_param_descrs_dec_ref |
def Z3_param_descrs_dec_ref(self, c: Z3_context, p: Z3_param_descrs) |
Z3_param_descrs_inc_ref |
def Z3_param_descrs_inc_ref(self, c: Z3_context, p: Z3_param_descrs) raises |
Z3_params_dec_ref |
def Z3_params_dec_ref(self, c: Z3_context, p: Z3_params) |
Z3_params_inc_ref |
def Z3_params_inc_ref(self, c: Z3_context, p: Z3_params) raises |
Z3_parser_context_dec_ref |
def Z3_parser_context_dec_ref(self, c: Z3_context, pc: Z3_parser_context) |
Z3_parser_context_inc_ref |
def Z3_parser_context_inc_ref(self, c: Z3_context, pc: Z3_parser_context) raises |
Z3_probe_dec_ref |
def Z3_probe_dec_ref(self, c: Z3_context, p: Z3_probe) |
Z3_probe_inc_ref |
def Z3_probe_inc_ref(self, c: Z3_context, p: Z3_probe) raises |
Z3_set_error_handler |
def Z3_set_error_handler(self, c: Z3_context, h: Ptr) |
Z3_simplifier_dec_ref |
def Z3_simplifier_dec_ref(self, c: Z3_context, g: Z3_simplifier) |
Z3_simplifier_inc_ref |
def Z3_simplifier_inc_ref(self, c: Z3_context, t: Z3_simplifier) raises |
Z3_solver_dec_ref |
def Z3_solver_dec_ref(self, c: Z3_context, s: Z3_solver) |
Z3_solver_inc_ref |
def Z3_solver_inc_ref(self, c: Z3_context, s: Z3_solver) raises |
Z3_stats_dec_ref |
def Z3_stats_dec_ref(self, c: Z3_context, s: Z3_stats) |
Z3_stats_inc_ref |
def Z3_stats_inc_ref(self, c: Z3_context, s: Z3_stats) raises |
Z3_tactic_dec_ref |
def Z3_tactic_dec_ref(self, c: Z3_context, g: Z3_tactic) |
Z3_tactic_inc_ref |
def Z3_tactic_inc_ref(self, c: Z3_context, t: Z3_tactic) raises |
z3_algebraic.h (21 functions)¶
Algebraic Numbers (21)¶
Z3_algebraic_add¶
def Z3_algebraic_add(self, c: Z3_context, a: Z3_ast, b: Z3_ast) raises -> Z3_ast
Return the value a + b.
Z3_algebraic_div¶
def Z3_algebraic_div(self, c: Z3_context, a: Z3_ast, b: Z3_ast) raises -> Z3_ast
Return the value a / b.
Z3_algebraic_eq¶
def Z3_algebraic_eq(self, c: Z3_context, a: Z3_ast, b: Z3_ast) raises -> Bool
Return true if a == b, and false otherwise.
Z3_algebraic_eval¶
def Z3_algebraic_eval(self, c: Z3_context, p: Z3_ast, n: UInt32, a: Pointer[mut=True, Z3_ast, _]) raises -> Int32
Given a multivariate polynomial p(x_0, ..., x_{n-1}), return the sign of p(a[0], ..., a[n-1]).
Z3_algebraic_ge¶
def Z3_algebraic_ge(self, c: Z3_context, a: Z3_ast, b: Z3_ast) raises -> Bool
Return true if a >= b, and false otherwise.
Z3_algebraic_get_i¶
def Z3_algebraic_get_i(self, c: Z3_context, a: Z3_ast) raises -> UInt32
Return which root of the polynomial the algebraic number represents.
Z3_algebraic_get_poly¶
def Z3_algebraic_get_poly(self, c: Z3_context, a: Z3_ast) raises -> Z3_ast_vector
Return the coefficients of the defining polynomial.
Z3_algebraic_gt¶
def Z3_algebraic_gt(self, c: Z3_context, a: Z3_ast, b: Z3_ast) raises -> Bool
Return true if a > b, and false otherwise.
Z3_algebraic_is_neg¶
def Z3_algebraic_is_neg(self, c: Z3_context, a: Z3_ast) raises -> Bool
Return true if a is negative, and false otherwise.
Z3_algebraic_is_pos¶
def Z3_algebraic_is_pos(self, c: Z3_context, a: Z3_ast) raises -> Bool
Return true if a is positive, and false otherwise.
Z3_algebraic_is_value¶
def Z3_algebraic_is_value(self, c: Z3_context, a: Z3_ast) raises -> Bool
Return true if a can be used as value in the Z3 real algebraic number package.
Z3_algebraic_is_zero¶
def Z3_algebraic_is_zero(self, c: Z3_context, a: Z3_ast) raises -> Bool
Return true if a is zero, and false otherwise.
Z3_algebraic_le¶
def Z3_algebraic_le(self, c: Z3_context, a: Z3_ast, b: Z3_ast) raises -> Bool
Return true if a <= b, and false otherwise.
Z3_algebraic_lt¶
def Z3_algebraic_lt(self, c: Z3_context, a: Z3_ast, b: Z3_ast) raises -> Bool
Return true if a < b, and false otherwise.
Z3_algebraic_mul¶
def Z3_algebraic_mul(self, c: Z3_context, a: Z3_ast, b: Z3_ast) raises -> Z3_ast
Return the value a * b.
Z3_algebraic_neq¶
def Z3_algebraic_neq(self, c: Z3_context, a: Z3_ast, b: Z3_ast) raises -> Bool
Return true if a != b, and false otherwise.
Z3_algebraic_power¶
def Z3_algebraic_power(self, c: Z3_context, a: Z3_ast, k: UInt32) raises -> Z3_ast
Return the a^k
Z3_algebraic_root¶
def Z3_algebraic_root(self, c: Z3_context, a: Z3_ast, k: UInt32) raises -> Z3_ast
Return the a^(1/k)
Z3_algebraic_roots¶
def Z3_algebraic_roots(self, c: Z3_context, p: Z3_ast, n: UInt32, a: Pointer[mut=True, Z3_ast, _]) raises -> Z3_ast_vector
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).
Z3_algebraic_sign¶
def Z3_algebraic_sign(self, c: Z3_context, a: Z3_ast) raises -> Int32
Return 1 if a is positive, 0 if a is zero, and -1 if a is negative.
Z3_algebraic_sub¶
def Z3_algebraic_sub(self, c: Z3_context, a: Z3_ast, b: Z3_ast) raises -> Z3_ast
Return the value a - b.
z3_ast_containers.h (21 functions)¶
AST vectors (8)¶
Z3_ast_vector_get¶
def Z3_ast_vector_get(self, c: Z3_context, v: Z3_ast_vector, i: UInt32) raises -> Z3_ast
Return the AST at position i in the AST vector v.
Z3_ast_vector_push¶
def Z3_ast_vector_push(self, c: Z3_context, v: Z3_ast_vector, a: Z3_ast) raises
Add the AST a in the end of the AST vector v. The size of v is increased by one.
Z3_ast_vector_resize¶
def Z3_ast_vector_resize(self, c: Z3_context, v: Z3_ast_vector, n: UInt32) raises
Resize the AST vector v.
Z3_ast_vector_set¶
def Z3_ast_vector_set(self, c: Z3_context, v: Z3_ast_vector, i: UInt32, a: Z3_ast) raises
Update position i of the AST vector v with the AST a.
Z3_ast_vector_size¶
def Z3_ast_vector_size(self, c: Z3_context, v: Z3_ast_vector) raises -> UInt32
Return the size of the given AST vector.
Z3_ast_vector_to_string¶
def Z3_ast_vector_to_string(self, c: Z3_context, v: Z3_ast_vector) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert AST vector into a string.
Z3_ast_vector_translate¶
def Z3_ast_vector_translate(self, s: Z3_context, v: Z3_ast_vector, t: Z3_context) raises -> Z3_ast_vector
Translate the AST vector v from context s into an AST vector in context t.
Z3_mk_ast_vector¶
def Z3_mk_ast_vector(self, c: Z3_context) raises -> Z3_ast_vector
Return an empty AST vector.
AST maps (9)¶
Z3_ast_map_contains¶
def Z3_ast_map_contains(self, c: Z3_context, m: Z3_ast_map, k: Z3_ast) raises -> Bool
Return true if the map m contains the AST key k.
Z3_ast_map_erase¶
def Z3_ast_map_erase(self, c: Z3_context, m: Z3_ast_map, k: Z3_ast) raises
Erase a key from the map.
Z3_ast_map_find¶
def Z3_ast_map_find(self, c: Z3_context, m: Z3_ast_map, k: Z3_ast) raises -> Z3_ast
Return the value associated with the key k.
The procedure invokes the error handler if k is not in the map.
Z3_ast_map_insert¶
def Z3_ast_map_insert(self, c: Z3_context, m: Z3_ast_map, k: Z3_ast, v: Z3_ast) raises
Store/Replace a new key, value pair in the given map.
Z3_ast_map_keys¶
def Z3_ast_map_keys(self, c: Z3_context, m: Z3_ast_map) raises -> Z3_ast_vector
Return the keys stored in the given map.
Z3_ast_map_reset¶
def Z3_ast_map_reset(self, c: Z3_context, m: Z3_ast_map) raises
Remove all keys from the given map.
Z3_ast_map_size¶
def Z3_ast_map_size(self, c: Z3_context, m: Z3_ast_map) raises -> UInt32
Return the size of the given map.
Z3_ast_map_to_string¶
def Z3_ast_map_to_string(self, c: Z3_context, m: Z3_ast_map) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert the given map into a string.
Z3_mk_ast_map¶
def Z3_mk_ast_map(self, c: Z3_context) raises -> Z3_ast_map
Return an empty mapping from AST to AST
Lifecycle & refcounting (4 functions — handled automatically by RAII)
| C Function | Mojo CApi Signature |
|---|---|
Z3_ast_map_dec_ref |
def Z3_ast_map_dec_ref(self, c: Z3_context, m: Z3_ast_map) |
Z3_ast_map_inc_ref |
def Z3_ast_map_inc_ref(self, c: Z3_context, m: Z3_ast_map) raises |
Z3_ast_vector_dec_ref |
def Z3_ast_vector_dec_ref(self, c: Z3_context, v: Z3_ast_vector) |
Z3_ast_vector_inc_ref |
def Z3_ast_vector_inc_ref(self, c: Z3_context, v: Z3_ast_vector) raises |
z3_fixedpoint.h (30 functions)¶
Fixedpoint facilities (28)¶
Z3_fixedpoint_add_callback¶
def Z3_fixedpoint_add_callback(self, ctx: Z3_context, f: Z3_fixedpoint, state: Pointer[mut=True, NoneType, _], new_lemma_eh: Ptr, predecessor_eh: Ptr, unfold_eh: Ptr) raises
set export callback for lemmas
Z3_fixedpoint_add_constraint¶
def Z3_fixedpoint_add_constraint(self, c: Z3_context, d: Z3_fixedpoint, e: Z3_ast, lvl: UInt32) raises
Z3_fixedpoint_add_cover¶
def Z3_fixedpoint_add_cover(self, c: Z3_context, d: Z3_fixedpoint, level: Int32, pred: Z3_func_decl, property: Z3_ast) raises
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.
Z3_fixedpoint_add_fact¶
def Z3_fixedpoint_add_fact(self, c: Z3_context, d: Z3_fixedpoint, r: Z3_func_decl, num_args: UInt32, args: Pointer[mut=True, UInt32, _]) raises
Add a Database fact.
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.
Z3_fixedpoint_add_rule¶
def Z3_fixedpoint_add_rule(self, c: Z3_context, d: Z3_fixedpoint, rule: Z3_ast, name: Z3_symbol) raises
Add a universal Horn clause as a named rule. The horn_rule should be of the form:
horn_rule ::= (forall (bound-vars) horn_rule)
| (=> atoms horn_rule)
| atom
Z3_fixedpoint_assert¶
def Z3_fixedpoint_assert(self, c: Z3_context, d: Z3_fixedpoint, axiom: Z3_ast) raises
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.
Z3_fixedpoint_from_file¶
def Z3_fixedpoint_from_file(self, c: Z3_context, f: Z3_fixedpoint, s: Pointer[Int8, _]) raises -> Z3_ast_vector
Parse an SMT-LIB2 file with fixedpoint rules. Add the rules to the current fixedpoint context. Return the set of queries in the file.
Z3_fixedpoint_from_string¶
def Z3_fixedpoint_from_string(self, c: Z3_context, f: Z3_fixedpoint, s: Pointer[Int8, _]) raises -> Z3_ast_vector
Parse an SMT-LIB2 string with fixedpoint rules. Add the rules to the current fixedpoint context. Return the set of queries in the string.
Z3_fixedpoint_get_answer¶
def Z3_fixedpoint_get_answer(self, c: Z3_context, d: Z3_fixedpoint) raises -> Z3_ast
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.
Z3_fixedpoint_get_assertions¶
def Z3_fixedpoint_get_assertions(self, c: Z3_context, f: Z3_fixedpoint) raises -> Z3_ast_vector
Retrieve set of background assertions from fixedpoint context.
Z3_fixedpoint_get_cover_delta¶
def Z3_fixedpoint_get_cover_delta(self, c: Z3_context, d: Z3_fixedpoint, level: Int32, pred: Z3_func_decl) raises -> Z3_ast
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.
Z3_fixedpoint_get_help¶
def Z3_fixedpoint_get_help(self, c: Z3_context, f: Z3_fixedpoint) raises -> Pointer[Int8, MutUntrackedOrigin]
Return a string describing all fixedpoint available parameters.
Z3_fixedpoint_get_num_levels¶
def Z3_fixedpoint_get_num_levels(self, c: Z3_context, d: Z3_fixedpoint, pred: Z3_func_decl) raises -> UInt32
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.
Z3_fixedpoint_get_param_descrs¶
def Z3_fixedpoint_get_param_descrs(self, c: Z3_context, f: Z3_fixedpoint) raises -> Z3_param_descrs
Return the parameter description set for the given fixedpoint object.
Z3_fixedpoint_get_reason_unknown¶
def Z3_fixedpoint_get_reason_unknown(self, c: Z3_context, d: Z3_fixedpoint) raises -> Pointer[Int8, MutUntrackedOrigin]
Retrieve a string that describes the last status returned by Z3_fixedpoint_query.
Use this method when Z3_fixedpoint_query returns Z3_L_UNDEF.
Z3_fixedpoint_get_rules¶
def Z3_fixedpoint_get_rules(self, c: Z3_context, f: Z3_fixedpoint) raises -> Z3_ast_vector
Retrieve set of rules from fixedpoint context.
Z3_fixedpoint_get_statistics¶
def Z3_fixedpoint_get_statistics(self, c: Z3_context, d: Z3_fixedpoint) raises -> Z3_stats
Retrieve statistics information from the last call to Z3_fixedpoint_query.
Z3_fixedpoint_init¶
def Z3_fixedpoint_init(self, c: Z3_context, d: Z3_fixedpoint, state: Pointer[mut=True, NoneType, _]) raises
Initialize the context with a user-defined state.
Z3_fixedpoint_query¶
def Z3_fixedpoint_query(self, c: Z3_context, d: Z3_fixedpoint, query: Z3_ast) raises -> Lbool
Pose a query against the asserted rules.
query ::= (exists (bound-vars) query)
| literals
query returns
Z3_L_FALSEif the query is unsatisfiable.Z3_L_TRUEif the query is satisfiable. Obtain the answer by callingZ3_fixedpoint_get_answer.Z3_L_UNDEFif the query was interrupted, timed out or otherwise failed.
Z3_fixedpoint_query_relations¶
def Z3_fixedpoint_query_relations(self, c: Z3_context, d: Z3_fixedpoint, num_relations: UInt32, relations: Pointer[Z3_func_decl, _]) raises -> Lbool
Pose multiple queries against the asserted rules.
The queries are encoded as relations (function declarations).
query returns
Z3_L_FALSEif the query is unsatisfiable.Z3_L_TRUEif the query is satisfiable. Obtain the answer by callingZ3_fixedpoint_get_answer.Z3_L_UNDEFif the query was interrupted, timed out or otherwise failed.
Z3_fixedpoint_register_relation¶
def Z3_fixedpoint_register_relation(self, c: Z3_context, d: Z3_fixedpoint, f: Z3_func_decl) raises
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.
Z3_fixedpoint_set_params¶
def Z3_fixedpoint_set_params(self, c: Z3_context, f: Z3_fixedpoint, p: Z3_params) raises
Set parameters on fixedpoint context.
Z3_fixedpoint_set_predicate_representation¶
def Z3_fixedpoint_set_predicate_representation(self, c: Z3_context, d: Z3_fixedpoint, f: Z3_func_decl, num_relations: UInt32, relation_kinds: Pointer[Z3_symbol, _]) raises
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.
Z3_fixedpoint_set_reduce_app_callback¶
def Z3_fixedpoint_set_reduce_app_callback(self, c: Z3_context, d: Z3_fixedpoint, cb: Ptr) raises
Register a callback for building terms based on the relational operators.
Z3_fixedpoint_set_reduce_assign_callback¶
def Z3_fixedpoint_set_reduce_assign_callback(self, c: Z3_context, d: Z3_fixedpoint, cb: Ptr) raises
Register a callback to destructive updates.
Registers are identified with terms encoded as fresh constants,
Z3_fixedpoint_to_string¶
def Z3_fixedpoint_to_string(self, c: Z3_context, f: Z3_fixedpoint, num_queries: UInt32, queries: Pointer[mut=True, Z3_ast, _]) raises -> Pointer[Int8, MutUntrackedOrigin]
Print the current rules and background axioms as a string.
Z3_fixedpoint_update_rule¶
def Z3_fixedpoint_update_rule(self, c: Z3_context, d: Z3_fixedpoint, a: Z3_ast, name: Z3_symbol) raises
Update a named rule. A rule with the same name must have been previously created.
Z3_mk_fixedpoint¶
def Z3_mk_fixedpoint(self, c: Z3_context) raises -> Z3_fixedpoint
Create a new fixedpoint context.
Lifecycle & refcounting (2 functions — handled automatically by RAII)
| C Function | Mojo CApi Signature |
|---|---|
Z3_fixedpoint_dec_ref |
def Z3_fixedpoint_dec_ref(self, c: Z3_context, d: Z3_fixedpoint) |
Z3_fixedpoint_inc_ref |
def Z3_fixedpoint_inc_ref(self, c: Z3_context, d: Z3_fixedpoint) raises |
z3_fpa.h (81 functions)¶
Floating-Point Arithmetic (61)¶
Z3_mk_fpa_abs¶
def Z3_mk_fpa_abs(self, c: Z3_context, t: Z3_ast) raises -> Z3_ast
Floating-point absolute value
Z3_mk_fpa_add¶
def Z3_mk_fpa_add(self, c: Z3_context, rm: Z3_ast, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Floating-point addition
rm must be of RoundingMode sort, t1 and t2 must have the same FloatingPoint sort.
Z3_mk_fpa_div¶
def Z3_mk_fpa_div(self, c: Z3_context, rm: Z3_ast, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Floating-point division
The nodes rm must be of RoundingMode sort, t1 and t2 must have the same FloatingPoint sort.
Z3_mk_fpa_eq¶
def Z3_mk_fpa_eq(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Floating-point equality.
Note that this is IEEE 754 equality (as opposed to SMT-LIB =).
t1 and t2 must have the same FloatingPoint sort.
Z3_mk_fpa_fma¶
def Z3_mk_fpa_fma(self, c: Z3_context, rm: Z3_ast, t1: Z3_ast, t2: Z3_ast, t3: Z3_ast) raises -> Z3_ast
Floating-point fused multiply-add.
The result is round((t1 * t2) + t3).
rm must be of RoundingMode sort, t1, t2, and t3 must have the same FloatingPoint sort.
Z3_mk_fpa_fp¶
def Z3_mk_fpa_fp(self, c: Z3_context, sgn: Z3_ast, exp: Z3_ast, sig: Z3_ast) raises -> Z3_ast
Create an expression of FloatingPoint sort from three bit-vector expressions.
This is the operator named fp' in the SMT FP theory definition. Note thatsgn` is required to be a bit-vector of size 1. Significand and exponent are required to be longer than 1 and 2 respectively. The FloatingPoint sort of the resulting expression is automatically determined from the bit-vector sizes of the arguments. The exponent is assumed to be in IEEE-754 biased representation.
Z3_mk_fpa_geq¶
def Z3_mk_fpa_geq(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Floating-point greater than or equal.
t1 and t2 must have the same FloatingPoint sort.
Z3_mk_fpa_gt¶
def Z3_mk_fpa_gt(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Floating-point greater than.
t1 and t2 must have the same FloatingPoint sort.
Z3_mk_fpa_inf¶
def Z3_mk_fpa_inf(self, c: Z3_context, s: Z3_sort, negative: Bool) raises -> Z3_ast
Create a floating-point infinity of sort s.
When negative is true, -oo will be generated instead of +oo.
Z3_mk_fpa_is_infinite¶
def Z3_mk_fpa_is_infinite(self, c: Z3_context, t: Z3_ast) raises -> Z3_ast
Predicate indicating whether t is a floating-point number representing +oo or -oo.
t must have FloatingPoint sort.
Z3_mk_fpa_is_nan¶
def Z3_mk_fpa_is_nan(self, c: Z3_context, t: Z3_ast) raises -> Z3_ast
Predicate indicating whether t is a NaN.
t must have FloatingPoint sort.
Z3_mk_fpa_is_negative¶
def Z3_mk_fpa_is_negative(self, c: Z3_context, t: Z3_ast) raises -> Z3_ast
Predicate indicating whether t is a negative floating-point number.
t must have FloatingPoint sort.
Z3_mk_fpa_is_normal¶
def Z3_mk_fpa_is_normal(self, c: Z3_context, t: Z3_ast) raises -> Z3_ast
Predicate indicating whether t is a normal floating-point number.
t must have FloatingPoint sort.
Z3_mk_fpa_is_positive¶
def Z3_mk_fpa_is_positive(self, c: Z3_context, t: Z3_ast) raises -> Z3_ast
Predicate indicating whether t is a positive floating-point number.
t must have FloatingPoint sort.
Z3_mk_fpa_is_subnormal¶
def Z3_mk_fpa_is_subnormal(self, c: Z3_context, t: Z3_ast) raises -> Z3_ast
Predicate indicating whether t is a subnormal floating-point number.
t must have FloatingPoint sort.
Z3_mk_fpa_is_zero¶
def Z3_mk_fpa_is_zero(self, c: Z3_context, t: Z3_ast) raises -> Z3_ast
Predicate indicating whether t is a floating-point number with zero value, i.e., +zero or -zero.
t must have FloatingPoint sort.
Z3_mk_fpa_leq¶
def Z3_mk_fpa_leq(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Floating-point less than or equal.
t1 and t2 must have the same FloatingPoint sort.
Z3_mk_fpa_lt¶
def Z3_mk_fpa_lt(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Floating-point less than.
t1 and t2 must have the same FloatingPoint sort.
Z3_mk_fpa_max¶
def Z3_mk_fpa_max(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Maximum of floating-point numbers.
t1, t2 must have the same FloatingPoint sort.
Z3_mk_fpa_min¶
def Z3_mk_fpa_min(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Minimum of floating-point numbers.
t1, t2 must have the same FloatingPoint sort.
Z3_mk_fpa_mul¶
def Z3_mk_fpa_mul(self, c: Z3_context, rm: Z3_ast, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Floating-point multiplication
rm must be of RoundingMode sort, t1 and t2 must have the same FloatingPoint sort.
Z3_mk_fpa_nan¶
def Z3_mk_fpa_nan(self, c: Z3_context, s: Z3_sort) raises -> Z3_ast
Create a floating-point NaN of sort s.
Z3_mk_fpa_neg¶
def Z3_mk_fpa_neg(self, c: Z3_context, t: Z3_ast) raises -> Z3_ast
Floating-point negation
Z3_mk_fpa_numeral_double¶
def Z3_mk_fpa_numeral_double(self, c: Z3_context, v: Float64, ty: Z3_sort) raises -> Z3_ast
Create a numeral of FloatingPoint sort from a double.
This function is used to create numerals that fit in a double value. It is slightly faster than Z3_mk_numeral since it is not necessary to parse a string.
ty must be a FloatingPoint sort
Z3_mk_fpa_numeral_float¶
def Z3_mk_fpa_numeral_float(self, c: Z3_context, v: Float32, ty: Z3_sort) raises -> Z3_ast
Create a numeral of FloatingPoint sort from a float.
This function is used to create numerals that fit in a float value. It is slightly faster than Z3_mk_numeral since it is not necessary to parse a string.
ty must be a FloatingPoint sort
Z3_mk_fpa_numeral_int¶
def Z3_mk_fpa_numeral_int(self, c: Z3_context, v: Int32, ty: Z3_sort) raises -> Z3_ast
Create a numeral of FloatingPoint sort from a signed integer.
ty must be a FloatingPoint sort
Z3_mk_fpa_numeral_int64_uint64¶
def Z3_mk_fpa_numeral_int64_uint64(self, c: Z3_context, sgn: Bool, exp: Int64, sig: UInt64, ty: Z3_sort) raises -> Z3_ast
Create a numeral of FloatingPoint sort from a sign bit and two 64-bit integers.
ty must be a FloatingPoint sort
Z3_mk_fpa_numeral_int_uint¶
def Z3_mk_fpa_numeral_int_uint(self, c: Z3_context, sgn: Bool, exp: Int32, sig: UInt32, ty: Z3_sort) raises -> Z3_ast
Create a numeral of FloatingPoint sort from a sign bit and two integers.
ty must be a FloatingPoint sort
Z3_mk_fpa_rem¶
def Z3_mk_fpa_rem(self, c: Z3_context, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Floating-point remainder
t1 and t2 must have the same FloatingPoint sort.
Z3_mk_fpa_rna¶
def Z3_mk_fpa_rna(self, c: Z3_context) raises -> Z3_ast
Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.
This is the same as Z3_mk_fpa_round_nearest_ties_to_away.
Z3_mk_fpa_rne¶
def Z3_mk_fpa_rne(self, c: Z3_context) raises -> Z3_ast
Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.
This is the same as Z3_mk_fpa_round_nearest_ties_to_even.
Z3_mk_fpa_round_nearest_ties_to_away¶
def Z3_mk_fpa_round_nearest_ties_to_away(self, c: Z3_context) raises -> Z3_ast
Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.
This is the same as Z3_mk_fpa_rna.
Z3_mk_fpa_round_nearest_ties_to_even¶
def Z3_mk_fpa_round_nearest_ties_to_even(self, c: Z3_context) raises -> Z3_ast
Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.
This is the same as Z3_mk_fpa_rne.
Z3_mk_fpa_round_to_integral¶
def Z3_mk_fpa_round_to_integral(self, c: Z3_context, rm: Z3_ast, t: Z3_ast) raises -> Z3_ast
Floating-point roundToIntegral. Rounds a floating-point number to the closest integer, again represented as a floating-point number.
t must be of FloatingPoint sort.
Z3_mk_fpa_round_toward_negative¶
def Z3_mk_fpa_round_toward_negative(self, c: Z3_context) raises -> Z3_ast
Create a numeral of RoundingMode sort which represents the TowardNegative rounding mode.
This is the same as Z3_mk_fpa_rtn.
Z3_mk_fpa_round_toward_positive¶
def Z3_mk_fpa_round_toward_positive(self, c: Z3_context) raises -> Z3_ast
Create a numeral of RoundingMode sort which represents the TowardPositive rounding mode.
This is the same as Z3_mk_fpa_rtp.
Z3_mk_fpa_round_toward_zero¶
def Z3_mk_fpa_round_toward_zero(self, c: Z3_context) raises -> Z3_ast
Create a numeral of RoundingMode sort which represents the TowardZero rounding mode.
This is the same as Z3_mk_fpa_rtz.
Z3_mk_fpa_rounding_mode_sort¶
def Z3_mk_fpa_rounding_mode_sort(self, c: Z3_context) raises -> Z3_sort
Create the RoundingMode sort.
Z3_mk_fpa_rtn¶
def Z3_mk_fpa_rtn(self, c: Z3_context) raises -> Z3_ast
Create a numeral of RoundingMode sort which represents the TowardNegative rounding mode.
This is the same as Z3_mk_fpa_round_toward_negative.
Z3_mk_fpa_rtp¶
def Z3_mk_fpa_rtp(self, c: Z3_context) raises -> Z3_ast
Create a numeral of RoundingMode sort which represents the TowardPositive rounding mode.
This is the same as Z3_mk_fpa_round_toward_positive.
Z3_mk_fpa_rtz¶
def Z3_mk_fpa_rtz(self, c: Z3_context) raises -> Z3_ast
Create a numeral of RoundingMode sort which represents the TowardZero rounding mode.
This is the same as Z3_mk_fpa_round_toward_zero.
Z3_mk_fpa_sort¶
def Z3_mk_fpa_sort(self, c: Z3_context, ebits: UInt32, sbits: UInt32) raises -> Z3_sort
Create a FloatingPoint sort.
Z3_mk_fpa_sort_128¶
def Z3_mk_fpa_sort_128(self, c: Z3_context) raises -> Z3_sort
Create the quadruple-precision (128-bit) FloatingPoint sort.
This is the same as Z3_mk_fpa_sort_quadruple.
Z3_mk_fpa_sort_16¶
def Z3_mk_fpa_sort_16(self, c: Z3_context) raises -> Z3_sort
Create the half-precision (16-bit) FloatingPoint sort.
This is the same as Z3_mk_fpa_sort_half.
Z3_mk_fpa_sort_32¶
def Z3_mk_fpa_sort_32(self, c: Z3_context) raises -> Z3_sort
Create the single-precision (32-bit) FloatingPoint sort.
This is the same as Z3_mk_fpa_sort_single.
Z3_mk_fpa_sort_64¶
def Z3_mk_fpa_sort_64(self, c: Z3_context) raises -> Z3_sort
Create the double-precision (64-bit) FloatingPoint sort.
This is the same as Z3_mk_fpa_sort_double.
Z3_mk_fpa_sort_double¶
def Z3_mk_fpa_sort_double(self, c: Z3_context) raises -> Z3_sort
Create the double-precision (64-bit) FloatingPoint sort.
This is the same as Z3_mk_fpa_sort_64.
Z3_mk_fpa_sort_half¶
def Z3_mk_fpa_sort_half(self, c: Z3_context) raises -> Z3_sort
Create the half-precision (16-bit) FloatingPoint sort.
This is the same as Z3_mk_fpa_sort_16.
Z3_mk_fpa_sort_quadruple¶
def Z3_mk_fpa_sort_quadruple(self, c: Z3_context) raises -> Z3_sort
Create the quadruple-precision (128-bit) FloatingPoint sort.
This is the same as Z3_mk_fpa_sort_128.
Z3_mk_fpa_sort_single¶
def Z3_mk_fpa_sort_single(self, c: Z3_context) raises -> Z3_sort
Create the single-precision (32-bit) FloatingPoint sort.
This is the same as Z3_mk_fpa_sort_32.
Z3_mk_fpa_sqrt¶
def Z3_mk_fpa_sqrt(self, c: Z3_context, rm: Z3_ast, t: Z3_ast) raises -> Z3_ast
Floating-point square root
rm must be of RoundingMode sort, t must have FloatingPoint sort.
Z3_mk_fpa_sub¶
def Z3_mk_fpa_sub(self, c: Z3_context, rm: Z3_ast, t1: Z3_ast, t2: Z3_ast) raises -> Z3_ast
Floating-point subtraction
rm must be of RoundingMode sort, t1 and t2 must have the same FloatingPoint sort.
Z3_mk_fpa_to_fp_bv¶
def Z3_mk_fpa_to_fp_bv(self, c: Z3_context, bv: Z3_ast, s: Z3_sort) raises -> Z3_ast
Conversion of a single IEEE 754-2008 bit-vector into a floating-point number.
Produces a term that represents the conversion of a bit-vector term bv to a floating-point term of sort s.
s must be a FloatingPoint sort, t must be of bit-vector sort, and the bit-vector size of bv must be equal to ebits+sbits of s. The format of the bit-vector is as defined by the IEEE 754-2008 interchange format.
Z3_mk_fpa_to_fp_float¶
def Z3_mk_fpa_to_fp_float(self, c: Z3_context, rm: Z3_ast, t: Z3_ast, s: Z3_sort) raises -> Z3_ast
Conversion of a FloatingPoint term into another term of different FloatingPoint sort.
Produces a term that represents the conversion of a floating-point term t to a floating-point term of sort s. If necessary, the result will be rounded according to rounding mode rm.
s must be a FloatingPoint sort, rm must be of RoundingMode sort, t must be of floating-point sort.
Z3_mk_fpa_to_fp_real¶
def Z3_mk_fpa_to_fp_real(self, c: Z3_context, rm: Z3_ast, t: Z3_ast, s: Z3_sort) raises -> Z3_ast
Conversion of a term of real sort into a term of FloatingPoint sort.
Produces a term that represents the conversion of term t of real sort into a floating-point term of sort s. If necessary, the result will be rounded according to rounding mode rm.
s must be a FloatingPoint sort, rm must be of RoundingMode sort, t must be of real sort.
Z3_mk_fpa_to_fp_signed¶
def Z3_mk_fpa_to_fp_signed(self, c: Z3_context, rm: Z3_ast, t: Z3_ast, s: Z3_sort) raises -> Z3_ast
Conversion of a 2's complement signed bit-vector term into a term of FloatingPoint sort.
Produces a term that represents the conversion of the bit-vector term t into a floating-point term of sort s. The bit-vector t is taken to be in signed 2's complement format. If necessary, the result will be rounded according to rounding mode rm.
s must be a FloatingPoint sort, rm must be of RoundingMode sort, t must be of bit-vector sort.
Z3_mk_fpa_to_fp_unsigned¶
def Z3_mk_fpa_to_fp_unsigned(self, c: Z3_context, rm: Z3_ast, t: Z3_ast, s: Z3_sort) raises -> Z3_ast
Conversion of a 2's complement unsigned bit-vector term into a term of FloatingPoint sort.
Produces a term that represents the conversion of the bit-vector term t into a floating-point term of sort s. The bit-vector t is taken to be in unsigned 2's complement format. If necessary, the result will be rounded according to rounding mode rm.
s must be a FloatingPoint sort, rm must be of RoundingMode sort, t must be of bit-vector sort.
Z3_mk_fpa_to_real¶
def Z3_mk_fpa_to_real(self, c: Z3_context, t: Z3_ast) raises -> Z3_ast
Conversion of a floating-point term into a real-numbered term.
Produces a term that represents the conversion of the floating-point term t into a real number. Note that this type of conversion will often result in non-linear constraints over real terms.
Z3_mk_fpa_to_sbv¶
def Z3_mk_fpa_to_sbv(self, c: Z3_context, rm: Z3_ast, t: Z3_ast, sz: UInt32) raises -> Z3_ast
Conversion of a floating-point term into a signed bit-vector.
Produces a term that represents the conversion of the floating-point term t into a bit-vector term of size sz in signed 2's complement format. If necessary, the result will be rounded according to rounding mode rm.
Z3_mk_fpa_to_ubv¶
def Z3_mk_fpa_to_ubv(self, c: Z3_context, rm: Z3_ast, t: Z3_ast, sz: UInt32) raises -> Z3_ast
Conversion of a floating-point term into an unsigned bit-vector.
Produces a term that represents the conversion of the floating-point term t into a bit-vector term of size sz in unsigned 2's complement format. If necessary, the result will be rounded according to rounding mode rm.
Z3_mk_fpa_zero¶
def Z3_mk_fpa_zero(self, c: Z3_context, s: Z3_sort, negative: Bool) raises -> Z3_ast
Create a floating-point zero of sort s.
When negative is true, -zero will be generated instead of +zero.
Z3-specific floating-point extensions (20)¶
Z3_fpa_get_ebits¶
def Z3_fpa_get_ebits(self, c: Z3_context, s: Z3_sort) raises -> UInt32
Retrieves the number of bits reserved for the exponent in a FloatingPoint sort.
Z3_fpa_get_numeral_exponent_bv¶
def Z3_fpa_get_numeral_exponent_bv(self, c: Z3_context, t: Z3_ast, biased: Bool) raises -> Z3_ast
Retrieves the exponent of a floating-point literal as a bit-vector expression.
Remarks: This function extracts the exponent in t, without normalization. NaN is an invalid arguments.
Z3_fpa_get_numeral_exponent_int64¶
def Z3_fpa_get_numeral_exponent_int64(self, c: Z3_context, t: Z3_ast, n: Pointer[mut=True, Int64, _], biased: Bool) raises -> Bool
Return the exponent value of a floating-point numeral as a signed 64-bit integer
Remarks: This function extracts the exponent in t, without normalization. NaN is an invalid argument.
Z3_fpa_get_numeral_exponent_string¶
def Z3_fpa_get_numeral_exponent_string(self, c: Z3_context, t: Z3_ast, biased: Bool) raises -> Pointer[Int8, MutUntrackedOrigin]
Return the exponent value of a floating-point numeral as a string.
Remarks: This function extracts the exponent in t, without normalization. NaN is an invalid argument.
Z3_fpa_get_numeral_sign¶
def Z3_fpa_get_numeral_sign(self, c: Z3_context, t: Z3_ast, sgn: Pointer[mut=True, UInt8, _]) raises -> Bool
Retrieves the sign of a floating-point literal.
Remarks: sets sgn to false if t' is positive and totrue` otherwise, except for NaN, which is an invalid argument.
Z3_fpa_get_numeral_sign_bv¶
def Z3_fpa_get_numeral_sign_bv(self, c: Z3_context, t: Z3_ast) raises -> Z3_ast
Retrieves the sign of a floating-point literal as a bit-vector expression.
Remarks: NaN is an invalid argument.
Z3_fpa_get_numeral_significand_bv¶
def Z3_fpa_get_numeral_significand_bv(self, c: Z3_context, t: Z3_ast) raises -> Z3_ast
Retrieves the significand of a floating-point literal as a bit-vector expression.
Remarks: NaN is an invalid argument.
Z3_fpa_get_numeral_significand_string¶
def Z3_fpa_get_numeral_significand_string(self, c: Z3_context, t: Z3_ast) raises -> Pointer[Int8, MutUntrackedOrigin]
Return the significand value of a floating-point numeral as a string.
Remarks: The significand s is always 0.0 <= s < 2.0; the resulting string is long enough to represent the real significand precisely.
Z3_fpa_get_numeral_significand_uint64¶
def Z3_fpa_get_numeral_significand_uint64(self, c: Z3_context, t: Z3_ast, n: Pointer[mut=True, UInt64, _]) raises -> Bool
Return the significand value of a floating-point numeral as a uint64.
Remarks: This function extracts the significand bits in t, without the hidden bit or normalization. Sets the Z3_INVALID_ARG error code if the significand does not fit into a uint64. NaN is an invalid argument.
Z3_fpa_get_sbits¶
def Z3_fpa_get_sbits(self, c: Z3_context, s: Z3_sort) raises -> UInt32
Retrieves the number of bits reserved for the significand in a FloatingPoint sort.
Z3_fpa_is_numeral¶
def Z3_fpa_is_numeral(self, c: Z3_context, t: Z3_ast) raises -> Bool
Checks whether a given ast is a floating-point numeral.
Z3_fpa_is_numeral_inf¶
def Z3_fpa_is_numeral_inf(self, c: Z3_context, t: Z3_ast) raises -> Bool
Checks whether a given floating-point numeral is a +oo or -oo.
Z3_fpa_is_numeral_nan¶
def Z3_fpa_is_numeral_nan(self, c: Z3_context, t: Z3_ast) raises -> Bool
Checks whether a given floating-point numeral is a NaN.
Z3_fpa_is_numeral_negative¶
def Z3_fpa_is_numeral_negative(self, c: Z3_context, t: Z3_ast) raises -> Bool
Checks whether a given floating-point numeral is negative.
Z3_fpa_is_numeral_normal¶
def Z3_fpa_is_numeral_normal(self, c: Z3_context, t: Z3_ast) raises -> Bool
Checks whether a given floating-point numeral is normal.
Z3_fpa_is_numeral_positive¶
def Z3_fpa_is_numeral_positive(self, c: Z3_context, t: Z3_ast) raises -> Bool
Checks whether a given floating-point numeral is positive.
Z3_fpa_is_numeral_subnormal¶
def Z3_fpa_is_numeral_subnormal(self, c: Z3_context, t: Z3_ast) raises -> Bool
Checks whether a given floating-point numeral is subnormal.
Z3_fpa_is_numeral_zero¶
def Z3_fpa_is_numeral_zero(self, c: Z3_context, t: Z3_ast) raises -> Bool
Checks whether a given floating-point numeral is +zero or -zero.
Z3_mk_fpa_to_fp_int_real¶
def Z3_mk_fpa_to_fp_int_real(self, c: Z3_context, rm: Z3_ast, exp: Z3_ast, sig: Z3_ast, s: Z3_sort) raises -> Z3_ast
Conversion of a real-sorted significand and an integer-sorted exponent into a term of FloatingPoint sort.
Produces a term that represents the conversion of sig * 2^exp into a floating-point term of sort s. If necessary, the result will be rounded according to rounding mode rm.
s must be a FloatingPoint sort, rm must be of RoundingMode sort, exp must be of int sort, sig must be of real sort.
Z3_mk_fpa_to_ieee_bv¶
def Z3_mk_fpa_to_ieee_bv(self, c: Z3_context, t: Z3_ast) raises -> Z3_ast
Conversion of a floating-point term into a bit-vector term in IEEE 754-2008 format.
t must have FloatingPoint sort. The size of the resulting bit-vector is automatically determined.
Note that IEEE 754-2008 allows multiple different representations of NaN. This conversion knows only one NaN and it will always produce the same bit-vector representation of that NaN.
z3_optimization.h (30 functions)¶
Optimization facilities (28)¶
Z3_mk_optimize¶
def Z3_mk_optimize(self, c: Z3_context) raises -> Z3_optimize
Create a new optimize context.
Z3_optimize_assert¶
def Z3_optimize_assert(self, c: Z3_context, o: Z3_optimize, a: Z3_ast) raises
Assert hard constraint to the optimization context.
Z3_optimize_assert_and_track¶
def Z3_optimize_assert_and_track(self, c: Z3_context, o: Z3_optimize, a: Z3_ast, t: Z3_ast) raises
Assert tracked hard constraint to the optimization context.
Z3_optimize_assert_soft¶
def Z3_optimize_assert_soft(self, c: Z3_context, o: Z3_optimize, a: Z3_ast, weight: Pointer[Int8, _], id: Z3_symbol) raises -> UInt32
Assert soft constraint to the optimization context.
Z3_optimize_check¶
def Z3_optimize_check(self, c: Z3_context, o: Z3_optimize, num_assumptions: UInt32, assumptions: Pointer[Z3_ast, _]) raises -> Lbool
Check consistency and produce optimal values.
Z3_optimize_from_file¶
def Z3_optimize_from_file(self, c: Z3_context, o: Z3_optimize, s: Pointer[Int8, _]) raises
Parse an SMT-LIB2 file with assertions, soft constraints and optimization objectives. Add the parsed constraints and objectives to the optimization context.
Z3_optimize_from_string¶
def Z3_optimize_from_string(self, c: Z3_context, o: Z3_optimize, s: Pointer[Int8, _]) raises
Parse an SMT-LIB2 string with assertions, soft constraints and optimization objectives. Add the parsed constraints and objectives to the optimization context.
Z3_optimize_get_assertions¶
def Z3_optimize_get_assertions(self, c: Z3_context, o: Z3_optimize) raises -> Z3_ast_vector
Return the set of asserted formulas on the optimization context.
Z3_optimize_get_help¶
def Z3_optimize_get_help(self, c: Z3_context, t: Z3_optimize) raises -> Pointer[Int8, MutUntrackedOrigin]
Return a string containing a description of parameters accepted by optimize.
Z3_optimize_get_lower¶
def Z3_optimize_get_lower(self, c: Z3_context, o: Z3_optimize, idx: UInt32) raises -> Z3_ast
Retrieve lower bound value or approximation for the i'th optimization objective.
An attained, certified irrational algebraic optimum is returned as an exact algebraic numeral by both Z3_optimize_get_lower and Z3_optimize_get_upper. Use Z3_get_algebraic_number_lower and Z3_get_algebraic_number_upper to obtain rational approximations.
A certified finite limit that is not attained includes an infinitesimal term: for example, sqrt(2) - epsilon for a supremum. The finite part can be algebraic even though the whole expression is not an algebraic numeral. Use Z3_optimize_get_lower_as_vector to inspect the finite part and the infinitesimal coefficient separately.
Z3_optimize_get_lower_as_vector¶
def Z3_optimize_get_lower_as_vector(self, c: Z3_context, o: Z3_optimize, idx: UInt32) raises -> Z3_ast_vector
Retrieve lower bound value or approximation for the i'th optimization objective. The returned vector is of length 3. Its entries are coefficients a, b, c and encode the result of Z3_optimize_get_lower a * infinity + b + c * epsilon. The coefficients a and c are rational numerals. The finite part b is a rational numeral or an exact irrational algebraic numeral when such a bound has been certified. For a finite attained optimum, a and c are zero. A finite open limit has a equal to zero and a nonzero infinitesimal coefficient c, even when b is algebraic.
Z3_optimize_get_model¶
def Z3_optimize_get_model(self, c: Z3_context, o: Z3_optimize) raises -> Z3_model
Retrieve the model for the last Z3_optimize_check
The error handler is invoked if a model is not available because the commands above were not invoked for the given optimization solver, or if the result was Z3_L_FALSE.
Z3_optimize_get_objectives¶
def Z3_optimize_get_objectives(self, c: Z3_context, o: Z3_optimize) raises -> Z3_ast_vector
Return objectives on the optimization context. If the objective function is a max-sat objective it is returned as a Pseudo-Boolean (minimization) sum of the form (+ (if f1 w1 0) (if f2 w2 0) ...) If the objective function is entered as a maximization objective, then return the corresponding minimization objective. In this way the resulting objective function is always returned as a minimization objective.
Z3_optimize_get_param_descrs¶
def Z3_optimize_get_param_descrs(self, c: Z3_context, o: Z3_optimize) raises -> Z3_param_descrs
Return the parameter description set for the given optimize object.
Z3_optimize_get_reason_unknown¶
def Z3_optimize_get_reason_unknown(self, c: Z3_context, d: Z3_optimize) raises -> Pointer[Int8, MutUntrackedOrigin]
Retrieve a string that describes the last status returned by Z3_optimize_check.
Use this method when Z3_optimize_check returns Z3_L_UNDEF.
Z3_optimize_get_statistics¶
def Z3_optimize_get_statistics(self, c: Z3_context, d: Z3_optimize) raises -> Z3_stats
Retrieve statistics information from the last call to Z3_optimize_check
Z3_optimize_get_unsat_core¶
def Z3_optimize_get_unsat_core(self, c: Z3_context, o: Z3_optimize) raises -> Z3_ast_vector
Retrieve the unsat core for the last Z3_optimize_check The unsat core is a subset of the assumptions a.
Z3_optimize_get_upper¶
def Z3_optimize_get_upper(self, c: Z3_context, o: Z3_optimize, idx: UInt32) raises -> Z3_ast
Retrieve upper bound value or approximation for the i'th optimization objective.
Certified algebraic optima and finite open limits are returned as described for Z3_optimize_get_lower.
Z3_optimize_get_upper_as_vector¶
def Z3_optimize_get_upper_as_vector(self, c: Z3_context, o: Z3_optimize, idx: UInt32) raises -> Z3_ast_vector
Retrieve upper bound value or approximation for the i'th optimization objective.
The returned vector has the same coefficient and algebraic-value semantics as Z3_optimize_get_lower_as_vector, and encodes the result of Z3_optimize_get_upper.
Z3_optimize_maximize¶
def Z3_optimize_maximize(self, c: Z3_context, o: Z3_optimize, t: Z3_ast) raises -> UInt32
Add a maximization constraint.
Z3_optimize_minimize¶
def Z3_optimize_minimize(self, c: Z3_context, o: Z3_optimize, t: Z3_ast) raises -> UInt32
Add a minimization constraint.
Z3_optimize_pop¶
def Z3_optimize_pop(self, c: Z3_context, d: Z3_optimize) raises
Backtrack one level.
Z3_optimize_push¶
def Z3_optimize_push(self, c: Z3_context, d: Z3_optimize) raises
Create a backtracking point.
The optimize solver contains a set of rules, added facts and assertions. The set of rules, facts and assertions are restored upon calling Z3_optimize_pop.
Z3_optimize_register_model_eh¶
def Z3_optimize_register_model_eh(self, c: Z3_context, o: Z3_optimize, m: Z3_model, ctx: Pointer[mut=True, NoneType, _], model_eh: Ptr) raises
register a model event handler for new models.
Z3_optimize_set_initial_value¶
def Z3_optimize_set_initial_value(self, c: Z3_context, o: Z3_optimize, v: Z3_ast, val: Z3_ast) raises
provide an initialization hint to the solver. The initialization hint is used to calibrate an initial value of the expression that represents a variable. If the variable is Boolean, the initial phase is set according to value. If the variable is an integer or real, the initial Simplex tableau is recalibrated to attempt to follow the value assignment.
Z3_optimize_set_params¶
def Z3_optimize_set_params(self, c: Z3_context, o: Z3_optimize, p: Z3_params) raises
Set parameters on optimization context, including parameters for the underlying SMT solver.
Z3_optimize_to_string¶
def Z3_optimize_to_string(self, c: Z3_context, o: Z3_optimize) raises -> Pointer[Int8, MutUntrackedOrigin]
Print the current context as a string.
Z3_optimize_translate¶
def Z3_optimize_translate(self, c: Z3_context, o: Z3_optimize, target: Z3_context) raises -> Z3_optimize
Copy an optimization context from a source to a target context.
This function allows translating an optimization context from one Z3_context to another. This is useful when working with multiple contexts and needing to transfer optimization problems between them.
Lifecycle & refcounting (2 functions — handled automatically by RAII)
| C Function | Mojo CApi Signature |
|---|---|
Z3_optimize_dec_ref |
def Z3_optimize_dec_ref(self, c: Z3_context, d: Z3_optimize) |
Z3_optimize_inc_ref |
def Z3_optimize_inc_ref(self, c: Z3_context, d: Z3_optimize) raises |
z3_polynomial.h (1 functions)¶
Polynomials (1)¶
Z3_polynomial_subresultants¶
def Z3_polynomial_subresultants(self, c: Z3_context, p: Z3_ast, q: Z3_ast, x: Z3_ast) raises -> Z3_ast_vector
Return the nonzero subresultants of p and q with respect to the "variable" x.
z3_rcf.h (37 functions)¶
Real Closed Fields (36)¶
Z3_rcf_add¶
def Z3_rcf_add(self, c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) raises -> Z3_rcf_num
Return the value a + b.
Z3_rcf_coefficient¶
def Z3_rcf_coefficient(self, c: Z3_context, a: Z3_rcf_num, i: UInt32) raises -> Z3_rcf_num
Extract a coefficient from an algebraic number.
Z3_rcf_div¶
def Z3_rcf_div(self, c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) raises -> Z3_rcf_num
Return the value a / b.
Z3_rcf_eq¶
def Z3_rcf_eq(self, c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) raises -> Bool
Return true if a == b.
Z3_rcf_extension_index¶
def Z3_rcf_extension_index(self, c: Z3_context, a: Z3_rcf_num) raises -> UInt32
Return the index of a field extension.
Z3_rcf_ge¶
def Z3_rcf_ge(self, c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) raises -> Bool
Return true if a >= b.
Z3_rcf_get_numerator_denominator¶
def Z3_rcf_get_numerator_denominator(self, c: Z3_context, a: Z3_rcf_num, n: Pointer[mut=True, Z3_rcf_num, _], d: Pointer[mut=True, Z3_rcf_num, _]) raises
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.
Z3_rcf_gt¶
def Z3_rcf_gt(self, c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) raises -> Bool
Return true if a > b.
Z3_rcf_infinitesimal_name¶
def Z3_rcf_infinitesimal_name(self, c: Z3_context, a: Z3_rcf_num) raises -> Z3_symbol
Return the name of an infinitesimal.
Z3_rcf_interval¶
def Z3_rcf_interval(self, c: Z3_context, a: Z3_rcf_num, lower_is_inf: Pointer[mut=True, UInt8, _], lower_is_open: Pointer[mut=True, UInt8, _], lower: Pointer[mut=True, Z3_rcf_num, _], upper_is_inf: Pointer[mut=True, UInt8, _], upper_is_open: Pointer[mut=True, UInt8, _], upper: Pointer[mut=True, Z3_rcf_num, _]) raises -> Int32
Extract an interval from an algebraic number.
Z3_rcf_inv¶
def Z3_rcf_inv(self, c: Z3_context, a: Z3_rcf_num) raises -> Z3_rcf_num
Return the value 1/a.
Z3_rcf_is_algebraic¶
def Z3_rcf_is_algebraic(self, c: Z3_context, a: Z3_rcf_num) raises -> Bool
Return true if a represents an algebraic number.
Z3_rcf_is_infinitesimal¶
def Z3_rcf_is_infinitesimal(self, c: Z3_context, a: Z3_rcf_num) raises -> Bool
Return true if a represents an infinitesimal.
Z3_rcf_is_rational¶
def Z3_rcf_is_rational(self, c: Z3_context, a: Z3_rcf_num) raises -> Bool
Return true if a represents a rational number.
Z3_rcf_is_transcendental¶
def Z3_rcf_is_transcendental(self, c: Z3_context, a: Z3_rcf_num) raises -> Bool
Return true if a represents a transcendental number.
Z3_rcf_le¶
def Z3_rcf_le(self, c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) raises -> Bool
Return true if a <= b.
Z3_rcf_lt¶
def Z3_rcf_lt(self, c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) raises -> Bool
Return true if a < b.
Z3_rcf_mk_e¶
def Z3_rcf_mk_e(self, c: Z3_context) raises -> Z3_rcf_num
Return e (Euler's constant)
Z3_rcf_mk_infinitesimal¶
def Z3_rcf_mk_infinitesimal(self, c: Z3_context) raises -> Z3_rcf_num
Return a new infinitesimal that is smaller than all elements in the Z3 field.
Z3_rcf_mk_pi¶
def Z3_rcf_mk_pi(self, c: Z3_context) raises -> Z3_rcf_num
Return Pi
Z3_rcf_mk_rational¶
def Z3_rcf_mk_rational(self, c: Z3_context, val: Pointer[Int8, _]) raises -> Z3_rcf_num
Return a RCF rational using the given string.
Z3_rcf_mk_roots¶
def Z3_rcf_mk_roots(self, c: Z3_context, n: UInt32, a: Pointer[Z3_rcf_num, _], roots: Pointer[mut=True, Z3_rcf_num, _]) raises -> UInt32
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.
Z3_rcf_mk_small_int¶
def Z3_rcf_mk_small_int(self, c: Z3_context, val: Int32) raises -> Z3_rcf_num
Return a RCF small integer.
Z3_rcf_mul¶
def Z3_rcf_mul(self, c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) raises -> Z3_rcf_num
Return the value a * b.
Z3_rcf_neg¶
def Z3_rcf_neg(self, c: Z3_context, a: Z3_rcf_num) raises -> Z3_rcf_num
Return the value -a.
Z3_rcf_neq¶
def Z3_rcf_neq(self, c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) raises -> Bool
Return true if a != b.
Z3_rcf_num_coefficients¶
def Z3_rcf_num_coefficients(self, c: Z3_context, a: Z3_rcf_num) raises -> UInt32
Return the number of coefficients in an algebraic number.
Z3_rcf_num_sign_condition_coefficients¶
def Z3_rcf_num_sign_condition_coefficients(self, c: Z3_context, a: Z3_rcf_num, i: UInt32) raises -> UInt32
Return the number of sign condition polynomial coefficients of an algebraic number.
Z3_rcf_num_sign_conditions¶
def Z3_rcf_num_sign_conditions(self, c: Z3_context, a: Z3_rcf_num) raises -> UInt32
Return the number of sign conditions of an algebraic number.
Z3_rcf_num_to_decimal_string¶
def Z3_rcf_num_to_decimal_string(self, c: Z3_context, a: Z3_rcf_num, prec: UInt32) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert the RCF numeral into a string in decimal notation.
Z3_rcf_num_to_string¶
def Z3_rcf_num_to_string(self, c: Z3_context, a: Z3_rcf_num, compact: Bool, html: Bool) raises -> Pointer[Int8, MutUntrackedOrigin]
Convert the RCF numeral into a string.
Z3_rcf_power¶
def Z3_rcf_power(self, c: Z3_context, a: Z3_rcf_num, k: UInt32) raises -> Z3_rcf_num
Return the value a^k.
Z3_rcf_sign_condition_coefficient¶
def Z3_rcf_sign_condition_coefficient(self, c: Z3_context, a: Z3_rcf_num, i: UInt32, j: UInt32) raises -> Z3_rcf_num
Extract the j-th polynomial coefficient of the i-th sign condition.
Z3_rcf_sign_condition_sign¶
def Z3_rcf_sign_condition_sign(self, c: Z3_context, a: Z3_rcf_num, i: UInt32) raises -> Int32
Extract the sign of a sign condition from an algebraic number.
Z3_rcf_sub¶
def Z3_rcf_sub(self, c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) raises -> Z3_rcf_num
Return the value a - b.
Z3_rcf_transcendental_name¶
def Z3_rcf_transcendental_name(self, c: Z3_context, a: Z3_rcf_num) raises -> Z3_symbol
Return the name of a transcendental.
Lifecycle & refcounting (1 functions — handled automatically by RAII)
| C Function | Mojo CApi Signature |
|---|---|
Z3_rcf_del |
def Z3_rcf_del(self, c: Z3_context, a: Z3_rcf_num) |
z3_spacer.h (11 functions)¶
Spacer facilities (11)¶
Z3_fixedpoint_add_invariant¶
def Z3_fixedpoint_add_invariant(self, c: Z3_context, d: Z3_fixedpoint, pred: Z3_func_decl, property: Z3_ast) raises
Add an invariant for the predicate pred. Add an assumed invariant of predicate pred.
Note: this functionality is Spacer specific.
Z3_fixedpoint_get_ground_sat_answer¶
def Z3_fixedpoint_get_ground_sat_answer(self, c: Z3_context, d: Z3_fixedpoint) raises -> Z3_ast
Retrieve a bottom-up (from query) sequence of ground facts
The previous call to Z3_fixedpoint_query must have returned Z3_L_TRUE.
Z3_fixedpoint_get_reachable¶
def Z3_fixedpoint_get_reachable(self, c: Z3_context, d: Z3_fixedpoint, pred: Z3_func_decl) raises -> Z3_ast
Retrieve reachable states of a predicate. Note: this functionality is Spacer specific.
Z3_fixedpoint_get_rule_names_along_trace¶
def Z3_fixedpoint_get_rule_names_along_trace(self, c: Z3_context, d: Z3_fixedpoint) raises -> Z3_symbol
Obtain the list of rules along the counterexample trace.
Z3_fixedpoint_get_rules_along_trace¶
def Z3_fixedpoint_get_rules_along_trace(self, c: Z3_context, d: Z3_fixedpoint) raises -> Z3_ast_vector
Obtain the list of rules along the counterexample trace.
Z3_fixedpoint_query_from_lvl¶
def Z3_fixedpoint_query_from_lvl(self, c: Z3_context, d: Z3_fixedpoint, query: Z3_ast, lvl: UInt32) raises -> Lbool
Pose a query against the asserted rules at the given level.
query ::= (exists (bound-vars) query)
| literals
query returns
Z3_L_FALSEif the query is unsatisfiable.Z3_L_TRUEif the query is satisfiable. Obtain the answer by callingZ3_fixedpoint_get_answer.Z3_L_UNDEFif the query was interrupted, timed out or otherwise failed.
Z3_model_extrapolate¶
def Z3_model_extrapolate(self, c: Z3_context, m: Z3_model, fml: Z3_ast) raises -> Z3_ast
Extrapolates a model of a formula
Z3_qe_lite¶
def Z3_qe_lite(self, c: Z3_context, vars: Z3_ast_vector, body: Z3_ast) raises -> Z3_ast
Best-effort quantifier elimination
Z3_qe_model_project¶
def Z3_qe_model_project(self, c: Z3_context, m: Z3_model, num_bounds: UInt32, bound: Pointer[Z3_app, _], body: Z3_ast) raises -> Z3_ast
Project variables given a model
Z3_qe_model_project_skolem¶
def Z3_qe_model_project_skolem(self, c: Z3_context, m: Z3_model, num_bounds: UInt32, bound: Pointer[Z3_app, _], body: Z3_ast, map: Z3_ast_map) raises -> Z3_ast
Project variables given a model
Z3_qe_model_project_with_witness¶
def Z3_qe_model_project_with_witness(self, c: Z3_context, m: Z3_model, num_bounds: UInt32, bound: Pointer[Z3_app, _], body: Z3_ast, map: Z3_ast_map) raises -> Z3_ast
Project with witness extraction.
The returned map contains a binding of variables to terms that such that when the binding is used for the formula, it remains true within the model.