YES We show the termination of the TRS R: min(|0|(),y) -> |0|() min(s(x),|0|()) -> |0|() min(s(x),s(y)) -> min(x,y) len(nil()) -> |0|() len(cons(x,xs)) -> s(len(xs)) sum(x,|0|()) -> x sum(x,s(y)) -> s(sum(x,y)) le(|0|(),x) -> true() le(s(x),|0|()) -> false() le(s(x),s(y)) -> le(x,y) take(|0|(),cons(y,ys)) -> y take(s(x),cons(y,ys)) -> take(x,ys) addList(x,y) -> if(le(|0|(),min(len(x),len(y))),|0|(),x,y,nil()) if(false(),c,x,y,z) -> z if(true(),c,xs,ys,z) -> if(le(s(c),min(len(xs),len(ys))),s(c),xs,ys,cons(sum(take(c,xs),take(c,ys)),z)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: min#(s(x),s(y)) -> min#(x,y) p2: len#(cons(x,xs)) -> len#(xs) p3: sum#(x,s(y)) -> sum#(x,y) p4: le#(s(x),s(y)) -> le#(x,y) p5: take#(s(x),cons(y,ys)) -> take#(x,ys) p6: addList#(x,y) -> if#(le(|0|(),min(len(x),len(y))),|0|(),x,y,nil()) p7: addList#(x,y) -> le#(|0|(),min(len(x),len(y))) p8: addList#(x,y) -> min#(len(x),len(y)) p9: addList#(x,y) -> len#(x) p10: addList#(x,y) -> len#(y) p11: if#(true(),c,xs,ys,z) -> if#(le(s(c),min(len(xs),len(ys))),s(c),xs,ys,cons(sum(take(c,xs),take(c,ys)),z)) p12: if#(true(),c,xs,ys,z) -> le#(s(c),min(len(xs),len(ys))) p13: if#(true(),c,xs,ys,z) -> min#(len(xs),len(ys)) p14: if#(true(),c,xs,ys,z) -> len#(xs) p15: if#(true(),c,xs,ys,z) -> len#(ys) p16: if#(true(),c,xs,ys,z) -> sum#(take(c,xs),take(c,ys)) p17: if#(true(),c,xs,ys,z) -> take#(c,xs) p18: if#(true(),c,xs,ys,z) -> take#(c,ys) and R consists of: r1: min(|0|(),y) -> |0|() r2: min(s(x),|0|()) -> |0|() r3: min(s(x),s(y)) -> min(x,y) r4: len(nil()) -> |0|() r5: len(cons(x,xs)) -> s(len(xs)) r6: sum(x,|0|()) -> x r7: sum(x,s(y)) -> s(sum(x,y)) r8: le(|0|(),x) -> true() r9: le(s(x),|0|()) -> false() r10: le(s(x),s(y)) -> le(x,y) r11: take(|0|(),cons(y,ys)) -> y r12: take(s(x),cons(y,ys)) -> take(x,ys) r13: addList(x,y) -> if(le(|0|(),min(len(x),len(y))),|0|(),x,y,nil()) r14: if(false(),c,x,y,z) -> z r15: if(true(),c,xs,ys,z) -> if(le(s(c),min(len(xs),len(ys))),s(c),xs,ys,cons(sum(take(c,xs),take(c,ys)),z)) The estimated dependency graph contains the following SCCs: {p11} {p1} {p2} {p3} {p4} {p5} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: if#(true(),c,xs,ys,z) -> if#(le(s(c),min(len(xs),len(ys))),s(c),xs,ys,cons(sum(take(c,xs),take(c,ys)),z)) and R consists of: r1: min(|0|(),y) -> |0|() r2: min(s(x),|0|()) -> |0|() r3: min(s(x),s(y)) -> min(x,y) r4: len(nil()) -> |0|() r5: len(cons(x,xs)) -> s(len(xs)) r6: sum(x,|0|()) -> x r7: sum(x,s(y)) -> s(sum(x,y)) r8: le(|0|(),x) -> true() r9: le(s(x),|0|()) -> false() r10: le(s(x),s(y)) -> le(x,y) r11: take(|0|(),cons(y,ys)) -> y r12: take(s(x),cons(y,ys)) -> take(x,ys) r13: addList(x,y) -> if(le(|0|(),min(len(x),len(y))),|0|(),x,y,nil()) r14: if(false(),c,x,y,z) -> z r15: if(true(),c,xs,ys,z) -> if(le(s(c),min(len(xs),len(ys))),s(c),xs,ys,cons(sum(take(c,xs),take(c,ys)),z)) The set of usable rules consists of r1, r2, r3, r8, r9, r10 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#_A(x1,x2,x3,x4,x5) = x1 + x3 + x4 + 4 true_A() = 1 le_A(x1,x2) = x2 + 1 s_A(x1) = x1 + 2 min_A(x1,x2) = 0 len_A(x1) = 3 cons_A(x1,x2) = 4 sum_A(x1,x2) = 4 take_A(x1,x2) = 3 |0|_A() = 0 false_A() = 0 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: if#_A(x1,x2,x3,x4,x5) = max{20, x1 - 4, x2 - 3, x3 - 2, x4 - 1} true_A = 8 le_A(x1,x2) = 24 s_A(x1) = 2 min_A(x1,x2) = 5 len_A(x1) = max{1, x1 - 20} cons_A(x1,x2) = max{19, x2 + 1} sum_A(x1,x2) = max{17, x2 - 20} take_A(x1,x2) = max{0, x2 - 10} |0|_A = 5 false_A = 0 if#!_A(x1,x2,x3,x4,x5) = max{x1 - 7, x2 - 3, x3 + 17, x4 + 14} true!_A = 29 le!_A(x1,x2) = max{28, x1 + 25, x2 + 8} s!_A(x1) = 0 min!_A(x1,x2) = 0 len!_A(x1) = max{0, x1 - 20} cons!_A(x1,x2) = 30 sum!_A(x1,x2) = x2 + 25 take!_A(x1,x2) = max{31, x1 + 27} |0|!_A = 0 false!_A = 28 partial status: pi(if#) = [1, 3] pi(true) = [] pi(le) = [] pi(s) = [] pi(min) = [] pi(len) = [] pi(cons) = [] pi(sum) = [] pi(take) = [] pi(|0|) = [] pi(false) = [] 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: min#(s(x),s(y)) -> min#(x,y) and R consists of: r1: min(|0|(),y) -> |0|() r2: min(s(x),|0|()) -> |0|() r3: min(s(x),s(y)) -> min(x,y) r4: len(nil()) -> |0|() r5: len(cons(x,xs)) -> s(len(xs)) r6: sum(x,|0|()) -> x r7: sum(x,s(y)) -> s(sum(x,y)) r8: le(|0|(),x) -> true() r9: le(s(x),|0|()) -> false() r10: le(s(x),s(y)) -> le(x,y) r11: take(|0|(),cons(y,ys)) -> y r12: take(s(x),cons(y,ys)) -> take(x,ys) r13: addList(x,y) -> if(le(|0|(),min(len(x),len(y))),|0|(),x,y,nil()) r14: if(false(),c,x,y,z) -> z r15: if(true(),c,xs,ys,z) -> if(le(s(c),min(len(xs),len(ys))),s(c),xs,ys,cons(sum(take(c,xs),take(c,ys)),z)) The set of usable rules consists of r1, r2, r8 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: min#_A(x1,x2) = x1 + x2 + 11 s_A(x1) = x1 + 10 min_A(x1,x2) = 9 |0|_A() = 8 le_A(x1,x2) = x1 + 9 true_A() = 16 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: min#_A(x1,x2) = 0 s_A(x1) = max{21, x1 - 59} min_A(x1,x2) = max{35, x1 - 22, x2 - 24} |0|_A = 16 le_A(x1,x2) = max{77, x1 - 22, x2 - 17} true_A = 0 min#!_A(x1,x2) = 2 s!_A(x1) = 2 min!_A(x1,x2) = max{10, x2 - 58} |0|!_A = 7 le!_A(x1,x2) = max{3, x1 - 24, x2 - 101} true!_A = 4 partial status: pi(min#) = [] pi(s) = [1] pi(min) = [] pi(|0|) = [] pi(le) = [1] pi(true) = [] 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: len#(cons(x,xs)) -> len#(xs) and R consists of: r1: min(|0|(),y) -> |0|() r2: min(s(x),|0|()) -> |0|() r3: min(s(x),s(y)) -> min(x,y) r4: len(nil()) -> |0|() r5: len(cons(x,xs)) -> s(len(xs)) r6: sum(x,|0|()) -> x r7: sum(x,s(y)) -> s(sum(x,y)) r8: le(|0|(),x) -> true() r9: le(s(x),|0|()) -> false() r10: le(s(x),s(y)) -> le(x,y) r11: take(|0|(),cons(y,ys)) -> y r12: take(s(x),cons(y,ys)) -> take(x,ys) r13: addList(x,y) -> if(le(|0|(),min(len(x),len(y))),|0|(),x,y,nil()) r14: if(false(),c,x,y,z) -> z r15: if(true(),c,xs,ys,z) -> if(le(s(c),min(len(xs),len(ys))),s(c),xs,ys,cons(sum(take(c,xs),take(c,ys)),z)) The set of usable rules consists of r1, r2 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: len#_A(x1) = x1 cons_A(x1,x2) = x1 + x2 + 9 min_A(x1,x2) = 3 |0|_A() = 2 s_A(x1) = x1 + 5 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: len#_A(x1) = 0 cons_A(x1,x2) = max{9, x1 - 2, x2 - 2} min_A(x1,x2) = max{8, x1 - 8, x2 - 8} |0|_A = 5 s_A(x1) = max{7, x1 - 18} len#!_A(x1) = 1 cons!_A(x1,x2) = max{52, x1 - 36, x2} min!_A(x1,x2) = x1 + 23 |0|!_A = 3 s!_A(x1) = 53 partial status: pi(len#) = [1] pi(cons) = [] pi(min) = [] pi(|0|) = [] 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: sum#(x,s(y)) -> sum#(x,y) and R consists of: r1: min(|0|(),y) -> |0|() r2: min(s(x),|0|()) -> |0|() r3: min(s(x),s(y)) -> min(x,y) r4: len(nil()) -> |0|() r5: len(cons(x,xs)) -> s(len(xs)) r6: sum(x,|0|()) -> x r7: sum(x,s(y)) -> s(sum(x,y)) r8: le(|0|(),x) -> true() r9: le(s(x),|0|()) -> false() r10: le(s(x),s(y)) -> le(x,y) r11: take(|0|(),cons(y,ys)) -> y r12: take(s(x),cons(y,ys)) -> take(x,ys) r13: addList(x,y) -> if(le(|0|(),min(len(x),len(y))),|0|(),x,y,nil()) r14: if(false(),c,x,y,z) -> z r15: if(true(),c,xs,ys,z) -> if(le(s(c),min(len(xs),len(ys))),s(c),xs,ys,cons(sum(take(c,xs),take(c,ys)),z)) The set of usable rules consists of r1, r2, r8 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: sum#_A(x1,x2) = x2 s_A(x1) = x1 + 4 min_A(x1,x2) = 3 |0|_A() = 0 le_A(x1,x2) = x1 true_A() = 0 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: sum#_A(x1,x2) = 0 s_A(x1) = max{7, x1 - 22} min_A(x1,x2) = max{2, x1 - 8, x2 - 64} |0|_A = 0 le_A(x1,x2) = max{59, x1 - 8, x2 - 1} true_A = 0 sum#!_A(x1,x2) = 22 s!_A(x1) = max{50, x1 + 21} min!_A(x1,x2) = max{51, x1 + 23, x2 + 28} |0|!_A = 49 le!_A(x1,x2) = max{x1 - 13, x2 + 42} true!_A = 48 partial status: pi(sum#) = [] pi(s) = [1] pi(min) = [] pi(|0|) = [] pi(le) = [1] pi(true) = [] 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: le#(s(x),s(y)) -> le#(x,y) and R consists of: r1: min(|0|(),y) -> |0|() r2: min(s(x),|0|()) -> |0|() r3: min(s(x),s(y)) -> min(x,y) r4: len(nil()) -> |0|() r5: len(cons(x,xs)) -> s(len(xs)) r6: sum(x,|0|()) -> x r7: sum(x,s(y)) -> s(sum(x,y)) r8: le(|0|(),x) -> true() r9: le(s(x),|0|()) -> false() r10: le(s(x),s(y)) -> le(x,y) r11: take(|0|(),cons(y,ys)) -> y r12: take(s(x),cons(y,ys)) -> take(x,ys) r13: addList(x,y) -> if(le(|0|(),min(len(x),len(y))),|0|(),x,y,nil()) r14: if(false(),c,x,y,z) -> z r15: if(true(),c,xs,ys,z) -> if(le(s(c),min(len(xs),len(ys))),s(c),xs,ys,cons(sum(take(c,xs),take(c,ys)),z)) The set of usable rules consists of r1, r2 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) = x1 + x2 + 4 s_A(x1) = x1 + 3 min_A(x1,x2) = 25 |0|_A() = 2 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: le#_A(x1,x2) = 0 s_A(x1) = max{25, x1 - 77} min_A(x1,x2) = max{38, x1 - 32, x2 - 40} |0|_A = 31 le#!_A(x1,x2) = 3 s!_A(x1) = 2 min!_A(x1,x2) = max{206, x2 - 166} |0|!_A = 5 partial status: pi(le#) = [2] pi(s) = [] pi(min) = [] pi(|0|) = [] 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: take#(s(x),cons(y,ys)) -> take#(x,ys) and R consists of: r1: min(|0|(),y) -> |0|() r2: min(s(x),|0|()) -> |0|() r3: min(s(x),s(y)) -> min(x,y) r4: len(nil()) -> |0|() r5: len(cons(x,xs)) -> s(len(xs)) r6: sum(x,|0|()) -> x r7: sum(x,s(y)) -> s(sum(x,y)) r8: le(|0|(),x) -> true() r9: le(s(x),|0|()) -> false() r10: le(s(x),s(y)) -> le(x,y) r11: take(|0|(),cons(y,ys)) -> y r12: take(s(x),cons(y,ys)) -> take(x,ys) r13: addList(x,y) -> if(le(|0|(),min(len(x),len(y))),|0|(),x,y,nil()) r14: if(false(),c,x,y,z) -> z r15: if(true(),c,xs,ys,z) -> if(le(s(c),min(len(xs),len(ys))),s(c),xs,ys,cons(sum(take(c,xs),take(c,ys)),z)) The set of usable rules consists of r8 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: take#_A(x1,x2) = x1 + x2 + 4 s_A(x1) = x1 + 5 cons_A(x1,x2) = x1 + x2 + 11 le_A(x1,x2) = x1 + x2 + 25 |0|_A() = 0 true_A() = 24 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: take#_A(x1,x2) = x2 s_A(x1) = max{9, x1 - 2} cons_A(x1,x2) = max{x1 + 21, x2 + 8} le_A(x1,x2) = max{66, x1 - 2, x2 + 65} |0|_A = 1 true_A = 0 take#!_A(x1,x2) = max{6, x2 - 1} s!_A(x1) = max{39, x1 - 70} cons!_A(x1,x2) = max{41, x1 - 64, x2 - 95} le!_A(x1,x2) = max{x1 - 10, x2 + 37} |0|!_A = 40 true!_A = 47 partial status: pi(take#) = [] pi(s) = [1] pi(cons) = [2] pi(le) = [] pi(|0|) = [] pi(true) = [] The following rules are removed: p1 Then no dependency pair remains.