Runtime Complexity TRS:
The TRS R consists of the following rules:
app(x, y) → helpa(0, plus(length(x), length(y)), x, y)
plus(x, 0) → x
plus(x, s(y)) → s(plus(x, y))
length(nil) → 0
length(cons(x, y)) → s(length(y))
helpa(c, l, ys, zs) → if(ge(c, l), c, l, ys, zs)
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
if(true, c, l, ys, zs) → nil
if(false, c, l, ys, zs) → helpb(c, l, ys, zs)
take(0, cons(x, xs), ys) → x
take(0, nil, cons(y, ys)) → y
take(s(c), cons(x, xs), ys) → take(c, xs, ys)
take(s(c), nil, cons(y, ys)) → take(c, nil, ys)
helpb(c, l, ys, zs) → cons(take(c, ys, zs), helpa(s(c), l, ys, zs))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
app'(x, y) → helpa'(0', plus'(length'(x), length'(y)), x, y)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))
length'(nil') → 0'
length'(cons'(x, y)) → s'(length'(y))
helpa'(c, l, ys, zs) → if'(ge'(c, l), c, l, ys, zs)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
if'(true', c, l, ys, zs) → nil'
if'(false', c, l, ys, zs) → helpb'(c, l, ys, zs)
take'(0', cons'(x, xs'), ys) → x
take'(0', nil', cons'(y, ys)) → y
take'(s'(c), cons'(x, xs'), ys) → take'(c, xs', ys)
take'(s'(c), nil', cons'(y, ys)) → take'(c, nil', ys)
helpb'(c, l, ys, zs) → cons'(take'(c, ys, zs), helpa'(s'(c), l, ys, zs))
Infered types.
Rules:
app'(x, y) → helpa'(0', plus'(length'(x), length'(y)), x, y)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))
length'(nil') → 0'
length'(cons'(x, y)) → s'(length'(y))
helpa'(c, l, ys, zs) → if'(ge'(c, l), c, l, ys, zs)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
if'(true', c, l, ys, zs) → nil'
if'(false', c, l, ys, zs) → helpb'(c, l, ys, zs)
take'(0', cons'(x, xs'), ys) → x
take'(0', nil', cons'(y, ys)) → y
take'(s'(c), cons'(x, xs'), ys) → take'(c, xs', ys)
take'(s'(c), nil', cons'(y, ys)) → take'(c, nil', ys)
helpb'(c, l, ys, zs) → cons'(take'(c, ys, zs), helpa'(s'(c), l, ys, zs))
Types:
app' :: nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
helpa' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
0' :: 0':s'
plus' :: 0':s' → 0':s' → 0':s'
length' :: nil':cons':xs' → 0':s'
s' :: 0':s' → 0':s'
nil' :: nil':cons':xs'
cons' :: take' → nil':cons':xs' → nil':cons':xs'
if' :: true':false' → 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
helpb' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
take' :: 0':s' → nil':cons':xs' → nil':cons':xs' → take'
xs' :: nil':cons':xs'
_hole_nil':cons':xs'1 :: nil':cons':xs'
_hole_0':s'2 :: 0':s'
_hole_take'3 :: take'
_hole_true':false'4 :: true':false'
_gen_nil':cons':xs'5 :: Nat → nil':cons':xs'
_gen_0':s'6 :: Nat → 0':s'
Heuristically decided to analyse the following defined symbols:
helpa', plus', length', ge', helpb', take'
They will be analysed ascendingly in the following order:
ge' < helpa'
helpa' = helpb'
take' < helpb'
Rules:
app'(x, y) → helpa'(0', plus'(length'(x), length'(y)), x, y)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))
length'(nil') → 0'
length'(cons'(x, y)) → s'(length'(y))
helpa'(c, l, ys, zs) → if'(ge'(c, l), c, l, ys, zs)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
if'(true', c, l, ys, zs) → nil'
if'(false', c, l, ys, zs) → helpb'(c, l, ys, zs)
take'(0', cons'(x, xs'), ys) → x
take'(0', nil', cons'(y, ys)) → y
take'(s'(c), cons'(x, xs'), ys) → take'(c, xs', ys)
take'(s'(c), nil', cons'(y, ys)) → take'(c, nil', ys)
helpb'(c, l, ys, zs) → cons'(take'(c, ys, zs), helpa'(s'(c), l, ys, zs))
Types:
app' :: nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
helpa' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
0' :: 0':s'
plus' :: 0':s' → 0':s' → 0':s'
length' :: nil':cons':xs' → 0':s'
s' :: 0':s' → 0':s'
nil' :: nil':cons':xs'
cons' :: take' → nil':cons':xs' → nil':cons':xs'
if' :: true':false' → 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
helpb' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
take' :: 0':s' → nil':cons':xs' → nil':cons':xs' → take'
xs' :: nil':cons':xs'
_hole_nil':cons':xs'1 :: nil':cons':xs'
_hole_0':s'2 :: 0':s'
_hole_take'3 :: take'
_hole_true':false'4 :: true':false'
_gen_nil':cons':xs'5 :: Nat → nil':cons':xs'
_gen_0':s'6 :: Nat → 0':s'
Generator Equations:
_gen_nil':cons':xs'5(0) ⇔ nil'
_gen_nil':cons':xs'5(+(x, 1)) ⇔ cons'(_hole_take'3, _gen_nil':cons':xs'5(x))
_gen_0':s'6(0) ⇔ 0'
_gen_0':s'6(+(x, 1)) ⇔ s'(_gen_0':s'6(x))
The following defined symbols remain to be analysed:
plus', helpa', length', ge', helpb', take'
They will be analysed ascendingly in the following order:
ge' < helpa'
helpa' = helpb'
take' < helpb'
Proved the following rewrite lemma:
plus'(_gen_0':s'6(a), _gen_0':s'6(_n8)) → _gen_0':s'6(+(_n8, a)), rt ∈ Ω(1 + n8)
Induction Base:
plus'(_gen_0':s'6(a), _gen_0':s'6(0)) →RΩ(1)
_gen_0':s'6(a)
Induction Step:
plus'(_gen_0':s'6(_a231), _gen_0':s'6(+(_$n9, 1))) →RΩ(1)
s'(plus'(_gen_0':s'6(_a231), _gen_0':s'6(_$n9))) →IH
s'(_gen_0':s'6(+(_$n9, _a231)))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
app'(x, y) → helpa'(0', plus'(length'(x), length'(y)), x, y)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))
length'(nil') → 0'
length'(cons'(x, y)) → s'(length'(y))
helpa'(c, l, ys, zs) → if'(ge'(c, l), c, l, ys, zs)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
if'(true', c, l, ys, zs) → nil'
if'(false', c, l, ys, zs) → helpb'(c, l, ys, zs)
take'(0', cons'(x, xs'), ys) → x
take'(0', nil', cons'(y, ys)) → y
take'(s'(c), cons'(x, xs'), ys) → take'(c, xs', ys)
take'(s'(c), nil', cons'(y, ys)) → take'(c, nil', ys)
helpb'(c, l, ys, zs) → cons'(take'(c, ys, zs), helpa'(s'(c), l, ys, zs))
Types:
app' :: nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
helpa' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
0' :: 0':s'
plus' :: 0':s' → 0':s' → 0':s'
length' :: nil':cons':xs' → 0':s'
s' :: 0':s' → 0':s'
nil' :: nil':cons':xs'
cons' :: take' → nil':cons':xs' → nil':cons':xs'
if' :: true':false' → 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
helpb' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
take' :: 0':s' → nil':cons':xs' → nil':cons':xs' → take'
xs' :: nil':cons':xs'
_hole_nil':cons':xs'1 :: nil':cons':xs'
_hole_0':s'2 :: 0':s'
_hole_take'3 :: take'
_hole_true':false'4 :: true':false'
_gen_nil':cons':xs'5 :: Nat → nil':cons':xs'
_gen_0':s'6 :: Nat → 0':s'
Lemmas:
plus'(_gen_0':s'6(a), _gen_0':s'6(_n8)) → _gen_0':s'6(+(_n8, a)), rt ∈ Ω(1 + n8)
Generator Equations:
_gen_nil':cons':xs'5(0) ⇔ nil'
_gen_nil':cons':xs'5(+(x, 1)) ⇔ cons'(_hole_take'3, _gen_nil':cons':xs'5(x))
_gen_0':s'6(0) ⇔ 0'
_gen_0':s'6(+(x, 1)) ⇔ s'(_gen_0':s'6(x))
The following defined symbols remain to be analysed:
length', helpa', ge', helpb', take'
They will be analysed ascendingly in the following order:
ge' < helpa'
helpa' = helpb'
take' < helpb'
Proved the following rewrite lemma:
length'(_gen_nil':cons':xs'5(_n1309)) → _gen_0':s'6(_n1309), rt ∈ Ω(1 + n1309)
Induction Base:
length'(_gen_nil':cons':xs'5(0)) →RΩ(1)
0'
Induction Step:
length'(_gen_nil':cons':xs'5(+(_$n1310, 1))) →RΩ(1)
s'(length'(_gen_nil':cons':xs'5(_$n1310))) →IH
s'(_gen_0':s'6(_$n1310))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
app'(x, y) → helpa'(0', plus'(length'(x), length'(y)), x, y)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))
length'(nil') → 0'
length'(cons'(x, y)) → s'(length'(y))
helpa'(c, l, ys, zs) → if'(ge'(c, l), c, l, ys, zs)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
if'(true', c, l, ys, zs) → nil'
if'(false', c, l, ys, zs) → helpb'(c, l, ys, zs)
take'(0', cons'(x, xs'), ys) → x
take'(0', nil', cons'(y, ys)) → y
take'(s'(c), cons'(x, xs'), ys) → take'(c, xs', ys)
take'(s'(c), nil', cons'(y, ys)) → take'(c, nil', ys)
helpb'(c, l, ys, zs) → cons'(take'(c, ys, zs), helpa'(s'(c), l, ys, zs))
Types:
app' :: nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
helpa' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
0' :: 0':s'
plus' :: 0':s' → 0':s' → 0':s'
length' :: nil':cons':xs' → 0':s'
s' :: 0':s' → 0':s'
nil' :: nil':cons':xs'
cons' :: take' → nil':cons':xs' → nil':cons':xs'
if' :: true':false' → 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
helpb' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
take' :: 0':s' → nil':cons':xs' → nil':cons':xs' → take'
xs' :: nil':cons':xs'
_hole_nil':cons':xs'1 :: nil':cons':xs'
_hole_0':s'2 :: 0':s'
_hole_take'3 :: take'
_hole_true':false'4 :: true':false'
_gen_nil':cons':xs'5 :: Nat → nil':cons':xs'
_gen_0':s'6 :: Nat → 0':s'
Lemmas:
plus'(_gen_0':s'6(a), _gen_0':s'6(_n8)) → _gen_0':s'6(+(_n8, a)), rt ∈ Ω(1 + n8)
length'(_gen_nil':cons':xs'5(_n1309)) → _gen_0':s'6(_n1309), rt ∈ Ω(1 + n1309)
Generator Equations:
_gen_nil':cons':xs'5(0) ⇔ nil'
_gen_nil':cons':xs'5(+(x, 1)) ⇔ cons'(_hole_take'3, _gen_nil':cons':xs'5(x))
_gen_0':s'6(0) ⇔ 0'
_gen_0':s'6(+(x, 1)) ⇔ s'(_gen_0':s'6(x))
The following defined symbols remain to be analysed:
ge', helpa', helpb', take'
They will be analysed ascendingly in the following order:
ge' < helpa'
helpa' = helpb'
take' < helpb'
Proved the following rewrite lemma:
ge'(_gen_0':s'6(_n2098), _gen_0':s'6(_n2098)) → true', rt ∈ Ω(1 + n2098)
Induction Base:
ge'(_gen_0':s'6(0), _gen_0':s'6(0)) →RΩ(1)
true'
Induction Step:
ge'(_gen_0':s'6(+(_$n2099, 1)), _gen_0':s'6(+(_$n2099, 1))) →RΩ(1)
ge'(_gen_0':s'6(_$n2099), _gen_0':s'6(_$n2099)) →IH
true'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
app'(x, y) → helpa'(0', plus'(length'(x), length'(y)), x, y)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))
length'(nil') → 0'
length'(cons'(x, y)) → s'(length'(y))
helpa'(c, l, ys, zs) → if'(ge'(c, l), c, l, ys, zs)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
if'(true', c, l, ys, zs) → nil'
if'(false', c, l, ys, zs) → helpb'(c, l, ys, zs)
take'(0', cons'(x, xs'), ys) → x
take'(0', nil', cons'(y, ys)) → y
take'(s'(c), cons'(x, xs'), ys) → take'(c, xs', ys)
take'(s'(c), nil', cons'(y, ys)) → take'(c, nil', ys)
helpb'(c, l, ys, zs) → cons'(take'(c, ys, zs), helpa'(s'(c), l, ys, zs))
Types:
app' :: nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
helpa' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
0' :: 0':s'
plus' :: 0':s' → 0':s' → 0':s'
length' :: nil':cons':xs' → 0':s'
s' :: 0':s' → 0':s'
nil' :: nil':cons':xs'
cons' :: take' → nil':cons':xs' → nil':cons':xs'
if' :: true':false' → 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
helpb' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
take' :: 0':s' → nil':cons':xs' → nil':cons':xs' → take'
xs' :: nil':cons':xs'
_hole_nil':cons':xs'1 :: nil':cons':xs'
_hole_0':s'2 :: 0':s'
_hole_take'3 :: take'
_hole_true':false'4 :: true':false'
_gen_nil':cons':xs'5 :: Nat → nil':cons':xs'
_gen_0':s'6 :: Nat → 0':s'
Lemmas:
plus'(_gen_0':s'6(a), _gen_0':s'6(_n8)) → _gen_0':s'6(+(_n8, a)), rt ∈ Ω(1 + n8)
length'(_gen_nil':cons':xs'5(_n1309)) → _gen_0':s'6(_n1309), rt ∈ Ω(1 + n1309)
ge'(_gen_0':s'6(_n2098), _gen_0':s'6(_n2098)) → true', rt ∈ Ω(1 + n2098)
Generator Equations:
_gen_nil':cons':xs'5(0) ⇔ nil'
_gen_nil':cons':xs'5(+(x, 1)) ⇔ cons'(_hole_take'3, _gen_nil':cons':xs'5(x))
_gen_0':s'6(0) ⇔ 0'
_gen_0':s'6(+(x, 1)) ⇔ s'(_gen_0':s'6(x))
The following defined symbols remain to be analysed:
take', helpa', helpb'
They will be analysed ascendingly in the following order:
helpa' = helpb'
take' < helpb'
Proved the following rewrite lemma:
take'(_gen_0':s'6(_n3185), _gen_nil':cons':xs'5(0), _gen_nil':cons':xs'5(+(1, _n3185))) → _hole_take'3, rt ∈ Ω(1 + n3185)
Induction Base:
take'(_gen_0':s'6(0), _gen_nil':cons':xs'5(0), _gen_nil':cons':xs'5(+(1, 0))) →RΩ(1)
_hole_take'3
Induction Step:
take'(_gen_0':s'6(+(_$n3186, 1)), _gen_nil':cons':xs'5(0), _gen_nil':cons':xs'5(+(1, +(_$n3186, 1)))) →RΩ(1)
take'(_gen_0':s'6(_$n3186), nil', _gen_nil':cons':xs'5(+(1, _$n3186))) →IH
_hole_take'3
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
app'(x, y) → helpa'(0', plus'(length'(x), length'(y)), x, y)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))
length'(nil') → 0'
length'(cons'(x, y)) → s'(length'(y))
helpa'(c, l, ys, zs) → if'(ge'(c, l), c, l, ys, zs)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
if'(true', c, l, ys, zs) → nil'
if'(false', c, l, ys, zs) → helpb'(c, l, ys, zs)
take'(0', cons'(x, xs'), ys) → x
take'(0', nil', cons'(y, ys)) → y
take'(s'(c), cons'(x, xs'), ys) → take'(c, xs', ys)
take'(s'(c), nil', cons'(y, ys)) → take'(c, nil', ys)
helpb'(c, l, ys, zs) → cons'(take'(c, ys, zs), helpa'(s'(c), l, ys, zs))
Types:
app' :: nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
helpa' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
0' :: 0':s'
plus' :: 0':s' → 0':s' → 0':s'
length' :: nil':cons':xs' → 0':s'
s' :: 0':s' → 0':s'
nil' :: nil':cons':xs'
cons' :: take' → nil':cons':xs' → nil':cons':xs'
if' :: true':false' → 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
helpb' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
take' :: 0':s' → nil':cons':xs' → nil':cons':xs' → take'
xs' :: nil':cons':xs'
_hole_nil':cons':xs'1 :: nil':cons':xs'
_hole_0':s'2 :: 0':s'
_hole_take'3 :: take'
_hole_true':false'4 :: true':false'
_gen_nil':cons':xs'5 :: Nat → nil':cons':xs'
_gen_0':s'6 :: Nat → 0':s'
Lemmas:
plus'(_gen_0':s'6(a), _gen_0':s'6(_n8)) → _gen_0':s'6(+(_n8, a)), rt ∈ Ω(1 + n8)
length'(_gen_nil':cons':xs'5(_n1309)) → _gen_0':s'6(_n1309), rt ∈ Ω(1 + n1309)
ge'(_gen_0':s'6(_n2098), _gen_0':s'6(_n2098)) → true', rt ∈ Ω(1 + n2098)
take'(_gen_0':s'6(_n3185), _gen_nil':cons':xs'5(0), _gen_nil':cons':xs'5(+(1, _n3185))) → _hole_take'3, rt ∈ Ω(1 + n3185)
Generator Equations:
_gen_nil':cons':xs'5(0) ⇔ nil'
_gen_nil':cons':xs'5(+(x, 1)) ⇔ cons'(_hole_take'3, _gen_nil':cons':xs'5(x))
_gen_0':s'6(0) ⇔ 0'
_gen_0':s'6(+(x, 1)) ⇔ s'(_gen_0':s'6(x))
The following defined symbols remain to be analysed:
helpb', helpa'
They will be analysed ascendingly in the following order:
helpa' = helpb'
Could not prove a rewrite lemma for the defined symbol helpb'.
Rules:
app'(x, y) → helpa'(0', plus'(length'(x), length'(y)), x, y)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))
length'(nil') → 0'
length'(cons'(x, y)) → s'(length'(y))
helpa'(c, l, ys, zs) → if'(ge'(c, l), c, l, ys, zs)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
if'(true', c, l, ys, zs) → nil'
if'(false', c, l, ys, zs) → helpb'(c, l, ys, zs)
take'(0', cons'(x, xs'), ys) → x
take'(0', nil', cons'(y, ys)) → y
take'(s'(c), cons'(x, xs'), ys) → take'(c, xs', ys)
take'(s'(c), nil', cons'(y, ys)) → take'(c, nil', ys)
helpb'(c, l, ys, zs) → cons'(take'(c, ys, zs), helpa'(s'(c), l, ys, zs))
Types:
app' :: nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
helpa' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
0' :: 0':s'
plus' :: 0':s' → 0':s' → 0':s'
length' :: nil':cons':xs' → 0':s'
s' :: 0':s' → 0':s'
nil' :: nil':cons':xs'
cons' :: take' → nil':cons':xs' → nil':cons':xs'
if' :: true':false' → 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
helpb' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
take' :: 0':s' → nil':cons':xs' → nil':cons':xs' → take'
xs' :: nil':cons':xs'
_hole_nil':cons':xs'1 :: nil':cons':xs'
_hole_0':s'2 :: 0':s'
_hole_take'3 :: take'
_hole_true':false'4 :: true':false'
_gen_nil':cons':xs'5 :: Nat → nil':cons':xs'
_gen_0':s'6 :: Nat → 0':s'
Lemmas:
plus'(_gen_0':s'6(a), _gen_0':s'6(_n8)) → _gen_0':s'6(+(_n8, a)), rt ∈ Ω(1 + n8)
length'(_gen_nil':cons':xs'5(_n1309)) → _gen_0':s'6(_n1309), rt ∈ Ω(1 + n1309)
ge'(_gen_0':s'6(_n2098), _gen_0':s'6(_n2098)) → true', rt ∈ Ω(1 + n2098)
take'(_gen_0':s'6(_n3185), _gen_nil':cons':xs'5(0), _gen_nil':cons':xs'5(+(1, _n3185))) → _hole_take'3, rt ∈ Ω(1 + n3185)
Generator Equations:
_gen_nil':cons':xs'5(0) ⇔ nil'
_gen_nil':cons':xs'5(+(x, 1)) ⇔ cons'(_hole_take'3, _gen_nil':cons':xs'5(x))
_gen_0':s'6(0) ⇔ 0'
_gen_0':s'6(+(x, 1)) ⇔ s'(_gen_0':s'6(x))
The following defined symbols remain to be analysed:
helpa'
They will be analysed ascendingly in the following order:
helpa' = helpb'
Could not prove a rewrite lemma for the defined symbol helpa'.
Rules:
app'(x, y) → helpa'(0', plus'(length'(x), length'(y)), x, y)
plus'(x, 0') → x
plus'(x, s'(y)) → s'(plus'(x, y))
length'(nil') → 0'
length'(cons'(x, y)) → s'(length'(y))
helpa'(c, l, ys, zs) → if'(ge'(c, l), c, l, ys, zs)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
if'(true', c, l, ys, zs) → nil'
if'(false', c, l, ys, zs) → helpb'(c, l, ys, zs)
take'(0', cons'(x, xs'), ys) → x
take'(0', nil', cons'(y, ys)) → y
take'(s'(c), cons'(x, xs'), ys) → take'(c, xs', ys)
take'(s'(c), nil', cons'(y, ys)) → take'(c, nil', ys)
helpb'(c, l, ys, zs) → cons'(take'(c, ys, zs), helpa'(s'(c), l, ys, zs))
Types:
app' :: nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
helpa' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
0' :: 0':s'
plus' :: 0':s' → 0':s' → 0':s'
length' :: nil':cons':xs' → 0':s'
s' :: 0':s' → 0':s'
nil' :: nil':cons':xs'
cons' :: take' → nil':cons':xs' → nil':cons':xs'
if' :: true':false' → 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
ge' :: 0':s' → 0':s' → true':false'
true' :: true':false'
false' :: true':false'
helpb' :: 0':s' → 0':s' → nil':cons':xs' → nil':cons':xs' → nil':cons':xs'
take' :: 0':s' → nil':cons':xs' → nil':cons':xs' → take'
xs' :: nil':cons':xs'
_hole_nil':cons':xs'1 :: nil':cons':xs'
_hole_0':s'2 :: 0':s'
_hole_take'3 :: take'
_hole_true':false'4 :: true':false'
_gen_nil':cons':xs'5 :: Nat → nil':cons':xs'
_gen_0':s'6 :: Nat → 0':s'
Lemmas:
plus'(_gen_0':s'6(a), _gen_0':s'6(_n8)) → _gen_0':s'6(+(_n8, a)), rt ∈ Ω(1 + n8)
length'(_gen_nil':cons':xs'5(_n1309)) → _gen_0':s'6(_n1309), rt ∈ Ω(1 + n1309)
ge'(_gen_0':s'6(_n2098), _gen_0':s'6(_n2098)) → true', rt ∈ Ω(1 + n2098)
take'(_gen_0':s'6(_n3185), _gen_nil':cons':xs'5(0), _gen_nil':cons':xs'5(+(1, _n3185))) → _hole_take'3, rt ∈ Ω(1 + n3185)
Generator Equations:
_gen_nil':cons':xs'5(0) ⇔ nil'
_gen_nil':cons':xs'5(+(x, 1)) ⇔ cons'(_hole_take'3, _gen_nil':cons':xs'5(x))
_gen_0':s'6(0) ⇔ 0'
_gen_0':s'6(+(x, 1)) ⇔ s'(_gen_0':s'6(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
plus'(_gen_0':s'6(a), _gen_0':s'6(_n8)) → _gen_0':s'6(+(_n8, a)), rt ∈ Ω(1 + n8)