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 Patrick's Day for not wearing green.