YES Termination proof of INVY_15_quicktest.ari

(0) Obligation:

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

tests(0) → true
tests(s(x)) → and(test(rands(rand(0), nil)), x)
test(done(y)) → eq(f(y), g(y))
eq(x, x) → true
rands(0, y) → done(y)
rands(s(x), y) → rands(x, ::(rand(0), y))

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:

tests(0) → true
tests(s(x)) → and(TEST(rands(rand(0), nil)), x)
tests(s(x)) → and(test(RANDS(rand(0), nil)), x)
tests(s(x)) → and(test(rands(RAND(0), nil)), x)
test(done(y)) → EQ(f(y), g(y))
eq(x, x) → true
rands(0, y) → done(y)
rands(s(x), y) → RANDS(x, ::(rand(0), y))
rands(s(x), y) → rands(x, ::(RAND(0), y))

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:

rands(s(x), y) → RANDS(x, ::(rand(0), y))

and relative ADPs:

tests(s(x)) → and(test(rands(rand(0), nil)), x)
rands(0, y) → done(y)
rands(s(x), y) → rands(x, ::(rand(0), y))
test(done(y)) → eq(f(y), g(y))
tests(0) → true
rand(x) → rand(s(x))
eq(x, x) → true
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:

RANDS(s(x), y) → RANDS(x, ::(rand(0), y))

The TRS R consists of the following rules:

tests(s(x)) → and(test(rands(rand(0), nil)), x)
rands(0, y) → done(y)
rands(s(x), y) → rands(x, ::(rand(0), y))
test(done(y)) → eq(f(y), g(y))
tests(0) → true
rand(x) → rand(s(x))
eq(x, x) → true
rand(x) → x

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:

tests(s(x)) → and(test(rands(rand(0), nil)), x)
tests(0) → true

Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(::(x1, x2)) = x1 + x2   
POL(RANDS(x1, x2)) = x1 + x2   
POL(and(x1, x2)) = x1 + x2   
POL(done(x1)) = 2·x1   
POL(eq(x1, x2)) = x1 + x2   
POL(f(x1)) = x1   
POL(g(x1)) = x1   
POL(nil) = 0   
POL(rand(x1)) = x1   
POL(rands(x1, x2)) = x1 + 2·x2   
POL(s(x1)) = x1   
POL(test(x1)) = 2·x1   
POL(tests(x1)) = 1 + 2·x1   
POL(true) = 0   

(8) Obligation:

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

RANDS(s(x), y) → RANDS(x, ::(rand(0), y))

The TRS R consists of the following rules:

rands(0, y) → done(y)
rands(s(x), y) → rands(x, ::(rand(0), y))
test(done(y)) → eq(f(y), g(y))
rand(x) → rand(s(x))
eq(x, x) → true
rand(x) → x

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:

rands(0, y) → done(y)
test(done(y)) → eq(f(y), g(y))

Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(::(x1, x2)) = x1 + x2   
POL(RANDS(x1, x2)) = x1 + x2   
POL(done(x1)) = 1 + 2·x1   
POL(eq(x1, x2)) = x1 + x2   
POL(f(x1)) = x1   
POL(g(x1)) = x1   
POL(rand(x1)) = x1   
POL(rands(x1, x2)) = 2 + x1 + 2·x2   
POL(s(x1)) = x1   
POL(test(x1)) = 2 + x1   
POL(true) = 0   

(10) Obligation:

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

RANDS(s(x), y) → RANDS(x, ::(rand(0), y))

The TRS R consists of the following rules:

rands(s(x), y) → rands(x, ::(rand(0), y))
rand(x) → rand(s(x))
eq(x, x) → true
rand(x) → x

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

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

eq(x, x) → true

Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(::(x1, x2)) = x1 + x2   
POL(RANDS(x1, x2)) = x1 + x2   
POL(eq(x1, x2)) = 2 + x1 + x2   
POL(rand(x1)) = x1   
POL(rands(x1, x2)) = x1 + x2   
POL(s(x1)) = x1   
POL(true) = 0   

(12) Obligation:

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

RANDS(s(x), y) → RANDS(x, ::(rand(0), y))

The TRS R consists of the following rules:

rands(s(x), y) → rands(x, ::(rand(0), y))
rand(x) → rand(s(x))
rand(x) → x

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

(13) TransformationProof (EQUIVALENT transformation)

By instantiating [LPAR04] the rule RANDS(s(x), y) → RANDS(x, ::(rand(0), y)) we obtained the following new rules [LPAR04]:

RANDS(s(x0), ::(y_1, y_2)) → RANDS(x0, ::(rand(0), ::(y_1, y_2))) → RANDS(s(x0), ::(y_1, y_2)) → RANDS(x0, ::(rand(0), ::(y_1, y_2)))

(14) Obligation:

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

RANDS(s(x0), ::(y_1, y_2)) → RANDS(x0, ::(rand(0), ::(y_1, y_2)))

The TRS R consists of the following rules:

rands(s(x), y) → rands(x, ::(rand(0), y))
rand(x) → rand(s(x))
rand(x) → x

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

(15) TransformationProof (EQUIVALENT transformation)

By instantiating [LPAR04] the rule RANDS(s(x0), ::(y_1, y_2)) → RANDS(x0, ::(rand(0), ::(y_1, y_2))) we obtained the following new rules [LPAR04]:

RANDS(s(x0), ::(y_1, ::(y_2, y_3))) → RANDS(x0, ::(rand(0), ::(y_1, ::(y_2, y_3)))) → RANDS(s(x0), ::(y_1, ::(y_2, y_3))) → RANDS(x0, ::(rand(0), ::(y_1, ::(y_2, y_3))))

(16) Obligation:

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

RANDS(s(x0), ::(y_1, ::(y_2, y_3))) → RANDS(x0, ::(rand(0), ::(y_1, ::(y_2, y_3))))

The TRS R consists of the following rules:

rands(s(x), y) → rands(x, ::(rand(0), y))
rand(x) → rand(s(x))
rand(x) → x

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

(17) QDPBoundsTAProof (EQUIVALENT transformation)

The DP-Problem (P, R) could be shown to be Match-DP-Bounded [TAB_NONLEFTLINEAR] by 0 for the Rule:

RANDS(s(x0), ::(y_1, ::(y_2, y_3))) → RANDS(x0, ::(rand(0), ::(y_1, ::(y_2, y_3))))
by considering the usable rules:

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

The compatible tree automaton used to show the Match-DP-Boundedness is represented by:
final states : [0]
transitions:
#0() → 1
01() → 4
rand0(4) → 3
#0() → 6
#0() → 8
::0(6, 8) → 7
::0(6, 7) → 5
::0(3, 5) → 2
RANDS0(1, 2) → 0
s0(4) → 9
rand0(9) → 3
::0(6, 7) → 11
::0(3, 11) → 10
::0(3, 10) → 2
s0(9) → 9
::0(3, 11) → 11
::0(4, 11) → 11
::0(4, 11) → 10
4 → 3
9 → 3

(18) Obligation:

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

rands(s(x), y) → rands(x, ::(rand(0), y))
rand(x) → rand(s(x))
rand(x) → x

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

(19) PisEmptyProof (EQUIVALENT transformation)

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

(20) YES