Logic Programming and Artifical Intelligence, Lecture Notes - Computer Science 4, Study notes of Computer Numerical Control

Logic programming and Artificial Intelligence

Typology: Study notes

2010/2011

Uploaded on 09/10/2011

myohmy
myohmy 🇬🇧

4.8

(10)

297 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Logic Programming and Artificial Intelligence
9 February 2010
LPA Problem Sheet 4
Due: 10:15, 17 February
1. [6 marks] Consider the first-order predicate calculus with the following lexicon:
Predicate symbols: P(with arity 2), and Q(with arity 1);
Function symbols: f(with arity 2) and a(with arity 0);
Variables: x,yand z.
In each of the following formulas draw lines to indicate which quantifier (if any) binds every
occurrence of every variable. Indicate which of these formulas are sentences. (Eg. In x(P(x)
xyQ(x, y, x)) you would connect the first occurrence of xto the second occurrence of x, and
you would connect the third, fourth and fifth occurrences of x. You would also connect the two
occurrences of y.)
(a) xP (x, x)
(b) xx(Q(x)Q(x))
(c) x(Q(x) xQ(x))
(d) x((Q(x) xQ(x)) Q(x))
(e) x((yQ(x)) Q(y))
(f) x¬P(f(x, y ), a)
2. [17 marks] Let zero be an individual symbol, sbe a function symbol of arity one, and LE be
a predicate symbols of arity two. Let gbe the value assignment that maps xto 1 and yto 2.
Let Ibe a model whose domain is the natural numbers and whose assignment maps
zero to 0
sto λx.x + 1
LE to λx, y.(TRUE if xy, FALSE otherwise)
Give the values of each of the following:
(a) [[s(x)]]I,g
(b) [[s(x)]]I,g[y7→7]
(c) [[s(x)]]I,g[x7→7]
(d) [[LE (x, y)]]I,g
(e) [[x LE (x, y)]]I,g
(f) [[s(s(s(zero)))]]I
(g) [[LE (zer o, zero)]]I
(h) [[s(z ero) = zero LE(s(z ero), z ero)]]I
(i) [[x z ero =x]]]I
(j) [[xy y =s(x)]]I
(k) [[yx y =s(x)]]I
(l) [[xy LE (x, y)LE (y, x)]]I
(m) [[(xy LE (x, y)) (xy LE (y, x))]]I
(n) [[xy LE (x, y)]]I
(o) [[yx LE (x, y)]]I
(p) [[xy LE (x, y)]]I
(q) [[yx LE (x, y)]]I
3. [6 marks] Specify a model that falsifies the sentence (xyP (x, y)) (yxP (x, y )).
4. [12 marks] State whether each of the following claims holds and use the semantic definition of
FOPC to support your answer rigorously.
1
pf2

Partial preview of the text

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

Logic Programming and Artificial Intelligence 9 February 2010 LPA Problem Sheet 4 Due: 10:15, 17 February

  1. [6 marks] Consider the first-order predicate calculus with the following lexicon: Predicate symbols: P (with arity 2), and Q (with arity 1); Function symbols: f (with arity 2) and a (with arity 0); Variables: x, y and z. In each of the following formulas draw lines to indicate which quantifier (if any) binds every occurrence of every variable. Indicate which of these formulas are sentences. (Eg. In ∀x(P (x) → ∀x∀yQ(x, y, x)) you would connect the first occurrence of x to the second occurrence of x, and you would connect the third, fourth and fifth occurrences of x. You would also connect the two occurrences of y.) (a) ∀xP (x, x) (b) ∃x∀x(Q(x) → Q(x)) (c) ∀x(Q(x) → ∀xQ(x)) (d) ∀x((Q(x) → ∀xQ(x)) → Q(x)) (e) ∀x((∃yQ(x)) → Q(y)) (f) ∃x¬P (f (x, y), a)
  2. [17 marks] Let zero be an individual symbol, s be a function symbol of arity one, and LE be a predicate symbols of arity two. Let g be the value assignment that maps x to 1 and y to 2. Let I be a model whose domain is the natural numbers and whose assignment maps zero to 0 s to λx.x + 1 LE to λx, y.(TRUE if x ≤ y, FALSE otherwise) Give the values of each of the following: (a) [[s(x)]]I,g (b) [[s(x)]]I,g[y^7 →7] (c) [[s(x)]]I,g[x^7 →7] (d) [[LE(x, y)]]I,g (e) [[∃x LE(x, y)]]I,g (f) [[s(s(s(zero)))]]I (g) [[LE(zero, zero)]]I (h) [[s(zero) = zero → LE(s(zero), zero)]]I (i) [[∃x zero = x]]]I (j) [[∀x∃y y = s(x)]]I (k) [[∀y∃x y = s(x)]]I (l) [[∀x∀y LE(x, y) ∨ LE(y, x)]]I (m) [[(∀x∀y LE(x, y)) ∨ (∀x∀y LE(y, x))]]I (n) [[∀x∃y LE(x, y)]]I (o) [[∀y∃x LE(x, y)]]I (p) [[∃x∀y LE(x, y)]]I (q) [[∃y∀x LE(x, y)]]I
  3. [6 marks] Specify a model that falsifies the sentence (∀x∃yP (x, y)) → (∃y∀xP (x, y)).
  4. [12 marks] State whether each of the following claims holds and use the semantic definition of FOPC to support your answer rigorously.

