/export/starexec/sandbox/solver/bin/starexec_run_complexity /export/starexec/sandbox/benchmark/theBenchmark.xml /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^2)) proof of /export/starexec/sandbox/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^2). (0) CpxTRS (1) NestedDefinedSymbolProof [UPPER BOUND(ID), 0 ms] (2) CpxTRS (3) NonCtorToCtorProof [UPPER BOUND(ID), 0 ms] (4) CpxRelTRS (5) RcToIrcProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CpxRelTRS (7) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxWeightedTrs (9) CpxWeightedTrsRenamingProof [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, 301 ms] (18) BOUNDS(1, n^2) (19) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] (20) TRS for Loop Detection (21) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] (22) BEST (23) proven lower bound (24) LowerBoundPropagationProof [FINISHED, 0 ms] (25) BOUNDS(n^1, INF) (26) TRS for Loop Detection ---------------------------------------- (0) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: O(0) -> 0 +(0, x) -> x +(x, 0) -> x +(O(x), O(y)) -> O(+(x, y)) +(O(x), I(y)) -> I(+(x, y)) +(I(x), O(y)) -> I(+(x, y)) +(I(x), I(y)) -> O(+(+(x, y), I(0))) *(0, x) -> 0 *(x, 0) -> 0 *(O(x), y) -> O(*(x, y)) *(I(x), y) -> +(O(*(x, y)), y) S is empty. Rewrite Strategy: FULL ---------------------------------------- (1) NestedDefinedSymbolProof (UPPER BOUND(ID)) The following defined symbols can occur below the 0th argument of +: O, +, * The following defined symbols can occur below the 0th argument of O: O, +, * Hence, the left-hand sides of the following rules are not basic-reachable and can be removed: +(O(x), O(y)) -> O(+(x, y)) +(I(x), O(y)) -> I(+(x, y)) *(O(x), y) -> O(*(x, y)) ---------------------------------------- (2) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: O(0) -> 0 +(0, x) -> x +(x, 0) -> x +(O(x), I(y)) -> I(+(x, y)) +(I(x), I(y)) -> O(+(+(x, y), I(0))) *(0, x) -> 0 *(x, 0) -> 0 *(I(x), y) -> +(O(*(x, y)), y) S is empty. Rewrite Strategy: FULL ---------------------------------------- (3) NonCtorToCtorProof (UPPER BOUND(ID)) transformed non-ctor to ctor-system ---------------------------------------- (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: O(0) -> 0 +(0, x) -> x +(x, 0) -> x +(I(x), I(y)) -> O(+(+(x, y), I(0))) *(0, x) -> 0 *(x, 0) -> 0 *(I(x), y) -> +(O(*(x, y)), y) +(c_O(x), I(y)) -> I(+(x, y)) The (relative) TRS S consists of the following rules: O(x0) -> c_O(x0) Rewrite Strategy: FULL ---------------------------------------- (5) RcToIrcProof (BOTH BOUNDS(ID, ID)) Converted rc-obligation to irc-obligation. The duplicating contexts are: *(I(x), []) The defined contexts are: +([], x1) O([]) +([], I(0)) As the TRS is an overlay system and the defined contexts and the duplicating contexts don't overlap, we have rc = irc. ---------------------------------------- (6) 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: O(0) -> 0 +(0, x) -> x +(x, 0) -> x +(I(x), I(y)) -> O(+(+(x, y), I(0))) *(0, x) -> 0 *(x, 0) -> 0 *(I(x), y) -> +(O(*(x, y)), y) +(c_O(x), I(y)) -> I(+(x, y)) The (relative) TRS S consists of the following rules: O(x0) -> c_O(x0) 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^2). The TRS R consists of the following rules: O(0) -> 0 [1] +(0, x) -> x [1] +(x, 0) -> x [1] +(I(x), I(y)) -> O(+(+(x, y), I(0))) [1] *(0, x) -> 0 [1] *(x, 0) -> 0 [1] *(I(x), y) -> +(O(*(x, y)), y) [1] +(c_O(x), I(y)) -> I(+(x, y)) [1] O(x0) -> c_O(x0) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (9) CpxWeightedTrsRenamingProof (BOTH BOUNDS(ID, ID)) Renamed defined symbols to avoid conflicts with arithmetic symbols: + => plus * => times ---------------------------------------- (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: O(0) -> 0 [1] plus(0, x) -> x [1] plus(x, 0) -> x [1] plus(I(x), I(y)) -> O(plus(plus(x, y), I(0))) [1] times(0, x) -> 0 [1] times(x, 0) -> 0 [1] times(I(x), y) -> plus(O(times(x, y)), y) [1] plus(c_O(x), I(y)) -> I(plus(x, y)) [1] O(x0) -> c_O(x0) [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: O(0) -> 0 [1] plus(0, x) -> x [1] plus(x, 0) -> x [1] plus(I(x), I(y)) -> O(plus(plus(x, y), I(0))) [1] times(0, x) -> 0 [1] times(x, 0) -> 0 [1] times(I(x), y) -> plus(O(times(x, y)), y) [1] plus(c_O(x), I(y)) -> I(plus(x, y)) [1] O(x0) -> c_O(x0) [0] The TRS has the following type information: O :: 0:I:c_O -> 0:I:c_O 0 :: 0:I:c_O plus :: 0:I:c_O -> 0:I:c_O -> 0:I:c_O I :: 0:I:c_O -> 0:I:c_O times :: 0:I:c_O -> 0:I:c_O -> 0:I:c_O c_O :: 0:I:c_O -> 0:I:c_O 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: O(v0) -> null_O [0] plus(v0, v1) -> null_plus [0] times(v0, v1) -> null_times [0] And the following fresh constants: null_O, null_plus, null_times ---------------------------------------- (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: O(0) -> 0 [1] plus(0, x) -> x [1] plus(x, 0) -> x [1] plus(I(x), I(y)) -> O(plus(plus(x, y), I(0))) [1] times(0, x) -> 0 [1] times(x, 0) -> 0 [1] times(I(x), y) -> plus(O(times(x, y)), y) [1] plus(c_O(x), I(y)) -> I(plus(x, y)) [1] O(x0) -> c_O(x0) [0] O(v0) -> null_O [0] plus(v0, v1) -> null_plus [0] times(v0, v1) -> null_times [0] The TRS has the following type information: O :: 0:I:c_O:null_O:null_plus:null_times -> 0:I:c_O:null_O:null_plus:null_times 0 :: 0:I:c_O:null_O:null_plus:null_times plus :: 0:I:c_O:null_O:null_plus:null_times -> 0:I:c_O:null_O:null_plus:null_times -> 0:I:c_O:null_O:null_plus:null_times I :: 0:I:c_O:null_O:null_plus:null_times -> 0:I:c_O:null_O:null_plus:null_times times :: 0:I:c_O:null_O:null_plus:null_times -> 0:I:c_O:null_O:null_plus:null_times -> 0:I:c_O:null_O:null_plus:null_times c_O :: 0:I:c_O:null_O:null_plus:null_times -> 0:I:c_O:null_O:null_plus:null_times null_O :: 0:I:c_O:null_O:null_plus:null_times null_plus :: 0:I:c_O:null_O:null_plus:null_times null_times :: 0:I:c_O:null_O:null_plus:null_times 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: 0 => 0 null_O => 0 null_plus => 0 null_times => 0 ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: O(z) -{ 1 }-> 0 :|: z = 0 O(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 O(z) -{ 0 }-> 1 + x0 :|: z = x0, x0 >= 0 plus(z, z') -{ 1 }-> x :|: z' = x, x >= 0, z = 0 plus(z, z') -{ 1 }-> x :|: x >= 0, z = x, z' = 0 plus(z, z') -{ 1 }-> O(plus(plus(x, y), 1 + 0)) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x plus(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 plus(z, z') -{ 1 }-> 1 + plus(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x times(z, z') -{ 1 }-> plus(O(times(x, y)), y) :|: x >= 0, y >= 0, z = 1 + x, z' = y times(z, z') -{ 1 }-> 0 :|: z' = x, x >= 0, z = 0 times(z, z') -{ 1 }-> 0 :|: x >= 0, z = x, z' = 0 times(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 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, V1),0,[fun(V, Out)],[V >= 0]). eq(start(V, V1),0,[plus(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1),0,[times(V, V1, Out)],[V >= 0,V1 >= 0]). eq(fun(V, Out),1,[],[Out = 0,V = 0]). eq(plus(V, V1, Out),1,[],[Out = V2,V1 = V2,V2 >= 0,V = 0]). eq(plus(V, V1, Out),1,[],[Out = V3,V3 >= 0,V = V3,V1 = 0]). eq(plus(V, V1, Out),1,[plus(V4, V5, Ret00),plus(Ret00, 1 + 0, Ret0),fun(Ret0, Ret)],[Out = Ret,V1 = 1 + V5,V4 >= 0,V5 >= 0,V = 1 + V4]). eq(times(V, V1, Out),1,[],[Out = 0,V1 = V6,V6 >= 0,V = 0]). eq(times(V, V1, Out),1,[],[Out = 0,V7 >= 0,V = V7,V1 = 0]). eq(times(V, V1, Out),1,[times(V8, V9, Ret001),fun(Ret001, Ret01),plus(Ret01, V9, Ret1)],[Out = Ret1,V8 >= 0,V9 >= 0,V = 1 + V8,V1 = V9]). eq(plus(V, V1, Out),1,[plus(V11, V10, Ret11)],[Out = 1 + Ret11,V1 = 1 + V10,V11 >= 0,V10 >= 0,V = 1 + V11]). eq(fun(V, Out),0,[],[Out = 1 + V12,V = V12,V12 >= 0]). eq(fun(V, Out),0,[],[Out = 0,V13 >= 0,V = V13]). eq(plus(V, V1, Out),0,[],[Out = 0,V15 >= 0,V14 >= 0,V = V15,V1 = V14]). eq(times(V, V1, Out),0,[],[Out = 0,V17 >= 0,V16 >= 0,V = V17,V1 = V16]). input_output_vars(fun(V,Out),[V],[Out]). input_output_vars(plus(V,V1,Out),[V,V1],[Out]). input_output_vars(times(V,V1,Out),[V,V1],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. non_recursive : [fun/2] 1. recursive [non_tail,multiple] : [plus/3] 2. recursive [non_tail] : [times/3] 3. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun/2 1. SCC is partially evaluated into plus/3 2. SCC is partially evaluated into times/3 3. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/2 * CE 5 is refined into CE [16] * CE 4 is refined into CE [17] * CE 6 is refined into CE [18] ### Cost equations --> "Loop" of fun/2 * CEs [16] --> Loop 12 * CEs [17,18] --> Loop 13 ### Ranking functions of CR fun(V,Out) #### Partial ranking functions of CR fun(V,Out) ### Specialization of cost equations plus/3 * CE 11 is refined into CE [19] * CE 8 is refined into CE [20] * CE 7 is refined into CE [21] * CE 10 is refined into CE [22] * CE 9 is refined into CE [23,24] ### Cost equations --> "Loop" of plus/3 * CEs [24] --> Loop 14 * CEs [23] --> Loop 15 * CEs [22] --> Loop 16 * CEs [19] --> Loop 17 * CEs [20] --> Loop 18 * CEs [21] --> Loop 19 ### Ranking functions of CR plus(V,V1,Out) #### Partial ranking functions of CR plus(V,V1,Out) * Partial RF of phase [14,15,16]: - RF of loop [14:1,15:1,16:1]: V depends on loops [14:2,15:2] V1 ### Specialization of cost equations times/3 * CE 13 is refined into CE [25] * CE 12 is refined into CE [26] * CE 15 is refined into CE [27] * CE 14 is refined into CE [28,29,30,31,32,33] ### Cost equations --> "Loop" of times/3 * CEs [33] --> Loop 20 * CEs [28] --> Loop 21 * CEs [31] --> Loop 22 * CEs [29,30,32] --> Loop 23 * CEs [25] --> Loop 24 * CEs [26,27] --> Loop 25 ### Ranking functions of CR times(V,V1,Out) * RF of phase [20,21,22,23]: [V] #### Partial ranking functions of CR times(V,V1,Out) * Partial RF of phase [20,21,22,23]: - RF of loop [20:1,21:1,22:1,23:1]: V ### Specialization of cost equations start/2 * CE 1 is refined into CE [34,35] * CE 2 is refined into CE [36,37,38,39] * CE 3 is refined into CE [40,41] ### Cost equations --> "Loop" of start/2 * CEs [37] --> Loop 26 * CEs [34,35,36,38,40,41] --> Loop 27 * CEs [39] --> Loop 28 ### Ranking functions of CR start(V,V1) #### Partial ranking functions of CR start(V,V1) Computing Bounds ===================================== #### Cost of chains of fun(V,Out): * Chain [13]: 1 with precondition: [Out=0,V>=0] * Chain [12]: 0 with precondition: [V+1=Out,V>=0] #### Cost of chains of plus(V,V1,Out): * Chain [multiple([14,15,16],[[],[19],[18],[17]])]...: 4*it(14)+2*it([18])+0 Such that:aux(1) =< 1 aux(2) =< 2*V1 it(14) =< aux(2) it([18]) =< it(14)+it(14)+aux(1) with precondition: [V>=1,V1>=1] * Chain [19]: 1 with precondition: [V=0,V1=Out,V1>=0] * Chain [18]: 1 with precondition: [V1=0,V=Out,V>=0] * Chain [17]: 0 with precondition: [Out=0,V>=0,V1>=0] #### Cost of chains of times(V,V1,Out): * Chain [[20,21,22,23],25]: 9*it(20)+4*s(9)+2*s(10)+1 Such that:aux(4) =< 2*V1 aux(7) =< V it(20) =< aux(7) s(12) =< it(20)*aux(4) s(9) =< s(12) s(10) =< s(9)+s(9)+aux(7) with precondition: [V>=1,V1>=0] * Chain [[20,21,22,23],24]: 9*it(20)+2*s(10)+1 Such that:aux(8) =< V it(20) =< aux(8) s(10) =< aux(8) with precondition: [V1=0,V>=1,Out>=0,V>=Out] * Chain [25]: 1 with precondition: [Out=0,V>=0,V1>=0] * Chain [24]: 1 with precondition: [V1=0,Out=0,V>=0] #### Cost of chains of start(V,V1): * Chain [28]...: 4*s(24)+2*s(25)+0 Such that:s(22) =< 1 s(23) =< 2*V1 s(24) =< s(23) s(25) =< s(24)+s(24)+s(22) with precondition: [V>=1,V1>=1] * Chain [27]: 20*s(28)+4*s(30)+2*s(31)+1 Such that:s(27) =< V s(26) =< 2*V1 s(28) =< s(27) s(29) =< s(28)*s(26) s(30) =< s(29) s(31) =< s(30)+s(30)+s(27) with precondition: [V>=0] * Chain [26]: 1 with precondition: [V1=0,V>=0] Closed-form bounds of start(V,V1): ------------------------------------- * Chain [28]... with precondition: [V>=1,V1>=1] - Upper bound: 16*V1+2 - Complexity: n * Chain [27] with precondition: [V>=0] - Upper bound: 22*V+1+8*V*nat(2*V1) - Complexity: n^2 * Chain [26] with precondition: [V1=0,V>=0] - Upper bound: 1 - Complexity: constant ### Maximum cost of start(V,V1): max([nat(2*V1)*8+1,8*V*nat(2*V1)+22*V])+1 Asymptotic class: n^2 * Total analysis performed in 220 ms. ---------------------------------------- (18) BOUNDS(1, n^2) ---------------------------------------- (19) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) Transformed a relative TRS into a decreasing-loop problem. ---------------------------------------- (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^2). The TRS R consists of the following rules: O(0) -> 0 +(0, x) -> x +(x, 0) -> x +(O(x), O(y)) -> O(+(x, y)) +(O(x), I(y)) -> I(+(x, y)) +(I(x), O(y)) -> I(+(x, y)) +(I(x), I(y)) -> O(+(+(x, y), I(0))) *(0, x) -> 0 *(x, 0) -> 0 *(O(x), y) -> O(*(x, y)) *(I(x), y) -> +(O(*(x, y)), y) S is empty. Rewrite Strategy: FULL ---------------------------------------- (21) DecreasingLoopProof (LOWER BOUND(ID)) The following loop(s) give(s) rise to the lower bound Omega(n^1): The rewrite sequence +(I(x), I(y)) ->^+ O(+(+(x, y), I(0))) gives rise to a decreasing loop by considering the right hand sides subterm at position [0,0]. The pumping substitution is [x / I(x), y / I(y)]. The result substitution is [ ]. ---------------------------------------- (22) Complex Obligation (BEST) ---------------------------------------- (23) 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^2). The TRS R consists of the following rules: O(0) -> 0 +(0, x) -> x +(x, 0) -> x +(O(x), O(y)) -> O(+(x, y)) +(O(x), I(y)) -> I(+(x, y)) +(I(x), O(y)) -> I(+(x, y)) +(I(x), I(y)) -> O(+(+(x, y), I(0))) *(0, x) -> 0 *(x, 0) -> 0 *(O(x), y) -> O(*(x, y)) *(I(x), y) -> +(O(*(x, y)), y) S is empty. Rewrite Strategy: FULL ---------------------------------------- (24) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (25) BOUNDS(n^1, INF) ---------------------------------------- (26) 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^2). The TRS R consists of the following rules: O(0) -> 0 +(0, x) -> x +(x, 0) -> x +(O(x), O(y)) -> O(+(x, y)) +(O(x), I(y)) -> I(+(x, y)) +(I(x), O(y)) -> I(+(x, y)) +(I(x), I(y)) -> O(+(+(x, y), I(0))) *(0, x) -> 0 *(x, 0) -> 0 *(O(x), y) -> O(*(x, y)) *(I(x), y) -> +(O(*(x, y)), y) S is empty. Rewrite Strategy: FULL