Functional Programming is more Expressive than Logic Programming


Problem: The Hamming Numbers

Dijkstra attributes to Hamming the problem of building the infinite ascending sequence of all positive numbers greater than 1 containing no prime factors other than 2, 3 and 5, i.e. numbers of the form 2^i x 3^j x 5^k (i,j,k >= 0). The ideas to compute them are the following:
Try yourself before you check the Functional solution and the Prolog solution.

But Logic Programming is more Expressive than Functional Programming


Go to index