mirror of
https://github.com/Z3Prover/z3
synced 2025-08-26 21:16:02 +00:00
Fixes in Java's User Propagator (#7088)
* Fixed decide callback for Java user propagators * Java User Prop: - Added return value to conflict - Added consequence method - Added missing access modifier to decideWrapper * Removed type parameters of expressions in UserPropagatorBase * Renamed propagateConflict to propagateConsequence
This commit is contained in:
parent
2c55aa5466
commit
d2706bab64
3 changed files with 31 additions and 17 deletions
|
@ -60,36 +60,47 @@ public abstract class UserPropagatorBase extends Native.UserPropagatorBase {
|
|||
fixed(var, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void decideWrapper(long lvar, int bit, boolean is_pos) {
|
||||
Expr var = new Expr(ctx, lvar);
|
||||
decide(var, bit, is_pos);
|
||||
}
|
||||
|
||||
public abstract void push();
|
||||
|
||||
public abstract void pop(int number);
|
||||
|
||||
public abstract UserPropagatorBase fresh(Context ctx);
|
||||
|
||||
public <R extends Sort> void created(Expr<R> ast) {}
|
||||
public void created(Expr<?> ast) {}
|
||||
|
||||
public <R extends Sort> void fixed(Expr<R> var, Expr<R> value) {}
|
||||
public void fixed(Expr<?> var, Expr<?> value) {}
|
||||
|
||||
public <R extends Sort> void eq(Expr<R> x, Expr<R> y) {}
|
||||
public void eq(Expr<?> x, Expr<?> y) {}
|
||||
|
||||
public void decide(Expr<?> var, int bit, boolean is_pos) {}
|
||||
|
||||
public void fin() {}
|
||||
|
||||
public final <R extends Sort> void add(Expr<R> expr) {
|
||||
public final void add(Expr<?> expr) {
|
||||
Native.propagateAdd(this, ctx.nCtx(), solver.getNativeObject(), javainfo, expr.getNativeObject());
|
||||
}
|
||||
|
||||
public final <R extends Sort> void conflict(Expr<R>[] fixed) {
|
||||
conflict(fixed, new Expr[0], new Expr[0]);
|
||||
public final boolean conflict(Expr<?>[] fixed) {
|
||||
return conflict(fixed, new Expr[0], new Expr[0]);
|
||||
}
|
||||
|
||||
public final <R extends Sort> void conflict(Expr<R>[] fixed, Expr<R>[] lhs, Expr<R>[] rhs) {
|
||||
AST conseq = ctx.mkBool(false);
|
||||
Native.propagateConflict(
|
||||
public final boolean conflict(Expr<?>[] fixed, Expr<?>[] lhs, Expr<?>[] rhs) {
|
||||
return consequence(fixed, lhs, rhs, ctx.mkBool(false));
|
||||
}
|
||||
|
||||
public final boolean consequence(Expr<?>[] fixed, Expr<?>[] lhs, Expr<?>[] rhs, Expr<?> conseq) {
|
||||
return Native.propagateConsequence(
|
||||
this, ctx.nCtx(), solver.getNativeObject(), javainfo,
|
||||
fixed.length, AST.arrayToNative(fixed), lhs.length, AST.arrayToNative(lhs), AST.arrayToNative(rhs), conseq.getNativeObject());
|
||||
}
|
||||
|
||||
public final <R extends Sort> boolean nextSplit(Expr<R> e, long idx, Z3_lbool phase) {
|
||||
public final boolean nextSplit(Expr<?> e, long idx, Z3_lbool phase) {
|
||||
return Native.propagateNextSplit(
|
||||
this, ctx.nCtx(), solver.getNativeObject(), javainfo,
|
||||
e.getNativeObject(), idx, phase.toInt());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue