Runtime Complexity TRS:
The TRS R consists of the following rules:
0(#) → #
+(x, #) → x
+(#, x) → x
+(0(x), 0(y)) → 0(+(x, y))
+(0(x), 1(y)) → 1(+(x, y))
+(1(x), 0(y)) → 1(+(x, y))
+(1(x), 1(y)) → 0(+(+(x, y), 1(#)))
+(+(x, y), z) → +(x, +(y, z))
*(#, x) → #
*(0(x), y) → 0(*(x, y))
*(1(x), y) → +(0(*(x, y)), y)
*(*(x, y), z) → *(x, *(y, z))
sum(nil) → 0(#)
sum(cons(x, l)) → +(x, sum(l))
prod(nil) → 1(#)
prod(cons(x, l)) → *(x, prod(l))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
0'(#') → #'
+'(x, #') → x
+'(#', x) → x
+'(0'(x), 0'(y)) → 0'(+'(x, y))
+'(0'(x), 1'(y)) → 1'(+'(x, y))
+'(1'(x), 0'(y)) → 1'(+'(x, y))
+'(1'(x), 1'(y)) → 0'(+'(+'(x, y), 1'(#')))
+'(+'(x, y), z) → +'(x, +'(y, z))
*'(#', x) → #'
*'(0'(x), y) → 0'(*'(x, y))
*'(1'(x), y) → +'(0'(*'(x, y)), y)
*'(*'(x, y), z) → *'(x, *'(y, z))
sum'(nil') → 0'(#')
sum'(cons'(x, l)) → +'(x, sum'(l))
prod'(nil') → 1'(#')
prod'(cons'(x, l)) → *'(x, prod'(l))
Infered types.
Rules:
0'(#') → #'
+'(x, #') → x
+'(#', x) → x
+'(0'(x), 0'(y)) → 0'(+'(x, y))
+'(0'(x), 1'(y)) → 1'(+'(x, y))
+'(1'(x), 0'(y)) → 1'(+'(x, y))
+'(1'(x), 1'(y)) → 0'(+'(+'(x, y), 1'(#')))
+'(+'(x, y), z) → +'(x, +'(y, z))
*'(#', x) → #'
*'(0'(x), y) → 0'(*'(x, y))
*'(1'(x), y) → +'(0'(*'(x, y)), y)
*'(*'(x, y), z) → *'(x, *'(y, z))
sum'(nil') → 0'(#')
sum'(cons'(x, l)) → +'(x, sum'(l))
prod'(nil') → 1'(#')
prod'(cons'(x, l)) → *'(x, prod'(l))
Types:
0' :: #':1' → #':1'
#' :: #':1'
+' :: #':1' → #':1' → #':1'
1' :: #':1' → #':1'
*' :: #':1' → #':1' → #':1'
sum' :: nil':cons' → #':1'
nil' :: nil':cons'
cons' :: #':1' → nil':cons' → nil':cons'
prod' :: nil':cons' → #':1'
_hole_#':1'1 :: #':1'
_hole_nil':cons'2 :: nil':cons'
_gen_#':1'3 :: Nat → #':1'
_gen_nil':cons'4 :: Nat → nil':cons'
Heuristically decided to analyse the following defined symbols:
+', *', sum', prod'
They will be analysed ascendingly in the following order:
+' < *'
+' < sum'
*' < prod'
Rules:
0'(#') → #'
+'(x, #') → x
+'(#', x) → x
+'(0'(x), 0'(y)) → 0'(+'(x, y))
+'(0'(x), 1'(y)) → 1'(+'(x, y))
+'(1'(x), 0'(y)) → 1'(+'(x, y))
+'(1'(x), 1'(y)) → 0'(+'(+'(x, y), 1'(#')))
+'(+'(x, y), z) → +'(x, +'(y, z))
*'(#', x) → #'
*'(0'(x), y) → 0'(*'(x, y))
*'(1'(x), y) → +'(0'(*'(x, y)), y)
*'(*'(x, y), z) → *'(x, *'(y, z))
sum'(nil') → 0'(#')
sum'(cons'(x, l)) → +'(x, sum'(l))
prod'(nil') → 1'(#')
prod'(cons'(x, l)) → *'(x, prod'(l))
Types:
0' :: #':1' → #':1'
#' :: #':1'
+' :: #':1' → #':1' → #':1'
1' :: #':1' → #':1'
*' :: #':1' → #':1' → #':1'
sum' :: nil':cons' → #':1'
nil' :: nil':cons'
cons' :: #':1' → nil':cons' → nil':cons'
prod' :: nil':cons' → #':1'
_hole_#':1'1 :: #':1'
_hole_nil':cons'2 :: nil':cons'
_gen_#':1'3 :: Nat → #':1'
_gen_nil':cons'4 :: Nat → nil':cons'
Generator Equations:
_gen_#':1'3(0) ⇔ #'
_gen_#':1'3(+(x, 1)) ⇔ 1'(_gen_#':1'3(x))
_gen_nil':cons'4(0) ⇔ nil'
_gen_nil':cons'4(+(x, 1)) ⇔ cons'(#', _gen_nil':cons'4(x))
The following defined symbols remain to be analysed:
+', *', sum', prod'
They will be analysed ascendingly in the following order:
+' < *'
+' < sum'
*' < prod'
Proved the following rewrite lemma:
+'(_gen_#':1'3(_n6), _gen_#':1'3(_n6)) → _*5, rt ∈ Ω(n6)
Induction Base:
+'(_gen_#':1'3(0), _gen_#':1'3(0))
Induction Step:
+'(_gen_#':1'3(+(_$n7, 1)), _gen_#':1'3(+(_$n7, 1))) →RΩ(1)
0'(+'(+'(_gen_#':1'3(_$n7), _gen_#':1'3(_$n7)), 1'(#'))) →IH
0'(+'(_*5, 1'(#')))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
0'(#') → #'
+'(x, #') → x
+'(#', x) → x
+'(0'(x), 0'(y)) → 0'(+'(x, y))
+'(0'(x), 1'(y)) → 1'(+'(x, y))
+'(1'(x), 0'(y)) → 1'(+'(x, y))
+'(1'(x), 1'(y)) → 0'(+'(+'(x, y), 1'(#')))
+'(+'(x, y), z) → +'(x, +'(y, z))
*'(#', x) → #'
*'(0'(x), y) → 0'(*'(x, y))
*'(1'(x), y) → +'(0'(*'(x, y)), y)
*'(*'(x, y), z) → *'(x, *'(y, z))
sum'(nil') → 0'(#')
sum'(cons'(x, l)) → +'(x, sum'(l))
prod'(nil') → 1'(#')
prod'(cons'(x, l)) → *'(x, prod'(l))
Types:
0' :: #':1' → #':1'
#' :: #':1'
+' :: #':1' → #':1' → #':1'
1' :: #':1' → #':1'
*' :: #':1' → #':1' → #':1'
sum' :: nil':cons' → #':1'
nil' :: nil':cons'
cons' :: #':1' → nil':cons' → nil':cons'
prod' :: nil':cons' → #':1'
_hole_#':1'1 :: #':1'
_hole_nil':cons'2 :: nil':cons'
_gen_#':1'3 :: Nat → #':1'
_gen_nil':cons'4 :: Nat → nil':cons'
Lemmas:
+'(_gen_#':1'3(_n6), _gen_#':1'3(_n6)) → _*5, rt ∈ Ω(n6)
Generator Equations:
_gen_#':1'3(0) ⇔ #'
_gen_#':1'3(+(x, 1)) ⇔ 1'(_gen_#':1'3(x))
_gen_nil':cons'4(0) ⇔ nil'
_gen_nil':cons'4(+(x, 1)) ⇔ cons'(#', _gen_nil':cons'4(x))
The following defined symbols remain to be analysed:
*', sum', prod'
They will be analysed ascendingly in the following order:
*' < prod'
Proved the following rewrite lemma:
*'(_gen_#':1'3(_n40649), _gen_#':1'3(0)) → _gen_#':1'3(0), rt ∈ Ω(1 + n40649)
Induction Base:
*'(_gen_#':1'3(0), _gen_#':1'3(0)) →RΩ(1)
#'
Induction Step:
*'(_gen_#':1'3(+(_$n40650, 1)), _gen_#':1'3(0)) →RΩ(1)
+'(0'(*'(_gen_#':1'3(_$n40650), _gen_#':1'3(0))), _gen_#':1'3(0)) →IH
+'(0'(_gen_#':1'3(0)), _gen_#':1'3(0)) →RΩ(1)
+'(#', _gen_#':1'3(0)) →RΩ(1)
#'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
0'(#') → #'
+'(x, #') → x
+'(#', x) → x
+'(0'(x), 0'(y)) → 0'(+'(x, y))
+'(0'(x), 1'(y)) → 1'(+'(x, y))
+'(1'(x), 0'(y)) → 1'(+'(x, y))
+'(1'(x), 1'(y)) → 0'(+'(+'(x, y), 1'(#')))
+'(+'(x, y), z) → +'(x, +'(y, z))
*'(#', x) → #'
*'(0'(x), y) → 0'(*'(x, y))
*'(1'(x), y) → +'(0'(*'(x, y)), y)
*'(*'(x, y), z) → *'(x, *'(y, z))
sum'(nil') → 0'(#')
sum'(cons'(x, l)) → +'(x, sum'(l))
prod'(nil') → 1'(#')
prod'(cons'(x, l)) → *'(x, prod'(l))
Types:
0' :: #':1' → #':1'
#' :: #':1'
+' :: #':1' → #':1' → #':1'
1' :: #':1' → #':1'
*' :: #':1' → #':1' → #':1'
sum' :: nil':cons' → #':1'
nil' :: nil':cons'
cons' :: #':1' → nil':cons' → nil':cons'
prod' :: nil':cons' → #':1'
_hole_#':1'1 :: #':1'
_hole_nil':cons'2 :: nil':cons'
_gen_#':1'3 :: Nat → #':1'
_gen_nil':cons'4 :: Nat → nil':cons'
Lemmas:
+'(_gen_#':1'3(_n6), _gen_#':1'3(_n6)) → _*5, rt ∈ Ω(n6)
*'(_gen_#':1'3(_n40649), _gen_#':1'3(0)) → _gen_#':1'3(0), rt ∈ Ω(1 + n40649)
Generator Equations:
_gen_#':1'3(0) ⇔ #'
_gen_#':1'3(+(x, 1)) ⇔ 1'(_gen_#':1'3(x))
_gen_nil':cons'4(0) ⇔ nil'
_gen_nil':cons'4(+(x, 1)) ⇔ cons'(#', _gen_nil':cons'4(x))
The following defined symbols remain to be analysed:
sum', prod'
Proved the following rewrite lemma:
sum'(_gen_nil':cons'4(_n53318)) → _gen_#':1'3(0), rt ∈ Ω(1 + n53318)
Induction Base:
sum'(_gen_nil':cons'4(0)) →RΩ(1)
0'(#') →RΩ(1)
#'
Induction Step:
sum'(_gen_nil':cons'4(+(_$n53319, 1))) →RΩ(1)
+'(#', sum'(_gen_nil':cons'4(_$n53319))) →IH
+'(#', _gen_#':1'3(0)) →RΩ(1)
#'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
0'(#') → #'
+'(x, #') → x
+'(#', x) → x
+'(0'(x), 0'(y)) → 0'(+'(x, y))
+'(0'(x), 1'(y)) → 1'(+'(x, y))
+'(1'(x), 0'(y)) → 1'(+'(x, y))
+'(1'(x), 1'(y)) → 0'(+'(+'(x, y), 1'(#')))
+'(+'(x, y), z) → +'(x, +'(y, z))
*'(#', x) → #'
*'(0'(x), y) → 0'(*'(x, y))
*'(1'(x), y) → +'(0'(*'(x, y)), y)
*'(*'(x, y), z) → *'(x, *'(y, z))
sum'(nil') → 0'(#')
sum'(cons'(x, l)) → +'(x, sum'(l))
prod'(nil') → 1'(#')
prod'(cons'(x, l)) → *'(x, prod'(l))
Types:
0' :: #':1' → #':1'
#' :: #':1'
+' :: #':1' → #':1' → #':1'
1' :: #':1' → #':1'
*' :: #':1' → #':1' → #':1'
sum' :: nil':cons' → #':1'
nil' :: nil':cons'
cons' :: #':1' → nil':cons' → nil':cons'
prod' :: nil':cons' → #':1'
_hole_#':1'1 :: #':1'
_hole_nil':cons'2 :: nil':cons'
_gen_#':1'3 :: Nat → #':1'
_gen_nil':cons'4 :: Nat → nil':cons'
Lemmas:
+'(_gen_#':1'3(_n6), _gen_#':1'3(_n6)) → _*5, rt ∈ Ω(n6)
*'(_gen_#':1'3(_n40649), _gen_#':1'3(0)) → _gen_#':1'3(0), rt ∈ Ω(1 + n40649)
sum'(_gen_nil':cons'4(_n53318)) → _gen_#':1'3(0), rt ∈ Ω(1 + n53318)
Generator Equations:
_gen_#':1'3(0) ⇔ #'
_gen_#':1'3(+(x, 1)) ⇔ 1'(_gen_#':1'3(x))
_gen_nil':cons'4(0) ⇔ nil'
_gen_nil':cons'4(+(x, 1)) ⇔ cons'(#', _gen_nil':cons'4(x))
The following defined symbols remain to be analysed:
prod'
Proved the following rewrite lemma:
prod'(_gen_nil':cons'4(_n58630)) → _*5, rt ∈ Ω(n58630)
Induction Base:
prod'(_gen_nil':cons'4(0))
Induction Step:
prod'(_gen_nil':cons'4(+(_$n58631, 1))) →RΩ(1)
*'(#', prod'(_gen_nil':cons'4(_$n58631))) →IH
*'(#', _*5)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
0'(#') → #'
+'(x, #') → x
+'(#', x) → x
+'(0'(x), 0'(y)) → 0'(+'(x, y))
+'(0'(x), 1'(y)) → 1'(+'(x, y))
+'(1'(x), 0'(y)) → 1'(+'(x, y))
+'(1'(x), 1'(y)) → 0'(+'(+'(x, y), 1'(#')))
+'(+'(x, y), z) → +'(x, +'(y, z))
*'(#', x) → #'
*'(0'(x), y) → 0'(*'(x, y))
*'(1'(x), y) → +'(0'(*'(x, y)), y)
*'(*'(x, y), z) → *'(x, *'(y, z))
sum'(nil') → 0'(#')
sum'(cons'(x, l)) → +'(x, sum'(l))
prod'(nil') → 1'(#')
prod'(cons'(x, l)) → *'(x, prod'(l))
Types:
0' :: #':1' → #':1'
#' :: #':1'
+' :: #':1' → #':1' → #':1'
1' :: #':1' → #':1'
*' :: #':1' → #':1' → #':1'
sum' :: nil':cons' → #':1'
nil' :: nil':cons'
cons' :: #':1' → nil':cons' → nil':cons'
prod' :: nil':cons' → #':1'
_hole_#':1'1 :: #':1'
_hole_nil':cons'2 :: nil':cons'
_gen_#':1'3 :: Nat → #':1'
_gen_nil':cons'4 :: Nat → nil':cons'
Lemmas:
+'(_gen_#':1'3(_n6), _gen_#':1'3(_n6)) → _*5, rt ∈ Ω(n6)
*'(_gen_#':1'3(_n40649), _gen_#':1'3(0)) → _gen_#':1'3(0), rt ∈ Ω(1 + n40649)
sum'(_gen_nil':cons'4(_n53318)) → _gen_#':1'3(0), rt ∈ Ω(1 + n53318)
prod'(_gen_nil':cons'4(_n58630)) → _*5, rt ∈ Ω(n58630)
Generator Equations:
_gen_#':1'3(0) ⇔ #'
_gen_#':1'3(+(x, 1)) ⇔ 1'(_gen_#':1'3(x))
_gen_nil':cons'4(0) ⇔ nil'
_gen_nil':cons'4(+(x, 1)) ⇔ cons'(#', _gen_nil':cons'4(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
+'(_gen_#':1'3(_n6), _gen_#':1'3(_n6)) → _*5, rt ∈ Ω(n6)