Overview
The Solver API provides an incremental interface for solving satisfiability problems. Solvers support assertions, backtracking (push/pop), and extracting models and unsat cores.Types
Z3_solver
Incremental solver object that can be specialized by tactics or logics.Solver Creation
Z3_mk_solver
Z3_solver
New solver instance
Z3_mk_simple_solver
Z3_solver
New simple solver instance
Z3_mk_solver_for_logic
Z3_solver
New solver instance
Z3_mk_solver_from_tactic
Z3_solver
Solver based on tactic
Reference Counting
Z3_solver_inc_ref
Z3_solver_dec_ref
Assertions
Z3_solver_assert
Z3_solver_assert_and_track
Satisfiability Checking
Z3_solver_check
Z3_lbool
Z3_L_TRUE if satisfiable, Z3_L_FALSE if unsatisfiable, Z3_L_UNDEF if unknown
Z3_solver_check_assumptions
Z3_lbool
Satisfiability result
Models
Z3_solver_get_model
Z3_model
Model object (must increment reference)
Z3_model_inc_ref.
Unsat Cores
Z3_solver_get_unsat_core
Z3_ast_vector
Subset of asserted constraints that are unsatisfiable
- Context must be created with
unsat_coreenabled - Assertions must be tracked using
Z3_solver_assert_and_track
Backtracking
Z3_solver_push
Z3_solver_pop
Z3_solver_reset
Solver Information
Z3_solver_get_num_scopes
unsigned
Number of scopes
Z3_solver_get_assertions
Z3_ast_vector
Vector of assertions
Z3_solver_get_reason_unknown
Z3_string
Reason string
Z3_solver_to_string
Z3_string
String representation
