Question: How will you represent following programs in Prolog? 1.If John feels hungry, then he eats quickly. If he eats quickly, he gets heartburn. If he

How will you represent following programs in Prolog?

1.If John feels hungry, then he eats quickly. If he eats quickly, he gets heartburn. If he gets heartburn, he takes medicine. John feels hungry. Write rules and solve what will be the answer to this query takes(John, medicine).

2.John is dating Nancy, but right now he is wondering if he must leave the country. Now John will take a vacation in either of two circumstances: if the IRS is after him, or if he is doomed. He is also dating Susan. If he is dating both of them, then Nancy knows this. Now John is in fact doomed if both Nancy and Susan know he is dating both of them. If John will take a vacation, then he must leave the country. So must John leave the country?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!