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(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) → sum(app(l, sum(cons(x, cons(y, k)))))
plus(s(x), s(y)) → s(s(plus(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))))
plus(s(x), x) → plus(if(gt(x, x), id(x), id(x)), s(x))
plus(zero, y) → y
plus(id(x), s(y)) → s(plus(x, if(gt(s(y), y), y, s(y))))
id(x) → x
if(true, x, y) → x
if(false, x, y) → y
not(x) → if(x, false, true)
gt(s(x), zero) → true
gt(zero, y) → false
gt(s(x), s(y)) → gt(x, y)

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'(plus'(x, y), l))
sum'(app'(l, cons'(x, cons'(y, k)))) → sum'(app'(l, sum'(cons'(x, cons'(y, k)))))
plus'(s'(x), s'(y)) → s'(s'(plus'(if'(gt'(x, y), x, y), if'(not'(gt'(x, y)), id'(x), id'(y)))))
plus'(s'(x), x) → plus'(if'(gt'(x, x), id'(x), id'(x)), s'(x))
plus'(zero', y) → y
plus'(id'(x), s'(y)) → s'(plus'(x, if'(gt'(s'(y), y), y, s'(y))))
id'(x) → x
if'(true', x, y) → x
if'(false', x, y) → y
not'(x) → if'(x, false', true')
gt'(s'(x), zero') → true'
gt'(zero', y) → false'
gt'(s'(x), s'(y)) → gt'(x, y)

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'(plus'(x, y), l))
sum'(app'(l, cons'(x, cons'(y, k)))) → sum'(app'(l, sum'(cons'(x, cons'(y, k)))))
plus'(s'(x), s'(y)) → s'(s'(plus'(if'(gt'(x, y), x, y), if'(not'(gt'(x, y)), id'(x), id'(y)))))
plus'(s'(x), x) → plus'(if'(gt'(x, x), id'(x), id'(x)), s'(x))
plus'(zero', y) → y
plus'(id'(x), s'(y)) → s'(plus'(x, if'(gt'(s'(y), y), y, s'(y))))
id'(x) → x
if'(true', x, y) → x
if'(false', x, y) → y
not'(x) → if'(x, false', true')
gt'(s'(x), zero') → true'
gt'(zero', y) → false'
gt'(s'(x), s'(y)) → gt'(x, y)

Types:
app' :: nil':cons' → nil':cons' → nil':cons'
nil' :: nil':cons'
cons' :: s':zero':true':false' → nil':cons' → nil':cons'
sum' :: nil':cons' → nil':cons'
plus' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
s' :: s':zero':true':false' → s':zero':true':false'
if' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
gt' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
not' :: s':zero':true':false' → s':zero':true':false'
id' :: s':zero':true':false' → s':zero':true':false'
zero' :: s':zero':true':false'
true' :: s':zero':true':false'
false' :: s':zero':true':false'
_hole_nil':cons'1 :: nil':cons'
_hole_s':zero':true':false'2 :: s':zero':true':false'
_gen_nil':cons'3 :: Nat → nil':cons'
_gen_s':zero':true':false'4 :: Nat → s':zero':true':false'


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

They will be analysed ascendingly in the following order:
app' < sum'
plus' < sum'
gt' < plus'


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'(plus'(x, y), l))
sum'(app'(l, cons'(x, cons'(y, k)))) → sum'(app'(l, sum'(cons'(x, cons'(y, k)))))
plus'(s'(x), s'(y)) → s'(s'(plus'(if'(gt'(x, y), x, y), if'(not'(gt'(x, y)), id'(x), id'(y)))))
plus'(s'(x), x) → plus'(if'(gt'(x, x), id'(x), id'(x)), s'(x))
plus'(zero', y) → y
plus'(id'(x), s'(y)) → s'(plus'(x, if'(gt'(s'(y), y), y, s'(y))))
id'(x) → x
if'(true', x, y) → x
if'(false', x, y) → y
not'(x) → if'(x, false', true')
gt'(s'(x), zero') → true'
gt'(zero', y) → false'
gt'(s'(x), s'(y)) → gt'(x, y)

