/export/starexec/sandbox2/solver/bin/starexec_run_complexity /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^3)) proof of /export/starexec/sandbox2/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^3). (0) CpxTRS (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, 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) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (8) CpxRNTS (9) CompleteCoflocoProof [FINISHED, 616 ms] (10) BOUNDS(1, n^3) (11) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxTRS (13) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (14) typed CpxTrs (15) OrderProof [LOWER BOUND(ID), 0 ms] (16) typed CpxTrs (17) RewriteLemmaProof [LOWER BOUND(ID), 292 ms] (18) BEST (19) proven lower bound (20) LowerBoundPropagationProof [FINISHED, 0 ms] (21) BOUNDS(n^1, INF) (22) typed CpxTrs (23) RewriteLemmaProof [LOWER BOUND(ID), 42 ms] (24) typed CpxTrs ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^3). The TRS R consists of the following rules: minus(x, y) -> if(gt(x, y), x, y) if(true, x, y) -> s(minus(p(x), y)) if(false, x, y) -> 0 p(0) -> 0 p(s(x)) -> x ge(x, 0) -> true ge(0, s(x)) -> false ge(s(x), s(y)) -> ge(x, y) gt(0, y) -> false gt(s(x), 0) -> true gt(s(x), s(y)) -> gt(x, y) div(x, y) -> if1(ge(x, y), x, y) if1(true, x, y) -> if2(gt(y, 0), x, y) if1(false, x, y) -> 0 if2(true, x, y) -> s(div(minus(x, y), y)) if2(false, x, y) -> 0 S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, 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^3). The TRS R consists of the following rules: minus(x, y) -> if(gt(x, y), x, y) [1] if(true, x, y) -> s(minus(p(x), y)) [1] if(false, x, y) -> 0 [1] p(0) -> 0 [1] p(s(x)) -> x [1] ge(x, 0) -> true [1] ge(0, s(x)) -> false [1] ge(s(x), s(y)) -> ge(x, y) [1] gt(0, y) -> false [1] gt(s(x), 0) -> true [1] gt(s(x), s(y)) -> gt(x, y) [1] div(x, y) -> if1(ge(x, y), x, y) [1] if1(true, x, y) -> if2(gt(y, 0), x, y) [1] if1(false, x, y) -> 0 [1] if2(true, x, y) -> s(div(minus(x, y), y)) [1] if2(false, x, y) -> 0 [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: minus(x, y) -> if(gt(x, y), x, y) [1] if(true, x, y) -> s(minus(p(x), y)) [1] if(false, x, y) -> 0 [1] p(0) -> 0 [1] p(s(x)) -> x [1] ge(x, 0) -> true [1] ge(0, s(x)) -> false [1] ge(s(x), s(y)) -> ge(x, y) [1] gt(0, y) -> false [1] gt(s(x), 0) -> true [1] gt(s(x), s(y)) -> gt(x, y) [1] div(x, y) -> if1(ge(x, y), x, y) [1] if1(true, x, y) -> if2(gt(y, 0), x, y) [1] if1(false, x, y) -> 0 [1] if2(true, x, y) -> s(div(minus(x, y), y)) [1] if2(false, x, y) -> 0 [1] The TRS has the following type information: minus :: s:0 -> s:0 -> s:0 if :: true:false -> s:0 -> s:0 -> s:0 gt :: s:0 -> s:0 -> true:false true :: true:false s :: s:0 -> s:0 p :: s:0 -> s:0 false :: true:false 0 :: s:0 ge :: s:0 -> s:0 -> true:false div :: s:0 -> s:0 -> s:0 if1 :: true:false -> s:0 -> s:0 -> s:0 if2 :: true:false -> s:0 -> s:0 -> s:0 Rewrite Strategy: INNERMOST ---------------------------------------- (5) 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: none And the following fresh constants: none ---------------------------------------- (6) 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: minus(x, y) -> if(gt(x, y), x, y) [1] if(true, x, y) -> s(minus(p(x), y)) [1] if(false, x, y) -> 0 [1] p(0) -> 0 [1] p(s(x)) -> x [1] ge(x, 0) -> true [1] ge(0, s(x)) -> false [1] ge(s(x), s(y)) -> ge(x, y) [1] gt(0, y) -> false [1] gt(s(x), 0) -> true [1] gt(s(x), s(y)) -> gt(x, y) [1] div(x, y) -> if1(ge(x, y), x, y) [1] if1(true, x, y) -> if2(gt(y, 0), x, y) [1] if1(false, x, y) -> 0 [1] if2(true, x, y) -> s(div(minus(x, y), y)) [1] if2(false, x, y) -> 0 [1] The TRS has the following type information: minus :: s:0 -> s:0 -> s:0 if :: true:false -> s:0 -> s:0 -> s:0 gt :: s:0 -> s:0 -> true:false true :: true:false s :: s:0 -> s:0 p :: s:0 -> s:0 false :: true:false 0 :: s:0 ge :: s:0 -> s:0 -> true:false div :: s:0 -> s:0 -> s:0 if1 :: true:false -> s:0 -> s:0 -> s:0 if2 :: true:false -> s:0 -> s:0 -> s:0 Rewrite Strategy: INNERMOST ---------------------------------------- (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: true => 1 false => 0 0 => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: div(z, z') -{ 1 }-> if1(ge(x, y), x, y) :|: x >= 0, y >= 0, z = x, z' = y ge(z, z') -{ 1 }-> ge(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x ge(z, z') -{ 1 }-> 1 :|: x >= 0, z = x, z' = 0 ge(z, z') -{ 1 }-> 0 :|: z' = 1 + x, x >= 0, z = 0 gt(z, z') -{ 1 }-> gt(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x gt(z, z') -{ 1 }-> 1 :|: x >= 0, z = 1 + x, z' = 0 gt(z, z') -{ 1 }-> 0 :|: y >= 0, z = 0, z' = y if(z, z', z'') -{ 1 }-> 0 :|: z' = x, z'' = y, x >= 0, y >= 0, z = 0 if(z, z', z'') -{ 1 }-> 1 + minus(p(x), y) :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 if1(z, z', z'') -{ 1 }-> if2(gt(y, 0), x, y) :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 if1(z, z', z'') -{ 1 }-> 0 :|: z' = x, z'' = y, x >= 0, y >= 0, z = 0 if2(z, z', z'') -{ 1 }-> 0 :|: z' = x, z'' = y, x >= 0, y >= 0, z = 0 if2(z, z', z'') -{ 1 }-> 1 + div(minus(x, y), y) :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 minus(z, z') -{ 1 }-> if(gt(x, y), x, y) :|: x >= 0, y >= 0, z = x, z' = y p(z) -{ 1 }-> x :|: x >= 0, z = 1 + x p(z) -{ 1 }-> 0 :|: z = 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (9) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V1, V, V5),0,[minus(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V5),0,[if(V1, V, V5, Out)],[V1 >= 0,V >= 0,V5 >= 0]). eq(start(V1, V, V5),0,[p(V1, Out)],[V1 >= 0]). eq(start(V1, V, V5),0,[ge(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V5),0,[gt(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V5),0,[div(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V5),0,[if1(V1, V, V5, Out)],[V1 >= 0,V >= 0,V5 >= 0]). eq(start(V1, V, V5),0,[if2(V1, V, V5, Out)],[V1 >= 0,V >= 0,V5 >= 0]). eq(minus(V1, V, Out),1,[gt(V3, V2, Ret0),if(Ret0, V3, V2, Ret)],[Out = Ret,V3 >= 0,V2 >= 0,V1 = V3,V = V2]). eq(if(V1, V, V5, Out),1,[p(V4, Ret10),minus(Ret10, V6, Ret1)],[Out = 1 + Ret1,V = V4,V5 = V6,V1 = 1,V4 >= 0,V6 >= 0]). eq(if(V1, V, V5, Out),1,[],[Out = 0,V = V8,V5 = V7,V8 >= 0,V7 >= 0,V1 = 0]). eq(p(V1, Out),1,[],[Out = 0,V1 = 0]). eq(p(V1, Out),1,[],[Out = V9,V9 >= 0,V1 = 1 + V9]). eq(ge(V1, V, Out),1,[],[Out = 1,V10 >= 0,V1 = V10,V = 0]). eq(ge(V1, V, Out),1,[],[Out = 0,V = 1 + V11,V11 >= 0,V1 = 0]). eq(ge(V1, V, Out),1,[ge(V13, V12, Ret2)],[Out = Ret2,V = 1 + V12,V13 >= 0,V12 >= 0,V1 = 1 + V13]). eq(gt(V1, V, Out),1,[],[Out = 0,V14 >= 0,V1 = 0,V = V14]). eq(gt(V1, V, Out),1,[],[Out = 1,V15 >= 0,V1 = 1 + V15,V = 0]). eq(gt(V1, V, Out),1,[gt(V17, V16, Ret3)],[Out = Ret3,V = 1 + V16,V17 >= 0,V16 >= 0,V1 = 1 + V17]). eq(div(V1, V, Out),1,[ge(V19, V18, Ret01),if1(Ret01, V19, V18, Ret4)],[Out = Ret4,V19 >= 0,V18 >= 0,V1 = V19,V = V18]). eq(if1(V1, V, V5, Out),1,[gt(V20, 0, Ret02),if2(Ret02, V21, V20, Ret5)],[Out = Ret5,V = V21,V5 = V20,V1 = 1,V21 >= 0,V20 >= 0]). eq(if1(V1, V, V5, Out),1,[],[Out = 0,V = V23,V5 = V22,V23 >= 0,V22 >= 0,V1 = 0]). eq(if2(V1, V, V5, Out),1,[minus(V24, V25, Ret101),div(Ret101, V25, Ret11)],[Out = 1 + Ret11,V = V24,V5 = V25,V1 = 1,V24 >= 0,V25 >= 0]). eq(if2(V1, V, V5, Out),1,[],[Out = 0,V = V26,V5 = V27,V26 >= 0,V27 >= 0,V1 = 0]). input_output_vars(minus(V1,V,Out),[V1,V],[Out]). input_output_vars(if(V1,V,V5,Out),[V1,V,V5],[Out]). input_output_vars(p(V1,Out),[V1],[Out]). input_output_vars(ge(V1,V,Out),[V1,V],[Out]). input_output_vars(gt(V1,V,Out),[V1,V],[Out]). input_output_vars(div(V1,V,Out),[V1,V],[Out]). input_output_vars(if1(V1,V,V5,Out),[V1,V,V5],[Out]). input_output_vars(if2(V1,V,V5,Out),[V1,V,V5],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [ge/3] 1. recursive : [gt/3] 2. non_recursive : [p/2] 3. recursive : [if/4,minus/3] 4. recursive : [(div)/3,if1/4,if2/4] 5. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into ge/3 1. SCC is partially evaluated into gt/3 2. SCC is partially evaluated into p/2 3. SCC is partially evaluated into minus/3 4. SCC is partially evaluated into (div)/3 5. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations ge/3 * CE 23 is refined into CE [24] * CE 21 is refined into CE [25] * CE 22 is refined into CE [26] ### Cost equations --> "Loop" of ge/3 * CEs [25] --> Loop 15 * CEs [26] --> Loop 16 * CEs [24] --> Loop 17 ### Ranking functions of CR ge(V1,V,Out) * RF of phase [17]: [V,V1] #### Partial ranking functions of CR ge(V1,V,Out) * Partial RF of phase [17]: - RF of loop [17:1]: V V1 ### Specialization of cost equations gt/3 * CE 13 is refined into CE [27] * CE 12 is refined into CE [28] * CE 11 is refined into CE [29] ### Cost equations --> "Loop" of gt/3 * CEs [28] --> Loop 18 * CEs [29] --> Loop 19 * CEs [27] --> Loop 20 ### Ranking functions of CR gt(V1,V,Out) * RF of phase [20]: [V,V1] #### Partial ranking functions of CR gt(V1,V,Out) * Partial RF of phase [20]: - RF of loop [20:1]: V V1 ### Specialization of cost equations p/2 * CE 20 is refined into CE [30] * CE 19 is refined into CE [31] ### Cost equations --> "Loop" of p/2 * CEs [30] --> Loop 21 * CEs [31] --> Loop 22 ### Ranking functions of CR p(V1,Out) #### Partial ranking functions of CR p(V1,Out) ### Specialization of cost equations minus/3 * CE 15 is refined into CE [32,33] * CE 14 is refined into CE [34,35] ### Cost equations --> "Loop" of minus/3 * CEs [35] --> Loop 23 * CEs [34] --> Loop 24 * CEs [33] --> Loop 25 * CEs [32] --> Loop 26 ### Ranking functions of CR minus(V1,V,Out) * RF of phase [25]: [V1-1,V1-V] * RF of phase [26]: [V1] #### Partial ranking functions of CR minus(V1,V,Out) * Partial RF of phase [25]: - RF of loop [25:1]: V1-1 V1-V * Partial RF of phase [26]: - RF of loop [26:1]: V1 ### Specialization of cost equations (div)/3 * CE 16 is refined into CE [36,37] * CE 18 is refined into CE [38] * CE 17 is refined into CE [39,40] ### Cost equations --> "Loop" of (div)/3 * CEs [40] --> Loop 27 * CEs [39] --> Loop 28 * CEs [37] --> Loop 29 * CEs [38] --> Loop 30 * CEs [36] --> Loop 31 ### Ranking functions of CR div(V1,V,Out) * RF of phase [27]: [V1-1,V1-V] #### Partial ranking functions of CR div(V1,V,Out) * Partial RF of phase [27]: - RF of loop [27:1]: V1-1 V1-V ### Specialization of cost equations start/3 * CE 2 is refined into CE [41,42,43,44,45,46] * CE 3 is refined into CE [47] * CE 4 is refined into CE [48,49,50,51,52,53,54,55] * CE 5 is refined into CE [56,57,58,59,60] * CE 1 is refined into CE [61] * CE 6 is refined into CE [62,63,64,65] * CE 7 is refined into CE [66,67] * CE 8 is refined into CE [68,69,70,71] * CE 9 is refined into CE [72,73,74,75] * CE 10 is refined into CE [76,77,78,79,80,81] ### Cost equations --> "Loop" of start/3 * CEs [43,52] --> Loop 32 * CEs [45,46,54,55,60] --> Loop 33 * CEs [59] --> Loop 34 * CEs [42,51] --> Loop 35 * CEs [44,53] --> Loop 36 * CEs [47,50,58] --> Loop 37 * CEs [57,64,65,67,70,71,74,75,78,79,80,81] --> Loop 38 * CEs [41,48,49,56,63,69,73,77] --> Loop 39 * CEs [61,62,66,68,72,76] --> Loop 40 ### Ranking functions of CR start(V1,V,V5) #### Partial ranking functions of CR start(V1,V,V5) Computing Bounds ===================================== #### Cost of chains of ge(V1,V,Out): * Chain [[17],16]: 1*it(17)+1 Such that:it(17) =< V1 with precondition: [Out=0,V1>=1,V>=V1+1] * Chain [[17],15]: 1*it(17)+1 Such that:it(17) =< V with precondition: [Out=1,V>=1,V1>=V] * Chain [16]: 1 with precondition: [V1=0,Out=0,V>=1] * Chain [15]: 1 with precondition: [V=0,Out=1,V1>=0] #### Cost of chains of gt(V1,V,Out): * Chain [[20],19]: 1*it(20)+1 Such that:it(20) =< V1 with precondition: [Out=0,V1>=1,V>=V1] * Chain [[20],18]: 1*it(20)+1 Such that:it(20) =< V with precondition: [Out=1,V>=1,V1>=V+1] * Chain [19]: 1 with precondition: [V1=0,Out=0,V>=0] * Chain [18]: 1 with precondition: [V=0,Out=1,V1>=1] #### Cost of chains of p(V1,Out): * Chain [22]: 1 with precondition: [V1=0,Out=0] * Chain [21]: 1 with precondition: [V1=Out+1,V1>=1] #### Cost of chains of minus(V1,V,Out): * Chain [[26],24]: 4*it(26)+3 Such that:it(26) =< Out with precondition: [V=0,V1=Out,V1>=1] * Chain [[25],23]: 4*it(25)+1*s(1)+1*s(4)+3 Such that:it(25) =< Out aux(2) =< V1-Out s(1) =< aux(2) s(4) =< it(25)*aux(2) with precondition: [V1=Out+V,V>=1,V1>=V+1] * Chain [24]: 3 with precondition: [V1=0,Out=0,V>=0] * Chain [23]: 1*s(1)+3 Such that:s(1) =< V1 with precondition: [Out=0,V1>=1,V>=V1] #### Cost of chains of div(V1,V,Out): * Chain [[27],29]: 8*it(27)+3*s(5)+4*s(16)+1*s(17)+3 Such that:aux(7) =< V1-V s(12) =< V aux(9) =< V1 it(27) =< aux(9) s(5) =< aux(9) it(27) =< aux(7) s(16) =< it(27)*aux(7) s(17) =< s(16)*s(12) with precondition: [V>=1,Out>=1,V1>=Out+V] * Chain [[27],28,31]: 8*it(27)+2*s(15)+4*s(16)+1*s(17)+2*s(19)+11 Such that:aux(6) =< V1 aux(11) =< V1-V aux(12) =< V it(27) =< aux(11) s(19) =< aux(12) it(27) =< aux(6) s(18) =< aux(6) s(18) =< aux(11) s(16) =< it(27)*aux(11) s(15) =< s(18) s(17) =< s(16)*aux(12) with precondition: [V>=1,Out>=2,V1+2>=2*V+Out] * Chain [31]: 3 with precondition: [V1=0,Out=0,V>=1] * Chain [30]: 5 with precondition: [V=0,Out=0,V1>=0] * Chain [29]: 1*s(5)+3 Such that:s(5) =< V1 with precondition: [Out=0,V1>=1,V>=V1+1] * Chain [28,31]: 2*s(19)+11 Such that:aux(10) =< V1 s(19) =< aux(10) with precondition: [Out=1,V1=V,V1>=1] #### Cost of chains of start(V1,V,V5): * Chain [40]: 3 with precondition: [V1=0] * Chain [39]: 4*s(21)+9 Such that:s(21) =< V1 with precondition: [V=0,V1>=0] * Chain [38]: 7*s(22)+4*s(23)+7*s(25)+1*s(26)+16*s(37)+8*s(39)+2*s(40)+2*s(48)+11 Such that:aux(13) =< V1 aux(14) =< V1-V aux(15) =< V s(22) =< aux(13) s(23) =< aux(14) s(25) =< aux(15) s(37) =< aux(13) s(37) =< aux(14) s(39) =< s(37)*aux(14) s(40) =< s(39)*aux(15) s(46) =< aux(13) s(46) =< aux(14) s(48) =< s(46) s(26) =< s(23)*aux(15) with precondition: [V1>=1] * Chain [37]: 8*s(50)+9 Such that:aux(16) =< V s(50) =< aux(16) with precondition: [V1=1,V5=0,V>=0] * Chain [36]: 14*s(52)+2*s(55)+17 Such that:aux(19) =< V5 s(52) =< aux(19) s(55) =< s(52)*aux(19) with precondition: [V1=1,V=2*V5,V>=2] * Chain [35]: 2*s(64)+9 Such that:aux(20) =< V s(64) =< aux(20) with precondition: [V1=1,V>=1,V5>=V] * Chain [34]: 1*s(66)+5 Such that:s(66) =< V with precondition: [V1=1,V>=2,V5+1>=V] * Chain [33]: 26*s(67)+9*s(69)+5*s(70)+32*s(74)+16*s(76)+4*s(77)+4*s(89)+17 Such that:aux(29) =< V-2*V5 aux(30) =< V-V5 aux(31) =< V5 s(67) =< aux(30) s(74) =< aux(30) s(74) =< aux(29) s(76) =< s(74)*aux(29) s(77) =< s(76)*aux(31) s(69) =< aux(31) s(70) =< s(67)*aux(31) s(87) =< aux(30) s(87) =< aux(29) s(89) =< s(87) with precondition: [V1=1,V5>=1,V>=V5+2] * Chain [32]: 10*s(119)+2*s(121)+2*s(122)+9 Such that:aux(34) =< V-V5 aux(35) =< V5 s(119) =< aux(34) s(121) =< aux(35) s(122) =< s(119)*aux(35) with precondition: [V1=1,2*V5>=V+1,V>=V5+1] Closed-form bounds of start(V1,V,V5): ------------------------------------- * Chain [40] with precondition: [V1=0] - Upper bound: 3 - Complexity: constant * Chain [39] with precondition: [V=0,V1>=0] - Upper bound: 4*V1+9 - Complexity: n * Chain [38] with precondition: [V1>=1] - Upper bound: 25*V1+11+2*V1*nat(V)*nat(V1-V)+8*V1*nat(V1-V)+nat(V)*7+nat(V1-V)*nat(V)+nat(V1-V)*4 - Complexity: n^3 * Chain [37] with precondition: [V1=1,V5=0,V>=0] - Upper bound: 8*V+9 - Complexity: n * Chain [36] with precondition: [V1=1,V=2*V5,V>=2] - Upper bound: 14*V5+17+2*V5*V5 - Complexity: n^2 * Chain [35] with precondition: [V1=1,V>=1,V5>=V] - Upper bound: 2*V+9 - Complexity: n * Chain [34] with precondition: [V1=1,V>=2,V5+1>=V] - Upper bound: V+5 - Complexity: n * Chain [33] with precondition: [V1=1,V5>=1,V>=V5+2] - Upper bound: 62*V-62*V5+(9*V5+17+(V-V5)*(5*V5)+(V-V5)*(4*V5)*nat(V-2*V5))+(16*V-16*V5)*nat(V-2*V5) - Complexity: n^3 * Chain [32] with precondition: [V1=1,2*V5>=V+1,V>=V5+1] - Upper bound: 10*V-10*V5+(2*V5+9+(V-V5)*(2*V5)) - Complexity: n^2 ### Maximum cost of start(V1,V,V5): max([max([4*V1+6,nat(V5)*2+6+max([nat(V5)*2*nat(V-V5)+nat(V-V5)*10,nat(V5)*7+8+max([nat(V5)*2*nat(V5)+nat(V5)*5,nat(V5)*4*nat(V-V5)*nat(V-2*V5)+nat(V5)*5*nat(V-V5)+nat(V-V5)*62+nat(V-V5)*16*nat(V-2*V5)])])]),nat(V)*5+max([nat(V),25*V1+2+2*V1*nat(V)*nat(V1-V)+8*V1*nat(V1-V)+nat(V1-V)*nat(V)+nat(V1-V)*4])+(nat(V)+4)+(nat(V)+2)])+3 Asymptotic class: n^3 * Total analysis performed in 509 ms. ---------------------------------------- (10) BOUNDS(1, n^3) ---------------------------------------- (11) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (12) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: minus(x, y) -> if(gt(x, y), x, y) if(true, x, y) -> s(minus(p(x), y)) if(false, x, y) -> 0' p(0') -> 0' p(s(x)) -> x ge(x, 0') -> true ge(0', s(x)) -> false ge(s(x), s(y)) -> ge(x, y) gt(0', y) -> false gt(s(x), 0') -> true gt(s(x), s(y)) -> gt(x, y) div(x, y) -> if1(ge(x, y), x, y) if1(true, x, y) -> if2(gt(y, 0'), x, y) if1(false, x, y) -> 0' if2(true, x, y) -> s(div(minus(x, y), y)) if2(false, x, y) -> 0' S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (13) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (14) Obligation: Innermost TRS: Rules: minus(x, y) -> if(gt(x, y), x, y) if(true, x, y) -> s(minus(p(x), y)) if(false, x, y) -> 0' p(0') -> 0' p(s(x)) -> x ge(x, 0') -> true ge(0', s(x)) -> false ge(s(x), s(y)) -> ge(x, y) gt(0', y) -> false gt(s(x), 0') -> true gt(s(x), s(y)) -> gt(x, y) div(x, y) -> if1(ge(x, y), x, y) if1(true, x, y) -> if2(gt(y, 0'), x, y) if1(false, x, y) -> 0' if2(true, x, y) -> s(div(minus(x, y), y)) if2(false, x, y) -> 0' Types: minus :: s:0' -> s:0' -> s:0' if :: true:false -> s:0' -> s:0' -> s:0' gt :: s:0' -> s:0' -> true:false true :: true:false s :: s:0' -> s:0' p :: s:0' -> s:0' false :: true:false 0' :: s:0' ge :: s:0' -> s:0' -> true:false div :: s:0' -> s:0' -> s:0' if1 :: true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> s:0' -> s:0' -> s:0' hole_s:0'1_0 :: s:0' hole_true:false2_0 :: true:false gen_s:0'3_0 :: Nat -> s:0' ---------------------------------------- (15) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: minus, gt, ge, div They will be analysed ascendingly in the following order: gt < minus minus < div gt < div ge < div ---------------------------------------- (16) Obligation: Innermost TRS: Rules: minus(x, y) -> if(gt(x, y), x, y) if(true, x, y) -> s(minus(p(x), y)) if(false, x, y) -> 0' p(0') -> 0' p(s(x)) -> x ge(x, 0') -> true ge(0', s(x)) -> false ge(s(x), s(y)) -> ge(x, y) gt(0', y) -> false gt(s(x), 0') -> true gt(s(x), s(y)) -> gt(x, y) div(x, y) -> if1(ge(x, y), x, y) if1(true, x, y) -> if2(gt(y, 0'), x, y) if1(false, x, y) -> 0' if2(true, x, y) -> s(div(minus(x, y), y)) if2(false, x, y) -> 0' Types: minus :: s:0' -> s:0' -> s:0' if :: true:false -> s:0' -> s:0' -> s:0' gt :: s:0' -> s:0' -> true:false true :: true:false s :: s:0' -> s:0' p :: s:0' -> s:0' false :: true:false 0' :: s:0' ge :: s:0' -> s:0' -> true:false div :: s:0' -> s:0' -> s:0' if1 :: true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> s:0' -> s:0' -> s:0' hole_s:0'1_0 :: s:0' hole_true:false2_0 :: true:false gen_s:0'3_0 :: Nat -> s:0' Generator Equations: gen_s:0'3_0(0) <=> 0' gen_s:0'3_0(+(x, 1)) <=> s(gen_s:0'3_0(x)) The following defined symbols remain to be analysed: gt, minus, ge, div They will be analysed ascendingly in the following order: gt < minus minus < div gt < div ge < div ---------------------------------------- (17) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: gt(gen_s:0'3_0(n5_0), gen_s:0'3_0(n5_0)) -> false, rt in Omega(1 + n5_0) Induction Base: gt(gen_s:0'3_0(0), gen_s:0'3_0(0)) ->_R^Omega(1) false Induction Step: gt(gen_s:0'3_0(+(n5_0, 1)), gen_s:0'3_0(+(n5_0, 1))) ->_R^Omega(1) gt(gen_s:0'3_0(n5_0), gen_s:0'3_0(n5_0)) ->_IH false We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (18) Complex Obligation (BEST) ---------------------------------------- (19) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: minus(x, y) -> if(gt(x, y), x, y) if(true, x, y) -> s(minus(p(x), y)) if(false, x, y) -> 0' p(0') -> 0' p(s(x)) -> x ge(x, 0') -> true ge(0', s(x)) -> false ge(s(x), s(y)) -> ge(x, y) gt(0', y) -> false gt(s(x), 0') -> true gt(s(x), s(y)) -> gt(x, y) div(x, y) -> if1(ge(x, y), x, y) if1(true, x, y) -> if2(gt(y, 0'), x, y) if1(false, x, y) -> 0' if2(true, x, y) -> s(div(minus(x, y), y)) if2(false, x, y) -> 0' Types: minus :: s:0' -> s:0' -> s:0' if :: true:false -> s:0' -> s:0' -> s:0' gt :: s:0' -> s:0' -> true:false true :: true:false s :: s:0' -> s:0' p :: s:0' -> s:0' false :: true:false 0' :: s:0' ge :: s:0' -> s:0' -> true:false div :: s:0' -> s:0' -> s:0' if1 :: true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> s:0' -> s:0' -> s:0' hole_s:0'1_0 :: s:0' hole_true:false2_0 :: true:false gen_s:0'3_0 :: Nat -> s:0' Generator Equations: gen_s:0'3_0(0) <=> 0' gen_s:0'3_0(+(x, 1)) <=> s(gen_s:0'3_0(x)) The following defined symbols remain to be analysed: gt, minus, ge, div They will be analysed ascendingly in the following order: gt < minus minus < div gt < div ge < div ---------------------------------------- (20) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (21) BOUNDS(n^1, INF) ---------------------------------------- (22) Obligation: Innermost TRS: Rules: minus(x, y) -> if(gt(x, y), x, y) if(true, x, y) -> s(minus(p(x), y)) if(false, x, y) -> 0' p(0') -> 0' p(s(x)) -> x ge(x, 0') -> true ge(0', s(x)) -> false ge(s(x), s(y)) -> ge(x, y) gt(0', y) -> false gt(s(x), 0') -> true gt(s(x), s(y)) -> gt(x, y) div(x, y) -> if1(ge(x, y), x, y) if1(true, x, y) -> if2(gt(y, 0'), x, y) if1(false, x, y) -> 0' if2(true, x, y) -> s(div(minus(x, y), y)) if2(false, x, y) -> 0' Types: minus :: s:0' -> s:0' -> s:0' if :: true:false -> s:0' -> s:0' -> s:0' gt :: s:0' -> s:0' -> true:false true :: true:false s :: s:0' -> s:0' p :: s:0' -> s:0' false :: true:false 0' :: s:0' ge :: s:0' -> s:0' -> true:false div :: s:0' -> s:0' -> s:0' if1 :: true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> s:0' -> s:0' -> s:0' hole_s:0'1_0 :: s:0' hole_true:false2_0 :: true:false gen_s:0'3_0 :: Nat -> s:0' Lemmas: gt(gen_s:0'3_0(n5_0), gen_s:0'3_0(n5_0)) -> false, rt in Omega(1 + n5_0) Generator Equations: gen_s:0'3_0(0) <=> 0' gen_s:0'3_0(+(x, 1)) <=> s(gen_s:0'3_0(x)) The following defined symbols remain to be analysed: minus, ge, div They will be analysed ascendingly in the following order: minus < div ge < div ---------------------------------------- (23) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: ge(gen_s:0'3_0(n395_0), gen_s:0'3_0(n395_0)) -> true, rt in Omega(1 + n395_0) Induction Base: ge(gen_s:0'3_0(0), gen_s:0'3_0(0)) ->_R^Omega(1) true Induction Step: ge(gen_s:0'3_0(+(n395_0, 1)), gen_s:0'3_0(+(n395_0, 1))) ->_R^Omega(1) ge(gen_s:0'3_0(n395_0), gen_s:0'3_0(n395_0)) ->_IH true We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (24) Obligation: Innermost TRS: Rules: minus(x, y) -> if(gt(x, y), x, y) if(true, x, y) -> s(minus(p(x), y)) if(false, x, y) -> 0' p(0') -> 0' p(s(x)) -> x ge(x, 0') -> true ge(0', s(x)) -> false ge(s(x), s(y)) -> ge(x, y) gt(0', y) -> false gt(s(x), 0') -> true gt(s(x), s(y)) -> gt(x, y) div(x, y) -> if1(ge(x, y), x, y) if1(true, x, y) -> if2(gt(y, 0'), x, y) if1(false, x, y) -> 0' if2(true, x, y) -> s(div(minus(x, y), y)) if2(false, x, y) -> 0' Types: minus :: s:0' -> s:0' -> s:0' if :: true:false -> s:0' -> s:0' -> s:0' gt :: s:0' -> s:0' -> true:false true :: true:false s :: s:0' -> s:0' p :: s:0' -> s:0' false :: true:false 0' :: s:0' ge :: s:0' -> s:0' -> true:false div :: s:0' -> s:0' -> s:0' if1 :: true:false -> s:0' -> s:0' -> s:0' if2 :: true:false -> s:0' -> s:0' -> s:0' hole_s:0'1_0 :: s:0' hole_true:false2_0 :: true:false gen_s:0'3_0 :: Nat -> s:0' Lemmas: gt(gen_s:0'3_0(n5_0), gen_s:0'3_0(n5_0)) -> false, rt in Omega(1 + n5_0) ge(gen_s:0'3_0(n395_0), gen_s:0'3_0(n395_0)) -> true, rt in Omega(1 + n395_0) Generator Equations: gen_s:0'3_0(0) <=> 0' gen_s:0'3_0(+(x, 1)) <=> s(gen_s:0'3_0(x)) The following defined symbols remain to be analysed: div