(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
lt(0, s(x)) → true
lt(x, 0) → false
lt(s(x), s(y)) → lt(x, y)
fibo(0) → fib(0)
fibo(s(0)) → fib(s(0))
fibo(s(s(x))) → sum(fibo(s(x)), fibo(x))
fib(0) → s(0)
fib(s(0)) → s(0)
fib(s(s(x))) → if(true, 0, s(s(x)), 0, 0)
if(true, c, s(s(x)), a, b) → if(lt(s(c), s(s(x))), s(c), s(s(x)), b, c)
if(false, c, s(s(x)), a, b) → sum(fibo(a), fibo(b))
sum(x, 0) → x
sum(x, s(y)) → s(sum(x, y))
Rewrite Strategy: FULL
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(2n):
The rewrite sequence
fibo(s(s(x))) →+ sum(fibo(s(x)), fibo(x))
gives rise to a decreasing loop by considering the right hand sides subterm at position [0].
The pumping substitution is [x / s(x)].
The result substitution is [ ].
The rewrite sequence
fibo(s(s(x))) →+ sum(fibo(s(x)), fibo(x))
gives rise to a decreasing loop by considering the right hand sides subterm at position [1].
The pumping substitution is [x / s(s(x))].
The result substitution is [ ].
(2) BOUNDS(2^n, INF)
(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:
lt(0', s(x)) → true
lt(x, 0') → false
lt(s(x), s(y)) → lt(x, y)
fibo(0') → fib(0')
fibo(s(0')) → fib(s(0'))
fibo(s(s(x))) → sum(fibo(s(x)), fibo(x))
fib(0') → s(0')
fib(s(0')) → s(0')
fib(s(s(x))) → if(true, 0', s(s(x)), 0', 0')
if(true, c, s(s(x)), a, b) → if(lt(s(c), s(s(x))), s(c), s(s(x)), b, c)
if(false, c, s(s(x)), a, b) → sum(fibo(a), fibo(b))
sum(x, 0') → x
sum(x, s(y)) → s(sum(x, y))
S is empty.
Rewrite Strategy: FULL
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
Rules:
lt(0', s(x)) → true
lt(x, 0') → false
lt(s(x), s(y)) → lt(x, y)
fibo(0') → fib(0')
fibo(s(0')) → fib(s(0'))
fibo(s(s(x))) → sum(fibo(s(x)), fibo(x))
fib(0') → s(0')
fib(s(0')) → s(0')
fib(s(s(x))) → if(true, 0', s(s(x)), 0', 0')
if(true, c, s(s(x)), a, b) → if(lt(s(c), s(s(x))), s(c), s(s(x)), b, c)
if(false, c, s(s(x)), a, b) → sum(fibo(a), fibo(b))
sum(x, 0') → x
sum(x, s(y)) → s(sum(x, y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
lt,
fibo,
fib,
sum,
ifThey will be analysed ascendingly in the following order:
lt < if
fibo = fib
sum < fibo
fibo = if
fib = if
sum < if
(8) Obligation:
TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
The following defined symbols remain to be analysed:
lt, fibo, fib, sum, if
They will be analysed ascendingly in the following order:
lt < if
fibo = fib
sum < fibo
fibo = if
fib = if
sum < if
(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
lt(
gen_0':s3_0(
n5_0),
gen_0':s3_0(
+(
1,
n5_0))) →
true, rt ∈ Ω(1 + n5
0)
Induction Base:
lt(gen_0':s3_0(0), gen_0':s3_0(+(1, 0))) →RΩ(1)
true
Induction Step:
lt(gen_0':s3_0(+(n5_0, 1)), gen_0':s3_0(+(1, +(n5_0, 1)))) →RΩ(1)
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) →IH
true
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(10) Complex Obligation (BEST)
(11) Obligation:
TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
The following defined symbols remain to be analysed:
sum, fibo, fib, if
They will be analysed ascendingly in the following order:
fibo = fib
sum < fibo
fibo = if
fib = if
sum < if
(12) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
sum(
gen_0':s3_0(
a),
gen_0':s3_0(
n294_0)) →
gen_0':s3_0(
+(
n294_0,
a)), rt ∈ Ω(1 + n294
0)
Induction Base:
sum(gen_0':s3_0(a), gen_0':s3_0(0)) →RΩ(1)
gen_0':s3_0(a)
Induction Step:
sum(gen_0':s3_0(a), gen_0':s3_0(+(n294_0, 1))) →RΩ(1)
s(sum(gen_0':s3_0(a), gen_0':s3_0(n294_0))) →IH
s(gen_0':s3_0(+(a, c295_0)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(13) Complex Obligation (BEST)
(14) Obligation:
TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
sum(gen_0':s3_0(a), gen_0':s3_0(n294_0)) → gen_0':s3_0(+(n294_0, a)), rt ∈ Ω(1 + n2940)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
The following defined symbols remain to be analysed:
fib, fibo, if
They will be analysed ascendingly in the following order:
fibo = fib
fibo = if
fib = if
(15) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol fib.
(16) Obligation:
TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
sum(gen_0':s3_0(a), gen_0':s3_0(n294_0)) → gen_0':s3_0(+(n294_0, a)), rt ∈ Ω(1 + n2940)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
The following defined symbols remain to be analysed:
if, fibo
They will be analysed ascendingly in the following order:
fibo = fib
fibo = if
fib = if
(17) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol if.
(18) Obligation:
TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
sum(gen_0':s3_0(a), gen_0':s3_0(n294_0)) → gen_0':s3_0(+(n294_0, a)), rt ∈ Ω(1 + n2940)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
The following defined symbols remain to be analysed:
fibo
They will be analysed ascendingly in the following order:
fibo = fib
fibo = if
fib = if
(19) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol fibo.
(20) Obligation:
TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
sum(gen_0':s3_0(a), gen_0':s3_0(n294_0)) → gen_0':s3_0(+(n294_0, a)), rt ∈ Ω(1 + n2940)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
(22) BOUNDS(n^1, INF)
(23) Obligation:
TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
sum(gen_0':s3_0(a), gen_0':s3_0(n294_0)) → gen_0':s3_0(+(n294_0, a)), rt ∈ Ω(1 + n2940)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
No more defined symbols left to analyse.
(24) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
(25) BOUNDS(n^1, INF)
(26) Obligation:
TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
No more defined symbols left to analyse.
(27) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
(28) BOUNDS(n^1, INF)