(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,a,g).
(1) PrologToDTProblemTransformerProof (SOUND transformation)
Built DT problem from termination graph.
(2) Obligation:
Triples:
p7(0, T22, T22, T11, T23, T15) :- sum1(T11, T23, T15).
p7(s(T30), T33, s(T32), T11, T34, T15) :- p7(T30, T33, T32, T11, T34, T15).
sum1(.(T10, T11), .(T16, T17), .(T14, T15)) :- p7(T10, T16, T14, T11, T17, T15).
Clauses:
sumc1([], [], []).
sumc1(.(T10, T11), .(T16, T17), .(T14, T15)) :- qc7(T10, T16, T14, T11, T17, T15).
qc7(0, T22, T22, T11, T23, T15) :- sumc1(T11, T23, T15).
qc7(s(T30), T33, s(T32), T11, T34, T15) :- qc7(T30, T33, T32, T11, T34, T15).
Afs:
sum1(x1, x2, x3) = sum1(x1, x3)
(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,f,b)
p7_in: (b,f,b,b,f,b)
Transforming
TRIPLES into the following
Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:
SUM1_IN_GAG(.(T10, T11), .(T16, T17), .(T14, T15)) → U3_GAG(T10, T11, T16, T17, T14, T15, p7_in_gaggag(T10, T16, T14, T11, T17, T15))
SUM1_IN_GAG(.(T10, T11), .(T16, T17), .(T14, T15)) → P7_IN_GAGGAG(T10, T16, T14, T11, T17, T15)
P7_IN_GAGGAG(0, T22, T22, T11, T23, T15) → U1_GAGGAG(T22, T11, T23, T15, sum1_in_gag(T11, T23, T15))
P7_IN_GAGGAG(0, T22, T22, T11, T23, T15) → SUM1_IN_GAG(T11, T23, T15)
P7_IN_GAGGAG(s(T30), T33, s(T32), T11, T34, T15) → U2_GAGGAG(T30, T33, T32, T11, T34, T15, p7_in_gaggag(T30, T33, T32, T11, T34, T15))
P7_IN_GAGGAG(s(T30), T33, s(T32), T11, T34, T15) → P7_IN_GAGGAG(T30, T33, T32, T11, T34, T15)
R is empty.
The argument filtering Pi contains the following mapping:
sum1_in_gag(
x1,
x2,
x3) =
sum1_in_gag(
x1,
x3)
.(
x1,
x2) =
.(
x1,
x2)
p7_in_gaggag(
x1,
x2,
x3,
x4,
x5,
x6) =
p7_in_gaggag(
x1,
x3,
x4,
x6)
0 =
0
s(
x1) =
s(
x1)
SUM1_IN_GAG(
x1,
x2,
x3) =
SUM1_IN_GAG(
x1,
x3)
U3_GAG(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U3_GAG(
x1,
x2,
x5,
x6,
x7)
P7_IN_GAGGAG(
x1,
x2,
x3,
x4,
x5,
x6) =
P7_IN_GAGGAG(
x1,
x3,
x4,
x6)
U1_GAGGAG(
x1,
x2,
x3,
x4,
x5) =
U1_GAGGAG(
x1,
x2,
x4,
x5)
U2_GAGGAG(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U2_GAGGAG(
x1,
x3,
x4,
x6,
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_GAG(.(T10, T11), .(T16, T17), .(T14, T15)) → U3_GAG(T10, T11, T16, T17, T14, T15, p7_in_gaggag(T10, T16, T14, T11, T17, T15))
SUM1_IN_GAG(.(T10, T11), .(T16, T17), .(T14, T15)) → P7_IN_GAGGAG(T10, T16, T14, T11, T17, T15)
P7_IN_GAGGAG(0, T22, T22, T11, T23, T15) → U1_GAGGAG(T22, T11, T23, T15, sum1_in_gag(T11, T23, T15))
P7_IN_GAGGAG(0, T22, T22, T11, T23, T15) → SUM1_IN_GAG(T11, T23, T15)
P7_IN_GAGGAG(s(T30), T33, s(T32), T11, T34, T15) → U2_GAGGAG(T30, T33, T32, T11, T34, T15, p7_in_gaggag(T30, T33, T32, T11, T34, T15))
P7_IN_GAGGAG(s(T30), T33, s(T32), T11, T34, T15) → P7_IN_GAGGAG(T30, T33, T32, T11, T34, T15)
R is empty.
The argument filtering Pi contains the following mapping:
sum1_in_gag(
x1,
x2,
x3) =
sum1_in_gag(
x1,
x3)
.(
x1,
x2) =
.(
x1,
x2)
p7_in_gaggag(
x1,
x2,
x3,
x4,
x5,
x6) =
p7_in_gaggag(
x1,
x3,
x4,
x6)
0 =
0
s(
x1) =
s(
x1)
SUM1_IN_GAG(
x1,
x2,
x3) =
SUM1_IN_GAG(
x1,
x3)
U3_GAG(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U3_GAG(
x1,
x2,
x5,
x6,
x7)
P7_IN_GAGGAG(
x1,
x2,
x3,
x4,
x5,
x6) =
P7_IN_GAGGAG(
x1,
x3,
x4,
x6)
U1_GAGGAG(
x1,
x2,
x3,
x4,
x5) =
U1_GAGGAG(
x1,
x2,
x4,
x5)
U2_GAGGAG(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U2_GAGGAG(
x1,
x3,
x4,
x6,
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_GAG(.(T10, T11), .(T16, T17), .(T14, T15)) → P7_IN_GAGGAG(T10, T16, T14, T11, T17, T15)
P7_IN_GAGGAG(0, T22, T22, T11, T23, T15) → SUM1_IN_GAG(T11, T23, T15)
P7_IN_GAGGAG(s(T30), T33, s(T32), T11, T34, T15) → P7_IN_GAGGAG(T30, T33, T32, T11, T34, T15)
R is empty.
The argument filtering Pi contains the following mapping:
.(
x1,
x2) =
.(
x1,
x2)
0 =
0
s(
x1) =
s(
x1)
SUM1_IN_GAG(
x1,
x2,
x3) =
SUM1_IN_GAG(
x1,
x3)
P7_IN_GAGGAG(
x1,
x2,
x3,
x4,
x5,
x6) =
P7_IN_GAGGAG(
x1,
x3,
x4,
x6)
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_GAG(.(T10, T11), .(T14, T15)) → P7_IN_GAGGAG(T10, T14, T11, T15)
P7_IN_GAGGAG(0, T22, T11, T15) → SUM1_IN_GAG(T11, T15)
P7_IN_GAGGAG(s(T30), s(T32), T11, T15) → P7_IN_GAGGAG(T30, T32, T11, T15)
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_GAGGAG(0, T22, T11, T15) → SUM1_IN_GAG(T11, T15)
The graph contains the following edges 3 >= 1, 4 >= 2
- P7_IN_GAGGAG(s(T30), s(T32), T11, T15) → P7_IN_GAGGAG(T30, T32, T11, T15)
The graph contains the following edges 1 > 1, 2 > 2, 3 >= 3, 4 >= 4
- SUM1_IN_GAG(.(T10, T11), .(T14, T15)) → P7_IN_GAGGAG(T10, T14, T11, T15)
The graph contains the following edges 1 > 1, 2 > 2, 1 > 3, 2 > 4
(10) YES