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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started