(0) Obligation:

Clauses:

average(0, 0, 0).
average(0, s(0), 0).
average(0, s(s(0)), s(0)).
average(s(X), Y, Z) :- average(X, s(Y), Z).
average(X, s(s(s(Y))), s(Z)) :- average(s(X), Y, Z).

Queries:

average(g,g,a).

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph.

(2) Obligation:

Triples:

average1(s(s(T23)), T24, T26) :- average1(T23, s(s(T24)), T26).
average1(s(T39), s(s(T40)), s(T42)) :- average1(s(T39), T40, T42).
average1(s(T52), s(s(s(T53))), s(T55)) :- average1(s(s(T52)), T53, T55).
average1(T80, s(s(s(T81))), s(T83)) :- average1(T80, s(T81), T83).
average1(T90, s(s(s(s(s(s(T91)))))), s(s(T93))) :- average1(s(s(T90)), T91, T93).

Clauses:

averagec1(0, 0, 0).
averagec1(0, s(0), 0).
averagec1(0, s(s(0)), s(0)).
averagec1(s(0), 0, 0).
averagec1(s(0), s(0), s(0)).
averagec1(s(s(T23)), T24, T26) :- averagec1(T23, s(s(T24)), T26).
averagec1(s(T39), s(s(T40)), s(T42)) :- averagec1(s(T39), T40, T42).
averagec1(s(T52), s(s(s(T53))), s(T55)) :- averagec1(s(s(T52)), T53, T55).
averagec1(T80, s(s(s(T81))), s(T83)) :- averagec1(T80, s(T81), T83).
averagec1(T90, s(s(s(s(s(s(T91)))))), s(s(T93))) :- averagec1(s(s(T90)), T91, T93).

Afs:

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

AVERAGE1_IN_GGA(s(s(T23)), T24, T26) → U1_GGA(T23, T24, T26, average1_in_gga(T23, s(s(T24)), T26))
AVERAGE1_IN_GGA(s(s(T23)), T24, T26) → AVERAGE1_IN_GGA(T23, s(s(T24)), T26)
AVERAGE1_IN_GGA(s(T39), s(s(T40)), s(T42)) → U2_GGA(T39, T40, T42, average1_in_gga(s(T39), T40, T42))
AVERAGE1_IN_GGA(s(T39), s(s(T40)), s(T42)) → AVERAGE1_IN_GGA(s(T39), T40, T42)
AVERAGE1_IN_GGA(s(T52), s(s(s(T53))), s(T55)) → U3_GGA(T52, T53, T55, average1_in_gga(s(s(T52)), T53, T55))
AVERAGE1_IN_GGA(s(T52), s(s(s(T53))), s(T55)) → AVERAGE1_IN_GGA(s(s(T52)), T53, T55)
AVERAGE1_IN_GGA(T80, s(s(s(T81))), s(T83)) → U4_GGA(T80, T81, T83, average1_in_gga(T80, s(T81), T83))
AVERAGE1_IN_GGA(T80, s(s(s(T81))), s(T83)) → AVERAGE1_IN_GGA(T80, s(T81), T83)
AVERAGE1_IN_GGA(T90, s(s(s(s(s(s(T91)))))), s(s(T93))) → U5_GGA(T90, T91, T93, average1_in_gga(s(s(T90)), T91, T93))
AVERAGE1_IN_GGA(T90, s(s(s(s(s(s(T91)))))), s(s(T93))) → AVERAGE1_IN_GGA(s(s(T90)), T91, T93)

R is empty.
The argument filtering Pi contains the following mapping:
average1_in_gga(x1, x2, x3)  =  average1_in_gga(x1, x2)
s(x1)  =  s(x1)
AVERAGE1_IN_GGA(x1, x2, x3)  =  AVERAGE1_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)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
U5_GGA(x1, x2, x3, x4)  =  U5_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:

