Translating English sentence to First Order Logic sentence

938 Views Asked by At

For the following natural language sentence:

Hermione is the only Gryffindor student who does not like Flying class.

My English to FOL conversion is as follows:

∀x StudentOf(x, Gryffindor) ∧ ¬Likes(x, Flying) ⇒  (x = Hermione)

I've been told that this is wrong, but I believe it is right.

Do you think this conversion is right? If not, can you please help me with why this is wrong?

3

There are 3 best solutions below

0
On

It is wrong.

Assume there are no students in Gryffindor. Then your FOL would still be true, but the natural language sentence clearly states that there is at least one student, namely Hermione.

0
On

Your formula is indeed wrong. The problem is that the universally quantified statement can become vacuously true: If there are no students at all, then by the semantics of $\forall$ and $\to$, the formula becomes true, but this conflicts with the intended meaning of the English sentence which implies that there is at least one student, namely Hermione.
So you need to include an additional existential quantification in order to ensure that Hermione exists, and conjoin it with the uniqueness constraint that she is the only such student.

As a way to approach the (or a) correct solution:

"Exactly one" (sometimes written $!\exists x \phi$) can be formalized as $$\underbrace{\exists x(\phi (x)}_{\text{existence}} \land \underbrace{\forall y (\phi(y) \to y=x)}_{\text{uniqueness}})$$ or equilvalently $$\exists x \forall y (\phi(y) \leftrightarrow y=x)$$

Since your sentence can be paraphrased as

"There is exactly one Gryffindor student who does not like flying classes, and this student is Hermione"

all you need to do now is insert "is a student who (= and) does not like flying classes" for $\phi$, and add the condition that $x$ is Hermione:

$$\exists x \forall y ((studentof(y,gryffindor) \land \neg like(y,flying) \leftrightarrow y = x) \land x = hermione)$$

0
On

First, you need to add a few parnetheses to give the quantifier its correct scope:

$$\forall x ((StudentOf(x, Gryffindor) \land \neg Likes(x, Flying)) \to x = Hermione)$$

Second, as others have pointed out, this sentence does not require Hermione to actually be a student of Gryffindor, though that is clearly implied. The fix is easy: just change the conditional into a biconditional:

$$\forall x ((StudentOf(x, Gryffindor) \land \neg Likes(x, Flying)) \leftrightarrow x = Hermione)$$