YES Termination proof of AG_#3.55_rand.trs

(0) Obligation:

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

minus(x, 0) → x
minus(s(x), s(y)) → minus(x, y)
quot(0, s(y)) → 0
quot(s(x), s(y)) → s(quot(minus(x, y), s(y)))
le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → le(x, y)
app(nil, y) → y
app(add(n, x), y) → add(n, app(x, y))
low(n, nil) → nil
low(n, add(m, x)) → if_low(le(m, n), n, add(m, x))
if_low(true, n, add(m, x)) → add(m, low(n, x))
if_low(false, n, add(m, x)) → low(n, x)
high(n, nil) → nil
high(n, add(m, x)) → if_high(le(m, n), n, add(m, x))
if_high(true, n, add(m, x)) → high(n, x)
if_high(false, n, add(m, x)) → add(m, high(n, x))
quicksort(nil) → nil
quicksort(add(n, x)) → app(quicksort(low(n, x)), add(n, quicksort(high(n, x))))

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:

minus(x, 0) → x
minus(s(x), s(y)) → MINUS(x, y)
quot(0, s(y)) → 0
quot(s(x), s(y)) → s(QUOT(minus(x, y), s(y)))
quot(s(x), s(y)) → s(quot(MINUS(x, y), s(y)))
le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → LE(x, y)
app(nil, y) → y
app(add(n, x), y) → add(n, APP(x, y))
low(n, nil) → nil
low(n, add(m, x)) → IF_LOW(le(m, n), n, add(m, x))
low(n, add(m, x)) → if_low(LE(m, n), n, add(m, x))
if_low(true, n, add(m, x)) → add(m, LOW(n, x))
if_low(false, n, add(m, x)) → LOW(n, x)
high(n, nil) → nil
high(n, add(m, x)) → IF_HIGH(le(m, n), n, add(m, x))
high(n, add(m, x)) → if_high(LE(m, n), n, add(m, x))
if_high(true, n, add(m, x)) → HIGH(n, x)
if_high(false, n, add(m, x)) → add(m, HIGH(n, x))
quicksort(nil) → nil
quicksort(add(n, x)) → APP(quicksort(low(n, x)), add(n, quicksort(high(n, x))))
quicksort(add(n, x)) → app(QUICKSORT(low(n, x)), add(n, quicksort(high(n, x))))
quicksort(add(n, x)) → app(quicksort(LOW(n, x)), add(n, quicksort(high(n, x))))
quicksort(add(n, x)) → app(quicksort(low(n, x)), add(n, QUICKSORT(high(n, x))))
quicksort(add(n, x)) → app(quicksort(low(n, x)), add(n, quicksort(HIGH(n, x))))

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

(4) Complex Obligation (AND)

(5) Obligation:

Relative ADP Problem with
absolute ADPs:

