(0) Obligation:

Clauses:

h(X) :- ','(f(X), g(X)).
f(c(0, X1)).
f(c(X, Y)) :- ','(no(zero(X)), ','(p(X, P), f(c(P, s(Y))))).
g(c(X2, 0)).
g(c(X, Y)) :- ','(no(zero(Y)), ','(p(Y, P), g(c(s(X), P)))).
p(0, 0).
p(s(X), X).
zero(0).
no(X) :- ','(X, ','(!, failure(a))).
no(X3).
failure(b).

Query: h(g)

(1) PrologToPiTRSViaGraphTransformerProof (SOUND transformation)

Transformed Prolog program to (Pi-)TRS.

(2) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

hA_in_g(c(0, 0)) → hA_out_g(c(0, 0))
hA_in_g(c(0, s(0))) → hA_out_g(c(0, s(0)))
hA_in_g(c(0, s(s(0)))) → hA_out_g(c(0, s(s(0))))
hA_in_g(c(0, s(s(s(0))))) → hA_out_g(c(0, s(s(s(0)))))
hA_in_g(c(0, s(s(s(s(0)))))) → hA_out_g(c(0, s(s(s(s(0))))))
hA_in_g(c(0, s(s(s(s(s(0))))))) → hA_out_g(c(0, s(s(s(s(s(0)))))))
hA_in_g(c(0, s(s(s(s(s(s(0)))))))) → hA_out_g(c(0, s(s(s(s(s(s(0))))))))
hA_in_g(c(0, s(s(s(s(s(s(s(0))))))))) → hA_out_g(c(0, s(s(s(s(s(s(s(0)))))))))
hA_in_g(c(0, s(s(s(s(s(s(s(s(T104)))))))))) → U1_g(T104, gB_in_gg(s(s(s(s(s(s(s(0))))))), T104))
gB_in_gg(T112, 0) → gB_out_gg(T112, 0)
gB_in_gg(T118, s(T132)) → U3_gg(T118, T132, gB_in_gg(s(T118), T132))
U3_gg(T118, T132, gB_out_gg(s(T118), T132)) → gB_out_gg(T118, s(T132))
U1_g(T104, gB_out_gg(s(s(s(s(s(s(s(0))))))), T104)) → hA_out_g(c(0, s(s(s(s(s(s(s(s(T104))))))))))
hA_in_g(c(s(T159), T140)) → U2_g(T159, T140, pC_in_gg(T159, T140))
pC_in_gg(T159, T140) → U5_gg(T159, T140, fD_in_gg(T159, T140))
fD_in_gg(0, T168) → fD_out_gg(0, T168)
fD_in_gg(s(T188), T175) → U4_gg(T188, T175, fD_in_gg(T188, s(T175)))
U4_gg(T188, T175, fD_out_gg(T188, s(T175))) → fD_out_gg(s(T188), T175)
U5_gg(T159, T140, fD_out_gg(T159, T140)) → U6_gg(T159, T140, gB_in_gg(T159, T140))
U6_gg(T159, T140, gB_out_gg(T159, T140)) → pC_out_gg(T159, T140)
U2_g(T159, T140, pC_out_gg(T159, T140)) → hA_out_g(c(s(T159), T140))

Pi is empty.

(3) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

HA_IN_G(c(0, s(s(s(s(s(s(s(s(T104)))))))))) → U1_G(T104, gB_in_gg(s(s(s(s(s(s(s(0))))))), T104))
HA_IN_G(c(0, s(s(s(s(s(s(s(s(T104)))))))))) → GB_IN_GG(s(s(s(s(s(s(s(0))))))), T104)
GB_IN_GG(T118, s(T132)) → U3_GG(T118, T132, gB_in_gg(s(T118), T132))
GB_IN_GG(T118, s(T132)) → GB_IN_GG(s(T118), T132)
HA_IN_G(c(s(T159), T140)) → U2_G(T159, T140, pC_in_gg(T159, T140))
HA_IN_G(c(s(T159), T140)) → PC_IN_GG(T159, T140)
PC_IN_GG(T159, T140) → U5_GG(T159, T140, fD_in_gg(T159, T140))
PC_IN_GG(T159, T140) → FD_IN_GG(T159, T140)
FD_IN_GG(s(T188), T175) → U4_GG(T188, T175, fD_in_gg(T188, s(T175)))
FD_IN_GG(s(T188), T175) → FD_IN_GG(T188, s(T175))
U5_GG(T159, T140, fD_out_gg(T159, T140)) → U6_GG(T159, T140, gB_in_gg(T159, T140))
U5_GG(T159, T140, fD_out_gg(T159, T140)) → GB_IN_GG(T159, T140)

