(0) Obligation:

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

qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(x, cons(x, xs))), cons(x, qsort(filterhigh(x, cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))

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:

qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(x, cons(x, xs))), cons(x, qsort(filterhigh(x, cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))

The set Q consists of the following terms:

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

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

QSORT(cons(x, xs)) → APPEND(qsort(filterlow(x, cons(x, xs))), cons(x, qsort(filterhigh(x, cons(x, xs)))))
QSORT(cons(x, xs)) → QSORT(filterlow(x, cons(x, xs)))
QSORT(cons(x, xs)) → FILTERLOW(x, cons(x, xs))
QSORT(cons(x, xs)) → QSORT(filterhigh(x, cons(x, xs)))
QSORT(cons(x, xs)) → FILTERHIGH(x, cons(x, xs))
FILTERLOW(n, cons(x, xs)) → IF1(ge(n, x), n, x, xs)
FILTERLOW(n, cons(x, xs)) → GE(n, x)
IF1(true, n, x, xs) → FILTERLOW(n, xs)
IF1(false, n, x, xs) → FILTERLOW(n, xs)
FILTERHIGH(n, cons(x, xs)) → IF2(ge(x, n), n, x, xs)
FILTERHIGH(n, cons(x, xs)) → GE(x, n)
IF2(true, n, x, xs) → FILTERHIGH(n, xs)
IF2(false, n, x, xs) → FILTERHIGH(n, xs)
GE(s(x), s(y)) → GE(x, y)
APPEND(cons(x, xs), ys) → APPEND(xs, ys)

The TRS R consists of the following rules:

qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(x, cons(x, xs))), cons(x, qsort(filterhigh(x, cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))

The set Q consists of the following terms:

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

APPEND(cons(x, xs), ys) → APPEND(xs, ys)

The TRS R consists of the following rules:

qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(x, cons(x, xs))), cons(x, qsort(filterhigh(x, cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))

The set Q consists of the following terms:

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

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

(8) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(9) Obligation:

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

APPEND(cons(x, xs), ys) → APPEND(xs, ys)

R is empty.
The set Q consists of the following terms:

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

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

(10) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

(11) Obligation:

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

APPEND(cons(x, xs), ys) → APPEND(xs, ys)

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

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • APPEND(cons(x, xs), ys) → APPEND(xs, ys)
    The graph contains the following edges 1 > 1, 2 >= 2

(13) YES

(14) Obligation:

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

GE(s(x), s(y)) → GE(x, y)

The TRS R consists of the following rules:

qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(x, cons(x, xs))), cons(x, qsort(filterhigh(x, cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))

The set Q consists of the following terms:

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

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

(15) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(16) Obligation:

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

GE(s(x), s(y)) → GE(x, y)

R is empty.
The set Q consists of the following terms:

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

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

(17) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

(18) Obligation:

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

GE(s(x), s(y)) → GE(x, y)

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

(19) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • GE(s(x), s(y)) → GE(x, y)
    The graph contains the following edges 1 > 1, 2 > 2

(20) YES

(21) Obligation:

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

IF2(true, n, x, xs) → FILTERHIGH(n, xs)
FILTERHIGH(n, cons(x, xs)) → IF2(ge(x, n), n, x, xs)
IF2(false, n, x, xs) → FILTERHIGH(n, xs)

The TRS R consists of the following rules:

qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(x, cons(x, xs))), cons(x, qsort(filterhigh(x, cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))

The set Q consists of the following terms:

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

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

(22) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(23) Obligation:

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

IF2(true, n, x, xs) → FILTERHIGH(n, xs)
FILTERHIGH(n, cons(x, xs)) → IF2(ge(x, n), n, x, xs)
IF2(false, n, x, xs) → FILTERHIGH(n, xs)

The TRS R consists of the following rules:

ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)

The set Q consists of the following terms:

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

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

(24) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
append(nil, ys)
append(cons(x0, x1), ys)

(25) Obligation:

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

IF2(true, n, x, xs) → FILTERHIGH(n, xs)
FILTERHIGH(n, cons(x, xs)) → IF2(ge(x, n), n, x, xs)
IF2(false, n, x, xs) → FILTERHIGH(n, xs)

The TRS R consists of the following rules:

ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)

The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))

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

(26) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • FILTERHIGH(n, cons(x, xs)) → IF2(ge(x, n), n, x, xs)
    The graph contains the following edges 1 >= 2, 2 > 3, 2 > 4

  • IF2(true, n, x, xs) → FILTERHIGH(n, xs)
    The graph contains the following edges 2 >= 1, 4 >= 2

  • IF2(false, n, x, xs) → FILTERHIGH(n, xs)
    The graph contains the following edges 2 >= 1, 4 >= 2

(27) YES

(28) Obligation:

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

IF1(true, n, x, xs) → FILTERLOW(n, xs)
FILTERLOW(n, cons(x, xs)) → IF1(ge(n, x), n, x, xs)
IF1(false, n, x, xs) → FILTERLOW(n, xs)

The TRS R consists of the following rules:

qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(x, cons(x, xs))), cons(x, qsort(filterhigh(x, cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))

The set Q consists of the following terms:

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

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

(29) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(30) Obligation:

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

IF1(true, n, x, xs) → FILTERLOW(n, xs)
FILTERLOW(n, cons(x, xs)) → IF1(ge(n, x), n, x, xs)
IF1(false, n, x, xs) → FILTERLOW(n, xs)

The TRS R consists of the following rules:

ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)

The set Q consists of the following terms:

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

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

(31) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
append(nil, ys)
append(cons(x0, x1), ys)

(32) Obligation:

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

IF1(true, n, x, xs) → FILTERLOW(n, xs)
FILTERLOW(n, cons(x, xs)) → IF1(ge(n, x), n, x, xs)
IF1(false, n, x, xs) → FILTERLOW(n, xs)

The TRS R consists of the following rules:

ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)

The set Q consists of the following terms:

ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))

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

(33) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • FILTERLOW(n, cons(x, xs)) → IF1(ge(n, x), n, x, xs)
    The graph contains the following edges 1 >= 2, 2 > 3, 2 > 4

  • IF1(true, n, x, xs) → FILTERLOW(n, xs)
    The graph contains the following edges 2 >= 1, 4 >= 2

  • IF1(false, n, x, xs) → FILTERLOW(n, xs)
    The graph contains the following edges 2 >= 1, 4 >= 2

(34) YES

(35) Obligation:

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

QSORT(cons(x, xs)) → QSORT(filterhigh(x, cons(x, xs)))
QSORT(cons(x, xs)) → QSORT(filterlow(x, cons(x, xs)))

The TRS R consists of the following rules:

qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(x, cons(x, xs))), cons(x, qsort(filterhigh(x, cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))

The set Q consists of the following terms:

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

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

(36) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(37) Obligation:

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

QSORT(cons(x, xs)) → QSORT(filterhigh(x, cons(x, xs)))
QSORT(cons(x, xs)) → QSORT(filterlow(x, cons(x, xs)))

The TRS R consists of the following rules:

filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterlow(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
filterhigh(n, nil) → nil

The set Q consists of the following terms:

qsort(nil)
qsort(cons(x0, x1))
filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))
append(nil, ys)
append(cons(x0, x1), ys)

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

(38) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

qsort(nil)
qsort(cons(x0, x1))
append(nil, ys)
append(cons(x0, x1), ys)

(39) Obligation:

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

QSORT(cons(x, xs)) → QSORT(filterhigh(x, cons(x, xs)))
QSORT(cons(x, xs)) → QSORT(filterlow(x, cons(x, xs)))

The TRS R consists of the following rules:

filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterlow(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
filterhigh(n, nil) → nil

The set Q consists of the following terms:

filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))

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

(40) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule QSORT(cons(x, xs)) → QSORT(filterhigh(x, cons(x, xs))) at position [0] we obtained the following new rules [LPAR04]:

