4 ms·
Prolog is my favorite example language I use to convey the concept of how different programming paradigms lend themselves to different types of problems. After
by gnarbarian 12y ago
Prolog is my favorite example language I use to convey the concept of how different programming paradigms lend themselves to different types of problems. After learning the syntax and mechanics prolog seems like a ridiculous language that was written to win a drunken bet with a philosopher. but given the right problem it feels like using black magic.
Solving Einstein's riddle[1] is trivial in prolog for example. But perhaps only because we know that the answer can be determined from the premises.
1) http://en.m.wikipedia.org/wiki/Zebra_Puzzle http://en.m.wikipedia.org/wiki/Zebra_Puzzle
- zmonx 12y agoSee also the SWI-Prolog example: http://swish.swi-prolog.org/example/houses_puzzle.pl http://swish.swi-prolog.org/example/houses_puzzle.pl