AVERAGE1_IN_GGA(s(s(T23)), T24, T26) → U1_GGA(T23, T24, T26, average1_in_gga(T23, s(s(T24)), T26))
AVERAGE1_IN_GGA(s(s(T23)), T24, T26) → AVERAGE1_IN_GGA(T23, s(s(T24)), T26)
AVERAGE1_IN_GGA(s(T39), s(s(T40)), s(T42)) → U2_GGA(T39, T40, T42, average1_in_gga(s(T39), T40, T42))
AVERAGE1_IN_GGA(s(T39), s(s(T40)), s(T42)) → AVERAGE1_IN_GGA(s(T39), T40, T42)
AVERAGE1_IN_GGA(s(T52), s(s(s(T53))), s(T55)) → U3_GGA(T52, T53, T55, average1_in_gga(s(s(T52)), T53, T55))
AVERAGE1_IN_GGA(s(T52), s(s(s(T53))), s(T55)) → AVERAGE1_IN_GGA(s(s(T52)), T53, T55)
AVERAGE1_IN_GGA(T80, s(s(s(T81))), s(T83)) → U4_GGA(T80, T81, T83, average1_in_gga(T80, s(T81), T83))
AVERAGE1_IN_GGA(T80, s(s(s(T81))), s(T83)) → AVERAGE1_IN_GGA(T80, s(T81), T83)
AVERAGE1_IN_GGA(T90, s(s(s(s(s(s(T91)))))), s(s(T93))) → U5_GGA(T90, T91, T93, average1_in_gga(s(s(T90)), T91, T93))
AVERAGE1_IN_GGA(T90, s(s(s(s(s(s(T91)))))), s(s(T93))) → AVERAGE1_IN_GGA(s(s(T90)), T91, T93)

R is empty.
The argument filtering Pi contains the following mapping:
average1_in_gga(x1, x2, x3)  =  average1_in_gga(x1, x2)
s(x1)  =  s(x1)
AVERAGE1_IN_GGA(x1, x2, x3)  =  AVERAGE1_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)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
U5_GGA(x1, x2, x3, x4)  =  U5_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 1 SCC with 5 less nodes.

(6) Obligation:

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

AVERAGE1_IN_GGA(s(T39), s(s(T40)), s(T42)) → AVERAGE1_IN_GGA(s(T39), T40, T42)
AVERAGE1_IN_GGA(s(s(T23)), T24, T26) → AVERAGE1_IN_GGA(T23, s(s(T24)), T26)
AVERAGE1_IN_GGA(s(T52), s(s(s(T53))), s(T55)) → AVERAGE1_IN_GGA(s(s(T52)), T53, T55)
AVERAGE1_IN_GGA(T80, s(s(s(T81))), s(T83)) → AVERAGE1_IN_GGA(T80, s(T81), T83)
AVERAGE1_IN_GGA(T90, s(s(s(s(s(s(T91)))))), s(s(T93))) → AVERAGE1_IN_GGA(s(s(T90)), T91, T93)

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

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:

AVERAGE1_IN_GGA(s(T39), s(s(T40))) → AVERAGE1_IN_GGA(s(T39), T40)
AVERAGE1_IN_GGA(s(s(T23)), T24) → AVERAGE1_IN_GGA(T23, s(s(T24)))
AVERAGE1_IN_GGA(s(T52), s(s(s(T53)))) → AVERAGE1_IN_GGA(s(s(T52)), T53)
AVERAGE1_IN_GGA(T80, s(s(s(T81)))) → AVERAGE1_IN_GGA(T80, s(T81))
AVERAGE1_IN_GGA(T90, s(s(s(s(s(s(T91))))))) → AVERAGE1_IN_GGA(s(s(T90)), T91)

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

(9) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

AVERAGE1_IN_GGA(s(T39), s(s(T40))) → AVERAGE1_IN_GGA(s(T39), T40)
AVERAGE1_IN_GGA(s(T52), s(s(s(T53)))) → AVERAGE1_IN_GGA(s(s(T52)), T53)
AVERAGE1_IN_GGA(T80, s(s(s(T81)))) → AVERAGE1_IN_GGA(T80, s(T81))
AVERAGE1_IN_GGA(T90, s(s(s(s(s(s(T91))))))) → AVERAGE1_IN_GGA(s(s(T90)), T91)


Used ordering: Polynomial interpretation [POLO]:

POL(AVERAGE1_IN_GGA(x1, x2)) = x1 + x2   
POL(s(x1)) = 1 + x1   

(10) Obligation:

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

AVERAGE1_IN_GGA(s(s(T23)), T24) → AVERAGE1_IN_GGA(T23, s(s(T24)))

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

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

  • AVERAGE1_IN_GGA(s(s(T23)), T24) → AVERAGE1_IN_GGA(T23, s(s(T24)))
    The graph contains the following edges 1 > 1

(12) YES