YES Termination proof of AG_#3.38_rand.trs

(0) Obligation:

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

rev(nil) → nil
rev(cons(x, l)) → cons(rev1(x, l), rev2(x, l))
rev1(0, nil) → 0
rev1(s(x), nil) → s(x)
rev1(x, cons(y, l)) → rev1(y, l)
rev2(x, nil) → nil
rev2(x, cons(y, l)) → rev(cons(x, rev2(y, l)))

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:

rev(nil) → nil
rev(cons(x, l)) → cons(REV1(x, l), rev2(x, l))
rev(cons(x, l)) → cons(rev1(x, l), REV2(x, l))
rev1(0, nil) → 0
rev1(s(x), nil) → s(x)
rev1(x, cons(y, l)) → REV1(y, l)
rev2(x, nil) → nil
rev2(x, cons(y, l)) → REV(cons(x, rev2(y, l)))
rev2(x, cons(y, l)) → rev(cons(x, REV2(y, l)))

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:
2 SCCs with nodes from P_abs,
0 Lassos,
Result: This relative DT problem is equivalent to 2 subproblems.

(4) Complex Obligation (AND)

(5) Obligation:

Relative ADP Problem with
absolute ADPs:

rev2(x, cons(y, l)) → rev(cons(x, rev2(y, l)))
rev1(0, nil) → 0
rev1(x, cons(y, l)) → REV1(y, l)
rev(nil) → nil
rev(cons(x, l)) → cons(rev1(x, l), rev2(x, l))
rev1(s(x), nil) → s(x)
rev2(x, nil) → nil

and relative ADPs:

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

