YES We show the termination of the TRS R: minus(x,|0|()) -> x minus(s(x),s(y)) -> minus(x,y) quot(|0|(),s(y)) -> |0|() quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) le(|0|(),y) -> true() le(s(x),|0|()) -> false() le(s(x),s(y)) -> le(x,y) app(nil(),y) -> y app(add(n,x),y) -> add(n,app(x,y)) low(n,nil()) -> nil() low(n,add(m,x)) -> if_low(le(m,n),n,add(m,x)) if_low(true(),n,add(m,x)) -> add(m,low(n,x)) if_low(false(),n,add(m,x)) -> low(n,x) high(n,nil()) -> nil() high(n,add(m,x)) -> if_high(le(m,n),n,add(m,x)) if_high(true(),n,add(m,x)) -> high(n,x) if_high(false(),n,add(m,x)) -> add(m,high(n,x)) quicksort(nil()) -> nil() quicksort(add(n,x)) -> app(quicksort(low(n,x)),add(n,quicksort(high(n,x)))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: minus#(s(x),s(y)) -> minus#(x,y) p2: quot#(s(x),s(y)) -> quot#(minus(x,y),s(y)) p3: quot#(s(x),s(y)) -> minus#(x,y) p4: le#(s(x),s(y)) -> le#(x,y) p5: app#(add(n,x),y) -> app#(x,y) p6: low#(n,add(m,x)) -> if_low#(le(m,n),n,add(m,x)) p7: low#(n,add(m,x)) -> le#(m,n) p8: if_low#(true(),n,add(m,x)) -> low#(n,x) p9: if_low#(false(),n,add(m,x)) -> low#(n,x) p10: high#(n,add(m,x)) -> if_high#(le(m,n),n,add(m,x)) p11: high#(n,add(m,x)) -> le#(m,n) p12: if_high#(true(),n,add(m,x)) -> high#(n,x) p13: if_high#(false(),n,add(m,x)) -> high#(n,x) p14: quicksort#(add(n,x)) -> app#(quicksort(low(n,x)),add(n,quicksort(high(n,x)))) p15: quicksort#(add(n,x)) -> quicksort#(low(n,x)) p16: quicksort#(add(n,x)) -> low#(n,x) p17: quicksort#(add(n,x)) -> quicksort#(high(n,x)) p18: quicksort#(add(n,x)) -> high#(n,x) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: low(n,nil()) -> nil() r11: low(n,add(m,x)) -> if_low(le(m,n),n,add(m,x)) r12: if_low(true(),n,add(m,x)) -> add(m,low(n,x)) r13: if_low(false(),n,add(m,x)) -> low(n,x) r14: high(n,nil()) -> nil() r15: high(n,add(m,x)) -> if_high(le(m,n),n,add(m,x)) r16: if_high(true(),n,add(m,x)) -> high(n,x) r17: if_high(false(),n,add(m,x)) -> add(m,high(n,x)) r18: quicksort(nil()) -> nil() r19: quicksort(add(n,x)) -> app(quicksort(low(n,x)),add(n,quicksort(high(n,x)))) The estimated dependency graph contains the following SCCs: {p2} {p1} {p15, p17} {p10, p12, p13} {p6, p8, p9} {p4} {p5} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: quot#(s(x),s(y)) -> quot#(minus(x,y),s(y)) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: low(n,nil()) -> nil() r11: low(n,add(m,x)) -> if_low(le(m,n),n,add(m,x)) r12: if_low(true(),n,add(m,x)) -> add(m,low(n,x)) r13: if_low(false(),n,add(m,x)) -> low(n,x) r14: high(n,nil()) -> nil() r15: high(n,add(m,x)) -> if_high(le(m,n),n,add(m,x)) r16: if_high(true(),n,add(m,x)) -> high(n,x) r17: if_high(false(),n,add(m,x)) -> add(m,high(n,x)) r18: quicksort(nil()) -> nil() r19: quicksort(add(n,x)) -> app(quicksort(low(n,x)),add(n,quicksort(high(n,x)))) The set of usable rules consists of r1, r2, r3, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: quot#_A(x1,x2) = x1 + 1 s_A(x1) = x1 + 4 minus_A(x1,x2) = x1 + 1 |0|_A() = 2 quot_A(x1,x2) = 3 high_A(x1,x2) = x1 + x2 + 3 nil_A() = 1 quicksort_A(x1) = x1 + 3 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: quot#_A(x1,x2) = max{51, x1 + 34, x2 - 35} s_A(x1) = x1 + 34 minus_A(x1,x2) = max{17, x1 + 16} |0|_A = 0 quot_A(x1,x2) = max{17, x1} high_A(x1,x2) = max{40, x1 - 125, x2 - 42} nil_A = 9 quicksort_A(x1) = max{39, x1 - 10} quot#!_A(x1,x2) = max{67, x1 + 34} s!_A(x1) = x1 + 52 minus!_A(x1,x2) = max{66, x1 - 35, x2 - 35} |0|!_A = 53 quot!_A(x1,x2) = max{49, x1 + 34} high!_A(x1,x2) = max{50, x1 - 36, x2 - 8} nil!_A = 0 quicksort!_A(x1) = max{0, x1 - 58} partial status: pi(quot#) = [] pi(s) = [] pi(minus) = [1] pi(|0|) = [] pi(quot) = [] pi(high) = [2] pi(nil) = [] pi(quicksort) = [1] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: minus#(s(x),s(y)) -> minus#(x,y) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: low(n,nil()) -> nil() r11: low(n,add(m,x)) -> if_low(le(m,n),n,add(m,x)) r12: if_low(true(),n,add(m,x)) -> add(m,low(n,x)) r13: if_low(false(),n,add(m,x)) -> low(n,x) r14: high(n,nil()) -> nil() r15: high(n,add(m,x)) -> if_high(le(m,n),n,add(m,x)) r16: if_high(true(),n,add(m,x)) -> high(n,x) r17: if_high(false(),n,add(m,x)) -> add(m,high(n,x)) r18: quicksort(nil()) -> nil() r19: quicksort(add(n,x)) -> app(quicksort(low(n,x)),add(n,quicksort(high(n,x)))) The set of usable rules consists of r14 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: minus#_A(x1,x2) = 0 s_A(x1) = 8 high_A(x1,x2) = x1 + x2 + 4 nil_A() = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{0, x1 - 3, x2 - 3} s_A(x1) = max{67, x1 + 2} high_A(x1,x2) = max{57, x1 - 48, x2 - 47} nil_A = 30 minus#!_A(x1,x2) = max{1, x1 - 3, x2 - 68} s!_A(x1) = max{70, x1 + 68} high!_A(x1,x2) = max{92, x1 - 1, x2 - 31} nil!_A = 91 partial status: pi(minus#) = [] pi(s) = [] pi(high) = [1] pi(nil) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: quicksort#(add(n,x)) -> quicksort#(high(n,x)) p2: quicksort#(add(n,x)) -> quicksort#(low(n,x)) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: low(n,nil()) -> nil() r11: low(n,add(m,x)) -> if_low(le(m,n),n,add(m,x)) r12: if_low(true(),n,add(m,x)) -> add(m,low(n,x)) r13: if_low(false(),n,add(m,x)) -> low(n,x) r14: high(n,nil()) -> nil() r15: high(n,add(m,x)) -> if_high(le(m,n),n,add(m,x)) r16: if_high(true(),n,add(m,x)) -> high(n,x) r17: if_high(false(),n,add(m,x)) -> add(m,high(n,x)) r18: quicksort(nil()) -> nil() r19: quicksort(add(n,x)) -> app(quicksort(low(n,x)),add(n,quicksort(high(n,x)))) The set of usable rules consists of r5, r6, r7, r10, r11, r12, r13, r14, r15, r16, r17, r18 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: quicksort#_A(x1) = x1 + 3 add_A(x1,x2) = x2 + 2 high_A(x1,x2) = x2 low_A(x1,x2) = x2 + 1 le_A(x1,x2) = 5 |0|_A() = 5 true_A() = 4 s_A(x1) = x1 + 6 false_A() = 0 nil_A() = 1 if_low_A(x1,x2,x3) = x3 + 1 if_high_A(x1,x2,x3) = x3 quicksort_A(x1) = 3 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: quicksort#_A(x1) = 0 add_A(x1,x2) = max{9, x1 - 15, x2} high_A(x1,x2) = max{x1 + 8, x2} low_A(x1,x2) = max{16, x1 - 15, x2} le_A(x1,x2) = max{0, x1 - 4, x2 - 7} |0|_A = 3 true_A = 0 s_A(x1) = max{3, x1 + 1} false_A = 0 nil_A = 9 if_low_A(x1,x2,x3) = max{16, x2 - 15, x3} if_high_A(x1,x2,x3) = max{x2 + 8, x3} quicksort_A(x1) = x1 + 7 quicksort#!_A(x1) = max{1, x1 - 10} add!_A(x1,x2) = 6 high!_A(x1,x2) = max{2, x1 - 26, x2 - 10} low!_A(x1,x2) = max{x1 + 5, x2 + 22} le!_A(x1,x2) = max{8, x2 - 6} |0|!_A = 8 true!_A = 8 s!_A(x1) = max{8, x1 - 5} false!_A = 5 nil!_A = 1 if_low!_A(x1,x2,x3) = max{x2 + 5, x3 + 22} if_high!_A(x1,x2,x3) = max{0, x2 - 27, x3 - 36} quicksort!_A(x1) = max{3, x1 - 13} partial status: pi(quicksort#) = [1] pi(add) = [] pi(high) = [2] pi(low) = [] pi(le) = [] pi(|0|) = [] pi(true) = [] pi(s) = [1] pi(false) = [] pi(nil) = [] pi(if_low) = [] pi(if_high) = [3] pi(quicksort) = [] The following rules are removed: p1, p2 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: if_high#(false(),n,add(m,x)) -> high#(n,x) p2: high#(n,add(m,x)) -> if_high#(le(m,n),n,add(m,x)) p3: if_high#(true(),n,add(m,x)) -> high#(n,x) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: low(n,nil()) -> nil() r11: low(n,add(m,x)) -> if_low(le(m,n),n,add(m,x)) r12: if_low(true(),n,add(m,x)) -> add(m,low(n,x)) r13: if_low(false(),n,add(m,x)) -> low(n,x) r14: high(n,nil()) -> nil() r15: high(n,add(m,x)) -> if_high(le(m,n),n,add(m,x)) r16: if_high(true(),n,add(m,x)) -> high(n,x) r17: if_high(false(),n,add(m,x)) -> add(m,high(n,x)) r18: quicksort(nil()) -> nil() r19: quicksort(add(n,x)) -> app(quicksort(low(n,x)),add(n,quicksort(high(n,x)))) The set of usable rules consists of r3, r5, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: if_high#_A(x1,x2,x3) = x3 false_A() = 8 add_A(x1,x2) = x2 + 2 high#_A(x1,x2) = x2 + 2 le_A(x1,x2) = 7 true_A() = 3 quot_A(x1,x2) = 10 |0|_A() = 9 s_A(x1) = x1 + 11 low_A(x1,x2) = x1 + x2 + 4 nil_A() = 1 high_A(x1,x2) = x1 + x2 + 9 quicksort_A(x1) = x1 + 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: if_high#_A(x1,x2,x3) = max{1, x2 - 2, x3 - 15} false_A = 0 add_A(x1,x2) = max{14, x1 + 1, x2 + 6} high#_A(x1,x2) = max{1, x1 - 2, x2 - 15} le_A(x1,x2) = max{x1, x2} true_A = 0 quot_A(x1,x2) = max{1, x1 - 246, x2 - 407} |0|_A = 0 s_A(x1) = max{163, x1 + 162} low_A(x1,x2) = max{67, x1 - 7} nil_A = 1 high_A(x1,x2) = max{40, x1 - 10, x2 - 16} quicksort_A(x1) = max{24, x1 - 41} if_high#!_A(x1,x2,x3) = max{73, x2 + 72, x3 + 71} false!_A = 74 add!_A(x1,x2) = max{72, x2 - 160} high#!_A(x1,x2) = max{71, x2 - 161} le!_A(x1,x2) = max{73, x1 - 164} true!_A = 1 quot!_A(x1,x2) = max{1, x1 - 84, x2 - 86} |0|!_A = 75 s!_A(x1) = max{245, x1 + 243} low!_A(x1,x2) = max{73, x1 - 162, x2 - 165} nil!_A = 1 high!_A(x1,x2) = max{71, x2 - 167} quicksort!_A(x1) = max{0, x1 - 143} partial status: pi(if_high#) = [] pi(false) = [] pi(add) = [2] pi(high#) = [] pi(le) = [] pi(true) = [] pi(quot) = [] pi(|0|) = [] pi(s) = [1] pi(low) = [2] pi(nil) = [] pi(high) = [] pi(quicksort) = [] The following rules are removed: p1, p2, p3 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: if_low#(false(),n,add(m,x)) -> low#(n,x) p2: low#(n,add(m,x)) -> if_low#(le(m,n),n,add(m,x)) p3: if_low#(true(),n,add(m,x)) -> low#(n,x) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: low(n,nil()) -> nil() r11: low(n,add(m,x)) -> if_low(le(m,n),n,add(m,x)) r12: if_low(true(),n,add(m,x)) -> add(m,low(n,x)) r13: if_low(false(),n,add(m,x)) -> low(n,x) r14: high(n,nil()) -> nil() r15: high(n,add(m,x)) -> if_high(le(m,n),n,add(m,x)) r16: if_high(true(),n,add(m,x)) -> high(n,x) r17: if_high(false(),n,add(m,x)) -> add(m,high(n,x)) r18: quicksort(nil()) -> nil() r19: quicksort(add(n,x)) -> app(quicksort(low(n,x)),add(n,quicksort(high(n,x)))) The set of usable rules consists of r5, r6, r7 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: if_low#_A(x1,x2,x3) = 1 false_A() = 2 add_A(x1,x2) = x2 + 5 low#_A(x1,x2) = 1 le_A(x1,x2) = 13 true_A() = 2 |0|_A() = 3 s_A(x1) = x1 + 14 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: if_low#_A(x1,x2,x3) = max{0, x1 - 1, x2 - 3, x3 - 35} false_A = 0 add_A(x1,x2) = max{33, x1 + 28, x2 + 28} low#_A(x1,x2) = max{0, x1 - 3, x2 - 35} le_A(x1,x2) = max{0, x1 - 16, x2 - 16} true_A = 0 |0|_A = 2 s_A(x1) = x1 + 15 if_low#!_A(x1,x2,x3) = max{12, x3 - 47} false!_A = 1 add!_A(x1,x2) = max{5, x2 - 20} low#!_A(x1,x2) = max{4, x2 - 21} le!_A(x1,x2) = max{6, x1 - 3, x2 - 15} true!_A = 1 |0|!_A = 2 s!_A(x1) = x1 + 15 partial status: pi(if_low#) = [] pi(false) = [] pi(add) = [2] pi(low#) = [] pi(le) = [] pi(true) = [] pi(|0|) = [] pi(s) = [1] The following rules are removed: p1, p3 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: low#(n,add(m,x)) -> if_low#(le(m,n),n,add(m,x)) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: low(n,nil()) -> nil() r11: low(n,add(m,x)) -> if_low(le(m,n),n,add(m,x)) r12: if_low(true(),n,add(m,x)) -> add(m,low(n,x)) r13: if_low(false(),n,add(m,x)) -> low(n,x) r14: high(n,nil()) -> nil() r15: high(n,add(m,x)) -> if_high(le(m,n),n,add(m,x)) r16: if_high(true(),n,add(m,x)) -> high(n,x) r17: if_high(false(),n,add(m,x)) -> add(m,high(n,x)) r18: quicksort(nil()) -> nil() r19: quicksort(add(n,x)) -> app(quicksort(low(n,x)),add(n,quicksort(high(n,x)))) The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: le#(s(x),s(y)) -> le#(x,y) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: low(n,nil()) -> nil() r11: low(n,add(m,x)) -> if_low(le(m,n),n,add(m,x)) r12: if_low(true(),n,add(m,x)) -> add(m,low(n,x)) r13: if_low(false(),n,add(m,x)) -> low(n,x) r14: high(n,nil()) -> nil() r15: high(n,add(m,x)) -> if_high(le(m,n),n,add(m,x)) r16: if_high(true(),n,add(m,x)) -> high(n,x) r17: if_high(false(),n,add(m,x)) -> add(m,high(n,x)) r18: quicksort(nil()) -> nil() r19: quicksort(add(n,x)) -> app(quicksort(low(n,x)),add(n,quicksort(high(n,x)))) The set of usable rules consists of r14 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: le#_A(x1,x2) = 0 s_A(x1) = 8 high_A(x1,x2) = x1 + x2 + 4 nil_A() = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: le#_A(x1,x2) = max{0, x1 - 89, x2 - 89} s_A(x1) = max{129, x1 + 88} high_A(x1,x2) = max{100, x1 - 82, x2 - 77} nil_A = 74 le#!_A(x1,x2) = max{1, x1 - 89, x2 - 89} s!_A(x1) = max{222, x1 + 220} high!_A(x1,x2) = max{302, x1 - 1, x2 - 75} nil!_A = 301 partial status: pi(le#) = [] pi(s) = [] pi(high) = [1] pi(nil) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(add(n,x),y) -> app#(x,y) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: le(|0|(),y) -> true() r6: le(s(x),|0|()) -> false() r7: le(s(x),s(y)) -> le(x,y) r8: app(nil(),y) -> y r9: app(add(n,x),y) -> add(n,app(x,y)) r10: low(n,nil()) -> nil() r11: low(n,add(m,x)) -> if_low(le(m,n),n,add(m,x)) r12: if_low(true(),n,add(m,x)) -> add(m,low(n,x)) r13: if_low(false(),n,add(m,x)) -> low(n,x) r14: high(n,nil()) -> nil() r15: high(n,add(m,x)) -> if_high(le(m,n),n,add(m,x)) r16: if_high(true(),n,add(m,x)) -> high(n,x) r17: if_high(false(),n,add(m,x)) -> add(m,high(n,x)) r18: quicksort(nil()) -> nil() r19: quicksort(add(n,x)) -> app(quicksort(low(n,x)),add(n,quicksort(high(n,x)))) The set of usable rules consists of r5, r6 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: app#_A(x1,x2) = x1 add_A(x1,x2) = x2 + 3 le_A(x1,x2) = x2 + 2 |0|_A() = 4 true_A() = 1 s_A(x1) = x1 + 3 false_A() = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 8} add_A(x1,x2) = max{x1 - 64, x2 + 7} le_A(x1,x2) = max{86, x1 - 2, x2 - 2} |0|_A = 1 true_A = 0 s_A(x1) = max{1, x1 - 216} false_A = 0 app#!_A(x1,x2) = max{68, x1 - 32} add!_A(x1,x2) = max{x1 + 69, x2 - 31} le!_A(x1,x2) = max{214, x2 - 2} |0|!_A = 216 true!_A = 1 s!_A(x1) = x1 + 214 false!_A = 214 partial status: pi(app#) = [1] pi(add) = [] pi(le) = [] pi(|0|) = [] pi(true) = [] pi(s) = [1] pi(false) = [] The following rules are removed: p1 Then no dependency pair remains.