/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^2)) 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^2). (0) CpxRelTRS (1) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 177 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, 537 ms] (12) BOUNDS(1, n^2) (13) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxRelTRS (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), 269 ms] (20) typed CpxTrs (21) RewriteLemmaProof [LOWER BOUND(ID), 18 ms] (22) BEST (23) proven lower bound (24) LowerBoundPropagationProof [FINISHED, 0 ms] (25) BOUNDS(n^1, INF) (26) typed CpxTrs (27) RewriteLemmaProof [LOWER BOUND(ID), 23 ms] (28) BOUNDS(1, INF) ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: overlap(Cons(x, xs), ys) -> overlap[Ite][True][Ite](member(x, ys), Cons(x, xs), ys) overlap(Nil, ys) -> False 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(xs, ys) -> overlap(xs, ys) 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 overlap[Ite][True][Ite](False, Cons(x, xs), ys) -> overlap(xs, ys) member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) overlap[Ite][True][Ite](True, xs, ys) -> True 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^2). The TRS R consists of the following rules: overlap(Cons(x, xs), ys) -> overlap[Ite][True][Ite](member(x, ys), Cons(x, xs), ys) overlap(Nil, ys) -> False 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(xs, ys) -> overlap(xs, ys) 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 overlap[Ite][True][Ite](False, Cons(x, xs), ys) -> overlap(xs, ys) member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) overlap[Ite][True][Ite](True, xs, ys) -> True 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^2). The TRS R consists of the following rules: overlap(Cons(x, xs), ys) -> overlap[Ite][True][Ite](member(x, ys), Cons(x, xs), ys) [1] overlap(Nil, ys) -> False [1] 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(xs, ys) -> overlap(xs, ys) [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] overlap[Ite][True][Ite](False, Cons(x, xs), ys) -> overlap(xs, ys) [0] member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) [0] overlap[Ite][True][Ite](True, xs, ys) -> True [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: overlap(Cons(x, xs), ys) -> overlap[Ite][True][Ite](member(x, ys), Cons(x, xs), ys) [1] overlap(Nil, ys) -> False [1] 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(xs, ys) -> overlap(xs, ys) [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] overlap[Ite][True][Ite](False, Cons(x, xs), ys) -> overlap(xs, ys) [0] member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) [0] overlap[Ite][True][Ite](True, xs, ys) -> True [0] member[Ite][True][Ite](True, x, xs) -> True [0] The TRS has the following type information: overlap :: Cons:Nil -> Cons:Nil -> False:True Cons :: S:0 -> Cons:Nil -> Cons:Nil overlap[Ite][True][Ite] :: False:True -> Cons:Nil -> Cons:Nil -> False:True member :: S:0 -> Cons:Nil -> False:True Nil :: Cons:Nil False :: False:True member[Ite][True][Ite] :: False:True -> S:0 -> Cons:Nil -> False:True !EQ :: S:0 -> S:0 -> False:True notEmpty :: Cons:Nil -> False:True True :: False:True goal :: Cons:Nil -> 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] overlap[Ite][True][Ite](v0, v1, v2) -> null_overlap[Ite][True][Ite] [0] member[Ite][True][Ite](v0, v1, v2) -> null_member[Ite][True][Ite] [0] And the following fresh constants: null_!EQ, null_overlap[Ite][True][Ite], 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: overlap(Cons(x, xs), ys) -> overlap[Ite][True][Ite](member(x, ys), Cons(x, xs), ys) [1] overlap(Nil, ys) -> False [1] 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(xs, ys) -> overlap(xs, ys) [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] overlap[Ite][True][Ite](False, Cons(x, xs), ys) -> overlap(xs, ys) [0] member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) [0] overlap[Ite][True][Ite](True, xs, ys) -> True [0] member[Ite][True][Ite](True, x, xs) -> True [0] !EQ(v0, v1) -> null_!EQ [0] overlap[Ite][True][Ite](v0, v1, v2) -> null_overlap[Ite][True][Ite] [0] member[Ite][True][Ite](v0, v1, v2) -> null_member[Ite][True][Ite] [0] The TRS has the following type information: overlap :: Cons:Nil -> Cons:Nil -> False:True:null_!EQ:null_overlap[Ite][True][Ite]:null_member[Ite][True][Ite] Cons :: S:0 -> Cons:Nil -> Cons:Nil overlap[Ite][True][Ite] :: False:True:null_!EQ:null_overlap[Ite][True][Ite]:null_member[Ite][True][Ite] -> Cons:Nil -> Cons:Nil -> False:True:null_!EQ:null_overlap[Ite][True][Ite]:null_member[Ite][True][Ite] member :: S:0 -> Cons:Nil -> False:True:null_!EQ:null_overlap[Ite][True][Ite]:null_member[Ite][True][Ite] Nil :: Cons:Nil False :: False:True:null_!EQ:null_overlap[Ite][True][Ite]:null_member[Ite][True][Ite] member[Ite][True][Ite] :: False:True:null_!EQ:null_overlap[Ite][True][Ite]:null_member[Ite][True][Ite] -> S:0 -> Cons:Nil -> False:True:null_!EQ:null_overlap[Ite][True][Ite]:null_member[Ite][True][Ite] !EQ :: S:0 -> S:0 -> False:True:null_!EQ:null_overlap[Ite][True][Ite]:null_member[Ite][True][Ite] notEmpty :: Cons:Nil -> False:True:null_!EQ:null_overlap[Ite][True][Ite]:null_member[Ite][True][Ite] True :: False:True:null_!EQ:null_overlap[Ite][True][Ite]:null_member[Ite][True][Ite] goal :: Cons:Nil -> Cons:Nil -> False:True:null_!EQ:null_overlap[Ite][True][Ite]:null_member[Ite][True][Ite] S :: S:0 -> S:0 0 :: S:0 null_!EQ :: False:True:null_!EQ:null_overlap[Ite][True][Ite]:null_member[Ite][True][Ite] null_overlap[Ite][True][Ite] :: False:True:null_!EQ:null_overlap[Ite][True][Ite]:null_member[Ite][True][Ite] null_member[Ite][True][Ite] :: False:True:null_!EQ:null_overlap[Ite][True][Ite]: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_overlap[Ite][True][Ite] => 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 }-> overlap(xs, ys) :|: xs >= 0, z = xs, z' = ys, ys >= 0 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 overlap(z, z') -{ 1 }-> overlap[Ite][True][Ite](member(x, ys), 1 + x + xs, ys) :|: z = 1 + x + xs, xs >= 0, z' = ys, ys >= 0, x >= 0 overlap(z, z') -{ 1 }-> 1 :|: z' = ys, ys >= 0, z = 0 overlap[Ite][True][Ite](z, z', z'') -{ 0 }-> overlap(xs, ys) :|: xs >= 0, z' = 1 + x + xs, z = 1, ys >= 0, x >= 0, z'' = ys overlap[Ite][True][Ite](z, z', z'') -{ 0 }-> 2 :|: z = 2, xs >= 0, ys >= 0, z'' = ys, z' = xs overlap[Ite][True][Ite](z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 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, V18),0,[overlap(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V18),0,[member(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V18),0,[notEmpty(V1, Out)],[V1 >= 0]). eq(start(V1, V, V18),0,[goal(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V18),0,[fun2(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V18),0,[fun(V1, V, V18, Out)],[V1 >= 0,V >= 0,V18 >= 0]). eq(start(V1, V, V18),0,[fun1(V1, V, V18, Out)],[V1 >= 0,V >= 0,V18 >= 0]). eq(overlap(V1, V, Out),1,[member(V4, V3, Ret0),fun(Ret0, 1 + V4 + V2, V3, Ret)],[Out = Ret,V1 = 1 + V2 + V4,V2 >= 0,V = V3,V3 >= 0,V4 >= 0]). eq(overlap(V1, V, Out),1,[],[Out = 1,V = V5,V5 >= 0,V1 = 0]). eq(member(V1, V, Out),1,[fun2(V6, V8, Ret01),fun1(Ret01, V8, 1 + V6 + V7, Ret1)],[Out = Ret1,V7 >= 0,V = 1 + V6 + V7,V8 >= 0,V6 >= 0,V1 = V8]). eq(member(V1, V, Out),1,[],[Out = 1,V9 >= 0,V1 = V9,V = 0]). eq(notEmpty(V1, Out),1,[],[Out = 2,V1 = 1 + V10 + V11,V11 >= 0,V10 >= 0]). eq(notEmpty(V1, Out),1,[],[Out = 1,V1 = 0]). eq(goal(V1, V, Out),1,[overlap(V12, V13, Ret2)],[Out = Ret2,V12 >= 0,V1 = V12,V = V13,V13 >= 0]). eq(fun2(V1, V, Out),0,[fun2(V14, V15, Ret3)],[Out = Ret3,V = 1 + V15,V14 >= 0,V15 >= 0,V1 = 1 + V14]). eq(fun2(V1, V, Out),0,[],[Out = 1,V = 1 + V16,V16 >= 0,V1 = 0]). eq(fun2(V1, V, Out),0,[],[Out = 1,V17 >= 0,V1 = 1 + V17,V = 0]). eq(fun2(V1, V, Out),0,[],[Out = 2,V1 = 0,V = 0]). eq(fun(V1, V, V18, Out),0,[overlap(V19, V20, Ret4)],[Out = Ret4,V19 >= 0,V = 1 + V19 + V21,V1 = 1,V20 >= 0,V21 >= 0,V18 = V20]). eq(fun1(V1, V, V18, Out),0,[member(V24, V23, Ret5)],[Out = Ret5,V = V24,V23 >= 0,V1 = 1,V24 >= 0,V22 >= 0,V18 = 1 + V22 + V23]). eq(fun(V1, V, V18, Out),0,[],[Out = 2,V1 = 2,V26 >= 0,V25 >= 0,V18 = V25,V = V26]). eq(fun1(V1, V, V18, Out),0,[],[Out = 2,V1 = 2,V28 >= 0,V = V27,V27 >= 0,V18 = V28]). eq(fun2(V1, V, Out),0,[],[Out = 0,V30 >= 0,V29 >= 0,V1 = V30,V = V29]). eq(fun(V1, V, V18, Out),0,[],[Out = 0,V32 >= 0,V18 = V33,V31 >= 0,V1 = V32,V = V31,V33 >= 0]). eq(fun1(V1, V, V18, Out),0,[],[Out = 0,V36 >= 0,V18 = V34,V35 >= 0,V1 = V36,V = V35,V34 >= 0]). input_output_vars(overlap(V1,V,Out),[V1,V],[Out]). 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(fun2(V1,V,Out),[V1,V],[Out]). input_output_vars(fun(V1,V,V18,Out),[V1,V,V18],[Out]). input_output_vars(fun1(V1,V,V18,Out),[V1,V,V18],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun2/3] 1. recursive : [fun1/4,member/3] 2. recursive : [fun/4,overlap/3] 3. non_recursive : [goal/3] 4. non_recursive : [notEmpty/2] 5. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun2/3 1. SCC is partially evaluated into member/3 2. SCC is partially evaluated into overlap/3 3. SCC is completely evaluated into other SCCs 4. SCC is partially evaluated into notEmpty/2 5. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun2/3 * CE 23 is refined into CE [24] * CE 21 is refined into CE [25] * CE 20 is refined into CE [26] * CE 22 is refined into CE [27] * CE 19 is refined into CE [28] ### Cost equations --> "Loop" of fun2/3 * CEs [28] --> Loop 18 * CEs [24] --> Loop 19 * CEs [25] --> Loop 20 * CEs [26] --> Loop 21 * CEs [27] --> Loop 22 ### Ranking functions of CR fun2(V1,V,Out) * RF of phase [18]: [V,V1] #### Partial ranking functions of CR fun2(V1,V,Out) * Partial RF of phase [18]: - RF of loop [18:1]: V V1 ### Specialization of cost equations member/3 * CE 14 is refined into CE [29,30] * CE 13 is refined into CE [31,32,33,34,35,36,37] * CE 16 is refined into CE [38] * CE 15 is refined into CE [39,40,41,42] ### Cost equations --> "Loop" of member/3 * CEs [39,41,42] --> Loop 23 * CEs [40] --> Loop 24 * CEs [30] --> Loop 25 * CEs [38] --> Loop 26 * CEs [29] --> Loop 27 * CEs [31,32,33,34,35,36,37] --> Loop 28 ### Ranking functions of CR member(V1,V,Out) * RF of phase [23]: [V] * RF of phase [24]: [V-1] #### Partial ranking functions of CR member(V1,V,Out) * Partial RF of phase [23]: - RF of loop [23:1]: V * Partial RF of phase [24]: - RF of loop [24:1]: V-1 ### Specialization of cost equations overlap/3 * CE 10 is refined into CE [43,44] * CE 9 is refined into CE [45,46,47,48,49,50] * CE 12 is refined into CE [51] * CE 11 is refined into CE [52,53,54] ### Cost equations --> "Loop" of overlap/3 * CEs [52] --> Loop 29 * CEs [54] --> Loop 30 * CEs [53] --> Loop 31 * CEs [43,44] --> Loop 32 * CEs [45,46,47,49,50] --> Loop 33 * CEs [48] --> Loop 34 * CEs [51] --> Loop 35 ### Ranking functions of CR overlap(V1,V,Out) * RF of phase [29,30]: [V1,V1+V-2] * RF of phase [31]: [V1] #### Partial ranking functions of CR overlap(V1,V,Out) * Partial RF of phase [29,30]: - RF of loop [29:1]: V1 - RF of loop [30:1]: V1-1 * Partial RF of phase [31]: - RF of loop [31:1]: V1 ### Specialization of cost equations notEmpty/2 * CE 17 is refined into CE [55] * CE 18 is refined into CE [56] ### Cost equations --> "Loop" of notEmpty/2 * CEs [55] --> Loop 36 * CEs [56] --> Loop 37 ### Ranking functions of CR notEmpty(V1,Out) #### Partial ranking functions of CR notEmpty(V1,Out) ### Specialization of cost equations start/3 * CE 2 is refined into CE [57,58,59,60,61,62] * CE 1 is refined into CE [63] * CE 3 is refined into CE [64,65,66,67,68,69] * CE 4 is refined into CE [70,71,72,73,74,75] * CE 5 is refined into CE [76,77,78,79,80,81] * CE 6 is refined into CE [82,83] * CE 7 is refined into CE [84,85,86,87,88,89] * CE 8 is refined into CE [90,91,92,93,94,95,96] ### Cost equations --> "Loop" of start/3 * CEs [96] --> Loop 38 * CEs [71,72,79,85,86,92] --> Loop 39 * CEs [57,58,59,83] --> Loop 40 * CEs [60,61,62,63,64,65,66,67,68,69,73,74,75,76,80,81,87,88,89,93,94,95] --> Loop 41 * CEs [70,77,78,82,84,90,91] --> Loop 42 ### Ranking functions of CR start(V1,V,V18) #### Partial ranking functions of CR start(V1,V,V18) Computing Bounds ===================================== #### Cost of chains of fun2(V1,V,Out): * Chain [[18],22]: 0 with precondition: [Out=2,V1=V,V1>=1] * Chain [[18],21]: 0 with precondition: [Out=1,V1>=1,V>=V1+1] * Chain [[18],20]: 0 with precondition: [Out=1,V>=1,V1>=V+1] * Chain [[18],19]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [22]: 0 with precondition: [V1=0,V=0,Out=2] * Chain [21]: 0 with precondition: [V1=0,Out=1,V>=1] * Chain [20]: 0 with precondition: [V=0,Out=1,V1>=1] * Chain [19]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of member(V1,V,Out): * Chain [[24],28]: 1*it(24)+1 Such that:it(24) =< V with precondition: [V1=0,Out=0,V>=2] * Chain [[24],27]: 1*it(24)+1 Such that:it(24) =< V with precondition: [V1=0,Out=2,V>=2] * Chain [[24],26]: 1*it(24)+1 Such that:it(24) =< V with precondition: [V1=0,Out=1,V>=2] * Chain [[23],28]: 1*it(23)+1 Such that:it(23) =< V with precondition: [Out=0,V1>=1,V>=2] * Chain [[23],26]: 1*it(23)+1 Such that:it(23) =< V with precondition: [Out=1,V1>=1,V>=1] * Chain [[23],25]: 1*it(23)+1 Such that:it(23) =< -V1+V with precondition: [Out=2,V1>=1,V>=V1+2] * Chain [28]: 1 with precondition: [Out=0,V1>=0,V>=1] * Chain [27]: 1 with precondition: [V1=0,Out=2,V>=1] * Chain [26]: 1 with precondition: [V=0,Out=1,V1>=0] * Chain [25]: 1 with precondition: [Out=2,V1>=1,V>=V1+1] #### Cost of chains of overlap(V1,V,Out): * Chain [[31],35]: 2*it(31)+1 Such that:it(31) =< V1 with precondition: [V=0,Out=1,V1>=1] * Chain [[31],34]: 2*it(31)+2 Such that:it(31) =< V1 with precondition: [V=0,Out=0,V1>=2] * Chain [[29,30],35]: 4*it(29)+1*s(9)+1*s(10)+1 Such that:aux(5) =< V1+V aux(2) =< V aux(8) =< V1 it(29) =< aux(8) it(29) =< aux(5) aux(3) =< aux(2) s(9) =< it(29)*aux(2) s(10) =< it(29)*aux(3) with precondition: [Out=1,V1>=1,V>=1,V+V1>=3] * Chain [[29,30],33]: 4*it(29)+1*s(9)+1*s(10)+6*s(12)+2 Such that:aux(5) =< V1+V aux(10) =< V1 aux(11) =< V s(12) =< aux(11) it(29) =< aux(10) it(29) =< aux(5) aux(3) =< aux(11) s(9) =< it(29)*aux(11) s(10) =< it(29)*aux(3) with precondition: [Out=0,V1>=2,V>=1] * Chain [[29,30],32]: 4*it(29)+1*s(9)+1*s(10)+2*s(17)+2 Such that:aux(5) =< V1+V aux(13) =< V1 aux(14) =< V s(17) =< aux(14) it(29) =< aux(13) it(29) =< aux(5) aux(3) =< aux(14) s(9) =< it(29)*aux(14) s(10) =< it(29)*aux(3) with precondition: [Out=2,V1>=2,V>=1] * Chain [35]: 1 with precondition: [V1=0,Out=1,V>=0] * Chain [34]: 2 with precondition: [V=0,Out=0,V1>=1] * Chain [33]: 6*s(12)+2 Such that:aux(9) =< V s(12) =< aux(9) with precondition: [Out=0,V1>=1,V>=1] * Chain [32]: 2*s(17)+2 Such that:aux(12) =< V s(17) =< aux(12) with precondition: [Out=2,V1>=1,V>=1] #### Cost of chains of notEmpty(V1,Out): * Chain [37]: 1 with precondition: [V1=0,Out=1] * Chain [36]: 1 with precondition: [Out=2,V1>=1] #### Cost of chains of start(V1,V,V18): * Chain [42]: 2*s(40)+2 Such that:aux(17) =< V s(40) =< aux(17) with precondition: [V1=0] * Chain [41]: 21*s(45)+12*s(46)+3*s(48)+3*s(49)+1*s(70)+35*s(74)+24*s(75)+6*s(77)+6*s(78)+1*s(97)+3 Such that:s(97) =< -V1+V s(70) =< -V+V18 aux(18) =< V1 aux(19) =< V1+V aux(20) =< V aux(21) =< V+V18 aux(22) =< V18 s(74) =< aux(20) s(45) =< aux(22) s(75) =< aux(18) s(75) =< aux(19) s(76) =< aux(20) s(77) =< s(75)*aux(20) s(78) =< s(75)*s(76) s(46) =< aux(20) s(46) =< aux(21) s(47) =< aux(22) s(48) =< s(46)*aux(22) s(49) =< s(46)*s(47) with precondition: [V1>=0,V>=0] * Chain [40]: 4*s(121)+2 Such that:aux(23) =< V s(121) =< aux(23) with precondition: [V1>=1] * Chain [39]: 8*s(123)+3 Such that:aux(24) =< V1 s(123) =< aux(24) with precondition: [V=0,V1>=0] * Chain [38]: 0 with precondition: [V1=V,V1>=1] Closed-form bounds of start(V1,V,V18): ------------------------------------- * Chain [42] with precondition: [V1=0] - Upper bound: nat(V)*2+2 - Complexity: n * Chain [41] with precondition: [V1>=0,V>=0] - Upper bound: 24*V1+3+12*V1*V+47*V+6*V*nat(V18)+nat(V18)*21+nat(-V1+V)+nat(-V+V18) - Complexity: n^2 * Chain [40] with precondition: [V1>=1] - Upper bound: nat(V)*4+2 - Complexity: n * Chain [39] with precondition: [V=0,V1>=0] - Upper bound: 8*V1+3 - Complexity: n * Chain [38] with precondition: [V1=V,V1>=1] - Upper bound: 0 - Complexity: constant ### Maximum cost of start(V1,V,V18): max([8*V1+3,24*V1+1+12*V1*nat(V)+nat(V)*43+nat(V)*6*nat(V18)+nat(V18)*21+nat(-V1+V)+nat(-V+V18)+nat(V)*2+(nat(V)*2+2)]) Asymptotic class: n^2 * Total analysis performed in 495 ms. ---------------------------------------- (12) BOUNDS(1, n^2) ---------------------------------------- (13) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (14) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: overlap(Cons(x, xs), ys) -> overlap[Ite][True][Ite](member(x, ys), Cons(x, xs), ys) overlap(Nil, ys) -> False 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(xs, ys) -> overlap(xs, ys) 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 overlap[Ite][True][Ite](False, Cons(x, xs), ys) -> overlap(xs, ys) member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) overlap[Ite][True][Ite](True, xs, ys) -> True member[Ite][True][Ite](True, x, xs) -> True Rewrite Strategy: INNERMOST ---------------------------------------- (15) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (16) Obligation: Innermost TRS: Rules: overlap(Cons(x, xs), ys) -> overlap[Ite][True][Ite](member(x, ys), Cons(x, xs), ys) overlap(Nil, ys) -> False 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(xs, ys) -> overlap(xs, ys) !EQ(S(x), S(y)) -> !EQ(x, y) !EQ(0', S(y)) -> False !EQ(S(x), 0') -> False !EQ(0', 0') -> True overlap[Ite][True][Ite](False, Cons(x, xs), ys) -> overlap(xs, ys) member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) overlap[Ite][True][Ite](True, xs, ys) -> True member[Ite][True][Ite](True, x, xs) -> True Types: overlap :: Cons:Nil -> Cons:Nil -> False:True Cons :: S:0' -> Cons:Nil -> Cons:Nil overlap[Ite][True][Ite] :: False:True -> Cons:Nil -> Cons:Nil -> False:True member :: S:0' -> Cons:Nil -> False:True Nil :: Cons:Nil False :: False:True member[Ite][True][Ite] :: False:True -> S:0' -> Cons:Nil -> False:True !EQ :: S:0' -> S:0' -> False:True notEmpty :: Cons:Nil -> False:True True :: False:True goal :: Cons:Nil -> Cons:Nil -> False:True S :: S:0' -> S:0' 0' :: S:0' hole_False:True1_0 :: False:True hole_Cons:Nil2_0 :: Cons:Nil hole_S:0'3_0 :: S:0' gen_Cons:Nil4_0 :: Nat -> Cons:Nil gen_S:0'5_0 :: Nat -> S:0' ---------------------------------------- (17) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: overlap, member, !EQ They will be analysed ascendingly in the following order: member < overlap !EQ < member ---------------------------------------- (18) Obligation: Innermost TRS: Rules: overlap(Cons(x, xs), ys) -> overlap[Ite][True][Ite](member(x, ys), Cons(x, xs), ys) overlap(Nil, ys) -> False 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(xs, ys) -> overlap(xs, ys) !EQ(S(x), S(y)) -> !EQ(x, y) !EQ(0', S(y)) -> False !EQ(S(x), 0') -> False !EQ(0', 0') -> True overlap[Ite][True][Ite](False, Cons(x, xs), ys) -> overlap(xs, ys) member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) overlap[Ite][True][Ite](True, xs, ys) -> True member[Ite][True][Ite](True, x, xs) -> True Types: overlap :: Cons:Nil -> Cons:Nil -> False:True Cons :: S:0' -> Cons:Nil -> Cons:Nil overlap[Ite][True][Ite] :: False:True -> Cons:Nil -> Cons:Nil -> False:True member :: S:0' -> Cons:Nil -> False:True Nil :: Cons:Nil False :: False:True member[Ite][True][Ite] :: False:True -> S:0' -> Cons:Nil -> False:True !EQ :: S:0' -> S:0' -> False:True notEmpty :: Cons:Nil -> False:True True :: False:True goal :: Cons:Nil -> Cons:Nil -> False:True S :: S:0' -> S:0' 0' :: S:0' hole_False:True1_0 :: False:True hole_Cons:Nil2_0 :: Cons:Nil hole_S:0'3_0 :: S:0' gen_Cons:Nil4_0 :: Nat -> Cons:Nil gen_S:0'5_0 :: Nat -> S:0' Generator Equations: gen_Cons:Nil4_0(0) <=> Nil gen_Cons:Nil4_0(+(x, 1)) <=> Cons(0', gen_Cons:Nil4_0(x)) gen_S:0'5_0(0) <=> 0' gen_S:0'5_0(+(x, 1)) <=> S(gen_S:0'5_0(x)) The following defined symbols remain to be analysed: !EQ, overlap, member They will be analysed ascendingly in the following order: member < overlap !EQ < member ---------------------------------------- (19) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: !EQ(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) -> False, rt in Omega(0) Induction Base: !EQ(gen_S:0'5_0(0), gen_S:0'5_0(+(1, 0))) ->_R^Omega(0) False Induction Step: !EQ(gen_S:0'5_0(+(n7_0, 1)), gen_S:0'5_0(+(1, +(n7_0, 1)))) ->_R^Omega(0) !EQ(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) ->_IH False We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (20) Obligation: Innermost TRS: Rules: overlap(Cons(x, xs), ys) -> overlap[Ite][True][Ite](member(x, ys), Cons(x, xs), ys) overlap(Nil, ys) -> False 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(xs, ys) -> overlap(xs, ys) !EQ(S(x), S(y)) -> !EQ(x, y) !EQ(0', S(y)) -> False !EQ(S(x), 0') -> False !EQ(0', 0') -> True overlap[Ite][True][Ite](False, Cons(x, xs), ys) -> overlap(xs, ys) member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) overlap[Ite][True][Ite](True, xs, ys) -> True member[Ite][True][Ite](True, x, xs) -> True Types: overlap :: Cons:Nil -> Cons:Nil -> False:True Cons :: S:0' -> Cons:Nil -> Cons:Nil overlap[Ite][True][Ite] :: False:True -> Cons:Nil -> Cons:Nil -> False:True member :: S:0' -> Cons:Nil -> False:True Nil :: Cons:Nil False :: False:True member[Ite][True][Ite] :: False:True -> S:0' -> Cons:Nil -> False:True !EQ :: S:0' -> S:0' -> False:True notEmpty :: Cons:Nil -> False:True True :: False:True goal :: Cons:Nil -> Cons:Nil -> False:True S :: S:0' -> S:0' 0' :: S:0' hole_False:True1_0 :: False:True hole_Cons:Nil2_0 :: Cons:Nil hole_S:0'3_0 :: S:0' gen_Cons:Nil4_0 :: Nat -> Cons:Nil gen_S:0'5_0 :: Nat -> S:0' Lemmas: !EQ(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) -> False, rt in Omega(0) Generator Equations: gen_Cons:Nil4_0(0) <=> Nil gen_Cons:Nil4_0(+(x, 1)) <=> Cons(0', gen_Cons:Nil4_0(x)) gen_S:0'5_0(0) <=> 0' gen_S:0'5_0(+(x, 1)) <=> S(gen_S:0'5_0(x)) The following defined symbols remain to be analysed: member, overlap They will be analysed ascendingly in the following order: member < overlap ---------------------------------------- (21) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: member(gen_S:0'5_0(1), gen_Cons:Nil4_0(n286_0)) -> False, rt in Omega(1 + n286_0) Induction Base: member(gen_S:0'5_0(1), gen_Cons:Nil4_0(0)) ->_R^Omega(1) False Induction Step: member(gen_S:0'5_0(1), gen_Cons:Nil4_0(+(n286_0, 1))) ->_R^Omega(1) member[Ite][True][Ite](!EQ(0', gen_S:0'5_0(1)), gen_S:0'5_0(1), Cons(0', gen_Cons:Nil4_0(n286_0))) ->_L^Omega(0) member[Ite][True][Ite](False, gen_S:0'5_0(1), Cons(0', gen_Cons:Nil4_0(n286_0))) ->_R^Omega(0) member(gen_S:0'5_0(1), gen_Cons:Nil4_0(n286_0)) ->_IH False We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (22) Complex Obligation (BEST) ---------------------------------------- (23) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: overlap(Cons(x, xs), ys) -> overlap[Ite][True][Ite](member(x, ys), Cons(x, xs), ys) overlap(Nil, ys) -> False 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(xs, ys) -> overlap(xs, ys) !EQ(S(x), S(y)) -> !EQ(x, y) !EQ(0', S(y)) -> False !EQ(S(x), 0') -> False !EQ(0', 0') -> True overlap[Ite][True][Ite](False, Cons(x, xs), ys) -> overlap(xs, ys) member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) overlap[Ite][True][Ite](True, xs, ys) -> True member[Ite][True][Ite](True, x, xs) -> True Types: overlap :: Cons:Nil -> Cons:Nil -> False:True Cons :: S:0' -> Cons:Nil -> Cons:Nil overlap[Ite][True][Ite] :: False:True -> Cons:Nil -> Cons:Nil -> False:True member :: S:0' -> Cons:Nil -> False:True Nil :: Cons:Nil False :: False:True member[Ite][True][Ite] :: False:True -> S:0' -> Cons:Nil -> False:True !EQ :: S:0' -> S:0' -> False:True notEmpty :: Cons:Nil -> False:True True :: False:True goal :: Cons:Nil -> Cons:Nil -> False:True S :: S:0' -> S:0' 0' :: S:0' hole_False:True1_0 :: False:True hole_Cons:Nil2_0 :: Cons:Nil hole_S:0'3_0 :: S:0' gen_Cons:Nil4_0 :: Nat -> Cons:Nil gen_S:0'5_0 :: Nat -> S:0' Lemmas: !EQ(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) -> False, rt in Omega(0) Generator Equations: gen_Cons:Nil4_0(0) <=> Nil gen_Cons:Nil4_0(+(x, 1)) <=> Cons(0', gen_Cons:Nil4_0(x)) gen_S:0'5_0(0) <=> 0' gen_S:0'5_0(+(x, 1)) <=> S(gen_S:0'5_0(x)) The following defined symbols remain to be analysed: member, overlap They will be analysed ascendingly in the following order: member < overlap ---------------------------------------- (24) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (25) BOUNDS(n^1, INF) ---------------------------------------- (26) Obligation: Innermost TRS: Rules: overlap(Cons(x, xs), ys) -> overlap[Ite][True][Ite](member(x, ys), Cons(x, xs), ys) overlap(Nil, ys) -> False 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(xs, ys) -> overlap(xs, ys) !EQ(S(x), S(y)) -> !EQ(x, y) !EQ(0', S(y)) -> False !EQ(S(x), 0') -> False !EQ(0', 0') -> True overlap[Ite][True][Ite](False, Cons(x, xs), ys) -> overlap(xs, ys) member[Ite][True][Ite](False, x', Cons(x, xs)) -> member(x', xs) overlap[Ite][True][Ite](True, xs, ys) -> True member[Ite][True][Ite](True, x, xs) -> True Types: overlap :: Cons:Nil -> Cons:Nil -> False:True Cons :: S:0' -> Cons:Nil -> Cons:Nil overlap[Ite][True][Ite] :: False:True -> Cons:Nil -> Cons:Nil -> False:True member :: S:0' -> Cons:Nil -> False:True Nil :: Cons:Nil False :: False:True member[Ite][True][Ite] :: False:True -> S:0' -> Cons:Nil -> False:True !EQ :: S:0' -> S:0' -> False:True notEmpty :: Cons:Nil -> False:True True :: False:True goal :: Cons:Nil -> Cons:Nil -> False:True S :: S:0' -> S:0' 0' :: S:0' hole_False:True1_0 :: False:True hole_Cons:Nil2_0 :: Cons:Nil hole_S:0'3_0 :: S:0' gen_Cons:Nil4_0 :: Nat -> Cons:Nil gen_S:0'5_0 :: Nat -> S:0' Lemmas: !EQ(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) -> False, rt in Omega(0) member(gen_S:0'5_0(1), gen_Cons:Nil4_0(n286_0)) -> False, rt in Omega(1 + n286_0) Generator Equations: gen_Cons:Nil4_0(0) <=> Nil gen_Cons:Nil4_0(+(x, 1)) <=> Cons(0', gen_Cons:Nil4_0(x)) gen_S:0'5_0(0) <=> 0' gen_S:0'5_0(+(x, 1)) <=> S(gen_S:0'5_0(x)) The following defined symbols remain to be analysed: overlap ---------------------------------------- (27) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: overlap(gen_Cons:Nil4_0(n633_0), gen_Cons:Nil4_0(0)) -> False, rt in Omega(1 + n633_0) Induction Base: overlap(gen_Cons:Nil4_0(0), gen_Cons:Nil4_0(0)) ->_R^Omega(1) False Induction Step: overlap(gen_Cons:Nil4_0(+(n633_0, 1)), gen_Cons:Nil4_0(0)) ->_R^Omega(1) overlap[Ite][True][Ite](member(0', gen_Cons:Nil4_0(0)), Cons(0', gen_Cons:Nil4_0(n633_0)), gen_Cons:Nil4_0(0)) ->_R^Omega(1) overlap[Ite][True][Ite](False, Cons(0', gen_Cons:Nil4_0(n633_0)), gen_Cons:Nil4_0(0)) ->_R^Omega(0) overlap(gen_Cons:Nil4_0(n633_0), gen_Cons:Nil4_0(0)) ->_IH False We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (28) BOUNDS(1, INF)