YES We show the termination of the TRS R: a(h(),h(),h(),x) -> s(x) a(l,x,s(y),h()) -> a(l,x,y,s(h())) a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) a(l,s(x),h(),z) -> a(l,x,z,z) a(s(l),h(),h(),z) -> a(l,z,h(),z) +(x,h()) -> x +(h(),x) -> x +(s(x),s(y)) -> s(s(+(x,y))) +(+(x,y),z) -> +(x,+(y,z)) s(h()) -> |1|() 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(a(x,y,h(),h()),l)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a#(h(),h(),h(),x) -> s#(x) p2: a#(l,x,s(y),h()) -> a#(l,x,y,s(h())) p3: a#(l,x,s(y),h()) -> s#(h()) p4: a#(l,x,s(y),s(z)) -> a#(l,x,y,a(l,x,s(y),z)) p5: a#(l,x,s(y),s(z)) -> a#(l,x,s(y),z) p6: a#(l,s(x),h(),z) -> a#(l,x,z,z) p7: a#(s(l),h(),h(),z) -> a#(l,z,h(),z) p8: +#(s(x),s(y)) -> s#(s(+(x,y))) p9: +#(s(x),s(y)) -> s#(+(x,y)) p10: +#(s(x),s(y)) -> +#(x,y) p11: +#(+(x,y),z) -> +#(x,+(y,z)) p12: +#(+(x,y),z) -> +#(y,z) p13: app#(cons(x,l),k) -> app#(l,k) p14: sum#(cons(x,cons(y,l))) -> sum#(cons(a(x,y,h(),h()),l)) p15: sum#(cons(x,cons(y,l))) -> a#(x,y,h(),h()) and R consists of: r1: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The estimated dependency graph contains the following SCCs: {p14} {p2, p4, p5, p6, p7} {p10, p11, p12} {p13} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: sum#(cons(x,cons(y,l))) -> sum#(cons(a(x,y,h(),h()),l)) and R consists of: r1: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The set of usable rules consists of r1, r2, r3, r4, r5, r10 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: sum#_A(x1) = max{2, x1 - 5} cons_A(x1,x2) = max{6, x2 + 2} a_A(x1,x2,x3,x4) = max{x1 + 1, x2, x3, x4} h_A = 0 s_A(x1) = x1 |1|_A = 0 precedence: sum# = cons = a > s = |1| > h partial status: pi(sum#) = [] pi(cons) = [2] pi(a) = [1, 2, 3, 4] pi(h) = [] pi(s) = [1] pi(|1|) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a#(l,x,s(y),h()) -> a#(l,x,y,s(h())) p2: a#(s(l),h(),h(),z) -> a#(l,z,h(),z) p3: a#(l,s(x),h(),z) -> a#(l,x,z,z) p4: a#(l,x,s(y),s(z)) -> a#(l,x,s(y),z) p5: a#(l,x,s(y),s(z)) -> a#(l,x,y,a(l,x,s(y),z)) and R consists of: r1: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The set of usable rules consists of r1, r2, r3, r4, r5, r10 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: a#_A(x1,x2,x3,x4) = x1 + 3 s_A(x1) = x1 h_A = 0 a_A(x1,x2,x3,x4) = max{x1 + 4, x2, x3, x4} |1|_A = 0 precedence: a > a# = s = |1| > h partial status: pi(a#) = [1] pi(s) = [1] pi(h) = [] pi(a) = [1, 2, 3, 4] pi(|1|) = [] The next rules are strictly ordered: p2 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a#(l,x,s(y),h()) -> a#(l,x,y,s(h())) p2: a#(l,s(x),h(),z) -> a#(l,x,z,z) p3: a#(l,x,s(y),s(z)) -> a#(l,x,s(y),z) p4: a#(l,x,s(y),s(z)) -> a#(l,x,y,a(l,x,s(y),z)) and R consists of: r1: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a#(l,x,s(y),h()) -> a#(l,x,y,s(h())) p2: a#(l,x,s(y),s(z)) -> a#(l,x,y,a(l,x,s(y),z)) p3: a#(l,x,s(y),s(z)) -> a#(l,x,s(y),z) p4: a#(l,s(x),h(),z) -> a#(l,x,z,z) and R consists of: r1: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The set of usable rules consists of r1, r2, r3, r4, r5, r10 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: a#_A(x1,x2,x3,x4) = max{x1 + 10, x2 + 7, x3 + 6, x4 + 6} s_A(x1) = max{4, x1} h_A = 2 a_A(x1,x2,x3,x4) = max{x1 + 4, x2, x3, x4} |1|_A = 3 precedence: a# > a > h > s = |1| partial status: pi(a#) = [2] pi(s) = [1] pi(h) = [] pi(a) = [1, 2, 3, 4] pi(|1|) = [] The next rules are strictly ordered: p4 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a#(l,x,s(y),h()) -> a#(l,x,y,s(h())) p2: a#(l,x,s(y),s(z)) -> a#(l,x,y,a(l,x,s(y),z)) p3: a#(l,x,s(y),s(z)) -> a#(l,x,s(y),z) and R consists of: r1: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The estimated dependency graph contains the following SCCs: {p1, p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a#(l,x,s(y),h()) -> a#(l,x,y,s(h())) p2: a#(l,x,s(y),s(z)) -> a#(l,x,s(y),z) p3: a#(l,x,s(y),s(z)) -> a#(l,x,y,a(l,x,s(y),z)) and R consists of: r1: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The set of usable rules consists of r1, r2, r3, r4, r5, r10 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: a#_A(x1,x2,x3,x4) = max{x1 + 8, x2 + 7, x3 + 8, x4 + 4} s_A(x1) = max{3, x1} h_A = 0 a_A(x1,x2,x3,x4) = max{x1 + 4, x2, x3, x4} |1|_A = 1 precedence: a# > a > s = |1| > h partial status: pi(a#) = [3] pi(s) = [1] pi(h) = [] pi(a) = [1, 2, 3, 4] pi(|1|) = [] The next rules are strictly ordered: p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a#(l,x,s(y),h()) -> a#(l,x,y,s(h())) p2: a#(l,x,s(y),s(z)) -> a#(l,x,s(y),z) and R consists of: r1: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),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: a#(l,x,s(y),h()) -> a#(l,x,y,s(h())) p2: a#(l,x,s(y),s(z)) -> a#(l,x,s(y),z) and R consists of: r1: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The set of usable rules consists of r10 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: a#_A(x1,x2,x3,x4) = max{10, x1 + 7, x3 + 7, x4 + 4} s_A(x1) = x1 + 3 h_A = 0 |1|_A = 0 precedence: s = h > a# > |1| partial status: pi(a#) = [3] pi(s) = [1] pi(h) = [] pi(|1|) = [] The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a#(l,x,s(y),s(z)) -> a#(l,x,s(y),z) and R consists of: r1: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a#(l,x,s(y),s(z)) -> a#(l,x,s(y),z) and R consists of: r1: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The set of usable rules consists of r10 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: a#_A(x1,x2,x3,x4) = max{0, x4 - 3} s_A(x1) = max{4, x1 + 2} h_A = 4 |1|_A = 5 precedence: a# = s = h = |1| partial status: pi(a#) = [] pi(s) = [1] pi(h) = [] pi(|1|) = [] The next rules are strictly ordered: p1 We remove them from the problem. 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: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The set of usable rules consists of r6, r7, r8, r9, r10 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: +#_A(x1,x2) = x1 + 2 s_A(x1) = x1 +_A(x1,x2) = max{x1 + 2, x2} h_A = 2 |1|_A = 1 precedence: s = + > +# = |1| > h partial status: pi(+#) = [] pi(s) = [] pi(+) = [] pi(h) = [] pi(|1|) = [] The next rules are strictly ordered: p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: +#(s(x),s(y)) -> +#(x,y) p2: +#(+(x,y),z) -> +#(y,z) and R consists of: r1: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),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: +#(s(x),s(y)) -> +#(x,y) p2: +#(+(x,y),z) -> +#(y,z) and R consists of: r1: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: +#_A(x1,x2) = max{0, x1 - 2} s_A(x1) = max{2, x1} +_A(x1,x2) = max{3, x1 - 1, x2 + 1} precedence: +# = s = + partial status: pi(+#) = [] pi(s) = [1] pi(+) = [2] The next rules are strictly ordered: p2 We remove them from the problem. -- 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: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),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: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: +#_A(x1,x2) = max{0, x1 - 2, x2 - 2} s_A(x1) = max{3, x1 + 1} precedence: +# = s partial status: pi(+#) = [] pi(s) = [] The next rules are strictly ordered: p1 We remove them from the problem. 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: a(h(),h(),h(),x) -> s(x) r2: a(l,x,s(y),h()) -> a(l,x,y,s(h())) r3: a(l,x,s(y),s(z)) -> a(l,x,y,a(l,x,s(y),z)) r4: a(l,s(x),h(),z) -> a(l,x,z,z) r5: a(s(l),h(),h(),z) -> a(l,z,h(),z) r6: +(x,h()) -> x r7: +(h(),x) -> x r8: +(s(x),s(y)) -> s(s(+(x,y))) r9: +(+(x,y),z) -> +(x,+(y,z)) r10: s(h()) -> |1|() r11: app(nil(),k) -> k r12: app(l,nil()) -> l r13: app(cons(x,l),k) -> cons(x,app(l,k)) r14: sum(cons(x,nil())) -> cons(x,nil()) r15: sum(cons(x,cons(y,l))) -> sum(cons(a(x,y,h(),h()),l)) The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{0, x1 - 2} cons_A(x1,x2) = max{x1 + 3, x2 + 1} precedence: app# = cons partial status: pi(app#) = [] pi(cons) = [2] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.