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