Types:
app' :: nil':cons' → nil':cons' → nil':cons'
nil' :: nil':cons'
cons' :: s':zero':true':false' → nil':cons' → nil':cons'
sum' :: nil':cons' → nil':cons'
plus' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
s' :: s':zero':true':false' → s':zero':true':false'
if' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
gt' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
not' :: s':zero':true':false' → s':zero':true':false'
id' :: s':zero':true':false' → s':zero':true':false'
zero' :: s':zero':true':false'
true' :: s':zero':true':false'
false' :: s':zero':true':false'
_hole_nil':cons'1 :: nil':cons'
_hole_s':zero':true':false'2 :: s':zero':true':false'
_gen_nil':cons'3 :: Nat → nil':cons'
_gen_s':zero':true':false'4 :: Nat → s':zero':true':false'

Generator Equations:
_gen_nil':cons'3(0) ⇔ nil'
_gen_nil':cons'3(+(x, 1)) ⇔ cons'(zero', _gen_nil':cons'3(x))
_gen_s':zero':true':false'4(0) ⇔ zero'
_gen_s':zero':true':false'4(+(x, 1)) ⇔ s'(_gen_s':zero':true':false'4(x))

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

They will be analysed ascendingly in the following order:
app' < sum'
plus' < sum'
gt' < plus'


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'(zero', app'(_gen_nil':cons'3(_$n7), _gen_nil':cons'3(_b199))) →IH
cons'(zero', _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'(plus'(x, y), l))
sum'(app'(l, cons'(x, cons'(y, k)))) → sum'(app'(l, sum'(cons'(x, cons'(y, k)))))
plus'(s'(x), s'(y)) → s'(s'(plus'(if'(gt'(x, y), x, y), if'(not'(gt'(x, y)), id'(x), id'(y)))))
plus'(s'(x), x) → plus'(if'(gt'(x, x), id'(x), id'(x)), s'(x))
plus'(zero', y) → y
plus'(id'(x), s'(y)) → s'(plus'(x, if'(gt'(s'(y), y), y, s'(y))))
id'(x) → x
if'(true', x, y) → x
if'(false', x, y) → y
not'(x) → if'(x, false', true')
gt'(s'(x), zero') → true'
gt'(zero', y) → false'
gt'(s'(x), s'(y)) → gt'(x, y)

Types:
app' :: nil':cons' → nil':cons' → nil':cons'
nil' :: nil':cons'
cons' :: s':zero':true':false' → nil':cons' → nil':cons'
sum' :: nil':cons' → nil':cons'
plus' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
s' :: s':zero':true':false' → s':zero':true':false'
if' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
gt' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
not' :: s':zero':true':false' → s':zero':true':false'
id' :: s':zero':true':false' → s':zero':true':false'
zero' :: s':zero':true':false'
true' :: s':zero':true':false'
false' :: s':zero':true':false'
_hole_nil':cons'1 :: nil':cons'
_hole_s':zero':true':false'2 :: s':zero':true':false'
_gen_nil':cons'3 :: Nat → nil':cons'
_gen_s':zero':true':false'4 :: Nat → s':zero':true':false'

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'(zero', _gen_nil':cons'3(x))
_gen_s':zero':true':false'4(0) ⇔ zero'
_gen_s':zero':true':false'4(+(x, 1)) ⇔ s'(_gen_s':zero':true':false'4(x))

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

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


Proved the following rewrite lemma:
gt'(_gen_s':zero':true':false'4(+(1, _n1185)), _gen_s':zero':true':false'4(_n1185)) → true', rt ∈ Ω(1 + n1185)

Induction Base:
gt'(_gen_s':zero':true':false'4(+(1, 0)), _gen_s':zero':true':false'4(0)) →RΩ(1)
true'