The TRS R consists of the following rules:

hA_in_g(c(0, 0)) → hA_out_g(c(0, 0))
hA_in_g(c(0, s(0))) → hA_out_g(c(0, s(0)))
hA_in_g(c(0, s(s(0)))) → hA_out_g(c(0, s(s(0))))
hA_in_g(c(0, s(s(s(0))))) → hA_out_g(c(0, s(s(s(0)))))
hA_in_g(c(0, s(s(s(s(0)))))) → hA_out_g(c(0, s(s(s(s(0))))))
hA_in_g(c(0, s(s(s(s(s(0))))))) → hA_out_g(c(0, s(s(s(s(s(0)))))))
hA_in_g(c(0, s(s(s(s(s(s(0)))))))) → hA_out_g(c(0, s(s(s(s(s(s(0))))))))
hA_in_g(c(0, s(s(s(s(s(s(s(0))))))))) → hA_out_g(c(0, s(s(s(s(s(s(s(0)))))))))
hA_in_g(c(0, s(s(s(s(s(s(s(s(T104)))))))))) → U1_g(T104, gB_in_gg(s(s(s(s(s(s(s(0))))))), T104))
gB_in_gg(T112, 0) → gB_out_gg(T112, 0)
gB_in_gg(T118, s(T132)) → U3_gg(T118, T132, gB_in_gg(s(T118), T132))
U3_gg(T118, T132, gB_out_gg(s(T118), T132)) → gB_out_gg(T118, s(T132))
U1_g(T104, gB_out_gg(s(s(s(s(s(s(s(0))))))), T104)) → hA_out_g(c(0, s(s(s(s(s(s(s(s(T104))))))))))
hA_in_g(c(s(T159), T140)) → U2_g(T159, T140, pC_in_gg(T159, T140))
pC_in_gg(T159, T140) → U5_gg(T159, T140, fD_in_gg(T159, T140))
fD_in_gg(0, T168) → fD_out_gg(0, T168)
fD_in_gg(s(T188), T175) → U4_gg(T188, T175, fD_in_gg(T188, s(T175)))
U4_gg(T188, T175, fD_out_gg(T188, s(T175))) → fD_out_gg(s(T188), T175)
U5_gg(T159, T140, fD_out_gg(T159, T140)) → U6_gg(T159, T140, gB_in_gg(T159, T140))
U6_gg(T159, T140, gB_out_gg(T159, T140)) → pC_out_gg(T159, T140)
U2_g(T159, T140, pC_out_gg(T159, T140)) → hA_out_g(c(s(T159), T140))

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

(4) Obligation:

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

HA_IN_G(c(0, s(s(s(s(s(s(s(s(T104)))))))))) → U1_G(T104, gB_in_gg(s(s(s(s(s(s(s(0))))))), T104))
HA_IN_G(c(0, s(s(s(s(s(s(s(s(T104)))))))))) → GB_IN_GG(s(s(s(s(s(s(s(0))))))), T104)
GB_IN_GG(T118, s(T132)) → U3_GG(T118, T132, gB_in_gg(s(T118), T132))
GB_IN_GG(T118, s(T132)) → GB_IN_GG(s(T118), T132)
HA_IN_G(c(s(T159), T140)) → U2_G(T159, T140, pC_in_gg(T159, T140))
HA_IN_G(c(s(T159), T140)) → PC_IN_GG(T159, T140)
PC_IN_GG(T159, T140) → U5_GG(T159, T140, fD_in_gg(T159, T140))
PC_IN_GG(T159, T140) → FD_IN_GG(T159, T140)
FD_IN_GG(s(T188), T175) → U4_GG(T188, T175, fD_in_gg(T188, s(T175)))
FD_IN_GG(s(T188), T175) → FD_IN_GG(T188, s(T175))
U5_GG(T159, T140, fD_out_gg(T159, T140)) → U6_GG(T159, T140, gB_in_gg(T159, T140))
U5_GG(T159, T140, fD_out_gg(T159, T140)) → GB_IN_GG(T159, T140)

