3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-19 20:33:38 +00:00

Managed API: Refactoring.

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2012-11-26 21:02:22 +00:00
parent 682a725e13
commit 75b1278e97
2 changed files with 8 additions and 6 deletions

View file

@ -388,7 +388,7 @@ namespace Microsoft.Z3
IntPtr[] n_constr = new IntPtr[n]; IntPtr[] n_constr = new IntPtr[n];
for (uint i = 0; i < n; i++) for (uint i = 0; i < n; i++)
{ {
var constructor = c[i]; Constructor[] constructor = c[i];
Contract.Assume(Contract.ForAll(constructor, arr => arr != null), "Clousot does not support yet quantified formula on multidimensional arrays"); Contract.Assume(Contract.ForAll(constructor, arr => arr != null), "Clousot does not support yet quantified formula on multidimensional arrays");
CheckContextMatch(constructor); CheckContextMatch(constructor);
cla[i] = new ConstructorList(this, constructor); cla[i] = new ConstructorList(this, constructor);

View file

@ -433,7 +433,8 @@ namespace Microsoft.Z3
get get
{ {
return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 && return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 &&
(Z3_sort_kind)Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject)) == Z3_sort_kind.Z3_ARRAY_SORT); (Z3_sort_kind)Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject))
== Z3_sort_kind.Z3_ARRAY_SORT);
} }
} }
@ -1308,7 +1309,8 @@ namespace Microsoft.Z3
get get
{ {
return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 && return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 &&
(Z3_sort_kind)Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject)) == Z3_sort_kind.Z3_RELATION_SORT); Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject))
== (uint)Z3_sort_kind.Z3_RELATION_SORT);
} }
} }
@ -1429,7 +1431,7 @@ namespace Microsoft.Z3
get get
{ {
return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 && return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 &&
(Z3_sort_kind)Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject)) == Z3_sort_kind.Z3_FINITE_DOMAIN_SORT); Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject)) == (uint)Z3_sort_kind.Z3_FINITE_DOMAIN_SORT);
} }
} }
@ -1489,8 +1491,8 @@ namespace Microsoft.Z3
internal override void CheckNativeObject(IntPtr obj) internal override void CheckNativeObject(IntPtr obj)
{ {
if (Native.Z3_is_app(Context.nCtx, obj) == 0 && if (Native.Z3_is_app(Context.nCtx, obj) == 0 &&
(Z3_ast_kind)Native.Z3_get_ast_kind(Context.nCtx, obj) != Z3_ast_kind.Z3_VAR_AST && Native.Z3_get_ast_kind(Context.nCtx, obj) != (uint)Z3_ast_kind.Z3_VAR_AST &&
(Z3_ast_kind)Native.Z3_get_ast_kind(Context.nCtx, obj) != Z3_ast_kind.Z3_QUANTIFIER_AST) Native.Z3_get_ast_kind(Context.nCtx, obj) != (uint)Z3_ast_kind.Z3_QUANTIFIER_AST)
throw new Z3Exception("Underlying object is not a term"); throw new Z3Exception("Underlying object is not a term");
base.CheckNativeObject(obj); base.CheckNativeObject(obj);
} }