(6) RelADPCleverAfsProof (SOUND 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.

Furthermore, We use an argument filter [LPAR04].
Filtering:s_1 = 0 0 = rev2_2 = 0 cons_2 = 0 rev1_2 = 0, 1 rev_1 = rand_1 = REV1_2 = 0 nil =
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
REV1(x1, x2)  =  x2
cons(x1, x2)  =  cons(x2)
rev2(x1, x2)  =  x2
rev(x1)  =  x1
rev1(x1, x2)  =  rev1
0  =  0
nil  =  nil
s(x1)  =  s

Recursive path order with status [RPO].
Quasi-Precedence:

[rev1, 0, s]

Status:
cons1: [1]
rev1: multiset
0: multiset
nil: multiset
s: multiset

(7) Obligation:

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

REV1(cons(l)) → REV1(l)

The TRS R consists of the following rules:

rev2(cons(l)) → rev0(cons(rev2(l)))
rev100
rev0(nil0) → nil0
rev0(cons(l)) → cons(rev2(l))
rev1rev1
rand0(x) → rand0(s)
rev1s
rev2(nil0) → nil0
rand0(x) → x

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

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

rev100
rev1s
rand0(x) → x

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(REV1(x1)) = x1   
POL(cons(x1)) = 2·x1   
POL(nil0) = 0   
POL(rand0(x1)) = 2 + x1   
POL(rev0(x1)) = x1   
POL(rev1) = 2   
POL(rev2(x1)) = x1   
POL(s) = 0   

(9) Obligation:

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

REV1(cons(l)) → REV1(l)

The TRS R consists of the following rules:

rev2(cons(l)) → rev0(cons(rev2(l)))
rev0(nil0) → nil0
rev0(cons(l)) → cons(rev2(l))
rev1rev1
rand0(x) → rand0(s)
rev2(nil0) → nil0

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

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

REV1(cons(l)) → REV1(l)


Used ordering: Polynomial interpretation [POLO]:

POL(REV1(x1)) = x1   
POL(cons(x1)) = 2 + 2·x1   
POL(nil0) = 2   
POL(rand0(x1)) = x1   
POL(rev0(x1)) = x1   
POL(rev1) = 0   
POL(rev2(x1)) = x1   
POL(s) = 0   

(11) Obligation:

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

rev2(cons(l)) → rev0(cons(rev2(l)))
rev0(nil0) → nil0
rev0(cons(l)) → cons(rev2(l))
rev1rev1
rand0(x) → rand0(s)
rev2(nil0) → nil0

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

(12) PisEmptyProof (EQUIVALENT transformation)

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

(13) YES

(14) Obligation:

Relative ADP Problem with
absolute ADPs:

rev1(0, nil) → 0
rev(nil) → nil
rev(cons(x, l)) → cons(rev1(x, l), rev2(x, l))
rev(cons(x, l)) → cons(rev1(x, l), REV2(x, l))
rev1(x, cons(y, l)) → rev1(y, l)
rev1(s(x), nil) → s(x)
rev2(x, nil) → nil
rev2(x, cons(y, l)) → rev(cons(x, REV2(y, l)))
rev2(x, cons(y, l)) → REV(cons(x, rev2(y, l)))

and relative ADPs:

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

(15) RelADPCleverAfsProof (SOUND 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.

Furthermore, We use an argument filter [LPAR04].
Filtering:s_1 = 0 REV_1 = REV2_2 = 0 0 = cons_2 = 0 rev2_2 = 0 rev1_2 = 0, 1 rev_1 = rand_1 = nil =
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
REV2(x1, x2)  =  REV2(x2)
cons(x1, x2)  =  cons(x2)
REV(x1)  =  x1
rev2(x1, x2)  =  x2
rev(x1)  =  x1
rev1(x1, x2)  =  rev1
0  =  0
nil  =  nil
s(x1)  =  s

Recursive path order with status [RPO].
Quasi-Precedence:

[REV21, cons1]
[rev1, s] > [0, nil]

Status:
REV21: [1]
cons1: [1]
rev1: multiset
0: multiset
nil: multiset
s: multiset

(16) Obligation:

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

REV2(cons(l)) → REV2(l)
REV0(cons(l)) → REV2(l)
REV2(cons(l)) → REV0(cons(rev2(l)))

The TRS R consists of the following rules:

rev2(cons(l)) → rev0(cons(rev2(l)))
rev100
rev0(nil0) → nil0
rev0(cons(l)) → cons(rev2(l))
rev1rev1
rand0(x) → rand0(s)
rev1s
rev2(nil0) → nil0
rand0(x) → x

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

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

rev100
rev1s
rand0(x) → x

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(REV0(x1)) = 2·x1   
POL(REV2(x1)) = 2·x1   
POL(cons(x1)) = x1   
POL(nil0) = 0   
POL(rand0(x1)) = 2 + x1   
POL(rev0(x1)) = x1   
POL(rev1) = 2   
POL(rev2(x1)) = x1   
POL(s) = 0   

(18) Obligation:

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

REV2(cons(l)) → REV2(l)
REV0(cons(l)) → REV2(l)
REV2(cons(l)) → REV0(cons(rev2(l)))

The TRS R consists of the following rules:

rev2(cons(l)) → rev0(cons(rev2(l)))
rev0(nil0) → nil0
rev0(cons(l)) → cons(rev2(l))
rev1rev1
rand0(x) → rand0(s)
rev2(nil0) → nil0

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

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

REV2(cons(l)) → REV2(l)
REV2(cons(l)) → REV0(cons(rev2(l)))


Used ordering: Polynomial interpretation [POLO]:

POL(REV0(x1)) = 1 + x1   
POL(REV2(x1)) = 2 + x1   
POL(cons(x1)) = 1 + x1   
POL(nil0) = 1   
POL(rand0(x1)) = x1   
POL(rev0(x1)) = x1   
POL(rev1) = 0   
POL(rev2(x1)) = x1   
POL(s) = 0   

(20) Obligation:

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

REV0(cons(l)) → REV2(l)

The TRS R consists of the following rules:

rev2(cons(l)) → rev0(cons(rev2(l)))
rev0(nil0) → nil0
rev0(cons(l)) → cons(rev2(l))
rev1rev1
rand0(x) → rand0(s)
rev2(nil0) → nil0

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

(21) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(22) TRUE