YES We show the termination of the TRS R: app(nil(),k) -> k app(l,nil()) -> l app(cons(x,l),k) -> cons(x,app(l,k)) sum(cons(x,nil())) -> cons(x,nil()) sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) plus(|0|(),y) -> y plus(s(x),y) -> s(plus(x,y)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(cons(x,l),k) -> app#(l,k) p2: sum#(cons(x,cons(y,l))) -> sum#(cons(plus(x,y),l)) p3: sum#(cons(x,cons(y,l))) -> plus#(x,y) p4: sum#(app(l,cons(x,cons(y,k)))) -> sum#(app(l,sum(cons(x,cons(y,k))))) p5: sum#(app(l,cons(x,cons(y,k)))) -> app#(l,sum(cons(x,cons(y,k)))) p6: sum#(app(l,cons(x,cons(y,k)))) -> sum#(cons(x,cons(y,k))) p7: plus#(s(x),y) -> plus#(x,y) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: plus(|0|(),y) -> y r8: plus(s(x),y) -> s(plus(x,y)) The estimated dependency graph contains the following SCCs: {p4} {p1} {p2} {p7} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: sum#(app(l,cons(x,cons(y,k)))) -> sum#(app(l,sum(cons(x,cons(y,k))))) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: plus(|0|(),y) -> y r8: plus(s(x),y) -> s(plus(x,y)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, 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!): max/plus interpretation on natural numbers: sum#_A(x1) = max{0, x1 - 24} app_A(x1,x2) = max{23, x1 + 17, x2 + 1} cons_A(x1,x2) = max{11, x2} sum_A(x1) = 22 nil_A = 4 plus_A(x1,x2) = max{39, x1 - 35, x2 + 37} |0|_A = 0 s_A(x1) = max{0, x1 - 40} sum#!_A(x1) = x1 + 16 app!_A(x1,x2) = max{x1 + 40, x2 + 7} cons!_A(x1,x2) = max{8, x2 + 3} sum!_A(x1) = max{2, x1 - 2} nil!_A = 1 plus!_A(x1,x2) = max{15, x1 - 2, x2 - 2} |0|!_A = 0 s!_A(x1) = max{1, x1 - 40} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: sum#_A(x1) = max{0, x1 - 21} app_A(x1,x2) = max{x1 + 1, x2 + 17} cons_A(x1,x2) = max{16, x1 - 18, x2} sum_A(x1) = max{5, x1} nil_A = 6 plus_A(x1,x2) = max{24, x1 - 4, x2} |0|_A = 0 s_A(x1) = max{1, x1 - 25} sum#!_A(x1) = x1 + 4 app!_A(x1,x2) = max{x1 + 43, x2 + 25} cons!_A(x1,x2) = max{0, x2 - 15} sum!_A(x1) = max{26, x1 - 7} nil!_A = 10 plus!_A(x1,x2) = max{10, x1 - 23, x2 - 24} |0|!_A = 0 s!_A(x1) = max{1, x1 - 45} partial status: pi(sum#) = [1] pi(app) = [1, 2] pi(cons) = [2] pi(sum) = [] pi(nil) = [] pi(plus) = [2] pi(|0|) = [] pi(s) = [] 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#(cons(x,l),k) -> app#(l,k) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: plus(|0|(),y) -> y r8: plus(s(x),y) -> s(plus(x,y)) 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!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 6} cons_A(x1,x2) = max{x1 - 53, x2 + 5} app#!_A(x1,x2) = max{1, x1 - 48, x2 - 1} cons!_A(x1,x2) = max{3, x1 - 140, x2 - 47} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 4} cons_A(x1,x2) = max{x1 - 49, x2 + 3} app#!_A(x1,x2) = max{4, x1 - 4, x2 - 1} cons!_A(x1,x2) = max{3, x1 - 126, x2 - 133} partial status: pi(app#) = [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#(cons(x,cons(y,l))) -> sum#(cons(plus(x,y),l)) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: plus(|0|(),y) -> y r8: plus(s(x),y) -> s(plus(x,y)) The set of usable rules consists of r7, 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!): max/plus interpretation on natural numbers: sum#_A(x1) = max{0, x1 - 17} cons_A(x1,x2) = max{x1 - 2, x2 + 7} plus_A(x1,x2) = max{18, x1 - 9, x2 + 1} |0|_A = 0 s_A(x1) = max{2, x1 - 19} sum#!_A(x1) = max{1, x1 - 45} cons!_A(x1,x2) = max{25, x1 - 52, x2 - 42} plus!_A(x1,x2) = max{26, x1 - 3, x2 - 1} |0|!_A = 0 s!_A(x1) = max{1, x1 - 41} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: sum#_A(x1) = max{0, x1 - 19} cons_A(x1,x2) = max{x1 - 27, x2 + 5} plus_A(x1,x2) = max{45, x1 - 47, x2 + 1} |0|_A = 0 s_A(x1) = max{2, x1 - 46} sum#!_A(x1) = max{1, x1 - 62} cons!_A(x1,x2) = max{3, x1 - 135, x2 - 60} plus!_A(x1,x2) = max{4, x1 - 3, x2 - 40} |0|!_A = 0 s!_A(x1) = max{1, x1 - 95} partial status: pi(sum#) = [1] pi(cons) = [2] pi(plus) = [2] pi(|0|) = [] pi(s) = [] 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: plus#(s(x),y) -> plus#(x,y) and R consists of: r1: app(nil(),k) -> k r2: app(l,nil()) -> l r3: app(cons(x,l),k) -> cons(x,app(l,k)) r4: sum(cons(x,nil())) -> cons(x,nil()) r5: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r6: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) r7: plus(|0|(),y) -> y r8: plus(s(x),y) -> s(plus(x,y)) 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!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 2} s_A(x1) = max{52, x1 + 1} plus#!_A(x1,x2) = max{2, x1 - 125, x2 - 1} s!_A(x1) = max{1, x1 - 124} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 2} s_A(x1) = max{33, x1 + 1} plus#!_A(x1,x2) = max{7, x1 - 36, x2 - 1} s!_A(x1) = max{6, x1 - 35} partial status: pi(plus#) = [1] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.