(0) Obligation:

Clauses:

mul(X1, 0, Z) :- ','(!, eq(Z, 0)).
mul(X, Y, Z) :- ','(p(Y, P), ','(mul(X, P, V), add(X, V, Z))).
add(X, 0, Z) :- ','(!, eq(Z, X)).
add(X, Y, Z) :- ','(p(Y, V), ','(add(X, V, W), p(Z, W))).
p(0, 0).
p(s(X), X).
eq(X, X).

Queries:

mul(g,g,a).

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(2) Obligation:

Triples:

mul15(T33, s(T38), X65) :- mul15(T33, T38, X64).
mul15(T33, s(T38), X65) :- ','(mulc15(T33, T38, T40), add30(T33, T40, X65)).
add30(T54, s(T59), X117) :- add30(T54, T59, X116).
mul1(T15, s(T21), T18) :- mul15(T15, T21, X19).
mul1(T86, s(T21), T89) :- ','(mulc15(T86, T21, s(T93)), add30(T86, T93, X166)).

Clauses:

mulc15(T27, 0, 0).
mulc15(T33, s(T38), X65) :- ','(mulc15(T33, T38, T40), addc30(T33, T40, X65)).
addc30(T48, 0, T48).
addc30(T54, s(T59), 0) :- addc30(T54, T59, 0).
addc30(T54, s(T59), s(T65)) :- addc30(T54, T59, T65).

Afs:

mul1(x1, x2, x3)  =  mul1(x1, x2)

