18 package com.microsoft.z3;
38 getContext().checkContextMatch(a);
53 getContext().checkContextMatch(f);
55 || Native.getSortKind(getContext().nCtx(),
56 Native.
getRange(getContext().nCtx(), f.getNativeObject())) == Z3_sort_kind.Z3_ARRAY_SORT
59 "Non-zero arity functions and arrays have FunctionInterpretations as a model. Use FuncInterp.");
61 long n = Native.modelGetConstInterp(getContext().nCtx(), getNativeObject(),
66 return Expr.create(getContext(), n);
79 getContext().checkContextMatch(f);
81 Z3_sort_kind sk = Z3_sort_kind.fromInt(Native.getSortKind(getContext()
82 .nCtx(),
Native.
getRange(getContext().nCtx(), f.getNativeObject())));
86 long n = Native.modelGetConstInterp(getContext().nCtx(),
87 getNativeObject(), f.getNativeObject());
97 "Argument was not an array constant");
98 long fd = Native.getAsArrayFuncDecl(getContext().nCtx(), n);
104 "Constant functions do not have a function interpretation; use ConstInterp");
108 long n = Native.modelGetFuncInterp(getContext().nCtx(),
109 getNativeObject(), f.getNativeObject());
122 return Native.modelGetNumConsts(getContext().nCtx(), getNativeObject());
134 for (
int i = 0; i < n; i++)
136 .nCtx(), getNativeObject(), i));
145 return Native.modelGetNumFuncs(getContext().nCtx(), getNativeObject());
157 for (
int i = 0; i < n; i++)
159 .nCtx(), getNativeObject(), i));
172 int n = nFuncs + nConsts;
174 for (
int i = 0; i < nConsts; i++)
176 .nCtx(), getNativeObject(), i));
177 for (
int i = 0; i < nFuncs; i++)
178 res[nConsts + i] =
new FuncDecl(getContext(), Native.modelGetFuncDecl(
179 getContext().nCtx(), getNativeObject(), i));
187 @SuppressWarnings(
"serial")
213 Native.LongPtr v =
new Native.LongPtr();
215 t.getNativeObject(), (completion) ?
true :
false, v) ^
true)
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(),
275 getContext().nCtx(), getNativeObject(), s.getNativeObject()));
276 return nUniv.ToExprArray();
288 return Native.modelToString(getContext().nCtx(), getNativeObject());
291 return "Z3Exception: " + e.getMessage();
302 getContext().getModelDRQ().incAndClear(getContext(), o);
308 getContext().getModelDRQ().add(o);
Expr evaluate(Expr t, boolean completion)
Z3_sort_kind
The different kinds of Z3 types (See Z3_get_sort_kind).
Expr getConstInterp(Expr a)
static long modelGetSort(long a0, long a1, int a2)
Expr[] getSortUniverse(Sort s)
Expr getConstInterp(FuncDecl f)
FuncDecl[] getFuncDecls()
Expr eval(Expr t, boolean completion)
ModelEvaluationFailedException()
static boolean isAsArray(long a0, long a1)
FuncDecl[] getConstDecls()
static boolean modelEval(long a0, long a1, long a2, boolean a3, LongPtr a4)
static long modelGetFuncDecl(long a0, long a1, int a2)
static long modelGetSortUniverse(long a0, long a1, long a2)
static long modelGetConstDecl(long a0, long a1, int a2)
static long getRange(long a0, long a1)
FuncInterp getFuncInterp(FuncDecl f)