/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), 0 ms] (8) CpxRNTS (9) CompleteCoflocoProof [FINISHED, 28 ms] (10) BOUNDS(1, n^1) (11) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxTRS (13) SlicingProof [LOWER BOUND(ID), 0 ms] (14) CpxTRS (15) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (16) typed CpxTrs (17) OrderProof [LOWER BOUND(ID), 0 ms] (18) typed CpxTrs (19) RewriteLemmaProof [LOWER BOUND(ID), 297 ms] (20) proven lower bound (21) LowerBoundPropagationProof [FINISHED, 0 ms] (22) 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: duplicate(Cons(x, xs)) -> Cons(x, Cons(x, duplicate(xs))) duplicate(Nil) -> Nil goal(x) -> duplicate(x) 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: duplicate(Cons(x, xs)) -> Cons(x, Cons(x, duplicate(xs))) [1] duplicate(Nil) -> Nil [1] goal(x) -> duplicate(x) [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: duplicate(Cons(x, xs)) -> Cons(x, Cons(x, duplicate(xs))) [1] duplicate(Nil) -> Nil [1] goal(x) -> duplicate(x) [1] The TRS has the following type information: duplicate :: Cons:Nil -> Cons:Nil Cons :: a -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil goal :: Cons:Nil -> Cons:Nil 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: none And the following fresh constants: const ---------------------------------------- (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: duplicate(Cons(x, xs)) -> Cons(x, Cons(x, duplicate(xs))) [1] duplicate(Nil) -> Nil [1] goal(x) -> duplicate(x) [1] The TRS has the following type information: duplicate :: Cons:Nil -> Cons:Nil Cons :: a -> Cons:Nil -> Cons:Nil Nil :: Cons:Nil goal :: Cons:Nil -> Cons:Nil const :: a 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: Nil => 0 const => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: duplicate(z) -{ 1 }-> 0 :|: z = 0 duplicate(z) -{ 1 }-> 1 + x + (1 + x + duplicate(xs)) :|: z = 1 + x + xs, xs >= 0, x >= 0 goal(z) -{ 1 }-> duplicate(x) :|: x >= 0, z = x 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,[duplicate(V, Out)],[V >= 0]). eq(start(V),0,[goal(V, Out)],[V >= 0]). eq(duplicate(V, Out),1,[duplicate(V1, Ret11)],[Out = 2 + Ret11 + 2*V2,V = 1 + V1 + V2,V1 >= 0,V2 >= 0]). eq(duplicate(V, Out),1,[],[Out = 0,V = 0]). eq(goal(V, Out),1,[duplicate(V3, Ret)],[Out = Ret,V3 >= 0,V = V3]). input_output_vars(duplicate(V,Out),[V],[Out]). input_output_vars(goal(V,Out),[V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [duplicate/2] 1. non_recursive : [goal/2] 2. non_recursive : [start/1] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into duplicate/2 1. SCC is completely evaluated into other SCCs 2. SCC is partially evaluated into start/1 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations duplicate/2 * CE 4 is refined into CE [5] * CE 3 is refined into CE [6] ### Cost equations --> "Loop" of duplicate/2 * CEs [6] --> Loop 4 * CEs [5] --> Loop 5 ### Ranking functions of CR duplicate(V,Out) * RF of phase [4]: [V] #### Partial ranking functions of CR duplicate(V,Out) * Partial RF of phase [4]: - RF of loop [4:1]: V ### Specialization of cost equations start/1 * CE 1 is refined into CE [7,8] * CE 2 is refined into CE [9,10] ### Cost equations --> "Loop" of start/1 * CEs [8,10] --> Loop 6 * CEs [7,9] --> Loop 7 ### Ranking functions of CR start(V) #### Partial ranking functions of CR start(V) Computing Bounds ===================================== #### Cost of chains of duplicate(V,Out): * Chain [[4],5]: 1*it(4)+1 Such that:it(4) =< Out/2 with precondition: [2*V=Out,V>=1] * Chain [5]: 1 with precondition: [V=0,Out=0] #### Cost of chains of start(V): * Chain [7]: 2 with precondition: [V=0] * Chain [6]: 2*s(1)+2 Such that:aux(1) =< V s(1) =< aux(1) with precondition: [V>=1] Closed-form bounds of start(V): ------------------------------------- * Chain [7] with precondition: [V=0] - Upper bound: 2 - Complexity: constant * Chain [6] with precondition: [V>=1] - Upper bound: 2*V+2 - Complexity: n ### Maximum cost of start(V): 2*V+2 Asymptotic class: n * Total analysis performed in 35 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: duplicate(Cons(x, xs)) -> Cons(x, Cons(x, duplicate(xs))) duplicate(Nil) -> Nil goal(x) -> duplicate(x) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (13) SlicingProof (LOWER BOUND(ID)) Sliced the following arguments: Cons/0 ---------------------------------------- (14) 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: duplicate(Cons(xs)) -> Cons(Cons(duplicate(xs))) duplicate(Nil) -> Nil goal(x) -> duplicate(x) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (15) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (16) Obligation: Innermost TRS: Rules: duplicate(Cons(xs)) -> Cons(Cons(duplicate(xs))) duplicate(Nil) -> Nil goal(x) -> duplicate(x) Types: duplicate :: Cons:Nil -> Cons:Nil Cons :: Cons:Nil -> Cons:Nil Nil :: Cons:Nil goal :: Cons:Nil -> Cons:Nil hole_Cons:Nil1_0 :: Cons:Nil gen_Cons:Nil2_0 :: Nat -> Cons:Nil ---------------------------------------- (17) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: duplicate ---------------------------------------- (18) Obligation: Innermost TRS: Rules: duplicate(Cons(xs)) -> Cons(Cons(duplicate(xs))) duplicate(Nil) -> Nil goal(x) -> duplicate(x) Types: duplicate :: Cons:Nil -> Cons:Nil Cons :: Cons:Nil -> Cons:Nil Nil :: Cons:Nil goal :: Cons:Nil -> Cons:Nil hole_Cons:Nil1_0 :: Cons:Nil gen_Cons:Nil2_0 :: Nat -> Cons:Nil Generator Equations: gen_Cons:Nil2_0(0) <=> Nil gen_Cons:Nil2_0(+(x, 1)) <=> Cons(gen_Cons:Nil2_0(x)) The following defined symbols remain to be analysed: duplicate ---------------------------------------- (19) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: duplicate(gen_Cons:Nil2_0(n4_0)) -> gen_Cons:Nil2_0(*(2, n4_0)), rt in Omega(1 + n4_0) Induction Base: duplicate(gen_Cons:Nil2_0(0)) ->_R^Omega(1) Nil Induction Step: duplicate(gen_Cons:Nil2_0(+(n4_0, 1))) ->_R^Omega(1) Cons(Cons(duplicate(gen_Cons:Nil2_0(n4_0)))) ->_IH Cons(Cons(gen_Cons:Nil2_0(*(2, c5_0)))) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (20) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: duplicate(Cons(xs)) -> Cons(Cons(duplicate(xs))) duplicate(Nil) -> Nil goal(x) -> duplicate(x) Types: duplicate :: Cons:Nil -> Cons:Nil Cons :: Cons:Nil -> Cons:Nil Nil :: Cons:Nil goal :: Cons:Nil -> Cons:Nil hole_Cons:Nil1_0 :: Cons:Nil gen_Cons:Nil2_0 :: Nat -> Cons:Nil Generator Equations: gen_Cons:Nil2_0(0) <=> Nil gen_Cons:Nil2_0(+(x, 1)) <=> Cons(gen_Cons:Nil2_0(x)) The following defined symbols remain to be analysed: duplicate ---------------------------------------- (21) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (22) BOUNDS(n^1, INF)