(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:
mul1_in: (b,b,f)
mul15_in: (b,b,f)
mulc15_in: (b,b,f)
addc30_in: (b,b,f) (b,b,b)
add30_in: (b,b,f)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

MUL1_IN_GGA(T15, s(T21), T18) → U5_GGA(T15, T21, T18, mul15_in_gga(T15, T21, X19))
MUL1_IN_GGA(T15, s(T21), T18) → MUL15_IN_GGA(T15, T21, X19)
MUL15_IN_GGA(T33, s(T38), X65) → U1_GGA(T33, T38, X65, mul15_in_gga(T33, T38, X64))
MUL15_IN_GGA(T33, s(T38), X65) → MUL15_IN_GGA(T33, T38, X64)
MUL15_IN_GGA(T33, s(T38), X65) → U2_GGA(T33, T38, X65, mulc15_in_gga(T33, T38, T40))
U2_GGA(T33, T38, X65, mulc15_out_gga(T33, T38, T40)) → U3_GGA(T33, T38, X65, add30_in_gga(T33, T40, X65))
U2_GGA(T33, T38, X65, mulc15_out_gga(T33, T38, T40)) → ADD30_IN_GGA(T33, T40, X65)
ADD30_IN_GGA(T54, s(T59), X117) → U4_GGA(T54, T59, X117, add30_in_gga(T54, T59, X116))
ADD30_IN_GGA(T54, s(T59), X117) → ADD30_IN_GGA(T54, T59, X116)
MUL1_IN_GGA(T86, s(T21), T89) → U6_GGA(T86, T21, T89, mulc15_in_gga(T86, T21, s(T93)))
U6_GGA(T86, T21, T89, mulc15_out_gga(T86, T21, s(T93))) → U7_GGA(T86, T21, T89, add30_in_gga(T86, T93, X166))
U6_GGA(T86, T21, T89, mulc15_out_gga(T86, T21, s(T93))) → ADD30_IN_GGA(T86, T93, X166)

The TRS R consists of the following rules:

mulc15_in_gga(T27, 0, 0) → mulc15_out_gga(T27, 0, 0)
mulc15_in_gga(T33, s(T38), X65) → U9_gga(T33, T38, X65, mulc15_in_gga(T33, T38, T40))
U9_gga(T33, T38, X65, mulc15_out_gga(T33, T38, T40)) → U10_gga(T33, T38, X65, addc30_in_gga(T33, T40, X65))
addc30_in_gga(T48, 0, T48) → addc30_out_gga(T48, 0, T48)
addc30_in_gga(T54, s(T59), 0) → U11_gga(T54, T59, addc30_in_ggg(T54, T59, 0))
addc30_in_ggg(T48, 0, T48) → addc30_out_ggg(T48, 0, T48)
addc30_in_ggg(T54, s(T59), 0) → U11_ggg(T54, T59, addc30_in_ggg(T54, T59, 0))
addc30_in_ggg(T54, s(T59), s(T65)) → U12_ggg(T54, T59, T65, addc30_in_ggg(T54, T59, T65))
U12_ggg(T54, T59, T65, addc30_out_ggg(T54, T59, T65)) → addc30_out_ggg(T54, s(T59), s(T65))
U11_ggg(T54, T59, addc30_out_ggg(T54, T59, 0)) → addc30_out_ggg(T54, s(T59), 0)
U11_gga(T54, T59, addc30_out_ggg(T54, T59, 0)) → addc30_out_gga(T54, s(T59), 0)
addc30_in_gga(T54, s(T59), s(T65)) → U12_gga(T54, T59, T65, addc30_in_gga(T54, T59, T65))
U12_gga(T54, T59, T65, addc30_out_gga(T54, T59, T65)) → addc30_out_gga(T54, s(T59), s(T65))
U10_gga(T33, T38, X65, addc30_out_gga(T33, T40, X65)) → mulc15_out_gga(T33, s(T38), X65)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
mul15_in_gga(x1, x2, x3)  =  mul15_in_gga(x1, x2)
mulc15_in_gga(x1, x2, x3)  =  mulc15_in_gga(x1, x2)
0  =  0
mulc15_out_gga(x1, x2, x3)  =  mulc15_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4)  =  U9_gga(x1, x2, x4)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
addc30_in_gga(x1, x2, x3)  =  addc30_in_gga(x1, x2)
addc30_out_gga(x1, x2, x3)  =  addc30_out_gga(x1, x2, x3)
U11_gga(x1, x2, x3)  =  U11_gga(x1, x2, x3)
addc30_in_ggg(x1, x2, x3)  =  addc30_in_ggg(x1, x2, x3)
addc30_out_ggg(x1, x2, x3)  =  addc30_out_ggg(x1, x2, x3)
U11_ggg(x1, x2, x3)  =  U11_ggg(x1, x2, x3)
U12_ggg(x1, x2, x3, x4)  =  U12_ggg(x1, x2, x3, x4)
U12_gga(x1, x2, x3, x4)  =  U12_gga(x1, x2, x4)
add30_in_gga(x1, x2, x3)  =  add30_in_gga(x1, x2)
MUL1_IN_GGA(x1, x2, x3)  =  MUL1_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x2, x4)
MUL15_IN_GGA(x1, x2, x3)  =  MUL15_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
ADD30_IN_GGA(x1, x2, x3)  =  ADD30_IN_GGA(x1, x2)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x1, x2, x4)

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:

MUL1_IN_GGA(T15, s(T21), T18) → U5_GGA(T15, T21, T18, mul15_in_gga(T15, T21, X19))
MUL1_IN_GGA(T15, s(T21), T18) → MUL15_IN_GGA(T15, T21, X19)
MUL15_IN_GGA(T33, s(T38), X65) → U1_GGA(T33, T38, X65, mul15_in_gga(T33, T38, X64))
MUL15_IN_GGA(T33, s(T38), X65) → MUL15_IN_GGA(T33, T38, X64)
MUL15_IN_GGA(T33, s(T38), X65) → U2_GGA(T33, T38, X65, mulc15_in_gga(T33, T38, T40))
U2_GGA(T33, T38, X65, mulc15_out_gga(T33, T38, T40)) → U3_GGA(T33, T38, X65, add30_in_gga(T33, T40, X65))
U2_GGA(T33, T38, X65, mulc15_out_gga(T33, T38, T40)) → ADD30_IN_GGA(T33, T40, X65)
ADD30_IN_GGA(T54, s(T59), X117) → U4_GGA(T54, T59, X117, add30_in_gga(T54, T59, X116))
ADD30_IN_GGA(T54, s(T59), X117) → ADD30_IN_GGA(T54, T59, X116)
MUL1_IN_GGA(T86, s(T21), T89) → U6_GGA(T86, T21, T89, mulc15_in_gga(T86, T21, s(T93)))
U6_GGA(T86, T21, T89, mulc15_out_gga(T86, T21, s(T93))) → U7_GGA(T86, T21, T89, add30_in_gga(T86, T93, X166))
U6_GGA(T86, T21, T89, mulc15_out_gga(T86, T21, s(T93))) → ADD30_IN_GGA(T86, T93, X166)

