<div class="notebook"> <div class="nb-cell program" name="p1"> hasBook(markham_library,dave,"Artifical Intelligence: A Modern Approach",1). hasBook(indigo,levesque,"the two",2). hasBook(union_library,dave,"the three",3). hasBook(somewhere_library,bob,"Thinking as Computation",4). hasBook(amazon,robert,"the five",5). hasBook(ajax_library,daniel ,"the six",6). hasBook(markham_library,evan,"Computational Intelligence",7). hasBook(stouffvile_library,john ,"the eight",8). hasBook(ajax_library,sam,"the nine",9). hasBook(kitchner_library,david,"the ten",10). hasBook(amazon,chad,"the eleven",105). hasBook(amazon,chad, "the twelve", 107). hasBook(amazon,chad, "the thirteen",10). hasBook(amazon,chad, "the fourteen", 20). hasBook(amazon,jkrowling,"harrypotter",10). hasBook(markham_library,jkrowling,"harrypotter",5). lives(brad,markham). lives(joyce,stouffville). lives(opal,union). lives(delia,ajax). lives(verna,ville). lives(sean,ajax). lives(william,kitchner). lives(casey,ajax). lives(courtney,markham). lives(garrett,stouffville). lives(chad,newyork). shipping(markham_library, union, 1). shipping(stouffville_library, toronto, 2). shipping(markham_library, stouffville, 3). shipping(stouffville_library, stouffville, 4). shipping(markham_library, markham, 5). shipping(stouffville_library, ajax, 6). shipping(markham_library, kitchner, 7). shipping(stouffville_library, kitchner, 11). shipping(union_library, markham, 9). shipping(union_library, stouffville, 2). shipping(amazon, stouffville, 5). shipping(amazon, markham, 17). shipping(amazon, toronto, 20). shipping(markham_library, toronto, 5). </div> <div class="nb-cell query" name="q1"> hasBook(_,X,A,_), not(( hasBook(_,X,B,_), B\=A) ) </div> </div>