Logic Programming

Prolog (1)

Overview

Alain ColmerauerProlog is a declarative logic programming language. It was created by Alain Colmerauer and Robert Kowalski around 1972 as an alternative to the American-dominated Lisp programming languages. It is an attempt to make a programming language that enables the expression of logic instead of carefully specified instructions on the computer. Prolog has got superb pattern matching mechanism as well as good memory management. It is very commonly used in artificial intelligence applications.

The execution of a Prolog program is equivalent to searching the tree of possibilities and determining the objects which satisfy the given rules. This is equivalent to proof by proposition. Prolog has an excellent backtrack mechanism, so when exploring the tree it can always return to another branch if the present branch does not contain the answer. This approach is equivalent to depth first search which is known as an efficient algorithm for traversing trees with a large number of nodes.

Sometimes there can be several answers which are true in a given circumstances. This is because the program does not terminate as soon as the first answer is found, but keeps going until the entire tree of possibilities has been checked.

Prolog is a conversational language, meaning the user and the computer have a 'conversation'. Firstly, the user specifies the objects and the relationships that exist between these objects. Prolog can then answer the questions about this set of data.

Prolog has a very compact syntax. From the developers point of view the difficulty of programming in Prolog, is the vagueness in human thinking. Prolog makes the coding easier as the syntax is very short and precise.