The TRS R consists of the following rules:

mulc15_in_gga(T27, 0, 0) → mulc15_out_gga(T27, 0, 0)
mulc15_in_gga(T33, s(T38), X65) → U9_gga(T33, T38, X65, mulc15_in_gga(T33, T38, T40))
U9_gga(T33, T38, X65, mulc15_out_gga(T33, T38, T40)) → U10_gga(T33, T38, X65, addc30_in_gga(T33, T40, X65))
addc30_in_gga(T48, 0, T48) → addc30_out_gga(T48, 0, T48)
addc30_in_gga(T54, s(T59), 0) → U11_gga(T54, T59, addc30_in_ggg(T54, T59, 0))
addc30_in_ggg(T48, 0, T48) → addc30_out_ggg(T48, 0, T48)
addc30_in_ggg(T54, s(T59), 0) → U11_ggg(T54, T59, addc30_in_ggg(T54, T59, 0))
addc30_in_ggg(T54, s(T59), s(T65)) → U12_ggg(T54, T59, T65, addc30_in_ggg(T54, T59, T65))
U12_ggg(T54, T59, T65, addc30_out_ggg(T54, T59, T65)) → addc30_out_ggg(T54, s(T59), s(T65))
U11_ggg(T54, T59, addc30_out_ggg(T54, T59, 0)) → addc30_out_ggg(T54, s(T59), 0)
U11_gga(T54, T59, addc30_out_ggg(T54, T59, 0)) → addc30_out_gga(T54, s(T59), 0)
addc30_in_gga(T54, s(T59), s(T65)) → U12_gga(T54, T59, T65, addc30_in_gga(T54, T59, T65))
U12_gga(T54, T59, T65, addc30_out_gga(T54, T59, T65)) → addc30_out_gga(T54, s(T59), s(T65))
U10_gga(T33, T38, X65, addc30_out_gga(T33, T40, X65)) → mulc15_out_gga(T33, s(T38), X65)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
mul15_in_gga(x1, x2, x3)  =  mul15_in_gga(x1, x2)
mulc15_in_gga(x1, x2, x3)  =  mulc15_in_gga(x1, x2)
0  =  0
mulc15_out_gga(x1, x2, x3)  =  mulc15_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4)  =  U9_gga(x1, x2, x4)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
addc30_in_gga(x1, x2, x3)  =  addc30_in_gga(x1, x2)
addc30_out_gga(x1, x2, x3)  =  addc30_out_gga(x1, x2, x3)
U11_gga(x1, x2, x3)  =  U11_gga(x1, x2, x3)
addc30_in_ggg(x1, x2, x3)  =  addc30_in_ggg(x1, x2, x3)
addc30_out_ggg(x1, x2, x3)  =  addc30_out_ggg(x1, x2, x3)
U11_ggg(x1, x2, x3)  =  U11_ggg(x1, x2, x3)
U12_ggg(x1, x2, x3, x4)  =  U12_ggg(x1, x2, x3, x4)
U12_gga(x1, x2, x3, x4)  =  U12_gga(x1, x2, x4)
add30_in_gga(x1, x2, x3)  =  add30_in_gga(x1, x2)
MUL1_IN_GGA(x1, x2, x3)  =  MUL1_IN_GGA(x1, x2)
U5_GGA(x1, x2, x3, x4)  =  U5_GGA(x1, x2, x4)
MUL15_IN_GGA(x1, x2, x3)  =  MUL15_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x1, x2, x4)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x2, x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
ADD30_IN_GGA(x1, x2, x3)  =  ADD30_IN_GGA(x1, x2)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x1, x2, x4)
U7_GGA(x1, x2, x3, x4)  =  U7_GGA(x1, x2, x4)

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:

