The concept of “computation” in Prolog
Posted by: Edward in: Our Daily PrologReading up on various introductions to Prolog, I suddenly realize that Prolog is a language that doesn’t really compute but rather extracts knowledge implicit from declarative statements that define relations on a set of values. This means that you don’t use Prolog to tell a computer what to do (which is often what we thought programming was about) but rather you use Prolog to define facts and rules and then let the computer figure out an answer.
Although a Prolog program is a “functional” program with a “declarative” language, that is, it consists of a series of function (relation) definitions (or expressions), the execution engine of Prolog does not evaluate the expressions but rather interprets it as a question. Prolog’s execution environment is often an interactive system interpreter in which queries are posed and Prolog then tries to deduce: Is the query true in the context of the program?
On the other hand, it might be more appropriate to say that Prolog is a relational or logical (rather than functional) program. Surely, there aren’t any Prolog functions, and after all, Prolog stands for “Programming in Logic” (Programmation en Logique) and intended to use logic as a declarative knowledge representation language. If functions, however, may be regarded as a special case of relations thereby making functional programming a subset of logic programming, then Prolog tries to reconcile the declarative with the procedural representation of knowledge.
All these made me think of the concept of “computation” in Prolog and inevitably, the concept of “computation” in biological, social, cultural, political systems. As far as I’m concerned, the puny world of humans has never gotten beyond the bland and banal variety of computation that it has managed to sink itself into. For example, a comic strip in today’s newspaper shows a politician at an election campaign tour being asked such dismal questions by the public about his celebrity sister’s love life. If those are the kinds of queries Prolog gets, either the query fails or Prolog tries to resolve the query with the fact or rule by replacing the atom by the body of the rule (in the case of a fact this just means the elimination of the atom). So me dog logic isn’t surprised that human politics is an ever-expanding black hole.
Anyway, this should be enough Prolog for the day. My caregiver and her partner had a rather disappointing day (a hassle at the immigration and a visit to a craft’s shop that turned out to be a shop full of expensive junk books (I may be a dog but I know a good book from a junk book)). Luckily, a good drink of coconut juice cooled things down a bit, and a quick visit to a few shops where I got my photos taken made my caregiver happy. I rather like the dresses they had at the Kultura shop (wearing them or looking under them).

And the laundry was dry, clean and ready when we got to the Laundromat. So all’s well that ends well.

October 11th, 2007 at 10:33 pm
The distinction between “Procedural” (Imperative?) languages and Declarative languages may well have implications far beyond computers…..
Perhaps many communication problems -including those that have lead to the idea that men come from Mars and Women come from Venus could be the result of using different linguistic strategies.
There is also the traditional western philosophical problem of linking epistemology to ontology…. making sure that our “descriptions” fit the (phenomological) “existance” that they are supposed to describe. The “experience” of “insiders” might well be entirely different from the “description” given by “outsiders”….. Presumably, the (view and) descrioption that a “terrorist” has of himself is not the same as that given to him by others: During the American war of independance the Americans presumably saw themselves as “patriots” but to the British they were apparently “rebels”.
Perhaps it is important to know if our language is intended to control something -or to understand it…..
On the other hand, presumably, it is difficult to control something if we do not understand it……