21 using System.Diagnostics.Contracts;
23 namespace Microsoft.Z3
30 [ContractVerification(
true)]
51 get {
return Precision ==
Z3_goal_prec.Z3_GOAL_PRECISE; }
56 public bool IsUnderApproximation
64 public bool IsOverApproximation
74 get {
return Precision ==
Z3_goal_prec.Z3_GOAL_UNDER_OVER; }
80 public void Assert(params
BoolExpr[] constraints)
82 Contract.Requires(constraints != null);
83 Contract.Requires(Contract.ForAll(constraints, c => c != null));
85 Context.CheckContextMatch(constraints);
88 Contract.Assert(c != null);
96 public bool Inconsistent
135 Contract.Ensures(Contract.Result<
BoolExpr[]>() != null);
139 for (uint i = 0; i < n; i++)
156 public bool IsDecidedSat
164 public bool IsDecidedUnsat
174 Contract.Requires(ctx != null);
198 public override string ToString()
204 internal Goal(
Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
206 internal Goal(Context ctx,
bool models,
bool unsatCores,
bool proofs)
207 : base(ctx, Native.
Z3_mk_goal(ctx.nCtx, (models) ? 1 : 0, (unsatCores) ? 1 : 0, (proofs) ? 1 : 0))
209 Contract.Requires(ctx != null);
212 internal class DecRefQueue : Z3.DecRefQueue
214 public override void IncRef(Context ctx, IntPtr obj)
216 Native.Z3_goal_inc_ref(ctx.nCtx, obj);
219 public override void DecRef(Context ctx, IntPtr obj)
221 Native.Z3_goal_dec_ref(ctx.nCtx, obj);
225 internal override void IncRef(IntPtr o)
227 Context.Goal_DRQ.IncAndClear(Context, o);
231 internal override void DecRef(IntPtr o)
233 Context.Goal_DRQ.Add(o);