Runtime Complexity TRS:
The TRS R consists of the following rules:
f(node(s(n), xs)) → f(addchild(select(xs), node(n, xs)))
select(cons(ap, xs)) → ap
select(cons(ap, xs)) → select(xs)
addchild(node(y, ys), node(n, xs)) → node(y, cons(node(n, xs), ys))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
f'(node'(s'(n), xs)) → f'(addchild'(select'(xs), node'(n, xs)))
select'(cons'(ap, xs)) → ap
select'(cons'(ap, xs)) → select'(xs)
addchild'(node'(y, ys), node'(n, xs)) → node'(y, cons'(node'(n, xs), ys))
Infered types.
Rules:
f'(node'(s'(n), xs)) → f'(addchild'(select'(xs), node'(n, xs)))
select'(cons'(ap, xs)) → ap
select'(cons'(ap, xs)) → select'(xs)
addchild'(node'(y, ys), node'(n, xs)) → node'(y, cons'(node'(n, xs), ys))
Types:
f' :: node' → f'
node' :: s' → cons' → node'
s' :: s' → s'
addchild' :: node' → node' → node'
select' :: cons' → node'
cons' :: node' → cons' → cons'
_hole_f'1 :: f'
_hole_node'2 :: node'
_hole_s'3 :: s'
_hole_cons'4 :: cons'
_gen_s'5 :: Nat → s'
_gen_cons'6 :: Nat → cons'
Heuristically decided to analyse the following defined symbols:
f', select'
They will be analysed ascendingly in the following order:
select' < f'
Rules:
f'(node'(s'(n), xs)) → f'(addchild'(select'(xs), node'(n, xs)))
select'(cons'(ap, xs)) → ap
select'(cons'(ap, xs)) → select'(xs)
addchild'(node'(y, ys), node'(n, xs)) → node'(y, cons'(node'(n, xs), ys))
Types:
f' :: node' → f'
node' :: s' → cons' → node'
s' :: s' → s'
addchild' :: node' → node' → node'
select' :: cons' → node'
cons' :: node' → cons' → cons'
_hole_f'1 :: f'
_hole_node'2 :: node'
_hole_s'3 :: s'
_hole_cons'4 :: cons'
_gen_s'5 :: Nat → s'
_gen_cons'6 :: Nat → cons'
Generator Equations:
_gen_s'5(0) ⇔ _hole_s'3
_gen_s'5(+(x, 1)) ⇔ s'(_gen_s'5(x))
_gen_cons'6(0) ⇔ _hole_cons'4
_gen_cons'6(+(x, 1)) ⇔ cons'(node'(_hole_s'3, _hole_cons'4), _gen_cons'6(x))
The following defined symbols remain to be analysed:
select', f'
They will be analysed ascendingly in the following order:
select' < f'
Proved the following rewrite lemma:
select'(_gen_cons'6(+(1, _n8))) → _*7, rt ∈ Ω(n8)
Induction Base:
select'(_gen_cons'6(+(1, 0)))
Induction Step:
select'(_gen_cons'6(+(1, +(_$n9, 1)))) →RΩ(1)
select'(_gen_cons'6(+(1, _$n9))) →IH
_*7
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
f'(node'(s'(n), xs)) → f'(addchild'(select'(xs), node'(n, xs)))
select'(cons'(ap, xs)) → ap
select'(cons'(ap, xs)) → select'(xs)
addchild'(node'(y, ys), node'(n, xs)) → node'(y, cons'(node'(n, xs), ys))
Types:
f' :: node' → f'
node' :: s' → cons' → node'
s' :: s' → s'
addchild' :: node' → node' → node'
select' :: cons' → node'
cons' :: node' → cons' → cons'
_hole_f'1 :: f'
_hole_node'2 :: node'
_hole_s'3 :: s'
_hole_cons'4 :: cons'
_gen_s'5 :: Nat → s'
_gen_cons'6 :: Nat → cons'
Lemmas:
select'(_gen_cons'6(+(1, _n8))) → _*7, rt ∈ Ω(n8)
Generator Equations:
_gen_s'5(0) ⇔ _hole_s'3
_gen_s'5(+(x, 1)) ⇔ s'(_gen_s'5(x))
_gen_cons'6(0) ⇔ _hole_cons'4
_gen_cons'6(+(x, 1)) ⇔ cons'(node'(_hole_s'3, _hole_cons'4), _gen_cons'6(x))
The following defined symbols remain to be analysed:
f'
Could not prove a rewrite lemma for the defined symbol f'.
Rules:
f'(node'(s'(n), xs)) → f'(addchild'(select'(xs), node'(n, xs)))
select'(cons'(ap, xs)) → ap
select'(cons'(ap, xs)) → select'(xs)
addchild'(node'(y, ys), node'(n, xs)) → node'(y, cons'(node'(n, xs), ys))
Types:
f' :: node' → f'
node' :: s' → cons' → node'
s' :: s' → s'
addchild' :: node' → node' → node'
select' :: cons' → node'
cons' :: node' → cons' → cons'
_hole_f'1 :: f'
_hole_node'2 :: node'
_hole_s'3 :: s'
_hole_cons'4 :: cons'
_gen_s'5 :: Nat → s'
_gen_cons'6 :: Nat → cons'
Lemmas:
select'(_gen_cons'6(+(1, _n8))) → _*7, rt ∈ Ω(n8)
Generator Equations:
_gen_s'5(0) ⇔ _hole_s'3
_gen_s'5(+(x, 1)) ⇔ s'(_gen_s'5(x))
_gen_cons'6(0) ⇔ _hole_cons'4
_gen_cons'6(+(x, 1)) ⇔ cons'(node'(_hole_s'3, _hole_cons'4), _gen_cons'6(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
select'(_gen_cons'6(+(1, _n8))) → _*7, rt ∈ Ω(n8)