Saturday
Sep182004

The Principles of Specification

Properties are functions on objects.  For example:

  • The fields of records are property functions of those records.
  • The fields and attributes of objects are property functions of those objects.
  • Associations between objects are property functions of the source objects.
  • Procedures and operations on objects can also be seen as property functions on those objects. This is even when they only bring about a change of state in the object, and do not appear to return any value.  In these cases it is possible to regard the next state of an object as a property of that object, and to consequently treat it as a property function.
  • Time is also is also a property function of objects.  This has far-reaching implications for object identity which I shall go into in a later article on Object Identity and Time.
Any property function can be applied to any object to yield a unique value.  However, unless that property has been explicitly constrained for that class of object, we cannot deduce anything about what that unique value might be (or what its properties might be).  For example, applying the property function square to the integer 4 would yield 16, but it would also be possible to apply colour to 4 and it would yield a unique answer but, unless we had specified what the colour of that integer should be, we would not be able to deduce anything about that value; we could not even say whether it was an integer: it could be the real number pi/4, or the character string "Xy$#!", or even an object representing a bank account.

Every object has an infinite number of properties.  Two objects are identical if and only if they yield the same value for every one of these properties, even the ones that are unspecified.  In effect, this means that variables can only be identical if they refer to the same object (all their properties are the same so they are the same - this is one half of Leibniz's definition of identity: the useful half).

This object identity corresponds to reference semantics in programming languages.  It is what we get when we manipulate and copy pointers to objects rather than the objects themselves.  The pointers can be thought of as object identifiers.

The apparently more simple value semantics is actually more complicated. This is got by restricting comparisons and copying to a finite subset of properties.  For example, to compare two points on the Euclidean plane we use a function that compares only their x and y coordinates and ignores all other properties.  This form of comparison is more complicated because you need a separate special-purpose comparison function for each finite subset of properties.  For example, if we think of the above two points as being in 3-dimensional Euclidean space the function would compare the x, y and z coordinates and ignore the rest.

 

Saturday
Sep182004

Chiffchaffs

On Thursday morning I got off the train at Farnborough North and was surprised to hear the alternating two-note song of a chiffchaff as I walked over the bridge. 

It was back in the spring that I first noticed one of these small, non-descript warblers belting out its distinctive song from high up on a power line, and was so intrigued that I took the trouble to look it up in BWP-CE.  It was the repetitive two-note song and the fact that it was sung from high up that convinced me that it was a chiffchaff (Phylloscopus collybita).  Over the next few weeks I would regularly hear two or even three of them each morning as I walked the half-mile through the woods to Frimley, but I never again managed to see any of them.   The song is so distinctive that I am sure that I would remember if I had heard it before, but I am fairly sure I haven't.  The two-note phrase is repeated between about five and ten times and then is followed by a lower and quieter brrr-brrr-brrr sound. 

During the summer I noticed that the chiffchaffs were no longer singing, or were only doing so much less frequently than in the spring.  Hence my surprise to hear one singing again at the start of autumn.

Friday
Sep172004

Children's Books for Adults

For me, one of the greatest joys of being a father has been reading books to my daughter Zoe at bed time.  When she was just a year or two old I used to read her Edward Lear verses to lull her to sleep.  The Jumblies and The Courtship of the Yonghy-Bonghy-Bo were always very good for this because they were so soporifically repetitive.  I remember also using some of the Dr. Seuss books for the same reason (Green Eggs and Ham, There's a Wocket in My Pocket, and others).  However, most books aimed at the under-threes are rather boring for adults and in those years I left most of the bed-time reading to my wife Liz.

It wasn't until Zoe was three or four that I started to take reading to her really seriously.  I began hanging around in the children's sections of Waterstone's and Blackwell's (our local bookshops here in Reading at the time - Blackwell's has since closed) looking for something that I would enjoy reading to to her.  In this way I discovered the Dilly Dinosaur books by Tony Bradman (with the wonderful pictures by Susan Hellard), the Kitty books by Bel Mooney, and the Horrid Henry books by Francesca Simon.  These were always great fun to read to Zoe because she identified with the naughty children in them.  She became so keen on Dilly Dinosaur that she even tried to read it by herself, and whenever she came across a word she didn't know she would come though and ask me or Liz what it was.

Amongst the books that I remember from that time were Tove Jansson's Moomin books.  We started with a copy of Comet in Moominland which Liz still had from when she was young.  We then worked our way through all of the other ones we could find in the town library.  These are wonderfully dreamy stories which have some quite grown-up themes running through them (like the impending destruction of the world in Comet in Moominland, and a father's failure in the eyes of his family in Moominpappa at Sea).  Don't be put off by the cute little cartoon characters - these are as much fun for adults to read as they are for children to listen to.

However, it was when Zoe was five that our bed time reading really took off.  It was then that I read her The Hobbit.  I knew that it was a bit advanced for her (I first had it read to me at school when I was seven) so I took care to explain some things, simplify others, and gloss over some of the battle scenes.  But she enjoyed it so much that, when I told her that the characters Bilbo and Gollum also appear in another, much bigger book by Tolkien, she pestered me to read The Lord of the Rings to her as well.

So, at Christmas 2000 I started on The Lord of the Rings, reading her only half a chapter an evening.  Sometimes Zoe would fall asleep while I was reading, but mostly she kept awake and followed the story remarkably well.  I again took care to explain things that she might find difficult (this was especially necessary as nearly every character seems to have at least three different names).  She had to wait a long time for Gollum to make his appearance (it is only around page 600 that he gets to speak, though we do get occasional glimpses of him from about page 400 onwards.)  She liked the chapter where Merry and Pippin met Treebeard.  It wasn't until the middle of the spring that we reached the last page.

But that wasn't the end if it.  Later in 2001, BBC Radio re-broadcast their thirteen part radio adaptation, which I taped, and which Zoe listened to over and over again.  And then there was Peter Jackson's film, starting with the first part in December 2001.  I was a bit worried that the film would be too violent for Zoe, after all she was only 6 years old, and I was expecting to have to put my hands over her eyes in parts I thought unsuitable, however, she just lapped it up without any problems.  Walking home afterwards we discussed the differences between the film and the book, such as the omission of Tom Bombadil.

By now Zoe knew the story inside out and when a Lord of the Rings craze developed at school she gained much kudos amongst the boys for this.  She even took our copy of the book in to school and got into a race with two of the boys in her class to see who could finish reading it first (she won after one of boys dropped out and the other went for a weeks holiday and forgot to take his copy of the book with him).  The craze continued for the next two years, and each Christmas I took her to see the next part of the film.  In a way, I felt relieved when we came out from seeing the last film: three years is long enough to live with one book.

Going back to the spring of 2001, I had the problem of deciding what to read after the Lord of the Rings.  Anything was going to be a bit of a let down.  Again I spent my evenings searching the children's section of Waterstone's.  Among the best books I found during that time were Kensuke's Kingdom by Michael Morpurgo and When Marnie was There by Joan G. Robinson.

Zoe so enjoyed Kensuke's Kingdom that she took it to school with her and used it as her reading book in class.  It is about a boy whose parents take him on a round-the-world yacht trip and who is marooned on a tropical island.  Morpurgo has written many other good books which are worth reading, though a lot of them seem to be rather similar, but children probably don't notice this as much as adults.

When Marnie was There is definitely more of a girly book.  It is about a orphaned girl who goes to stay in a village on the Norfolk coast.  There she meets and befriends Marnie, a girl of the same age.  The ending, in which the significance of Marnie is revealed, is rather good.

Towards the end of 2003, Zoe and I together watched the final program in the BBC Television's Big Read series.  On it, various celebrities discussed the nation's five favorite books.  I let Zoe stay up late to watch this because I knew that the The Lord of the Rings was going to be on it.  However, Zoe also became interested in what was said about some of the other book, in particular Phillip Pullman's His Dark Materials trilogy. So, on my next visit to Waterstone's I checked it out and bought Northern Lights, the first book of the trilogy.

Northern Lights grabbed Zoe's attention from the first page: the idea of daemons (animals that are visible manifestations of a person's soul and accompany them everywhere) in particular seemed to her to be very like Pokemon, which she was, and still is, very keen on.  Again I had to explain parts of the story to her, but she followed it very carefully, asking intelligent questions along the way.  The reading level is similar to that of The Lord of the Rings.

We read Northern Lights, The Subtle Knife, and The Amber Spyglass, all within a couple of months.  The pace of these books, the characters, the variety of scenery, and the ideas in them, make these three book like no other children's books I have ever read.  It is useless for me to even try to summarize them; you will just have to to read them for yourself.

Friday
Sep172004

Young Adolph by Beryl Bainbridge

An imaginary story in which the the twenty-three year old Adolph Hitler comes to stay with his half-brother Alois in Liverpool.  Hitler comes across as a paranoid tramp-like figure (one of the the reviewers uses the term 'Chaplinesque' which is nicely ironic).  The level of the story is signalled when Alois' wife decides to make Adolph a replacement for his tattered shirt, but the only material available is brown linen...  There are several other similar 'forward' reference to look out for. 

An amusing read and a good antidote to all those self-important door-stopping biographies of Hitler that fill the history shelves of bookshops.

(A search on Google suggests that this story might actually have some basis in fact.  There certainly does seem to be a tradition in Liverpool that Hitler's brother lived there for a while.  However, as all the internet accounts post-date Bainbridge's 1978 story, I suppose that it is possible that the former were all derived from the latter by a process of chinese whispers.)

Friday
Sep102004

Invariants should be Unadorned

Properties that always hold, ie: invariants, should not have to be indicated by special notations.  They should be unadorned.  Special notations should only be used to indicate when a property does not always hold.

Lamport's Temporal Logic of Actions violates this principle in that a predicate P holds only in the initial state, and if you want to indicate that it always holds the you have to put a box symbol in front of it:

[]P

Similarly, in Daniel Jackson's Micromodularity Mechanism you have to use the keyword 'fact' to indicate that a predicate is invariant.

It seems obvious and natural to me that if a predicate P does not always hold then this should be indicated by an implication Q->P where Q is the condition under which P does hold.