Question: Write prolog rule ordered_pizza(Person):- Consider the following problem: Donna, Danny, David, and Doreen were seated at a table in a restaurant. The men sat across
Write prolog rule
ordered_pizza(Person):-
Consider the following problem: Donna, Danny, David, and Doreen were seated at a table in a restaurant. The men sat across from each other, as did the women. They each ordered a different main course with a different beverage.
In addition,
Doreen sat beside the person who ordered steak.
The chicken came with a Coke.
The person with the lasagna sat across from the person with milk.
David never drinks coffee.
Donna only drinks water.
Danny could not afford to order steak.
Who ordered the pizza? Write a Prolog program that solves this problem by displaying who ordered each of the main courses and each of the beverages. Hint: Begin by writing clauses de?ning predicates beside(x,y), which holds if person x is sitting beside person y, and across(x,y), which holds if person x is sitting across from person y.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
