YES We show the termination of the TRS R: app(app(app(compose(),f),g),x) -> app(g,app(f,x)) app(reverse(),l) -> app(app(reverse2(),l),nil()) app(app(reverse2(),nil()),l) -> l app(app(reverse2(),app(app(cons(),x),xs)),l) -> app(app(reverse2(),xs),app(app(cons(),x),l)) app(hd(),app(app(cons(),x),xs)) -> x app(tl(),app(app(cons(),x),xs)) -> xs last() -> app(app(compose(),hd()),reverse()) init() -> app(app(compose(),reverse()),app(app(compose(),tl()),reverse())) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(app(compose(),f),g),x) -> app#(g,app(f,x)) p2: app#(app(app(compose(),f),g),x) -> app#(f,x) p3: app#(reverse(),l) -> app#(app(reverse2(),l),nil()) p4: app#(reverse(),l) -> app#(reverse2(),l) p5: app#(app(reverse2(),app(app(cons(),x),xs)),l) -> app#(app(reverse2(),xs),app(app(cons(),x),l)) p6: app#(app(reverse2(),app(app(cons(),x),xs)),l) -> app#(reverse2(),xs) p7: app#(app(reverse2(),app(app(cons(),x),xs)),l) -> app#(app(cons(),x),l) p8: last#() -> app#(app(compose(),hd()),reverse()) p9: last#() -> app#(compose(),hd()) p10: init#() -> app#(app(compose(),reverse()),app(app(compose(),tl()),reverse())) p11: init#() -> app#(compose(),reverse()) p12: init#() -> app#(app(compose(),tl()),reverse()) p13: init#() -> app#(compose(),tl()) and R consists of: r1: app(app(app(compose(),f),g),x) -> app(g,app(f,x)) r2: app(reverse(),l) -> app(app(reverse2(),l),nil()) r3: app(app(reverse2(),nil()),l) -> l r4: app(app(reverse2(),app(app(cons(),x),xs)),l) -> app(app(reverse2(),xs),app(app(cons(),x),l)) r5: app(hd(),app(app(cons(),x),xs)) -> x r6: app(tl(),app(app(cons(),x),xs)) -> xs r7: last() -> app(app(compose(),hd()),reverse()) r8: init() -> app(app(compose(),reverse()),app(app(compose(),tl()),reverse())) The estimated dependency graph contains the following SCCs: {p1, p2} {p5} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(app(compose(),f),g),x) -> app#(g,app(f,x)) p2: app#(app(app(compose(),f),g),x) -> app#(f,x) and R consists of: r1: app(app(app(compose(),f),g),x) -> app(g,app(f,x)) r2: app(reverse(),l) -> app(app(reverse2(),l),nil()) r3: app(app(reverse2(),nil()),l) -> l r4: app(app(reverse2(),app(app(cons(),x),xs)),l) -> app(app(reverse2(),xs),app(app(cons(),x),l)) r5: app(hd(),app(app(cons(),x),xs)) -> x r6: app(tl(),app(app(cons(),x),xs)) -> xs r7: last() -> app(app(compose(),hd()),reverse()) r8: init() -> app(app(compose(),reverse()),app(app(compose(),tl()),reverse())) 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: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = ((1,0),(0,0)) x1 + (4,3) app_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(0,0)) x2 + (2,2) compose_A() = (1,1) reverse_A() = (5,3) reverse2_A() = (1,1) nil_A() = (1,1) cons_A() = (2,3) hd_A() = (1,0) tl_A() = (1,1) precedence: reverse2 > reverse = nil > app# = app = cons > compose = hd = tl partial status: pi(app#) = [] pi(app) = [] pi(compose) = [] pi(reverse) = [] pi(reverse2) = [] pi(nil) = [] pi(cons) = [] pi(hd) = [] pi(tl) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: app#_A(x1,x2) = (0,0) app_A(x1,x2) = (1,3) compose_A() = (2,4) reverse_A() = (2,2) reverse2_A() = (1,1) nil_A() = (0,0) cons_A() = (3,4) hd_A() = (1,0) tl_A() = (1,1) precedence: tl > cons = hd > reverse2 > compose = reverse > app# = app = nil partial status: pi(app#) = [] pi(app) = [] pi(compose) = [] pi(reverse) = [] pi(reverse2) = [] pi(nil) = [] pi(cons) = [] pi(hd) = [] pi(tl) = [] 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: app#(app(reverse2(),app(app(cons(),x),xs)),l) -> app#(app(reverse2(),xs),app(app(cons(),x),l)) and R consists of: r1: app(app(app(compose(),f),g),x) -> app(g,app(f,x)) r2: app(reverse(),l) -> app(app(reverse2(),l),nil()) r3: app(app(reverse2(),nil()),l) -> l r4: app(app(reverse2(),app(app(cons(),x),xs)),l) -> app(app(reverse2(),xs),app(app(cons(),x),l)) r5: app(hd(),app(app(cons(),x),xs)) -> x r6: app(tl(),app(app(cons(),x),xs)) -> xs r7: last() -> app(app(compose(),hd()),reverse()) r8: init() -> app(app(compose(),reverse()),app(app(compose(),tl()),reverse())) 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: app#_A(x1,x2) = max{x1 + 24, x2 + 12} app_A(x1,x2) = max{x1 + 4, x2} reverse2_A = 1 cons_A = 3 precedence: app# = app = reverse2 = cons partial status: pi(app#) = [1, 2] pi(app) = [1, 2] pi(reverse2) = [] pi(cons) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: app#_A(x1,x2) = max{x1 + 19, x2 + 10} app_A(x1,x2) = max{x1 + 3, x2 + 11} reverse2_A = 2 cons_A = 3 precedence: app# = app = reverse2 = cons partial status: pi(app#) = [] pi(app) = [1, 2] pi(reverse2) = [] pi(cons) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.