The TRS R consists of the following rules:

hA_in_g(c(0, 0)) → hA_out_g(c(0, 0))
hA_in_g(c(0, s(0))) → hA_out_g(c(0, s(0)))
hA_in_g(c(0, s(s(0)))) → hA_out_g(c(0, s(s(0))))
hA_in_g(c(0, s(s(s(0))))) → hA_out_g(c(0, s(s(s(0)))))
hA_in_g(c(0, s(s(s(s(0)))))) → hA_out_g(c(0, s(s(s(s(0))))))
hA_in_g(c(0, s(s(s(s(s(0))))))) → hA_out_g(c(0, s(s(s(s(s(0)))))))
hA_in_g(c(0, s(s(s(s(s(s(0)))))))) → hA_out_g(c(0, s(s(s(s(s(s(0))))))))
hA_in_g(c(0, s(s(s(s(s(s(s(0))))))))) → hA_out_g(c(0, s(s(s(s(s(s(s(0)))))))))
hA_in_g(c(0, s(s(s(s(s(s(s(s(T104)))))))))) → U1_g(T104, gB_in_gg(s(s(s(s(s(s(s(0))))))), T104))
gB_in_gg(T112, 0) → gB_out_gg(T112, 0)
gB_in_gg(T118, s(T132)) → U3_gg(T118, T132, gB_in_gg(s(T118), T132))
U3_gg(T118, T132, gB_out_gg(s(T118), T132)) → gB_out_gg(T118, s(T132))
U1_g(T104, gB_out_gg(s(s(s(s(s(s(s(0))))))), T104)) → hA_out_g(c(0, s(s(s(s(s(s(s(s(T104))))))))))
hA_in_g(c(s(T159), T140)) → U2_g(T159, T140, pC_in_gg(T159, T140))
pC_in_gg(T159, T140) → U5_gg(T159, T140, fD_in_gg(T159, T140))
fD_in_gg(0, T168) → fD_out_gg(0, T168)
fD_in_gg(s(T188), T175) → U4_gg(T188, T175, fD_in_gg(T188, s(T175)))
U4_gg(T188, T175, fD_out_gg(T188, s(T175))) → fD_out_gg(s(T188), T175)
U5_gg(T159, T140, fD_out_gg(T159, T140)) → U6_gg(T159, T140, gB_in_gg(T159, T140))
U6_gg(T159, T140, gB_out_gg(T159, T140)) → pC_out_gg(T159, T140)
U2_g(T159, T140, pC_out_gg(T159, T140)) → hA_out_g(c(s(T159), T140))

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 10 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

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

FD_IN_GG(s(T188), T175) → FD_IN_GG(T188, s(T175))

The TRS R consists of the following rules:

hA_in_g(c(0, 0)) → hA_out_g(c(0, 0))
hA_in_g(c(0, s(0))) → hA_out_g(c(0, s(0)))
hA_in_g(c(0, s(s(0)))) → hA_out_g(c(0, s(s(0))))
hA_in_g(c(0, s(s(s(0))))) → hA_out_g(c(0, s(s(s(0)))))
hA_in_g(c(0, s(s(s(s(0)))))) → hA_out_g(c(0, s(s(s(s(0))))))
hA_in_g(c(0, s(s(s(s(s(0))))))) → hA_out_g(c(0, s(s(s(s(s(0)))))))
hA_in_g(c(0, s(s(s(s(s(s(0)))))))) → hA_out_g(c(0, s(s(s(s(s(s(0))))))))
hA_in_g(c(0, s(s(s(s(s(s(s(0))))))))) → hA_out_g(c(0, s(s(s(s(s(s(s(0)))))))))
hA_in_g(c(0, s(s(s(s(s(s(s(s(T104)))))))))) → U1_g(T104, gB_in_gg(s(s(s(s(s(s(s(0))))))), T104))
gB_in_gg(T112, 0) → gB_out_gg(T112, 0)
gB_in_gg(T118, s(T132)) → U3_gg(T118, T132, gB_in_gg(s(T118), T132))
U3_gg(T118, T132, gB_out_gg(s(T118), T132)) → gB_out_gg(T118, s(T132))
U1_g(T104, gB_out_gg(s(s(s(s(s(s(s(0))))))), T104)) → hA_out_g(c(0, s(s(s(s(s(s(s(s(T104))))))))))
hA_in_g(c(s(T159), T140)) → U2_g(T159, T140, pC_in_gg(T159, T140))
pC_in_gg(T159, T140) → U5_gg(T159, T140, fD_in_gg(T159, T140))
fD_in_gg(0, T168) → fD_out_gg(0, T168)
fD_in_gg(s(T188), T175) → U4_gg(T188, T175, fD_in_gg(T188, s(T175)))
U4_gg(T188, T175, fD_out_gg(T188, s(T175))) → fD_out_gg(s(T188), T175)
U5_gg(T159, T140, fD_out_gg(T159, T140)) → U6_gg(T159, T140, gB_in_gg(T159, T140))
U6_gg(T159, T140, gB_out_gg(T159, T140)) → pC_out_gg(T159, T140)
U2_g(T159, T140, pC_out_gg(T159, T140)) → hA_out_g(c(s(T159), T140))

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:

