/// <summary> /// Disposes of the underlying native Z3 object. /// </summary> public void Dispose() { if (z3solver != IntPtr.Zero) { Native.Z3_solver_dec_ref(nCtx, z3solver); z3solver = IntPtr.Zero; } GC.SuppressFinalize(this); }
internal NativeSolver(NativeContext nativeCtx, Z3_solver z3solver) { Debug.Assert(nativeCtx != null); Debug.Assert(z3solver != IntPtr.Zero); this.ntvContext = nativeCtx; this.z3solver = z3solver; Native.Z3_solver_inc_ref(nCtx, z3solver); }
public static int Z3_get_implied_equalities(Z3_context a0, Z3_solver a1, uint a2, [In] Z3_ast[] a3, [Out] uint[] a4) { int r = LIB.Z3_get_implied_equalities(a0, a1, a2, a3, a4); Z3_error_code err = (Z3_error_code)LIB.Z3_get_error_code(a0); if (err != Z3_error_code.Z3_OK) throw new Z3Exception(Marshal.PtrToStringAnsi(LIB.Z3_get_error_msg_ex(a0, (uint)err))); return r; }
public static Z3_stats Z3_solver_get_statistics(Z3_context a0, Z3_solver a1) { Z3_stats r = LIB.Z3_solver_get_statistics(a0, a1); Z3_error_code err = (Z3_error_code)LIB.Z3_get_error_code(a0); if (err != Z3_error_code.Z3_OK) throw new Z3Exception(Marshal.PtrToStringAnsi(LIB.Z3_get_error_msg_ex(a0, (uint)err))); return r; }
public static void Z3_solver_assert_and_track(Z3_context a0, Z3_solver a1, Z3_ast a2, Z3_ast a3) { LIB.Z3_solver_assert_and_track(a0, a1, a2, a3); Z3_error_code err = (Z3_error_code)LIB.Z3_get_error_code(a0); if (err != Z3_error_code.Z3_OK) throw new Z3Exception(Marshal.PtrToStringAnsi(LIB.Z3_get_error_msg_ex(a0, (uint)err))); }
public extern static int Z3_get_implied_equalities(Z3_context a0, Z3_solver a1, uint a2, [In] Z3_ast[] a3, [Out] uint[] a4);
public extern static Z3_stats Z3_solver_get_statistics(Z3_context a0, Z3_solver a1);
public extern static Z3_ast_vector Z3_solver_get_unsat_core(Z3_context a0, Z3_solver a1);
public extern static void Z3_solver_pop(Z3_context a0, Z3_solver a1, uint a2);
public extern static void Z3_solver_push(Z3_context a0, Z3_solver a1);
public extern static void Z3_solver_dec_ref(Z3_context a0, Z3_solver a1);
public extern static void Z3_solver_set_params(Z3_context a0, Z3_solver a1, Z3_params a2);
public extern static Z3_param_descrs Z3_solver_get_param_descrs(Z3_context a0, Z3_solver a1);
public extern static IntPtr Z3_solver_get_help(Z3_context a0, Z3_solver a1);
public extern static Z3_solver Z3_solver_translate(Z3_context a0, Z3_solver a1, Z3_context a2);
public extern static Z3_model Z3_solver_get_model(Z3_context a0, Z3_solver a1);
public extern static Z3_ast Z3_solver_get_proof(Z3_context a0, Z3_solver a1);
public extern static void Z3_solver_reset(Z3_context a0, Z3_solver a1);
public extern static IntPtr Z3_solver_get_reason_unknown(Z3_context a0, Z3_solver a1);
public extern static uint Z3_solver_get_num_scopes(Z3_context a0, Z3_solver a1);
public extern static IntPtr Z3_solver_to_string(Z3_context a0, Z3_solver a1);
public extern static void Z3_solver_assert(Z3_context a0, Z3_solver a1, Z3_ast a2);
public static void Z3_solver_reset(Z3_context a0, Z3_solver a1) { LIB.Z3_solver_reset(a0, a1); Z3_error_code err = (Z3_error_code)LIB.Z3_get_error_code(a0); if (err != Z3_error_code.Z3_OK) throw new Z3Exception(Marshal.PtrToStringAnsi(LIB.Z3_get_error_msg_ex(a0, (uint)err))); }
public extern static void Z3_solver_assert_and_track(Z3_context a0, Z3_solver a1, Z3_ast a2, Z3_ast a3);
public static int Z3_solver_check_assumptions(Z3_context a0, Z3_solver a1, uint a2, [In] Z3_ast[] a3) { int r = LIB.Z3_solver_check_assumptions(a0, a1, a2, a3); Z3_error_code err = (Z3_error_code)LIB.Z3_get_error_code(a0); if (err != Z3_error_code.Z3_OK) throw new Z3Exception(Marshal.PtrToStringAnsi(LIB.Z3_get_error_msg_ex(a0, (uint)err))); return r; }
public extern static Z3_ast_vector Z3_solver_get_assertions(Z3_context a0, Z3_solver a1);
public static string Z3_solver_to_string(Z3_context a0, Z3_solver a1) { IntPtr r = LIB.Z3_solver_to_string(a0, a1); Z3_error_code err = (Z3_error_code)LIB.Z3_get_error_code(a0); if (err != Z3_error_code.Z3_OK) throw new Z3Exception(Marshal.PtrToStringAnsi(LIB.Z3_get_error_msg_ex(a0, (uint)err))); return Marshal.PtrToStringAnsi(r); }
public extern static int Z3_solver_check(Z3_context a0, Z3_solver a1);
/// <summary> /// Creates a new (incremental) solver. /// </summary> public NativeSolver MkSimpleSolver() { Z3_solver nSolver = Native.Z3_mk_simple_solver(nCtx); return(new NativeSolver(this, nSolver)); }
public extern static int Z3_solver_check_assumptions(Z3_context a0, Z3_solver a1, uint a2, [In] Z3_ast[] a3);