/export/starexec/sandbox/solver/bin/starexec_run_rcdcRelativeAlsoLower /export/starexec/sandbox/benchmark/theBenchmark.xml /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(?, O(n^2)) proof of /export/starexec/sandbox/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Derivational Complexity (full) of the given DCpxTrs could be proven to be BOUNDS(1, n^2). (0) DCpxTrs (1) DerivationalComplexityToRuntimeComplexityProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxRelTRS (3) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 172 ms] (4) CpxRelTRS (5) NonCtorToCtorProof [UPPER BOUND(ID), 0 ms] (6) CpxRelTRS (7) RcToIrcProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxRelTRS (9) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (10) CpxWeightedTrs (11) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxTypedWeightedTrs (13) CompletionProof [UPPER BOUND(ID), 0 ms] (14) CpxTypedWeightedCompleteTrs (15) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (16) CpxRNTS (17) CompleteCoflocoProof [FINISHED, 329 ms] (18) BOUNDS(1, n^2) ---------------------------------------- (0) Obligation: The Derivational Complexity (full) of the given DCpxTrs could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: .(.(x, y), z) -> .(x, .(y, z)) S is empty. Rewrite Strategy: FULL ---------------------------------------- (1) DerivationalComplexityToRuntimeComplexityProof (BOTH BOUNDS(ID, ID)) The following rules have been added to S to convert the given derivational complexity problem to a runtime complexity problem: encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) ---------------------------------------- (2) Obligation: The Runtime Complexity (full) of the given CpxRelTRS could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: .(.(x, y), z) -> .(x, .(y, z)) The (relative) TRS S consists of the following rules: encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) Rewrite Strategy: FULL ---------------------------------------- (3) SInnermostTerminationProof (BOTH CONCRETE BOUNDS(ID, ID)) proved innermost termination of relative rules ---------------------------------------- (4) Obligation: The Runtime Complexity (full) of the given CpxRelTRS could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: .(.(x, y), z) -> .(x, .(y, z)) The (relative) TRS S consists of the following rules: encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) Rewrite Strategy: FULL ---------------------------------------- (5) NonCtorToCtorProof (UPPER BOUND(ID)) transformed non-ctor to ctor-system ---------------------------------------- (6) Obligation: The Runtime Complexity (full) of the given CpxRelTRS could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: .(c_.(x, y), z) -> .(x, .(y, z)) The (relative) TRS S consists of the following rules: encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) .(x0, x1) -> c_.(x0, x1) Rewrite Strategy: FULL ---------------------------------------- (7) RcToIrcProof (BOTH BOUNDS(ID, ID)) Converted rc-obligation to irc-obligation. As the TRS is a non-duplicating overlay system, we have rc = irc. ---------------------------------------- (8) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: .(c_.(x, y), z) -> .(x, .(y, z)) The (relative) TRS S consists of the following rules: encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) .(x0, x1) -> c_.(x0, x1) Rewrite Strategy: INNERMOST ---------------------------------------- (9) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (10) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: .(c_.(x, y), z) -> .(x, .(y, z)) [1] encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) [0] encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) [0] .(x0, x1) -> c_.(x0, x1) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (11) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (12) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: .(c_.(x, y), z) -> .(x, .(y, z)) [1] encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) [0] encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) [0] .(x0, x1) -> c_.(x0, x1) [0] The TRS has the following type information: . :: c_. -> c_. -> c_. c_. :: c_. -> c_. -> c_. encArg :: cons_. -> c_. cons_. :: cons_. -> cons_. -> cons_. encode_. :: cons_. -> cons_. -> c_. Rewrite Strategy: INNERMOST ---------------------------------------- (13) 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: encArg(v0) -> null_encArg [0] encode_.(v0, v1) -> null_encode_. [0] .(v0, v1) -> null_. [0] And the following fresh constants: null_encArg, null_encode_., null_., const ---------------------------------------- (14) 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: .(c_.(x, y), z) -> .(x, .(y, z)) [1] encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) [0] encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) [0] .(x0, x1) -> c_.(x0, x1) [0] encArg(v0) -> null_encArg [0] encode_.(v0, v1) -> null_encode_. [0] .(v0, v1) -> null_. [0] The TRS has the following type information: . :: c_.:null_encArg:null_encode_.:null_. -> c_.:null_encArg:null_encode_.:null_. -> c_.:null_encArg:null_encode_.:null_. c_. :: c_.:null_encArg:null_encode_.:null_. -> c_.:null_encArg:null_encode_.:null_. -> c_.:null_encArg:null_encode_.:null_. encArg :: cons_. -> c_.:null_encArg:null_encode_.:null_. cons_. :: cons_. -> cons_. -> cons_. encode_. :: cons_. -> cons_. -> c_.:null_encArg:null_encode_.:null_. null_encArg :: c_.:null_encArg:null_encode_.:null_. null_encode_. :: c_.:null_encArg:null_encode_.:null_. null_. :: c_.:null_encArg:null_encode_.:null_. const :: cons_. Rewrite Strategy: INNERMOST ---------------------------------------- (15) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: null_encArg => 0 null_encode_. => 0 null_. => 0 const => 0 ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: .(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 .(z', z'') -{ 1 }-> .(x, .(y, z)) :|: z'' = z, z >= 0, z' = 1 + x + y, x >= 0, y >= 0 .(z', z'') -{ 0 }-> 1 + x0 + x1 :|: z'' = x1, x0 >= 0, x1 >= 0, z' = x0 encArg(z') -{ 0 }-> 0 :|: v0 >= 0, z' = v0 encArg(z') -{ 0 }-> .(encArg(x_1), encArg(x_2)) :|: x_1 >= 0, x_2 >= 0, z' = 1 + x_1 + x_2 encode_.(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 encode_.(z', z'') -{ 0 }-> .(encArg(x_1), encArg(x_2)) :|: x_1 >= 0, z' = x_1, x_2 >= 0, z'' = x_2 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (17) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V, V2),0,[fun(V, V2, Out)],[V >= 0,V2 >= 0]). eq(start(V, V2),0,[encArg(V, Out)],[V >= 0]). eq(start(V, V2),0,[fun1(V, V2, Out)],[V >= 0,V2 >= 0]). eq(fun(V, V2, Out),1,[fun(V3, V4, Ret1),fun(V1, Ret1, Ret)],[Out = Ret,V2 = V4,V4 >= 0,V = 1 + V1 + V3,V1 >= 0,V3 >= 0]). eq(encArg(V, Out),0,[encArg(V6, Ret0),encArg(V5, Ret11),fun(Ret0, Ret11, Ret2)],[Out = Ret2,V6 >= 0,V5 >= 0,V = 1 + V5 + V6]). eq(fun1(V, V2, Out),0,[encArg(V7, Ret01),encArg(V8, Ret12),fun(Ret01, Ret12, Ret3)],[Out = Ret3,V7 >= 0,V = V7,V8 >= 0,V2 = V8]). eq(fun(V, V2, Out),0,[],[Out = 1 + V10 + V9,V2 = V9,V10 >= 0,V9 >= 0,V = V10]). eq(encArg(V, Out),0,[],[Out = 0,V11 >= 0,V = V11]). eq(fun1(V, V2, Out),0,[],[Out = 0,V13 >= 0,V12 >= 0,V2 = V12,V = V13]). eq(fun(V, V2, Out),0,[],[Out = 0,V15 >= 0,V14 >= 0,V2 = V14,V = V15]). input_output_vars(fun(V,V2,Out),[V,V2],[Out]). input_output_vars(encArg(V,Out),[V],[Out]). input_output_vars(fun1(V,V2,Out),[V,V2],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive [multiple] : [fun/3] 1. recursive [non_tail,multiple] : [encArg/2] 2. non_recursive : [fun1/3] 3. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun/3 1. SCC is partially evaluated into encArg/2 2. SCC is partially evaluated into fun1/3 3. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/3 * CE 5 is refined into CE [11] * CE 6 is refined into CE [12] * CE 4 is refined into CE [13] ### Cost equations --> "Loop" of fun/3 * CEs [13] --> Loop 8 * CEs [11] --> Loop 9 * CEs [12] --> Loop 10 ### Ranking functions of CR fun(V,V2,Out) * RF of phase [8]: [V] #### Partial ranking functions of CR fun(V,V2,Out) * Partial RF of phase [8]: - RF of loop [8:1,8:2]: V ### Specialization of cost equations encArg/2 * CE 8 is refined into CE [14] * CE 7 is refined into CE [15,16,17] ### Cost equations --> "Loop" of encArg/2 * CEs [17] --> Loop 11 * CEs [16] --> Loop 12 * CEs [15] --> Loop 13 * CEs [14] --> Loop 14 ### Ranking functions of CR encArg(V,Out) * RF of phase [11,12,13]: [V] #### Partial ranking functions of CR encArg(V,Out) * Partial RF of phase [11,12,13]: - RF of loop [11:1,11:2,12:1,12:2,13:1,13:2]: V ### Specialization of cost equations fun1/3 * CE 9 is refined into CE [18,19,20,21,22,23,24,25,26,27] * CE 10 is refined into CE [28] ### Cost equations --> "Loop" of fun1/3 * CEs [26,27] --> Loop 15 * CEs [23,24] --> Loop 16 * CEs [21] --> Loop 17 * CEs [19] --> Loop 18 * CEs [18,20,22,25,28] --> Loop 19 ### Ranking functions of CR fun1(V,V2,Out) #### Partial ranking functions of CR fun1(V,V2,Out) ### Specialization of cost equations start/2 * CE 1 is refined into CE [29,30,31] * CE 2 is refined into CE [32,33] * CE 3 is refined into CE [34,35,36,37,38] ### Cost equations --> "Loop" of start/2 * CEs [29,30,31,32,33,34,35,36,37,38] --> Loop 20 ### Ranking functions of CR start(V,V2) #### Partial ranking functions of CR start(V,V2) Computing Bounds ===================================== #### Cost of chains of fun(V,V2,Out): * Chain [10]: 0 with precondition: [Out=0,V>=0,V2>=0] * Chain [9]: 0 with precondition: [V+V2+1=Out,V>=0,V2>=0] * Chain [multiple([8],[[10],[9]])]: 1*it(8)+0 Such that:it(8) =< V with precondition: [V>=1,V2>=0,Out>=0,V+V2+1>=Out] #### Cost of chains of encArg(V,Out): * Chain [14]: 0 with precondition: [Out=0,V>=0] * Chain [multiple([11,12,13],[[14]])]: 1*s(3)+0 Such that:aux(3) =< V aux(4) =< 2*V+1 it(11) =< aux(4) s(3) =< it(11)*aux(3) with precondition: [V>=1,Out>=0,V>=Out] #### Cost of chains of fun1(V,V2,Out): * Chain [19]: 2*s(7)+2*s(11)+0 Such that:aux(5) =< V aux(6) =< 2*V+1 aux(7) =< V2 aux(8) =< 2*V2+1 s(11) =< aux(6)*aux(5) s(7) =< aux(8)*aux(7) with precondition: [Out=0,V>=0,V2>=0] * Chain [18]: 0 with precondition: [Out=1,V>=0,V2>=0] * Chain [17]: 1*s(23)+0 Such that:s(20) =< V2 s(21) =< 2*V2+1 s(23) =< s(21)*s(20) with precondition: [V>=0,V2>=1,Out>=1,V2+1>=Out] * Chain [16]: 2*s(27)+1*s(32)+0 Such that:aux(10) =< V aux(11) =< 2*V+1 s(27) =< aux(11)*aux(10) s(32) =< aux(10) with precondition: [V>=1,V2>=0,Out>=0,V+1>=Out] * Chain [15]: 2*s(36)+2*s(40)+1*s(49)+0 Such that:aux(13) =< V aux(14) =< 2*V+1 aux(15) =< V2 aux(16) =< 2*V2+1 s(40) =< aux(16)*aux(15) s(36) =< aux(14)*aux(13) s(49) =< aux(13) with precondition: [V>=1,V2>=1,Out>=0,V+V2+1>=Out] #### Cost of chains of start(V,V2): * Chain [20]: 3*s(50)+7*s(54)+5*s(60)+0 Such that:aux(17) =< V aux(18) =< 2*V+1 aux(19) =< V2 aux(20) =< 2*V2+1 s(50) =< aux(17) s(54) =< aux(18)*aux(17) s(60) =< aux(20)*aux(19) with precondition: [V>=0] Closed-form bounds of start(V,V2): ------------------------------------- * Chain [20] with precondition: [V>=0] - Upper bound: (2*V+1)*(7*V)+3*V+nat(V2)*5*nat(2*V2+1) - Complexity: n^2 ### Maximum cost of start(V,V2): (2*V+1)*(7*V)+3*V+nat(V2)*5*nat(2*V2+1) Asymptotic class: n^2 * Total analysis performed in 260 ms. ---------------------------------------- (18) BOUNDS(1, n^2)