YES We show the termination of the TRS R: +(x,|0|()) -> x +(|0|(),x) -> x +(s(x),s(y)) -> s(s(+(x,y))) +(+(x,y),z) -> +(x,+(y,z)) *(x,|0|()) -> |0|() *(|0|(),x) -> |0|() *(s(x),s(y)) -> s(+(*(x,y),+(x,y))) *(*(x,y),z) -> *(x,*(y,z)) sum(nil()) -> |0|() sum(cons(x,l)) -> +(x,sum(l)) prod(nil()) -> s(|0|()) prod(cons(x,l)) -> *(x,prod(l)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: +#(s(x),s(y)) -> +#(x,y) p2: +#(+(x,y),z) -> +#(x,+(y,z)) p3: +#(+(x,y),z) -> +#(y,z) p4: *#(s(x),s(y)) -> +#(*(x,y),+(x,y)) p5: *#(s(x),s(y)) -> *#(x,y) p6: *#(s(x),s(y)) -> +#(x,y) p7: *#(*(x,y),z) -> *#(x,*(y,z)) p8: *#(*(x,y),z) -> *#(y,z) p9: sum#(cons(x,l)) -> +#(x,sum(l)) p10: sum#(cons(x,l)) -> sum#(l) p11: prod#(cons(x,l)) -> *#(x,prod(l)) p12: prod#(cons(x,l)) -> prod#(l) and R consists of: r1: +(x,|0|()) -> x r2: +(|0|(),x) -> x r3: +(s(x),s(y)) -> s(s(+(x,y))) r4: +(+(x,y),z) -> +(x,+(y,z)) r5: *(x,|0|()) -> |0|() r6: *(|0|(),x) -> |0|() r7: *(s(x),s(y)) -> s(+(*(x,y),+(x,y))) r8: *(*(x,y),z) -> *(x,*(y,z)) r9: sum(nil()) -> |0|() r10: sum(cons(x,l)) -> +(x,sum(l)) r11: prod(nil()) -> s(|0|()) r12: prod(cons(x,l)) -> *(x,prod(l)) The estimated dependency graph contains the following SCCs: {p10} {p12} {p5, p7, p8} {p1, p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: sum#(cons(x,l)) -> sum#(l) and R consists of: r1: +(x,|0|()) -> x r2: +(|0|(),x) -> x r3: +(s(x),s(y)) -> s(s(+(x,y))) r4: +(+(x,y),z) -> +(x,+(y,z)) r5: *(x,|0|()) -> |0|() r6: *(|0|(),x) -> |0|() r7: *(s(x),s(y)) -> s(+(*(x,y),+(x,y))) r8: *(*(x,y),z) -> *(x,*(y,z)) r9: sum(nil()) -> |0|() r10: sum(cons(x,l)) -> +(x,sum(l)) r11: prod(nil()) -> s(|0|()) r12: prod(cons(x,l)) -> *(x,prod(l)) 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: sum#_A(x1) = x1 cons_A(x1,x2) = max{x1 + 90, x2 + 17} sum#!_A(x1) = max{1, x1 - 214} cons!_A(x1,x2) = max{2, x1 - 76, x2 - 213} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: sum#_A(x1) = x1 cons_A(x1,x2) = max{6, x1 - 42, x2 + 1} sum#!_A(x1) = max{1, x1 - 8} cons!_A(x1,x2) = max{2, x1 - 51, x2 - 8} partial status: pi(sum#) = [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: prod#(cons(x,l)) -> prod#(l) and R consists of: r1: +(x,|0|()) -> x r2: +(|0|(),x) -> x r3: +(s(x),s(y)) -> s(s(+(x,y))) r4: +(+(x,y),z) -> +(x,+(y,z)) r5: *(x,|0|()) -> |0|() r6: *(|0|(),x) -> |0|() r7: *(s(x),s(y)) -> s(+(*(x,y),+(x,y))) r8: *(*(x,y),z) -> *(x,*(y,z)) r9: sum(nil()) -> |0|() r10: sum(cons(x,l)) -> +(x,sum(l)) r11: prod(nil()) -> s(|0|()) r12: prod(cons(x,l)) -> *(x,prod(l)) 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: prod#_A(x1) = x1 cons_A(x1,x2) = max{x1, x2 + 1} prod#!_A(x1) = max{1, x1 - 50} cons!_A(x1,x2) = max{2, x1 - 11, x2 - 49} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: prod#_A(x1) = x1 cons_A(x1,x2) = max{x1 + 33, x2 + 30} prod#!_A(x1) = max{1, x1 - 31} cons!_A(x1,x2) = max{2, x1 - 18, x2 - 1} partial status: pi(prod#) = [] 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: *#(*(x,y),z) -> *#(y,z) p2: *#(*(x,y),z) -> *#(x,*(y,z)) p3: *#(s(x),s(y)) -> *#(x,y) and R consists of: r1: +(x,|0|()) -> x r2: +(|0|(),x) -> x r3: +(s(x),s(y)) -> s(s(+(x,y))) r4: +(+(x,y),z) -> +(x,+(y,z)) r5: *(x,|0|()) -> |0|() r6: *(|0|(),x) -> |0|() r7: *(s(x),s(y)) -> s(+(*(x,y),+(x,y))) r8: *(*(x,y),z) -> *(x,*(y,z)) r9: sum(nil()) -> |0|() r10: sum(cons(x,l)) -> +(x,sum(l)) r11: prod(nil()) -> s(|0|()) r12: prod(cons(x,l)) -> *(x,prod(l)) 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: *#_A(x1,x2) = max{0, x1 - 11, x2 - 12} *_A(x1,x2) = max{10, x1 + 1, x2} s_A(x1) = max{6, x1} +_A(x1,x2) = max{10, x1, x2} |0|_A = 11 *#!_A(x1,x2) = 1 *!_A(x1,x2) = max{5, x1 - 12, x2 - 15} s!_A(x1) = max{2, x1 - 37} +!_A(x1,x2) = max{6, x1 - 26, x2 - 32} |0|!_A = 4 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: *#_A(x1,x2) = max{0, x1 - 9, x2 - 10} *_A(x1,x2) = max{8, x1 + 1, x2} s_A(x1) = max{2, x1} +_A(x1,x2) = max{6, x1, x2} |0|_A = 9 *#!_A(x1,x2) = x1 + 2 *!_A(x1,x2) = max{13, x1 + 6, x2 + 4} s!_A(x1) = max{10, x1 + 3} +!_A(x1,x2) = max{14, x1 - 9, x2 - 9} |0|!_A = 8 partial status: pi(*#) = [] pi(*) = [] pi(s) = [] pi(+) = [1, 2] pi(|0|) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: *#(*(x,y),z) -> *#(y,z) p2: *#(s(x),s(y)) -> *#(x,y) and R consists of: r1: +(x,|0|()) -> x r2: +(|0|(),x) -> x r3: +(s(x),s(y)) -> s(s(+(x,y))) r4: +(+(x,y),z) -> +(x,+(y,z)) r5: *(x,|0|()) -> |0|() r6: *(|0|(),x) -> |0|() r7: *(s(x),s(y)) -> s(+(*(x,y),+(x,y))) r8: *(*(x,y),z) -> *(x,*(y,z)) r9: sum(nil()) -> |0|() r10: sum(cons(x,l)) -> +(x,sum(l)) r11: prod(nil()) -> s(|0|()) r12: prod(cons(x,l)) -> *(x,prod(l)) The estimated dependency graph contains the following SCCs: {p1, p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: *#(*(x,y),z) -> *#(y,z) p2: *#(s(x),s(y)) -> *#(x,y) and R consists of: r1: +(x,|0|()) -> x r2: +(|0|(),x) -> x r3: +(s(x),s(y)) -> s(s(+(x,y))) r4: +(+(x,y),z) -> +(x,+(y,z)) r5: *(x,|0|()) -> |0|() r6: *(|0|(),x) -> |0|() r7: *(s(x),s(y)) -> s(+(*(x,y),+(x,y))) r8: *(*(x,y),z) -> *(x,*(y,z)) r9: sum(nil()) -> |0|() r10: sum(cons(x,l)) -> +(x,sum(l)) r11: prod(nil()) -> s(|0|()) r12: prod(cons(x,l)) -> *(x,prod(l)) 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: *#_A(x1,x2) = 0 *_A(x1,x2) = max{1, x1 - 21, x2 - 17} s_A(x1) = max{2, x1 - 3} *#!_A(x1,x2) = max{1, x1 - 53} *!_A(x1,x2) = max{4, x1 - 3, x2 - 22} s!_A(x1) = max{2, x1 - 52} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: *#_A(x1,x2) = 0 *_A(x1,x2) = max{1, x1 - 28, x2 - 23} s_A(x1) = max{3, x1 - 4} *#!_A(x1,x2) = max{3, x1 - 4, x2 - 4} *!_A(x1,x2) = max{4, x1 - 14, x2 - 9} s!_A(x1) = max{2, x1 - 5} partial status: pi(*#) = [1] pi(*) = [1, 2] pi(s) = [1] The following rules are removed: p1, p2 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: +#(s(x),s(y)) -> +#(x,y) p2: +#(+(x,y),z) -> +#(y,z) p3: +#(+(x,y),z) -> +#(x,+(y,z)) and R consists of: r1: +(x,|0|()) -> x r2: +(|0|(),x) -> x r3: +(s(x),s(y)) -> s(s(+(x,y))) r4: +(+(x,y),z) -> +(x,+(y,z)) r5: *(x,|0|()) -> |0|() r6: *(|0|(),x) -> |0|() r7: *(s(x),s(y)) -> s(+(*(x,y),+(x,y))) r8: *(*(x,y),z) -> *(x,*(y,z)) r9: sum(nil()) -> |0|() r10: sum(cons(x,l)) -> +(x,sum(l)) r11: prod(nil()) -> s(|0|()) r12: prod(cons(x,l)) -> *(x,prod(l)) The set of usable rules consists of r1, r2, r3, r4 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: +#_A(x1,x2) = max{0, x1 - 35, x2 - 46} s_A(x1) = max{16, x1} +_A(x1,x2) = max{34, x1 + 11, x2} |0|_A = 16 +#!_A(x1,x2) = max{3, x1 - 70, x2 - 81} s!_A(x1) = max{2, x1 - 54} +!_A(x1,x2) = max{3, x1 - 35, x2 - 46} |0|!_A = 0 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: +#_A(x1,x2) = max{0, x1 - 19, x2 - 23} s_A(x1) = max{8, x1} +_A(x1,x2) = max{18, x1 + 4, x2} |0|_A = 8 +#!_A(x1,x2) = max{7, x1 - 20, x2 - 33} s!_A(x1) = max{5, x1 - 31} +!_A(x1,x2) = max{6, x1 - 19, x2 - 32} |0|!_A = 3 partial status: pi(+#) = [1] pi(s) = [1] pi(+) = [1, 2] pi(|0|) = [] The following rules are removed: p2, p3 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: +#(s(x),s(y)) -> +#(x,y) and R consists of: r1: +(x,|0|()) -> x r2: +(|0|(),x) -> x r3: +(s(x),s(y)) -> s(s(+(x,y))) r4: +(+(x,y),z) -> +(x,+(y,z)) r5: *(x,|0|()) -> |0|() r6: *(|0|(),x) -> |0|() r7: *(s(x),s(y)) -> s(+(*(x,y),+(x,y))) r8: *(*(x,y),z) -> *(x,*(y,z)) r9: sum(nil()) -> |0|() r10: sum(cons(x,l)) -> +(x,sum(l)) r11: prod(nil()) -> s(|0|()) r12: prod(cons(x,l)) -> *(x,prod(l)) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: +#(s(x),s(y)) -> +#(x,y) and R consists of: r1: +(x,|0|()) -> x r2: +(|0|(),x) -> x r3: +(s(x),s(y)) -> s(s(+(x,y))) r4: +(+(x,y),z) -> +(x,+(y,z)) r5: *(x,|0|()) -> |0|() r6: *(|0|(),x) -> |0|() r7: *(s(x),s(y)) -> s(+(*(x,y),+(x,y))) r8: *(*(x,y),z) -> *(x,*(y,z)) r9: sum(nil()) -> |0|() r10: sum(cons(x,l)) -> +(x,sum(l)) r11: prod(nil()) -> s(|0|()) r12: prod(cons(x,l)) -> *(x,prod(l)) 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: +#_A(x1,x2) = 0 s_A(x1) = max{2, x1 - 3} +#!_A(x1,x2) = max{1, x2 - 5} s!_A(x1) = max{6, x1 - 4} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: +#_A(x1,x2) = 0 s_A(x1) = max{5, x1 - 6} +#!_A(x1,x2) = max{1, x1 - 6, x2 - 6} s!_A(x1) = max{4, x1 - 55} partial status: pi(+#) = [2] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.