<div class="notebook"> <div class="nb-cell markdown" name="md1"> # Using Well Founded Semantics As an example consider one of Russell's paradoxes -- the barber in a town shaves every person who does not shave himself-- written as a logic program. From _|"XSB: A System for Efficiently Computing Well-Founded Semantics"|_ by Prasad Rao, Konstantinos Sagonas, Terrance Swift, David S. Warren and Juliana Freire. </div> <div class="nb-cell program" name="p1"> :- table shaves/2. shaves(barber,P) :- person(P), tnot(shaves(P,P)). person(barber). person(mayor). </div> <div class="nb-cell query" name="q1"> shaves(X, Y). </div> </div>