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

Method assertAndTrack

src/api/java/Solver.java:153–165  ·  view source on GitHub ↗

Assert multiple constraints into the solver, and track them (in the unsat) core using the Boolean constants in ps. Remarks: This API is an alternative to #check() with assumptions for extracting unsat cores. Both APIs can be used in the same solver. The unsat core will contain a combination

(Expr<BoolSort>[] constraints, Expr<BoolSort>[] ps)

Source from the content-addressed store, hash-verified

151 * provided using {@link #check()} with assumptions.
152 **/
153 public void assertAndTrack(Expr<BoolSort>[] constraints, Expr<BoolSort>[] ps)
154 {
155 getContext().checkContextMatch(constraints);
156 getContext().checkContextMatch(ps);
157 if (constraints.length != ps.length) {
158 throw new Z3Exception("Argument size mismatch");
159 }
160
161 for (int i = 0; i < constraints.length; i++) {
162 Native.solverAssertAndTrack(getContext().nCtx(), getNativeObject(),
163 constraints[i].getNativeObject(), ps[i].getNativeObject());
164 }
165 }
166
167 /**
168 * Assert a constraint into the solver, and track it (in the unsat) core

Callers 2

Calls 4

checkContextMatchMethod · 0.80
getContextMethod · 0.80
nCtxMethod · 0.80
getNativeObjectMethod · 0.80

Tested by

no test coverage detected