(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
+(x, 0) → x
+(0, x) → x
+(s(x), s(y)) → s(s(+(x, y)))
*(x, 0) → 0
*(0, x) → 0
*(s(x), s(y)) → s(+(*(x, y), +(x, y)))
sum(nil) → 0
sum(cons(x, l)) → +(x, sum(l))
prod(nil) → s(0)
prod(cons(x, l)) → *(x, prod(l))
Rewrite Strategy: INNERMOST
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
+'(x, 0') → x
+'(0', x) → x
+'(s(x), s(y)) → s(s(+'(x, y)))
*'(x, 0') → 0'
*'(0', x) → 0'
*'(s(x), s(y)) → s(+'(*'(x, y), +'(x, y)))
sum(nil) → 0'
sum(cons(x, l)) → +'(x, sum(l))
prod(nil) → s(0')
prod(cons(x, l)) → *'(x, prod(l))
S is empty.
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
Rules:
+'(x, 0') → x
+'(0', x) → x
+'(s(x), s(y)) → s(s(+'(x, y)))
*'(x, 0') → 0'
*'(0', x) → 0'
*'(s(x), s(y)) → s(+'(*'(x, y), +'(x, y)))
sum(nil) → 0'
sum(cons(x, l)) → +'(x, sum(l))
prod(nil) → s(0')
prod(cons(x, l)) → *'(x, prod(l))
Types:
+' :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
*' :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
prod :: nil:cons → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
gen_0':s3_0 :: Nat → 0':s
gen_nil:cons4_0 :: Nat → nil:cons
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
+',
*',
sum,
prodThey will be analysed ascendingly in the following order:
+' < *'
+' < sum
*' < prod
(6) Obligation:
Innermost TRS:
Rules:
+'(
x,
0') →
x+'(
0',
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
*'(
x,
0') →
0'*'(
0',
x) →
0'*'(
s(
x),
s(
y)) →
s(
+'(
*'(
x,
y),
+'(
x,
y)))
sum(
nil) →
0'sum(
cons(
x,
l)) →
+'(
x,
sum(
l))
prod(
nil) →
s(
0')
prod(
cons(
x,
l)) →
*'(
x,
prod(
l))
Types:
+' :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
*' :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
prod :: nil:cons → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
gen_0':s3_0 :: Nat → 0':s
gen_nil:cons4_0 :: Nat → nil:cons
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
+', *', sum, prod
They will be analysed ascendingly in the following order:
+' < *'
+' < sum
*' < prod
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
+'(
gen_0':s3_0(
n6_0),
gen_0':s3_0(
n6_0)) →
gen_0':s3_0(
*(
2,
n6_0)), rt ∈ Ω(1 + n6
0)
Induction Base:
+'(gen_0':s3_0(0), gen_0':s3_0(0)) →RΩ(1)
gen_0':s3_0(0)
Induction Step:
+'(gen_0':s3_0(+(n6_0, 1)), gen_0':s3_0(+(n6_0, 1))) →RΩ(1)
s(s(+'(gen_0':s3_0(n6_0), gen_0':s3_0(n6_0)))) →IH
s(s(gen_0':s3_0(*(2, c7_0))))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
Innermost TRS:
Rules:
+'(
x,
0') →
x+'(
0',
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
*'(
x,
0') →
0'*'(
0',
x) →
0'*'(
s(
x),
s(
y)) →
s(
+'(
*'(
x,
y),
+'(
x,
y)))
sum(
nil) →
0'sum(
cons(
x,
l)) →
+'(
x,
sum(
l))
prod(
nil) →
s(
0')
prod(
cons(
x,
l)) →
*'(
x,
prod(
l))
Types:
+' :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
*' :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
prod :: nil:cons → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
gen_0':s3_0 :: Nat → 0':s
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
+'(gen_0':s3_0(n6_0), gen_0':s3_0(n6_0)) → gen_0':s3_0(*(2, n6_0)), rt ∈ Ω(1 + n60)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
*', sum, prod
They will be analysed ascendingly in the following order:
*' < prod
(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
*'(
gen_0':s3_0(
n566_0),
gen_0':s3_0(
n566_0)) →
*5_0, rt ∈ Ω(n566
0 + n566
02)
Induction Base:
*'(gen_0':s3_0(0), gen_0':s3_0(0))
Induction Step:
*'(gen_0':s3_0(+(n566_0, 1)), gen_0':s3_0(+(n566_0, 1))) →RΩ(1)
s(+'(*'(gen_0':s3_0(n566_0), gen_0':s3_0(n566_0)), +'(gen_0':s3_0(n566_0), gen_0':s3_0(n566_0)))) →IH
s(+'(*5_0, +'(gen_0':s3_0(n566_0), gen_0':s3_0(n566_0)))) →LΩ(1 + n5660)
s(+'(*5_0, gen_0':s3_0(*(2, n566_0))))
We have rt ∈ Ω(n2) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n2).
(11) Complex Obligation (BEST)
(12) Obligation:
Innermost TRS:
Rules:
+'(
x,
0') →
x+'(
0',
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
*'(
x,
0') →
0'*'(
0',
x) →
0'*'(
s(
x),
s(
y)) →
s(
+'(
*'(
x,
y),
+'(
x,
y)))
sum(
nil) →
0'sum(
cons(
x,
l)) →
+'(
x,
sum(
l))
prod(
nil) →
s(
0')
prod(
cons(
x,
l)) →
*'(
x,
prod(
l))
Types:
+' :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
*' :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
prod :: nil:cons → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
gen_0':s3_0 :: Nat → 0':s
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
+'(gen_0':s3_0(n6_0), gen_0':s3_0(n6_0)) → gen_0':s3_0(*(2, n6_0)), rt ∈ Ω(1 + n60)
*'(gen_0':s3_0(n566_0), gen_0':s3_0(n566_0)) → *5_0, rt ∈ Ω(n5660 + n56602)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
sum, prod
(13) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
sum(
gen_nil:cons4_0(
n10521_0)) →
gen_0':s3_0(
0), rt ∈ Ω(1 + n10521
0)
Induction Base:
sum(gen_nil:cons4_0(0)) →RΩ(1)
0'
Induction Step:
sum(gen_nil:cons4_0(+(n10521_0, 1))) →RΩ(1)
+'(0', sum(gen_nil:cons4_0(n10521_0))) →IH
+'(0', gen_0':s3_0(0)) →LΩ(1)
gen_0':s3_0(*(2, 0))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(14) Complex Obligation (BEST)
(15) Obligation:
Innermost TRS:
Rules:
+'(
x,
0') →
x+'(
0',
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
*'(
x,
0') →
0'*'(
0',
x) →
0'*'(
s(
x),
s(
y)) →
s(
+'(
*'(
x,
y),
+'(
x,
y)))
sum(
nil) →
0'sum(
cons(
x,
l)) →
+'(
x,
sum(
l))
prod(
nil) →
s(
0')
prod(
cons(
x,
l)) →
*'(
x,
prod(
l))
Types:
+' :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
*' :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
prod :: nil:cons → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
gen_0':s3_0 :: Nat → 0':s
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
+'(gen_0':s3_0(n6_0), gen_0':s3_0(n6_0)) → gen_0':s3_0(*(2, n6_0)), rt ∈ Ω(1 + n60)
*'(gen_0':s3_0(n566_0), gen_0':s3_0(n566_0)) → *5_0, rt ∈ Ω(n5660 + n56602)
sum(gen_nil:cons4_0(n10521_0)) → gen_0':s3_0(0), rt ∈ Ω(1 + n105210)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
prod
(16) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
prod(
gen_nil:cons4_0(
n10985_0)) →
*5_0, rt ∈ Ω(n10985
0)
Induction Base:
prod(gen_nil:cons4_0(0))
Induction Step:
prod(gen_nil:cons4_0(+(n10985_0, 1))) →RΩ(1)
*'(0', prod(gen_nil:cons4_0(n10985_0))) →IH
*'(0', *5_0)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(17) Complex Obligation (BEST)
(18) Obligation:
Innermost TRS:
Rules:
+'(
x,
0') →
x+'(
0',
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
*'(
x,
0') →
0'*'(
0',
x) →
0'*'(
s(
x),
s(
y)) →
s(
+'(
*'(
x,
y),
+'(
x,
y)))
sum(
nil) →
0'sum(
cons(
x,
l)) →
+'(
x,
sum(
l))
prod(
nil) →
s(
0')
prod(
cons(
x,
l)) →
*'(
x,
prod(
l))
Types:
+' :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
*' :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
prod :: nil:cons → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
gen_0':s3_0 :: Nat → 0':s
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
+'(gen_0':s3_0(n6_0), gen_0':s3_0(n6_0)) → gen_0':s3_0(*(2, n6_0)), rt ∈ Ω(1 + n60)
*'(gen_0':s3_0(n566_0), gen_0':s3_0(n566_0)) → *5_0, rt ∈ Ω(n5660 + n56602)
sum(gen_nil:cons4_0(n10521_0)) → gen_0':s3_0(0), rt ∈ Ω(1 + n105210)
prod(gen_nil:cons4_0(n10985_0)) → *5_0, rt ∈ Ω(n109850)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
No more defined symbols left to analyse.
(19) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n2) was proven with the following lemma:
*'(gen_0':s3_0(n566_0), gen_0':s3_0(n566_0)) → *5_0, rt ∈ Ω(n5660 + n56602)
(20) BOUNDS(n^2, INF)
(21) Obligation:
Innermost TRS:
Rules:
+'(
x,
0') →
x+'(
0',
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
*'(
x,
0') →
0'*'(
0',
x) →
0'*'(
s(
x),
s(
y)) →
s(
+'(
*'(
x,
y),
+'(
x,
y)))
sum(
nil) →
0'sum(
cons(
x,
l)) →
+'(
x,
sum(
l))
prod(
nil) →
s(
0')
prod(
cons(
x,
l)) →
*'(
x,
prod(
l))
Types:
+' :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
*' :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
prod :: nil:cons → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
gen_0':s3_0 :: Nat → 0':s
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
+'(gen_0':s3_0(n6_0), gen_0':s3_0(n6_0)) → gen_0':s3_0(*(2, n6_0)), rt ∈ Ω(1 + n60)
*'(gen_0':s3_0(n566_0), gen_0':s3_0(n566_0)) → *5_0, rt ∈ Ω(n5660 + n56602)
sum(gen_nil:cons4_0(n10521_0)) → gen_0':s3_0(0), rt ∈ Ω(1 + n105210)
prod(gen_nil:cons4_0(n10985_0)) → *5_0, rt ∈ Ω(n109850)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
No more defined symbols left to analyse.
(22) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n2) was proven with the following lemma:
*'(gen_0':s3_0(n566_0), gen_0':s3_0(n566_0)) → *5_0, rt ∈ Ω(n5660 + n56602)
(23) BOUNDS(n^2, INF)
(24) Obligation:
Innermost TRS:
Rules:
+'(
x,
0') →
x+'(
0',
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
*'(
x,
0') →
0'*'(
0',
x) →
0'*'(
s(
x),
s(
y)) →
s(
+'(
*'(
x,
y),
+'(
x,
y)))
sum(
nil) →
0'sum(
cons(
x,
l)) →
+'(
x,
sum(
l))
prod(
nil) →
s(
0')
prod(
cons(
x,
l)) →
*'(
x,
prod(
l))
Types:
+' :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
*' :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
prod :: nil:cons → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
gen_0':s3_0 :: Nat → 0':s
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
+'(gen_0':s3_0(n6_0), gen_0':s3_0(n6_0)) → gen_0':s3_0(*(2, n6_0)), rt ∈ Ω(1 + n60)
*'(gen_0':s3_0(n566_0), gen_0':s3_0(n566_0)) → *5_0, rt ∈ Ω(n5660 + n56602)
sum(gen_nil:cons4_0(n10521_0)) → gen_0':s3_0(0), rt ∈ Ω(1 + n105210)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
No more defined symbols left to analyse.
(25) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n2) was proven with the following lemma:
*'(gen_0':s3_0(n566_0), gen_0':s3_0(n566_0)) → *5_0, rt ∈ Ω(n5660 + n56602)
(26) BOUNDS(n^2, INF)
(27) Obligation:
Innermost TRS:
Rules:
+'(
x,
0') →
x+'(
0',
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
*'(
x,
0') →
0'*'(
0',
x) →
0'*'(
s(
x),
s(
y)) →
s(
+'(
*'(
x,
y),
+'(
x,
y)))
sum(
nil) →
0'sum(
cons(
x,
l)) →
+'(
x,
sum(
l))
prod(
nil) →
s(
0')
prod(
cons(
x,
l)) →
*'(
x,
prod(
l))
Types:
+' :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
*' :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
prod :: nil:cons → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
gen_0':s3_0 :: Nat → 0':s
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
+'(gen_0':s3_0(n6_0), gen_0':s3_0(n6_0)) → gen_0':s3_0(*(2, n6_0)), rt ∈ Ω(1 + n60)
*'(gen_0':s3_0(n566_0), gen_0':s3_0(n566_0)) → *5_0, rt ∈ Ω(n5660 + n56602)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
No more defined symbols left to analyse.
(28) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n2) was proven with the following lemma:
*'(gen_0':s3_0(n566_0), gen_0':s3_0(n566_0)) → *5_0, rt ∈ Ω(n5660 + n56602)
(29) BOUNDS(n^2, INF)
(30) Obligation:
Innermost TRS:
Rules:
+'(
x,
0') →
x+'(
0',
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
*'(
x,
0') →
0'*'(
0',
x) →
0'*'(
s(
x),
s(
y)) →
s(
+'(
*'(
x,
y),
+'(
x,
y)))
sum(
nil) →
0'sum(
cons(
x,
l)) →
+'(
x,
sum(
l))
prod(
nil) →
s(
0')
prod(
cons(
x,
l)) →
*'(
x,
prod(
l))
Types:
+' :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
*' :: 0':s → 0':s → 0':s
sum :: nil:cons → 0':s
nil :: nil:cons
cons :: 0':s → nil:cons → nil:cons
prod :: nil:cons → 0':s
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
gen_0':s3_0 :: Nat → 0':s
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
+'(gen_0':s3_0(n6_0), gen_0':s3_0(n6_0)) → gen_0':s3_0(*(2, n6_0)), rt ∈ Ω(1 + n60)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
No more defined symbols left to analyse.
(31) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
+'(gen_0':s3_0(n6_0), gen_0':s3_0(n6_0)) → gen_0':s3_0(*(2, n6_0)), rt ∈ Ω(1 + n60)
(32) BOUNDS(n^1, INF)