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, r5, r6, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: quot#_A(x1,x2) = max{1, x1 - 2} s_A(x1) = x1 + 99 minus_A(x1,x2) = x1 + 1 |0|_A = 6 quot_A(x1,x2) = max{1, x1} le_A(x1,x2) = max{15, x1 - 83, x2 - 100} true_A = 3 false_A = 5 low_A(x1,x2) = max{4, x1 - 101, x2 - 57} nil_A = 3 high_A(x1,x2) = max{16, x1 - 12, x2 - 8} quicksort_A(x1) = max{5, x1 - 17} base order 2: precedence: high > le > quot# = s = quot > minus = |0| > false > quicksort > low > true = nil partial status: pi(quot#) = [] pi(s) = [] pi(minus) = [] pi(|0|) = [] pi(quot) = [1] pi(le) = [] pi(true) = [] pi(false) = [] pi(low) = [] pi(nil) = [] pi(high) = [] 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 r3, r5, r6, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: minus#_A(x1,x2) = max{x1 - 1, x2 + 6} s_A(x1) = max{12, x1 + 6} quot_A(x1,x2) = max{13, x1 - 15, x2 - 19} |0|_A = 8 le_A(x1,x2) = max{13, x1 - 121, x2 - 52} true_A = 7 false_A = 7 low_A(x1,x2) = max{13, x1 - 92, x2 - 94} nil_A = 0 high_A(x1,x2) = max{14, x1 - 51, x2 - 66} quicksort_A(x1) = max{15, x1 - 21} base order 2: precedence: quot > quicksort > high > nil > low > le > minus# = s = true > |0| > false partial status: pi(minus#) = [2] pi(s) = [1] pi(quot) = [] pi(|0|) = [] pi(le) = [] pi(true) = [] pi(false) = [] pi(low) = [] pi(nil) = [] pi(high) = [] 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: 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, >MG) base order 1: max/plus interpretation on natural numbers: quicksort#_A(x1) = x1 + 14 add_A(x1,x2) = max{x1 - 9, x2 + 19} high_A(x1,x2) = x2 low_A(x1,x2) = x2 + 4 quot_A(x1,x2) = max{8, x1 - 13, x2 - 26} |0|_A = 4 s_A(x1) = max{12, x1 + 5} le_A(x1,x2) = max{2, x1 - 6} true_A = 1 false_A = 3 nil_A = 0 if_low_A(x1,x2,x3) = max{22, x1 - 4, x3 + 4} if_high_A(x1,x2,x3) = max{1, x1 - 4, x3} base order 2: precedence: quicksort# > low = quot > le = if_low > s > |0| > false > high > true = if_high > add > nil partial status: pi(quicksort#) = [1] pi(add) = [2] pi(high) = [2] pi(low) = [] pi(quot) = [] pi(|0|) = [] pi(s) = [1] pi(le) = [] pi(true) = [] pi(false) = [] pi(nil) = [] pi(if_low) = [3] pi(if_high) = [3] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: quicksort#(add(n,x)) -> quicksort#(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: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: quicksort#(add(n,x)) -> quicksort#(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, r6, r7, r10, r14, r15, r16, r17 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: quicksort#_A(x1) = x1 + 2 add_A(x1,x2) = max{19, x1 + 12, x2 + 5} high_A(x1,x2) = max{13, x2 + 2} quot_A(x1,x2) = max{3, x1 - 21, x2 - 35} |0|_A = 2 s_A(x1) = x1 + 18 le_A(x1,x2) = max{15, x1 - 19} true_A = 1 false_A = 1 low_A(x1,x2) = max{0, x1 - 14, x2 - 31} nil_A = 0 if_high_A(x1,x2,x3) = max{21, x1 - 17, x3 + 2} base order 2: precedence: high > quot = if_high > add = |0| > quicksort# = true > low > le = nil > s > false partial status: pi(quicksort#) = [1] pi(add) = [1] pi(high) = [2] pi(quot) = [] pi(|0|) = [] pi(s) = [1] pi(le) = [] pi(true) = [] pi(false) = [] pi(low) = [] pi(nil) = [] pi(if_high) = [3] 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: 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 r1, r2, r3, r5, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: if_high#_A(x1,x2,x3) = max{x2 + 27, x3 + 6} false_A = 37 add_A(x1,x2) = max{20, x1 + 13, x2 + 15} high#_A(x1,x2) = max{x1 + 27, x2 + 14} le_A(x1,x2) = max{x1 + 12, x2 + 18} true_A = 17 minus_A(x1,x2) = max{x1 + 1, x2} |0|_A = 18 s_A(x1) = x1 + 19 quot_A(x1,x2) = max{20, x1 - 22, x2 - 39} low_A(x1,x2) = max{72, x1 - 16, x2 - 44} nil_A = 0 high_A(x1,x2) = max{x1 + 58, x2 - 43} quicksort_A(x1) = max{1, x1 - 58} base order 2: precedence: if_high# = high# = s = quot > le = minus = |0| > false > add = low > quicksort > high > true = nil partial status: pi(if_high#) = [3] pi(false) = [] pi(add) = [2] pi(high#) = [2] pi(le) = [1] pi(true) = [] pi(minus) = [2] pi(|0|) = [] pi(s) = [1] pi(quot) = [] pi(low) = [] pi(nil) = [] pi(high) = [] pi(quicksort) = [] The following rules are removed: p3 -- SCC decomposition. 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)) 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: {p1, p2} -- 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)) 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, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: if_high#_A(x1,x2,x3) = max{33, x1 + 23, x3 + 10} false_A = 10 add_A(x1,x2) = max{x1 + 45, x2 + 23} high#_A(x1,x2) = max{32, x2 + 22} le_A(x1,x2) = max{8, x1 + 6} quot_A(x1,x2) = max{19, x1 - 19, x2 - 25} |0|_A = 0 s_A(x1) = max{18, x1 + 5} true_A = 7 low_A(x1,x2) = max{70, x1 - 37, x2 - 46} nil_A = 0 high_A(x1,x2) = max{8, x1 - 39, x2 - 61} quicksort_A(x1) = max{9, x1 - 83} base order 2: precedence: high# > if_high# > add > |0| = quicksort > quot = s = low > le > false > high > true = nil partial status: pi(if_high#) = [3] pi(false) = [] pi(add) = [1] pi(high#) = [] pi(le) = [1] pi(quot) = [] pi(|0|) = [] pi(s) = [1] pi(true) = [] pi(low) = [] pi(nil) = [] pi(high) = [] pi(quicksort) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: high#(n,add(m,x)) -> if_high#(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: 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 r3, r10 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: if_low#_A(x1,x2,x3) = max{x2 + 52, x3 + 2} false_A = 21 add_A(x1,x2) = max{x1 + 38, x2 + 13} low#_A(x1,x2) = max{x1 + 52, x2 + 12} le_A(x1,x2) = max{x1 - 2, x2 + 4} true_A = 15 quot_A(x1,x2) = max{4, x1 - 3} |0|_A = 1 s_A(x1) = max{22, x1 + 3} low_A(x1,x2) = max{110, x1 + 63, x2 - 11} nil_A = 64 base order 2: precedence: low > add > true = nil > if_low# = low# > le = quot > s > |0| > false partial status: pi(if_low#) = [3] pi(false) = [] pi(add) = [2] pi(low#) = [2] pi(le) = [] pi(true) = [] pi(quot) = [] pi(|0|) = [] pi(s) = [] pi(low) = [] pi(nil) = [] The following rules are removed: p1 -- 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)) p2: 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 estimated dependency graph contains the following SCCs: {p1, p2} -- Reduction pair. 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)) p2: 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 r3, r6, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: low#_A(x1,x2) = x2 + 2 add_A(x1,x2) = max{x1 + 40, x2 + 15} if_low#_A(x1,x2,x3) = x3 + 1 le_A(x1,x2) = max{65, x1 - 67, x2 + 54} true_A = 69 quot_A(x1,x2) = max{69, x1 - 69, x2 - 136} |0|_A = 68 s_A(x1) = max{66, x1 + 12} false_A = 27 low_A(x1,x2) = 178 nil_A = 0 high_A(x1,x2) = max{13, x2 - 8} quicksort_A(x1) = max{0, x1 - 12} base order 2: precedence: add = low = quicksort > high > true = nil > low# > if_low# = le = quot = s > |0| > false partial status: pi(low#) = [2] pi(add) = [2] pi(if_low#) = [3] pi(le) = [] pi(true) = [] pi(quot) = [] pi(|0|) = [] pi(s) = [1] pi(false) = [] pi(low) = [] pi(nil) = [] pi(high) = [] pi(quicksort) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: 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 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 r3, r5, r6, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: le#_A(x1,x2) = max{3, x1 - 1, x2 + 1} s_A(x1) = max{7, x1 + 5} quot_A(x1,x2) = max{8, x1 - 13, x2 - 16} |0|_A = 4 le_A(x1,x2) = max{8, x1 - 68, x2 - 39} true_A = 3 false_A = 3 low_A(x1,x2) = max{11, x1 - 18, x2 - 19} nil_A = 8 high_A(x1,x2) = max{9, x1 - 38, x2 - 48} quicksort_A(x1) = max{10, x1 - 16} base order 2: precedence: nil > quot = low > quicksort > high > le > le# = s = true > |0| > false partial status: pi(le#) = [2] pi(s) = [1] pi(quot) = [] pi(|0|) = [] pi(le) = [] pi(true) = [] pi(false) = [] pi(low) = [] pi(nil) = [] pi(high) = [] 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: 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 r3, r5, r6, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: app#_A(x1,x2) = max{x1 + 64, x2 + 50} add_A(x1,x2) = max{x1 - 14, x2 + 48} quot_A(x1,x2) = max{32, x1 - 32, x2 - 69} |0|_A = 2 s_A(x1) = max{3, x1 - 33} le_A(x1,x2) = max{10, x1 - 24, x2 - 32} true_A = 1 false_A = 1 low_A(x1,x2) = max{x1 + 2, x2 + 2} nil_A = 3 high_A(x1,x2) = max{5, x1 - 31, x2 - 9} quicksort_A(x1) = max{4, x1 - 16} base order 2: precedence: app# = low > add > quicksort > nil = high > le > quot = s > |0| > true = false partial status: pi(app#) = [1] pi(add) = [2] pi(quot) = [] pi(|0|) = [] pi(s) = [] pi(le) = [] pi(true) = [] pi(false) = [] pi(low) = [] pi(nil) = [] pi(high) = [] pi(quicksort) = [] The following rules are removed: p1 Then no dependency pair remains.