# Convert sentences into First Order Logic

Hello there, I have 3 sentences.

They are:
1) If someone is not in the class then that person is either ill or lazy.
2) Ill people do not go for shopping.
3) The class teacher noticed that James is not in the class but she has seen James come out of the Candy Shop.

I want to convert above sentences to first order logic.

I have tried like this

1) $\exists$x person(x) $\wedge$ $\neg$inClass(x) $\rightarrow$ ill(x) $\vee$ lazy(x)

2) $\forall$x person(x) $\wedge$ ill(x) $\wedge$ $\neg$goShopping(x)

3) $\exists$x teacher(x) $\wedge$ hasNoticed(x) $\rightarrow$ $\neg$inClass(James) $\wedge$ goShopping(James)

Please somebody tell me whether these are right or wrong?
If they are wrong can you correct them?
Thank you.........

Last edited:

D H
Staff Emeritus
1 doesn't look quite right. What if everyone is in class?

2 says that everyone is ill and nobody is shopping.

3 is also definitely wrong. Suppose Mr. X, a teacher, asks his class if anyone knows the answer to some question. He notices Jane raising her hand. This does not imply one thing about James. Mr. X might not even have James as a student.

Can you please write it in correct way?
I need to have a clear idea....

Is this right?

1) $\exists$x person(x) $\wedge$ $\neg$inClass(x) $\rightarrow$ ill(x) $\vee$ lazy(x)

2) $\forall$x person(x) $\wedge$ ill(x) $\rightarrow$ $\neg$goShopping(x)

3) $\exists$x teacher(x) $\wedge$ (hasNoticed(x, James) $\wedge$ $\neg$inClass(James) $\wedge$ goShopping(James))

D H
Staff Emeritus
A problem common to your answers 1 and 2: No parentheses. What you wrote is not a WFF because implication is the last to be evaluated without parentheses. The x's on the right hand side of the implication in your expressions are free variables. I'm assuming you meant ∃x (person(x) ∧ ¬inClass(x) → ill(x) ∨ lazy(x)), or with even more parentheses, ∃x ((person(x) ∧ ¬inClass(x)) → (ill(x) ∨ lazy(x))) (but neither of these is correct).

For (1), you shouldn't be using ∃. What happens if x is a rock (i.e., not a person)?

(3) also has problems. Try translating what you wrote back to English. Hint: To be correct, the teacher has to have noticed that James is not in class and has to have noticed that James left the Candy Store.

1 person

1) $\forall$x [$\exists$y $\neg$inClass(y) $\rightarrow$ ill(y) $\vee$ lazy(y)]

2) $\neg$ $\exists$x (go(ill_people, x) $\wedge$ shopping(x))

3) $\exists$x teacher(x) $\wedge$ (hasNoticed(x, James) $\wedge$ $\neg$ inClass(Suresh)) $\wedge$ goes(James, shopping))

Last edited:

D H
Staff Emeritus
No. What's x doing in your new version of 1? In 2, what's this go(ill_people,x)? In 3, who's Suresh? Where's the Candy Store?

It looks like you are just grasping for answers.

I'm so confused. please do this for me......

D H
Staff Emeritus
We do not do your homework for you at this site.

It appears you are getting confused by "someone" in the phrase "if someone is not in the class then that person is either ill or lazy.". English is a bit sloppy. Sometimes "some" means "there exists", but not here. Consider the phrase "someone who is over 18 is eligible to vote". This does not mean that there exists some person who is over 18 and who is eligible to vote. It means that every person who is over 18 is eligible to vote. Try translating "Anyone who is not in class is either ill or lazy".

With regard to "ill people do not go for shopping," you were almost there once. You have to be careful of operator precedence. When in doubt, use parentheses. You can address this particular problem using either a universal or negated existential qualifier.

With regard to "the class teacher noticed that James is not in the class but she has seen James come out of the Candy Shop," there's no mention of shopping. One thing you have to be careful of here is the temptation to use second order logic. Don't make a predicate that takes a predicate as an argument.

1 person
verty
Homework Helper
Hello there, I have 3 sentences.

They are:
1) If someone is not in the class then that person is either ill or lazy.
2) Ill people do not go for shopping.
3) The class teacher noticed that James is not in the class but she has seen James come out of the Candy Shop.

I want to convert above sentences to first order logic.

You've got to take these step by step. Looking at number 1, what is the shape of the sentence? It is an if-then sentence. So your answer will be something like "(quantifiers) if (predicate) then (predicate)". This is the first step.

Next, let's look at the first predicate, it says someone is not in the class. So let's have C(x) mean, x is in the class. So our sentence now looks like "(quantifiers) if ~C(x) then (predicate)".

The second predicate is similar, I'll leave you to handle that. Now to decide what the quantifiers should be. The question must apply to all students, because it means that ANYONE who isn't in the class is ill or lazy. So it must be "all students x". So finally, "For all students x, if ~C(x) then (predicate)."

This is almost ready to translate. If ##\in## is available to you, you can translate this as-is. Otherwise, you need to modify it so that x includes only students. I can think of 3 ways to do that, see if you can find a way to do that.