The book compares it to a baker, versus a recipe. With a recipe there is a specific set of instructions that if followed exactly you should end up with the same result each time.
Prolog is like a baker - you tell it "I want a chocolate cake that is chewy, has vanilla icing between 3 layers and on top, and chocolate shavings on top as well. Here are the ingredients I have." Based on your ingredients it will make the cake (or it will just say "no" if you don't have everything it needs -- that made me laugh when the computer just said "no" when I made a mistake)
So play along:
brew install gnu-prolog
then surf over to my github repo and see what you think

You're bringing up some painful memories of mine from university years :)
ReplyDeletehttps://github.com/mondalaci/misc/blob/master/prolog-parser.pl