/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 (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), 0 ms] (10) CpxRNTS (11) CompleteCoflocoProof [FINISHED, 157 ms] (12) BOUNDS(1, n^1) (13) RenamingProof [BOTH BOUNDS(ID, 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), 3478 ms] (20) proven lower bound (21) LowerBoundPropagationProof [FINISHED, 0 ms] (22) BOUNDS(n^1, INF) ---------------------------------------- (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: a__f(X, X) -> a__f(a, b) a__b -> a mark(f(X1, X2)) -> a__f(mark(X1), X2) mark(b) -> a__b mark(a) -> a a__f(X1, X2) -> f(X1, X2) a__b -> b S is empty. Rewrite Strategy: FULL ---------------------------------------- (1) RcToIrcProof (BOTH BOUNDS(ID, ID)) Converted rc-obligation to irc-obligation. As the TRS is a non-duplicating overlay system, 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: a__f(X, X) -> a__f(a, b) a__b -> a mark(f(X1, X2)) -> a__f(mark(X1), X2) mark(b) -> a__b mark(a) -> a a__f(X1, X2) -> f(X1, X2) a__b -> b 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: a__f(X, X) -> a__f(a, b) [1] a__b -> a [1] mark(f(X1, X2)) -> a__f(mark(X1), X2) [1] mark(b) -> a__b [1] mark(a) -> a [1] a__f(X1, X2) -> f(X1, X2) [1] a__b -> b [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: a__f(X, X) -> a__f(a, b) [1] a__b -> a [1] mark(f(X1, X2)) -> a__f(mark(X1), X2) [1] mark(b) -> a__b [1] mark(a) -> a [1] a__f(X1, X2) -> f(X1, X2) [1] a__b -> b [1] The TRS has the following type information: a__f :: a:b:f -> a:b:f -> a:b:f a :: a:b:f b :: a:b:f a__b :: a:b:f mark :: a:b:f -> a:b:f f :: a:b:f -> a:b:f -> a:b:f 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: none And the following fresh constants: none ---------------------------------------- (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: a__f(X, X) -> a__f(a, b) [1] a__b -> a [1] mark(f(X1, X2)) -> a__f(mark(X1), X2) [1] mark(b) -> a__b [1] mark(a) -> a [1] a__f(X1, X2) -> f(X1, X2) [1] a__b -> b [1] The TRS has the following type information: a__f :: a:b:f -> a:b:f -> a:b:f a :: a:b:f b :: a:b:f a__b :: a:b:f mark :: a:b:f -> a:b:f f :: a:b:f -> a:b:f -> a:b:f 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: a => 0 b => 1 ---------------------------------------- (10) Obligation: Complexity RNTS consisting of the following rules: a__b -{ 1 }-> 1 :|: a__b -{ 1 }-> 0 :|: a__f(z, z') -{ 1 }-> a__f(0, 1) :|: z' = X, X >= 0, z = X a__f(z, z') -{ 1 }-> 1 + X1 + X2 :|: X1 >= 0, X2 >= 0, z = X1, z' = X2 mark(z) -{ 1 }-> a__f(mark(X1), X2) :|: X1 >= 0, X2 >= 0, z = 1 + X1 + X2 mark(z) -{ 1 }-> a__b :|: z = 1 mark(z) -{ 1 }-> 0 :|: z = 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,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[fun1(Out)],[]). eq(start(V1, V),0,[mark(V1, Out)],[V1 >= 0]). eq(fun(V1, V, Out),1,[fun(0, 1, Ret)],[Out = Ret,V = X3,X3 >= 0,V1 = X3]). eq(fun1(Out),1,[],[Out = 0]). eq(mark(V1, Out),1,[mark(X11, Ret0),fun(Ret0, X21, Ret1)],[Out = Ret1,X11 >= 0,X21 >= 0,V1 = 1 + X11 + X21]). eq(mark(V1, Out),1,[fun1(Ret2)],[Out = Ret2,V1 = 1]). eq(mark(V1, Out),1,[],[Out = 0,V1 = 0]). eq(fun(V1, V, Out),1,[],[Out = 1 + X12 + X22,X12 >= 0,X22 >= 0,V1 = X12,V = X22]). eq(fun1(Out),1,[],[Out = 1]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(Out),[],[Out]). input_output_vars(mark(V1,Out),[V1],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun/3] 1. non_recursive : [fun1/1] 2. recursive [non_tail] : [mark/2] 3. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun/3 1. SCC is partially evaluated into fun1/1 2. SCC is partially evaluated into mark/2 3. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/3 * CE 5 is refined into CE [11] * CE 4 is refined into CE [12] ### Cost equations --> "Loop" of fun/3 * CEs [12] --> Loop 9 * CEs [11] --> Loop 10 ### Ranking functions of CR fun(V1,V,Out) #### Partial ranking functions of CR fun(V1,V,Out) ### Specialization of cost equations fun1/1 * CE 7 is refined into CE [13] * CE 6 is refined into CE [14] ### Cost equations --> "Loop" of fun1/1 * CEs [13] --> Loop 11 * CEs [14] --> Loop 12 ### Ranking functions of CR fun1(Out) #### Partial ranking functions of CR fun1(Out) ### Specialization of cost equations mark/2 * CE 9 is refined into CE [15,16] * CE 10 is refined into CE [17] * CE 8 is refined into CE [18,19] ### Cost equations --> "Loop" of mark/2 * CEs [19] --> Loop 13 * CEs [18] --> Loop 14 * CEs [16] --> Loop 15 * CEs [15] --> Loop 16 * CEs [17] --> Loop 17 ### Ranking functions of CR mark(V1,Out) * RF of phase [13,14]: [V1] #### Partial ranking functions of CR mark(V1,Out) * Partial RF of phase [13,14]: - RF of loop [13:1,14:1]: V1 ### Specialization of cost equations start/2 * CE 1 is refined into CE [20,21] * CE 2 is refined into CE [22,23] * CE 3 is refined into CE [24,25,26] ### Cost equations --> "Loop" of start/2 * CEs [20,21,22,23,24,25,26] --> Loop 18 ### Ranking functions of CR start(V1,V) #### Partial ranking functions of CR start(V1,V) Computing Bounds ===================================== #### Cost of chains of fun(V1,V,Out): * Chain [10]: 1 with precondition: [V+V1+1=Out,V1>=0,V>=0] * Chain [9,10]: 2 with precondition: [Out=2,V1=V,V1>=0] #### Cost of chains of fun1(Out): * Chain [12]: 1 with precondition: [Out=0] * Chain [11]: 1 with precondition: [Out=1] #### Cost of chains of mark(V1,Out): * Chain [[13,14],17]: 5*it(13)+1 Such that:aux(3) =< V1 it(13) =< aux(3) with precondition: [V1>=1,Out>=1,V1+1>=Out] * Chain [[13,14],16]: 5*it(13)+2 Such that:aux(4) =< V1 it(13) =< aux(4) with precondition: [V1>=2,Out>=1,V1>=Out] * Chain [[13,14],15]: 5*it(13)+2 Such that:aux(5) =< V1 it(13) =< aux(5) with precondition: [Out>=2,V1>=Out] * Chain [17]: 1 with precondition: [V1=0,Out=0] * Chain [16]: 2 with precondition: [V1=1,Out=0] * Chain [15]: 2 with precondition: [V1=1,Out=1] #### Cost of chains of start(V1,V): * Chain [18]: 15*s(8)+2 Such that:s(7) =< V1 s(8) =< s(7) with precondition: [] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [18] with precondition: [] - Upper bound: nat(V1)*15+2 - Complexity: n ### Maximum cost of start(V1,V): nat(V1)*15+2 Asymptotic class: n * Total analysis performed in 97 ms. ---------------------------------------- (12) BOUNDS(1, n^1) ---------------------------------------- (13) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (14) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: a__f(X, X) -> a__f(a, b) a__b -> a mark(f(X1, X2)) -> a__f(mark(X1), X2) mark(b) -> a__b mark(a) -> a a__f(X1, X2) -> f(X1, X2) a__b -> b S is empty. Rewrite Strategy: FULL ---------------------------------------- (15) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (16) Obligation: TRS: Rules: a__f(X, X) -> a__f(a, b) a__b -> a mark(f(X1, X2)) -> a__f(mark(X1), X2) mark(b) -> a__b mark(a) -> a a__f(X1, X2) -> f(X1, X2) a__b -> b Types: a__f :: a:b:f -> a:b:f -> a:b:f a :: a:b:f b :: a:b:f a__b :: a:b:f mark :: a:b:f -> a:b:f f :: a:b:f -> a:b:f -> a:b:f hole_a:b:f1_0 :: a:b:f gen_a:b:f2_0 :: Nat -> a:b:f ---------------------------------------- (17) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: a__f, mark They will be analysed ascendingly in the following order: a__f < mark ---------------------------------------- (18) Obligation: TRS: Rules: a__f(X, X) -> a__f(a, b) a__b -> a mark(f(X1, X2)) -> a__f(mark(X1), X2) mark(b) -> a__b mark(a) -> a a__f(X1, X2) -> f(X1, X2) a__b -> b Types: a__f :: a:b:f -> a:b:f -> a:b:f a :: a:b:f b :: a:b:f a__b :: a:b:f mark :: a:b:f -> a:b:f f :: a:b:f -> a:b:f -> a:b:f hole_a:b:f1_0 :: a:b:f gen_a:b:f2_0 :: Nat -> a:b:f Generator Equations: gen_a:b:f2_0(0) <=> a gen_a:b:f2_0(+(x, 1)) <=> f(gen_a:b:f2_0(x), a) The following defined symbols remain to be analysed: a__f, mark They will be analysed ascendingly in the following order: a__f < mark ---------------------------------------- (19) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: mark(gen_a:b:f2_0(+(1, n22_0))) -> *3_0, rt in Omega(n22_0) Induction Base: mark(gen_a:b:f2_0(+(1, 0))) Induction Step: mark(gen_a:b:f2_0(+(1, +(n22_0, 1)))) ->_R^Omega(1) a__f(mark(gen_a:b:f2_0(+(1, n22_0))), a) ->_IH a__f(*3_0, a) 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: TRS: Rules: a__f(X, X) -> a__f(a, b) a__b -> a mark(f(X1, X2)) -> a__f(mark(X1), X2) mark(b) -> a__b mark(a) -> a a__f(X1, X2) -> f(X1, X2) a__b -> b Types: a__f :: a:b:f -> a:b:f -> a:b:f a :: a:b:f b :: a:b:f a__b :: a:b:f mark :: a:b:f -> a:b:f f :: a:b:f -> a:b:f -> a:b:f hole_a:b:f1_0 :: a:b:f gen_a:b:f2_0 :: Nat -> a:b:f Generator Equations: gen_a:b:f2_0(0) <=> a gen_a:b:f2_0(+(x, 1)) <=> f(gen_a:b:f2_0(x), a) The following defined symbols remain to be analysed: mark ---------------------------------------- (21) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (22) BOUNDS(n^1, INF)