/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), 168 ms] (4) CpxRelTRS (5) RcToIrcProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CpxRelTRS (7) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxWeightedTrs (9) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (10) CpxTypedWeightedTrs (11) CompletionProof [UPPER BOUND(ID), 0 ms] (12) CpxTypedWeightedCompleteTrs (13) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (14) CpxRNTS (15) CompleteCoflocoProof [FINISHED, 222 ms] (16) 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(x, x) -> f(a, b) b -> c 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(c) -> c encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) encArg(cons_b) -> b encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) encode_a -> a encode_b -> b encode_c -> c ---------------------------------------- (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(x, x) -> f(a, b) b -> c The (relative) TRS S consists of the following rules: encArg(a) -> a encArg(c) -> c encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) encArg(cons_b) -> b encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) encode_a -> a encode_b -> b encode_c -> c 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(x, x) -> f(a, b) b -> c The (relative) TRS S consists of the following rules: encArg(a) -> a encArg(c) -> c encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) encArg(cons_b) -> b encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) encode_a -> a encode_b -> b encode_c -> c Rewrite Strategy: FULL ---------------------------------------- (5) RcToIrcProof (BOTH BOUNDS(ID, ID)) Converted rc-obligation to irc-obligation. As the TRS is a non-duplicating overlay system, we have rc = irc. ---------------------------------------- (6) 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(x, x) -> f(a, b) b -> c The (relative) TRS S consists of the following rules: encArg(a) -> a encArg(c) -> c encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) encArg(cons_b) -> b encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) encode_a -> a encode_b -> b encode_c -> c Rewrite Strategy: INNERMOST ---------------------------------------- (7) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (8) 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(x, x) -> f(a, b) [1] b -> c [1] encArg(a) -> a [0] encArg(c) -> c [0] encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) [0] encArg(cons_b) -> b [0] encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) [0] encode_a -> a [0] encode_b -> b [0] encode_c -> c [0] Rewrite Strategy: INNERMOST ---------------------------------------- (9) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (10) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: f(x, x) -> f(a, b) [1] b -> c [1] encArg(a) -> a [0] encArg(c) -> c [0] encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) [0] encArg(cons_b) -> b [0] encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) [0] encode_a -> a [0] encode_b -> b [0] encode_c -> c [0] The TRS has the following type information: f :: a:c:cons_f:cons_b -> a:c:cons_f:cons_b -> a:c:cons_f:cons_b a :: a:c:cons_f:cons_b b :: a:c:cons_f:cons_b c :: a:c:cons_f:cons_b encArg :: a:c:cons_f:cons_b -> a:c:cons_f:cons_b cons_f :: a:c:cons_f:cons_b -> a:c:cons_f:cons_b -> a:c:cons_f:cons_b cons_b :: a:c:cons_f:cons_b encode_f :: a:c:cons_f:cons_b -> a:c:cons_f:cons_b -> a:c:cons_f:cons_b encode_a :: a:c:cons_f:cons_b encode_b :: a:c:cons_f:cons_b encode_c :: a:c:cons_f:cons_b Rewrite Strategy: INNERMOST ---------------------------------------- (11) 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] encode_c -> null_encode_c [0] f(v0, v1) -> null_f [0] And the following fresh constants: null_encArg, null_encode_f, null_encode_a, null_encode_b, null_encode_c, null_f ---------------------------------------- (12) 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(x, x) -> f(a, b) [1] b -> c [1] encArg(a) -> a [0] encArg(c) -> c [0] encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) [0] encArg(cons_b) -> b [0] encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) [0] encode_a -> a [0] encode_b -> b [0] encode_c -> c [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] encode_c -> null_encode_c [0] f(v0, v1) -> null_f [0] The TRS has the following type information: f :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f -> a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f -> a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f a :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f b :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f c :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f encArg :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f -> a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f cons_f :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f -> a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f -> a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f cons_b :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f encode_f :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f -> a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f -> a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f encode_a :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f encode_b :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f encode_c :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f null_encArg :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f null_encode_f :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f null_encode_a :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f null_encode_b :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f null_encode_c :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f null_f :: a:c:cons_f:cons_b:null_encArg:null_encode_f:null_encode_a:null_encode_b:null_encode_c:null_f Rewrite Strategy: INNERMOST ---------------------------------------- (13) 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 c => 1 cons_b => 2 null_encArg => 0 null_encode_f => 0 null_encode_a => 0 null_encode_b => 0 null_encode_c => 0 null_f => 0 ---------------------------------------- (14) Obligation: Complexity RNTS consisting of the following rules: b -{ 1 }-> 1 :|: 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 }-> b :|: z = 2 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 }-> b :|: encode_b -{ 0 }-> 0 :|: encode_c -{ 0 }-> 1 :|: encode_c -{ 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, b) :|: z' = x, x >= 0, z = x f(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (15) 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,[b(Out)],[]). 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(start(V1, V),0,[fun3(Out)],[]). eq(f(V1, V, Out),1,[b(Ret1),f(0, Ret1, Ret)],[Out = Ret,V = V2,V2 >= 0,V1 = V2]). eq(b(Out),1,[],[Out = 1]). 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, Ret11),f(Ret0, Ret11, Ret2)],[Out = Ret2,V4 >= 0,V1 = 1 + V3 + V4,V3 >= 0]). eq(encArg(V1, Out),0,[b(Ret3)],[Out = Ret3,V1 = 2]). eq(fun(V1, V, Out),0,[encArg(V5, Ret01),encArg(V6, Ret12),f(Ret01, Ret12, Ret4)],[Out = Ret4,V5 >= 0,V6 >= 0,V1 = V5,V = V6]). eq(fun1(Out),0,[],[Out = 0]). eq(fun2(Out),0,[b(Ret5)],[Out = Ret5]). eq(fun3(Out),0,[],[Out = 1]). eq(encArg(V1, Out),0,[],[Out = 0,V7 >= 0,V1 = V7]). eq(fun(V1, V, Out),0,[],[Out = 0,V9 >= 0,V8 >= 0,V1 = V9,V = V8]). eq(fun2(Out),0,[],[Out = 0]). eq(fun3(Out),0,[],[Out = 0]). eq(f(V1, V, Out),0,[],[Out = 0,V11 >= 0,V10 >= 0,V1 = V11,V = V10]). input_output_vars(f(V1,V,Out),[V1,V],[Out]). input_output_vars(b(Out),[],[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]). input_output_vars(fun3(Out),[],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. non_recursive : [b/1] 1. recursive : [f/3] 2. recursive [non_tail,multiple] : [encArg/2] 3. non_recursive : [fun/3] 4. non_recursive : [fun1/1] 5. non_recursive : [fun2/1] 6. non_recursive : [fun3/1] 7. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is completely evaluated into other SCCs 1. SCC is partially evaluated into f/3 2. SCC is partially evaluated into encArg/2 3. SCC is partially evaluated into fun/3 4. SCC is completely evaluated into other SCCs 5. SCC is partially evaluated into fun2/1 6. SCC is partially evaluated into fun3/1 7. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations f/3 * CE 9 is refined into CE [20] * CE 8 is refined into CE [21] ### Cost equations --> "Loop" of f/3 * CEs [21] --> Loop 13 * CEs [20] --> Loop 14 ### Ranking functions of CR f(V1,V,Out) #### Partial ranking functions of CR f(V1,V,Out) ### Specialization of cost equations encArg/2 * CE 10 is refined into CE [22] * CE 13 is refined into CE [23] * CE 11 is refined into CE [24] * CE 12 is refined into CE [25] ### Cost equations --> "Loop" of encArg/2 * CEs [25] --> Loop 15 * CEs [22] --> Loop 16 * CEs [23] --> Loop 17 * CEs [24] --> Loop 18 ### Ranking functions of CR encArg(V1,Out) * RF of phase [15]: [V1] #### Partial ranking functions of CR encArg(V1,Out) * Partial RF of phase [15]: - RF of loop [15:1,15:2]: V1 ### Specialization of cost equations fun/3 * CE 14 is refined into CE [26,27,28,29,30,31,32,33,34] * CE 15 is refined into CE [35] ### Cost equations --> "Loop" of fun/3 * CEs [32] --> Loop 19 * CEs [30] --> Loop 20 * CEs [29,31] --> Loop 21 * CEs [27,33] --> Loop 22 * CEs [26,28,34,35] --> 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 16 is refined into CE [36] * CE 17 is refined into CE [37] ### Cost equations --> "Loop" of fun2/1 * CEs [36] --> Loop 24 * CEs [37] --> Loop 25 ### Ranking functions of CR fun2(Out) #### Partial ranking functions of CR fun2(Out) ### Specialization of cost equations fun3/1 * CE 18 is refined into CE [38] * CE 19 is refined into CE [39] ### Cost equations --> "Loop" of fun3/1 * CEs [38] --> Loop 26 * CEs [39] --> Loop 27 ### Ranking functions of CR fun3(Out) #### Partial ranking functions of CR fun3(Out) ### Specialization of cost equations start/2 * CE 1 is refined into CE [40] * CE 2 is refined into CE [41] * CE 3 is refined into CE [42,43,44] * CE 4 is refined into CE [45,46,47] * CE 5 is refined into CE [48] * CE 6 is refined into CE [49,50] * CE 7 is refined into CE [51,52] ### Cost equations --> "Loop" of start/2 * CEs [40,41,42,43,44,45,46,47,48,49,50,51,52] --> Loop 28 ### 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 [14]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [13,14]: 2 with precondition: [Out=0,V1=V,V1>=0] #### Cost of chains of encArg(V1,Out): * Chain [18]: 0 with precondition: [V1=1,Out=1] * Chain [17]: 1 with precondition: [V1=2,Out=1] * Chain [16]: 0 with precondition: [Out=0,V1>=0] * Chain [multiple([15],[[18],[17],[16]])]: 2*it(15)+1*it([17])+0 Such that:it([17]) =< V1/3+1/3 aux(1) =< V1 aux(2) =< V1+1 it(15) =< aux(1) it([17]) =< aux(1) it([17]) =< aux(2) with precondition: [Out=0,V1>=1] #### Cost of chains of fun(V1,V,Out): * Chain [23]: 2*s(7)+4*s(8)+1*s(11)+2*s(12)+2 Such that:s(9) =< V1 s(10) =< V1+1 s(11) =< V1/3+1/3 aux(3) =< V aux(4) =< V+1 aux(5) =< V/3+1/3 s(7) =< aux(5) s(8) =< aux(3) s(7) =< aux(3) s(7) =< aux(4) s(12) =< s(9) s(11) =< s(9) s(11) =< s(10) with precondition: [Out=0,V1>=0,V>=0] * Chain [22]: 1*s(19)+2*s(20)+3 Such that:s(17) =< V1 s(18) =< V1+1 s(19) =< V1/3+1/3 s(20) =< s(17) s(19) =< s(17) s(19) =< s(18) with precondition: [V=2,Out=0,V1>=0] * Chain [21]: 1*s(23)+2*s(24)+3 Such that:s(21) =< V s(22) =< V+1 s(23) =< V/3+1/3 s(24) =< s(21) s(23) =< s(21) s(23) =< s(22) with precondition: [V1=2,Out=0,V>=0] * Chain [20]: 4 with precondition: [V1=2,V=2,Out=0] * Chain [19]: 1*s(27)+2*s(28)+2 Such that:s(25) =< V1 s(26) =< V1+1 s(27) =< V1/3+1/3 s(28) =< s(25) s(27) =< s(25) s(27) =< s(26) with precondition: [V=1,Out=0,V1>=0] #### Cost of chains of fun2(Out): * Chain [25]: 0 with precondition: [Out=0] * Chain [24]: 1 with precondition: [Out=1] #### Cost of chains of fun3(Out): * Chain [27]: 0 with precondition: [Out=0] * Chain [26]: 0 with precondition: [Out=1] #### Cost of chains of start(V1,V): * Chain [28]: 4*s(44)+8*s(45)+3*s(52)+6*s(53)+4 Such that:s(49) =< V s(50) =< V+1 s(51) =< V/3+1/3 aux(9) =< V1 aux(10) =< V1+1 aux(11) =< V1/3+1/3 s(44) =< aux(11) s(45) =< aux(9) s(44) =< aux(9) s(44) =< aux(10) s(52) =< s(51) s(53) =< s(49) s(52) =< s(49) s(52) =< s(50) with precondition: [] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [28] with precondition: [] - Upper bound: nat(V1)*8+4+nat(V)*6+nat(V1/3+1/3)*4+nat(V/3+1/3)*3 - Complexity: n ### Maximum cost of start(V1,V): nat(V1)*8+4+nat(V)*6+nat(V1/3+1/3)*4+nat(V/3+1/3)*3 Asymptotic class: n * Total analysis performed in 167 ms. ---------------------------------------- (16) BOUNDS(1, n^1)