internal NativeModel(NativeContext ctx, IntPtr obj) { ntvContext = ctx; NativeObject = obj; Debug.Assert(ctx != null); Native.Z3_model_inc_ref(ctx.nCtx, obj); }
internal NativeFuncInterp(NativeContext ctx, NativeModel mdl, Z3_func_decl decl, Z3_func_interp fi) { Debug.Assert(ctx != null); Z3_context nCtx = ctx.nCtx; Native.Z3_func_interp_inc_ref(nCtx, fi); Declaration = decl; Else = Native.Z3_func_interp_get_else(nCtx, fi); uint numEntries = Native.Z3_func_interp_get_num_entries(nCtx, fi); uint numArgs = Native.Z3_func_interp_get_arity(nCtx, fi); Entries = new Entry[numEntries]; for (uint j = 0; j < numEntries; ++j) { var entry = Native.Z3_func_interp_get_entry(nCtx, fi, j); Native.Z3_func_entry_inc_ref(nCtx, entry); Entries[j].Arguments = new Z3_ast[numArgs]; for (uint i = 0; i < numArgs; ++i) { Entries[j].Arguments[i] = Native.Z3_func_entry_get_arg(nCtx, entry, i); } Entries[j].Result = Native.Z3_func_entry_get_value(nCtx, entry); Native.Z3_func_entry_dec_ref(nCtx, entry); } Native.Z3_func_interp_dec_ref(nCtx, fi); }
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); }
/// <summary> /// Create a clone of the current solver with respect to <c>ctx</c>. /// </summary> public NativeSolver Translate(NativeContext ctx) { Debug.Assert(ctx != null); return(new NativeSolver(ctx, Native.Z3_solver_translate(nCtx, z3solver, ctx.nCtx))); }