next up previous
Next: Example 1 Up: No Title Previous: No Title

Controlling Backtracking

member(X, [ X| _]) :- !.

member(X, [ _| Tail) :-
  member( X, Tail).

Notice the use of the cut in the first clause



Omer F Rana
Sun Feb 16 21:01:24 GMT 1997