We consider the system AotoYamada_05__015. Alphabet: cons : [a * c] --> c false : [] --> b filter : [a -> b * c] --> c if : [b * c * c] --> c nil : [] --> c true : [] --> b Rules: if(true, x, y) => x if(false, x, y) => y filter(f, nil) => nil filter(f, cons(x, y)) => if(f x, cons(x, filter(f, y)), filter(f, y)) This AFS is converted to an AFSM simply by replacing all free variables by meta-variables (with arity 0). We use the dependency pair framework as described in [Kop12, Ch. 6/7], with dynamic dependency pairs. After applying [Kop12, Thm. 7.22] to denote collapsing dependency pairs in an extended form, we thus obtain the following dependency pair problem (P_0, R_0, minimal, formative): Dependency Pairs P_0: 0] filter#(F, cons(X, Y)) =#> if#(F X, cons(X, filter(F, Y)), filter(F, Y)) 1] filter#(F, cons(X, Y)) =#> F(X) 2] filter#(F, cons(X, Y)) =#> filter#(F, Y) 3] filter#(F, cons(X, Y)) =#> filter#(F, Y) Rules R_0: if(true, X, Y) => X if(false, X, Y) => Y filter(F, nil) => nil filter(F, cons(X, Y)) => if(F X, cons(X, filter(F, Y)), filter(F, Y)) Thus, the original system is terminating if (P_0, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_0, R_0, minimal, formative). We place the elements of P in a dependency graph approximation G (see e.g. [Kop12, Thm. 7.27, 7.29], as follows: * 0 : * 1 : 0, 1, 2, 3 * 2 : 0, 1, 2, 3 * 3 : 0, 1, 2, 3 This graph has the following strongly connected components: P_1: filter#(F, cons(X, Y)) =#> F(X) filter#(F, cons(X, Y)) =#> filter#(F, Y) filter#(F, cons(X, Y)) =#> filter#(F, Y) By [Kop12, Thm. 7.31], we may replace any dependency pair problem (P_0, R_0, m, f) by (P_1, R_0, m, f). Thus, the original system is terminating if (P_1, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_1, R_0, minimal, formative). The formative rules of (P_1, R_0) are R_1 ::= if(true, X, Y) => X if(false, X, Y) => Y filter(F, cons(X, Y)) => if(F X, cons(X, filter(F, Y)), filter(F, Y)) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_1, R_0, minimal, formative) by (P_1, R_1, minimal, formative). Thus, the original system is terminating if (P_1, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_1, R_1, minimal, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. As the system is abstraction-simple and the formative flag is set, it suffices to find a tagged reduction pair [Kop12, Def. 6.70]. Thus, we must orient: filter#(F, cons(X, Y)) >? F(X) filter#(F, cons(X, Y)) >? filter#(F, Y) filter#(F, cons(X, Y)) >? filter#(F, Y) if(true, X, Y) >= X if(false, X, Y) >= Y filter(F, cons(X, Y)) >= if(F X, cons(X, filter(F, Y)), filter(F, Y)) Since this representation is not advantageous for the higher-order recursive path ordering, we present the strict requirements in their unextended form, which is not problematic since for any F, s and substituion gamma: (F s)gamma beta-reduces to F(s)gamma.) We use a recursive path ordering as defined in [Kop12, Chapter 5]. We choose Lex = {} and Mul = {@_{o -> o}, cons, false, filter, filter#, if, true}, and the following precedence: false > filter# > filter > @_{o -> o} > cons > if > true With these choices, we have: 1] filter#(F, cons(X, Y)) > @_{o -> o}(F, X) because [2], by definition 2] filter#*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter# > @_{o -> o}, [3] and [5], by (Copy) 3] filter#*(F, cons(X, Y)) >= F because [4], by (Select) 4] F >= F by (Meta) 5] filter#*(F, cons(X, Y)) >= X because [6], by (Select) 6] cons(X, Y) >= X because [7], by (Star) 7] cons*(X, Y) >= X because [8], by (Select) 8] X >= X by (Meta) 9] filter#(F, cons(X, Y)) >= filter#(F, Y) because filter# in Mul, [10] and [11], by (Fun) 10] F >= F by (Meta) 11] cons(X, Y) >= Y because [12], by (Star) 12] cons*(X, Y) >= Y because [13], by (Select) 13] Y >= Y by (Meta) 14] filter#(F, cons(X, Y)) >= filter#(F, Y) because filter# in Mul, [10] and [11], by (Fun) 15] if(true, X, Y) >= X because [16], by (Star) 16] if*(true, X, Y) >= X because [17], by (Select) 17] X >= X by (Meta) 18] if(false, X, Y) >= Y because [19], by (Star) 19] if*(false, X, Y) >= Y because [20], by (Select) 20] Y >= Y by (Meta) 21] filter(F, cons(X, Y)) >= if(@_{o -> o}(F, X), cons(X, filter(F, Y)), filter(F, Y)) because [22], by (Star) 22] filter*(F, cons(X, Y)) >= if(@_{o -> o}(F, X), cons(X, filter(F, Y)), filter(F, Y)) because filter > if, [23], [26] and [27], by (Copy) 23] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [24] and [25], by (Copy) 24] filter*(F, cons(X, Y)) >= F because [10], by (Select) 25] filter*(F, cons(X, Y)) >= X because [6], by (Select) 26] filter*(F, cons(X, Y)) >= cons(X, filter(F, Y)) because filter > cons, [25] and [27], by (Copy) 27] filter*(F, cons(X, Y)) >= filter(F, Y) because filter in Mul, [10] and [28], by (Stat) 28] cons(X, Y) > Y because [29], by definition 29] cons*(X, Y) >= Y because [13], by (Select) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_1, R_1, minimal, formative) by (P_2, R_1, minimal, formative), where P_2 consists of: filter#(F, cons(X, Y)) =#> filter#(F, Y) filter#(F, cons(X, Y)) =#> filter#(F, Y) Thus, the original system is terminating if (P_2, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_2, R_1, minimal, formative). We apply the subterm criterion with the following projection function: nu(filter#) = 2 Thus, we can orient the dependency pairs as follows: nu(filter#(F, cons(X, Y))) = cons(X, Y) |> Y = nu(filter#(F, Y)) nu(filter#(F, cons(X, Y))) = cons(X, Y) |> Y = nu(filter#(F, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_2, R_1, minimal, f) by ({}, R_1, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. As all dependency pair problems were succesfully simplified with sound (and complete) processors until nothing remained, we conclude termination. +++ Citations +++ [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012.