/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 (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxTRS (1) RcToIrcProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxTRS (3) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxWeightedTrs (5) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CpxTypedWeightedTrs (7) CompletionProof [UPPER BOUND(ID), 0 ms] (8) CpxTypedWeightedCompleteTrs (9) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 9 ms] (10) CpxRNTS (11) CompleteCoflocoProof [FINISHED, 410 ms] (12) BOUNDS(1, n^1) (13) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] (14) TRS for Loop Detection (15) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] (16) BEST (17) proven lower bound (18) LowerBoundPropagationProof [FINISHED, 0 ms] (19) BOUNDS(n^1, INF) (20) TRS for Loop Detection ---------------------------------------- (0) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: min(X, 0) -> X min(s(X), s(Y)) -> min(X, Y) quot(0, s(Y)) -> 0 quot(s(X), s(Y)) -> s(quot(min(X, Y), s(Y))) log(s(0)) -> 0 log(s(s(X))) -> s(log(s(quot(X, s(s(0)))))) S is empty. Rewrite Strategy: FULL ---------------------------------------- (1) RcToIrcProof (BOTH BOUNDS(ID, ID)) Converted rc-obligation to irc-obligation. The duplicating contexts are: quot(s(X), s([])) The defined contexts are: log(s([])) quot([], s(x1)) min([], x1) quot([], s(s(0))) [] just represents basic- or constructor-terms in the following defined contexts: quot([], s(x1)) As the TRS is an overlay system and the defined contexts and the duplicating contexts don't overlap, we have rc = irc. ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: min(X, 0) -> X min(s(X), s(Y)) -> min(X, Y) quot(0, s(Y)) -> 0 quot(s(X), s(Y)) -> s(quot(min(X, Y), s(Y))) log(s(0)) -> 0 log(s(s(X))) -> s(log(s(quot(X, s(s(0)))))) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (3) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (4) 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: min(X, 0) -> X [1] min(s(X), s(Y)) -> min(X, Y) [1] quot(0, s(Y)) -> 0 [1] quot(s(X), s(Y)) -> s(quot(min(X, Y), s(Y))) [1] log(s(0)) -> 0 [1] log(s(s(X))) -> s(log(s(quot(X, s(s(0)))))) [1] Rewrite Strategy: INNERMOST ---------------------------------------- (5) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (6) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: min(X, 0) -> X [1] min(s(X), s(Y)) -> min(X, Y) [1] quot(0, s(Y)) -> 0 [1] quot(s(X), s(Y)) -> s(quot(min(X, Y), s(Y))) [1] log(s(0)) -> 0 [1] log(s(s(X))) -> s(log(s(quot(X, s(s(0)))))) [1] The TRS has the following type information: min :: 0:s -> 0:s -> 0:s 0 :: 0:s s :: 0:s -> 0:s quot :: 0:s -> 0:s -> 0:s log :: 0:s -> 0:s Rewrite Strategy: INNERMOST ---------------------------------------- (7) 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: min(v0, v1) -> null_min [0] quot(v0, v1) -> null_quot [0] log(v0) -> null_log [0] And the following fresh constants: null_min, null_quot, null_log ---------------------------------------- (8) 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: min(X, 0) -> X [1] min(s(X), s(Y)) -> min(X, Y) [1] quot(0, s(Y)) -> 0 [1] quot(s(X), s(Y)) -> s(quot(min(X, Y), s(Y))) [1] log(s(0)) -> 0 [1] log(s(s(X))) -> s(log(s(quot(X, s(s(0)))))) [1] min(v0, v1) -> null_min [0] quot(v0, v1) -> null_quot [0] log(v0) -> null_log [0] The TRS has the following type information: min :: 0:s:null_min:null_quot:null_log -> 0:s:null_min:null_quot:null_log -> 0:s:null_min:null_quot:null_log 0 :: 0:s:null_min:null_quot:null_log s :: 0:s:null_min:null_quot:null_log -> 0:s:null_min:null_quot:null_log quot :: 0:s:null_min:null_quot:null_log -> 0:s:null_min:null_quot:null_log -> 0:s:null_min:null_quot:null_log log :: 0:s:null_min:null_quot:null_log -> 0:s:null_min:null_quot:null_log null_min :: 0:s:null_min:null_quot:null_log null_quot :: 0:s:null_min:null_quot:null_log null_log :: 0:s:null_min:null_quot:null_log Rewrite Strategy: INNERMOST ---------------------------------------- (9) 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_min => 0 null_quot => 0 null_log => 0 ---------------------------------------- (10) Obligation: Complexity RNTS consisting of the following rules: log(z) -{ 1 }-> 0 :|: z = 1 + 0 log(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 log(z) -{ 1 }-> 1 + log(1 + quot(X, 1 + (1 + 0))) :|: z = 1 + (1 + X), X >= 0 min(z, z') -{ 1 }-> X :|: X >= 0, z = X, z' = 0 min(z, z') -{ 1 }-> min(X, Y) :|: z = 1 + X, Y >= 0, z' = 1 + Y, X >= 0 min(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 quot(z, z') -{ 1 }-> 0 :|: Y >= 0, z' = 1 + Y, z = 0 quot(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 quot(z, z') -{ 1 }-> 1 + quot(min(X, Y), 1 + Y) :|: z = 1 + X, Y >= 0, z' = 1 + Y, X >= 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (11) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V1, V),0,[min(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[quot(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[log(V1, Out)],[V1 >= 0]). eq(min(V1, V, Out),1,[],[Out = X1,X1 >= 0,V1 = X1,V = 0]). eq(min(V1, V, Out),1,[min(X2, Y1, Ret)],[Out = Ret,V1 = 1 + X2,Y1 >= 0,V = 1 + Y1,X2 >= 0]). eq(quot(V1, V, Out),1,[],[Out = 0,Y2 >= 0,V = 1 + Y2,V1 = 0]). eq(quot(V1, V, Out),1,[min(X3, Y3, Ret10),quot(Ret10, 1 + Y3, Ret1)],[Out = 1 + Ret1,V1 = 1 + X3,Y3 >= 0,V = 1 + Y3,X3 >= 0]). eq(log(V1, Out),1,[],[Out = 0,V1 = 1]). eq(log(V1, Out),1,[quot(X4, 1 + (1 + 0), Ret101),log(1 + Ret101, Ret11)],[Out = 1 + Ret11,V1 = 2 + X4,X4 >= 0]). eq(min(V1, V, Out),0,[],[Out = 0,V3 >= 0,V2 >= 0,V1 = V3,V = V2]). eq(quot(V1, V, Out),0,[],[Out = 0,V5 >= 0,V4 >= 0,V1 = V5,V = V4]). eq(log(V1, Out),0,[],[Out = 0,V6 >= 0,V1 = V6]). input_output_vars(min(V1,V,Out),[V1,V],[Out]). input_output_vars(quot(V1,V,Out),[V1,V],[Out]). input_output_vars(log(V1,Out),[V1],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [min/3] 1. recursive : [quot/3] 2. recursive : [log/2] 3. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into min/3 1. SCC is partially evaluated into quot/3 2. SCC is partially evaluated into log/2 3. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations min/3 * CE 6 is refined into CE [13] * CE 4 is refined into CE [14] * CE 5 is refined into CE [15] ### Cost equations --> "Loop" of min/3 * CEs [15] --> Loop 9 * CEs [13] --> Loop 10 * CEs [14] --> Loop 11 ### Ranking functions of CR min(V1,V,Out) * RF of phase [9]: [V,V1] #### Partial ranking functions of CR min(V1,V,Out) * Partial RF of phase [9]: - RF of loop [9:1]: V V1 ### Specialization of cost equations quot/3 * CE 7 is refined into CE [16] * CE 9 is refined into CE [17] * CE 8 is refined into CE [18,19,20] ### Cost equations --> "Loop" of quot/3 * CEs [20] --> Loop 12 * CEs [19] --> Loop 13 * CEs [18] --> Loop 14 * CEs [16,17] --> Loop 15 ### Ranking functions of CR quot(V1,V,Out) * RF of phase [12]: [V1-1,V1-V+1] * RF of phase [14]: [V1] #### Partial ranking functions of CR quot(V1,V,Out) * Partial RF of phase [12]: - RF of loop [12:1]: V1-1 V1-V+1 * Partial RF of phase [14]: - RF of loop [14:1]: V1 ### Specialization of cost equations log/2 * CE 10 is refined into CE [21] * CE 12 is refined into CE [22] * CE 11 is refined into CE [23,24,25,26] ### Cost equations --> "Loop" of log/2 * CEs [26] --> Loop 16 * CEs [25] --> Loop 17 * CEs [24] --> Loop 18 * CEs [23] --> Loop 19 * CEs [21,22] --> Loop 20 ### Ranking functions of CR log(V1,Out) * RF of phase [16,17]: [V1-3,V1/2-3/2] #### Partial ranking functions of CR log(V1,Out) * Partial RF of phase [16,17]: - RF of loop [16:1]: V1/2-2 - RF of loop [17:1]: V1-3 ### Specialization of cost equations start/2 * CE 1 is refined into CE [27,28,29] * CE 2 is refined into CE [30,31,32,33,34] * CE 3 is refined into CE [35,36,37,38,39,40] ### Cost equations --> "Loop" of start/2 * CEs [30] --> Loop 21 * CEs [27,28,29,31,32,33,34,35,36,37,38,39,40] --> Loop 22 ### Ranking functions of CR start(V1,V) #### Partial ranking functions of CR start(V1,V) Computing Bounds ===================================== #### Cost of chains of min(V1,V,Out): * Chain [[9],11]: 1*it(9)+1 Such that:it(9) =< V with precondition: [V1=Out+V,V>=1,V1>=V] * Chain [[9],10]: 1*it(9)+0 Such that:it(9) =< V with precondition: [Out=0,V1>=1,V>=1] * Chain [11]: 1 with precondition: [V=0,V1=Out,V1>=0] * Chain [10]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of quot(V1,V,Out): * Chain [[14],15]: 2*it(14)+1 Such that:it(14) =< Out with precondition: [V=1,Out>=1,V1>=Out] * Chain [[14],13,15]: 2*it(14)+1*s(2)+2 Such that:s(2) =< 1 it(14) =< Out with precondition: [V=1,Out>=2,V1>=Out] * Chain [[12],15]: 2*it(12)+1*s(5)+1 Such that:it(12) =< V1-V+1 aux(3) =< V1 it(12) =< aux(3) s(5) =< aux(3) with precondition: [V>=2,Out>=1,V1+2>=2*Out+V] * Chain [[12],13,15]: 2*it(12)+1*s(2)+1*s(5)+2 Such that:it(12) =< V1-V+1 s(2) =< V aux(4) =< V1 it(12) =< aux(4) s(5) =< aux(4) with precondition: [V>=2,Out>=2,V1+3>=2*Out+V] * Chain [15]: 1 with precondition: [Out=0,V1>=0,V>=0] * Chain [13,15]: 1*s(2)+2 Such that:s(2) =< V with precondition: [Out=1,V1>=1,V>=1] #### Cost of chains of log(V1,Out): * Chain [[16,17],20]: 3*it(16)+2*it(17)+3*s(21)+1*s(22)+3*s(24)+1 Such that:s(25) =< 2*V1 aux(14) =< 5/2*V1 aux(13) =< 5/2*V1+27/2 aux(15) =< V1 aux(16) =< V1/2 aux(8) =< aux(15) it(16) =< aux(15) it(17) =< aux(15) aux(8) =< aux(16) it(16) =< aux(16) it(17) =< aux(16) it(17) =< aux(13) s(23) =< aux(13) it(17) =< aux(14) s(23) =< aux(14) s(22) =< aux(8)*2 s(24) =< s(25) s(21) =< s(23) with precondition: [Out>=1,V1>=3*Out+1] * Chain [[16,17],19,20]: 3*it(16)+2*it(17)+3*s(21)+1*s(22)+3*s(24)+3 Such that:s(25) =< 2*V1 aux(14) =< 5/2*V1 aux(13) =< 5/2*V1+27/2 aux(17) =< V1 aux(18) =< V1/2 aux(8) =< aux(17) it(16) =< aux(17) it(17) =< aux(17) aux(8) =< aux(18) it(16) =< aux(18) it(17) =< aux(18) it(17) =< aux(13) s(23) =< aux(13) it(17) =< aux(14) s(23) =< aux(14) s(22) =< aux(8)*2 s(24) =< s(25) s(21) =< s(23) with precondition: [Out>=2,V1+2>=3*Out] * Chain [[16,17],18,20]: 3*it(16)+2*it(17)+3*s(21)+1*s(22)+3*s(24)+1*s(26)+4 Such that:s(26) =< 2 s(25) =< 2*V1 aux(14) =< 5/2*V1 aux(13) =< 5/2*V1+27/2 aux(19) =< V1 aux(20) =< V1/2 aux(8) =< aux(19) it(16) =< aux(19) it(17) =< aux(19) aux(8) =< aux(20) it(16) =< aux(20) it(17) =< aux(20) it(17) =< aux(13) s(23) =< aux(13) it(17) =< aux(14) s(23) =< aux(14) s(22) =< aux(8)*2 s(24) =< s(25) s(21) =< s(23) with precondition: [Out>=2,V1+3>=4*Out] * Chain [[16,17],18,19,20]: 3*it(16)+2*it(17)+3*s(21)+1*s(22)+3*s(24)+1*s(26)+6 Such that:s(26) =< 2 s(25) =< 2*V1 aux(14) =< 5/2*V1 aux(13) =< 5/2*V1+27/2 aux(21) =< V1 aux(22) =< V1/2 aux(8) =< aux(21) it(16) =< aux(21) it(17) =< aux(21) aux(8) =< aux(22) it(16) =< aux(22) it(17) =< aux(22) it(17) =< aux(13) s(23) =< aux(13) it(17) =< aux(14) s(23) =< aux(14) s(22) =< aux(8)*2 s(24) =< s(25) s(21) =< s(23) with precondition: [Out>=3,V1+7>=4*Out] * Chain [20]: 1 with precondition: [Out=0,V1>=0] * Chain [19,20]: 3 with precondition: [Out=1,V1>=2] * Chain [18,20]: 1*s(26)+4 Such that:s(26) =< 2 with precondition: [Out=1,V1>=3] * Chain [18,19,20]: 1*s(26)+6 Such that:s(26) =< 2 with precondition: [Out=2,V1>=3] #### Cost of chains of start(V1,V): * Chain [22]: 4*s(53)+4*s(56)+2*s(58)+3*s(63)+12*s(70)+8*s(71)+4*s(73)+12*s(74)+12*s(75)+6 Such that:aux(28) =< 2 aux(29) =< V1 aux(30) =< V1-V+1 aux(31) =< 2*V1 aux(32) =< V1/2 aux(33) =< 5/2*V1 aux(34) =< 5/2*V1+27/2 aux(35) =< V s(63) =< aux(28) s(56) =< aux(30) s(53) =< aux(35) s(69) =< aux(29) s(70) =< aux(29) s(71) =< aux(29) s(69) =< aux(32) s(70) =< aux(32) s(71) =< aux(32) s(71) =< aux(34) s(72) =< aux(34) s(71) =< aux(33) s(72) =< aux(33) s(73) =< s(69)*2 s(74) =< aux(31) s(75) =< s(72) s(56) =< aux(29) s(58) =< aux(29) with precondition: [V1>=0] * Chain [21]: 1*s(102)+4*s(104)+2 Such that:s(102) =< 1 s(103) =< V1 s(104) =< s(103) with precondition: [V=1,V1>=1] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [22] with precondition: [V1>=0] - Upper bound: 30*V1+12+nat(V)*4+24*V1+(30*V1+162)+nat(V1-V+1)*4 - Complexity: n * Chain [21] with precondition: [V=1,V1>=1] - Upper bound: 4*V1+3 - Complexity: n ### Maximum cost of start(V1,V): 26*V1+9+nat(V)*4+24*V1+(30*V1+162)+nat(V1-V+1)*4+(4*V1+3) Asymptotic class: n * Total analysis performed in 327 ms. ---------------------------------------- (12) BOUNDS(1, n^1) ---------------------------------------- (13) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) Transformed a relative TRS into a decreasing-loop problem. ---------------------------------------- (14) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: min(X, 0) -> X min(s(X), s(Y)) -> min(X, Y) quot(0, s(Y)) -> 0 quot(s(X), s(Y)) -> s(quot(min(X, Y), s(Y))) log(s(0)) -> 0 log(s(s(X))) -> s(log(s(quot(X, s(s(0)))))) S is empty. Rewrite Strategy: FULL ---------------------------------------- (15) DecreasingLoopProof (LOWER BOUND(ID)) The following loop(s) give(s) rise to the lower bound Omega(n^1): The rewrite sequence min(s(X), s(Y)) ->^+ min(X, Y) gives rise to a decreasing loop by considering the right hand sides subterm at position []. The pumping substitution is [X / s(X), Y / s(Y)]. The result substitution is [ ]. ---------------------------------------- (16) Complex Obligation (BEST) ---------------------------------------- (17) Obligation: Proved the lower bound n^1 for the following obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: min(X, 0) -> X min(s(X), s(Y)) -> min(X, Y) quot(0, s(Y)) -> 0 quot(s(X), s(Y)) -> s(quot(min(X, Y), s(Y))) log(s(0)) -> 0 log(s(s(X))) -> s(log(s(quot(X, s(s(0)))))) S is empty. Rewrite Strategy: FULL ---------------------------------------- (18) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (19) BOUNDS(n^1, INF) ---------------------------------------- (20) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: min(X, 0) -> X min(s(X), s(Y)) -> min(X, Y) quot(0, s(Y)) -> 0 quot(s(X), s(Y)) -> s(quot(min(X, Y), s(Y))) log(s(0)) -> 0 log(s(s(X))) -> s(log(s(quot(X, s(s(0)))))) S is empty. Rewrite Strategy: FULL