
Logic Programming and Artificial Intelligence
17 February 2010
Solutions to LPA Problem Sheet 4
1. (a) ∀x P (x, x) is a sentence. (Both xbound to ∀x.)
(b) ∃x∀x(Q(x)→Q(x)) is a sentence. (Both xbound to ∀x.)
(c) ∀x(Q(x)→ ∀xQ(x)) is a sentence. (Each xbound to closest ∀x.)
(d) ∀x((Q(x)→ ∀xQ(x)) →Q(x)) is a sentence. (Innermost ∀xQ(x) bound together, other
x’s bound to outer ∀x.)
(e) ∀x((∃yQ(x)) →Q(y)) is not a sentence. (xbound to ∀x, but yis unbound.)
(f) ∃x¬P(f(x, y ), a) is not a sentence. (xbound to ∃x, but yis unbound.)
2. (a) 2, (b) 2, (c) 8, (d) TRUE , (e) TRUE , (f) 3, (g) TRUE , (h) TRUE , (i) TRUE , (j) TRUE, (k)
FALSE , (l) TRUE, (m) FALSE , (n) TRUE, (o) TRUE , (p) TRUE , (q) FALSE.
3. One such model is h{1,2},Ai, where Amaps Pto λx, y.if x=ythen TRUE else FALSE.
4. (a) The entailment holds. This will be proved by assuming that ∀x Q(x) is satisfied by an
arbitrary model and showing that ∃x Q(x) is also satisfied by that model. Consider an
arbitrary model, M=hD, Ai. By the semantic definition of ∀, if [[∀xQ(x)]]M,g =Tthen
for all i∈Dit holds that [[Q(x)]]M,g[x7→i]=T. Thus since D6=∅there exists j∈Dsuch
that [[Q(x)]]M,g[x7→j]=T. Therefore by the semantic definition of ∃, [[∃xQ(x)]]M ,g =T.
(b) The entailment does not hold. We show that any model M=hD, Aisuch that Aassigns
λx.FALSE to the predicate symbol Pis a counter-model. In particular, we first show that
[[∀x(P(x)→Q(x))]]M=TRUE and then show that [[∃x(P(x)∧Q(x))]]M=FALSE. Since
Aassigns λx.FALSE to the predicate symbol P, [[P(x)]]M,g[x7→i]=FALSE for all i∈D.
Thus (by the semantic definition of →) [[P(x)→Q(x)]]M,g[x7→i]=TRUE for all i∈D,
and (by the semantic definition of ∀) [[∀x(P(x)→Q(x))]]M=TRUE . Furthermore, since
[[P(x)]]M,g[x7→i]=FALSE for all i∈D, then (by the semantic definition of ∧) [[P(x)∧
Q(x)]]M,g [x7→i]=FALSE for all i∈D, and (by the semantic definition of ∃) [[∃x(P(x)∧
Q(x))]]M=FALSE .
5. Argument (4b) is similar to argument (4a) except that its attention is restricted to the set of
things which are “P”. The only counter-models to argument (4b) are those in which nothing is
a “P”. However, we can’t build a similar counter-model for argument (4a), since by definition
a model can’t have an empty domain.
6. (a) ¬∃X on(table, X )
If Xis on Y, then from axiom (2) it follows that Xis a block. But we know that the table
is not a block from (1), so the table cannot be on anything.
(b) ∀X¬on(X, X )
Follows from axiom (11). This can be seen by considering Xand Yto be the same object
in that axiom.
(c) ∀X, Y, Z ((on(X, Y )∧on(Y , Z)) → ¬on(X, Z ))
If Yis on Zthen Yand Zare different since (as we just established above) Yis not on
itself. If Xis on Ythen Xis not on Z, since, from axiom (6), Xis at most one thing.
(d) (∃X, Y (block (X)∧block(Y)∧ ¬(X=Y)) →(∃X, Y on(X, Y ))
Assume that block Xand block Yare different and that block Xis not on anything.
Then by axiom (4), block Xmust be held. And since only one thing is held (axiom (5)),
block Yis not held. And since block Yis not held, then from axiom (4), we know it is on
something.
(e) (∃X, Y on(X , Y )) → ∃X clear(X)
Suppose Xis on Y. Then from axiom (10) we know that something is on the table.
Therefore, from axiom (9) it follows that something is clear.
1