Question
2 Arizona Best Pizzaria made combo pizza that contains exactly 45 ounces of toppings. The base has a fixed weight and is not considered in
2
Arizona Best Pizzaria made combo pizza that contains exactly 45 ounces of toppings. The
base has a fixed weight and is not considered in the calculation. The available toppings are listed below with their corresponding weight (in ounces). There can be multiple entries of each topping, as long as the total weight is equal to 45 ounces. [20 points]
Topping | Weight(ounces) | |||||
|
|
For example, a pizza can contain 1 topping of pepperoni, 2 toppings of meatball, 2 toppings of basil, and 2 toppings of olives: 1*5+ 2*10 + 2*7+ 2*3= 45(ounces)
A pizza cannot contain 6toppings of chicken: 6* 8= 48> 45
A pizza cannot contain only3 toppings of meatball: 3*10= 30< 45
2.1
Define a rule pizza(P, M, B, O, C) to find out how many of each topping can be contained
on a pizza, where P, M, B, O, and C are the weight (in ounces) of the pepperoni, meatball, basil, olives, and chicken toppings, respectively. [14]
2.2
Write a rule called q2 :- condition, to ask the following question (goal), so that the grader to
type | ?-q2. To test the question. [2]
| ?-pizza(1, 2, 2, 2, 2). Put all answers of the question in a comment in the file.
2.3
Write a rule called q3 :- condition, to ask the following question (goal), so that the grader to
type | ?-q3. To test the question. [2]
| ?-pizza(1, M, 1, O, C). Put all answers of the question in a comment in the file.
2.4
Write a rule called q3 :- condition, to ask the following question (goal), so that the grader to
type | ?-q3. To test the question. [2]
| ?-pizza(P, M, B, O, 1). Put all answers of the question in a comment in the file.
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