3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-08 07:03:23 +00:00

Java API: split incRef into incRef and addToReferenceQueue

One method should do one thing only, it's easy to mix things up
otherwise.
This commit is contained in:
George Karpenkov 2016-06-12 21:01:58 +02:00
parent 2a347f04bf
commit 22ffd65d1e
20 changed files with 150 additions and 87 deletions

View file

@ -22,8 +22,7 @@ import com.microsoft.z3.enumerations.Z3_lbool;
/**
* Solvers.
**/
public class Solver extends Z3Object
{
public class Solver extends Z3Object {
/**
* A string that describes all available solver parameters.
**/
@ -154,13 +153,13 @@ public class Solver extends Z3Object
* using the Boolean constant p.
*
* Remarks:
* This API is an alternative to {@link check} with assumptions for
* This API is an alternative to {@link #check} with assumptions for
* extracting unsat cores.
* Both APIs can be used in the same solver. The unsat core will contain a
* combination
* of the Boolean variables provided using {@link assertAndTrack}
* of the Boolean variables provided using {@link #assertAndTrack}
* and the Boolean literals
* provided using {@link check} with assumptions.
* provided using {@link #check} with assumptions.
*/
public void assertAndTrack(BoolExpr constraint, BoolExpr p)
{
@ -333,8 +332,12 @@ public class Solver extends Z3Object
}
@Override
void incRef(long o) {
Native.solverIncRef(getContext().nCtx(), o);
void incRef() {
Native.solverIncRef(getContext().nCtx(), getNativeObject());
}
@Override
void addToReferenceQueue() {
getContext().getSolverDRQ().storeReference(getContext(), this);
}
}