Question: use prolog - swipl Define a relation contains which relates dishes and all of their ingredients with the corresponding quantities. For instance, pancakes contain 3

use prolog - swipl

Define a relation contains which relates dishes and all of their ingredients with the corresponding quantities. For instance, pancakes contain 3 units of milk, 4 units of flour and 3 units of eggs. Then define a relation available which describes the available ingredients and their quantities. For example: we may have 3 units of milk and 4 units of jam available. Finally define two relations: can_cook(X) which should hold for a dish X if all its ingredients are available in the required quantities; needs_ingredient(X, Y) which holds for a dish X and an ingredient Y if X contains Y .

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!