YES We show the termination of the relative TRS R/S: 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)) sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) pred(cons(s(x),nil())) -> cons(x,nil()) S: cons(x,cons(y,l)) -> cons(y,cons(x,l)) -- SCC decomposition. Consider the non-minimal 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) p8: sum#(plus(cons(|0|(),x),cons(y,l))) -> pred#(sum(cons(s(x),cons(y,l)))) p9: sum#(plus(cons(|0|(),x),cons(y,l))) -> sum#(cons(s(x),cons(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)) r9: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r10: pred(cons(s(x),nil())) -> cons(x,nil()) r11: cons(x,cons(y,l)) -> cons(y,cons(x,l)) The estimated dependency graph contains the following SCCs: {p2, p4, p6, p9} {p1} {p7} -- Reduction pair. Consider the non-minimal dependency pair problem (P, R), where P consists of p1: sum#(plus(cons(|0|(),x),cons(y,l))) -> sum#(cons(s(x),cons(y,l))) p2: sum#(app(l,cons(x,cons(y,k)))) -> sum#(cons(x,cons(y,k))) p3: sum#(app(l,cons(x,cons(y,k)))) -> sum#(app(l,sum(cons(x,cons(y,k))))) p4: 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)) r9: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r10: pred(cons(s(x),nil())) -> cons(x,nil()) r11: cons(x,cons(y,l)) -> cons(y,cons(x,l)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: sum#_A(x1) = max{48, x1 + 22} plus_A(x1,x2) = max{x1 + 19, x2 + 21} cons_A(x1,x2) = max{8, x2} |0|_A = 10 s_A(x1) = max{64, x1} app_A(x1,x2) = max{63, x1 + 54, x2 + 45} sum_A(x1) = max{2, x1} nil_A = 0 pred_A(x1) = max{16, x1 + 10} precedence: sum# = plus > |0| = s = app = sum > cons = nil = pred partial status: pi(sum#) = [] pi(plus) = [1, 2] pi(cons) = [] pi(|0|) = [] pi(s) = [1] pi(app) = [1, 2] pi(sum) = [] pi(nil) = [] pi(pred) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: sum#_A(x1) = 172 plus_A(x1,x2) = max{x1 - 158, x2 + 74} cons_A(x1,x2) = 232 |0|_A = 307 s_A(x1) = x1 + 157 app_A(x1,x2) = max{x1 + 122, x2 + 111} sum_A(x1) = 66 nil_A = 156 pred_A(x1) = max{146, x1 + 2} precedence: sum# = plus = cons = |0| = s = app = sum = nil = pred partial status: pi(sum#) = [] pi(plus) = [2] pi(cons) = [] pi(|0|) = [] pi(s) = [1] pi(app) = [2] pi(sum) = [] pi(nil) = [] pi(pred) = [1] The next rules are strictly ordered: p1, p2 We remove them from the problem. -- SCC decomposition. Consider the non-minimal 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))))) p2: 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)) r9: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r10: pred(cons(s(x),nil())) -> cons(x,nil()) r11: cons(x,cons(y,l)) -> cons(y,cons(x,l)) The estimated dependency graph contains the following SCCs: {p1, p2} -- Reduction pair. Consider the non-minimal 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))))) p2: 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)) r9: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r10: pred(cons(s(x),nil())) -> cons(x,nil()) r11: cons(x,cons(y,l)) -> cons(y,cons(x,l)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: sum#_A(x1) = x1 app_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(0,0)) x2 + (6,1) cons_A(x1,x2) = x1 + x2 + (5,2) sum_A(x1) = x1 + (0,4) plus_A(x1,x2) = x1 + ((1,0),(1,1)) x2 + (4,5) nil_A() = (7,1) |0|_A() = (4,3) s_A(x1) = x1 + (6,4) pred_A(x1) = x1 + (1,1) precedence: sum# = app = cons = sum = plus = nil = |0| = s = pred partial status: pi(sum#) = [] pi(app) = [] pi(cons) = [] pi(sum) = [] pi(plus) = [] pi(nil) = [] pi(|0|) = [] pi(s) = [] pi(pred) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: sum#_A(x1) = ((1,0),(0,0)) x1 app_A(x1,x2) = ((1,0),(0,0)) x1 + (8,16) cons_A(x1,x2) = ((1,0),(1,1)) x1 + x2 + (9,4) sum_A(x1) = ((1,0),(0,0)) x1 + (2,15) plus_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(0,0)) x2 + (6,16) nil_A() = (11,0) |0|_A() = (8,2) s_A(x1) = x1 + (10,1) pred_A(x1) = ((1,0),(0,0)) x1 + (1,3) precedence: sum = plus = pred > |0| > sum# = cons > app > nil = s partial status: pi(sum#) = [] pi(app) = [] pi(cons) = [] pi(sum) = [] pi(plus) = [] pi(nil) = [] pi(|0|) = [] pi(s) = [] pi(pred) = [] The next rules are strictly ordered: p2 We remove them from the problem. -- SCC decomposition. Consider the non-minimal 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)) r9: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r10: pred(cons(s(x),nil())) -> cons(x,nil()) r11: cons(x,cons(y,l)) -> cons(y,cons(x,l)) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the non-minimal 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)) r9: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r10: pred(cons(s(x),nil())) -> cons(x,nil()) r11: cons(x,cons(y,l)) -> cons(y,cons(x,l)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: sum#_A(x1) = ((1,0),(1,0)) x1 + (1,1) app_A(x1,x2) = x1 + x2 + (6,0) cons_A(x1,x2) = ((1,0),(0,0)) x2 + (5,0) sum_A(x1) = (8,8) nil_A() = (1,9) plus_A(x1,x2) = ((1,0),(1,1)) x2 + (6,7) |0|_A() = (11,9) s_A(x1) = ((1,0),(1,0)) x1 pred_A(x1) = (7,10) precedence: sum# = app = cons = sum = nil = plus = |0| = s = pred partial status: pi(sum#) = [] pi(app) = [] pi(cons) = [] pi(sum) = [] pi(nil) = [] pi(plus) = [] pi(|0|) = [] pi(s) = [] pi(pred) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: sum#_A(x1) = (0,1) app_A(x1,x2) = x1 + x2 cons_A(x1,x2) = (0,2) sum_A(x1) = (2,2) nil_A() = (2,2) plus_A(x1,x2) = x2 + (3,3) |0|_A() = (0,2) s_A(x1) = (1,3) pred_A(x1) = (1,3) precedence: sum# = app = cons = sum = nil = plus = pred > |0| = s partial status: pi(sum#) = [] pi(app) = [2] pi(cons) = [] pi(sum) = [] pi(nil) = [] pi(plus) = [2] pi(|0|) = [] pi(s) = [] pi(pred) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the non-minimal 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)) r9: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r10: pred(cons(s(x),nil())) -> cons(x,nil()) r11: cons(x,cons(y,l)) -> cons(y,cons(x,l)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = x1 + x2 + (10,16) cons_A(x1,x2) = x2 + (9,15) app_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(1,1)) x2 + (2,16) nil_A() = (7,1) sum_A(x1) = ((0,0),(1,0)) x1 + (17,1) plus_A(x1,x2) = ((1,0),(1,0)) x1 + ((1,0),(1,1)) x2 + (9,20) |0|_A() = (27,0) s_A(x1) = x1 + (26,24) pred_A(x1) = (17,2) precedence: app# = cons = app = nil = sum = plus = |0| = s = pred partial status: pi(app#) = [] pi(cons) = [] pi(app) = [] pi(nil) = [] pi(sum) = [] pi(plus) = [] pi(|0|) = [] pi(s) = [] pi(pred) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = x1 cons_A(x1,x2) = x2 + (0,6) app_A(x1,x2) = x2 + (4,1) nil_A() = (1,9) sum_A(x1) = (3,10) plus_A(x1,x2) = ((1,0),(0,0)) x2 + (3,13) |0|_A() = (1,5) s_A(x1) = ((0,0),(1,0)) x1 + (2,14) pred_A(x1) = (2,16) precedence: |0| = s > cons = app = sum = plus = pred > app# > nil partial status: pi(app#) = [1] pi(cons) = [2] pi(app) = [2] pi(nil) = [] pi(sum) = [] pi(plus) = [] pi(|0|) = [] pi(s) = [] pi(pred) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the non-minimal 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)) r9: sum(plus(cons(|0|(),x),cons(y,l))) -> pred(sum(cons(s(x),cons(y,l)))) r10: pred(cons(s(x),nil())) -> cons(x,nil()) r11: cons(x,cons(y,l)) -> cons(y,cons(x,l)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: plus#_A(x1,x2) = max{2, x1 + 1, x2 + 1} s_A(x1) = max{1, x1} app_A(x1,x2) = max{79, x1 + 54, x2 + 34} nil_A = 0 cons_A(x1,x2) = 44 sum_A(x1) = max{45, x1} plus_A(x1,x2) = max{x1 + 45, x2 + 15} |0|_A = 0 pred_A(x1) = x1 + 31 precedence: plus# > app = nil = cons = sum = plus > s = |0| = pred partial status: pi(plus#) = [1, 2] pi(s) = [1] pi(app) = [1] pi(nil) = [] pi(cons) = [] pi(sum) = [1] pi(plus) = [1, 2] pi(|0|) = [] pi(pred) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: plus#_A(x1,x2) = x2 + 1 s_A(x1) = x1 + 43 app_A(x1,x2) = x1 + 44 nil_A = 40 cons_A(x1,x2) = 49 sum_A(x1) = max{80, x1 + 21} plus_A(x1,x2) = max{x1 + 10, x2 + 10} |0|_A = 39 pred_A(x1) = max{26, x1 + 1} precedence: plus# = s = app = nil = cons = sum = plus = |0| = pred partial status: pi(plus#) = [] pi(s) = [1] pi(app) = [1] pi(nil) = [] pi(cons) = [] pi(sum) = [] pi(plus) = [2] pi(|0|) = [] pi(pred) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.