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, r10, r18 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: quot#_A(x1,x2) = 0 s_A(x1) = x1 + 11 minus_A(x1,x2) = max{x1 + 11, x2 - 12} |0|_A = 6 low_A(x1,x2) = max{40, x1 - 17, x2 - 17} nil_A = 16 quicksort_A(x1) = max{23, x1 - 25} quot#!_A(x1,x2) = max{x1 + 26, x2 + 3} s!_A(x1) = max{7, x1 - 2} minus!_A(x1,x2) = max{2, x1 - 12} |0|!_A = 6 low!_A(x1,x2) = max{2, x1 - 84, x2 - 171} nil!_A = 0 quicksort!_A(x1) = max{6, x1 - 41} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: quot#_A(x1,x2) = max{0, x1 - 10, x2 - 11} s_A(x1) = x1 + 9 minus_A(x1,x2) = max{9, x1 + 3, x2 + 6} |0|_A = 8 low_A(x1,x2) = max{39, x1 - 13, x2 - 13} nil_A = 8 quicksort_A(x1) = max{25, x1 - 27} quot#!_A(x1,x2) = max{1, x1 - 4, x2 - 7} s!_A(x1) = max{6, x1 - 162} minus!_A(x1,x2) = max{4, x1 - 5, x2 - 157} |0|!_A = 2 low!_A(x1,x2) = max{0, x1 - 78, x2 - 122} nil!_A = 0 quicksort!_A(x1) = max{0, x1 - 40} partial status: pi(quot#) = [1] pi(s) = [1] pi(minus) = [1] pi(|0|) = [] pi(low) = [] pi(nil) = [] pi(quicksort) = [] 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 (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. 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{11, x1 + 2} minus#!_A(x1,x2) = max{8, x1 - 12, x2 - 17} s!_A(x1) = max{7, x1 - 16} 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{11, x1 + 2} minus#!_A(x1,x2) = max{1, x1 - 12, x2 - 12} s!_A(x1) = max{5, x1 - 2} partial status: pi(minus#) = [1] pi(s) = [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: 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 r3, r5, r6, r7, r10, r11, r12, r13, r14, r15, r16, r17 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: quicksort#_A(x1) = 0 add_A(x1,x2) = 69 high_A(x1,x2) = x1 + 68 low_A(x1,x2) = x1 + 77 quot_A(x1,x2) = max{24, x1 - 1, x2 - 4} |0|_A = 13 s_A(x1) = max{2, x1} le_A(x1,x2) = max{67, x2 + 55} true_A = 67 false_A = 68 nil_A = 61 if_low_A(x1,x2,x3) = max{x2 + 77, x3 - 29} if_high_A(x1,x2,x3) = max{x1 + 1, x2 + 68} quicksort#!_A(x1) = 2 add!_A(x1,x2) = max{15, x2 - 40} high!_A(x1,x2) = x1 + 29 low!_A(x1,x2) = x1 + 139 quot!_A(x1,x2) = max{x1 + 22, x2 + 18} |0|!_A = 17 s!_A(x1) = max{12, x1 + 1} le!_A(x1,x2) = 14 true!_A = 16 false!_A = 13 nil!_A = 28 if_low!_A(x1,x2,x3) = max{x2 + 139, x3 - 68} if_high!_A(x1,x2,x3) = max{x1 - 54, x2 + 29, x3 - 53} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: quicksort#_A(x1) = 0 add_A(x1,x2) = max{x1 + 23, x2 + 21} high_A(x1,x2) = max{2, x2} low_A(x1,x2) = max{21, x2 + 19} quot_A(x1,x2) = max{x1 + 2, x2 - 1} |0|_A = 2 s_A(x1) = x1 + 2 le_A(x1,x2) = max{34, x2 + 1} true_A = 16 false_A = 18 nil_A = 0 if_low_A(x1,x2,x3) = max{41, x3 + 19} if_high_A(x1,x2,x3) = max{22, x3} quicksort#!_A(x1) = max{9, x1 - 7} add!_A(x1,x2) = 0 high!_A(x1,x2) = max{x1 + 12, x2 + 15} low!_A(x1,x2) = max{8, x2 - 5} quot!_A(x1,x2) = 1 |0|!_A = 2 s!_A(x1) = max{3, x1 - 4} le!_A(x1,x2) = max{37, x1 - 5, x2 + 13} true!_A = 3 false!_A = 37 nil!_A = 0 if_low!_A(x1,x2,x3) = max{15, x3 - 16} if_high!_A(x1,x2,x3) = max{x1 - 2, x2 + 12, x3 - 6} partial status: pi(quicksort#) = [] pi(add) = [1, 2] pi(high) = [2] pi(low) = [2] pi(quot) = [] pi(|0|) = [] pi(s) = [1] pi(le) = [1] pi(true) = [] pi(false) = [] pi(nil) = [] pi(if_low) = [3] pi(if_high) = [3] 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 r5, r6, r7 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: if_high#_A(x1,x2,x3) = max{0, x1 - 1, x2 - 3, x3 - 26} false_A = 0 add_A(x1,x2) = max{24, x1 + 17, x2 + 17} high#_A(x1,x2) = max{0, x1 - 3, x2 - 26} le_A(x1,x2) = max{0, x1 - 49, x2 - 49} true_A = 0 |0|_A = 33 s_A(x1) = max{48, x1 + 47} if_high#!_A(x1,x2,x3) = max{17, x3 - 14} false!_A = 14 add!_A(x1,x2) = max{16, x1 - 4, x2 - 25} high#!_A(x1,x2) = max{2, x2 - 6} le!_A(x1,x2) = max{12, x1 - 34, x2 - 49} true!_A = 1 |0|!_A = 15 s!_A(x1) = max{17, x1 - 99} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: if_high#_A(x1,x2,x3) = max{0, x1 - 1, x2 - 483, x3 - 16} false_A = 0 add_A(x1,x2) = max{10, x1 - 284, x2 + 4} high#_A(x1,x2) = max{0, x1 - 483, x2 - 12} le_A(x1,x2) = max{0, x1 - 492, x2 - 482} true_A = 0 |0|_A = 481 s_A(x1) = max{491, x1 + 11} if_high#!_A(x1,x2,x3) = max{289, x3 + 285} false!_A = 5 add!_A(x1,x2) = max{6, x1 - 495, x2 - 143} high#!_A(x1,x2) = x2 + 286 le!_A(x1,x2) = max{3, x1 - 458, x2 - 492} true!_A = 9 |0|!_A = 4 s!_A(x1) = max{6, x1 - 458} partial status: pi(if_high#) = [2] pi(false) = [] pi(add) = [1] pi(high#) = [1] pi(le) = [] pi(true) = [] pi(|0|) = [] pi(s) = [1] 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, r10 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. 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 - 10} false_A = 0 add_A(x1,x2) = max{8, x1 + 6, x2 + 6} low#_A(x1,x2) = max{0, x1 - 3, x2 - 10} le_A(x1,x2) = max{0, x1 - 15, x2 - 15} true_A = 0 |0|_A = 5 s_A(x1) = max{14, x1 + 4} low_A(x1,x2) = max{50, x1 + 15} nil_A = 16 if_low#!_A(x1,x2,x3) = 0 false!_A = 21 add!_A(x1,x2) = max{0, x2 - 4} low#!_A(x1,x2) = max{0, x2 - 5} le!_A(x1,x2) = max{24, x2 - 28} true!_A = 23 |0|!_A = 22 s!_A(x1) = max{23, x1 - 29} low!_A(x1,x2) = max{26, x1 + 3, x2 - 17} nil!_A = 2 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 - 36} false_A = 0 add_A(x1,x2) = max{34, x1 - 111, x2 + 7} low#_A(x1,x2) = max{0, x1 - 3, x2 - 36} le_A(x1,x2) = max{0, x1 - 146, x2 - 14} true_A = 0 |0|_A = 13 s_A(x1) = max{16, x1 + 13} low_A(x1,x2) = max{110, x1 - 111} nil_A = 7 if_low#!_A(x1,x2,x3) = max{0, x1 - 1, x2 - 1, x3 - 36} false!_A = 2 add!_A(x1,x2) = max{x1 + 2, x2 + 192} low#!_A(x1,x2) = max{1, x2 - 37} le!_A(x1,x2) = max{25, x1 - 120, x2 - 136} true!_A = 5 |0|!_A = 6 s!_A(x1) = x1 + 24 low!_A(x1,x2) = max{193, x1 - 54, x2 - 37} nil!_A = 0 partial status: pi(if_low#) = [3] pi(false) = [] pi(add) = [2] pi(low#) = [2] pi(le) = [] pi(true) = [] pi(|0|) = [] pi(s) = [1] pi(low) = [2] pi(nil) = [] 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: 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 (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: le#_A(x1,x2) = max{0, x1 - 2, x2 - 2} s_A(x1) = max{7, x1 + 1} le#!_A(x1,x2) = max{45, x1 - 8, x2 - 10} s!_A(x1) = max{44, x1 - 9} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: le#_A(x1,x2) = max{0, x1 - 6, x2 - 6} s_A(x1) = max{8, x1 + 5} le#!_A(x1,x2) = max{5, x1 - 88, x2 - 9} s!_A(x1) = max{4, x1 - 87} partial status: pi(le#) = [1] pi(s) = [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: 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 (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 2} add_A(x1,x2) = max{4, x1 - 46, x2 + 1} app#!_A(x1,x2) = max{3, x1 - 5, x2 - 1} add!_A(x1,x2) = max{2, x1 - 104, x2 - 61} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 7} add_A(x1,x2) = max{14, x1 - 85, x2 + 6} app#!_A(x1,x2) = max{7, x1 - 131, x2 - 1} add!_A(x1,x2) = max{6, x1 - 220, x2 - 130} partial status: pi(app#) = [1] pi(add) = [2] The following rules are removed: p1 Then no dependency pair remains.