(VAR f x xs y ) (RULES app(app(le,0),y) -> true app(app(le,app(s,x)),0) -> false app(app(le,app(s,x)),app(s,y)) -> app(app(le,x),y) app(pred,app(s,x)) -> x app(app(minus,x),0) -> x app(app(minus,x),app(s,y)) -> app(pred,app(app(minus,x),y)) app(app(gcd,0),y) -> y app(app(gcd,app(s,x)),0) -> app(s,x) app(app(gcd,app(s,x)),app(s,y)) -> app(app(app(if_gcd,app(app(le,y),x)),app(s,x)),app(s,y)) app(app(app(if_gcd,true),app(s,x)),app(s,y)) -> app(app(gcd,app(app(minus,x),y)),app(s,y)) app(app(app(if_gcd,false),app(s,x)),app(s,y)) -> app(app(gcd,app(app(minus,y),x)),app(s,x)) app(app(map,f),nil) -> nil app(app(map,f),app(app(cons,x),xs)) -> app(app(cons,app(f,x)),app(app(map,f),xs)) app(app(filter,f),nil) -> nil app(app(filter,f),app(app(cons,x),xs)) -> app(app(app(app(filter2,app(f,x)),f),x),xs) app(app(app(app(filter2,true),f),x),xs) -> app(app(cons,x),app(app(filter,f),xs)) app(app(app(app(filter2,false),f),x),xs) -> app(app(filter,f),xs) )