YES We show the termination of the TRS R: f(x,nil()) -> g(nil(),x) f(x,g(y,z)) -> g(f(x,y),z) ++(x,nil()) -> x ++(x,g(y,z)) -> g(++(x,y),z) null(nil()) -> true() null(g(x,y)) -> false() mem(nil(),y) -> false() mem(g(x,y),z) -> or(=(y,z),mem(x,z)) mem(x,max(x)) -> not(null(x)) max(g(g(nil(),x),y)) -> |max'|(x,y) max(g(g(g(x,y),z),u())) -> |max'|(max(g(g(x,y),z)),u()) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: f#(x,g(y,z)) -> f#(x,y) p2: ++#(x,g(y,z)) -> ++#(x,y) p3: mem#(g(x,y),z) -> mem#(x,z) p4: mem#(x,max(x)) -> null#(x) p5: max#(g(g(g(x,y),z),u())) -> max#(g(g(x,y),z)) and R consists of: r1: f(x,nil()) -> g(nil(),x) r2: f(x,g(y,z)) -> g(f(x,y),z) r3: ++(x,nil()) -> x r4: ++(x,g(y,z)) -> g(++(x,y),z) r5: null(nil()) -> true() r6: null(g(x,y)) -> false() r7: mem(nil(),y) -> false() r8: mem(g(x,y),z) -> or(=(y,z),mem(x,z)) r9: mem(x,max(x)) -> not(null(x)) r10: max(g(g(nil(),x),y)) -> |max'|(x,y) r11: max(g(g(g(x,y),z),u())) -> |max'|(max(g(g(x,y),z)),u()) The estimated dependency graph contains the following SCCs: {p1} {p2} {p3} {p5} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: f#(x,g(y,z)) -> f#(x,y) and R consists of: r1: f(x,nil()) -> g(nil(),x) r2: f(x,g(y,z)) -> g(f(x,y),z) r3: ++(x,nil()) -> x r4: ++(x,g(y,z)) -> g(++(x,y),z) r5: null(nil()) -> true() r6: null(g(x,y)) -> false() r7: mem(nil(),y) -> false() r8: mem(g(x,y),z) -> or(=(y,z),mem(x,z)) r9: mem(x,max(x)) -> not(null(x)) r10: max(g(g(nil(),x),y)) -> |max'|(x,y) r11: max(g(g(g(x,y),z),u())) -> |max'|(max(g(g(x,y),z)),u()) 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) = max{x1 + 1, x2 + 1} g_A(x1,x2) = max{x1, x2} precedence: f# = g partial status: pi(f#) = [2] pi(g) = [1, 2] 2. weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2) = x2 + 1 g_A(x1,x2) = max{x1, x2} precedence: f# = g partial status: pi(f#) = [2] pi(g) = [1, 2] 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: ++#(x,g(y,z)) -> ++#(x,y) and R consists of: r1: f(x,nil()) -> g(nil(),x) r2: f(x,g(y,z)) -> g(f(x,y),z) r3: ++(x,nil()) -> x r4: ++(x,g(y,z)) -> g(++(x,y),z) r5: null(nil()) -> true() r6: null(g(x,y)) -> false() r7: mem(nil(),y) -> false() r8: mem(g(x,y),z) -> or(=(y,z),mem(x,z)) r9: mem(x,max(x)) -> not(null(x)) r10: max(g(g(nil(),x),y)) -> |max'|(x,y) r11: max(g(g(g(x,y),z),u())) -> |max'|(max(g(g(x,y),z)),u()) 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: ++#_A(x1,x2) = max{x1 + 1, x2 + 1} g_A(x1,x2) = max{x1, x2} precedence: ++# = g partial status: pi(++#) = [2] pi(g) = [1, 2] 2. weighted path order base order: max/plus interpretations on natural numbers: ++#_A(x1,x2) = x2 + 1 g_A(x1,x2) = max{x1, x2} precedence: ++# = g partial status: pi(++#) = [2] pi(g) = [1, 2] 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: mem#(g(x,y),z) -> mem#(x,z) and R consists of: r1: f(x,nil()) -> g(nil(),x) r2: f(x,g(y,z)) -> g(f(x,y),z) r3: ++(x,nil()) -> x r4: ++(x,g(y,z)) -> g(++(x,y),z) r5: null(nil()) -> true() r6: null(g(x,y)) -> false() r7: mem(nil(),y) -> false() r8: mem(g(x,y),z) -> or(=(y,z),mem(x,z)) r9: mem(x,max(x)) -> not(null(x)) r10: max(g(g(nil(),x),y)) -> |max'|(x,y) r11: max(g(g(g(x,y),z),u())) -> |max'|(max(g(g(x,y),z)),u()) 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: mem#_A(x1,x2) = max{x1 + 1, x2} g_A(x1,x2) = max{x1, x2} precedence: mem# = g partial status: pi(mem#) = [1, 2] pi(g) = [1, 2] 2. weighted path order base order: max/plus interpretations on natural numbers: mem#_A(x1,x2) = max{x1 - 1, x2 + 1} g_A(x1,x2) = max{x1, x2} precedence: mem# = g partial status: pi(mem#) = [] pi(g) = [2] 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: max#(g(g(g(x,y),z),u())) -> max#(g(g(x,y),z)) and R consists of: r1: f(x,nil()) -> g(nil(),x) r2: f(x,g(y,z)) -> g(f(x,y),z) r3: ++(x,nil()) -> x r4: ++(x,g(y,z)) -> g(++(x,y),z) r5: null(nil()) -> true() r6: null(g(x,y)) -> false() r7: mem(nil(),y) -> false() r8: mem(g(x,y),z) -> or(=(y,z),mem(x,z)) r9: mem(x,max(x)) -> not(null(x)) r10: max(g(g(nil(),x),y)) -> |max'|(x,y) r11: max(g(g(g(x,y),z),u())) -> |max'|(max(g(g(x,y),z)),u()) 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: max#_A(x1) = max{5, x1 + 2} g_A(x1,x2) = max{x1 + 1, x2 + 1} u_A = 2 precedence: max# = g = u partial status: pi(max#) = [1] pi(g) = [1, 2] pi(u) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: max#_A(x1) = x1 + 3 g_A(x1,x2) = max{x1 - 2, x2} u_A = 0 precedence: max# = g = u partial status: pi(max#) = [] pi(g) = [2] pi(u) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.