We consider the system AotoYamada_05__028. Alphabet: cons : [a * c] --> c consif : [b * a * c] --> c false : [] --> b filter : [a -> b * c] --> c nil : [] --> c true : [] --> b Rules: consif(true, x, y) => cons(x, y) consif(false, x, y) => y filter(f, nil) => nil filter(f, cons(x, y)) => consif(f x, x, filter(f, y)) This AFS is converted to an AFSM simply by replacing all free variables by meta-variables (with arity 0). We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): consif(true, X, Y) >? cons(X, Y) consif(false, X, Y) >? Y filter(F, nil) >? nil filter(F, cons(X, Y)) >? consif(F X, X, filter(F, Y)) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[nil]] = _|_ We choose Lex = {} and Mul = {@_{o -> o}, cons, consif, false, filter, true}, and the following precedence: false > filter > consif > cons > true > @_{o -> o} Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: consif(true, X, Y) >= cons(X, Y) consif(false, X, Y) > Y filter(F, _|_) >= _|_ filter(F, cons(X, Y)) >= consif(@_{o -> o}(F, X), X, filter(F, Y)) With these choices, we have: 1] consif(true, X, Y) >= cons(X, Y) because [2], by (Star) 2] consif*(true, X, Y) >= cons(X, Y) because consif > cons, [3] and [5], by (Copy) 3] consif*(true, X, Y) >= X because [4], by (Select) 4] X >= X by (Meta) 5] consif*(true, X, Y) >= Y because [6], by (Select) 6] Y >= Y by (Meta) 7] consif(false, X, Y) > Y because [8], by definition 8] consif*(false, X, Y) >= Y because [9], by (Select) 9] Y >= Y by (Meta) 10] filter(F, _|_) >= _|_ by (Bot) 11] filter(F, cons(X, Y)) >= consif(@_{o -> o}(F, X), X, filter(F, Y)) because [12], by (Star) 12] filter*(F, cons(X, Y)) >= consif(@_{o -> o}(F, X), X, filter(F, Y)) because filter > consif, [13], [16] and [20], by (Copy) 13] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [14] and [16], by (Copy) 14] filter*(F, cons(X, Y)) >= F because [15], by (Select) 15] F >= F by (Meta) 16] filter*(F, cons(X, Y)) >= X because [17], by (Select) 17] cons(X, Y) >= X because [18], by (Star) 18] cons*(X, Y) >= X because [19], by (Select) 19] X >= X by (Meta) 20] filter*(F, cons(X, Y)) >= filter(F, Y) because filter in Mul, [21] and [22], by (Stat) 21] F >= F by (Meta) 22] cons(X, Y) > Y because [23], by definition 23] cons*(X, Y) >= Y because [24], by (Select) 24] Y >= Y by (Meta) We can thus remove the following rules: consif(false, X, Y) => Y We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): consif(true, X, Y) >? cons(X, Y) filter(F, nil) >? nil filter(F, cons(X, Y)) >? consif(F X, X, filter(F, Y)) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[nil]] = _|_ We choose Lex = {} and Mul = {@_{o -> o}, cons, consif, filter, true}, and the following precedence: true > @_{o -> o} = filter > consif > cons Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: consif(true, X, Y) >= cons(X, Y) filter(F, _|_) > _|_ filter(F, cons(X, Y)) >= consif(@_{o -> o}(F, X), X, filter(F, Y)) With these choices, we have: 1] consif(true, X, Y) >= cons(X, Y) because [2], by (Star) 2] consif*(true, X, Y) >= cons(X, Y) because consif > cons, [3] and [5], by (Copy) 3] consif*(true, X, Y) >= X because [4], by (Select) 4] X >= X by (Meta) 5] consif*(true, X, Y) >= Y because [6], by (Select) 6] Y >= Y by (Meta) 7] filter(F, _|_) > _|_ because [8], by definition 8] filter*(F, _|_) >= _|_ by (Bot) 9] filter(F, cons(X, Y)) >= consif(@_{o -> o}(F, X), X, filter(F, Y)) because [10], by (Star) 10] filter*(F, cons(X, Y)) >= consif(@_{o -> o}(F, X), X, filter(F, Y)) because filter > consif, [11], [16] and [18], by (Copy) 11] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter = @_{o -> o}, filter in Mul, [12] and [13], by (Stat) 12] F >= F by (Meta) 13] cons(X, Y) > X because [14], by definition 14] cons*(X, Y) >= X because [15], by (Select) 15] X >= X by (Meta) 16] filter*(F, cons(X, Y)) >= X because [17], by (Select) 17] cons(X, Y) >= X because [14], by (Star) 18] filter*(F, cons(X, Y)) >= filter(F, Y) because filter in Mul, [12] and [19], by (Stat) 19] cons(X, Y) > Y because [20], by definition 20] cons*(X, Y) >= Y because [21], by (Select) 21] Y >= Y by (Meta) We can thus remove the following rules: filter(F, nil) => nil We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): consif(true, X, Y) >? cons(X, Y) filter(F, cons(X, Y)) >? consif(F X, X, filter(F, Y)) We use a recursive path ordering as defined in [Kop12, Chapter 5]. We choose Lex = {} and Mul = {@_{o -> o}, cons, consif, filter, true}, and the following precedence: filter > consif > cons > true > @_{o -> o} With these choices, we have: 1] consif(true, X, Y) >= cons(X, Y) because [2], by (Star) 2] consif*(true, X, Y) >= cons(X, Y) because consif > cons, [3] and [5], by (Copy) 3] consif*(true, X, Y) >= X because [4], by (Select) 4] X >= X by (Meta) 5] consif*(true, X, Y) >= Y because [6], by (Select) 6] Y >= Y by (Meta) 7] filter(F, cons(X, Y)) > consif(@_{o -> o}(F, X), X, filter(F, Y)) because [8], by definition 8] filter*(F, cons(X, Y)) >= consif(@_{o -> o}(F, X), X, filter(F, Y)) because filter > consif, [9], [12] and [16], by (Copy) 9] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [10] and [12], by (Copy) 10] filter*(F, cons(X, Y)) >= F because [11], by (Select) 11] F >= F by (Meta) 12] filter*(F, cons(X, Y)) >= X because [13], by (Select) 13] cons(X, Y) >= X because [14], by (Star) 14] cons*(X, Y) >= X because [15], by (Select) 15] X >= X by (Meta) 16] filter*(F, cons(X, Y)) >= filter(F, Y) because filter in Mul, [17] and [18], by (Stat) 17] F >= F by (Meta) 18] cons(X, Y) > Y because [19], by definition 19] cons*(X, Y) >= Y because [20], by (Select) 20] Y >= Y by (Meta) We can thus remove the following rules: filter(F, cons(X, Y)) => consif(F X, X, filter(F, Y)) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): consif(true, X, Y) >? cons(X, Y) We use a recursive path ordering as defined in [Kop12, Chapter 5]. We choose Lex = {} and Mul = {cons, consif, true}, and the following precedence: consif > cons > true With these choices, we have: 1] consif(true, X, Y) > cons(X, Y) because [2], by definition 2] consif*(true, X, Y) >= cons(X, Y) because consif > cons, [3] and [5], by (Copy) 3] consif*(true, X, Y) >= X because [4], by (Select) 4] X >= X by (Meta) 5] consif*(true, X, Y) >= Y because [6], by (Select) 6] Y >= Y by (Meta) We can thus remove the following rules: consif(true, X, Y) => cons(X, Y) All rules were succesfully removed. Thus, termination of the original system has been reduced to termination of the beta-rule, which is well-known to hold. +++ Citations +++ [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012.