/* Formulae for the shopping example from Russell and Norvig */ test3 :- nl, writenl('Test 3'), abdemo([holds_at(have(o1),T), holds_at(have(o2),T), holds_at(have(o3),T)], [[],[]], R). test4 :- nl, writenl('Test 4'), abdemo([holds_at(have(o1),T), holds_at(have(o2),T), holds_at(have(o3),T), holds_at(have(o4),T)], [[],[]], R). test5 :- abdemo([holds_at(have(o1),T), holds_at(have(o2),T), holds_at(have(o3),T), holds_at(have(o4),T), holds_at(have(o5),T)], [[],[]], R). test6 :- nl, writenl('Test 6'), abdemo([holds_at(have(o1),T), holds_at(have(o2),T), holds_at(have(o3),T), holds_at(have(o4),T), holds_at(have(o5),T), holds_at(have(o6),T)], [[],[]], R). test7 :- abdemo([holds_at(have(o1),T), holds_at(have(o2),T), holds_at(have(o3),T), holds_at(have(o4),T), holds_at(have(o5),T), holds_at(have(o6),T), holds_at(have(o7),T)], [[],[]], R). test8 :- nl, writenl('Test 8'), abdemo([holds_at(have(o1),T), holds_at(have(o2),T), holds_at(have(o3),T), holds_at(have(o4),T), holds_at(have(o5),T), holds_at(have(o6),T), holds_at(have(o7),T), holds_at(have(o8),T)], [[],[]], R). test9 :- abdemo([holds_at(have(o1),T), holds_at(have(o2),T), holds_at(have(o3),T), holds_at(have(o4),T), holds_at(have(o5),T), holds_at(have(o6),T), holds_at(have(o7),T), holds_at(have(o8),T), holds_at(have(o9),T)], [[],[]], R). test10 :- nl, writenl('Test 10'), abdemo([holds_at(have(o1),T), holds_at(have(o2),T), holds_at(have(o3),T), holds_at(have(o4),T), holds_at(have(o5),T), holds_at(have(o6),T), holds_at(have(o7),T), holds_at(have(o8),T), holds_at(have(o9),T), holds_at(have(o10),T)], [[],[]], R). test12 :- nl, writenl('Test 12'), abdemo([holds_at(have(o1),T), holds_at(have(o2),T), holds_at(have(o3),T), holds_at(have(o4),T), holds_at(have(o5),T), holds_at(have(o6),T), holds_at(have(o7),T), holds_at(have(o8),T), holds_at(have(o9),T), holds_at(have(o10),T), holds_at(have(o11),T), holds_at(have(o12),T)], [[],[]], R). test14 :- nl, writenl('Test 14'), abdemo([holds_at(have(o1),T), holds_at(have(o2),T), holds_at(have(o3),T), holds_at(have(o4),T), holds_at(have(o5),T), holds_at(have(o6),T), holds_at(have(o7),T), holds_at(have(o8),T), holds_at(have(o9),T), holds_at(have(o10),T), holds_at(have(o11),T), holds_at(have(o12),T), holds_at(have(o13),T), holds_at(have(o14),T)], [[],[]], R). test16 :- nl, writenl('Test 16'), abdemo([holds_at(have(o1),T), holds_at(have(o2),T), holds_at(have(o3),T), holds_at(have(o4),T), holds_at(have(o5),T), holds_at(have(o6),T), holds_at(have(o7),T), holds_at(have(o8),T), holds_at(have(o9),T), holds_at(have(o10),T), holds_at(have(o11),T), holds_at(have(o12),T), holds_at(have(o13),T), holds_at(have(o14),T), holds_at(have(o15),T), holds_at(have(o16),T)], [[],[]], R). axiom(initiates(go(X),at(X),T),[]). axiom(terminates(go(X),at(Y),T),[diff(X,Y)]). axiom(initiates(buy(X),have(X),T),[sells(Y,X), holds_at(at(Y),T)]). axiom(sells(s1,o1),[]). axiom(sells(s2,o2),[]). axiom(sells(s3,o3),[]). axiom(sells(s4,o4),[]). axiom(sells(s5,o5),[]). axiom(sells(s6,o6),[]). axiom(sells(s7,o7),[]). axiom(sells(s8,o8),[]). axiom(sells(s9,o9),[]). axiom(sells(s10,o10),[]). axiom(sells(s11,o11),[]). axiom(sells(s12,o12),[]). axiom(sells(s13,o13),[]). axiom(sells(s14,o14),[]). axiom(sells(s15,o15),[]). axiom(sells(s16,o16),[]). /* Abduction policy */ abducible(dummy). executable(go(X)). executable(buy(X)).