Runtime Complexity TRS:
The TRS R consists of the following rules:

filter(cons(X, Y), 0, M) → cons(0, n__filter(activate(Y), M, M))
filter(cons(X, Y), s(N), M) → cons(X, n__filter(activate(Y), N, M))
sieve(cons(0, Y)) → cons(0, n__sieve(activate(Y)))
sieve(cons(s(N), Y)) → cons(s(N), n__sieve(filter(activate(Y), N, N)))
nats(N) → cons(N, n__nats(s(N)))
zprimessieve(nats(s(s(0))))
filter(X1, X2, X3) → n__filter(X1, X2, X3)
sieve(X) → n__sieve(X)
nats(X) → n__nats(X)
activate(n__filter(X1, X2, X3)) → filter(X1, X2, X3)
activate(n__sieve(X)) → sieve(X)
activate(n__nats(X)) → nats(X)
activate(X) → X

Rewrite Strategy: INNERMOST


Renamed function symbols to avoid clashes with predefined symbol.


Runtime Complexity TRS:
The TRS R consists of the following rules:


filter'(cons'(X, Y), 0', M) → cons'(0', n__filter'(activate'(Y), M, M))
filter'(cons'(X, Y), s'(N), M) → cons'(X, n__filter'(activate'(Y), N, M))
sieve'(cons'(0', Y)) → cons'(0', n__sieve'(activate'(Y)))
sieve'(cons'(s'(N), Y)) → cons'(s'(N), n__sieve'(filter'(activate'(Y), N, N)))
nats'(N) → cons'(N, n__nats'(s'(N)))
zprimes'sieve'(nats'(s'(s'(0'))))
filter'(X1, X2, X3) → n__filter'(X1, X2, X3)
sieve'(X) → n__sieve'(X)
nats'(X) → n__nats'(X)
activate'(n__filter'(X1, X2, X3)) → filter'(X1, X2, X3)
activate'(n__sieve'(X)) → sieve'(X)
activate'(n__nats'(X)) → nats'(X)
activate'(X) → X

Rewrite Strategy: INNERMOST


Infered types.


Rules:
filter'(cons'(X, Y), 0', M) → cons'(0', n__filter'(activate'(Y), M, M))
filter'(cons'(X, Y), s'(N), M) → cons'(X, n__filter'(activate'(Y), N, M))
sieve'(cons'(0', Y)) → cons'(0', n__sieve'(activate'(Y)))
sieve'(cons'(s'(N), Y)) → cons'(s'(N), n__sieve'(filter'(activate'(Y), N, N)))
nats'(N) → cons'(N, n__nats'(s'(N)))
zprimes'sieve'(nats'(s'(s'(0'))))
filter'(X1, X2, X3) → n__filter'(X1, X2, X3)
sieve'(X) → n__sieve'(X)
nats'(X) → n__nats'(X)
activate'(n__filter'(X1, X2, X3)) → filter'(X1, X2, X3)
activate'(n__sieve'(X)) → sieve'(X)
activate'(n__nats'(X)) → nats'(X)
activate'(X) → X

Types:
filter' :: cons':n__filter':n__sieve':n__nats' → 0':s' → 0':s' → cons':n__filter':n__sieve':n__nats'
cons' :: 0':s' → cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
0' :: 0':s'
n__filter' :: cons':n__filter':n__sieve':n__nats' → 0':s' → 0':s' → cons':n__filter':n__sieve':n__nats'
activate' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
s' :: 0':s' → 0':s'
sieve' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
n__sieve' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
nats' :: 0':s' → cons':n__filter':n__sieve':n__nats'
n__nats' :: 0':s' → cons':n__filter':n__sieve':n__nats'
zprimes' :: cons':n__filter':n__sieve':n__nats'
_hole_cons':n__filter':n__sieve':n__nats'1 :: cons':n__filter':n__sieve':n__nats'
_hole_0':s'2 :: 0':s'
_gen_cons':n__filter':n__sieve':n__nats'3 :: Nat → cons':n__filter':n__sieve':n__nats'
_gen_0':s'4 :: Nat → 0':s'


Heuristically decided to analyse the following defined symbols:
filter', activate', sieve'

They will be analysed ascendingly in the following order:
filter' = activate'
filter' = sieve'
activate' = sieve'


Rules:
filter'(cons'(X, Y), 0', M) → cons'(0', n__filter'(activate'(Y), M, M))
filter'(cons'(X, Y), s'(N), M) → cons'(X, n__filter'(activate'(Y), N, M))
sieve'(cons'(0', Y)) → cons'(0', n__sieve'(activate'(Y)))
sieve'(cons'(s'(N), Y)) → cons'(s'(N), n__sieve'(filter'(activate'(Y), N, N)))
nats'(N) → cons'(N, n__nats'(s'(N)))
zprimes'sieve'(nats'(s'(s'(0'))))
filter'(X1, X2, X3) → n__filter'(X1, X2, X3)
sieve'(X) → n__sieve'(X)
nats'(X) → n__nats'(X)
activate'(n__filter'(X1, X2, X3)) → filter'(X1, X2, X3)
activate'(n__sieve'(X)) → sieve'(X)
activate'(n__nats'(X)) → nats'(X)
activate'(X) → X

