/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: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxRelTRS (1) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 143 ms] (2) CpxRelTRS (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, 333 ms] (12) BOUNDS(1, n^1) (13) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] (14) TRS for Loop Detection (15) DecreasingLoopProof [LOWER BOUND(ID), 2 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 (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: member(x', Cons(x, xs)) -> member[Ite][True][Ite](!EQ(x', x), x', Cons(x, xs)) member(x, Nil) -> False notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(x, xs) -> member(x, xs) The (relative) TRS S consists of the following rules: !EQ(S(x), S(y)) -> !EQ(x, y) !EQ(0, S(y)) -> False !EQ(S(x), 0) -> False !EQ(0, 0) -> True member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) member[Ite][True][Ite](True, x, xs) -> True Rewrite Strategy: INNERMOST ---------------------------------------- (1) SInnermostTerminationProof (BOTH CONCRETE BOUNDS(ID, ID)) proved innermost termination of relative rules ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: member(x', Cons(x, xs)) -> member[Ite][True][Ite](!EQ(x', x), x', Cons(x, xs)) member(x, Nil) -> False notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(x, xs) -> member(x, xs) The (relative) TRS S consists of the following rules: !EQ(S(x), S(y)) -> !EQ(x, y) !EQ(0, S(y)) -> False !EQ(S(x), 0) -> False !EQ(0, 0) -> True member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) member[Ite][True][Ite](True, x, xs) -> True 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: member(x', Cons(x, xs)) -> member[Ite][True][Ite](!EQ(x', x), x', Cons(x, xs)) [1] member(x, Nil) -> False [1] notEmpty(Cons(x, xs)) -> True [1] notEmpty(Nil) -> False [1] goal(x, xs) -> member(x, xs) [1] !EQ(S(x), S(y)) -> !EQ(x, y) [0] !EQ(0, S(y)) -> False [0] !EQ(S(x), 0) -> False [0] !EQ(0, 0) -> True [0] member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) [0] member[Ite][True][Ite](True, x, xs) -> True [0] 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: member(x', Cons(x, xs)) -> member[Ite][True][Ite](!EQ(x', x), x', Cons(x, xs)) [1] member(x, Nil) -> False [1] notEmpty(Cons(x, xs)) -> True [1] notEmpty(Nil) -> False [1] goal(x, xs) -> member(x, xs) [1] !EQ(S(x), S(y)) -> !EQ(x, y) [0] !EQ(0, S(y)) -> False [0] !EQ(S(x), 0) -> False [0] !EQ(0, 0) -> True [0] member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) [0] member[Ite][True][Ite](True, x, xs) -> True [0] The TRS has the following type information: member :: S:0 -> Cons:Nil -> False:True Cons :: S:0 -> Cons:Nil -> Cons:Nil member[Ite][True][Ite] :: False:True -> S:0 -> Cons:Nil -> False:True !EQ :: S:0 -> S:0 -> False:True Nil :: Cons:Nil False :: False:True notEmpty :: Cons:Nil -> False:True True :: False:True goal :: S:0 -> Cons:Nil -> False:True S :: S:0 -> S:0 0 :: S:0 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: !EQ(v0, v1) -> null_!EQ [0] member[Ite][True][Ite](v0, v1, v2) -> null_member[Ite][True][Ite] [0] And the following fresh constants: null_!EQ, null_member[Ite][True][Ite] ---------------------------------------- (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: member(x', Cons(x, xs)) -> member[Ite][True][Ite](!EQ(x', x), x', Cons(x, xs)) [1] member(x, Nil) -> False [1] notEmpty(Cons(x, xs)) -> True [1] notEmpty(Nil) -> False [1] goal(x, xs) -> member(x, xs) [1] !EQ(S(x), S(y)) -> !EQ(x, y) [0] !EQ(0, S(y)) -> False [0] !EQ(S(x), 0) -> False [0] !EQ(0, 0) -> True [0] member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) [0] member[Ite][True][Ite](True, x, xs) -> True [0] !EQ(v0, v1) -> null_!EQ [0] member[Ite][True][Ite](v0, v1, v2) -> null_member[Ite][True][Ite] [0] The TRS has the following type information: member :: S:0 -> Cons:Nil -> False:True:null_!EQ:null_member[Ite][True][Ite] Cons :: S:0 -> Cons:Nil -> Cons:Nil member[Ite][True][Ite] :: False:True:null_!EQ:null_member[Ite][True][Ite] -> S:0 -> Cons:Nil -> False:True:null_!EQ:null_member[Ite][True][Ite] !EQ :: S:0 -> S:0 -> False:True:null_!EQ:null_member[Ite][True][Ite] Nil :: Cons:Nil False :: False:True:null_!EQ:null_member[Ite][True][Ite] notEmpty :: Cons:Nil -> False:True:null_!EQ:null_member[Ite][True][Ite] True :: False:True:null_!EQ:null_member[Ite][True][Ite] goal :: S:0 -> Cons:Nil -> False:True:null_!EQ:null_member[Ite][True][Ite] S :: S:0 -> S:0 0 :: S:0 null_!EQ :: False:True:null_!EQ:null_member[Ite][True][Ite] null_member[Ite][True][Ite] :: False:True:null_!EQ:null_member[Ite][True][Ite] 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: Nil => 0 False => 1 True => 2 0 => 0 null_!EQ => 0 null_member[Ite][True][Ite] => 0 ---------------------------------------- (10) Obligation: Complexity RNTS consisting of the following rules: !EQ(z, z') -{ 0 }-> 2 :|: z = 0, z' = 0 !EQ(z, z') -{ 0 }-> 1 :|: z' = 1 + y, y >= 0, z = 0 !EQ(z, z') -{ 0 }-> 1 :|: x >= 0, z = 1 + x, z' = 0 !EQ(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 !EQ(z, z') -{ 0 }-> !EQ(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x goal(z, z') -{ 1 }-> member(x, xs) :|: xs >= 0, x >= 0, z' = xs, z = x member(z, z') -{ 1 }-> member[Ite][True][Ite](!EQ(x', x), x', 1 + x + xs) :|: xs >= 0, z' = 1 + x + xs, x' >= 0, x >= 0, z = x' member(z, z') -{ 1 }-> 1 :|: x >= 0, z = x, z' = 0 member[Ite][True][Ite](z, z', z'') -{ 0 }-> member(x', xs) :|: z' = x', xs >= 0, z = 1, x' >= 0, x >= 0, z'' = 1 + x + xs member[Ite][True][Ite](z, z', z'') -{ 0 }-> 2 :|: z = 2, xs >= 0, z' = x, x >= 0, z'' = xs member[Ite][True][Ite](z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: 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, V14),0,[member(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V14),0,[notEmpty(V1, Out)],[V1 >= 0]). eq(start(V1, V, V14),0,[goal(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V14),0,[fun1(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V14),0,[fun(V1, V, V14, Out)],[V1 >= 0,V >= 0,V14 >= 0]). eq(member(V1, V, Out),1,[fun1(V3, V4, Ret0),fun(Ret0, V3, 1 + V4 + V2, Ret)],[Out = Ret,V2 >= 0,V = 1 + V2 + V4,V3 >= 0,V4 >= 0,V1 = V3]). eq(member(V1, V, Out),1,[],[Out = 1,V5 >= 0,V1 = V5,V = 0]). eq(notEmpty(V1, Out),1,[],[Out = 2,V1 = 1 + V6 + V7,V7 >= 0,V6 >= 0]). eq(notEmpty(V1, Out),1,[],[Out = 1,V1 = 0]). eq(goal(V1, V, Out),1,[member(V8, V9, Ret1)],[Out = Ret1,V9 >= 0,V8 >= 0,V = V9,V1 = V8]). eq(fun1(V1, V, Out),0,[fun1(V10, V11, Ret2)],[Out = Ret2,V = 1 + V11,V10 >= 0,V11 >= 0,V1 = 1 + V10]). eq(fun1(V1, V, Out),0,[],[Out = 1,V = 1 + V12,V12 >= 0,V1 = 0]). eq(fun1(V1, V, Out),0,[],[Out = 1,V13 >= 0,V1 = 1 + V13,V = 0]). eq(fun1(V1, V, Out),0,[],[Out = 2,V1 = 0,V = 0]). eq(fun(V1, V, V14, Out),0,[member(V17, V16, Ret3)],[Out = Ret3,V = V17,V16 >= 0,V1 = 1,V17 >= 0,V15 >= 0,V14 = 1 + V15 + V16]). eq(fun(V1, V, V14, Out),0,[],[Out = 2,V1 = 2,V18 >= 0,V = V19,V19 >= 0,V14 = V18]). eq(fun1(V1, V, Out),0,[],[Out = 0,V21 >= 0,V20 >= 0,V1 = V21,V = V20]). eq(fun(V1, V, V14, Out),0,[],[Out = 0,V23 >= 0,V14 = V24,V22 >= 0,V1 = V23,V = V22,V24 >= 0]). input_output_vars(member(V1,V,Out),[V1,V],[Out]). input_output_vars(notEmpty(V1,Out),[V1],[Out]). input_output_vars(goal(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,V,Out),[V1,V],[Out]). input_output_vars(fun(V1,V,V14,Out),[V1,V,V14],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun1/3] 1. recursive : [fun/4,member/3] 2. non_recursive : [goal/3] 3. non_recursive : [notEmpty/2] 4. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun1/3 1. SCC is partially evaluated into member/3 2. SCC is completely evaluated into other SCCs 3. SCC is partially evaluated into notEmpty/2 4. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun1/3 * CE 17 is refined into CE [18] * CE 15 is refined into CE [19] * CE 14 is refined into CE [20] * CE 16 is refined into CE [21] * CE 13 is refined into CE [22] ### Cost equations --> "Loop" of fun1/3 * CEs [22] --> Loop 13 * CEs [18] --> Loop 14 * CEs [19] --> Loop 15 * CEs [20] --> Loop 16 * CEs [21] --> Loop 17 ### Ranking functions of CR fun1(V1,V,Out) * RF of phase [13]: [V,V1] #### Partial ranking functions of CR fun1(V1,V,Out) * Partial RF of phase [13]: - RF of loop [13:1]: V V1 ### Specialization of cost equations member/3 * CE 8 is refined into CE [23,24] * CE 7 is refined into CE [25,26,27,28,29,30,31] * CE 10 is refined into CE [32] * CE 9 is refined into CE [33,34,35,36] ### Cost equations --> "Loop" of member/3 * CEs [34,35,36] --> Loop 18 * CEs [33] --> Loop 19 * CEs [24] --> Loop 20 * CEs [32] --> Loop 21 * CEs [23] --> Loop 22 * CEs [25,26,27,28,29,30,31] --> Loop 23 ### Ranking functions of CR member(V1,V,Out) * RF of phase [18]: [V] * RF of phase [19]: [V-1] #### Partial ranking functions of CR member(V1,V,Out) * Partial RF of phase [18]: - RF of loop [18:1]: V * Partial RF of phase [19]: - RF of loop [19:1]: V-1 ### Specialization of cost equations notEmpty/2 * CE 11 is refined into CE [37] * CE 12 is refined into CE [38] ### Cost equations --> "Loop" of notEmpty/2 * CEs [37] --> Loop 24 * CEs [38] --> Loop 25 ### Ranking functions of CR notEmpty(V1,Out) #### Partial ranking functions of CR notEmpty(V1,Out) ### Specialization of cost equations start/3 * CE 1 is refined into CE [39] * CE 2 is refined into CE [40,41,42,43,44,45] * CE 3 is refined into CE [46,47,48,49,50,51] * CE 4 is refined into CE [52,53] * CE 5 is refined into CE [54,55,56,57,58,59] * CE 6 is refined into CE [60,61,62,63,64,65,66] ### Cost equations --> "Loop" of start/3 * CEs [53,66] --> Loop 26 * CEs [49,57,62] --> Loop 27 * CEs [39,40,41,42,43,44,45,46,50,51,54,58,59,63,64,65] --> Loop 28 * CEs [47,48,52,55,56,60,61] --> Loop 29 ### Ranking functions of CR start(V1,V,V14) #### Partial ranking functions of CR start(V1,V,V14) Computing Bounds ===================================== #### Cost of chains of fun1(V1,V,Out): * Chain [[13],17]: 0 with precondition: [Out=2,V1=V,V1>=1] * Chain [[13],16]: 0 with precondition: [Out=1,V1>=1,V>=V1+1] * Chain [[13],15]: 0 with precondition: [Out=1,V>=1,V1>=V+1] * Chain [[13],14]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [17]: 0 with precondition: [V1=0,V=0,Out=2] * Chain [16]: 0 with precondition: [V1=0,Out=1,V>=1] * Chain [15]: 0 with precondition: [V=0,Out=1,V1>=1] * Chain [14]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of member(V1,V,Out): * Chain [[19],23]: 1*it(19)+1 Such that:it(19) =< V with precondition: [V1=0,Out=0,V>=2] * Chain [[19],22]: 1*it(19)+1 Such that:it(19) =< V with precondition: [V1=0,Out=2,V>=2] * Chain [[19],21]: 1*it(19)+1 Such that:it(19) =< V with precondition: [V1=0,Out=1,V>=2] * Chain [[18],23]: 1*it(18)+1 Such that:it(18) =< V with precondition: [Out=0,V1>=1,V>=2] * Chain [[18],21]: 1*it(18)+1 Such that:it(18) =< V with precondition: [Out=1,V1>=1,V>=1] * Chain [[18],20]: 1*it(18)+1 Such that:it(18) =< -V1+V with precondition: [Out=2,V1>=1,V>=V1+2] * Chain [23]: 1 with precondition: [Out=0,V1>=0,V>=1] * Chain [22]: 1 with precondition: [V1=0,Out=2,V>=1] * Chain [21]: 1 with precondition: [V=0,Out=1,V1>=0] * Chain [20]: 1 with precondition: [Out=2,V1>=1,V>=V1+1] #### Cost of chains of notEmpty(V1,Out): * Chain [25]: 1 with precondition: [V1=0,Out=1] * Chain [24]: 1 with precondition: [Out=2,V1>=1] #### Cost of chains of start(V1,V,V14): * Chain [29]: 4*s(5)+2 Such that:aux(2) =< V s(5) =< aux(2) with precondition: [V1=0] * Chain [28]: 5*s(10)+1*s(14)+6*s(16)+2*s(18)+2 Such that:s(14) =< -V+V14 aux(3) =< -V1+V aux(4) =< V aux(5) =< V14 s(18) =< aux(3) s(16) =< aux(4) s(10) =< aux(5) with precondition: [V1>=0,V>=0] * Chain [27]: 2 with precondition: [V=0,V1>=0] * Chain [26]: 1 with precondition: [V1>=1] Closed-form bounds of start(V1,V,V14): ------------------------------------- * Chain [29] with precondition: [V1=0] - Upper bound: nat(V)*4+2 - Complexity: n * Chain [28] with precondition: [V1>=0,V>=0] - Upper bound: 6*V+2+nat(V14)*5+nat(-V1+V)*2+nat(-V+V14) - Complexity: n * Chain [27] with precondition: [V=0,V1>=0] - Upper bound: 2 - Complexity: constant * Chain [26] with precondition: [V1>=1] - Upper bound: 1 - Complexity: constant ### Maximum cost of start(V1,V,V14): nat(V14)*5+nat(V)*2+nat(-V1+V)*2+nat(-V+V14)+nat(V)*4+2 Asymptotic class: n * Total analysis performed in 272 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 (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: member(x', Cons(x, xs)) -> member[Ite][True][Ite](!EQ(x', x), x', Cons(x, xs)) member(x, Nil) -> False notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(x, xs) -> member(x, xs) The (relative) TRS S consists of the following rules: !EQ(S(x), S(y)) -> !EQ(x, y) !EQ(0, S(y)) -> False !EQ(S(x), 0) -> False !EQ(0, 0) -> True member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) member[Ite][True][Ite](True, x, xs) -> True Rewrite Strategy: INNERMOST ---------------------------------------- (15) DecreasingLoopProof (LOWER BOUND(ID)) The following loop(s) give(s) rise to the lower bound Omega(n^1): The rewrite sequence member(0, Cons(S(y1_0), xs)) ->^+ member(0, xs) gives rise to a decreasing loop by considering the right hand sides subterm at position []. The pumping substitution is [xs / Cons(S(y1_0), xs)]. The result substitution is [ ]. ---------------------------------------- (16) Complex Obligation (BEST) ---------------------------------------- (17) Obligation: Proved the lower bound n^1 for the following obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: member(x', Cons(x, xs)) -> member[Ite][True][Ite](!EQ(x', x), x', Cons(x, xs)) member(x, Nil) -> False notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(x, xs) -> member(x, xs) The (relative) TRS S consists of the following rules: !EQ(S(x), S(y)) -> !EQ(x, y) !EQ(0, S(y)) -> False !EQ(S(x), 0) -> False !EQ(0, 0) -> True member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) member[Ite][True][Ite](True, x, xs) -> True Rewrite Strategy: INNERMOST ---------------------------------------- (18) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (19) BOUNDS(n^1, INF) ---------------------------------------- (20) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: member(x', Cons(x, xs)) -> member[Ite][True][Ite](!EQ(x', x), x', Cons(x, xs)) member(x, Nil) -> False notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(x, xs) -> member(x, xs) The (relative) TRS S consists of the following rules: !EQ(S(x), S(y)) -> !EQ(x, y) !EQ(0, S(y)) -> False !EQ(S(x), 0) -> False !EQ(0, 0) -> True member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) member[Ite][True][Ite](True, x, xs) -> True Rewrite Strategy: INNERMOST