YES We show the termination of the TRS R: f(x,|0|(),|0|()) -> s(x) f(|0|(),y,|0|()) -> s(y) f(|0|(),|0|(),z) -> s(z) f(s(|0|()),y,z) -> f(|0|(),s(y),s(z)) f(s(x),s(y),|0|()) -> f(x,y,s(|0|())) f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z) f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|())) f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z)) f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|())) f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z) f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(z))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: f#(s(|0|()),y,z) -> f#(|0|(),s(y),s(z)) p2: f#(s(x),s(y),|0|()) -> f#(x,y,s(|0|())) p3: f#(s(x),|0|(),s(z)) -> f#(x,s(|0|()),z) p4: f#(s(x),s(y),s(z)) -> f#(x,y,f(s(x),s(y),z)) p5: f#(s(x),s(y),s(z)) -> f#(s(x),s(y),z) p6: f#(|0|(),s(s(y)),s(|0|())) -> f#(|0|(),y,s(|0|())) p7: f#(|0|(),s(|0|()),s(s(z))) -> f#(|0|(),s(|0|()),z) p8: f#(|0|(),s(s(y)),s(s(z))) -> f#(|0|(),y,f(|0|(),s(s(y)),s(z))) p9: f#(|0|(),s(s(y)),s(s(z))) -> f#(|0|(),s(s(y)),s(z)) and R consists of: r1: f(x,|0|(),|0|()) -> s(x) r2: f(|0|(),y,|0|()) -> s(y) r3: f(|0|(),|0|(),z) -> s(z) r4: f(s(|0|()),y,z) -> f(|0|(),s(y),s(z)) r5: f(s(x),s(y),|0|()) -> f(x,y,s(|0|())) r6: f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z) r7: f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|())) r8: f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z)) r9: f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|())) r10: f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z) r11: f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(z))) The estimated dependency graph contains the following SCCs: {p2, p3, p4, p5} {p8, p9} {p6} {p7} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: f#(s(x),s(y),s(z)) -> f#(s(x),s(y),z) p2: f#(s(x),s(y),s(z)) -> f#(x,y,f(s(x),s(y),z)) p3: f#(s(x),|0|(),s(z)) -> f#(x,s(|0|()),z) p4: f#(s(x),s(y),|0|()) -> f#(x,y,s(|0|())) and R consists of: r1: f(x,|0|(),|0|()) -> s(x) r2: f(|0|(),y,|0|()) -> s(y) r3: f(|0|(),|0|(),z) -> s(z) r4: f(s(|0|()),y,z) -> f(|0|(),s(y),s(z)) r5: f(s(x),s(y),|0|()) -> f(x,y,s(|0|())) r6: f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z) r7: f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|())) r8: f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z)) r9: f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|())) r10: f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z) r11: f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(z))) 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: f#_A(x1,x2,x3) = max{20, x1 + 6, x2 + 16} s_A(x1) = max{4, x1} f_A(x1,x2,x3) = max{4, x1 + 3, x2, x3} |0|_A = 1 precedence: f = |0| > f# = s partial status: pi(f#) = [1, 2] pi(s) = [1] pi(f) = [1, 2, 3] pi(|0|) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = max{x1 + 14, x2 + 16} s_A(x1) = max{15, x1 + 2} f_A(x1,x2,x3) = max{x1 + 24, x3 + 38} |0|_A = 12 precedence: f# > f = |0| > s partial status: pi(f#) = [] pi(s) = [] pi(f) = [1, 3] pi(|0|) = [] The next rules are strictly ordered: p2, p3, p4 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: f#(s(x),s(y),s(z)) -> f#(s(x),s(y),z) and R consists of: r1: f(x,|0|(),|0|()) -> s(x) r2: f(|0|(),y,|0|()) -> s(y) r3: f(|0|(),|0|(),z) -> s(z) r4: f(s(|0|()),y,z) -> f(|0|(),s(y),s(z)) r5: f(s(x),s(y),|0|()) -> f(x,y,s(|0|())) r6: f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z) r7: f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|())) r8: f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z)) r9: f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|())) r10: f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z) r11: f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(z))) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: f#(s(x),s(y),s(z)) -> f#(s(x),s(y),z) and R consists of: r1: f(x,|0|(),|0|()) -> s(x) r2: f(|0|(),y,|0|()) -> s(y) r3: f(|0|(),|0|(),z) -> s(z) r4: f(s(|0|()),y,z) -> f(|0|(),s(y),s(z)) r5: f(s(x),s(y),|0|()) -> f(x,y,s(|0|())) r6: f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z) r7: f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|())) r8: f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z)) r9: f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|())) r10: f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z) r11: f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(z))) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = max{0, x3 - 2} s_A(x1) = x1 + 5 precedence: f# = s partial status: pi(f#) = [] pi(s) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = 0 s_A(x1) = x1 + 3 precedence: f# = s partial status: pi(f#) = [] pi(s) = [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: f#(|0|(),s(s(y)),s(s(z))) -> f#(|0|(),s(s(y)),s(z)) p2: f#(|0|(),s(s(y)),s(s(z))) -> f#(|0|(),y,f(|0|(),s(s(y)),s(z))) and R consists of: r1: f(x,|0|(),|0|()) -> s(x) r2: f(|0|(),y,|0|()) -> s(y) r3: f(|0|(),|0|(),z) -> s(z) r4: f(s(|0|()),y,z) -> f(|0|(),s(y),s(z)) r5: f(s(x),s(y),|0|()) -> f(x,y,s(|0|())) r6: f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z) r7: f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|())) r8: f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z)) r9: f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|())) r10: f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z) r11: f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(z))) The set of usable rules consists of r1, r2, r3, r7, r9, r10, r11 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = max{8, x1 - 2, x2, x3} |0|_A = 4 s_A(x1) = max{3, x1} f_A(x1,x2,x3) = max{x1 + 4, x2, x3} precedence: f# > |0| = f > s partial status: pi(f#) = [2, 3] pi(|0|) = [] pi(s) = [1] pi(f) = [1, 2, 3] 2. weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = x3 + 14 |0|_A = 26 s_A(x1) = max{20, x1 + 7} f_A(x1,x2,x3) = max{1, x1 - 7} precedence: f# = |0| = s = f partial status: pi(f#) = [] pi(|0|) = [] pi(s) = [1] pi(f) = [] The next rules are strictly ordered: p1, p2 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: f#(|0|(),s(s(y)),s(|0|())) -> f#(|0|(),y,s(|0|())) and R consists of: r1: f(x,|0|(),|0|()) -> s(x) r2: f(|0|(),y,|0|()) -> s(y) r3: f(|0|(),|0|(),z) -> s(z) r4: f(s(|0|()),y,z) -> f(|0|(),s(y),s(z)) r5: f(s(x),s(y),|0|()) -> f(x,y,s(|0|())) r6: f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z) r7: f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|())) r8: f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z)) r9: f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|())) r10: f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z) r11: f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(z))) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = max{x1 + 9, x2 + 15, x3 + 3} |0|_A = 6 s_A(x1) = x1 + 7 precedence: f# = |0| = s partial status: pi(f#) = [1, 2, 3] pi(|0|) = [] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = max{14, x1 + 13, x2 + 8, x3 + 5} |0|_A = 1 s_A(x1) = x1 + 3 precedence: f# = |0| = s partial status: pi(f#) = [] pi(|0|) = [] pi(s) = [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: f#(|0|(),s(|0|()),s(s(z))) -> f#(|0|(),s(|0|()),z) and R consists of: r1: f(x,|0|(),|0|()) -> s(x) r2: f(|0|(),y,|0|()) -> s(y) r3: f(|0|(),|0|(),z) -> s(z) r4: f(s(|0|()),y,z) -> f(|0|(),s(y),s(z)) r5: f(s(x),s(y),|0|()) -> f(x,y,s(|0|())) r6: f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z) r7: f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|())) r8: f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z)) r9: f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|())) r10: f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z) r11: f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(z))) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = max{x1 + 6, x2 + 7, x3 + 10} |0|_A = 1 s_A(x1) = x1 + 3 precedence: f# = |0| = s partial status: pi(f#) = [] pi(|0|) = [] pi(s) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = 15 |0|_A = 6 s_A(x1) = x1 + 7 precedence: f# = |0| = s partial status: pi(f#) = [] pi(|0|) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.