18 package com.microsoft.z3;
37 getContext().checkContextMatch(a);
52 getContext().checkContextMatch(f);
54 || Native.getSortKind(getContext().nCtx(),
55 Native.getRange(getContext().nCtx(), f.getNativeObject())) ==
Z3_sort_kind.Z3_ARRAY_SORT
58 "Non-zero arity functions and arrays have FunctionInterpretations as a model. Use getFuncInterp.");
60 long n = Native.modelGetConstInterp(getContext().nCtx(), getNativeObject(),
65 return Expr.create(getContext(), n);
78 getContext().checkContextMatch(f);
81 .nCtx(), Native.getRange(getContext().nCtx(), f.getNativeObject())));
85 long n = Native.modelGetConstInterp(getContext().nCtx(),
86 getNativeObject(), f.getNativeObject());
94 if (!Native.isAsArray(getContext().nCtx(), n))
96 "Argument was not an array constant");
97 long fd = Native.getAsArrayFuncDecl(getContext().nCtx(), n);
103 "Constant functions do not have a function interpretation; use getConstInterp");
107 long n = Native.modelGetFuncInterp(getContext().nCtx(),
108 getNativeObject(), f.getNativeObject());
121 return Native.modelGetNumConsts(getContext().nCtx(), getNativeObject());
133 for (
int i = 0; i < n; i++)
134 res[i] =
new FuncDecl(getContext(), Native.modelGetConstDecl(getContext()
135 .nCtx(), getNativeObject(), i));
144 return Native.modelGetNumFuncs(getContext().nCtx(), getNativeObject());
156 for (
int i = 0; i < n; i++)
157 res[i] =
new FuncDecl(getContext(), Native.modelGetFuncDecl(getContext()
158 .nCtx(), getNativeObject(), i));
171 int n = nFuncs + nConsts;
173 for (
int i = 0; i < nConsts; i++)
174 res[i] =
new FuncDecl(getContext(), Native.modelGetConstDecl(getContext()
175 .nCtx(), getNativeObject(), i));
176 for (
int i = 0; i < nFuncs; i++)
177 res[nConsts + i] =
new FuncDecl(getContext(), Native.modelGetFuncDecl(
178 getContext().nCtx(), getNativeObject(), i));
186 @SuppressWarnings(
"serial")
213 Native.LongPtr v =
new Native.LongPtr();
214 if (!Native.modelEval(getContext().nCtx(), getNativeObject(),
215 t.getNativeObject(), (completion), v))
218 return Expr.create(getContext(), v.value);
228 return eval(t, completion);
237 return Native.modelGetNumSorts(getContext().nCtx(), getNativeObject());
256 for (
int i = 0; i < n; i++)
257 res[i] =
Sort.create(getContext(),
258 Native.modelGetSort(getContext().nCtx(), getNativeObject(), i));
275 getContext().nCtx(), getNativeObject(), s.getNativeObject()));
286 return Native.modelToString(getContext().nCtx(), getNativeObject());
296 Native.modelIncRef(getContext().nCtx(), getNativeObject());
300 void addToReferenceQueue() {
Expr evaluate(Expr t, boolean completion)
Z3_sort_kind
The different kinds of Z3 types (See #Z3_get_sort_kind).
Expr getConstInterp(Expr a)
Expr [] getSortUniverse(Sort s)
Expr getConstInterp(FuncDecl f)
FuncDecl [] getFuncDecls()
Expr eval(Expr t, boolean completion)
ModelEvaluationFailedException()
IDecRefQueue< Model > getModelDRQ()
void storeReference(Context ctx, T obj)
FuncDecl [] getConstDecls()
def String(name, ctx=None)
FuncInterp getFuncInterp(FuncDecl f)