/export/starexec/sandbox2/solver/bin/starexec_run_rcdcRelativeAlsoLower /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(?, O(n^1)) proof of /export/starexec/sandbox2/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), 150 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, 212 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(g(x), x) g(x) -> s(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(s(x_1)) -> s(encArg(x_1)) encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) encArg(cons_g(x_1)) -> g(encArg(x_1)) encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) encode_g(x_1) -> g(encArg(x_1)) encode_s(x_1) -> s(encArg(x_1)) ---------------------------------------- (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(g(x), x) g(x) -> s(x) The (relative) TRS S consists of the following rules: encArg(s(x_1)) -> s(encArg(x_1)) encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) encArg(cons_g(x_1)) -> g(encArg(x_1)) encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) encode_g(x_1) -> g(encArg(x_1)) encode_s(x_1) -> s(encArg(x_1)) 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(g(x), x) g(x) -> s(x) The (relative) TRS S consists of the following rules: encArg(s(x_1)) -> s(encArg(x_1)) encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) encArg(cons_g(x_1)) -> g(encArg(x_1)) encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) encode_g(x_1) -> g(encArg(x_1)) encode_s(x_1) -> s(encArg(x_1)) 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(g(x), x) g(x) -> s(x) The (relative) TRS S consists of the following rules: encArg(s(x_1)) -> s(encArg(x_1)) encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) encArg(cons_g(x_1)) -> g(encArg(x_1)) encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) encode_g(x_1) -> g(encArg(x_1)) encode_s(x_1) -> s(encArg(x_1)) 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(g(x), x) [1] g(x) -> s(x) [1] encArg(s(x_1)) -> s(encArg(x_1)) [0] encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) [0] encArg(cons_g(x_1)) -> g(encArg(x_1)) [0] encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) [0] encode_g(x_1) -> g(encArg(x_1)) [0] encode_s(x_1) -> s(encArg(x_1)) [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(g(x), x) [1] g(x) -> s(x) [1] encArg(s(x_1)) -> s(encArg(x_1)) [0] encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) [0] encArg(cons_g(x_1)) -> g(encArg(x_1)) [0] encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) [0] encode_g(x_1) -> g(encArg(x_1)) [0] encode_s(x_1) -> s(encArg(x_1)) [0] The TRS has the following type information: f :: s:cons_f:cons_g -> s:cons_f:cons_g -> s:cons_f:cons_g g :: s:cons_f:cons_g -> s:cons_f:cons_g s :: s:cons_f:cons_g -> s:cons_f:cons_g encArg :: s:cons_f:cons_g -> s:cons_f:cons_g cons_f :: s:cons_f:cons_g -> s:cons_f:cons_g -> s:cons_f:cons_g cons_g :: s:cons_f:cons_g -> s:cons_f:cons_g encode_f :: s:cons_f:cons_g -> s:cons_f:cons_g -> s:cons_f:cons_g encode_g :: s:cons_f:cons_g -> s:cons_f:cons_g encode_s :: s:cons_f:cons_g -> s:cons_f:cons_g 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_g(v0) -> null_encode_g [0] encode_s(v0) -> null_encode_s [0] f(v0, v1) -> null_f [0] And the following fresh constants: null_encArg, null_encode_f, null_encode_g, null_encode_s, 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(g(x), x) [1] g(x) -> s(x) [1] encArg(s(x_1)) -> s(encArg(x_1)) [0] encArg(cons_f(x_1, x_2)) -> f(encArg(x_1), encArg(x_2)) [0] encArg(cons_g(x_1)) -> g(encArg(x_1)) [0] encode_f(x_1, x_2) -> f(encArg(x_1), encArg(x_2)) [0] encode_g(x_1) -> g(encArg(x_1)) [0] encode_s(x_1) -> s(encArg(x_1)) [0] encArg(v0) -> null_encArg [0] encode_f(v0, v1) -> null_encode_f [0] encode_g(v0) -> null_encode_g [0] encode_s(v0) -> null_encode_s [0] f(v0, v1) -> null_f [0] The TRS has the following type information: f :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f -> s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f -> s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f g :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f -> s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f s :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f -> s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f encArg :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f -> s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f cons_f :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f -> s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f -> s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f cons_g :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f -> s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f encode_f :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f -> s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f -> s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f encode_g :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f -> s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f encode_s :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f -> s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f null_encArg :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f null_encode_f :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f null_encode_g :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f null_encode_s :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s:null_f null_f :: s:cons_f:cons_g:null_encArg:null_encode_f:null_encode_g:null_encode_s: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: null_encArg => 0 null_encode_f => 0 null_encode_g => 0 null_encode_s => 0 null_f => 0 ---------------------------------------- (14) Obligation: Complexity RNTS consisting of the following rules: encArg(z) -{ 0 }-> g(encArg(x_1)) :|: z = 1 + x_1, x_1 >= 0 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 }-> 0 :|: v0 >= 0, z = v0 encArg(z) -{ 0 }-> 1 + encArg(x_1) :|: z = 1 + x_1, x_1 >= 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 encode_g(z) -{ 0 }-> g(encArg(x_1)) :|: x_1 >= 0, z = x_1 encode_g(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 encode_s(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 encode_s(z) -{ 0 }-> 1 + encArg(x_1) :|: x_1 >= 0, z = x_1 f(z, z') -{ 1 }-> f(g(x), x) :|: z' = x, x >= 0, z = x f(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 g(z) -{ 1 }-> 1 + x :|: x >= 0, z = x 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,[g(V1, Out)],[V1 >= 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(V1, Out)],[V1 >= 0]). eq(start(V1, V),0,[fun2(V1, Out)],[V1 >= 0]). eq(f(V1, V, Out),1,[g(V2, Ret0),f(Ret0, V2, Ret)],[Out = Ret,V = V2,V2 >= 0,V1 = V2]). eq(g(V1, Out),1,[],[Out = 1 + V3,V3 >= 0,V1 = V3]). eq(encArg(V1, Out),0,[encArg(V4, Ret1)],[Out = 1 + Ret1,V1 = 1 + V4,V4 >= 0]). eq(encArg(V1, Out),0,[encArg(V5, Ret01),encArg(V6, Ret11),f(Ret01, Ret11, Ret2)],[Out = Ret2,V5 >= 0,V1 = 1 + V5 + V6,V6 >= 0]). eq(encArg(V1, Out),0,[encArg(V7, Ret02),g(Ret02, Ret3)],[Out = Ret3,V1 = 1 + V7,V7 >= 0]). eq(fun(V1, V, Out),0,[encArg(V9, Ret03),encArg(V8, Ret12),f(Ret03, Ret12, Ret4)],[Out = Ret4,V9 >= 0,V8 >= 0,V1 = V9,V = V8]). eq(fun1(V1, Out),0,[encArg(V10, Ret04),g(Ret04, Ret5)],[Out = Ret5,V10 >= 0,V1 = V10]). eq(fun2(V1, Out),0,[encArg(V11, Ret13)],[Out = 1 + Ret13,V11 >= 0,V1 = V11]). eq(encArg(V1, Out),0,[],[Out = 0,V12 >= 0,V1 = V12]). eq(fun(V1, V, Out),0,[],[Out = 0,V14 >= 0,V13 >= 0,V1 = V14,V = V13]). eq(fun1(V1, Out),0,[],[Out = 0,V15 >= 0,V1 = V15]). eq(fun2(V1, Out),0,[],[Out = 0,V16 >= 0,V1 = V16]). eq(f(V1, V, Out),0,[],[Out = 0,V17 >= 0,V18 >= 0,V1 = V17,V = V18]). input_output_vars(f(V1,V,Out),[V1,V],[Out]). input_output_vars(g(V1,Out),[V1],[Out]). input_output_vars(encArg(V1,Out),[V1],[Out]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,Out),[V1],[Out]). input_output_vars(fun2(V1,Out),[V1],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. non_recursive : [g/2] 1. recursive : [f/3] 2. recursive [non_tail,multiple] : [encArg/2] 3. non_recursive : [fun/3] 4. non_recursive : [fun1/2] 5. non_recursive : [fun2/2] 6. 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 partially evaluated into fun1/2 5. SCC is partially evaluated into fun2/2 6. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations f/3 * CE 8 is refined into CE [19] * CE 7 is refined into CE [20] ### Cost equations --> "Loop" of f/3 * CEs [20] --> Loop 11 * CEs [19] --> Loop 12 ### Ranking functions of CR f(V1,V,Out) #### Partial ranking functions of CR f(V1,V,Out) ### Specialization of cost equations encArg/2 * CE 12 is refined into CE [21] * CE 9 is refined into CE [22] * CE 11 is refined into CE [23] * CE 10 is refined into CE [24] ### Cost equations --> "Loop" of encArg/2 * CEs [24] --> Loop 13 * CEs [22,23] --> Loop 14 * CEs [21] --> Loop 15 ### Ranking functions of CR encArg(V1,Out) * RF of phase [13,14]: [V1] #### Partial ranking functions of CR encArg(V1,Out) * Partial RF of phase [13,14]: - RF of loop [13:1,13:2,14:1]: V1 ### Specialization of cost equations fun/3 * CE 13 is refined into CE [25,26,27,28] * CE 14 is refined into CE [29] ### Cost equations --> "Loop" of fun/3 * CEs [25,26,27,28,29] --> Loop 16 ### Ranking functions of CR fun(V1,V,Out) #### Partial ranking functions of CR fun(V1,V,Out) ### Specialization of cost equations fun1/2 * CE 15 is refined into CE [30,31] * CE 16 is refined into CE [32] ### Cost equations --> "Loop" of fun1/2 * CEs [31] --> Loop 17 * CEs [30] --> Loop 18 * CEs [32] --> Loop 19 ### Ranking functions of CR fun1(V1,Out) #### Partial ranking functions of CR fun1(V1,Out) ### Specialization of cost equations fun2/2 * CE 17 is refined into CE [33,34] * CE 18 is refined into CE [35] ### Cost equations --> "Loop" of fun2/2 * CEs [34] --> Loop 20 * CEs [33] --> Loop 21 * CEs [35] --> Loop 22 ### Ranking functions of CR fun2(V1,Out) #### Partial ranking functions of CR fun2(V1,Out) ### Specialization of cost equations start/2 * CE 1 is refined into CE [36] * CE 2 is refined into CE [37] * CE 3 is refined into CE [38,39] * CE 4 is refined into CE [40] * CE 5 is refined into CE [41,42,43] * CE 6 is refined into CE [44,45,46] ### Cost equations --> "Loop" of start/2 * CEs [36,37,38,39,40,41,42,43,44,45,46] --> Loop 23 ### 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 [12]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [11,12]: 2 with precondition: [Out=0,V1=V,V1>=0] #### Cost of chains of encArg(V1,Out): * Chain [15]: 0 with precondition: [Out=0,V1>=0] * Chain [multiple([13,14],[[15]])]: 3*it(13)+0 Such that:aux(1) =< V1 it(13) =< aux(1) with precondition: [V1>=1,Out>=0,V1>=Out] #### Cost of chains of fun(V1,V,Out): * Chain [16]: 6*s(2)+6*s(4)+2 Such that:aux(2) =< V1 aux(3) =< V s(4) =< aux(2) s(2) =< aux(3) with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun1(V1,Out): * Chain [19]: 0 with precondition: [Out=0,V1>=0] * Chain [18]: 1 with precondition: [Out=1,V1>=0] * Chain [17]: 3*s(10)+1 Such that:s(9) =< V1 s(10) =< s(9) with precondition: [V1>=1,Out>=1,V1+1>=Out] #### Cost of chains of fun2(V1,Out): * Chain [22]: 0 with precondition: [Out=0,V1>=0] * Chain [21]: 0 with precondition: [Out=1,V1>=0] * Chain [20]: 3*s(12)+0 Such that:s(11) =< V1 s(12) =< s(11) with precondition: [V1>=1,Out>=1,V1+1>=Out] #### Cost of chains of start(V1,V): * Chain [23]: 15*s(14)+6*s(18)+2 Such that:s(16) =< V aux(4) =< V1 s(14) =< aux(4) s(18) =< s(16) with precondition: [V1>=0] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [23] with precondition: [V1>=0] - Upper bound: 15*V1+2+nat(V)*6 - Complexity: n ### Maximum cost of start(V1,V): 15*V1+2+nat(V)*6 Asymptotic class: n * Total analysis performed in 151 ms. ---------------------------------------- (16) BOUNDS(1, n^1)