(0) Obligation:

Clauses:

q(X) :- ','(not_zero(X), ','(p(X, Y), q(Y))).
p(0, 0).
p(s(X), X).
zero(0).
not_zero(X) :- ','(zero(X), ','(!, failure(a))).
not_zero(X1).
failure(b).

Query: q(g)

(1) PrologToTRSTransformerProof (SOUND transformation)

Transformed Prolog program to TRS.

(2) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

f2_in(s(T12)) → U1(f2_in(T12), s(T12))
U1(f2_out1, s(T12)) → f2_out1

Q is empty.

(3) QTRSRRRProof (EQUIVALENT transformation)

Used ordering:
Polynomial interpretation [POLO]:

POL(U1(x1, x2)) = x1 + x2   
POL(f2_in(x1)) = 2 + 2·x1   
POL(f2_out1) = 0   
POL(s(x1)) = 1 + 2·x1   
With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:

f2_in(s(T12)) → U1(f2_in(T12), s(T12))
U1(f2_out1, s(T12)) → f2_out1


(4) Obligation:

Q restricted rewrite system:
R is empty.
Q is empty.

(5) RisEmptyProof (EQUIVALENT transformation)

The TRS R is empty. Hence, termination is trivially proven.

(6) YES