@@ -53,11 +53,6 @@ the FloatingPoint SMT-LIB theory.
53
53
((_ ae.round prec exp) RoundingMode Real Real)
54
54
```
55
55
56
- * Note* : While Alt-Ergo has built-in support for ** computing** with ` ae.round `
57
- on known arguments, reasoning capabilities involving ` ae.round ` on non-constant
58
- arguments are disabled by default and currently requires to use the flag
59
- ` --enable-theories fpa ` .
60
-
61
56
` prec ` defines the number of bits in the significand, including the hidden bit,
62
57
and is equivalent to the ` sb ` parameter of the ` (_ FloatingPoint eb sb) ` sort
63
58
in the FloatingPoint SMT-LIB theory.
@@ -70,7 +65,7 @@ of the `(_ FloatingPoint eb sb)` sort as `exp = 2^(eb - 1) + sb - 3`.
70
65
71
66
The result of ` (_ ae.round prec exp) ` is always of the form ` (-1)^s * c * 2^q `
72
67
where ` s ` is a sign (` 0 ` or ` 1 ` ), ` c ` is an integer with at most ` prec - 1 `
73
- binary digits (i.e. ` 0 <= c < 2^(prec - 1) ` ) and ` q >= exp ` is an integer.
68
+ binary digits (i.e. ` 0 <= c < 2^(prec - 1) ` ) and ` q >= - exp ` is an integer.
74
69
75
70
The following function symbols are provided as short synonyms for common
76
71
floating point representations:
@@ -79,3 +74,28 @@ floating point representations:
79
74
- ` ae.float32 ` is a synonym for ` (_ ae.round 24 149) `
80
75
- ` ae.float64 ` is a synonym for ` (_ ae.round 53 1074) `
81
76
- ` ae.float128 ` is a synonym for ` (_ ae.round 113 16494) `
77
+
78
+ ### Examples
79
+
80
+ Input:
81
+
82
+ ``` smt-lib
83
+ (set-option :produce-models true)
84
+ (set-logic ALL)
85
+ (declare-const |0.3f32| Real)
86
+ (assert (= (ae.float32 RNE 0.3) |0.3f32|))
87
+ (declare-const |0.3f16| Real)
88
+ (assert (= (ae.float16 RNE 0.3) |0.3f16|))
89
+ (check-sat)
90
+ (get-model)
91
+ ```
92
+
93
+ Output:
94
+
95
+ ``` smt-lib
96
+ unknown
97
+ (
98
+ (define-fun |0.3f32| () Real (/ 5033165 16777216))
99
+ (define-fun |0.3f16| () Real (/ 1229 4096))
100
+ )
101
+ ```
0 commit comments