(0) Obligation:
Q restricted rewrite system:
The TRS R consists of the following rules:
bsort(nil) → nil
bsort(.(x, y)) → last(.(bubble(.(x, y)), bsort(butlast(bubble(.(x, y))))))
bubble(nil) → nil
bubble(.(x, nil)) → .(x, nil)
bubble(.(x, .(y, z))) → if(<=(x, y), .(y, bubble(.(x, z))), .(x, bubble(.(y, z))))
last(nil) → 0
last(.(x, nil)) → x
last(.(x, .(y, z))) → last(.(y, z))
butlast(nil) → nil
butlast(.(x, nil)) → nil
butlast(.(x, .(y, z))) → .(x, butlast(.(y, z)))
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:
bsort(nil) → nil
bsort(.(x, y)) → last(.(bubble(.(x, y)), bsort(butlast(bubble(.(x, y))))))
bubble(nil) → nil
bubble(.(x, nil)) → .(x, nil)
bubble(.(x, .(y, z))) → if(<=(x, y), .(y, bubble(.(x, z))), .(x, bubble(.(y, z))))
last(nil) → 0
last(.(x, nil)) → x
last(.(x, .(y, z))) → last(.(y, z))
butlast(nil) → nil
butlast(.(x, nil)) → nil
butlast(.(x, .(y, z))) → .(x, butlast(.(y, z)))
The set Q consists of the following terms:
bsort(nil)
bsort(.(x0, x1))
bubble(nil)
bubble(.(x0, nil))
bubble(.(x0, .(x1, x2)))
last(nil)
last(.(x0, nil))
last(.(x0, .(x1, x2)))
butlast(nil)
butlast(.(x0, nil))
butlast(.(x0, .(x1, x2)))
(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:
BSORT(.(x, y)) → LAST(.(bubble(.(x, y)), bsort(butlast(bubble(.(x, y))))))
BSORT(.(x, y)) → BUBBLE(.(x, y))
BSORT(.(x, y)) → BSORT(butlast(bubble(.(x, y))))
BSORT(.(x, y)) → BUTLAST(bubble(.(x, y)))
BUBBLE(.(x, .(y, z))) → BUBBLE(.(x, z))
BUBBLE(.(x, .(y, z))) → BUBBLE(.(y, z))
LAST(.(x, .(y, z))) → LAST(.(y, z))
BUTLAST(.(x, .(y, z))) → BUTLAST(.(y, z))
The TRS R consists of the following rules:
bsort(nil) → nil
bsort(.(x, y)) → last(.(bubble(.(x, y)), bsort(butlast(bubble(.(x, y))))))
bubble(nil) → nil
bubble(.(x, nil)) → .(x, nil)
bubble(.(x, .(y, z))) → if(<=(x, y), .(y, bubble(.(x, z))), .(x, bubble(.(y, z))))
last(nil) → 0
last(.(x, nil)) → x
last(.(x, .(y, z))) → last(.(y, z))
butlast(nil) → nil
butlast(.(x, nil)) → nil
butlast(.(x, .(y, z))) → .(x, butlast(.(y, z)))
The set Q consists of the following terms:
bsort(nil)
bsort(.(x0, x1))
bubble(nil)
bubble(.(x0, nil))
bubble(.(x0, .(x1, x2)))
last(nil)
last(.(x0, nil))
last(.(x0, .(x1, x2)))
butlast(nil)
butlast(.(x0, nil))
butlast(.(x0, .(x1, x2)))
We have to consider all minimal (P,Q,R)-chains.
(5) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 4 SCCs with 3 less nodes.
(6) Complex Obligation (AND)
(7) Obligation:
Q DP problem:
The TRS P consists of the following rules:
BUTLAST(.(x, .(y, z))) → BUTLAST(.(y, z))
The TRS R consists of the following rules:
bsort(nil) → nil
bsort(.(x, y)) → last(.(bubble(.(x, y)), bsort(butlast(bubble(.(x, y))))))
bubble(nil) → nil
bubble(.(x, nil)) → .(x, nil)
bubble(.(x, .(y, z))) → if(<=(x, y), .(y, bubble(.(x, z))), .(x, bubble(.(y, z))))
last(nil) → 0
last(.(x, nil)) → x
last(.(x, .(y, z))) → last(.(y, z))
butlast(nil) → nil
butlast(.(x, nil)) → nil
butlast(.(x, .(y, z))) → .(x, butlast(.(y, z)))
The set Q consists of the following terms:
bsort(nil)
bsort(.(x0, x1))
bubble(nil)
bubble(.(x0, nil))
bubble(.(x0, .(x1, x2)))
last(nil)
last(.(x0, nil))
last(.(x0, .(x1, x2)))
butlast(nil)
butlast(.(x0, nil))
butlast(.(x0, .(x1, x2)))
We have to consider all minimal (P,Q,R)-chains.
(8) Obligation:
Q DP problem:
The TRS P consists of the following rules:
LAST(.(x, .(y, z))) → LAST(.(y, z))
The TRS R consists of the following rules:
bsort(nil) → nil
bsort(.(x, y)) → last(.(bubble(.(x, y)), bsort(butlast(bubble(.(x, y))))))
bubble(nil) → nil
bubble(.(x, nil)) → .(x, nil)
bubble(.(x, .(y, z))) → if(<=(x, y), .(y, bubble(.(x, z))), .(x, bubble(.(y, z))))
last(nil) → 0
last(.(x, nil)) → x
last(.(x, .(y, z))) → last(.(y, z))
butlast(nil) → nil
butlast(.(x, nil)) → nil
butlast(.(x, .(y, z))) → .(x, butlast(.(y, z)))
The set Q consists of the following terms:
bsort(nil)
bsort(.(x0, x1))
bubble(nil)
bubble(.(x0, nil))
bubble(.(x0, .(x1, x2)))
last(nil)
last(.(x0, nil))
last(.(x0, .(x1, x2)))
butlast(nil)
butlast(.(x0, nil))
butlast(.(x0, .(x1, x2)))
We have to consider all minimal (P,Q,R)-chains.
(9) Obligation:
Q DP problem:
The TRS P consists of the following rules:
BUBBLE(.(x, .(y, z))) → BUBBLE(.(y, z))
BUBBLE(.(x, .(y, z))) → BUBBLE(.(x, z))
The TRS R consists of the following rules:
bsort(nil) → nil
bsort(.(x, y)) → last(.(bubble(.(x, y)), bsort(butlast(bubble(.(x, y))))))
bubble(nil) → nil
bubble(.(x, nil)) → .(x, nil)
bubble(.(x, .(y, z))) → if(<=(x, y), .(y, bubble(.(x, z))), .(x, bubble(.(y, z))))
last(nil) → 0
last(.(x, nil)) → x
last(.(x, .(y, z))) → last(.(y, z))
butlast(nil) → nil
butlast(.(x, nil)) → nil
butlast(.(x, .(y, z))) → .(x, butlast(.(y, z)))
The set Q consists of the following terms:
bsort(nil)
bsort(.(x0, x1))
bubble(nil)
bubble(.(x0, nil))
bubble(.(x0, .(x1, x2)))
last(nil)
last(.(x0, nil))
last(.(x0, .(x1, x2)))
butlast(nil)
butlast(.(x0, nil))
butlast(.(x0, .(x1, x2)))
We have to consider all minimal (P,Q,R)-chains.
(10) Obligation:
Q DP problem:
The TRS P consists of the following rules:
BSORT(.(x, y)) → BSORT(butlast(bubble(.(x, y))))
The TRS R consists of the following rules:
bsort(nil) → nil
bsort(.(x, y)) → last(.(bubble(.(x, y)), bsort(butlast(bubble(.(x, y))))))
bubble(nil) → nil
bubble(.(x, nil)) → .(x, nil)
bubble(.(x, .(y, z))) → if(<=(x, y), .(y, bubble(.(x, z))), .(x, bubble(.(y, z))))
last(nil) → 0
last(.(x, nil)) → x
last(.(x, .(y, z))) → last(.(y, z))
butlast(nil) → nil
butlast(.(x, nil)) → nil
butlast(.(x, .(y, z))) → .(x, butlast(.(y, z)))
The set Q consists of the following terms:
bsort(nil)
bsort(.(x0, x1))
bubble(nil)
bubble(.(x0, nil))
bubble(.(x0, .(x1, x2)))
last(nil)
last(.(x0, nil))
last(.(x0, .(x1, x2)))
butlast(nil)
butlast(.(x0, nil))
butlast(.(x0, .(x1, x2)))
We have to consider all minimal (P,Q,R)-chains.