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