YES We show the termination of the TRS R: f(f(x,y,z),u,f(x,y,v)) -> f(x,y,f(z,u,v)) f(x,y,y) -> y f(x,y,g(y)) -> x f(x,x,y) -> x f(g(x),x,y) -> y -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: f#(f(x,y,z),u,f(x,y,v)) -> f#(x,y,f(z,u,v)) p2: f#(f(x,y,z),u,f(x,y,v)) -> f#(z,u,v) and R consists of: r1: f(f(x,y,z),u,f(x,y,v)) -> f(x,y,f(z,u,v)) r2: f(x,y,y) -> y r3: f(x,y,g(y)) -> x r4: f(x,x,y) -> x r5: f(g(x),x,y) -> y The estimated dependency graph contains the following SCCs: {p1, p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: f#(f(x,y,z),u,f(x,y,v)) -> f#(x,y,f(z,u,v)) p2: f#(f(x,y,z),u,f(x,y,v)) -> f#(z,u,v) and R consists of: r1: f(f(x,y,z),u,f(x,y,v)) -> f(x,y,f(z,u,v)) r2: f(x,y,y) -> y r3: f(x,y,g(y)) -> x r4: f(x,x,y) -> x r5: f(g(x),x,y) -> y The set of usable rules consists of r1, r2, r3, r4, r5 Take the reduction pair: lexicographic combination of reduction pairs: 1. max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = max{x1, x3} f_A(x1,x2,x3) = max{x1 + 1, x3 + 1} g_A(x1) = 0 2. max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = 0 f_A(x1,x2,x3) = 0 g_A(x1) = 0 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: f#(f(x,y,z),u,f(x,y,v)) -> f#(x,y,f(z,u,v)) and R consists of: r1: f(f(x,y,z),u,f(x,y,v)) -> f(x,y,f(z,u,v)) r2: f(x,y,y) -> y r3: f(x,y,g(y)) -> x r4: f(x,x,y) -> x r5: f(g(x),x,y) -> y The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: f#(f(x,y,z),u,f(x,y,v)) -> f#(x,y,f(z,u,v)) and R consists of: r1: f(f(x,y,z),u,f(x,y,v)) -> f(x,y,f(z,u,v)) r2: f(x,y,y) -> y r3: f(x,y,g(y)) -> x r4: f(x,x,y) -> x r5: f(g(x),x,y) -> y The set of usable rules consists of r1, r2, r3, r4, r5 Take the reduction pair: lexicographic combination of reduction pairs: 1. max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = x1 f_A(x1,x2,x3) = max{x1 + 1, x3 + 1} g_A(x1) = 0 2. max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = 0 f_A(x1,x2,x3) = 0 g_A(x1) = 0 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.