WORST_CASE(Omega(n^1),O(n^1)) proof of input_4MB1FDdGiX.trs # AProVE Commit ID: aff8ecad908e01718a4c36e68d2e55d5e0f16e15 fuhs 20220216 unpublished The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^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) SimplificationProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxRNTS (13) CpxRntsAnalysisOrderProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxRNTS (15) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (16) CpxRNTS (17) IntTrsBoundProof [UPPER BOUND(ID), 1294 ms] (18) CpxRNTS (19) IntTrsBoundProof [UPPER BOUND(ID), 494 ms] (20) CpxRNTS (21) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (22) CpxRNTS (23) IntTrsBoundProof [UPPER BOUND(ID), 157 ms] (24) CpxRNTS (25) IntTrsBoundProof [UPPER BOUND(ID), 52 ms] (26) CpxRNTS (27) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (28) CpxRNTS (29) IntTrsBoundProof [UPPER BOUND(ID), 177 ms] (30) CpxRNTS (31) IntTrsBoundProof [UPPER BOUND(ID), 42 ms] (32) CpxRNTS (33) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (34) CpxRNTS (35) IntTrsBoundProof [UPPER BOUND(ID), 147 ms] (36) CpxRNTS (37) IntTrsBoundProof [UPPER BOUND(ID), 52 ms] (38) CpxRNTS (39) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (40) CpxRNTS (41) IntTrsBoundProof [UPPER BOUND(ID), 129 ms] (42) CpxRNTS (43) IntTrsBoundProof [UPPER BOUND(ID), 52 ms] (44) CpxRNTS (45) FinalProof [FINISHED, 0 ms] (46) BOUNDS(1, n^1) (47) CpxTrsToCdtProof [BOTH BOUNDS(ID, ID), 0 ms] (48) CdtProblem (49) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (50) CpxRelTRS (51) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (52) CpxRelTRS (53) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (54) typed CpxTrs (55) OrderProof [LOWER BOUND(ID), 11 ms] (56) typed CpxTrs (57) RewriteLemmaProof [LOWER BOUND(ID), 1612 ms] (58) BEST (59) proven lower bound (60) LowerBoundPropagationProof [FINISHED, 0 ms] (61) BOUNDS(n^1, INF) (62) typed CpxTrs (63) RewriteLemmaProof [LOWER BOUND(ID), 21 ms] (64) BOUNDS(1, INF) ---------------------------------------- (0) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: nonZero(0) -> false nonZero(s(x)) -> true p(0) -> 0 p(s(x)) -> x id_inc(x) -> x id_inc(x) -> s(x) random(x) -> rand(x, 0) rand(x, y) -> if(nonZero(x), x, y) if(false, x, y) -> y if(true, x, y) -> rand(p(x), id_inc(y)) 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: nonZero(0) -> false [1] nonZero(s(x)) -> true [1] p(0) -> 0 [1] p(s(x)) -> x [1] id_inc(x) -> x [1] id_inc(x) -> s(x) [1] random(x) -> rand(x, 0) [1] rand(x, y) -> if(nonZero(x), x, y) [1] if(false, x, y) -> y [1] if(true, x, y) -> rand(p(x), id_inc(y)) [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: nonZero(0) -> false [1] nonZero(s(x)) -> true [1] p(0) -> 0 [1] p(s(x)) -> x [1] id_inc(x) -> x [1] id_inc(x) -> s(x) [1] random(x) -> rand(x, 0) [1] rand(x, y) -> if(nonZero(x), x, y) [1] if(false, x, y) -> y [1] if(true, x, y) -> rand(p(x), id_inc(y)) [1] The TRS has the following type information: nonZero :: 0:s -> false:true 0 :: 0:s false :: false:true s :: 0:s -> 0:s true :: false:true p :: 0:s -> 0:s id_inc :: 0:s -> 0:s random :: 0:s -> 0:s rand :: 0:s -> 0:s -> 0:s if :: false:true -> 0:s -> 0:s -> 0:s 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: random_1 rand_2 if_3 (c) The following functions are completely defined: p_1 id_inc_1 nonZero_1 Due to the following rules being added: none 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: nonZero(0) -> false [1] nonZero(s(x)) -> true [1] p(0) -> 0 [1] p(s(x)) -> x [1] id_inc(x) -> x [1] id_inc(x) -> s(x) [1] random(x) -> rand(x, 0) [1] rand(x, y) -> if(nonZero(x), x, y) [1] if(false, x, y) -> y [1] if(true, x, y) -> rand(p(x), id_inc(y)) [1] The TRS has the following type information: nonZero :: 0:s -> false:true 0 :: 0:s false :: false:true s :: 0:s -> 0:s true :: false:true p :: 0:s -> 0:s id_inc :: 0:s -> 0:s random :: 0:s -> 0:s rand :: 0:s -> 0:s -> 0:s if :: false:true -> 0:s -> 0:s -> 0:s 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: nonZero(0) -> false [1] nonZero(s(x)) -> true [1] p(0) -> 0 [1] p(s(x)) -> x [1] id_inc(x) -> x [1] id_inc(x) -> s(x) [1] random(x) -> rand(x, 0) [1] rand(0, y) -> if(false, 0, y) [2] rand(s(x'), y) -> if(true, s(x'), y) [2] if(false, x, y) -> y [1] if(true, 0, y) -> rand(0, y) [3] if(true, 0, y) -> rand(0, s(y)) [3] if(true, s(x''), y) -> rand(x'', y) [3] if(true, s(x''), y) -> rand(x'', s(y)) [3] The TRS has the following type information: nonZero :: 0:s -> false:true 0 :: 0:s false :: false:true s :: 0:s -> 0:s true :: false:true p :: 0:s -> 0:s id_inc :: 0:s -> 0:s random :: 0:s -> 0:s rand :: 0:s -> 0:s -> 0:s if :: false:true -> 0:s -> 0:s -> 0:s 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 false => 0 true => 1 ---------------------------------------- (10) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> x :|: x >= 0, z = x id_inc(z) -{ 1 }-> 1 + x :|: x >= 0, z = x if(z, z', z'') -{ 1 }-> y :|: z' = x, z'' = y, x >= 0, y >= 0, z = 0 if(z, z', z'') -{ 3 }-> rand(x'', y) :|: z' = 1 + x'', z'' = y, z = 1, y >= 0, x'' >= 0 if(z, z', z'') -{ 3 }-> rand(x'', 1 + y) :|: z' = 1 + x'', z'' = y, z = 1, y >= 0, x'' >= 0 if(z, z', z'') -{ 3 }-> rand(0, y) :|: z'' = y, z = 1, y >= 0, z' = 0 if(z, z', z'') -{ 3 }-> rand(0, 1 + y) :|: z'' = y, z = 1, y >= 0, z' = 0 nonZero(z) -{ 1 }-> 1 :|: x >= 0, z = 1 + x nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> x :|: x >= 0, z = 1 + x p(z) -{ 1 }-> 0 :|: z = 0 rand(z, z') -{ 2 }-> if(1, 1 + x', y) :|: z = 1 + x', x' >= 0, y >= 0, z' = y rand(z, z') -{ 2 }-> if(0, 0, y) :|: y >= 0, z = 0, z' = y random(z) -{ 1 }-> rand(x, 0) :|: x >= 0, z = x ---------------------------------------- (11) SimplificationProof (BOTH BOUNDS(ID, ID)) Simplified the RNTS by moving equalities from the constraints into the right-hand sides. ---------------------------------------- (12) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 if(z, z', z'') -{ 3 }-> rand(0, z'') :|: z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 3 }-> rand(0, 1 + z'') :|: z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 3 }-> rand(z' - 1, z'') :|: z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 3 }-> rand(z' - 1, 1 + z'') :|: z = 1, z'' >= 0, z' - 1 >= 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 2 }-> if(1, 1 + (z - 1), z') :|: z - 1 >= 0, z' >= 0 rand(z, z') -{ 2 }-> if(0, 0, z') :|: z' >= 0, z = 0 random(z) -{ 1 }-> rand(z, 0) :|: z >= 0 ---------------------------------------- (13) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID)) Found the following analysis order by SCC decomposition: { if, rand } { nonZero } { id_inc } { p } { random } ---------------------------------------- (14) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 if(z, z', z'') -{ 3 }-> rand(0, z'') :|: z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 3 }-> rand(0, 1 + z'') :|: z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 3 }-> rand(z' - 1, z'') :|: z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 3 }-> rand(z' - 1, 1 + z'') :|: z = 1, z'' >= 0, z' - 1 >= 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 2 }-> if(1, 1 + (z - 1), z') :|: z - 1 >= 0, z' >= 0 rand(z, z') -{ 2 }-> if(0, 0, z') :|: z' >= 0, z = 0 random(z) -{ 1 }-> rand(z, 0) :|: z >= 0 Function symbols to be analyzed: {if,rand}, {nonZero}, {id_inc}, {p}, {random} ---------------------------------------- (15) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 if(z, z', z'') -{ 3 }-> rand(0, z'') :|: z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 3 }-> rand(0, 1 + z'') :|: z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 3 }-> rand(z' - 1, z'') :|: z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 3 }-> rand(z' - 1, 1 + z'') :|: z = 1, z'' >= 0, z' - 1 >= 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 2 }-> if(1, 1 + (z - 1), z') :|: z - 1 >= 0, z' >= 0 rand(z, z') -{ 2 }-> if(0, 0, z') :|: z' >= 0, z = 0 random(z) -{ 1 }-> rand(z, 0) :|: z >= 0 Function symbols to be analyzed: {if,rand}, {nonZero}, {id_inc}, {p}, {random} ---------------------------------------- (17) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: if after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 1 + z' + z'' Computed SIZE bound using CoFloCo for: rand after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 1 + z + z' ---------------------------------------- (18) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 if(z, z', z'') -{ 3 }-> rand(0, z'') :|: z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 3 }-> rand(0, 1 + z'') :|: z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 3 }-> rand(z' - 1, z'') :|: z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 3 }-> rand(z' - 1, 1 + z'') :|: z = 1, z'' >= 0, z' - 1 >= 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 2 }-> if(1, 1 + (z - 1), z') :|: z - 1 >= 0, z' >= 0 rand(z, z') -{ 2 }-> if(0, 0, z') :|: z' >= 0, z = 0 random(z) -{ 1 }-> rand(z, 0) :|: z >= 0 Function symbols to be analyzed: {if,rand}, {nonZero}, {id_inc}, {p}, {random} Previous analysis results are: if: runtime: ?, size: O(n^1) [1 + z' + z''] rand: runtime: ?, size: O(n^1) [1 + z + z'] ---------------------------------------- (19) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: if after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 11 + 5*z' Computed RUNTIME bound using CoFloCo for: rand after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 13 + 5*z ---------------------------------------- (20) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 if(z, z', z'') -{ 3 }-> rand(0, z'') :|: z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 3 }-> rand(0, 1 + z'') :|: z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 3 }-> rand(z' - 1, z'') :|: z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 3 }-> rand(z' - 1, 1 + z'') :|: z = 1, z'' >= 0, z' - 1 >= 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 2 }-> if(1, 1 + (z - 1), z') :|: z - 1 >= 0, z' >= 0 rand(z, z') -{ 2 }-> if(0, 0, z') :|: z' >= 0, z = 0 random(z) -{ 1 }-> rand(z, 0) :|: z >= 0 Function symbols to be analyzed: {nonZero}, {id_inc}, {p}, {random} Previous analysis results are: if: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [1 + z' + z''] rand: runtime: O(n^1) [13 + 5*z], size: O(n^1) [1 + z + z'] ---------------------------------------- (21) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (22) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 16 }-> s1 :|: s1 >= 0, s1 <= 0 + z'' + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 16 }-> s2 :|: s2 >= 0, s2 <= 0 + (1 + z'') + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 11 + 5*z' }-> s3 :|: s3 >= 0, s3 <= z' - 1 + z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 11 + 5*z' }-> s4 :|: s4 >= 0, s4 <= z' - 1 + (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 13 }-> s' :|: s' >= 0, s' <= z' + 1 + 0, z' >= 0, z = 0 rand(z, z') -{ 13 + 5*z }-> s'' :|: s'' >= 0, s'' <= z' + 1 + (1 + (z - 1)), z - 1 >= 0, z' >= 0 random(z) -{ 14 + 5*z }-> s :|: s >= 0, s <= z + 0 + 1, z >= 0 Function symbols to be analyzed: {nonZero}, {id_inc}, {p}, {random} Previous analysis results are: if: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [1 + z' + z''] rand: runtime: O(n^1) [13 + 5*z], size: O(n^1) [1 + z + z'] ---------------------------------------- (23) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: nonZero 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: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 16 }-> s1 :|: s1 >= 0, s1 <= 0 + z'' + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 16 }-> s2 :|: s2 >= 0, s2 <= 0 + (1 + z'') + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 11 + 5*z' }-> s3 :|: s3 >= 0, s3 <= z' - 1 + z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 11 + 5*z' }-> s4 :|: s4 >= 0, s4 <= z' - 1 + (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 13 }-> s' :|: s' >= 0, s' <= z' + 1 + 0, z' >= 0, z = 0 rand(z, z') -{ 13 + 5*z }-> s'' :|: s'' >= 0, s'' <= z' + 1 + (1 + (z - 1)), z - 1 >= 0, z' >= 0 random(z) -{ 14 + 5*z }-> s :|: s >= 0, s <= z + 0 + 1, z >= 0 Function symbols to be analyzed: {nonZero}, {id_inc}, {p}, {random} Previous analysis results are: if: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [1 + z' + z''] rand: runtime: O(n^1) [13 + 5*z], size: O(n^1) [1 + z + z'] nonZero: runtime: ?, size: O(1) [1] ---------------------------------------- (25) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: nonZero 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: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 16 }-> s1 :|: s1 >= 0, s1 <= 0 + z'' + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 16 }-> s2 :|: s2 >= 0, s2 <= 0 + (1 + z'') + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 11 + 5*z' }-> s3 :|: s3 >= 0, s3 <= z' - 1 + z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 11 + 5*z' }-> s4 :|: s4 >= 0, s4 <= z' - 1 + (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 13 }-> s' :|: s' >= 0, s' <= z' + 1 + 0, z' >= 0, z = 0 rand(z, z') -{ 13 + 5*z }-> s'' :|: s'' >= 0, s'' <= z' + 1 + (1 + (z - 1)), z - 1 >= 0, z' >= 0 random(z) -{ 14 + 5*z }-> s :|: s >= 0, s <= z + 0 + 1, z >= 0 Function symbols to be analyzed: {id_inc}, {p}, {random} Previous analysis results are: if: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [1 + z' + z''] rand: runtime: O(n^1) [13 + 5*z], size: O(n^1) [1 + z + z'] nonZero: runtime: O(1) [1], size: O(1) [1] ---------------------------------------- (27) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (28) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 16 }-> s1 :|: s1 >= 0, s1 <= 0 + z'' + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 16 }-> s2 :|: s2 >= 0, s2 <= 0 + (1 + z'') + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 11 + 5*z' }-> s3 :|: s3 >= 0, s3 <= z' - 1 + z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 11 + 5*z' }-> s4 :|: s4 >= 0, s4 <= z' - 1 + (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 13 }-> s' :|: s' >= 0, s' <= z' + 1 + 0, z' >= 0, z = 0 rand(z, z') -{ 13 + 5*z }-> s'' :|: s'' >= 0, s'' <= z' + 1 + (1 + (z - 1)), z - 1 >= 0, z' >= 0 random(z) -{ 14 + 5*z }-> s :|: s >= 0, s <= z + 0 + 1, z >= 0 Function symbols to be analyzed: {id_inc}, {p}, {random} Previous analysis results are: if: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [1 + z' + z''] rand: runtime: O(n^1) [13 + 5*z], size: O(n^1) [1 + z + z'] nonZero: runtime: O(1) [1], size: O(1) [1] ---------------------------------------- (29) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: id_inc after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 1 + z ---------------------------------------- (30) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 16 }-> s1 :|: s1 >= 0, s1 <= 0 + z'' + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 16 }-> s2 :|: s2 >= 0, s2 <= 0 + (1 + z'') + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 11 + 5*z' }-> s3 :|: s3 >= 0, s3 <= z' - 1 + z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 11 + 5*z' }-> s4 :|: s4 >= 0, s4 <= z' - 1 + (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 13 }-> s' :|: s' >= 0, s' <= z' + 1 + 0, z' >= 0, z = 0 rand(z, z') -{ 13 + 5*z }-> s'' :|: s'' >= 0, s'' <= z' + 1 + (1 + (z - 1)), z - 1 >= 0, z' >= 0 random(z) -{ 14 + 5*z }-> s :|: s >= 0, s <= z + 0 + 1, z >= 0 Function symbols to be analyzed: {id_inc}, {p}, {random} Previous analysis results are: if: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [1 + z' + z''] rand: runtime: O(n^1) [13 + 5*z], size: O(n^1) [1 + z + z'] nonZero: runtime: O(1) [1], size: O(1) [1] id_inc: runtime: ?, size: O(n^1) [1 + z] ---------------------------------------- (31) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: id_inc 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: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 16 }-> s1 :|: s1 >= 0, s1 <= 0 + z'' + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 16 }-> s2 :|: s2 >= 0, s2 <= 0 + (1 + z'') + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 11 + 5*z' }-> s3 :|: s3 >= 0, s3 <= z' - 1 + z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 11 + 5*z' }-> s4 :|: s4 >= 0, s4 <= z' - 1 + (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 13 }-> s' :|: s' >= 0, s' <= z' + 1 + 0, z' >= 0, z = 0 rand(z, z') -{ 13 + 5*z }-> s'' :|: s'' >= 0, s'' <= z' + 1 + (1 + (z - 1)), z - 1 >= 0, z' >= 0 random(z) -{ 14 + 5*z }-> s :|: s >= 0, s <= z + 0 + 1, z >= 0 Function symbols to be analyzed: {p}, {random} Previous analysis results are: if: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [1 + z' + z''] rand: runtime: O(n^1) [13 + 5*z], size: O(n^1) [1 + z + z'] nonZero: runtime: O(1) [1], size: O(1) [1] id_inc: runtime: O(1) [1], size: O(n^1) [1 + z] ---------------------------------------- (33) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (34) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 16 }-> s1 :|: s1 >= 0, s1 <= 0 + z'' + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 16 }-> s2 :|: s2 >= 0, s2 <= 0 + (1 + z'') + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 11 + 5*z' }-> s3 :|: s3 >= 0, s3 <= z' - 1 + z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 11 + 5*z' }-> s4 :|: s4 >= 0, s4 <= z' - 1 + (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 13 }-> s' :|: s' >= 0, s' <= z' + 1 + 0, z' >= 0, z = 0 rand(z, z') -{ 13 + 5*z }-> s'' :|: s'' >= 0, s'' <= z' + 1 + (1 + (z - 1)), z - 1 >= 0, z' >= 0 random(z) -{ 14 + 5*z }-> s :|: s >= 0, s <= z + 0 + 1, z >= 0 Function symbols to be analyzed: {p}, {random} Previous analysis results are: if: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [1 + z' + z''] rand: runtime: O(n^1) [13 + 5*z], size: O(n^1) [1 + z + z'] nonZero: runtime: O(1) [1], size: O(1) [1] id_inc: runtime: O(1) [1], size: O(n^1) [1 + z] ---------------------------------------- (35) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using KoAT for: p after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: z ---------------------------------------- (36) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 16 }-> s1 :|: s1 >= 0, s1 <= 0 + z'' + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 16 }-> s2 :|: s2 >= 0, s2 <= 0 + (1 + z'') + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 11 + 5*z' }-> s3 :|: s3 >= 0, s3 <= z' - 1 + z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 11 + 5*z' }-> s4 :|: s4 >= 0, s4 <= z' - 1 + (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 13 }-> s' :|: s' >= 0, s' <= z' + 1 + 0, z' >= 0, z = 0 rand(z, z') -{ 13 + 5*z }-> s'' :|: s'' >= 0, s'' <= z' + 1 + (1 + (z - 1)), z - 1 >= 0, z' >= 0 random(z) -{ 14 + 5*z }-> s :|: s >= 0, s <= z + 0 + 1, z >= 0 Function symbols to be analyzed: {p}, {random} Previous analysis results are: if: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [1 + z' + z''] rand: runtime: O(n^1) [13 + 5*z], size: O(n^1) [1 + z + z'] nonZero: runtime: O(1) [1], size: O(1) [1] id_inc: runtime: O(1) [1], size: O(n^1) [1 + z] p: runtime: ?, size: O(n^1) [z] ---------------------------------------- (37) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: p after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 1 ---------------------------------------- (38) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 16 }-> s1 :|: s1 >= 0, s1 <= 0 + z'' + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 16 }-> s2 :|: s2 >= 0, s2 <= 0 + (1 + z'') + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 11 + 5*z' }-> s3 :|: s3 >= 0, s3 <= z' - 1 + z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 11 + 5*z' }-> s4 :|: s4 >= 0, s4 <= z' - 1 + (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 13 }-> s' :|: s' >= 0, s' <= z' + 1 + 0, z' >= 0, z = 0 rand(z, z') -{ 13 + 5*z }-> s'' :|: s'' >= 0, s'' <= z' + 1 + (1 + (z - 1)), z - 1 >= 0, z' >= 0 random(z) -{ 14 + 5*z }-> s :|: s >= 0, s <= z + 0 + 1, z >= 0 Function symbols to be analyzed: {random} Previous analysis results are: if: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [1 + z' + z''] rand: runtime: O(n^1) [13 + 5*z], size: O(n^1) [1 + z + z'] nonZero: runtime: O(1) [1], size: O(1) [1] id_inc: runtime: O(1) [1], size: O(n^1) [1 + z] p: runtime: O(1) [1], size: O(n^1) [z] ---------------------------------------- (39) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (40) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 16 }-> s1 :|: s1 >= 0, s1 <= 0 + z'' + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 16 }-> s2 :|: s2 >= 0, s2 <= 0 + (1 + z'') + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 11 + 5*z' }-> s3 :|: s3 >= 0, s3 <= z' - 1 + z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 11 + 5*z' }-> s4 :|: s4 >= 0, s4 <= z' - 1 + (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 13 }-> s' :|: s' >= 0, s' <= z' + 1 + 0, z' >= 0, z = 0 rand(z, z') -{ 13 + 5*z }-> s'' :|: s'' >= 0, s'' <= z' + 1 + (1 + (z - 1)), z - 1 >= 0, z' >= 0 random(z) -{ 14 + 5*z }-> s :|: s >= 0, s <= z + 0 + 1, z >= 0 Function symbols to be analyzed: {random} Previous analysis results are: if: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [1 + z' + z''] rand: runtime: O(n^1) [13 + 5*z], size: O(n^1) [1 + z + z'] nonZero: runtime: O(1) [1], size: O(1) [1] id_inc: runtime: O(1) [1], size: O(n^1) [1 + z] p: runtime: O(1) [1], size: O(n^1) [z] ---------------------------------------- (41) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: random after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 1 + z ---------------------------------------- (42) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 16 }-> s1 :|: s1 >= 0, s1 <= 0 + z'' + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 16 }-> s2 :|: s2 >= 0, s2 <= 0 + (1 + z'') + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 11 + 5*z' }-> s3 :|: s3 >= 0, s3 <= z' - 1 + z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 11 + 5*z' }-> s4 :|: s4 >= 0, s4 <= z' - 1 + (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 13 }-> s' :|: s' >= 0, s' <= z' + 1 + 0, z' >= 0, z = 0 rand(z, z') -{ 13 + 5*z }-> s'' :|: s'' >= 0, s'' <= z' + 1 + (1 + (z - 1)), z - 1 >= 0, z' >= 0 random(z) -{ 14 + 5*z }-> s :|: s >= 0, s <= z + 0 + 1, z >= 0 Function symbols to be analyzed: {random} Previous analysis results are: if: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [1 + z' + z''] rand: runtime: O(n^1) [13 + 5*z], size: O(n^1) [1 + z + z'] nonZero: runtime: O(1) [1], size: O(1) [1] id_inc: runtime: O(1) [1], size: O(n^1) [1 + z] p: runtime: O(1) [1], size: O(n^1) [z] random: runtime: ?, size: O(n^1) [1 + z] ---------------------------------------- (43) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: random after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 14 + 5*z ---------------------------------------- (44) Obligation: Complexity RNTS consisting of the following rules: id_inc(z) -{ 1 }-> z :|: z >= 0 id_inc(z) -{ 1 }-> 1 + z :|: z >= 0 if(z, z', z'') -{ 16 }-> s1 :|: s1 >= 0, s1 <= 0 + z'' + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 16 }-> s2 :|: s2 >= 0, s2 <= 0 + (1 + z'') + 1, z = 1, z'' >= 0, z' = 0 if(z, z', z'') -{ 11 + 5*z' }-> s3 :|: s3 >= 0, s3 <= z' - 1 + z'' + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 11 + 5*z' }-> s4 :|: s4 >= 0, s4 <= z' - 1 + (1 + z'') + 1, z = 1, z'' >= 0, z' - 1 >= 0 if(z, z', z'') -{ 1 }-> z'' :|: z' >= 0, z'' >= 0, z = 0 nonZero(z) -{ 1 }-> 1 :|: z - 1 >= 0 nonZero(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 1 }-> z - 1 :|: z - 1 >= 0 rand(z, z') -{ 13 }-> s' :|: s' >= 0, s' <= z' + 1 + 0, z' >= 0, z = 0 rand(z, z') -{ 13 + 5*z }-> s'' :|: s'' >= 0, s'' <= z' + 1 + (1 + (z - 1)), z - 1 >= 0, z' >= 0 random(z) -{ 14 + 5*z }-> s :|: s >= 0, s <= z + 0 + 1, z >= 0 Function symbols to be analyzed: Previous analysis results are: if: runtime: O(n^1) [11 + 5*z'], size: O(n^1) [1 + z' + z''] rand: runtime: O(n^1) [13 + 5*z], size: O(n^1) [1 + z + z'] nonZero: runtime: O(1) [1], size: O(1) [1] id_inc: runtime: O(1) [1], size: O(n^1) [1 + z] p: runtime: O(1) [1], size: O(n^1) [z] random: runtime: O(n^1) [14 + 5*z], size: O(n^1) [1 + z] ---------------------------------------- (45) FinalProof (FINISHED) Computed overall runtime complexity ---------------------------------------- (46) BOUNDS(1, n^1) ---------------------------------------- (47) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (48) Obligation: Complexity Dependency Tuples Problem Rules: nonZero(0) -> false nonZero(s(z0)) -> true p(0) -> 0 p(s(z0)) -> z0 id_inc(z0) -> z0 id_inc(z0) -> s(z0) random(z0) -> rand(z0, 0) rand(z0, z1) -> if(nonZero(z0), z0, z1) if(false, z0, z1) -> z1 if(true, z0, z1) -> rand(p(z0), id_inc(z1)) Tuples: NONZERO(0) -> c NONZERO(s(z0)) -> c1 P(0) -> c2 P(s(z0)) -> c3 ID_INC(z0) -> c4 ID_INC(z0) -> c5 RANDOM(z0) -> c6(RAND(z0, 0)) RAND(z0, z1) -> c7(IF(nonZero(z0), z0, z1), NONZERO(z0)) IF(false, z0, z1) -> c8 IF(true, z0, z1) -> c9(RAND(p(z0), id_inc(z1)), P(z0)) IF(true, z0, z1) -> c10(RAND(p(z0), id_inc(z1)), ID_INC(z1)) S tuples: NONZERO(0) -> c NONZERO(s(z0)) -> c1 P(0) -> c2 P(s(z0)) -> c3 ID_INC(z0) -> c4 ID_INC(z0) -> c5 RANDOM(z0) -> c6(RAND(z0, 0)) RAND(z0, z1) -> c7(IF(nonZero(z0), z0, z1), NONZERO(z0)) IF(false, z0, z1) -> c8 IF(true, z0, z1) -> c9(RAND(p(z0), id_inc(z1)), P(z0)) IF(true, z0, z1) -> c10(RAND(p(z0), id_inc(z1)), ID_INC(z1)) K tuples:none Defined Rule Symbols: nonZero_1, p_1, id_inc_1, random_1, rand_2, if_3 Defined Pair Symbols: NONZERO_1, P_1, ID_INC_1, RANDOM_1, RAND_2, IF_3 Compound Symbols: c, c1, c2, c3, c4, c5, c6_1, c7_2, c8, c9_2, c10_2 ---------------------------------------- (49) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (50) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: NONZERO(0) -> c NONZERO(s(z0)) -> c1 P(0) -> c2 P(s(z0)) -> c3 ID_INC(z0) -> c4 ID_INC(z0) -> c5 RANDOM(z0) -> c6(RAND(z0, 0)) RAND(z0, z1) -> c7(IF(nonZero(z0), z0, z1), NONZERO(z0)) IF(false, z0, z1) -> c8 IF(true, z0, z1) -> c9(RAND(p(z0), id_inc(z1)), P(z0)) IF(true, z0, z1) -> c10(RAND(p(z0), id_inc(z1)), ID_INC(z1)) The (relative) TRS S consists of the following rules: nonZero(0) -> false nonZero(s(z0)) -> true p(0) -> 0 p(s(z0)) -> z0 id_inc(z0) -> z0 id_inc(z0) -> s(z0) random(z0) -> rand(z0, 0) rand(z0, z1) -> if(nonZero(z0), z0, z1) if(false, z0, z1) -> z1 if(true, z0, z1) -> rand(p(z0), id_inc(z1)) Rewrite Strategy: INNERMOST ---------------------------------------- (51) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (52) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: NONZERO(0') -> c NONZERO(s(z0)) -> c1 P(0') -> c2 P(s(z0)) -> c3 ID_INC(z0) -> c4 ID_INC(z0) -> c5 RANDOM(z0) -> c6(RAND(z0, 0')) RAND(z0, z1) -> c7(IF(nonZero(z0), z0, z1), NONZERO(z0)) IF(false, z0, z1) -> c8 IF(true, z0, z1) -> c9(RAND(p(z0), id_inc(z1)), P(z0)) IF(true, z0, z1) -> c10(RAND(p(z0), id_inc(z1)), ID_INC(z1)) The (relative) TRS S consists of the following rules: nonZero(0') -> false nonZero(s(z0)) -> true p(0') -> 0' p(s(z0)) -> z0 id_inc(z0) -> z0 id_inc(z0) -> s(z0) random(z0) -> rand(z0, 0') rand(z0, z1) -> if(nonZero(z0), z0, z1) if(false, z0, z1) -> z1 if(true, z0, z1) -> rand(p(z0), id_inc(z1)) Rewrite Strategy: INNERMOST ---------------------------------------- (53) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (54) Obligation: Innermost TRS: Rules: NONZERO(0') -> c NONZERO(s(z0)) -> c1 P(0') -> c2 P(s(z0)) -> c3 ID_INC(z0) -> c4 ID_INC(z0) -> c5 RANDOM(z0) -> c6(RAND(z0, 0')) RAND(z0, z1) -> c7(IF(nonZero(z0), z0, z1), NONZERO(z0)) IF(false, z0, z1) -> c8 IF(true, z0, z1) -> c9(RAND(p(z0), id_inc(z1)), P(z0)) IF(true, z0, z1) -> c10(RAND(p(z0), id_inc(z1)), ID_INC(z1)) nonZero(0') -> false nonZero(s(z0)) -> true p(0') -> 0' p(s(z0)) -> z0 id_inc(z0) -> z0 id_inc(z0) -> s(z0) random(z0) -> rand(z0, 0') rand(z0, z1) -> if(nonZero(z0), z0, z1) if(false, z0, z1) -> z1 if(true, z0, z1) -> rand(p(z0), id_inc(z1)) Types: NONZERO :: 0':s -> c:c1 0' :: 0':s c :: c:c1 s :: 0':s -> 0':s c1 :: c:c1 P :: 0':s -> c2:c3 c2 :: c2:c3 c3 :: c2:c3 ID_INC :: 0':s -> c4:c5 c4 :: c4:c5 c5 :: c4:c5 RANDOM :: 0':s -> c6 c6 :: c7 -> c6 RAND :: 0':s -> 0':s -> c7 c7 :: c8:c9:c10 -> c:c1 -> c7 IF :: false:true -> 0':s -> 0':s -> c8:c9:c10 nonZero :: 0':s -> false:true false :: false:true c8 :: c8:c9:c10 true :: false:true c9 :: c7 -> c2:c3 -> c8:c9:c10 p :: 0':s -> 0':s id_inc :: 0':s -> 0':s c10 :: c7 -> c4:c5 -> c8:c9:c10 random :: 0':s -> 0':s rand :: 0':s -> 0':s -> 0':s if :: false:true -> 0':s -> 0':s -> 0':s hole_c:c11_11 :: c:c1 hole_0':s2_11 :: 0':s hole_c2:c33_11 :: c2:c3 hole_c4:c54_11 :: c4:c5 hole_c65_11 :: c6 hole_c76_11 :: c7 hole_c8:c9:c107_11 :: c8:c9:c10 hole_false:true8_11 :: false:true gen_0':s9_11 :: Nat -> 0':s ---------------------------------------- (55) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: RAND, rand ---------------------------------------- (56) Obligation: Innermost TRS: Rules: NONZERO(0') -> c NONZERO(s(z0)) -> c1 P(0') -> c2 P(s(z0)) -> c3 ID_INC(z0) -> c4 ID_INC(z0) -> c5 RANDOM(z0) -> c6(RAND(z0, 0')) RAND(z0, z1) -> c7(IF(nonZero(z0), z0, z1), NONZERO(z0)) IF(false, z0, z1) -> c8 IF(true, z0, z1) -> c9(RAND(p(z0), id_inc(z1)), P(z0)) IF(true, z0, z1) -> c10(RAND(p(z0), id_inc(z1)), ID_INC(z1)) nonZero(0') -> false nonZero(s(z0)) -> true p(0') -> 0' p(s(z0)) -> z0 id_inc(z0) -> z0 id_inc(z0) -> s(z0) random(z0) -> rand(z0, 0') rand(z0, z1) -> if(nonZero(z0), z0, z1) if(false, z0, z1) -> z1 if(true, z0, z1) -> rand(p(z0), id_inc(z1)) Types: NONZERO :: 0':s -> c:c1 0' :: 0':s c :: c:c1 s :: 0':s -> 0':s c1 :: c:c1 P :: 0':s -> c2:c3 c2 :: c2:c3 c3 :: c2:c3 ID_INC :: 0':s -> c4:c5 c4 :: c4:c5 c5 :: c4:c5 RANDOM :: 0':s -> c6 c6 :: c7 -> c6 RAND :: 0':s -> 0':s -> c7 c7 :: c8:c9:c10 -> c:c1 -> c7 IF :: false:true -> 0':s -> 0':s -> c8:c9:c10 nonZero :: 0':s -> false:true false :: false:true c8 :: c8:c9:c10 true :: false:true c9 :: c7 -> c2:c3 -> c8:c9:c10 p :: 0':s -> 0':s id_inc :: 0':s -> 0':s c10 :: c7 -> c4:c5 -> c8:c9:c10 random :: 0':s -> 0':s rand :: 0':s -> 0':s -> 0':s if :: false:true -> 0':s -> 0':s -> 0':s hole_c:c11_11 :: c:c1 hole_0':s2_11 :: 0':s hole_c2:c33_11 :: c2:c3 hole_c4:c54_11 :: c4:c5 hole_c65_11 :: c6 hole_c76_11 :: c7 hole_c8:c9:c107_11 :: c8:c9:c10 hole_false:true8_11 :: false:true gen_0':s9_11 :: Nat -> 0':s Generator Equations: gen_0':s9_11(0) <=> 0' gen_0':s9_11(+(x, 1)) <=> s(gen_0':s9_11(x)) The following defined symbols remain to be analysed: RAND, rand ---------------------------------------- (57) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: RAND(gen_0':s9_11(n11_11), gen_0':s9_11(b)) -> *10_11, rt in Omega(n11_11) Induction Base: RAND(gen_0':s9_11(0), gen_0':s9_11(b)) Induction Step: RAND(gen_0':s9_11(+(n11_11, 1)), gen_0':s9_11(b)) ->_R^Omega(1) c7(IF(nonZero(gen_0':s9_11(+(n11_11, 1))), gen_0':s9_11(+(n11_11, 1)), gen_0':s9_11(b)), NONZERO(gen_0':s9_11(+(n11_11, 1)))) ->_R^Omega(0) c7(IF(true, gen_0':s9_11(+(1, n11_11)), gen_0':s9_11(b)), NONZERO(gen_0':s9_11(+(1, n11_11)))) ->_R^Omega(1) c7(c9(RAND(p(gen_0':s9_11(+(1, n11_11))), id_inc(gen_0':s9_11(b))), P(gen_0':s9_11(+(1, n11_11)))), NONZERO(gen_0':s9_11(+(1, n11_11)))) ->_R^Omega(0) c7(c9(RAND(gen_0':s9_11(n11_11), id_inc(gen_0':s9_11(b))), P(gen_0':s9_11(+(1, n11_11)))), NONZERO(gen_0':s9_11(+(1, n11_11)))) ->_R^Omega(0) c7(c9(RAND(gen_0':s9_11(n11_11), gen_0':s9_11(b)), P(gen_0':s9_11(+(1, n11_11)))), NONZERO(gen_0':s9_11(+(1, n11_11)))) ->_IH c7(c9(*10_11, P(gen_0':s9_11(+(1, n11_11)))), NONZERO(gen_0':s9_11(+(1, n11_11)))) ->_R^Omega(1) c7(c9(*10_11, c3), NONZERO(gen_0':s9_11(+(1, n11_11)))) ->_R^Omega(1) c7(c9(*10_11, c3), c1) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (58) Complex Obligation (BEST) ---------------------------------------- (59) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: NONZERO(0') -> c NONZERO(s(z0)) -> c1 P(0') -> c2 P(s(z0)) -> c3 ID_INC(z0) -> c4 ID_INC(z0) -> c5 RANDOM(z0) -> c6(RAND(z0, 0')) RAND(z0, z1) -> c7(IF(nonZero(z0), z0, z1), NONZERO(z0)) IF(false, z0, z1) -> c8 IF(true, z0, z1) -> c9(RAND(p(z0), id_inc(z1)), P(z0)) IF(true, z0, z1) -> c10(RAND(p(z0), id_inc(z1)), ID_INC(z1)) nonZero(0') -> false nonZero(s(z0)) -> true p(0') -> 0' p(s(z0)) -> z0 id_inc(z0) -> z0 id_inc(z0) -> s(z0) random(z0) -> rand(z0, 0') rand(z0, z1) -> if(nonZero(z0), z0, z1) if(false, z0, z1) -> z1 if(true, z0, z1) -> rand(p(z0), id_inc(z1)) Types: NONZERO :: 0':s -> c:c1 0' :: 0':s c :: c:c1 s :: 0':s -> 0':s c1 :: c:c1 P :: 0':s -> c2:c3 c2 :: c2:c3 c3 :: c2:c3 ID_INC :: 0':s -> c4:c5 c4 :: c4:c5 c5 :: c4:c5 RANDOM :: 0':s -> c6 c6 :: c7 -> c6 RAND :: 0':s -> 0':s -> c7 c7 :: c8:c9:c10 -> c:c1 -> c7 IF :: false:true -> 0':s -> 0':s -> c8:c9:c10 nonZero :: 0':s -> false:true false :: false:true c8 :: c8:c9:c10 true :: false:true c9 :: c7 -> c2:c3 -> c8:c9:c10 p :: 0':s -> 0':s id_inc :: 0':s -> 0':s c10 :: c7 -> c4:c5 -> c8:c9:c10 random :: 0':s -> 0':s rand :: 0':s -> 0':s -> 0':s if :: false:true -> 0':s -> 0':s -> 0':s hole_c:c11_11 :: c:c1 hole_0':s2_11 :: 0':s hole_c2:c33_11 :: c2:c3 hole_c4:c54_11 :: c4:c5 hole_c65_11 :: c6 hole_c76_11 :: c7 hole_c8:c9:c107_11 :: c8:c9:c10 hole_false:true8_11 :: false:true gen_0':s9_11 :: Nat -> 0':s Generator Equations: gen_0':s9_11(0) <=> 0' gen_0':s9_11(+(x, 1)) <=> s(gen_0':s9_11(x)) The following defined symbols remain to be analysed: RAND, rand ---------------------------------------- (60) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (61) BOUNDS(n^1, INF) ---------------------------------------- (62) Obligation: Innermost TRS: Rules: NONZERO(0') -> c NONZERO(s(z0)) -> c1 P(0') -> c2 P(s(z0)) -> c3 ID_INC(z0) -> c4 ID_INC(z0) -> c5 RANDOM(z0) -> c6(RAND(z0, 0')) RAND(z0, z1) -> c7(IF(nonZero(z0), z0, z1), NONZERO(z0)) IF(false, z0, z1) -> c8 IF(true, z0, z1) -> c9(RAND(p(z0), id_inc(z1)), P(z0)) IF(true, z0, z1) -> c10(RAND(p(z0), id_inc(z1)), ID_INC(z1)) nonZero(0') -> false nonZero(s(z0)) -> true p(0') -> 0' p(s(z0)) -> z0 id_inc(z0) -> z0 id_inc(z0) -> s(z0) random(z0) -> rand(z0, 0') rand(z0, z1) -> if(nonZero(z0), z0, z1) if(false, z0, z1) -> z1 if(true, z0, z1) -> rand(p(z0), id_inc(z1)) Types: NONZERO :: 0':s -> c:c1 0' :: 0':s c :: c:c1 s :: 0':s -> 0':s c1 :: c:c1 P :: 0':s -> c2:c3 c2 :: c2:c3 c3 :: c2:c3 ID_INC :: 0':s -> c4:c5 c4 :: c4:c5 c5 :: c4:c5 RANDOM :: 0':s -> c6 c6 :: c7 -> c6 RAND :: 0':s -> 0':s -> c7 c7 :: c8:c9:c10 -> c:c1 -> c7 IF :: false:true -> 0':s -> 0':s -> c8:c9:c10 nonZero :: 0':s -> false:true false :: false:true c8 :: c8:c9:c10 true :: false:true c9 :: c7 -> c2:c3 -> c8:c9:c10 p :: 0':s -> 0':s id_inc :: 0':s -> 0':s c10 :: c7 -> c4:c5 -> c8:c9:c10 random :: 0':s -> 0':s rand :: 0':s -> 0':s -> 0':s if :: false:true -> 0':s -> 0':s -> 0':s hole_c:c11_11 :: c:c1 hole_0':s2_11 :: 0':s hole_c2:c33_11 :: c2:c3 hole_c4:c54_11 :: c4:c5 hole_c65_11 :: c6 hole_c76_11 :: c7 hole_c8:c9:c107_11 :: c8:c9:c10 hole_false:true8_11 :: false:true gen_0':s9_11 :: Nat -> 0':s Lemmas: RAND(gen_0':s9_11(n11_11), gen_0':s9_11(b)) -> *10_11, rt in Omega(n11_11) Generator Equations: gen_0':s9_11(0) <=> 0' gen_0':s9_11(+(x, 1)) <=> s(gen_0':s9_11(x)) The following defined symbols remain to be analysed: rand ---------------------------------------- (63) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: rand(gen_0':s9_11(n6259_11), gen_0':s9_11(b)) -> gen_0':s9_11(b), rt in Omega(0) Induction Base: rand(gen_0':s9_11(0), gen_0':s9_11(b)) ->_R^Omega(0) if(nonZero(gen_0':s9_11(0)), gen_0':s9_11(0), gen_0':s9_11(b)) ->_R^Omega(0) if(false, gen_0':s9_11(0), gen_0':s9_11(b)) ->_R^Omega(0) gen_0':s9_11(b) Induction Step: rand(gen_0':s9_11(+(n6259_11, 1)), gen_0':s9_11(b)) ->_R^Omega(0) if(nonZero(gen_0':s9_11(+(n6259_11, 1))), gen_0':s9_11(+(n6259_11, 1)), gen_0':s9_11(b)) ->_R^Omega(0) if(true, gen_0':s9_11(+(1, n6259_11)), gen_0':s9_11(b)) ->_R^Omega(0) rand(p(gen_0':s9_11(+(1, n6259_11))), id_inc(gen_0':s9_11(b))) ->_R^Omega(0) rand(gen_0':s9_11(n6259_11), id_inc(gen_0':s9_11(b))) ->_R^Omega(0) rand(gen_0':s9_11(n6259_11), gen_0':s9_11(b)) ->_IH gen_0':s9_11(b) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (64) BOUNDS(1, INF)