YES TRS: active(filter(cons(X,Y),0(),M)) -> mark(cons(0(),filter(Y,M,M))) active(filter(cons(X,Y),s(N),M)) -> mark(cons(X,filter(Y,N,M))) active(sieve(cons(0(),Y))) -> mark(cons(0(),sieve(Y))) active(sieve(cons(s(N),Y))) -> mark(cons(s(N),sieve(filter(Y,N,N)))) active(nats(N)) -> mark(cons(N,nats(s(N)))) active(zprimes()) -> mark(sieve(nats(s(s(0()))))) mark(filter(X1,X2,X3)) -> active(filter(mark(X1),mark(X2),mark(X3))) mark(cons(X1,X2)) -> active(cons(mark(X1),X2)) mark(0()) -> active(0()) mark(s(X)) -> active(s(mark(X))) mark(sieve(X)) -> active(sieve(mark(X))) mark(nats(X)) -> active(nats(mark(X))) mark(zprimes()) -> active(zprimes()) filter(mark(X1),X2,X3) -> filter(X1,X2,X3) filter(X1,mark(X2),X3) -> filter(X1,X2,X3) filter(X1,X2,mark(X3)) -> filter(X1,X2,X3) filter(active(X1),X2,X3) -> filter(X1,X2,X3) filter(X1,active(X2),X3) -> filter(X1,X2,X3) filter(X1,X2,active(X3)) -> filter(X1,X2,X3) cons(mark(X1),X2) -> cons(X1,X2) cons(X1,mark(X2)) -> cons(X1,X2) cons(active(X1),X2) -> cons(X1,X2) cons(X1,active(X2)) -> cons(X1,X2) s(mark(X)) -> s(X) s(active(X)) -> s(X) sieve(mark(X)) -> sieve(X) sieve(active(X)) -> sieve(X) nats(mark(X)) -> nats(X) nats(active(X)) -> nats(X) max/plus interpretations on N: active_A(x1) = max{23, x1} active#_A(x1) = max{51, 2 + x1} filter_A(x1,x2,x3) = max{8, 99 + x1, 40 + x2, 62 + x3} filter#_A(x1,x2,x3) = max{88, 65, 18, 56} cons_A(x1,x2) = max{1, 7 + x1, 7} cons#_A(x1,x2) = max{19, 56, 19} 0_A = 7 0#_A = 0 mark_A(x1) = max{11, 16 + x1} mark#_A(x1) = max{54, 49 + x1} s_A(x1) = max{93, 130 + x1} s#_A(x1) = max{48, -1} sieve_A(x1) = max{53, 47 + x1} sieve#_A(x1) = max{52, 1} nats_A(x1) = max{55, 87 + x1} nats#_A(x1) = max{0, 1} zprimes_A = 449 zprimes#_A = 53 precedence: active = zprimes > filter = nats > mark > sieve > cons > 0 = s