/** The Love Shop John smelled the rose. As an aside, in Cognitive Science, one may check whether a property has changed. For example, one may check whether a rose still smells fragrant, because of being watered the previous day. If it is fragrant, it will therefore be pressed. The algorithm watered1/2 tests whether the list of Properties belongs to every item in Area. watered1([s,c], [[[s,c], [s,c], [s,c], [s,c]], [[s,c], [s,c], [s,c], [s,c]], [[s,c], [s,c], [s,c], [s,c]], [[s,c], [s,c], [s,c], [s,c]]]). Yes watered1([s,c], [[[s,c], [s,c], [s,c], [s,c]], [[s,c], [c], [s,c], [c]], [[s,c], [s], [c], [s,c]], [[s,c], [s,c], [], [s]]]). No watered1(+Properties, +Area) Properties - The list of properties to test each of the items for: s - soft c - cold Area - The area, composed of lines of items, to test for the properties. **/ watered1(_, []). watered1(Properties, [Line | Lines]) :- watered2(Properties, Line), watered1(Properties, Lines). /** watered1(+Properties, +Line) Properties - The list of properties to test each of the items for, as in watered1/2. Line - The line, composed of items, to test for the properties. **/ watered2(_, []). watered2(Properties, [Item | Items]) :- sameproperties(Properties, Item), watered2(Properties,Items). /** sameproperties(+Properties, +Item) Properties - The list of properties to test each of the items for, as in watered 1/2. Item - The item, a list of properties, to test for the properties. **/ sameproperties([], []). sameproperties([Item | Items], List1) :- member(Item, List1), delete(List1, Item, List2), sameproperties(Items, List2).