CS532, Winter 2008 Homework #1...

4

Click here to load reader

Transcript of CS532, Winter 2008 Homework #1...

Page 1: CS532, Winter 2008 Homework #1 Solutionweb.engr.oregonstate.edu/~afern/classes/cs532/hw/hw-1-solutions.pdf · CS532, Winter 2008 Homework #1 Solution Dr. Alan Fern, afern@cs.orst.edu

CS532, Winter 2008

Homework #1 Solution

Dr. Alan Fern, [email protected]

January 20, 2010

Problem A: Prove that if a knowledge base entails contradictory formulas, then it entails anyformula. That is, use the definition of entailment to prove the following statement.

Let KB be a formula of some logic. If there exists a formula φ such that both KB |= φ andKB |= ¬φ, then KB |= φ for any formula φ.

Assume that both KB |= φ and KB |= ¬φ. By the definition of entailment, it follows that anymodel M of KB must satisfy both φ and ¬φ. However, we know that there is no model with thisproperty, which implies that KB has no models.

By definition a formula φ′ is entailed by KB iff it is true in all of the models of KB. Since, KBhas no models this definition is satisfied for any formula φ′, and hence KB |= φ′ for any φ′. Thiscompletes the proof.

Problem B: Prove that if KB |= φ, then the formula KB → φ is logically valid (i.e. a tautology).

We will prove the contrapositive. That is, if KB → φ is not valid then KB 6|= φ.If KB → φ is not valid then there is a model M in which it is false. In order for this to happenit must be the case the KB is true with respect to M and φ is false with respect to M . But thisviolates the definition of entailment which says that φ must be true in all models that KB is truein, proving that KB 6|= φ.

Also complete the following problems from your textbook.

1

Page 2: CS532, Winter 2008 Homework #1 Solutionweb.engr.oregonstate.edu/~afern/classes/cs532/hw/hw-1-solutions.pdf · CS532, Winter 2008 Homework #1 Solution Dr. Alan Fern, afern@cs.orst.edu

8.2 Consider a knowledge base containing just two sentences: P (a) and P (b). Does this knowledgebase entail ∀ x P (x)? Explain your answer in terms of models.

The knowledge base does not entail ∀ x P (x). To show this, we must give a model where P (a)and P (b) are true but where ∀ x P (x) is false. Consider a model with domain D = { A,B,C }and interpretation function such that

I(a) = A

I(b) = B

I(P ) = A,B

Here we see that both P (a) and P (b) are true in the model, but since P is not true for domainelement C we have that ∀ x P (x) is not true.

8.3 Is the sentence ∃ x, y x = y valid? Explain.

The answer depends on whether or not we allow our first-order models to have empty domains.Since I did not specify this clearly in the notes, I will accept either answer, of course with thecorrect argument. However, I would like to indicate that the standard textbook semantics offirst-order logic require that all domains be non-empty.

The sentence ∃ x, y x = y is valid. A sentence if valid if it is true in every model. Anexistentially quantified sentence is true in a model if it holds under any extended interpretationin which its variables are assigned to domain elements. In the case where we do not allowempty domains, for any model, there is an extended interpretation in which x and y areassigned to the first domain element. In such an interpretation x = y is true.

In the case where we allow for empty domains, the sentence would be false in the model withan empty domain.

8.4 Write down a logical sentence such that every world in which it is true contains exactly oneobject.

The following formula asserts that there is exactly one object

∀ x, y x = y

To see this, note that if a model contains at least two objects, then there is an extendedinterpretation in which x and y are assigned different objects, making the sentence false.

The above formula suffices if we are not allowing empty domains (which is correct); however,if you considered the possibility of empty domains, then you could have used the formula

(∀ x, y x = y) ∧ (∃ y y = y)

which requires that there is some object in the domain.

8.6 Represent the following sentences in first-order logic, using a consistent vocabulary (whichyou must define):

2

Page 3: CS532, Winter 2008 Homework #1 Solutionweb.engr.oregonstate.edu/~afern/classes/cs532/hw/hw-1-solutions.pdf · CS532, Winter 2008 Homework #1 Solution Dr. Alan Fern, afern@cs.orst.edu

h There is a barber who shaves all men in town who do not shave themselves.

∃ x [ Barber(x) ∧ ∀ y [ (Man(y) ∧ ¬Shaves(y, y)) ⇒ Shaves(x, y) ] ]

i A person born in the UK, each of whose parents is a UK citizen or a UK resident, is aUK citizen by birth.Below Citizen(y, c, r) means that y is a citizen of c for reason r.

∀ x

[Person(x) ∧ Born(x, UK)∧

( ∀ y Parent(y, x) ⇒ [ ∃ r Citizen(y, UK, r) ∨ Resident(y, UK) ] )

]⇒ Citizen(x, UK, Birth)

j A person born outside the UK, one of whose parents is a UK citizen by birth, is a UK citizen by descent.

∀ x[

Person(x) ∧ ¬Born(x, UK)∧( ∃ y Parent(y, x) ∧ Citizen(y, UK,Birth) )

]⇒ Citizen(x, UK,Descent)

k Politicians can fool some of the people all of the time, and they can fool all of the peoplesome of the time, but they can’t fool all of the people all of the time.

∀ x Politician(x) ⇒

(∃ y ∀ t Person(y) ∧ Fools(x, y, t))∧(∃ t ∀ y Person(y) ⇒ Fools(x, y, t))∧¬(∀ t ∀ y Person(y) ⇒ Fools(x, y, t))

8.13 Explain what is wrong with the following proposed definition of the set membership predicate∈ (in terms of models allowed):

∀ x, s x ∈ {x|s}

∀ x, s x ∈ s⇒ ∀y x ∈ {y|s}.

These axioms are sufficient to prove set membership when x is in fact a member of a givenset; they have nothing to say about cases where x is not a member. For example, it is notpossible to prove that x is not a member of the empty set.

Another way view the problem is to look at some of the unintended models allowed by theaxioms. Consider a model with domain elements, A, {A}, and {}, where we interpret the ∈relation as

I(∈) = { < A, {A} >,< A, {} > }

This model satisfies the axioms but is clearly not what we intend as A is considered to be anelement of the empty set.

3

Page 4: CS532, Winter 2008 Homework #1 Solutionweb.engr.oregonstate.edu/~afern/classes/cs532/hw/hw-1-solutions.pdf · CS532, Winter 2008 Homework #1 Solution Dr. Alan Fern, afern@cs.orst.edu

8.15 Explain what is wrong with the following proposed definition of adjacent squares in thewumpus world (in terms of models allowed):

∀x, yAdjacent([x, y], [x+ 1, y]) ∧Adjacent([x, y], [x, y + 1]).

There are several problems with the proposed definition. For example, it allows one to proveAdjacent([1, 1], [1, 2]) but not Adjacent([1, 2], [1, 1]). At the very least, this shows we need anadditional symmetry axiom. It does not allow one to prove that Adjacent([1, 1], [1, 3]) is false,so it needs to be written as

∀ s1, s2 ⇐⇒ . . .

Finally, it does not work at the boundaries of the world, so some extra conditions must beadded.

4