We consider the system Applicative_05__BTreeMember. Alphabet: 0 : [] --> a eq : [a * a] --> c false : [] --> c fork : [b * a * b] --> b if : [c * c * c] --> c lt : [a * a] --> c member : [a * b] --> c null : [] --> b s : [a] --> a true : [] --> c Rules: lt(s(x), s(y)) => lt(x, y) lt(0, s(x)) => true lt(x, 0) => false eq(x, x) => true eq(s(x), 0) => false eq(0, s(x)) => false member(x, null) => false member(x, fork(y, z, u)) => if(lt(x, z), member(x, y), if(eq(x, z), true, member(x, u))) 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. We thus obtain the following dependency pair problem (P_0, R_0, minimal, all): Dependency Pairs P_0: 0] lt#(s(X), s(Y)) =#> lt#(X, Y) 1] member#(X, fork(Y, Z, U)) =#> lt#(X, Z) 2] member#(X, fork(Y, Z, U)) =#> member#(X, Y) 3] member#(X, fork(Y, Z, U)) =#> eq#(X, Z) 4] member#(X, fork(Y, Z, U)) =#> member#(X, U) Rules R_0: lt(s(X), s(Y)) => lt(X, Y) lt(0, s(X)) => true lt(X, 0) => false eq(X, X) => true eq(s(X), 0) => false eq(0, s(X)) => false member(X, null) => false member(X, fork(Y, Z, U)) => if(lt(X, Z), member(X, Y), if(eq(X, Z), true, member(X, U))) Thus, the original system is terminating if (P_0, R_0, minimal, all) is finite. We consider the dependency pair problem (P_0, R_0, minimal, all). We place the elements of P in a dependency graph approximation G (see e.g. [Kop12, Thm. 7.27, 7.29], as follows: * 0 : 0 * 1 : 0 * 2 : 1, 2, 3, 4 * 3 : * 4 : 1, 2, 3, 4 This graph has the following strongly connected components: P_1: lt#(s(X), s(Y)) =#> lt#(X, Y) P_2: member#(X, fork(Y, Z, U)) =#> member#(X, Y) member#(X, fork(Y, Z, U)) =#> member#(X, U) 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) and (P_2, R_0, m, f). Thus, the original system is terminating if each of (P_1, R_0, minimal, all) and (P_2, R_0, minimal, all) is finite. We consider the dependency pair problem (P_2, R_0, minimal, all). We apply the subterm criterion with the following projection function: nu(member#) = 2 Thus, we can orient the dependency pairs as follows: nu(member#(X, fork(Y, Z, U))) = fork(Y, Z, U) |> Y = nu(member#(X, Y)) nu(member#(X, fork(Y, Z, U))) = fork(Y, Z, U) |> U = nu(member#(X, U)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_2, R_0, minimal, f) by ({}, R_0, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if (P_1, R_0, minimal, all) is finite. We consider the dependency pair problem (P_1, R_0, minimal, all). We apply the subterm criterion with the following projection function: nu(lt#) = 1 Thus, we can orient the dependency pairs as follows: nu(lt#(s(X), s(Y))) = s(X) |> X = nu(lt#(X, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_1, R_0, minimal, f) by ({}, R_0, 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.