ADD30_IN_GGA(T54, s(T59), X117) → ADD30_IN_GGA(T54, T59, X116)

The TRS R consists of the following rules:

mulc15_in_gga(T27, 0, 0) → mulc15_out_gga(T27, 0, 0)
mulc15_in_gga(T33, s(T38), X65) → U9_gga(T33, T38, X65, mulc15_in_gga(T33, T38, T40))
U9_gga(T33, T38, X65, mulc15_out_gga(T33, T38, T40)) → U10_gga(T33, T38, X65, addc30_in_gga(T33, T40, X65))
addc30_in_gga(T48, 0, T48) → addc30_out_gga(T48, 0, T48)
addc30_in_gga(T54, s(T59), 0) → U11_gga(T54, T59, addc30_in_ggg(T54, T59, 0))
addc30_in_ggg(T48, 0, T48) → addc30_out_ggg(T48, 0, T48)
addc30_in_ggg(T54, s(T59), 0) → U11_ggg(T54, T59, addc30_in_ggg(T54, T59, 0))
addc30_in_ggg(T54, s(T59), s(T65)) → U12_ggg(T54, T59, T65, addc30_in_ggg(T54, T59, T65))
U12_ggg(T54, T59, T65, addc30_out_ggg(T54, T59, T65)) → addc30_out_ggg(T54, s(T59), s(T65))
U11_ggg(T54, T59, addc30_out_ggg(T54, T59, 0)) → addc30_out_ggg(T54, s(T59), 0)
U11_gga(T54, T59, addc30_out_ggg(T54, T59, 0)) → addc30_out_gga(T54, s(T59), 0)
addc30_in_gga(T54, s(T59), s(T65)) → U12_gga(T54, T59, T65, addc30_in_gga(T54, T59, T65))
U12_gga(T54, T59, T65, addc30_out_gga(T54, T59, T65)) → addc30_out_gga(T54, s(T59), s(T65))
U10_gga(T33, T38, X65, addc30_out_gga(T33, T40, X65)) → mulc15_out_gga(T33, s(T38), X65)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
mulc15_in_gga(x1, x2, x3)  =  mulc15_in_gga(x1, x2)
0  =  0
mulc15_out_gga(x1, x2, x3)  =  mulc15_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4)  =  U9_gga(x1, x2, x4)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
addc30_in_gga(x1, x2, x3)  =  addc30_in_gga(x1, x2)
addc30_out_gga(x1, x2, x3)  =  addc30_out_gga(x1, x2, x3)
U11_gga(x1, x2, x3)  =  U11_gga(x1, x2, x3)
addc30_in_ggg(x1, x2, x3)  =  addc30_in_ggg(x1, x2, x3)
addc30_out_ggg(x1, x2, x3)  =  addc30_out_ggg(x1, x2, x3)
U11_ggg(x1, x2, x3)  =  U11_ggg(x1, x2, x3)
U12_ggg(x1, x2, x3, x4)  =  U12_ggg(x1, x2, x3, x4)
U12_gga(x1, x2, x3, x4)  =  U12_gga(x1, x2, x4)
ADD30_IN_GGA(x1, x2, x3)  =  ADD30_IN_GGA(x1, x2)

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:

ADD30_IN_GGA(T54, s(T59), X117) → ADD30_IN_GGA(T54, T59, X116)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
ADD30_IN_GGA(x1, x2, x3)  =  ADD30_IN_GGA(x1, x2)

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