(a) ∀x Q(x) entails ∃x Q(x). (b) ∀x P (x) → Q(x) entails ∃x P (x) ∧ Q(x).

  1. [6 marks] Examine (4a) and (4b) in the above problem. Informally, (4a) says that from “ev- erything is a Q” conclude “something is a Q.” Informally, (4b) says that from “every P is a Q” conclude “some P is a Q.” Intuitively, it seems reasonable that you should have the same answer to the two questions. Yet if you did the problem correctly, you will have different answers. Explain why the answers come out differently.
  2. [12 marks] The following sentences are all redundant with those that we already have in the representation of the static blocks world given in the lecture notes:

(a) The table is not on anything. (b) Nothing is on itself. (c) The on relation is anti-transitive. (d) If there are at least two blocks, then there is something on something. (e) If something is on something then something is clear.

Using the lexicon we already have for the static blocks world, state each of these as sentences of first-order calculus with equality and argue convincingly that each is a logical consequence of sentences that we already have in the representation. (But you need not give a rigorous proof.) In particular, identify the sentences from which each logically follows.

  1. [12 marks] In our theory of the static blocks world we saw that it would require an infinite set of sentences to state that there cannot be a cycle of “on” relationships. It is claimed that this could be captured by a finite set of sentences if we had available a predicate symbol for the “above” relationship. So let us consider extending the lexicon with above, a predicate symbol of arity 2, where in the intended models above(x, y) denotes true if x is a block and is supported by, (but not necessarily directly on) y. It is intended that a block could be above the table. Using this extra predicate symbol, extend the static-blocks representation given in the lecture notes with as many non-redundant sentences as possible. Indicate any sentences in the original representation that become redundant as a result of your extension.
  2. [2 marks] Give a joke about Bill Gates or Microsoft.
  3. [Challenge Problem] In The Game of Logic Lewis Carroll posed a set of problems called “sorites”. Each sorite gives a set of sentences and poses the challenge of finding the one interesting consequence of them. Here are two of Carroll’s sorites: (a) (Problem 35 from Lewis Carroll’s The Game of Logic) No birds, except ostriches, are 9 feet high. There are no birds in this aviary that belong to anyone but me. No ostrich lives on mince pies. I have no birds less than 9 feet high. (b) (Problem 58 from Lewis Carroll’s The Game of Logic) I never put a cheque, received by me on that file, unless I am anxious about it. All the cheques received by me, that are not marked with a cross, are payable to bearer. None of them are ever brought back to me, unless they have been dishonoured at the bank. All of them, that are marked with a cross, are for amounts of over one hundred pounds. All of them, that are not on that file, are marked “not negotiable.” No cheque of yours, received by me, has ever been dishonoured. I am never anxious about a cheque, received by me, unless it should happen to be brought back to me. None of the cheques received by me, that are marked “not negotiable,” are for amounts of over 100 pounds.