Types:
filter' :: cons':n__filter':n__sieve':n__nats' → 0':s' → 0':s' → cons':n__filter':n__sieve':n__nats'
cons' :: 0':s' → cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
0' :: 0':s'
n__filter' :: cons':n__filter':n__sieve':n__nats' → 0':s' → 0':s' → cons':n__filter':n__sieve':n__nats'
activate' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
s' :: 0':s' → 0':s'
sieve' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
n__sieve' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
nats' :: 0':s' → cons':n__filter':n__sieve':n__nats'
n__nats' :: 0':s' → cons':n__filter':n__sieve':n__nats'
zprimes' :: cons':n__filter':n__sieve':n__nats'
_hole_cons':n__filter':n__sieve':n__nats'1 :: cons':n__filter':n__sieve':n__nats'
_hole_0':s'2 :: 0':s'
_gen_cons':n__filter':n__sieve':n__nats'3 :: Nat → cons':n__filter':n__sieve':n__nats'
_gen_0':s'4 :: Nat → 0':s'

Generator Equations:
_gen_cons':n__filter':n__sieve':n__nats'3(0) ⇔ n__nats'(0')
_gen_cons':n__filter':n__sieve':n__nats'3(+(x, 1)) ⇔ cons'(0', _gen_cons':n__filter':n__sieve':n__nats'3(x))
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))

The following defined symbols remain to be analysed:
activate', filter', sieve'

They will be analysed ascendingly in the following order:
filter' = activate'
filter' = sieve'
activate' = sieve'


Could not prove a rewrite lemma for the defined symbol activate'.


Rules:
filter'(cons'(X, Y), 0', M) → cons'(0', n__filter'(activate'(Y), M, M))
filter'(cons'(X, Y), s'(N), M) → cons'(X, n__filter'(activate'(Y), N, M))
sieve'(cons'(0', Y)) → cons'(0', n__sieve'(activate'(Y)))
sieve'(cons'(s'(N), Y)) → cons'(s'(N), n__sieve'(filter'(activate'(Y), N, N)))
nats'(N) → cons'(N, n__nats'(s'(N)))
zprimes'sieve'(nats'(s'(s'(0'))))
filter'(X1, X2, X3) → n__filter'(X1, X2, X3)
sieve'(X) → n__sieve'(X)
nats'(X) → n__nats'(X)
activate'(n__filter'(X1, X2, X3)) → filter'(X1, X2, X3)
activate'(n__sieve'(X)) → sieve'(X)
activate'(n__nats'(X)) → nats'(X)
activate'(X) → X

Types:
filter' :: cons':n__filter':n__sieve':n__nats' → 0':s' → 0':s' → cons':n__filter':n__sieve':n__nats'
cons' :: 0':s' → cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
0' :: 0':s'
n__filter' :: cons':n__filter':n__sieve':n__nats' → 0':s' → 0':s' → cons':n__filter':n__sieve':n__nats'
activate' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
s' :: 0':s' → 0':s'
sieve' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
n__sieve' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
nats' :: 0':s' → cons':n__filter':n__sieve':n__nats'
n__nats' :: 0':s' → cons':n__filter':n__sieve':n__nats'
zprimes' :: cons':n__filter':n__sieve':n__nats'
_hole_cons':n__filter':n__sieve':n__nats'1 :: cons':n__filter':n__sieve':n__nats'
_hole_0':s'2 :: 0':s'
_gen_cons':n__filter':n__sieve':n__nats'3 :: Nat → cons':n__filter':n__sieve':n__nats'
_gen_0':s'4 :: Nat → 0':s'

Generator Equations:
_gen_cons':n__filter':n__sieve':n__nats'3(0) ⇔ n__nats'(0')
_gen_cons':n__filter':n__sieve':n__nats'3(+(x, 1)) ⇔ cons'(0', _gen_cons':n__filter':n__sieve':n__nats'3(x))
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))

The following defined symbols remain to be analysed:
filter', sieve'

They will be analysed ascendingly in the following order:
filter' = activate'
filter' = sieve'
activate' = sieve'


Could not prove a rewrite lemma for the defined symbol filter'.