Induction Step:
gt'(_gen_s':zero':true':false'4(+(1, +(_$n1186, 1))), _gen_s':zero':true':false'4(+(_$n1186, 1))) →RΩ(1)
gt'(_gen_s':zero':true':false'4(+(1, _$n1186)), _gen_s':zero':true':false'4(_$n1186)) →IH
true'

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'(plus'(x, y), l))
sum'(app'(l, cons'(x, cons'(y, k)))) → sum'(app'(l, sum'(cons'(x, cons'(y, k)))))
plus'(s'(x), s'(y)) → s'(s'(plus'(if'(gt'(x, y), x, y), if'(not'(gt'(x, y)), id'(x), id'(y)))))
plus'(s'(x), x) → plus'(if'(gt'(x, x), id'(x), id'(x)), s'(x))
plus'(zero', y) → y
plus'(id'(x), s'(y)) → s'(plus'(x, if'(gt'(s'(y), y), y, s'(y))))
id'(x) → x
if'(true', x, y) → x
if'(false', x, y) → y
not'(x) → if'(x, false', true')
gt'(s'(x), zero') → true'
gt'(zero', y) → false'
gt'(s'(x), s'(y)) → gt'(x, y)

Types:
app' :: nil':cons' → nil':cons' → nil':cons'
nil' :: nil':cons'
cons' :: s':zero':true':false' → nil':cons' → nil':cons'
sum' :: nil':cons' → nil':cons'
plus' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
s' :: s':zero':true':false' → s':zero':true':false'
if' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
gt' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
not' :: s':zero':true':false' → s':zero':true':false'
id' :: s':zero':true':false' → s':zero':true':false'
zero' :: s':zero':true':false'
true' :: s':zero':true':false'
false' :: s':zero':true':false'
_hole_nil':cons'1 :: nil':cons'
_hole_s':zero':true':false'2 :: s':zero':true':false'
_gen_nil':cons'3 :: Nat → nil':cons'
_gen_s':zero':true':false'4 :: Nat → s':zero':true':false'

Lemmas:
app'(_gen_nil':cons'3(_n6), _gen_nil':cons'3(b)) → _gen_nil':cons'3(+(_n6, b)), rt ∈ Ω(1 + n6)
gt'(_gen_s':zero':true':false'4(+(1, _n1185)), _gen_s':zero':true':false'4(_n1185)) → true', rt ∈ Ω(1 + n1185)

Generator Equations:
_gen_nil':cons'3(0) ⇔ nil'
_gen_nil':cons'3(+(x, 1)) ⇔ cons'(zero', _gen_nil':cons'3(x))
_gen_s':zero':true':false'4(0) ⇔ zero'
_gen_s':zero':true':false'4(+(x, 1)) ⇔ s'(_gen_s':zero':true':false'4(x))

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

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


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


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'(plus'(x, y), l))
sum'(app'(l, cons'(x, cons'(y, k)))) → sum'(app'(l, sum'(cons'(x, cons'(y, k)))))
plus'(s'(x), s'(y)) → s'(s'(plus'(if'(gt'(x, y), x, y), if'(not'(gt'(x, y)), id'(x), id'(y)))))
plus'(s'(x), x) → plus'(if'(gt'(x, x), id'(x), id'(x)), s'(x))
plus'(zero', y) → y
plus'(id'(x), s'(y)) → s'(plus'(x, if'(gt'(s'(y), y), y, s'(y))))
id'(x) → x
if'(true', x, y) → x
if'(false', x, y) → y
not'(x) → if'(x, false', true')
gt'(s'(x), zero') → true'
gt'(zero', y) → false'
gt'(s'(x), s'(y)) → gt'(x, y)

Types:
app' :: nil':cons' → nil':cons' → nil':cons'
nil' :: nil':cons'
cons' :: s':zero':true':false' → nil':cons' → nil':cons'
sum' :: nil':cons' → nil':cons'
plus' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
s' :: s':zero':true':false' → s':zero':true':false'
if' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
gt' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
not' :: s':zero':true':false' → s':zero':true':false'
id' :: s':zero':true':false' → s':zero':true':false'
zero' :: s':zero':true':false'
true' :: s':zero':true':false'
false' :: s':zero':true':false'
_hole_nil':cons'1 :: nil':cons'
_hole_s':zero':true':false'2 :: s':zero':true':false'
_gen_nil':cons'3 :: Nat → nil':cons'
_gen_s':zero':true':false'4 :: Nat → s':zero':true':false'

