YES We show the termination of the TRS R: ack_in(|0|(),n) -> ack_out(s(n)) ack_in(s(m),|0|()) -> u11(ack_in(m,s(|0|()))) u11(ack_out(n)) -> ack_out(n) ack_in(s(m),s(n)) -> u21(ack_in(s(m),n),m) u21(ack_out(n),m) -> u22(ack_in(m,n)) u22(ack_out(n)) -> ack_out(n) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: ack_in#(s(m),|0|()) -> u11#(ack_in(m,s(|0|()))) p2: ack_in#(s(m),|0|()) -> ack_in#(m,s(|0|())) p3: ack_in#(s(m),s(n)) -> u21#(ack_in(s(m),n),m) p4: ack_in#(s(m),s(n)) -> ack_in#(s(m),n) p5: u21#(ack_out(n),m) -> u22#(ack_in(m,n)) p6: u21#(ack_out(n),m) -> ack_in#(m,n) and R consists of: r1: ack_in(|0|(),n) -> ack_out(s(n)) r2: ack_in(s(m),|0|()) -> u11(ack_in(m,s(|0|()))) r3: u11(ack_out(n)) -> ack_out(n) r4: ack_in(s(m),s(n)) -> u21(ack_in(s(m),n),m) r5: u21(ack_out(n),m) -> u22(ack_in(m,n)) r6: u22(ack_out(n)) -> ack_out(n) The estimated dependency graph contains the following SCCs: {p2, p3, p4, p6} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: ack_in#(s(m),|0|()) -> ack_in#(m,s(|0|())) p2: ack_in#(s(m),s(n)) -> ack_in#(s(m),n) p3: ack_in#(s(m),s(n)) -> u21#(ack_in(s(m),n),m) p4: u21#(ack_out(n),m) -> ack_in#(m,n) and R consists of: r1: ack_in(|0|(),n) -> ack_out(s(n)) r2: ack_in(s(m),|0|()) -> u11(ack_in(m,s(|0|()))) r3: u11(ack_out(n)) -> ack_out(n) r4: ack_in(s(m),s(n)) -> u21(ack_in(s(m),n),m) r5: u21(ack_out(n),m) -> u22(ack_in(m,n)) r6: u22(ack_out(n)) -> ack_out(n) The set of usable rules consists of r1, r2, r3, r4, r5, r6 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: ack_in#_A(x1,x2) = x1 + 13 s_A(x1) = x1 |0|_A = 1 u21#_A(x1,x2) = x2 + 13 ack_in_A(x1,x2) = max{18, x1 + 14, x2 + 16} ack_out_A(x1) = 0 u22_A(x1) = 15 u11_A(x1) = 0 u21_A(x1,x2) = 15 precedence: ack_in# = u21# > s = |0| = ack_in > u21 > u22 > u11 > ack_out partial status: pi(ack_in#) = [1] pi(s) = [1] pi(|0|) = [] pi(u21#) = [2] pi(ack_in) = [1] pi(ack_out) = [] pi(u22) = [] pi(u11) = [] pi(u21) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: ack_in#_A(x1,x2) = x1 + 15 s_A(x1) = x1 + 12 |0|_A = 9 u21#_A(x1,x2) = x2 + 16 ack_in_A(x1,x2) = max{18, x1 + 14} ack_out_A(x1) = 24 u22_A(x1) = 38 u11_A(x1) = 27 u21_A(x1,x2) = 27 precedence: ack_in# = s = |0| = u21# = ack_in = ack_out = u22 = u11 = u21 partial status: pi(ack_in#) = [1] pi(s) = [1] pi(|0|) = [] pi(u21#) = [2] pi(ack_in) = [1] pi(ack_out) = [] pi(u22) = [] pi(u11) = [] pi(u21) = [] 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: ack_in#(s(m),s(n)) -> ack_in#(s(m),n) p2: ack_in#(s(m),s(n)) -> u21#(ack_in(s(m),n),m) p3: u21#(ack_out(n),m) -> ack_in#(m,n) and R consists of: r1: ack_in(|0|(),n) -> ack_out(s(n)) r2: ack_in(s(m),|0|()) -> u11(ack_in(m,s(|0|()))) r3: u11(ack_out(n)) -> ack_out(n) r4: ack_in(s(m),s(n)) -> u21(ack_in(s(m),n),m) r5: u21(ack_out(n),m) -> u22(ack_in(m,n)) r6: u22(ack_out(n)) -> ack_out(n) 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: ack_in#(s(m),s(n)) -> ack_in#(s(m),n) p2: ack_in#(s(m),s(n)) -> u21#(ack_in(s(m),n),m) p3: u21#(ack_out(n),m) -> ack_in#(m,n) and R consists of: r1: ack_in(|0|(),n) -> ack_out(s(n)) r2: ack_in(s(m),|0|()) -> u11(ack_in(m,s(|0|()))) r3: u11(ack_out(n)) -> ack_out(n) r4: ack_in(s(m),s(n)) -> u21(ack_in(s(m),n),m) r5: u21(ack_out(n),m) -> u22(ack_in(m,n)) r6: u22(ack_out(n)) -> ack_out(n) The set of usable rules consists of r1, r2, r3, r4, r5, r6 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: ack_in#_A(x1,x2) = x1 + 5 s_A(x1) = x1 u21#_A(x1,x2) = x2 + 5 ack_in_A(x1,x2) = max{x1 + 5, x2 + 4} ack_out_A(x1) = max{5, x1 + 4} u22_A(x1) = max{3, x1} |0|_A = 0 u11_A(x1) = max{3, x1} u21_A(x1,x2) = max{x1, x2 + 5} precedence: ack_in# = s = u21# = ack_in > u22 = |0| = u11 = u21 > ack_out partial status: pi(ack_in#) = [1] pi(s) = [1] pi(u21#) = [2] pi(ack_in) = [1, 2] pi(ack_out) = [1] pi(u22) = [] pi(|0|) = [] pi(u11) = [1] pi(u21) = [1, 2] 2. weighted path order base order: max/plus interpretations on natural numbers: ack_in#_A(x1,x2) = max{1, x1 - 4} s_A(x1) = x1 + 10 u21#_A(x1,x2) = x2 + 1 ack_in_A(x1,x2) = max{x1 + 21, x2 + 19} ack_out_A(x1) = max{25, x1} u22_A(x1) = 39 |0|_A = 3 u11_A(x1) = max{21, x1 - 1} u21_A(x1,x2) = max{x1 + 13, x2 + 32} precedence: ack_in# = s = u21# = ack_in = ack_out = u22 = |0| = u11 = u21 partial status: pi(ack_in#) = [] pi(s) = [1] pi(u21#) = [2] pi(ack_in) = [1, 2] pi(ack_out) = [1] pi(u22) = [] pi(|0|) = [] pi(u11) = [] pi(u21) = [] The next rules are strictly ordered: p2, p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: ack_in#(s(m),s(n)) -> ack_in#(s(m),n) and R consists of: r1: ack_in(|0|(),n) -> ack_out(s(n)) r2: ack_in(s(m),|0|()) -> u11(ack_in(m,s(|0|()))) r3: u11(ack_out(n)) -> ack_out(n) r4: ack_in(s(m),s(n)) -> u21(ack_in(s(m),n),m) r5: u21(ack_out(n),m) -> u22(ack_in(m,n)) r6: u22(ack_out(n)) -> ack_out(n) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: ack_in#(s(m),s(n)) -> ack_in#(s(m),n) and R consists of: r1: ack_in(|0|(),n) -> ack_out(s(n)) r2: ack_in(s(m),|0|()) -> u11(ack_in(m,s(|0|()))) r3: u11(ack_out(n)) -> ack_out(n) r4: ack_in(s(m),s(n)) -> u21(ack_in(s(m),n),m) r5: u21(ack_out(n),m) -> u22(ack_in(m,n)) r6: u22(ack_out(n)) -> ack_out(n) 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: ack_in#_A(x1,x2) = max{x1 - 1, x2 + 3} s_A(x1) = max{2, x1} precedence: ack_in# = s partial status: pi(ack_in#) = [2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: ack_in#_A(x1,x2) = max{0, x2 - 3} s_A(x1) = x1 + 2 precedence: ack_in# = s partial status: pi(ack_in#) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.