18 package com.microsoft.z3;
38 synchronized(creation_lock) {
39 m_ctx = Native.mkInterpolationContext(0);
54 synchronized(creation_lock) {
55 long cfg = Native.mkConfig();
57 Native.setParamValue(cfg, kv.getKey(), kv.getValue());
58 m_ctx = Native.mkInterpolationContext(cfg);
59 Native.delConfig(cfg);
75 return new BoolExpr(
this, Native.mkInterpolant(nCtx(), a.getNativeObject()));
87 checkContextMatch(pf);
88 checkContextMatch(pat);
91 ASTVector seq =
new ASTVector(
this, Native.getInterpolant(nCtx(), pf.getNativeObject(), pat.getNativeObject(), p.getNativeObject()));
111 checkContextMatch(pat);
112 checkContextMatch(p);
115 Native.LongPtr n_i =
new Native.LongPtr();
116 Native.LongPtr n_m =
new Native.LongPtr();
117 res.
status =
Z3_lbool.fromInt(Native.computeInterpolant(nCtx(), pat.getNativeObject(), p.getNativeObject(), n_i, n_m));
133 return Native.interpolationProfile(nCtx());
151 Native.StringPtr n_err_str =
new Native.StringPtr();
154 Expr.arrayToNative(cnsts),
156 Expr.arrayToNative(interps),
159 Expr.arrayToNative(theory));
160 res.
error = n_err_str.value;
183 Native.IntPtr n_num =
new Native.IntPtr();
184 Native.IntPtr n_num_theory =
new Native.IntPtr();
185 Native.ObjArrayPtr n_cnsts =
new Native.ObjArrayPtr();
186 Native.UIntArrayPtr n_parents =
new Native.UIntArrayPtr();
187 Native.ObjArrayPtr n_theory =
new Native.ObjArrayPtr();
188 Native.StringPtr n_err_str =
new Native.StringPtr();
189 res.
return_value = Native.readInterpolationProblem(nCtx(), n_num, n_cnsts, n_parents, filename, n_err_str, n_num_theory, n_theory);
190 int num = n_num.value;
191 int num_theory = n_num_theory.value;
192 res.
error = n_err_str.value;
195 theory =
new Expr[num_theory];
196 for (
int i = 0; i < num; i++)
198 res.
cnsts[i] =
Expr.create(
this, n_cnsts.value[i]);
199 res.
parents[i] = n_parents.value[i];
201 for (
int i = 0; i < num_theory; i++)
202 res.
theory[i] =
Expr.create(
this, n_theory.value[i]);
214 Native.writeInterpolationProblem(nCtx(), cnsts.length,
Expr.arrayToNative(cnsts), parents, filename, theory.length,
Expr.arrayToNative(theory));
static InterpolationContext mkContext(Map< String, String > settings)
BoolExpr [] ToBoolExprArray()
ReadInterpolationProblemResult ReadInterpolationProblem(String filename, Expr[] cnsts, int[] parents, String error, Expr[] theory)
Z3_lbool
Lifted Boolean type: false, undefined, true.
BoolExpr MkInterpolant(BoolExpr a)
String InterpolationProfile()
void WriteInterpolationProblem(String filename, Expr[] cnsts, int[] parents, String error, Expr[] theory)
ComputeInterpolantResult ComputeInterpolant(Expr pat, Params p)
static InterpolationContext mkContext()
BoolExpr [] GetInterpolant(Expr pf, Expr pat, Params p)
CheckInterpolantResult CheckInterpolant(Expr[] cnsts, int[] parents, BoolExpr[] interps, String error, Expr[] theory)
def String(name, ctx=None)