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