Docsity

Logic Programming and Artificial Intelligence: Solutions to LPA Problem Sheet 5, Study notes of Computer Numerical Control

Toggle sidebar
bg1
Logic Programming and Artificial Intelligence
24 February 2010
Solutions to LPA Problem Sheet 5
Note: We shall often use the following shorthand notation for trees.
A A
B / \
F = B C
C / / \
D F D E
E
1. • ∀x F emale(m(x))
All mothers are female.
• ∀x Male(f(x))
All fathers are male.
• ∀x(Male(x)↔ ¬F emale(x))
Everyone is either male or female, but not both.
• ∃y∀x¬P(y, x)
There is someone who is the parent of no one.
• ∀x¬P(x, x)
No one is his own parent.
• ∀x1x2P(x1, x2)→ ¬P(x2, x1)
One’s parent is not one’s child.
• ∀x1x2x3P(x1, x2)∧P(x2, x3)→ ¬P(x3, x1)
One’s grandparent is not one’s child.
•The above series continues infinitely, and in general for n≥2 we have
∀x1x2· · · xnP(x1, x2)∧P(x2, x3)∧ · · · ∧ P(xn−1, xn)→ ¬P(xn, x1)
One’s ancestor is not one’s child. (This is also the same as “One’s descendant is
not one’s parent.”)
• ∀x, y P (x, y )↔x=f(y)∨x=m(y)
One person is the parent of a second person if and only if the first is the mother
or the father of the second.
It follows from these axioms that there is a male and that there is a female. It also
follows that the father of someone is his parent and that the mother of someone is his
parent.
It follows from these axioms that a mother is not a father. It also follows that everyone
has exactly two parents. In particular, the last axiom entails that each person has at
most two parents—a father and a mother. And since, fathers are not mothers, each
person has exactly two parents, exactly one of which is male and exactly one of which
is female.
In addition to the sequence of axioms capturing that one’s ancestor is not one’s child,
which we already have, we can consider two other sequences: one capturing that one’s
parent is not one’s descendant and one capturing that one’s ancestor is not one’s de-
scendant. Interestingly, and certainly not obviously, the sequence which we have entails
the other two sequences.
2. Adding a non-redundant axiom to the theory reduces the set of models that satisfy the
theory. So in order to eliminate models in which social conventions are not followed,
more axioms would have to be added to the theory.
3. Since this system can derive only the premises themselves every sentence it derives must
be a logical consequence of the premises. On the other hand, this system cannot derive
any other logical consequences so it is incomplete.
1
pf3
pf4

Partial preview of the text

Download Logic Programming and Artificial Intelligence: Solutions to LPA Problem Sheet 5 and more Study notes Computer Numerical Control in PDF only on Docsity!

Logic Programming and Artificial Intelligence 24 February 2010 Solutions to LPA Problem Sheet 5

Note: We shall often use the following shorthand notation for trees. A A B /
F = B C C / /
D F D E E

  1. • ∀x F emale(m(x)) All mothers are female.
  • ∀x M ale(f (x)) All fathers are male.
  • ∀x (M ale(x) ↔ ¬F emale(x)) Everyone is either male or female, but not both.
  • ∃y∀x ¬P (y, x) There is someone who is the parent of no one.
  • ∀x ¬P (x, x) No one is his own parent.
  • ∀x 1 x 2 P (x 1 , x 2 ) → ¬P (x 2 , x 1 ) One’s parent is not one’s child.
  • ∀x 1 x 2 x 3 P (x 1 , x 2 ) ∧ P (x 2 , x 3 ) → ¬P (x 3 , x 1 ) One’s grandparent is not one’s child.
  • The above series continues infinitely, and in general for n ≥ 2 we have ∀x 1 x 2 · · · xn P (x 1 , x 2 ) ∧ P (x 2 , x 3 ) ∧ · · · ∧ P (xn− 1 , xn) → ¬P (xn, x 1 ) One’s ancestor is not one’s child. (This is also the same as “One’s descendant is not one’s parent.”)
  • ∀x, y P (x, y) ↔ x = f (y) ∨ x = m(y) One person is the parent of a second person if and only if the first is the mother or the father of the second. It follows from these axioms that there is a male and that there is a female. It also follows that the father of someone is his parent and that the mother of someone is his parent. It follows from these axioms that a mother is not a father. It also follows that everyone has exactly two parents. In particular, the last axiom entails that each person has at most two parents—a father and a mother. And since, fathers are not mothers, each person has exactly two parents, exactly one of which is male and exactly one of which is female. In addition to the sequence of axioms capturing that one’s ancestor is not one’s child, which we already have, we can consider two other sequences: one capturing that one’s parent is not one’s descendant and one capturing that one’s ancestor is not one’s de- scendant. Interestingly, and certainly not obviously, the sequence which we have entails the other two sequences.
  1. Adding a non-redundant axiom to the theory reduces the set of models that satisfy the theory. So in order to eliminate models in which social conventions are not followed, more axioms would have to be added to the theory.
  2. Since this system can derive only the premises themselves every sentence it derives must be a logical consequence of the premises. On the other hand, this system cannot derive any other logical consequences so it is incomplete.
  1. This inference rule can be used to derive all logical consequences, and only logical consequences. So it is sound and complete. However, the rule is based on a semantic property of the sentences (logical consequence), whereas all other inference rules we have seen are based solely on syntactic properties. The rule is unacceptable because the purpose of proof systems is to characterise valid arguments syntactically.
  2. A sound proof system can derive only logical consequences from a set of premises. In particular, the inference rules should infer only logical consequences. To show that this inference rule is sound we shall consider an arbitrary model, I, that satisfies both A ∨ B and ¬A ∨ C and show that I also satisfies B ∨ C. If A is satisfied by I then so is C (since I satisfies ¬A ∨ C). On the other hand, if A is not satisfied by I, then I satisfies B (since I satisfies A ∨ B). In either case, I satisfies B ∨ C. Since I is an arbitrary model that satisfies both A ∨ B and ¬A ∨ C, we can conclude that every model that satisfies both A ∨ B and ¬A ∨ C also satisfies B ∨ C. Alternatively, this result could be obtained by appealing to a truth table.
  3. • P ∧ Q Q (from (2)) S (from (4)) 2 (from (3))
  • (a) S (premise 3) (b) Q (a and premise 4) (c) P ∧ Q (b and premise 2)
  • Since SLD resolution is sound, the existence of a proof indicates that the argument is valid.
  1. (a) A & B where BSPACE is A1 & B ........ from 1 BSPACE...... from 3 B A2 & B ........ from 2 B1 ...... from 5 BSPACE...... from 4 [] ... from 8 B2 ...... from 6 B3 ...... from 7

(b) A & B A & B1 ........ from 5 A .......... from 8 A1 ...... from 1 [] ... from 3 A2 ...... from 2 [] ... from 4 A & B2 ........ from 6 A & B3 ........ from 7

  1. (a) {P ∨ Q}. Notice that it has three models {P }, {Q}, and {P, Q}. and that the first two of these are minimal. (b) Since D is finite it contains a finite set of proposition symbols. Thus there are only a finite number of models for D, so and the set M of models that satsify D is also finite. Thus M must contain at least one minimal element. We now show by contradiction that M has does not have more than one minimal elements. Suppose that M has multiple minimal elements and let m and m′^ be two distinct minimal elements. One can show that m ∪ m′^ must satisfy D. Since m∪m′^ must be strictly less than at least one of m and m′, we have a contradiction.