Skip to content

Commit 2d4e9a0

Browse files
committedJul 13, 2019
update managed APIs for lambda-based array models Z3Prover#2400
Signed-off-by: Nikolaj Bjorner <[email protected]>
1 parent 659be69 commit 2d4e9a0

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed
 

‎examples/dotnet/Program.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,10 @@ static void ArrayExample1(Context ctx)
363363

364364
Console.WriteLine("Model = " + s.Model);
365365

366-
//Console.WriteLine("Interpretation of MyArray:\n" + s.Model.ConstInterp(aex.FuncDecl));
366+
Console.WriteLine("Interpretation of MyArray:\n" + s.Model.ConstInterp(aex.FuncDecl));
367367
Console.WriteLine("Interpretation of x:\n" + s.Model.ConstInterp(xc));
368368
Console.WriteLine("Interpretation of f:\n" + s.Model.FuncInterp(fd));
369-
//Console.WriteLine("Interpretation of MyArray as Term:\n" + s.Model.ConstInterp(aex.FuncDecl));
369+
Console.WriteLine("Interpretation of MyArray as Term:\n" + s.Model.ConstInterp(aex.FuncDecl));
370370
}
371371

372372
/// <summary>

‎src/api/dotnet/Model.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ public Expr ConstInterp(FuncDecl f)
5151
Debug.Assert(f != null);
5252

5353
Context.CheckContextMatch(f);
54-
if (f.Arity != 0 ||
55-
Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_range(Context.nCtx, f.NativeObject)) == (uint)Z3_sort_kind.Z3_ARRAY_SORT)
56-
throw new Z3Exception("Non-zero arity functions and arrays have FunctionInterpretations as a model. Use FuncInterp.");
54+
if (f.Arity != 0)
55+
throw new Z3Exception("Non-zero arity functions have FunctionInterpretations as a model. Use FuncInterp.");
5756

5857
IntPtr n = Native.Z3_model_get_const_interp(Context.nCtx, NativeObject, f.NativeObject);
5958
if (n == IntPtr.Zero)

‎src/api/java/Model.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,9 @@ public Expr getConstInterp(Expr a)
5050
public Expr getConstInterp(FuncDecl f)
5151
{
5252
getContext().checkContextMatch(f);
53-
if (f.getArity() != 0
54-
|| Native.getSortKind(getContext().nCtx(),
55-
Native.getRange(getContext().nCtx(), f.getNativeObject())) == Z3_sort_kind.Z3_ARRAY_SORT
56-
.toInt())
53+
if (f.getArity() != 0)
5754
throw new Z3Exception(
58-
"Non-zero arity functions and arrays have FunctionInterpretations as a model. Use getFuncInterp.");
55+
"Non-zero arity functions have FunctionInterpretations as a model. Use getFuncInterp.");
5956

6057
long n = Native.modelGetConstInterp(getContext().nCtx(), getNativeObject(),
6158
f.getNativeObject());

0 commit comments

Comments
 (0)
Please sign in to comment.