Lemmas:
app'(_gen_nil':cons'3(_n6), _gen_nil':cons'3(b)) → _gen_nil':cons'3(+(_n6, b)), rt ∈ Ω(1 + n6)
gt'(_gen_s':zero':true':false'4(+(1, _n1185)), _gen_s':zero':true':false'4(_n1185)) → true', rt ∈ Ω(1 + n1185)

Generator Equations:
_gen_nil':cons'3(0) ⇔ nil'
_gen_nil':cons'3(+(x, 1)) ⇔ cons'(zero', _gen_nil':cons'3(x))
_gen_s':zero':true':false'4(0) ⇔ zero'
_gen_s':zero':true':false'4(+(x, 1)) ⇔ s'(_gen_s':zero':true':false'4(x))

The following defined symbols remain to be analysed:
sum'


Proved the following rewrite lemma:
sum'(_gen_nil':cons'3(+(1, _n4978))) → _gen_nil':cons'3(1), rt ∈ Ω(1 + n4978)

Induction Base:
sum'(_gen_nil':cons'3(+(1, 0))) →RΩ(1)
cons'(zero', nil')

Induction Step:
sum'(_gen_nil':cons'3(+(1, +(_$n4979, 1)))) →RΩ(1)
sum'(cons'(plus'(zero', zero'), _gen_nil':cons'3(_$n4979))) →RΩ(1)
sum'(cons'(zero', _gen_nil':cons'3(_$n4979))) →IH
_gen_nil':cons'3(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'(plus'(x, y), l))
sum'(app'(l, cons'(x, cons'(y, k)))) → sum'(app'(l, sum'(cons'(x, cons'(y, k)))))
plus'(s'(x), s'(y)) → s'(s'(plus'(if'(gt'(x, y), x, y), if'(not'(gt'(x, y)), id'(x), id'(y)))))
plus'(s'(x), x) → plus'(if'(gt'(x, x), id'(x), id'(x)), s'(x))
plus'(zero', y) → y
plus'(id'(x), s'(y)) → s'(plus'(x, if'(gt'(s'(y), y), y, s'(y))))
id'(x) → x
if'(true', x, y) → x
if'(false', x, y) → y
not'(x) → if'(x, false', true')
gt'(s'(x), zero') → true'
gt'(zero', y) → false'
gt'(s'(x), s'(y)) → gt'(x, y)

Types:
app' :: nil':cons' → nil':cons' → nil':cons'
nil' :: nil':cons'
cons' :: s':zero':true':false' → nil':cons' → nil':cons'
sum' :: nil':cons' → nil':cons'
plus' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
s' :: s':zero':true':false' → s':zero':true':false'
if' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
gt' :: s':zero':true':false' → s':zero':true':false' → s':zero':true':false'
not' :: s':zero':true':false' → s':zero':true':false'
id' :: s':zero':true':false' → s':zero':true':false'
zero' :: s':zero':true':false'
true' :: s':zero':true':false'
false' :: s':zero':true':false'
_hole_nil':cons'1 :: nil':cons'
_hole_s':zero':true':false'2 :: s':zero':true':false'
_gen_nil':cons'3 :: Nat → nil':cons'
_gen_s':zero':true':false'4 :: Nat → s':zero':true':false'

Lemmas:
app'(_gen_nil':cons'3(_n6), _gen_nil':cons'3(b)) → _gen_nil':cons'3(+(_n6, b)), rt ∈ Ω(1 + n6)
gt'(_gen_s':zero':true':false'4(+(1, _n1185)), _gen_s':zero':true':false'4(_n1185)) → true', rt ∈ Ω(1 + n1185)
sum'(_gen_nil':cons'3(+(1, _n4978))) → _gen_nil':cons'3(1), rt ∈ Ω(1 + n4978)

Generator Equations:
_gen_nil':cons'3(0) ⇔ nil'
_gen_nil':cons'3(+(x, 1)) ⇔ cons'(zero', _gen_nil':cons'3(x))
_gen_s':zero':true':false'4(0) ⇔ zero'
_gen_s':zero':true':false'4(+(x, 1)) ⇔ s'(_gen_s':zero':true':false'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)