34 public static class Entry<R
extends Sort> extends
Z3Object {
45 Native.funcEntryGetValue(getContext().nCtx(), getNativeObject()));
52 public int getNumArgs()
54 return Native.funcEntryGetNumArgs(getContext().nCtx(), getNativeObject());
67 for (
int i = 0; i < n; i++)
68 res[i] =
Expr.create(getContext(), Native.funcEntryGetArg(
69 getContext().nCtx(), getNativeObject(), i));
77 public String toString()
82 for (
int i = 0; i < n; i++)
83 res += args[i] +
", ";
84 return res + getValue() +
"]";
93 Native.funcEntryIncRef(getContext().nCtx(), getNativeObject());
97 void addToReferenceQueue() {
98 getContext().getReferenceQueue().storeReference(
this, FuncEntryRef::new);
101 private static class FuncEntryRef
extends Z3ReferenceQueue.Reference<Entry<?>> {
103 private FuncEntryRef(Entry<?> referent, ReferenceQueue<Z3Object> q) {
108 void decRef(
Context ctx,
long z3Obj) {
109 Native.funcEntryDecRef(ctx.
nCtx(), z3Obj);
121 return Native.funcInterpGetNumEntries(getContext().nCtx(), getNativeObject());
132 int n = getNumEntries();
133 Entry<R>[] res =
new Entry[n];
134 for (
int i = 0; i < n; i++)
135 res[i] =
new Entry<>(getContext(), Native.funcInterpGetEntry(getContext()
136 .nCtx(), getNativeObject(), i));
150 Native.funcInterpGetElse(getContext().nCtx(), getNativeObject()));
160 return Native.funcInterpGetArity(getContext().nCtx(), getNativeObject());
170 for (Entry<R> e : getEntries())
172 int n = e.getNumArgs();
176 for (
int i = 0; i < n; i++)
184 res +=
" -> " + e.getValue() +
", ";
186 res +=
"else -> " + getElse();
198 Native.funcInterpIncRef(getContext().nCtx(), getNativeObject());
202 void addToReferenceQueue() {
203 getContext().getReferenceQueue().storeReference(
this, FuncInterpRef::new);
206 private static class FuncInterpRef
extends Z3ReferenceQueue.Reference<FuncInterp<?>> {
208 private FuncInterpRef(FuncInterp<?> referent, ReferenceQueue<Z3Object> q) {
213 void decRef(Context ctx,
long z3Obj) {
214 Native.funcInterpDecRef(ctx.nCtx(), z3Obj);