We consider the system AotoYamada_05__016. Alphabet: 0 : [] --> a cons : [a * c] --> c false : [] --> b filter : [a -> b] --> c -> c filtersub : [b * a -> b * c] --> c neq : [a] --> a -> b nil : [] --> c nonzero : [] --> c -> c s : [a] --> a true : [] --> b Rules: neq(0) 0 => false neq(0) s(x) => true neq(s(x)) 0 => true neq(s(x)) s(y) => neq(x) y filter(f) nil => nil filter(f) cons(x, y) => filtersub(f x, f, cons(x, y)) filtersub(true, f, cons(x, y)) => cons(x, filter(f) y) filtersub(false, f, cons(x, y)) => filter(f) y nonzero => filter(neq(0)) 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 static dependency pairs (see [KusIsoSakBla09] and the adaptation for AFSMs and accessible arguments in [Kop13]). In order to do so, we start by eta-expanding the system, which gives: neq(0, 0) => false neq(0, s(X)) => true neq(s(X), 0) => true neq(s(X), s(Y)) => neq(X, Y) filter(F, nil) => nil filter(F, cons(X, Y)) => filtersub(F X, F, cons(X, Y)) filtersub(true, F, cons(X, Y)) => cons(X, filter(F, Y)) filtersub(false, F, cons(X, Y)) => filter(F, Y) nonzero(X) => filter(/\x.neq(0, x), X) We thus obtain the following dependency pair problem (P_0, R_0, static, formative): Dependency Pairs P_0: 0] neq#(s(X), s(Y)) =#> neq#(X, Y) 1] filter#(F, cons(X, Y)) =#> filtersub#(F X, F, cons(X, Y)) 2] filtersub#(true, F, cons(X, Y)) =#> filter#(F, Y) 3] filtersub#(false, F, cons(X, Y)) =#> filter#(F, Y) 4] nonzero#(X) =#> filter#(/\x.neq(0, x), X) 5] nonzero#(X) =#> neq#(0, Y) Rules R_0: neq(0, 0) => false neq(0, s(X)) => true neq(s(X), 0) => true neq(s(X), s(Y)) => neq(X, Y) filter(F, nil) => nil filter(F, cons(X, Y)) => filtersub(F X, F, cons(X, Y)) filtersub(true, F, cons(X, Y)) => cons(X, filter(F, Y)) filtersub(false, F, cons(X, Y)) => filter(F, Y) nonzero(X) => filter(/\x.neq(0, x), X) Thus, the original system is terminating if (P_0, R_0, static, formative) is finite. We consider the dependency pair problem (P_0, R_0, static, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: neq#(s(X), s(Y)) >? neq#(X, Y) filter#(F, cons(X, Y)) >? filtersub#(F X, F, cons(X, Y)) filtersub#(true, F, cons(X, Y)) >? filter#(F, Y) filtersub#(false, F, cons(X, Y)) >? filter#(F, Y) nonzero#(X) >? filter#(/\x.neq(0, x), X) nonzero#(X) >? neq#(0, Y) neq(0, 0) >= false neq(0, s(X)) >= true neq(s(X), 0) >= true neq(s(X), s(Y)) >= neq(X, Y) filter(F, nil) >= nil filter(F, cons(X, Y)) >= filtersub(F X, F, cons(X, Y)) filtersub(true, F, cons(X, Y)) >= cons(X, filter(F, Y)) filtersub(false, F, cons(X, Y)) >= filter(F, Y) nonzero(X) >= filter(/\x.neq(0, x), X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( nonzero(X) ) = #argfun-nonzero#(filter(/\x.neq(0, x), X)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: #argfun-nonzero# = \y0.3 + y0 0 = 0 cons = \y0y1.2y1 false = 0 filter = \G0y1.0 filter# = \G0y1.0 filtersub = \y0G1y2.0 filtersub# = \y0G1y2.0 neq = \y0y1.2 neq# = \y0y1.0 nil = 0 nonzero = \y0.0 nonzero# = \y0.3 + 2y0 s = \y0.3 true = 0 Using this interpretation, the requirements translate to: [[neq#(s(_x0), s(_x1))]] = 0 >= 0 = [[neq#(_x0, _x1)]] [[filter#(_F0, cons(_x1, _x2))]] = 0 >= 0 = [[filtersub#(_F0 _x1, _F0, cons(_x1, _x2))]] [[filtersub#(true, _F0, cons(_x1, _x2))]] = 0 >= 0 = [[filter#(_F0, _x2)]] [[filtersub#(false, _F0, cons(_x1, _x2))]] = 0 >= 0 = [[filter#(_F0, _x2)]] [[nonzero#(_x0)]] = 3 + 2x0 > 0 = [[filter#(/\x.neq(0, x), _x0)]] [[nonzero#(_x0)]] = 3 + 2x0 > 0 = [[neq#(0, _x1)]] [[neq(0, 0)]] = 2 >= 0 = [[false]] [[neq(0, s(_x0))]] = 2 >= 0 = [[true]] [[neq(s(_x0), 0)]] = 2 >= 0 = [[true]] [[neq(s(_x0), s(_x1))]] = 2 >= 2 = [[neq(_x0, _x1)]] [[filter(_F0, nil)]] = 0 >= 0 = [[nil]] [[filter(_F0, cons(_x1, _x2))]] = 0 >= 0 = [[filtersub(_F0 _x1, _F0, cons(_x1, _x2))]] [[filtersub(true, _F0, cons(_x1, _x2))]] = 0 >= 0 = [[cons(_x1, filter(_F0, _x2))]] [[filtersub(false, _F0, cons(_x1, _x2))]] = 0 >= 0 = [[filter(_F0, _x2)]] [[#argfun-nonzero#(filter(/\x.neq(0, x), _x0))]] = 3 >= 0 = [[filter(/\x.neq(0, x), _x0)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_0, R_0, static, formative) by (P_1, R_0, static, formative), where P_1 consists of: neq#(s(X), s(Y)) =#> neq#(X, Y) filter#(F, cons(X, Y)) =#> filtersub#(F X, F, cons(X, Y)) filtersub#(true, F, cons(X, Y)) =#> filter#(F, Y) filtersub#(false, F, cons(X, Y)) =#> filter#(F, Y) Thus, the original system is terminating if (P_1, R_0, static, formative) is finite. We consider the dependency pair problem (P_1, R_0, static, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: neq#(s(X), s(Y)) >? neq#(X, Y) filter#(F, cons(X, Y)) >? filtersub#(F X, F, cons(X, Y)) filtersub#(true, F, cons(X, Y)) >? filter#(F, Y) filtersub#(false, F, cons(X, Y)) >? filter#(F, Y) neq(0, 0) >= false neq(0, s(X)) >= true neq(s(X), 0) >= true neq(s(X), s(Y)) >= neq(X, Y) filter(F, nil) >= nil filter(F, cons(X, Y)) >= filtersub(F X, F, cons(X, Y)) filtersub(true, F, cons(X, Y)) >= cons(X, filter(F, Y)) filtersub(false, F, cons(X, Y)) >= filter(F, Y) nonzero(X) >= filter(/\x.neq(0, x), X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( nonzero(X) ) = #argfun-nonzero#(filter(/\x.neq(0, x), X)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: #argfun-nonzero# = \y0.3 + y0 0 = 3 cons = \y0y1.0 false = 0 filter = \G0y1.0 filter# = \G0y1.0 filtersub = \y0G1y2.0 filtersub# = \y0G1y2.0 neq = \y0y1.3 neq# = \y0y1.y1 nil = 0 nonzero = \y0.0 s = \y0.3 + y0 true = 0 Using this interpretation, the requirements translate to: [[neq#(s(_x0), s(_x1))]] = 3 + x1 > x1 = [[neq#(_x0, _x1)]] [[filter#(_F0, cons(_x1, _x2))]] = 0 >= 0 = [[filtersub#(_F0 _x1, _F0, cons(_x1, _x2))]] [[filtersub#(true, _F0, cons(_x1, _x2))]] = 0 >= 0 = [[filter#(_F0, _x2)]] [[filtersub#(false, _F0, cons(_x1, _x2))]] = 0 >= 0 = [[filter#(_F0, _x2)]] [[neq(0, 0)]] = 3 >= 0 = [[false]] [[neq(0, s(_x0))]] = 3 >= 0 = [[true]] [[neq(s(_x0), 0)]] = 3 >= 0 = [[true]] [[neq(s(_x0), s(_x1))]] = 3 >= 3 = [[neq(_x0, _x1)]] [[filter(_F0, nil)]] = 0 >= 0 = [[nil]] [[filter(_F0, cons(_x1, _x2))]] = 0 >= 0 = [[filtersub(_F0 _x1, _F0, cons(_x1, _x2))]] [[filtersub(true, _F0, cons(_x1, _x2))]] = 0 >= 0 = [[cons(_x1, filter(_F0, _x2))]] [[filtersub(false, _F0, cons(_x1, _x2))]] = 0 >= 0 = [[filter(_F0, _x2)]] [[#argfun-nonzero#(filter(/\x.neq(0, x), _x0))]] = 3 >= 0 = [[filter(/\x.neq(0, x), _x0)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_1, R_0, static, formative) by (P_2, R_0, static, formative), where P_2 consists of: filter#(F, cons(X, Y)) =#> filtersub#(F X, F, cons(X, Y)) filtersub#(true, F, cons(X, Y)) =#> filter#(F, Y) filtersub#(false, F, cons(X, Y)) =#> filter#(F, Y) Thus, the original system is terminating if (P_2, R_0, static, formative) is finite. We consider the dependency pair problem (P_2, R_0, static, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: filter#(F, cons(X, Y)) >? filtersub#(F X, F, cons(X, Y)) filtersub#(true, F, cons(X, Y)) >? filter#(F, Y) filtersub#(false, F, cons(X, Y)) >? filter#(F, Y) neq(0, 0) >= false neq(0, s(X)) >= true neq(s(X), 0) >= true neq(s(X), s(Y)) >= neq(X, Y) filter(F, nil) >= nil filter(F, cons(X, Y)) >= filtersub(F X, F, cons(X, Y)) filtersub(true, F, cons(X, Y)) >= cons(X, filter(F, Y)) filtersub(false, F, cons(X, Y)) >= filter(F, Y) nonzero(X) >= filter(/\x.neq(0, x), X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( nonzero(X) ) = #argfun-nonzero#(filter(/\x.neq(0, x), X)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: #argfun-nonzero# = \y0.3 + y0 0 = 3 cons = \y0y1.1 + y1 false = 0 filter = \G0y1.y1 filter# = \G0y1.y1 filtersub = \y0G1y2.y2 filtersub# = \y0G1y2.y2 neq = \y0y1.3 nil = 0 nonzero = \y0.0 s = \y0.3 true = 0 Using this interpretation, the requirements translate to: [[filter#(_F0, cons(_x1, _x2))]] = 1 + x2 >= 1 + x2 = [[filtersub#(_F0 _x1, _F0, cons(_x1, _x2))]] [[filtersub#(true, _F0, cons(_x1, _x2))]] = 1 + x2 > x2 = [[filter#(_F0, _x2)]] [[filtersub#(false, _F0, cons(_x1, _x2))]] = 1 + x2 > x2 = [[filter#(_F0, _x2)]] [[neq(0, 0)]] = 3 >= 0 = [[false]] [[neq(0, s(_x0))]] = 3 >= 0 = [[true]] [[neq(s(_x0), 0)]] = 3 >= 0 = [[true]] [[neq(s(_x0), s(_x1))]] = 3 >= 3 = [[neq(_x0, _x1)]] [[filter(_F0, nil)]] = 0 >= 0 = [[nil]] [[filter(_F0, cons(_x1, _x2))]] = 1 + x2 >= 1 + x2 = [[filtersub(_F0 _x1, _F0, cons(_x1, _x2))]] [[filtersub(true, _F0, cons(_x1, _x2))]] = 1 + x2 >= 1 + x2 = [[cons(_x1, filter(_F0, _x2))]] [[filtersub(false, _F0, cons(_x1, _x2))]] = 1 + x2 >= x2 = [[filter(_F0, _x2)]] [[#argfun-nonzero#(filter(/\x.neq(0, x), _x0))]] = 3 + x0 >= x0 = [[filter(/\x.neq(0, x), _x0)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_2, R_0, static, formative) by (P_3, R_0, static, formative), where P_3 consists of: filter#(F, cons(X, Y)) =#> filtersub#(F X, F, cons(X, Y)) Thus, the original system is terminating if (P_3, R_0, static, formative) is finite. We consider the dependency pair problem (P_3, R_0, static, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: filter#(F, cons(X, Y)) >? filtersub#(F X, F, cons(X, Y)) neq(0, 0) >= false neq(0, s(X)) >= true neq(s(X), 0) >= true neq(s(X), s(Y)) >= neq(X, Y) filter(F, nil) >= nil filter(F, cons(X, Y)) >= filtersub(F X, F, cons(X, Y)) filtersub(true, F, cons(X, Y)) >= cons(X, filter(F, Y)) filtersub(false, F, cons(X, Y)) >= filter(F, Y) nonzero(X) >= filter(/\x.neq(0, x), X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( nonzero(X) ) = #argfun-nonzero#(filter(/\x.neq(0, x), X)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: #argfun-nonzero# = \y0.3 + y0 0 = 3 cons = \y0y1.1 + y1 false = 0 filter = \G0y1.2 + 2y1 filter# = \G0y1.3 filtersub = \y0G1y2.1 + 2y2 filtersub# = \y0G1y2.0 neq = \y0y1.3 nil = 0 nonzero = \y0.0 s = \y0.3 true = 0 Using this interpretation, the requirements translate to: [[filter#(_F0, cons(_x1, _x2))]] = 3 > 0 = [[filtersub#(_F0 _x1, _F0, cons(_x1, _x2))]] [[neq(0, 0)]] = 3 >= 0 = [[false]] [[neq(0, s(_x0))]] = 3 >= 0 = [[true]] [[neq(s(_x0), 0)]] = 3 >= 0 = [[true]] [[neq(s(_x0), s(_x1))]] = 3 >= 3 = [[neq(_x0, _x1)]] [[filter(_F0, nil)]] = 2 >= 0 = [[nil]] [[filter(_F0, cons(_x1, _x2))]] = 4 + 2x2 >= 3 + 2x2 = [[filtersub(_F0 _x1, _F0, cons(_x1, _x2))]] [[filtersub(true, _F0, cons(_x1, _x2))]] = 3 + 2x2 >= 3 + 2x2 = [[cons(_x1, filter(_F0, _x2))]] [[filtersub(false, _F0, cons(_x1, _x2))]] = 3 + 2x2 >= 2 + 2x2 = [[filter(_F0, _x2)]] [[#argfun-nonzero#(filter(/\x.neq(0, x), _x0))]] = 5 + 2x0 >= 2 + 2x0 = [[filter(/\x.neq(0, x), _x0)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_3, R_0) by ({}, R_0). 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. [Kop13] C. Kop. Static Dependency Pairs with Accessibility. Unpublished manuscript, http://cl-informatik.uibk.ac.at/users/kop/static.pdf, 2013. [KusIsoSakBla09] K. Kusakari, Y. Isogai, M. Sakai, and F. Blanqui. Static Dependency Pair Method Based On Strong Computability for Higher-Order Rewrite Systems. In volume 92(10) of IEICE Transactions on Information and Systems. 2007--2015, 2009.