Rules:
filter'(cons'(X, Y), 0', M) → cons'(0', n__filter'(activate'(Y), M, M))
filter'(cons'(X, Y), s'(N), M) → cons'(X, n__filter'(activate'(Y), N, M))
sieve'(cons'(0', Y)) → cons'(0', n__sieve'(activate'(Y)))
sieve'(cons'(s'(N), Y)) → cons'(s'(N), n__sieve'(filter'(activate'(Y), N, N)))
nats'(N) → cons'(N, n__nats'(s'(N)))
zprimes'sieve'(nats'(s'(s'(0'))))
filter'(X1, X2, X3) → n__filter'(X1, X2, X3)
sieve'(X) → n__sieve'(X)
nats'(X) → n__nats'(X)
activate'(n__filter'(X1, X2, X3)) → filter'(X1, X2, X3)
activate'(n__sieve'(X)) → sieve'(X)
activate'(n__nats'(X)) → nats'(X)
activate'(X) → X

Types:
filter' :: cons':n__filter':n__sieve':n__nats' → 0':s' → 0':s' → cons':n__filter':n__sieve':n__nats'
cons' :: 0':s' → cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
0' :: 0':s'
n__filter' :: cons':n__filter':n__sieve':n__nats' → 0':s' → 0':s' → cons':n__filter':n__sieve':n__nats'
activate' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
s' :: 0':s' → 0':s'
sieve' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
n__sieve' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
nats' :: 0':s' → cons':n__filter':n__sieve':n__nats'
n__nats' :: 0':s' → cons':n__filter':n__sieve':n__nats'
zprimes' :: cons':n__filter':n__sieve':n__nats'
_hole_cons':n__filter':n__sieve':n__nats'1 :: cons':n__filter':n__sieve':n__nats'
_hole_0':s'2 :: 0':s'
_gen_cons':n__filter':n__sieve':n__nats'3 :: Nat → cons':n__filter':n__sieve':n__nats'
_gen_0':s'4 :: Nat → 0':s'

Generator Equations:
_gen_cons':n__filter':n__sieve':n__nats'3(0) ⇔ n__nats'(0')
_gen_cons':n__filter':n__sieve':n__nats'3(+(x, 1)) ⇔ cons'(0', _gen_cons':n__filter':n__sieve':n__nats'3(x))
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))

The following defined symbols remain to be analysed:
sieve'

They will be analysed ascendingly in the following order:
filter' = activate'
filter' = sieve'
activate' = sieve'


Could not prove a rewrite lemma for the defined symbol sieve'.


Rules:
filter'(cons'(X, Y), 0', M) → cons'(0', n__filter'(activate'(Y), M, M))
filter'(cons'(X, Y), s'(N), M) → cons'(X, n__filter'(activate'(Y), N, M))
sieve'(cons'(0', Y)) → cons'(0', n__sieve'(activate'(Y)))
sieve'(cons'(s'(N), Y)) → cons'(s'(N), n__sieve'(filter'(activate'(Y), N, N)))
nats'(N) → cons'(N, n__nats'(s'(N)))
zprimes'sieve'(nats'(s'(s'(0'))))
filter'(X1, X2, X3) → n__filter'(X1, X2, X3)
sieve'(X) → n__sieve'(X)
nats'(X) → n__nats'(X)
activate'(n__filter'(X1, X2, X3)) → filter'(X1, X2, X3)
activate'(n__sieve'(X)) → sieve'(X)
activate'(n__nats'(X)) → nats'(X)
activate'(X) → X

Types:
filter' :: cons':n__filter':n__sieve':n__nats' → 0':s' → 0':s' → cons':n__filter':n__sieve':n__nats'
cons' :: 0':s' → cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
0' :: 0':s'
n__filter' :: cons':n__filter':n__sieve':n__nats' → 0':s' → 0':s' → cons':n__filter':n__sieve':n__nats'
activate' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
s' :: 0':s' → 0':s'
sieve' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
n__sieve' :: cons':n__filter':n__sieve':n__nats' → cons':n__filter':n__sieve':n__nats'
nats' :: 0':s' → cons':n__filter':n__sieve':n__nats'
n__nats' :: 0':s' → cons':n__filter':n__sieve':n__nats'
zprimes' :: cons':n__filter':n__sieve':n__nats'
_hole_cons':n__filter':n__sieve':n__nats'1 :: cons':n__filter':n__sieve':n__nats'
_hole_0':s'2 :: 0':s'
_gen_cons':n__filter':n__sieve':n__nats'3 :: Nat → cons':n__filter':n__sieve':n__nats'
_gen_0':s'4 :: Nat → 0':s'

Generator Equations:
_gen_cons':n__filter':n__sieve':n__nats'3(0) ⇔ n__nats'(0')
_gen_cons':n__filter':n__sieve':n__nats'3(+(x, 1)) ⇔ cons'(0', _gen_cons':n__filter':n__sieve':n__nats'3(x))
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))

No more defined symbols left to analyse.