# First order Logic!

• Dec 31st 2010, 03:07 PM
payam
First order Logic!
Could anyone help me with this? (Headbang)

Donald and Daisy Duck took their nephews, age 4, 5, and 6, on an outing. Each boy wore a tee-shirt with a different design on it and of a different color. You are also given the following information:
■ Huey is younger than the boy in the green tee-shirt.
■ The 5-year-old wore the tee-shirt with the camel design.
■ Dewey’s tee-shirt was yellow.
■ Louie’s tee-shirt bore the giraffe design.
■ The panda design was not featured on the white tee-shirt.

And,

Use the language containing the constants huey, dewey, louie, 4, 5, 6, green, yellow, white, camel, giraffe, and panda; the function symbols age/1, color/1, and design/1; and the predicate symbols Nephew/1, = /2 and < /2.

Questions:

(a) Represent these facts as sentences in FOL.
(b) Using your formalization, is it possible to conclude the age of each boy together with the color and design of the tee-shirt he is wearing? Show semantically how you determined your answer.
(c) If your answer was “no,” indicate what further sentences you would need to add so that you could conclude the age of each boy together with the color and design of the tee-shirt he is wearing.

• Dec 31st 2010, 07:56 PM
I don't know FOL, but hopefully I can help you solve the problem.

1 ■ Huey is younger than the boy in the green tee-shirt.
2 ■ The 5-year-old wore the tee-shirt with the camel design.
3 ■ Dewey’s tee-shirt was yellow.
4 ■ Louie’s tee-shirt bore the giraffe design.
5 ■ The panda design was not featured on the white tee-shirt.
--

Statement 1 implies Huey is not wearing a green shirt. Statement 3 implies he's not wearing the yellow shirt. Hence he's wearing the white shirt. Then 4 and 5 imply that Huey's shirt bore the camel design. Statement 2 implies that Huey is 5. Hence: Huey, 5, white, camel

By Statement 1, since Huey is younger than the boy in the green t-shirt, this implies that the boy in the green shirt is 6. Hence by Statement 3, Louie is 6 and Dewey is 4. Hence: Louie, 6, green, giraffe. Dewey, 4, yellow, panda.

It's a bit confusing at first, but if you work it out you should be fine. A table can help as well.
• Jan 1st 2011, 02:49 AM
Ackbeet
I'll give my stab at translating the first sentence into FOL. I'll do an iterative approach to show what my thought process was in translation. I'll use MacstersUndead's numbering scheme as well.

1. $\displaystyle \text{age}(\text{huey})<\text{age}(\text{boy in the green T-shirt})$ (This is the main idea this statement is making. What remains is to translate "boy in the green T-shirt" into FOL. This is non-trivial. I may be breaking some of your FOL rules here, but hopefully I'll give you an idea of how it might be done.)

1. $\displaystyle \text{age}(\text{huey})<\text{age}((x)(x\in\{\text {huey},\text{dewey},\text{louie}\}\land =\!(\text{color}(x),\text{green}))).$ You'll notice that I'm sort of using a quantifier-type construction here, only without the quantifier. That's because I need to have a variable that is a boy, instead of merely asserting the existence of a boy, or saying something about all the boys. In mathematical notation, I'd probably use set builder notation to translate "boy in the green T-shirt" thus:

$\displaystyle \{x|x\in\{\text{huey},\text{dewey},\text{louie}\}\ land =\!(\text{color}(x),\text{green})\}.$

Finally, since I'm thinking that the notation of sets might not be available to you, I can rewrite one more time this way:

1. $\displaystyle \text{age}(\text{huey})<\text{age}((x)((=\!(x,\tex t{huey})\lor =\!(x,\text{dewey})\lor =\!(x,\text{louie}))\land =\!(\text{color}(x),\text{green}))).$ So in this expression, the only thing about which I'm unsure is whether I can use that type of expression to get at the value of $\displaystyle x.$ You'll also note that I'm assuming the "color" function returns the color of its argument's T-shirt. If it didn't, we'd have to have another function that returned the T-shirt of its argument, so that you'd write it thus:

$\displaystyle \text{color}(\text{T-shirt}(x)),$ anytime you wanted the color of a T-shirt.

[EDIT]: To get rid of the problems above, actually USE a quantifier! Throw everything inside a quantifier statement thus:

$\displaystyle (\forall x)(((=\!(x,\text{huey})\lor =\!(x,\text{dewey})\lor =\!(x,\text{louie}))\land =\!(\text{color}(x),\text{green}))\to\:<\!(\text{a ge}(\text{huey}),\text{age}(x))).$

So, re-translating this FOL sentence into English would go like this: for any x, if x is either Huey, Dewey, or Louie, and if x's T-shirt is green, then the age of Huey is less than the age of x.

I think that does it.
• Jan 2nd 2011, 08:33 AM
payam
That was really helful.

Following your comments, I tried to do part 'a', that is translating the sentences to FOL:

a)Representing facts as sentences in FOL.

(1) ∀x [(color (Shirt (x)) =green) → (age (huey) < age (x))]

(2) ∀x [(age(x) = 5) → (design, shirt(x)= camel)]

(3)Ex dewey(x) /\ shirt (x) = yellow

(4) Ey louie (y) /\ (design, shirt (y) = giraffe)

(5) Ex z(shirt) /\ white(color(z)) /\ (design (z) =/ panda)

Do you think these are correct? I suppose the are. Then I need to do the part B, which is to conclude age, color and design of each boy. Any idea? Thanks
• Jan 2nd 2011, 02:31 PM
payam
I think MacstersUndead solution for second part is perfect.

Thanks.
• Jan 3rd 2011, 02:31 AM
Ackbeet
Unless your universe of discourse is the set of the boys, none of your sentences work, because they don't restrict the possible objects over which the variable x can run. Are you sure you're allowed to introduce the Shirt function? In # 2, you should have (design(shirt(x))= camel). For #3, why not do simply Shirt(dewey) = yellow? You don't have to use quantifiers everywhere, necessarily. In addition, the way you've written it, dewey is now a predicate, which was not given in the beginning as one of the allowed predicates. I don't think your #5 has quite got it. You should only need one variable for that one.
• Jan 3rd 2011, 07:36 AM
payam
Thanks Ackbeet, that was really helpful,

I made some changes, as:

(1) ∀x [(color (Shirt (x)) =green) → (age (huey) < age (x))]

(2) ∀x [(age(x) = 5) → (design (shirt(x))= camel)]

(3) Shirt(dewey) = yellow

(4) Ey louie (y) /\ (design, shirt (y) = giraffe)

(5)∀x [color(shirt(x)) = white -> design(shirt(x)) =/ Panda]

what do you think about these? thanks
• Jan 3rd 2011, 08:07 AM
Ackbeet
Whoops. Sorry. For (3), you're going to need this:

Color(Shirt(dewey)) = yellow.

For (4), do the same sort of thing as with 3:

design(Shirt(louie)) = giraffe

Everything else looks good.
• Jan 3rd 2011, 10:43 AM
payam
Thanks Ackbeet.
• Jan 3rd 2011, 10:55 AM
Ackbeet
You're welcome. Have a good one!