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