quot(s(x), s(y)) → s(quot(minus(x, y), s(y)))
app(add(n, x), y) → add(n, APP(x, y))
le(s(x), s(y)) → le(x, y)
if_low(true, n, add(m, x)) → add(m, low(n, x))
le(s(x), 0) → false
high(n, nil) → nil
high(n, add(m, x)) → if_high(le(m, n), n, add(m, x))
if_low(false, n, add(m, x)) → low(n, x)
if_high(true, n, add(m, x)) → high(n, x)
quot(0, s(y)) → 0
low(n, add(m, x)) → if_low(le(m, n), n, add(m, x))
low(n, nil) → nil
if_high(false, n, add(m, x)) → add(m, high(n, x))
app(nil, y) → y
minus(s(x), s(y)) → minus(x, y)
le(0, y) → true
quicksort(add(n, x)) → app(quicksort(low(n, x)), add(n, quicksort(high(n, x))))
minus(x, 0) → x
quicksort(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:low_2 = 0 true = app_2 = add_2 = quicksort_1 = if_high_3 = 0, 1 rand_1 = APP_2 = 1 quot_2 = 0, 1 false = nil = s_1 = if_low_3 = 0, 1 le_2 = 0, 1 0 = minus_2 = 1 high_2 = 0
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
APP(x1, x2)  =  APP(x1)
add(x1, x2)  =  add(x1, x2)
quot(x1, x2)  =  quot
s(x1)  =  x1
minus(x1, x2)  =  x1
le(x1, x2)  =  le
if_low(x1, x2, x3)  =  x3
true  =  true
low(x1, x2)  =  x2
0  =  0
false  =  false
high(x1, x2)  =  x2
nil  =  nil
if_high(x1, x2, x3)  =  x3
app(x1, x2)  =  app(x1, x2)
quicksort(x1)  =  quicksort(x1)

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

APP1 > nil
[quot, 0] > [le, true] > false > nil
quicksort1 > [add2, app2] > [le, true] > false > nil

Status:
APP1: multiset
add2: [1,2]
quot: []
le: multiset
true: multiset
0: multiset
false: multiset
nil: multiset
app2: [1,2]
quicksort1: multiset

(7) Obligation:

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

APP(add0(n, x)) → APP(x)

The TRS R consists of the following rules:

quots0(quot)
lele
if_low(add0(m, x)) → add0(m, low(x))
lefalse0
high(nil0) → nil0
high(add0(m, x)) → if_high(add0(m, x))
rand0(x) → rand0(s0(x))
if_low(add0(m, x)) → low(x)
if_high(add0(m, x)) → high(x)
quot00
low(add0(m, x)) → if_low(add0(m, x))
low(nil0) → nil0
if_high(add0(m, x)) → add0(m, high(x))
app0(add0(n, x), y) → add0(n, app0(x, y))
app0(nil0, y) → y
minus(s0(x)) → minus(x)
letrue0
quicksort0(add0(n, x)) → app0(quicksort0(low(x)), add0(n, quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

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

(8) QDPOrderProof (EQUIVALENT transformation)

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


The following pairs can be oriented strictly and are deleted.


APP(add0(n, x)) → APP(x)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
APP(x1)  =  APP(x1)
add0(x1, x2)  =  add0(x1, x2)
quot  =  quot
s0(x1)  =  x1
le  =  le
if_low(x1)  =  if_low(x1)
low(x1)  =  low(x1)
false0  =  false0
high(x1)  =  x1
nil0  =  nil0
if_high(x1)  =  x1
rand0(x1)  =  x1
00  =  00
app0(x1, x2)  =  app0(x1, x2)
minus(x1)  =  minus(x1)
true0  =  true0
quicksort0(x1)  =  quicksort0(x1)

Recursive path order with status [RPO].
Quasi-Precedence:
quot > 00 > [APP1, add02, iflow1, low1]
[le, false0] > true0 > [APP1, add02, iflow1, low1]
minus1 > [APP1, add02, iflow1, low1]
quicksort01 > nil0 > [APP1, add02, iflow1, low1]
quicksort01 > app02 > [APP1, add02, iflow1, low1]

Status:
APP1: multiset
add02: multiset
quot: multiset
le: multiset
iflow1: multiset
low1: multiset
false0: multiset
nil0: multiset
00: multiset
app02: [1,2]
minus1: [1]
true0: multiset
quicksort01: multiset


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

quots0(quot)
lele
if_low(add0(m, x)) → add0(m, low(x))
lefalse0
high(nil0) → nil0
high(add0(m, x)) → if_high(add0(m, x))
rand0(x) → rand0(s0(x))
if_low(add0(m, x)) → low(x)
if_high(add0(m, x)) → high(x)
quot00
low(add0(m, x)) → if_low(add0(m, x))
low(nil0) → nil0
if_high(add0(m, x)) → add0(m, high(x))
app0(add0(n, x), y) → add0(n, app0(x, y))
app0(nil0, y) → y
minus(s0(x)) → minus(x)
letrue0
quicksort0(add0(n, x)) → app0(quicksort0(low(x)), add0(n, quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

(9) Obligation:

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

quots0(quot)
lele
if_low(add0(m, x)) → add0(m, low(x))
lefalse0
high(nil0) → nil0
high(add0(m, x)) → if_high(add0(m, x))
rand0(x) → rand0(s0(x))
if_low(add0(m, x)) → low(x)
if_high(add0(m, x)) → high(x)
quot00
low(add0(m, x)) → if_low(add0(m, x))
low(nil0) → nil0
if_high(add0(m, x)) → add0(m, high(x))
app0(add0(n, x), y) → add0(n, app0(x, y))
app0(nil0, y) → y
minus(s0(x)) → minus(x)
letrue0
quicksort0(add0(n, x)) → app0(quicksort0(low(x)), add0(n, quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

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

(10) PisEmptyProof (EQUIVALENT transformation)

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

(11) YES

(12) Obligation:

Relative ADP Problem with
absolute ADPs:

quot(s(x), s(y)) → s(quot(minus(x, y), s(y)))
le(s(x), s(y)) → le(x, y)
if_low(true, n, add(m, x)) → add(m, low(n, x))
le(s(x), 0) → false
high(n, nil) → nil
high(n, add(m, x)) → if_high(le(m, n), n, add(m, x))
if_low(false, n, add(m, x)) → low(n, x)
if_high(true, n, add(m, x)) → high(n, x)
quot(0, s(y)) → 0
low(n, add(m, x)) → if_low(le(m, n), n, add(m, x))
low(n, nil) → nil
if_high(false, n, add(m, x)) → add(m, high(n, x))
app(add(n, x), y) → add(n, app(x, y))
app(nil, y) → y
le(0, y) → true
quicksort(add(n, x)) → app(quicksort(low(n, x)), add(n, quicksort(high(n, x))))
minus(x, 0) → x
minus(s(x), s(y)) → MINUS(x, y)
quicksort(nil) → nil

and relative ADPs:

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

(13) 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:low_2 = 0, 1 MINUS_2 = true = add_2 = 0 app_2 = 0 quicksort_1 = if_high_3 = 0, 1, 2 rand_1 = quot_2 = 1 false = nil = s_1 = if_low_3 = 0, 1, 2 le_2 = 1 0 = minus_2 = 1 high_2 = 0, 1
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
MINUS(x1, x2)  =  MINUS(x1, x2)
s(x1)  =  s(x1)
quot(x1, x2)  =  x1
minus(x1, x2)  =  x1
le(x1, x2)  =  x1
if_low(x1, x2, x3)  =  if_low
true  =  true
add(x1, x2)  =  x2
low(x1, x2)  =  low
0  =  0
false  =  false
high(x1, x2)  =  high
nil  =  nil
if_high(x1, x2, x3)  =  if_high
app(x1, x2)  =  x2
quicksort(x1)  =  quicksort(x1)

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

MINUS2 > [iflow, true, low, false, high, nil, ifhigh]
s1 > [iflow, true, low, false, high, nil, ifhigh]
0 > [iflow, true, low, false, high, nil, ifhigh]
quicksort1 > [iflow, true, low, false, high, nil, ifhigh]

Status:
MINUS2: [2,1]
s1: [1]
iflow: []
true: multiset
low: []
0: multiset
false: multiset
high: []
nil: multiset
ifhigh: []
quicksort1: multiset

(14) Obligation:

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

MINUS0(s0(x), s0(y)) → MINUS0(x, y)

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
le(s0(x)) → le(x)
if_lowadd(low)
le(s0(x)) → false0
highnil0
highif_high
rand0(x) → rand0(s0(x))
if_lowlow
if_highhigh
quot(00) → 00
lowif_low
lownil0
if_highadd(high)
app(y) → add(app(y))
app(y) → y
minus(s0(x)) → minus(x)
le(00) → true0
quicksort0(add(x)) → app(add(quicksort0(high)))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

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

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

lownil0
rand0(x) → x

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(MINUS0(x1, x2)) = x1 + x2   
POL(add(x1)) = x1   
POL(app(x1)) = 2·x1   
POL(false0) = 0   
POL(high) = 0   
POL(if_high) = 0   
POL(if_low) = 2   
POL(le(x1)) = 2·x1   
POL(low) = 2   
POL(minus(x1)) = x1   
POL(nil0) = 0   
POL(quicksort0(x1)) = x1   
POL(quot(x1)) = x1   
POL(rand0(x1)) = 2 + x1   
POL(s0(x1)) = x1   
POL(true0) = 0   

(16) Obligation:

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

MINUS0(s0(x), s0(y)) → MINUS0(x, y)

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
le(s0(x)) → le(x)
if_lowadd(low)
le(s0(x)) → false0
highnil0
highif_high
rand0(x) → rand0(s0(x))
if_lowlow
if_highhigh
quot(00) → 00
lowif_low
if_highadd(high)
app(y) → add(app(y))
app(y) → y
minus(s0(x)) → minus(x)
le(00) → true0
quicksort0(add(x)) → app(add(quicksort0(high)))
minus(x) → x
quicksort0(nil0) → nil0

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:

le(s0(x)) → false0
quot(00) → 00
le(00) → true0

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(MINUS0(x1, x2)) = x1 + x2   
POL(add(x1)) = x1   
POL(app(x1)) = x1   
POL(false0) = 1   
POL(high) = 0   
POL(if_high) = 0   
POL(if_low) = 0   
POL(le(x1)) = 2 + x1   
POL(low) = 0   
POL(minus(x1)) = x1   
POL(nil0) = 0   
POL(quicksort0(x1)) = 2·x1   
POL(quot(x1)) = 1 + 2·x1   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   
POL(true0) = 1   

(18) Obligation:

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

MINUS0(s0(x), s0(y)) → MINUS0(x, y)

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
le(s0(x)) → le(x)
if_lowadd(low)
highnil0
highif_high
rand0(x) → rand0(s0(x))
if_lowlow
if_highhigh
lowif_low
if_highadd(high)
app(y) → add(app(y))
app(y) → y
minus(s0(x)) → minus(x)
quicksort0(add(x)) → app(add(quicksort0(high)))
minus(x) → x
quicksort0(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 rules of the TRS R:

quicksort0(nil0) → nil0

Used ordering: Polynomial interpretation [POLO]:

POL(MINUS0(x1, x2)) = x1 + x2   
POL(add(x1)) = x1   
POL(app(x1)) = x1   
POL(high) = 0   
POL(if_high) = 0   
POL(if_low) = 0   
POL(le(x1)) = x1   
POL(low) = 0   
POL(minus(x1)) = x1   
POL(nil0) = 0   
POL(quicksort0(x1)) = 2 + x1   
POL(quot(x1)) = x1   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   

(20) Obligation:

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

MINUS0(s0(x), s0(y)) → MINUS0(x, y)

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
le(s0(x)) → le(x)
if_lowadd(low)
highnil0
highif_high
rand0(x) → rand0(s0(x))
if_lowlow
if_highhigh
lowif_low
if_highadd(high)
app(y) → add(app(y))
app(y) → y
minus(s0(x)) → minus(x)
quicksort0(add(x)) → app(add(quicksort0(high)))
minus(x) → x

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

(21) QDPOrderProof (EQUIVALENT transformation)

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


The following pairs can be oriented strictly and are deleted.


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

POL( s0(x1) ) = x1 + 2

POL( minus(x1) ) = x1 + 1

POL( le(x1) ) = 0

POL( if_low ) = 2

POL( add(x1) ) = 2

POL( low ) = 2

POL( high ) = 2

POL( nil0 ) = 2

POL( if_high ) = 2

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

POL( app(x1) ) = x1 + 2

POL( quicksort0(x1) ) = 2x1

POL( MINUS0(x1, x2) ) = 2x1 + 2x2


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

quot(s0(x)) → s0(quot(minus(x)))
le(s0(x)) → le(x)
if_lowadd(low)
highnil0
highif_high
rand0(x) → rand0(s0(x))
if_lowlow
if_highhigh
lowif_low
if_highadd(high)
app(y) → add(app(y))
app(y) → y
minus(s0(x)) → minus(x)
quicksort0(add(x)) → app(add(quicksort0(high)))
minus(x) → x

(22) Obligation:

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

quot(s0(x)) → s0(quot(minus(x)))
le(s0(x)) → le(x)
if_lowadd(low)
highnil0
highif_high
rand0(x) → rand0(s0(x))
if_lowlow
if_highhigh
lowif_low
if_highadd(high)
app(y) → add(app(y))
app(y) → y
minus(s0(x)) → minus(x)
quicksort0(add(x)) → app(add(quicksort0(high)))
minus(x) → x

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

(23) PisEmptyProof (EQUIVALENT transformation)

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

(24) YES

(25) Obligation:

Relative ADP Problem with
absolute ADPs:

quot(s(x), s(y)) → s(quot(minus(x, y), s(y)))
if_low(true, n, add(m, x)) → add(m, low(n, x))
le(s(x), 0) → false
high(n, nil) → nil
high(n, add(m, x)) → if_high(le(m, n), n, add(m, x))
if_low(false, n, add(m, x)) → low(n, x)
if_high(true, n, add(m, x)) → high(n, x)
le(s(x), s(y)) → LE(x, y)
quot(0, s(y)) → 0
low(n, add(m, x)) → if_low(le(m, n), n, add(m, x))
low(n, nil) → nil
if_high(false, n, add(m, x)) → add(m, high(n, x))
app(add(n, x), y) → add(n, app(x, y))
app(nil, y) → y
minus(s(x), s(y)) → minus(x, y)
le(0, y) → true
quicksort(add(n, x)) → app(quicksort(low(n, x)), add(n, quicksort(high(n, x))))
minus(x, 0) → x
quicksort(nil) → nil

and relative ADPs:

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

(26) 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:low_2 = 0, 1 true = add_2 = 0 app_2 = 0 quicksort_1 = if_high_3 = 0, 1 rand_1 = quot_2 = 1 false = nil = s_1 = if_low_3 = 0, 1, 2 LE_2 = le_2 = 0, 1 0 = minus_2 = 1 high_2 = 0
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
LE(x1, x2)  =  LE(x1, x2)
s(x1)  =  s(x1)
quot(x1, x2)  =  x1
minus(x1, x2)  =  x1
le(x1, x2)  =  le
if_low(x1, x2, x3)  =  if_low
true  =  true
add(x1, x2)  =  x2
low(x1, x2)  =  low
0  =  0
false  =  false
high(x1, x2)  =  x2
nil  =  nil
if_high(x1, x2, x3)  =  x3
app(x1, x2)  =  x2
quicksort(x1)  =  x1

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

[iflow, low] > [le, false] > true
[iflow, low] > nil
0 > [le, false] > true

Status:
LE2: multiset
s1: multiset
le: []
iflow: multiset
true: multiset
low: multiset
0: multiset
false: multiset
nil: multiset

(27) Obligation:

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

LE0(s0(x), s0(y)) → LE0(x, y)

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
lele
if_lowadd(low)
lefalse0
high(nil0) → nil0
high(add(x)) → if_high(add(x))
rand0(x) → rand0(s0(x))
if_lowlow
if_high(add(x)) → high(x)
quot(00) → 00
lowif_low
lownil0
if_high(add(x)) → add(high(x))
app(y) → add(app(y))
app(y) → y
minus(s0(x)) → minus(x)
letrue0
quicksort0(add(x)) → app(add(quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

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

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

lefalse0
rand0(x) → x

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(LE0(x1, x2)) = x1 + x2   
POL(add(x1)) = x1   
POL(app(x1)) = x1   
POL(false0) = 0   
POL(high(x1)) = x1   
POL(if_high(x1)) = x1   
POL(if_low) = 0   
POL(le) = 2   
POL(low) = 0   
POL(minus(x1)) = x1   
POL(nil0) = 0   
POL(quicksort0(x1)) = 2·x1   
POL(quot(x1)) = x1   
POL(rand0(x1)) = 2 + x1   
POL(s0(x1)) = x1   
POL(true0) = 2   

(29) Obligation:

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

LE0(s0(x), s0(y)) → LE0(x, y)

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
lele
if_lowadd(low)
high(nil0) → nil0
high(add(x)) → if_high(add(x))
rand0(x) → rand0(s0(x))
if_lowlow
if_high(add(x)) → high(x)
quot(00) → 00
lowif_low
lownil0
if_high(add(x)) → add(high(x))
app(y) → add(app(y))
app(y) → y
minus(s0(x)) → minus(x)
letrue0
quicksort0(add(x)) → app(add(quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0

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

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

letrue0

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(LE0(x1, x2)) = x1 + x2   
POL(add(x1)) = x1   
POL(app(x1)) = x1   
POL(high(x1)) = x1   
POL(if_high(x1)) = x1   
POL(if_low) = 0   
POL(le) = 2   
POL(low) = 0   
POL(minus(x1)) = x1   
POL(nil0) = 0   
POL(quicksort0(x1)) = 2·x1   
POL(quot(x1)) = x1   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   
POL(true0) = 1   

(31) Obligation:

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

LE0(s0(x), s0(y)) → LE0(x, y)

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
lele
if_lowadd(low)
high(nil0) → nil0
high(add(x)) → if_high(add(x))
rand0(x) → rand0(s0(x))
if_lowlow
if_high(add(x)) → high(x)
quot(00) → 00
lowif_low
lownil0
if_high(add(x)) → add(high(x))
app(y) → add(app(y))
app(y) → y
minus(s0(x)) → minus(x)
quicksort0(add(x)) → app(add(quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0

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

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

quot(00) → 00
quicksort0(nil0) → nil0

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 1   
POL(LE0(x1, x2)) = x1 + x2   
POL(add(x1)) = x1   
POL(app(x1)) = x1   
POL(high(x1)) = x1   
POL(if_high(x1)) = x1   
POL(if_low) = 2   
POL(le) = 0   
POL(low) = 2   
POL(minus(x1)) = x1   
POL(nil0) = 2   
POL(quicksort0(x1)) = 2 + x1   
POL(quot(x1)) = 2 + 2·x1   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   

(33) Obligation:

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

LE0(s0(x), s0(y)) → LE0(x, y)

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
lele
if_lowadd(low)
high(nil0) → nil0
high(add(x)) → if_high(add(x))
rand0(x) → rand0(s0(x))
if_lowlow
if_high(add(x)) → high(x)
lowif_low
lownil0
if_high(add(x)) → add(high(x))
app(y) → add(app(y))
app(y) → y
minus(s0(x)) → minus(x)
quicksort0(add(x)) → app(add(quicksort0(high(x))))
minus(x) → x

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

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

lownil0

Used ordering: Polynomial interpretation [POLO]:

POL(LE0(x1, x2)) = x1 + x2   
POL(add(x1)) = x1   
POL(app(x1)) = x1   
POL(high(x1)) = x1   
POL(if_high(x1)) = x1   
POL(if_low) = 2   
POL(le) = 0   
POL(low) = 2   
POL(minus(x1)) = x1   
POL(nil0) = 0   
POL(quicksort0(x1)) = x1   
POL(quot(x1)) = 2 + x1   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   

(35) Obligation:

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

LE0(s0(x), s0(y)) → LE0(x, y)

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
lele
if_lowadd(low)
high(nil0) → nil0
high(add(x)) → if_high(add(x))
rand0(x) → rand0(s0(x))
if_lowlow
if_high(add(x)) → high(x)
lowif_low
if_high(add(x)) → add(high(x))
app(y) → add(app(y))
app(y) → y
minus(s0(x)) → minus(x)
quicksort0(add(x)) → app(add(quicksort0(high(x))))
minus(x) → x

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

(36) QDPOrderProof (EQUIVALENT transformation)

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


The following pairs can be oriented strictly and are deleted.


LE0(s0(x), s0(y)) → LE0(x, y)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
LE0(x1, x2)  =  LE0(x1, x2)
s0(x1)  =  s0(x1)
quot(x1)  =  quot(x1)
minus(x1)  =  minus(x1)
le  =  le
if_low  =  if_low
add(x1)  =  x1
low  =  low
high(x1)  =  x1
nil0  =  nil0
if_high(x1)  =  x1
rand0(x1)  =  rand0
app(x1)  =  x1
quicksort0(x1)  =  x1

Recursive path order with status [RPO].
Quasi-Precedence:
quot1 > s01 > LE02
quot1 > s01 > minus1
[iflow, low]
rand0 > s01 > LE02
rand0 > s01 > minus1

Status:
LE02: [2,1]
s01: multiset
quot1: multiset
minus1: multiset
le: multiset
iflow: multiset
low: multiset
nil0: multiset
rand0: []


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

quot(s0(x)) → s0(quot(minus(x)))
lele
if_lowadd(low)
high(nil0) → nil0
high(add(x)) → if_high(add(x))
rand0(x) → rand0(s0(x))
if_lowlow
if_high(add(x)) → high(x)
lowif_low
if_high(add(x)) → add(high(x))
app(y) → add(app(y))
app(y) → y
minus(s0(x)) → minus(x)
quicksort0(add(x)) → app(add(quicksort0(high(x))))
minus(x) → x

(37) Obligation:

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

quot(s0(x)) → s0(quot(minus(x)))
lele
if_lowadd(low)
high(nil0) → nil0
high(add(x)) → if_high(add(x))
rand0(x) → rand0(s0(x))
if_lowlow
if_high(add(x)) → high(x)
lowif_low
if_high(add(x)) → add(high(x))
app(y) → add(app(y))
app(y) → y
minus(s0(x)) → minus(x)
quicksort0(add(x)) → app(add(quicksort0(high(x))))
minus(x) → x

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

(38) PisEmptyProof (EQUIVALENT transformation)

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

(39) YES

(40) Obligation:

Relative ADP Problem with
absolute ADPs:

quot(s(x), s(y)) → s(quot(minus(x, y), s(y)))
le(s(x), s(y)) → le(x, y)
le(s(x), 0) → false
high(n, nil) → nil
high(n, add(m, x)) → if_high(le(m, n), n, add(m, x))
if_high(true, n, add(m, x)) → high(n, x)
low(n, add(m, x)) → IF_LOW(le(m, n), n, add(m, x))
quot(0, s(y)) → 0
if_low(false, n, add(m, x)) → LOW(n, x)
low(n, add(m, x)) → if_low(le(m, n), n, add(m, x))
low(n, nil) → nil
if_high(false, n, add(m, x)) → add(m, high(n, x))
app(add(n, x), y) → add(n, app(x, y))
app(nil, y) → y
if_low(true, n, add(m, x)) → add(m, LOW(n, x))
minus(s(x), s(y)) → minus(x, y)
le(0, y) → true
quicksort(add(n, x)) → app(quicksort(low(n, x)), add(n, quicksort(high(n, x))))
minus(x, 0) → x
quicksort(nil) → nil

and relative ADPs:

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

(41) 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:low_2 = 0 true = add_2 = 0 app_2 = IF_LOW_3 = 0 quicksort_1 = if_high_3 = 0, 1 rand_1 = quot_2 = false = nil = s_1 = if_low_3 = 0, 1 le_2 = 0, 1 0 = minus_2 = 1 high_2 = 0 LOW_2 =
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
IF_LOW(x1, x2, x3)  =  IF_LOW(x2, x3)
false  =  false
add(x1, x2)  =  add(x2)
LOW(x1, x2)  =  LOW(x1, x2)
true  =  true
le(x1, x2)  =  le
quot(x1, x2)  =  quot(x1, x2)
s(x1)  =  s(x1)
minus(x1, x2)  =  minus(x1)
if_low(x1, x2, x3)  =  x3
low(x1, x2)  =  x2
0  =  0
high(x1, x2)  =  x2
nil  =  nil
if_high(x1, x2, x3)  =  x3
app(x1, x2)  =  app(x1, x2)
quicksort(x1)  =  quicksort(x1)

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

[true, le] > add1 > [IFLOW2, LOW2] > [false, 0]
quot2 > s1 > minus1 > [false, 0]
quicksort1 > nil > [false, 0]
quicksort1 > app2 > add1 > [IFLOW2, LOW2] > [false, 0]

Status:
IFLOW2: multiset
false: multiset
add1: multiset
LOW2: multiset
true: multiset
le: []
quot2: [2,1]
s1: multiset
minus1: [1]
0: multiset
nil: multiset
app2: multiset
quicksort1: [1]

(42) Obligation:

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

IF_LOW(n, add(x)) → LOW0(n, x)
LOW0(n, add(x)) → IF_LOW(n, add(x))

The TRS R consists of the following rules:

quot0(s0(x), s0(y)) → s0(quot0(minus(x), s0(y)))
lele
if_low(add(x)) → add(low(x))
lefalse0
high(nil0) → nil0
high(add(x)) → if_high(add(x))
rand0(x) → rand0(s0(x))
if_low(add(x)) → low(x)
if_high(add(x)) → high(x)
quot0(00, s0(y)) → 00
low(add(x)) → if_low(add(x))
low(nil0) → nil0
if_high(add(x)) → add(high(x))
app0(add(x), y) → add(app0(x, y))
app0(nil0, y) → y
minus(s0(x)) → minus(x)
letrue0
quicksort0(add(x)) → app0(quicksort0(low(x)), add(quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

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

(43) QDPOrderProof (EQUIVALENT transformation)

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


The following pairs can be oriented strictly and are deleted.


IF_LOW(n, add(x)) → LOW0(n, x)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
IF_LOW(x1, x2)  =  IF_LOW(x2)
add(x1)  =  add(x1)
LOW0(x1, x2)  =  LOW0(x2)
quot0(x1, x2)  =  quot0
s0(x1)  =  x1
minus(x1)  =  minus(x1)
le  =  le
if_low(x1)  =  x1
low(x1)  =  x1
false0  =  false0
high(x1)  =  x1
nil0  =  nil0
if_high(x1)  =  x1
rand0(x1)  =  x1
00  =  00
app0(x1, x2)  =  app0(x1, x2)
true0  =  true0
quicksort0(x1)  =  quicksort0(x1)

Recursive path order with status [RPO].
Quasi-Precedence:
[quot0, 00] > minus1 > [IFLOW1, LOW01]
le > false0 > [IFLOW1, LOW01]
le > true0 > [IFLOW1, LOW01]
quicksort01 > nil0 > [IFLOW1, LOW01]
quicksort01 > app02 > add1 > [IFLOW1, LOW01]

Status:
IFLOW1: [1]
add1: [1]
LOW01: [1]
quot0: []
minus1: [1]
le: multiset
false0: multiset
nil0: multiset
00: multiset
app02: [2,1]
true0: multiset
quicksort01: multiset


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

quot0(s0(x), s0(y)) → s0(quot0(minus(x), s0(y)))
lele
if_low(add(x)) → add(low(x))
lefalse0
high(nil0) → nil0
high(add(x)) → if_high(add(x))
rand0(x) → rand0(s0(x))
if_low(add(x)) → low(x)
if_high(add(x)) → high(x)
quot0(00, s0(y)) → 00
low(add(x)) → if_low(add(x))
low(nil0) → nil0
if_high(add(x)) → add(high(x))
app0(add(x), y) → add(app0(x, y))
app0(nil0, y) → y
minus(s0(x)) → minus(x)
letrue0
quicksort0(add(x)) → app0(quicksort0(low(x)), add(quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

(44) Obligation:

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

LOW0(n, add(x)) → IF_LOW(n, add(x))

The TRS R consists of the following rules:

quot0(s0(x), s0(y)) → s0(quot0(minus(x), s0(y)))
lele
if_low(add(x)) → add(low(x))
lefalse0
high(nil0) → nil0
high(add(x)) → if_high(add(x))
rand0(x) → rand0(s0(x))
if_low(add(x)) → low(x)
if_high(add(x)) → high(x)
quot0(00, s0(y)) → 00
low(add(x)) → if_low(add(x))
low(nil0) → nil0
if_high(add(x)) → add(high(x))
app0(add(x), y) → add(app0(x, y))
app0(nil0, y) → y
minus(s0(x)) → minus(x)
letrue0
quicksort0(add(x)) → app0(quicksort0(low(x)), add(quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

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

(45) DependencyGraphProof (EQUIVALENT transformation)

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

(46) TRUE

(47) Obligation:

Relative ADP Problem with
absolute ADPs:

quot(s(x), s(y)) → s(quot(minus(x, y), s(y)))
if_high(false, n, add(m, x)) → add(m, HIGH(n, x))
le(s(x), s(y)) → le(x, y)
if_low(true, n, add(m, x)) → add(m, low(n, x))
le(s(x), 0) → false
high(n, nil) → nil
high(n, add(m, x)) → if_high(le(m, n), n, add(m, x))
if_low(false, n, add(m, x)) → low(n, x)
quot(0, s(y)) → 0
low(n, add(m, x)) → if_low(le(m, n), n, add(m, x))
low(n, nil) → nil
app(add(n, x), y) → add(n, app(x, y))
if_high(true, n, add(m, x)) → HIGH(n, x)
app(nil, y) → y
high(n, add(m, x)) → IF_HIGH(le(m, n), n, add(m, x))
minus(s(x), s(y)) → minus(x, y)
le(0, y) → true
quicksort(add(n, x)) → app(quicksort(low(n, x)), add(n, quicksort(high(n, x))))
minus(x, 0) → x
quicksort(nil) → nil

and relative ADPs:

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

(48) 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:HIGH_2 = 0 low_2 = 0 true = IF_HIGH_3 = 1 add_2 = app_2 = quicksort_1 = if_high_3 = 0, 1 rand_1 = quot_2 = false = nil = s_1 = if_low_3 = 0, 1 le_2 = 1 0 = minus_2 = 1 high_2 = 0
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
IF_HIGH(x1, x2, x3)  =  IF_HIGH(x1, x3)
true  =  true
add(x1, x2)  =  add(x1, x2)
HIGH(x1, x2)  =  HIGH(x2)
le(x1, x2)  =  le(x1)
false  =  false
quot(x1, x2)  =  quot(x1, x2)
s(x1)  =  x1
minus(x1, x2)  =  x1
if_low(x1, x2, x3)  =  x3
low(x1, x2)  =  x2
0  =  0
high(x1, x2)  =  x2
nil  =  nil
if_high(x1, x2, x3)  =  x3
app(x1, x2)  =  app(x1, x2)
quicksort(x1)  =  quicksort(x1)

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

0 > true > [add2, HIGH1, le1] > IFHIGH2
0 > true > [add2, HIGH1, le1] > false
[nil, quicksort1] > app2 > [add2, HIGH1, le1] > IFHIGH2
[nil, quicksort1] > app2 > [add2, HIGH1, le1] > false

Status:
IFHIGH2: multiset
true: multiset
add2: multiset
HIGH1: multiset
le1: multiset
false: multiset
quot2: [1,2]
0: multiset
nil: multiset
app2: multiset
quicksort1: [1]

(49) Obligation:

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

IF_HIGH(true0, add0(m, x)) → HIGH(x)
HIGH(add0(m, x)) → IF_HIGH(le(m), add0(m, x))
IF_HIGH(false0, add0(m, x)) → HIGH(x)

The TRS R consists of the following rules:

quot0(s0(x), s0(y)) → s0(quot0(minus(x), s0(y)))
le(s0(x)) → le(x)
if_low(add0(m, x)) → add0(m, low(x))
le(s0(x)) → false0
high(nil0) → nil0
high(add0(m, x)) → if_high(add0(m, x))
rand0(x) → rand0(s0(x))
if_low(add0(m, x)) → low(x)
if_high(add0(m, x)) → high(x)
quot0(00, s0(y)) → 00
low(add0(m, x)) → if_low(add0(m, x))
low(nil0) → nil0
if_high(add0(m, x)) → add0(m, high(x))
app0(add0(n, x), y) → add0(n, app0(x, y))
app0(nil0, y) → y
minus(s0(x)) → minus(x)
le(00) → true0
quicksort0(add0(n, x)) → app0(quicksort0(low(x)), add0(n, quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

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

(50) QDPOrderProof (EQUIVALENT transformation)

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


The following pairs can be oriented strictly and are deleted.


IF_HIGH(true0, add0(m, x)) → HIGH(x)
HIGH(add0(m, x)) → IF_HIGH(le(m), add0(m, x))
IF_HIGH(false0, add0(m, x)) → HIGH(x)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
IF_HIGH(x1, x2)  =  IF_HIGH(x1, x2)
true0  =  true0
add0(x1, x2)  =  add0(x2)
HIGH(x1)  =  HIGH(x1)
le(x1)  =  le
false0  =  false0
quot0(x1, x2)  =  x2
s0(x1)  =  x1
minus(x1)  =  x1
if_low(x1)  =  x1
low(x1)  =  x1
high(x1)  =  x1
nil0  =  nil0
if_high(x1)  =  x1
rand0(x1)  =  x1
00  =  00
app0(x1, x2)  =  app0(x1, x2)
quicksort0(x1)  =  quicksort0(x1)

Recursive path order with status [RPO].
Quasi-Precedence:
nil0 > [IFHIGH2, 00]
quicksort01 > app02 > [true0, add01, HIGH1, le] > false0 > [IFHIGH2, 00]

Status:
IFHIGH2: [1,2]
true0: multiset
add01: multiset
HIGH1: multiset
le: multiset
false0: multiset
nil0: multiset
00: multiset
app02: multiset
quicksort01: multiset


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

quot0(s0(x), s0(y)) → s0(quot0(minus(x), s0(y)))
le(s0(x)) → le(x)
if_low(add0(m, x)) → add0(m, low(x))
le(s0(x)) → false0
high(nil0) → nil0
high(add0(m, x)) → if_high(add0(m, x))
rand0(x) → rand0(s0(x))
if_low(add0(m, x)) → low(x)
if_high(add0(m, x)) → high(x)
quot0(00, s0(y)) → 00
low(add0(m, x)) → if_low(add0(m, x))
low(nil0) → nil0
if_high(add0(m, x)) → add0(m, high(x))
app0(add0(n, x), y) → add0(n, app0(x, y))
app0(nil0, y) → y
minus(s0(x)) → minus(x)
le(00) → true0
quicksort0(add0(n, x)) → app0(quicksort0(low(x)), add0(n, quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

(51) Obligation:

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

quot0(s0(x), s0(y)) → s0(quot0(minus(x), s0(y)))
le(s0(x)) → le(x)
if_low(add0(m, x)) → add0(m, low(x))
le(s0(x)) → false0
high(nil0) → nil0
high(add0(m, x)) → if_high(add0(m, x))
rand0(x) → rand0(s0(x))
if_low(add0(m, x)) → low(x)
if_high(add0(m, x)) → high(x)
quot0(00, s0(y)) → 00
low(add0(m, x)) → if_low(add0(m, x))
low(nil0) → nil0
if_high(add0(m, x)) → add0(m, high(x))
app0(add0(n, x), y) → add0(n, app0(x, y))
app0(nil0, y) → y
minus(s0(x)) → minus(x)
le(00) → true0
quicksort0(add0(n, x)) → app0(quicksort0(low(x)), add0(n, quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

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

(52) PisEmptyProof (EQUIVALENT transformation)

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

(53) YES

(54) Obligation:

Relative ADP Problem with
absolute ADPs:

quot(s(x), s(y)) → s(quot(minus(x, y), s(y)))
le(s(x), s(y)) → le(x, y)
if_low(true, n, add(m, x)) → add(m, low(n, x))
quicksort(add(n, x)) → app(quicksort(low(n, x)), add(n, QUICKSORT(high(n, x))))
le(s(x), 0) → false
high(n, nil) → nil
high(n, add(m, x)) → if_high(le(m, n), n, add(m, x))
if_low(false, n, add(m, x)) → low(n, x)
if_high(true, n, add(m, x)) → high(n, x)
quot(0, s(y)) → 0
low(n, add(m, x)) → if_low(le(m, n), n, add(m, x))
quicksort(add(n, x)) → app(QUICKSORT(low(n, x)), add(n, quicksort(high(n, x))))
low(n, nil) → nil
if_high(false, n, add(m, x)) → add(m, high(n, x))
app(add(n, x), y) → add(n, app(x, y))
app(nil, y) → y
minus(s(x), s(y)) → minus(x, y)
le(0, y) → true
quicksort(add(n, x)) → app(quicksort(low(n, x)), add(n, quicksort(high(n, x))))
minus(x, 0) → x
quicksort(nil) → nil

and relative ADPs:

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

(55) 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:low_2 = 0 true = add_2 = app_2 = quicksort_1 = QUICKSORT_1 = if_high_3 = 0, 1 rand_1 = quot_2 = false = nil = s_1 = if_low_3 = 0, 1 le_2 = 0, 1 0 = minus_2 = 1 high_2 = 0
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
QUICKSORT(x1)  =  QUICKSORT(x1)
add(x1, x2)  =  add(x1, x2)
high(x1, x2)  =  x2
low(x1, x2)  =  x2
quot(x1, x2)  =  quot(x1, x2)
s(x1)  =  s(x1)
minus(x1, x2)  =  minus(x1)
le(x1, x2)  =  le
if_low(x1, x2, x3)  =  x3
true  =  true
0  =  0
false  =  false
nil  =  nil
if_high(x1, x2, x3)  =  x3
app(x1, x2)  =  app(x1, x2)
quicksort(x1)  =  quicksort(x1)

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

quot2 > s1 > false > [minus1, nil]
le > [QUICKSORT1, add2, true, app2] > [minus1, nil]
le > false > [minus1, nil]
0 > false > [minus1, nil]
quicksort1 > [QUICKSORT1, add2, true, app2] > [minus1, nil]

Status:
QUICKSORT1: [1]
add2: [1,2]
quot2: [1,2]
s1: multiset
minus1: multiset
le: []
true: multiset
0: multiset
false: multiset
nil: multiset
app2: [1,2]
quicksort1: [1]

(56) Obligation:

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

QUICKSORT0(add0(n, x)) → QUICKSORT0(high(x))
QUICKSORT0(add0(n, x)) → QUICKSORT0(low(x))

The TRS R consists of the following rules:

quot0(s0(x), s0(y)) → s0(quot0(minus(x), s0(y)))
lele
if_low(add0(m, x)) → add0(m, low(x))
lefalse0
high(nil0) → nil0
high(add0(m, x)) → if_high(add0(m, x))
rand0(x) → rand0(s0(x))
if_low(add0(m, x)) → low(x)
if_high(add0(m, x)) → high(x)
quot0(00, s0(y)) → 00
low(add0(m, x)) → if_low(add0(m, x))
low(nil0) → nil0
if_high(add0(m, x)) → add0(m, high(x))
app0(add0(n, x), y) → add0(n, app0(x, y))
app0(nil0, y) → y
minus(s0(x)) → minus(x)
letrue0
quicksort0(add0(n, x)) → app0(quicksort0(low(x)), add0(n, quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

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

(57) QDPOrderProof (EQUIVALENT transformation)

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


The following pairs can be oriented strictly and are deleted.


QUICKSORT0(add0(n, x)) → QUICKSORT0(high(x))
QUICKSORT0(add0(n, x)) → QUICKSORT0(low(x))
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
QUICKSORT0(x1)  =  QUICKSORT0(x1)
add0(x1, x2)  =  add0(x1, x2)
high(x1)  =  high(x1)
low(x1)  =  x1
quot0(x1, x2)  =  quot0
s0(x1)  =  x1
minus(x1)  =  minus(x1)
le  =  le
if_low(x1)  =  x1
false0  =  false0
nil0  =  nil0
if_high(x1)  =  if_high(x1)
rand0(x1)  =  x1
00  =  00
app0(x1, x2)  =  app0(x1, x2)
true0  =  true0
quicksort0(x1)  =  quicksort0(x1)

Recursive path order with status [RPO].
Quasi-Precedence:
[quot0, minus1, 00]
[le, false0] > true0
quicksort01 > app02 > [QUICKSORT01, add02, high1, ifhigh1] > nil0

Status:
QUICKSORT01: [1]
add02: multiset
high1: multiset
quot0: multiset
minus1: multiset
le: multiset
false0: multiset
nil0: multiset
ifhigh1: multiset
00: multiset
app02: multiset
true0: multiset
quicksort01: [1]


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

quot0(s0(x), s0(y)) → s0(quot0(minus(x), s0(y)))
lele
if_low(add0(m, x)) → add0(m, low(x))
lefalse0
high(nil0) → nil0
high(add0(m, x)) → if_high(add0(m, x))
rand0(x) → rand0(s0(x))
if_low(add0(m, x)) → low(x)
if_high(add0(m, x)) → high(x)
quot0(00, s0(y)) → 00
low(add0(m, x)) → if_low(add0(m, x))
low(nil0) → nil0
if_high(add0(m, x)) → add0(m, high(x))
app0(add0(n, x), y) → add0(n, app0(x, y))
app0(nil0, y) → y
minus(s0(x)) → minus(x)
letrue0
quicksort0(add0(n, x)) → app0(quicksort0(low(x)), add0(n, quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

(58) Obligation:

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

quot0(s0(x), s0(y)) → s0(quot0(minus(x), s0(y)))
lele
if_low(add0(m, x)) → add0(m, low(x))
lefalse0
high(nil0) → nil0
high(add0(m, x)) → if_high(add0(m, x))
rand0(x) → rand0(s0(x))
if_low(add0(m, x)) → low(x)
if_high(add0(m, x)) → high(x)
quot0(00, s0(y)) → 00
low(add0(m, x)) → if_low(add0(m, x))
low(nil0) → nil0
if_high(add0(m, x)) → add0(m, high(x))
app0(add0(n, x), y) → add0(n, app0(x, y))
app0(nil0, y) → y
minus(s0(x)) → minus(x)
letrue0
quicksort0(add0(n, x)) → app0(quicksort0(low(x)), add0(n, quicksort0(high(x))))
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

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

(59) PisEmptyProof (EQUIVALENT transformation)

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

(60) YES

(61) Obligation:

Relative ADP Problem with
absolute ADPs:

quot(s(x), s(y)) → s(quot(minus(x, y), s(y)))
le(s(x), s(y)) → le(x, y)
if_low(true, n, add(m, x)) → add(m, low(n, x))
le(s(x), 0) → false
high(n, nil) → nil
high(n, add(m, x)) → if_high(le(m, n), n, add(m, x))
if_low(false, n, add(m, x)) → low(n, x)
if_high(true, n, add(m, x)) → high(n, x)
quot(0, s(y)) → 0
low(n, add(m, x)) → if_low(le(m, n), n, add(m, x))
quot(s(x), s(y)) → s(QUOT(minus(x, y), s(y)))
low(n, nil) → nil
if_high(false, n, add(m, x)) → add(m, high(n, x))
app(add(n, x), y) → add(n, app(x, y))
app(nil, y) → y
minus(s(x), s(y)) → minus(x, y)
le(0, y) → true
quicksort(add(n, x)) → app(quicksort(low(n, x)), add(n, quicksort(high(n, x))))
minus(x, 0) → x
quicksort(nil) → nil

and relative ADPs:

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

(62) 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:low_2 = 0, 1 true = QUOT_2 = 1 add_2 = 0, 1 app_2 = 0 quicksort_1 = if_high_3 = 0, 1 rand_1 = quot_2 = 1 false = nil = s_1 = if_low_3 = 0, 1 le_2 = 0, 1 0 = minus_2 = 1 high_2 = 0, 1
Found this filtering by looking at the following order that orders at least one DP strictly:Combined order from the following AFS and order.
QUOT(x1, x2)  =  QUOT(x1)
s(x1)  =  s(x1)
minus(x1, x2)  =  x1
quot(x1, x2)  =  quot(x1)
le(x1, x2)  =  le
if_low(x1, x2, x3)  =  x3
true  =  true
add(x1, x2)  =  add
low(x1, x2)  =  low
0  =  0
false  =  false
high(x1, x2)  =  high
nil  =  nil
if_high(x1, x2, x3)  =  x3
app(x1, x2)  =  app(x2)
quicksort(x1)  =  quicksort(x1)

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

quot1 > [QUOT1, s1] > 0 > [false, nil]
le > [true, add, low, high] > [false, nil]
[app1, quicksort1] > [true, add, low, high] > [false, nil]

Status:
QUOT1: [1]
s1: multiset
quot1: [1]
le: []
true: multiset
add: multiset
low: multiset
0: multiset
false: multiset
high: multiset
nil: multiset
app1: [1]
quicksort1: [1]

(63) Obligation:

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

QUOT(s0(x)) → QUOT(minus(x))

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
lele
if_low(add) → add
lefalse0
highnil0
highif_high(add)
rand0(x) → rand0(s0(x))
if_low(add) → low
if_high(add) → high
quot(00) → 00
lowif_low(add)
lownil0
if_high(add) → add
app(y) → add
app(y) → y
minus(s0(x)) → minus(x)
letrue0
quicksort0(add) → app(add)
minus(x) → x
quicksort0(nil0) → nil0
rand0(x) → x

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

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

lefalse0
rand0(x) → x

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(QUOT(x1)) = x1   
POL(add) = 0   
POL(app(x1)) = 2·x1   
POL(false0) = 0   
POL(high) = 0   
POL(if_high(x1)) = x1   
POL(if_low(x1)) = x1   
POL(le) = 2   
POL(low) = 0   
POL(minus(x1)) = x1   
POL(nil0) = 0   
POL(quicksort0(x1)) = x1   
POL(quot(x1)) = x1   
POL(rand0(x1)) = 2 + x1   
POL(s0(x1)) = x1   
POL(true0) = 2   

(65) Obligation:

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

QUOT(s0(x)) → QUOT(minus(x))

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
lele
if_low(add) → add
highnil0
highif_high(add)
rand0(x) → rand0(s0(x))
if_low(add) → low
if_high(add) → high
quot(00) → 00
lowif_low(add)
lownil0
if_high(add) → add
app(y) → add
app(y) → y
minus(s0(x)) → minus(x)
letrue0
quicksort0(add) → app(add)
minus(x) → x
quicksort0(nil0) → nil0

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

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

letrue0

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 0   
POL(QUOT(x1)) = x1   
POL(add) = 0   
POL(app(x1)) = 2·x1   
POL(high) = 0   
POL(if_high(x1)) = x1   
POL(if_low(x1)) = x1   
POL(le) = 2   
POL(low) = 0   
POL(minus(x1)) = x1   
POL(nil0) = 0   
POL(quicksort0(x1)) = x1   
POL(quot(x1)) = x1   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   
POL(true0) = 1   

(67) Obligation:

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

QUOT(s0(x)) → QUOT(minus(x))

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
lele
if_low(add) → add
highnil0
highif_high(add)
rand0(x) → rand0(s0(x))
if_low(add) → low
if_high(add) → high
quot(00) → 00
lowif_low(add)
lownil0
if_high(add) → add
app(y) → add
app(y) → y
minus(s0(x)) → minus(x)
quicksort0(add) → app(add)
minus(x) → x
quicksort0(nil0) → nil0

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

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

if_low(add) → add
highnil0
quot(00) → 00
lownil0
if_high(add) → add
app(y) → y
quicksort0(add) → app(add)
quicksort0(nil0) → nil0

Used ordering: Polynomial interpretation [POLO]:

POL(00) = 2   
POL(QUOT(x1)) = x1   
POL(add) = 1   
POL(app(x1)) = 1 + x1   
POL(high) = 2   
POL(if_high(x1)) = 2·x1   
POL(if_low(x1)) = 2·x1   
POL(le) = 0   
POL(low) = 2   
POL(minus(x1)) = x1   
POL(nil0) = 1   
POL(quicksort0(x1)) = 2 + 2·x1   
POL(quot(x1)) = 2·x1   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   

(69) Obligation:

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

QUOT(s0(x)) → QUOT(minus(x))

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
lele
highif_high(add)
rand0(x) → rand0(s0(x))
if_low(add) → low
if_high(add) → high
lowif_low(add)
app(y) → add
minus(s0(x)) → minus(x)
minus(x) → x

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

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

app(y) → add

Used ordering: Polynomial interpretation [POLO]:

POL(QUOT(x1)) = x1   
POL(add) = 0   
POL(app(x1)) = 2 + x1   
POL(high) = 0   
POL(if_high(x1)) = 2·x1   
POL(if_low(x1)) = 2·x1   
POL(le) = 0   
POL(low) = 0   
POL(minus(x1)) = x1   
POL(quot(x1)) = 2·x1   
POL(rand0(x1)) = x1   
POL(s0(x1)) = x1   

(71) Obligation:

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

QUOT(s0(x)) → QUOT(minus(x))

The TRS R consists of the following rules:

quot(s0(x)) → s0(quot(minus(x)))
lele
highif_high(add)
rand0(x) → rand0(s0(x))
if_low(add) → low
if_high(add) → high
lowif_low(add)
minus(s0(x)) → minus(x)
minus(x) → x

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

(72) QDPOrderProof (EQUIVALENT transformation)

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


The following pairs can be oriented strictly and are deleted.


QUOT(s0(x)) → QUOT(minus(x))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial Order [NEGPOLO,POLO] with Interpretation:
POL( quot(x1) ) = max{0, 2x1 - 2}

POL( s0(x1) ) = 2x1 + 2

POL( minus(x1) ) = x1 + 1

POL( le ) = 0

POL( high ) = 0

POL( if_high(x1) ) = max{0, x1 - 1}

POL( add ) = 1

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

POL( if_low(x1) ) = 0

POL( low ) = 0

POL( QUOT(x1) ) = 2x1


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

quot(s0(x)) → s0(quot(minus(x)))
lele
highif_high(add)
rand0(x) → rand0(s0(x))
if_low(add) → low
if_high(add) → high
lowif_low(add)
minus(s0(x)) → minus(x)
minus(x) → x

(73) Obligation:

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

quot(s0(x)) → s0(quot(minus(x)))
lele
highif_high(add)
rand0(x) → rand0(s0(x))
if_low(add) → low
if_high(add) → high
lowif_low(add)
minus(s0(x)) → minus(x)
minus(x) → x

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

(74) PisEmptyProof (EQUIVALENT transformation)

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

(75) YES