We consider the system fuhkop11frocos. Alphabet: append : [list * list] --> list cons : [nat * list] --> list map : [nat -> nat * list] --> list mirror : [list] --> list nil : [] --> list reverse : [list] --> list shuffle : [list] --> list Rules: append(nil, x) => x append(cons(x, y), z) => cons(x, append(y, z)) reverse(nil) => nil shuffle(nil) => nil shuffle(cons(x, y)) => cons(x, shuffle(reverse(y))) mirror(nil) => nil mirror(cons(x, y)) => append(cons(x, mirror(y)), cons(x, nil)) map(f, nil) => nil map(f, cons(x, y)) => cons(f x, map(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]): append(nil, X) >? X append(cons(X, Y), Z) >? cons(X, append(Y, Z)) reverse(nil) >? nil shuffle(nil) >? nil shuffle(cons(X, Y)) >? cons(X, shuffle(reverse(Y))) mirror(nil) >? nil mirror(cons(X, Y)) >? append(cons(X, mirror(Y)), cons(X, nil)) map(F, nil) >? nil map(F, cons(X, Y)) >? cons(F X, map(F, Y)) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[nil]] = _|_ [[reverse(x_1)]] = x_1 We choose Lex = {shuffle} and Mul = {@_{o -> o}, append, cons, map, mirror}, and the following precedence: mirror > append > shuffle > map > cons > @_{o -> o} Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: append(_|_, X) >= X append(cons(X, Y), Z) >= cons(X, append(Y, Z)) _|_ >= _|_ shuffle(_|_) >= _|_ shuffle(cons(X, Y)) > cons(X, shuffle(Y)) mirror(_|_) >= _|_ mirror(cons(X, Y)) > append(cons(X, mirror(Y)), cons(X, _|_)) map(F, _|_) > _|_ map(F, cons(X, Y)) > cons(@_{o -> o}(F, X), map(F, Y)) With these choices, we have: 1] append(_|_, X) >= X because [2], by (Star) 2] append*(_|_, X) >= X because [3], by (Select) 3] X >= X by (Meta) 4] append(cons(X, Y), Z) >= cons(X, append(Y, Z)) because [5], by (Star) 5] append*(cons(X, Y), Z) >= cons(X, append(Y, Z)) because append > cons, [6] and [10], by (Copy) 6] append*(cons(X, Y), Z) >= X because [7], by (Select) 7] cons(X, Y) >= X because [8], by (Star) 8] cons*(X, Y) >= X because [9], by (Select) 9] X >= X by (Meta) 10] append*(cons(X, Y), Z) >= append(Y, Z) because append in Mul, [11] and [14], by (Stat) 11] cons(X, Y) > Y because [12], by definition 12] cons*(X, Y) >= Y because [13], by (Select) 13] Y >= Y by (Meta) 14] Z >= Z by (Meta) 15] _|_ >= _|_ by (Bot) 16] shuffle(_|_) >= _|_ by (Bot) 17] shuffle(cons(X, Y)) > cons(X, shuffle(Y)) because [18], by definition 18] shuffle*(cons(X, Y)) >= cons(X, shuffle(Y)) because shuffle > cons, [19] and [23], by (Copy) 19] shuffle*(cons(X, Y)) >= X because [20], by (Select) 20] cons(X, Y) >= X because [21], by (Star) 21] cons*(X, Y) >= X because [22], by (Select) 22] X >= X by (Meta) 23] shuffle*(cons(X, Y)) >= shuffle(Y) because [24] and [27], by (Stat) 24] cons(X, Y) > Y because [25], by definition 25] cons*(X, Y) >= Y because [26], by (Select) 26] Y >= Y by (Meta) 27] shuffle*(cons(X, Y)) >= Y because [28], by (Select) 28] cons(X, Y) >= Y because [25], by (Star) 29] mirror(_|_) >= _|_ by (Bot) 30] mirror(cons(X, Y)) > append(cons(X, mirror(Y)), cons(X, _|_)) because [31], by definition 31] mirror*(cons(X, Y)) >= append(cons(X, mirror(Y)), cons(X, _|_)) because mirror > append, [32] and [41], by (Copy) 32] mirror*(cons(X, Y)) >= cons(X, mirror(Y)) because mirror > cons, [33] and [37], by (Copy) 33] mirror*(cons(X, Y)) >= X because [34], by (Select) 34] cons(X, Y) >= X because [35], by (Star) 35] cons*(X, Y) >= X because [36], by (Select) 36] X >= X by (Meta) 37] mirror*(cons(X, Y)) >= mirror(Y) because mirror in Mul and [38], by (Stat) 38] cons(X, Y) > Y because [39], by definition 39] cons*(X, Y) >= Y because [40], by (Select) 40] Y >= Y by (Meta) 41] mirror*(cons(X, Y)) >= cons(X, _|_) because [42], by (Select) 42] cons(X, Y) >= cons(X, _|_) because cons in Mul, [43] and [44], by (Fun) 43] X >= X by (Meta) 44] Y >= _|_ by (Bot) 45] map(F, _|_) > _|_ because [46], by definition 46] map*(F, _|_) >= _|_ by (Bot) 47] map(F, cons(X, Y)) > cons(@_{o -> o}(F, X), map(F, Y)) because [48], by definition 48] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [49] and [56], by (Copy) 49] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map > @_{o -> o}, [50] and [52], by (Copy) 50] map*(F, cons(X, Y)) >= F because [51], by (Select) 51] F >= F by (Meta) 52] map*(F, cons(X, Y)) >= X because [53], by (Select) 53] cons(X, Y) >= X because [54], by (Star) 54] cons*(X, Y) >= X because [55], by (Select) 55] X >= X by (Meta) 56] map*(F, cons(X, Y)) >= map(F, Y) because map in Mul, [57] and [58], by (Stat) 57] F >= F by (Meta) 58] cons(X, Y) > Y because [59], by definition 59] cons*(X, Y) >= Y because [60], by (Select) 60] Y >= Y by (Meta) We can thus remove the following rules: shuffle(cons(X, Y)) => cons(X, shuffle(reverse(Y))) mirror(cons(X, Y)) => append(cons(X, mirror(Y)), cons(X, nil)) map(F, nil) => nil map(F, cons(X, Y)) => cons(F X, map(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]): append(nil, X) >? X append(cons(X, Y), Z) >? cons(X, append(Y, Z)) reverse(nil) >? nil shuffle(nil) >? nil mirror(nil) >? nil We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[nil]] = _|_ [[reverse(x_1)]] = x_1 We choose Lex = {} and Mul = {append, cons, mirror, shuffle}, and the following precedence: append > cons > shuffle > mirror Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: append(_|_, X) > X append(cons(X, Y), Z) >= cons(X, append(Y, Z)) _|_ >= _|_ shuffle(_|_) >= _|_ mirror(_|_) >= _|_ With these choices, we have: 1] append(_|_, X) > X because [2], by definition 2] append*(_|_, X) >= X because [3], by (Select) 3] X >= X by (Meta) 4] append(cons(X, Y), Z) >= cons(X, append(Y, Z)) because [5], by (Star) 5] append*(cons(X, Y), Z) >= cons(X, append(Y, Z)) because append > cons, [6] and [10], by (Copy) 6] append*(cons(X, Y), Z) >= X because [7], by (Select) 7] cons(X, Y) >= X because [8], by (Star) 8] cons*(X, Y) >= X because [9], by (Select) 9] X >= X by (Meta) 10] append*(cons(X, Y), Z) >= append(Y, Z) because append in Mul, [11] and [14], by (Stat) 11] cons(X, Y) > Y because [12], by definition 12] cons*(X, Y) >= Y because [13], by (Select) 13] Y >= Y by (Meta) 14] Z >= Z by (Meta) 15] _|_ >= _|_ by (Bot) 16] shuffle(_|_) >= _|_ by (Bot) 17] mirror(_|_) >= _|_ by (Bot) We can thus remove the following rules: append(nil, X) => X We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): append(cons(X, Y), Z) >? cons(X, append(Y, Z)) reverse(nil) >? nil shuffle(nil) >? nil mirror(nil) >? nil We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[nil]] = _|_ We choose Lex = {} and Mul = {append, cons, mirror, reverse, shuffle}, and the following precedence: append > shuffle > cons > reverse > mirror Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: append(cons(X, Y), Z) >= cons(X, append(Y, Z)) reverse(_|_) >= _|_ shuffle(_|_) >= _|_ mirror(_|_) > _|_ With these choices, we have: 1] append(cons(X, Y), Z) >= cons(X, append(Y, Z)) because [2], by (Star) 2] append*(cons(X, Y), Z) >= cons(X, append(Y, Z)) because append > cons, [3] and [7], by (Copy) 3] append*(cons(X, Y), Z) >= X because [4], by (Select) 4] cons(X, Y) >= X because [5], by (Star) 5] cons*(X, Y) >= X because [6], by (Select) 6] X >= X by (Meta) 7] append*(cons(X, Y), Z) >= append(Y, Z) because append in Mul, [8] and [11], by (Stat) 8] cons(X, Y) > Y because [9], by definition 9] cons*(X, Y) >= Y because [10], by (Select) 10] Y >= Y by (Meta) 11] Z >= Z by (Meta) 12] reverse(_|_) >= _|_ by (Bot) 13] shuffle(_|_) >= _|_ by (Bot) 14] mirror(_|_) > _|_ because [15], by definition 15] mirror*(_|_) >= _|_ by (Bot) We can thus remove the following rules: mirror(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]): append(cons(X, Y), Z) >? cons(X, append(Y, Z)) reverse(nil) >? nil shuffle(nil) >? nil We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[nil]] = _|_ We choose Lex = {} and Mul = {append, cons, reverse, shuffle}, and the following precedence: append > reverse > shuffle > cons Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: append(cons(X, Y), Z) > cons(X, append(Y, Z)) reverse(_|_) >= _|_ shuffle(_|_) >= _|_ With these choices, we have: 1] append(cons(X, Y), Z) > cons(X, append(Y, Z)) because [2], by definition 2] append*(cons(X, Y), Z) >= cons(X, append(Y, Z)) because append > cons, [3] and [7], by (Copy) 3] append*(cons(X, Y), Z) >= X because [4], by (Select) 4] cons(X, Y) >= X because [5], by (Star) 5] cons*(X, Y) >= X because [6], by (Select) 6] X >= X by (Meta) 7] append*(cons(X, Y), Z) >= append(Y, Z) because append in Mul, [8] and [11], by (Stat) 8] cons(X, Y) > Y because [9], by definition 9] cons*(X, Y) >= Y because [10], by (Select) 10] Y >= Y by (Meta) 11] Z >= Z by (Meta) 12] reverse(_|_) >= _|_ by (Bot) 13] shuffle(_|_) >= _|_ by (Bot) We can thus remove the following rules: append(cons(X, Y), Z) => cons(X, append(Y, Z)) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): reverse(nil) >? nil shuffle(nil) >? nil We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[nil]] = _|_ We choose Lex = {} and Mul = {reverse, shuffle}, and the following precedence: reverse > shuffle Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: reverse(_|_) > _|_ shuffle(_|_) >= _|_ With these choices, we have: 1] reverse(_|_) > _|_ because [2], by definition 2] reverse*(_|_) >= _|_ by (Bot) 3] shuffle(_|_) >= _|_ by (Bot) We can thus remove the following rules: reverse(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]): shuffle(nil) >? nil We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[nil]] = _|_ We choose Lex = {} and Mul = {shuffle}, and the following precedence: shuffle Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: shuffle(_|_) > _|_ With these choices, we have: 1] shuffle(_|_) > _|_ because [2], by definition 2] shuffle*(_|_) >= _|_ by (Bot) We can thus remove the following rules: shuffle(nil) => nil 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.