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