/export/starexec/sandbox/solver/bin/starexec_run_complexity /export/starexec/sandbox/benchmark/theBenchmark.xml /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^3)) proof of /export/starexec/sandbox/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, 1616 ms] (10) BOUNDS(1, n^3) (11) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] (12) TRS for Loop Detection (13) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] (14) BEST (15) proven lower bound (16) LowerBoundPropagationProof [FINISHED, 0 ms] (17) BOUNDS(n^1, INF) (18) TRS for Loop Detection ---------------------------------------- (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(s(x), y) -> if(gt(s(x), y), x, y) if(true, x, y) -> s(minus(x, y)) if(false, x, y) -> 0 gcd(x, y) -> if1(ge(x, y), x, y) if1(true, x, y) -> if2(gt(y, 0), x, y) if1(false, x, y) -> gcd(y, x) if2(true, x, y) -> gcd(minus(x, y), y) if2(false, x, y) -> x gt(0, y) -> false gt(s(x), 0) -> true gt(s(x), s(y)) -> gt(x, y) ge(x, 0) -> true ge(0, s(x)) -> false ge(s(x), s(y)) -> ge(x, y) 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(s(x), y) -> if(gt(s(x), y), x, y) [1] if(true, x, y) -> s(minus(x, y)) [1] if(false, x, y) -> 0 [1] gcd(x, y) -> if1(ge(x, y), x, y) [1] if1(true, x, y) -> if2(gt(y, 0), x, y) [1] if1(false, x, y) -> gcd(y, x) [1] if2(true, x, y) -> gcd(minus(x, y), y) [1] if2(false, x, y) -> x [1] gt(0, y) -> false [1] gt(s(x), 0) -> true [1] gt(s(x), s(y)) -> gt(x, y) [1] ge(x, 0) -> true [1] ge(0, s(x)) -> false [1] ge(s(x), s(y)) -> ge(x, 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: minus(s(x), y) -> if(gt(s(x), y), x, y) [1] if(true, x, y) -> s(minus(x, y)) [1] if(false, x, y) -> 0 [1] gcd(x, y) -> if1(ge(x, y), x, y) [1] if1(true, x, y) -> if2(gt(y, 0), x, y) [1] if1(false, x, y) -> gcd(y, x) [1] if2(true, x, y) -> gcd(minus(x, y), y) [1] if2(false, x, y) -> x [1] gt(0, y) -> false [1] gt(s(x), 0) -> true [1] gt(s(x), s(y)) -> gt(x, y) [1] ge(x, 0) -> true [1] ge(0, s(x)) -> false [1] ge(s(x), s(y)) -> ge(x, y) [1] The TRS has the following type information: minus :: s:0 -> s:0 -> s:0 s :: s:0 -> s:0 if :: true:false -> s:0 -> s:0 -> s:0 gt :: s:0 -> s:0 -> true:false true :: true:false false :: true:false 0 :: s:0 gcd :: s:0 -> s:0 -> s:0 if1 :: true:false -> s:0 -> s:0 -> s:0 ge :: s:0 -> s:0 -> true:false 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: minus(v0, v1) -> null_minus [0] gt(v0, v1) -> null_gt [0] ge(v0, v1) -> null_ge [0] if(v0, v1, v2) -> null_if [0] if1(v0, v1, v2) -> null_if1 [0] if2(v0, v1, v2) -> null_if2 [0] And the following fresh constants: null_minus, null_gt, null_ge, null_if, null_if1, null_if2 ---------------------------------------- (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(s(x), y) -> if(gt(s(x), y), x, y) [1] if(true, x, y) -> s(minus(x, y)) [1] if(false, x, y) -> 0 [1] gcd(x, y) -> if1(ge(x, y), x, y) [1] if1(true, x, y) -> if2(gt(y, 0), x, y) [1] if1(false, x, y) -> gcd(y, x) [1] if2(true, x, y) -> gcd(minus(x, y), y) [1] if2(false, x, y) -> x [1] gt(0, y) -> false [1] gt(s(x), 0) -> true [1] gt(s(x), s(y)) -> gt(x, y) [1] ge(x, 0) -> true [1] ge(0, s(x)) -> false [1] ge(s(x), s(y)) -> ge(x, y) [1] minus(v0, v1) -> null_minus [0] gt(v0, v1) -> null_gt [0] ge(v0, v1) -> null_ge [0] if(v0, v1, v2) -> null_if [0] if1(v0, v1, v2) -> null_if1 [0] if2(v0, v1, v2) -> null_if2 [0] The TRS has the following type information: minus :: s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 s :: s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 if :: true:false:null_gt:null_ge -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 gt :: s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> true:false:null_gt:null_ge true :: true:false:null_gt:null_ge false :: true:false:null_gt:null_ge 0 :: s:0:null_minus:null_if:null_if1:null_if2 gcd :: s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 if1 :: true:false:null_gt:null_ge -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 ge :: s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> true:false:null_gt:null_ge if2 :: true:false:null_gt:null_ge -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 -> s:0:null_minus:null_if:null_if1:null_if2 null_minus :: s:0:null_minus:null_if:null_if1:null_if2 null_gt :: true:false:null_gt:null_ge null_ge :: true:false:null_gt:null_ge null_if :: s:0:null_minus:null_if:null_if1:null_if2 null_if1 :: s:0:null_minus:null_if:null_if1:null_if2 null_if2 :: s:0:null_minus:null_if:null_if1:null_if2 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 => 2 false => 1 0 => 0 null_minus => 0 null_gt => 0 null_ge => 0 null_if => 0 null_if1 => 0 null_if2 => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: gcd(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 }-> 2 :|: x >= 0, z = x, z' = 0 ge(z, z') -{ 1 }-> 1 :|: z' = 1 + x, x >= 0, z = 0 ge(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 gt(z, z') -{ 1 }-> gt(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x gt(z, z') -{ 1 }-> 2 :|: x >= 0, z = 1 + x, z' = 0 gt(z, z') -{ 1 }-> 1 :|: y >= 0, z = 0, z' = y gt(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 if(z, z', z'') -{ 1 }-> 0 :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 if(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 if(z, z', z'') -{ 1 }-> 1 + minus(x, y) :|: z = 2, z' = x, z'' = y, x >= 0, y >= 0 if1(z, z', z'') -{ 1 }-> if2(gt(y, 0), x, y) :|: z = 2, z' = x, z'' = y, x >= 0, y >= 0 if1(z, z', z'') -{ 1 }-> gcd(y, x) :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 if1(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 if2(z, z', z'') -{ 1 }-> x :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 if2(z, z', z'') -{ 1 }-> gcd(minus(x, y), y) :|: z = 2, z' = x, z'' = y, x >= 0, y >= 0 if2(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 minus(z, z') -{ 1 }-> if(gt(1 + x, y), x, y) :|: x >= 0, y >= 0, z = 1 + x, z' = y minus(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 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,[gcd(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(start(V1, V, V5),0,[gt(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V5),0,[ge(V1, V, Out)],[V1 >= 0,V >= 0]). eq(minus(V1, V, Out),1,[gt(1 + V3, V2, Ret0),if(Ret0, V3, V2, Ret)],[Out = Ret,V3 >= 0,V2 >= 0,V1 = 1 + V3,V = V2]). eq(if(V1, V, V5, Out),1,[minus(V4, V6, Ret1)],[Out = 1 + Ret1,V1 = 2,V = V4,V5 = V6,V4 >= 0,V6 >= 0]). eq(if(V1, V, V5, Out),1,[],[Out = 0,V = V8,V5 = V7,V1 = 1,V8 >= 0,V7 >= 0]). eq(gcd(V1, V, Out),1,[ge(V9, V10, Ret01),if1(Ret01, V9, V10, Ret2)],[Out = Ret2,V9 >= 0,V10 >= 0,V1 = V9,V = V10]). eq(if1(V1, V, V5, Out),1,[gt(V11, 0, Ret02),if2(Ret02, V12, V11, Ret3)],[Out = Ret3,V1 = 2,V = V12,V5 = V11,V12 >= 0,V11 >= 0]). eq(if1(V1, V, V5, Out),1,[gcd(V13, V14, Ret4)],[Out = Ret4,V = V14,V5 = V13,V1 = 1,V14 >= 0,V13 >= 0]). eq(if2(V1, V, V5, Out),1,[minus(V16, V15, Ret03),gcd(Ret03, V15, Ret5)],[Out = Ret5,V1 = 2,V = V16,V5 = V15,V16 >= 0,V15 >= 0]). eq(if2(V1, V, V5, Out),1,[],[Out = V17,V = V17,V5 = V18,V1 = 1,V17 >= 0,V18 >= 0]). eq(gt(V1, V, Out),1,[],[Out = 1,V19 >= 0,V1 = 0,V = V19]). eq(gt(V1, V, Out),1,[],[Out = 2,V20 >= 0,V1 = 1 + V20,V = 0]). eq(gt(V1, V, Out),1,[gt(V21, V22, Ret6)],[Out = Ret6,V = 1 + V22,V21 >= 0,V22 >= 0,V1 = 1 + V21]). eq(ge(V1, V, Out),1,[],[Out = 2,V23 >= 0,V1 = V23,V = 0]). eq(ge(V1, V, Out),1,[],[Out = 1,V = 1 + V24,V24 >= 0,V1 = 0]). eq(ge(V1, V, Out),1,[ge(V25, V26, Ret7)],[Out = Ret7,V = 1 + V26,V25 >= 0,V26 >= 0,V1 = 1 + V25]). eq(minus(V1, V, Out),0,[],[Out = 0,V28 >= 0,V27 >= 0,V1 = V28,V = V27]). eq(gt(V1, V, Out),0,[],[Out = 0,V30 >= 0,V29 >= 0,V1 = V30,V = V29]). eq(ge(V1, V, Out),0,[],[Out = 0,V32 >= 0,V31 >= 0,V1 = V32,V = V31]). eq(if(V1, V, V5, Out),0,[],[Out = 0,V33 >= 0,V5 = V35,V34 >= 0,V1 = V33,V = V34,V35 >= 0]). eq(if1(V1, V, V5, Out),0,[],[Out = 0,V37 >= 0,V5 = V38,V36 >= 0,V1 = V37,V = V36,V38 >= 0]). eq(if2(V1, V, V5, Out),0,[],[Out = 0,V40 >= 0,V5 = V41,V39 >= 0,V1 = V40,V = V39,V41 >= 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(gcd(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]). input_output_vars(gt(V1,V,Out),[V1,V],[Out]). input_output_vars(ge(V1,V,Out),[V1,V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [ge/3] 1. recursive : [gt/3] 2. recursive : [if/4,minus/3] 3. recursive : [gcd/3,if1/4,if2/4] 4. 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 minus/3 3. SCC is partially evaluated into gcd/3 4. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations ge/3 * CE 29 is refined into CE [30] * CE 26 is refined into CE [31] * CE 27 is refined into CE [32] * CE 28 is refined into CE [33] ### Cost equations --> "Loop" of ge/3 * CEs [33] --> Loop 17 * CEs [30] --> Loop 18 * CEs [31] --> Loop 19 * CEs [32] --> Loop 20 ### 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 16 is refined into CE [34] * CE 14 is refined into CE [35] * CE 13 is refined into CE [36] * CE 15 is refined into CE [37] ### Cost equations --> "Loop" of gt/3 * CEs [37] --> Loop 21 * CEs [34] --> Loop 22 * CEs [35] --> Loop 23 * CEs [36] --> Loop 24 ### Ranking functions of CR gt(V1,V,Out) * RF of phase [21]: [V,V1] #### Partial ranking functions of CR gt(V1,V,Out) * Partial RF of phase [21]: - RF of loop [21:1]: V V1 ### Specialization of cost equations minus/3 * CE 17 is refined into CE [38,39,40,41] * CE 18 is refined into CE [42] * CE 20 is refined into CE [43] * CE 19 is refined into CE [44,45] ### Cost equations --> "Loop" of minus/3 * CEs [45] --> Loop 25 * CEs [44] --> Loop 26 * CEs [38,39,40,41,42,43] --> Loop 27 ### 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 gcd/3 * CE 23 is refined into CE [46,47] * CE 25 is refined into CE [48,49] * CE 22 is refined into CE [50] * CE 21 is refined into CE [51,52,53,54] * CE 24 is refined into CE [55,56,57,58,59] ### Cost equations --> "Loop" of gcd/3 * CEs [50] --> Loop 28 * CEs [51,52,56] --> Loop 29 * CEs [53,54,55,57,58,59] --> Loop 30 * CEs [47] --> Loop 31 * CEs [49] --> Loop 32 * CEs [46] --> Loop 33 * CEs [48] --> Loop 34 ### Ranking functions of CR gcd(V1,V,Out) * RF of phase [31,32]: [V1+2*V-3] #### Partial ranking functions of CR gcd(V1,V,Out) * Partial RF of phase [31,32]: - RF of loop [31:1]: V1-1 depends on loops [32:1] V1-V depends on loops [32:1] - RF of loop [32:1]: V-1 -V1/2+V/2 depends on loops [31:1] ### Specialization of cost equations start/3 * CE 1 is refined into CE [60,61,62] * CE 3 is refined into CE [63] * CE 5 is refined into CE [64,65,66,67,68] * CE 6 is refined into CE [69,70,71,72,73,74,75,76,77,78] * CE 8 is refined into CE [79,80,81] * CE 2 is refined into CE [82] * CE 4 is refined into CE [83] * CE 7 is refined into CE [84,85,86,87,88,89] * CE 9 is refined into CE [90,91,92] * CE 10 is refined into CE [93,94,95,96,97,98] * CE 11 is refined into CE [99,100,101,102,103] * CE 12 is refined into CE [104,105,106,107,108] ### Cost equations --> "Loop" of start/3 * CEs [90,95,96,100,105] --> Loop 35 * CEs [60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81] --> Loop 36 * CEs [85] --> Loop 37 * CEs [83,84,86,87,88,89] --> Loop 38 * CEs [82,91,92,93,94,97,98,99,101,102,103,104,106,107,108] --> Loop 39 ### 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],20]: 1*it(17)+1 Such that:it(17) =< V1 with precondition: [Out=1,V1>=1,V>=V1+1] * Chain [[17],19]: 1*it(17)+1 Such that:it(17) =< V with precondition: [Out=2,V>=1,V1>=V] * Chain [[17],18]: 1*it(17)+0 Such that:it(17) =< V with precondition: [Out=0,V1>=1,V>=1] * Chain [20]: 1 with precondition: [V1=0,Out=1,V>=1] * Chain [19]: 1 with precondition: [V=0,Out=2,V1>=0] * Chain [18]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of gt(V1,V,Out): * Chain [[21],24]: 1*it(21)+1 Such that:it(21) =< V1 with precondition: [Out=1,V1>=1,V>=V1] * Chain [[21],23]: 1*it(21)+1 Such that:it(21) =< V with precondition: [Out=2,V>=1,V1>=V+1] * Chain [[21],22]: 1*it(21)+0 Such that:it(21) =< V with precondition: [Out=0,V1>=1,V>=1] * Chain [24]: 1 with precondition: [V1=0,Out=1,V>=0] * Chain [23]: 1 with precondition: [V=0,Out=2,V1>=1] * Chain [22]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of minus(V1,V,Out): * Chain [[26],27]: 3*it(26)+2*s(4)+3 Such that:aux(1) =< V1-Out it(26) =< Out s(4) =< aux(1) with precondition: [V=0,Out>=1,V1>=Out] * Chain [[25],27]: 3*it(25)+2*s(3)+2*s(4)+1*s(9)+3 Such that:aux(1) =< V1-Out it(25) =< Out aux(4) =< V s(4) =< aux(1) s(3) =< aux(4) s(9) =< it(25)*aux(4) with precondition: [V>=1,Out>=1,V1>=Out+V] * Chain [27]: 2*s(3)+2*s(4)+3 Such that:aux(1) =< V1 aux(2) =< V s(4) =< aux(1) s(3) =< aux(2) with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of gcd(V1,V,Out): * Chain [[31,32],33,34,30]: 8*it(31)+3*it(32)+6*s(14)+3*s(36)+3*s(37)+2*s(38)+1*s(39)+1*s(42)+15 Such that:aux(36) =< -V1+V aux(12) =< V1-V aux(25) =< -V1/2+V/2 aux(42) =< V1/2+V/2 aux(45) =< V1 aux(46) =< V1+V aux(47) =< V1+2*V aux(48) =< V it(32) =< aux(48) s(14) =< aux(47) it(31) =< aux(47) it(32) =< aux(47) aux(24) =< aux(42) aux(24) =< aux(46) aux(23) =< aux(48) aux(26) =< aux(46)+1 aux(27) =< aux(24)*2 it(32) =< aux(24)+aux(25) aux(9) =< aux(27)+aux(36) aux(9) =< it(32)*aux(23) aux(11) =< aux(27)+aux(36) aux(11) =< it(32)*aux(48) s(42) =< it(32)*aux(26) s(41) =< aux(9)+aux(45) it(31) =< aux(11)+aux(12) it(31) =< aux(9)+aux(45) s(40) =< aux(9)+aux(45) s(41) =< it(31)*aux(23) s(37) =< it(31)*aux(46) s(40) =< it(31)*aux(46) s(36) =< s(41) s(38) =< s(40) s(39) =< s(37)*aux(48) with precondition: [Out=0,V1>=1,V>=1,V+V1>=3] * Chain [[31,32],33,34,29]: 8*it(31)+3*it(32)+5*s(16)+3*s(36)+3*s(37)+2*s(38)+1*s(39)+1*s(42)+15 Such that:aux(36) =< -V1+V aux(12) =< V1-V aux(25) =< -V1/2+V/2 aux(42) =< V1/2+V/2 aux(49) =< V1 aux(50) =< V1+V aux(51) =< V1+2*V aux(52) =< V it(32) =< aux(52) s(16) =< aux(51) it(31) =< aux(51) it(32) =< aux(51) aux(24) =< aux(42) aux(24) =< aux(50) aux(23) =< aux(52) aux(26) =< aux(50)+1 aux(27) =< aux(24)*2 it(32) =< aux(24)+aux(25) aux(9) =< aux(27)+aux(36) aux(9) =< it(32)*aux(23) aux(11) =< aux(27)+aux(36) aux(11) =< it(32)*aux(52) s(42) =< it(32)*aux(26) s(41) =< aux(9)+aux(49) it(31) =< aux(11)+aux(12) it(31) =< aux(9)+aux(49) s(40) =< aux(9)+aux(49) s(41) =< it(31)*aux(23) s(37) =< it(31)*aux(50) s(40) =< it(31)*aux(50) s(36) =< s(41) s(38) =< s(40) s(39) =< s(37)*aux(52) with precondition: [Out=0,V1>=1,V>=1,V+V1>=3] * Chain [[31,32],33,34,28]: 8*it(31)+3*it(32)+3*s(16)+2*s(19)+3*s(36)+3*s(37)+2*s(38)+1*s(39)+1*s(42)+16 Such that:aux(36) =< -V1+V aux(37) =< V1 aux(12) =< V1-V aux(38) =< V1+V aux(39) =< V1+2*V aux(40) =< V1+2*V-2*Out aux(41) =< V1-Out aux(25) =< -V1/2+V/2 aux(42) =< V1/2+V/2 aux(44) =< V it(32) =< V-Out aux(6) =< Out aux(53) =< V1+V-Out s(16) =< aux(6) s(19) =< aux(53) it(31) =< aux(39) it(32) =< aux(39) it(31) =< aux(40) it(32) =< aux(40) aux(24) =< aux(42) aux(24) =< aux(53) it(32) =< aux(44) aux(23) =< aux(44) aux(26) =< aux(38)+1 aux(27) =< aux(24)*2 it(32) =< aux(24)+aux(25) aux(9) =< aux(27)+aux(36) aux(9) =< it(32)*aux(23) aux(11) =< aux(27)+aux(36) aux(11) =< it(32)*aux(44) s(42) =< it(32)*aux(26) s(41) =< aux(9)+aux(37) it(31) =< aux(11)+aux(12) it(31) =< aux(9)+aux(37) s(41) =< aux(9)+aux(41) s(40) =< aux(9)+aux(41) s(40) =< aux(9)+aux(37) it(31) =< aux(9)+aux(41) s(41) =< it(31)*aux(23) s(37) =< it(31)*aux(38) s(40) =< it(31)*aux(38) s(36) =< s(41) s(38) =< s(40) s(39) =< s(37)*aux(44) with precondition: [Out>=1,V1>=Out,V>=Out,V+V1>=2*Out+1] * Chain [[31,32],33,30]: 8*it(31)+3*it(32)+9*s(10)+3*s(36)+3*s(37)+2*s(38)+1*s(39)+1*s(42)+12 Such that:aux(36) =< -V1+V aux(12) =< V1-V aux(25) =< -V1/2+V/2 aux(42) =< V1/2+V/2 aux(55) =< V1 aux(56) =< V1+V aux(57) =< V1+2*V aux(58) =< V it(32) =< aux(58) s(10) =< aux(56) it(31) =< aux(57) it(32) =< aux(57) aux(24) =< aux(42) aux(24) =< aux(56) aux(23) =< aux(58) aux(26) =< aux(56)+1 aux(27) =< aux(24)*2 it(32) =< aux(24)+aux(25) aux(9) =< aux(27)+aux(36) aux(9) =< it(32)*aux(23) aux(11) =< aux(27)+aux(36) aux(11) =< it(32)*aux(58) s(42) =< it(32)*aux(26) s(41) =< aux(9)+aux(55) it(31) =< aux(11)+aux(12) it(31) =< aux(9)+aux(55) s(40) =< aux(9)+aux(55) s(41) =< it(31)*aux(23) s(37) =< it(31)*aux(56) s(40) =< it(31)*aux(56) s(36) =< s(41) s(38) =< s(40) s(39) =< s(37)*aux(58) with precondition: [Out=0,V1>=1,V>=1,V+V1>=3] * Chain [[31,32],30]: 8*it(31)+3*it(32)+5*s(10)+3*s(36)+3*s(37)+2*s(38)+1*s(39)+1*s(42)+4 Such that:aux(36) =< -V1+V aux(12) =< V1-V aux(25) =< -V1/2+V/2 aux(42) =< V1/2+V/2 aux(59) =< V1 aux(60) =< V1+V aux(61) =< V1+2*V aux(62) =< V s(10) =< aux(60) it(32) =< aux(62) it(31) =< aux(61) it(32) =< aux(61) aux(24) =< aux(42) aux(24) =< aux(60) aux(23) =< aux(62) aux(26) =< aux(60)+1 aux(27) =< aux(24)*2 it(32) =< aux(24)+aux(25) aux(9) =< aux(27)+aux(36) aux(9) =< it(32)*aux(23) aux(11) =< aux(27)+aux(36) aux(11) =< it(32)*aux(62) s(42) =< it(32)*aux(26) s(41) =< aux(9)+aux(59) it(31) =< aux(11)+aux(12) it(31) =< aux(9)+aux(59) s(40) =< aux(9)+aux(59) s(41) =< it(31)*aux(23) s(37) =< it(31)*aux(60) s(40) =< it(31)*aux(60) s(36) =< s(41) s(38) =< s(40) s(39) =< s(37)*aux(62) with precondition: [Out=0,V1>=1,V>=1,V+V1>=3] * Chain [34,30]: 1*s(14)+7 Such that:s(14) =< V with precondition: [V1=0,Out=0,V>=1] * Chain [34,29]: 7 with precondition: [V1=0,Out=0,V>=1] * Chain [34,28]: 8 with precondition: [V1=0,V=Out,V>=1] * Chain [33,34,30]: 4*s(14)+2*s(19)+15 Such that:s(17) =< V1 aux(7) =< V s(14) =< aux(7) s(19) =< s(17) with precondition: [Out=0,V>=1,V1>=V] * Chain [33,34,29]: 3*s(16)+2*s(19)+15 Such that:s(17) =< V1 aux(6) =< V s(16) =< aux(6) s(19) =< s(17) with precondition: [Out=0,V>=1,V1>=V] * Chain [33,34,28]: 3*s(16)+2*s(19)+16 Such that:s(17) =< V1 aux(6) =< Out s(16) =< aux(6) s(19) =< s(17) with precondition: [V=Out,V>=1,V1>=V] * Chain [33,30]: 7*s(10)+2*s(19)+12 Such that:s(17) =< V1 aux(54) =< V s(10) =< aux(54) s(19) =< s(17) with precondition: [Out=0,V>=1,V1>=V] * Chain [30]: 4*s(10)+1*s(14)+4 Such that:s(14) =< V1 aux(5) =< V s(10) =< aux(5) with precondition: [Out=0,V1>=0,V>=0] * Chain [29]: 4 with precondition: [V=0,Out=0,V1>=0] * Chain [28]: 5 with precondition: [V=0,V1=Out,V1>=0] #### Cost of chains of start(V1,V,V5): * Chain [39]: 18*s(158)+30*s(159)+1*s(165)+19*s(176)+15*s(177)+40*s(178)+5*s(185)+15*s(188)+15*s(189)+10*s(190)+5*s(191)+11*s(192)+16 Such that:aux(76) =< -V1+V aux(77) =< V1 aux(78) =< V1-V aux(79) =< V1+V aux(80) =< V1+2*V aux(81) =< -V1/2+V/2 aux(82) =< V1/2+V/2 aux(83) =< V s(158) =< aux(77) s(159) =< aux(83) s(176) =< aux(79) s(177) =< aux(83) s(178) =< aux(80) s(177) =< aux(80) s(179) =< aux(82) s(179) =< aux(79) s(180) =< aux(83) s(181) =< aux(79)+1 s(182) =< s(179)*2 s(177) =< s(179)+aux(81) s(183) =< s(182)+aux(76) s(183) =< s(177)*s(180) s(184) =< s(182)+aux(76) s(184) =< s(177)*aux(83) s(185) =< s(177)*s(181) s(186) =< s(183)+aux(77) s(178) =< s(184)+aux(78) s(178) =< s(183)+aux(77) s(187) =< s(183)+aux(77) s(186) =< s(178)*s(180) s(188) =< s(178)*aux(79) s(187) =< s(178)*aux(79) s(189) =< s(186) s(190) =< s(187) s(191) =< s(188)*aux(83) s(192) =< aux(80) s(165) =< s(158)*aux(83) with precondition: [V1>=0,V>=0] * Chain [38]: 9*s(240)+22*s(241)+19*s(242)+15*s(243)+40*s(244)+5*s(251)+15*s(254)+15*s(255)+10*s(256)+5*s(257)+11*s(258)+17 Such that:aux(88) =< -V+V5 aux(89) =< V aux(90) =< V-V5 aux(91) =< V+V5 aux(92) =< 2*V+V5 aux(93) =< V/2-V5/2 aux(94) =< V/2+V5/2 aux(95) =< V5 s(240) =< aux(95) s(241) =< aux(89) s(242) =< aux(91) s(243) =< aux(89) s(244) =< aux(92) s(243) =< aux(92) s(245) =< aux(94) s(245) =< aux(91) s(246) =< aux(89) s(247) =< aux(91)+1 s(248) =< s(245)*2 s(243) =< s(245)+aux(93) s(249) =< s(248)+aux(90) s(249) =< s(243)*s(246) s(250) =< s(248)+aux(90) s(250) =< s(243)*aux(89) s(251) =< s(243)*s(247) s(252) =< s(249)+aux(95) s(244) =< s(250)+aux(88) s(244) =< s(249)+aux(95) s(253) =< s(249)+aux(95) s(252) =< s(244)*s(246) s(254) =< s(244)*aux(91) s(253) =< s(244)*aux(91) s(255) =< s(252) s(256) =< s(253) s(257) =< s(254)*aux(89) s(258) =< aux(92) with precondition: [V1=1,V>=0,V5>=0] * Chain [37]: 9 with precondition: [V1=1,V5=0,V>=1] * Chain [36]: 147*s(295)+134*s(296)+24*s(308)+64*s(309)+8*s(316)+24*s(319)+24*s(320)+16*s(321)+8*s(322)+22*s(323)+7*s(333)+42*s(344)+24*s(345)+64*s(346)+8*s(353)+24*s(356)+24*s(357)+16*s(358)+8*s(359)+22*s(360)+6*s(387)+16*s(392)+2*s(399)+6*s(402)+6*s(403)+4*s(404)+2*s(405)+12*s(431)+8*s(433)+22 Such that:aux(124) =< V aux(125) =< V-2*V5 aux(126) =< V+V5 aux(127) =< V+2*V5 aux(128) =< -V5 aux(129) =< V5 aux(130) =< 2*V5 aux(131) =< V5/2 s(295) =< aux(124) s(296) =< aux(129) s(333) =< s(295)*aux(129) s(430) =< aux(124) s(431) =< s(295)*aux(124) s(430) =< s(295)*aux(124) s(433) =< s(430) s(308) =< aux(129) s(309) =< aux(130) s(308) =< aux(130) s(310) =< aux(131) s(310) =< aux(129) s(311) =< aux(129) s(312) =< aux(129)+1 s(313) =< s(310)*2 s(308) =< s(310)+aux(131) s(314) =< s(313)+aux(129) s(314) =< s(308)*s(311) s(315) =< s(313)+aux(129) s(315) =< s(308)*aux(129) s(316) =< s(308)*s(312) s(317) =< s(314) s(309) =< s(315)+aux(128) s(309) =< s(314) s(318) =< s(314) s(317) =< s(309)*s(311) s(319) =< s(309)*aux(129) s(318) =< s(309)*aux(129) s(320) =< s(317) s(321) =< s(318) s(322) =< s(319)*aux(129) s(323) =< aux(130) s(344) =< aux(126) s(345) =< aux(129) s(346) =< aux(127) s(345) =< aux(127) s(349) =< aux(126)+1 s(350) =< aux(126)*2 s(345) =< aux(126)+aux(131) s(351) =< s(350)+aux(129) s(351) =< s(345)*s(311) s(352) =< s(350)+aux(129) s(352) =< s(345)*aux(129) s(353) =< s(345)*s(349) s(354) =< s(351)+aux(124) s(346) =< s(352)+aux(125) s(346) =< s(351)+aux(124) s(355) =< s(351)+aux(124) s(354) =< s(346)*s(311) s(356) =< s(346)*aux(126) s(355) =< s(346)*aux(126) s(357) =< s(354) s(358) =< s(355) s(359) =< s(356)*aux(129) s(360) =< aux(127) s(387) =< aux(129) s(392) =< aux(127) s(387) =< aux(127) s(387) =< aux(126)+aux(129) s(397) =< s(350)+aux(129) s(397) =< s(387)*s(311) s(398) =< s(350)+aux(129) s(398) =< s(387)*aux(129) s(399) =< s(387)*s(349) s(400) =< s(397)+aux(124) s(392) =< s(398)+aux(125) s(392) =< s(397)+aux(124) s(401) =< s(397)+aux(124) s(400) =< s(392)*s(311) s(402) =< s(392)*aux(126) s(401) =< s(392)*aux(126) s(403) =< s(400) s(404) =< s(401) s(405) =< s(402)*aux(129) with precondition: [V1=2,V>=0,V5>=0] * Chain [35]: 5*s(577)+5 Such that:aux(132) =< V1 s(577) =< aux(132) with precondition: [V=0,V1>=0] Closed-form bounds of start(V1,V,V5): ------------------------------------- * Chain [39] with precondition: [V1>=0,V>=0] - Upper bound: 43*V1+16+V*V1+50*V+(V1+V)*(5*V)+(V1+2*V)*((V1+V)*(5*V))+(19*V1+19*V)+(15*V1+15*V)*(V1+2*V)+(51*V1+102*V)+nat(-V1+V)*25+(25*V1+25*V) - Complexity: n^3 * Chain [38] with precondition: [V1=1,V>=0,V5>=0] - Upper bound: 42*V+17+(V+V5)*(5*V)+(2*V+V5)*((V+V5)*(5*V))+34*V5+(19*V+19*V5)+(15*V+15*V5)*(2*V+V5)+(102*V+51*V5)+(25*V+25*V5)+nat(V-V5)*25 - Complexity: n^3 * Chain [37] with precondition: [V1=1,V5=0,V>=1] - Upper bound: 9 - Complexity: constant * Chain [36] with precondition: [V1=2,V>=0,V5>=0] - Upper bound: 205*V+22+12*V*V+7*V*V5+296*V5+8*V5*V5+8*V5*V5*(2*V5)+24*V5*(2*V5)+(V+V5)*(10*V5)+(V+2*V5)*((V+V5)*(10*V5))+172*V5+(142*V+142*V5)+(30*V+30*V5)*(V+2*V5)+(102*V+204*V5)+40*V5 - Complexity: n^3 * Chain [35] with precondition: [V=0,V1>=0] - Upper bound: 5*V1+5 - Complexity: n ### Maximum cost of start(V1,V,V5): max([max([5*V1,4]),42*V+11+max([8*V+max([43*V1+V*V1+(V1+V)*(5*V)+(V1+2*V)*((V1+V)*(5*V))+(19*V1+19*V)+(15*V1+15*V)*(V1+2*V)+(51*V1+102*V)+nat(-V1+V)*25+(25*V1+25*V),155*V+6+12*V*V+7*V*nat(V5)+nat(V5)*296+nat(V5)*8*nat(V5)+nat(V5)*8*nat(V5)*nat(2*V5)+nat(V5)*24*nat(2*V5)+nat(V5)*10*nat(V+V5)+nat(V5)*10*nat(V+V5)*nat(V+2*V5)+nat(2*V5)*86+nat(V+V5)*142+nat(V+V5)*30*nat(V+2*V5)+nat(V+2*V5)*102+nat(V5/2)*80]),5*V*nat(V+V5)+1+5*V*nat(V+V5)*nat(2*V+V5)+nat(V5)*34+nat(V+V5)*19+nat(V+V5)*15*nat(2*V+V5)+nat(2*V+V5)*51+nat(V/2+V5/2)*50+nat(V-V5)*25])])+5 Asymptotic class: n^3 * Total analysis performed in 1376 ms. ---------------------------------------- (10) BOUNDS(1, n^3) ---------------------------------------- (11) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) Transformed a relative TRS into a decreasing-loop problem. ---------------------------------------- (12) Obligation: Analyzing the following TRS for decreasing loops: 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(s(x), y) -> if(gt(s(x), y), x, y) if(true, x, y) -> s(minus(x, y)) if(false, x, y) -> 0 gcd(x, y) -> if1(ge(x, y), x, y) if1(true, x, y) -> if2(gt(y, 0), x, y) if1(false, x, y) -> gcd(y, x) if2(true, x, y) -> gcd(minus(x, y), y) if2(false, x, y) -> x gt(0, y) -> false gt(s(x), 0) -> true gt(s(x), s(y)) -> gt(x, y) ge(x, 0) -> true ge(0, s(x)) -> false ge(s(x), s(y)) -> ge(x, y) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (13) DecreasingLoopProof (LOWER BOUND(ID)) The following loop(s) give(s) rise to the lower bound Omega(n^1): The rewrite sequence gt(s(x), s(y)) ->^+ gt(x, y) gives rise to a decreasing loop by considering the right hand sides subterm at position []. The pumping substitution is [x / s(x), y / s(y)]. The result substitution is [ ]. ---------------------------------------- (14) Complex Obligation (BEST) ---------------------------------------- (15) Obligation: Proved the lower bound n^1 for the following 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(s(x), y) -> if(gt(s(x), y), x, y) if(true, x, y) -> s(minus(x, y)) if(false, x, y) -> 0 gcd(x, y) -> if1(ge(x, y), x, y) if1(true, x, y) -> if2(gt(y, 0), x, y) if1(false, x, y) -> gcd(y, x) if2(true, x, y) -> gcd(minus(x, y), y) if2(false, x, y) -> x gt(0, y) -> false gt(s(x), 0) -> true gt(s(x), s(y)) -> gt(x, y) ge(x, 0) -> true ge(0, s(x)) -> false ge(s(x), s(y)) -> ge(x, y) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (16) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (17) BOUNDS(n^1, INF) ---------------------------------------- (18) Obligation: Analyzing the following TRS for decreasing loops: 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(s(x), y) -> if(gt(s(x), y), x, y) if(true, x, y) -> s(minus(x, y)) if(false, x, y) -> 0 gcd(x, y) -> if1(ge(x, y), x, y) if1(true, x, y) -> if2(gt(y, 0), x, y) if1(false, x, y) -> gcd(y, x) if2(true, x, y) -> gcd(minus(x, y), y) if2(false, x, y) -> x gt(0, y) -> false gt(s(x), 0) -> true gt(s(x), s(y)) -> gt(x, y) ge(x, 0) -> true ge(0, s(x)) -> false ge(s(x), s(y)) -> ge(x, y) S is empty. Rewrite Strategy: INNERMOST