(0) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

gt(0, y) → false
gt(s(x), 0) → true
gt(s(x), s(y)) → gt(x, y)
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
double(0) → 0
double(s(x)) → s(s(double(x)))
average(x, y) → aver(plus(x, y), 0)
aver(sum, z) → if(gt(sum, double(z)), sum, z)
if(true, sum, z) → aver(sum, s(z))
if(false, sum, z) → z

Q is empty.

(1) Overlay + Local Confluence (EQUIVALENT transformation)

The TRS is overlay and locally confluent. By [NOC] we can switch to innermost.

(2) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

gt(0, y) → false
gt(s(x), 0) → true
gt(s(x), s(y)) → gt(x, y)
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
double(0) → 0
double(s(x)) → s(s(double(x)))
average(x, y) → aver(plus(x, y), 0)
aver(sum, z) → if(gt(sum, double(z)), sum, z)
if(true, sum, z) → aver(sum, s(z))
if(false, sum, z) → z

The set Q consists of the following terms:

gt(0, x0)
gt(s(x0), 0)
gt(s(x0), s(x1))
plus(0, x0)
plus(s(x0), x1)
double(0)
double(s(x0))
average(x0, x1)
aver(x0, x1)
if(true, x0, x1)
if(false, x0, x1)

(3) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(4) Obligation:

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

GT(s(x), s(y)) → GT(x, y)
PLUS(s(x), y) → PLUS(x, y)
DOUBLE(s(x)) → DOUBLE(x)
AVERAGE(x, y) → AVER(plus(x, y), 0)
AVERAGE(x, y) → PLUS(x, y)
AVER(sum, z) → IF(gt(sum, double(z)), sum, z)
AVER(sum, z) → GT(sum, double(z))
AVER(sum, z) → DOUBLE(z)
IF(true, sum, z) → AVER(sum, s(z))

The TRS R consists of the following rules:

gt(0, y) → false
gt(s(x), 0) → true
gt(s(x), s(y)) → gt(x, y)
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
double(0) → 0
double(s(x)) → s(s(double(x)))
average(x, y) → aver(plus(x, y), 0)
aver(sum, z) → if(gt(sum, double(z)), sum, z)
if(true, sum, z) → aver(sum, s(z))
if(false, sum, z) → z

The set Q consists of the following terms:

gt(0, x0)
gt(s(x0), 0)
gt(s(x0), s(x1))
plus(0, x0)
plus(s(x0), x1)
double(0)
double(s(x0))
average(x0, x1)
aver(x0, x1)
if(true, x0, x1)
if(false, x0, x1)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 4 SCCs with 4 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

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

DOUBLE(s(x)) → DOUBLE(x)

The TRS R consists of the following rules:

gt(0, y) → false
gt(s(x), 0) → true
gt(s(x), s(y)) → gt(x, y)
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
double(0) → 0
double(s(x)) → s(s(double(x)))
average(x, y) → aver(plus(x, y), 0)
aver(sum, z) → if(gt(sum, double(z)), sum, z)
if(true, sum, z) → aver(sum, s(z))
if(false, sum, z) → z

The set Q consists of the following terms:

gt(0, x0)
gt(s(x0), 0)
gt(s(x0), s(x1))
plus(0, x0)
plus(s(x0), x1)
double(0)
double(s(x0))
average(x0, x1)
aver(x0, x1)
if(true, x0, x1)
if(false, x0, x1)

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

(8) Obligation:

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

PLUS(s(x), y) → PLUS(x, y)

The TRS R consists of the following rules:

gt(0, y) → false
gt(s(x), 0) → true
gt(s(x), s(y)) → gt(x, y)
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
double(0) → 0
double(s(x)) → s(s(double(x)))
average(x, y) → aver(plus(x, y), 0)
aver(sum, z) → if(gt(sum, double(z)), sum, z)
if(true, sum, z) → aver(sum, s(z))
if(false, sum, z) → z

The set Q consists of the following terms:

gt(0, x0)
gt(s(x0), 0)
gt(s(x0), s(x1))
plus(0, x0)
plus(s(x0), x1)
double(0)
double(s(x0))
average(x0, x1)
aver(x0, x1)
if(true, x0, x1)
if(false, x0, x1)

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

(9) Obligation:

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

GT(s(x), s(y)) → GT(x, y)

The TRS R consists of the following rules:

gt(0, y) → false
gt(s(x), 0) → true
gt(s(x), s(y)) → gt(x, y)
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
double(0) → 0
double(s(x)) → s(s(double(x)))
average(x, y) → aver(plus(x, y), 0)
aver(sum, z) → if(gt(sum, double(z)), sum, z)
if(true, sum, z) → aver(sum, s(z))
if(false, sum, z) → z

The set Q consists of the following terms:

gt(0, x0)
gt(s(x0), 0)
gt(s(x0), s(x1))
plus(0, x0)
plus(s(x0), x1)
double(0)
double(s(x0))
average(x0, x1)
aver(x0, x1)
if(true, x0, x1)
if(false, x0, x1)

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

(10) Obligation:

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

AVER(sum, z) → IF(gt(sum, double(z)), sum, z)
IF(true, sum, z) → AVER(sum, s(z))

The TRS R consists of the following rules:

gt(0, y) → false
gt(s(x), 0) → true
gt(s(x), s(y)) → gt(x, y)
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
double(0) → 0
double(s(x)) → s(s(double(x)))
average(x, y) → aver(plus(x, y), 0)
aver(sum, z) → if(gt(sum, double(z)), sum, z)
if(true, sum, z) → aver(sum, s(z))
if(false, sum, z) → z

The set Q consists of the following terms:

gt(0, x0)
gt(s(x0), 0)
gt(s(x0), s(x1))
plus(0, x0)
plus(s(x0), x1)
double(0)
double(s(x0))
average(x0, x1)
aver(x0, x1)
if(true, x0, x1)
if(false, x0, x1)

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