In imperative programming, you instruct the computer what to DO. You have created a player-piano roll, and the player-piano will render the song.
In logical programming, you instruct the computer about the known facts, and about the rules which govern the implications of unknown facts. You ask such a system a question, and the computer will scan through all of the facts and rules, recursing as necessary, until it has an answer (or it finds it impossible to solve).
If you've written a Makefile, you have used a little bit of logical programming. You specify the rules for what files depend on others, and how to build them. The facts are not specified in the Makefile but are specified by the timestamps on the files themselves. The make program simply uses the facts and the rules to prove it can get to a point where the specified target is the newest file.
However, saying that make is like Prolog is akin to saying that $a || $b is "lazy evaluation" (as was discussed here last week). It's a very very limited example, compared to the actual benefits of the methods.
This site is religiously themed. If you're a Catholic, I urge you to visit a synagogue, a mosque and a buddhist temple. Visit each one until you see what is of value, and you see what is merely the trappings of an old tradition. Go back to your own church, and you'll more easily spot the catechisms which are Catholic, except by rote. The same goes for anyone of any faith or church, by the way.
--
[ e d @ h a l l e y . c c ]
In reply to Re^4: Easy Text Adventures in Perl
by halley
in thread Easy Text Adventures in Perl
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |