• Support PF! Buy your school textbooks, materials and every day products Here!

Convert sentences into First Order Logic

  • Thread starter Cruger
  • Start date
  • #1
7
0
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) [itex]\exists[/itex]x person(x) [itex]\wedge[/itex] [itex]\neg[/itex]inClass(x) [itex]\rightarrow[/itex] ill(x) [itex]\vee[/itex] lazy(x)

2) [itex]\forall[/itex]x person(x) [itex]\wedge[/itex] ill(x) [itex]\wedge[/itex] [itex]\neg[/itex]goShopping(x)

3) [itex]\exists[/itex]x teacher(x) [itex]\wedge[/itex] hasNoticed(x) [itex]\rightarrow[/itex] [itex]\neg[/itex]inClass(James) [itex]\wedge[/itex] goShopping(James)


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

Answers and Replies

  • #2
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
683
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.
 
  • #3
7
0
Can you please write it in correct way?
I need to have a clear idea....
 
  • #4
7
0
Is this right?

1) [itex]\exists[/itex]x person(x) [itex]\wedge[/itex] [itex]\neg[/itex]inClass(x) [itex]\rightarrow[/itex] ill(x) [itex]\vee[/itex] lazy(x)

2) [itex]\forall[/itex]x person(x) [itex]\wedge[/itex] ill(x) [itex]\rightarrow[/itex] [itex]\neg[/itex]goShopping(x)

3) [itex]\exists[/itex]x teacher(x) [itex]\wedge[/itex] (hasNoticed(x, James) [itex]\wedge[/itex] [itex]\neg[/itex]inClass(James) [itex]\wedge[/itex] goShopping(James))
 
  • #5
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
683
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.
 
  • #6
7
0
how about this?

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

2) [itex]\neg[/itex] [itex]\exists[/itex]x (go(ill_people, x) [itex]\wedge[/itex] shopping(x))

3) [itex]\exists[/itex]x teacher(x) [itex]\wedge[/itex] (hasNoticed(x, James) [itex]\wedge[/itex] [itex]\neg[/itex] inClass(Suresh)) [itex]\wedge[/itex] goes(James, shopping))
 
Last edited:
  • #7
7
0
plz reply..........................
 
  • #8
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
683
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.
 
  • #9
7
0
I'm so confused. please do this for me......
 
  • #10
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
683
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.
 
  • #11
verty
Homework Helper
2,164
198
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.
 

Related Threads on Convert sentences into First Order Logic

Replies
3
Views
969
Replies
35
Views
2K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
3
Views
2K
Replies
2
Views
1K
  • Last Post
Replies
6
Views
2K
  • Last Post
Replies
15
Views
3K
  • Last Post
Replies
5
Views
532
Replies
16
Views
2K
Replies
3
Views
376
Top