Term Rewriting System R: [x, y, z] msort(nil) -> nil msort(.(x, y)) -> .(min(x, y), msort(del(min(x, y), .(x, y)))) min(x, nil) -> x min(x, .(y, z)) -> if(<=(x, y), min(x, z), min(y, z)) del(x, nil) -> nil del(x, .(y, z)) -> if(=(x, y), z, .(y, del(x, z))) Termination of R to be shown. This program has no overlaps, so it is sufficient to show innermost termination. R contains the following Dependency Pairs: DEL(x, .(y, z)) -> DEL(x, z) MIN(x, .(y, z)) -> MIN(x, z) MIN(x, .(y, z)) -> MIN(y, z) MSORT(.(x, y)) -> MIN(x, y) MSORT(.(x, y)) -> MSORT(del(min(x, y), .(x, y))) MSORT(.(x, y)) -> DEL(min(x, y), .(x, y)) Furthermore, R contains three SCCs. SCC1: DEL(x, .(y, z)) -> DEL(x, z) Removing rules from R by ordering and analyzing Dependency Pairs, Usable Rules, and Usable Equations. This is possible by using the following (C_E-compatible) Polynomial ordering. Polynomial interpretation: POL(DEL(x_1, x_2)) = 1 + x_1 + x_2 POL(.(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: DEL(x, .(y, z)) -> DEL(x, z) This transformation is resulting in no new subcycles. SCC2: MIN(x, .(y, z)) -> MIN(y, z) MIN(x, .(y, z)) -> MIN(x, z) Removing rules from R by ordering and analyzing Dependency Pairs, Usable Rules, and Usable Equations. This is possible by using the following (C_E-compatible) Polynomial ordering. Polynomial interpretation: POL(MIN(x_1, x_2)) = 1 + x_1 + x_2 POL(.(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: MIN(x, .(y, z)) -> MIN(y, z) MIN(x, .(y, z)) -> MIN(x, z) This transformation is resulting in no new subcycles. SCC3: MSORT(.(x, y)) -> MSORT(del(min(x, y), .(x, y))) On this Scc, a Rewriting SCC transformation can be performed. As a result of transforming the rule MSORT(.(x, y)) -> MSORT(del(min(x, y), .(x, y))) one new Dependency Pair is created: MSORT(.(x, y)) -> MSORT(if(=(min(x, y), x), y, .(x, del(min(x, y), y)))) The transformation is resulting in no subcycles. Termination of R successfully shown. Duration: 0.628 seconds.