/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: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxTRS (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxWeightedTrs (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxTypedWeightedTrs (5) CompletionProof [UPPER BOUND(ID), 0 ms] (6) CpxTypedWeightedCompleteTrs (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 2 ms] (8) CpxRNTS (9) CompleteCoflocoProof [FINISHED, 151 ms] (10) BOUNDS(1, n^1) (11) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxTRS (13) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (14) typed CpxTrs (15) OrderProof [LOWER BOUND(ID), 0 ms] (16) typed CpxTrs (17) RewriteLemmaProof [LOWER BOUND(ID), 668 ms] (18) proven lower bound (19) LowerBoundPropagationProof [FINISHED, 0 ms] (20) BOUNDS(n^1, INF) ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: D(t) -> 1 D(constant) -> 0 D(+(x, y)) -> +(D(x), D(y)) D(*(x, y)) -> +(*(y, D(x)), *(x, D(y))) D(-(x, y)) -> -(D(x), D(y)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (2) 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: D(t) -> 1 [1] D(constant) -> 0 [1] D(+(x, y)) -> +(D(x), D(y)) [1] D(*(x, y)) -> +(*(y, D(x)), *(x, D(y))) [1] D(-(x, y)) -> -(D(x), D(y)) [1] Rewrite Strategy: INNERMOST ---------------------------------------- (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (4) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: D(t) -> 1 [1] D(constant) -> 0 [1] D(+(x, y)) -> +(D(x), D(y)) [1] D(*(x, y)) -> +(*(y, D(x)), *(x, D(y))) [1] D(-(x, y)) -> -(D(x), D(y)) [1] The TRS has the following type information: D :: t:1:constant:0:+:*:- -> t:1:constant:0:+:*:- t :: t:1:constant:0:+:*:- 1 :: t:1:constant:0:+:*:- constant :: t:1:constant:0:+:*:- 0 :: t:1:constant:0:+:*:- + :: t:1:constant:0:+:*:- -> t:1:constant:0:+:*:- -> t:1:constant:0:+:*:- * :: t:1:constant:0:+:*:- -> t:1:constant:0:+:*:- -> t:1:constant:0:+:*:- - :: t:1:constant:0:+:*:- -> t:1:constant:0:+:*:- -> t:1:constant:0:+:*:- Rewrite Strategy: INNERMOST ---------------------------------------- (5) 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: D(v0) -> null_D [0] And the following fresh constants: null_D ---------------------------------------- (6) 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: D(t) -> 1 [1] D(constant) -> 0 [1] D(+(x, y)) -> +(D(x), D(y)) [1] D(*(x, y)) -> +(*(y, D(x)), *(x, D(y))) [1] D(-(x, y)) -> -(D(x), D(y)) [1] D(v0) -> null_D [0] The TRS has the following type information: D :: t:1:constant:0:+:*:-:null_D -> t:1:constant:0:+:*:-:null_D t :: t:1:constant:0:+:*:-:null_D 1 :: t:1:constant:0:+:*:-:null_D constant :: t:1:constant:0:+:*:-:null_D 0 :: t:1:constant:0:+:*:-:null_D + :: t:1:constant:0:+:*:-:null_D -> t:1:constant:0:+:*:-:null_D -> t:1:constant:0:+:*:-:null_D * :: t:1:constant:0:+:*:-:null_D -> t:1:constant:0:+:*:-:null_D -> t:1:constant:0:+:*:-:null_D - :: t:1:constant:0:+:*:-:null_D -> t:1:constant:0:+:*:-:null_D -> t:1:constant:0:+:*:-:null_D null_D :: t:1:constant:0:+:*:-:null_D Rewrite Strategy: INNERMOST ---------------------------------------- (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: t => 3 1 => 1 constant => 2 0 => 0 null_D => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: D(z) -{ 1 }-> 1 :|: z = 3 D(z) -{ 1 }-> 0 :|: z = 2 D(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 D(z) -{ 1 }-> 1 + D(x) + D(y) :|: z = 1 + x + y, x >= 0, y >= 0 D(z) -{ 1 }-> 1 + (1 + y + D(x)) + (1 + x + D(y)) :|: z = 1 + x + y, x >= 0, y >= 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (9) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V),0,[fun(V, Out)],[V >= 0]). eq(fun(V, Out),1,[],[Out = 1,V = 3]). eq(fun(V, Out),1,[],[Out = 0,V = 2]). eq(fun(V, Out),1,[fun(V2, Ret01),fun(V1, Ret1)],[Out = 1 + Ret01 + Ret1,V = 1 + V1 + V2,V2 >= 0,V1 >= 0]). eq(fun(V, Out),1,[fun(V3, Ret011),fun(V4, Ret11)],[Out = 3 + Ret011 + Ret11 + V3 + V4,V = 1 + V3 + V4,V3 >= 0,V4 >= 0]). eq(fun(V, Out),0,[],[Out = 0,V5 >= 0,V = V5]). input_output_vars(fun(V,Out),[V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive [multiple] : [fun/2] 1. non_recursive : [start/1] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun/2 1. SCC is partially evaluated into start/1 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/2 * CE 2 is refined into CE [7] * CE 3 is refined into CE [8] * CE 6 is refined into CE [9] * CE 5 is refined into CE [10] * CE 4 is refined into CE [11] ### Cost equations --> "Loop" of fun/2 * CEs [10] --> Loop 6 * CEs [11] --> Loop 7 * CEs [7] --> Loop 8 * CEs [8,9] --> Loop 9 ### Ranking functions of CR fun(V,Out) * RF of phase [6,7]: [V] #### Partial ranking functions of CR fun(V,Out) * Partial RF of phase [6,7]: - RF of loop [6:1,6:2,7:1,7:2]: V ### Specialization of cost equations start/1 * CE 1 is refined into CE [12,13] ### Cost equations --> "Loop" of start/1 * CEs [12,13] --> Loop 10 ### Ranking functions of CR start(V) #### Partial ranking functions of CR start(V) Computing Bounds ===================================== #### Cost of chains of fun(V,Out): * Chain [9]: 1 with precondition: [Out=0,V>=0] * Chain [8]: 1 with precondition: [V=3,Out=1] * Chain [multiple([6,7],[[9],[8]])]: 2*it(6)+1*it([8])+1*it([9])+0 Such that:it([9]) =< V+1 it([8]) =< V/4+1/4 aux(1) =< V it(6) =< aux(1) it([8]) =< aux(1) with precondition: [V>=1,Out>=1] #### Cost of chains of start(V): * Chain [10]: 1*s(6)+1*s(7)+2*s(8)+1 Such that:s(5) =< V s(6) =< V+1 s(7) =< V/4+1/4 s(8) =< s(5) s(7) =< s(5) with precondition: [V>=0] Closed-form bounds of start(V): ------------------------------------- * Chain [10] with precondition: [V>=0] - Upper bound: 13/4*V+9/4 - Complexity: n ### Maximum cost of start(V): 13/4*V+9/4 Asymptotic class: n * Total analysis performed in 81 ms. ---------------------------------------- (10) BOUNDS(1, n^1) ---------------------------------------- (11) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (12) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: D(t) -> 1' D(constant) -> 0' D(+'(x, y)) -> +'(D(x), D(y)) D(*'(x, y)) -> +'(*'(y, D(x)), *'(x, D(y))) D(-(x, y)) -> -(D(x), D(y)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (13) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (14) Obligation: Innermost TRS: Rules: D(t) -> 1' D(constant) -> 0' D(+'(x, y)) -> +'(D(x), D(y)) D(*'(x, y)) -> +'(*'(y, D(x)), *'(x, D(y))) D(-(x, y)) -> -(D(x), D(y)) Types: D :: t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- t :: t:1':constant:0':+':*':- 1' :: t:1':constant:0':+':*':- constant :: t:1':constant:0':+':*':- 0' :: t:1':constant:0':+':*':- +' :: t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- *' :: t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- - :: t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- hole_t:1':constant:0':+':*':-1_0 :: t:1':constant:0':+':*':- gen_t:1':constant:0':+':*':-2_0 :: Nat -> t:1':constant:0':+':*':- ---------------------------------------- (15) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: D ---------------------------------------- (16) Obligation: Innermost TRS: Rules: D(t) -> 1' D(constant) -> 0' D(+'(x, y)) -> +'(D(x), D(y)) D(*'(x, y)) -> +'(*'(y, D(x)), *'(x, D(y))) D(-(x, y)) -> -(D(x), D(y)) Types: D :: t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- t :: t:1':constant:0':+':*':- 1' :: t:1':constant:0':+':*':- constant :: t:1':constant:0':+':*':- 0' :: t:1':constant:0':+':*':- +' :: t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- *' :: t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- - :: t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- hole_t:1':constant:0':+':*':-1_0 :: t:1':constant:0':+':*':- gen_t:1':constant:0':+':*':-2_0 :: Nat -> t:1':constant:0':+':*':- Generator Equations: gen_t:1':constant:0':+':*':-2_0(0) <=> t gen_t:1':constant:0':+':*':-2_0(+(x, 1)) <=> +'(t, gen_t:1':constant:0':+':*':-2_0(x)) The following defined symbols remain to be analysed: D ---------------------------------------- (17) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: D(gen_t:1':constant:0':+':*':-2_0(n4_0)) -> *3_0, rt in Omega(n4_0) Induction Base: D(gen_t:1':constant:0':+':*':-2_0(0)) Induction Step: D(gen_t:1':constant:0':+':*':-2_0(+(n4_0, 1))) ->_R^Omega(1) +'(D(t), D(gen_t:1':constant:0':+':*':-2_0(n4_0))) ->_R^Omega(1) +'(1', D(gen_t:1':constant:0':+':*':-2_0(n4_0))) ->_IH +'(1', *3_0) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (18) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: D(t) -> 1' D(constant) -> 0' D(+'(x, y)) -> +'(D(x), D(y)) D(*'(x, y)) -> +'(*'(y, D(x)), *'(x, D(y))) D(-(x, y)) -> -(D(x), D(y)) Types: D :: t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- t :: t:1':constant:0':+':*':- 1' :: t:1':constant:0':+':*':- constant :: t:1':constant:0':+':*':- 0' :: t:1':constant:0':+':*':- +' :: t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- *' :: t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- - :: t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- -> t:1':constant:0':+':*':- hole_t:1':constant:0':+':*':-1_0 :: t:1':constant:0':+':*':- gen_t:1':constant:0':+':*':-2_0 :: Nat -> t:1':constant:0':+':*':- Generator Equations: gen_t:1':constant:0':+':*':-2_0(0) <=> t gen_t:1':constant:0':+':*':-2_0(+(x, 1)) <=> +'(t, gen_t:1':constant:0':+':*':-2_0(x)) The following defined symbols remain to be analysed: D ---------------------------------------- (19) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (20) BOUNDS(n^1, INF)