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) = 1 s_A(x1) = 6 min_A(x1,x2) = 1 len_A(x1) = x1 + 5 cons_A(x1,x2) = 1 sum_A(x1,x2) = 1 take_A(x1,x2) = 1 |0|_A() = 1 nil_A() = 0 false_A() = 1 if#!_A(x1,x2,x3,x4,x5) = x5 + 5 true!_A() = 7 le!_A(x1,x2) = 7 s!_A(x1) = 8 min!_A(x1,x2) = 6 len!_A(x1) = 9 cons!_A(x1,x2) = 10 sum!_A(x1,x2) = x2 + 3 take!_A(x1,x2) = 2 |0|!_A() = 1 nil!_A() = 2 false!_A() = 0 2. 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) = 1 s_A(x1) = 7 min_A(x1,x2) = 9 len_A(x1) = 9 cons_A(x1,x2) = 9 sum_A(x1,x2) = 1 take_A(x1,x2) = 1 |0|_A() = 9 nil_A() = 7 false_A() = 1 if#!_A(x1,x2,x3,x4,x5) = 7 true!_A() = 9 le!_A(x1,x2) = x1 + 1 s!_A(x1) = x1 + 2 min!_A(x1,x2) = 6 len!_A(x1) = x1 + 3 cons!_A(x1,x2) = x2 + 4 sum!_A(x1,x2) = 4 take!_A(x1,x2) = 1 |0|!_A() = 1 nil!_A() = 0 false!_A() = 0 partial status: pi(if#) = [1] pi(true) = [] pi(le) = [2] pi(s) = [1] pi(min) = [] pi(len) = [1] pi(cons) = [2] pi(sum) = [] pi(take) = [] 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 + 2 min#!_A(x1,x2) = x1 s!_A(x1) = 7 2. 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 + 5 min#!_A(x1,x2) = 0 s!_A(x1) = x1 + 2 partial status: pi(min#) = [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: 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 + 9 cons!_A(x1,x2) = 8 2. 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 cons!_A(x1,x2) = 3 partial status: pi(len#) = [] 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) = 0 s_A(x1) = 2 sum#!_A(x1,x2) = 0 s!_A(x1) = x1 + 5 2. 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) = 0 s_A(x1) = 6 sum#!_A(x1,x2) = 0 s!_A(x1) = x1 + 6 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 (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: le#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 7 le#!_A(x1,x2) = x1 + 7 s!_A(x1) = 6 2. 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 + 14 le#!_A(x1,x2) = x2 s!_A(x1) = x1 + 22 partial status: pi(le#) = [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: 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 + 2 cons_A(x1,x2) = x2 + 1 take#!_A(x1,x2) = x1 + x2 + 8 s!_A(x1) = 6 cons!_A(x1,x2) = 7 2. 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 + 4 take#!_A(x1,x2) = x1 + x2 s!_A(x1) = 2 cons!_A(x1,x2) = 3 partial status: pi(take#) = [] pi(s) = [1] pi(cons) = [2] The following rules are removed: p1 Then no dependency pair remains.