(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

foldl(x, Cons(S(0), xs)) → foldl(S(x), xs)
foldl(S(0), Cons(x, xs)) → foldl(S(x), xs)
foldr(a, Cons(x, xs)) → op(x, foldr(a, xs))
foldr(a, Nil) → a
foldl(a, Nil) → a
notEmpty(Cons(x, xs)) → True
notEmpty(Nil) → False
op(x, S(0)) → S(x)
op(S(0), y) → S(y)
fold(a, xs) → Cons(foldl(a, xs), Cons(foldr(a, xs), Nil))

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

foldl(x, Cons(S(0), xs)) → foldl(S(x), xs) [1]
foldl(S(0), Cons(x, xs)) → foldl(S(x), xs) [1]
foldr(a, Cons(x, xs)) → op(x, foldr(a, xs)) [1]
foldr(a, Nil) → a [1]
foldl(a, Nil) → a [1]
notEmpty(Cons(x, xs)) → True [1]
notEmpty(Nil) → False [1]
op(x, S(0)) → S(x) [1]
op(S(0), y) → S(y) [1]
fold(a, xs) → Cons(foldl(a, xs), Cons(foldr(a, xs), Nil)) [1]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

foldl(x, Cons(S(0), xs)) → foldl(S(x), xs) [1]
foldl(S(0), Cons(x, xs)) → foldl(S(x), xs) [1]
foldr(a, Cons(x, xs)) → op(x, foldr(a, xs)) [1]
foldr(a, Nil) → a [1]
foldl(a, Nil) → a [1]
notEmpty(Cons(x, xs)) → True [1]
notEmpty(Nil) → False [1]
op(x, S(0)) → S(x) [1]
op(S(0), y) → S(y) [1]
fold(a, xs) → Cons(foldl(a, xs), Cons(foldr(a, xs), Nil)) [1]

The TRS has the following type information:
foldl :: 0:S → Cons:Nil → 0:S
Cons :: 0:S → Cons:Nil → Cons:Nil
S :: 0:S → 0:S
0 :: 0:S
foldr :: 0:S → Cons:Nil → 0:S
op :: 0:S → 0:S → 0:S
Nil :: Cons:Nil
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
fold :: 0:S → Cons:Nil → Cons:Nil

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The transformation into a RNTS is sound, since:

(a) The obligation is a constructor system where every type has a constant constructor,

(b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols:


foldl
notEmpty
fold

(c) The following functions are completely defined:

foldr
op

Due to the following rules being added:

op(v0, v1) → 0 [0]

And the following fresh constants: none

(6) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

foldl(x, Cons(S(0), xs)) → foldl(S(x), xs) [1]
foldl(S(0), Cons(x, xs)) → foldl(S(x), xs) [1]
foldr(a, Cons(x, xs)) → op(x, foldr(a, xs)) [1]
foldr(a, Nil) → a [1]
foldl(a, Nil) → a [1]
notEmpty(Cons(x, xs)) → True [1]
notEmpty(Nil) → False [1]
op(x, S(0)) → S(x) [1]
op(S(0), y) → S(y) [1]
fold(a, xs) → Cons(foldl(a, xs), Cons(foldr(a, xs), Nil)) [1]
op(v0, v1) → 0 [0]

The TRS has the following type information:
foldl :: 0:S → Cons:Nil → 0:S
Cons :: 0:S → Cons:Nil → Cons:Nil
S :: 0:S → 0:S
0 :: 0:S
foldr :: 0:S → Cons:Nil → 0:S
op :: 0:S → 0:S → 0:S
Nil :: Cons:Nil
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
fold :: 0:S → Cons:Nil → Cons:Nil

Rewrite Strategy: INNERMOST

(7) NarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Narrowed the inner basic terms of all right-hand sides by a single narrowing step.

(8) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

foldl(x, Cons(S(0), xs)) → foldl(S(x), xs) [1]
foldl(S(0), Cons(x, xs)) → foldl(S(x), xs) [1]
foldr(a, Cons(x, Cons(x', xs'))) → op(x, op(x', foldr(a, xs'))) [2]
foldr(a, Cons(x, Nil)) → op(x, a) [2]
foldr(a, Nil) → a [1]
foldl(a, Nil) → a [1]
notEmpty(Cons(x, xs)) → True [1]
notEmpty(Nil) → False [1]
op(x, S(0)) → S(x) [1]
op(S(0), y) → S(y) [1]
fold(a, xs) → Cons(foldl(a, xs), Cons(foldr(a, xs), Nil)) [1]
op(v0, v1) → 0 [0]

The TRS has the following type information:
foldl :: 0:S → Cons:Nil → 0:S
Cons :: 0:S → Cons:Nil → Cons:Nil
S :: 0:S → 0:S
0 :: 0:S
foldr :: 0:S → Cons:Nil → 0:S
op :: 0:S → 0:S → 0:S
Nil :: Cons:Nil
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
fold :: 0:S → Cons:Nil → Cons:Nil

Rewrite Strategy: INNERMOST

(9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

0 => 0
Nil => 0
True => 1
False => 0

(10) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 1 }→ 1 + foldl(a, xs) + (1 + foldr(a, xs) + 0) :|: z = a, xs >= 0, a >= 0, z' = xs
foldl(z, z') -{ 1 }→ a :|: z = a, a >= 0, z' = 0
foldl(z, z') -{ 1 }→ foldl(1 + x, xs) :|: z' = 1 + (1 + 0) + xs, xs >= 0, x >= 0, z = x
foldl(z, z') -{ 1 }→ foldl(1 + x, xs) :|: xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldr(z, z') -{ 1 }→ a :|: z = a, a >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, a) :|: z = a, a >= 0, x >= 0, z' = 1 + x + 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(a, xs'))) :|: z = a, a >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
op(z, z') -{ 1 }→ 1 + x :|: x >= 0, z' = 1 + 0, z = x
op(z, z') -{ 1 }→ 1 + y :|: z = 1 + 0, y >= 0, z' = y

(11) InliningProof (UPPER BOUND(ID) transformation)

Inlined the following terminating rules on right-hand sides where appropriate:

op(z, z') -{ 1 }→ 1 + x :|: x >= 0, z' = 1 + 0, z = x
op(z, z') -{ 1 }→ 1 + y :|: z = 1 + 0, y >= 0, z' = y
op(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1

(12) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 1 }→ 1 + foldl(a, xs) + (1 + foldr(a, xs) + 0) :|: z = a, xs >= 0, a >= 0, z' = xs
foldl(z, z') -{ 1 }→ a :|: z = a, a >= 0, z' = 0
foldl(z, z') -{ 1 }→ foldl(1 + x, xs) :|: z' = 1 + (1 + 0) + xs, xs >= 0, x >= 0, z = x
foldl(z, z') -{ 1 }→ foldl(1 + x, xs) :|: xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldr(z, z') -{ 1 }→ a :|: z = a, a >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(a, xs'))) :|: z = a, a >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z = a, a >= 0, x >= 0, z' = 1 + x + 0, v0 >= 0, v1 >= 0, x = v0, a = v1
foldr(z, z') -{ 3 }→ 1 + x' :|: z = a, a >= 0, x >= 0, z' = 1 + x + 0, x' >= 0, a = 1 + 0, x = x'
foldr(z, z') -{ 3 }→ 1 + y :|: z = a, a >= 0, x >= 0, z' = 1 + x + 0, x = 1 + 0, y >= 0, a = y
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
op(z, z') -{ 1 }→ 1 + x :|: x >= 0, z' = 1 + 0, z = x
op(z, z') -{ 1 }→ 1 + y :|: z = 1 + 0, y >= 0, z' = y

(13) SimplificationProof (BOTH BOUNDS(ID, ID) transformation)

Simplified the RNTS by moving equalities from the constraints into the right-hand sides.

(14) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 1 }→ 1 + foldl(z, z') + (1 + foldr(z, z') + 0) :|: z' >= 0, z >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldl(z, z') -{ 1 }→ foldl(1 + x, xs) :|: xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ foldl(1 + z, z' - 2) :|: z' - 2 >= 0, z >= 0
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(z, xs'))) :|: z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

(15) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID) transformation)

Found the following analysis order by SCC decomposition:

{ foldl }
{ notEmpty }
{ op }
{ foldr }
{ fold }

(16) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 1 }→ 1 + foldl(z, z') + (1 + foldr(z, z') + 0) :|: z' >= 0, z >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldl(z, z') -{ 1 }→ foldl(1 + x, xs) :|: xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ foldl(1 + z, z' - 2) :|: z' - 2 >= 0, z >= 0
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(z, xs'))) :|: z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {foldl}, {notEmpty}, {op}, {foldr}, {fold}

(17) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: foldl
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z + z'

(18) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 1 }→ 1 + foldl(z, z') + (1 + foldr(z, z') + 0) :|: z' >= 0, z >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldl(z, z') -{ 1 }→ foldl(1 + x, xs) :|: xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ foldl(1 + z, z' - 2) :|: z' - 2 >= 0, z >= 0
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(z, xs'))) :|: z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {foldl}, {notEmpty}, {op}, {foldr}, {fold}
Previous analysis results are:
foldl: runtime: ?, size: O(n1) [z + z']

(19) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: foldl
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z'

(20) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 1 }→ 1 + foldl(z, z') + (1 + foldr(z, z') + 0) :|: z' >= 0, z >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldl(z, z') -{ 1 }→ foldl(1 + x, xs) :|: xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ foldl(1 + z, z' - 2) :|: z' - 2 >= 0, z >= 0
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(z, xs'))) :|: z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {notEmpty}, {op}, {foldr}, {fold}
Previous analysis results are:
foldl: runtime: O(n1) [1 + z'], size: O(n1) [z + z']

(21) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(22) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 2 + z' }→ 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= 1 * z + 1 * z', z' >= 0, z >= 0
foldl(z, z') -{ z' }→ s :|: s >= 0, s <= 1 * (1 + z) + 1 * (z' - 2), z' - 2 >= 0, z >= 0
foldl(z, z') -{ 2 + xs }→ s' :|: s' >= 0, s' <= 1 * (1 + x) + 1 * xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(z, xs'))) :|: z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {notEmpty}, {op}, {foldr}, {fold}
Previous analysis results are:
foldl: runtime: O(n1) [1 + z'], size: O(n1) [z + z']

(23) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: notEmpty
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(24) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 2 + z' }→ 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= 1 * z + 1 * z', z' >= 0, z >= 0
foldl(z, z') -{ z' }→ s :|: s >= 0, s <= 1 * (1 + z) + 1 * (z' - 2), z' - 2 >= 0, z >= 0
foldl(z, z') -{ 2 + xs }→ s' :|: s' >= 0, s' <= 1 * (1 + x) + 1 * xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(z, xs'))) :|: z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {notEmpty}, {op}, {foldr}, {fold}
Previous analysis results are:
foldl: runtime: O(n1) [1 + z'], size: O(n1) [z + z']
notEmpty: runtime: ?, size: O(1) [1]

(25) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: notEmpty
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(26) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 2 + z' }→ 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= 1 * z + 1 * z', z' >= 0, z >= 0
foldl(z, z') -{ z' }→ s :|: s >= 0, s <= 1 * (1 + z) + 1 * (z' - 2), z' - 2 >= 0, z >= 0
foldl(z, z') -{ 2 + xs }→ s' :|: s' >= 0, s' <= 1 * (1 + x) + 1 * xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(z, xs'))) :|: z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {op}, {foldr}, {fold}
Previous analysis results are:
foldl: runtime: O(n1) [1 + z'], size: O(n1) [z + z']
notEmpty: runtime: O(1) [1], size: O(1) [1]

(27) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(28) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 2 + z' }→ 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= 1 * z + 1 * z', z' >= 0, z >= 0
foldl(z, z') -{ z' }→ s :|: s >= 0, s <= 1 * (1 + z) + 1 * (z' - 2), z' - 2 >= 0, z >= 0
foldl(z, z') -{ 2 + xs }→ s' :|: s' >= 0, s' <= 1 * (1 + x) + 1 * xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(z, xs'))) :|: z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {op}, {foldr}, {fold}
Previous analysis results are:
foldl: runtime: O(n1) [1 + z'], size: O(n1) [z + z']
notEmpty: runtime: O(1) [1], size: O(1) [1]

(29) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: op
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z + z'

(30) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 2 + z' }→ 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= 1 * z + 1 * z', z' >= 0, z >= 0
foldl(z, z') -{ z' }→ s :|: s >= 0, s <= 1 * (1 + z) + 1 * (z' - 2), z' - 2 >= 0, z >= 0
foldl(z, z') -{ 2 + xs }→ s' :|: s' >= 0, s' <= 1 * (1 + x) + 1 * xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(z, xs'))) :|: z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {op}, {foldr}, {fold}
Previous analysis results are:
foldl: runtime: O(n1) [1 + z'], size: O(n1) [z + z']
notEmpty: runtime: O(1) [1], size: O(1) [1]
op: runtime: ?, size: O(n1) [z + z']

(31) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: op
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(32) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 2 + z' }→ 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= 1 * z + 1 * z', z' >= 0, z >= 0
foldl(z, z') -{ z' }→ s :|: s >= 0, s <= 1 * (1 + z) + 1 * (z' - 2), z' - 2 >= 0, z >= 0
foldl(z, z') -{ 2 + xs }→ s' :|: s' >= 0, s' <= 1 * (1 + x) + 1 * xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(z, xs'))) :|: z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {foldr}, {fold}
Previous analysis results are:
foldl: runtime: O(n1) [1 + z'], size: O(n1) [z + z']
notEmpty: runtime: O(1) [1], size: O(1) [1]
op: runtime: O(1) [1], size: O(n1) [z + z']

(33) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(34) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 2 + z' }→ 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= 1 * z + 1 * z', z' >= 0, z >= 0
foldl(z, z') -{ z' }→ s :|: s >= 0, s <= 1 * (1 + z) + 1 * (z' - 2), z' - 2 >= 0, z >= 0
foldl(z, z') -{ 2 + xs }→ s' :|: s' >= 0, s' <= 1 * (1 + x) + 1 * xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(z, xs'))) :|: z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {foldr}, {fold}
Previous analysis results are:
foldl: runtime: O(n1) [1 + z'], size: O(n1) [z + z']
notEmpty: runtime: O(1) [1], size: O(1) [1]
op: runtime: O(1) [1], size: O(n1) [z + z']

(35) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: foldr
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z + z'

(36) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 2 + z' }→ 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= 1 * z + 1 * z', z' >= 0, z >= 0
foldl(z, z') -{ z' }→ s :|: s >= 0, s <= 1 * (1 + z) + 1 * (z' - 2), z' - 2 >= 0, z >= 0
foldl(z, z') -{ 2 + xs }→ s' :|: s' >= 0, s' <= 1 * (1 + x) + 1 * xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(z, xs'))) :|: z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {foldr}, {fold}
Previous analysis results are:
foldl: runtime: O(n1) [1 + z'], size: O(n1) [z + z']
notEmpty: runtime: O(1) [1], size: O(1) [1]
op: runtime: O(1) [1], size: O(n1) [z + z']
foldr: runtime: ?, size: O(n1) [z + z']

(37) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using PUBS for: foldr
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 3 + 4·z'

(38) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 2 + z' }→ 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= 1 * z + 1 * z', z' >= 0, z >= 0
foldl(z, z') -{ z' }→ s :|: s >= 0, s <= 1 * (1 + z) + 1 * (z' - 2), z' - 2 >= 0, z >= 0
foldl(z, z') -{ 2 + xs }→ s' :|: s' >= 0, s' <= 1 * (1 + x) + 1 * xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ op(x, op(x', foldr(z, xs'))) :|: z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {fold}
Previous analysis results are:
foldl: runtime: O(n1) [1 + z'], size: O(n1) [z + z']
notEmpty: runtime: O(1) [1], size: O(1) [1]
op: runtime: O(1) [1], size: O(n1) [z + z']
foldr: runtime: O(n1) [3 + 4·z'], size: O(n1) [z + z']

(39) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(40) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 5 + 5·z' }→ 1 + s'' + (1 + s1 + 0) :|: s1 >= 0, s1 <= 1 * z + 1 * z', s'' >= 0, s'' <= 1 * z + 1 * z', z' >= 0, z >= 0
foldl(z, z') -{ z' }→ s :|: s >= 0, s <= 1 * (1 + z) + 1 * (z' - 2), z' - 2 >= 0, z >= 0
foldl(z, z') -{ 2 + xs }→ s' :|: s' >= 0, s' <= 1 * (1 + x) + 1 * xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 7 + 4·xs' }→ s4 :|: s2 >= 0, s2 <= 1 * z + 1 * xs', s3 >= 0, s3 <= 1 * x' + 1 * s2, s4 >= 0, s4 <= 1 * x + 1 * s3, z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {fold}
Previous analysis results are:
foldl: runtime: O(n1) [1 + z'], size: O(n1) [z + z']
notEmpty: runtime: O(1) [1], size: O(1) [1]
op: runtime: O(1) [1], size: O(n1) [z + z']
foldr: runtime: O(n1) [3 + 4·z'], size: O(n1) [z + z']

(41) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: fold
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 2 + 2·z + 2·z'

(42) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 5 + 5·z' }→ 1 + s'' + (1 + s1 + 0) :|: s1 >= 0, s1 <= 1 * z + 1 * z', s'' >= 0, s'' <= 1 * z + 1 * z', z' >= 0, z >= 0
foldl(z, z') -{ z' }→ s :|: s >= 0, s <= 1 * (1 + z) + 1 * (z' - 2), z' - 2 >= 0, z >= 0
foldl(z, z') -{ 2 + xs }→ s' :|: s' >= 0, s' <= 1 * (1 + x) + 1 * xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 7 + 4·xs' }→ s4 :|: s2 >= 0, s2 <= 1 * z + 1 * xs', s3 >= 0, s3 <= 1 * x' + 1 * s2, s4 >= 0, s4 <= 1 * x + 1 * s3, z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed: {fold}
Previous analysis results are:
foldl: runtime: O(n1) [1 + z'], size: O(n1) [z + z']
notEmpty: runtime: O(1) [1], size: O(1) [1]
op: runtime: O(1) [1], size: O(n1) [z + z']
foldr: runtime: O(n1) [3 + 4·z'], size: O(n1) [z + z']
fold: runtime: ?, size: O(n1) [2 + 2·z + 2·z']

(43) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: fold
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 5 + 5·z'

(44) Obligation:

Complexity RNTS consisting of the following rules:

fold(z, z') -{ 5 + 5·z' }→ 1 + s'' + (1 + s1 + 0) :|: s1 >= 0, s1 <= 1 * z + 1 * z', s'' >= 0, s'' <= 1 * z + 1 * z', z' >= 0, z >= 0
foldl(z, z') -{ z' }→ s :|: s >= 0, s <= 1 * (1 + z) + 1 * (z' - 2), z' - 2 >= 0, z >= 0
foldl(z, z') -{ 2 + xs }→ s' :|: s' >= 0, s' <= 1 * (1 + x) + 1 * xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0
foldl(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 7 + 4·xs' }→ s4 :|: s2 >= 0, s2 <= 1 * z + 1 * xs', s3 >= 0, s3 <= 1 * x' + 1 * s2, s4 >= 0, s4 <= 1 * x + 1 * s3, z >= 0, x >= 0, x' >= 0, xs' >= 0, z' = 1 + x + (1 + x' + xs')
foldr(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
foldr(z, z') -{ 2 }→ 0 :|: z >= 0, z' - 1 >= 0, v0 >= 0, z' - 1 = v0
foldr(z, z') -{ 3 }→ 1 + x' :|: z >= 0, z' - 1 >= 0, x' >= 0, z = 1 + 0, z' - 1 = x'
foldr(z, z') -{ 3 }→ 1 + z :|: z >= 0, z' - 1 >= 0, z' - 1 = 1 + 0
notEmpty(z) -{ 1 }→ 1 :|: z = 1 + x + xs, xs >= 0, x >= 0
notEmpty(z) -{ 1 }→ 0 :|: z = 0
op(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
op(z, z') -{ 1 }→ 1 + z :|: z >= 0, z' = 1 + 0
op(z, z') -{ 1 }→ 1 + z' :|: z = 1 + 0, z' >= 0

Function symbols to be analyzed:
Previous analysis results are:
foldl: runtime: O(n1) [1 + z'], size: O(n1) [z + z']
notEmpty: runtime: O(1) [1], size: O(1) [1]
op: runtime: O(1) [1], size: O(n1) [z + z']
foldr: runtime: O(n1) [3 + 4·z'], size: O(n1) [z + z']
fold: runtime: O(n1) [5 + 5·z'], size: O(n1) [2 + 2·z + 2·z']

(45) FinalProof (EQUIVALENT transformation)

Computed overall runtime complexity

(46) BOUNDS(1, n^1)