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