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

a__terms(N) → cons(recip(a__sqr(mark(N))), terms(s(N)))
a__sqr(0) → 0
a__dbl(0) → 0
a__dbl(s(X)) → s(s(dbl(X)))
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(mark(Y), first(X, Z))
mark(terms(X)) → a__terms(mark(X))
mark(sqr(X)) → a__sqr(mark(X))
mark(dbl(X)) → a__dbl(mark(X))
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(recip(X)) → recip(mark(X))
mark(s(X)) → s(X)
mark(0) → 0
mark(nil) → nil
a__terms(X) → terms(X)
a__sqr(X) → sqr(X)
a__dbl(X) → dbl(X)
a__first(X1, X2) → first(X1, X2)

Rewrite Strategy: INNERMOST

Renamed function symbols to avoid clashes with predefined symbol.

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

a__terms'(N) → cons'(recip'(a__sqr'(mark'(N))), terms'(s'(N)))
a__sqr'(0') → 0'
a__dbl'(0') → 0'
a__dbl'(s'(X)) → s'(s'(dbl'(X)))
a__first'(0', X) → nil'
a__first'(s'(X), cons'(Y, Z)) → cons'(mark'(Y), first'(X, Z))
mark'(terms'(X)) → a__terms'(mark'(X))
mark'(sqr'(X)) → a__sqr'(mark'(X))
mark'(dbl'(X)) → a__dbl'(mark'(X))
mark'(first'(X1, X2)) → a__first'(mark'(X1), mark'(X2))
mark'(cons'(X1, X2)) → cons'(mark'(X1), X2)
mark'(recip'(X)) → recip'(mark'(X))
mark'(s'(X)) → s'(X)
mark'(0') → 0'
mark'(nil') → nil'
a__terms'(X) → terms'(X)
a__sqr'(X) → sqr'(X)
a__dbl'(X) → dbl'(X)
a__first'(X1, X2) → first'(X1, X2)

Rewrite Strategy: INNERMOST

Sliced the following arguments:
cons'/1
s'/0

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

a__terms'(N) → cons'(recip'(a__sqr'(mark'(N))))
a__sqr'(0') → 0'
a__sqr'(s') → s'
a__dbl'(0') → 0'
a__dbl'(s') → s'
a__first'(0', X) → nil'
a__first'(s', cons'(Y)) → cons'(mark'(Y))
mark'(terms'(X)) → a__terms'(mark'(X))
mark'(sqr'(X)) → a__sqr'(mark'(X))
mark'(dbl'(X)) → a__dbl'(mark'(X))
mark'(first'(X1, X2)) → a__first'(mark'(X1), mark'(X2))
mark'(cons'(X1)) → cons'(mark'(X1))
mark'(recip'(X)) → recip'(mark'(X))
mark'(s') → s'
mark'(0') → 0'
mark'(nil') → nil'
a__terms'(X) → terms'(X)
a__sqr'(X) → sqr'(X)
a__dbl'(X) → dbl'(X)
a__first'(X1, X2) → first'(X1, X2)

Rewrite Strategy: INNERMOST

Infered types.

Rules:
a__terms'(N) → cons'(recip'(a__sqr'(mark'(N))))
a__sqr'(0') → 0'
a__sqr'(s') → s'
a__dbl'(0') → 0'
a__dbl'(s') → s'
a__first'(0', X) → nil'
a__first'(s', cons'(Y)) → cons'(mark'(Y))
mark'(terms'(X)) → a__terms'(mark'(X))
mark'(sqr'(X)) → a__sqr'(mark'(X))
mark'(dbl'(X)) → a__dbl'(mark'(X))
mark'(first'(X1, X2)) → a__first'(mark'(X1), mark'(X2))
mark'(cons'(X1)) → cons'(mark'(X1))
mark'(recip'(X)) → recip'(mark'(X))
mark'(s') → s'
mark'(0') → 0'
mark'(nil') → nil'
a__terms'(X) → terms'(X)
a__sqr'(X) → sqr'(X)
a__dbl'(X) → dbl'(X)
a__first'(X1, X2) → first'(X1, X2)

Types:

Heuristically decided to analyse the following defined symbols:
a__terms', mark'

They will be analysed ascendingly in the following order:
a__terms' = mark'

Rules:
a__terms'(N) → cons'(recip'(a__sqr'(mark'(N))))
a__sqr'(0') → 0'
a__sqr'(s') → s'
a__dbl'(0') → 0'
a__dbl'(s') → s'
a__first'(0', X) → nil'
a__first'(s', cons'(Y)) → cons'(mark'(Y))
mark'(terms'(X)) → a__terms'(mark'(X))
mark'(sqr'(X)) → a__sqr'(mark'(X))
mark'(dbl'(X)) → a__dbl'(mark'(X))
mark'(first'(X1, X2)) → a__first'(mark'(X1), mark'(X2))
mark'(cons'(X1)) → cons'(mark'(X1))
mark'(recip'(X)) → recip'(mark'(X))
mark'(s') → s'
mark'(0') → 0'
mark'(nil') → nil'
a__terms'(X) → terms'(X)
a__sqr'(X) → sqr'(X)
a__dbl'(X) → dbl'(X)
a__first'(X1, X2) → first'(X1, X2)

Types:

Generator Equations:

The following defined symbols remain to be analysed:
mark', a__terms'

They will be analysed ascendingly in the following order:
a__terms' = mark'

Proved the following rewrite lemma:

Induction Base:
0'

Induction Step:

We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).

Rules:
a__terms'(N) → cons'(recip'(a__sqr'(mark'(N))))
a__sqr'(0') → 0'
a__sqr'(s') → s'
a__dbl'(0') → 0'
a__dbl'(s') → s'
a__first'(0', X) → nil'
a__first'(s', cons'(Y)) → cons'(mark'(Y))
mark'(terms'(X)) → a__terms'(mark'(X))
mark'(sqr'(X)) → a__sqr'(mark'(X))
mark'(dbl'(X)) → a__dbl'(mark'(X))
mark'(first'(X1, X2)) → a__first'(mark'(X1), mark'(X2))
mark'(cons'(X1)) → cons'(mark'(X1))
mark'(recip'(X)) → recip'(mark'(X))
mark'(s') → s'
mark'(0') → 0'
mark'(nil') → nil'
a__terms'(X) → terms'(X)
a__sqr'(X) → sqr'(X)
a__dbl'(X) → dbl'(X)
a__first'(X1, X2) → first'(X1, X2)

Types:

Lemmas:

Generator Equations:

The following defined symbols remain to be analysed:
a__terms'

They will be analysed ascendingly in the following order:
a__terms' = mark'

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

Rules:
a__terms'(N) → cons'(recip'(a__sqr'(mark'(N))))
a__sqr'(0') → 0'
a__sqr'(s') → s'
a__dbl'(0') → 0'
a__dbl'(s') → s'
a__first'(0', X) → nil'
a__first'(s', cons'(Y)) → cons'(mark'(Y))
mark'(terms'(X)) → a__terms'(mark'(X))
mark'(sqr'(X)) → a__sqr'(mark'(X))
mark'(dbl'(X)) → a__dbl'(mark'(X))
mark'(first'(X1, X2)) → a__first'(mark'(X1), mark'(X2))
mark'(cons'(X1)) → cons'(mark'(X1))
mark'(recip'(X)) → recip'(mark'(X))
mark'(s') → s'
mark'(0') → 0'
mark'(nil') → nil'
a__terms'(X) → terms'(X)
a__sqr'(X) → sqr'(X)
a__dbl'(X) → dbl'(X)
a__first'(X1, X2) → first'(X1, X2)

Types: