Term Rewriting System R:
[x, y, z]
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)))

Innermost Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

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))

Furthermore, R contains four SCCs.


   R
DPs
       →DP Problem 1
Forward Instantiation Transformation
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar


Dependency Pair:

LAST(.(x, .(y, z))) -> LAST(.(y, z))


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)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

LAST(.(x, .(y, z))) -> LAST(.(y, z))
one new Dependency Pair is created:

LAST(.(x, .(y0, .(y'', z'')))) -> LAST(.(y0, .(y'', z'')))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
           →DP Problem 5
Forward Instantiation Transformation
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar


Dependency Pair:

LAST(.(x, .(y0, .(y'', z'')))) -> LAST(.(y0, .(y'', z'')))


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)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

LAST(.(x, .(y0, .(y'', z'')))) -> LAST(.(y0, .(y'', z'')))
one new Dependency Pair is created:

LAST(.(x, .(y0'', .(y''0, .(y'''', z''''))))) -> LAST(.(y0'', .(y''0, .(y'''', z''''))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
           →DP Problem 5
FwdInst
             ...
               →DP Problem 6
Argument Filtering and Ordering
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar


Dependency Pair:

LAST(.(x, .(y0'', .(y''0, .(y'''', z''''))))) -> LAST(.(y0'', .(y''0, .(y'''', z''''))))


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)))


Strategy:

innermost




The following dependency pair can be strictly oriented:

LAST(.(x, .(y0'', .(y''0, .(y'''', z''''))))) -> LAST(.(y0'', .(y''0, .(y'''', z''''))))


There are no usable rules for innermost that need to be oriented.
Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(LAST(x1))=  1 + x1  
  POL(.(x1, x2))=  1 + x1 + x2  

resulting in one new DP problem.
Used Argument Filtering System:
LAST(x1) -> LAST(x1)
.(x1, x2) -> .(x1, x2)


   R
DPs
       →DP Problem 1
FwdInst
           →DP Problem 5
FwdInst
             ...
               →DP Problem 7
Dependency Graph
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar


Dependency Pair:


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)))


Strategy:

innermost




Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
Forward Instantiation Transformation
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar


Dependency Pairs:

BUBBLE(.(x, .(y, z))) -> BUBBLE(.(y, z))
BUBBLE(.(x, .(y, z))) -> BUBBLE(.(x, z))


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)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

BUBBLE(.(x, .(y, z))) -> BUBBLE(.(x, z))
one new Dependency Pair is created:

BUBBLE(.(x'', .(y, .(y'', z'')))) -> BUBBLE(.(x'', .(y'', z'')))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
           →DP Problem 8
Forward Instantiation Transformation
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar


Dependency Pairs:

BUBBLE(.(x'', .(y, .(y'', z'')))) -> BUBBLE(.(x'', .(y'', z'')))
BUBBLE(.(x, .(y, z))) -> BUBBLE(.(y, z))


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)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

BUBBLE(.(x, .(y, z))) -> BUBBLE(.(y, z))
two new Dependency Pairs are created:

BUBBLE(.(x, .(y0, .(y'', z'')))) -> BUBBLE(.(y0, .(y'', z'')))
BUBBLE(.(x, .(y0, .(y'', .(y'''', z''''))))) -> BUBBLE(.(y0, .(y'', .(y'''', z''''))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
           →DP Problem 8
FwdInst
             ...
               →DP Problem 9
Forward Instantiation Transformation
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar


Dependency Pairs:

BUBBLE(.(x, .(y0, .(y'', .(y'''', z''''))))) -> BUBBLE(.(y0, .(y'', .(y'''', z''''))))
BUBBLE(.(x, .(y0, .(y'', z'')))) -> BUBBLE(.(y0, .(y'', z'')))
BUBBLE(.(x'', .(y, .(y'', z'')))) -> BUBBLE(.(x'', .(y'', z'')))


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)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

BUBBLE(.(x'', .(y, .(y'', z'')))) -> BUBBLE(.(x'', .(y'', z'')))
three new Dependency Pairs are created:

BUBBLE(.(x'''', .(y, .(y''0, .(y'''', z''''))))) -> BUBBLE(.(x'''', .(y''0, .(y'''', z''''))))
BUBBLE(.(x''', .(y, .(y''0, .(y'''', z''''))))) -> BUBBLE(.(x''', .(y''0, .(y'''', z''''))))
BUBBLE(.(x''', .(y, .(y''0, .(y'''', .(y'''''', z'''''')))))) -> BUBBLE(.(x''', .(y''0, .(y'''', .(y'''''', z'''''')))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
           →DP Problem 8
FwdInst
             ...
               →DP Problem 10
Forward Instantiation Transformation
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar


Dependency Pairs:

BUBBLE(.(x''', .(y, .(y''0, .(y'''', .(y'''''', z'''''')))))) -> BUBBLE(.(x''', .(y''0, .(y'''', .(y'''''', z'''''')))))
BUBBLE(.(x''', .(y, .(y''0, .(y'''', z''''))))) -> BUBBLE(.(x''', .(y''0, .(y'''', z''''))))
BUBBLE(.(x'''', .(y, .(y''0, .(y'''', z''''))))) -> BUBBLE(.(x'''', .(y''0, .(y'''', z''''))))
BUBBLE(.(x, .(y0, .(y'', z'')))) -> BUBBLE(.(y0, .(y'', z'')))
BUBBLE(.(x, .(y0, .(y'', .(y'''', z''''))))) -> BUBBLE(.(y0, .(y'', .(y'''', z''''))))


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)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

BUBBLE(.(x, .(y0, .(y'', z'')))) -> BUBBLE(.(y0, .(y'', z'')))
four new Dependency Pairs are created:

BUBBLE(.(x, .(y0'', .(y''0, .(y'''', z''''))))) -> BUBBLE(.(y0'', .(y''0, .(y'''', z''''))))
BUBBLE(.(x, .(y0'', .(y''0, .(y'''', .(y'''''', z'''''')))))) -> BUBBLE(.(y0'', .(y''0, .(y'''', .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0', .(y''', .(y''0'', .(y'''''', z'''''')))))) -> BUBBLE(.(y0', .(y''', .(y''0'', .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0', .(y''', .(y''0'', .(y'''''', .(y'''''''', z''''''''))))))) -> BUBBLE(.(y0', .(y''', .(y''0'', .(y'''''', .(y'''''''', z''''''''))))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
           →DP Problem 8
FwdInst
             ...
               →DP Problem 11
Forward Instantiation Transformation
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar


Dependency Pairs:

BUBBLE(.(x, .(y0', .(y''', .(y''0'', .(y'''''', .(y'''''''', z''''''''))))))) -> BUBBLE(.(y0', .(y''', .(y''0'', .(y'''''', .(y'''''''', z''''''''))))))
BUBBLE(.(x, .(y0', .(y''', .(y''0'', .(y'''''', z'''''')))))) -> BUBBLE(.(y0', .(y''', .(y''0'', .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0'', .(y''0, .(y'''', .(y'''''', z'''''')))))) -> BUBBLE(.(y0'', .(y''0, .(y'''', .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0'', .(y''0, .(y'''', z''''))))) -> BUBBLE(.(y0'', .(y''0, .(y'''', z''''))))
BUBBLE(.(x''', .(y, .(y''0, .(y'''', z''''))))) -> BUBBLE(.(x''', .(y''0, .(y'''', z''''))))
BUBBLE(.(x'''', .(y, .(y''0, .(y'''', z''''))))) -> BUBBLE(.(x'''', .(y''0, .(y'''', z''''))))
BUBBLE(.(x, .(y0, .(y'', .(y'''', z''''))))) -> BUBBLE(.(y0, .(y'', .(y'''', z''''))))
BUBBLE(.(x''', .(y, .(y''0, .(y'''', .(y'''''', z'''''')))))) -> BUBBLE(.(x''', .(y''0, .(y'''', .(y'''''', z'''''')))))


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)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

BUBBLE(.(x, .(y0, .(y'', .(y'''', z''''))))) -> BUBBLE(.(y0, .(y'', .(y'''', z''''))))
five new Dependency Pairs are created:

BUBBLE(.(x, .(y0'', .(y''0, .(y''''0, .(y'''''', z'''''')))))) -> BUBBLE(.(y0'', .(y''0, .(y''''0, .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0', .(y''', .(y''''0, .(y'''''', z'''''')))))) -> BUBBLE(.(y0', .(y''', .(y''''0, .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0', .(y''', .(y''''0, .(y'''''', .(y'''''''', z''''''''))))))) -> BUBBLE(.(y0', .(y''', .(y''''0, .(y'''''', .(y'''''''', z''''''''))))))
BUBBLE(.(x, .(y0', .(y''', .(y'''''', .(y''0'''', .(y'''''''', z''''''''))))))) -> BUBBLE(.(y0', .(y''', .(y'''''', .(y''0'''', .(y'''''''', z''''''''))))))
BUBBLE(.(x, .(y0', .(y''', .(y'''''', .(y''0'''', .(y'''''''', .(y'''''''''', z'''''''''')))))))) -> BUBBLE(.(y0', .(y''', .(y'''''', .(y''0'''', .(y'''''''', .(y'''''''''', z'''''''''')))))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
           →DP Problem 8
FwdInst
             ...
               →DP Problem 12
Argument Filtering and Ordering
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar


Dependency Pairs:

BUBBLE(.(x, .(y0', .(y''', .(y'''''', .(y''0'''', .(y'''''''', .(y'''''''''', z'''''''''')))))))) -> BUBBLE(.(y0', .(y''', .(y'''''', .(y''0'''', .(y'''''''', .(y'''''''''', z'''''''''')))))))
BUBBLE(.(x, .(y0', .(y''', .(y'''''', .(y''0'''', .(y'''''''', z''''''''))))))) -> BUBBLE(.(y0', .(y''', .(y'''''', .(y''0'''', .(y'''''''', z''''''''))))))
BUBBLE(.(x, .(y0', .(y''', .(y''''0, .(y'''''', .(y'''''''', z''''''''))))))) -> BUBBLE(.(y0', .(y''', .(y''''0, .(y'''''', .(y'''''''', z''''''''))))))
BUBBLE(.(x, .(y0', .(y''', .(y''''0, .(y'''''', z'''''')))))) -> BUBBLE(.(y0', .(y''', .(y''''0, .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0'', .(y''0, .(y''''0, .(y'''''', z'''''')))))) -> BUBBLE(.(y0'', .(y''0, .(y''''0, .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0', .(y''', .(y''0'', .(y'''''', z'''''')))))) -> BUBBLE(.(y0', .(y''', .(y''0'', .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0'', .(y''0, .(y'''', .(y'''''', z'''''')))))) -> BUBBLE(.(y0'', .(y''0, .(y'''', .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0'', .(y''0, .(y'''', z''''))))) -> BUBBLE(.(y0'', .(y''0, .(y'''', z''''))))
BUBBLE(.(x''', .(y, .(y''0, .(y'''', .(y'''''', z'''''')))))) -> BUBBLE(.(x''', .(y''0, .(y'''', .(y'''''', z'''''')))))
BUBBLE(.(x''', .(y, .(y''0, .(y'''', z''''))))) -> BUBBLE(.(x''', .(y''0, .(y'''', z''''))))
BUBBLE(.(x'''', .(y, .(y''0, .(y'''', z''''))))) -> BUBBLE(.(x'''', .(y''0, .(y'''', z''''))))
BUBBLE(.(x, .(y0', .(y''', .(y''0'', .(y'''''', .(y'''''''', z''''''''))))))) -> BUBBLE(.(y0', .(y''', .(y''0'', .(y'''''', .(y'''''''', z''''''''))))))


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)))


Strategy:

innermost




The following dependency pairs can be strictly oriented:

BUBBLE(.(x, .(y0', .(y''', .(y'''''', .(y''0'''', .(y'''''''', .(y'''''''''', z'''''''''')))))))) -> BUBBLE(.(y0', .(y''', .(y'''''', .(y''0'''', .(y'''''''', .(y'''''''''', z'''''''''')))))))
BUBBLE(.(x, .(y0', .(y''', .(y'''''', .(y''0'''', .(y'''''''', z''''''''))))))) -> BUBBLE(.(y0', .(y''', .(y'''''', .(y''0'''', .(y'''''''', z''''''''))))))
BUBBLE(.(x, .(y0', .(y''', .(y''''0, .(y'''''', .(y'''''''', z''''''''))))))) -> BUBBLE(.(y0', .(y''', .(y''''0, .(y'''''', .(y'''''''', z''''''''))))))
BUBBLE(.(x, .(y0', .(y''', .(y''''0, .(y'''''', z'''''')))))) -> BUBBLE(.(y0', .(y''', .(y''''0, .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0'', .(y''0, .(y''''0, .(y'''''', z'''''')))))) -> BUBBLE(.(y0'', .(y''0, .(y''''0, .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0', .(y''', .(y''0'', .(y'''''', z'''''')))))) -> BUBBLE(.(y0', .(y''', .(y''0'', .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0'', .(y''0, .(y'''', .(y'''''', z'''''')))))) -> BUBBLE(.(y0'', .(y''0, .(y'''', .(y'''''', z'''''')))))
BUBBLE(.(x, .(y0'', .(y''0, .(y'''', z''''))))) -> BUBBLE(.(y0'', .(y''0, .(y'''', z''''))))
BUBBLE(.(x''', .(y, .(y''0, .(y'''', .(y'''''', z'''''')))))) -> BUBBLE(.(x''', .(y''0, .(y'''', .(y'''''', z'''''')))))
BUBBLE(.(x''', .(y, .(y''0, .(y'''', z''''))))) -> BUBBLE(.(x''', .(y''0, .(y'''', z''''))))
BUBBLE(.(x'''', .(y, .(y''0, .(y'''', z''''))))) -> BUBBLE(.(x'''', .(y''0, .(y'''', z''''))))
BUBBLE(.(x, .(y0', .(y''', .(y''0'', .(y'''''', .(y'''''''', z''''''''))))))) -> BUBBLE(.(y0', .(y''', .(y''0'', .(y'''''', .(y'''''''', z''''''''))))))


There are no usable rules for innermost that need to be oriented.
Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(BUBBLE(x1))=  1 + x1  
  POL(.(x1, x2))=  1 + x1 + x2  

resulting in one new DP problem.
Used Argument Filtering System:
BUBBLE(x1) -> BUBBLE(x1)
.(x1, x2) -> .(x1, x2)


   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
           →DP Problem 8
FwdInst
             ...
               →DP Problem 13
Dependency Graph
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar


Dependency Pair:


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)))


Strategy:

innermost




Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
Forward Instantiation Transformation
       →DP Problem 4
Nar


Dependency Pair:

BUTLAST(.(x, .(y, z))) -> BUTLAST(.(y, z))


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)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

BUTLAST(.(x, .(y, z))) -> BUTLAST(.(y, z))
one new Dependency Pair is created:

BUTLAST(.(x, .(y0, .(y'', z'')))) -> BUTLAST(.(y0, .(y'', z'')))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
           →DP Problem 14
Forward Instantiation Transformation
       →DP Problem 4
Nar


Dependency Pair:

BUTLAST(.(x, .(y0, .(y'', z'')))) -> BUTLAST(.(y0, .(y'', z'')))


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)))


Strategy:

innermost




On this DP problem, a Forward Instantiation SCC transformation can be performed.
As a result of transforming the rule

BUTLAST(.(x, .(y0, .(y'', z'')))) -> BUTLAST(.(y0, .(y'', z'')))
one new Dependency Pair is created:

BUTLAST(.(x, .(y0'', .(y''0, .(y'''', z''''))))) -> BUTLAST(.(y0'', .(y''0, .(y'''', z''''))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
           →DP Problem 14
FwdInst
             ...
               →DP Problem 15
Argument Filtering and Ordering
       →DP Problem 4
Nar


Dependency Pair:

BUTLAST(.(x, .(y0'', .(y''0, .(y'''', z''''))))) -> BUTLAST(.(y0'', .(y''0, .(y'''', z''''))))


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)))


Strategy:

innermost




The following dependency pair can be strictly oriented:

BUTLAST(.(x, .(y0'', .(y''0, .(y'''', z''''))))) -> BUTLAST(.(y0'', .(y''0, .(y'''', z''''))))


There are no usable rules for innermost that need to be oriented.
Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(BUTLAST(x1))=  1 + x1  
  POL(.(x1, x2))=  1 + x1 + x2  

resulting in one new DP problem.
Used Argument Filtering System:
BUTLAST(x1) -> BUTLAST(x1)
.(x1, x2) -> .(x1, x2)


   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
           →DP Problem 14
FwdInst
             ...
               →DP Problem 16
Dependency Graph
       →DP Problem 4
Nar


Dependency Pair:


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)))


Strategy:

innermost




Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Narrowing Transformation


Dependency Pair:

BSORT(.(x, y)) -> BSORT(butlast(bubble(.(x, y))))


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)))


Strategy:

innermost




On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

BSORT(.(x, y)) -> BSORT(butlast(bubble(.(x, y))))
two new Dependency Pairs are created:

BSORT(.(x'', nil)) -> BSORT(butlast(.(x'', nil)))
BSORT(.(x'', .(y'', z'))) -> BSORT(butlast(if(<=(x'', y''), .(y'', bubble(.(x'', z'))), .(x'', bubble(.(y'', z'))))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar
           →DP Problem 17
Rewriting Transformation


Dependency Pairs:

BSORT(.(x'', .(y'', z'))) -> BSORT(butlast(if(<=(x'', y''), .(y'', bubble(.(x'', z'))), .(x'', bubble(.(y'', z'))))))
BSORT(.(x'', nil)) -> BSORT(butlast(.(x'', nil)))


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)))


Strategy:

innermost




On this DP problem, a Rewriting SCC transformation can be performed.
As a result of transforming the rule

BSORT(.(x'', nil)) -> BSORT(butlast(.(x'', nil)))
one new Dependency Pair is created:

BSORT(.(x'', nil)) -> BSORT(nil)

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar
           →DP Problem 17
Rw
             ...
               →DP Problem 18
Narrowing Transformation


Dependency Pair:

BSORT(.(x'', .(y'', z'))) -> BSORT(butlast(if(<=(x'', y''), .(y'', bubble(.(x'', z'))), .(x'', bubble(.(y'', z'))))))


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)))


Strategy:

innermost




On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

BSORT(.(x'', .(y'', z'))) -> BSORT(butlast(if(<=(x'', y''), .(y'', bubble(.(x'', z'))), .(x'', bubble(.(y'', z'))))))
four new Dependency Pairs are created:

BSORT(.(x''', .(y'', nil))) -> BSORT(butlast(if(<=(x''', y''), .(y'', .(x''', nil)), .(x''', bubble(.(y'', nil))))))
BSORT(.(x''', .(y'', .(y', z'')))) -> BSORT(butlast(if(<=(x''', y''), .(y'', if(<=(x''', y'), .(y', bubble(.(x''', z''))), .(x''', bubble(.(y', z''))))), .(x''', bubble(.(y'', .(y', z'')))))))
BSORT(.(x'', .(y''', nil))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', bubble(.(x'', nil))), .(x'', .(y''', nil)))))
BSORT(.(x'', .(y''', .(y', z'')))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', bubble(.(x'', .(y', z'')))), .(x'', if(<=(y''', y'), .(y', bubble(.(y''', z''))), .(y''', bubble(.(y', z''))))))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar
           →DP Problem 17
Rw
             ...
               →DP Problem 19
Rewriting Transformation


Dependency Pairs:

BSORT(.(x'', .(y''', .(y', z'')))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', bubble(.(x'', .(y', z'')))), .(x'', if(<=(y''', y'), .(y', bubble(.(y''', z''))), .(y''', bubble(.(y', z''))))))))
BSORT(.(x'', .(y''', nil))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', bubble(.(x'', nil))), .(x'', .(y''', nil)))))
BSORT(.(x''', .(y'', .(y', z'')))) -> BSORT(butlast(if(<=(x''', y''), .(y'', if(<=(x''', y'), .(y', bubble(.(x''', z''))), .(x''', bubble(.(y', z''))))), .(x''', bubble(.(y'', .(y', z'')))))))
BSORT(.(x''', .(y'', nil))) -> BSORT(butlast(if(<=(x''', y''), .(y'', .(x''', nil)), .(x''', bubble(.(y'', nil))))))


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)))


Strategy:

innermost




On this DP problem, a Rewriting SCC transformation can be performed.
As a result of transforming the rule

BSORT(.(x''', .(y'', nil))) -> BSORT(butlast(if(<=(x''', y''), .(y'', .(x''', nil)), .(x''', bubble(.(y'', nil))))))
one new Dependency Pair is created:

BSORT(.(x''', .(y'', nil))) -> BSORT(butlast(if(<=(x''', y''), .(y'', .(x''', nil)), .(x''', .(y'', nil)))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar
           →DP Problem 17
Rw
             ...
               →DP Problem 20
Rewriting Transformation


Dependency Pairs:

BSORT(.(x''', .(y'', nil))) -> BSORT(butlast(if(<=(x''', y''), .(y'', .(x''', nil)), .(x''', .(y'', nil)))))
BSORT(.(x'', .(y''', nil))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', bubble(.(x'', nil))), .(x'', .(y''', nil)))))
BSORT(.(x''', .(y'', .(y', z'')))) -> BSORT(butlast(if(<=(x''', y''), .(y'', if(<=(x''', y'), .(y', bubble(.(x''', z''))), .(x''', bubble(.(y', z''))))), .(x''', bubble(.(y'', .(y', z'')))))))
BSORT(.(x'', .(y''', .(y', z'')))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', bubble(.(x'', .(y', z'')))), .(x'', if(<=(y''', y'), .(y', bubble(.(y''', z''))), .(y''', bubble(.(y', z''))))))))


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)))


Strategy:

innermost




On this DP problem, a Rewriting SCC transformation can be performed.
As a result of transforming the rule

BSORT(.(x''', .(y'', .(y', z'')))) -> BSORT(butlast(if(<=(x''', y''), .(y'', if(<=(x''', y'), .(y', bubble(.(x''', z''))), .(x''', bubble(.(y', z''))))), .(x''', bubble(.(y'', .(y', z'')))))))
one new Dependency Pair is created:

BSORT(.(x''', .(y'', .(y', z'')))) -> BSORT(butlast(if(<=(x''', y''), .(y'', if(<=(x''', y'), .(y', bubble(.(x''', z''))), .(x''', bubble(.(y', z''))))), .(x''', if(<=(y'', y'), .(y', bubble(.(y'', z''))), .(y'', bubble(.(y', z''))))))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar
           →DP Problem 17
Rw
             ...
               →DP Problem 21
Rewriting Transformation


Dependency Pairs:

BSORT(.(x''', .(y'', .(y', z'')))) -> BSORT(butlast(if(<=(x''', y''), .(y'', if(<=(x''', y'), .(y', bubble(.(x''', z''))), .(x''', bubble(.(y', z''))))), .(x''', if(<=(y'', y'), .(y', bubble(.(y'', z''))), .(y'', bubble(.(y', z''))))))))
BSORT(.(x'', .(y''', .(y', z'')))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', bubble(.(x'', .(y', z'')))), .(x'', if(<=(y''', y'), .(y', bubble(.(y''', z''))), .(y''', bubble(.(y', z''))))))))
BSORT(.(x'', .(y''', nil))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', bubble(.(x'', nil))), .(x'', .(y''', nil)))))
BSORT(.(x''', .(y'', nil))) -> BSORT(butlast(if(<=(x''', y''), .(y'', .(x''', nil)), .(x''', .(y'', nil)))))


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)))


Strategy:

innermost




On this DP problem, a Rewriting SCC transformation can be performed.
As a result of transforming the rule

BSORT(.(x'', .(y''', nil))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', bubble(.(x'', nil))), .(x'', .(y''', nil)))))
one new Dependency Pair is created:

BSORT(.(x'', .(y''', nil))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', .(x'', nil)), .(x'', .(y''', nil)))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar
           →DP Problem 17
Rw
             ...
               →DP Problem 22
Rewriting Transformation


Dependency Pairs:

BSORT(.(x'', .(y''', nil))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', .(x'', nil)), .(x'', .(y''', nil)))))
BSORT(.(x''', .(y'', nil))) -> BSORT(butlast(if(<=(x''', y''), .(y'', .(x''', nil)), .(x''', .(y'', nil)))))
BSORT(.(x'', .(y''', .(y', z'')))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', bubble(.(x'', .(y', z'')))), .(x'', if(<=(y''', y'), .(y', bubble(.(y''', z''))), .(y''', bubble(.(y', z''))))))))
BSORT(.(x''', .(y'', .(y', z'')))) -> BSORT(butlast(if(<=(x''', y''), .(y'', if(<=(x''', y'), .(y', bubble(.(x''', z''))), .(x''', bubble(.(y', z''))))), .(x''', if(<=(y'', y'), .(y', bubble(.(y'', z''))), .(y'', bubble(.(y', z''))))))))


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)))


Strategy:

innermost




On this DP problem, a Rewriting SCC transformation can be performed.
As a result of transforming the rule

BSORT(.(x'', .(y''', .(y', z'')))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', bubble(.(x'', .(y', z'')))), .(x'', if(<=(y''', y'), .(y', bubble(.(y''', z''))), .(y''', bubble(.(y', z''))))))))
one new Dependency Pair is created:

BSORT(.(x'', .(y''', .(y', z'')))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', if(<=(x'', y'), .(y', bubble(.(x'', z''))), .(x'', bubble(.(y', z''))))), .(x'', if(<=(y''', y'), .(y', bubble(.(y''', z''))), .(y''', bubble(.(y', z''))))))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar
           →DP Problem 17
Rw
             ...
               →DP Problem 23
Narrowing Transformation


Dependency Pairs:

BSORT(.(x'', .(y''', .(y', z'')))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', if(<=(x'', y'), .(y', bubble(.(x'', z''))), .(x'', bubble(.(y', z''))))), .(x'', if(<=(y''', y'), .(y', bubble(.(y''', z''))), .(y''', bubble(.(y', z''))))))))
BSORT(.(x''', .(y'', .(y', z'')))) -> BSORT(butlast(if(<=(x''', y''), .(y'', if(<=(x''', y'), .(y', bubble(.(x''', z''))), .(x''', bubble(.(y', z''))))), .(x''', if(<=(y'', y'), .(y', bubble(.(y'', z''))), .(y'', bubble(.(y', z''))))))))
BSORT(.(x''', .(y'', nil))) -> BSORT(butlast(if(<=(x''', y''), .(y'', .(x''', nil)), .(x''', .(y'', nil)))))
BSORT(.(x'', .(y''', nil))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', .(x'', nil)), .(x'', .(y''', nil)))))


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)))


Strategy:

innermost




On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

BSORT(.(x''', .(y'', nil))) -> BSORT(butlast(if(<=(x''', y''), .(y'', .(x''', nil)), .(x''', .(y'', nil)))))
no new Dependency Pairs are created.
The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar
           →DP Problem 17
Rw
             ...
               →DP Problem 24
Narrowing Transformation


Dependency Pairs:

BSORT(.(x'', .(y''', nil))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', .(x'', nil)), .(x'', .(y''', nil)))))
BSORT(.(x''', .(y'', .(y', z'')))) -> BSORT(butlast(if(<=(x''', y''), .(y'', if(<=(x''', y'), .(y', bubble(.(x''', z''))), .(x''', bubble(.(y', z''))))), .(x''', if(<=(y'', y'), .(y', bubble(.(y'', z''))), .(y'', bubble(.(y', z''))))))))
BSORT(.(x'', .(y''', .(y', z'')))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', if(<=(x'', y'), .(y', bubble(.(x'', z''))), .(x'', bubble(.(y', z''))))), .(x'', if(<=(y''', y'), .(y', bubble(.(y''', z''))), .(y''', bubble(.(y', z''))))))))


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)))


Strategy:

innermost




On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

BSORT(.(x'', .(y''', nil))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', .(x'', nil)), .(x'', .(y''', nil)))))
no new Dependency Pairs are created.
The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar
           →DP Problem 17
Rw
             ...
               →DP Problem 25
Argument Filtering and Ordering


Dependency Pairs:

BSORT(.(x'', .(y''', .(y', z'')))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', if(<=(x'', y'), .(y', bubble(.(x'', z''))), .(x'', bubble(.(y', z''))))), .(x'', if(<=(y''', y'), .(y', bubble(.(y''', z''))), .(y''', bubble(.(y', z''))))))))
BSORT(.(x''', .(y'', .(y', z'')))) -> BSORT(butlast(if(<=(x''', y''), .(y'', if(<=(x''', y'), .(y', bubble(.(x''', z''))), .(x''', bubble(.(y', z''))))), .(x''', if(<=(y'', y'), .(y', bubble(.(y'', z''))), .(y'', bubble(.(y', z''))))))))


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)))


Strategy:

innermost




The following dependency pairs can be strictly oriented:

BSORT(.(x'', .(y''', .(y', z'')))) -> BSORT(butlast(if(<=(x'', y'''), .(y''', if(<=(x'', y'), .(y', bubble(.(x'', z''))), .(x'', bubble(.(y', z''))))), .(x'', if(<=(y''', y'), .(y', bubble(.(y''', z''))), .(y''', bubble(.(y', z''))))))))
BSORT(.(x''', .(y'', .(y', z'')))) -> BSORT(butlast(if(<=(x''', y''), .(y'', if(<=(x''', y'), .(y', bubble(.(x''', z''))), .(x''', bubble(.(y', z''))))), .(x''', if(<=(y'', y'), .(y', bubble(.(y'', z''))), .(y'', bubble(.(y', z''))))))))


The following usable rules for innermost can be oriented:

butlast(nil) -> nil
butlast(.(x, nil)) -> nil
butlast(.(x, .(y, z))) -> .(x, butlast(.(y, z)))
bubble(nil) -> nil
bubble(.(x, nil)) -> .(x, nil)
bubble(.(x, .(y, z))) -> if(<=(x, y), .(y, bubble(.(x, z))), .(x, bubble(.(y, z))))


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(butlast(x1))=  x1  
  POL(nil)=  0  
  POL(.(x1, x2))=  1 + x1 + x2  
  POL(BSORT(x1))=  1 + x1  
  POL(bubble(x1))=  x1  
  POL(<=(x1, x2))=  x1 + x2  

resulting in one new DP problem.
Used Argument Filtering System:
BSORT(x1) -> BSORT(x1)
.(x1, x2) -> .(x1, x2)
butlast(x1) -> butlast(x1)
if(x1, x2, x3) -> x1
<=(x1, x2) -> <=(x1, x2)
bubble(x1) -> bubble(x1)


   R
DPs
       →DP Problem 1
FwdInst
       →DP Problem 2
FwdInst
       →DP Problem 3
FwdInst
       →DP Problem 4
Nar
           →DP Problem 17
Rw
             ...
               →DP Problem 26
Dependency Graph


Dependency Pair:


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)))


Strategy:

innermost




Using the Dependency Graph resulted in no new DP problems.

Innermost Termination of R successfully shown.
Duration:
0:14 minutes