1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Convert sentences into First Order Logic

  1. Sep 2, 2013 #1
    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: Sep 2, 2013
  2. jcsd
  3. Sep 2, 2013 #2

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    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.
     
  4. Sep 2, 2013 #3
    Can you please write it in correct way?
    I need to have a clear idea....
     
  5. Sep 2, 2013 #4
    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))
     
  6. Sep 2, 2013 #5

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    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.
     
  7. Sep 2, 2013 #6
    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: Sep 2, 2013
  8. Sep 2, 2013 #7
    plz reply..........................
     
  9. Sep 2, 2013 #8

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    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.
     
  10. Sep 2, 2013 #9
    I'm so confused. please do this for me......
     
  11. Sep 2, 2013 #10

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    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.
     
  12. Sep 2, 2013 #11

    verty

    User Avatar
    Homework Helper

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Convert sentences into First Order Logic
  1. First order logic (Replies: 1)

  2. First order logic (Replies: 3)

Loading...