Skip to content

What is Prolog, anyway?

A simple explanation for outsiders

Conventional wisdom says that computers work just because someone "programs" them; otherwise they are unable to do anything on their own (that allows us to be confident our world won't turn into Terminator's, at least for now). In other words, we need to give computers specific instructions. step by step, to achieve a specific goal. Well, those instructions are not written in a human language, but in certain "computer languages" appropriately called programming languages.

As each person, research center or college, at every corner of our planet, has his own ideas about how a perfect language should be, or best suited to a specific task, it is easy to deduce that a lot of them have been invented (Wikipedia lists about 700 "official" languages, but thousand of them exist, because continually new ones are developed or adapted from others). Most of them are "procedural", meaning that each of those steps are indeed a command: do a sum, assign a variable, show a message on screen, and the like. Any commercial program is composed of thousands of commands like those along with their data, occupying lines of code. BASIC is a classic (and old...) example, Pascal and C are another classic ones, Swift is a modern one.

Prolog, on the other hand, is a declarative language: instead of instructing a computer "how" to resolve a problem, Prolog allows me (in a certain context) to just describe "what" is the problem, and let it solve it for me.

This language showed up in 1972, and in the '80s had a lot of publicity, because Japan decided Prolog would be an optimal language for their fifth generation computing project. Although it didn't happen, truth is Prolog reach a status of a superior language, thanks to have useful features to studying and solving problems now considered classic in the field of AI (Artificial Intelligence).

Personally, this language fascinated me (even today) to the point of convincing to my thesis advisor to build an interpreter for it (something I've been researching on my own and got quite well understood), with the excuse it may be useful to logic formalization of engineering problems, which is also true, let me say. Building a new interpreter with the introduction of new features is a possible task for my retirement.

Here you will find some resources: