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)) app(nil(),l) -> l app(cons(x,l1),l2) -> cons(x,app(l1,l2)) sum(nil()) -> |0|() sum(cons(x,l)) -> +(x,sum(l)) sum(app(l1,l2)) -> +(sum(l1),sum(l2)) prod(nil()) -> s(|0|()) prod(cons(x,l)) -> *(x,prod(l)) prod(app(l1,l2)) -> *(prod(l1),prod(l2)) -- 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: app#(cons(x,l1),l2) -> app#(l1,l2) p10: sum#(cons(x,l)) -> +#(x,sum(l)) p11: sum#(cons(x,l)) -> sum#(l) p12: sum#(app(l1,l2)) -> +#(sum(l1),sum(l2)) p13: sum#(app(l1,l2)) -> sum#(l1) p14: sum#(app(l1,l2)) -> sum#(l2) p15: prod#(cons(x,l)) -> *#(x,prod(l)) p16: prod#(cons(x,l)) -> prod#(l) p17: prod#(app(l1,l2)) -> *#(prod(l1),prod(l2)) p18: prod#(app(l1,l2)) -> prod#(l1) p19: prod#(app(l1,l2)) -> prod#(l2) 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: app(nil(),l) -> l r10: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r11: sum(nil()) -> |0|() r12: sum(cons(x,l)) -> +(x,sum(l)) r13: sum(app(l1,l2)) -> +(sum(l1),sum(l2)) r14: prod(nil()) -> s(|0|()) r15: prod(cons(x,l)) -> *(x,prod(l)) r16: prod(app(l1,l2)) -> *(prod(l1),prod(l2)) The estimated dependency graph contains the following SCCs: {p11, p13, p14} {p16, p18, p19} {p5, p7, p8} {p1, p2, p3} {p9} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: sum#(app(l1,l2)) -> sum#(l2) p2: sum#(app(l1,l2)) -> sum#(l1) p3: 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: app(nil(),l) -> l r10: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r11: sum(nil()) -> |0|() r12: sum(cons(x,l)) -> +(x,sum(l)) r13: sum(app(l1,l2)) -> +(sum(l1),sum(l2)) r14: prod(nil()) -> s(|0|()) r15: prod(cons(x,l)) -> *(x,prod(l)) r16: prod(app(l1,l2)) -> *(prod(l1),prod(l2)) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: sum#_A(x1) = x1 + 4 app_A(x1,x2) = max{35, x1 + 6, x2 + 24} cons_A(x1,x2) = max{29, x1 - 2, x2 + 5} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: sum#_A(x1) = 0 app_A(x1,x2) = max{3, x1 - 25, x2 - 25} cons_A(x1,x2) = max{0, x1 - 25, x2 - 27} sum#!_A(x1) = 1 app!_A(x1,x2) = max{7, x1 - 4, x2 - 1} cons!_A(x1,x2) = max{6, x1 - 1, x2 - 5} partial status: pi(sum#) = [1] pi(app) = [2] pi(cons) = [2] The following rules are removed: p1, p2, p3 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: prod#(app(l1,l2)) -> prod#(l2) p2: prod#(app(l1,l2)) -> prod#(l1) p3: 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: app(nil(),l) -> l r10: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r11: sum(nil()) -> |0|() r12: sum(cons(x,l)) -> +(x,sum(l)) r13: sum(app(l1,l2)) -> +(sum(l1),sum(l2)) r14: prod(nil()) -> s(|0|()) r15: prod(cons(x,l)) -> *(x,prod(l)) r16: prod(app(l1,l2)) -> *(prod(l1),prod(l2)) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: prod#_A(x1) = x1 + 4 app_A(x1,x2) = max{44, x1 + 6, x2 + 8} cons_A(x1,x2) = max{38, x1 - 2, x2 + 5} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: prod#_A(x1) = 0 app_A(x1,x2) = max{5, x1 - 70, x2 - 70} cons_A(x1,x2) = max{3, x1 - 70, x2 - 71} prod#!_A(x1) = 0 app!_A(x1,x2) = max{5, x1 - 78, x2 - 78} cons!_A(x1,x2) = max{4, x1 - 1, x2 - 7} partial status: pi(prod#) = [1] pi(app) = [2] pi(cons) = [2] The following rules are removed: p1, p2, p3 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: app(nil(),l) -> l r10: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r11: sum(nil()) -> |0|() r12: sum(cons(x,l)) -> +(x,sum(l)) r13: sum(app(l1,l2)) -> +(sum(l1),sum(l2)) r14: prod(nil()) -> s(|0|()) r15: prod(cons(x,l)) -> *(x,prod(l)) r16: prod(app(l1,l2)) -> *(prod(l1),prod(l2)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r11 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: *#_A(x1,x2) = 1 *_A(x1,x2) = max{x1 + 6, x2 - 8} s_A(x1) = 3 +_A(x1,x2) = max{x1 + 7, x2} |0|_A = 5 sum_A(x1) = 6 nil_A = 9 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: *#_A(x1,x2) = max{0, x1 - 25, x2 - 36} *_A(x1,x2) = max{24, x1 + 11, x2} s_A(x1) = max{12, x1} +_A(x1,x2) = max{24, x1, x2} |0|_A = 25 sum_A(x1) = max{41, x1 - 3} nil_A = 0 *#!_A(x1,x2) = max{11, x1 - 1} *!_A(x1,x2) = max{9, x1 - 26, x2 - 51} s!_A(x1) = max{1, x1 - 36} +!_A(x1,x2) = max{7, x1 - 36, x2 - 36} |0|!_A = 2 sum!_A(x1) = max{6, x1 - 55} nil!_A = 3 partial status: pi(*#) = [] pi(*) = [1] pi(s) = [] pi(+) = [1, 2] pi(|0|) = [] pi(sum) = [] pi(nil) = [] 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: app(nil(),l) -> l r10: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r11: sum(nil()) -> |0|() r12: sum(cons(x,l)) -> +(x,sum(l)) r13: sum(app(l1,l2)) -> +(sum(l1),sum(l2)) r14: prod(nil()) -> s(|0|()) r15: prod(cons(x,l)) -> *(x,prod(l)) r16: prod(app(l1,l2)) -> *(prod(l1),prod(l2)) 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: app(nil(),l) -> l r10: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r11: sum(nil()) -> |0|() r12: sum(cons(x,l)) -> +(x,sum(l)) r13: sum(app(l1,l2)) -> +(sum(l1),sum(l2)) r14: prod(nil()) -> s(|0|()) r15: prod(cons(x,l)) -> *(x,prod(l)) r16: prod(app(l1,l2)) -> *(prod(l1),prod(l2)) The set of usable rules consists of r5, r6 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: *#_A(x1,x2) = max{3, x2 + 1} *_A(x1,x2) = max{4, x1 - 14, x2 - 15} s_A(x1) = x1 + 26 |0|_A = 0 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: *#_A(x1,x2) = 0 *_A(x1,x2) = max{19, x1 - 20, x2 - 20} s_A(x1) = max{6, x1 - 20} |0|_A = 17 *#!_A(x1,x2) = 0 *!_A(x1,x2) = max{2, x1 - 18} s!_A(x1) = max{3, x1 - 84} |0|!_A = 1 partial status: pi(*#) = [2] pi(*) = [] pi(s) = [1] 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) 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: app(nil(),l) -> l r10: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r11: sum(nil()) -> |0|() r12: sum(cons(x,l)) -> +(x,sum(l)) r13: sum(app(l1,l2)) -> +(sum(l1),sum(l2)) r14: prod(nil()) -> s(|0|()) r15: prod(cons(x,l)) -> *(x,prod(l)) r16: prod(app(l1,l2)) -> *(prod(l1),prod(l2)) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: *#(*(x,y),z) -> *#(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: app(nil(),l) -> l r10: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r11: sum(nil()) -> |0|() r12: sum(cons(x,l)) -> +(x,sum(l)) r13: sum(app(l1,l2)) -> +(sum(l1),sum(l2)) r14: prod(nil()) -> s(|0|()) r15: prod(cons(x,l)) -> *(x,prod(l)) r16: prod(app(l1,l2)) -> *(prod(l1),prod(l2)) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: *#_A(x1,x2) = max{35, x1} *_A(x1,x2) = max{35, x1 + 17, x2 + 18} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: *#_A(x1,x2) = 0 *_A(x1,x2) = max{1, x1 - 22, x2 - 25} *#!_A(x1,x2) = 0 *!_A(x1,x2) = max{5, x1 - 3, x2 - 5} partial status: pi(*#) = [1] pi(*) = [1, 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: +#(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: app(nil(),l) -> l r10: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r11: sum(nil()) -> |0|() r12: sum(cons(x,l)) -> +(x,sum(l)) r13: sum(app(l1,l2)) -> +(sum(l1),sum(l2)) r14: prod(nil()) -> s(|0|()) r15: prod(cons(x,l)) -> *(x,prod(l)) r16: prod(app(l1,l2)) -> *(prod(l1),prod(l2)) The set of usable rules consists of r1, r2 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: +#_A(x1,x2) = 0 s_A(x1) = max{16, x1 - 42} +_A(x1,x2) = max{27, x1 + 14, x2 + 14} |0|_A = 16 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: +#_A(x1,x2) = max{0, x1 - 14} s_A(x1) = max{21, x1 + 10} +_A(x1,x2) = max{13, x1 + 10, x2 + 10} |0|_A = 21 +#!_A(x1,x2) = max{0, x1 - 20} s!_A(x1) = max{1, x1 - 31} +!_A(x1,x2) = max{5, x1 - 48, x2 - 40} |0|!_A = 0 partial status: pi(+#) = [] pi(s) = [] pi(+) = [1, 2] pi(|0|) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: +#(+(x,y),z) -> +#(y,z) p2: +#(+(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: app(nil(),l) -> l r10: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r11: sum(nil()) -> |0|() r12: sum(cons(x,l)) -> +(x,sum(l)) r13: sum(app(l1,l2)) -> +(sum(l1),sum(l2)) r14: prod(nil()) -> s(|0|()) r15: prod(cons(x,l)) -> *(x,prod(l)) r16: prod(app(l1,l2)) -> *(prod(l1),prod(l2)) 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: +#(+(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: app(nil(),l) -> l r10: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r11: sum(nil()) -> |0|() r12: sum(cons(x,l)) -> +(x,sum(l)) r13: sum(app(l1,l2)) -> +(sum(l1),sum(l2)) r14: prod(nil()) -> s(|0|()) r15: prod(cons(x,l)) -> *(x,prod(l)) r16: prod(app(l1,l2)) -> *(prod(l1),prod(l2)) The set of usable rules consists of r1, r2, r3, r4 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: +#_A(x1,x2) = max{25, x1 + 13, x2 - 11} +_A(x1,x2) = max{x1 + 12, x2} |0|_A = 8 s_A(x1) = max{14, x1 - 27} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: +#_A(x1,x2) = max{0, x1 - 18, x2 - 26} +_A(x1,x2) = max{17, x1 + 8, x2} |0|_A = 28 s_A(x1) = max{28, x1 - 29} +#!_A(x1,x2) = max{1, x1 - 18, x2 - 44} +!_A(x1,x2) = max{5, x1 - 29, x2 - 37} |0|!_A = 0 s!_A(x1) = max{1, x1 - 66} partial status: pi(+#) = [1] pi(+) = [1, 2] pi(|0|) = [] pi(s) = [] 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: app#(cons(x,l1),l2) -> app#(l1,l2) 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: app(nil(),l) -> l r10: app(cons(x,l1),l2) -> cons(x,app(l1,l2)) r11: sum(nil()) -> |0|() r12: sum(cons(x,l)) -> +(x,sum(l)) r13: sum(app(l1,l2)) -> +(sum(l1),sum(l2)) r14: prod(nil()) -> s(|0|()) r15: prod(cons(x,l)) -> *(x,prod(l)) r16: prod(app(l1,l2)) -> *(prod(l1),prod(l2)) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: app#_A(x1,x2) = x1 + 12 cons_A(x1,x2) = max{x1 - 10, x2 + 28} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = 0 cons_A(x1,x2) = max{153, x1 + 151, x2 - 117} app#!_A(x1,x2) = max{x1 + 123, x2 + 6} cons!_A(x1,x2) = max{4, x1 - 53, x2 - 55} partial status: pi(app#) = [1] pi(cons) = [] The following rules are removed: p1 Then no dependency pair remains.