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