WORST_CASE(?,O(n^1)) proof of input_XGTcvmtOF7.trs # AProVE Commit ID: aff8ecad908e01718a4c36e68d2e55d5e0f16e15 fuhs 20220216 unpublished The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1). (0) CpxTRS (1) RelTrsToWeightedTrsProof [UPPER BOUND(ID), 0 ms] (2) CpxWeightedTrs (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxTypedWeightedTrs (5) CompletionProof [UPPER BOUND(ID), 0 ms] (6) CpxTypedWeightedCompleteTrs (7) NarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxTypedWeightedCompleteTrs (9) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (10) CpxRNTS (11) InliningProof [UPPER BOUND(ID), 121 ms] (12) CpxRNTS (13) SimplificationProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxRNTS (15) CpxRntsAnalysisOrderProof [BOTH BOUNDS(ID, ID), 0 ms] (16) CpxRNTS (17) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (18) CpxRNTS (19) IntTrsBoundProof [UPPER BOUND(ID), 409 ms] (20) CpxRNTS (21) IntTrsBoundProof [UPPER BOUND(ID), 160 ms] (22) CpxRNTS (23) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (24) CpxRNTS (25) IntTrsBoundProof [UPPER BOUND(ID), 131 ms] (26) CpxRNTS (27) IntTrsBoundProof [UPPER BOUND(ID), 45 ms] (28) CpxRNTS (29) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (30) CpxRNTS (31) IntTrsBoundProof [UPPER BOUND(ID), 243 ms] (32) CpxRNTS (33) IntTrsBoundProof [UPPER BOUND(ID), 64 ms] (34) CpxRNTS (35) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (36) CpxRNTS (37) IntTrsBoundProof [UPPER BOUND(ID), 702 ms] (38) CpxRNTS (39) IntTrsBoundProof [UPPER BOUND(ID), 170 ms] (40) CpxRNTS (41) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (42) CpxRNTS (43) IntTrsBoundProof [UPPER BOUND(ID), 242 ms] (44) CpxRNTS (45) IntTrsBoundProof [UPPER BOUND(ID), 64 ms] (46) CpxRNTS (47) FinalProof [FINISHED, 0 ms] (48) BOUNDS(1, n^1) ---------------------------------------- (0) Obligation: The Runtime Complexity (parallel-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)) S is empty. Rewrite Strategy: PARALLEL_INNERMOST ---------------------------------------- (1) RelTrsToWeightedTrsProof (UPPER BOUND(ID)) Transformed relative 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)) 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)) 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_2 notEmpty_1 fold_2 (c) The following functions are completely defined: foldr_2 op_2 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)) 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)) 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)) 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)) 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)) 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) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (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} ---------------------------------------- (19) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using KoAT for: foldl after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: z + 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: {foldl}, {notEmpty}, {op}, {foldr}, {fold} Previous analysis results are: foldl: runtime: ?, size: O(n^1) [z + z'] ---------------------------------------- (21) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: foldl after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 1 + z' ---------------------------------------- (22) 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(n^1) [1 + z'], size: O(n^1) [z + z'] ---------------------------------------- (23) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (24) Obligation: Complexity RNTS consisting of the following rules: fold(z, z') -{ 2 + z' }-> 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= z + z', z' >= 0, z >= 0 foldl(z, z') -{ z' }-> s :|: s >= 0, s <= 1 + z + (z' - 2), z' - 2 >= 0, z >= 0 foldl(z, z') -{ 2 + xs }-> s' :|: s' >= 0, s' <= 1 + x + 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(n^1) [1 + z'], size: O(n^1) [z + z'] ---------------------------------------- (25) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE 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'' <= z + z', z' >= 0, z >= 0 foldl(z, z') -{ z' }-> s :|: s >= 0, s <= 1 + z + (z' - 2), z' - 2 >= 0, z >= 0 foldl(z, z') -{ 2 + xs }-> s' :|: s' >= 0, s' <= 1 + x + 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(n^1) [1 + z'], size: O(n^1) [z + z'] notEmpty: runtime: ?, size: O(1) [1] ---------------------------------------- (27) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: notEmpty after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 1 ---------------------------------------- (28) Obligation: Complexity RNTS consisting of the following rules: fold(z, z') -{ 2 + z' }-> 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= z + z', z' >= 0, z >= 0 foldl(z, z') -{ z' }-> s :|: s >= 0, s <= 1 + z + (z' - 2), z' - 2 >= 0, z >= 0 foldl(z, z') -{ 2 + xs }-> s' :|: s' >= 0, s' <= 1 + x + 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(n^1) [1 + z'], size: O(n^1) [z + z'] notEmpty: runtime: O(1) [1], size: O(1) [1] ---------------------------------------- (29) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (30) Obligation: Complexity RNTS consisting of the following rules: fold(z, z') -{ 2 + z' }-> 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= z + z', z' >= 0, z >= 0 foldl(z, z') -{ z' }-> s :|: s >= 0, s <= 1 + z + (z' - 2), z' - 2 >= 0, z >= 0 foldl(z, z') -{ 2 + xs }-> s' :|: s' >= 0, s' <= 1 + x + 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(n^1) [1 + z'], size: O(n^1) [z + z'] notEmpty: runtime: O(1) [1], size: O(1) [1] ---------------------------------------- (31) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using KoAT for: op after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: z + z' ---------------------------------------- (32) Obligation: Complexity RNTS consisting of the following rules: fold(z, z') -{ 2 + z' }-> 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= z + z', z' >= 0, z >= 0 foldl(z, z') -{ z' }-> s :|: s >= 0, s <= 1 + z + (z' - 2), z' - 2 >= 0, z >= 0 foldl(z, z') -{ 2 + xs }-> s' :|: s' >= 0, s' <= 1 + x + 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(n^1) [1 + z'], size: O(n^1) [z + z'] notEmpty: runtime: O(1) [1], size: O(1) [1] op: runtime: ?, size: O(n^1) [z + z'] ---------------------------------------- (33) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: op after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 1 ---------------------------------------- (34) Obligation: Complexity RNTS consisting of the following rules: fold(z, z') -{ 2 + z' }-> 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= z + z', z' >= 0, z >= 0 foldl(z, z') -{ z' }-> s :|: s >= 0, s <= 1 + z + (z' - 2), z' - 2 >= 0, z >= 0 foldl(z, z') -{ 2 + xs }-> s' :|: s' >= 0, s' <= 1 + x + 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(n^1) [1 + z'], size: O(n^1) [z + z'] notEmpty: runtime: O(1) [1], size: O(1) [1] op: runtime: O(1) [1], size: O(n^1) [z + z'] ---------------------------------------- (35) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (36) Obligation: Complexity RNTS consisting of the following rules: fold(z, z') -{ 2 + z' }-> 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= z + z', z' >= 0, z >= 0 foldl(z, z') -{ z' }-> s :|: s >= 0, s <= 1 + z + (z' - 2), z' - 2 >= 0, z >= 0 foldl(z, z') -{ 2 + xs }-> s' :|: s' >= 0, s' <= 1 + x + 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(n^1) [1 + z'], size: O(n^1) [z + z'] notEmpty: runtime: O(1) [1], size: O(1) [1] op: runtime: O(1) [1], size: O(n^1) [z + z'] ---------------------------------------- (37) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using KoAT for: foldr after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: z + 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'' <= z + z', z' >= 0, z >= 0 foldl(z, z') -{ z' }-> s :|: s >= 0, s <= 1 + z + (z' - 2), z' - 2 >= 0, z >= 0 foldl(z, z') -{ 2 + xs }-> s' :|: s' >= 0, s' <= 1 + x + 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(n^1) [1 + z'], size: O(n^1) [z + z'] notEmpty: runtime: O(1) [1], size: O(1) [1] op: runtime: O(1) [1], size: O(n^1) [z + z'] foldr: runtime: ?, size: O(n^1) [z + z'] ---------------------------------------- (39) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using KoAT for: foldr after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 9 + 4*z' ---------------------------------------- (40) Obligation: Complexity RNTS consisting of the following rules: fold(z, z') -{ 2 + z' }-> 1 + s'' + (1 + foldr(z, z') + 0) :|: s'' >= 0, s'' <= z + z', z' >= 0, z >= 0 foldl(z, z') -{ z' }-> s :|: s >= 0, s <= 1 + z + (z' - 2), z' - 2 >= 0, z >= 0 foldl(z, z') -{ 2 + xs }-> s' :|: s' >= 0, s' <= 1 + x + 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(n^1) [1 + z'], size: O(n^1) [z + z'] notEmpty: runtime: O(1) [1], size: O(1) [1] op: runtime: O(1) [1], size: O(n^1) [z + z'] foldr: runtime: O(n^1) [9 + 4*z'], size: O(n^1) [z + z'] ---------------------------------------- (41) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (42) Obligation: Complexity RNTS consisting of the following rules: fold(z, z') -{ 11 + 5*z' }-> 1 + s'' + (1 + s1 + 0) :|: s1 >= 0, s1 <= z + z', s'' >= 0, s'' <= z + z', z' >= 0, z >= 0 foldl(z, z') -{ z' }-> s :|: s >= 0, s <= 1 + z + (z' - 2), z' - 2 >= 0, z >= 0 foldl(z, z') -{ 2 + xs }-> s' :|: s' >= 0, s' <= 1 + x + xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0 foldl(z, z') -{ 1 }-> z :|: z >= 0, z' = 0 foldr(z, z') -{ 13 + 4*xs' }-> s4 :|: s2 >= 0, s2 <= z + xs', s3 >= 0, s3 <= x' + s2, s4 >= 0, s4 <= x + 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(n^1) [1 + z'], size: O(n^1) [z + z'] notEmpty: runtime: O(1) [1], size: O(1) [1] op: runtime: O(1) [1], size: O(n^1) [z + z'] foldr: runtime: O(n^1) [9 + 4*z'], size: O(n^1) [z + z'] ---------------------------------------- (43) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: fold after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 2 + 2*z + 2*z' ---------------------------------------- (44) Obligation: Complexity RNTS consisting of the following rules: fold(z, z') -{ 11 + 5*z' }-> 1 + s'' + (1 + s1 + 0) :|: s1 >= 0, s1 <= z + z', s'' >= 0, s'' <= z + z', z' >= 0, z >= 0 foldl(z, z') -{ z' }-> s :|: s >= 0, s <= 1 + z + (z' - 2), z' - 2 >= 0, z >= 0 foldl(z, z') -{ 2 + xs }-> s' :|: s' >= 0, s' <= 1 + x + xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0 foldl(z, z') -{ 1 }-> z :|: z >= 0, z' = 0 foldr(z, z') -{ 13 + 4*xs' }-> s4 :|: s2 >= 0, s2 <= z + xs', s3 >= 0, s3 <= x' + s2, s4 >= 0, s4 <= x + 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(n^1) [1 + z'], size: O(n^1) [z + z'] notEmpty: runtime: O(1) [1], size: O(1) [1] op: runtime: O(1) [1], size: O(n^1) [z + z'] foldr: runtime: O(n^1) [9 + 4*z'], size: O(n^1) [z + z'] fold: runtime: ?, size: O(n^1) [2 + 2*z + 2*z'] ---------------------------------------- (45) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: fold after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 11 + 5*z' ---------------------------------------- (46) Obligation: Complexity RNTS consisting of the following rules: fold(z, z') -{ 11 + 5*z' }-> 1 + s'' + (1 + s1 + 0) :|: s1 >= 0, s1 <= z + z', s'' >= 0, s'' <= z + z', z' >= 0, z >= 0 foldl(z, z') -{ z' }-> s :|: s >= 0, s <= 1 + z + (z' - 2), z' - 2 >= 0, z >= 0 foldl(z, z') -{ 2 + xs }-> s' :|: s' >= 0, s' <= 1 + x + xs, xs >= 0, z' = 1 + x + xs, z = 1 + 0, x >= 0 foldl(z, z') -{ 1 }-> z :|: z >= 0, z' = 0 foldr(z, z') -{ 13 + 4*xs' }-> s4 :|: s2 >= 0, s2 <= z + xs', s3 >= 0, s3 <= x' + s2, s4 >= 0, s4 <= x + 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(n^1) [1 + z'], size: O(n^1) [z + z'] notEmpty: runtime: O(1) [1], size: O(1) [1] op: runtime: O(1) [1], size: O(n^1) [z + z'] foldr: runtime: O(n^1) [9 + 4*z'], size: O(n^1) [z + z'] fold: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [2 + 2*z + 2*z'] ---------------------------------------- (47) FinalProof (FINISHED) Computed overall runtime complexity ---------------------------------------- (48) BOUNDS(1, n^1)