3

What are real numbers in Dafny. Are they represented as IEEE 754-2008 floating point numbers? If not, then what are they? I.e., what is the specification of the real type in Dafny?

Kevin S
  • 497
  • 2
  • 10
  • if you find an answer helpful, please upvote it, and accept the one that is best. see https://stackoverflow.com/help/someone-answers – James Wilcox Feb 11 '18 at 22:25

1 Answers1

4

Dafny's real numbers are not floating point numbers.

From a verification perspective, they are the mathematical real numbers, and Dafny reasons about them using Z3's theory of real arithmetic.

From a compilation perspective, Dafny actually compiles them to BigRationals, which is made possible by the fact that Dafny doesn't have any builtin operations for creating irrational real numbers.

James Wilcox
  • 5,307
  • 16
  • 25