(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
a(h, h, h, x) → s(x)
a(l, x, s(y), h) → a(l, x, y, s(h))
a(l, x, s(y), s(z)) → a(l, x, y, a(l, x, s(y), z))
a(l, s(x), h, z) → a(l, x, z, z)
a(s(l), h, h, z) → a(l, z, h, z)
+(x, h) → x
+(h, x) → x
+(s(x), s(y)) → s(s(+(x, y)))
+(+(x, y), z) → +(x, +(y, z))
s(h) → 1
app(nil, k) → k
app(l, nil) → l
app(cons(x, l), k) → cons(x, app(l, k))
sum(cons(x, nil)) → cons(x, nil)
sum(cons(x, cons(y, l))) → sum(cons(a(x, y, h, h), l))
Rewrite Strategy: FULL
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
app(cons(x, l), k) →+ cons(x, app(l, k))
gives rise to a decreasing loop by considering the right hand sides subterm at position [1].
The pumping substitution is [l / cons(x, l)].
The result substitution is [ ].
(2) BOUNDS(n^1, 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:
a(h, h, h, x) → s(x)
a(l, x, s(y), h) → a(l, x, y, s(h))
a(l, x, s(y), s(z)) → a(l, x, y, a(l, x, s(y), z))
a(l, s(x), h, z) → a(l, x, z, z)
a(s(l), h, h, z) → a(l, z, h, z)
+'(x, h) → x
+'(h, x) → x
+'(s(x), s(y)) → s(s(+'(x, y)))
+'(+'(x, y), z) → +'(x, +'(y, z))
s(h) → 1'
app(nil, k) → k
app(l, nil) → l
app(cons(x, l), k) → cons(x, app(l, k))
sum(cons(x, nil)) → cons(x, nil)
sum(cons(x, cons(y, l))) → sum(cons(a(x, y, h, h), l))
S is empty.
Rewrite Strategy: FULL
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
Rules:
a(h, h, h, x) → s(x)
a(l, x, s(y), h) → a(l, x, y, s(h))
a(l, x, s(y), s(z)) → a(l, x, y, a(l, x, s(y), z))
a(l, s(x), h, z) → a(l, x, z, z)
a(s(l), h, h, z) → a(l, z, h, z)
+'(x, h) → x
+'(h, x) → x
+'(s(x), s(y)) → s(s(+'(x, y)))
+'(+'(x, y), z) → +'(x, +'(y, z))
s(h) → 1'
app(nil, k) → k
app(l, nil) → l
app(cons(x, l), k) → cons(x, app(l, k))
sum(cons(x, nil)) → cons(x, nil)
sum(cons(x, cons(y, l))) → sum(cons(a(x, y, h, h), l))
Types:
a :: h:1' → h:1' → h:1' → h:1' → h:1'
h :: h:1'
s :: h:1' → h:1'
+' :: h:1' → h:1' → h:1'
1' :: h:1'
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: h:1' → nil:cons → nil:cons
sum :: nil:cons → nil:cons
hole_h:1'1_0 :: h:1'
hole_nil:cons2_0 :: nil:cons
gen_nil:cons3_0 :: Nat → nil:cons
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
a,
+',
app,
sumThey will be analysed ascendingly in the following order:
a < sum
(8) Obligation:
TRS:
Rules:
a(
h,
h,
h,
x) →
s(
x)
a(
l,
x,
s(
y),
h) →
a(
l,
x,
y,
s(
h))
a(
l,
x,
s(
y),
s(
z)) →
a(
l,
x,
y,
a(
l,
x,
s(
y),
z))
a(
l,
s(
x),
h,
z) →
a(
l,
x,
z,
z)
a(
s(
l),
h,
h,
z) →
a(
l,
z,
h,
z)
+'(
x,
h) →
x+'(
h,
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
+'(
+'(
x,
y),
z) →
+'(
x,
+'(
y,
z))
s(
h) →
1'app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
a(
x,
y,
h,
h),
l))
Types:
a :: h:1' → h:1' → h:1' → h:1' → h:1'
h :: h:1'
s :: h:1' → h:1'
+' :: h:1' → h:1' → h:1'
1' :: h:1'
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: h:1' → nil:cons → nil:cons
sum :: nil:cons → nil:cons
hole_h:1'1_0 :: h:1'
hole_nil:cons2_0 :: nil:cons
gen_nil:cons3_0 :: Nat → nil:cons
Generator Equations:
gen_nil:cons3_0(0) ⇔ nil
gen_nil:cons3_0(+(x, 1)) ⇔ cons(h, gen_nil:cons3_0(x))
The following defined symbols remain to be analysed:
a, +', app, sum
They will be analysed ascendingly in the following order:
a < sum
(9) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol a.
(10) Obligation:
TRS:
Rules:
a(
h,
h,
h,
x) →
s(
x)
a(
l,
x,
s(
y),
h) →
a(
l,
x,
y,
s(
h))
a(
l,
x,
s(
y),
s(
z)) →
a(
l,
x,
y,
a(
l,
x,
s(
y),
z))
a(
l,
s(
x),
h,
z) →
a(
l,
x,
z,
z)
a(
s(
l),
h,
h,
z) →
a(
l,
z,
h,
z)
+'(
x,
h) →
x+'(
h,
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
+'(
+'(
x,
y),
z) →
+'(
x,
+'(
y,
z))
s(
h) →
1'app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
a(
x,
y,
h,
h),
l))
Types:
a :: h:1' → h:1' → h:1' → h:1' → h:1'
h :: h:1'
s :: h:1' → h:1'
+' :: h:1' → h:1' → h:1'
1' :: h:1'
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: h:1' → nil:cons → nil:cons
sum :: nil:cons → nil:cons
hole_h:1'1_0 :: h:1'
hole_nil:cons2_0 :: nil:cons
gen_nil:cons3_0 :: Nat → nil:cons
Generator Equations:
gen_nil:cons3_0(0) ⇔ nil
gen_nil:cons3_0(+(x, 1)) ⇔ cons(h, gen_nil:cons3_0(x))
The following defined symbols remain to be analysed:
+', app, sum
(11) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol +'.
(12) Obligation:
TRS:
Rules:
a(
h,
h,
h,
x) →
s(
x)
a(
l,
x,
s(
y),
h) →
a(
l,
x,
y,
s(
h))
a(
l,
x,
s(
y),
s(
z)) →
a(
l,
x,
y,
a(
l,
x,
s(
y),
z))
a(
l,
s(
x),
h,
z) →
a(
l,
x,
z,
z)
a(
s(
l),
h,
h,
z) →
a(
l,
z,
h,
z)
+'(
x,
h) →
x+'(
h,
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
+'(
+'(
x,
y),
z) →
+'(
x,
+'(
y,
z))
s(
h) →
1'app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
a(
x,
y,
h,
h),
l))
Types:
a :: h:1' → h:1' → h:1' → h:1' → h:1'
h :: h:1'
s :: h:1' → h:1'
+' :: h:1' → h:1' → h:1'
1' :: h:1'
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: h:1' → nil:cons → nil:cons
sum :: nil:cons → nil:cons
hole_h:1'1_0 :: h:1'
hole_nil:cons2_0 :: nil:cons
gen_nil:cons3_0 :: Nat → nil:cons
Generator Equations:
gen_nil:cons3_0(0) ⇔ nil
gen_nil:cons3_0(+(x, 1)) ⇔ cons(h, gen_nil:cons3_0(x))
The following defined symbols remain to be analysed:
app, sum
(13) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
app(
gen_nil:cons3_0(
n170_0),
gen_nil:cons3_0(
b)) →
gen_nil:cons3_0(
+(
n170_0,
b)), rt ∈ Ω(1 + n170
0)
Induction Base:
app(gen_nil:cons3_0(0), gen_nil:cons3_0(b)) →RΩ(1)
gen_nil:cons3_0(b)
Induction Step:
app(gen_nil:cons3_0(+(n170_0, 1)), gen_nil:cons3_0(b)) →RΩ(1)
cons(h, app(gen_nil:cons3_0(n170_0), gen_nil:cons3_0(b))) →IH
cons(h, gen_nil:cons3_0(+(b, c171_0)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(14) Complex Obligation (BEST)
(15) Obligation:
TRS:
Rules:
a(
h,
h,
h,
x) →
s(
x)
a(
l,
x,
s(
y),
h) →
a(
l,
x,
y,
s(
h))
a(
l,
x,
s(
y),
s(
z)) →
a(
l,
x,
y,
a(
l,
x,
s(
y),
z))
a(
l,
s(
x),
h,
z) →
a(
l,
x,
z,
z)
a(
s(
l),
h,
h,
z) →
a(
l,
z,
h,
z)
+'(
x,
h) →
x+'(
h,
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
+'(
+'(
x,
y),
z) →
+'(
x,
+'(
y,
z))
s(
h) →
1'app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
a(
x,
y,
h,
h),
l))
Types:
a :: h:1' → h:1' → h:1' → h:1' → h:1'
h :: h:1'
s :: h:1' → h:1'
+' :: h:1' → h:1' → h:1'
1' :: h:1'
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: h:1' → nil:cons → nil:cons
sum :: nil:cons → nil:cons
hole_h:1'1_0 :: h:1'
hole_nil:cons2_0 :: nil:cons
gen_nil:cons3_0 :: Nat → nil:cons
Lemmas:
app(gen_nil:cons3_0(n170_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n170_0, b)), rt ∈ Ω(1 + n1700)
Generator Equations:
gen_nil:cons3_0(0) ⇔ nil
gen_nil:cons3_0(+(x, 1)) ⇔ cons(h, gen_nil:cons3_0(x))
The following defined symbols remain to be analysed:
sum
(16) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol sum.
(17) Obligation:
TRS:
Rules:
a(
h,
h,
h,
x) →
s(
x)
a(
l,
x,
s(
y),
h) →
a(
l,
x,
y,
s(
h))
a(
l,
x,
s(
y),
s(
z)) →
a(
l,
x,
y,
a(
l,
x,
s(
y),
z))
a(
l,
s(
x),
h,
z) →
a(
l,
x,
z,
z)
a(
s(
l),
h,
h,
z) →
a(
l,
z,
h,
z)
+'(
x,
h) →
x+'(
h,
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
+'(
+'(
x,
y),
z) →
+'(
x,
+'(
y,
z))
s(
h) →
1'app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
a(
x,
y,
h,
h),
l))
Types:
a :: h:1' → h:1' → h:1' → h:1' → h:1'
h :: h:1'
s :: h:1' → h:1'
+' :: h:1' → h:1' → h:1'
1' :: h:1'
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: h:1' → nil:cons → nil:cons
sum :: nil:cons → nil:cons
hole_h:1'1_0 :: h:1'
hole_nil:cons2_0 :: nil:cons
gen_nil:cons3_0 :: Nat → nil:cons
Lemmas:
app(gen_nil:cons3_0(n170_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n170_0, b)), rt ∈ Ω(1 + n1700)
Generator Equations:
gen_nil:cons3_0(0) ⇔ nil
gen_nil:cons3_0(+(x, 1)) ⇔ cons(h, gen_nil:cons3_0(x))
No more defined symbols left to analyse.
(18) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
app(gen_nil:cons3_0(n170_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n170_0, b)), rt ∈ Ω(1 + n1700)
(19) BOUNDS(n^1, INF)
(20) Obligation:
TRS:
Rules:
a(
h,
h,
h,
x) →
s(
x)
a(
l,
x,
s(
y),
h) →
a(
l,
x,
y,
s(
h))
a(
l,
x,
s(
y),
s(
z)) →
a(
l,
x,
y,
a(
l,
x,
s(
y),
z))
a(
l,
s(
x),
h,
z) →
a(
l,
x,
z,
z)
a(
s(
l),
h,
h,
z) →
a(
l,
z,
h,
z)
+'(
x,
h) →
x+'(
h,
x) →
x+'(
s(
x),
s(
y)) →
s(
s(
+'(
x,
y)))
+'(
+'(
x,
y),
z) →
+'(
x,
+'(
y,
z))
s(
h) →
1'app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
a(
x,
y,
h,
h),
l))
Types:
a :: h:1' → h:1' → h:1' → h:1' → h:1'
h :: h:1'
s :: h:1' → h:1'
+' :: h:1' → h:1' → h:1'
1' :: h:1'
app :: nil:cons → nil:cons → nil:cons
nil :: nil:cons
cons :: h:1' → nil:cons → nil:cons
sum :: nil:cons → nil:cons
hole_h:1'1_0 :: h:1'
hole_nil:cons2_0 :: nil:cons
gen_nil:cons3_0 :: Nat → nil:cons
Lemmas:
app(gen_nil:cons3_0(n170_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n170_0, b)), rt ∈ Ω(1 + n1700)
Generator Equations:
gen_nil:cons3_0(0) ⇔ nil
gen_nil:cons3_0(+(x, 1)) ⇔ cons(h, gen_nil:cons3_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
app(gen_nil:cons3_0(n170_0), gen_nil:cons3_0(b)) → gen_nil:cons3_0(+(n170_0, b)), rt ∈ Ω(1 + n1700)
(22) BOUNDS(n^1, INF)