mirror of
https://github.com/Z3Prover/z3
synced 2025-06-28 08:58:44 +00:00
FPA theory and API overhaul
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
parent
a28454d95e
commit
09247d2e29
9 changed files with 944 additions and 331 deletions
641
src/api/z3_fpa.h
641
src/api/z3_fpa.h
|
@ -7,7 +7,7 @@ Module Name:
|
|||
|
||||
Abstract:
|
||||
|
||||
Additional APIs for floating-point arithmetic (FPA).
|
||||
Additional APIs for floating-point arithmetic (FP).
|
||||
|
||||
Author:
|
||||
|
||||
|
@ -36,7 +36,7 @@ extern "C" {
|
|||
/*@{*/
|
||||
|
||||
/**
|
||||
\brief Create a rounding mode sort.
|
||||
\brief Create the RoundingMode sort.
|
||||
|
||||
\param c logical context.
|
||||
|
||||
|
@ -45,7 +45,7 @@ extern "C" {
|
|||
Z3_sort Z3_API Z3_mk_fpa_rounding_mode_sort(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of rounding mode sort which represents the NearestTiesToEven rounding mode.
|
||||
\brief Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.
|
||||
|
||||
\param c logical context.
|
||||
|
||||
|
@ -54,7 +54,16 @@ extern "C" {
|
|||
Z3_ast Z3_API Z3_mk_fpa_round_nearest_ties_to_even(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of rounding mode sort which represents the NearestTiesToAway rounding mode.
|
||||
\brief Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.
|
||||
|
||||
\param c logical context.
|
||||
|
||||
def_API('Z3_mk_fpa_rne', AST, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_rne(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.
|
||||
|
||||
\param c logical context.
|
||||
|
||||
|
@ -63,25 +72,52 @@ extern "C" {
|
|||
Z3_ast Z3_API Z3_mk_fpa_round_nearest_ties_to_away(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of rounding mode sort which represents the TowardPositive rounding mode.
|
||||
\brief Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.
|
||||
|
||||
\param c logical context.
|
||||
|
||||
def_API('Z3_mk_fpa_rna', AST, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_rna(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of RoundingMode sort which represents the TowardPositive rounding mode.
|
||||
|
||||
\param c logical context.
|
||||
|
||||
def_API('Z3_mk_fpa_round_toward_positive', AST, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_round_toward_positive(__in Z3_context c);
|
||||
Z3_ast Z3_API Z3_mk_fpa_round_toward_positive(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of rounding mode sort which represents the TowardNegative rounding mode.
|
||||
\brief Create a numeral of RoundingMode sort which represents the TowardPositive rounding mode.
|
||||
|
||||
\param c logical context.
|
||||
|
||||
def_API('Z3_mk_fpa_rtp', AST, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_rtp(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of RoundingMode sort which represents the TowardNegative rounding mode.
|
||||
|
||||
\param c logical context.
|
||||
|
||||
def_API('Z3_mk_fpa_round_toward_negative', AST, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_round_toward_negative(__in Z3_context c);
|
||||
Z3_ast Z3_API Z3_mk_fpa_round_toward_negative(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of rounding mode sort which represents the TowardZero rounding mode.
|
||||
\brief Create a numeral of RoundingMode sort which represents the TowardNegative rounding mode.
|
||||
|
||||
\param c logical context.
|
||||
|
||||
def_API('Z3_mk_fpa_rtn', AST, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_rtn(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of RoundingMode sort which represents the TowardZero rounding mode.
|
||||
|
||||
\param c logical context.
|
||||
|
||||
|
@ -89,14 +125,21 @@ extern "C" {
|
|||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_round_toward_zero(__in Z3_context c);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
\brief Create a floating point sort.
|
||||
\brief Create a numeral of RoundingMode sort which represents the TowardZero rounding mode.
|
||||
|
||||
\param c logical context.
|
||||
\param ebits number of exponent bits
|
||||
\param sbits number of significand bits
|
||||
|
||||
def_API('Z3_mk_fpa_rtz', AST, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_rtz(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create a FloatingPoint sort.
|
||||
|
||||
\param c logical context.
|
||||
\param ebits number of exponent bits.
|
||||
\param sbits number of significand bits.
|
||||
|
||||
\remark ebits must be larger than 1 and sbits must be larger than 2.
|
||||
|
||||
|
@ -105,85 +148,61 @@ extern "C" {
|
|||
Z3_sort Z3_API Z3_mk_fpa_sort(__in Z3_context c, __in unsigned ebits, __in unsigned sbits);
|
||||
|
||||
/**
|
||||
\brief Create the half-precision (16-bit) floating point sort.
|
||||
\brief Create the half-precision (16-bit) FloatingPoint sort.
|
||||
|
||||
\param c logical context.
|
||||
\param ebits number of exponent bits
|
||||
\param sbits number of significand bits
|
||||
|
||||
\remark ebits must be larger than 1 and sbits must be larger than 2.
|
||||
|
||||
def_API('Z3_mk_fpa_sort_half', SORT, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_sort Z3_API Z3_mk_fpa_sort_half(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create the half-precision (16-bit) floating point sort.
|
||||
\brief Create the half-precision (16-bit) FloatingPoint sort.
|
||||
|
||||
\param c logical context.
|
||||
\param ebits number of exponent bits
|
||||
\param sbits number of significand bits
|
||||
\param c logical context.
|
||||
|
||||
\remark ebits must be larger than 1 and sbits must be larger than 2.
|
||||
|
||||
def_API('Z3_mk_fpa_sort_16', SORT, (_in(CONTEXT),))
|
||||
def_API('Z3_mk_fpa_sort_16', SORT, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_sort Z3_API Z3_mk_fpa_sort_16(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create the single-precision (32-bit) floating point sort.
|
||||
\brief Create the single-precision (32-bit) FloatingPoint sort.
|
||||
|
||||
\param c logical context.
|
||||
\param ebits number of exponent bits
|
||||
\param sbits number of significand bits
|
||||
|
||||
\remark ebits must be larger than 1 and sbits must be larger than 2.
|
||||
\param c logical context.
|
||||
|
||||
def_API('Z3_mk_fpa_sort_single', SORT, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_sort Z3_API Z3_mk_fpa_sort_single(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create the single-precision (32-bit) floating point sort.
|
||||
\brief Create the single-precision (32-bit) FloatingPoint sort.
|
||||
|
||||
\param c logical context.
|
||||
\param ebits number of exponent bits
|
||||
\param sbits number of significand bits
|
||||
\param c logical context.
|
||||
|
||||
\remark ebits must be larger than 1 and sbits must be larger than 2.
|
||||
|
||||
def_API('Z3_mk_fpa_sort_32', SORT, (_in(CONTEXT),))
|
||||
def_API('Z3_mk_fpa_sort_32', SORT, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_sort Z3_API Z3_mk_fpa_sort_32(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create the double-precision (64-bit) floating point sort.
|
||||
\brief Create the double-precision (64-bit) FloatingPoint sort.
|
||||
|
||||
\param c logical context.
|
||||
\param ebits number of exponent bits
|
||||
\param sbits number of significand bits
|
||||
|
||||
\remark ebits must be larger than 1 and sbits must be larger than 2.
|
||||
|
||||
def_API('Z3_mk_fpa_sort_double', SORT, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_sort Z3_API Z3_mk_fpa_sort_double(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create the double-precision (64-bit) floating point sort.
|
||||
\brief Create the double-precision (64-bit) FloatingPoint sort.
|
||||
|
||||
\param c logical context.
|
||||
\param ebits number of exponent bits
|
||||
\param sbits number of significand bits
|
||||
\param c logical context.
|
||||
|
||||
\remark ebits must be larger than 1 and sbits must be larger than 2.
|
||||
|
||||
def_API('Z3_mk_fpa_sort_64', SORT, (_in(CONTEXT),))
|
||||
def_API('Z3_mk_fpa_sort_64', SORT, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_sort Z3_API Z3_mk_fpa_sort_64(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create the quadruple-precision (128-bit) floating point sort.
|
||||
\brief Create the quadruple-precision (128-bit) FloatingPoint sort.
|
||||
|
||||
\param c logical context.
|
||||
\param ebits number of exponent bits
|
||||
|
@ -196,15 +215,15 @@ extern "C" {
|
|||
Z3_sort Z3_API Z3_mk_fpa_sort_quadruple(__in Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Create the quadruple-precision (128-bit) floating point sort.
|
||||
\brief Create the quadruple-precision (128-bit) FloatingPoint sort.
|
||||
|
||||
\param c logical context.
|
||||
\param ebits number of exponent bits
|
||||
\param sbits number of significand bits
|
||||
\param c logical context.
|
||||
\param ebits number of exponent bits
|
||||
\param sbits number of significand bits
|
||||
|
||||
\remark ebits must be larger than 1 and sbits must be larger than 2.
|
||||
\remark ebits must be larger than 1 and sbits must be larger than 2.
|
||||
|
||||
def_API('Z3_mk_fpa_sort_128', SORT, (_in(CONTEXT),))
|
||||
def_API('Z3_mk_fpa_sort_128', SORT, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_sort Z3_API Z3_mk_fpa_sort_128(__in Z3_context c);
|
||||
|
||||
|
@ -219,7 +238,7 @@ extern "C" {
|
|||
Z3_ast Z3_API Z3_mk_fpa_nan(__in Z3_context c, __in Z3_sort s);
|
||||
|
||||
/**
|
||||
\brief Create a floating point infinity of sort s.
|
||||
\brief Create a floating-point infinity of sort s.
|
||||
|
||||
\param c logical context.
|
||||
\param s target sort
|
||||
|
@ -232,29 +251,64 @@ extern "C" {
|
|||
Z3_ast Z3_API Z3_mk_fpa_inf(__in Z3_context c, __in Z3_sort s, __in Z3_bool negative);
|
||||
|
||||
/**
|
||||
\brief Create a floating point zero of sort s.
|
||||
\brief Create a floating-point zero of sort s.
|
||||
|
||||
\param c logical context.
|
||||
\param s target sort
|
||||
\param negative indicates whether the result should be negative
|
||||
\param c logical context.
|
||||
\param s target sort
|
||||
\param negative indicates whether the result should be negative
|
||||
|
||||
When \c negative is true, -zero will be generated instead of +zero.
|
||||
When \c negative is true, -zero will be generated instead of +zero.
|
||||
|
||||
def_API('Z3_mk_fpa_zero', AST, (_in(CONTEXT),_in(SORT),_in(BOOL)))
|
||||
def_API('Z3_mk_fpa_zero', AST, (_in(CONTEXT),_in(SORT),_in(BOOL)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_zero(__in Z3_context c, __in Z3_sort s, __in Z3_bool negative);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of floating point sort from a double.
|
||||
\brief Create an expression of FloatingPoint sort from three bit-vector expressions.
|
||||
|
||||
Note that \c sign is required to be a bit-vector of size 1. Significand and exponent
|
||||
are required to be greater than 1 and 2 respectively. The FloatingPoint sort
|
||||
of the resulting expression is automatically determined from the bit-vector sizes
|
||||
of the arguments.
|
||||
|
||||
\params c logical context.
|
||||
\params sgn sign
|
||||
\params sig significand
|
||||
\params exp exponent
|
||||
|
||||
def_API('Z3_mk_fpa_fp', AST, (_in(CONTEXT), _in(AST), _in(AST), _in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_fp(__in Z3_context c, __in Z3_ast sgn, __in Z3_ast sig, __in Z3_ast exp);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of FloatingPoint sort from a float.
|
||||
|
||||
This function is used to create numerals that fit in a float value.
|
||||
It is slightly faster than #Z3_mk_numeral since it is not necessary to parse a string.
|
||||
|
||||
\params c logical context.
|
||||
\params v value.
|
||||
\params ty sort.
|
||||
|
||||
ty must be a FloatingPoint sort
|
||||
|
||||
\sa Z3_mk_numeral
|
||||
|
||||
def_API('Z3_mk_fpa_numeral_float', AST, (_in(CONTEXT), _in(FLOAT), _in(SORT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_numeral_float(__in Z3_context c, __in float v, __in Z3_sort ty);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of FloatingPoint sort from a double.
|
||||
|
||||
This function can be use to create numerals that fit in a double value.
|
||||
This function is used to create numerals that fit in a double value.
|
||||
It is slightly faster than #Z3_mk_numeral since it is not necessary to parse a string.
|
||||
|
||||
\params c logical context.
|
||||
\params v value.
|
||||
\params ty sort.
|
||||
|
||||
ty must be a floating point sort
|
||||
ty must be a FloatingPoint sort
|
||||
|
||||
\sa Z3_mk_numeral
|
||||
|
||||
|
@ -262,13 +316,57 @@ extern "C" {
|
|||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_numeral_double(__in Z3_context c, __in double v, __in Z3_sort ty);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of FloatingPoint sort from a signed integer.
|
||||
|
||||
\params c logical context.
|
||||
\params v value.
|
||||
|
||||
ty must be a FloatingPoint sort
|
||||
|
||||
\sa Z3_mk_numeral
|
||||
|
||||
def_API('Z3_mk_fpa_numeral_int', AST, (_in(CONTEXT), _in(INT), _in(SORT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_numeral_int(__in Z3_context c, __in signed v, Z3_sort ty);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of FloatingPoint sort from a sign bit and two integers.
|
||||
|
||||
\params c logical context.
|
||||
\params sgn sign bit (true == negative).
|
||||
\params sig significand.
|
||||
\params exp exponent.
|
||||
|
||||
ty must be a FloatingPoint sort
|
||||
|
||||
\sa Z3_mk_numeral
|
||||
|
||||
def_API('Z3_mk_fpa_numeral_uint_int', AST, (_in(CONTEXT), _in(BOOL), _in(UINT), _in(INT), _in(SORT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_numeral_uint_int(__in Z3_context c, __in bool sgn, __in unsigned sig, __in signed exp, Z3_sort ty);
|
||||
|
||||
/**
|
||||
\brief Create a numeral of FloatingPoint sort from a sign bit and two 64-bit integers.
|
||||
|
||||
\params c logical context.
|
||||
\params sgn sign bit (true == negative).
|
||||
\params sig significand.
|
||||
\params exp exponent.
|
||||
|
||||
ty must be a FloatingPoint sort
|
||||
|
||||
\sa Z3_mk_numeral
|
||||
|
||||
def_API('Z3_mk_fpa_numeral_uint64_int64', AST, (_in(CONTEXT), _in(BOOL), _in(UINT64), _in(INT64), _in(SORT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_numeral_uint64_int64(__in Z3_context c, __in bool sgn, __in __uint64 sig, __in __int64 exp, Z3_sort ty);
|
||||
|
||||
/**
|
||||
\brief Floating-point absolute value
|
||||
|
||||
\param c logical context.
|
||||
\param t floating-point term.
|
||||
|
||||
t must have floating point sort.
|
||||
\param t term of FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_abs', AST, (_in(CONTEXT),_in(AST)))
|
||||
*/
|
||||
|
@ -278,9 +376,7 @@ extern "C" {
|
|||
\brief Floating-point negation
|
||||
|
||||
\param c logical context.
|
||||
\param t floating-point term.
|
||||
|
||||
t must have floating point sort.
|
||||
\param t term of FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_neg', AST, (_in(CONTEXT),_in(AST)))
|
||||
*/
|
||||
|
@ -290,11 +386,11 @@ extern "C" {
|
|||
\brief Floating-point addition
|
||||
|
||||
\param c logical context.
|
||||
\param rm rounding mode
|
||||
\param t1 floating-point term.
|
||||
\param t2 floating-point term.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param t1 term of FloatingPoint sort.
|
||||
\param t2 term of FloatingPoint sort.
|
||||
|
||||
rm must be of FPA rounding mode sort, t1 and t2 must have the same floating point sort.
|
||||
rm must be of RoundingMode sort, t1 and t2 must have the same FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_add', AST, (_in(CONTEXT),_in(AST),_in(AST),_in(AST)))
|
||||
*/
|
||||
|
@ -304,11 +400,11 @@ extern "C" {
|
|||
\brief Floating-point subtraction
|
||||
|
||||
\param c logical context.
|
||||
\param rm rounding mode
|
||||
\param t1 floating-point term.
|
||||
\param t2 floating-point term.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param t1 term of FloatingPoint sort.
|
||||
\param t2 term of FloatingPoint sort.
|
||||
|
||||
rm must be of FPA rounding mode sort, t1 and t2 must have the same floating point sort.
|
||||
rm must be of RoundingMode sort, t1 and t2 must have the same FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_sub', AST, (_in(CONTEXT),_in(AST),_in(AST),_in(AST)))
|
||||
*/
|
||||
|
@ -318,11 +414,11 @@ extern "C" {
|
|||
\brief Floating-point multiplication
|
||||
|
||||
\param c logical context.
|
||||
\param rm rounding mode
|
||||
\param t1 floating-point term.
|
||||
\param t2 floating-point term.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param t1 term of FloatingPoint sort.
|
||||
\param t2 term of FloatingPoint sort.
|
||||
|
||||
rm must be of FPA rounding mode sort, t1 and t2 must have the same floating point sort.
|
||||
rm must be of RoundingMode sort, t1 and t2 must have the same FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_mul', AST, (_in(CONTEXT),_in(AST),_in(AST),_in(AST)))
|
||||
*/
|
||||
|
@ -332,11 +428,11 @@ extern "C" {
|
|||
\brief Floating-point division
|
||||
|
||||
\param c logical context.
|
||||
\param rm rounding mode
|
||||
\param t1 floating-point term.
|
||||
\param t2 floating-point term.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param t1 term of FloatingPoint sort.
|
||||
\param t2 term of FloatingPoint sort.
|
||||
|
||||
The nodes rm must be of FPA rounding mode sort t1 and t2 must have the same floating point sort.
|
||||
The nodes rm must be of RoundingMode sort t1 and t2 must have the same FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_div', AST, (_in(CONTEXT),_in(AST),_in(AST),_in(AST)))
|
||||
*/
|
||||
|
@ -346,13 +442,13 @@ extern "C" {
|
|||
\brief Floating-point fused multiply-add.
|
||||
|
||||
\param c logical context.
|
||||
\param rm rounding mode
|
||||
\param t1 floating-point term.
|
||||
\param t2 floating-point term.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param t1 term of FloatingPoint sort.
|
||||
\param t2 term of FloatingPoint sort.
|
||||
|
||||
The result is round((t1 * t2) + t3)
|
||||
|
||||
rm must be of FPA rounding mode sort, t1, t2, and t3 must have the same floating point sort.
|
||||
rm must be of RoundingMode sort, t1, t2, and t3 must have the same FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_fma', AST, (_in(CONTEXT),_in(AST),_in(AST),_in(AST),_in(AST)))
|
||||
*/
|
||||
|
@ -362,10 +458,10 @@ extern "C" {
|
|||
\brief Floating-point square root
|
||||
|
||||
\param c logical context.
|
||||
\param rm rounding mode
|
||||
\param t floating-point term.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param t term of FloatingPoint sort.
|
||||
|
||||
rm must be of FPA rounding mode sort, t must have floating point sort.
|
||||
rm must be of RoundingMode sort, t must have FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_sqrt', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
*/
|
||||
|
@ -375,198 +471,387 @@ extern "C" {
|
|||
\brief Floating-point remainder
|
||||
|
||||
\param c logical context.
|
||||
\param t1 floating-point term.
|
||||
\param t2 floating-point term.
|
||||
\param t1 term of FloatingPoint sort.
|
||||
\param t2 term of FloatingPoint sort.
|
||||
|
||||
t1 and t2 must have the same floating point sort.
|
||||
t1 and t2 must have the same FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_rem', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_rem(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
|
||||
Z3_ast Z3_API Z3_mk_fpa_rem(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
|
||||
/**
|
||||
\brief Floating-point equality
|
||||
\brief Floating-point roundToIntegral. Rounds a floating-point number to
|
||||
the closest integer, again represented as a floating-point number.
|
||||
|
||||
\param c logical context.
|
||||
\param t1 floating-point term.
|
||||
\param t2 floating-point term.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param t term of FloatingPoint sort.
|
||||
|
||||
Note that this is IEEE 754 equality (as opposed to SMT-LIB =).
|
||||
t must be of FloatingPoint sort.
|
||||
|
||||
t1 and t2 must have the same floating point sort.
|
||||
|
||||
def_API('Z3_mk_fpa_eq', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_eq(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
def_API('Z3_mk_fpa_round_to_integral', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_round_to_integral(__in Z3_context c, __in Z3_ast rm, __in Z3_ast t);
|
||||
|
||||
/**
|
||||
\brief Minimum of floating-point numbers
|
||||
|
||||
\param c logical context.
|
||||
\param t1 term of FloatingPoint sort.
|
||||
\param t2 term of FloatingPoint sort.
|
||||
|
||||
t1, t2 must have the same FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_min', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_min(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
|
||||
/**
|
||||
\brief Maximum of floating-point numbers
|
||||
|
||||
\param c logical context.
|
||||
\param t1 term of FloatingPoint sort.
|
||||
\param t2 term of FloatingPoint sort.
|
||||
|
||||
t1, t2 must have the same FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_max', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_max(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
|
||||
/**
|
||||
\brief Floating-point less than or equal
|
||||
|
||||
\param c logical context.
|
||||
\param t1 floating-point term.
|
||||
\param t2 floating-point term.
|
||||
\param t1 term of FloatingPoint sort.
|
||||
\param t2 term of FloatingPoint sort.
|
||||
|
||||
t1 and t2 must have the same floating point sort.
|
||||
t1 and t2 must have the same FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_le', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
def_API('Z3_mk_fpa_leq', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_le(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
Z3_ast Z3_API Z3_mk_fpa_leq(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
|
||||
/**
|
||||
\brief Floating-point less-than
|
||||
|
||||
\param c logical context.
|
||||
\param t1 floating-point term.
|
||||
\param t2 floating-point term.
|
||||
\param t1 term of FloatingPoint sort.
|
||||
\param t2 term of FloatingPoint sort.
|
||||
|
||||
t1 and t2 must have the same floating point sort.
|
||||
t1 and t2 must have the same FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_lt', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_lt(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
\brief Floating-point greater than or equal
|
||||
|
||||
\param c logical context.
|
||||
\param t1 floating-point term.
|
||||
\param t2 floating-point term.
|
||||
\param t1 term of FloatingPoint sort.
|
||||
\param t2 term of FloatingPoint sort.
|
||||
|
||||
t1 and t2 must have the same floating point sort.
|
||||
t1 and t2 must have the same FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_ge', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
def_API('Z3_mk_fpa_geq', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_ge(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
Z3_ast Z3_API Z3_mk_fpa_geq(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
|
||||
/**
|
||||
\brief Floating-point greater-than
|
||||
|
||||
\param c logical context.
|
||||
\param t1 floating-point term.
|
||||
\param t2 floating-point term.
|
||||
\param t1 term of FloatingPoint sort.
|
||||
\param t2 term of FloatingPoint sort.
|
||||
|
||||
t1 and t2 must have the same floating point sort.
|
||||
t1 and t2 must have the same FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_gt', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_gt(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
|
||||
|
||||
/**
|
||||
\brief Predicate indicating whether t is a normal floating point number
|
||||
\brief Floating-point equality
|
||||
|
||||
\param c logical context.
|
||||
\param t floating-point term.
|
||||
\param t1 term of FloatingPoint sort.
|
||||
\param t2 term of FloatingPoint sort.
|
||||
|
||||
t must have floating point sort.
|
||||
Note that this is IEEE 754 equality (as opposed to SMT-LIB =).
|
||||
|
||||
t1 and t2 must have the same FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_eq', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_eq(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
|
||||
/**
|
||||
\brief Predicate indicating whether t is a normal floating-point number.
|
||||
|
||||
\param c logical context.
|
||||
\param t term of FloatingPoint sort.
|
||||
|
||||
t must have FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_is_normal', AST, (_in(CONTEXT),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_is_normal(__in Z3_context c, __in Z3_ast t);
|
||||
|
||||
/**
|
||||
\brief Predicate indicating whether t is a subnormal floating point number
|
||||
\brief Predicate indicating whether t is a subnormal floating-point number.
|
||||
|
||||
\param c logical context.
|
||||
\param t floating-point term.
|
||||
\param t term of FloatingPoint sort.
|
||||
|
||||
t must have floating point sort.
|
||||
t must have FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_is_subnormal', AST, (_in(CONTEXT),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_is_subnormal(__in Z3_context c, __in Z3_ast t);
|
||||
|
||||
/**
|
||||
\brief Predicate indicating whether t is a floating point number with zero value, i.e., +0 or -0.
|
||||
\brief Predicate indicating whether t is a floating-point number with zero value, i.e., +zero or -zero.
|
||||
|
||||
\param c logical context.
|
||||
\param t floating-point term.
|
||||
\param t term of FloatingPoint sort.
|
||||
|
||||
t must have floating point sort.
|
||||
t must have FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_is_zero', AST, (_in(CONTEXT),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_is_zero(__in Z3_context c, __in Z3_ast t);
|
||||
|
||||
/**
|
||||
\brief Predicate indicating whether t is a floating point number representing +Inf or -Inf
|
||||
\brief Predicate indicating whether t is a floating-point number representing +oo or -oo.
|
||||
|
||||
\param c logical context.
|
||||
\param t floating-point term.
|
||||
\param t term of FloatingPoint sort.
|
||||
|
||||
t must have floating point sort.
|
||||
t must have FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_is_inf', AST, (_in(CONTEXT),_in(AST)))
|
||||
def_API('Z3_mk_fpa_is_infinite', AST, (_in(CONTEXT),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_is_inf(__in Z3_context c, __in Z3_ast t);
|
||||
Z3_ast Z3_API Z3_mk_fpa_is_infinite(__in Z3_context c, __in Z3_ast t);
|
||||
|
||||
/**
|
||||
\brief Predicate indicating whether t is a NaN
|
||||
|
||||
\param c logical context.
|
||||
\param t floating-point term.
|
||||
\param t term of FloatingPoint sort.
|
||||
|
||||
t must have floating point sort.
|
||||
t must have FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_is_nan', AST, (_in(CONTEXT),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_is_nan(__in Z3_context c, __in Z3_ast t);
|
||||
|
||||
/**
|
||||
\brief Minimum of floating point numbers
|
||||
\brief Predicate indicating whether t is a negative floating-point number.
|
||||
|
||||
\param c logical context.
|
||||
\param t1 floating-point term.
|
||||
\param t2 floating-point term.
|
||||
\param t term of FloatingPoint sort.
|
||||
|
||||
t1, t2 must have the same floating point sort.
|
||||
|
||||
def_API('Z3_mk_fpa_min', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_min(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
|
||||
/**
|
||||
\brief Maximum of floating point numbers
|
||||
t must have FloatingPoint sort.
|
||||
|
||||
\param c logical context.
|
||||
\param t1 floating-point term.
|
||||
\param t2 floating-point term.
|
||||
|
||||
t1, t2 must have the same floating point sort.
|
||||
|
||||
def_API('Z3_mk_fpa_max', AST, (_in(CONTEXT),_in(AST),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_max(__in Z3_context c, __in Z3_ast t1, __in Z3_ast t2);
|
||||
def_API('Z3_mk_fpa_is_negative', AST, (_in(CONTEXT),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_is_negative(__in Z3_context c, __in Z3_ast t);
|
||||
|
||||
/**
|
||||
\brief Conversion of a floating point number to another floating-point sort s.
|
||||
|
||||
Produces a term that represents the conversion of a floating-point term t to a different
|
||||
floating point sort s. If necessary, rounding according to rm is applied.
|
||||
\brief Predicate indicating whether t is a positive floating-point number.
|
||||
|
||||
\param c logical context.
|
||||
\param t term of FloatingPoint sort.
|
||||
|
||||
t must have FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_is_positive', AST, (_in(CONTEXT),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_is_positive(__in Z3_context c, __in Z3_ast t);
|
||||
|
||||
/**
|
||||
\brief Conversion of a single IEEE 754-2008 bit-vector into a floating-point number.
|
||||
|
||||
Produces a term that represents the conversion of a bit-vector term bv to a
|
||||
floating-point term of sort s.
|
||||
|
||||
\param c logical context.
|
||||
\param bv a bit-vector term.
|
||||
\param s floating-point sort.
|
||||
\param rm rounding mode.
|
||||
\param t floating-point term.
|
||||
|
||||
s must be a floating point sort, rm must have rounding mode sort, and t must have floating point sort.
|
||||
s must be a FloatingPoint sort, t must be of bit-vector sort, and the bit-vector
|
||||
size of bv, m, must be equal to ebits+sbits of s. The format of the bit-vector is
|
||||
as defined by the IEEE 754-2008 interchange format and the resulting floating-point
|
||||
sort (ebits, sbits) is automatically determined.
|
||||
|
||||
def_API('Z3_mk_fpa_convert', AST, (_in(CONTEXT),_in(SORT),_in(AST),_in(AST)))
|
||||
def_API('Z3_mk_fpa_to_fp_bv', AST, (_in(CONTEXT),_in(AST),_in(SORT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_convert(__in Z3_context c, __in Z3_sort s, __in Z3_ast rm, __in Z3_ast t);
|
||||
Z3_ast Z3_API Z3_mk_fpa_to_fp_bv(__in Z3_context c, __in Z3_ast bv, __in Z3_sort s);
|
||||
|
||||
/**
|
||||
\brief Conversion of a floating point term to a bit-vector term in IEEE754 format.
|
||||
\brief Conversion of a floating-point term into another floating-point term of different floating-point sort.
|
||||
|
||||
Produces a term that represents the conversion of a floating-point term t to a
|
||||
floating-point term of sort s. If necessary, the result will be rounded according
|
||||
to rounding mode rm.
|
||||
|
||||
\param c logical context.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param t term of FloatingPoint sort.
|
||||
\param s floating-point sort.
|
||||
|
||||
s must be a FloatingPoint sort, rm must be of RoundingMode sort, t must be of floating-point sort.
|
||||
|
||||
def_API('Z3_mk_fpa_to_fp_float', AST, (_in(CONTEXT),_in(AST),_in(AST),_in(SORT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_to_fp_float(__in Z3_context c, __in Z3_ast rm, __in Z3_ast t, __in Z3_sort s);
|
||||
|
||||
/**
|
||||
\brief Conversion of a term of real sort into a term of FloatingPoint sort.
|
||||
|
||||
Produces a term that represents the conversion of term t of real sort into a
|
||||
floating-point term of sort s. If necessary, the result will be rounded according
|
||||
to rounding mode rm.
|
||||
|
||||
\param c logical context.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param t term of Real sort.
|
||||
\param s floating-point sort.
|
||||
|
||||
s must be a FloatingPoint sort, rm must be of RoundingMode sort, t must be of real sort.
|
||||
|
||||
def_API('Z3_mk_fpa_to_fp_real', AST, (_in(CONTEXT),_in(AST),_in(AST),_in(SORT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_to_fp_real(__in Z3_context c, __in Z3_ast rm, __in Z3_ast t, __in Z3_sort s);
|
||||
|
||||
/**
|
||||
\brief Conversion of a 2's complement signed bit-vector term into a term of FloatingPoint sort.
|
||||
|
||||
Produces a term that represents the conversion of the bit-vector term t into a
|
||||
floating-point term of sort s. The bit-vector t is taken to be in signed
|
||||
2's complement format. If necessary, the result will be rounded according
|
||||
to rounding mode rm.
|
||||
|
||||
\param c logical context.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param t term of bit-vector sort.
|
||||
\param s floating-point sort.
|
||||
|
||||
s must be a FloatingPoint sort, rm must be of RoundingMode sort, t must be of bit-vector sort.
|
||||
|
||||
def_API('Z3_mk_fpa_to_fp_signed', AST, (_in(CONTEXT),_in(AST),_in(AST),_in(SORT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_to_fp_signed(__in Z3_context c, __in Z3_ast rm, __in Z3_ast t, __in Z3_sort s);
|
||||
|
||||
/**
|
||||
\brief Conversion of a 2's complement unsigned bit-vector term into a term of FloatingPoint sort.
|
||||
|
||||
Produces a term that represents the conversion of the bit-vector term t into a
|
||||
floating-point term of sort s. The bit-vector t is taken to be in unsigned
|
||||
2's complement format. If necessary, the result will be rounded according
|
||||
to rounding mode rm.
|
||||
|
||||
\param c logical context.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param t term of bit-vector sort.
|
||||
\param s floating-point sort.
|
||||
|
||||
s must be a FloatingPoint sort, rm must be of RoundingMode sort, t must be of bit-vector sort.
|
||||
|
||||
def_API('Z3_mk_fpa_to_fp_unsigned', AST, (_in(CONTEXT),_in(AST),_in(AST),_in(SORT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_to_fp_unsigned(__in Z3_context c, __in Z3_ast rm, __in Z3_ast t, __in Z3_sort s);
|
||||
|
||||
/**
|
||||
\brief Conversion of a floating-point term into an unsigned bit-vector.
|
||||
|
||||
Produces a term that represents the conversion of the floating-poiunt term t into a
|
||||
bit-vector term in unsigned 2's complement format. If necessary, the result will be
|
||||
rounded according to rounding mode rm.
|
||||
|
||||
\param c logical context.
|
||||
\param t floating-point term.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param t term of FloatingPoint sort.
|
||||
\param sz size of the resulting bit-vector.
|
||||
|
||||
t must have floating point sort. The size of the resulting bit-vector is automatically determined.
|
||||
def_API('Z3_mk_fpa_to_ubv', AST, (_in(CONTEXT),_in(AST),_in(AST),_in(UINT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_to_ubv(__in Z3_context c, __in Z3_ast rm, __in Z3_ast t, __in unsigned sz);
|
||||
|
||||
/**
|
||||
\brief Conversion of a floating-point term into a signed bit-vector.
|
||||
|
||||
Produces a term that represents the conversion of the floating-poiunt term t into a
|
||||
bit-vector term in signed 2's complement format. If necessary, the result will be
|
||||
rounded according to rounding mode rm.
|
||||
|
||||
\param c logical context.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param t term of FloatingPoint sort.
|
||||
\param sz size of the resulting bit-vector.
|
||||
|
||||
def_API('Z3_mk_fpa_to_sbv', AST, (_in(CONTEXT),_in(AST),_in(AST),_in(UINT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_to_sbv(__in Z3_context c, __in Z3_ast rm, __in Z3_ast t, __in unsigned sz);
|
||||
|
||||
/**
|
||||
\brief Conversion of a floating-point term into a real number.
|
||||
|
||||
Produces a term that represents the conversion of the floating-poiunt term t into a
|
||||
real number. Note that this type of conversion will often result in non-linear
|
||||
constraints over real terms.
|
||||
|
||||
\param c logical context.
|
||||
\param t term of FloatingPoint sort.
|
||||
|
||||
def_API('Z3_mk_fpa_to_real', AST, (_in(CONTEXT),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_to_real(__in Z3_context c, __in Z3_ast t);
|
||||
|
||||
/**
|
||||
@name Z3-specific extensions
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
\brief Conversion of a floating-point term into a bit-vector term in IEEE 754-2008 format.
|
||||
|
||||
\param c logical context.
|
||||
\param t term of FloatingPoint sort.
|
||||
|
||||
t must have FloatingPoint sort. The size of the resulting bit-vector is automatically
|
||||
determined.
|
||||
|
||||
Note that IEEE 754-2008 allows multiple different representations of NaN. This conversion
|
||||
knows only one NaN and it will always produce the same bit-vector represenatation of
|
||||
that NaN.
|
||||
|
||||
def_API('Z3_mk_fpa_to_ieee_bv', AST, (_in(CONTEXT),_in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_to_ieee_bv(__in Z3_context c, __in Z3_ast t);
|
||||
|
||||
/**
|
||||
\brief Conversion of a real-sorted significand and an integer-sorted exponent into a term of FloatingPoint sort.
|
||||
|
||||
Produces a term that represents the conversion of sig * 2^exp into a
|
||||
floating-point term of sort s. If necessary, the result will be rounded
|
||||
according to rounding mode rm.
|
||||
|
||||
\param c logical context.
|
||||
\param rm term of RoundingMode sort.
|
||||
\param sig significand term of Real sort.
|
||||
\param exp exponent term of Real sort.
|
||||
\param s floating-point sort.
|
||||
|
||||
s must be a FloatingPoint sort, rm must be of RoundingMode sort, t must be of real sort.
|
||||
|
||||
def_API('Z3_mk_fpa_to_fp_real_int', AST, (_in(CONTEXT),_in(AST),_in(AST),_in(AST),_in(SORT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_to_fp_real_int(__in Z3_context c, __in Z3_ast rm, __in Z3_ast sig, __in Z3_ast exp, __in Z3_sort s);
|
||||
|
||||
/*@}*/
|
||||
|
||||
/*@}*/
|
||||
/*@}*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue