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

app(nil, k) → k
app(l, nil) → l
app(cons(x, l), k) → cons(x, app(l, k))
sum(cons(x, nil)) → cons(x, nil)
sum(cons(x, cons(y, l))) → sum(cons(a(x, y, h), l))
a(h, h, x) → s(x)
a(x, s(y), h) → a(x, y, s(h))
a(x, s(y), s(z)) → a(x, y, a(x, s(y), z))
a(s(x), h, z) → a(x, z, z)

Rewrite Strategy: INNERMOST


Renamed function symbols to avoid clashes with predefined symbol.


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


app'(nil', k) → k
app'(l, nil') → l
app'(cons'(x, l), k) → cons'(x, app'(l, k))
sum'(cons'(x, nil')) → cons'(x, nil')
sum'(cons'(x, cons'(y, l))) → sum'(cons'(a'(x, y, h'), l))
a'(h', h', x) → s'(x)
a'(x, s'(y), h') → a'(x, y, s'(h'))
a'(x, s'(y), s'(z)) → a'(x, y, a'(x, s'(y), z))
a'(s'(x), h', z) → a'(x, z, z)

Rewrite Strategy: INNERMOST


Infered types.


Rules:
app'(nil', k) → k
app'(l, nil') → l
app'(cons'(x, l), k) → cons'(x, app'(l, k))
sum'(cons'(x, nil')) → cons'(x, nil')
sum'(cons'(x, cons'(y, l))) → sum'(cons'(a'(x, y, h'), l))
a'(h', h', x) → s'(x)
a'(x, s'(y), h') → a'(x, y, s'(h'))
a'(x, s'(y), s'(z)) → a'(x, y, a'(x, s'(y), z))
a'(s'(x), h', z) → a'(x, z, z)

Types:
app' :: nil':cons' → nil':cons' → nil':cons'
nil' :: nil':cons'
cons' :: h':s' → nil':cons' → nil':cons'
sum' :: nil':cons' → nil':cons'
a' :: h':s' → h':s' → h':s' → h':s'
h' :: h':s'
s' :: h':s' → h':s'
_hole_nil':cons'1 :: nil':cons'
_hole_h':s'2 :: h':s'
_gen_nil':cons'3 :: Nat → nil':cons'
_gen_h':s'4 :: Nat → h':s'


Heuristically decided to analyse the following defined symbols:
app', sum', a'

They will be analysed ascendingly in the following order:
a' < sum'


Rules:
app'(nil', k) → k
app'(l, nil') → l
app'(cons'(x, l), k) → cons'(x, app'(l, k))
sum'(cons'(x, nil')) → cons'(x, nil')
sum'(cons'(x, cons'(y, l))) → sum'(cons'(a'(x, y, h'), l))
a'(h', h', x) → s'(x)
a'(x, s'(y), h') → a'(x, y, s'(h'))
a'(x, s'(y), s'(z)) → a'(x, y, a'(x, s'(y), z))
a'(s'(x), h', z) → a'(x, z, z)

Types:
app' :: nil':cons' → nil':cons' → nil':cons'
nil' :: nil':cons'
cons' :: h':s' → nil':cons' → nil':cons'
sum' :: nil':cons' → nil':cons'
a' :: h':s' → h':s' → h':s' → h':s'
h' :: h':s'
s' :: h':s' → h':s'
_hole_nil':cons'1 :: nil':cons'
_hole_h':s'2 :: h':s'
_gen_nil':cons'3 :: Nat → nil':cons'
_gen_h':s'4 :: Nat → h':s'

Generator Equations:
_gen_nil':cons'3(0) ⇔ nil'
_gen_nil':cons'3(+(x, 1)) ⇔ cons'(h', _gen_nil':cons'3(x))
_gen_h':s'4(0) ⇔ h'
_gen_h':s'4(+(x, 1)) ⇔ s'(_gen_h':s'4(x))

The following defined symbols remain to be analysed:
app', sum', a'

They will be analysed ascendingly in the following order:
a' < sum'


Proved the following rewrite lemma:
app'(_gen_nil':cons'3(_n6), _gen_nil':cons'3(b)) → _gen_nil':cons'3(+(_n6, b)), rt ∈ Ω(1 + n6)

Induction Base:
app'(_gen_nil':cons'3(0), _gen_nil':cons'3(b)) →RΩ(1)
_gen_nil':cons'3(b)

Induction Step:
app'(_gen_nil':cons'3(+(_$n7, 1)), _gen_nil':cons'3(_b199)) →RΩ(1)
cons'(h', app'(_gen_nil':cons'3(_$n7), _gen_nil':cons'3(_b199))) →IH
cons'(h', _gen_nil':cons'3(+(_$n7, _b199)))

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


Rules:
app'(nil', k) → k
app'(l, nil') → l
app'(cons'(x, l), k) → cons'(x, app'(l, k))
sum'(cons'(x, nil')) → cons'(x, nil')
sum'(cons'(x, cons'(y, l))) → sum'(cons'(a'(x, y, h'), l))
a'(h', h', x) → s'(x)
a'(x, s'(y), h') → a'(x, y, s'(h'))
a'(x, s'(y), s'(z)) → a'(x, y, a'(x, s'(y), z))
a'(s'(x), h', z) → a'(x, z, z)

Types:
app' :: nil':cons' → nil':cons' → nil':cons'
nil' :: nil':cons'
cons' :: h':s' → nil':cons' → nil':cons'
sum' :: nil':cons' → nil':cons'
a' :: h':s' → h':s' → h':s' → h':s'
h' :: h':s'
s' :: h':s' → h':s'
_hole_nil':cons'1 :: nil':cons'
_hole_h':s'2 :: h':s'
_gen_nil':cons'3 :: Nat → nil':cons'
_gen_h':s'4 :: Nat → h':s'

Lemmas:
app'(_gen_nil':cons'3(_n6), _gen_nil':cons'3(b)) → _gen_nil':cons'3(+(_n6, b)), rt ∈ Ω(1 + n6)

Generator Equations:
_gen_nil':cons'3(0) ⇔ nil'
_gen_nil':cons'3(+(x, 1)) ⇔ cons'(h', _gen_nil':cons'3(x))
_gen_h':s'4(0) ⇔ h'
_gen_h':s'4(+(x, 1)) ⇔ s'(_gen_h':s'4(x))

The following defined symbols remain to be analysed:
a', sum'

They will be analysed ascendingly in the following order:
a' < sum'


Proved the following rewrite lemma:
a'(_gen_h':s'4(_n801), _gen_h':s'4(0), _gen_h':s'4(0)) → _gen_h':s'4(1), rt ∈ Ω(1 + n801)

Induction Base:
a'(_gen_h':s'4(0), _gen_h':s'4(0), _gen_h':s'4(0)) →RΩ(1)
s'(_gen_h':s'4(0))

Induction Step:
a'(_gen_h':s'4(+(_$n802, 1)), _gen_h':s'4(0), _gen_h':s'4(0)) →RΩ(1)
a'(_gen_h':s'4(_$n802), _gen_h':s'4(0), _gen_h':s'4(0)) →IH
_gen_h':s'4(1)

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


Rules:
app'(nil', k) → k
app'(l, nil') → l
app'(cons'(x, l), k) → cons'(x, app'(l, k))
sum'(cons'(x, nil')) → cons'(x, nil')
sum'(cons'(x, cons'(y, l))) → sum'(cons'(a'(x, y, h'), l))
a'(h', h', x) → s'(x)
a'(x, s'(y), h') → a'(x, y, s'(h'))
a'(x, s'(y), s'(z)) → a'(x, y, a'(x, s'(y), z))
a'(s'(x), h', z) → a'(x, z, z)

Types:
app' :: nil':cons' → nil':cons' → nil':cons'
nil' :: nil':cons'
cons' :: h':s' → nil':cons' → nil':cons'
sum' :: nil':cons' → nil':cons'
a' :: h':s' → h':s' → h':s' → h':s'
h' :: h':s'
s' :: h':s' → h':s'
_hole_nil':cons'1 :: nil':cons'
_hole_h':s'2 :: h':s'
_gen_nil':cons'3 :: Nat → nil':cons'
_gen_h':s'4 :: Nat → h':s'

Lemmas:
app'(_gen_nil':cons'3(_n6), _gen_nil':cons'3(b)) → _gen_nil':cons'3(+(_n6, b)), rt ∈ Ω(1 + n6)
a'(_gen_h':s'4(_n801), _gen_h':s'4(0), _gen_h':s'4(0)) → _gen_h':s'4(1), rt ∈ Ω(1 + n801)

Generator Equations:
_gen_nil':cons'3(0) ⇔ nil'
_gen_nil':cons'3(+(x, 1)) ⇔ cons'(h', _gen_nil':cons'3(x))
_gen_h':s'4(0) ⇔ h'
_gen_h':s'4(+(x, 1)) ⇔ s'(_gen_h':s'4(x))

The following defined symbols remain to be analysed:
sum'


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

The following conjecture could not be proven:

sum'(_gen_nil':cons'3(+(1, _n3536))) →? cons'(_gen_h':s'4(1), _gen_nil':cons'3(0))


Rules:
app'(nil', k) → k
app'(l, nil') → l
app'(cons'(x, l), k) → cons'(x, app'(l, k))
sum'(cons'(x, nil')) → cons'(x, nil')
sum'(cons'(x, cons'(y, l))) → sum'(cons'(a'(x, y, h'), l))
a'(h', h', x) → s'(x)
a'(x, s'(y), h') → a'(x, y, s'(h'))
a'(x, s'(y), s'(z)) → a'(x, y, a'(x, s'(y), z))
a'(s'(x), h', z) → a'(x, z, z)

Types:
app' :: nil':cons' → nil':cons' → nil':cons'
nil' :: nil':cons'
cons' :: h':s' → nil':cons' → nil':cons'
sum' :: nil':cons' → nil':cons'
a' :: h':s' → h':s' → h':s' → h':s'
h' :: h':s'
s' :: h':s' → h':s'
_hole_nil':cons'1 :: nil':cons'
_hole_h':s'2 :: h':s'
_gen_nil':cons'3 :: Nat → nil':cons'
_gen_h':s'4 :: Nat → h':s'

Lemmas:
app'(_gen_nil':cons'3(_n6), _gen_nil':cons'3(b)) → _gen_nil':cons'3(+(_n6, b)), rt ∈ Ω(1 + n6)
a'(_gen_h':s'4(_n801), _gen_h':s'4(0), _gen_h':s'4(0)) → _gen_h':s'4(1), rt ∈ Ω(1 + n801)

Generator Equations:
_gen_nil':cons'3(0) ⇔ nil'
_gen_nil':cons'3(+(x, 1)) ⇔ cons'(h', _gen_nil':cons'3(x))
_gen_h':s'4(0) ⇔ h'
_gen_h':s'4(+(x, 1)) ⇔ s'(_gen_h':s'4(x))

No more defined symbols left to analyse.


The lowerbound Ω(n) was proven with the following lemma:
app'(_gen_nil':cons'3(_n6), _gen_nil':cons'3(b)) → _gen_nil':cons'3(+(_n6, b)), rt ∈ Ω(1 + n6)