The bounded real (breal) data type

Involved: Joachim, Warwick
 

What is it?

A new type of number in Eclipse: a representation of a real as a pair of floating point bounds. While a float conceptually stands for a real that is somewhere in the vicinity of the float, a breal stands for a real that is somewhere between the given bounds. To keep terminology precise, we decided on the name bounded real rather than interval or ground interval - the latter would have invited confusion with interval variables.

Features

Predicates Syntax


Trick to convert all float constants into breals:

?- local macro(type(float),breal/2,[]).
Yes (0.00s cpu)

?- X = 3.4.
X = 3.3999999999999995__3.4000000000000004
Yes (0.00s cpu)

Problems

There are a number of rather fundamental problems associated to the idea of having reals in a programming language. No programming language can have exact representations for all reals - they are uncountable. Any one program can only deal with a countable subset of them.

Since there are uncountably many reals but only countably many names/representations, an infinite number of reals share the same representation.

Some of the usual generic Prolog properties are violated:

So why do all these problems not occur with floats? They do, of course, they are just fudged.