father(b1,b2). father(p1,p2). bird(b1). penguin(p1). bird(X) :- penguin(X). flies(X) :- bird(X), not -flies(X). -flies(X) :- penguin(X). % these ancestor rules along with the father facts % above make s(CASP) not terminate anc(X,Y):- father(X,Y). anc(X,Y) :- anc(X,Z), anc(Z,Y). penguin(X):- anc(Y,X), penguin(Y). %bird(X):- anc(Y,X), bird(Y). % ?- -flies(p1). ?- flies(b1).