(0) Obligation:

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

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

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:

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

The set Q consists of the following terms:

merge(nil, x0)
merge(x0, nil)
merge(.(x0, x1), .(x2, x3))
++(nil, x0)
++(.(x0, x1), x2)
if(true, x0, x1)
if(false, x0, x1)

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

MERGE(.(x, y), .(u, v)) → IF(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
MERGE(.(x, y), .(u, v)) → MERGE(y, .(u, v))
MERGE(.(x, y), .(u, v)) → MERGE(.(x, y), v)
++1(.(x, y), z) → ++1(y, z)

The TRS R consists of the following rules:

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

The set Q consists of the following terms:

merge(nil, x0)
merge(x0, nil)
merge(.(x0, x1), .(x2, x3))
++(nil, x0)
++(.(x0, x1), x2)
if(true, x0, x1)
if(false, x0, x1)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

++1(.(x, y), z) → ++1(y, z)

The TRS R consists of the following rules:

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

The set Q consists of the following terms:

merge(nil, x0)
merge(x0, nil)
merge(.(x0, x1), .(x2, x3))
++(nil, x0)
++(.(x0, x1), x2)
if(true, x0, x1)
if(false, x0, x1)

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.


++1(.(x, y), z) → ++1(y, z)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
++1(x1, x2)  =  ++1(x1, x2)
.(x1, x2)  =  .(x2)
merge(x1, x2)  =  merge(x1, x2)
nil  =  nil
if(x1, x2, x3)  =  if(x2)
<(x1, x2)  =  <(x1, x2)
++(x1, x2)  =  ++(x1, x2)
true  =  true
false  =  false

Lexicographic path order with status [LPO].
Precedence:
merge2 > .1 > if1 > ++^12
merge2 > .1 > <2 > ++^12
nil > ++^12
++2 > .1 > if1 > ++^12
++2 > .1 > <2 > ++^12
true > ++^12
false > ++^12

Status:
++^12: [1,2]
.1: [1]
merge2: [1,2]
nil: []
if1: [1]
<2: [1,2]
++2: [1,2]
true: []
false: []

The following usable rules [FROCOS05] were oriented:

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

(9) Obligation:

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

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

The set Q consists of the following terms:

merge(nil, x0)
merge(x0, nil)
merge(.(x0, x1), .(x2, x3))
++(nil, x0)
++(.(x0, x1), x2)
if(true, x0, x1)
if(false, x0, x1)

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:

MERGE(.(x, y), .(u, v)) → MERGE(.(x, y), v)
MERGE(.(x, y), .(u, v)) → MERGE(y, .(u, v))

The TRS R consists of the following rules:

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

The set Q consists of the following terms:

merge(nil, x0)
merge(x0, nil)
merge(.(x0, x1), .(x2, x3))
++(nil, x0)
++(.(x0, x1), x2)
if(true, x0, x1)
if(false, x0, x1)

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.


MERGE(.(x, y), .(u, v)) → MERGE(y, .(u, v))
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
MERGE(x1, x2)  =  MERGE(x1)
.(x1, x2)  =  .(x2)
merge(x1, x2)  =  merge(x1, x2)
nil  =  nil
if(x1, x2, x3)  =  if(x2)
<(x1, x2)  =  <(x1, x2)
++(x1, x2)  =  ++(x1, x2)
true  =  true
false  =  false

Lexicographic path order with status [LPO].
Precedence:
MERGE1 > .1
merge2 > if1 > .1
nil > .1
<2 > .1
++2 > .1
true > .1
false > .1

Status:
MERGE1: [1]
.1: [1]
merge2: [1,2]
nil: []
if1: [1]
<2: [1,2]
++2: [1,2]
true: []
false: []

The following usable rules [FROCOS05] were oriented:

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

(14) Obligation:

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

MERGE(.(x, y), .(u, v)) → MERGE(.(x, y), v)

The TRS R consists of the following rules:

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

The set Q consists of the following terms:

merge(nil, x0)
merge(x0, nil)
merge(.(x0, x1), .(x2, x3))
++(nil, x0)
++(.(x0, x1), x2)
if(true, x0, x1)
if(false, x0, x1)

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

(15) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


MERGE(.(x, y), .(u, v)) → MERGE(.(x, y), v)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
MERGE(x1, x2)  =  MERGE(x1, x2)
.(x1, x2)  =  .(x2)
merge(x1, x2)  =  merge(x1, x2)
nil  =  nil
if(x1, x2, x3)  =  if(x2)
<(x1, x2)  =  <(x1, x2)
++(x1, x2)  =  ++(x1, x2)
true  =  true
false  =  false

Lexicographic path order with status [LPO].
Precedence:
merge2 > .1 > MERGE2
merge2 > .1 > if1
merge2 > .1 > <2
++2 > .1 > MERGE2
++2 > .1 > if1
++2 > .1 > <2

Status:
MERGE2: [1,2]
.1: [1]
merge2: [1,2]
nil: []
if1: [1]
<2: [1,2]
++2: [2,1]
true: []
false: []

The following usable rules [FROCOS05] were oriented:

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

(16) Obligation:

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

merge(nil, y) → y
merge(x, nil) → x
merge(.(x, y), .(u, v)) → if(<(x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) → y
++(.(x, y), z) → .(x, ++(y, z))
if(true, x, y) → x
if(false, x, y) → x

The set Q consists of the following terms:

merge(nil, x0)
merge(x0, nil)
merge(.(x0, x1), .(x2, x3))
++(nil, x0)
++(.(x0, x1), x2)
if(true, x0, x1)
if(false, x0, x1)

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

(17) PisEmptyProof (EQUIVALENT transformation)

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

(18) TRUE