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, r4, r5, r8, r9, 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: if#_A(x1,x2,x3,x4,x5) = 0 true_A() = 1 le_A(x1,x2) = x1 + 1 s_A(x1) = x1 + 1 min_A(x1,x2) = 0 len_A(x1) = x1 + 1 cons_A(x1,x2) = x2 + 1 sum_A(x1,x2) = 1 take_A(x1,x2) = x1 + 1 |0|_A() = 0 nil_A() = 0 false_A() = 2 if#!_A(x1,x2,x3,x4,x5) = 5 true!_A() = 9 le!_A(x1,x2) = x2 + 9 s!_A(x1) = 6 min!_A(x1,x2) = 1 len!_A(x1) = 7 cons!_A(x1,x2) = 8 sum!_A(x1,x2) = 4 take!_A(x1,x2) = 3 |0|!_A() = 0 nil!_A() = 1 false!_A() = 7 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: if#_A(x1,x2,x3,x4,x5) = max{0, x3 - 1, x4 - 1} true_A = 0 le_A(x1,x2) = 5 s_A(x1) = 23 min_A(x1,x2) = 38 len_A(x1) = 26 cons_A(x1,x2) = max{56, x2 + 32} sum_A(x1,x2) = max{22, x2 + 2} take_A(x1,x2) = x2 + 18 |0|_A = 24 nil_A = 11 false_A = 1 if#!_A(x1,x2,x3,x4,x5) = max{x2 + 13, x3 + 20, x4 + 20} true!_A = 50 le!_A(x1,x2) = max{49, x1 + 26, x2 - 39} s!_A(x1) = x1 + 16 min!_A(x1,x2) = max{21, x1 - 1} len!_A(x1) = 44 cons!_A(x1,x2) = 43 sum!_A(x1,x2) = max{0, x2 - 10} take!_A(x1,x2) = max{51, x2 - 9} |0|!_A = 15 nil!_A = 16 false!_A = 13 partial status: pi(if#) = [1] pi(true) = [] pi(le) = [] pi(s) = [1] pi(min) = [2] pi(len) = [1] pi(cons) = [2] pi(sum) = [] pi(take) = [1] pi(|0|) = [] pi(nil) = [] 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 (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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: min#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 1 min#!_A(x1,x2) = x1 + x2 + 6 s!_A(x1) = 5 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: min#_A(x1,x2) = 0 s_A(x1) = max{26, x1 - 26} min#!_A(x1,x2) = max{1, x2 - 31} s!_A(x1) = max{0, x1 - 30} partial status: pi(min#) = [] 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: 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 (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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: len#_A(x1) = x1 cons_A(x1,x2) = x2 + 1 len#!_A(x1) = x1 + 6 cons!_A(x1,x2) = 5 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: len#_A(x1) = 0 cons_A(x1,x2) = max{27, x1 - 140, x2 - 140} len#!_A(x1) = 44 cons!_A(x1,x2) = max{43, x1 - 1, x2 - 56} partial status: pi(len#) = [1] pi(cons) = [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: 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 (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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: sum#_A(x1,x2) = x2 s_A(x1) = x1 + 1 sum#!_A(x1,x2) = x2 + 6 s!_A(x1) = 5 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: sum#_A(x1,x2) = 0 s_A(x1) = max{22, x1 + 20} sum#!_A(x1,x2) = max{1, x1 - 1} s!_A(x1) = max{5, x1 - 4} partial status: pi(sum#) = [2] 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: 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 r8 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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: le#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 1 le_A(x1,x2) = 2 |0|_A() = 7 true_A() = 1 le#!_A(x1,x2) = x2 + 3 s!_A(x1) = 2 le!_A(x1,x2) = x1 + 3 |0|!_A() = 1 true!_A() = 9 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: le#_A(x1,x2) = 0 s_A(x1) = max{0, x1 - 11} le_A(x1,x2) = max{19, x2 - 42} |0|_A = 0 true_A = 18 le#!_A(x1,x2) = x2 + 13 s!_A(x1) = max{17, x1 + 14} le!_A(x1,x2) = max{28, x1 - 1, x2 + 10} |0|!_A = 29 true!_A = 28 partial status: pi(le#) = [] pi(s) = [] pi(le) = [1] pi(|0|) = [] 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: 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 (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!): matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: take#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 1 cons_A(x1,x2) = x2 + 1 take#!_A(x1,x2) = 7 s!_A(x1) = x1 + 6 cons!_A(x1,x2) = 8 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: take#_A(x1,x2) = x2 s_A(x1) = max{15, x1 - 45} cons_A(x1,x2) = max{8, x1 + 7, x2 + 7} take#!_A(x1,x2) = 1 s!_A(x1) = x1 + 11 cons!_A(x1,x2) = x1 + 2 partial status: pi(take#) = [2] pi(s) = [] pi(cons) = [2] The following rules are removed: p1 Then no dependency pair remains.