3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

build warnings, updates to reduce-invertible, change is_algebraic tester to use int return type

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-07-01 12:34:55 -07:00
parent b8b70c53fa
commit fad1e611aa
8 changed files with 41 additions and 18 deletions

View file

@ -119,10 +119,10 @@ extern "C" {
Z3_CATCH_RETURN(nullptr);
}
Z3_bool Z3_API Z3_is_algebraic_number(Z3_context c, Z3_ast a) {
int Z3_API Z3_is_algebraic_number(Z3_context c, Z3_ast a) {
LOG_Z3_is_algebraic_number(c, a);
Z3_bool r = mk_c(c)->autil().is_irrational_algebraic_numeral(to_expr(a)) ? Z3_TRUE : Z3_FALSE;
IF_VERBOSE(10, verbose_stream() << r << "\n");
int r = mk_c(c)->autil().is_irrational_algebraic_numeral(to_expr(a)) ? 1 : 0;
//IF_VERBOSE(10, verbose_stream() << r << "\n");
return r;
}

View file

@ -239,7 +239,7 @@ namespace Microsoft.Z3
/// </summary>
public bool IsAlgebraicNumber
{
get { return Native.Z3_is_algebraic_number(Context.nCtx, NativeObject); }
get { return 0 != Native.Z3_is_algebraic_number(Context.nCtx, NativeObject); }
}
#endregion
@ -1823,7 +1823,7 @@ namespace Microsoft.Z3
Z3_sort_kind sk = (Z3_sort_kind)Native.Z3_get_sort_kind(ctx.nCtx, s);
if ( // Z3_sort_kind.Z3_REAL_SORT == sk &&
Native.Z3_is_algebraic_number(ctx.nCtx, obj)) // is this a numeral ast?
0 != 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))

View file

@ -275,7 +275,7 @@ public class Expr extends AST
**/
public boolean isAlgebraicNumber()
{
return Native.isAlgebraicNumber(getContext().nCtx(), getNativeObject());
return 0 != Native.isAlgebraicNumber(getContext().nCtx(), getNativeObject());
}
/**
@ -2108,7 +2108,7 @@ public class Expr extends AST
Z3_sort_kind sk = Z3_sort_kind
.fromInt(Native.getSortKind(ctx.nCtx(), s));
if (Native.isAlgebraicNumber(ctx.nCtx(), obj)) // is this a numeral ast?
if (Native.isAlgebraicNumber(ctx.nCtx(), obj) != 0) // is this a numeral ast?
return new AlgebraicNum(ctx, obj);
if (Native.isNumeralAst(ctx.nCtx(), obj))

View file

@ -4397,9 +4397,9 @@ extern "C" {
/**
\brief Return true if the given AST is a real algebraic number.
def_API('Z3_is_algebraic_number', BOOL, (_in(CONTEXT), _in(AST)))
def_API('Z3_is_algebraic_number', INT, (_in(CONTEXT), _in(AST)))
*/
Z3_bool Z3_API Z3_is_algebraic_number(Z3_context c, Z3_ast a);
int Z3_API Z3_is_algebraic_number(Z3_context c, Z3_ast a);
/**
\brief Convert an \c ast into an \c APP_AST. This is just type casting.