Question
Prolog Suppose we have a collection of rules about what people are wearing. We will represent an item of clothing by a structure with function
Prolog
Suppose we have a collection of rules about what people are wearing. We will represent an item of clothing by a structure with function name "clothing" and three parameters: the type of clothing (hat, shirt, etc.), the color (blue, green, etc.), and the size (a whole number). For example:
wearing( julia, clothing( hat, red, 3 ) ). wearing( julia, clothing( shirt, blue, 4 ) ). wearing( jack, clothing( shirt, purple, 6 ) ). wearing( bill, clothing( hat, red, 10 ) ). wearing( marie, clothing( shirt, blue, 2 ) ). wearing( jack, clothing( hat, green, 10 ) ).
Write a rule (and then test it) to find facts of who will be pinched on Saint Patricks Day for not wearing green.
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