mirror of
https://github.com/Z3Prover/z3
synced 2025-11-25 23:19:32 +00:00
add on_binding callbacks across APIs
update release notes, add to Java, .Net, C++
This commit is contained in:
parent
30830aae75
commit
fa3d341b18
6 changed files with 90 additions and 1 deletions
|
|
@ -153,6 +153,12 @@ static void decide_eh(void* _p, Z3_solver_callback cb, Z3_ast _val, unsigned bit
|
|||
info->jenv->CallVoidMethod(info->jobj, info->decide, (jlong)_val, bit, is_pos);
|
||||
}
|
||||
|
||||
static boolean on_binding_eh(void* _p, Z3_solver_callback cb, Z3_ast _q, Z3_ast _inst) {
|
||||
JavaInfo *info = static_cast<JavaInfo*>(_p);
|
||||
ScopedCB scoped(info, cb);
|
||||
return info->jenv->CallVoidMethod(info->jobj, info->on_binding, (jlong)_q, (jlong)_inst);
|
||||
}
|
||||
|
||||
DLL_VIS JNIEXPORT jlong JNICALL Java_com_microsoft_z3_Native_propagateInit(JNIEnv *jenv, jclass cls, jobject jobj, jlong ctx, jlong solver) {
|
||||
JavaInfo *info = new JavaInfo;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,13 @@ public abstract class UserPropagatorBase extends Native.UserPropagatorBase {
|
|||
eq(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final boolean onBindingWrapper(long lq, long linst) {
|
||||
Expr q = new Expr(ctx, lq);
|
||||
Expr inst = new Expr(ctx, linst);
|
||||
return on_binding(q, inst);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final UserPropagatorBase freshWrapper(long lctx) {
|
||||
return fresh(new Context(lctx));
|
||||
|
|
@ -77,6 +84,8 @@ public abstract class UserPropagatorBase extends Native.UserPropagatorBase {
|
|||
public void fixed(Expr<?> var, Expr<?> value) {}
|
||||
|
||||
public void eq(Expr<?> x, Expr<?> y) {}
|
||||
|
||||
public boolean on_binding(Expr<?> q, Expr<?> inst) { return true; }
|
||||
|
||||
public void decide(Expr<?> var, int bit, boolean is_pos) {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue