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