FD_IN_GG(s(T188), T175) → FD_IN_GG(T188, s(T175))

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:

FD_IN_GG(s(T188), T175) → FD_IN_GG(T188, s(T175))

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:

  • FD_IN_GG(s(T188), T175) → FD_IN_GG(T188, s(T175))
    The graph contains the following edges 1 > 1

(13) YES

(14) Obligation:

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

GB_IN_GG(T118, s(T132)) → GB_IN_GG(s(T118), T132)

The TRS R consists of the following rules:

hA_in_g(c(0, 0)) → hA_out_g(c(0, 0))
hA_in_g(c(0, s(0))) → hA_out_g(c(0, s(0)))
hA_in_g(c(0, s(s(0)))) → hA_out_g(c(0, s(s(0))))
hA_in_g(c(0, s(s(s(0))))) → hA_out_g(c(0, s(s(s(0)))))
hA_in_g(c(0, s(s(s(s(0)))))) → hA_out_g(c(0, s(s(s(s(0))))))
hA_in_g(c(0, s(s(s(s(s(0))))))) → hA_out_g(c(0, s(s(s(s(s(0)))))))
hA_in_g(c(0, s(s(s(s(s(s(0)))))))) → hA_out_g(c(0, s(s(s(s(s(s(0))))))))
hA_in_g(c(0, s(s(s(s(s(s(s(0))))))))) → hA_out_g(c(0, s(s(s(s(s(s(s(0)))))))))
hA_in_g(c(0, s(s(s(s(s(s(s(s(T104)))))))))) → U1_g(T104, gB_in_gg(s(s(s(s(s(s(s(0))))))), T104))
gB_in_gg(T112, 0) → gB_out_gg(T112, 0)
gB_in_gg(T118, s(T132)) → U3_gg(T118, T132, gB_in_gg(s(T118), T132))
U3_gg(T118, T132, gB_out_gg(s(T118), T132)) → gB_out_gg(T118, s(T132))
U1_g(T104, gB_out_gg(s(s(s(s(s(s(s(0))))))), T104)) → hA_out_g(c(0, s(s(s(s(s(s(s(s(T104))))))))))
hA_in_g(c(s(T159), T140)) → U2_g(T159, T140, pC_in_gg(T159, T140))
pC_in_gg(T159, T140) → U5_gg(T159, T140, fD_in_gg(T159, T140))
fD_in_gg(0, T168) → fD_out_gg(0, T168)
fD_in_gg(s(T188), T175) → U4_gg(T188, T175, fD_in_gg(T188, s(T175)))
U4_gg(T188, T175, fD_out_gg(T188, s(T175))) → fD_out_gg(s(T188), T175)
U5_gg(T159, T140, fD_out_gg(T159, T140)) → U6_gg(T159, T140, gB_in_gg(T159, T140))
U6_gg(T159, T140, gB_out_gg(T159, T140)) → pC_out_gg(T159, T140)
U2_g(T159, T140, pC_out_gg(T159, T140)) → hA_out_g(c(s(T159), T140))

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:

GB_IN_GG(T118, s(T132)) → GB_IN_GG(s(T118), T132)

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:

GB_IN_GG(T118, s(T132)) → GB_IN_GG(s(T118), T132)

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:

  • GB_IN_GG(T118, s(T132)) → GB_IN_GG(s(T118), T132)
    The graph contains the following edges 2 > 2

(20) YES