The `Hamming' in Prolog

Dijkstra [1] attributes to Hamming the problem of generating the set {2i3/5 k I i , j ,k >_0} in increasing order. Kahn and MacQueen [4] showed how to solve the problem with a stream-processing program that could be implemented with concurrent processes, and since then it has often been cited as an example of a problem whose concurrent solutions are simpler than sequential ones. In fact, however, the solution in Prolog is scarcely more complex than the concurrent ones. Stream processing programs typically depend on relationships on infinite data stnactures such as the set of all 'Hamming' numbers. If we call this set H and for an integer, n, let n*H denote {n *h I h ~ H }, then H satisfies the equation