/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 (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, 158 ms] (12) BOUNDS(1, n^1) (13) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] (14) TRS for Loop Detection (15) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] (16) BEST (17) proven lower bound (18) LowerBoundPropagationProof [FINISHED, 0 ms] (19) BOUNDS(n^1, INF) (20) TRS for Loop Detection ---------------------------------------- (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 96 ms. ---------------------------------------- (12) BOUNDS(1, n^1) ---------------------------------------- (13) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) Transformed a relative TRS into a decreasing-loop problem. ---------------------------------------- (14) 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^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 ---------------------------------------- (15) DecreasingLoopProof (LOWER BOUND(ID)) The following loop(s) give(s) rise to the lower bound Omega(n^1): The rewrite sequence mark(f(X1, X2)) ->^+ a__f(mark(X1), X2) gives rise to a decreasing loop by considering the right hand sides subterm at position [0]. The pumping substitution is [X1 / f(X1, X2)]. The result substitution is [ ]. ---------------------------------------- (16) Complex Obligation (BEST) ---------------------------------------- (17) 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^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 ---------------------------------------- (18) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (19) BOUNDS(n^1, INF) ---------------------------------------- (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^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