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