/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, 187 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: from(X) -> cons(X, n__from(s(X))) sel(0, cons(X, Y)) -> X sel(s(X), cons(Y, Z)) -> sel(X, activate(Z)) from(X) -> n__from(X) activate(n__from(X)) -> from(X) activate(X) -> X 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: from(X) -> cons(X, n__from(s(X))) [1] sel(0, cons(X, Y)) -> X [1] sel(s(X), cons(Y, Z)) -> sel(X, activate(Z)) [1] from(X) -> n__from(X) [1] activate(n__from(X)) -> from(X) [1] activate(X) -> X [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: from(X) -> cons(X, n__from(s(X))) [1] sel(0, cons(X, Y)) -> X [1] sel(s(X), cons(Y, Z)) -> sel(X, activate(Z)) [1] from(X) -> n__from(X) [1] activate(n__from(X)) -> from(X) [1] activate(X) -> X [1] The TRS has the following type information: from :: s:0 -> n__from:cons cons :: s:0 -> n__from:cons -> n__from:cons n__from :: s:0 -> n__from:cons s :: s:0 -> s:0 sel :: s:0 -> n__from:cons -> s:0 0 :: s:0 activate :: n__from:cons -> n__from: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: sel(v0, v1) -> null_sel [0] And the following fresh constants: null_sel, const ---------------------------------------- (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: from(X) -> cons(X, n__from(s(X))) [1] sel(0, cons(X, Y)) -> X [1] sel(s(X), cons(Y, Z)) -> sel(X, activate(Z)) [1] from(X) -> n__from(X) [1] activate(n__from(X)) -> from(X) [1] activate(X) -> X [1] sel(v0, v1) -> null_sel [0] The TRS has the following type information: from :: s:0:null_sel -> n__from:cons cons :: s:0:null_sel -> n__from:cons -> n__from:cons n__from :: s:0:null_sel -> n__from:cons s :: s:0:null_sel -> s:0:null_sel sel :: s:0:null_sel -> n__from:cons -> s:0:null_sel 0 :: s:0:null_sel activate :: n__from:cons -> n__from:cons null_sel :: s:0:null_sel const :: n__from: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: 0 => 0 null_sel => 0 const => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: activate(z) -{ 1 }-> X :|: X >= 0, z = X activate(z) -{ 1 }-> from(X) :|: z = 1 + X, X >= 0 from(z) -{ 1 }-> 1 + X :|: X >= 0, z = X from(z) -{ 1 }-> 1 + X + (1 + (1 + X)) :|: X >= 0, z = X sel(z, z') -{ 1 }-> X :|: Y >= 0, X >= 0, z' = 1 + X + Y, z = 0 sel(z, z') -{ 1 }-> sel(X, activate(Z)) :|: Z >= 0, z = 1 + X, Y >= 0, X >= 0, z' = 1 + Y + Z sel(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 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),0,[from(V, Out)],[V >= 0]). eq(start(V, V1),0,[sel(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1),0,[activate(V, Out)],[V >= 0]). eq(from(V, Out),1,[],[Out = 3 + 2*X1,X1 >= 0,V = X1]). eq(sel(V, V1, Out),1,[],[Out = X2,Y1 >= 0,X2 >= 0,V1 = 1 + X2 + Y1,V = 0]). eq(sel(V, V1, Out),1,[activate(Z1, Ret1),sel(X3, Ret1, Ret)],[Out = Ret,Z1 >= 0,V = 1 + X3,Y2 >= 0,X3 >= 0,V1 = 1 + Y2 + Z1]). eq(from(V, Out),1,[],[Out = 1 + X4,X4 >= 0,V = X4]). eq(activate(V, Out),1,[from(X5, Ret2)],[Out = Ret2,V = 1 + X5,X5 >= 0]). eq(activate(V, Out),1,[],[Out = X6,X6 >= 0,V = X6]). eq(sel(V, V1, Out),0,[],[Out = 0,V3 >= 0,V2 >= 0,V = V3,V1 = V2]). input_output_vars(from(V,Out),[V],[Out]). input_output_vars(sel(V,V1,Out),[V,V1],[Out]). input_output_vars(activate(V,Out),[V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. non_recursive : [from/2] 1. non_recursive : [activate/2] 2. recursive : [sel/3] 3. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into from/2 1. SCC is partially evaluated into activate/2 2. SCC is partially evaluated into sel/3 3. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations from/2 * CE 4 is refined into CE [11] * CE 5 is refined into CE [12] ### Cost equations --> "Loop" of from/2 * CEs [11] --> Loop 9 * CEs [12] --> Loop 10 ### Ranking functions of CR from(V,Out) #### Partial ranking functions of CR from(V,Out) ### Specialization of cost equations activate/2 * CE 9 is refined into CE [13,14] * CE 10 is refined into CE [15] ### Cost equations --> "Loop" of activate/2 * CEs [14] --> Loop 11 * CEs [13,15] --> Loop 12 ### Ranking functions of CR activate(V,Out) #### Partial ranking functions of CR activate(V,Out) ### Specialization of cost equations sel/3 * CE 8 is refined into CE [16] * CE 6 is refined into CE [17] * CE 7 is refined into CE [18,19] ### Cost equations --> "Loop" of sel/3 * CEs [19] --> Loop 13 * CEs [18] --> Loop 14 * CEs [16] --> Loop 15 * CEs [17] --> Loop 16 ### Ranking functions of CR sel(V,V1,Out) * RF of phase [13,14]: [V] #### Partial ranking functions of CR sel(V,V1,Out) * Partial RF of phase [13,14]: - RF of loop [13:1,14:1]: V - RF of loop [14:1]: V1 depends on loops [13:1] ### Specialization of cost equations start/2 * CE 1 is refined into CE [20,21] * CE 2 is refined into CE [22,23,24] * CE 3 is refined into CE [25,26] ### Cost equations --> "Loop" of start/2 * CEs [20,21,22,23,24,25,26] --> Loop 17 ### Ranking functions of CR start(V,V1) #### Partial ranking functions of CR start(V,V1) Computing Bounds ===================================== #### Cost of chains of from(V,Out): * Chain [10]: 1 with precondition: [V+1=Out,V>=0] * Chain [9]: 1 with precondition: [2*V+3=Out,V>=0] #### Cost of chains of activate(V,Out): * Chain [12]: 2 with precondition: [V=Out,V>=0] * Chain [11]: 2 with precondition: [2*V+1=Out,V>=1] #### Cost of chains of sel(V,V1,Out): * Chain [[13,14],16]: 6*it(13)+1 Such that:aux(9) =< V it(13) =< aux(9) with precondition: [V>=1,V1>=2,Out>=0] * Chain [[13,14],15]: 6*it(13)+0 Such that:aux(10) =< V it(13) =< aux(10) with precondition: [Out=0,V>=1,V1>=1] * Chain [16]: 1 with precondition: [V=0,Out>=0,V1>=Out+1] * Chain [15]: 0 with precondition: [Out=0,V>=0,V1>=0] #### Cost of chains of start(V,V1): * Chain [17]: 12*s(4)+2 Such that:aux(11) =< V s(4) =< aux(11) with precondition: [V>=0] Closed-form bounds of start(V,V1): ------------------------------------- * Chain [17] with precondition: [V>=0] - Upper bound: 12*V+2 - Complexity: n ### Maximum cost of start(V,V1): 12*V+2 Asymptotic class: n * Total analysis performed in 106 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: from(X) -> cons(X, n__from(s(X))) sel(0, cons(X, Y)) -> X sel(s(X), cons(Y, Z)) -> sel(X, activate(Z)) from(X) -> n__from(X) activate(n__from(X)) -> from(X) activate(X) -> X 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 sel(s(X), cons(Y, Z)) ->^+ sel(X, Z) gives rise to a decreasing loop by considering the right hand sides subterm at position []. The pumping substitution is [X / s(X), Z / cons(Y, Z)]. The result substitution is [ ]. ---------------------------------------- (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: from(X) -> cons(X, n__from(s(X))) sel(0, cons(X, Y)) -> X sel(s(X), cons(Y, Z)) -> sel(X, activate(Z)) from(X) -> n__from(X) activate(n__from(X)) -> from(X) activate(X) -> X 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: from(X) -> cons(X, n__from(s(X))) sel(0, cons(X, Y)) -> X sel(s(X), cons(Y, Z)) -> sel(X, activate(Z)) from(X) -> n__from(X) activate(n__from(X)) -> from(X) activate(X) -> X S is empty. Rewrite Strategy: INNERMOST