14.22/4.51 WORST_CASE(Omega(n^1), O(n^1)) 14.22/4.53 proof of /export/starexec/sandbox/benchmark/theBenchmark.xml 14.22/4.53 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 14.22/4.53 14.22/4.53 14.22/4.53 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 14.22/4.53 14.22/4.53 (0) CpxTRS 14.22/4.53 (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] 14.22/4.53 (2) CpxWeightedTrs 14.22/4.53 (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 2 ms] 14.22/4.53 (4) CpxTypedWeightedTrs 14.22/4.53 (5) CompletionProof [UPPER BOUND(ID), 0 ms] 14.22/4.53 (6) CpxTypedWeightedCompleteTrs 14.22/4.53 (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 2 ms] 14.22/4.53 (8) CpxRNTS 14.22/4.53 (9) CompleteCoflocoProof [FINISHED, 190 ms] 14.22/4.53 (10) BOUNDS(1, n^1) 14.22/4.53 (11) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] 14.22/4.53 (12) TRS for Loop Detection 14.22/4.53 (13) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] 14.22/4.53 (14) BEST 14.22/4.53 (15) proven lower bound 14.22/4.53 (16) LowerBoundPropagationProof [FINISHED, 0 ms] 14.22/4.53 (17) BOUNDS(n^1, INF) 14.22/4.53 (18) TRS for Loop Detection 14.22/4.53 14.22/4.53 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (0) 14.22/4.53 Obligation: 14.22/4.53 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 14.22/4.53 14.22/4.53 14.22/4.53 The TRS R consists of the following rules: 14.22/4.53 14.22/4.53 half(0) -> 0 14.22/4.53 half(s(0)) -> 0 14.22/4.53 half(s(s(x))) -> s(half(x)) 14.22/4.53 bits(0) -> 0 14.22/4.53 bits(s(x)) -> s(bits(half(s(x)))) 14.22/4.53 14.22/4.53 S is empty. 14.22/4.53 Rewrite Strategy: INNERMOST 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) 14.22/4.53 Transformed relative TRS to weighted TRS 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (2) 14.22/4.53 Obligation: 14.22/4.53 The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1). 14.22/4.53 14.22/4.53 14.22/4.53 The TRS R consists of the following rules: 14.22/4.53 14.22/4.53 half(0) -> 0 [1] 14.22/4.53 half(s(0)) -> 0 [1] 14.22/4.53 half(s(s(x))) -> s(half(x)) [1] 14.22/4.53 bits(0) -> 0 [1] 14.22/4.53 bits(s(x)) -> s(bits(half(s(x)))) [1] 14.22/4.53 14.22/4.53 Rewrite Strategy: INNERMOST 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 14.22/4.53 Infered types. 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (4) 14.22/4.53 Obligation: 14.22/4.53 Runtime Complexity Weighted TRS with Types. 14.22/4.53 The TRS R consists of the following rules: 14.22/4.53 14.22/4.53 half(0) -> 0 [1] 14.22/4.53 half(s(0)) -> 0 [1] 14.22/4.53 half(s(s(x))) -> s(half(x)) [1] 14.22/4.53 bits(0) -> 0 [1] 14.22/4.53 bits(s(x)) -> s(bits(half(s(x)))) [1] 14.22/4.53 14.22/4.53 The TRS has the following type information: 14.22/4.53 half :: 0:s -> 0:s 14.22/4.53 0 :: 0:s 14.22/4.53 s :: 0:s -> 0:s 14.22/4.53 bits :: 0:s -> 0:s 14.22/4.53 14.22/4.53 Rewrite Strategy: INNERMOST 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (5) CompletionProof (UPPER BOUND(ID)) 14.22/4.53 The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: 14.22/4.53 none 14.22/4.53 14.22/4.53 And the following fresh constants: none 14.22/4.53 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (6) 14.22/4.53 Obligation: 14.22/4.53 Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: 14.22/4.53 14.22/4.53 Runtime Complexity Weighted TRS with Types. 14.22/4.53 The TRS R consists of the following rules: 14.22/4.53 14.22/4.53 half(0) -> 0 [1] 14.22/4.53 half(s(0)) -> 0 [1] 14.22/4.53 half(s(s(x))) -> s(half(x)) [1] 14.22/4.53 bits(0) -> 0 [1] 14.22/4.53 bits(s(x)) -> s(bits(half(s(x)))) [1] 14.22/4.53 14.22/4.53 The TRS has the following type information: 14.22/4.53 half :: 0:s -> 0:s 14.22/4.53 0 :: 0:s 14.22/4.53 s :: 0:s -> 0:s 14.22/4.53 bits :: 0:s -> 0:s 14.22/4.53 14.22/4.53 Rewrite Strategy: INNERMOST 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) 14.22/4.53 Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. 14.22/4.53 The constant constructors are abstracted as follows: 14.22/4.53 14.22/4.53 0 => 0 14.22/4.53 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (8) 14.22/4.53 Obligation: 14.22/4.53 Complexity RNTS consisting of the following rules: 14.22/4.53 14.22/4.53 bits(z) -{ 1 }-> 0 :|: z = 0 14.22/4.53 bits(z) -{ 1 }-> 1 + bits(half(1 + x)) :|: x >= 0, z = 1 + x 14.22/4.53 half(z) -{ 1 }-> 0 :|: z = 0 14.22/4.53 half(z) -{ 1 }-> 0 :|: z = 1 + 0 14.22/4.53 half(z) -{ 1 }-> 1 + half(x) :|: x >= 0, z = 1 + (1 + x) 14.22/4.53 14.22/4.53 Only complete derivations are relevant for the runtime complexity. 14.22/4.53 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (9) CompleteCoflocoProof (FINISHED) 14.22/4.53 Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: 14.22/4.53 14.22/4.53 eq(start(V),0,[half(V, Out)],[V >= 0]). 14.22/4.53 eq(start(V),0,[bits(V, Out)],[V >= 0]). 14.22/4.53 eq(half(V, Out),1,[],[Out = 0,V = 0]). 14.22/4.53 eq(half(V, Out),1,[],[Out = 0,V = 1]). 14.22/4.53 eq(half(V, Out),1,[half(V1, Ret1)],[Out = 1 + Ret1,V1 >= 0,V = 2 + V1]). 14.22/4.53 eq(bits(V, Out),1,[],[Out = 0,V = 0]). 14.22/4.53 eq(bits(V, Out),1,[half(1 + V2, Ret10),bits(Ret10, Ret11)],[Out = 1 + Ret11,V2 >= 0,V = 1 + V2]). 14.22/4.53 input_output_vars(half(V,Out),[V],[Out]). 14.22/4.53 input_output_vars(bits(V,Out),[V],[Out]). 14.22/4.53 14.22/4.53 14.22/4.53 CoFloCo proof output: 14.22/4.53 Preprocessing Cost Relations 14.22/4.53 ===================================== 14.22/4.53 14.22/4.53 #### Computed strongly connected components 14.22/4.53 0. recursive : [half/2] 14.22/4.53 1. recursive : [bits/2] 14.22/4.53 2. non_recursive : [start/1] 14.22/4.53 14.22/4.53 #### Obtained direct recursion through partial evaluation 14.22/4.53 0. SCC is partially evaluated into half/2 14.22/4.53 1. SCC is partially evaluated into bits/2 14.22/4.53 2. SCC is partially evaluated into start/1 14.22/4.53 14.22/4.53 Control-Flow Refinement of Cost Relations 14.22/4.53 ===================================== 14.22/4.53 14.22/4.53 ### Specialization of cost equations half/2 14.22/4.53 * CE 5 is refined into CE [8] 14.22/4.53 * CE 4 is refined into CE [9] 14.22/4.53 * CE 3 is refined into CE [10] 14.22/4.53 14.22/4.53 14.22/4.53 ### Cost equations --> "Loop" of half/2 14.22/4.53 * CEs [9] --> Loop 7 14.22/4.53 * CEs [10] --> Loop 8 14.22/4.53 * CEs [8] --> Loop 9 14.22/4.53 14.22/4.53 ### Ranking functions of CR half(V,Out) 14.22/4.53 * RF of phase [9]: [V-1] 14.22/4.53 14.22/4.53 #### Partial ranking functions of CR half(V,Out) 14.22/4.53 * Partial RF of phase [9]: 14.22/4.53 - RF of loop [9:1]: 14.22/4.53 V-1 14.22/4.53 14.22/4.53 14.22/4.53 ### Specialization of cost equations bits/2 14.22/4.53 * CE 7 is refined into CE [11,12,13] 14.22/4.53 * CE 6 is refined into CE [14] 14.22/4.53 14.22/4.53 14.22/4.53 ### Cost equations --> "Loop" of bits/2 14.22/4.53 * CEs [14] --> Loop 10 14.22/4.53 * CEs [13] --> Loop 11 14.22/4.53 * CEs [12] --> Loop 12 14.22/4.53 * CEs [11] --> Loop 13 14.22/4.53 14.22/4.53 ### Ranking functions of CR bits(V,Out) 14.22/4.53 * RF of phase [11,12]: [V-1] 14.22/4.53 14.22/4.53 #### Partial ranking functions of CR bits(V,Out) 14.22/4.53 * Partial RF of phase [11,12]: 14.22/4.53 - RF of loop [11:1]: 14.22/4.53 V/2-1 14.22/4.53 - RF of loop [12:1]: 14.22/4.53 V-1 14.22/4.53 14.22/4.53 14.22/4.53 ### Specialization of cost equations start/1 14.22/4.53 * CE 1 is refined into CE [15,16,17,18] 14.22/4.53 * CE 2 is refined into CE [19,20,21] 14.22/4.53 14.22/4.53 14.22/4.53 ### Cost equations --> "Loop" of start/1 14.22/4.53 * CEs [17,18,21] --> Loop 14 14.22/4.53 * CEs [16,20] --> Loop 15 14.22/4.53 * CEs [15,19] --> Loop 16 14.22/4.53 14.22/4.53 ### Ranking functions of CR start(V) 14.22/4.53 14.22/4.53 #### Partial ranking functions of CR start(V) 14.22/4.53 14.22/4.53 14.22/4.53 Computing Bounds 14.22/4.53 ===================================== 14.22/4.53 14.22/4.53 #### Cost of chains of half(V,Out): 14.22/4.53 * Chain [[9],8]: 1*it(9)+1 14.22/4.53 Such that:it(9) =< 2*Out 14.22/4.53 14.22/4.53 with precondition: [V=2*Out,V>=2] 14.22/4.53 14.22/4.53 * Chain [[9],7]: 1*it(9)+1 14.22/4.53 Such that:it(9) =< 2*Out 14.22/4.53 14.22/4.53 with precondition: [V=2*Out+1,V>=3] 14.22/4.53 14.22/4.53 * Chain [8]: 1 14.22/4.53 with precondition: [V=0,Out=0] 14.22/4.53 14.22/4.53 * Chain [7]: 1 14.22/4.53 with precondition: [V=1,Out=0] 14.22/4.53 14.22/4.53 14.22/4.53 #### Cost of chains of bits(V,Out): 14.22/4.53 * Chain [[11,12],13,10]: 2*it(11)+2*it(12)+2*s(5)+3 14.22/4.53 Such that:it(11) =< V/2 14.22/4.53 aux(5) =< V 14.22/4.53 aux(6) =< 2*V 14.22/4.53 it(11) =< aux(5) 14.22/4.53 it(12) =< aux(5) 14.22/4.53 it(12) =< aux(6) 14.22/4.53 s(5) =< aux(6) 14.22/4.53 14.22/4.53 with precondition: [Out>=2,V+2>=2*Out] 14.22/4.53 14.22/4.53 * Chain [13,10]: 3 14.22/4.53 with precondition: [V=1,Out=1] 14.22/4.53 14.22/4.53 * Chain [10]: 1 14.22/4.53 with precondition: [V=0,Out=0] 14.22/4.53 14.22/4.53 14.22/4.53 #### Cost of chains of start(V): 14.22/4.53 * Chain [16]: 1 14.22/4.53 with precondition: [V=0] 14.22/4.53 14.22/4.53 * Chain [15]: 3 14.22/4.53 with precondition: [V=1] 14.22/4.53 14.22/4.53 * Chain [14]: 2*s(7)+2*s(9)+2*s(12)+2*s(13)+3 14.22/4.53 Such that:s(11) =< 2*V 14.22/4.53 s(9) =< V/2 14.22/4.53 aux(7) =< V 14.22/4.53 s(7) =< aux(7) 14.22/4.53 s(9) =< aux(7) 14.22/4.53 s(12) =< aux(7) 14.22/4.53 s(12) =< s(11) 14.22/4.53 s(13) =< s(11) 14.22/4.53 14.22/4.53 with precondition: [V>=2] 14.22/4.53 14.22/4.53 14.22/4.53 Closed-form bounds of start(V): 14.22/4.53 ------------------------------------- 14.22/4.53 * Chain [16] with precondition: [V=0] 14.22/4.53 - Upper bound: 1 14.22/4.53 - Complexity: constant 14.22/4.53 * Chain [15] with precondition: [V=1] 14.22/4.53 - Upper bound: 3 14.22/4.53 - Complexity: constant 14.22/4.53 * Chain [14] with precondition: [V>=2] 14.22/4.53 - Upper bound: 9*V+3 14.22/4.53 - Complexity: n 14.22/4.53 14.22/4.53 ### Maximum cost of start(V): 9*V+3 14.22/4.53 Asymptotic class: n 14.22/4.53 * Total analysis performed in 109 ms. 14.22/4.53 14.22/4.53 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (10) 14.22/4.53 BOUNDS(1, n^1) 14.22/4.53 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (11) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) 14.22/4.53 Transformed a relative TRS into a decreasing-loop problem. 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (12) 14.22/4.53 Obligation: 14.22/4.53 Analyzing the following TRS for decreasing loops: 14.22/4.53 14.22/4.53 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 14.22/4.53 14.22/4.53 14.22/4.53 The TRS R consists of the following rules: 14.22/4.53 14.22/4.53 half(0) -> 0 14.22/4.53 half(s(0)) -> 0 14.22/4.53 half(s(s(x))) -> s(half(x)) 14.22/4.53 bits(0) -> 0 14.22/4.53 bits(s(x)) -> s(bits(half(s(x)))) 14.22/4.53 14.22/4.53 S is empty. 14.22/4.53 Rewrite Strategy: INNERMOST 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (13) DecreasingLoopProof (LOWER BOUND(ID)) 14.22/4.53 The following loop(s) give(s) rise to the lower bound Omega(n^1): 14.22/4.53 14.22/4.53 The rewrite sequence 14.22/4.53 14.22/4.53 half(s(s(x))) ->^+ s(half(x)) 14.22/4.53 14.22/4.53 gives rise to a decreasing loop by considering the right hand sides subterm at position [0]. 14.22/4.53 14.22/4.53 The pumping substitution is [x / s(s(x))]. 14.22/4.53 14.22/4.53 The result substitution is [ ]. 14.22/4.53 14.22/4.53 14.22/4.53 14.22/4.53 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (14) 14.22/4.53 Complex Obligation (BEST) 14.22/4.53 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (15) 14.22/4.53 Obligation: 14.22/4.53 Proved the lower bound n^1 for the following obligation: 14.22/4.53 14.22/4.53 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 14.22/4.53 14.22/4.53 14.22/4.53 The TRS R consists of the following rules: 14.22/4.53 14.22/4.53 half(0) -> 0 14.22/4.53 half(s(0)) -> 0 14.22/4.53 half(s(s(x))) -> s(half(x)) 14.22/4.53 bits(0) -> 0 14.22/4.53 bits(s(x)) -> s(bits(half(s(x)))) 14.22/4.53 14.22/4.53 S is empty. 14.22/4.53 Rewrite Strategy: INNERMOST 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (16) LowerBoundPropagationProof (FINISHED) 14.22/4.53 Propagated lower bound. 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (17) 14.22/4.53 BOUNDS(n^1, INF) 14.22/4.53 14.22/4.53 ---------------------------------------- 14.22/4.53 14.22/4.53 (18) 14.22/4.53 Obligation: 14.22/4.53 Analyzing the following TRS for decreasing loops: 14.22/4.53 14.22/4.53 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 14.22/4.53 14.22/4.53 14.22/4.53 The TRS R consists of the following rules: 14.22/4.53 14.22/4.53 half(0) -> 0 14.22/4.53 half(s(0)) -> 0 14.22/4.53 half(s(s(x))) -> s(half(x)) 14.22/4.53 bits(0) -> 0 14.22/4.53 bits(s(x)) -> s(bits(half(s(x)))) 14.22/4.53 14.22/4.53 S is empty. 14.22/4.53 Rewrite Strategy: INNERMOST 14.22/4.57 EOF