% Generic example with cut.  Trace it to see what happens.

a(X) :- b(X), c(X), !, d(X), e(X).
a(X) :- p(X).

b(1).
b(2).
c(3).
b(4).
c(4).
d(4).
b(5).
c(5).
d(5).
e(5).
p(22).
