next up previous
Next: Indiscernables and Java
Up: The causes
Previous: The causes

The non-objecthood of mathematical entities

The disease responsible for these symptoms is that Java fails to distinguish between objects and entities such as numbers, vectors, and strings. Following philosophical terminology [Kneale] we shall refer to the latter as indiscernables. It is important to understand the difference.

Abstracting from our everyday experience, an object is something which can change and yet still retain its identity: objects have histories and behaviour. A very important characteristic of objects is that they exist in space. Two objects might have exactly the same properties, but if they are in different positions, then they are different objects. In fact, an object's position helps contribute to its identity.

These intuitions about objects can be formulated more precisely: a nice discussion will be found in A Treatise on Time and Space [Lucas]. As Lucas points out problems with our intuitions arise when objects --- amoebae and paramecia, for example --- fuse and split, but this does not detract from our arguments.

Now note that numbers are not objects. They have no identity apart from their value: all copies of 3 are the same number, regardless of where they live inside a computer, on a piece of paper, or wherever. There is no way to change 3, or any property of 3 (its primality, its factors, its role as the square root of 9) and for it still to retain its identity as 3. Numbers do not exist in physical space, and do not have histories or behaviours.

This argumentation applies equally to vectors, matrices, sets, groups and other mathematical entities. Changing any property (such as one component of a vector, or one node in a graph) generates a new entity of the same type, not a different ''version'' of the same entity. Hence, there is no analogue of physical time or space in which to locate these entities; and they do not have histories or behaviours. Like numbers, these are indiscernables.

A structure of particular importance to programming is the list. Lists are not objects for the same reason that the mathematical entities are not. Many languages, including all the logic-programming languages, and all the pure functional languages, do indeed treat them as indiscernables. This can be seen by the way these languages handle equality. A list's identity is determined only by its value, so two lists should be equal if and only if they have the same value: and this is the way equality works in all the logic-programming and pure functional languages we know.


next up previous
Next: Indiscernables and Java
Up: The causes
Previous: The causes



Jocelyn Ireson-Paine
Mon Jan 12 14:15:07 GMT 1998