(0) Obligation:

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

sort(nil) → nil
sort(cons(x, y)) → insert(x, sort(y))
insert(x, nil) → cons(x, nil)
insert(x, cons(v, w)) → choose(x, cons(v, w), x, v)
choose(x, cons(v, w), y, 0) → cons(x, cons(v, w))
choose(x, cons(v, w), 0, s(z)) → cons(v, insert(x, w))
choose(x, cons(v, w), s(y), s(z)) → choose(x, cons(v, w), y, z)

Q is empty.

(1) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(2) Obligation:

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

SORT(cons(x, y)) → INSERT(x, sort(y))
SORT(cons(x, y)) → SORT(y)
INSERT(x, cons(v, w)) → CHOOSE(x, cons(v, w), x, v)
CHOOSE(x, cons(v, w), 0, s(z)) → INSERT(x, w)
CHOOSE(x, cons(v, w), s(y), s(z)) → CHOOSE(x, cons(v, w), y, z)

The TRS R consists of the following rules:

sort(nil) → nil
sort(cons(x, y)) → insert(x, sort(y))
insert(x, nil) → cons(x, nil)
insert(x, cons(v, w)) → choose(x, cons(v, w), x, v)
choose(x, cons(v, w), y, 0) → cons(x, cons(v, w))
choose(x, cons(v, w), 0, s(z)) → cons(v, insert(x, w))
choose(x, cons(v, w), s(y), s(z)) → choose(x, cons(v, w), y, z)

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

(3) DependencyGraphProof (EQUIVALENT transformation)

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

(4) Complex Obligation (AND)

(5) Obligation:

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

CHOOSE(x, cons(v, w), 0, s(z)) → INSERT(x, w)
INSERT(x, cons(v, w)) → CHOOSE(x, cons(v, w), x, v)
CHOOSE(x, cons(v, w), s(y), s(z)) → CHOOSE(x, cons(v, w), y, z)

The TRS R consists of the following rules:

sort(nil) → nil
sort(cons(x, y)) → insert(x, sort(y))
insert(x, nil) → cons(x, nil)
insert(x, cons(v, w)) → choose(x, cons(v, w), x, v)
choose(x, cons(v, w), y, 0) → cons(x, cons(v, w))
choose(x, cons(v, w), 0, s(z)) → cons(v, insert(x, w))
choose(x, cons(v, w), s(y), s(z)) → choose(x, cons(v, w), y, z)

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

(6) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


CHOOSE(x, cons(v, w), 0, s(z)) → INSERT(x, w)
INSERT(x, cons(v, w)) → CHOOSE(x, cons(v, w), x, v)
The remaining pairs can at least be oriented weakly.
Used ordering: SCNP Order with the following components:
Level mapping:
Top level AFS:
CHOOSE(x0, x1, x2, x3, x4)  =  CHOOSE(x2)
INSERT(x0, x1, x2)  =  INSERT(x0, x2)

Tags:
CHOOSE has argument tags [2,2,4,0,1] and root tag 1
INSERT has argument tags [4,5,6] and root tag 0

Comparison: MAX
Underlying order for the size change arcs and the rules of R:
Combined order from the following AFS and order.
CHOOSE(x1, x2, x3, x4)  =  CHOOSE(x1, x3)
cons(x1, x2)  =  cons(x2)
0  =  0
s(x1)  =  s
INSERT(x1, x2)  =  INSERT(x2)

Recursive path order with status [RPO].
Quasi-Precedence:
s > CHOOSE2 > [cons1, 0, INSERT1]

Status:
CHOOSE2: [2,1]
cons1: multiset
0: multiset
s: multiset
INSERT1: multiset


The following usable rules [FROCOS05] were oriented: none

(7) Obligation:

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

CHOOSE(x, cons(v, w), s(y), s(z)) → CHOOSE(x, cons(v, w), y, z)

The TRS R consists of the following rules:

sort(nil) → nil
sort(cons(x, y)) → insert(x, sort(y))
insert(x, nil) → cons(x, nil)
insert(x, cons(v, w)) → choose(x, cons(v, w), x, v)
choose(x, cons(v, w), y, 0) → cons(x, cons(v, w))
choose(x, cons(v, w), 0, s(z)) → cons(v, insert(x, w))
choose(x, cons(v, w), s(y), s(z)) → choose(x, cons(v, w), y, z)

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

(8) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


CHOOSE(x, cons(v, w), s(y), s(z)) → CHOOSE(x, cons(v, w), y, z)
The remaining pairs can at least be oriented weakly.
Used ordering: SCNP Order with the following components:
Level mapping:
Top level AFS:
CHOOSE(x0, x1, x2, x3, x4)  =  CHOOSE(x3)

Tags:
CHOOSE has argument tags [3,0,1,3,0] and root tag 0

Comparison: MAX
Underlying order for the size change arcs and the rules of R:
Combined order from the following AFS and order.
CHOOSE(x1, x2, x3, x4)  =  x2
cons(x1, x2)  =  cons(x1, x2)
s(x1)  =  s(x1)

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

Status:
cons2: multiset
s1: [1]


The following usable rules [FROCOS05] were oriented: none

(9) Obligation:

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

sort(nil) → nil
sort(cons(x, y)) → insert(x, sort(y))
insert(x, nil) → cons(x, nil)
insert(x, cons(v, w)) → choose(x, cons(v, w), x, v)
choose(x, cons(v, w), y, 0) → cons(x, cons(v, w))
choose(x, cons(v, w), 0, s(z)) → cons(v, insert(x, w))
choose(x, cons(v, w), s(y), s(z)) → choose(x, cons(v, w), y, z)

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

(10) PisEmptyProof (EQUIVALENT transformation)

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

(11) TRUE

(12) Obligation:

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

SORT(cons(x, y)) → SORT(y)

The TRS R consists of the following rules:

sort(nil) → nil
sort(cons(x, y)) → insert(x, sort(y))
insert(x, nil) → cons(x, nil)
insert(x, cons(v, w)) → choose(x, cons(v, w), x, v)
choose(x, cons(v, w), y, 0) → cons(x, cons(v, w))
choose(x, cons(v, w), 0, s(z)) → cons(v, insert(x, w))
choose(x, cons(v, w), s(y), s(z)) → choose(x, cons(v, w), y, z)

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

(13) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


SORT(cons(x, y)) → SORT(y)
The remaining pairs can at least be oriented weakly.
Used ordering: SCNP Order with the following components:
Level mapping:
Top level AFS:
SORT(x0, x1)  =  SORT(x1)

Tags:
SORT has argument tags [1,1] and root tag 0

Comparison: MAX
Underlying order for the size change arcs and the rules of R:
Recursive path order with status [RPO].
Quasi-Precedence:
trivial

Status:
SORT1: multiset
cons2: multiset


The following usable rules [FROCOS05] were oriented: none

(14) Obligation:

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

sort(nil) → nil
sort(cons(x, y)) → insert(x, sort(y))
insert(x, nil) → cons(x, nil)
insert(x, cons(v, w)) → choose(x, cons(v, w), x, v)
choose(x, cons(v, w), y, 0) → cons(x, cons(v, w))
choose(x, cons(v, w), 0, s(z)) → cons(v, insert(x, w))
choose(x, cons(v, w), s(y), s(z)) → choose(x, cons(v, w), y, z)

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

(15) PisEmptyProof (EQUIVALENT transformation)

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

(16) TRUE