Help Converting to First Logic Order Representation

368 Views Asked by At

I'm studying AI and am having some issues understanding FOL. I need help in converting these examples into FOL with each statement having 2 variants. One with using the ∀ and the other with the ∃ symbols:

These are the examples and my attempts:

(i) All parrots are birds and all birds are animals.

a) ∀x, ((Parrot(x) ⇒ Bird(x)) ∧ (Bird(x) ⇒ Animal(x)))

b) ∃x, (Animal(x) ⇒ Bird(x)) ∧ ∃x, (Bird(x) ⇒ Parrot(x))

(ii) All plants are green or brown.

a) ∀x, Plant(x) ⇒ Green(x) ∨ Brown(x)

b) ∃x, ((Plant(x) ∧ Green(x)) ∨ (Plant(x) ∧ Brown(x)))

(iii) No birds are reptiles.

a) ∀x, Bird(x) ⇒ ¬Reptiles(x)

b) ¬∃x, Bird(x) ∧ Reptiles(x)

(iv) Some students are not smart.

a) ∀x, Students(x) ⇒ Smart(x) ∨ ¬Smart(x)

b) ∃x, Student(x) ∧ ¬Smart(x)

(v) Not all students are smart.

a) ∀x, Students(x) ⇒ Smart(x) ∨ ¬Smart(x)

b) ∃x, Student(x) ∧ ¬Smart(x)

(vi) The widow slaps every woman who does not slap herself.

a) ∀x, ((Woman(x)∧ ¬Slaps(x,x))⇒ Slaps(Widow,x)

b) ∃x (Widow(x) ∧ (∀(y), Woman(y) ∧ ¬Slaps(y,y) -> Slaps(x,y)))

Any help is appreciated. Thanks! Please correct me if I'm wrong.

1

There are 1 best solutions below

21
On BEST ANSWER

Do i put ∀(x), Parrot(x) -> Bird(x) ∧ [∀(x),Bird(x) -> Animal(x)]?

Right idea, but you need to be precise about the scope of the quantifier. One standard convention is to always use brackets around the quantified statement:

$\forall x\ ( Parrot(x) \to Bird(x) ) \land \forall x\ ( Bird(x) \to Animal(x) )$.

Note that under this convention the "$\land$" has lower priority than the "$\forall x$".

This accurately translates the English sentence. There is an equivalent alternative alluded to by Fabio Somenzi, but it does not accurately reflect the English sentence:

$\forall x\ ( ( Parrot(x) \to Bird(x) ) \land ( Bird(x) \to Animal(x) ) )$.

Actually what you need to learn is not how to translate English into first-order logic! Surprised by what I'm saying? Well what you need to learn is what exactly the sentences in first-order logic mean. So look at the definition of the meaning of "$\forall x\ ( \cdots )$" and "$\cdots \to \cdots$" and carefully think through what the above two sentences mean. Once you know precisely how to interpret every sentence in first-order logic, translating an English sentence into first-order logic becomes very straightforward; you simply construct the desired sentence to match the meaning you want to convey.

Taking (iii) as an example, you would have to ask yourself what it actually means. Well does it say something about every bird? Or does it say something about some birds? The answer will tell you which quantifier you need. You will also naturally see that "not all ..." can always be translated as "$\neg \forall \cdots$" or "$\exists \cdots$". The former corresponds more closely to the original form, while the latter corresponds to what you will get by following the kind of reasoning I showed above.

The English of (vi) is a little tricky to interpret, so the right way is to first decide what you think it means before attempting to translate it to first-order logic. Is "the widow" meant to convey that there is a unique object that is a "widow"? If so, then you would first have to say "there is an object that is a widow and is equal to any object that is a widow." in first-order logic. This may not be what you want. Another way is if you already have a constant symbol "widow", and if so you can just use that constant in your first-order sentence. As for "slap", it is a verb that takes a subject and object. Ignoring tense, "$x$ slaps $y$" is an assertion so we could capture "slap" by a $2$-input predicate-symbol. You have to precisely specify in your answer which input is for the subject and which input is for the object. The assertion is clearly saying something about every woman. In particular, for every woman $x$, it asserts that $widow$ slaps $x$ if ...

[Update]

I won't give direct answers to your whole list of attempts, but I'll point out the general mistakes. Under normal circumstances it is impossible for a sentence of the form "$\forall x\ ( \cdots )$" to say the same thing as a sentence of the form "$\exists x\ ( \cdots )$". The former means "Every $x$ ..." while the latter means "Some $x$ ...". That is why I said you must learn the exact meaning of first-order sentences first, before any attempts to translate from any other language to first-order logic. Also, to convert one quantifier to the other, we can simply analyze the meaning of the quantifiers. "$\forall x\ ( P(x) )$" is false exactly when there is some object $x$ such that "$P(x)$" is false, which is exactly when "$\exists x\ ( \neg P(x) )$" is true. And in general a sentence "$Q$" is false exactly when "$\neg Q$" is true. Putting these together will give you a systematic reasoning to convert each $\forall$-expression to an equivalent one using "$\exists$". Use the same reasoning on "$\forall x\ ( \neg P(x) )$" and you will get a systematic conversion of each $\exists$-expression to an equivalent one using "$\forall$".

[Second update]

(i)(b) Your attempt says "there is an $x$ such that ...", which as I said cannot be correct because (i) only makes claims about parrots and birds and does not even claim that there is anything at all. (i) says "given any parrot, it is also a bird". Think of it as a game. If you claim that (i) is true, then no matter what parrot I give you, you can convince me that it is a bird. It is the same as claiming that there is no parrot (that I can give you) that (I can convince you) is not a bird. Convert this into first-order logic.

(ii)(b) Same problem as above. Same solution. At the end you can also notice that "not ( X or Y )" is the same as "neither X nor Y" which is the same as "not X and not Y".

(iii)(b) It is correct, and I believe you got it after going through my previous explanation. That is precisely the same reasoning you need for the above two, but hopefully my above explanation helps further clarify them.

(iv)(a) Your attempt says "given any $x$, if $x$ is a student then $x$ is either smart or not smart". This is trivially true and not what you want. You only want to claim that some students are not smart. What is the opposite of this? The claim that every student is smart. You want the negation of the opposite claim.

(v) See above reasoning.

(vi) (a) is correct, and I think you it's because you actually did understand my explanation. (b) is not correct for the same reasons as the above.

Also please try your best to understand the explanation given in my first update, because it would explain why "$\forall x\ \neg ( \cdots )$" is equivalent to "$\neg \exists x\ ( \cdots )$".