Example #1
0
 /// <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);
 }
Example #2
0
        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);
        }
Example #3
0
 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;
 }
Example #4
0
 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;
 }
Example #5
0
 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)));
 }
Example #6
0
 public extern static int Z3_get_implied_equalities(Z3_context a0, Z3_solver a1, uint a2, [In] Z3_ast[] a3, [Out] uint[] a4);
Example #7
0
 public extern static Z3_stats Z3_solver_get_statistics(Z3_context a0, Z3_solver a1);
Example #8
0
 public extern static Z3_ast_vector Z3_solver_get_unsat_core(Z3_context a0, Z3_solver a1);
Example #9
0
 public extern static void Z3_solver_pop(Z3_context a0, Z3_solver a1, uint a2);
Example #10
0
 public extern static void Z3_solver_push(Z3_context a0, Z3_solver a1);
Example #11
0
 public extern static void Z3_solver_dec_ref(Z3_context a0, Z3_solver a1);
Example #12
0
 public extern static void Z3_solver_set_params(Z3_context a0, Z3_solver a1, Z3_params a2);
Example #13
0
 public extern static Z3_param_descrs Z3_solver_get_param_descrs(Z3_context a0, Z3_solver a1);
Example #14
0
 public extern static IntPtr Z3_solver_get_help(Z3_context a0, Z3_solver a1);
Example #15
0
 public extern static Z3_solver Z3_solver_translate(Z3_context a0, Z3_solver a1, Z3_context a2);
Example #16
0
 public extern static Z3_model Z3_solver_get_model(Z3_context a0, Z3_solver a1);
Example #17
0
 public extern static Z3_ast Z3_solver_get_proof(Z3_context a0, Z3_solver a1);
Example #18
0
 public extern static void Z3_solver_reset(Z3_context a0, Z3_solver a1);
Example #19
0
 public extern static IntPtr Z3_solver_get_reason_unknown(Z3_context a0, Z3_solver a1);
Example #20
0
 public extern static uint Z3_solver_get_num_scopes(Z3_context a0, Z3_solver a1);
Example #21
0
 public extern static IntPtr Z3_solver_to_string(Z3_context a0, Z3_solver a1);
Example #22
0
 public extern static void Z3_solver_assert(Z3_context a0, Z3_solver a1, Z3_ast a2);
Example #23
0
 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)));
 }
Example #24
0
 public extern static void Z3_solver_assert_and_track(Z3_context a0, Z3_solver a1, Z3_ast a2, Z3_ast a3);
Example #25
0
 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;
 }
Example #26
0
 public extern static Z3_ast_vector Z3_solver_get_assertions(Z3_context a0, Z3_solver a1);
Example #27
0
 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);
 }
Example #28
0
 public extern static int Z3_solver_check(Z3_context a0, Z3_solver a1);
Example #29
0
        /// <summary>
        /// Creates a new (incremental) solver.
        /// </summary>
        public NativeSolver MkSimpleSolver()
        {
            Z3_solver nSolver = Native.Z3_mk_simple_solver(nCtx);

            return(new NativeSolver(this, nSolver));
        }
Example #30
0
 public extern static int Z3_solver_check_assumptions(Z3_context a0, Z3_solver a1, uint a2, [In] Z3_ast[] a3);