YES We show the termination of the TRS R: app(app(filter(),f),nil()) -> nil() app(app(filter(),f),app(app(cons(),y),ys)) -> app(app(app(filtersub(),app(f,y)),f),app(app(cons(),y),ys)) app(app(app(filtersub(),true()),f),app(app(cons(),y),ys)) -> app(app(cons(),y),app(app(filter(),f),ys)) app(app(app(filtersub(),false()),f),app(app(cons(),y),ys)) -> app(app(filter(),f),ys) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(filter(),f),app(app(cons(),y),ys)) -> app#(app(app(filtersub(),app(f,y)),f),app(app(cons(),y),ys)) p2: app#(app(filter(),f),app(app(cons(),y),ys)) -> app#(app(filtersub(),app(f,y)),f) p3: app#(app(filter(),f),app(app(cons(),y),ys)) -> app#(filtersub(),app(f,y)) p4: app#(app(filter(),f),app(app(cons(),y),ys)) -> app#(f,y) p5: app#(app(app(filtersub(),true()),f),app(app(cons(),y),ys)) -> app#(app(cons(),y),app(app(filter(),f),ys)) p6: app#(app(app(filtersub(),true()),f),app(app(cons(),y),ys)) -> app#(app(filter(),f),ys) p7: app#(app(app(filtersub(),true()),f),app(app(cons(),y),ys)) -> app#(filter(),f) p8: app#(app(app(filtersub(),false()),f),app(app(cons(),y),ys)) -> app#(app(filter(),f),ys) p9: app#(app(app(filtersub(),false()),f),app(app(cons(),y),ys)) -> app#(filter(),f) and R consists of: r1: app(app(filter(),f),nil()) -> nil() r2: app(app(filter(),f),app(app(cons(),y),ys)) -> app(app(app(filtersub(),app(f,y)),f),app(app(cons(),y),ys)) r3: app(app(app(filtersub(),true()),f),app(app(cons(),y),ys)) -> app(app(cons(),y),app(app(filter(),f),ys)) r4: app(app(app(filtersub(),false()),f),app(app(cons(),y),ys)) -> app(app(filter(),f),ys) The estimated dependency graph contains the following SCCs: {p1, p4, p6, p8} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(filter(),f),app(app(cons(),y),ys)) -> app#(app(app(filtersub(),app(f,y)),f),app(app(cons(),y),ys)) p2: app#(app(app(filtersub(),false()),f),app(app(cons(),y),ys)) -> app#(app(filter(),f),ys) p3: app#(app(filter(),f),app(app(cons(),y),ys)) -> app#(f,y) p4: app#(app(app(filtersub(),true()),f),app(app(cons(),y),ys)) -> app#(app(filter(),f),ys) and R consists of: r1: app(app(filter(),f),nil()) -> nil() r2: app(app(filter(),f),app(app(cons(),y),ys)) -> app(app(app(filtersub(),app(f,y)),f),app(app(cons(),y),ys)) r3: app(app(app(filtersub(),true()),f),app(app(cons(),y),ys)) -> app(app(cons(),y),app(app(filter(),f),ys)) r4: app(app(app(filtersub(),false()),f),app(app(cons(),y),ys)) -> app(app(filter(),f),ys) The set of usable rules consists of r1, r2, r3, r4 Take the reduction pair: lexicographic combination of reduction pairs: 1. lexicographic path order with precedence: precedence: filtersub > filter > true > false > app > cons > app# > nil argument filter: pi(app#) = 1 pi(app) = 2 pi(filter) = [] pi(cons) = [] pi(filtersub) = [] pi(false) = [] pi(true) = [] pi(nil) = [] 2. lexicographic path order with precedence: precedence: nil > app# > filter > app > cons > true > false > filtersub argument filter: pi(app#) = [1] pi(app) = [2] pi(filter) = [] pi(cons) = [] pi(filtersub) = [] pi(false) = [] pi(true) = [] pi(nil) = [] The next rules are strictly ordered: p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(filter(),f),app(app(cons(),y),ys)) -> app#(app(app(filtersub(),app(f,y)),f),app(app(cons(),y),ys)) p2: app#(app(app(filtersub(),false()),f),app(app(cons(),y),ys)) -> app#(app(filter(),f),ys) p3: app#(app(app(filtersub(),true()),f),app(app(cons(),y),ys)) -> app#(app(filter(),f),ys) and R consists of: r1: app(app(filter(),f),nil()) -> nil() r2: app(app(filter(),f),app(app(cons(),y),ys)) -> app(app(app(filtersub(),app(f,y)),f),app(app(cons(),y),ys)) r3: app(app(app(filtersub(),true()),f),app(app(cons(),y),ys)) -> app(app(cons(),y),app(app(filter(),f),ys)) r4: app(app(app(filtersub(),false()),f),app(app(cons(),y),ys)) -> app(app(filter(),f),ys) The estimated dependency graph contains the following SCCs: {p1, p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(filter(),f),app(app(cons(),y),ys)) -> app#(app(app(filtersub(),app(f,y)),f),app(app(cons(),y),ys)) p2: app#(app(app(filtersub(),true()),f),app(app(cons(),y),ys)) -> app#(app(filter(),f),ys) p3: app#(app(app(filtersub(),false()),f),app(app(cons(),y),ys)) -> app#(app(filter(),f),ys) and R consists of: r1: app(app(filter(),f),nil()) -> nil() r2: app(app(filter(),f),app(app(cons(),y),ys)) -> app(app(app(filtersub(),app(f,y)),f),app(app(cons(),y),ys)) r3: app(app(app(filtersub(),true()),f),app(app(cons(),y),ys)) -> app(app(cons(),y),app(app(filter(),f),ys)) r4: app(app(app(filtersub(),false()),f),app(app(cons(),y),ys)) -> app(app(filter(),f),ys) The set of usable rules consists of r1, r2, r3, r4 Take the reduction pair: lexicographic combination of reduction pairs: 1. lexicographic path order with precedence: precedence: filtersub > false > true > filter > app > cons > app# > nil argument filter: pi(app#) = 2 pi(app) = 2 pi(filter) = [] pi(cons) = [] pi(filtersub) = [] pi(true) = [] pi(false) = [] pi(nil) = [] 2. lexicographic path order with precedence: precedence: nil > app > filter > false > cons > true > filtersub > app# argument filter: pi(app#) = 2 pi(app) = [2] pi(filter) = [] pi(cons) = [] pi(filtersub) = [] pi(true) = [] pi(false) = [] pi(nil) = [] The next rules are strictly ordered: p2, p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: app#(app(filter(),f),app(app(cons(),y),ys)) -> app#(app(app(filtersub(),app(f,y)),f),app(app(cons(),y),ys)) and R consists of: r1: app(app(filter(),f),nil()) -> nil() r2: app(app(filter(),f),app(app(cons(),y),ys)) -> app(app(app(filtersub(),app(f,y)),f),app(app(cons(),y),ys)) r3: app(app(app(filtersub(),true()),f),app(app(cons(),y),ys)) -> app(app(cons(),y),app(app(filter(),f),ys)) r4: app(app(app(filtersub(),false()),f),app(app(cons(),y),ys)) -> app(app(filter(),f),ys) The estimated dependency graph contains the following SCCs: (no SCCs)