% DiscountsR'Us Case study % See http://www.csci.csusb.edu/dick/cs656/discounts.html % rules discount(Day, Person, 10) :- card(Person), tuesday(Day). discount(D,P,5) :- card(P), not(tuesday(D)). discount(D,P,10):-senior(P), card(P). discount(D,P,5):-senior(P), not(card(P)). discount(D,P,0):-not(senior(P)), not(card(P)). % facts tuesday(jan29). tuesday(jan22). tuesday(feb5). card(tricia). card(maria). senior(tricia). person(dick). person(tricia). person(maria). % test: discount(jan29, tricia, X). % test: discount(jan21, tricia, X). % test: discount(When, Who, 7).