/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^1)) proof of /export/starexec/sandbox/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 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), 2 ms] (4) CpxTypedWeightedTrs (5) CompletionProof [UPPER BOUND(ID), 0 ms] (6) CpxTypedWeightedCompleteTrs (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (8) CpxRNTS (9) CompleteCoflocoProof [FINISHED, 136 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), 412 ms] (18) BEST (19) proven lower bound (20) LowerBoundPropagationProof [FINISHED, 0 ms] (21) BOUNDS(n^1, INF) (22) typed CpxTrs ---------------------------------------- (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: ackin(s(X), s(Y)) -> u21(ackin(s(X), Y), X) u21(ackout(X), Y) -> u22(ackin(Y, 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: ackin(s(X), s(Y)) -> u21(ackin(s(X), Y), X) [1] u21(ackout(X), Y) -> u22(ackin(Y, 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: ackin(s(X), s(Y)) -> u21(ackin(s(X), Y), X) [1] u21(ackout(X), Y) -> u22(ackin(Y, X)) [1] The TRS has the following type information: ackin :: s -> s -> ackout:u22 s :: s -> s u21 :: ackout:u22 -> s -> ackout:u22 ackout :: s -> ackout:u22 u22 :: ackout:u22 -> ackout:u22 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: ackin(v0, v1) -> null_ackin [0] u21(v0, v1) -> null_u21 [0] And the following fresh constants: null_ackin, null_u21, 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: ackin(s(X), s(Y)) -> u21(ackin(s(X), Y), X) [1] u21(ackout(X), Y) -> u22(ackin(Y, X)) [1] ackin(v0, v1) -> null_ackin [0] u21(v0, v1) -> null_u21 [0] The TRS has the following type information: ackin :: s -> s -> ackout:u22:null_ackin:null_u21 s :: s -> s u21 :: ackout:u22:null_ackin:null_u21 -> s -> ackout:u22:null_ackin:null_u21 ackout :: s -> ackout:u22:null_ackin:null_u21 u22 :: ackout:u22:null_ackin:null_u21 -> ackout:u22:null_ackin:null_u21 null_ackin :: ackout:u22:null_ackin:null_u21 null_u21 :: ackout:u22:null_ackin:null_u21 const :: s 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: null_ackin => 0 null_u21 => 0 const => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: ackin(z, z') -{ 1 }-> u21(ackin(1 + X, Y), X) :|: z = 1 + X, Y >= 0, z' = 1 + Y, X >= 0 ackin(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 u21(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 u21(z, z') -{ 1 }-> 1 + ackin(Y, X) :|: z = 1 + X, z' = Y, Y >= 0, X >= 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(V1, V),0,[ackin(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[u21(V1, V, Out)],[V1 >= 0,V >= 0]). eq(ackin(V1, V, Out),1,[ackin(1 + X1, Y1, Ret0),u21(Ret0, X1, Ret)],[Out = Ret,V1 = 1 + X1,Y1 >= 0,V = 1 + Y1,X1 >= 0]). eq(u21(V1, V, Out),1,[ackin(Y2, X2, Ret1)],[Out = 1 + Ret1,V1 = 1 + X2,V = Y2,Y2 >= 0,X2 >= 0]). eq(ackin(V1, V, Out),0,[],[Out = 0,V3 >= 0,V2 >= 0,V1 = V3,V = V2]). eq(u21(V1, V, Out),0,[],[Out = 0,V5 >= 0,V4 >= 0,V1 = V5,V = V4]). input_output_vars(ackin(V1,V,Out),[V1,V],[Out]). input_output_vars(u21(V1,V,Out),[V1,V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive [multiple] : [ackin/3,u21/3] 1. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into ackin/3 1. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations ackin/3 * CE 6 is refined into CE [7] * CE 5 is refined into CE [8] * CE 4 is refined into CE [9] ### Cost equations --> "Loop" of ackin/3 * CEs [9] --> Loop 5 * CEs [8] --> Loop 6 * CEs [7] --> Loop 7 ### Ranking functions of CR ackin(V1,V,Out) #### Partial ranking functions of CR ackin(V1,V,Out) * Partial RF of phase [5,6]: - RF of loop [5:1,6:1]: V depends on loops [6:2] - RF of loop [6:2]: V1 ### Specialization of cost equations start/2 * CE 1 is refined into CE [10] * CE 2 is refined into CE [11] * CE 3 is refined into CE [12] ### Cost equations --> "Loop" of start/2 * CEs [10,11,12] --> Loop 8 ### Ranking functions of CR start(V1,V) #### Partial ranking functions of CR start(V1,V) Computing Bounds ===================================== #### Cost of chains of ackin(V1,V,Out): * Chain [7]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [multiple([5,6],[[7]])]: 1*it(5)+0 Such that:it(5) =< V with precondition: [Out=0,V1>=1,V>=1] #### Cost of chains of start(V1,V): * Chain [8]: 1*s(2)+1*s(3)+1 Such that:s(2) =< V1 s(3) =< V with precondition: [V1>=0,V>=0] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [8] with precondition: [V1>=0,V>=0] - Upper bound: V1+V+1 - Complexity: n ### Maximum cost of start(V1,V): V1+V+1 Asymptotic class: n * Total analysis performed in 74 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: ackin(s(X), s(Y)) -> u21(ackin(s(X), Y), X) u21(ackout(X), Y) -> u22(ackin(Y, X)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (13) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (14) Obligation: Innermost TRS: Rules: ackin(s(X), s(Y)) -> u21(ackin(s(X), Y), X) u21(ackout(X), Y) -> u22(ackin(Y, X)) Types: ackin :: s -> s -> ackout:u22 s :: s -> s u21 :: ackout:u22 -> s -> ackout:u22 ackout :: s -> ackout:u22 u22 :: ackout:u22 -> ackout:u22 hole_ackout:u221_0 :: ackout:u22 hole_s2_0 :: s gen_ackout:u223_0 :: Nat -> ackout:u22 gen_s4_0 :: Nat -> s ---------------------------------------- (15) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: ackin, u21 They will be analysed ascendingly in the following order: ackin = u21 ---------------------------------------- (16) Obligation: Innermost TRS: Rules: ackin(s(X), s(Y)) -> u21(ackin(s(X), Y), X) u21(ackout(X), Y) -> u22(ackin(Y, X)) Types: ackin :: s -> s -> ackout:u22 s :: s -> s u21 :: ackout:u22 -> s -> ackout:u22 ackout :: s -> ackout:u22 u22 :: ackout:u22 -> ackout:u22 hole_ackout:u221_0 :: ackout:u22 hole_s2_0 :: s gen_ackout:u223_0 :: Nat -> ackout:u22 gen_s4_0 :: Nat -> s Generator Equations: gen_ackout:u223_0(0) <=> ackout(hole_s2_0) gen_ackout:u223_0(+(x, 1)) <=> u22(gen_ackout:u223_0(x)) gen_s4_0(0) <=> hole_s2_0 gen_s4_0(+(x, 1)) <=> s(gen_s4_0(x)) The following defined symbols remain to be analysed: u21, ackin They will be analysed ascendingly in the following order: ackin = u21 ---------------------------------------- (17) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: ackin(gen_s4_0(1), gen_s4_0(+(1, n115_0))) -> *5_0, rt in Omega(n115_0) Induction Base: ackin(gen_s4_0(1), gen_s4_0(+(1, 0))) Induction Step: ackin(gen_s4_0(1), gen_s4_0(+(1, +(n115_0, 1)))) ->_R^Omega(1) u21(ackin(s(gen_s4_0(0)), gen_s4_0(+(1, n115_0))), gen_s4_0(0)) ->_IH u21(*5_0, gen_s4_0(0)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (18) Complex Obligation (BEST) ---------------------------------------- (19) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: ackin(s(X), s(Y)) -> u21(ackin(s(X), Y), X) u21(ackout(X), Y) -> u22(ackin(Y, X)) Types: ackin :: s -> s -> ackout:u22 s :: s -> s u21 :: ackout:u22 -> s -> ackout:u22 ackout :: s -> ackout:u22 u22 :: ackout:u22 -> ackout:u22 hole_ackout:u221_0 :: ackout:u22 hole_s2_0 :: s gen_ackout:u223_0 :: Nat -> ackout:u22 gen_s4_0 :: Nat -> s Generator Equations: gen_ackout:u223_0(0) <=> ackout(hole_s2_0) gen_ackout:u223_0(+(x, 1)) <=> u22(gen_ackout:u223_0(x)) gen_s4_0(0) <=> hole_s2_0 gen_s4_0(+(x, 1)) <=> s(gen_s4_0(x)) The following defined symbols remain to be analysed: ackin They will be analysed ascendingly in the following order: ackin = u21 ---------------------------------------- (20) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (21) BOUNDS(n^1, INF) ---------------------------------------- (22) Obligation: Innermost TRS: Rules: ackin(s(X), s(Y)) -> u21(ackin(s(X), Y), X) u21(ackout(X), Y) -> u22(ackin(Y, X)) Types: ackin :: s -> s -> ackout:u22 s :: s -> s u21 :: ackout:u22 -> s -> ackout:u22 ackout :: s -> ackout:u22 u22 :: ackout:u22 -> ackout:u22 hole_ackout:u221_0 :: ackout:u22 hole_s2_0 :: s gen_ackout:u223_0 :: Nat -> ackout:u22 gen_s4_0 :: Nat -> s Lemmas: ackin(gen_s4_0(1), gen_s4_0(+(1, n115_0))) -> *5_0, rt in Omega(n115_0) Generator Equations: gen_ackout:u223_0(0) <=> ackout(hole_s2_0) gen_ackout:u223_0(+(x, 1)) <=> u22(gen_ackout:u223_0(x)) gen_s4_0(0) <=> hole_s2_0 gen_s4_0(+(x, 1)) <=> s(gen_s4_0(x)) The following defined symbols remain to be analysed: u21 They will be analysed ascendingly in the following order: ackin = u21