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