QSORT(cons(x, xs)) → QSORT(if2(ge(x, x), x, x, xs))

(41) Obligation:

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

QSORT(cons(x, xs)) → QSORT(filterlow(x, cons(x, xs)))
QSORT(cons(x, xs)) → QSORT(if2(ge(x, x), x, x, xs))

The TRS R consists of the following rules:

filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterlow(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
filterhigh(n, nil) → nil

The set Q consists of the following terms:

filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))

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

(42) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule QSORT(cons(x, xs)) → QSORT(filterlow(x, cons(x, xs))) at position [0] we obtained the following new rules [LPAR04]:

QSORT(cons(x, xs)) → QSORT(if1(ge(x, x), x, x, xs))

(43) Obligation:

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

QSORT(cons(x, xs)) → QSORT(if2(ge(x, x), x, x, xs))
QSORT(cons(x, xs)) → QSORT(if1(ge(x, x), x, x, xs))

The TRS R consists of the following rules:

filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterlow(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
filterhigh(n, nil) → nil

The set Q consists of the following terms:

filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))

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

(44) Induction-Processor (SOUND transformation)


This DP could be deleted by the Induction-Processor:
QSORT(cons(x, xs)) → QSORT(if2(ge(x, x), x, x, xs))


This order was computed:
Polynomial interpretation [POLO]:

POL(0) = 0   
POL(QSORT(x1)) = x1   
POL(cons(x1, x2)) = 1 + x2   
POL(false) = 0   
POL(filterhigh(x1, x2)) = x2   
POL(filterlow(x1, x2)) = x2   
POL(ge(x1, x2)) = 0   
POL(if1(x1, x2, x3, x4)) = 1 + x4   
POL(if2(x1, x2, x3, x4)) = 1 + x4   
POL(nil) = 0   
POL(s(x1)) = 0   
POL(true) = 0   

At least one of these decreasing rules is always used after the deleted DP:
if2(true, n652, x752, xs482) → filterhigh(n652, xs482)


The following formula is valid:
x:sort[a0],xs:sort[a2].if2'(ge(, ), , , xs )=true


The transformed set:
filterhigh'(n56, cons(x65, xs41)) → if2'(ge(x65, n56), n56, x65, xs41)
if2'(true, n65, x75, xs48) → true
if2'(false, n74, x85, xs55) → filterhigh'(n74, xs55)
filterhigh'(n83, nil) → false
if1(true, n, x, xs) → filterlow(n, xs)
filterlow(n4, cons(x5, xs2)) → if1(ge(n4, x5), n4, x5, xs2)
ge(x16, 0) → true
ge(0, s(x26)) → false
ge(s(x36), s(y2)) → ge(x36, y2)
if1(false, n38, x46, xs28) → cons(x46, filterlow(n38, xs28))
filterlow(n47, nil) → nil
filterhigh(n56, cons(x65, xs41)) → if2(ge(x65, n56), n56, x65, xs41)
if2(true, n65, x75, xs48) → filterhigh(n65, xs48)
if2(false, n74, x85, xs55) → cons(x85, filterhigh(n74, xs55))
filterhigh(n83, nil) → nil
equal_bool(true, false) → false
equal_bool(false, true) → false
equal_bool(true, true) → true
equal_bool(false, false) → true
and(true, x) → x
and(false, x) → false
or(true, x) → true
or(false, x) → x
not(false) → true
not(true) → false
isa_true(true) → true
isa_true(false) → false
isa_false(true) → false
isa_false(false) → true
equal_sort[a0](0, 0) → true
equal_sort[a0](0, s(x0)) → false
equal_sort[a0](s(x0), 0) → false
equal_sort[a0](s(x0), s(x1)) → equal_sort[a0](x0, x1)
equal_sort[a2](cons(x0, x1), cons(x2, x3)) → and(equal_sort[a2](x0, x2), equal_sort[a2](x1, x3))
equal_sort[a2](cons(x0, x1), nil) → false
equal_sort[a2](nil, cons(x0, x1)) → false
equal_sort[a2](nil, nil) → true
equal_sort[a55](witness_sort[a55], witness_sort[a55]) → true


The proof given by the theorem prover:
The following program was given to the internal theorem prover:
   [x, x0, x1, x2, x3, n65, x75, xs48, n74, x85, x65, xs41, n83, n56, x16, x26, x36, y2, n47, n4, x5, xs2, n, n38, x46]
   equal_bool(true, false) -> false
   equal_bool(false, true) -> false
   equal_bool(true, true) -> true
   equal_bool(false, false) -> true
   true and x -> x
   false and x -> false
   true or x -> true
   false or x -> x
   not(false) -> true
   not(true) -> false
   isa_true(true) -> true
   isa_true(false) -> false
   isa_false(true) -> false
   isa_false(false) -> true
   equal_sort[a0](0, 0) -> true
   equal_sort[a0](0, s(x0)) -> false
   equal_sort[a0](s(x0), 0) -> false
   equal_sort[a0](s(x0), s(x1)) -> equal_sort[a0](x0, x1)
   equal_sort[a2](cons(x0, x1), cons(x2, x3)) -> equal_sort[a2](x0, x2) and equal_sort[a2](x1, x3)
   equal_sort[a2](cons(x0, x1), nil) -> false
   equal_sort[a2](nil, cons(x0, x1)) -> false
   equal_sort[a2](nil, nil) -> true
   equal_sort[a55](witness_sort[a55], witness_sort[a55]) -> true
   if2'(true, n65, x75, xs48) -> true
   if2'(false, n74, x85, cons(x65, xs41)) -> if2'(ge(x65, n74), n74, x65, xs41)
   if2'(false, n74, x85, nil) -> false
   filterhigh'(n83, nil) -> false
   equal_bool(ge(x65, n56), true) -> true | filterhigh'(n56, cons(x65, xs41)) -> true
   equal_bool(ge(x65, n56), true) -> false | filterhigh'(n56, cons(x65, xs41)) -> filterhigh'(n56, xs41)
   ge(x16, 0) -> true
   ge(0, s(x26)) -> false
   ge(s(x36), s(y2)) -> ge(x36, y2)
   filterlow(n47, nil) -> nil
   equal_bool(ge(n4, x5), true) -> true | filterlow(n4, cons(x5, xs2)) -> filterlow(n4, xs2)
   equal_bool(ge(n4, x5), true) -> false | filterlow(n4, cons(x5, xs2)) -> cons(x5, filterlow(n4, xs2))
   filterhigh(n83, nil) -> nil
   equal_bool(ge(x65, n56), true) -> true | filterhigh(n56, cons(x65, xs41)) -> filterhigh(n56, xs41)
   equal_bool(ge(x65, n56), true) -> false | filterhigh(n56, cons(x65, xs41)) -> cons(x65, filterhigh(n56, xs41))
   if1(true, n, x, cons(x5, xs2)) -> if1(ge(n, x5), n, x5, xs2)
   if1(true, n, x, nil) -> nil
   if1(false, n38, x46, cons(x5, xs2)) -> cons(x46, if1(ge(n38, x5), n38, x5, xs2))
   if1(false, n38, x46, nil) -> cons(x46, nil)
   if2(true, n65, x75, cons(x65, xs41)) -> if2(ge(x65, n65), n65, x65, xs41)
   if2(true, n65, x75, nil) -> nil
   if2(false, n74, x85, cons(x65, xs41)) -> cons(x85, if2(ge(x65, n74), n74, x65, xs41))
   if2(false, n74, x85, nil) -> cons(x85, nil)


The following output was given by the internal theorem prover:
proof of internal
# AProVE Commit ID: 9a00b172b26c9abb2d4c4d5eaf341e919eb0fbf1 nowonder 20100222 unpublished dirty


