diff --git a/examples/dotnet/Program.cs b/examples/dotnet/Program.cs index 47906add4..bee44e1e7 100644 --- a/examples/dotnet/Program.cs +++ b/examples/dotnet/Program.cs @@ -363,10 +363,10 @@ namespace test_mapi Console.WriteLine("Model = " + s.Model); - //Console.WriteLine("Interpretation of MyArray:\n" + s.Model.ConstInterp(aex.FuncDecl)); + Console.WriteLine("Interpretation of MyArray:\n" + s.Model.ConstInterp(aex.FuncDecl)); Console.WriteLine("Interpretation of x:\n" + s.Model.ConstInterp(xc)); Console.WriteLine("Interpretation of f:\n" + s.Model.FuncInterp(fd)); - //Console.WriteLine("Interpretation of MyArray as Term:\n" + s.Model.ConstInterp(aex.FuncDecl)); + Console.WriteLine("Interpretation of MyArray as Term:\n" + s.Model.ConstInterp(aex.FuncDecl)); } /// diff --git a/src/api/dotnet/Model.cs b/src/api/dotnet/Model.cs index c0cb091b0..0238ff974 100644 --- a/src/api/dotnet/Model.cs +++ b/src/api/dotnet/Model.cs @@ -51,9 +51,8 @@ namespace Microsoft.Z3 Debug.Assert(f != null); Context.CheckContextMatch(f); - if (f.Arity != 0 || - Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_range(Context.nCtx, f.NativeObject)) == (uint)Z3_sort_kind.Z3_ARRAY_SORT) - throw new Z3Exception("Non-zero arity functions and arrays have FunctionInterpretations as a model. Use FuncInterp."); + if (f.Arity != 0) + throw new Z3Exception("Non-zero arity functions have FunctionInterpretations as a model. Use FuncInterp."); IntPtr n = Native.Z3_model_get_const_interp(Context.nCtx, NativeObject, f.NativeObject); if (n == IntPtr.Zero) diff --git a/src/api/java/Model.java b/src/api/java/Model.java index 8dc8d794b..4c9abef7a 100644 --- a/src/api/java/Model.java +++ b/src/api/java/Model.java @@ -50,12 +50,9 @@ public class Model extends Z3Object { public Expr getConstInterp(FuncDecl f) { getContext().checkContextMatch(f); - if (f.getArity() != 0 - || Native.getSortKind(getContext().nCtx(), - Native.getRange(getContext().nCtx(), f.getNativeObject())) == Z3_sort_kind.Z3_ARRAY_SORT - .toInt()) + if (f.getArity() != 0) throw new Z3Exception( - "Non-zero arity functions and arrays have FunctionInterpretations as a model. Use getFuncInterp."); + "Non-zero arity functions have FunctionInterpretations as a model. Use getFuncInterp."); long n = Native.modelGetConstInterp(getContext().nCtx(), getNativeObject(), f.getNativeObject());