My interest in Prolog was recently revived, after briefly courting the P vs NP problem, which, I was hoping, might be made solvable by the machine. While playing with the thing, I found a Prolog solution to the REVERSE game. The exercise is trivial, the point of it being merely to compare the implementation in various programming languages.
The interesting detail, however, is how the author of the Prolog solution tests if a list is sorted:
sorted(L) :- sort(L, L).
You can’t comment because I got bored with cleaning up after all the spammers and disabled comments altogether.
Long live DOS attacks (which btw are much older than technology – just try talking a woman out of her idea)!
Post a Comment
You must be logged in to post a comment.