What are the uses of the fail predicate in Prolog?
I can't come up with a situation where I would need it. Elegant systems provide false/0 as a declarative synonym for the imperative fail/0 . An example where it is useful is when you manually want to force backtracking for side-effects, like: ?- between(1,3,N), format("line ~w\n", [N]), false. line 1 line 2 line 3 Instead of false/0 , you can also use any goal that fails, for example a bit shorter: ?- between(1,3,N), format("line ~w\n", [N]), 0=1. line 1 line 2 line 3 Thus, false/0 is not strictly needed but quite nice. EDIT : I sometimes see beginners who want to state for example "my