3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 03:15:50 +00:00

Java bindings: Force cleaning the queue on context closing.

This commit is contained in:
George Karpenkov 2016-06-29 13:09:05 +02:00
parent 8aee7129f6
commit cb87991d5f
4 changed files with 67 additions and 47 deletions

View file

@ -87,12 +87,11 @@ public class Fixedpoint extends Z3Object
/**
* Add rule into the fixedpoint solver.
*
*
* @param name Nullable rule name.
* @throws Z3Exception
**/
public void addRule(BoolExpr rule, Symbol name)
{
public void addRule(BoolExpr rule, Symbol name) {
getContext().checkContextMatch(rule);
Native.fixedpointAddRule(getContext().nCtx(), getNativeObject(),
rule.getNativeObject(), AST.getNativeObject(name));
@ -103,11 +102,10 @@ public class Fixedpoint extends Z3Object
*
* @throws Z3Exception
**/
public void addFact(FuncDecl pred, int ... args)
{
public void addFact(FuncDecl pred, int ... args) {
getContext().checkContextMatch(pred);
Native.fixedpointAddFact(getContext().nCtx(), getNativeObject(),
pred.getNativeObject(), (int) args.length, args);
pred.getNativeObject(), args.length, args);
}
/**
@ -119,9 +117,7 @@ public class Fixedpoint extends Z3Object
*
* @throws Z3Exception
**/
public Status query(BoolExpr query)
{
public Status query(BoolExpr query) {
getContext().checkContextMatch(query);
Z3_lbool r = Z3_lbool.fromInt(Native.fixedpointQuery(getContext().nCtx(),
getNativeObject(), query.getNativeObject()));
@ -144,9 +140,7 @@ public class Fixedpoint extends Z3Object
*
* @throws Z3Exception
**/
public Status query(FuncDecl[] relations)
{
public Status query(FuncDecl[] relations) {
getContext().checkContextMatch(relations);
Z3_lbool r = Z3_lbool.fromInt(Native.fixedpointQueryRelations(getContext()
.nCtx(), getNativeObject(), AST.arrayLength(relations), AST
@ -166,8 +160,7 @@ public class Fixedpoint extends Z3Object
* Creates a backtracking point.
* @see #pop
**/
public void push()
{
public void push() {
Native.fixedpointPush(getContext().nCtx(), getNativeObject());
}
@ -178,19 +171,17 @@ public class Fixedpoint extends Z3Object
*
* @see #push
**/
public void pop()
{
public void pop() {
Native.fixedpointPop(getContext().nCtx(), getNativeObject());
}
/**
* Update named rule into in the fixedpoint solver.
*
*
* @param name Nullable rule name.
* @throws Z3Exception
**/
public void updateRule(BoolExpr rule, Symbol name)
{
public void updateRule(BoolExpr rule, Symbol name) {
getContext().checkContextMatch(rule);
Native.fixedpointUpdateRule(getContext().nCtx(), getNativeObject(),
rule.getNativeObject(), AST.getNativeObject(name));