premium(CUSTOMER) :- spending(CUSTOMER, "min 5000 euro", "previous year").
luxury("Porsche").
regular("Honda").
spending("Peter Miller", "min 5000 euro", "previous year").
integrity(xor(discount(CUSTOMER, PRODUCT, "5.0 percent"), discount(CUSTOMER, PRODUCT, "7.5 percent"))).
overrides("discount7.5", "discount5.0").
oid("discount5.0",discount(CUSTOMER, PRODUCT, "5.0 percent")).
discount(CUSTOMER, PRODUCT, "5.0 percent") :- testIntegrity(discount(CUSTOMER, PRODUCT, "5.0 percent")), defeasible(premium(CUSTOMER)), defeasible(regular(PRODUCT)), not(defeated("discount5.0", discount(CUSTOMER, PRODUCT, "5.0 percent"))).
neg(blocked(defeasible(discount(CUSTOMER, PRODUCT, "5.0 percent")))) :- testIntegrity(discount(CUSTOMER, PRODUCT, "5.0 percent")), defeasible(premium(CUSTOMER)), defeasible(regular(PRODUCT)).
body(defeasible(discount(CUSTOMER, PRODUCT, "5.0 percent"))) :- defeasible(premium(CUSTOMER)), defeasible(regular(PRODUCT)).
oid("discount7,5",discount(CUSTOMER, PRODUCT, "7.5 percent")).
discount(CUSTOMER, PRODUCT, "7.5 percent") :- testIntegrity(discount(CUSTOMER, PRODUCT, "7.5 percent")), defeasible(premium(CUSTOMER)), defeasible(luxury(PRODUCT)), not(defeated("discount7,5", discount(CUSTOMER, PRODUCT, "7.5 percent"))).
neg(blocked(defeasible(discount(CUSTOMER, PRODUCT, "7.5 percent")))) :- testIntegrity(discount(CUSTOMER, PRODUCT, "7.5 percent")), defeasible(premium(CUSTOMER)), defeasible(luxury(PRODUCT)).
body(defeasible(discount(CUSTOMER, PRODUCT, "7.5 percent"))) :- defeasible(premium(CUSTOMER)), defeasible(luxury(PRODUCT)).
:-solve(defeasible(discount(CUSTOMER, PRODUCT, AMOUNT))).
