Translating list of word for list of word (English, French).
Source: The Art of Prolog
Program source code: english2french.pl
/* translate(Words,Mots) :- Mots is a list of French words that is the translation of the list of English words Words. */ translate([Word|Words],[Mot|Mots]) :- dict(Word,Mot), translate(Words,Mots). translate([],[]). dict(the,le). dict(dog,chien). dict(chases,chasse). dict(cat,chat). % Program 7.8 Translating word for word