Skip to content

Overflow in FP operators #21

@fontainep

Description

@fontainep

Levent Erkok suggested to introduce FP overflow operators (as a reaction to an email about BV overflow operators on 22 Dec 2022):

These predicates are indeed very welcome. Unlike Florian, however, I think it'd also be good to add similar functionality to float conversion functions:

; from another floating point sort
((_ to_fp eb sb) RoundingMode (_ FloatingPoint mb nb) (_ FloatingPoint eb sb))

; from real
((_ to_fp eb sb) RoundingMode Real (_ FloatingPoint eb sb))

; from signed machine integer, represented as a 2's complement bit vector
((_ to_fp eb sb) RoundingMode (_ BitVec m) (_ FloatingPoint eb sb))

; from unsigned machine integer, represented as bit vector
((_ to_fp_unsigned eb sb) RoundingMode (_ BitVec m) (_ FloatingPoint eb sb))

; to unsigned machine integer, represented as a bit vector
((_ fp.to_ubv m) RoundingMode (_ FloatingPoint eb sb) (_ BitVec m))

; to signed machine integer, represented as a 2's complement bit vector
((_ fp.to_sbv m) RoundingMode (_ FloatingPoint eb sb) (_ BitVec m))

; to real
(fp.to_real (_ FloatingPoint eb sb) Real)

For naming: If a solver wants to provide individual overflow/underflow checking, maybe it's best to name these similar to bvsadd_out_of_range; then the names bvsaddo/bvsaddu can remain free for individual solver use to indicate overflow/underflow conditions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions