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