Docsity

Logic Programming and Artifical Intelligence, Solution Sheets - Computer Science 4, Study notes of Computer Numerical Control

Toggle sidebar
bg1
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
pf2

Partial preview of the text

Download Logic Programming and Artifical Intelligence, Solution Sheets - Computer Science 4 and more Study notes Computer Numerical Control in PDF only on Docsity!

Logic Programming and Artificial Intelligence 17 February 2010 Solutions to LPA Problem Sheet 4

  1. (a) ∀x P (x, x) is a sentence. (Both x bound to ∀x.) (b) ∃x∀x (Q(x) → Q(x)) is a sentence. (Both x bound to ∀x.) (c) ∀x (Q(x) → ∀xQ(x)) is a sentence. (Each x bound 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. (x bound to ∀x, but y is unbound.) (f) ∃x¬P (f (x, y), a) is not a sentence. (x bound to ∃x, but y is 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 〈{ 1 , 2 }, A〉, where A maps P to λx, y.if x = y then 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 = 〈D, A〉. By the semantic definition of ∀, if [[∀xQ(x)]]M,g^ = T then for all i ∈ D it holds that [[Q(x)]]M,g[x^7 →i]^ = T. Thus since D 6 = ∅ there exists j ∈ D such that [[Q(x)]]M,g[x^7 →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 = 〈D, A〉 such that A assigns λx.FALSE to the predicate symbol P is 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 A assigns λx.FALSE to the predicate symbol P , [[P (x)]]M,g[x^7 →i]^ = FALSE for all i ∈ D. Thus (by the semantic definition of →) [[P (x) → Q(x)]]M,g[x^7 →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[x^7 →i]^ = FALSE for all i ∈ D, then (by the semantic definition of ∧) [[P (x) ∧ Q(x)]]M,g[x^7 →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 X is on Y , then from axiom (2) it follows that X is 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 X and Y to be the same object in that axiom. (c) ∀X, Y, Z ((on(X, Y ) ∧ on(Y, Z)) → ¬on(X, Z)) If Y is on Z then Y and Z are different since (as we just established above) Y is not on itself. If X is on Y then X is not on Z, since, from axiom (6), X is at most one thing. (d) (∃X, Y (block(X) ∧ block(Y ) ∧ ¬(X = Y )) → (∃X, Y on(X, Y )) Assume that block X and block Y are different and that block X is not on anything. Then by axiom (4), block X must be held. And since only one thing is held (axiom (5)), block Y is not held. And since block Y is not held, then from axiom (4), we know it is on something. (e) (∃X, Y on(X, Y )) → ∃X clear(X) Suppose X is 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. This could be achieved in several ways. Perhaps the simplest is to add these three sentences:

A. ∀X, Y on(X, Y ) → above(X, Y ) B. ∀X, Y, Z above(X, Y ) ∧ above(Y, Z) → above(X, Z) C. ∀X ¬above(X, X)

These three sentences together entail axiom (11), axiom (12) and the infinite sequence of axioms in (13).

  1. (a) Nothing in this aviary lives on mince pies.

(b) All of your cheques to me are payable to bearer.