Partial correctness of the following Program

   [x, x0, x1, x2, x3, n65, x75, xs48, n74, x85, x65, xs41, n83, n56, x16, x26, x36, y2, n47, n4, x5, xs2, n, n38, x46]
   equal_bool(true, false) -> false
   equal_bool(false, true) -> false
   equal_bool(true, true) -> true
   equal_bool(false, false) -> true
   true and x -> x
   false and x -> false
   true or x -> true
   false or x -> x
   not(false) -> true
   not(true) -> false
   isa_true(true) -> true
   isa_true(false) -> false
   isa_false(true) -> false
   isa_false(false) -> true
   equal_sort[a0](0, 0) -> true
   equal_sort[a0](0, s(x0)) -> false
   equal_sort[a0](s(x0), 0) -> false
   equal_sort[a0](s(x0), s(x1)) -> equal_sort[a0](x0, x1)
   equal_sort[a2](cons(x0, x1), cons(x2, x3)) -> equal_sort[a2](x0, x2) and equal_sort[a2](x1, x3)
   equal_sort[a2](cons(x0, x1), nil) -> false
   equal_sort[a2](nil, cons(x0, x1)) -> false
   equal_sort[a2](nil, nil) -> true
   equal_sort[a55](witness_sort[a55], witness_sort[a55]) -> true
   if2'(true, n65, x75, xs48) -> true
   if2'(false, n74, x85, cons(x65, xs41)) -> if2'(ge(x65, n74), n74, x65, xs41)
   if2'(false, n74, x85, nil) -> false
   filterhigh'(n83, nil) -> false
   equal_bool(ge(x65, n56), true) -> true | filterhigh'(n56, cons(x65, xs41)) -> true
   equal_bool(ge(x65, n56), true) -> false | filterhigh'(n56, cons(x65, xs41)) -> filterhigh'(n56, xs41)
   ge(x16, 0) -> true
   ge(0, s(x26)) -> false
   ge(s(x36), s(y2)) -> ge(x36, y2)
   filterlow(n47, nil) -> nil
   equal_bool(ge(n4, x5), true) -> true | filterlow(n4, cons(x5, xs2)) -> filterlow(n4, xs2)
   equal_bool(ge(n4, x5), true) -> false | filterlow(n4, cons(x5, xs2)) -> cons(x5, filterlow(n4, xs2))
   filterhigh(n83, nil) -> nil
   equal_bool(ge(x65, n56), true) -> true | filterhigh(n56, cons(x65, xs41)) -> filterhigh(n56, xs41)
   equal_bool(ge(x65, n56), true) -> false | filterhigh(n56, cons(x65, xs41)) -> cons(x65, filterhigh(n56, xs41))
   if1(true, n, x, cons(x5, xs2)) -> if1(ge(n, x5), n, x5, xs2)
   if1(true, n, x, nil) -> nil
   if1(false, n38, x46, cons(x5, xs2)) -> cons(x46, if1(ge(n38, x5), n38, x5, xs2))
   if1(false, n38, x46, nil) -> cons(x46, nil)
   if2(true, n65, x75, cons(x65, xs41)) -> if2(ge(x65, n65), n65, x65, xs41)
   if2(true, n65, x75, nil) -> nil
   if2(false, n74, x85, cons(x65, xs41)) -> cons(x85, if2(ge(x65, n74), n74, x65, xs41))
   if2(false, n74, x85, nil) -> cons(x85, nil)

using the following formula:
x:sort[a0],xs:sort[a2].if2'(ge(x, x), x, x, xs)=true

could be successfully shown:
(0) Formula
(1) Induction by data structure [EQUIVALENT]
(2) AND
    (3) Formula
        (4) Symbolic evaluation [EQUIVALENT]
        (5) YES
    (6) Formula
        (7) Symbolic evaluation [EQUIVALENT]
        (8) Formula
        (9) Case Analysis [EQUIVALENT]
        (10) AND
            (11) Formula
                (12) Inverse Substitution [SOUND]
                (13) Formula
                (14) Induction by data structure [SOUND]
                (15) AND
                    (16) Formula
                        (17) Symbolic evaluation [EQUIVALENT]
                        (18) YES
                    (19) Formula
                        (20) Symbolic evaluation under hypothesis [EQUIVALENT]
                        (21) YES
            (22) Formula
                (23) Inverse Substitution [SOUND]
                (24) Formula
                (25) Induction by data structure [SOUND]
                (26) AND
                    (27) Formula
                        (28) Symbolic evaluation [EQUIVALENT]
                        (29) YES
                    (30) Formula
                        (31) Symbolic evaluation under hypothesis [EQUIVALENT]
                        (32) YES


----------------------------------------

(0)
Obligation:
Formula:
x:sort[a0],xs:sort[a2].if2'(ge(x, x), x, x, xs)=true

There are no hypotheses.




----------------------------------------

(1) Induction by data structure (EQUIVALENT)
Induction by data structure sort[a0] generates the following cases:



1. Base Case:
Formula:
xs:sort[a2].if2'(ge(0, 0), 0, 0, xs)=true

There are no hypotheses.





1. Step Case:
Formula:
n:sort[a0],xs:sort[a2].if2'(ge(s(n), s(n)), s(n), s(n), xs)=true

Hypotheses:
n:sort[a0],!xs:sort[a2].if2'(ge(n, n), n, n, xs)=true






----------------------------------------

(2)
Complex Obligation (AND)

----------------------------------------

(3)
Obligation:
Formula:
xs:sort[a2].if2'(ge(0, 0), 0, 0, xs)=true

There are no hypotheses.




----------------------------------------

(4) Symbolic evaluation (EQUIVALENT)
Could be reduced to the following new obligation by simple symbolic evaluation:
True
----------------------------------------

(5)
YES

----------------------------------------

(6)
Obligation:
Formula:
n:sort[a0],xs:sort[a2].if2'(ge(s(n), s(n)), s(n), s(n), xs)=true

Hypotheses:
n:sort[a0],!xs:sort[a2].if2'(ge(n, n), n, n, xs)=true




----------------------------------------

(7) Symbolic evaluation (EQUIVALENT)
Could be reduced to the following new obligation by simple symbolic evaluation:
n:sort[a0],xs:sort[a2].if2'(ge(n, n), s(n), s(n), xs)=true
----------------------------------------

(8)
Obligation:
Formula:
n:sort[a0],xs:sort[a2].if2'(ge(n, n), s(n), s(n), xs)=true

Hypotheses:
n:sort[a0],!xs:sort[a2].if2'(ge(n, n), n, n, xs)=true




----------------------------------------

(9) Case Analysis (EQUIVALENT)
Case analysis leads to the following new obligations:

Formula:
n:sort[a0],x_1:sort[a0],x_2:sort[a2].if2'(ge(n, n), s(n), s(n), cons(x_1, x_2))=true

Hypotheses:
n:sort[a0],!xs:sort[a2].if2'(ge(n, n), n, n, xs)=true





Formula:
n:sort[a0].if2'(ge(n, n), s(n), s(n), nil)=true

Hypotheses:
n:sort[a0],!xs:sort[a2].if2'(ge(n, n), n, n, xs)=true






----------------------------------------

(10)
Complex Obligation (AND)

----------------------------------------

(11)
Obligation:
Formula:
n:sort[a0],x_1:sort[a0],x_2:sort[a2].if2'(ge(n, n), s(n), s(n), cons(x_1, x_2))=true

Hypotheses:
n:sort[a0],!xs:sort[a2].if2'(ge(n, n), n, n, xs)=true




----------------------------------------

(12) Inverse Substitution (SOUND)
The formula could be generalised by inverse substitution to:
n:sort[a0],n':sort[a0],x_1:sort[a0],x_2:sort[a2].if2'(ge(n, n), n', n', cons(x_1, x_2))=true

