Question
Use Prolog only (syntax and semantics.} (Use siwpl-SWI-Prolog) Define a relation contains which relates dishes and all of their ingredients with the corresponding quantities. For
Use Prolog only (syntax and semantics.} (Use siwpl-SWI-Prolog)
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
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