### (0) Obligation:

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

plus(x, y) → plusIter(x, y, 0)
plusIter(x, y, z) → ifPlus(le(x, z), x, y, z)
ifPlus(true, x, y, z) → y
ifPlus(false, x, y, z) → plusIter(x, s(y), s(z))
le(s(x), 0) → false
le(0, y) → true
le(s(x), s(y)) → le(x, y)
sum(xs) → sumIter(xs, 0)
sumIter(xs, x) → ifSum(isempty(xs), xs, x, plus(x, head(xs)))
ifSum(true, xs, x, y) → x
ifSum(false, xs, x, y) → sumIter(tail(xs), y)
isempty(nil) → true
isempty(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
ab
ac

Rewrite Strategy: FULL

### (1) DecreasingLoopProof (EQUIVALENT transformation)

The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
le(s(x), s(y)) →+ le(x, y)
gives rise to a decreasing loop by considering the right hand sides subterm at position [].
The pumping substitution is [x / s(x), y / s(y)].
The result substitution is [ ].

### (3) RenamingProof (EQUIVALENT transformation)

Renamed function symbols to avoid clashes with predefined symbol.

### (4) Obligation:

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

plus(x, y) → plusIter(x, y, 0')
plusIter(x, y, z) → ifPlus(le(x, z), x, y, z)
ifPlus(true, x, y, z) → y
ifPlus(false, x, y, z) → plusIter(x, s(y), s(z))
le(s(x), 0') → false
le(0', y) → true
le(s(x), s(y)) → le(x, y)
sum(xs) → sumIter(xs, 0')
sumIter(xs, x) → ifSum(isempty(xs), xs, x, plus(x, head(xs)))
ifSum(true, xs, x, y) → x
ifSum(false, xs, x, y) → sumIter(tail(xs), y)
isempty(nil) → true
isempty(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
ab
ac

S is empty.
Rewrite Strategy: FULL

Infered types.

### (6) Obligation:

TRS:
Rules:
plus(x, y) → plusIter(x, y, 0')
plusIter(x, y, z) → ifPlus(le(x, z), x, y, z)
ifPlus(true, x, y, z) → y
ifPlus(false, x, y, z) → plusIter(x, s(y), s(z))
le(s(x), 0') → false
le(0', y) → true
le(s(x), s(y)) → le(x, y)
sum(xs) → sumIter(xs, 0')
sumIter(xs, x) → ifSum(isempty(xs), xs, x, plus(x, head(xs)))
ifSum(true, xs, x, y) → x
ifSum(false, xs, x, y) → sumIter(tail(xs), y)
isempty(nil) → true
isempty(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
ab
ac

Types:
plus :: 0':s:error → 0':s:error → 0':s:error
plusIter :: 0':s:error → 0':s:error → 0':s:error → 0':s:error
0' :: 0':s:error
ifPlus :: true:false → 0':s:error → 0':s:error → 0':s:error → 0':s:error
le :: 0':s:error → 0':s:error → true:false
true :: true:false
false :: true:false
s :: 0':s:error → 0':s:error
sum :: nil:cons → 0':s:error
sumIter :: nil:cons → 0':s:error → 0':s:error
ifSum :: true:false → nil:cons → 0':s:error → 0':s:error → 0':s:error
isempty :: nil:cons → true:false
tail :: nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s:error → nil:cons → nil:cons
error :: 0':s:error
a :: b:c
b :: b:c
c :: b:c
hole_0':s:error1_0 :: 0':s:error
hole_true:false2_0 :: true:false
hole_nil:cons3_0 :: nil:cons
hole_b:c4_0 :: b:c
gen_0':s:error5_0 :: Nat → 0':s:error
gen_nil:cons6_0 :: Nat → nil:cons

### (7) OrderProof (LOWER BOUND(ID) transformation)

Heuristically decided to analyse the following defined symbols:
plusIter, le, sumIter

They will be analysed ascendingly in the following order:
le < plusIter

### (8) Obligation:

TRS:
Rules:
plus(x, y) → plusIter(x, y, 0')
plusIter(x, y, z) → ifPlus(le(x, z), x, y, z)
ifPlus(true, x, y, z) → y
ifPlus(false, x, y, z) → plusIter(x, s(y), s(z))
le(s(x), 0') → false
le(0', y) → true
le(s(x), s(y)) → le(x, y)
sum(xs) → sumIter(xs, 0')
sumIter(xs, x) → ifSum(isempty(xs), xs, x, plus(x, head(xs)))
ifSum(true, xs, x, y) → x
ifSum(false, xs, x, y) → sumIter(tail(xs), y)
isempty(nil) → true
isempty(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
ab
ac

Types:
plus :: 0':s:error → 0':s:error → 0':s:error
plusIter :: 0':s:error → 0':s:error → 0':s:error → 0':s:error
0' :: 0':s:error
ifPlus :: true:false → 0':s:error → 0':s:error → 0':s:error → 0':s:error
le :: 0':s:error → 0':s:error → true:false
true :: true:false
false :: true:false
s :: 0':s:error → 0':s:error
sum :: nil:cons → 0':s:error
sumIter :: nil:cons → 0':s:error → 0':s:error
ifSum :: true:false → nil:cons → 0':s:error → 0':s:error → 0':s:error
isempty :: nil:cons → true:false
tail :: nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s:error → nil:cons → nil:cons
error :: 0':s:error
a :: b:c
b :: b:c
c :: b:c
hole_0':s:error1_0 :: 0':s:error
hole_true:false2_0 :: true:false
hole_nil:cons3_0 :: nil:cons
hole_b:c4_0 :: b:c
gen_0':s:error5_0 :: Nat → 0':s:error
gen_nil:cons6_0 :: Nat → nil:cons

Generator Equations:
gen_0':s:error5_0(0) ⇔ 0'
gen_0':s:error5_0(+(x, 1)) ⇔ s(gen_0':s:error5_0(x))
gen_nil:cons6_0(0) ⇔ nil
gen_nil:cons6_0(+(x, 1)) ⇔ cons(0', gen_nil:cons6_0(x))

The following defined symbols remain to be analysed:
le, plusIter, sumIter

They will be analysed ascendingly in the following order:
le < plusIter

### (9) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
le(gen_0':s:error5_0(+(1, n8_0)), gen_0':s:error5_0(n8_0)) → false, rt ∈ Ω(1 + n80)

Induction Base:
le(gen_0':s:error5_0(+(1, 0)), gen_0':s:error5_0(0)) →RΩ(1)
false

Induction Step:
le(gen_0':s:error5_0(+(1, +(n8_0, 1))), gen_0':s:error5_0(+(n8_0, 1))) →RΩ(1)
le(gen_0':s:error5_0(+(1, n8_0)), gen_0':s:error5_0(n8_0)) →IH
false

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

### (11) Obligation:

TRS:
Rules:
plus(x, y) → plusIter(x, y, 0')
plusIter(x, y, z) → ifPlus(le(x, z), x, y, z)
ifPlus(true, x, y, z) → y
ifPlus(false, x, y, z) → plusIter(x, s(y), s(z))
le(s(x), 0') → false
le(0', y) → true
le(s(x), s(y)) → le(x, y)
sum(xs) → sumIter(xs, 0')
sumIter(xs, x) → ifSum(isempty(xs), xs, x, plus(x, head(xs)))
ifSum(true, xs, x, y) → x
ifSum(false, xs, x, y) → sumIter(tail(xs), y)
isempty(nil) → true
isempty(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
ab
ac

Types:
plus :: 0':s:error → 0':s:error → 0':s:error
plusIter :: 0':s:error → 0':s:error → 0':s:error → 0':s:error
0' :: 0':s:error
ifPlus :: true:false → 0':s:error → 0':s:error → 0':s:error → 0':s:error
le :: 0':s:error → 0':s:error → true:false
true :: true:false
false :: true:false
s :: 0':s:error → 0':s:error
sum :: nil:cons → 0':s:error
sumIter :: nil:cons → 0':s:error → 0':s:error
ifSum :: true:false → nil:cons → 0':s:error → 0':s:error → 0':s:error
isempty :: nil:cons → true:false
tail :: nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s:error → nil:cons → nil:cons
error :: 0':s:error
a :: b:c
b :: b:c
c :: b:c
hole_0':s:error1_0 :: 0':s:error
hole_true:false2_0 :: true:false
hole_nil:cons3_0 :: nil:cons
hole_b:c4_0 :: b:c
gen_0':s:error5_0 :: Nat → 0':s:error
gen_nil:cons6_0 :: Nat → nil:cons

Lemmas:
le(gen_0':s:error5_0(+(1, n8_0)), gen_0':s:error5_0(n8_0)) → false, rt ∈ Ω(1 + n80)

Generator Equations:
gen_0':s:error5_0(0) ⇔ 0'
gen_0':s:error5_0(+(x, 1)) ⇔ s(gen_0':s:error5_0(x))
gen_nil:cons6_0(0) ⇔ nil
gen_nil:cons6_0(+(x, 1)) ⇔ cons(0', gen_nil:cons6_0(x))

The following defined symbols remain to be analysed:
plusIter, sumIter

### (12) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)

Could not prove a rewrite lemma for the defined symbol plusIter.

### (13) Obligation:

TRS:
Rules:
plus(x, y) → plusIter(x, y, 0')
plusIter(x, y, z) → ifPlus(le(x, z), x, y, z)
ifPlus(true, x, y, z) → y
ifPlus(false, x, y, z) → plusIter(x, s(y), s(z))
le(s(x), 0') → false
le(0', y) → true
le(s(x), s(y)) → le(x, y)
sum(xs) → sumIter(xs, 0')
sumIter(xs, x) → ifSum(isempty(xs), xs, x, plus(x, head(xs)))
ifSum(true, xs, x, y) → x
ifSum(false, xs, x, y) → sumIter(tail(xs), y)
isempty(nil) → true
isempty(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
ab
ac

Types:
plus :: 0':s:error → 0':s:error → 0':s:error
plusIter :: 0':s:error → 0':s:error → 0':s:error → 0':s:error
0' :: 0':s:error
ifPlus :: true:false → 0':s:error → 0':s:error → 0':s:error → 0':s:error
le :: 0':s:error → 0':s:error → true:false
true :: true:false
false :: true:false
s :: 0':s:error → 0':s:error
sum :: nil:cons → 0':s:error
sumIter :: nil:cons → 0':s:error → 0':s:error
ifSum :: true:false → nil:cons → 0':s:error → 0':s:error → 0':s:error
isempty :: nil:cons → true:false
tail :: nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s:error → nil:cons → nil:cons
error :: 0':s:error
a :: b:c
b :: b:c
c :: b:c
hole_0':s:error1_0 :: 0':s:error
hole_true:false2_0 :: true:false
hole_nil:cons3_0 :: nil:cons
hole_b:c4_0 :: b:c
gen_0':s:error5_0 :: Nat → 0':s:error
gen_nil:cons6_0 :: Nat → nil:cons

Lemmas:
le(gen_0':s:error5_0(+(1, n8_0)), gen_0':s:error5_0(n8_0)) → false, rt ∈ Ω(1 + n80)

Generator Equations:
gen_0':s:error5_0(0) ⇔ 0'
gen_0':s:error5_0(+(x, 1)) ⇔ s(gen_0':s:error5_0(x))
gen_nil:cons6_0(0) ⇔ nil
gen_nil:cons6_0(+(x, 1)) ⇔ cons(0', gen_nil:cons6_0(x))

The following defined symbols remain to be analysed:
sumIter

### (14) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
sumIter(gen_nil:cons6_0(n2802_0), gen_0':s:error5_0(1)) → *7_0, rt ∈ Ω(n28020)

Induction Base:
sumIter(gen_nil:cons6_0(0), gen_0':s:error5_0(1))

Induction Step:
sumIter(gen_nil:cons6_0(+(n2802_0, 1)), gen_0':s:error5_0(1)) →RΩ(1)
ifSum(isempty(gen_nil:cons6_0(+(n2802_0, 1))), gen_nil:cons6_0(+(n2802_0, 1)), gen_0':s:error5_0(1), plus(gen_0':s:error5_0(1), head(gen_nil:cons6_0(+(n2802_0, 1))))) →RΩ(1)
ifSum(false, gen_nil:cons6_0(+(1, n2802_0)), gen_0':s:error5_0(1), plus(gen_0':s:error5_0(1), head(gen_nil:cons6_0(+(1, n2802_0))))) →RΩ(1)
ifSum(false, gen_nil:cons6_0(+(1, n2802_0)), gen_0':s:error5_0(1), plus(gen_0':s:error5_0(1), 0')) →RΩ(1)
ifSum(false, gen_nil:cons6_0(+(1, n2802_0)), gen_0':s:error5_0(1), plusIter(gen_0':s:error5_0(1), 0', 0')) →RΩ(1)
ifSum(false, gen_nil:cons6_0(+(1, n2802_0)), gen_0':s:error5_0(1), ifPlus(le(gen_0':s:error5_0(1), 0'), gen_0':s:error5_0(1), 0', 0')) →LΩ(1)
ifSum(false, gen_nil:cons6_0(+(1, n2802_0)), gen_0':s:error5_0(1), ifPlus(false, gen_0':s:error5_0(1), 0', 0')) →RΩ(1)
ifSum(false, gen_nil:cons6_0(+(1, n2802_0)), gen_0':s:error5_0(1), plusIter(gen_0':s:error5_0(1), s(0'), s(0'))) →RΩ(1)
ifSum(false, gen_nil:cons6_0(+(1, n2802_0)), gen_0':s:error5_0(1), ifPlus(le(gen_0':s:error5_0(1), s(0')), gen_0':s:error5_0(1), s(0'), s(0'))) →RΩ(1)
ifSum(false, gen_nil:cons6_0(+(1, n2802_0)), gen_0':s:error5_0(1), ifPlus(le(gen_0':s:error5_0(0), 0'), gen_0':s:error5_0(1), s(0'), s(0'))) →RΩ(1)
ifSum(false, gen_nil:cons6_0(+(1, n2802_0)), gen_0':s:error5_0(1), ifPlus(true, gen_0':s:error5_0(1), s(0'), s(0'))) →RΩ(1)
ifSum(false, gen_nil:cons6_0(+(1, n2802_0)), gen_0':s:error5_0(1), s(0')) →RΩ(1)
sumIter(tail(gen_nil:cons6_0(+(1, n2802_0))), s(0')) →RΩ(1)
sumIter(gen_nil:cons6_0(n2802_0), s(0')) →IH
*7_0

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

### (16) Obligation:

TRS:
Rules:
plus(x, y) → plusIter(x, y, 0')
plusIter(x, y, z) → ifPlus(le(x, z), x, y, z)
ifPlus(true, x, y, z) → y
ifPlus(false, x, y, z) → plusIter(x, s(y), s(z))
le(s(x), 0') → false
le(0', y) → true
le(s(x), s(y)) → le(x, y)
sum(xs) → sumIter(xs, 0')
sumIter(xs, x) → ifSum(isempty(xs), xs, x, plus(x, head(xs)))
ifSum(true, xs, x, y) → x
ifSum(false, xs, x, y) → sumIter(tail(xs), y)
isempty(nil) → true
isempty(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
ab
ac

Types:
plus :: 0':s:error → 0':s:error → 0':s:error
plusIter :: 0':s:error → 0':s:error → 0':s:error → 0':s:error
0' :: 0':s:error
ifPlus :: true:false → 0':s:error → 0':s:error → 0':s:error → 0':s:error
le :: 0':s:error → 0':s:error → true:false
true :: true:false
false :: true:false
s :: 0':s:error → 0':s:error
sum :: nil:cons → 0':s:error
sumIter :: nil:cons → 0':s:error → 0':s:error
ifSum :: true:false → nil:cons → 0':s:error → 0':s:error → 0':s:error
isempty :: nil:cons → true:false
tail :: nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s:error → nil:cons → nil:cons
error :: 0':s:error
a :: b:c
b :: b:c
c :: b:c
hole_0':s:error1_0 :: 0':s:error
hole_true:false2_0 :: true:false
hole_nil:cons3_0 :: nil:cons
hole_b:c4_0 :: b:c
gen_0':s:error5_0 :: Nat → 0':s:error
gen_nil:cons6_0 :: Nat → nil:cons

Lemmas:
le(gen_0':s:error5_0(+(1, n8_0)), gen_0':s:error5_0(n8_0)) → false, rt ∈ Ω(1 + n80)
sumIter(gen_nil:cons6_0(n2802_0), gen_0':s:error5_0(1)) → *7_0, rt ∈ Ω(n28020)

Generator Equations:
gen_0':s:error5_0(0) ⇔ 0'
gen_0':s:error5_0(+(x, 1)) ⇔ s(gen_0':s:error5_0(x))
gen_nil:cons6_0(0) ⇔ nil
gen_nil:cons6_0(+(x, 1)) ⇔ cons(0', gen_nil:cons6_0(x))

No more defined symbols left to analyse.

### (17) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
le(gen_0':s:error5_0(+(1, n8_0)), gen_0':s:error5_0(n8_0)) → false, rt ∈ Ω(1 + n80)

### (19) Obligation:

TRS:
Rules:
plus(x, y) → plusIter(x, y, 0')
plusIter(x, y, z) → ifPlus(le(x, z), x, y, z)
ifPlus(true, x, y, z) → y
ifPlus(false, x, y, z) → plusIter(x, s(y), s(z))
le(s(x), 0') → false
le(0', y) → true
le(s(x), s(y)) → le(x, y)
sum(xs) → sumIter(xs, 0')
sumIter(xs, x) → ifSum(isempty(xs), xs, x, plus(x, head(xs)))
ifSum(true, xs, x, y) → x
ifSum(false, xs, x, y) → sumIter(tail(xs), y)
isempty(nil) → true
isempty(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
ab
ac

Types:
plus :: 0':s:error → 0':s:error → 0':s:error
plusIter :: 0':s:error → 0':s:error → 0':s:error → 0':s:error
0' :: 0':s:error
ifPlus :: true:false → 0':s:error → 0':s:error → 0':s:error → 0':s:error
le :: 0':s:error → 0':s:error → true:false
true :: true:false
false :: true:false
s :: 0':s:error → 0':s:error
sum :: nil:cons → 0':s:error
sumIter :: nil:cons → 0':s:error → 0':s:error
ifSum :: true:false → nil:cons → 0':s:error → 0':s:error → 0':s:error
isempty :: nil:cons → true:false
tail :: nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s:error → nil:cons → nil:cons
error :: 0':s:error
a :: b:c
b :: b:c
c :: b:c
hole_0':s:error1_0 :: 0':s:error
hole_true:false2_0 :: true:false
hole_nil:cons3_0 :: nil:cons
hole_b:c4_0 :: b:c
gen_0':s:error5_0 :: Nat → 0':s:error
gen_nil:cons6_0 :: Nat → nil:cons

Lemmas:
le(gen_0':s:error5_0(+(1, n8_0)), gen_0':s:error5_0(n8_0)) → false, rt ∈ Ω(1 + n80)
sumIter(gen_nil:cons6_0(n2802_0), gen_0':s:error5_0(1)) → *7_0, rt ∈ Ω(n28020)

Generator Equations:
gen_0':s:error5_0(0) ⇔ 0'
gen_0':s:error5_0(+(x, 1)) ⇔ s(gen_0':s:error5_0(x))
gen_nil:cons6_0(0) ⇔ nil
gen_nil:cons6_0(+(x, 1)) ⇔ cons(0', gen_nil:cons6_0(x))

No more defined symbols left to analyse.

### (20) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
le(gen_0':s:error5_0(+(1, n8_0)), gen_0':s:error5_0(n8_0)) → false, rt ∈ Ω(1 + n80)

### (22) Obligation:

TRS:
Rules:
plus(x, y) → plusIter(x, y, 0')
plusIter(x, y, z) → ifPlus(le(x, z), x, y, z)
ifPlus(true, x, y, z) → y
ifPlus(false, x, y, z) → plusIter(x, s(y), s(z))
le(s(x), 0') → false
le(0', y) → true
le(s(x), s(y)) → le(x, y)
sum(xs) → sumIter(xs, 0')
sumIter(xs, x) → ifSum(isempty(xs), xs, x, plus(x, head(xs)))
ifSum(true, xs, x, y) → x
ifSum(false, xs, x, y) → sumIter(tail(xs), y)
isempty(nil) → true
isempty(cons(x, xs)) → false
tail(nil) → nil
tail(cons(x, xs)) → xs
ab
ac

Types:
plus :: 0':s:error → 0':s:error → 0':s:error
plusIter :: 0':s:error → 0':s:error → 0':s:error → 0':s:error
0' :: 0':s:error
ifPlus :: true:false → 0':s:error → 0':s:error → 0':s:error → 0':s:error
le :: 0':s:error → 0':s:error → true:false
true :: true:false
false :: true:false
s :: 0':s:error → 0':s:error
sum :: nil:cons → 0':s:error
sumIter :: nil:cons → 0':s:error → 0':s:error
ifSum :: true:false → nil:cons → 0':s:error → 0':s:error → 0':s:error
isempty :: nil:cons → true:false
tail :: nil:cons → nil:cons
nil :: nil:cons
cons :: 0':s:error → nil:cons → nil:cons
error :: 0':s:error
a :: b:c
b :: b:c
c :: b:c
hole_0':s:error1_0 :: 0':s:error
hole_true:false2_0 :: true:false
hole_nil:cons3_0 :: nil:cons
hole_b:c4_0 :: b:c
gen_0':s:error5_0 :: Nat → 0':s:error
gen_nil:cons6_0 :: Nat → nil:cons

Lemmas:
le(gen_0':s:error5_0(+(1, n8_0)), gen_0':s:error5_0(n8_0)) → false, rt ∈ Ω(1 + n80)

Generator Equations:
gen_0':s:error5_0(0) ⇔ 0'
gen_0':s:error5_0(+(x, 1)) ⇔ s(gen_0':s:error5_0(x))
gen_nil:cons6_0(0) ⇔ nil
gen_nil:cons6_0(+(x, 1)) ⇔ cons(0', gen_nil:cons6_0(x))

No more defined symbols left to analyse.

### (23) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
le(gen_0':s:error5_0(+(1, n8_0)), gen_0':s:error5_0(n8_0)) → false, rt ∈ Ω(1 + n80)