3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 16:45:31 +00:00

Bugfix for Expr.isInt in .NET, Java, ML.

Fixes #370
This commit is contained in:
Christoph M. Wintersteiger 2015-12-10 15:13:55 +00:00
parent 0e701138e1
commit 383d06b225
3 changed files with 3 additions and 13 deletions

View file

@ -337,11 +337,7 @@ namespace Microsoft.Z3
/// </summary>
public bool IsInt
{
get
{
return (Native.Z3_is_numeral_ast(Context.nCtx, NativeObject) != 0 &&
Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject)) == (uint)Z3_sort_kind.Z3_INT_SORT);
}
get { return Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject)) == (uint)Z3_sort_kind.Z3_INT_SORT; }
}
/// <summary>

View file

@ -415,10 +415,7 @@ public class Expr extends AST
**/
public boolean isInt()
{
return (Native.isNumeralAst(getContext().nCtx(), getNativeObject()) && Native
.getSortKind(getContext().nCtx(),
Native.getSort(getContext().nCtx(), getNativeObject())) == Z3_sort_kind.Z3_INT_SORT
.toInt());
return Native.getSortKind(getContext().nCtx(), Native.getSort(getContext().nCtx(), getNativeObject())) == Z3_sort_kind.Z3_INT_SORT.toInt();
}
/**
@ -428,9 +425,7 @@ public class Expr extends AST
**/
public boolean isReal()
{
return Native.getSortKind(getContext().nCtx(),
Native.getSort(getContext().nCtx(), getNativeObject())) == Z3_sort_kind.Z3_REAL_SORT
.toInt();
return Native.getSortKind(getContext().nCtx(), Native.getSort(getContext().nCtx(), getNativeObject())) == Z3_sort_kind.Z3_REAL_SORT.toInt();
}
/**

View file

@ -1545,7 +1545,6 @@ end
module Arithmetic =
struct
let is_int ( x : expr ) =
(Z3native.is_numeral_ast (Expr.gnc x) (Expr.gno x)) &&
((sort_kind_of_int (Z3native.get_sort_kind (Expr.gnc x) (Z3native.get_sort (Expr.gnc x) (Expr.gno x)))) == INT_SORT)
let is_arithmetic_numeral ( x : expr ) = (AST.is_app (Expr.ast_of_expr x)) && (FuncDecl.get_decl_kind (Expr.get_func_decl x) == OP_ANUM)