YES We show the termination of the TRS R: a(f(),a(g(),a(f(),x))) -> a(f(),a(g(),a(g(),a(f(),x)))) a(g(),a(f(),a(g(),x))) -> a(g(),a(f(),a(f(),a(g(),x)))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a#(f(),a(g(),a(f(),x))) -> a#(f(),a(g(),a(g(),a(f(),x)))) p2: a#(f(),a(g(),a(f(),x))) -> a#(g(),a(g(),a(f(),x))) p3: a#(g(),a(f(),a(g(),x))) -> a#(g(),a(f(),a(f(),a(g(),x)))) p4: a#(g(),a(f(),a(g(),x))) -> a#(f(),a(f(),a(g(),x))) and R consists of: r1: a(f(),a(g(),a(f(),x))) -> a(f(),a(g(),a(g(),a(f(),x)))) r2: a(g(),a(f(),a(g(),x))) -> a(g(),a(f(),a(f(),a(g(),x)))) The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a#(f(),a(g(),a(f(),x))) -> a#(f(),a(g(),a(g(),a(f(),x)))) p2: a#(f(),a(g(),a(f(),x))) -> a#(g(),a(g(),a(f(),x))) p3: a#(g(),a(f(),a(g(),x))) -> a#(f(),a(f(),a(g(),x))) p4: a#(g(),a(f(),a(g(),x))) -> a#(g(),a(f(),a(f(),a(g(),x)))) and R consists of: r1: a(f(),a(g(),a(f(),x))) -> a(f(),a(g(),a(g(),a(f(),x)))) r2: a(g(),a(f(),a(g(),x))) -> a(g(),a(f(),a(f(),a(g(),x)))) The set of usable rules consists of r1, r2 Take the reduction pair: max/plus interpretations on natural numbers: a#_A(x1,x2) = max{x1 + 1, x2 + 3} f_A = 0 a_A(x1,x2) = max{x1 + 4, x2 - 1} g_A = 5 The next rules are strictly ordered: p4 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a#(f(),a(g(),a(f(),x))) -> a#(f(),a(g(),a(g(),a(f(),x)))) p2: a#(f(),a(g(),a(f(),x))) -> a#(g(),a(g(),a(f(),x))) p3: a#(g(),a(f(),a(g(),x))) -> a#(f(),a(f(),a(g(),x))) and R consists of: r1: a(f(),a(g(),a(f(),x))) -> a(f(),a(g(),a(g(),a(f(),x)))) r2: a(g(),a(f(),a(g(),x))) -> a(g(),a(f(),a(f(),a(g(),x)))) 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: a#(f(),a(g(),a(f(),x))) -> a#(f(),a(g(),a(g(),a(f(),x)))) p2: a#(f(),a(g(),a(f(),x))) -> a#(g(),a(g(),a(f(),x))) p3: a#(g(),a(f(),a(g(),x))) -> a#(f(),a(f(),a(g(),x))) and R consists of: r1: a(f(),a(g(),a(f(),x))) -> a(f(),a(g(),a(g(),a(f(),x)))) r2: a(g(),a(f(),a(g(),x))) -> a(g(),a(f(),a(f(),a(g(),x)))) The set of usable rules consists of r1, r2 Take the reduction pair: max/plus interpretations on natural numbers: a#_A(x1,x2) = max{x1 + 10, x2 + 5} f_A = 0 a_A(x1,x2) = x1 + 8 g_A = 5 The next rules are strictly ordered: p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a#(f(),a(g(),a(f(),x))) -> a#(f(),a(g(),a(g(),a(f(),x)))) p2: a#(f(),a(g(),a(f(),x))) -> a#(g(),a(g(),a(f(),x))) and R consists of: r1: a(f(),a(g(),a(f(),x))) -> a(f(),a(g(),a(g(),a(f(),x)))) r2: a(g(),a(f(),a(g(),x))) -> a(g(),a(f(),a(f(),a(g(),x)))) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a#(f(),a(g(),a(f(),x))) -> a#(f(),a(g(),a(g(),a(f(),x)))) and R consists of: r1: a(f(),a(g(),a(f(),x))) -> a(f(),a(g(),a(g(),a(f(),x)))) r2: a(g(),a(f(),a(g(),x))) -> a(g(),a(f(),a(f(),a(g(),x)))) The set of usable rules consists of r1, r2 Take the reduction pair: max/plus interpretations on natural numbers: a#_A(x1,x2) = max{x1, x2 + 23} f_A = 19 a_A(x1,x2) = max{1, x1 - 5, x2 - 4} g_A = 0 The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.