/export/starexec/sandbox2/solver/bin/starexec_run_rcdcRelativeAlsoLower /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^2)) proof of /export/starexec/sandbox2/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Derivational Complexity (innermost) of the given DCpxTrs could be proven to be BOUNDS(n^1, n^2). (0) DCpxTrs (1) DerivationalComplexityToRuntimeComplexityProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxRelTRS (3) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 68 ms] (4) CpxRelTRS (5) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CpxWeightedTrs (7) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxTypedWeightedTrs (9) CompletionProof [UPPER BOUND(ID), 0 ms] (10) CpxTypedWeightedCompleteTrs (11) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (12) CpxRNTS (13) CompleteCoflocoProof [FINISHED, 387 ms] (14) BOUNDS(1, n^2) (15) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (16) CpxRelTRS (17) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (18) typed CpxTrs (19) OrderProof [LOWER BOUND(ID), 0 ms] (20) typed CpxTrs (21) RewriteLemmaProof [LOWER BOUND(ID), 328 ms] (22) BEST (23) proven lower bound (24) LowerBoundPropagationProof [FINISHED, 0 ms] (25) BOUNDS(n^1, INF) (26) typed CpxTrs (27) RewriteLemmaProof [LOWER BOUND(ID), 1340 ms] (28) BOUNDS(1, INF) ---------------------------------------- (0) Obligation: The Derivational Complexity (innermost) of the given DCpxTrs could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: half(0) -> 0 half(s(0)) -> 0 half(s(s(x))) -> s(half(x)) bits(0) -> 0 bits(s(x)) -> s(bits(half(s(x)))) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (1) DerivationalComplexityToRuntimeComplexityProof (BOTH BOUNDS(ID, ID)) The following rules have been added to S to convert the given derivational complexity problem to a runtime complexity problem: encArg(0) -> 0 encArg(s(x_1)) -> s(encArg(x_1)) encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_bits(x_1)) -> bits(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0 encode_s(x_1) -> s(encArg(x_1)) encode_bits(x_1) -> bits(encArg(x_1)) ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: half(0) -> 0 half(s(0)) -> 0 half(s(s(x))) -> s(half(x)) bits(0) -> 0 bits(s(x)) -> s(bits(half(s(x)))) The (relative) TRS S consists of the following rules: encArg(0) -> 0 encArg(s(x_1)) -> s(encArg(x_1)) encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_bits(x_1)) -> bits(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0 encode_s(x_1) -> s(encArg(x_1)) encode_bits(x_1) -> bits(encArg(x_1)) Rewrite Strategy: INNERMOST ---------------------------------------- (3) SInnermostTerminationProof (BOTH CONCRETE BOUNDS(ID, ID)) proved innermost termination of relative rules ---------------------------------------- (4) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: half(0) -> 0 half(s(0)) -> 0 half(s(s(x))) -> s(half(x)) bits(0) -> 0 bits(s(x)) -> s(bits(half(s(x)))) The (relative) TRS S consists of the following rules: encArg(0) -> 0 encArg(s(x_1)) -> s(encArg(x_1)) encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_bits(x_1)) -> bits(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0 encode_s(x_1) -> s(encArg(x_1)) encode_bits(x_1) -> bits(encArg(x_1)) Rewrite Strategy: INNERMOST ---------------------------------------- (5) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (6) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: half(0) -> 0 [1] half(s(0)) -> 0 [1] half(s(s(x))) -> s(half(x)) [1] bits(0) -> 0 [1] bits(s(x)) -> s(bits(half(s(x)))) [1] encArg(0) -> 0 [0] encArg(s(x_1)) -> s(encArg(x_1)) [0] encArg(cons_half(x_1)) -> half(encArg(x_1)) [0] encArg(cons_bits(x_1)) -> bits(encArg(x_1)) [0] encode_half(x_1) -> half(encArg(x_1)) [0] encode_0 -> 0 [0] encode_s(x_1) -> s(encArg(x_1)) [0] encode_bits(x_1) -> bits(encArg(x_1)) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (7) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (8) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: half(0) -> 0 [1] half(s(0)) -> 0 [1] half(s(s(x))) -> s(half(x)) [1] bits(0) -> 0 [1] bits(s(x)) -> s(bits(half(s(x)))) [1] encArg(0) -> 0 [0] encArg(s(x_1)) -> s(encArg(x_1)) [0] encArg(cons_half(x_1)) -> half(encArg(x_1)) [0] encArg(cons_bits(x_1)) -> bits(encArg(x_1)) [0] encode_half(x_1) -> half(encArg(x_1)) [0] encode_0 -> 0 [0] encode_s(x_1) -> s(encArg(x_1)) [0] encode_bits(x_1) -> bits(encArg(x_1)) [0] The TRS has the following type information: half :: 0:s:cons_half:cons_bits -> 0:s:cons_half:cons_bits 0 :: 0:s:cons_half:cons_bits s :: 0:s:cons_half:cons_bits -> 0:s:cons_half:cons_bits bits :: 0:s:cons_half:cons_bits -> 0:s:cons_half:cons_bits encArg :: 0:s:cons_half:cons_bits -> 0:s:cons_half:cons_bits cons_half :: 0:s:cons_half:cons_bits -> 0:s:cons_half:cons_bits cons_bits :: 0:s:cons_half:cons_bits -> 0:s:cons_half:cons_bits encode_half :: 0:s:cons_half:cons_bits -> 0:s:cons_half:cons_bits encode_0 :: 0:s:cons_half:cons_bits encode_s :: 0:s:cons_half:cons_bits -> 0:s:cons_half:cons_bits encode_bits :: 0:s:cons_half:cons_bits -> 0:s:cons_half:cons_bits Rewrite Strategy: INNERMOST ---------------------------------------- (9) CompletionProof (UPPER BOUND(ID)) The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: encArg(v0) -> null_encArg [0] encode_half(v0) -> null_encode_half [0] encode_0 -> null_encode_0 [0] encode_s(v0) -> null_encode_s [0] encode_bits(v0) -> null_encode_bits [0] half(v0) -> null_half [0] bits(v0) -> null_bits [0] And the following fresh constants: null_encArg, null_encode_half, null_encode_0, null_encode_s, null_encode_bits, null_half, null_bits ---------------------------------------- (10) Obligation: Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: half(0) -> 0 [1] half(s(0)) -> 0 [1] half(s(s(x))) -> s(half(x)) [1] bits(0) -> 0 [1] bits(s(x)) -> s(bits(half(s(x)))) [1] encArg(0) -> 0 [0] encArg(s(x_1)) -> s(encArg(x_1)) [0] encArg(cons_half(x_1)) -> half(encArg(x_1)) [0] encArg(cons_bits(x_1)) -> bits(encArg(x_1)) [0] encode_half(x_1) -> half(encArg(x_1)) [0] encode_0 -> 0 [0] encode_s(x_1) -> s(encArg(x_1)) [0] encode_bits(x_1) -> bits(encArg(x_1)) [0] encArg(v0) -> null_encArg [0] encode_half(v0) -> null_encode_half [0] encode_0 -> null_encode_0 [0] encode_s(v0) -> null_encode_s [0] encode_bits(v0) -> null_encode_bits [0] half(v0) -> null_half [0] bits(v0) -> null_bits [0] The TRS has the following type information: half :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits -> 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits 0 :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits s :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits -> 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits bits :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits -> 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits encArg :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits -> 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits cons_half :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits -> 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits cons_bits :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits -> 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits encode_half :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits -> 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits encode_0 :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits encode_s :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits -> 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits encode_bits :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits -> 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits null_encArg :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits null_encode_half :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits null_encode_0 :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits null_encode_s :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits null_encode_bits :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits null_half :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits null_bits :: 0:s:cons_half:cons_bits:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_bits:null_half:null_bits Rewrite Strategy: INNERMOST ---------------------------------------- (11) 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 null_encArg => 0 null_encode_half => 0 null_encode_0 => 0 null_encode_s => 0 null_encode_bits => 0 null_half => 0 null_bits => 0 ---------------------------------------- (12) Obligation: Complexity RNTS consisting of the following rules: bits(z) -{ 1 }-> 0 :|: z = 0 bits(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 bits(z) -{ 1 }-> 1 + bits(half(1 + x)) :|: x >= 0, z = 1 + x encArg(z) -{ 0 }-> half(encArg(x_1)) :|: z = 1 + x_1, x_1 >= 0 encArg(z) -{ 0 }-> bits(encArg(x_1)) :|: z = 1 + x_1, x_1 >= 0 encArg(z) -{ 0 }-> 0 :|: z = 0 encArg(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 encArg(z) -{ 0 }-> 1 + encArg(x_1) :|: z = 1 + x_1, x_1 >= 0 encode_0 -{ 0 }-> 0 :|: encode_bits(z) -{ 0 }-> bits(encArg(x_1)) :|: x_1 >= 0, z = x_1 encode_bits(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 encode_half(z) -{ 0 }-> half(encArg(x_1)) :|: x_1 >= 0, z = x_1 encode_half(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 encode_s(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 encode_s(z) -{ 0 }-> 1 + encArg(x_1) :|: x_1 >= 0, z = x_1 half(z) -{ 1 }-> 0 :|: z = 0 half(z) -{ 1 }-> 0 :|: z = 1 + 0 half(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 half(z) -{ 1 }-> 1 + half(x) :|: x >= 0, z = 1 + (1 + x) Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (13) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V),0,[half(V, Out)],[V >= 0]). eq(start(V),0,[bits(V, Out)],[V >= 0]). eq(start(V),0,[encArg(V, Out)],[V >= 0]). eq(start(V),0,[fun(V, Out)],[V >= 0]). eq(start(V),0,[fun1(Out)],[]). eq(start(V),0,[fun2(V, Out)],[V >= 0]). eq(start(V),0,[fun3(V, Out)],[V >= 0]). eq(half(V, Out),1,[],[Out = 0,V = 0]). eq(half(V, Out),1,[],[Out = 0,V = 1]). eq(half(V, Out),1,[half(V1, Ret1)],[Out = 1 + Ret1,V1 >= 0,V = 2 + V1]). eq(bits(V, Out),1,[],[Out = 0,V = 0]). eq(bits(V, Out),1,[half(1 + V2, Ret10),bits(Ret10, Ret11)],[Out = 1 + Ret11,V2 >= 0,V = 1 + V2]). eq(encArg(V, Out),0,[],[Out = 0,V = 0]). eq(encArg(V, Out),0,[encArg(V3, Ret12)],[Out = 1 + Ret12,V = 1 + V3,V3 >= 0]). eq(encArg(V, Out),0,[encArg(V4, Ret0),half(Ret0, Ret)],[Out = Ret,V = 1 + V4,V4 >= 0]). eq(encArg(V, Out),0,[encArg(V5, Ret01),bits(Ret01, Ret2)],[Out = Ret2,V = 1 + V5,V5 >= 0]). eq(fun(V, Out),0,[encArg(V6, Ret02),half(Ret02, Ret3)],[Out = Ret3,V6 >= 0,V = V6]). eq(fun1(Out),0,[],[Out = 0]). eq(fun2(V, Out),0,[encArg(V7, Ret13)],[Out = 1 + Ret13,V7 >= 0,V = V7]). eq(fun3(V, Out),0,[encArg(V8, Ret03),bits(Ret03, Ret4)],[Out = Ret4,V8 >= 0,V = V8]). eq(encArg(V, Out),0,[],[Out = 0,V9 >= 0,V = V9]). eq(fun(V, Out),0,[],[Out = 0,V10 >= 0,V = V10]). eq(fun2(V, Out),0,[],[Out = 0,V11 >= 0,V = V11]). eq(fun3(V, Out),0,[],[Out = 0,V12 >= 0,V = V12]). eq(half(V, Out),0,[],[Out = 0,V13 >= 0,V = V13]). eq(bits(V, Out),0,[],[Out = 0,V14 >= 0,V = V14]). input_output_vars(half(V,Out),[V],[Out]). input_output_vars(bits(V,Out),[V],[Out]). input_output_vars(encArg(V,Out),[V],[Out]). input_output_vars(fun(V,Out),[V],[Out]). input_output_vars(fun1(Out),[],[Out]). input_output_vars(fun2(V,Out),[V],[Out]). input_output_vars(fun3(V,Out),[V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [half/2] 1. recursive : [bits/2] 2. recursive [non_tail] : [encArg/2] 3. non_recursive : [fun/2] 4. non_recursive : [fun1/1] 5. non_recursive : [fun2/2] 6. non_recursive : [fun3/2] 7. non_recursive : [start/1] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into half/2 1. SCC is partially evaluated into bits/2 2. SCC is partially evaluated into encArg/2 3. SCC is partially evaluated into fun/2 4. SCC is completely evaluated into other SCCs 5. SCC is partially evaluated into fun2/2 6. SCC is partially evaluated into fun3/2 7. SCC is partially evaluated into start/1 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations half/2 * CE 9 is refined into CE [25] * CE 8 is refined into CE [26] * CE 11 is refined into CE [27] * CE 10 is refined into CE [28] ### Cost equations --> "Loop" of half/2 * CEs [28] --> Loop 12 * CEs [25] --> Loop 13 * CEs [26,27] --> Loop 14 ### Ranking functions of CR half(V,Out) * RF of phase [12]: [V-1] #### Partial ranking functions of CR half(V,Out) * Partial RF of phase [12]: - RF of loop [12:1]: V-1 ### Specialization of cost equations bits/2 * CE 12 is refined into CE [29] * CE 14 is refined into CE [30] * CE 13 is refined into CE [31,32] ### Cost equations --> "Loop" of bits/2 * CEs [32] --> Loop 15 * CEs [31] --> Loop 16 * CEs [29,30] --> Loop 17 ### Ranking functions of CR bits(V,Out) * RF of phase [15]: [V-1] #### Partial ranking functions of CR bits(V,Out) * Partial RF of phase [15]: - RF of loop [15:1]: V-1 ### Specialization of cost equations encArg/2 * CE 15 is refined into CE [33] * CE 16 is refined into CE [34] * CE 17 is refined into CE [35,36] * CE 18 is refined into CE [37,38,39,40] ### Cost equations --> "Loop" of encArg/2 * CEs [40] --> Loop 18 * CEs [36,39] --> Loop 19 * CEs [34] --> Loop 20 * CEs [38] --> Loop 21 * CEs [35,37] --> Loop 22 * CEs [33] --> Loop 23 ### Ranking functions of CR encArg(V,Out) * RF of phase [18,19,20,21,22]: [V] #### Partial ranking functions of CR encArg(V,Out) * Partial RF of phase [18,19,20,21,22]: - RF of loop [18:1,19:1,20:1,21:1,22:1]: V ### Specialization of cost equations fun/2 * CE 19 is refined into CE [41,42,43] * CE 20 is refined into CE [44] ### Cost equations --> "Loop" of fun/2 * CEs [43] --> Loop 24 * CEs [41,42,44] --> Loop 25 ### Ranking functions of CR fun(V,Out) #### Partial ranking functions of CR fun(V,Out) ### Specialization of cost equations fun2/2 * CE 21 is refined into CE [45,46] * CE 22 is refined into CE [47] ### Cost equations --> "Loop" of fun2/2 * CEs [46] --> Loop 26 * CEs [45] --> Loop 27 * CEs [47] --> Loop 28 ### Ranking functions of CR fun2(V,Out) #### Partial ranking functions of CR fun2(V,Out) ### Specialization of cost equations fun3/2 * CE 23 is refined into CE [48,49,50,51,52] * CE 24 is refined into CE [53] ### Cost equations --> "Loop" of fun3/2 * CEs [52] --> Loop 29 * CEs [51] --> Loop 30 * CEs [50] --> Loop 31 * CEs [48,49,53] --> Loop 32 ### Ranking functions of CR fun3(V,Out) #### Partial ranking functions of CR fun3(V,Out) ### Specialization of cost equations start/1 * CE 1 is refined into CE [54,55] * CE 2 is refined into CE [56,57,58,59] * CE 3 is refined into CE [60,61] * CE 4 is refined into CE [62,63] * CE 5 is refined into CE [64] * CE 6 is refined into CE [65,66,67] * CE 7 is refined into CE [68,69,70,71] ### Cost equations --> "Loop" of start/1 * CEs [54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71] --> Loop 33 ### Ranking functions of CR start(V) #### Partial ranking functions of CR start(V) Computing Bounds ===================================== #### Cost of chains of half(V,Out): * Chain [[12],14]: 1*it(12)+1 Such that:it(12) =< 2*Out with precondition: [Out>=1,V>=2*Out] * Chain [[12],13]: 1*it(12)+1 Such that:it(12) =< 2*Out with precondition: [V=2*Out+1,V>=3] * Chain [14]: 1 with precondition: [Out=0,V>=0] * Chain [13]: 1 with precondition: [V=1,Out=0] #### Cost of chains of bits(V,Out): * Chain [[15],17]: 2*it(15)+2*s(7)+1 Such that:it(15) =< V s(8) =< 2*V s(7) =< s(8) with precondition: [Out>=1,V>=2*Out] * Chain [[15],16,17]: 2*it(15)+2*s(7)+3 Such that:it(15) =< V s(8) =< 2*V s(7) =< s(8) with precondition: [Out>=2,V+2>=2*Out] * Chain [17]: 1 with precondition: [Out=0,V>=0] * Chain [16,17]: 3 with precondition: [Out=1,V>=1] #### Cost of chains of encArg(V,Out): * Chain [[18,19,20,21,22],23]: 8*it(18)+2*s(24)+2*s(25)+4*s(27)+2*s(28)+0 Such that:aux(9) =< V it(18) =< aux(9) aux(5) =< aux(9) aux(4) =< it(18)*aux(9) s(24) =< it(18)*aux(9) aux(6) =< it(18)*aux(5) s(26) =< aux(4)*2 s(29) =< aux(6)*2 s(27) =< aux(6) s(28) =< s(29) s(25) =< s(26) with precondition: [V>=1,Out>=0,V>=Out] * Chain [23]: 0 with precondition: [Out=0,V>=0] #### Cost of chains of fun(V,Out): * Chain [25]: 8*s(32)+2*s(35)+4*s(39)+2*s(40)+2*s(41)+1 Such that:s(31) =< V s(32) =< s(31) s(33) =< s(31) s(34) =< s(32)*s(31) s(35) =< s(32)*s(31) s(36) =< s(32)*s(33) s(37) =< s(34)*2 s(38) =< s(36)*2 s(39) =< s(36) s(40) =< s(38) s(41) =< s(37) with precondition: [Out=0,V>=0] * Chain [24]: 10*s(43)+2*s(46)+4*s(50)+2*s(51)+2*s(52)+1 Such that:aux(10) =< V s(43) =< aux(10) s(44) =< aux(10) s(45) =< s(43)*aux(10) s(46) =< s(43)*aux(10) s(47) =< s(43)*s(44) s(48) =< s(45)*2 s(49) =< s(47)*2 s(50) =< s(47) s(51) =< s(49) s(52) =< s(48) with precondition: [Out>=1,V>=2*Out] #### Cost of chains of fun2(V,Out): * Chain [28]: 0 with precondition: [Out=0,V>=0] * Chain [27]: 0 with precondition: [Out=1,V>=0] * Chain [26]: 8*s(56)+2*s(59)+4*s(63)+2*s(64)+2*s(65)+0 Such that:s(55) =< V s(56) =< s(55) s(57) =< s(55) s(58) =< s(56)*s(55) s(59) =< s(56)*s(55) s(60) =< s(56)*s(57) s(61) =< s(58)*2 s(62) =< s(60)*2 s(63) =< s(60) s(64) =< s(62) s(65) =< s(61) with precondition: [V>=1,Out>=1,V+1>=Out] #### Cost of chains of fun3(V,Out): * Chain [32]: 8*s(67)+2*s(70)+4*s(74)+2*s(75)+2*s(76)+1 Such that:s(66) =< V s(67) =< s(66) s(68) =< s(66) s(69) =< s(67)*s(66) s(70) =< s(67)*s(66) s(71) =< s(67)*s(68) s(72) =< s(69)*2 s(73) =< s(71)*2 s(74) =< s(71) s(75) =< s(73) s(76) =< s(72) with precondition: [Out=0,V>=0] * Chain [31]: 8*s(78)+2*s(81)+4*s(85)+2*s(86)+2*s(87)+3 Such that:s(77) =< V s(78) =< s(77) s(79) =< s(77) s(80) =< s(78)*s(77) s(81) =< s(78)*s(77) s(82) =< s(78)*s(79) s(83) =< s(80)*2 s(84) =< s(82)*2 s(85) =< s(82) s(86) =< s(84) s(87) =< s(83) with precondition: [Out=1,V>=1] * Chain [30]: 10*s(89)+2*s(92)+4*s(96)+2*s(97)+2*s(98)+2*s(101)+1 Such that:s(100) =< 2*V aux(11) =< V s(89) =< aux(11) s(101) =< s(100) s(90) =< aux(11) s(91) =< s(89)*aux(11) s(92) =< s(89)*aux(11) s(93) =< s(89)*s(90) s(94) =< s(91)*2 s(95) =< s(93)*2 s(96) =< s(93) s(97) =< s(95) s(98) =< s(94) with precondition: [Out>=1,V>=2*Out] * Chain [29]: 10*s(103)+2*s(106)+4*s(110)+2*s(111)+2*s(112)+2*s(115)+3 Such that:s(114) =< 2*V aux(12) =< V s(103) =< aux(12) s(115) =< s(114) s(104) =< aux(12) s(105) =< s(103)*aux(12) s(106) =< s(103)*aux(12) s(107) =< s(103)*s(104) s(108) =< s(105)*2 s(109) =< s(107)*2 s(110) =< s(107) s(111) =< s(109) s(112) =< s(108) with precondition: [Out>=2,V+2>=2*Out] #### Cost of chains of start(V): * Chain [33]: 76*s(117)+8*s(120)+16*s(128)+32*s(132)+16*s(133)+16*s(134)+3 Such that:aux(13) =< V aux(14) =< 2*V s(117) =< aux(13) s(120) =< aux(14) s(126) =< aux(13) s(127) =< s(117)*aux(13) s(128) =< s(117)*aux(13) s(129) =< s(117)*s(126) s(130) =< s(127)*2 s(131) =< s(129)*2 s(132) =< s(129) s(133) =< s(131) s(134) =< s(130) with precondition: [] Closed-form bounds of start(V): ------------------------------------- * Chain [33] with precondition: [] - Upper bound: nat(V)*76+3+nat(V)*112*nat(V)+nat(2*V)*8 - Complexity: n^2 ### Maximum cost of start(V): nat(V)*76+3+nat(V)*112*nat(V)+nat(2*V)*8 Asymptotic class: n^2 * Total analysis performed in 297 ms. ---------------------------------------- (14) BOUNDS(1, n^2) ---------------------------------------- (15) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (16) 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: half(0') -> 0' half(s(0')) -> 0' half(s(s(x))) -> s(half(x)) bits(0') -> 0' bits(s(x)) -> s(bits(half(s(x)))) The (relative) TRS S consists of the following rules: encArg(0') -> 0' encArg(s(x_1)) -> s(encArg(x_1)) encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_bits(x_1)) -> bits(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0' encode_s(x_1) -> s(encArg(x_1)) encode_bits(x_1) -> bits(encArg(x_1)) Rewrite Strategy: INNERMOST ---------------------------------------- (17) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (18) Obligation: Innermost TRS: Rules: half(0') -> 0' half(s(0')) -> 0' half(s(s(x))) -> s(half(x)) bits(0') -> 0' bits(s(x)) -> s(bits(half(s(x)))) encArg(0') -> 0' encArg(s(x_1)) -> s(encArg(x_1)) encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_bits(x_1)) -> bits(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0' encode_s(x_1) -> s(encArg(x_1)) encode_bits(x_1) -> bits(encArg(x_1)) Types: half :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits 0' :: 0':s:cons_half:cons_bits s :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits bits :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encArg :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits cons_half :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits cons_bits :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encode_half :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encode_0 :: 0':s:cons_half:cons_bits encode_s :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encode_bits :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits hole_0':s:cons_half:cons_bits1_2 :: 0':s:cons_half:cons_bits gen_0':s:cons_half:cons_bits2_2 :: Nat -> 0':s:cons_half:cons_bits ---------------------------------------- (19) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: half, bits, encArg They will be analysed ascendingly in the following order: half < bits half < encArg bits < encArg ---------------------------------------- (20) Obligation: Innermost TRS: Rules: half(0') -> 0' half(s(0')) -> 0' half(s(s(x))) -> s(half(x)) bits(0') -> 0' bits(s(x)) -> s(bits(half(s(x)))) encArg(0') -> 0' encArg(s(x_1)) -> s(encArg(x_1)) encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_bits(x_1)) -> bits(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0' encode_s(x_1) -> s(encArg(x_1)) encode_bits(x_1) -> bits(encArg(x_1)) Types: half :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits 0' :: 0':s:cons_half:cons_bits s :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits bits :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encArg :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits cons_half :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits cons_bits :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encode_half :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encode_0 :: 0':s:cons_half:cons_bits encode_s :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encode_bits :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits hole_0':s:cons_half:cons_bits1_2 :: 0':s:cons_half:cons_bits gen_0':s:cons_half:cons_bits2_2 :: Nat -> 0':s:cons_half:cons_bits Generator Equations: gen_0':s:cons_half:cons_bits2_2(0) <=> 0' gen_0':s:cons_half:cons_bits2_2(+(x, 1)) <=> s(gen_0':s:cons_half:cons_bits2_2(x)) The following defined symbols remain to be analysed: half, bits, encArg They will be analysed ascendingly in the following order: half < bits half < encArg bits < encArg ---------------------------------------- (21) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: half(gen_0':s:cons_half:cons_bits2_2(*(2, n4_2))) -> gen_0':s:cons_half:cons_bits2_2(n4_2), rt in Omega(1 + n4_2) Induction Base: half(gen_0':s:cons_half:cons_bits2_2(*(2, 0))) ->_R^Omega(1) 0' Induction Step: half(gen_0':s:cons_half:cons_bits2_2(*(2, +(n4_2, 1)))) ->_R^Omega(1) s(half(gen_0':s:cons_half:cons_bits2_2(*(2, n4_2)))) ->_IH s(gen_0':s:cons_half:cons_bits2_2(c5_2)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (22) Complex Obligation (BEST) ---------------------------------------- (23) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: half(0') -> 0' half(s(0')) -> 0' half(s(s(x))) -> s(half(x)) bits(0') -> 0' bits(s(x)) -> s(bits(half(s(x)))) encArg(0') -> 0' encArg(s(x_1)) -> s(encArg(x_1)) encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_bits(x_1)) -> bits(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0' encode_s(x_1) -> s(encArg(x_1)) encode_bits(x_1) -> bits(encArg(x_1)) Types: half :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits 0' :: 0':s:cons_half:cons_bits s :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits bits :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encArg :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits cons_half :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits cons_bits :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encode_half :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encode_0 :: 0':s:cons_half:cons_bits encode_s :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encode_bits :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits hole_0':s:cons_half:cons_bits1_2 :: 0':s:cons_half:cons_bits gen_0':s:cons_half:cons_bits2_2 :: Nat -> 0':s:cons_half:cons_bits Generator Equations: gen_0':s:cons_half:cons_bits2_2(0) <=> 0' gen_0':s:cons_half:cons_bits2_2(+(x, 1)) <=> s(gen_0':s:cons_half:cons_bits2_2(x)) The following defined symbols remain to be analysed: half, bits, encArg They will be analysed ascendingly in the following order: half < bits half < encArg bits < encArg ---------------------------------------- (24) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (25) BOUNDS(n^1, INF) ---------------------------------------- (26) Obligation: Innermost TRS: Rules: half(0') -> 0' half(s(0')) -> 0' half(s(s(x))) -> s(half(x)) bits(0') -> 0' bits(s(x)) -> s(bits(half(s(x)))) encArg(0') -> 0' encArg(s(x_1)) -> s(encArg(x_1)) encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_bits(x_1)) -> bits(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0' encode_s(x_1) -> s(encArg(x_1)) encode_bits(x_1) -> bits(encArg(x_1)) Types: half :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits 0' :: 0':s:cons_half:cons_bits s :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits bits :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encArg :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits cons_half :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits cons_bits :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encode_half :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encode_0 :: 0':s:cons_half:cons_bits encode_s :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits encode_bits :: 0':s:cons_half:cons_bits -> 0':s:cons_half:cons_bits hole_0':s:cons_half:cons_bits1_2 :: 0':s:cons_half:cons_bits gen_0':s:cons_half:cons_bits2_2 :: Nat -> 0':s:cons_half:cons_bits Lemmas: half(gen_0':s:cons_half:cons_bits2_2(*(2, n4_2))) -> gen_0':s:cons_half:cons_bits2_2(n4_2), rt in Omega(1 + n4_2) Generator Equations: gen_0':s:cons_half:cons_bits2_2(0) <=> 0' gen_0':s:cons_half:cons_bits2_2(+(x, 1)) <=> s(gen_0':s:cons_half:cons_bits2_2(x)) The following defined symbols remain to be analysed: bits, encArg They will be analysed ascendingly in the following order: bits < encArg ---------------------------------------- (27) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: encArg(gen_0':s:cons_half:cons_bits2_2(n1774_2)) -> gen_0':s:cons_half:cons_bits2_2(n1774_2), rt in Omega(0) Induction Base: encArg(gen_0':s:cons_half:cons_bits2_2(0)) ->_R^Omega(0) 0' Induction Step: encArg(gen_0':s:cons_half:cons_bits2_2(+(n1774_2, 1))) ->_R^Omega(0) s(encArg(gen_0':s:cons_half:cons_bits2_2(n1774_2))) ->_IH s(gen_0':s:cons_half:cons_bits2_2(c1775_2)) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (28) BOUNDS(1, INF)