Information Technology Reference
In-Depth Information
for another clause to work with A 1 , in step 3e. It is only when it runs out of clauses
to use for A 1 that it finally returns failure , in step 4.
Want to read more?
This chapter presented Prolog as a language for writing programs and queries, and
showed how a Prolog system uses back-chaining to answer queries. Chapter 4 deals
with how to write meaningful Prolog programs.
Prolog was developed by Alain Colmerauer at the Universite d'Aix-Marseille II and
the Universite de Montreal in the early 1970s. Philippe Roussel and Robert Kowalski
were also early contributors. (See [16] for some of the history.) Many of the ideas
in Prolog were proposed independently in a slightly different form by Carl Hewitt at
the Massachusetts Institute of Technology in a computer language called Planner [17].
Prolog was originally intended for computer programs that process natural language
inputs such as English or French, but it is now used for a wide variety of applications,
mainly having to do with artificial intelligence or databases.
Prolog is used most commonly in Britain and France but has enthusiastic fans
worldwide. It is often studied as a programming language in computer science
courses because it presents a unique view of programming compared to the more
conventional programming languages like C++, Java, or Python.
Exercises
Make up a simple knowledge base of atomic sentences about movies (not necessarily
real ones) using the following predicates:
acted_in( person , movie ) the person acted in the movie
directed( person , movie ) the person directed the movie
released( movie , year ) the movie came out that year
You can use numbers like 2011 as constants. You may also find it convenient to use
quoted strings like 'The Big Lebowski' as constants.
Save your knowledge base as a Prolog program in a file, and load it into Prolog.
Then pose the following questions as queries to Prolog, and obtain Prolog's answers:
1.
Did Leonardo DiCaprio act in Babel ?
2.
Who directed District 9 ?
 
 
Search WWH ::




Custom Search