MCPcopy Create free account
hub / github.com/Z3Prover/z3 / Check

Method Check

src/api/java/Optimize.java:200–225  ·  view source on GitHub ↗

Check satisfiability of asserted constraints. Produce a model that (when the objectives are bounded and don't use strict inequalities) is optimal.

(Expr<BoolSort>... assumptions)

Source from the content-addressed store, hash-verified

198 * don't use strict inequalities) is optimal.
199 **/
200 public Status Check(Expr<BoolSort>... assumptions)
201 {
202 Z3_lbool r;
203 if (assumptions == null) {
204 r = Z3_lbool.fromInt(
205 Native.optimizeCheck(
206 getContext().nCtx(),
207 getNativeObject(), 0, null));
208 }
209 else {
210 r = Z3_lbool.fromInt(
211 Native.optimizeCheck(
212 getContext().nCtx(),
213 getNativeObject(),
214 assumptions.length,
215 AST.arrayToNative(assumptions)));
216 }
217 switch (r) {
218 case Z3_L_TRUE:
219 return Status.SATISFIABLE;
220 case Z3_L_FALSE:
221 return Status.UNSATISFIABLE;
222 default:
223 return Status.UNKNOWN;
224 }
225 }
226
227 /**
228 * Creates a backtracking point.

Callers

nothing calls this directly

Calls 5

fromIntMethod · 0.80
nCtxMethod · 0.80
getContextMethod · 0.80
getNativeObjectMethod · 0.80
arrayToNativeMethod · 0.80

Tested by

no test coverage detected