|
3 | 3 | package inox
|
4 | 4 | package ast
|
5 | 5 |
|
6 |
| -import scala.collection.immutable |
7 | 6 | import scala.collection.immutable.BitSet
|
8 | 7 |
|
9 | 8 | /** Expression definitions for Pure Scala.
|
@@ -233,26 +232,7 @@ trait Expressions { self: Trees =>
|
233 | 232 | /** $encodingof a floating point literal */
|
234 | 233 | sealed case class FPLiteral(exponent: Int, significand: Int, value: BitSet) extends Literal[BitSet] {
|
235 | 234 | override def getType(using Symbols) = FPType(exponent, significand)
|
236 |
| - def isNegative: Boolean = !isNaN && value(exponent + significand) |
237 |
| - def isPositive: Boolean = !isNaN && !isNegative |
238 |
| - def isZero: Boolean = !Range(1, significand + exponent).exists(value) |
239 |
| - def isNumber: Boolean = !Range(significand, significand + exponent).forall(value) |
240 |
| - def isNaN: Boolean = !isNumber && Range(1, significand).exists(value) |
241 |
| - def isInfinite: Boolean = !isNumber && !isNaN |
242 | 235 | def toBV: BVLiteral = BVLiteral(true, value, exponent + significand)
|
243 |
| - |
244 |
| - def strictEquals(obj: Any): Boolean = obj match { |
245 |
| - case lit @ FPLiteral(e2, s2, v2) => exponent == e2 && significand == s2 && value == v2 |
246 |
| - case _ => false |
247 |
| - } |
248 |
| - |
249 |
| - /** Semantic equality for FP */ |
250 |
| - def semEquals(obj: Any): Boolean = obj match |
251 |
| - case lit @ FPLiteral(e2, s2, v2) => |
252 |
| - !isNaN && !lit.isNaN && ((isZero && lit.isZero) || strictEquals(obj)) |
253 |
| - case _ => strictEquals(obj) |
254 |
| - |
255 |
| - override def equals(obj: Any): Boolean = strictEquals(obj) |
256 | 236 | }
|
257 | 237 |
|
258 | 238 | object FPLiteral {
|
|
0 commit comments