(0) Obligation:

Clauses:

h(X) :- ','(f(X), g(X)).
f(c(0, X1)) :- !.
f(c(X, Y)) :- ','(p(X, P), f(c(P, s(Y)))).
g(c(X2, 0)) :- !.
g(c(X, Y)) :- ','(p(Y, P), g(c(s(X), P))).
p(0, 0).
p(s(X), X).

Queries:

h(g).

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(2) Obligation:

Triples:

g88(T65, s(T70)) :- g88(s(T65), T70).
f105(s(T97), T93) :- f105(T97, s(T93)).
h1(c(0, s(s(s(s(s(s(s(s(T54)))))))))) :- g88(s(s(s(s(s(s(s(0))))))), T54).
h1(c(s(T81), T77)) :- f105(T81, T77).
h1(c(s(T81), T77)) :- ','(fc105(T81, T77), g88(T81, T77)).

Clauses:

gc88(T59, 0).
gc88(T65, s(T70)) :- gc88(s(T65), T70).
fc105(0, T86).
fc105(s(T97), T93) :- fc105(T97, s(T93)).

Afs:

h1(x1)  =  h1(x1)

(3) TriplesToPiDPProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
h1_in: (b)
g88_in: (b,b)
f105_in: (b,b)
fc105_in: (b,b)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

H1_IN_G(c(0, s(s(s(s(s(s(s(s(T54)))))))))) → U3_G(T54, g88_in_gg(s(s(s(s(s(s(s(0))))))), T54))
H1_IN_G(c(0, s(s(s(s(s(s(s(s(T54)))))))))) → G88_IN_GG(s(s(s(s(s(s(s(0))))))), T54)
G88_IN_GG(T65, s(T70)) → U1_GG(T65, T70, g88_in_gg(s(T65), T70))
G88_IN_GG(T65, s(T70)) → G88_IN_GG(s(T65), T70)
H1_IN_G(c(s(T81), T77)) → U4_G(T81, T77, f105_in_gg(T81, T77))
H1_IN_G(c(s(T81), T77)) → F105_IN_GG(T81, T77)
F105_IN_GG(s(T97), T93) → U2_GG(T97, T93, f105_in_gg(T97, s(T93)))
F105_IN_GG(s(T97), T93) → F105_IN_GG(T97, s(T93))
H1_IN_G(c(s(T81), T77)) → U5_G(T81, T77, fc105_in_gg(T81, T77))
U5_G(T81, T77, fc105_out_gg(T81, T77)) → U6_G(T81, T77, g88_in_gg(T81, T77))
U5_G(T81, T77, fc105_out_gg(T81, T77)) → G88_IN_GG(T81, T77)

The TRS R consists of the following rules:

fc105_in_gg(0, T86) → fc105_out_gg(0, T86)
fc105_in_gg(s(T97), T93) → U9_gg(T97, T93, fc105_in_gg(T97, s(T93)))
U9_gg(T97, T93, fc105_out_gg(T97, s(T93))) → fc105_out_gg(s(T97), T93)

Pi is empty.
We have to consider all (P,R,Pi)-chains

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

H1_IN_G(c(0, s(s(s(s(s(s(s(s(T54)))))))))) → U3_G(T54, g88_in_gg(s(s(s(s(s(s(s(0))))))), T54))
H1_IN_G(c(0, s(s(s(s(s(s(s(s(T54)))))))))) → G88_IN_GG(s(s(s(s(s(s(s(0))))))), T54)
G88_IN_GG(T65, s(T70)) → U1_GG(T65, T70, g88_in_gg(s(T65), T70))
G88_IN_GG(T65, s(T70)) → G88_IN_GG(s(T65), T70)
H1_IN_G(c(s(T81), T77)) → U4_G(T81, T77, f105_in_gg(T81, T77))
H1_IN_G(c(s(T81), T77)) → F105_IN_GG(T81, T77)
F105_IN_GG(s(T97), T93) → U2_GG(T97, T93, f105_in_gg(T97, s(T93)))
F105_IN_GG(s(T97), T93) → F105_IN_GG(T97, s(T93))
H1_IN_G(c(s(T81), T77)) → U5_G(T81, T77, fc105_in_gg(T81, T77))
U5_G(T81, T77, fc105_out_gg(T81, T77)) → U6_G(T81, T77, g88_in_gg(T81, T77))
U5_G(T81, T77, fc105_out_gg(T81, T77)) → G88_IN_GG(T81, T77)

The TRS R consists of the following rules:

fc105_in_gg(0, T86) → fc105_out_gg(0, T86)
fc105_in_gg(s(T97), T93) → U9_gg(T97, T93, fc105_in_gg(T97, s(T93)))
U9_gg(T97, T93, fc105_out_gg(T97, s(T93))) → fc105_out_gg(s(T97), T93)

Pi is empty.
We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 9 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

F105_IN_GG(s(T97), T93) → F105_IN_GG(T97, s(T93))

The TRS R consists of the following rules:

fc105_in_gg(0, T86) → fc105_out_gg(0, T86)
fc105_in_gg(s(T97), T93) → U9_gg(T97, T93, fc105_in_gg(T97, s(T93)))
U9_gg(T97, T93, fc105_out_gg(T97, s(T93))) → fc105_out_gg(s(T97), T93)

Pi is empty.
We have to consider all (P,R,Pi)-chains

(8) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

F105_IN_GG(s(T97), T93) → F105_IN_GG(T97, s(T93))

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(10) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(11) Obligation:

Q DP problem:
The TRS P consists of the following rules:

F105_IN_GG(s(T97), T93) → F105_IN_GG(T97, s(T93))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • F105_IN_GG(s(T97), T93) → F105_IN_GG(T97, s(T93))
    The graph contains the following edges 1 > 1

(13) YES

(14) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

G88_IN_GG(T65, s(T70)) → G88_IN_GG(s(T65), T70)

The TRS R consists of the following rules:

fc105_in_gg(0, T86) → fc105_out_gg(0, T86)
fc105_in_gg(s(T97), T93) → U9_gg(T97, T93, fc105_in_gg(T97, s(T93)))
U9_gg(T97, T93, fc105_out_gg(T97, s(T93))) → fc105_out_gg(s(T97), T93)

Pi is empty.
We have to consider all (P,R,Pi)-chains

(15) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

G88_IN_GG(T65, s(T70)) → G88_IN_GG(s(T65), T70)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(17) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

G88_IN_GG(T65, s(T70)) → G88_IN_GG(s(T65), T70)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(19) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • G88_IN_GG(T65, s(T70)) → G88_IN_GG(s(T65), T70)
    The graph contains the following edges 2 > 2

(20) YES