YES We show the termination of the TRS R: 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))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: msort#(.(x,y)) -> min#(x,y) p2: msort#(.(x,y)) -> msort#(del(min(x,y),.(x,y))) p3: msort#(.(x,y)) -> del#(min(x,y),.(x,y)) p4: min#(x,.(y,z)) -> min#(x,z) p5: min#(x,.(y,z)) -> min#(y,z) p6: del#(x,.(y,z)) -> del#(x,z) and R consists of: r1: msort(nil()) -> nil() r2: msort(.(x,y)) -> .(min(x,y),msort(del(min(x,y),.(x,y)))) r3: min(x,nil()) -> x r4: min(x,.(y,z)) -> if(<=(x,y),min(x,z),min(y,z)) r5: del(x,nil()) -> nil() r6: del(x,.(y,z)) -> if(=(x,y),z,.(y,del(x,z))) The estimated dependency graph contains the following SCCs: {p2} {p4, p5} {p6} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: msort#(.(x,y)) -> msort#(del(min(x,y),.(x,y))) and R consists of: r1: msort(nil()) -> nil() r2: msort(.(x,y)) -> .(min(x,y),msort(del(min(x,y),.(x,y)))) r3: min(x,nil()) -> x r4: min(x,.(y,z)) -> if(<=(x,y),min(x,z),min(y,z)) r5: del(x,nil()) -> nil() r6: del(x,.(y,z)) -> if(=(x,y),z,.(y,del(x,z))) The set of usable rules consists of r3, r4, r5, r6 Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: msort#_A(x1) = x1 + (3,1) ._A(x1,x2) = ((1,0),(0,0)) x1 + x2 + (2,1) del_A(x1,x2) = ((0,0),(0,1)) x2 min_A(x1,x2) = ((1,1),(1,1)) x1 + ((1,0),(1,0)) x2 + (3,3) nil_A() = (0,1) if_A(x1,x2,x3) = (0,0) <=_A(x1,x2) = (0,0) =_A(x1,x2) = (1,1) precedence: del = min > msort# = . > nil = <= = = > if partial status: pi(msort#) = [1] pi(.) = [2] pi(del) = [] pi(min) = [] pi(nil) = [] pi(if) = [] pi(<=) = [] pi(=) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: min#(x,.(y,z)) -> min#(x,z) p2: min#(x,.(y,z)) -> min#(y,z) and R consists of: r1: msort(nil()) -> nil() r2: msort(.(x,y)) -> .(min(x,y),msort(del(min(x,y),.(x,y)))) r3: min(x,nil()) -> x r4: min(x,.(y,z)) -> if(<=(x,y),min(x,z),min(y,z)) r5: del(x,nil()) -> nil() r6: del(x,.(y,z)) -> if(=(x,y),z,.(y,del(x,z))) The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: min#_A(x1,x2) = ((1,0),(0,0)) x2 + (1,1) ._A(x1,x2) = ((1,0),(0,0)) x2 + (2,1) precedence: min# = . partial status: pi(min#) = [] pi(.) = [] The next rules are strictly ordered: p2 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: min#(x,.(y,z)) -> min#(x,z) and R consists of: r1: msort(nil()) -> nil() r2: msort(.(x,y)) -> .(min(x,y),msort(del(min(x,y),.(x,y)))) r3: min(x,nil()) -> x r4: min(x,.(y,z)) -> if(<=(x,y),min(x,z),min(y,z)) r5: del(x,nil()) -> nil() r6: del(x,.(y,z)) -> if(=(x,y),z,.(y,del(x,z))) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: min#(x,.(y,z)) -> min#(x,z) and R consists of: r1: msort(nil()) -> nil() r2: msort(.(x,y)) -> .(min(x,y),msort(del(min(x,y),.(x,y)))) r3: min(x,nil()) -> x r4: min(x,.(y,z)) -> if(<=(x,y),min(x,z),min(y,z)) r5: del(x,nil()) -> nil() r6: del(x,.(y,z)) -> if(=(x,y),z,.(y,del(x,z))) The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: min#_A(x1,x2) = x2 + (0,1) ._A(x1,x2) = ((1,1),(1,1)) x1 + ((1,0),(1,1)) x2 + (1,1) precedence: . > min# partial status: pi(min#) = [2] pi(.) = [2] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: del#(x,.(y,z)) -> del#(x,z) and R consists of: r1: msort(nil()) -> nil() r2: msort(.(x,y)) -> .(min(x,y),msort(del(min(x,y),.(x,y)))) r3: min(x,nil()) -> x r4: min(x,.(y,z)) -> if(<=(x,y),min(x,z),min(y,z)) r5: del(x,nil()) -> nil() r6: del(x,.(y,z)) -> if(=(x,y),z,.(y,del(x,z))) The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: del#_A(x1,x2) = x2 + (0,1) ._A(x1,x2) = ((1,1),(1,1)) x1 + ((1,0),(1,1)) x2 + (1,1) precedence: . > del# partial status: pi(del#) = [2] pi(.) = [2] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.