(0) Obligation:

Clauses:

sum([], [], []).
sum(.(X1, Y1), .(X2, Y2), .(X3, Y3)) :- ','(add(X1, X2, X3), sum(Y1, Y2, Y3)).
add(0, X, X).
add(s(X), Y, s(Z)) :- add(X, Y, Z).

Queries:

sum(g,g,a).

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(2) Obligation:

Triples:

p7(0, T22, T22, T11, T13, T23) :- sum1(T11, T13, T23).
p7(s(T30), T31, s(T33), T11, T13, T34) :- p7(T30, T31, T33, T11, T13, T34).
sum1(.(T10, T11), .(T12, T13), .(T16, T17)) :- p7(T10, T12, T16, T11, T13, T17).

Clauses:

sumc1([], [], []).
sumc1(.(T10, T11), .(T12, T13), .(T16, T17)) :- qc7(T10, T12, T16, T11, T13, T17).
qc7(0, T22, T22, T11, T13, T23) :- sumc1(T11, T13, T23).
qc7(s(T30), T31, s(T33), T11, T13, T34) :- qc7(T30, T31, T33, T11, T13, T34).

Afs:

sum1(x1, x2, x3)  =  sum1(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:
sum1_in: (b,b,f)
p7_in: (b,b,f,b,b,f)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

SUM1_IN_GGA(.(T10, T11), .(T12, T13), .(T16, T17)) → U3_GGA(T10, T11, T12, T13, T16, T17, p7_in_ggagga(T10, T12, T16, T11, T13, T17))
SUM1_IN_GGA(.(T10, T11), .(T12, T13), .(T16, T17)) → P7_IN_GGAGGA(T10, T12, T16, T11, T13, T17)
P7_IN_GGAGGA(0, T22, T22, T11, T13, T23) → U1_GGAGGA(T22, T11, T13, T23, sum1_in_gga(T11, T13, T23))
P7_IN_GGAGGA(0, T22, T22, T11, T13, T23) → SUM1_IN_GGA(T11, T13, T23)
P7_IN_GGAGGA(s(T30), T31, s(T33), T11, T13, T34) → U2_GGAGGA(T30, T31, T33, T11, T13, T34, p7_in_ggagga(T30, T31, T33, T11, T13, T34))
P7_IN_GGAGGA(s(T30), T31, s(T33), T11, T13, T34) → P7_IN_GGAGGA(T30, T31, T33, T11, T13, T34)

R is empty.
The argument filtering Pi contains the following mapping:
sum1_in_gga(x1, x2, x3)  =  sum1_in_gga(x1, x2)
.(x1, x2)  =  .(x1, x2)
p7_in_ggagga(x1, x2, x3, x4, x5, x6)  =  p7_in_ggagga(x1, x2, x4, x5)
0  =  0
s(x1)  =  s(x1)
SUM1_IN_GGA(x1, x2, x3)  =  SUM1_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4, x5, x6, x7)  =  U3_GGA(x1, x2, x3, x4, x7)
P7_IN_GGAGGA(x1, x2, x3, x4, x5, x6)  =  P7_IN_GGAGGA(x1, x2, x4, x5)
U1_GGAGGA(x1, x2, x3, x4, x5)  =  U1_GGAGGA(x1, x2, x3, x5)
U2_GGAGGA(x1, x2, x3, x4, x5, x6, x7)  =  U2_GGAGGA(x1, x2, x4, x5, x7)

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:

SUM1_IN_GGA(.(T10, T11), .(T12, T13), .(T16, T17)) → U3_GGA(T10, T11, T12, T13, T16, T17, p7_in_ggagga(T10, T12, T16, T11, T13, T17))
SUM1_IN_GGA(.(T10, T11), .(T12, T13), .(T16, T17)) → P7_IN_GGAGGA(T10, T12, T16, T11, T13, T17)
P7_IN_GGAGGA(0, T22, T22, T11, T13, T23) → U1_GGAGGA(T22, T11, T13, T23, sum1_in_gga(T11, T13, T23))
P7_IN_GGAGGA(0, T22, T22, T11, T13, T23) → SUM1_IN_GGA(T11, T13, T23)
P7_IN_GGAGGA(s(T30), T31, s(T33), T11, T13, T34) → U2_GGAGGA(T30, T31, T33, T11, T13, T34, p7_in_ggagga(T30, T31, T33, T11, T13, T34))
P7_IN_GGAGGA(s(T30), T31, s(T33), T11, T13, T34) → P7_IN_GGAGGA(T30, T31, T33, T11, T13, T34)

R is empty.
The argument filtering Pi contains the following mapping:
sum1_in_gga(x1, x2, x3)  =  sum1_in_gga(x1, x2)
.(x1, x2)  =  .(x1, x2)
p7_in_ggagga(x1, x2, x3, x4, x5, x6)  =  p7_in_ggagga(x1, x2, x4, x5)
0  =  0
s(x1)  =  s(x1)
SUM1_IN_GGA(x1, x2, x3)  =  SUM1_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4, x5, x6, x7)  =  U3_GGA(x1, x2, x3, x4, x7)
P7_IN_GGAGGA(x1, x2, x3, x4, x5, x6)  =  P7_IN_GGAGGA(x1, x2, x4, x5)
U1_GGAGGA(x1, x2, x3, x4, x5)  =  U1_GGAGGA(x1, x2, x3, x5)
U2_GGAGGA(x1, x2, x3, x4, x5, x6, x7)  =  U2_GGAGGA(x1, x2, x4, x5, x7)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 3 less nodes.

(6) Obligation:

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

SUM1_IN_GGA(.(T10, T11), .(T12, T13), .(T16, T17)) → P7_IN_GGAGGA(T10, T12, T16, T11, T13, T17)
P7_IN_GGAGGA(0, T22, T22, T11, T13, T23) → SUM1_IN_GGA(T11, T13, T23)
P7_IN_GGAGGA(s(T30), T31, s(T33), T11, T13, T34) → P7_IN_GGAGGA(T30, T31, T33, T11, T13, T34)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
0  =  0
s(x1)  =  s(x1)
SUM1_IN_GGA(x1, x2, x3)  =  SUM1_IN_GGA(x1, x2)
P7_IN_GGAGGA(x1, x2, x3, x4, x5, x6)  =  P7_IN_GGAGGA(x1, x2, x4, x5)

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

(7) PiDPToQDPProof (SOUND transformation)

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

(8) Obligation:

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

SUM1_IN_GGA(.(T10, T11), .(T12, T13)) → P7_IN_GGAGGA(T10, T12, T11, T13)
P7_IN_GGAGGA(0, T22, T11, T13) → SUM1_IN_GGA(T11, T13)
P7_IN_GGAGGA(s(T30), T31, T11, T13) → P7_IN_GGAGGA(T30, T31, T11, T13)

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

(9) 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:

  • P7_IN_GGAGGA(0, T22, T11, T13) → SUM1_IN_GGA(T11, T13)
    The graph contains the following edges 3 >= 1, 4 >= 2

  • P7_IN_GGAGGA(s(T30), T31, T11, T13) → P7_IN_GGAGGA(T30, T31, T11, T13)
    The graph contains the following edges 1 > 1, 2 >= 2, 3 >= 3, 4 >= 4

  • SUM1_IN_GGA(.(T10, T11), .(T12, T13)) → P7_IN_GGAGGA(T10, T12, T11, T13)
    The graph contains the following edges 1 > 1, 2 > 2, 1 > 3, 2 > 4

(10) YES