Subj : Re: Compiler and an interpreter To : comp.programming From : Arthur J. O'Dwyer Date : Sun Aug 07 2005 05:33 pm On Sat, 6 Aug 2005, Gerry Quinn wrote: > usenet@jdh30.plus.com says... >> >> nth(i, 0) = {i} >> nth(i, 1) = neighbours(i) >> nth(i, n) = union(j in nth(i,n-1), nth(i, 1)) - nth(i, n-1) - nth(i, n-2) >> >> where neighbours(i) gives the set of neighbours of "i". > > I don't understand the last line, so I may have solved a different > problem! I don't know for sure, but I strongly suspect nth(i, n) = union(j in nth(i,n-1), nth(i, 1)) - ... was supposed to read nth(i, n) = union(j in nth(i,n-1), nth(j, 1)) - ... Otherwise, what's the point of mentioning 'j'? Once that change is made, I think it's easy to read the expression as calculating, as you said, > nth( i, n ) = all neighbours of nth( i, n-1 ), that don't appear in > nth( i, n-1 ) or nth( i, n-2 ) -Arthur .