Inverse substitution used:
[s(n)/n']


----------------------------------------

(13)
Obligation:
Formula:
n:sort[a0],n':sort[a0],x_1:sort[a0],x_2:sort[a2].if2'(ge(n, n), n', n', cons(x_1, x_2))=true

Hypotheses:
n:sort[a0],!xs:sort[a2].if2'(ge(n, n), n, n, xs)=true




----------------------------------------

(14) Induction by data structure (SOUND)
Induction by data structure sort[a0] generates the following cases:



1. Base Case:
Formula:
n':sort[a0],x_1:sort[a0],x_2:sort[a2].if2'(ge(0, 0), n', n', cons(x_1, x_2))=true

There are no hypotheses.





1. Step Case:
Formula:
n'':sort[a0],n':sort[a0],x_1:sort[a0],x_2:sort[a2].if2'(ge(s(n''), s(n'')), n', n', cons(x_1, x_2))=true

Hypotheses:
n'':sort[a0],!n':sort[a0],!x_1:sort[a0],!x_2:sort[a2].if2'(ge(n'', n''), n', n', cons(x_1, x_2))=true






----------------------------------------

(15)
Complex Obligation (AND)

----------------------------------------

(16)
Obligation:
Formula:
n':sort[a0],x_1:sort[a0],x_2:sort[a2].if2'(ge(0, 0), n', n', cons(x_1, x_2))=true

There are no hypotheses.




----------------------------------------

(17) Symbolic evaluation (EQUIVALENT)
Could be reduced to the following new obligation by simple symbolic evaluation:
True
----------------------------------------

(18)
YES

----------------------------------------

(19)
Obligation:
Formula:
n'':sort[a0],n':sort[a0],x_1:sort[a0],x_2:sort[a2].if2'(ge(s(n''), s(n'')), n', n', cons(x_1, x_2))=true

Hypotheses:
n'':sort[a0],!n':sort[a0],!x_1:sort[a0],!x_2:sort[a2].if2'(ge(n'', n''), n', n', cons(x_1, x_2))=true




----------------------------------------

(20) Symbolic evaluation under hypothesis (EQUIVALENT)
Could be shown using symbolic evaluation under hypothesis, by using the following hypotheses:

n'':sort[a0],!n':sort[a0],!x_1:sort[a0],!x_2:sort[a2].if2'(ge(n'', n''), n', n', cons(x_1, x_2))=true

----------------------------------------

(21)
YES

----------------------------------------

(22)
Obligation:
Formula:
n:sort[a0].if2'(ge(n, n), s(n), s(n), nil)=true

Hypotheses:
n:sort[a0],!xs:sort[a2].if2'(ge(n, n), n, n, xs)=true




----------------------------------------

(23) Inverse Substitution (SOUND)
The formula could be generalised by inverse substitution to:
n:sort[a0],n':sort[a0].if2'(ge(n, n), n', n', nil)=true

Inverse substitution used:
[s(n)/n']


----------------------------------------

(24)
Obligation:
Formula:
n:sort[a0],n':sort[a0].if2'(ge(n, n), n', n', nil)=true

Hypotheses:
n:sort[a0],!xs:sort[a2].if2'(ge(n, n), n, n, xs)=true




----------------------------------------

(25) Induction by data structure (SOUND)
Induction by data structure sort[a0] generates the following cases:



1. Base Case:
Formula:
n':sort[a0].if2'(ge(0, 0), n', n', nil)=true

There are no hypotheses.





1. Step Case:
Formula:
n'':sort[a0],n':sort[a0].if2'(ge(s(n''), s(n'')), n', n', nil)=true

Hypotheses:
n'':sort[a0],!n':sort[a0].if2'(ge(n'', n''), n', n', nil)=true






----------------------------------------

(26)
Complex Obligation (AND)

----------------------------------------

(27)
Obligation:
Formula:
n':sort[a0].if2'(ge(0, 0), n', n', nil)=true

There are no hypotheses.




----------------------------------------

(28) Symbolic evaluation (EQUIVALENT)
Could be reduced to the following new obligation by simple symbolic evaluation:
True
----------------------------------------

(29)
YES

----------------------------------------

(30)
Obligation:
Formula:
n'':sort[a0],n':sort[a0].if2'(ge(s(n''), s(n'')), n', n', nil)=true

Hypotheses:
n'':sort[a0],!n':sort[a0].if2'(ge(n'', n''), n', n', nil)=true




----------------------------------------

(31) Symbolic evaluation under hypothesis (EQUIVALENT)
Could be shown using symbolic evaluation under hypothesis, by using the following hypotheses:

n'':sort[a0],!n':sort[a0].if2'(ge(n'', n''), n', n', nil)=true

----------------------------------------

(32)
YES

(45) Complex Obligation (AND)

(46) Obligation:

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

QSORT(cons(x, xs)) → QSORT(if1(ge(x, x), x, x, xs))

The TRS R consists of the following rules:

filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterlow(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
filterhigh(n, nil) → nil

The set Q consists of the following terms:

filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))

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

(47) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(48) Obligation:

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

QSORT(cons(x, xs)) → QSORT(if1(ge(x, x), x, x, xs))

The TRS R consists of the following rules:

ge(x, 0) → true
ge(s(x), s(y)) → ge(x, y)
if1(true, n, x, xs) → filterlow(n, xs)
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterlow(n, nil) → nil
ge(0, s(x)) → false

The set Q consists of the following terms:

filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))

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

(49) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

filterhigh(x0, nil)
filterhigh(x0, cons(x1, x2))
if2(true, x0, x1, x2)
if2(false, x0, x1, x2)

(50) Obligation:

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

QSORT(cons(x, xs)) → QSORT(if1(ge(x, x), x, x, xs))

The TRS R consists of the following rules:

ge(x, 0) → true
ge(s(x), s(y)) → ge(x, y)
if1(true, n, x, xs) → filterlow(n, xs)
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterlow(n, nil) → nil
ge(0, s(x)) → false

The set Q consists of the following terms:

filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))

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

(51) Induction-Processor (SOUND transformation)


This DP could be deleted by the Induction-Processor:
QSORT(cons(x, xs)) → QSORT(if1(ge(x, x), x, x, xs))


This order was computed:
Polynomial interpretation [POLO]:

POL(0) = 1   
POL(QSORT(x1)) = x1   
POL(cons(x1, x2)) = 1 + x2   
POL(false) = 0   
POL(filterlow(x1, x2)) = x2   
POL(ge(x1, x2)) = x2   
POL(if1(x1, x2, x3, x4)) = 1 + x4   
POL(nil) = 1   
POL(s(x1)) = x1   
POL(true) = 1   

At least one of these decreasing rules is always used after the deleted DP:
if1(true, n6'', x12'', xs4'') → filterlow(n6'', xs4'')


The following formula is valid:
x:sort[a0],xs:sort[a5].if1'(ge(, ), , , xs )=true


