1. Translation from English to First-Order Logic
Give a FOL representation for each of the following English sentences; choose (and briefly define) reasonable constants, predicates and functions (Section 7.3, and other portions of Chapter 7, contain useful examples; see also Nilsson's book pages 248-249; Tony is not a relation) in such a way that you can represent the question "Who is a member of the Alpine Club who is a mountain climber but not a skier?" as a FOL wff.
2. Convert the following to CNF (Conjunctive Normal Form) and INF (Implicative Normal Form):
3. Unification
For each of the following pairs of atomic sentences, give the most general unifier, if it exists (apply the algorithm and show the steps). If none exists, explain why. W, X, Y and Z are variable symbols, a , b and c are constant symbols, f and g are function symbols, and P and Q are predicate symbols.
4. Linear Resolution
Given the formulae (a) -(f) of the knowledge base (KB) and the query (G) formula (g), does the knowledge base entails the query,
i.e. KB |= G? Explain (give all theorems that allow you to answer this question using a proof system).
5. Prolog / SLD-resolution
Last(cons(X, nil), X) <=
Last(cons(X, Y), Z)) <= Last(Y, Z)
Use resolution SLD with answer extraction to prove EX Last(cons(2, cons(1, nil)), X).
(Hint: ask <= Last(cons(2, cons(1, nil)), X), remember to "play" DO generating the resolvents).
Because the notations becomes so clumsy, the following syntactic sugar is usually adopted (see also page 200 of textbook):
nil becomes [] (empty list)
cons(H, T) becomes [H|T]
There are two syntactic simplifications:
[E1 | [E2]] becomes [E1, E2]
examples: [a|[d, nil]] becomes [a, d | nil]
[a, b, c|[d, e, f]] becomes [a, b, c, d, e, f]
[a, b, c|[d, e|F]] becomes [a, b, c, d, e | F]
[E1 | nil] becomes [E1]
examples: [a, b, c | nil] becomes [a, b, c]
using both rules [a|[d|nil]] becomes [a,d]
b)Can we prove EX Append([1, 2], [3, 4], X) from the clauses below using Prolog ?
(Hint: ask <= Append([1, 2], [3, 4], X), remember to "play" DO generating the resolvents). Show the steps (by that I also mean the mgu in each step).
Append([ ], X, X) <=
Append([X|L], Y, [X| Z]) <= Append(L, Y, Z)
6. Prolog / SLDNF-resolution
Can we prove EX EYdaughter(X, Y) from the clauses below using Prolog?
(Hint: ask <= daughter(X, Y) , remember to "play" DO generating the resolvents). The operator not is negation by failure. Show the steps.
daughter(X, Y) <= female(X), father(Y, X)
daughter(X, Y) <= mother(Y, X), not male(X)
mother(john, mary) <=
7. Using Quintus Prolog
See http://www.cs.wisc.edu/~jgast/cs540/prolog.html for a recipe how to use it.
Load both files (program and data), then load the math-library with this command:
load_files(library(math)).
Then run the query:
dtlearn(reads, [e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15,e16,e17,e18], [known,new,short,home], DT).
You can use the trace facilities in order to see the computation steps.
8. Problem 11.7 in the textbook - parts a (use "successor-state axiom") and b only (see pages 360 - 362).