/export/starexec/sandbox/solver/bin/starexec_run_rcdcRelativeAlsoLower /export/starexec/sandbox/benchmark/theBenchmark.xml /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^2)) proof of /export/starexec/sandbox/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), 163 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, 332 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), 1131 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), 18 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: rev(a) -> a rev(b) -> b rev(++(x, y)) -> ++(rev(y), rev(x)) rev(++(x, x)) -> rev(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(a) -> a encArg(b) -> b encArg(++(x_1, x_2)) -> ++(encArg(x_1), encArg(x_2)) encArg(cons_rev(x_1)) -> rev(encArg(x_1)) encode_rev(x_1) -> rev(encArg(x_1)) encode_a -> a encode_b -> b encode_++(x_1, x_2) -> ++(encArg(x_1), encArg(x_2)) ---------------------------------------- (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: rev(a) -> a rev(b) -> b rev(++(x, y)) -> ++(rev(y), rev(x)) rev(++(x, x)) -> rev(x) The (relative) TRS S consists of the following rules: encArg(a) -> a encArg(b) -> b encArg(++(x_1, x_2)) -> ++(encArg(x_1), encArg(x_2)) encArg(cons_rev(x_1)) -> rev(encArg(x_1)) encode_rev(x_1) -> rev(encArg(x_1)) encode_a -> a encode_b -> b encode_++(x_1, x_2) -> ++(encArg(x_1), encArg(x_2)) 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: rev(a) -> a rev(b) -> b rev(++(x, y)) -> ++(rev(y), rev(x)) rev(++(x, x)) -> rev(x) The (relative) TRS S consists of the following rules: encArg(a) -> a encArg(b) -> b encArg(++(x_1, x_2)) -> ++(encArg(x_1), encArg(x_2)) encArg(cons_rev(x_1)) -> rev(encArg(x_1)) encode_rev(x_1) -> rev(encArg(x_1)) encode_a -> a encode_b -> b encode_++(x_1, x_2) -> ++(encArg(x_1), encArg(x_2)) 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: rev(a) -> a [1] rev(b) -> b [1] rev(++(x, y)) -> ++(rev(y), rev(x)) [1] rev(++(x, x)) -> rev(x) [1] encArg(a) -> a [0] encArg(b) -> b [0] encArg(++(x_1, x_2)) -> ++(encArg(x_1), encArg(x_2)) [0] encArg(cons_rev(x_1)) -> rev(encArg(x_1)) [0] encode_rev(x_1) -> rev(encArg(x_1)) [0] encode_a -> a [0] encode_b -> b [0] encode_++(x_1, x_2) -> ++(encArg(x_1), encArg(x_2)) [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: rev(a) -> a [1] rev(b) -> b [1] rev(++(x, y)) -> ++(rev(y), rev(x)) [1] rev(++(x, x)) -> rev(x) [1] encArg(a) -> a [0] encArg(b) -> b [0] encArg(++(x_1, x_2)) -> ++(encArg(x_1), encArg(x_2)) [0] encArg(cons_rev(x_1)) -> rev(encArg(x_1)) [0] encode_rev(x_1) -> rev(encArg(x_1)) [0] encode_a -> a [0] encode_b -> b [0] encode_++(x_1, x_2) -> ++(encArg(x_1), encArg(x_2)) [0] The TRS has the following type information: rev :: a:b:++:cons_rev -> a:b:++:cons_rev a :: a:b:++:cons_rev b :: a:b:++:cons_rev ++ :: a:b:++:cons_rev -> a:b:++:cons_rev -> a:b:++:cons_rev encArg :: a:b:++:cons_rev -> a:b:++:cons_rev cons_rev :: a:b:++:cons_rev -> a:b:++:cons_rev encode_rev :: a:b:++:cons_rev -> a:b:++:cons_rev encode_a :: a:b:++:cons_rev encode_b :: a:b:++:cons_rev encode_++ :: a:b:++:cons_rev -> a:b:++:cons_rev -> a:b:++:cons_rev 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_rev(v0) -> null_encode_rev [0] encode_a -> null_encode_a [0] encode_b -> null_encode_b [0] encode_++(v0, v1) -> null_encode_++ [0] rev(v0) -> null_rev [0] And the following fresh constants: null_encArg, null_encode_rev, null_encode_a, null_encode_b, null_encode_++, null_rev ---------------------------------------- (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: rev(a) -> a [1] rev(b) -> b [1] rev(++(x, y)) -> ++(rev(y), rev(x)) [1] rev(++(x, x)) -> rev(x) [1] encArg(a) -> a [0] encArg(b) -> b [0] encArg(++(x_1, x_2)) -> ++(encArg(x_1), encArg(x_2)) [0] encArg(cons_rev(x_1)) -> rev(encArg(x_1)) [0] encode_rev(x_1) -> rev(encArg(x_1)) [0] encode_a -> a [0] encode_b -> b [0] encode_++(x_1, x_2) -> ++(encArg(x_1), encArg(x_2)) [0] encArg(v0) -> null_encArg [0] encode_rev(v0) -> null_encode_rev [0] encode_a -> null_encode_a [0] encode_b -> null_encode_b [0] encode_++(v0, v1) -> null_encode_++ [0] rev(v0) -> null_rev [0] The TRS has the following type information: rev :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev -> a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev a :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev b :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev ++ :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev -> a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev -> a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev encArg :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev -> a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev cons_rev :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev -> a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev encode_rev :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev -> a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev encode_a :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev encode_b :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev encode_++ :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev -> a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev -> a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev null_encArg :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev null_encode_rev :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev null_encode_a :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev null_encode_b :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev null_encode_++ :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev null_rev :: a:b:++:cons_rev:null_encArg:null_encode_rev:null_encode_a:null_encode_b:null_encode_++:null_rev 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: a => 0 b => 1 null_encArg => 0 null_encode_rev => 0 null_encode_a => 0 null_encode_b => 0 null_encode_++ => 0 null_rev => 0 ---------------------------------------- (12) Obligation: Complexity RNTS consisting of the following rules: encArg(z) -{ 0 }-> rev(encArg(x_1)) :|: z = 1 + x_1, x_1 >= 0 encArg(z) -{ 0 }-> 1 :|: z = 1 encArg(z) -{ 0 }-> 0 :|: z = 0 encArg(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 encArg(z) -{ 0 }-> 1 + encArg(x_1) + encArg(x_2) :|: x_1 >= 0, z = 1 + x_1 + x_2, x_2 >= 0 encode_++(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 encode_++(z, z') -{ 0 }-> 1 + encArg(x_1) + encArg(x_2) :|: x_1 >= 0, x_2 >= 0, z = x_1, z' = x_2 encode_a -{ 0 }-> 0 :|: encode_b -{ 0 }-> 1 :|: encode_b -{ 0 }-> 0 :|: encode_rev(z) -{ 0 }-> rev(encArg(x_1)) :|: x_1 >= 0, z = x_1 encode_rev(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 rev(z) -{ 1 }-> rev(x) :|: z = 1 + x + x, x >= 0 rev(z) -{ 1 }-> 1 :|: z = 1 rev(z) -{ 1 }-> 0 :|: z = 0 rev(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 rev(z) -{ 1 }-> 1 + rev(y) + rev(x) :|: z = 1 + x + y, x >= 0, y >= 0 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, V8),0,[rev(V, Out)],[V >= 0]). eq(start(V, V8),0,[encArg(V, Out)],[V >= 0]). eq(start(V, V8),0,[fun(V, Out)],[V >= 0]). eq(start(V, V8),0,[fun1(Out)],[]). eq(start(V, V8),0,[fun2(Out)],[]). eq(start(V, V8),0,[fun3(V, V8, Out)],[V >= 0,V8 >= 0]). eq(rev(V, Out),1,[],[Out = 0,V = 0]). eq(rev(V, Out),1,[],[Out = 1,V = 1]). eq(rev(V, Out),1,[rev(V1, Ret01),rev(V2, Ret1)],[Out = 1 + Ret01 + Ret1,V = 1 + V1 + V2,V2 >= 0,V1 >= 0]). eq(rev(V, Out),1,[rev(V3, Ret)],[Out = Ret,V = 1 + 2*V3,V3 >= 0]). eq(encArg(V, Out),0,[],[Out = 0,V = 0]). eq(encArg(V, Out),0,[],[Out = 1,V = 1]). eq(encArg(V, Out),0,[encArg(V5, Ret011),encArg(V4, Ret11)],[Out = 1 + Ret011 + Ret11,V5 >= 0,V = 1 + V4 + V5,V4 >= 0]). eq(encArg(V, Out),0,[encArg(V6, Ret0),rev(Ret0, Ret2)],[Out = Ret2,V = 1 + V6,V6 >= 0]). eq(fun(V, Out),0,[encArg(V7, Ret02),rev(Ret02, Ret3)],[Out = Ret3,V7 >= 0,V = V7]). eq(fun1(Out),0,[],[Out = 0]). eq(fun2(Out),0,[],[Out = 1]). eq(fun3(V, V8, Out),0,[encArg(V10, Ret012),encArg(V9, Ret12)],[Out = 1 + Ret012 + Ret12,V10 >= 0,V9 >= 0,V = V10,V8 = V9]). eq(encArg(V, Out),0,[],[Out = 0,V11 >= 0,V = V11]). eq(fun(V, Out),0,[],[Out = 0,V12 >= 0,V = V12]). eq(fun2(Out),0,[],[Out = 0]). eq(fun3(V, V8, Out),0,[],[Out = 0,V14 >= 0,V13 >= 0,V = V14,V8 = V13]). eq(rev(V, Out),0,[],[Out = 0,V15 >= 0,V = V15]). input_output_vars(rev(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(Out),[],[Out]). input_output_vars(fun3(V,V8,Out),[V,V8],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive [multiple] : [rev/2] 1. recursive [non_tail,multiple] : [encArg/2] 2. non_recursive : [fun/2] 3. non_recursive : [fun1/1] 4. non_recursive : [fun2/1] 5. non_recursive : [fun3/3] 6. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into rev/2 1. SCC is partially evaluated into encArg/2 2. SCC is partially evaluated into fun/2 3. SCC is completely evaluated into other SCCs 4. SCC is partially evaluated into fun2/1 5. SCC is partially evaluated into fun3/3 6. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations rev/2 * CE 8 is refined into CE [22] * CE 7 is refined into CE [23] * CE 11 is refined into CE [24] * CE 10 is refined into CE [25] * CE 9 is refined into CE [26] ### Cost equations --> "Loop" of rev/2 * CEs [26] --> Loop 14 * CEs [25] --> Loop 15 * CEs [22] --> Loop 16 * CEs [23,24] --> Loop 17 ### Ranking functions of CR rev(V,Out) * RF of phase [14,15]: [V] #### Partial ranking functions of CR rev(V,Out) * Partial RF of phase [14,15]: - RF of loop [14:1,14:2,15:1]: V ### Specialization of cost equations encArg/2 * CE 12 is refined into CE [27] * CE 13 is refined into CE [28] * CE 15 is refined into CE [29,30] * CE 14 is refined into CE [31] ### Cost equations --> "Loop" of encArg/2 * CEs [31] --> Loop 18 * CEs [29] --> Loop 19 * CEs [30] --> Loop 20 * CEs [27] --> Loop 21 * CEs [28] --> Loop 22 ### Ranking functions of CR encArg(V,Out) * RF of phase [18,19,20]: [V] #### Partial ranking functions of CR encArg(V,Out) * Partial RF of phase [18,19,20]: - RF of loop [18:1,18:2,19:1,20:1]: V ### Specialization of cost equations fun/2 * CE 16 is refined into CE [32,33,34] * CE 17 is refined into CE [35] ### Cost equations --> "Loop" of fun/2 * CEs [32] --> Loop 23 * CEs [33,34,35] --> Loop 24 ### Ranking functions of CR fun(V,Out) #### Partial ranking functions of CR fun(V,Out) ### Specialization of cost equations fun2/1 * CE 18 is refined into CE [36] * CE 19 is refined into CE [37] ### Cost equations --> "Loop" of fun2/1 * CEs [36] --> Loop 25 * CEs [37] --> Loop 26 ### Ranking functions of CR fun2(Out) #### Partial ranking functions of CR fun2(Out) ### Specialization of cost equations fun3/3 * CE 20 is refined into CE [38,39,40,41] * CE 21 is refined into CE [42] ### Cost equations --> "Loop" of fun3/3 * CEs [38] --> Loop 27 * CEs [39] --> Loop 28 * CEs [40] --> Loop 29 * CEs [41] --> Loop 30 * CEs [42] --> Loop 31 ### Ranking functions of CR fun3(V,V8,Out) #### Partial ranking functions of CR fun3(V,V8,Out) ### Specialization of cost equations start/2 * CE 1 is refined into CE [43,44] * CE 2 is refined into CE [45,46] * CE 3 is refined into CE [47,48] * CE 4 is refined into CE [49] * CE 5 is refined into CE [50,51] * CE 6 is refined into CE [52,53,54,55,56] ### Cost equations --> "Loop" of start/2 * CEs [43,44,45,46,47,48,49,50,51,52,53,54,55,56] --> Loop 32 ### Ranking functions of CR start(V,V8) #### Partial ranking functions of CR start(V,V8) Computing Bounds ===================================== #### Cost of chains of rev(V,Out): * Chain [17]: 1 with precondition: [Out=0,V>=0] * Chain [16]: 1 with precondition: [V=1,Out=1] * Chain [multiple([14,15],[[17],[16]])]: 2*it(14)+1*it([16])+1*it([17])+0 Such that:it([17]) =< V+1 it([16]) =< V/2+1/2 aux(1) =< V it(14) =< aux(1) it([16]) =< aux(1) with precondition: [V>=1,Out>=0,V>=Out] #### Cost of chains of encArg(V,Out): * Chain [22]: 0 with precondition: [V=1,Out=1] * Chain [21]: 0 with precondition: [Out=0,V>=0] * Chain [multiple([18,19,20],[[22],[21]])]: 2*it(19)+1*s(13)+1*s(14)+2*s(15)+0 Such that:aux(5) =< V it(19) =< aux(5) aux(3) =< aux(5)+1 s(16) =< it(19)*aux(5) aux(4) =< it(19)*aux(3) s(13) =< it(19)*aux(3) s(14) =< aux(4)*(1/2) s(15) =< s(16) s(14) =< s(16) with precondition: [V>=1,Out>=0,V>=Out] #### Cost of chains of fun(V,Out): * Chain [24]: 2*s(26)+1*s(30)+1*s(31)+2*s(32)+1 Such that:s(25) =< V s(26) =< s(25) s(27) =< s(25)+1 s(28) =< s(26)*s(25) s(29) =< s(26)*s(27) s(30) =< s(26)*s(27) s(31) =< s(29)*(1/2) s(32) =< s(28) s(31) =< s(28) with precondition: [Out=0,V>=0] * Chain [23]: 4*s(34)+1*s(38)+1*s(39)+2*s(40)+1*s(42)+1*s(43)+1 Such that:s(42) =< V+1 s(43) =< V/2+1/2 aux(7) =< V s(34) =< aux(7) s(43) =< aux(7) s(35) =< aux(7)+1 s(36) =< s(34)*aux(7) s(37) =< s(34)*s(35) s(38) =< s(34)*s(35) s(39) =< s(37)*(1/2) s(40) =< s(36) s(39) =< s(36) with precondition: [V>=1,Out>=0,V>=Out] #### Cost of chains of fun2(Out): * Chain [26]: 0 with precondition: [Out=0] * Chain [25]: 0 with precondition: [Out=1] #### Cost of chains of fun3(V,V8,Out): * Chain [31]: 0 with precondition: [Out=0,V>=0,V8>=0] * Chain [30]: 0 with precondition: [Out=1,V>=0,V8>=0] * Chain [29]: 2*s(46)+1*s(50)+1*s(51)+2*s(52)+0 Such that:s(45) =< V8 s(46) =< s(45) s(47) =< s(45)+1 s(48) =< s(46)*s(45) s(49) =< s(46)*s(47) s(50) =< s(46)*s(47) s(51) =< s(49)*(1/2) s(52) =< s(48) s(51) =< s(48) with precondition: [V>=0,V8>=1,Out>=1,V8+1>=Out] * Chain [28]: 2*s(54)+1*s(58)+1*s(59)+2*s(60)+0 Such that:s(53) =< V s(54) =< s(53) s(55) =< s(53)+1 s(56) =< s(54)*s(53) s(57) =< s(54)*s(55) s(58) =< s(54)*s(55) s(59) =< s(57)*(1/2) s(60) =< s(56) s(59) =< s(56) with precondition: [V>=1,V8>=0,Out>=1,V+1>=Out] * Chain [27]: 2*s(62)+1*s(66)+1*s(67)+2*s(68)+2*s(70)+1*s(74)+1*s(75)+2*s(76)+0 Such that:s(61) =< V s(69) =< V8 s(70) =< s(69) s(71) =< s(69)+1 s(72) =< s(70)*s(69) s(73) =< s(70)*s(71) s(74) =< s(70)*s(71) s(75) =< s(73)*(1/2) s(76) =< s(72) s(75) =< s(72) s(62) =< s(61) s(63) =< s(61)+1 s(64) =< s(62)*s(61) s(65) =< s(62)*s(63) s(66) =< s(62)*s(63) s(67) =< s(65)*(1/2) s(68) =< s(64) s(67) =< s(64) with precondition: [V>=1,V8>=1,Out>=1,V+V8+1>=Out] #### Cost of chains of start(V,V8): * Chain [32]: 2*s(78)+2*s(79)+14*s(80)+5*s(86)+5*s(87)+10*s(88)+4*s(108)+2*s(112)+2*s(113)+4*s(114)+1 Such that:aux(8) =< V aux(9) =< V+1 aux(10) =< V/2+1/2 aux(11) =< V8 s(78) =< aux(9) s(79) =< aux(10) s(80) =< aux(8) s(79) =< aux(8) s(83) =< aux(8)+1 s(84) =< s(80)*aux(8) s(85) =< s(80)*s(83) s(86) =< s(80)*s(83) s(87) =< s(85)*(1/2) s(88) =< s(84) s(87) =< s(84) s(108) =< aux(11) s(109) =< aux(11)+1 s(110) =< s(108)*aux(11) s(111) =< s(108)*s(109) s(112) =< s(108)*s(109) s(113) =< s(111)*(1/2) s(114) =< s(110) s(113) =< s(110) with precondition: [] Closed-form bounds of start(V,V8): ------------------------------------- * Chain [32] with precondition: [] - Upper bound: 43/2*nat(V)+1+35/2*nat(V)*nat(V)+nat(V8)*7+nat(V8)*7*nat(V8)+nat(V+1)*2+nat(V/2+1/2)*2 - Complexity: n^2 ### Maximum cost of start(V,V8): 43/2*nat(V)+1+35/2*nat(V)*nat(V)+nat(V8)*7+nat(V8)*7*nat(V8)+nat(V+1)*2+nat(V/2+1/2)*2 Asymptotic class: n^2 * Total analysis performed in 255 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: rev(a) -> a rev(b) -> b rev(++(x, y)) -> ++(rev(y), rev(x)) rev(++(x, x)) -> rev(x) The (relative) TRS S consists of the following rules: encArg(a) -> a encArg(b) -> b encArg(++(x_1, x_2)) -> ++(encArg(x_1), encArg(x_2)) encArg(cons_rev(x_1)) -> rev(encArg(x_1)) encode_rev(x_1) -> rev(encArg(x_1)) encode_a -> a encode_b -> b encode_++(x_1, x_2) -> ++(encArg(x_1), encArg(x_2)) Rewrite Strategy: INNERMOST ---------------------------------------- (17) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (18) Obligation: Innermost TRS: Rules: rev(a) -> a rev(b) -> b rev(++(x, y)) -> ++(rev(y), rev(x)) rev(++(x, x)) -> rev(x) encArg(a) -> a encArg(b) -> b encArg(++(x_1, x_2)) -> ++(encArg(x_1), encArg(x_2)) encArg(cons_rev(x_1)) -> rev(encArg(x_1)) encode_rev(x_1) -> rev(encArg(x_1)) encode_a -> a encode_b -> b encode_++(x_1, x_2) -> ++(encArg(x_1), encArg(x_2)) Types: rev :: a:b:++:cons_rev -> a:b:++:cons_rev a :: a:b:++:cons_rev b :: a:b:++:cons_rev ++ :: a:b:++:cons_rev -> a:b:++:cons_rev -> a:b:++:cons_rev encArg :: a:b:++:cons_rev -> a:b:++:cons_rev cons_rev :: a:b:++:cons_rev -> a:b:++:cons_rev encode_rev :: a:b:++:cons_rev -> a:b:++:cons_rev encode_a :: a:b:++:cons_rev encode_b :: a:b:++:cons_rev encode_++ :: a:b:++:cons_rev -> a:b:++:cons_rev -> a:b:++:cons_rev hole_a:b:++:cons_rev1_0 :: a:b:++:cons_rev gen_a:b:++:cons_rev2_0 :: Nat -> a:b:++:cons_rev ---------------------------------------- (19) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: rev, encArg They will be analysed ascendingly in the following order: rev < encArg ---------------------------------------- (20) Obligation: Innermost TRS: Rules: rev(a) -> a rev(b) -> b rev(++(x, y)) -> ++(rev(y), rev(x)) rev(++(x, x)) -> rev(x) encArg(a) -> a encArg(b) -> b encArg(++(x_1, x_2)) -> ++(encArg(x_1), encArg(x_2)) encArg(cons_rev(x_1)) -> rev(encArg(x_1)) encode_rev(x_1) -> rev(encArg(x_1)) encode_a -> a encode_b -> b encode_++(x_1, x_2) -> ++(encArg(x_1), encArg(x_2)) Types: rev :: a:b:++:cons_rev -> a:b:++:cons_rev a :: a:b:++:cons_rev b :: a:b:++:cons_rev ++ :: a:b:++:cons_rev -> a:b:++:cons_rev -> a:b:++:cons_rev encArg :: a:b:++:cons_rev -> a:b:++:cons_rev cons_rev :: a:b:++:cons_rev -> a:b:++:cons_rev encode_rev :: a:b:++:cons_rev -> a:b:++:cons_rev encode_a :: a:b:++:cons_rev encode_b :: a:b:++:cons_rev encode_++ :: a:b:++:cons_rev -> a:b:++:cons_rev -> a:b:++:cons_rev hole_a:b:++:cons_rev1_0 :: a:b:++:cons_rev gen_a:b:++:cons_rev2_0 :: Nat -> a:b:++:cons_rev Generator Equations: gen_a:b:++:cons_rev2_0(0) <=> a gen_a:b:++:cons_rev2_0(+(x, 1)) <=> ++(a, gen_a:b:++:cons_rev2_0(x)) The following defined symbols remain to be analysed: rev, encArg They will be analysed ascendingly in the following order: rev < encArg ---------------------------------------- (21) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: rev(gen_a:b:++:cons_rev2_0(+(1, n4_0))) -> *3_0, rt in Omega(n4_0) Induction Base: rev(gen_a:b:++:cons_rev2_0(+(1, 0))) Induction Step: rev(gen_a:b:++:cons_rev2_0(+(1, +(n4_0, 1)))) ->_R^Omega(1) ++(rev(gen_a:b:++:cons_rev2_0(+(1, n4_0))), rev(a)) ->_IH ++(*3_0, rev(a)) ->_R^Omega(1) ++(*3_0, a) 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: rev(a) -> a rev(b) -> b rev(++(x, y)) -> ++(rev(y), rev(x)) rev(++(x, x)) -> rev(x) encArg(a) -> a encArg(b) -> b encArg(++(x_1, x_2)) -> ++(encArg(x_1), encArg(x_2)) encArg(cons_rev(x_1)) -> rev(encArg(x_1)) encode_rev(x_1) -> rev(encArg(x_1)) encode_a -> a encode_b -> b encode_++(x_1, x_2) -> ++(encArg(x_1), encArg(x_2)) Types: rev :: a:b:++:cons_rev -> a:b:++:cons_rev a :: a:b:++:cons_rev b :: a:b:++:cons_rev ++ :: a:b:++:cons_rev -> a:b:++:cons_rev -> a:b:++:cons_rev encArg :: a:b:++:cons_rev -> a:b:++:cons_rev cons_rev :: a:b:++:cons_rev -> a:b:++:cons_rev encode_rev :: a:b:++:cons_rev -> a:b:++:cons_rev encode_a :: a:b:++:cons_rev encode_b :: a:b:++:cons_rev encode_++ :: a:b:++:cons_rev -> a:b:++:cons_rev -> a:b:++:cons_rev hole_a:b:++:cons_rev1_0 :: a:b:++:cons_rev gen_a:b:++:cons_rev2_0 :: Nat -> a:b:++:cons_rev Generator Equations: gen_a:b:++:cons_rev2_0(0) <=> a gen_a:b:++:cons_rev2_0(+(x, 1)) <=> ++(a, gen_a:b:++:cons_rev2_0(x)) The following defined symbols remain to be analysed: rev, encArg They will be analysed ascendingly in the following order: rev < encArg ---------------------------------------- (24) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (25) BOUNDS(n^1, INF) ---------------------------------------- (26) Obligation: Innermost TRS: Rules: rev(a) -> a rev(b) -> b rev(++(x, y)) -> ++(rev(y), rev(x)) rev(++(x, x)) -> rev(x) encArg(a) -> a encArg(b) -> b encArg(++(x_1, x_2)) -> ++(encArg(x_1), encArg(x_2)) encArg(cons_rev(x_1)) -> rev(encArg(x_1)) encode_rev(x_1) -> rev(encArg(x_1)) encode_a -> a encode_b -> b encode_++(x_1, x_2) -> ++(encArg(x_1), encArg(x_2)) Types: rev :: a:b:++:cons_rev -> a:b:++:cons_rev a :: a:b:++:cons_rev b :: a:b:++:cons_rev ++ :: a:b:++:cons_rev -> a:b:++:cons_rev -> a:b:++:cons_rev encArg :: a:b:++:cons_rev -> a:b:++:cons_rev cons_rev :: a:b:++:cons_rev -> a:b:++:cons_rev encode_rev :: a:b:++:cons_rev -> a:b:++:cons_rev encode_a :: a:b:++:cons_rev encode_b :: a:b:++:cons_rev encode_++ :: a:b:++:cons_rev -> a:b:++:cons_rev -> a:b:++:cons_rev hole_a:b:++:cons_rev1_0 :: a:b:++:cons_rev gen_a:b:++:cons_rev2_0 :: Nat -> a:b:++:cons_rev Lemmas: rev(gen_a:b:++:cons_rev2_0(+(1, n4_0))) -> *3_0, rt in Omega(n4_0) Generator Equations: gen_a:b:++:cons_rev2_0(0) <=> a gen_a:b:++:cons_rev2_0(+(x, 1)) <=> ++(a, gen_a:b:++:cons_rev2_0(x)) The following defined symbols remain to be analysed: encArg ---------------------------------------- (27) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: encArg(gen_a:b:++:cons_rev2_0(n11844_0)) -> gen_a:b:++:cons_rev2_0(n11844_0), rt in Omega(0) Induction Base: encArg(gen_a:b:++:cons_rev2_0(0)) ->_R^Omega(0) a Induction Step: encArg(gen_a:b:++:cons_rev2_0(+(n11844_0, 1))) ->_R^Omega(0) ++(encArg(a), encArg(gen_a:b:++:cons_rev2_0(n11844_0))) ->_R^Omega(0) ++(a, encArg(gen_a:b:++:cons_rev2_0(n11844_0))) ->_IH ++(a, gen_a:b:++:cons_rev2_0(c11845_0)) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (28) BOUNDS(1, INF)