1112.94/291.55 WORST_CASE(Omega(n^1), O(n^3)) 1112.94/291.57 proof of /export/starexec/sandbox2/benchmark/theBenchmark.xml 1112.94/291.57 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 1112.94/291.57 1112.94/291.57 1112.94/291.57 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^3). 1112.94/291.57 1112.94/291.57 (0) CpxTRS 1112.94/291.57 (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] 1112.94/291.57 (2) CpxWeightedTrs 1112.94/291.57 (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 1112.94/291.57 (4) CpxTypedWeightedTrs 1112.94/291.57 (5) CompletionProof [UPPER BOUND(ID), 0 ms] 1112.94/291.57 (6) CpxTypedWeightedCompleteTrs 1112.94/291.57 (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] 1112.94/291.57 (8) CpxRNTS 1112.94/291.57 (9) CompleteCoflocoProof [FINISHED, 515 ms] 1112.94/291.57 (10) BOUNDS(1, n^3) 1112.94/291.57 (11) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] 1112.94/291.57 (12) TRS for Loop Detection 1112.94/291.57 (13) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] 1112.94/291.57 (14) BEST 1112.94/291.57 (15) proven lower bound 1112.94/291.57 (16) LowerBoundPropagationProof [FINISHED, 0 ms] 1112.94/291.57 (17) BOUNDS(n^1, INF) 1112.94/291.57 (18) TRS for Loop Detection 1112.94/291.57 1112.94/291.57 1112.94/291.57 ---------------------------------------- 1112.94/291.57 1112.94/291.57 (0) 1112.94/291.57 Obligation: 1112.94/291.57 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^3). 1112.94/291.57 1112.94/291.57 1112.94/291.57 The TRS R consists of the following rules: 1112.94/291.57 1112.94/291.57 minus(0, y) -> 0 1112.94/291.57 minus(s(x), y) -> if(gt(s(x), y), x, y) 1112.94/291.57 if(true, x, y) -> s(minus(x, y)) 1112.94/291.57 if(false, x, y) -> 0 1112.94/291.57 mod(x, 0) -> 0 1112.94/291.57 mod(x, s(y)) -> if1(lt(x, s(y)), x, s(y)) 1112.94/291.57 if1(true, x, y) -> x 1112.94/291.57 if1(false, x, y) -> mod(minus(x, y), y) 1112.94/291.57 gt(0, y) -> false 1112.94/291.57 gt(s(x), 0) -> true 1112.94/291.57 gt(s(x), s(y)) -> gt(x, y) 1112.94/291.57 lt(x, 0) -> false 1112.94/291.57 lt(0, s(x)) -> true 1112.94/291.57 lt(s(x), s(y)) -> lt(x, y) 1112.94/291.57 1112.94/291.57 S is empty. 1112.94/291.57 Rewrite Strategy: INNERMOST 1112.94/291.57 ---------------------------------------- 1112.94/291.57 1112.94/291.57 (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) 1112.94/291.57 Transformed relative TRS to weighted TRS 1112.94/291.57 ---------------------------------------- 1112.94/291.57 1112.94/291.57 (2) 1112.94/291.57 Obligation: 1112.94/291.57 The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^3). 1112.94/291.57 1112.94/291.57 1112.94/291.57 The TRS R consists of the following rules: 1112.94/291.57 1112.94/291.57 minus(0, y) -> 0 [1] 1112.94/291.57 minus(s(x), y) -> if(gt(s(x), y), x, y) [1] 1112.94/291.57 if(true, x, y) -> s(minus(x, y)) [1] 1112.94/291.57 if(false, x, y) -> 0 [1] 1112.94/291.57 mod(x, 0) -> 0 [1] 1112.94/291.57 mod(x, s(y)) -> if1(lt(x, s(y)), x, s(y)) [1] 1112.94/291.57 if1(true, x, y) -> x [1] 1112.94/291.57 if1(false, x, y) -> mod(minus(x, y), y) [1] 1112.94/291.57 gt(0, y) -> false [1] 1112.94/291.57 gt(s(x), 0) -> true [1] 1112.94/291.57 gt(s(x), s(y)) -> gt(x, y) [1] 1112.94/291.57 lt(x, 0) -> false [1] 1112.94/291.57 lt(0, s(x)) -> true [1] 1112.94/291.57 lt(s(x), s(y)) -> lt(x, y) [1] 1112.94/291.57 1112.94/291.57 Rewrite Strategy: INNERMOST 1112.94/291.57 ---------------------------------------- 1112.94/291.57 1112.94/291.57 (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 1112.94/291.57 Infered types. 1112.94/291.57 ---------------------------------------- 1112.94/291.57 1112.94/291.57 (4) 1112.94/291.57 Obligation: 1112.94/291.57 Runtime Complexity Weighted TRS with Types. 1112.94/291.57 The TRS R consists of the following rules: 1112.94/291.57 1112.94/291.57 minus(0, y) -> 0 [1] 1112.94/291.57 minus(s(x), y) -> if(gt(s(x), y), x, y) [1] 1112.94/291.57 if(true, x, y) -> s(minus(x, y)) [1] 1112.94/291.57 if(false, x, y) -> 0 [1] 1112.94/291.57 mod(x, 0) -> 0 [1] 1112.94/291.57 mod(x, s(y)) -> if1(lt(x, s(y)), x, s(y)) [1] 1112.94/291.57 if1(true, x, y) -> x [1] 1112.94/291.57 if1(false, x, y) -> mod(minus(x, y), y) [1] 1112.94/291.57 gt(0, y) -> false [1] 1112.94/291.57 gt(s(x), 0) -> true [1] 1112.94/291.57 gt(s(x), s(y)) -> gt(x, y) [1] 1112.94/291.57 lt(x, 0) -> false [1] 1112.94/291.57 lt(0, s(x)) -> true [1] 1112.94/291.57 lt(s(x), s(y)) -> lt(x, y) [1] 1112.94/291.57 1112.94/291.57 The TRS has the following type information: 1112.94/291.57 minus :: 0:s -> 0:s -> 0:s 1112.94/291.57 0 :: 0:s 1112.94/291.57 s :: 0:s -> 0:s 1112.94/291.57 if :: true:false -> 0:s -> 0:s -> 0:s 1112.94/291.57 gt :: 0:s -> 0:s -> true:false 1112.94/291.57 true :: true:false 1112.94/291.57 false :: true:false 1112.94/291.57 mod :: 0:s -> 0:s -> 0:s 1112.94/291.57 if1 :: true:false -> 0:s -> 0:s -> 0:s 1112.94/291.57 lt :: 0:s -> 0:s -> true:false 1112.94/291.57 1112.94/291.57 Rewrite Strategy: INNERMOST 1112.94/291.57 ---------------------------------------- 1112.94/291.57 1112.94/291.57 (5) CompletionProof (UPPER BOUND(ID)) 1112.94/291.57 The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: 1112.94/291.57 none 1112.94/291.57 1112.94/291.57 And the following fresh constants: none 1112.94/291.57 1112.94/291.57 ---------------------------------------- 1112.94/291.57 1112.94/291.57 (6) 1112.94/291.57 Obligation: 1112.94/291.57 Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: 1112.94/291.57 1112.94/291.57 Runtime Complexity Weighted TRS with Types. 1112.94/291.57 The TRS R consists of the following rules: 1112.94/291.57 1112.94/291.57 minus(0, y) -> 0 [1] 1112.94/291.57 minus(s(x), y) -> if(gt(s(x), y), x, y) [1] 1112.94/291.57 if(true, x, y) -> s(minus(x, y)) [1] 1112.94/291.57 if(false, x, y) -> 0 [1] 1112.94/291.57 mod(x, 0) -> 0 [1] 1112.94/291.57 mod(x, s(y)) -> if1(lt(x, s(y)), x, s(y)) [1] 1112.94/291.57 if1(true, x, y) -> x [1] 1112.94/291.57 if1(false, x, y) -> mod(minus(x, y), y) [1] 1112.94/291.57 gt(0, y) -> false [1] 1112.94/291.57 gt(s(x), 0) -> true [1] 1112.94/291.57 gt(s(x), s(y)) -> gt(x, y) [1] 1112.94/291.57 lt(x, 0) -> false [1] 1112.94/291.57 lt(0, s(x)) -> true [1] 1112.94/291.57 lt(s(x), s(y)) -> lt(x, y) [1] 1112.94/291.57 1112.94/291.57 The TRS has the following type information: 1112.94/291.57 minus :: 0:s -> 0:s -> 0:s 1112.94/291.57 0 :: 0:s 1112.94/291.57 s :: 0:s -> 0:s 1112.94/291.57 if :: true:false -> 0:s -> 0:s -> 0:s 1112.94/291.57 gt :: 0:s -> 0:s -> true:false 1112.94/291.57 true :: true:false 1112.94/291.57 false :: true:false 1112.94/291.57 mod :: 0:s -> 0:s -> 0:s 1112.94/291.57 if1 :: true:false -> 0:s -> 0:s -> 0:s 1112.94/291.57 lt :: 0:s -> 0:s -> true:false 1112.94/291.57 1112.94/291.57 Rewrite Strategy: INNERMOST 1112.94/291.57 ---------------------------------------- 1112.94/291.57 1112.94/291.57 (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) 1112.94/291.57 Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. 1112.94/291.57 The constant constructors are abstracted as follows: 1112.94/291.57 1112.94/291.57 0 => 0 1112.94/291.57 true => 1 1112.94/291.57 false => 0 1112.94/291.57 1112.94/291.57 ---------------------------------------- 1112.94/291.57 1112.94/291.57 (8) 1112.94/291.57 Obligation: 1112.94/291.57 Complexity RNTS consisting of the following rules: 1112.94/291.57 1112.94/291.57 gt(z, z') -{ 1 }-> gt(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x 1112.94/291.57 gt(z, z') -{ 1 }-> 1 :|: x >= 0, z = 1 + x, z' = 0 1112.94/291.57 gt(z, z') -{ 1 }-> 0 :|: y >= 0, z = 0, z' = y 1112.94/291.57 if(z, z', z'') -{ 1 }-> 0 :|: z' = x, z'' = y, x >= 0, y >= 0, z = 0 1112.94/291.57 if(z, z', z'') -{ 1 }-> 1 + minus(x, y) :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 1112.94/291.57 if1(z, z', z'') -{ 1 }-> x :|: z' = x, z'' = y, z = 1, x >= 0, y >= 0 1112.94/291.57 if1(z, z', z'') -{ 1 }-> mod(minus(x, y), y) :|: z' = x, z'' = y, x >= 0, y >= 0, z = 0 1112.94/291.57 lt(z, z') -{ 1 }-> lt(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x 1112.94/291.57 lt(z, z') -{ 1 }-> 1 :|: z' = 1 + x, x >= 0, z = 0 1112.94/291.57 lt(z, z') -{ 1 }-> 0 :|: x >= 0, z = x, z' = 0 1112.94/291.57 minus(z, z') -{ 1 }-> if(gt(1 + x, y), x, y) :|: x >= 0, y >= 0, z = 1 + x, z' = y 1112.94/291.57 minus(z, z') -{ 1 }-> 0 :|: y >= 0, z = 0, z' = y 1112.94/291.57 mod(z, z') -{ 1 }-> if1(lt(x, 1 + y), x, 1 + y) :|: z' = 1 + y, x >= 0, y >= 0, z = x 1112.94/291.57 mod(z, z') -{ 1 }-> 0 :|: x >= 0, z = x, z' = 0 1112.94/291.57 1112.94/291.57 Only complete derivations are relevant for the runtime complexity. 1112.94/291.57 1112.94/291.57 ---------------------------------------- 1112.94/291.57 1112.94/291.57 (9) CompleteCoflocoProof (FINISHED) 1112.94/291.57 Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: 1112.94/291.57 1112.94/291.57 eq(start(V1, V, V7),0,[minus(V1, V, Out)],[V1 >= 0,V >= 0]). 1112.94/291.57 eq(start(V1, V, V7),0,[if(V1, V, V7, Out)],[V1 >= 0,V >= 0,V7 >= 0]). 1112.94/291.57 eq(start(V1, V, V7),0,[mod(V1, V, Out)],[V1 >= 0,V >= 0]). 1112.94/291.57 eq(start(V1, V, V7),0,[if1(V1, V, V7, Out)],[V1 >= 0,V >= 0,V7 >= 0]). 1112.94/291.57 eq(start(V1, V, V7),0,[gt(V1, V, Out)],[V1 >= 0,V >= 0]). 1112.94/291.57 eq(start(V1, V, V7),0,[lt(V1, V, Out)],[V1 >= 0,V >= 0]). 1112.94/291.57 eq(minus(V1, V, Out),1,[],[Out = 0,V2 >= 0,V1 = 0,V = V2]). 1112.94/291.57 eq(minus(V1, V, Out),1,[gt(1 + V3, V4, Ret0),if(Ret0, V3, V4, Ret)],[Out = Ret,V3 >= 0,V4 >= 0,V1 = 1 + V3,V = V4]). 1112.94/291.57 eq(if(V1, V, V7, Out),1,[minus(V5, V6, Ret1)],[Out = 1 + Ret1,V = V5,V7 = V6,V1 = 1,V5 >= 0,V6 >= 0]). 1112.94/291.57 eq(if(V1, V, V7, Out),1,[],[Out = 0,V = V8,V7 = V9,V8 >= 0,V9 >= 0,V1 = 0]). 1112.94/291.57 eq(mod(V1, V, Out),1,[],[Out = 0,V10 >= 0,V1 = V10,V = 0]). 1112.94/291.57 eq(mod(V1, V, Out),1,[lt(V12, 1 + V11, Ret01),if1(Ret01, V12, 1 + V11, Ret2)],[Out = Ret2,V = 1 + V11,V12 >= 0,V11 >= 0,V1 = V12]). 1112.94/291.57 eq(if1(V1, V, V7, Out),1,[],[Out = V14,V = V14,V7 = V13,V1 = 1,V14 >= 0,V13 >= 0]). 1112.94/291.57 eq(if1(V1, V, V7, Out),1,[minus(V16, V15, Ret02),mod(Ret02, V15, Ret3)],[Out = Ret3,V = V16,V7 = V15,V16 >= 0,V15 >= 0,V1 = 0]). 1112.94/291.57 eq(gt(V1, V, Out),1,[],[Out = 0,V17 >= 0,V1 = 0,V = V17]). 1112.94/291.57 eq(gt(V1, V, Out),1,[],[Out = 1,V18 >= 0,V1 = 1 + V18,V = 0]). 1112.94/291.57 eq(gt(V1, V, Out),1,[gt(V20, V19, Ret4)],[Out = Ret4,V = 1 + V19,V20 >= 0,V19 >= 0,V1 = 1 + V20]). 1112.94/291.57 eq(lt(V1, V, Out),1,[],[Out = 0,V21 >= 0,V1 = V21,V = 0]). 1112.94/291.57 eq(lt(V1, V, Out),1,[],[Out = 1,V = 1 + V22,V22 >= 0,V1 = 0]). 1112.94/291.57 eq(lt(V1, V, Out),1,[lt(V24, V23, Ret5)],[Out = Ret5,V = 1 + V23,V24 >= 0,V23 >= 0,V1 = 1 + V24]). 1112.94/291.57 input_output_vars(minus(V1,V,Out),[V1,V],[Out]). 1112.94/291.57 input_output_vars(if(V1,V,V7,Out),[V1,V,V7],[Out]). 1112.94/291.57 input_output_vars(mod(V1,V,Out),[V1,V],[Out]). 1112.94/291.57 input_output_vars(if1(V1,V,V7,Out),[V1,V,V7],[Out]). 1112.94/291.57 input_output_vars(gt(V1,V,Out),[V1,V],[Out]). 1112.94/291.57 input_output_vars(lt(V1,V,Out),[V1,V],[Out]). 1112.94/291.58 1112.94/291.58 1112.94/291.58 CoFloCo proof output: 1112.94/291.58 Preprocessing Cost Relations 1112.94/291.58 ===================================== 1112.94/291.58 1112.94/291.58 #### Computed strongly connected components 1112.94/291.58 0. recursive : [gt/3] 1112.94/291.58 1. recursive : [if/4,minus/3] 1112.94/291.58 2. recursive : [lt/3] 1112.94/291.58 3. recursive : [if1/4,(mod)/3] 1112.94/291.58 4. non_recursive : [start/3] 1112.94/291.58 1112.94/291.58 #### Obtained direct recursion through partial evaluation 1112.94/291.58 0. SCC is partially evaluated into gt/3 1112.94/291.58 1. SCC is partially evaluated into minus/3 1112.94/291.58 2. SCC is partially evaluated into lt/3 1112.94/291.58 3. SCC is partially evaluated into (mod)/3 1112.94/291.58 4. SCC is partially evaluated into start/3 1112.94/291.58 1112.94/291.58 Control-Flow Refinement of Cost Relations 1112.94/291.58 ===================================== 1112.94/291.58 1112.94/291.58 ### Specialization of cost equations gt/3 1112.94/291.58 * CE 17 is refined into CE [21] 1112.94/291.58 * CE 16 is refined into CE [22] 1112.94/291.58 * CE 15 is refined into CE [23] 1112.94/291.58 1112.94/291.58 1112.94/291.58 ### Cost equations --> "Loop" of gt/3 1112.94/291.58 * CEs [22] --> Loop 15 1112.94/291.58 * CEs [23] --> Loop 16 1112.94/291.58 * CEs [21] --> Loop 17 1112.94/291.58 1112.94/291.58 ### Ranking functions of CR gt(V1,V,Out) 1112.94/291.58 * RF of phase [17]: [V,V1] 1112.94/291.58 1112.94/291.58 #### Partial ranking functions of CR gt(V1,V,Out) 1112.94/291.58 * Partial RF of phase [17]: 1112.94/291.58 - RF of loop [17:1]: 1112.94/291.58 V 1112.94/291.58 V1 1112.94/291.58 1112.94/291.58 1112.94/291.58 ### Specialization of cost equations minus/3 1112.94/291.58 * CE 9 is refined into CE [24] 1112.94/291.58 * CE 11 is refined into CE [25] 1112.94/291.58 * CE 10 is refined into CE [26,27] 1112.94/291.58 1112.94/291.58 1112.94/291.58 ### Cost equations --> "Loop" of minus/3 1112.94/291.58 * CEs [27] --> Loop 18 1112.94/291.58 * CEs [26] --> Loop 19 1112.94/291.58 * CEs [24] --> Loop 20 1112.94/291.58 * CEs [25] --> Loop 21 1112.94/291.58 1112.94/291.58 ### Ranking functions of CR minus(V1,V,Out) 1112.94/291.58 * RF of phase [18]: [V1-1,V1-V] 1112.94/291.58 * RF of phase [19]: [V1] 1112.94/291.58 1112.94/291.58 #### Partial ranking functions of CR minus(V1,V,Out) 1112.94/291.58 * Partial RF of phase [18]: 1112.94/291.58 - RF of loop [18:1]: 1112.94/291.58 V1-1 1112.94/291.58 V1-V 1112.94/291.58 * Partial RF of phase [19]: 1112.94/291.58 - RF of loop [19:1]: 1112.94/291.58 V1 1112.94/291.58 1112.94/291.58 1112.94/291.58 ### Specialization of cost equations lt/3 1112.94/291.58 * CE 20 is refined into CE [28] 1112.94/291.58 * CE 18 is refined into CE [29] 1112.94/291.58 * CE 19 is refined into CE [30] 1112.94/291.58 1112.94/291.58 1112.94/291.58 ### Cost equations --> "Loop" of lt/3 1112.94/291.58 * CEs [29] --> Loop 22 1112.94/291.58 * CEs [30] --> Loop 23 1112.94/291.58 * CEs [28] --> Loop 24 1112.94/291.58 1112.94/291.58 ### Ranking functions of CR lt(V1,V,Out) 1112.94/291.58 * RF of phase [24]: [V,V1] 1112.94/291.58 1112.94/291.58 #### Partial ranking functions of CR lt(V1,V,Out) 1112.94/291.58 * Partial RF of phase [24]: 1112.94/291.58 - RF of loop [24:1]: 1112.94/291.58 V 1112.94/291.58 V1 1112.94/291.58 1112.94/291.58 1112.94/291.58 ### Specialization of cost equations (mod)/3 1112.94/291.58 * CE 13 is refined into CE [31,32] 1112.94/291.58 * CE 14 is refined into CE [33] 1112.94/291.58 * CE 12 is refined into CE [34,35] 1112.94/291.58 1112.94/291.58 1112.94/291.58 ### Cost equations --> "Loop" of (mod)/3 1112.94/291.58 * CEs [35] --> Loop 25 1112.94/291.58 * CEs [34] --> Loop 26 1112.94/291.58 * CEs [32] --> Loop 27 1112.94/291.58 * CEs [33] --> Loop 28 1112.94/291.58 * CEs [31] --> Loop 29 1112.94/291.58 1112.94/291.58 ### Ranking functions of CR mod(V1,V,Out) 1112.94/291.58 * RF of phase [25]: [V1-1,V1-V] 1112.94/291.58 1112.94/291.58 #### Partial ranking functions of CR mod(V1,V,Out) 1112.94/291.58 * Partial RF of phase [25]: 1112.94/291.58 - RF of loop [25:1]: 1112.94/291.58 V1-1 1112.94/291.58 V1-V 1112.94/291.58 1112.94/291.58 1112.94/291.58 ### Specialization of cost equations start/3 1112.94/291.58 * CE 2 is refined into CE [36] 1112.94/291.58 * CE 4 is refined into CE [37,38,39,40] 1112.94/291.58 * CE 1 is refined into CE [41,42,43,44,45,46,47,48] 1112.94/291.58 * CE 3 is refined into CE [49] 1112.94/291.58 * CE 5 is refined into CE [50,51,52,53] 1112.94/291.58 * CE 6 is refined into CE [54,55,56,57,58,59] 1112.94/291.58 * CE 7 is refined into CE [60,61,62,63] 1112.94/291.58 * CE 8 is refined into CE [64,65,66,67] 1112.94/291.58 1112.94/291.58 1112.94/291.58 ### Cost equations --> "Loop" of start/3 1112.94/291.58 * CEs [57] --> Loop 30 1112.94/291.58 * CEs [53,56,59,63,66] --> Loop 31 1112.94/291.58 * CEs [38,52,58,62,67] --> Loop 32 1112.94/291.58 * CEs [36,37,39,40] --> Loop 33 1112.94/291.58 * CEs [45] --> Loop 34 1112.94/291.58 * CEs [43] --> Loop 35 1112.94/291.58 * CEs [41,51,55,61,65] --> Loop 36 1112.94/291.58 * CEs [42,44,46,47,48,49,50,54,60,64] --> Loop 37 1112.94/291.58 1112.94/291.58 ### Ranking functions of CR start(V1,V,V7) 1112.94/291.58 1112.94/291.58 #### Partial ranking functions of CR start(V1,V,V7) 1112.94/291.58 1112.94/291.58 1112.94/291.58 Computing Bounds 1112.94/291.58 ===================================== 1112.94/291.58 1112.94/291.58 #### Cost of chains of gt(V1,V,Out): 1112.94/291.58 * Chain [[17],16]: 1*it(17)+1 1112.94/291.58 Such that:it(17) =< V1 1112.94/291.58 1112.94/291.58 with precondition: [Out=0,V1>=1,V>=V1] 1112.94/291.58 1112.94/291.58 * Chain [[17],15]: 1*it(17)+1 1112.94/291.58 Such that:it(17) =< V 1112.94/291.58 1112.94/291.58 with precondition: [Out=1,V>=1,V1>=V+1] 1112.94/291.58 1112.94/291.58 * Chain [16]: 1 1112.94/291.58 with precondition: [V1=0,Out=0,V>=0] 1112.94/291.58 1112.94/291.58 * Chain [15]: 1 1112.94/291.58 with precondition: [V=0,Out=1,V1>=1] 1112.94/291.58 1112.94/291.58 1112.94/291.58 #### Cost of chains of minus(V1,V,Out): 1112.94/291.58 * Chain [[19],21]: 3*it(19)+1 1112.94/291.58 Such that:it(19) =< Out 1112.94/291.58 1112.94/291.58 with precondition: [V=0,V1=Out,V1>=1] 1112.94/291.58 1112.94/291.58 * Chain [[18],20]: 3*it(18)+1*s(1)+1*s(4)+3 1112.94/291.58 Such that:it(18) =< Out 1112.94/291.58 aux(2) =< V1-Out 1112.94/291.58 s(1) =< aux(2) 1112.94/291.58 s(4) =< it(18)*aux(2) 1112.94/291.58 1112.94/291.58 with precondition: [V1=Out+V,V>=1,V1>=V+1] 1112.94/291.58 1112.94/291.58 * Chain [21]: 1 1112.94/291.58 with precondition: [V1=0,Out=0,V>=0] 1112.94/291.58 1112.94/291.58 * Chain [20]: 1*s(1)+3 1112.94/291.58 Such that:s(1) =< V1 1112.94/291.58 1112.94/291.58 with precondition: [Out=0,V1>=1,V>=V1] 1112.94/291.58 1112.94/291.58 1112.94/291.58 #### Cost of chains of lt(V1,V,Out): 1112.94/291.58 * Chain [[24],23]: 1*it(24)+1 1112.94/291.58 Such that:it(24) =< V1 1112.94/291.58 1112.94/291.58 with precondition: [Out=1,V1>=1,V>=V1+1] 1112.94/291.58 1112.94/291.58 * Chain [[24],22]: 1*it(24)+1 1112.94/291.58 Such that:it(24) =< V 1112.94/291.58 1112.94/291.58 with precondition: [Out=0,V>=1,V1>=V] 1112.94/291.58 1112.94/291.58 * Chain [23]: 1 1112.94/291.58 with precondition: [V1=0,Out=1,V>=1] 1112.94/291.58 1112.94/291.58 * Chain [22]: 1 1112.94/291.58 with precondition: [V=0,Out=0,V1>=0] 1112.94/291.58 1112.94/291.58 1112.94/291.58 #### Cost of chains of mod(V1,V,Out): 1112.94/291.58 * Chain [[25],27]: 6*it(25)+1*s(5)+2*s(15)+3*s(16)+1*s(17)+3 1112.94/291.58 Such that:aux(5) =< V1 1112.94/291.58 aux(6) =< V1-V 1112.94/291.58 s(12) =< V 1112.94/291.58 s(5) =< Out 1112.94/291.58 aux(8) =< V1-Out 1112.94/291.58 it(25) =< aux(8) 1112.94/291.58 it(25) =< aux(5) 1112.94/291.58 s(18) =< aux(5) 1112.94/291.58 it(25) =< aux(6) 1112.94/291.58 s(18) =< aux(8) 1112.94/291.58 s(16) =< it(25)*aux(6) 1112.94/291.58 s(15) =< s(18) 1112.94/291.58 s(17) =< s(16)*s(12) 1112.94/291.58 1112.94/291.58 with precondition: [Out>=1,V>=Out+1,V1>=Out+V] 1112.94/291.58 1112.94/291.58 * Chain [[25],26,29]: 6*it(25)+2*s(15)+3*s(16)+1*s(17)+2*s(19)+9 1112.94/291.58 Such that:aux(5) =< V1 1112.94/291.58 aux(10) =< V1-V 1112.94/291.58 aux(11) =< V 1112.94/291.58 it(25) =< aux(10) 1112.94/291.58 s(19) =< aux(11) 1112.94/291.58 it(25) =< aux(5) 1112.94/291.58 s(18) =< aux(5) 1112.94/291.58 s(18) =< aux(10) 1112.94/291.58 s(16) =< it(25)*aux(10) 1112.94/291.58 s(15) =< s(18) 1112.94/291.58 s(17) =< s(16)*aux(11) 1112.94/291.58 1112.94/291.58 with precondition: [Out=0,V>=1,V1>=2*V] 1112.94/291.58 1112.94/291.58 * Chain [29]: 3 1112.94/291.58 with precondition: [V1=0,Out=0,V>=1] 1112.94/291.58 1112.94/291.58 * Chain [28]: 1 1112.94/291.58 with precondition: [V=0,Out=0,V1>=0] 1112.94/291.58 1112.94/291.58 * Chain [27]: 1*s(5)+3 1112.94/291.58 Such that:s(5) =< V1 1112.94/291.58 1112.94/291.58 with precondition: [V1=Out,V1>=1,V>=V1+1] 1112.94/291.58 1112.94/291.58 * Chain [26,29]: 2*s(19)+9 1112.94/291.58 Such that:aux(9) =< V1 1112.94/291.58 s(19) =< aux(9) 1112.94/291.58 1112.94/291.58 with precondition: [Out=0,V1=V,V1>=1] 1112.94/291.58 1112.94/291.58 1112.94/291.58 #### Cost of chains of start(V1,V,V7): 1112.94/291.58 * Chain [37]: 1*s(21)+13*s(22)+5*s(24)+3*s(25)+12*s(29)+6*s(32)+2*s(33)+2*s(34)+13 1112.94/291.58 Such that:s(21) =< V 1112.94/291.58 aux(17) =< V-2*V7 1112.94/291.58 aux(18) =< V-V7 1112.94/291.58 aux(19) =< V7 1112.94/291.58 s(22) =< aux(18) 1112.94/291.58 s(29) =< aux(17) 1112.94/291.58 s(24) =< aux(19) 1112.94/291.58 s(29) =< aux(18) 1112.94/291.58 s(31) =< aux(18) 1112.94/291.58 s(31) =< aux(17) 1112.94/291.58 s(32) =< s(29)*aux(17) 1112.94/291.58 s(33) =< s(31) 1112.94/291.58 s(34) =< s(32)*aux(19) 1112.94/291.58 s(25) =< s(22)*aux(19) 1112.94/291.58 1112.94/291.58 with precondition: [V1=0,V>=0] 1112.94/291.58 1112.94/291.58 * Chain [36]: 3*s(54)+5 1112.94/291.58 Such that:s(54) =< V1 1112.94/291.58 1112.94/291.58 with precondition: [V=0,V1>=0] 1112.94/291.58 1112.94/291.58 * Chain [35]: 3*s(55)+3 1112.94/291.58 Such that:s(55) =< V 1112.94/291.58 1112.94/291.58 with precondition: [V1=0,V7=0,V>=1] 1112.94/291.58 1112.94/291.58 * Chain [34]: 6*s(56)+1*s(59)+13 1112.94/291.58 Such that:aux(20) =< V7 1112.94/291.58 s(56) =< aux(20) 1112.94/291.58 s(59) =< s(56)*aux(20) 1112.94/291.58 1112.94/291.58 with precondition: [V1=0,V=2*V7,V>=2] 1112.94/291.58 1112.94/291.58 * Chain [33]: 1*s(62)+3*s(63)+1*s(65)+1*s(66)+4 1112.94/291.58 Such that:s(62) =< V 1112.94/291.58 s(63) =< V-V7 1112.94/291.58 s(64) =< V7 1112.94/291.58 s(65) =< s(64) 1112.94/291.58 s(66) =< s(63)*s(64) 1112.94/291.58 1112.94/291.58 with precondition: [V1=1,V>=0,V7>=0] 1112.94/291.58 1112.94/291.58 * Chain [32]: 3*s(67)+4*s(68)+3 1112.94/291.58 Such that:s(67) =< V 1112.94/291.58 aux(21) =< V1 1112.94/291.58 s(68) =< aux(21) 1112.94/291.58 1112.94/291.58 with precondition: [V1>=1,V>=V1] 1112.94/291.58 1112.94/291.58 * Chain [31]: 3*s(72)+5*s(74)+1*s(75)+3*s(81)+6*s(83)+3*s(85)+1*s(87)+9 1112.94/291.58 Such that:aux(22) =< V1 1112.94/291.58 aux(23) =< V1-V 1112.94/291.58 aux(24) =< V 1112.94/291.58 s(72) =< aux(23) 1112.94/291.58 s(74) =< aux(24) 1112.94/291.58 s(75) =< s(72)*aux(24) 1112.94/291.58 s(81) =< aux(22) 1112.94/291.58 s(83) =< aux(22) 1112.94/291.58 s(83) =< aux(23) 1112.94/291.58 s(85) =< s(83)*aux(23) 1112.94/291.58 s(87) =< s(85)*aux(24) 1112.94/291.58 1112.94/291.58 with precondition: [V>=1,V1>=V] 1112.94/291.58 1112.94/291.58 * Chain [30]: 6*s(93)+2*s(94)+3*s(96)+2*s(97)+1*s(98)+9 1112.94/291.58 Such that:s(90) =< V1 1112.94/291.58 s(91) =< V1-V 1112.94/291.58 s(92) =< V 1112.94/291.58 s(93) =< s(91) 1112.94/291.58 s(94) =< s(92) 1112.94/291.58 s(93) =< s(90) 1112.94/291.58 s(95) =< s(90) 1112.94/291.58 s(95) =< s(91) 1112.94/291.58 s(96) =< s(93)*s(91) 1112.94/291.58 s(97) =< s(95) 1112.94/291.58 s(98) =< s(96)*s(92) 1112.94/291.58 1112.94/291.58 with precondition: [V>=1,V1>=2*V] 1112.94/291.58 1112.94/291.58 1112.94/291.58 Closed-form bounds of start(V1,V,V7): 1112.94/291.58 ------------------------------------- 1112.94/291.58 * Chain [37] with precondition: [V1=0,V>=0] 1112.94/291.58 - Upper bound: V+13+nat(V7)*5+nat(V7)*3*nat(V-V7)+nat(V7)*2*nat(V-2*V7)*nat(V-2*V7)+nat(V-V7)*15+nat(V-2*V7)*12+nat(V-2*V7)*6*nat(V-2*V7) 1112.94/291.58 - Complexity: n^3 1112.94/291.58 * Chain [36] with precondition: [V=0,V1>=0] 1112.94/291.58 - Upper bound: 3*V1+5 1112.94/291.58 - Complexity: n 1112.94/291.58 * Chain [35] with precondition: [V1=0,V7=0,V>=1] 1112.94/291.58 - Upper bound: 3*V+3 1112.94/291.58 - Complexity: n 1112.94/291.58 * Chain [34] with precondition: [V1=0,V=2*V7,V>=2] 1112.94/291.58 - Upper bound: 6*V7+13+V7*V7 1112.94/291.58 - Complexity: n^2 1112.94/291.58 * Chain [33] with precondition: [V1=1,V>=0,V7>=0] 1112.94/291.58 - Upper bound: V+V7+4+nat(V-V7)*V7+nat(V-V7)*3 1112.94/291.58 - Complexity: n^2 1112.94/291.58 * Chain [32] with precondition: [V1>=1,V>=V1] 1112.94/291.58 - Upper bound: 4*V1+3*V+3 1112.94/291.58 - Complexity: n 1112.94/291.58 * Chain [31] with precondition: [V>=1,V1>=V] 1112.94/291.58 - Upper bound: 3*V1-3*V+(9*V1+9+(V1-V)*(V*V1)+(V1-V)*(3*V1)+5*V+(V1-V)*V) 1112.94/291.58 - Complexity: n^3 1112.94/291.58 * Chain [30] with precondition: [V>=1,V1>=2*V] 1112.94/291.58 - Upper bound: 6*V1-6*V+(2*V1+2*V+9+(V1-V)*((V1-V)*V))+(3*V1-3*V)*(V1-V) 1112.94/291.58 - Complexity: n^3 1112.94/291.58 1112.94/291.58 ### Maximum cost of start(V1,V,V7): max([max([3*V1,nat(V7)*6+8+nat(V7)*nat(V7)])+2,max([max([V,2*V1+max([nat(V1-V)*V*nat(V1-V)+6+nat(V1-V)*6+nat(V1-V)*3*nat(V1-V),5*V1+6+V*V1*nat(V1-V)+3*V1*nat(V1-V)+2*V+nat(V1-V)*V+nat(V1-V)*3+(2*V1+V)])])+V,nat(V7)*4+9+nat(V7)*2*nat(V-V7)+nat(V7)*2*nat(V-2*V7)*nat(V-2*V7)+nat(V-V7)*12+nat(V-2*V7)*12+nat(V-2*V7)*6*nat(V-2*V7)+(nat(V7)+1+nat(V-V7)*nat(V7)+nat(V-V7)*3)])+V])+3 1112.94/291.58 Asymptotic class: n^3 1112.94/291.58 * Total analysis performed in 418 ms. 1112.94/291.58 1112.94/291.58 1112.94/291.58 ---------------------------------------- 1112.94/291.58 1112.94/291.58 (10) 1112.94/291.58 BOUNDS(1, n^3) 1112.94/291.58 1112.94/291.58 ---------------------------------------- 1112.94/291.58 1112.94/291.58 (11) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) 1112.94/291.58 Transformed a relative TRS into a decreasing-loop problem. 1112.94/291.58 ---------------------------------------- 1112.94/291.58 1112.94/291.58 (12) 1112.94/291.58 Obligation: 1112.94/291.58 Analyzing the following TRS for decreasing loops: 1112.94/291.58 1112.94/291.58 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^3). 1112.94/291.58 1112.94/291.58 1112.94/291.58 The TRS R consists of the following rules: 1112.94/291.58 1112.94/291.58 minus(0, y) -> 0 1112.94/291.58 minus(s(x), y) -> if(gt(s(x), y), x, y) 1112.94/291.58 if(true, x, y) -> s(minus(x, y)) 1112.94/291.58 if(false, x, y) -> 0 1112.94/291.58 mod(x, 0) -> 0 1112.94/291.58 mod(x, s(y)) -> if1(lt(x, s(y)), x, s(y)) 1112.94/291.58 if1(true, x, y) -> x 1112.94/291.58 if1(false, x, y) -> mod(minus(x, y), y) 1112.94/291.58 gt(0, y) -> false 1112.94/291.58 gt(s(x), 0) -> true 1112.94/291.58 gt(s(x), s(y)) -> gt(x, y) 1112.94/291.58 lt(x, 0) -> false 1112.94/291.58 lt(0, s(x)) -> true 1112.94/291.58 lt(s(x), s(y)) -> lt(x, y) 1112.94/291.58 1112.94/291.58 S is empty. 1112.94/291.58 Rewrite Strategy: INNERMOST 1112.94/291.58 ---------------------------------------- 1112.94/291.58 1112.94/291.58 (13) DecreasingLoopProof (LOWER BOUND(ID)) 1112.94/291.58 The following loop(s) give(s) rise to the lower bound Omega(n^1): 1112.94/291.58 1112.94/291.58 The rewrite sequence 1112.94/291.58 1112.94/291.58 lt(s(x), s(y)) ->^+ lt(x, y) 1112.94/291.58 1112.94/291.58 gives rise to a decreasing loop by considering the right hand sides subterm at position []. 1112.94/291.58 1112.94/291.58 The pumping substitution is [x / s(x), y / s(y)]. 1112.94/291.58 1112.94/291.58 The result substitution is [ ]. 1112.94/291.58 1112.94/291.58 1112.94/291.58 1112.94/291.58 1112.94/291.58 ---------------------------------------- 1112.94/291.58 1112.94/291.58 (14) 1112.94/291.58 Complex Obligation (BEST) 1112.94/291.58 1112.94/291.58 ---------------------------------------- 1112.94/291.58 1112.94/291.58 (15) 1112.94/291.58 Obligation: 1112.94/291.58 Proved the lower bound n^1 for the following obligation: 1112.94/291.58 1112.94/291.58 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^3). 1112.94/291.58 1112.94/291.58 1112.94/291.58 The TRS R consists of the following rules: 1112.94/291.58 1112.94/291.58 minus(0, y) -> 0 1112.94/291.58 minus(s(x), y) -> if(gt(s(x), y), x, y) 1112.94/291.58 if(true, x, y) -> s(minus(x, y)) 1112.94/291.58 if(false, x, y) -> 0 1112.94/291.58 mod(x, 0) -> 0 1112.94/291.58 mod(x, s(y)) -> if1(lt(x, s(y)), x, s(y)) 1112.94/291.58 if1(true, x, y) -> x 1112.94/291.58 if1(false, x, y) -> mod(minus(x, y), y) 1112.94/291.58 gt(0, y) -> false 1112.94/291.58 gt(s(x), 0) -> true 1112.94/291.58 gt(s(x), s(y)) -> gt(x, y) 1112.94/291.58 lt(x, 0) -> false 1112.94/291.58 lt(0, s(x)) -> true 1112.94/291.58 lt(s(x), s(y)) -> lt(x, y) 1112.94/291.58 1112.94/291.58 S is empty. 1112.94/291.58 Rewrite Strategy: INNERMOST 1112.94/291.58 ---------------------------------------- 1112.94/291.58 1112.94/291.58 (16) LowerBoundPropagationProof (FINISHED) 1112.94/291.58 Propagated lower bound. 1112.94/291.58 ---------------------------------------- 1112.94/291.58 1112.94/291.58 (17) 1112.94/291.58 BOUNDS(n^1, INF) 1112.94/291.58 1112.94/291.58 ---------------------------------------- 1112.94/291.58 1112.94/291.58 (18) 1112.94/291.58 Obligation: 1112.94/291.58 Analyzing the following TRS for decreasing loops: 1112.94/291.58 1112.94/291.58 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^3). 1112.94/291.58 1112.94/291.58 1112.94/291.58 The TRS R consists of the following rules: 1112.94/291.58 1112.94/291.58 minus(0, y) -> 0 1112.94/291.58 minus(s(x), y) -> if(gt(s(x), y), x, y) 1112.94/291.58 if(true, x, y) -> s(minus(x, y)) 1112.94/291.58 if(false, x, y) -> 0 1112.94/291.58 mod(x, 0) -> 0 1112.94/291.58 mod(x, s(y)) -> if1(lt(x, s(y)), x, s(y)) 1112.94/291.58 if1(true, x, y) -> x 1112.94/291.58 if1(false, x, y) -> mod(minus(x, y), y) 1112.94/291.58 gt(0, y) -> false 1112.94/291.58 gt(s(x), 0) -> true 1112.94/291.58 gt(s(x), s(y)) -> gt(x, y) 1112.94/291.58 lt(x, 0) -> false 1112.94/291.58 lt(0, s(x)) -> true 1112.94/291.58 lt(s(x), s(y)) -> lt(x, y) 1112.94/291.58 1112.94/291.58 S is empty. 1112.94/291.58 Rewrite Strategy: INNERMOST 1113.14/291.65 EOF