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, r7, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) 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 + 3 minus_A(x1,x2) = x1 + 1 |0|_A() = 2 quot_A(x1,x2) = x1 + 3 le_A(x1,x2) = x1 + x2 + 6 true_A() = 1 false_A() = 1 low_A(x1,x2) = x1 + x2 + 4 nil_A() = 1 high_A(x1,x2) = x1 + x2 + 2 quicksort_A(x1) = x1 + 2 base order 2: precedence: le > low = high > quicksort > s = quot = nil > quot# = |0| > minus = true = false partial status: pi(quot#) = [1] pi(s) = [] pi(minus) = [] pi(|0|) = [] pi(quot) = [1] pi(le) = [1] 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, r7, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: minus#_A(x1,x2) = x1 s_A(x1) = x1 + 4 quot_A(x1,x2) = 3 |0|_A() = 2 le_A(x1,x2) = x1 + x2 + 6 true_A() = 1 false_A() = 1 low_A(x1,x2) = x1 + x2 + 2 nil_A() = 1 high_A(x1,x2) = x1 + x2 + 6 quicksort_A(x1) = x1 + 2 base order 2: precedence: minus# = le > s > quot > |0| > false > low > high = quicksort > true = nil partial status: pi(minus#) = [1] pi(s) = [1] pi(quot) = [] pi(|0|) = [] pi(le) = [] pi(true) = [] pi(false) = [] pi(low) = [] pi(nil) = [] pi(high) = [1, 2] 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: 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 r1, r2, 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: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: quicksort#_A(x1) = x1 add_A(x1,x2) = x1 + x2 + 3 high_A(x1,x2) = x1 + x2 + 2 low_A(x1,x2) = x1 + x2 + 2 minus_A(x1,x2) = x1 + x2 + 5 |0|_A() = 2 s_A(x1) = x1 + 3 quot_A(x1,x2) = x1 + 1 le_A(x1,x2) = x1 + x2 + 6 true_A() = 1 false_A() = 1 nil_A() = 1 if_low_A(x1,x2,x3) = x2 + x3 + 2 if_high_A(x1,x2,x3) = x2 + x3 + 2 base order 2: precedence: |0| > minus = s = quot > le > true = false > low > high > nil = if_low = if_high > add > quicksort# partial status: pi(quicksort#) = [1] pi(add) = [1] pi(high) = [2] pi(low) = [2] pi(minus) = [1] pi(|0|) = [] pi(s) = [1] pi(quot) = [] pi(le) = [1] pi(true) = [] pi(false) = [] pi(nil) = [] pi(if_low) = [3] pi(if_high) = [3] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: 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 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#(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 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: quicksort#_A(x1) = x1 add_A(x1,x2) = x1 + x2 + 4 low_A(x1,x2) = x1 + x2 + 2 quot_A(x1,x2) = 0 |0|_A() = 0 s_A(x1) = 6 le_A(x1,x2) = 5 true_A() = 1 false_A() = 1 nil_A() = 1 if_low_A(x1,x2,x3) = x2 + x3 + 2 high_A(x1,x2) = x1 + x2 + 2 base order 2: precedence: s > false > low > if_low > add > quicksort# > quot = high > le = nil > true > |0| partial status: pi(quicksort#) = [] pi(add) = [] pi(low) = [] pi(quot) = [] pi(|0|) = [] pi(s) = [] pi(le) = [] pi(true) = [] pi(false) = [] pi(nil) = [] pi(if_low) = [] pi(high) = [1, 2] 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, r6, r7, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: if_high#_A(x1,x2,x3) = x1 + x3 false_A() = 0 add_A(x1,x2) = x1 + x2 + 4 high#_A(x1,x2) = x2 + 4 le_A(x1,x2) = 4 true_A() = 2 minus_A(x1,x2) = x1 + x2 + 6 |0|_A() = 3 s_A(x1) = x1 + 5 quot_A(x1,x2) = x1 + x2 low_A(x1,x2) = 1 nil_A() = 0 high_A(x1,x2) = 3 quicksort_A(x1) = 0 base order 2: precedence: minus = s = quot > |0| = high > true > add > high# = quicksort > if_high# = le > false > low > nil partial status: pi(if_high#) = [3] pi(false) = [] pi(add) = [1] pi(high#) = [] pi(le) = [] pi(true) = [] pi(minus) = [2] pi(|0|) = [] pi(s) = [] pi(quot) = [2] pi(low) = [] pi(nil) = [] pi(high) = [] pi(quicksort) = [] The following rules are removed: p2 -- 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: 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 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 r1, r2, r3, r5, r6, r7, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: if_low#_A(x1,x2,x3) = x1 + x3 false_A() = 0 add_A(x1,x2) = x1 + x2 low#_A(x1,x2) = x2 le_A(x1,x2) = 0 true_A() = 0 minus_A(x1,x2) = x1 + x2 + 3 |0|_A() = 1 s_A(x1) = x1 + 2 quot_A(x1,x2) = x1 + x2 low_A(x1,x2) = 0 nil_A() = 0 high_A(x1,x2) = x1 + 2 quicksort_A(x1) = x1 base order 2: precedence: high > add = low# > if_low# = quicksort > minus = s = quot = low > le = nil > true = |0| > false partial status: pi(if_low#) = [3] pi(false) = [] pi(add) = [2] pi(low#) = [2] pi(le) = [] pi(true) = [] pi(minus) = [2] pi(|0|) = [] pi(s) = [] pi(quot) = [2] 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: 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 r1, r2, r3, r6, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: low#_A(x1,x2) = x2 + 5 add_A(x1,x2) = x2 + 6 if_low#_A(x1,x2,x3) = x3 le_A(x1,x2) = x1 + x2 + 1 true_A() = 4 minus_A(x1,x2) = x1 + x2 + 5 |0|_A() = 2 s_A(x1) = x1 + 3 quot_A(x1,x2) = x1 + 1 false_A() = 1 low_A(x1,x2) = x1 + x2 + 8 nil_A() = 1 high_A(x1,x2) = x1 + x2 + 8 quicksort_A(x1) = x1 + 1 base order 2: precedence: minus > quot > low# = |0| = s = high > add = true = low = quicksort > if_low# = le = nil > false partial status: pi(low#) = [] pi(add) = [2] pi(if_low#) = [] pi(le) = [2] pi(true) = [] pi(minus) = [] pi(|0|) = [] pi(s) = [1] pi(quot) = [] pi(false) = [] pi(low) = [2] pi(nil) = [] pi(high) = [1, 2] pi(quicksort) = [1] 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, r7, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: le#_A(x1,x2) = x1 s_A(x1) = x1 + 4 quot_A(x1,x2) = 3 |0|_A() = 2 le_A(x1,x2) = x1 + x2 + 6 true_A() = 1 false_A() = 1 low_A(x1,x2) = x1 + x2 + 2 nil_A() = 1 high_A(x1,x2) = x1 + x2 + 6 quicksort_A(x1) = x1 + 2 base order 2: precedence: le# = le > s > quot > |0| > false > low > high = quicksort > true = nil partial status: pi(le#) = [1] pi(s) = [1] pi(quot) = [] pi(|0|) = [] pi(le) = [] pi(true) = [] pi(false) = [] pi(low) = [] pi(nil) = [] pi(high) = [1, 2] 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: 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 r1, r2, r3, r5, r6, r7, r10, r14, r18 Take the reduction pair: generalized weighted path order (>=MG, >MG) 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 + 1 minus_A(x1,x2) = x1 + 1 |0|_A() = 5 s_A(x1) = x1 + 6 quot_A(x1,x2) = x1 + 1 le_A(x1,x2) = x1 + x2 + 7 true_A() = 1 false_A() = 4 low_A(x1,x2) = x1 + x2 + 3 nil_A() = 1 high_A(x1,x2) = x1 + x2 + 5 quicksort_A(x1) = x1 + 1 base order 2: precedence: |0| > minus = s = quot = le > false > low > add > app# = high > true = quicksort > nil partial status: pi(app#) = [] pi(add) = [] pi(minus) = [] pi(|0|) = [] pi(s) = [1] pi(quot) = [1] pi(le) = [] pi(true) = [] pi(false) = [] pi(low) = [] pi(nil) = [] pi(high) = [2] pi(quicksort) = [1] The following rules are removed: p1 Then no dependency pair remains.