YES Termination proof of AG_#3.15_rand.trs

(0) Obligation:

Relative term rewrite system:
The relative TRS consists of the following R rules:

average(s(x), y) → average(x, s(y))
average(x, s(s(s(y)))) → s(average(s(x), y))
average(0, 0) → 0
average(0, s(0)) → 0
average(0, s(s(0))) → s(0)

The relative TRS consists of the following S rules:

rand(x) → rand(s(x))
rand(x) → x

(1) RelTRStoRelADPProof (EQUIVALENT transformation)

We upgrade the RelTRS problem to an equivalent Relative ADP Problem [IJCAR24].

(2) Obligation:

Relative ADP Problem with
absolute ADPs:

average(s(x), y) → AVERAGE(x, s(y))
average(x, s(s(s(y)))) → s(AVERAGE(s(x), y))
average(0, 0) → 0
average(0, s(0)) → 0
average(0, s(s(0))) → s(0)

and relative ADPs:

rand(x) → RAND(s(x))
rand(x) → x

(3) RelADPDepGraphProof (EQUIVALENT transformation)

We use the relative dependency graph processor [IJCAR24].
The approximation of the Relative Dependency Graph contains:
1 SCC with nodes from P_abs,
0 Lassos,
Result: This relative DT problem is equivalent to 1 subproblem.

(4) Obligation:

Relative ADP Problem with
absolute ADPs:

average(s(x), y) → AVERAGE(x, s(y))
average(0, s(0)) → 0
average(x, s(s(s(y)))) → s(AVERAGE(s(x), y))
average(0, 0) → 0
average(0, s(s(0))) → s(0)

and relative ADPs:

rand(x) → rand(s(x))
rand(x) → x

(5) RelADPDerelatifyingProof (EQUIVALENT transformation)

We use the first derelatifying processor [IJCAR24].
There are no annotations in relative ADPs, so the relative ADP problem can be transformed into a non-relative DP problem.

(6) Obligation:

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

AVERAGE(s(x), y) → AVERAGE(x, s(y))
AVERAGE(x, s(s(s(y)))) → AVERAGE(s(x), y)

The TRS R consists of the following rules:

average(s(x), y) → average(x, s(y))
average(0, s(0)) → 0
average(x, s(s(s(y)))) → s(average(s(x), y))
rand(x) → rand(s(x))
average(0, 0) → 0
rand(x) → x
average(0, s(s(0))) → s(0)

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

(7) 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 rules of the TRS R:

rand(x) → x

Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(AVERAGE(x1, x2)) = x1 + x2   
POL(average(x1, x2)) = 2·x1 + x2   
POL(rand(x1)) = 2 + x1   
POL(s(x1)) = x1   

(8) Obligation:

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

AVERAGE(s(x), y) → AVERAGE(x, s(y))
AVERAGE(x, s(s(s(y)))) → AVERAGE(s(x), y)

The TRS R consists of the following rules:

average(s(x), y) → average(x, s(y))
average(0, s(0)) → 0
average(x, s(s(s(y)))) → s(average(s(x), y))
rand(x) → rand(s(x))
average(0, 0) → 0
average(0, s(s(0))) → s(0)

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 rules of the TRS R:

average(0, s(0)) → 0
average(0, 0) → 0
average(0, s(s(0))) → s(0)

Used ordering: Polynomial interpretation [POLO]:

POL(0) = 2   
POL(AVERAGE(x1, x2)) = x1 + x2   
POL(average(x1, x2)) = 1 + x1 + x2   
POL(rand(x1)) = x1   
POL(s(x1)) = x1   

(10) Obligation:

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

AVERAGE(s(x), y) → AVERAGE(x, s(y))
AVERAGE(x, s(s(s(y)))) → AVERAGE(s(x), y)

The TRS R consists of the following rules:

average(s(x), y) → average(x, s(y))
average(x, s(s(s(y)))) → s(average(s(x), y))
rand(x) → rand(s(x))

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

(11) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


AVERAGE(x, s(s(s(y)))) → AVERAGE(s(x), y)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial Order [NEGPOLO,POLO] with Interpretation:
POL( average(x1, x2) ) = max{0, x1 + x2 - 1}

POL( s(x1) ) = x1 + 1

POL( rand(x1) ) = max{0, -2}

POL( AVERAGE(x1, x2) ) = max{0, 2x1 + 2x2 - 2}


The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:

average(s(x), y) → average(x, s(y))
average(x, s(s(s(y)))) → s(average(s(x), y))
rand(x) → rand(s(x))

(12) Obligation:

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

AVERAGE(s(x), y) → AVERAGE(x, s(y))

The TRS R consists of the following rules:

average(s(x), y) → average(x, s(y))
average(x, s(s(s(y)))) → s(average(s(x), y))
rand(x) → rand(s(x))

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

(13) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


AVERAGE(s(x), y) → AVERAGE(x, s(y))
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
AVERAGE(x1, x2)  =  x1
s(x1)  =  s(x1)
average(x1, x2)  =  average(x1, x2)
rand(x1)  =  rand

Knuth-Bendix order [KBO] with precedence:
trivial

and weight map:

s_1=1
average_2=1
rand=1

The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:

average(s(x), y) → average(x, s(y))
average(x, s(s(s(y)))) → s(average(s(x), y))
rand(x) → rand(s(x))

(14) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

average(s(x), y) → average(x, s(y))
average(x, s(s(s(y)))) → s(average(s(x), y))
rand(x) → rand(s(x))

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

(15) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(16) YES