1117.53/291.56 WORST_CASE(Omega(n^1), O(n^2)) 1117.53/291.57 proof of /export/starexec/sandbox/benchmark/theBenchmark.xml 1117.53/291.57 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 1117.53/291.57 1117.53/291.57 1117.53/291.57 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1117.53/291.57 1117.53/291.57 (0) CpxTRS 1117.53/291.57 (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] 1117.53/291.57 (2) CpxWeightedTrs 1117.53/291.57 (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 1117.53/291.57 (4) CpxTypedWeightedTrs 1117.53/291.57 (5) CompletionProof [UPPER BOUND(ID), 0 ms] 1117.53/291.57 (6) CpxTypedWeightedCompleteTrs 1117.53/291.57 (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] 1117.53/291.57 (8) CpxRNTS 1117.53/291.57 (9) CompleteCoflocoProof [FINISHED, 544 ms] 1117.53/291.57 (10) BOUNDS(1, n^2) 1117.53/291.57 (11) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] 1117.53/291.57 (12) TRS for Loop Detection 1117.53/291.57 (13) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] 1117.53/291.57 (14) BEST 1117.53/291.57 (15) proven lower bound 1117.53/291.57 (16) LowerBoundPropagationProof [FINISHED, 0 ms] 1117.53/291.57 (17) BOUNDS(n^1, INF) 1117.53/291.57 (18) TRS for Loop Detection 1117.53/291.57 1117.53/291.57 1117.53/291.57 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (0) 1117.72/291.58 Obligation: 1117.72/291.58 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1117.72/291.58 1117.72/291.58 1117.72/291.58 The TRS R consists of the following rules: 1117.72/291.58 1117.72/291.58 diff(x, y) -> cond1(equal(x, y), x, y) 1117.72/291.58 cond1(true, x, y) -> 0 1117.72/291.58 cond1(false, x, y) -> cond2(gt(x, y), x, y) 1117.72/291.58 cond2(true, x, y) -> s(diff(x, s(y))) 1117.72/291.58 cond2(false, x, y) -> s(diff(s(x), y)) 1117.72/291.58 gt(0, v) -> false 1117.72/291.58 gt(s(u), 0) -> true 1117.72/291.58 gt(s(u), s(v)) -> gt(u, v) 1117.72/291.58 equal(0, 0) -> true 1117.72/291.58 equal(s(x), 0) -> false 1117.72/291.58 equal(0, s(y)) -> false 1117.72/291.58 equal(s(x), s(y)) -> equal(x, y) 1117.72/291.58 1117.72/291.58 S is empty. 1117.72/291.58 Rewrite Strategy: INNERMOST 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) 1117.72/291.58 Transformed relative TRS to weighted TRS 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (2) 1117.72/291.58 Obligation: 1117.72/291.58 The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2). 1117.72/291.58 1117.72/291.58 1117.72/291.58 The TRS R consists of the following rules: 1117.72/291.58 1117.72/291.58 diff(x, y) -> cond1(equal(x, y), x, y) [1] 1117.72/291.58 cond1(true, x, y) -> 0 [1] 1117.72/291.58 cond1(false, x, y) -> cond2(gt(x, y), x, y) [1] 1117.72/291.58 cond2(true, x, y) -> s(diff(x, s(y))) [1] 1117.72/291.58 cond2(false, x, y) -> s(diff(s(x), y)) [1] 1117.72/291.58 gt(0, v) -> false [1] 1117.72/291.58 gt(s(u), 0) -> true [1] 1117.72/291.58 gt(s(u), s(v)) -> gt(u, v) [1] 1117.72/291.58 equal(0, 0) -> true [1] 1117.72/291.58 equal(s(x), 0) -> false [1] 1117.72/291.58 equal(0, s(y)) -> false [1] 1117.72/291.58 equal(s(x), s(y)) -> equal(x, y) [1] 1117.72/291.58 1117.72/291.58 Rewrite Strategy: INNERMOST 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 1117.72/291.58 Infered types. 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (4) 1117.72/291.58 Obligation: 1117.72/291.58 Runtime Complexity Weighted TRS with Types. 1117.72/291.58 The TRS R consists of the following rules: 1117.72/291.58 1117.72/291.58 diff(x, y) -> cond1(equal(x, y), x, y) [1] 1117.72/291.58 cond1(true, x, y) -> 0 [1] 1117.72/291.58 cond1(false, x, y) -> cond2(gt(x, y), x, y) [1] 1117.72/291.58 cond2(true, x, y) -> s(diff(x, s(y))) [1] 1117.72/291.58 cond2(false, x, y) -> s(diff(s(x), y)) [1] 1117.72/291.58 gt(0, v) -> false [1] 1117.72/291.58 gt(s(u), 0) -> true [1] 1117.72/291.58 gt(s(u), s(v)) -> gt(u, v) [1] 1117.72/291.58 equal(0, 0) -> true [1] 1117.72/291.58 equal(s(x), 0) -> false [1] 1117.72/291.58 equal(0, s(y)) -> false [1] 1117.72/291.58 equal(s(x), s(y)) -> equal(x, y) [1] 1117.72/291.58 1117.72/291.58 The TRS has the following type information: 1117.72/291.58 diff :: 0:s -> 0:s -> 0:s 1117.72/291.58 cond1 :: true:false -> 0:s -> 0:s -> 0:s 1117.72/291.58 equal :: 0:s -> 0:s -> true:false 1117.72/291.58 true :: true:false 1117.72/291.58 0 :: 0:s 1117.72/291.58 false :: true:false 1117.72/291.58 cond2 :: true:false -> 0:s -> 0:s -> 0:s 1117.72/291.58 gt :: 0:s -> 0:s -> true:false 1117.72/291.58 s :: 0:s -> 0:s 1117.72/291.58 1117.72/291.58 Rewrite Strategy: INNERMOST 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (5) CompletionProof (UPPER BOUND(ID)) 1117.72/291.58 The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: 1117.72/291.58 none 1117.72/291.58 1117.72/291.58 And the following fresh constants: none 1117.72/291.58 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (6) 1117.72/291.58 Obligation: 1117.72/291.58 Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: 1117.72/291.58 1117.72/291.58 Runtime Complexity Weighted TRS with Types. 1117.72/291.58 The TRS R consists of the following rules: 1117.72/291.58 1117.72/291.58 diff(x, y) -> cond1(equal(x, y), x, y) [1] 1117.72/291.58 cond1(true, x, y) -> 0 [1] 1117.72/291.58 cond1(false, x, y) -> cond2(gt(x, y), x, y) [1] 1117.72/291.58 cond2(true, x, y) -> s(diff(x, s(y))) [1] 1117.72/291.58 cond2(false, x, y) -> s(diff(s(x), y)) [1] 1117.72/291.58 gt(0, v) -> false [1] 1117.72/291.58 gt(s(u), 0) -> true [1] 1117.72/291.58 gt(s(u), s(v)) -> gt(u, v) [1] 1117.72/291.58 equal(0, 0) -> true [1] 1117.72/291.58 equal(s(x), 0) -> false [1] 1117.72/291.58 equal(0, s(y)) -> false [1] 1117.72/291.58 equal(s(x), s(y)) -> equal(x, y) [1] 1117.72/291.58 1117.72/291.58 The TRS has the following type information: 1117.72/291.58 diff :: 0:s -> 0:s -> 0:s 1117.72/291.58 cond1 :: true:false -> 0:s -> 0:s -> 0:s 1117.72/291.58 equal :: 0:s -> 0:s -> true:false 1117.72/291.58 true :: true:false 1117.72/291.58 0 :: 0:s 1117.72/291.58 false :: true:false 1117.72/291.58 cond2 :: true:false -> 0:s -> 0:s -> 0:s 1117.72/291.58 gt :: 0:s -> 0:s -> true:false 1117.72/291.58 s :: 0:s -> 0:s 1117.72/291.58 1117.72/291.58 Rewrite Strategy: INNERMOST 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) 1117.72/291.58 Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. 1117.72/291.58 The constant constructors are abstracted as follows: 1117.72/291.58 1117.72/291.58 true => 1 1117.72/291.58 0 => 0 1117.72/291.58 false => 0 1117.72/291.58 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (8) 1117.72/291.58 Obligation: 1117.72/291.58 Complexity RNTS consisting of the following rules: 1117.72/291.58 1117.72/291.58 cond1(z, z', z'') -{ 1 }-> cond2(gt(x, y), x, y) :|: z' = x, z'' = y, x >= 0, y >= 0, z = 0 1117.72/291.58 cond1(z, z', z'') -{ 1 }-> 0 :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 1117.72/291.58 cond2(z, z', z'') -{ 1 }-> 1 + diff(x, 1 + y) :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 1117.72/291.58 cond2(z, z', z'') -{ 1 }-> 1 + diff(1 + x, y) :|: z' = x, z'' = y, x >= 0, y >= 0, z = 0 1117.72/291.58 diff(z, z') -{ 1 }-> cond1(equal(x, y), x, y) :|: x >= 0, y >= 0, z = x, z' = y 1117.72/291.58 equal(z, z') -{ 1 }-> equal(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x 1117.72/291.58 equal(z, z') -{ 1 }-> 1 :|: z = 0, z' = 0 1117.72/291.58 equal(z, z') -{ 1 }-> 0 :|: x >= 0, z = 1 + x, z' = 0 1117.72/291.58 equal(z, z') -{ 1 }-> 0 :|: z' = 1 + y, y >= 0, z = 0 1117.72/291.58 gt(z, z') -{ 1 }-> gt(u, v) :|: v >= 0, z' = 1 + v, z = 1 + u, u >= 0 1117.72/291.58 gt(z, z') -{ 1 }-> 1 :|: z = 1 + u, z' = 0, u >= 0 1117.72/291.58 gt(z, z') -{ 1 }-> 0 :|: v >= 0, z' = v, z = 0 1117.72/291.58 1117.72/291.58 Only complete derivations are relevant for the runtime complexity. 1117.72/291.58 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (9) CompleteCoflocoProof (FINISHED) 1117.72/291.58 Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: 1117.72/291.58 1117.72/291.58 eq(start(V1, V, V5),0,[diff(V1, V, Out)],[V1 >= 0,V >= 0]). 1117.72/291.58 eq(start(V1, V, V5),0,[cond1(V1, V, V5, Out)],[V1 >= 0,V >= 0,V5 >= 0]). 1117.72/291.58 eq(start(V1, V, V5),0,[cond2(V1, V, V5, Out)],[V1 >= 0,V >= 0,V5 >= 0]). 1117.72/291.58 eq(start(V1, V, V5),0,[gt(V1, V, Out)],[V1 >= 0,V >= 0]). 1117.72/291.58 eq(start(V1, V, V5),0,[equal(V1, V, Out)],[V1 >= 0,V >= 0]). 1117.72/291.58 eq(diff(V1, V, Out),1,[equal(V3, V2, Ret0),cond1(Ret0, V3, V2, Ret)],[Out = Ret,V3 >= 0,V2 >= 0,V1 = V3,V = V2]). 1117.72/291.58 eq(cond1(V1, V, V5, Out),1,[],[Out = 0,V = V4,V5 = V6,V1 = 1,V4 >= 0,V6 >= 0]). 1117.72/291.58 eq(cond1(V1, V, V5, Out),1,[gt(V8, V7, Ret01),cond2(Ret01, V8, V7, Ret1)],[Out = Ret1,V = V8,V5 = V7,V8 >= 0,V7 >= 0,V1 = 0]). 1117.72/291.58 eq(cond2(V1, V, V5, Out),1,[diff(V9, 1 + V10, Ret11)],[Out = 1 + Ret11,V = V9,V5 = V10,V1 = 1,V9 >= 0,V10 >= 0]). 1117.72/291.58 eq(cond2(V1, V, V5, Out),1,[diff(1 + V12, V11, Ret12)],[Out = 1 + Ret12,V = V12,V5 = V11,V12 >= 0,V11 >= 0,V1 = 0]). 1117.72/291.58 eq(gt(V1, V, Out),1,[],[Out = 0,V13 >= 0,V = V13,V1 = 0]). 1117.72/291.58 eq(gt(V1, V, Out),1,[],[Out = 1,V1 = 1 + V14,V = 0,V14 >= 0]). 1117.72/291.58 eq(gt(V1, V, Out),1,[gt(V16, V15, Ret2)],[Out = Ret2,V15 >= 0,V = 1 + V15,V1 = 1 + V16,V16 >= 0]). 1117.72/291.58 eq(equal(V1, V, Out),1,[],[Out = 1,V1 = 0,V = 0]). 1117.72/291.58 eq(equal(V1, V, Out),1,[],[Out = 0,V17 >= 0,V1 = 1 + V17,V = 0]). 1117.72/291.58 eq(equal(V1, V, Out),1,[],[Out = 0,V = 1 + V18,V18 >= 0,V1 = 0]). 1117.72/291.58 eq(equal(V1, V, Out),1,[equal(V20, V19, Ret3)],[Out = Ret3,V = 1 + V19,V20 >= 0,V19 >= 0,V1 = 1 + V20]). 1117.72/291.58 input_output_vars(diff(V1,V,Out),[V1,V],[Out]). 1117.72/291.58 input_output_vars(cond1(V1,V,V5,Out),[V1,V,V5],[Out]). 1117.72/291.58 input_output_vars(cond2(V1,V,V5,Out),[V1,V,V5],[Out]). 1117.72/291.58 input_output_vars(gt(V1,V,Out),[V1,V],[Out]). 1117.72/291.58 input_output_vars(equal(V1,V,Out),[V1,V],[Out]). 1117.72/291.58 1117.72/291.58 1117.72/291.58 CoFloCo proof output: 1117.72/291.58 Preprocessing Cost Relations 1117.72/291.58 ===================================== 1117.72/291.58 1117.72/291.58 #### Computed strongly connected components 1117.72/291.58 0. recursive : [equal/3] 1117.72/291.58 1. recursive : [gt/3] 1117.72/291.58 2. recursive : [cond1/4,cond2/4,diff/3] 1117.72/291.58 3. non_recursive : [start/3] 1117.72/291.58 1117.72/291.58 #### Obtained direct recursion through partial evaluation 1117.72/291.58 0. SCC is partially evaluated into equal/3 1117.72/291.58 1. SCC is partially evaluated into gt/3 1117.72/291.58 2. SCC is partially evaluated into diff/3 1117.72/291.58 3. SCC is partially evaluated into start/3 1117.72/291.58 1117.72/291.58 Control-Flow Refinement of Cost Relations 1117.72/291.58 ===================================== 1117.72/291.58 1117.72/291.58 ### Specialization of cost equations equal/3 1117.72/291.58 * CE 18 is refined into CE [19] 1117.72/291.58 * CE 16 is refined into CE [20] 1117.72/291.58 * CE 17 is refined into CE [21] 1117.72/291.58 * CE 15 is refined into CE [22] 1117.72/291.58 1117.72/291.58 1117.72/291.58 ### Cost equations --> "Loop" of equal/3 1117.72/291.58 * CEs [20] --> Loop 13 1117.72/291.58 * CEs [21] --> Loop 14 1117.72/291.58 * CEs [22] --> Loop 15 1117.72/291.58 * CEs [19] --> Loop 16 1117.72/291.58 1117.72/291.58 ### Ranking functions of CR equal(V1,V,Out) 1117.72/291.58 * RF of phase [16]: [V,V1] 1117.72/291.58 1117.72/291.58 #### Partial ranking functions of CR equal(V1,V,Out) 1117.72/291.58 * Partial RF of phase [16]: 1117.72/291.58 - RF of loop [16:1]: 1117.72/291.58 V 1117.72/291.58 V1 1117.72/291.58 1117.72/291.58 1117.72/291.58 ### Specialization of cost equations gt/3 1117.72/291.58 * CE 11 is refined into CE [23] 1117.72/291.58 * CE 10 is refined into CE [24] 1117.72/291.58 * CE 9 is refined into CE [25] 1117.72/291.58 1117.72/291.58 1117.72/291.58 ### Cost equations --> "Loop" of gt/3 1117.72/291.58 * CEs [24] --> Loop 17 1117.72/291.58 * CEs [25] --> Loop 18 1117.72/291.58 * CEs [23] --> Loop 19 1117.72/291.58 1117.72/291.58 ### Ranking functions of CR gt(V1,V,Out) 1117.72/291.58 * RF of phase [19]: [V,V1] 1117.72/291.58 1117.72/291.58 #### Partial ranking functions of CR gt(V1,V,Out) 1117.72/291.58 * Partial RF of phase [19]: 1117.72/291.58 - RF of loop [19:1]: 1117.72/291.58 V 1117.72/291.58 V1 1117.72/291.58 1117.72/291.58 1117.72/291.58 ### Specialization of cost equations diff/3 1117.72/291.58 * CE 13 is refined into CE [26,27] 1117.72/291.58 * CE 14 is refined into CE [28,29] 1117.72/291.58 * CE 12 is refined into CE [30,31] 1117.72/291.58 1117.72/291.58 1117.72/291.58 ### Cost equations --> "Loop" of diff/3 1117.72/291.58 * CEs [31] --> Loop 20 1117.72/291.58 * CEs [30] --> Loop 21 1117.72/291.58 * CEs [27] --> Loop 22 1117.72/291.58 * CEs [29] --> Loop 23 1117.72/291.58 * CEs [26] --> Loop 24 1117.72/291.58 * CEs [28] --> Loop 25 1117.72/291.58 1117.72/291.58 ### Ranking functions of CR diff(V1,V,Out) 1117.72/291.58 * RF of phase [22]: [V1-V] 1117.72/291.58 * RF of phase [23]: [-V1+V] 1117.72/291.58 1117.72/291.58 #### Partial ranking functions of CR diff(V1,V,Out) 1117.72/291.58 * Partial RF of phase [22]: 1117.72/291.58 - RF of loop [22:1]: 1117.72/291.58 V1-V 1117.72/291.58 * Partial RF of phase [23]: 1117.72/291.58 - RF of loop [23:1]: 1117.72/291.58 -V1+V 1117.72/291.58 1117.72/291.58 1117.72/291.58 ### Specialization of cost equations start/3 1117.72/291.58 * CE 1 is refined into CE [32] 1117.72/291.58 * CE 5 is refined into CE [33,34,35,36,37] 1117.72/291.58 * CE 2 is refined into CE [38,39,40,41] 1117.72/291.58 * CE 3 is refined into CE [42,43,44,45,46,47] 1117.72/291.58 * CE 4 is refined into CE [48,49,50,51,52] 1117.72/291.58 * CE 6 is refined into CE [53,54,55,56,57,58,59,60] 1117.72/291.58 * CE 7 is refined into CE [61,62,63,64] 1117.72/291.58 * CE 8 is refined into CE [65,66,67,68,69,70] 1117.72/291.58 1117.72/291.58 1117.72/291.58 ### Cost equations --> "Loop" of start/3 1117.72/291.58 * CEs [59,64,69] --> Loop 26 1117.72/291.58 * CEs [58,60,63,68,70] --> Loop 27 1117.72/291.58 * CEs [32,35,36,37] --> Loop 28 1117.72/291.58 * CEs [33,34,56,57,62,67] --> Loop 29 1117.72/291.58 * CEs [40] --> Loop 30 1117.72/291.58 * CEs [46] --> Loop 31 1117.72/291.58 * CEs [45,50] --> Loop 32 1117.72/291.58 * CEs [39,49] --> Loop 33 1117.72/291.58 * CEs [38,54] --> Loop 34 1117.72/291.58 * CEs [41,42,43,44,47,48,51,52,53,55,61,65,66] --> Loop 35 1117.72/291.58 1117.72/291.58 ### Ranking functions of CR start(V1,V,V5) 1117.72/291.58 1117.72/291.58 #### Partial ranking functions of CR start(V1,V,V5) 1117.72/291.58 1117.72/291.58 1117.72/291.58 Computing Bounds 1117.72/291.58 ===================================== 1117.72/291.58 1117.72/291.58 #### Cost of chains of equal(V1,V,Out): 1117.72/291.58 * Chain [[16],15]: 1*it(16)+1 1117.72/291.58 Such that:it(16) =< V1 1117.72/291.58 1117.72/291.58 with precondition: [Out=1,V1=V,V1>=1] 1117.72/291.58 1117.72/291.58 * Chain [[16],14]: 1*it(16)+1 1117.72/291.58 Such that:it(16) =< V1 1117.72/291.58 1117.72/291.58 with precondition: [Out=0,V1>=1,V>=V1+1] 1117.72/291.58 1117.72/291.58 * Chain [[16],13]: 1*it(16)+1 1117.72/291.58 Such that:it(16) =< V 1117.72/291.58 1117.72/291.58 with precondition: [Out=0,V>=1,V1>=V+1] 1117.72/291.58 1117.72/291.58 * Chain [15]: 1 1117.72/291.58 with precondition: [V1=0,V=0,Out=1] 1117.72/291.58 1117.72/291.58 * Chain [14]: 1 1117.72/291.58 with precondition: [V1=0,Out=0,V>=1] 1117.72/291.58 1117.72/291.58 * Chain [13]: 1 1117.72/291.58 with precondition: [V=0,Out=0,V1>=1] 1117.72/291.58 1117.72/291.58 1117.72/291.58 #### Cost of chains of gt(V1,V,Out): 1117.72/291.58 * Chain [[19],18]: 1*it(19)+1 1117.72/291.58 Such that:it(19) =< V1 1117.72/291.58 1117.72/291.58 with precondition: [Out=0,V1>=1,V>=V1] 1117.72/291.58 1117.72/291.58 * Chain [[19],17]: 1*it(19)+1 1117.72/291.58 Such that:it(19) =< V 1117.72/291.58 1117.72/291.58 with precondition: [Out=1,V>=1,V1>=V+1] 1117.72/291.58 1117.72/291.58 * Chain [18]: 1 1117.72/291.58 with precondition: [V1=0,Out=0,V>=0] 1117.72/291.58 1117.72/291.58 * Chain [17]: 1 1117.72/291.58 with precondition: [V=0,Out=1,V1>=1] 1117.72/291.58 1117.72/291.58 1117.72/291.58 #### Cost of chains of diff(V1,V,Out): 1117.72/291.58 * Chain [[23],20]: 5*it(23)+1*s(1)+2*s(6)+3 1117.72/291.58 Such that:it(23) =< Out 1117.72/291.58 aux(3) =< V 1117.72/291.58 s(1) =< aux(3) 1117.72/291.58 s(7) =< it(23)*aux(3) 1117.72/291.58 s(6) =< s(7) 1117.72/291.58 1117.72/291.58 with precondition: [Out+V1=V,V1>=1,V>=V1+1] 1117.72/291.58 1117.72/291.58 * Chain [[22],20]: 5*it(22)+1*s(1)+2*s(12)+3 1117.72/291.58 Such that:it(22) =< Out 1117.72/291.58 aux(6) =< V+Out 1117.72/291.58 s(1) =< aux(6) 1117.72/291.58 s(13) =< it(22)*aux(6) 1117.72/291.58 s(12) =< s(13) 1117.72/291.58 1117.72/291.58 with precondition: [V1=Out+V,V>=1,V1>=V+1] 1117.72/291.58 1117.72/291.58 * Chain [25,[23],20]: 6*it(23)+2*s(6)+8 1117.72/291.58 Such that:aux(7) =< Out 1117.72/291.58 it(23) =< aux(7) 1117.72/291.58 s(7) =< it(23)*aux(7) 1117.72/291.58 s(6) =< s(7) 1117.72/291.58 1117.72/291.58 with precondition: [V1=0,V=Out,V>=2] 1117.72/291.58 1117.72/291.58 * Chain [25,20]: 1*s(1)+8 1117.72/291.58 Such that:s(1) =< 1 1117.72/291.58 1117.72/291.58 with precondition: [V1=0,V=1,Out=1] 1117.72/291.58 1117.72/291.58 * Chain [24,[22],20]: 6*it(22)+2*s(12)+8 1117.72/291.58 Such that:aux(8) =< Out 1117.72/291.58 it(22) =< aux(8) 1117.72/291.58 s(13) =< it(22)*aux(8) 1117.72/291.58 s(12) =< s(13) 1117.72/291.58 1117.72/291.58 with precondition: [V=0,V1=Out,V1>=2] 1117.72/291.58 1117.72/291.58 * Chain [24,20]: 1*s(1)+8 1117.72/291.58 Such that:s(1) =< 1 1117.72/291.58 1117.72/291.58 with precondition: [V1=1,V=0,Out=1] 1117.72/291.58 1117.72/291.58 * Chain [21]: 3 1117.72/291.58 with precondition: [V1=0,V=0,Out=0] 1117.72/291.58 1117.72/291.58 * Chain [20]: 1*s(1)+3 1117.72/291.58 Such that:s(1) =< V 1117.72/291.58 1117.72/291.58 with precondition: [Out=0,V=V1,V>=1] 1117.72/291.58 1117.72/291.58 1117.72/291.58 #### Cost of chains of start(V1,V,V5): 1117.72/291.58 * Chain [35]: 9*s(14)+5*s(15)+8*s(17)+2*s(19)+3*s(20)+2*s(26)+10*s(28)+4*s(32)+5*s(34)+1*s(36)+2*s(38)+2*s(47)+11 1117.72/291.58 Such that:s(35) =< V+1 1117.72/291.58 s(15) =< V-V5 1117.72/291.58 s(34) =< V-V5+1 1117.72/291.58 aux(10) =< 1 1117.72/291.58 aux(11) =< -V+V5 1117.72/291.58 aux(12) =< V 1117.72/291.58 aux(13) =< V5 1117.72/291.58 s(20) =< aux(10) 1117.72/291.58 s(28) =< aux(11) 1117.72/291.58 s(17) =< aux(12) 1117.72/291.58 s(14) =< aux(13) 1117.72/291.58 s(31) =< s(28)*aux(13) 1117.72/291.58 s(32) =< s(31) 1117.72/291.58 s(18) =< s(15)*aux(12) 1117.72/291.58 s(19) =< s(18) 1117.72/291.58 s(46) =< s(17)*aux(12) 1117.72/291.58 s(47) =< s(46) 1117.72/291.58 s(36) =< s(35) 1117.72/291.58 s(37) =< s(34)*s(35) 1117.72/291.58 s(38) =< s(37) 1117.72/291.58 s(25) =< s(14)*aux(13) 1117.72/291.58 s(26) =< s(25) 1117.72/291.58 1117.72/291.58 with precondition: [V1=0,V>=0] 1117.72/291.58 1117.72/291.58 * Chain [34]: 10 1117.72/291.58 with precondition: [V1=0,V=1] 1117.72/291.58 1117.72/291.58 * Chain [33]: 6*s(50)+2*s(54)+6*s(56)+2*s(58)+9 1117.72/291.58 Such that:aux(15) =< V 1117.72/291.58 s(55) =< V+1 1117.72/291.58 s(50) =< aux(15) 1117.72/291.58 s(53) =< s(50)*aux(15) 1117.72/291.58 s(54) =< s(53) 1117.72/291.58 s(56) =< s(55) 1117.72/291.58 s(57) =< s(56)*s(55) 1117.72/291.58 s(58) =< s(57) 1117.72/291.58 1117.72/291.58 with precondition: [V1=0,V5=0,V>=1] 1117.72/291.58 1117.72/291.58 * Chain [32]: 2*s(59)+1*s(61)+6 1117.72/291.58 Such that:s(61) =< V+1 1117.72/291.58 aux(16) =< V5 1117.72/291.58 s(59) =< aux(16) 1117.72/291.58 1117.72/291.58 with precondition: [V1=0,V+1=V5,V>=0] 1117.72/291.58 1117.72/291.58 * Chain [31]: 1*s(62)+5*s(63)+1*s(65)+2*s(67)+6 1117.72/291.58 Such that:s(63) =< 1 1117.72/291.58 s(62) =< V5 1117.72/291.58 s(64) =< V5+1 1117.72/291.58 s(65) =< s(64) 1117.72/291.58 s(66) =< s(63)*s(64) 1117.72/291.58 s(67) =< s(66) 1117.72/291.58 1117.72/291.58 with precondition: [V1=0,V=V5,V>=1] 1117.72/291.58 1117.72/291.58 * Chain [30]: 1*s(68)+1*s(69)+6 1117.72/291.58 Such that:s(68) =< V5 1117.72/291.58 s(69) =< V5+1 1117.72/291.58 1117.72/291.58 with precondition: [V1=0,V=V5+1,V>=2] 1117.72/291.58 1117.72/291.58 * Chain [29]: 2*s(70)+6*s(72)+2*s(74)+6*s(77)+2*s(79)+9 1117.72/291.58 Such that:s(76) =< V1 1117.72/291.58 s(71) =< V5+1 1117.72/291.58 aux(17) =< 1 1117.72/291.58 s(70) =< aux(17) 1117.72/291.58 s(77) =< s(76) 1117.72/291.58 s(78) =< s(77)*s(76) 1117.72/291.58 s(79) =< s(78) 1117.72/291.58 s(72) =< s(71) 1117.72/291.58 s(73) =< s(72)*s(71) 1117.72/291.58 s(74) =< s(73) 1117.72/291.58 1117.72/291.58 with precondition: [V=0,V1>=1] 1117.72/291.58 1117.72/291.58 * Chain [28]: 2*s(80)+5*s(81)+1*s(83)+2*s(85)+5*s(86)+2*s(90)+4 1117.72/291.58 Such that:s(86) =< -V+V5+1 1117.72/291.58 s(82) =< V 1117.72/291.58 s(81) =< V-V5 1117.72/291.58 aux(18) =< V5+1 1117.72/291.58 s(80) =< aux(18) 1117.72/291.58 s(89) =< s(86)*aux(18) 1117.72/291.58 s(90) =< s(89) 1117.72/291.58 s(83) =< s(82) 1117.72/291.58 s(84) =< s(81)*s(82) 1117.72/291.58 s(85) =< s(84) 1117.72/291.58 1117.72/291.58 with precondition: [V1=1,V>=0,V5>=0] 1117.72/291.58 1117.72/291.58 * Chain [27]: 3*s(91)+5*s(92)+2*s(96)+2*s(97)+3 1117.72/291.58 Such that:s(92) =< -V1+V 1117.72/291.58 aux(19) =< V1 1117.72/291.58 aux(20) =< V 1117.72/291.58 s(97) =< aux(19) 1117.72/291.58 s(91) =< aux(20) 1117.72/291.58 s(95) =< s(92)*aux(20) 1117.72/291.58 s(96) =< s(95) 1117.72/291.58 1117.72/291.58 with precondition: [V1>=1,V>=V1] 1117.72/291.58 1117.72/291.58 * Chain [26]: 5*s(100)+1*s(102)+2*s(104)+2*s(105)+3 1117.72/291.58 Such that:s(101) =< V1 1117.72/291.58 s(100) =< V1-V 1117.72/291.58 aux(21) =< V 1117.72/291.58 s(105) =< aux(21) 1117.72/291.58 s(102) =< s(101) 1117.72/291.58 s(103) =< s(100)*s(101) 1117.72/291.58 s(104) =< s(103) 1117.72/291.58 1117.72/291.58 with precondition: [V>=1,V1>=V+1] 1117.72/291.58 1117.72/291.58 1117.72/291.58 Closed-form bounds of start(V1,V,V5): 1117.72/291.58 ------------------------------------- 1117.72/291.58 * Chain [35] with precondition: [V1=0,V>=0] 1117.72/291.58 - Upper bound: 8*V+14+2*V*V+2*V*nat(V-V5)+nat(V5)*9+nat(V5)*2*nat(V5)+nat(V5)*4*nat(-V+V5)+(V+1)+(2*V+2)*nat(V-V5+1)+nat(-V+V5)*10+nat(V-V5+1)*5+nat(V-V5)*5 1117.72/291.58 - Complexity: n^2 1117.72/291.58 * Chain [34] with precondition: [V1=0,V=1] 1117.72/291.58 - Upper bound: 10 1117.72/291.58 - Complexity: constant 1117.72/291.58 * Chain [33] with precondition: [V1=0,V5=0,V>=1] 1117.72/291.58 - Upper bound: 6*V+9+2*V*V+(6*V+6)+(2*V+2)*(V+1) 1117.72/291.58 - Complexity: n^2 1117.72/291.58 * Chain [32] with precondition: [V1=0,V+1=V5,V>=0] 1117.72/291.58 - Upper bound: V+2*V5+7 1117.72/291.58 - Complexity: n 1117.72/291.58 * Chain [31] with precondition: [V1=0,V=V5,V>=1] 1117.72/291.58 - Upper bound: 4*V5+14 1117.72/291.58 - Complexity: n 1117.72/291.58 * Chain [30] with precondition: [V1=0,V=V5+1,V>=2] 1117.72/291.58 - Upper bound: 2*V5+7 1117.72/291.58 - Complexity: n 1117.72/291.58 * Chain [29] with precondition: [V=0,V1>=1] 1117.72/291.58 - Upper bound: 6*V1+11+2*V1*V1+nat(V5+1)*6+nat(V5+1)*2*nat(V5+1) 1117.72/291.58 - Complexity: n^2 1117.72/291.58 * Chain [28] with precondition: [V1=1,V>=0,V5>=0] 1117.72/291.58 - Upper bound: V+4+2*V*nat(V-V5)+(2*V5+2)+(2*V5+2)*nat(-V+V5+1)+nat(-V+V5+1)*5+nat(V-V5)*5 1117.72/291.58 - Complexity: n^2 1117.72/291.58 * Chain [27] with precondition: [V1>=1,V>=V1] 1117.72/291.58 - Upper bound: 2*V1+3*V+3+(-V1+V)*(2*V)+(-5*V1+5*V) 1117.72/291.58 - Complexity: n^2 1117.72/291.58 * Chain [26] with precondition: [V>=1,V1>=V+1] 1117.72/291.58 - Upper bound: 5*V1-5*V+(V1+3+(V1-V)*(2*V1)+2*V) 1117.72/291.58 - Complexity: n^2 1117.72/291.58 1117.72/291.58 ### Maximum cost of start(V1,V,V5): max([max([max([max([2*V*nat(-V1+V)+2*V1+nat(-V1+V)*5,3*V+6+2*V*V+(V+1)+max([5*V+5+(2*V+2)*(V+1),2*V+5+2*V*nat(V-V5)+nat(V5)*9+nat(V5)*2*nat(V5)+nat(V5)*4*nat(-V+V5)+(2*V+2)*nat(V-V5+1)+nat(-V+V5)*10+nat(V-V5+1)*5+nat(V-V5)*5])])+V,2*V1*nat(V1-V)+V1+nat(V1-V)*5])+V,2*V*nat(V-V5)+1+nat(V5+1)*2+nat(V5+1)*2*nat(-V+V5+1)+nat(-V+V5+1)*5+nat(V-V5)*5])+V,max([nat(V5)+max([V+1+nat(V5),nat(V5+1)*2+5+nat(V5+1)]),6*V1+1+2*V1*V1+nat(V5+1)*6+nat(V5+1)*2*nat(V5+1)+4])+3])+3 1117.72/291.58 Asymptotic class: n^2 1117.72/291.58 * Total analysis performed in 449 ms. 1117.72/291.58 1117.72/291.58 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (10) 1117.72/291.58 BOUNDS(1, n^2) 1117.72/291.58 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (11) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) 1117.72/291.58 Transformed a relative TRS into a decreasing-loop problem. 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (12) 1117.72/291.58 Obligation: 1117.72/291.58 Analyzing the following TRS for decreasing loops: 1117.72/291.58 1117.72/291.58 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1117.72/291.58 1117.72/291.58 1117.72/291.58 The TRS R consists of the following rules: 1117.72/291.58 1117.72/291.58 diff(x, y) -> cond1(equal(x, y), x, y) 1117.72/291.58 cond1(true, x, y) -> 0 1117.72/291.58 cond1(false, x, y) -> cond2(gt(x, y), x, y) 1117.72/291.58 cond2(true, x, y) -> s(diff(x, s(y))) 1117.72/291.58 cond2(false, x, y) -> s(diff(s(x), y)) 1117.72/291.58 gt(0, v) -> false 1117.72/291.58 gt(s(u), 0) -> true 1117.72/291.58 gt(s(u), s(v)) -> gt(u, v) 1117.72/291.58 equal(0, 0) -> true 1117.72/291.58 equal(s(x), 0) -> false 1117.72/291.58 equal(0, s(y)) -> false 1117.72/291.58 equal(s(x), s(y)) -> equal(x, y) 1117.72/291.58 1117.72/291.58 S is empty. 1117.72/291.58 Rewrite Strategy: INNERMOST 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (13) DecreasingLoopProof (LOWER BOUND(ID)) 1117.72/291.58 The following loop(s) give(s) rise to the lower bound Omega(n^1): 1117.72/291.58 1117.72/291.58 The rewrite sequence 1117.72/291.58 1117.72/291.58 gt(s(u), s(v)) ->^+ gt(u, v) 1117.72/291.58 1117.72/291.58 gives rise to a decreasing loop by considering the right hand sides subterm at position []. 1117.72/291.58 1117.72/291.58 The pumping substitution is [u / s(u), v / s(v)]. 1117.72/291.58 1117.72/291.58 The result substitution is [ ]. 1117.72/291.58 1117.72/291.58 1117.72/291.58 1117.72/291.58 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (14) 1117.72/291.58 Complex Obligation (BEST) 1117.72/291.58 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (15) 1117.72/291.58 Obligation: 1117.72/291.58 Proved the lower bound n^1 for the following obligation: 1117.72/291.58 1117.72/291.58 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1117.72/291.58 1117.72/291.58 1117.72/291.58 The TRS R consists of the following rules: 1117.72/291.58 1117.72/291.58 diff(x, y) -> cond1(equal(x, y), x, y) 1117.72/291.58 cond1(true, x, y) -> 0 1117.72/291.58 cond1(false, x, y) -> cond2(gt(x, y), x, y) 1117.72/291.58 cond2(true, x, y) -> s(diff(x, s(y))) 1117.72/291.58 cond2(false, x, y) -> s(diff(s(x), y)) 1117.72/291.58 gt(0, v) -> false 1117.72/291.58 gt(s(u), 0) -> true 1117.72/291.58 gt(s(u), s(v)) -> gt(u, v) 1117.72/291.58 equal(0, 0) -> true 1117.72/291.58 equal(s(x), 0) -> false 1117.72/291.58 equal(0, s(y)) -> false 1117.72/291.58 equal(s(x), s(y)) -> equal(x, y) 1117.72/291.58 1117.72/291.58 S is empty. 1117.72/291.58 Rewrite Strategy: INNERMOST 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (16) LowerBoundPropagationProof (FINISHED) 1117.72/291.58 Propagated lower bound. 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (17) 1117.72/291.58 BOUNDS(n^1, INF) 1117.72/291.58 1117.72/291.58 ---------------------------------------- 1117.72/291.58 1117.72/291.58 (18) 1117.72/291.58 Obligation: 1117.72/291.58 Analyzing the following TRS for decreasing loops: 1117.72/291.58 1117.72/291.58 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1117.72/291.58 1117.72/291.58 1117.72/291.58 The TRS R consists of the following rules: 1117.72/291.58 1117.72/291.58 diff(x, y) -> cond1(equal(x, y), x, y) 1117.72/291.58 cond1(true, x, y) -> 0 1117.72/291.58 cond1(false, x, y) -> cond2(gt(x, y), x, y) 1117.72/291.58 cond2(true, x, y) -> s(diff(x, s(y))) 1117.72/291.58 cond2(false, x, y) -> s(diff(s(x), y)) 1117.72/291.58 gt(0, v) -> false 1117.72/291.58 gt(s(u), 0) -> true 1117.72/291.58 gt(s(u), s(v)) -> gt(u, v) 1117.72/291.58 equal(0, 0) -> true 1117.72/291.58 equal(s(x), 0) -> false 1117.72/291.58 equal(0, s(y)) -> false 1117.72/291.58 equal(s(x), s(y)) -> equal(x, y) 1117.72/291.58 1117.72/291.58 S is empty. 1117.72/291.58 Rewrite Strategy: INNERMOST 1117.72/291.64 EOF