We consider the system 05height. Alphabet: cons : [t * f] --> f heightf : [f] --> N heightt : [t] --> N leaf : [] --> t max : [N * N] --> N nil : [] --> f node : [f] --> t s : [N] --> N z : [] --> N Rules: heightf(nil) => z heightf(cons(x, y)) => max(heightt(x), heightf(y)) heightt(leaf) => z heightt(node(x)) => s(heightf(x)) 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, formative): Dependency Pairs P_0: 0] heightf#(cons(X, Y)) =#> heightt#(X) 1] heightf#(cons(X, Y)) =#> heightf#(Y) 2] heightt#(node(X)) =#> heightf#(X) Rules R_0: heightf(nil) => z heightf(cons(X, Y)) => max(heightt(X), heightf(Y)) heightt(leaf) => z heightt(node(X)) => s(heightf(X)) 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 apply the subterm criterion with the following projection function: nu(heightf#) = 1 nu(heightt#) = 1 Thus, we can orient the dependency pairs as follows: nu(heightf#(cons(X, Y))) = cons(X, Y) |> X = nu(heightt#(X)) nu(heightf#(cons(X, Y))) = cons(X, Y) |> Y = nu(heightf#(Y)) nu(heightt#(node(X))) = node(X) |> X = nu(heightf#(X)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_0, 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.