(0) Obligation:

Clauses:

len([], 0).
len(Xs, s(N)) :- ','(no(empty(Xs)), ','(tail(Xs, Ys), len(Ys, N))).
tail([], []).
tail(.(X, Xs), Xs).
empty([]).
no(X) :- ','(X, ','(!, failure(a))).
no(X1).
failure(b).

Queries:

len(g,a).

(1) CutEliminatorProof (SOUND transformation)

Eliminated all cuts by simply ignoring them[PROLOG].

(2) Obligation:

Clauses:

len([], 0).
len(Xs, s(N)) :- ','(no(empty(Xs)), ','(tail(Xs, Ys), len(Ys, N))).
tail([], []).
tail(.(X, Xs), Xs).
empty([]).
no(X) :- ','(X, failure(a)).
no(X1).
failure(b).

Queries:

len(g,a).