The transformed set:
if1'(true, n6, x12, xs4) → true
filterlow'(n11, cons(x19, xs8)) → if1'(ge(n11, x19), n11, x19, xs8)
if1'(false, n16, x26, xs12) → filterlow'(n16, xs12)
filterlow'(n21, nil) → false
ge(x, 0) → true
ge(s(x5), s(y')) → ge(x5, y')
if1(true, n6, x12, xs4) → filterlow(n6, xs4)
filterlow(n11, cons(x19, xs8)) → if1(ge(n11, x19), n11, x19, xs8)
if1(false, n16, x26, xs12) → cons(x26, filterlow(n16, xs12))
filterlow(n21, nil) → nil
ge(0, s(x39)) → false
equal_bool(true, false) → false
equal_bool(false, true) → false
equal_bool(true, true) → true
equal_bool(false, false) → true
and(true, x) → x
and(false, x) → false
or(true, x) → true
or(false, x) → x
not(false) → true
not(true) → false
isa_true(true) → true
isa_true(false) → false
isa_false(true) → false
isa_false(false) → true
equal_sort[a0](0, 0) → true
equal_sort[a0](0, s(x0)) → false
equal_sort[a0](s(x0), 0) → false
equal_sort[a0](s(x0), s(x1)) → equal_sort[a0](x0, x1)
equal_sort[a5](cons(x0, x1), cons(x2, x3)) → and(equal_sort[a5](x0, x2), equal_sort[a5](x1, x3))
equal_sort[a5](cons(x0, x1), nil) → false
equal_sort[a5](nil, cons(x0, x1)) → false
equal_sort[a5](nil, nil) → true
equal_sort[a36](witness_sort[a36], witness_sort[a36]) → true


The proof given by the theorem prover:
The following program was given to the internal theorem prover:
   [x, x0, x1, x2, x3, n6, x12, xs4, n16, x26, x19, xs8, n21, n11, x5, y', x39]
   equal_bool(true, false) -> false
   equal_bool(false, true) -> false
   equal_bool(true, true) -> true
   equal_bool(false, false) -> true
   true and x -> x
   false and x -> false
   true or x -> true
   false or x -> x
   not(false) -> true
   not(true) -> false
   isa_true(true) -> true
   isa_true(false) -> false
   isa_false(true) -> false
   isa_false(false) -> true
   equal_sort[a0](0, 0) -> true
   equal_sort[a0](0, s(x0)) -> false
   equal_sort[a0](s(x0), 0) -> false
   equal_sort[a0](s(x0), s(x1)) -> equal_sort[a0](x0, x1)
   equal_sort[a5](cons(x0, x1), cons(x2, x3)) -> equal_sort[a5](x0, x2) and equal_sort[a5](x1, x3)
   equal_sort[a5](cons(x0, x1), nil) -> false
   equal_sort[a5](nil, cons(x0, x1)) -> false
   equal_sort[a5](nil, nil) -> true
   equal_sort[a36](witness_sort[a36], witness_sort[a36]) -> true
   if1'(true, n6, x12, xs4) -> true
   if1'(false, n16, x26, cons(x19, xs8)) -> if1'(ge(n16, x19), n16, x19, xs8)
   if1'(false, n16, x26, nil) -> false
   filterlow'(n21, nil) -> false
   equal_bool(ge(n11, x19), true) -> true | filterlow'(n11, cons(x19, xs8)) -> true
   equal_bool(ge(n11, x19), true) -> false | filterlow'(n11, cons(x19, xs8)) -> filterlow'(n11, xs8)
   ge(x, 0) -> true
   ge(s(x5), s(y')) -> ge(x5, y')
   ge(0, s(x39)) -> false
   filterlow(n21, nil) -> nil
   equal_bool(ge(n11, x19), true) -> true | filterlow(n11, cons(x19, xs8)) -> filterlow(n11, xs8)
   equal_bool(ge(n11, x19), true) -> false | filterlow(n11, cons(x19, xs8)) -> cons(x19, filterlow(n11, xs8))
   if1(true, n6, x12, cons(x19, xs8)) -> if1(ge(n6, x19), n6, x19, xs8)
   if1(true, n6, x12, nil) -> nil
   if1(false, n16, x26, cons(x19, xs8)) -> cons(x26, if1(ge(n16, x19), n16, x19, xs8))
   if1(false, n16, x26, nil) -> cons(x26, nil)


The following output was given by the internal theorem prover:
proof of internal
# AProVE Commit ID: 9a00b172b26c9abb2d4c4d5eaf341e919eb0fbf1 nowonder 20100222 unpublished dirty


Partial correctness of the following Program

   [x, x0, x1, x2, x3, n6, x12, xs4, n16, x26, x19, xs8, n21, n11, x5, y', x39]
   equal_bool(true, false) -> false
   equal_bool(false, true) -> false
   equal_bool(true, true) -> true
   equal_bool(false, false) -> true
   true and x -> x
   false and x -> false
   true or x -> true
   false or x -> x
   not(false) -> true
   not(true) -> false
   isa_true(true) -> true
   isa_true(false) -> false
   isa_false(true) -> false
   isa_false(false) -> true
   equal_sort[a0](0, 0) -> true
   equal_sort[a0](0, s(x0)) -> false
   equal_sort[a0](s(x0), 0) -> false
   equal_sort[a0](s(x0), s(x1)) -> equal_sort[a0](x0, x1)
   equal_sort[a5](cons(x0, x1), cons(x2, x3)) -> equal_sort[a5](x0, x2) and equal_sort[a5](x1, x3)
   equal_sort[a5](cons(x0, x1), nil) -> false
   equal_sort[a5](nil, cons(x0, x1)) -> false
   equal_sort[a5](nil, nil) -> true
   equal_sort[a36](witness_sort[a36], witness_sort[a36]) -> true
   if1'(true, n6, x12, xs4) -> true
   if1'(false, n16, x26, cons(x19, xs8)) -> if1'(ge(n16, x19), n16, x19, xs8)
   if1'(false, n16, x26, nil) -> false
   filterlow'(n21, nil) -> false
   equal_bool(ge(n11, x19), true) -> true | filterlow'(n11, cons(x19, xs8)) -> true
   equal_bool(ge(n11, x19), true) -> false | filterlow'(n11, cons(x19, xs8)) -> filterlow'(n11, xs8)
   ge(x, 0) -> true
   ge(s(x5), s(y')) -> ge(x5, y')
   ge(0, s(x39)) -> false
   filterlow(n21, nil) -> nil
   equal_bool(ge(n11, x19), true) -> true | filterlow(n11, cons(x19, xs8)) -> filterlow(n11, xs8)
   equal_bool(ge(n11, x19), true) -> false | filterlow(n11, cons(x19, xs8)) -> cons(x19, filterlow(n11, xs8))
   if1(true, n6, x12, cons(x19, xs8)) -> if1(ge(n6, x19), n6, x19, xs8)
   if1(true, n6, x12, nil) -> nil
   if1(false, n16, x26, cons(x19, xs8)) -> cons(x26, if1(ge(n16, x19), n16, x19, xs8))
   if1(false, n16, x26, nil) -> cons(x26, nil)

using the following formula:
x:sort[a0],xs:sort[a5].if1'(ge(x, x), x, x, xs)=true

could be successfully shown:
(0) Formula
(1) Induction by data structure [EQUIVALENT]
(2) AND
    (3) Formula
        (4) Symbolic evaluation [EQUIVALENT]
        (5) YES
    (6) Formula
        (7) Symbolic evaluation [EQUIVALENT]
        (8) Formula
        (9) Case Analysis [EQUIVALENT]
        (10) AND
            (11) Formula
                (12) Inverse Substitution [SOUND]
                (13) Formula
                (14) Induction by data structure [SOUND]
                (15) AND
                    (16) Formula
                        (17) Symbolic evaluation [EQUIVALENT]
                        (18) YES
                    (19) Formula
                        (20) Symbolic evaluation under hypothesis [EQUIVALENT]
                        (21) YES
            (22) Formula
                (23) Inverse Substitution [SOUND]
                (24) Formula
                (25) Induction by data structure [SOUND]
                (26) AND
                    (27) Formula
                        (28) Symbolic evaluation [EQUIVALENT]
                        (29) YES
                    (30) Formula
                        (31) Symbolic evaluation under hypothesis [EQUIVALENT]
                        (32) YES


----------------------------------------

(0)
Obligation:
Formula:
x:sort[a0],xs:sort[a5].if1'(ge(x, x), x, x, xs)=true

There are no hypotheses.




----------------------------------------

(1) Induction by data structure (EQUIVALENT)
Induction by data structure sort[a0] generates the following cases:



1. Base Case:
Formula:
xs:sort[a5].if1'(ge(0, 0), 0, 0, xs)=true

There are no hypotheses.





1. Step Case:
Formula:
n:sort[a0],xs:sort[a5].if1'(ge(s(n), s(n)), s(n), s(n), xs)=true

Hypotheses:
n:sort[a0],!xs:sort[a5].if1'(ge(n, n), n, n, xs)=true






----------------------------------------

(2)
Complex Obligation (AND)

----------------------------------------

(3)
Obligation:
Formula:
xs:sort[a5].if1'(ge(0, 0), 0, 0, xs)=true

There are no hypotheses.




----------------------------------------

(4) Symbolic evaluation (EQUIVALENT)
Could be reduced to the following new obligation by simple symbolic evaluation:
True
----------------------------------------

(5)
YES

----------------------------------------

(6)
Obligation:
Formula:
n:sort[a0],xs:sort[a5].if1'(ge(s(n), s(n)), s(n), s(n), xs)=true

Hypotheses:
n:sort[a0],!xs:sort[a5].if1'(ge(n, n), n, n, xs)=true




----------------------------------------

(7) Symbolic evaluation (EQUIVALENT)
Could be reduced to the following new obligation by simple symbolic evaluation:
n:sort[a0],xs:sort[a5].if1'(ge(n, n), s(n), s(n), xs)=true
----------------------------------------

(8)
Obligation:
Formula:
n:sort[a0],xs:sort[a5].if1'(ge(n, n), s(n), s(n), xs)=true

Hypotheses:
n:sort[a0],!xs:sort[a5].if1'(ge(n, n), n, n, xs)=true




----------------------------------------

(9) Case Analysis (EQUIVALENT)
Case analysis leads to the following new obligations:

Formula:
n:sort[a0],x_1:sort[a0],x_2:sort[a5].if1'(ge(n, n), s(n), s(n), cons(x_1, x_2))=true

Hypotheses:
n:sort[a0],!xs:sort[a5].if1'(ge(n, n), n, n, xs)=true





Formula:
n:sort[a0].if1'(ge(n, n), s(n), s(n), nil)=true

Hypotheses:
n:sort[a0],!xs:sort[a5].if1'(ge(n, n), n, n, xs)=true






----------------------------------------

(10)
Complex Obligation (AND)

----------------------------------------

(11)
Obligation:
Formula:
n:sort[a0],x_1:sort[a0],x_2:sort[a5].if1'(ge(n, n), s(n), s(n), cons(x_1, x_2))=true

Hypotheses:
n:sort[a0],!xs:sort[a5].if1'(ge(n, n), n, n, xs)=true




----------------------------------------

(12) Inverse Substitution (SOUND)
The formula could be generalised by inverse substitution to:
n:sort[a0],n':sort[a0],x_1:sort[a0],x_2:sort[a5].if1'(ge(n, n), n', n', cons(x_1, x_2))=true

Inverse substitution used:
[s(n)/n']


----------------------------------------

(13)
Obligation:
Formula:
n:sort[a0],n':sort[a0],x_1:sort[a0],x_2:sort[a5].if1'(ge(n, n), n', n', cons(x_1, x_2))=true

Hypotheses:
n:sort[a0],!xs:sort[a5].if1'(ge(n, n), n, n, xs)=true




----------------------------------------

(14) Induction by data structure (SOUND)
Induction by data structure sort[a0] generates the following cases:



1. Base Case:
Formula:
n':sort[a0],x_1:sort[a0],x_2:sort[a5].if1'(ge(0, 0), n', n', cons(x_1, x_2))=true

There are no hypotheses.





1. Step Case:
Formula:
n'':sort[a0],n':sort[a0],x_1:sort[a0],x_2:sort[a5].if1'(ge(s(n''), s(n'')), n', n', cons(x_1, x_2))=true

Hypotheses:
n'':sort[a0],!n':sort[a0],!x_1:sort[a0],!x_2:sort[a5].if1'(ge(n'', n''), n', n', cons(x_1, x_2))=true






----------------------------------------

(15)
Complex Obligation (AND)

----------------------------------------

(16)
Obligation:
Formula:
n':sort[a0],x_1:sort[a0],x_2:sort[a5].if1'(ge(0, 0), n', n', cons(x_1, x_2))=true

There are no hypotheses.




----------------------------------------

(17) Symbolic evaluation (EQUIVALENT)
Could be reduced to the following new obligation by simple symbolic evaluation:
True
----------------------------------------

(18)
YES

----------------------------------------

(19)
Obligation:
Formula:
n'':sort[a0],n':sort[a0],x_1:sort[a0],x_2:sort[a5].if1'(ge(s(n''), s(n'')), n', n', cons(x_1, x_2))=true

Hypotheses:
n'':sort[a0],!n':sort[a0],!x_1:sort[a0],!x_2:sort[a5].if1'(ge(n'', n''), n', n', cons(x_1, x_2))=true




----------------------------------------

(20) Symbolic evaluation under hypothesis (EQUIVALENT)
Could be shown using symbolic evaluation under hypothesis, by using the following hypotheses:

n'':sort[a0],!n':sort[a0],!x_1:sort[a0],!x_2:sort[a5].if1'(ge(n'', n''), n', n', cons(x_1, x_2))=true

----------------------------------------

(21)
YES

----------------------------------------

(22)
Obligation:
Formula:
n:sort[a0].if1'(ge(n, n), s(n), s(n), nil)=true

Hypotheses:
n:sort[a0],!xs:sort[a5].if1'(ge(n, n), n, n, xs)=true




----------------------------------------

(23) Inverse Substitution (SOUND)
The formula could be generalised by inverse substitution to:
n:sort[a0],n':sort[a0].if1'(ge(n, n), n', n', nil)=true

Inverse substitution used:
[s(n)/n']


----------------------------------------

(24)
Obligation:
Formula:
n:sort[a0],n':sort[a0].if1'(ge(n, n), n', n', nil)=true

Hypotheses:
n:sort[a0],!xs:sort[a5].if1'(ge(n, n), n, n, xs)=true




----------------------------------------

(25) Induction by data structure (SOUND)
Induction by data structure sort[a0] generates the following cases:



1. Base Case:
Formula:
n':sort[a0].if1'(ge(0, 0), n', n', nil)=true

There are no hypotheses.





1. Step Case:
Formula:
n'':sort[a0],n':sort[a0].if1'(ge(s(n''), s(n'')), n', n', nil)=true

Hypotheses:
n'':sort[a0],!n':sort[a0].if1'(ge(n'', n''), n', n', nil)=true






----------------------------------------

(26)
Complex Obligation (AND)

----------------------------------------

(27)
Obligation:
Formula:
n':sort[a0].if1'(ge(0, 0), n', n', nil)=true

There are no hypotheses.




----------------------------------------

(28) Symbolic evaluation (EQUIVALENT)
Could be reduced to the following new obligation by simple symbolic evaluation:
True
----------------------------------------

(29)
YES

----------------------------------------

(30)
Obligation:
Formula:
n'':sort[a0],n':sort[a0].if1'(ge(s(n''), s(n'')), n', n', nil)=true

Hypotheses:
n'':sort[a0],!n':sort[a0].if1'(ge(n'', n''), n', n', nil)=true




----------------------------------------

(31) Symbolic evaluation under hypothesis (EQUIVALENT)
Could be shown using symbolic evaluation under hypothesis, by using the following hypotheses:

n'':sort[a0],!n':sort[a0].if1'(ge(n'', n''), n', n', nil)=true

----------------------------------------

(32)
YES

(52) Complex Obligation (AND)

(53) Obligation:

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

ge(x, 0) → true
ge(s(x), s(y)) → ge(x, y)
if1(true, n, x, xs) → filterlow(n, xs)
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterlow(n, nil) → nil
ge(0, s(x)) → false

The set Q consists of the following terms:

filterlow(x0, nil)
filterlow(x0, cons(x1, x2))
if1(true, x0, x1, x2)
if1(false, x0, x1, x2)
ge(x0, 0)
ge(0, s(x0))
ge(s(x0), s(x1))

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

(54) PisEmptyProof (EQUIVALENT transformation)

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

(55) YES

(56) Obligation:

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

if1'(true, n6, x12, xs4) → true
filterlow'(n11, cons(x19, xs8)) → if1'(ge(n11, x19), n11, x19, xs8)
if1'(false, n16, x26, xs12) → filterlow'(n16, xs12)
filterlow'(n21, nil) → false
ge(x, 0) → true
ge(s(x5), s(y')) → ge(x5, y')
if1(true, n6, x12, xs4) → filterlow(n6, xs4)
filterlow(n11, cons(x19, xs8)) → if1(ge(n11, x19), n11, x19, xs8)
if1(false, n16, x26, xs12) → cons(x26, filterlow(n16, xs12))
filterlow(n21, nil) → nil
ge(0, s(x39)) → false
equal_bool(true, false) → false
equal_bool(false, true) → false
equal_bool(true, true) → true
equal_bool(false, false) → true
and(true, x) → x
and(false, x) → false
or(true, x) → true
or(false, x) → x
not(false) → true
not(true) → false
isa_true(true) → true
isa_true(false) → false
isa_false(true) → false
isa_false(false) → true
equal_sort[a0](0, 0) → true
equal_sort[a0](0, s(x0)) → false
equal_sort[a0](s(x0), 0) → false
equal_sort[a0](s(x0), s(x1)) → equal_sort[a0](x0, x1)
equal_sort[a5](cons(x0, x1), cons(x2, x3)) → and(equal_sort[a5](x0, x2), equal_sort[a5](x1, x3))
equal_sort[a5](cons(x0, x1), nil) → false
equal_sort[a5](nil, cons(x0, x1)) → false
equal_sort[a5](nil, nil) → true
equal_sort[a36](witness_sort[a36], witness_sort[a36]) → true

Q is empty.

(57) QTRSRRRProof (EQUIVALENT transformation)

Used ordering:
Combined order from the following AFS and order.
if1'(x1, x2, x3, x4)  =  if1'(x1, x2, x3, x4)
true  =  true
filterlow'(x1, x2)  =  filterlow'(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
ge(x1, x2)  =  ge(x1, x2)
false  =  false
nil  =  nil
0  =  0
s(x1)  =  x1
if1(x1, x2, x3, x4)  =  if1(x1, x2, x3, x4)
filterlow(x1, x2)  =  filterlow(x1, x2)
equal_bool(x1, x2)  =  equal_bool(x1, x2)
and(x1, x2)  =  and(x1, x2)
or(x1, x2)  =  or(x1, x2)
not(x1)  =  not(x1)
isa_true(x1)  =  isa_true(x1)
isa_false(x1)  =  isa_false(x1)
equal_sort[a0](x1, x2)  =  equal_sort[a0](x1, x2)
equal_sort[a5](x1, x2)  =  equal_sort[a5](x1, x2)
equal_sort[a36](x1, x2)  =  equal_sort[a36](x1, x2)
witness_sort[a36]  =  witness_sort[a36]

Recursive path order with status [RPO].
Quasi-Precedence:
[if1'4, filterlow'2] > [true, ge2, if14, filterlow2, equalbool2, isafalse1] > [cons2, and2] > false
nil > [true, ge2, if14, filterlow2, equalbool2, isafalse1] > [cons2, and2] > false
0 > false
or2 > false
not1 > [true, ge2, if14, filterlow2, equalbool2, isafalse1] > [cons2, and2] > false
isatrue1 > false
equalsort[a0]2 > [true, ge2, if14, filterlow2, equalbool2, isafalse1] > [cons2, and2] > false
equalsort[a5]2 > [cons2, and2] > false
equalsort[a36]2 > [true, ge2, if14, filterlow2, equalbool2, isafalse1] > [cons2, and2] > false
witnesssort[a36] > false

Status:
if1'4: [2,4,3,1]
true: multiset
filterlow'2: [1,2]
cons2: multiset
ge2: [1,2]
false: multiset
nil: multiset
0: multiset
if14: [2,4,1,3]
filterlow2: [1,2]
equalbool2: [1,2]
and2: multiset
or2: multiset
not1: multiset
isatrue1: multiset
isafalse1: [1]
equalsort[a0]2: multiset
equalsort[a5]2: [2,1]
equalsort[a36]2: multiset
witnesssort[a36]: multiset

With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:

if1'(true, n6, x12, xs4) → true
filterlow'(n11, cons(x19, xs8)) → if1'(ge(n11, x19), n11, x19, xs8)
if1'(false, n16, x26, xs12) → filterlow'(n16, xs12)
filterlow'(n21, nil) → false
ge(x, 0) → true
if1(true, n6, x12, xs4) → filterlow(n6, xs4)
filterlow(n11, cons(x19, xs8)) → if1(ge(n11, x19), n11, x19, xs8)
if1(false, n16, x26, xs12) → cons(x26, filterlow(n16, xs12))
filterlow(n21, nil) → nil
ge(0, s(x39)) → false
equal_bool(true, false) → false
equal_bool(false, true) → false
equal_bool(true, true) → true
equal_bool(false, false) → true
and(true, x) → x
and(false, x) → false
or(true, x) → true
or(false, x) → x
not(false) → true
not(true) → false
isa_true(true) → true
isa_true(false) → false
isa_false(true) → false
isa_false(false) → true
equal_sort[a0](0, 0) → true
equal_sort[a0](0, s(x0)) → false
equal_sort[a0](s(x0), 0) → false
equal_sort[a5](cons(x0, x1), cons(x2, x3)) → and(equal_sort[a5](x0, x2), equal_sort[a5](x1, x3))
equal_sort[a5](cons(x0, x1), nil) → false
equal_sort[a5](nil, cons(x0, x1)) → false
equal_sort[a5](nil, nil) → true
equal_sort[a36](witness_sort[a36], witness_sort[a36]) → true


(58) Obligation:

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

ge(s(x5), s(y')) → ge(x5, y')
equal_sort[a0](s(x0), s(x1)) → equal_sort[a0](x0, x1)

Q is empty.

(59) QTRSRRRProof (EQUIVALENT transformation)

Used ordering:
Polynomial interpretation [POLO]:

POL(equal_sort[a0](x1, x2)) = x1 + x2   
POL(ge(x1, x2)) = 2·x1 + x2   
POL(s(x1)) = 1 + 2·x1   
With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:

ge(s(x5), s(y')) → ge(x5, y')
equal_sort[a0](s(x0), s(x1)) → equal_sort[a0](x0, x1)


(60) Obligation:

Q restricted rewrite system:
R is empty.
Q is empty.

(61) RisEmptyProof (EQUIVALENT transformation)

The TRS R is empty. Hence, termination is trivially proven.

(62) YES

(63) Obligation:

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

filterhigh'(n56, cons(x65, xs41)) → if2'(ge(x65, n56), n56, x65, xs41)
if2'(true, n65, x75, xs48) → true
if2'(false, n74, x85, xs55) → filterhigh'(n74, xs55)
filterhigh'(n83, nil) → false
if1(true, n, x, xs) → filterlow(n, xs)
filterlow(n4, cons(x5, xs2)) → if1(ge(n4, x5), n4, x5, xs2)
ge(x16, 0) → true
ge(0, s(x26)) → false
ge(s(x36), s(y2)) → ge(x36, y2)
if1(false, n38, x46, xs28) → cons(x46, filterlow(n38, xs28))
filterlow(n47, nil) → nil
filterhigh(n56, cons(x65, xs41)) → if2(ge(x65, n56), n56, x65, xs41)
if2(true, n65, x75, xs48) → filterhigh(n65, xs48)
if2(false, n74, x85, xs55) → cons(x85, filterhigh(n74, xs55))
filterhigh(n83, nil) → nil
equal_bool(true, false) → false
equal_bool(false, true) → false
equal_bool(true, true) → true
equal_bool(false, false) → true
and(true, x) → x
and(false, x) → false
or(true, x) → true
or(false, x) → x
not(false) → true
not(true) → false
isa_true(true) → true
isa_true(false) → false
isa_false(true) → false
isa_false(false) → true
equal_sort[a0](0, 0) → true
equal_sort[a0](0, s(x0)) → false
equal_sort[a0](s(x0), 0) → false
equal_sort[a0](s(x0), s(x1)) → equal_sort[a0](x0, x1)
equal_sort[a2](cons(x0, x1), cons(x2, x3)) → and(equal_sort[a2](x0, x2), equal_sort[a2](x1, x3))
equal_sort[a2](cons(x0, x1), nil) → false
equal_sort[a2](nil, cons(x0, x1)) → false
equal_sort[a2](nil, nil) → true
equal_sort[a55](witness_sort[a55], witness_sort[a55]) → true

Q is empty.

(64) QTRSRRRProof (EQUIVALENT transformation)

Used ordering:
Combined order from the following AFS and order.
filterhigh'(x1, x2)  =  filterhigh'(x1, x2)
cons(x1, x2)  =  cons(x1, x2)
if2'(x1, x2, x3, x4)  =  if2'(x1, x2, x3, x4)
ge(x1, x2)  =  ge(x1, x2)
true  =  true
false  =  false
nil  =  nil
if1(x1, x2, x3, x4)  =  if1(x1, x2, x3, x4)
filterlow(x1, x2)  =  filterlow(x1, x2)
0  =  0
s(x1)  =  x1
filterhigh(x1, x2)  =  filterhigh(x1, x2)
if2(x1, x2, x3, x4)  =  if2(x1, x2, x3, x4)
equal_bool(x1, x2)  =  equal_bool(x1, x2)
and(x1, x2)  =  and(x1, x2)
or(x1, x2)  =  or(x1, x2)
not(x1)  =  not(x1)
isa_true(x1)  =  isa_true(x1)
isa_false(x1)  =  isa_false(x1)
equal_sort[a0](x1, x2)  =  equal_sort[a0](x1, x2)
equal_sort[a2](x1, x2)  =  equal_sort[a2](x1, x2)
equal_sort[a55](x1, x2)  =  equal_sort[a55](x1, x2)
witness_sort[a55]  =  witness_sort[a55]

Recursive path order with status [RPO].
Quasi-Precedence:
nil > [false, not1] > [true, equalsort[a55]2] > [if14, filterlow2] > cons2 > [filterhigh'2, if2'4] > ge2
nil > [false, not1] > [true, equalsort[a55]2] > [if14, filterlow2] > cons2 > and2
nil > [false, not1] > [true, equalsort[a55]2] > [filterhigh2, if24] > cons2 > [filterhigh'2, if2'4] > ge2
nil > [false, not1] > [true, equalsort[a55]2] > [filterhigh2, if24] > cons2 > and2
0 > [false, not1] > [true, equalsort[a55]2] > [if14, filterlow2] > cons2 > [filterhigh'2, if2'4] > ge2
0 > [false, not1] > [true, equalsort[a55]2] > [if14, filterlow2] > cons2 > and2
0 > [false, not1] > [true, equalsort[a55]2] > [filterhigh2, if24] > cons2 > [filterhigh'2, if2'4] > ge2
0 > [false, not1] > [true, equalsort[a55]2] > [filterhigh2, if24] > cons2 > and2
isafalse1 > [false, not1] > [true, equalsort[a55]2] > [if14, filterlow2] > cons2 > [filterhigh'2, if2'4] > ge2
isafalse1 > [false, not1] > [true, equalsort[a55]2] > [if14, filterlow2] > cons2 > and2
isafalse1 > [false, not1] > [true, equalsort[a55]2] > [filterhigh2, if24] > cons2 > [filterhigh'2, if2'4] > ge2
isafalse1 > [false, not1] > [true, equalsort[a55]2] > [filterhigh2, if24] > cons2 > and2
equalsort[a0]2 > [true, equalsort[a55]2] > [if14, filterlow2] > cons2 > [filterhigh'2, if2'4] > ge2
equalsort[a0]2 > [true, equalsort[a55]2] > [if14, filterlow2] > cons2 > and2
equalsort[a0]2 > [true, equalsort[a55]2] > [filterhigh2, if24] > cons2 > [filterhigh'2, if2'4] > ge2
equalsort[a0]2 > [true, equalsort[a55]2] > [filterhigh2, if24] > cons2 > and2
equalsort[a2]2 > [true, equalsort[a55]2] > [if14, filterlow2] > cons2 > [filterhigh'2, if2'4] > ge2
equalsort[a2]2 > [true, equalsort[a55]2] > [if14, filterlow2] > cons2 > and2
equalsort[a2]2 > [true, equalsort[a55]2] > [filterhigh2, if24] > cons2 > [filterhigh'2, if2'4] > ge2
equalsort[a2]2 > [true, equalsort[a55]2] > [filterhigh2, if24] > cons2 > and2

Status:
filterhigh'2: [1,2]
cons2: [2,1]
if2'4: [2,4,3,1]
ge2: [1,2]
true: multiset
false: multiset
nil: multiset
if14: [4,2,1,3]
filterlow2: [2,1]
0: multiset
filterhigh2: [1,2]
if24: [2,4,1,3]
equalbool2: [2,1]
and2: [2,1]
or2: [2,1]
not1: multiset
isatrue1: [1]
isafalse1: [1]
equalsort[a0]2: multiset
equalsort[a2]2: multiset
equalsort[a55]2: multiset
witnesssort[a55]: multiset

With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:

filterhigh'(n56, cons(x65, xs41)) → if2'(ge(x65, n56), n56, x65, xs41)
if2'(true, n65, x75, xs48) → true
if2'(false, n74, x85, xs55) → filterhigh'(n74, xs55)
filterhigh'(n83, nil) → false
if1(true, n, x, xs) → filterlow(n, xs)
filterlow(n4, cons(x5, xs2)) → if1(ge(n4, x5), n4, x5, xs2)
ge(x16, 0) → true
ge(0, s(x26)) → false
if1(false, n38, x46, xs28) → cons(x46, filterlow(n38, xs28))
filterlow(n47, nil) → nil
filterhigh(n56, cons(x65, xs41)) → if2(ge(x65, n56), n56, x65, xs41)
if2(true, n65, x75, xs48) → filterhigh(n65, xs48)
if2(false, n74, x85, xs55) → cons(x85, filterhigh(n74, xs55))
filterhigh(n83, nil) → nil
equal_bool(true, false) → false
equal_bool(false, true) → false
equal_bool(true, true) → true
equal_bool(false, false) → true
and(true, x) → x
and(false, x) → false
or(true, x) → true
or(false, x) → x
not(false) → true
not(true) → false
isa_true(true) → true
isa_true(false) → false
isa_false(true) → false
isa_false(false) → true
equal_sort[a0](0, 0) → true
equal_sort[a0](0, s(x0)) → false
equal_sort[a0](s(x0), 0) → false
equal_sort[a2](cons(x0, x1), cons(x2, x3)) → and(equal_sort[a2](x0, x2), equal_sort[a2](x1, x3))
equal_sort[a2](cons(x0, x1), nil) → false
equal_sort[a2](nil, cons(x0, x1)) → false
equal_sort[a2](nil, nil) → true
equal_sort[a55](witness_sort[a55], witness_sort[a55]) → true


(65) Obligation:

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

ge(s(x36), s(y2)) → ge(x36, y2)
equal_sort[a0](s(x0), s(x1)) → equal_sort[a0](x0, x1)

Q is empty.

(66) QTRSRRRProof (EQUIVALENT transformation)

Used ordering:
Polynomial interpretation [POLO]:

POL(equal_sort[a0](x1, x2)) = x1 + x2   
POL(ge(x1, x2)) = 2·x1 + x2   
POL(s(x1)) = 1 + 2·x1   
With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:

ge(s(x36), s(y2)) → ge(x36, y2)
equal_sort[a0](s(x0), s(x1)) → equal_sort[a0](x0, x1)


(67) Obligation:

Q restricted rewrite system:
R is empty.
Q is empty.

(68) RisEmptyProof (EQUIVALENT transformation)

The TRS R is empty. Hence, termination is trivially proven.

(69) YES