(10) PiDPToQDPProof (SOUND 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:

ADD30_IN_GGA(T54, s(T59)) → ADD30_IN_GGA(T54, T59)

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:

  • ADD30_IN_GGA(T54, s(T59)) → ADD30_IN_GGA(T54, T59)
    The graph contains the following edges 1 >= 1, 2 > 2

(13) YES

(14) Obligation:

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

MUL15_IN_GGA(T33, s(T38), X65) → MUL15_IN_GGA(T33, T38, X64)

The TRS R consists of the following rules:

mulc15_in_gga(T27, 0, 0) → mulc15_out_gga(T27, 0, 0)
mulc15_in_gga(T33, s(T38), X65) → U9_gga(T33, T38, X65, mulc15_in_gga(T33, T38, T40))
U9_gga(T33, T38, X65, mulc15_out_gga(T33, T38, T40)) → U10_gga(T33, T38, X65, addc30_in_gga(T33, T40, X65))
addc30_in_gga(T48, 0, T48) → addc30_out_gga(T48, 0, T48)
addc30_in_gga(T54, s(T59), 0) → U11_gga(T54, T59, addc30_in_ggg(T54, T59, 0))
addc30_in_ggg(T48, 0, T48) → addc30_out_ggg(T48, 0, T48)
addc30_in_ggg(T54, s(T59), 0) → U11_ggg(T54, T59, addc30_in_ggg(T54, T59, 0))
addc30_in_ggg(T54, s(T59), s(T65)) → U12_ggg(T54, T59, T65, addc30_in_ggg(T54, T59, T65))
U12_ggg(T54, T59, T65, addc30_out_ggg(T54, T59, T65)) → addc30_out_ggg(T54, s(T59), s(T65))
U11_ggg(T54, T59, addc30_out_ggg(T54, T59, 0)) → addc30_out_ggg(T54, s(T59), 0)
U11_gga(T54, T59, addc30_out_ggg(T54, T59, 0)) → addc30_out_gga(T54, s(T59), 0)
addc30_in_gga(T54, s(T59), s(T65)) → U12_gga(T54, T59, T65, addc30_in_gga(T54, T59, T65))
U12_gga(T54, T59, T65, addc30_out_gga(T54, T59, T65)) → addc30_out_gga(T54, s(T59), s(T65))
U10_gga(T33, T38, X65, addc30_out_gga(T33, T40, X65)) → mulc15_out_gga(T33, s(T38), X65)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
mulc15_in_gga(x1, x2, x3)  =  mulc15_in_gga(x1, x2)
0  =  0
mulc15_out_gga(x1, x2, x3)  =  mulc15_out_gga(x1, x2, x3)
U9_gga(x1, x2, x3, x4)  =  U9_gga(x1, x2, x4)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
addc30_in_gga(x1, x2, x3)  =  addc30_in_gga(x1, x2)
addc30_out_gga(x1, x2, x3)  =  addc30_out_gga(x1, x2, x3)
U11_gga(x1, x2, x3)  =  U11_gga(x1, x2, x3)
addc30_in_ggg(x1, x2, x3)  =  addc30_in_ggg(x1, x2, x3)
addc30_out_ggg(x1, x2, x3)  =  addc30_out_ggg(x1, x2, x3)
U11_ggg(x1, x2, x3)  =  U11_ggg(x1, x2, x3)
U12_ggg(x1, x2, x3, x4)  =  U12_ggg(x1, x2, x3, x4)
U12_gga(x1, x2, x3, x4)  =  U12_gga(x1, x2, x4)
MUL15_IN_GGA(x1, x2, x3)  =  MUL15_IN_GGA(x1, x2)

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:

MUL15_IN_GGA(T33, s(T38), X65) → MUL15_IN_GGA(T33, T38, X64)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
MUL15_IN_GGA(x1, x2, x3)  =  MUL15_IN_GGA(x1, x2)

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

(17) PiDPToQDPProof (SOUND 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:

MUL15_IN_GGA(T33, s(T38)) → MUL15_IN_GGA(T33, T38)

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:

  • MUL15_IN_GGA(T33, s(T38)) → MUL15_IN_GGA(T33, T38)
    The graph contains the following edges 1 >= 1, 2 > 2

(20) YES