YES We show the termination of the TRS R: minus(x,|0|()) -> x minus(s(x),s(y)) -> minus(x,y) quot(|0|(),s(y)) -> |0|() quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) plus(|0|(),y) -> y plus(s(x),y) -> s(plus(x,y)) minus(minus(x,y),z) -> minus(x,plus(y,z)) 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))))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: minus#(s(x),s(y)) -> minus#(x,y) p2: quot#(s(x),s(y)) -> quot#(minus(x,y),s(y)) p3: quot#(s(x),s(y)) -> minus#(x,y) p4: plus#(s(x),y) -> plus#(x,y) p5: minus#(minus(x,y),z) -> minus#(x,plus(y,z)) p6: minus#(minus(x,y),z) -> plus#(y,z) p7: app#(cons(x,l),k) -> app#(l,k) p8: sum#(cons(x,cons(y,l))) -> sum#(cons(plus(x,y),l)) p9: sum#(cons(x,cons(y,l))) -> plus#(x,y) p10: sum#(app(l,cons(x,cons(y,k)))) -> sum#(app(l,sum(cons(x,cons(y,k))))) p11: sum#(app(l,cons(x,cons(y,k)))) -> app#(l,sum(cons(x,cons(y,k)))) p12: sum#(app(l,cons(x,cons(y,k)))) -> sum#(cons(x,cons(y,k))) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) The estimated dependency graph contains the following SCCs: {p2} {p1, p5} {p10} {p8} {p4} {p7} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: quot#(s(x),s(y)) -> quot#(minus(x,y),s(y)) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) The set of usable rules consists of r1, r2, r7 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: quot#_A(x1,x2) = 0 s_A(x1) = x1 + 3 minus_A(x1,x2) = x1 + 1 |0|_A() = 1 plus_A(x1,x2) = x1 + x2 + 4 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: quot#_A(x1,x2) = max{0, x2 - 10} s_A(x1) = x1 + 12 minus_A(x1,x2) = x1 + 5 |0|_A = 2 plus_A(x1,x2) = max{12, x1 - 14} quot#!_A(x1,x2) = max{3, x1 - 6} s!_A(x1) = x1 + 12 minus!_A(x1,x2) = x1 + 12 |0|!_A = 12 plus!_A(x1,x2) = max{65, x1 - 13} partial status: pi(quot#) = [] pi(s) = [1] pi(minus) = [] pi(|0|) = [] pi(plus) = [] 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: minus#(s(x),s(y)) -> minus#(x,y) p2: minus#(minus(x,y),z) -> minus#(x,plus(y,z)) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) The set of usable rules consists of r5, r6 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: minus#_A(x1,x2) = x1 + x2 + 3 s_A(x1) = x1 + 2 minus_A(x1,x2) = x1 + x2 + 7 plus_A(x1,x2) = x1 + x2 + 6 |0|_A() = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: minus#_A(x1,x2) = 0 s_A(x1) = 18 minus_A(x1,x2) = max{16, x1 - 20, x2 - 20} plus_A(x1,x2) = max{18, x1 - 19, x2 + 6} |0|_A = 16 minus#!_A(x1,x2) = max{14, x1 - 1} s!_A(x1) = 39 minus!_A(x1,x2) = 40 plus!_A(x1,x2) = max{41, x1 + 20, x2 + 1} |0|!_A = 39 partial status: pi(minus#) = [] pi(s) = [] pi(minus) = [2] pi(plus) = [] pi(|0|) = [] 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: sum#(app(l,cons(x,cons(y,k)))) -> sum#(app(l,sum(cons(x,cons(y,k))))) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) The set of usable rules consists of r5, r6, r8, r9, r10, r11, r12 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: sum#_A(x1) = x1 app_A(x1,x2) = x1 + x2 + 4 cons_A(x1,x2) = x2 + 3 sum_A(x1) = 5 plus_A(x1,x2) = x1 + x2 + 7 |0|_A() = 1 s_A(x1) = 2 nil_A() = 1 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{9, x1 + 1, x2 + 7} cons_A(x1,x2) = max{41, x1 - 16, x2} sum_A(x1) = max{59, x1 + 6} plus_A(x1,x2) = max{3, x1 - 5, x2} |0|_A = 3 s_A(x1) = max{3, x1 - 4} nil_A = 60 sum#!_A(x1) = max{46, x1 - 4} app!_A(x1,x2) = max{45, x1 - 45, x2 - 61} cons!_A(x1,x2) = max{4, x1 - 93, x2 - 71} sum!_A(x1) = max{2, x1 - 85} plus!_A(x1,x2) = max{5, x1 - 28, x2 - 32} |0|!_A = 0 s!_A(x1) = max{1, x1 - 23} nil!_A = 1 partial status: pi(sum#) = [1] pi(app) = [2] pi(cons) = [2] pi(sum) = [] pi(plus) = [] pi(|0|) = [] pi(s) = [] pi(nil) = [] 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: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) The set of usable rules consists of r5, r6 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: sum#_A(x1) = 0 cons_A(x1,x2) = x1 + 4 plus_A(x1,x2) = x2 + 3 |0|_A() = 1 s_A(x1) = 2 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: sum#_A(x1) = max{0, x1 - 15} cons_A(x1,x2) = max{x1 - 35, x2 + 7} plus_A(x1,x2) = max{6, x1 - 56, x2 + 3} |0|_A = 20 s_A(x1) = max{4, x1 - 7} sum#!_A(x1) = x1 + 37 cons!_A(x1,x2) = x1 + 113 plus!_A(x1,x2) = max{54, x1 - 78, x2 - 74} |0|!_A = 0 s!_A(x1) = max{53, x1 - 79} partial status: pi(sum#) = [] pi(cons) = [1] 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: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: plus#_A(x1,x2) = x1 + x2 s_A(x1) = x1 + 4 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x1 - 3} s_A(x1) = max{28, x1 + 2} plus#!_A(x1,x2) = max{1, x1 - 29, x2 - 1} s!_A(x1) = max{58, x1 - 33} partial status: pi(plus#) = [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: app#(cons(x,l),k) -> app#(l,k) and R consists of: r1: minus(x,|0|()) -> x r2: minus(s(x),s(y)) -> minus(x,y) r3: quot(|0|(),s(y)) -> |0|() r4: quot(s(x),s(y)) -> s(quot(minus(x,y),s(y))) r5: plus(|0|(),y) -> y r6: plus(s(x),y) -> s(plus(x,y)) r7: minus(minus(x,y),z) -> minus(x,plus(y,z)) r8: app(nil(),k) -> k r9: app(l,nil()) -> l r10: app(cons(x,l),k) -> cons(x,app(l,k)) r11: sum(cons(x,nil())) -> cons(x,nil()) r12: sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) r13: sum(app(l,cons(x,cons(y,k)))) -> sum(app(l,sum(cons(x,cons(y,k))))) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: app#_A(x1,x2) = x1 + 5 cons_A(x1,x2) = x1 + x2 + 4 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: app#_A(x1,x2) = max{0, x1 - 7} cons_A(x1,x2) = max{10, x1 - 28, x2 + 6} app#!_A(x1,x2) = max{1, x1 - 336} cons!_A(x1,x2) = max{3, x1 - 291, x2 - 335} partial status: pi(app#) = [] pi(cons) = [2] The following rules are removed: p1 Then no dependency pair remains.