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