/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, 95 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(empty, l) -> l f(cons(x, k), l) -> g(k, l, cons(x, k)) g(a, b, c) -> f(a, cons(b, c)) 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(empty, l) -> l [1] f(cons(x, k), l) -> g(k, l, cons(x, k)) [1] g(a, b, c) -> f(a, cons(b, c)) [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(empty, l) -> l [1] f(cons(x, k), l) -> g(k, l, cons(x, k)) [1] g(a, b, c) -> f(a, cons(b, c)) [1] The TRS has the following type information: f :: empty:cons -> empty:cons -> empty:cons empty :: empty:cons cons :: empty:cons -> empty:cons -> empty:cons g :: empty:cons -> empty:cons -> empty:cons -> empty:cons 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: none And the following fresh constants: none ---------------------------------------- (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(empty, l) -> l [1] f(cons(x, k), l) -> g(k, l, cons(x, k)) [1] g(a, b, c) -> f(a, cons(b, c)) [1] The TRS has the following type information: f :: empty:cons -> empty:cons -> empty:cons empty :: empty:cons cons :: empty:cons -> empty:cons -> empty:cons g :: empty:cons -> empty:cons -> empty:cons -> empty:cons 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: empty => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: f(z, z') -{ 1 }-> l :|: z' = l, l >= 0, z = 0 f(z, z') -{ 1 }-> g(k, l, 1 + x + k) :|: z' = l, x >= 0, l >= 0, k >= 0, z = 1 + x + k g(z, z', z'') -{ 1 }-> f(a, 1 + b + c) :|: z = a, b >= 0, a >= 0, c >= 0, z' = b, z'' = c 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(V1, V, V6),0,[f(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V6),0,[g(V1, V, V6, Out)],[V1 >= 0,V >= 0,V6 >= 0]). eq(f(V1, V, Out),1,[],[Out = V2,V = V2,V2 >= 0,V1 = 0]). eq(f(V1, V, Out),1,[g(V4, V5, 1 + V3 + V4, Ret)],[Out = Ret,V = V5,V3 >= 0,V5 >= 0,V4 >= 0,V1 = 1 + V3 + V4]). eq(g(V1, V, V6, Out),1,[f(V7, 1 + V9 + V8, Ret1)],[Out = Ret1,V1 = V7,V9 >= 0,V7 >= 0,V8 >= 0,V = V9,V6 = V8]). input_output_vars(f(V1,V,Out),[V1,V],[Out]). input_output_vars(g(V1,V,V6,Out),[V1,V,V6],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [f/3,g/4] 1. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into f/3 1. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations f/3 * CE 4 is refined into CE [5] * CE 3 is refined into CE [6] ### Cost equations --> "Loop" of f/3 * CEs [6] --> Loop 4 * CEs [5] --> Loop 5 ### Ranking functions of CR f(V1,V,Out) * RF of phase [4]: [V1] #### Partial ranking functions of CR f(V1,V,Out) * Partial RF of phase [4]: - RF of loop [4:1]: V1 ### Specialization of cost equations start/3 * CE 1 is refined into CE [7,8] * CE 2 is refined into CE [9,10] ### Cost equations --> "Loop" of start/3 * CEs [8,10] --> Loop 6 * CEs [7,9] --> Loop 7 ### Ranking functions of CR start(V1,V,V6) #### Partial ranking functions of CR start(V1,V,V6) Computing Bounds ===================================== #### Cost of chains of f(V1,V,Out): * Chain [[4],5]: 2*it(4)+1 Such that:it(4) =< V1 with precondition: [V1>=1,V>=0,Out>=V+V1+1] * Chain [5]: 1 with precondition: [V1=0,V=Out,V>=0] #### Cost of chains of start(V1,V,V6): * Chain [7]: 2 with precondition: [V1=0,V>=0] * Chain [6]: 4*s(1)+2 Such that:aux(1) =< V1 s(1) =< aux(1) with precondition: [V1>=1,V>=0] Closed-form bounds of start(V1,V,V6): ------------------------------------- * Chain [7] with precondition: [V1=0,V>=0] - Upper bound: 2 - Complexity: constant * Chain [6] with precondition: [V1>=1,V>=0] - Upper bound: 4*V1+2 - Complexity: n ### Maximum cost of start(V1,V,V6): 4*V1+2 Asymptotic class: n * Total analysis performed in 51 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(empty, l) -> l f(cons(x, k), l) -> g(k, l, cons(x, k)) g(a, b, c) -> f(a, cons(b, c)) 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 g(cons(x1_0, k2_0), b, c) ->^+ g(k2_0, cons(b, c), cons(x1_0, k2_0)) gives rise to a decreasing loop by considering the right hand sides subterm at position []. The pumping substitution is [k2_0 / cons(x1_0, k2_0)]. The result substitution is [b / cons(b, c), c / cons(x1_0, k2_0)]. ---------------------------------------- (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(empty, l) -> l f(cons(x, k), l) -> g(k, l, cons(x, k)) g(a, b, c) -> f(a, cons(b, c)) 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(empty, l) -> l f(cons(x, k), l) -> g(k, l, cons(x, k)) g(a, b, c) -> f(a, cons(b, c)) S is empty. Rewrite Strategy: INNERMOST