58.50/16.39 WORST_CASE(Omega(n^2), O(n^2)) 58.50/16.40 proof of /export/starexec/sandbox/benchmark/theBenchmark.xml 58.50/16.40 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 58.50/16.40 58.50/16.40 58.50/16.40 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^2, n^2). 58.50/16.40 58.50/16.40 (0) CpxTRS 58.50/16.40 (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] 58.50/16.40 (2) CpxWeightedTrs 58.50/16.40 (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 58.50/16.40 (4) CpxTypedWeightedTrs 58.50/16.40 (5) CompletionProof [UPPER BOUND(ID), 0 ms] 58.50/16.40 (6) CpxTypedWeightedCompleteTrs 58.50/16.40 (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] 58.50/16.40 (8) CpxRNTS 58.50/16.40 (9) CompleteCoflocoProof [FINISHED, 390 ms] 58.50/16.40 (10) BOUNDS(1, n^2) 58.50/16.40 (11) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] 58.50/16.40 (12) CpxTRS 58.50/16.40 (13) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 58.50/16.40 (14) typed CpxTrs 58.50/16.40 (15) OrderProof [LOWER BOUND(ID), 0 ms] 58.50/16.40 (16) typed CpxTrs 58.50/16.40 (17) RewriteLemmaProof [LOWER BOUND(ID), 255 ms] 58.50/16.40 (18) BEST 58.50/16.40 (19) proven lower bound 58.50/16.40 (20) LowerBoundPropagationProof [FINISHED, 0 ms] 58.50/16.40 (21) BOUNDS(n^1, INF) 58.50/16.40 (22) typed CpxTrs 58.50/16.40 (23) RewriteLemmaProof [LOWER BOUND(ID), 51 ms] 58.50/16.40 (24) proven lower bound 58.50/16.40 (25) LowerBoundPropagationProof [FINISHED, 0 ms] 58.50/16.40 (26) BOUNDS(n^2, INF) 58.50/16.40 58.50/16.40 58.50/16.40 ---------------------------------------- 58.50/16.40 58.50/16.40 (0) 58.50/16.40 Obligation: 58.50/16.40 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^2, n^2). 58.50/16.40 58.50/16.40 58.50/16.40 The TRS R consists of the following rules: 58.50/16.40 58.50/16.40 nonZero(0) -> false 58.50/16.40 nonZero(s(x)) -> true 58.50/16.40 p(s(0)) -> 0 58.50/16.40 p(s(s(x))) -> s(p(s(x))) 58.50/16.40 id_inc(x) -> x 58.50/16.40 id_inc(x) -> s(x) 58.50/16.40 random(x) -> rand(x, 0) 58.50/16.40 rand(x, y) -> if(nonZero(x), x, y) 58.50/16.40 if(false, x, y) -> y 58.50/16.40 if(true, x, y) -> rand(p(x), id_inc(y)) 58.50/16.40 58.50/16.40 S is empty. 58.50/16.40 Rewrite Strategy: INNERMOST 58.50/16.40 ---------------------------------------- 58.50/16.40 58.50/16.40 (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) 58.50/16.40 Transformed relative TRS to weighted TRS 58.50/16.40 ---------------------------------------- 58.50/16.40 58.50/16.40 (2) 58.50/16.40 Obligation: 58.50/16.40 The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2). 58.50/16.40 58.50/16.40 58.50/16.40 The TRS R consists of the following rules: 58.50/16.40 58.50/16.40 nonZero(0) -> false [1] 58.50/16.40 nonZero(s(x)) -> true [1] 58.50/16.40 p(s(0)) -> 0 [1] 58.50/16.40 p(s(s(x))) -> s(p(s(x))) [1] 58.50/16.40 id_inc(x) -> x [1] 58.50/16.40 id_inc(x) -> s(x) [1] 58.50/16.40 random(x) -> rand(x, 0) [1] 58.50/16.40 rand(x, y) -> if(nonZero(x), x, y) [1] 58.50/16.40 if(false, x, y) -> y [1] 58.50/16.40 if(true, x, y) -> rand(p(x), id_inc(y)) [1] 58.50/16.40 58.50/16.40 Rewrite Strategy: INNERMOST 58.50/16.40 ---------------------------------------- 58.50/16.40 58.50/16.40 (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 58.50/16.40 Infered types. 58.50/16.40 ---------------------------------------- 58.50/16.40 58.50/16.40 (4) 58.50/16.40 Obligation: 58.50/16.40 Runtime Complexity Weighted TRS with Types. 58.50/16.40 The TRS R consists of the following rules: 58.50/16.40 58.50/16.40 nonZero(0) -> false [1] 58.50/16.40 nonZero(s(x)) -> true [1] 58.50/16.40 p(s(0)) -> 0 [1] 58.50/16.40 p(s(s(x))) -> s(p(s(x))) [1] 58.50/16.40 id_inc(x) -> x [1] 58.50/16.40 id_inc(x) -> s(x) [1] 58.50/16.40 random(x) -> rand(x, 0) [1] 58.50/16.40 rand(x, y) -> if(nonZero(x), x, y) [1] 58.50/16.40 if(false, x, y) -> y [1] 58.50/16.40 if(true, x, y) -> rand(p(x), id_inc(y)) [1] 58.50/16.40 58.50/16.40 The TRS has the following type information: 58.50/16.40 nonZero :: 0:s -> false:true 58.50/16.40 0 :: 0:s 58.50/16.40 false :: false:true 58.50/16.40 s :: 0:s -> 0:s 58.50/16.40 true :: false:true 58.50/16.40 p :: 0:s -> 0:s 58.50/16.40 id_inc :: 0:s -> 0:s 58.50/16.40 random :: 0:s -> 0:s 58.50/16.40 rand :: 0:s -> 0:s -> 0:s 58.50/16.40 if :: false:true -> 0:s -> 0:s -> 0:s 58.50/16.40 58.50/16.40 Rewrite Strategy: INNERMOST 58.50/16.40 ---------------------------------------- 58.50/16.40 58.50/16.40 (5) CompletionProof (UPPER BOUND(ID)) 58.50/16.40 The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: 58.50/16.40 58.50/16.40 p(v0) -> null_p [0] 58.50/16.40 nonZero(v0) -> null_nonZero [0] 58.50/16.40 if(v0, v1, v2) -> null_if [0] 58.50/16.40 58.50/16.40 And the following fresh constants: null_p, null_nonZero, null_if 58.50/16.40 58.50/16.40 ---------------------------------------- 58.50/16.40 58.50/16.40 (6) 58.50/16.40 Obligation: 58.50/16.40 Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: 58.50/16.40 58.50/16.40 Runtime Complexity Weighted TRS with Types. 58.50/16.40 The TRS R consists of the following rules: 58.50/16.40 58.50/16.40 nonZero(0) -> false [1] 58.50/16.40 nonZero(s(x)) -> true [1] 58.50/16.40 p(s(0)) -> 0 [1] 58.50/16.40 p(s(s(x))) -> s(p(s(x))) [1] 58.50/16.40 id_inc(x) -> x [1] 58.50/16.40 id_inc(x) -> s(x) [1] 58.50/16.40 random(x) -> rand(x, 0) [1] 58.50/16.40 rand(x, y) -> if(nonZero(x), x, y) [1] 58.50/16.40 if(false, x, y) -> y [1] 58.50/16.40 if(true, x, y) -> rand(p(x), id_inc(y)) [1] 58.50/16.40 p(v0) -> null_p [0] 58.50/16.40 nonZero(v0) -> null_nonZero [0] 58.50/16.40 if(v0, v1, v2) -> null_if [0] 58.50/16.40 58.50/16.40 The TRS has the following type information: 58.50/16.40 nonZero :: 0:s:null_p:null_if -> false:true:null_nonZero 58.50/16.40 0 :: 0:s:null_p:null_if 58.50/16.40 false :: false:true:null_nonZero 58.50/16.40 s :: 0:s:null_p:null_if -> 0:s:null_p:null_if 58.50/16.40 true :: false:true:null_nonZero 58.50/16.40 p :: 0:s:null_p:null_if -> 0:s:null_p:null_if 58.50/16.40 id_inc :: 0:s:null_p:null_if -> 0:s:null_p:null_if 58.50/16.40 random :: 0:s:null_p:null_if -> 0:s:null_p:null_if 58.50/16.40 rand :: 0:s:null_p:null_if -> 0:s:null_p:null_if -> 0:s:null_p:null_if 58.50/16.40 if :: false:true:null_nonZero -> 0:s:null_p:null_if -> 0:s:null_p:null_if -> 0:s:null_p:null_if 58.50/16.40 null_p :: 0:s:null_p:null_if 58.50/16.40 null_nonZero :: false:true:null_nonZero 58.50/16.40 null_if :: 0:s:null_p:null_if 58.50/16.40 58.50/16.40 Rewrite Strategy: INNERMOST 58.50/16.40 ---------------------------------------- 58.50/16.40 58.50/16.40 (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) 58.50/16.40 Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. 58.50/16.40 The constant constructors are abstracted as follows: 58.50/16.40 58.50/16.40 0 => 0 58.50/16.40 false => 1 58.50/16.40 true => 2 58.50/16.40 null_p => 0 58.50/16.40 null_nonZero => 0 58.50/16.40 null_if => 0 58.50/16.40 58.50/16.40 ---------------------------------------- 58.50/16.40 58.50/16.40 (8) 58.50/16.40 Obligation: 58.50/16.40 Complexity RNTS consisting of the following rules: 58.50/16.40 58.50/16.40 id_inc(z) -{ 1 }-> x :|: x >= 0, z = x 58.50/16.40 id_inc(z) -{ 1 }-> 1 + x :|: x >= 0, z = x 58.50/16.40 if(z, z', z'') -{ 1 }-> y :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 58.50/16.40 if(z, z', z'') -{ 1 }-> rand(p(x), id_inc(y)) :|: z = 2, z' = x, z'' = y, x >= 0, y >= 0 58.50/16.40 if(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 58.50/16.40 nonZero(z) -{ 1 }-> 2 :|: x >= 0, z = 1 + x 58.50/16.40 nonZero(z) -{ 1 }-> 1 :|: z = 0 58.50/16.40 nonZero(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 58.50/16.40 p(z) -{ 1 }-> 0 :|: z = 1 + 0 58.50/16.40 p(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 58.50/16.40 p(z) -{ 1 }-> 1 + p(1 + x) :|: x >= 0, z = 1 + (1 + x) 58.50/16.40 rand(z, z') -{ 1 }-> if(nonZero(x), x, y) :|: x >= 0, y >= 0, z = x, z' = y 58.50/16.40 random(z) -{ 1 }-> rand(x, 0) :|: x >= 0, z = x 58.50/16.40 58.50/16.40 Only complete derivations are relevant for the runtime complexity. 58.50/16.40 58.50/16.40 ---------------------------------------- 58.50/16.40 58.50/16.40 (9) CompleteCoflocoProof (FINISHED) 58.50/16.40 Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: 58.50/16.40 58.50/16.40 eq(start(V, V6, V9),0,[nonZero(V, Out)],[V >= 0]). 58.50/16.40 eq(start(V, V6, V9),0,[p(V, Out)],[V >= 0]). 58.50/16.40 eq(start(V, V6, V9),0,[fun(V, Out)],[V >= 0]). 58.50/16.40 eq(start(V, V6, V9),0,[random(V, Out)],[V >= 0]). 58.50/16.40 eq(start(V, V6, V9),0,[rand(V, V6, Out)],[V >= 0,V6 >= 0]). 58.50/16.40 eq(start(V, V6, V9),0,[if(V, V6, V9, Out)],[V >= 0,V6 >= 0,V9 >= 0]). 58.50/16.40 eq(nonZero(V, Out),1,[],[Out = 1,V = 0]). 58.50/16.40 eq(nonZero(V, Out),1,[],[Out = 2,V1 >= 0,V = 1 + V1]). 58.50/16.40 eq(p(V, Out),1,[],[Out = 0,V = 1]). 58.50/16.40 eq(p(V, Out),1,[p(1 + V2, Ret1)],[Out = 1 + Ret1,V2 >= 0,V = 2 + V2]). 58.50/16.40 eq(fun(V, Out),1,[],[Out = V3,V3 >= 0,V = V3]). 58.50/16.40 eq(fun(V, Out),1,[],[Out = 1 + V4,V4 >= 0,V = V4]). 58.50/16.40 eq(random(V, Out),1,[rand(V5, 0, Ret)],[Out = Ret,V5 >= 0,V = V5]). 58.50/16.40 eq(rand(V, V6, Out),1,[nonZero(V7, Ret0),if(Ret0, V7, V8, Ret2)],[Out = Ret2,V7 >= 0,V8 >= 0,V = V7,V6 = V8]). 58.50/16.40 eq(if(V, V6, V9, Out),1,[],[Out = V11,V6 = V10,V9 = V11,V = 1,V10 >= 0,V11 >= 0]). 58.50/16.40 eq(if(V, V6, V9, Out),1,[p(V13, Ret01),fun(V12, Ret11),rand(Ret01, Ret11, Ret3)],[Out = Ret3,V = 2,V6 = V13,V9 = V12,V13 >= 0,V12 >= 0]). 58.50/16.40 eq(p(V, Out),0,[],[Out = 0,V14 >= 0,V = V14]). 58.50/16.40 eq(nonZero(V, Out),0,[],[Out = 0,V15 >= 0,V = V15]). 58.50/16.40 eq(if(V, V6, V9, Out),0,[],[Out = 0,V17 >= 0,V9 = V18,V16 >= 0,V = V17,V6 = V16,V18 >= 0]). 58.50/16.40 input_output_vars(nonZero(V,Out),[V],[Out]). 58.50/16.40 input_output_vars(p(V,Out),[V],[Out]). 58.50/16.40 input_output_vars(fun(V,Out),[V],[Out]). 58.50/16.40 input_output_vars(random(V,Out),[V],[Out]). 58.50/16.40 input_output_vars(rand(V,V6,Out),[V,V6],[Out]). 58.50/16.40 input_output_vars(if(V,V6,V9,Out),[V,V6,V9],[Out]). 58.50/16.40 58.50/16.40 58.50/16.40 CoFloCo proof output: 58.50/16.40 Preprocessing Cost Relations 58.50/16.40 ===================================== 58.50/16.40 58.50/16.40 #### Computed strongly connected components 58.50/16.40 0. non_recursive : [fun/2] 58.50/16.40 1. recursive : [p/2] 58.50/16.40 2. non_recursive : [nonZero/2] 58.50/16.40 3. recursive : [if/4,rand/3] 58.50/16.40 4. non_recursive : [random/2] 58.50/16.40 5. non_recursive : [start/3] 58.50/16.40 58.50/16.40 #### Obtained direct recursion through partial evaluation 58.50/16.40 0. SCC is partially evaluated into fun/2 58.50/16.40 1. SCC is partially evaluated into p/2 58.50/16.40 2. SCC is partially evaluated into nonZero/2 58.50/16.40 3. SCC is partially evaluated into rand/3 58.50/16.40 4. SCC is completely evaluated into other SCCs 58.50/16.40 5. SCC is partially evaluated into start/3 58.50/16.40 58.50/16.40 Control-Flow Refinement of Cost Relations 58.50/16.40 ===================================== 58.50/16.40 58.50/16.40 ### Specialization of cost equations fun/2 58.50/16.40 * CE 12 is refined into CE [20] 58.50/16.40 * CE 13 is refined into CE [21] 58.50/16.40 58.50/16.40 58.50/16.40 ### Cost equations --> "Loop" of fun/2 58.50/16.40 * CEs [20] --> Loop 13 58.50/16.40 * CEs [21] --> Loop 14 58.50/16.40 58.50/16.40 ### Ranking functions of CR fun(V,Out) 58.50/16.40 58.50/16.40 #### Partial ranking functions of CR fun(V,Out) 58.50/16.40 58.50/16.40 58.50/16.40 ### Specialization of cost equations p/2 58.50/16.40 * CE 9 is refined into CE [22] 58.50/16.40 * CE 11 is refined into CE [23] 58.50/16.40 * CE 10 is refined into CE [24] 58.50/16.40 58.50/16.40 58.50/16.40 ### Cost equations --> "Loop" of p/2 58.50/16.40 * CEs [24] --> Loop 15 58.50/16.40 * CEs [22,23] --> Loop 16 58.50/16.40 58.50/16.40 ### Ranking functions of CR p(V,Out) 58.50/16.40 * RF of phase [15]: [V-1] 58.50/16.40 58.50/16.40 #### Partial ranking functions of CR p(V,Out) 58.50/16.40 * Partial RF of phase [15]: 58.50/16.40 - RF of loop [15:1]: 58.50/16.40 V-1 58.50/16.40 58.50/16.40 58.50/16.40 ### Specialization of cost equations nonZero/2 58.50/16.40 * CE 18 is refined into CE [25] 58.50/16.40 * CE 19 is refined into CE [26] 58.50/16.40 * CE 17 is refined into CE [27] 58.50/16.40 58.50/16.40 58.50/16.40 ### Cost equations --> "Loop" of nonZero/2 58.50/16.40 * CEs [25] --> Loop 17 58.50/16.40 * CEs [26] --> Loop 18 58.50/16.40 * CEs [27] --> Loop 19 58.50/16.40 58.50/16.40 ### Ranking functions of CR nonZero(V,Out) 58.50/16.40 58.50/16.40 #### Partial ranking functions of CR nonZero(V,Out) 58.50/16.40 58.50/16.40 58.50/16.40 ### Specialization of cost equations rand/3 58.50/16.40 * CE 16 is refined into CE [28] 58.50/16.40 * CE 14 is refined into CE [29,30,31] 58.50/16.40 * CE 15 is refined into CE [32,33,34,35] 58.50/16.40 58.50/16.40 58.50/16.40 ### Cost equations --> "Loop" of rand/3 58.50/16.40 * CEs [35] --> Loop 20 58.50/16.40 * CEs [34] --> Loop 21 58.50/16.40 * CEs [33] --> Loop 22 58.50/16.40 * CEs [32] --> Loop 23 58.50/16.40 * CEs [28] --> Loop 24 58.50/16.40 * CEs [29,30,31] --> Loop 25 58.50/16.40 58.50/16.40 ### Ranking functions of CR rand(V,V6,Out) 58.50/16.40 * RF of phase [20,21]: [V-1] 58.50/16.40 58.50/16.40 #### Partial ranking functions of CR rand(V,V6,Out) 58.50/16.40 * Partial RF of phase [20,21]: 58.50/16.40 - RF of loop [20:1,21:1]: 58.50/16.40 V-1 58.50/16.40 58.50/16.40 58.50/16.40 ### Specialization of cost equations start/3 58.50/16.40 * CE 2 is refined into CE [36,37,38,39,40,41,42,43,44,45,46,47,48,49] 58.50/16.40 * CE 1 is refined into CE [50] 58.50/16.40 * CE 3 is refined into CE [51] 58.50/16.40 * CE 4 is refined into CE [52,53,54] 58.50/16.40 * CE 5 is refined into CE [55,56] 58.50/16.40 * CE 6 is refined into CE [57,58] 58.50/16.40 * CE 7 is refined into CE [59,60,61,62,63,64] 58.50/16.40 * CE 8 is refined into CE [65,66,67,68,69,70] 58.50/16.40 58.50/16.40 58.50/16.40 ### Cost equations --> "Loop" of start/3 58.50/16.40 * CEs [36,37,38,39,40,41,42,43,44,45,46,47,48,49] --> Loop 26 58.50/16.40 * CEs [51] --> Loop 27 58.50/16.40 * CEs [50,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70] --> Loop 28 58.50/16.40 58.50/16.40 ### Ranking functions of CR start(V,V6,V9) 58.50/16.40 58.50/16.40 #### Partial ranking functions of CR start(V,V6,V9) 58.50/16.40 58.50/16.40 58.50/16.40 Computing Bounds 58.50/16.40 ===================================== 58.50/16.40 58.50/16.40 #### Cost of chains of fun(V,Out): 58.50/16.40 * Chain [14]: 1 58.50/16.40 with precondition: [V+1=Out,V>=0] 58.50/16.40 58.50/16.40 * Chain [13]: 1 58.50/16.40 with precondition: [V=Out,V>=0] 58.50/16.40 58.50/16.40 58.50/16.40 #### Cost of chains of p(V,Out): 58.50/16.40 * Chain [[15],16]: 1*it(15)+1 58.50/16.40 Such that:it(15) =< Out 58.50/16.40 58.50/16.40 with precondition: [Out>=1,V>=Out+1] 58.50/16.40 58.50/16.40 * Chain [16]: 1 58.50/16.40 with precondition: [Out=0,V>=0] 58.50/16.40 58.50/16.40 58.50/16.40 #### Cost of chains of nonZero(V,Out): 58.50/16.40 * Chain [19]: 1 58.50/16.40 with precondition: [V=0,Out=1] 58.50/16.40 58.50/16.40 * Chain [18]: 0 58.50/16.40 with precondition: [Out=0,V>=0] 58.50/16.40 58.50/16.40 * Chain [17]: 1 58.50/16.40 with precondition: [Out=2,V>=1] 58.50/16.40 58.50/16.40 58.50/16.40 #### Cost of chains of rand(V,V6,Out): 58.50/16.40 * Chain [[20,21],25]: 10*it(20)+1*s(5)+1*s(6)+2 58.50/16.40 Such that:aux(5) =< V 58.50/16.40 it(20) =< aux(5) 58.50/16.40 aux(2) =< aux(5) 58.50/16.40 s(5) =< it(20)*aux(5) 58.50/16.40 s(6) =< it(20)*aux(2) 58.50/16.40 58.50/16.40 with precondition: [Out=0,V>=2,V6>=0] 58.50/16.40 58.50/16.40 * Chain [[20,21],23,25]: 10*it(20)+1*s(5)+1*s(6)+7 58.50/16.40 Such that:aux(6) =< V 58.50/16.40 it(20) =< aux(6) 58.50/16.40 aux(2) =< aux(6) 58.50/16.40 s(5) =< it(20)*aux(6) 58.50/16.40 s(6) =< it(20)*aux(2) 58.50/16.40 58.50/16.40 with precondition: [Out=0,V>=2,V6>=0] 58.50/16.40 58.50/16.40 * Chain [[20,21],23,24]: 10*it(20)+1*s(5)+1*s(6)+8 58.50/16.40 Such that:aux(7) =< V 58.50/16.40 it(20) =< aux(7) 58.50/16.40 aux(2) =< aux(7) 58.50/16.40 s(5) =< it(20)*aux(7) 58.50/16.40 s(6) =< it(20)*aux(2) 58.50/16.40 58.50/16.40 with precondition: [V>=2,V6>=0,Out>=V6+1,V+V6>=Out] 58.50/16.40 58.50/16.40 * Chain [[20,21],22,25]: 10*it(20)+1*s(5)+1*s(6)+7 58.50/16.40 Such that:aux(8) =< V 58.50/16.40 it(20) =< aux(8) 58.50/16.40 aux(2) =< aux(8) 58.50/16.40 s(5) =< it(20)*aux(8) 58.50/16.40 s(6) =< it(20)*aux(2) 58.50/16.40 58.50/16.40 with precondition: [Out=0,V>=2,V6>=0] 58.50/16.41 58.50/16.41 * Chain [[20,21],22,24]: 10*it(20)+1*s(5)+1*s(6)+8 58.50/16.41 Such that:aux(9) =< V 58.50/16.41 it(20) =< aux(9) 58.50/16.41 aux(2) =< aux(9) 58.50/16.41 s(5) =< it(20)*aux(9) 58.50/16.41 s(6) =< it(20)*aux(2) 58.50/16.41 58.50/16.41 with precondition: [V>=2,V6>=0,Out>=V6,V+V6>=Out+1] 58.50/16.41 58.50/16.41 * Chain [25]: 2 58.50/16.41 with precondition: [Out=0,V>=0,V6>=0] 58.50/16.41 58.50/16.41 * Chain [24]: 3 58.50/16.41 with precondition: [V=0,V6=Out,V6>=0] 58.50/16.41 58.50/16.41 * Chain [23,25]: 7 58.50/16.41 with precondition: [Out=0,V>=1,V6>=0] 58.50/16.41 58.50/16.41 * Chain [23,24]: 8 58.50/16.41 with precondition: [Out=V6+1,V>=1,Out>=1] 58.50/16.41 58.50/16.41 * Chain [22,25]: 7 58.50/16.41 with precondition: [Out=0,V>=1,V6>=0] 58.50/16.41 58.50/16.41 * Chain [22,24]: 8 58.50/16.41 with precondition: [V6=Out,V>=1,V6>=0] 58.50/16.41 58.50/16.41 58.50/16.41 #### Cost of chains of start(V,V6,V9): 58.50/16.41 * Chain [28]: 101*s(22)+10*s(26)+10*s(27)+9 58.50/16.41 Such that:aux(11) =< V 58.50/16.41 s(22) =< aux(11) 58.50/16.41 s(25) =< aux(11) 58.50/16.41 s(26) =< s(22)*aux(11) 58.50/16.41 s(27) =< s(22)*s(25) 58.50/16.41 58.50/16.41 with precondition: [V>=0] 58.50/16.41 58.50/16.41 * Chain [27]: 1 58.50/16.41 with precondition: [V=1,V6>=0,V9>=0] 58.50/16.41 58.50/16.41 * Chain [26]: 110*s(63)+10*s(67)+10*s(68)+11 58.50/16.41 Such that:aux(18) =< V6 58.50/16.41 s(63) =< aux(18) 58.50/16.41 s(66) =< aux(18) 58.50/16.41 s(67) =< s(63)*aux(18) 58.50/16.41 s(68) =< s(63)*s(66) 58.50/16.41 58.50/16.41 with precondition: [V=2,V6>=0,V9>=0] 58.50/16.41 58.50/16.41 58.50/16.41 Closed-form bounds of start(V,V6,V9): 58.50/16.41 ------------------------------------- 58.50/16.41 * Chain [28] with precondition: [V>=0] 58.50/16.41 - Upper bound: 101*V+9+20*V*V 58.50/16.41 - Complexity: n^2 58.50/16.41 * Chain [27] with precondition: [V=1,V6>=0,V9>=0] 58.50/16.41 - Upper bound: 1 58.50/16.41 - Complexity: constant 58.50/16.41 * Chain [26] with precondition: [V=2,V6>=0,V9>=0] 58.50/16.41 - Upper bound: 110*V6+11+20*V6*V6 58.50/16.41 - Complexity: n^2 58.50/16.41 58.50/16.41 ### Maximum cost of start(V,V6,V9): max([101*V+8+20*V*V,nat(V6)*110+10+nat(V6)*20*nat(V6)])+1 58.50/16.41 Asymptotic class: n^2 58.50/16.41 * Total analysis performed in 307 ms. 58.50/16.41 58.50/16.41 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (10) 58.50/16.41 BOUNDS(1, n^2) 58.50/16.41 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (11) RenamingProof (BOTH BOUNDS(ID, ID)) 58.50/16.41 Renamed function symbols to avoid clashes with predefined symbol. 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (12) 58.50/16.41 Obligation: 58.50/16.41 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^2, INF). 58.50/16.41 58.50/16.41 58.50/16.41 The TRS R consists of the following rules: 58.50/16.41 58.50/16.41 nonZero(0') -> false 58.50/16.41 nonZero(s(x)) -> true 58.50/16.41 p(s(0')) -> 0' 58.50/16.41 p(s(s(x))) -> s(p(s(x))) 58.50/16.41 id_inc(x) -> x 58.50/16.41 id_inc(x) -> s(x) 58.50/16.41 random(x) -> rand(x, 0') 58.50/16.41 rand(x, y) -> if(nonZero(x), x, y) 58.50/16.41 if(false, x, y) -> y 58.50/16.41 if(true, x, y) -> rand(p(x), id_inc(y)) 58.50/16.41 58.50/16.41 S is empty. 58.50/16.41 Rewrite Strategy: INNERMOST 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (13) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 58.50/16.41 Infered types. 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (14) 58.50/16.41 Obligation: 58.50/16.41 Innermost TRS: 58.50/16.41 Rules: 58.50/16.41 nonZero(0') -> false 58.50/16.41 nonZero(s(x)) -> true 58.50/16.41 p(s(0')) -> 0' 58.50/16.41 p(s(s(x))) -> s(p(s(x))) 58.50/16.41 id_inc(x) -> x 58.50/16.41 id_inc(x) -> s(x) 58.50/16.41 random(x) -> rand(x, 0') 58.50/16.41 rand(x, y) -> if(nonZero(x), x, y) 58.50/16.41 if(false, x, y) -> y 58.50/16.41 if(true, x, y) -> rand(p(x), id_inc(y)) 58.50/16.41 58.50/16.41 Types: 58.50/16.41 nonZero :: 0':s -> false:true 58.50/16.41 0' :: 0':s 58.50/16.41 false :: false:true 58.50/16.41 s :: 0':s -> 0':s 58.50/16.41 true :: false:true 58.50/16.41 p :: 0':s -> 0':s 58.50/16.41 id_inc :: 0':s -> 0':s 58.50/16.41 random :: 0':s -> 0':s 58.50/16.41 rand :: 0':s -> 0':s -> 0':s 58.50/16.41 if :: false:true -> 0':s -> 0':s -> 0':s 58.50/16.41 hole_false:true1_0 :: false:true 58.50/16.41 hole_0':s2_0 :: 0':s 58.50/16.41 gen_0':s3_0 :: Nat -> 0':s 58.50/16.41 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (15) OrderProof (LOWER BOUND(ID)) 58.50/16.41 Heuristically decided to analyse the following defined symbols: 58.50/16.41 p, rand 58.50/16.41 58.50/16.41 They will be analysed ascendingly in the following order: 58.50/16.41 p < rand 58.50/16.41 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (16) 58.50/16.41 Obligation: 58.50/16.41 Innermost TRS: 58.50/16.41 Rules: 58.50/16.41 nonZero(0') -> false 58.50/16.41 nonZero(s(x)) -> true 58.50/16.41 p(s(0')) -> 0' 58.50/16.41 p(s(s(x))) -> s(p(s(x))) 58.50/16.41 id_inc(x) -> x 58.50/16.41 id_inc(x) -> s(x) 58.50/16.41 random(x) -> rand(x, 0') 58.50/16.41 rand(x, y) -> if(nonZero(x), x, y) 58.50/16.41 if(false, x, y) -> y 58.50/16.41 if(true, x, y) -> rand(p(x), id_inc(y)) 58.50/16.41 58.50/16.41 Types: 58.50/16.41 nonZero :: 0':s -> false:true 58.50/16.41 0' :: 0':s 58.50/16.41 false :: false:true 58.50/16.41 s :: 0':s -> 0':s 58.50/16.41 true :: false:true 58.50/16.41 p :: 0':s -> 0':s 58.50/16.41 id_inc :: 0':s -> 0':s 58.50/16.41 random :: 0':s -> 0':s 58.50/16.41 rand :: 0':s -> 0':s -> 0':s 58.50/16.41 if :: false:true -> 0':s -> 0':s -> 0':s 58.50/16.41 hole_false:true1_0 :: false:true 58.50/16.41 hole_0':s2_0 :: 0':s 58.50/16.41 gen_0':s3_0 :: Nat -> 0':s 58.50/16.41 58.50/16.41 58.50/16.41 Generator Equations: 58.50/16.41 gen_0':s3_0(0) <=> 0' 58.50/16.41 gen_0':s3_0(+(x, 1)) <=> s(gen_0':s3_0(x)) 58.50/16.41 58.50/16.41 58.50/16.41 The following defined symbols remain to be analysed: 58.50/16.41 p, rand 58.50/16.41 58.50/16.41 They will be analysed ascendingly in the following order: 58.50/16.41 p < rand 58.50/16.41 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (17) RewriteLemmaProof (LOWER BOUND(ID)) 58.50/16.41 Proved the following rewrite lemma: 58.50/16.41 p(gen_0':s3_0(+(1, n5_0))) -> gen_0':s3_0(n5_0), rt in Omega(1 + n5_0) 58.50/16.41 58.50/16.41 Induction Base: 58.50/16.41 p(gen_0':s3_0(+(1, 0))) ->_R^Omega(1) 58.50/16.41 0' 58.50/16.41 58.50/16.41 Induction Step: 58.50/16.41 p(gen_0':s3_0(+(1, +(n5_0, 1)))) ->_R^Omega(1) 58.50/16.41 s(p(s(gen_0':s3_0(n5_0)))) ->_IH 58.50/16.41 s(gen_0':s3_0(c6_0)) 58.50/16.41 58.50/16.41 We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (18) 58.50/16.41 Complex Obligation (BEST) 58.50/16.41 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (19) 58.50/16.41 Obligation: 58.50/16.41 Proved the lower bound n^1 for the following obligation: 58.50/16.41 58.50/16.41 Innermost TRS: 58.50/16.41 Rules: 58.50/16.41 nonZero(0') -> false 58.50/16.41 nonZero(s(x)) -> true 58.50/16.41 p(s(0')) -> 0' 58.50/16.41 p(s(s(x))) -> s(p(s(x))) 58.50/16.41 id_inc(x) -> x 58.50/16.41 id_inc(x) -> s(x) 58.50/16.41 random(x) -> rand(x, 0') 58.50/16.41 rand(x, y) -> if(nonZero(x), x, y) 58.50/16.41 if(false, x, y) -> y 58.50/16.41 if(true, x, y) -> rand(p(x), id_inc(y)) 58.50/16.41 58.50/16.41 Types: 58.50/16.41 nonZero :: 0':s -> false:true 58.50/16.41 0' :: 0':s 58.50/16.41 false :: false:true 58.50/16.41 s :: 0':s -> 0':s 58.50/16.41 true :: false:true 58.50/16.41 p :: 0':s -> 0':s 58.50/16.41 id_inc :: 0':s -> 0':s 58.50/16.41 random :: 0':s -> 0':s 58.50/16.41 rand :: 0':s -> 0':s -> 0':s 58.50/16.41 if :: false:true -> 0':s -> 0':s -> 0':s 58.50/16.41 hole_false:true1_0 :: false:true 58.50/16.41 hole_0':s2_0 :: 0':s 58.50/16.41 gen_0':s3_0 :: Nat -> 0':s 58.50/16.41 58.50/16.41 58.50/16.41 Generator Equations: 58.50/16.41 gen_0':s3_0(0) <=> 0' 58.50/16.41 gen_0':s3_0(+(x, 1)) <=> s(gen_0':s3_0(x)) 58.50/16.41 58.50/16.41 58.50/16.41 The following defined symbols remain to be analysed: 58.50/16.41 p, rand 58.50/16.41 58.50/16.41 They will be analysed ascendingly in the following order: 58.50/16.41 p < rand 58.50/16.41 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (20) LowerBoundPropagationProof (FINISHED) 58.50/16.41 Propagated lower bound. 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (21) 58.50/16.41 BOUNDS(n^1, INF) 58.50/16.41 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (22) 58.50/16.41 Obligation: 58.50/16.41 Innermost TRS: 58.50/16.41 Rules: 58.50/16.41 nonZero(0') -> false 58.50/16.41 nonZero(s(x)) -> true 58.50/16.41 p(s(0')) -> 0' 58.50/16.41 p(s(s(x))) -> s(p(s(x))) 58.50/16.41 id_inc(x) -> x 58.50/16.41 id_inc(x) -> s(x) 58.50/16.41 random(x) -> rand(x, 0') 58.50/16.41 rand(x, y) -> if(nonZero(x), x, y) 58.50/16.41 if(false, x, y) -> y 58.50/16.41 if(true, x, y) -> rand(p(x), id_inc(y)) 58.50/16.41 58.50/16.41 Types: 58.50/16.41 nonZero :: 0':s -> false:true 58.50/16.41 0' :: 0':s 58.50/16.41 false :: false:true 58.50/16.41 s :: 0':s -> 0':s 58.50/16.41 true :: false:true 58.50/16.41 p :: 0':s -> 0':s 58.50/16.41 id_inc :: 0':s -> 0':s 58.50/16.41 random :: 0':s -> 0':s 58.50/16.41 rand :: 0':s -> 0':s -> 0':s 58.50/16.41 if :: false:true -> 0':s -> 0':s -> 0':s 58.50/16.41 hole_false:true1_0 :: false:true 58.50/16.41 hole_0':s2_0 :: 0':s 58.50/16.41 gen_0':s3_0 :: Nat -> 0':s 58.50/16.41 58.50/16.41 58.50/16.41 Lemmas: 58.50/16.41 p(gen_0':s3_0(+(1, n5_0))) -> gen_0':s3_0(n5_0), rt in Omega(1 + n5_0) 58.50/16.41 58.50/16.41 58.50/16.41 Generator Equations: 58.50/16.41 gen_0':s3_0(0) <=> 0' 58.50/16.41 gen_0':s3_0(+(x, 1)) <=> s(gen_0':s3_0(x)) 58.50/16.41 58.50/16.41 58.50/16.41 The following defined symbols remain to be analysed: 58.50/16.41 rand 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (23) RewriteLemmaProof (LOWER BOUND(ID)) 58.50/16.41 Proved the following rewrite lemma: 58.50/16.41 rand(gen_0':s3_0(n230_0), gen_0':s3_0(b)) -> gen_0':s3_0(b), rt in Omega(1 + n230_0 + n230_0^2) 58.50/16.41 58.50/16.41 Induction Base: 58.50/16.41 rand(gen_0':s3_0(0), gen_0':s3_0(b)) ->_R^Omega(1) 58.50/16.41 if(nonZero(gen_0':s3_0(0)), gen_0':s3_0(0), gen_0':s3_0(b)) ->_R^Omega(1) 58.50/16.41 if(false, gen_0':s3_0(0), gen_0':s3_0(b)) ->_R^Omega(1) 58.50/16.41 gen_0':s3_0(b) 58.50/16.41 58.50/16.41 Induction Step: 58.50/16.41 rand(gen_0':s3_0(+(n230_0, 1)), gen_0':s3_0(b)) ->_R^Omega(1) 58.50/16.41 if(nonZero(gen_0':s3_0(+(n230_0, 1))), gen_0':s3_0(+(n230_0, 1)), gen_0':s3_0(b)) ->_R^Omega(1) 58.50/16.41 if(true, gen_0':s3_0(+(1, n230_0)), gen_0':s3_0(b)) ->_R^Omega(1) 58.50/16.41 rand(p(gen_0':s3_0(+(1, n230_0))), id_inc(gen_0':s3_0(b))) ->_L^Omega(1 + n230_0) 58.50/16.41 rand(gen_0':s3_0(n230_0), id_inc(gen_0':s3_0(b))) ->_R^Omega(1) 58.50/16.41 rand(gen_0':s3_0(n230_0), gen_0':s3_0(b)) ->_IH 58.50/16.41 gen_0':s3_0(b) 58.50/16.41 58.50/16.41 We have rt in Omega(n^2) and sz in O(n). Thus, we have irc_R in Omega(n^2). 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (24) 58.50/16.41 Obligation: 58.50/16.41 Proved the lower bound n^2 for the following obligation: 58.50/16.41 58.50/16.41 Innermost TRS: 58.50/16.41 Rules: 58.50/16.41 nonZero(0') -> false 58.50/16.41 nonZero(s(x)) -> true 58.50/16.41 p(s(0')) -> 0' 58.50/16.41 p(s(s(x))) -> s(p(s(x))) 58.50/16.41 id_inc(x) -> x 58.50/16.41 id_inc(x) -> s(x) 58.50/16.41 random(x) -> rand(x, 0') 58.50/16.41 rand(x, y) -> if(nonZero(x), x, y) 58.50/16.41 if(false, x, y) -> y 58.50/16.41 if(true, x, y) -> rand(p(x), id_inc(y)) 58.50/16.41 58.50/16.41 Types: 58.50/16.41 nonZero :: 0':s -> false:true 58.50/16.41 0' :: 0':s 58.50/16.41 false :: false:true 58.50/16.41 s :: 0':s -> 0':s 58.50/16.41 true :: false:true 58.50/16.41 p :: 0':s -> 0':s 58.50/16.41 id_inc :: 0':s -> 0':s 58.50/16.41 random :: 0':s -> 0':s 58.50/16.41 rand :: 0':s -> 0':s -> 0':s 58.50/16.41 if :: false:true -> 0':s -> 0':s -> 0':s 58.50/16.41 hole_false:true1_0 :: false:true 58.50/16.41 hole_0':s2_0 :: 0':s 58.50/16.41 gen_0':s3_0 :: Nat -> 0':s 58.50/16.41 58.50/16.41 58.50/16.41 Lemmas: 58.50/16.41 p(gen_0':s3_0(+(1, n5_0))) -> gen_0':s3_0(n5_0), rt in Omega(1 + n5_0) 58.50/16.41 58.50/16.41 58.50/16.41 Generator Equations: 58.50/16.41 gen_0':s3_0(0) <=> 0' 58.50/16.41 gen_0':s3_0(+(x, 1)) <=> s(gen_0':s3_0(x)) 58.50/16.41 58.50/16.41 58.50/16.41 The following defined symbols remain to be analysed: 58.50/16.41 rand 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (25) LowerBoundPropagationProof (FINISHED) 58.50/16.41 Propagated lower bound. 58.50/16.41 ---------------------------------------- 58.50/16.41 58.50/16.41 (26) 58.50/16.41 BOUNDS(n^2, INF) 58.50/16.44 EOF