/export/starexec/sandbox/solver/bin/starexec_run_rcdcRelativeAlsoLower /export/starexec/sandbox/benchmark/theBenchmark.xml /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(?, O(n^1)) 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^1). (0) DCpxTrs (1) DerivationalComplexityToRuntimeComplexityProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxRelTRS (3) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 158 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, 413 ms] (18) BOUNDS(1, n^1) ---------------------------------------- (0) Obligation: The Derivational Complexity (full) of the given DCpxTrs could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: f(a, f(a, f(b, f(a, f(a, f(b, f(a, x))))))) -> f(a, f(b, f(a, f(a, f(b, f(a, f(a, f(a, f(b, x))))))))) 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(a) -> a encArg(b) -> b encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) encode_a -> a encode_b -> b ---------------------------------------- (2) Obligation: The Runtime Complexity (full) of the given CpxRelTRS could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: f(a, f(a, f(b, f(a, f(a, f(b, f(a, x))))))) -> f(a, f(b, f(a, f(a, f(b, f(a, f(a, f(a, f(b, x))))))))) The (relative) TRS S consists of the following rules: encArg(a) -> a encArg(b) -> b encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) encode_a -> a encode_b -> b 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^1). The TRS R consists of the following rules: f(a, f(a, f(b, f(a, f(a, f(b, f(a, x))))))) -> f(a, f(b, f(a, f(a, f(b, f(a, f(a, f(a, f(b, x))))))))) The (relative) TRS S consists of the following rules: encArg(a) -> a encArg(b) -> b encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) encode_a -> a encode_b -> b 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^1). The TRS R consists of the following rules: f(a, c_f(a, c_f(b, c_f(a, c_f(a, c_f(b, c_f(a, x))))))) -> f(a, f(b, f(a, f(a, f(b, f(a, f(a, f(a, f(b, x))))))))) The (relative) TRS S consists of the following rules: encArg(a) -> a encArg(b) -> b encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) encode_a -> a encode_b -> b f(x0, x1) -> c_f(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^1). The TRS R consists of the following rules: f(a, c_f(a, c_f(b, c_f(a, c_f(a, c_f(b, c_f(a, x))))))) -> f(a, f(b, f(a, f(a, f(b, f(a, f(a, f(a, f(b, x))))))))) The (relative) TRS S consists of the following rules: encArg(a) -> a encArg(b) -> b encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) encode_a -> a encode_b -> b f(x0, x1) -> c_f(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^1). The TRS R consists of the following rules: f(a, c_f(a, c_f(b, c_f(a, c_f(a, c_f(b, c_f(a, x))))))) -> f(a, f(b, f(a, f(a, f(b, f(a, f(a, f(a, f(b, x))))))))) [1] encArg(a) -> a [0] encArg(b) -> b [0] encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) [0] encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) [0] encode_a -> a [0] encode_b -> b [0] f(x0, x1) -> c_f(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: f(a, c_f(a, c_f(b, c_f(a, c_f(a, c_f(b, c_f(a, x))))))) -> f(a, f(b, f(a, f(a, f(b, f(a, f(a, f(a, f(b, x))))))))) [1] encArg(a) -> a [0] encArg(b) -> b [0] encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) [0] encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) [0] encode_a -> a [0] encode_b -> b [0] f(x0, x1) -> c_f(x0, x1) [0] The TRS has the following type information: f :: a:b:c_f:cons_f -> a:b:c_f:cons_f -> a:b:c_f:cons_f a :: a:b:c_f:cons_f c_f :: a:b:c_f:cons_f -> a:b:c_f:cons_f -> a:b:c_f:cons_f b :: a:b:c_f:cons_f encArg :: a:b:c_f:cons_f -> a:b:c_f:cons_f cons_f :: a:b:c_f:cons_f -> a:b:c_f:cons_f -> a:b:c_f:cons_f encode_f :: a:b:c_f:cons_f -> a:b:c_f:cons_f -> a:b:c_f:cons_f encode_a :: a:b:c_f:cons_f encode_b :: a:b:c_f:cons_f 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_f(v0, v1) -> null_encode_f [0] encode_a -> null_encode_a [0] encode_b -> null_encode_b [0] f(v0, v1) -> null_f [0] And the following fresh constants: null_encArg, null_encode_f, null_encode_a, null_encode_b, null_f ---------------------------------------- (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: f(a, c_f(a, c_f(b, c_f(a, c_f(a, c_f(b, c_f(a, x))))))) -> f(a, f(b, f(a, f(a, f(b, f(a, f(a, f(a, f(b, x))))))))) [1] encArg(a) -> a [0] encArg(b) -> b [0] encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) [0] encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) [0] encode_a -> a [0] encode_b -> b [0] f(x0, x1) -> c_f(x0, x1) [0] encArg(v0) -> null_encArg [0] encode_f(v0, v1) -> null_encode_f [0] encode_a -> null_encode_a [0] encode_b -> null_encode_b [0] f(v0, v1) -> null_f [0] The TRS has the following type information: f :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f -> a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f -> a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f a :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f c_f :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f -> a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f -> a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f b :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f encArg :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f -> a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f cons_f :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f -> a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f -> a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f encode_f :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f -> a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f -> a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f encode_a :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f encode_b :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f null_encArg :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f null_encode_f :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f null_encode_a :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f null_encode_b :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f null_f :: a:b:c_f:cons_f:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_f 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: a => 0 b => 1 null_encArg => 0 null_encode_f => 0 null_encode_a => 0 null_encode_b => 0 null_f => 0 ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: encArg(z) -{ 0 }-> f(encArg(x_1), encArg(x_2)) :|: x_1 >= 0, z = 1 + x_1 + x_2, x_2 >= 0 encArg(z) -{ 0 }-> 1 :|: z = 1 encArg(z) -{ 0 }-> 0 :|: z = 0 encArg(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 encode_a -{ 0 }-> 0 :|: encode_b -{ 0 }-> 1 :|: encode_b -{ 0 }-> 0 :|: encode_f(z, z') -{ 0 }-> f(encArg(x_1), encArg(x_2)) :|: x_1 >= 0, x_2 >= 0, z = x_1, z' = x_2 encode_f(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 f(z, z') -{ 1 }-> f(0, f(1, f(0, f(0, f(1, f(0, f(0, f(0, f(1, x))))))))) :|: z' = 1 + 0 + (1 + 1 + (1 + 0 + (1 + 0 + (1 + 1 + (1 + 0 + x))))), x >= 0, z = 0 f(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 f(z, z') -{ 0 }-> 1 + x0 + x1 :|: z = x0, x0 >= 0, x1 >= 0, z' = x1 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(V1, V),0,[f(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[encArg(V1, Out)],[V1 >= 0]). eq(start(V1, V),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[fun1(Out)],[]). eq(start(V1, V),0,[fun2(Out)],[]). eq(f(V1, V, Out),1,[f(1, V2, Ret11111111),f(0, Ret11111111, Ret1111111),f(0, Ret1111111, Ret111111),f(0, Ret111111, Ret11111),f(1, Ret11111, Ret1111),f(0, Ret1111, Ret111),f(0, Ret111, Ret11),f(1, Ret11, Ret1),f(0, Ret1, Ret)],[Out = Ret,V = 8 + V2,V2 >= 0,V1 = 0]). eq(encArg(V1, Out),0,[],[Out = 0,V1 = 0]). eq(encArg(V1, Out),0,[],[Out = 1,V1 = 1]). eq(encArg(V1, Out),0,[encArg(V4, Ret0),encArg(V3, Ret12),f(Ret0, Ret12, Ret2)],[Out = Ret2,V4 >= 0,V1 = 1 + V3 + V4,V3 >= 0]). eq(fun(V1, V, Out),0,[encArg(V5, Ret01),encArg(V6, Ret13),f(Ret01, Ret13, Ret3)],[Out = Ret3,V5 >= 0,V6 >= 0,V1 = V5,V = V6]). eq(fun1(Out),0,[],[Out = 0]). eq(fun2(Out),0,[],[Out = 1]). eq(f(V1, V, Out),0,[],[Out = 1 + V7 + V8,V1 = V8,V8 >= 0,V7 >= 0,V = V7]). eq(encArg(V1, Out),0,[],[Out = 0,V9 >= 0,V1 = V9]). eq(fun(V1, V, Out),0,[],[Out = 0,V11 >= 0,V10 >= 0,V1 = V11,V = V10]). eq(fun2(Out),0,[],[Out = 0]). eq(f(V1, V, Out),0,[],[Out = 0,V13 >= 0,V12 >= 0,V1 = V13,V = V12]). input_output_vars(f(V1,V,Out),[V1,V],[Out]). input_output_vars(encArg(V1,Out),[V1],[Out]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(Out),[],[Out]). input_output_vars(fun2(Out),[],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive [multiple] : [f/3] 1. recursive [non_tail,multiple] : [encArg/2] 2. non_recursive : [fun/3] 3. non_recursive : [fun1/1] 4. non_recursive : [fun2/1] 5. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into f/3 1. SCC is partially evaluated into encArg/2 2. SCC is partially evaluated into fun/3 3. SCC is completely evaluated into other SCCs 4. SCC is partially evaluated into fun2/1 5. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations f/3 * CE 7 is refined into CE [16] * CE 8 is refined into CE [17] * CE 6 is refined into CE [18] ### Cost equations --> "Loop" of f/3 * CEs [18] --> Loop 11 * CEs [16] --> Loop 12 * CEs [17] --> Loop 13 ### Ranking functions of CR f(V1,V,Out) #### Partial ranking functions of CR f(V1,V,Out) * Partial RF of phase [11]: - RF of loop [11:1]: V/8-7/8 depends on loops [11:2,11:3,11:4,11:5,11:6,11:7,11:8,11:9] - RF of loop [11:1,11:5,11:8]: -V1+1 ### Specialization of cost equations encArg/2 * CE 9 is refined into CE [19] * CE 10 is refined into CE [20] * CE 11 is refined into CE [21,22,23] ### Cost equations --> "Loop" of encArg/2 * CEs [23] --> Loop 14 * CEs [22] --> Loop 15 * CEs [21] --> Loop 16 * CEs [19] --> Loop 17 * CEs [20] --> Loop 18 ### Ranking functions of CR encArg(V1,Out) * RF of phase [14,15,16]: [V1] #### Partial ranking functions of CR encArg(V1,Out) * Partial RF of phase [14,15,16]: - RF of loop [14:1,14:2,15:1,15:2,16:1,16:2]: V1 ### Specialization of cost equations fun/3 * CE 12 is refined into CE [24,25,26,27,28,29,30,31,32,33] * CE 13 is refined into CE [34] ### Cost equations --> "Loop" of fun/3 * CEs [28] --> Loop 19 * CEs [25,30] --> Loop 20 * CEs [33] --> Loop 21 * CEs [24,27,29,32,34] --> Loop 22 * CEs [26,31] --> Loop 23 ### Ranking functions of CR fun(V1,V,Out) #### Partial ranking functions of CR fun(V1,V,Out) ### Specialization of cost equations fun2/1 * CE 14 is refined into CE [35] * CE 15 is refined into CE [36] ### Cost equations --> "Loop" of fun2/1 * CEs [35] --> Loop 24 * CEs [36] --> Loop 25 ### Ranking functions of CR fun2(Out) #### Partial ranking functions of CR fun2(Out) ### Specialization of cost equations start/2 * CE 1 is refined into CE [37,38,39] * CE 2 is refined into CE [40,41] * CE 3 is refined into CE [42,43,44,45,46] * CE 4 is refined into CE [47] * CE 5 is refined into CE [48,49] ### Cost equations --> "Loop" of start/2 * CEs [37,38,40,41,42,43,44,45,47,48,49] --> Loop 26 * CEs [39,46] --> Loop 27 ### Ranking functions of CR start(V1,V) #### Partial ranking functions of CR start(V1,V) Computing Bounds ===================================== #### Cost of chains of f(V1,V,Out): * Chain [multiple([11],[[],[13],[12]])]...: 1*it(11)+0 Such that:it(11) =< -3*V1+1 with precondition: [V1=0,V>=8] * Chain [13]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [12]: 0 with precondition: [V+V1+1=Out,V1>=0,V>=0] #### Cost of chains of encArg(V1,Out): * Chain [18]: 0 with precondition: [V1=1,Out=1] * Chain [17]: 0 with precondition: [Out=0,V1>=0] * Chain [multiple([14,15,16],[[18],[17]])]: 1*s(3)+0 Such that:aux(3) =< V1 s(3) =< aux(3) with precondition: [V1>=1] #### Cost of chains of fun(V1,V,Out): * Chain [23]...: 1*s(7)+2*s(9)+2*s(10)+0 Such that:s(6) =< V1 aux(5) =< 1 aux(6) =< V s(10) =< aux(5) s(9) =< aux(6) s(7) =< s(6) with precondition: [V1>=0,V>=1] * Chain [22]: 2*s(15)+2*s(17)+0 Such that:aux(7) =< V1 aux(8) =< V s(17) =< aux(8) s(15) =< aux(7) with precondition: [Out=0,V1>=0,V>=0] * Chain [21]: 0 with precondition: [Out=1,V1>=0,V>=0] * Chain [20]: 1*s(23)+2*s(25)+0 Such that:s(22) =< V1 aux(9) =< V s(25) =< aux(9) s(23) =< s(22) with precondition: [V1>=0,V>=1,Out>=1] * Chain [19]: 1*s(29)+0 Such that:s(28) =< V1 s(29) =< s(28) with precondition: [V1>=1,V>=0,Out>=1] #### Cost of chains of fun2(Out): * Chain [25]: 0 with precondition: [Out=0] * Chain [24]: 0 with precondition: [Out=1] #### Cost of chains of start(V1,V): * Chain [27]...: 3*s(30)+2*s(35)+1*s(36)+0 Such that:s(31) =< V1 s(33) =< V aux(10) =< 1 s(30) =< aux(10) s(35) =< s(33) s(36) =< s(31) with precondition: [V1>=0,V>=1] * Chain [26]: 5*s(38)+4*s(41)+0 Such that:aux(11) =< V1 aux(12) =< V s(38) =< aux(11) s(41) =< aux(12) with precondition: [] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [27]... with precondition: [V1>=0,V>=1] - Upper bound: V1+2*V+3 - Complexity: n * Chain [26] with precondition: [] - Upper bound: nat(V)*4+nat(V1)*5 - Complexity: n ### Maximum cost of start(V1,V): nat(V)*2+nat(V1)+max([3,nat(V)*2+nat(V1)*4]) Asymptotic class: n * Total analysis performed in 338 ms. ---------------------------------------- (18) BOUNDS(1, n^1)