mirror of
https://github.com/Z3Prover/z3
synced 2025-10-28 10:19:23 +00:00
workaround non-deterministic behavior of is_irrational_numeral test
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
481b177d47
commit
f1d27cd487
20 changed files with 77 additions and 77 deletions
|
|
@ -179,7 +179,7 @@ namespace Microsoft.Z3
|
|||
/// </summary>
|
||||
public bool IsNumeral
|
||||
{
|
||||
get { return Native.Z3_is_numeral_ast(Context.nCtx, NativeObject) != 0; }
|
||||
get { return Native.Z3_is_numeral_ast(Context.nCtx, NativeObject) ; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -188,7 +188,7 @@ namespace Microsoft.Z3
|
|||
/// <returns>True if the term is well-sorted, false otherwise.</returns>
|
||||
public bool IsWellSorted
|
||||
{
|
||||
get { return Native.Z3_is_well_sorted(Context.nCtx, NativeObject) != 0; }
|
||||
get { return Native.Z3_is_well_sorted(Context.nCtx, NativeObject) ; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -239,7 +239,7 @@ namespace Microsoft.Z3
|
|||
/// </summary>
|
||||
public bool IsAlgebraicNumber
|
||||
{
|
||||
get { return Native.Z3_is_algebraic_number(Context.nCtx, NativeObject) != 0; }
|
||||
get { return Native.Z3_is_algebraic_number(Context.nCtx, NativeObject); }
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
@ -256,7 +256,7 @@ namespace Microsoft.Z3
|
|||
return (IsExpr &&
|
||||
Native.Z3_is_eq_sort(Context.nCtx,
|
||||
Native.Z3_mk_bool_sort(Context.nCtx),
|
||||
Native.Z3_get_sort(Context.nCtx, NativeObject)) != 0);
|
||||
Native.Z3_get_sort(Context.nCtx, NativeObject)) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -423,7 +423,7 @@ namespace Microsoft.Z3
|
|||
{
|
||||
get
|
||||
{
|
||||
return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 &&
|
||||
return (Native.Z3_is_app(Context.nCtx, NativeObject) &&
|
||||
(Z3_sort_kind)Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject))
|
||||
== Z3_sort_kind.Z3_ARRAY_SORT);
|
||||
}
|
||||
|
|
@ -789,7 +789,7 @@ namespace Microsoft.Z3
|
|||
/// Check whether expression is a string constant.
|
||||
/// </summary>
|
||||
/// <returns>a Boolean</returns>
|
||||
public bool IsString { get { return IsApp && 0 != Native.Z3_is_string(Context.nCtx, NativeObject); } }
|
||||
public bool IsString { get { return IsApp && Native.Z3_is_string(Context.nCtx, NativeObject); } }
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve string corresponding to string constant.
|
||||
|
|
@ -1336,7 +1336,7 @@ namespace Microsoft.Z3
|
|||
{
|
||||
get
|
||||
{
|
||||
return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 &&
|
||||
return (Native.Z3_is_app(Context.nCtx, NativeObject) &&
|
||||
Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject))
|
||||
== (uint)Z3_sort_kind.Z3_RELATION_SORT);
|
||||
}
|
||||
|
|
@ -1458,7 +1458,7 @@ namespace Microsoft.Z3
|
|||
{
|
||||
get
|
||||
{
|
||||
return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 &&
|
||||
return (Native.Z3_is_app(Context.nCtx, NativeObject) &&
|
||||
Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject)) == (uint)Z3_sort_kind.Z3_FINITE_DOMAIN_SORT);
|
||||
}
|
||||
}
|
||||
|
|
@ -1822,11 +1822,13 @@ namespace Microsoft.Z3
|
|||
IntPtr s = Native.Z3_get_sort(ctx.nCtx, obj);
|
||||
Z3_sort_kind sk = (Z3_sort_kind)Native.Z3_get_sort_kind(ctx.nCtx, s);
|
||||
|
||||
if (Native.Z3_is_algebraic_number(ctx.nCtx, obj) != 0) // is this a numeral ast?
|
||||
if (Z3_sort_kind.Z3_REAL_SORT == sk &&
|
||||
Native.Z3_is_algebraic_number(ctx.nCtx, obj)) // is this a numeral ast?
|
||||
return new AlgebraicNum(ctx, obj);
|
||||
|
||||
if (Native.Z3_is_numeral_ast(ctx.nCtx, obj) != 0)
|
||||
if (Native.Z3_is_numeral_ast(ctx.nCtx, obj))
|
||||
{
|
||||
|
||||
switch (sk)
|
||||
{
|
||||
case Z3_sort_kind.Z3_INT_SORT: return new IntNum(ctx, obj);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue