(0) Obligation:

Clauses:

rev(L, R) :- rev(L, [], R).
rev([], Y, Y).
rev(L, S, R) :- ','(no(empty(L)), ','(head(L, X), ','(tail(L, T), rev(T, .(X, S), R)))).
head([], X1).
head(.(X, X2), X).
tail([], []).
tail(.(X3, Xs), Xs).
empty([]).
no(X) :- ','(X, ','(!, failure(a))).
no(X4).
failure(b).

Queries:

rev(g,a).

(1) CutEliminatorProof (SOUND transformation)

Eliminated all cuts by simply ignoring them[PROLOG].

(2) Obligation:

Clauses:

rev(L, R) :- rev(L, [], R).
rev([], Y, Y).
rev(L, S, R) :- ','(no(empty(L)), ','(head(L, X), ','(tail(L, T), rev(T, .(X, S), R)))).
head([], X1).
head(.(X, X2), X).
tail([], []).
tail(.(X3, Xs), Xs).
empty([]).
no(X) :- ','(X, failure(a)).
no(X4).
failure(b).

Queries:

rev(g,a).