Dr. Alain Colmerauer

From Scholarpedia
Curator of ScholarpediaCurator Index: 0(Difference between revisions)
Jump to: navigation, search
(User 1: - What it is?)
(User 1: - What it is?)
Line 7: Line 7:
 
It states:
 
It states:
  
   ''<assertion><sub>0</sub> holds if <assertion><sub>1</sub>, ... ,<assertation><sub>n</sub> all hold.''
+
   ''<assertion><sub>0</sub> holds if <assertion><sub>1</sub>,...,<assertation><sub>n</sub> all hold.''
  
 
In particular, when ''n=0,'' it states: ''<assertion><sub>0</sub> holds.'' This is is the declarative meaning. For the procedural meaning the rule states:
 
In particular, when ''n=0,'' it states: ''<assertion><sub>0</sub> holds.'' This is is the declarative meaning. For the procedural meaning the rule states:
  
   ''to compute <assertion><sub>0</sub> compute <assertion><sub>1</sub>, ... ,<assertation><sub>n</sub>.''
+
   ''to compute <assertion><sub>0</sub> compute <assertion><sub>1</sub>,...,<assertation><sub>n</sub>.''
  
 
In this case, when ''n=0,'' it states: ''<assertion><sub>0</sub> is already computed.''
 
In this case, when ''n=0,'' it states: ''<assertion><sub>0</sub> is already computed.''

Revision as of 20:57, 30 March 2008

What it is?

A Prolog program is made of a set rules. A rule is of the following form:

  <assertion>0 \(\leftarrow\) <assertion>1  , ... , <assertation>n . 

It states:

  <assertion>0 holds if <assertion>1,...,<assertation>n all hold.

In particular, when n=0, it states: <assertion>0 holds. This is is the declarative meaning. For the procedural meaning the rule states:

  to compute <assertion>0 compute <assertion>1,...,<assertation>n.

In this case, when n=0, it states: <assertion>0 is already computed.


\(\mbox{assertation}_0\)

Example

We would like to concatenate b l to u e to obtain b l u e. Given the data structure of Prolog, we will concatenate dot(b,dot(l,nil)) to dot(u,dot(e,nil)) to obtain dot(b,dot(l,dot(u,dot(e,nil)))). Let us suppose that conc(X,Y,Z) means the concatenation of X with Y is Z and that list(X) means X is a list. Here is the program:

  conc(nil,X,X) :- list(X).
  conc(dot(A,X),Y,dot(A,Z)) :- conc(X,Y,Z).
  
  list(nil) :- .
  list(dot(A,X)) :- list(X).

The doubled-sign :- denotes \(\leftarrow\). What is more important, capital letters are used for variables. Their scope is just valid for each rule, and their value is unique but partially unknown. To run the program we ask a query:

  conc(dot(b,dot(l,nil)),dot(u,dot(e,nil)),Z).

and the computer gives the answer:

  Z=dot(b,dot(l,dot(u,dot(e,nil)))).

But because we have defined conc to be a ternary relation and not a binary functiok, we can ask:

  conc(X,Y,dot(b,dot(l,dot(u,dot(e,nil))))).

and obtain several answers:

  X=nil, Y=dot(b,dot(l,dot(u,dot(e,nil)))).
  X=dot(b,nil), Y=dot(l,dot(u,dot(e,nil))).
  X=dot(b,dot(l,nil)), Y=dot(u,dot(e,nil)).
  X=dot(b,dot(l,dot(u,nil))), Y=dot(e,nil).
  X=dot(b,dot(l,dot(u,dot(e,nil)))), Y=nil.

History

Prolog was invented in 1972, at Marseilles, by Alain Colmerauer and Philippe Roussel. The only trace at that the time is:

Alain Colmerauer, Henry Kanoui, Robert Pasero et Philippe Roussel, Un système de communication en français, rapport préliminaire de fin de contrat IRIA, Groupe d'Intelligence Artificielle, Faculté des Sciences de Luminy, Université Aix-Marseille II, France, October 1972.

The name Prolog stands for Progammation en Logique in French and was coined by Philippe Roussel. The work was influenced by Robert Kovalski at that time in Edimburgh. A few years later David Warren, also in Edimburgh, created the WAM machine, which leads to his Prolog compiler.

Personal tools
Namespaces

Variants
Actions
Navigation
Focal areas
Activity
Tools