Representing facts and answering questions in Prolog
Part 1: the Genealogy Exercise
Work the exercise given in
http://www.ling.helsinki.fi/kit/2003k/ctl272/genealogy.html
Use the royal.pl database.
In the report from this exercise include your solutions to items: 4, 5, 6,
7, 8, 9, and 10.
Part 2: the Airports Exercise
Work the exercise given in
https://cs.gmu.edu/%7Ehenryh/330/Prolog/f02-flight-sked.html
Create at least 10 airports/cities with at least 20 flight connections.
In the report from this exercise include your solutions to all the
predicates stated in the Exercise. Also show an example of a path(A1,A2,L)
calculation with results.
Note (a small correction): Los Angeles is in time zone -9 (nine hours past
Greenwich), not 16.
Part 3: question answering
Make up a short story written in short, clear sentences (approx. 5 to 10
sentences). It can be anything, about your family, about your studies, about
the world, about the environment, about animals, about climate changes, about
politics, about science, about the economy, just about anything you can
express your ideas about.
Convert the facts contained in your story to Prolog statements. If it seems
that some facts cannot be directly and exactly converted to Prolog statements,
make a note of this in your report, but do not simplify your story. It will
be sufficient, if only part of it is possible to express in Prolog. Make it a
Prolog program.
Make up some questions about your story, express them in Prolog queries.
Again, if you'd like to ask questions which seem impossible to express in
Prolog, make a note of this in your report, and make up some other questions.
It is OK if the Prolog query only partially corresponds to the real question.
Run a Prolog session, ask your queries, review the answers. In your report,
include selected answers which satisfy the following:
(a) a simple answer to a simple question, which nevertheless is not identical
to some fact of the database (ie. requires some Prolog recursion to produce
the answer),
(b) an answer which requires significant deduction, ie. matching and combining
many facts,
(c) a question and its answer which seem problematic in some way, ie. either
the Prolog query expresses the question in a specific way, or the answer is
unexpected, or incorrect in some sense, in spite of facts and the question
having been stated correctly, or generally in some sense interesting.
If you do not encounter any situation producing (c), then it's OK, just leave
it empty.