/export/starexec/sandbox2/solver/bin/starexec_run_complexity /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^3), O(n^3)) proof of /export/starexec/sandbox2/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^3, n^3). (0) CpxTRS (1) RcToIrcProof [BOTH BOUNDS(ID, ID), 2 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, 503 ms] (12) BOUNDS(1, n^3) (13) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxTRS (15) SlicingProof [LOWER BOUND(ID), 0 ms] (16) CpxTRS (17) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (18) typed CpxTrs (19) OrderProof [LOWER BOUND(ID), 0 ms] (20) typed CpxTrs (21) RewriteLemmaProof [LOWER BOUND(ID), 293 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), 87 ms] (28) typed CpxTrs (29) RewriteLemmaProof [LOWER BOUND(ID), 35 ms] (30) BEST (31) proven lower bound (32) LowerBoundPropagationProof [FINISHED, 0 ms] (33) BOUNDS(n^2, INF) (34) typed CpxTrs (35) RewriteLemmaProof [LOWER BOUND(ID), 0 ms] (36) BEST (37) proven lower bound (38) LowerBoundPropagationProof [FINISHED, 0 ms] (39) BOUNDS(n^3, INF) (40) typed CpxTrs (41) RewriteLemmaProof [LOWER BOUND(ID), 21 ms] (42) typed CpxTrs (43) RewriteLemmaProof [LOWER BOUND(ID), 43 ms] (44) BOUNDS(1, INF) ---------------------------------------- (0) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^3, n^3). The TRS R consists of the following rules: minus(x, 0) -> x minus(s(x), s(y)) -> minus(x, y) quot(0, s(y)) -> 0 quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(n, x), y) -> add(n, app(x, y)) reverse(nil) -> nil reverse(add(n, x)) -> app(reverse(x), add(n, nil)) shuffle(nil) -> nil shuffle(add(n, x)) -> add(n, shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) S is empty. Rewrite Strategy: FULL ---------------------------------------- (1) RcToIrcProof (BOTH BOUNDS(ID, ID)) Converted rc-obligation to irc-obligation. The duplicating contexts are: quot(s(x), s([])) The defined contexts are: quot([], s(x1)) shuffle([]) less_leaves([], x1) less_leaves(x0, []) app([], add(x1, nil)) minus([], x1) app([], x1) reverse([]) concat([], x1) concat(x0, []) app(x0, add([], nil)) app(x0, []) [] just represents basic- or constructor-terms in the following defined contexts: quot([], s(x1)) As the TRS is an overlay system and the defined contexts and the duplicating contexts don't overlap, we have rc = irc. ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^3). The TRS R consists of the following rules: minus(x, 0) -> x minus(s(x), s(y)) -> minus(x, y) quot(0, s(y)) -> 0 quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(n, x), y) -> add(n, app(x, y)) reverse(nil) -> nil reverse(add(n, x)) -> app(reverse(x), add(n, nil)) shuffle(nil) -> nil shuffle(add(n, x)) -> add(n, shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) 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^3). The TRS R consists of the following rules: minus(x, 0) -> x [1] minus(s(x), s(y)) -> minus(x, y) [1] quot(0, s(y)) -> 0 [1] quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) [1] app(nil, y) -> y [1] app(add(n, x), y) -> add(n, app(x, y)) [1] reverse(nil) -> nil [1] reverse(add(n, x)) -> app(reverse(x), add(n, nil)) [1] shuffle(nil) -> nil [1] shuffle(add(n, x)) -> add(n, shuffle(reverse(x))) [1] concat(leaf, y) -> y [1] concat(cons(u, v), y) -> cons(u, concat(v, y)) [1] less_leaves(x, leaf) -> false [1] less_leaves(leaf, cons(w, z)) -> true [1] less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) [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: minus(x, 0) -> x [1] minus(s(x), s(y)) -> minus(x, y) [1] quot(0, s(y)) -> 0 [1] quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) [1] app(nil, y) -> y [1] app(add(n, x), y) -> add(n, app(x, y)) [1] reverse(nil) -> nil [1] reverse(add(n, x)) -> app(reverse(x), add(n, nil)) [1] shuffle(nil) -> nil [1] shuffle(add(n, x)) -> add(n, shuffle(reverse(x))) [1] concat(leaf, y) -> y [1] concat(cons(u, v), y) -> cons(u, concat(v, y)) [1] less_leaves(x, leaf) -> false [1] less_leaves(leaf, cons(w, z)) -> true [1] less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) [1] The TRS has the following type information: minus :: 0:s -> 0:s -> 0:s 0 :: 0:s s :: 0:s -> 0:s quot :: 0:s -> 0:s -> 0:s app :: nil:add -> nil:add -> nil:add nil :: nil:add add :: a -> nil:add -> nil:add reverse :: nil:add -> nil:add shuffle :: nil:add -> nil:add concat :: leaf:cons -> leaf:cons -> leaf:cons leaf :: leaf:cons cons :: leaf:cons -> leaf:cons -> leaf:cons less_leaves :: leaf:cons -> leaf:cons -> false:true false :: false:true true :: false:true 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: minus(v0, v1) -> null_minus [0] quot(v0, v1) -> null_quot [0] And the following fresh constants: null_minus, null_quot, const ---------------------------------------- (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: minus(x, 0) -> x [1] minus(s(x), s(y)) -> minus(x, y) [1] quot(0, s(y)) -> 0 [1] quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) [1] app(nil, y) -> y [1] app(add(n, x), y) -> add(n, app(x, y)) [1] reverse(nil) -> nil [1] reverse(add(n, x)) -> app(reverse(x), add(n, nil)) [1] shuffle(nil) -> nil [1] shuffle(add(n, x)) -> add(n, shuffle(reverse(x))) [1] concat(leaf, y) -> y [1] concat(cons(u, v), y) -> cons(u, concat(v, y)) [1] less_leaves(x, leaf) -> false [1] less_leaves(leaf, cons(w, z)) -> true [1] less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) [1] minus(v0, v1) -> null_minus [0] quot(v0, v1) -> null_quot [0] The TRS has the following type information: minus :: 0:s:null_minus:null_quot -> 0:s:null_minus:null_quot -> 0:s:null_minus:null_quot 0 :: 0:s:null_minus:null_quot s :: 0:s:null_minus:null_quot -> 0:s:null_minus:null_quot quot :: 0:s:null_minus:null_quot -> 0:s:null_minus:null_quot -> 0:s:null_minus:null_quot app :: nil:add -> nil:add -> nil:add nil :: nil:add add :: a -> nil:add -> nil:add reverse :: nil:add -> nil:add shuffle :: nil:add -> nil:add concat :: leaf:cons -> leaf:cons -> leaf:cons leaf :: leaf:cons cons :: leaf:cons -> leaf:cons -> leaf:cons less_leaves :: leaf:cons -> leaf:cons -> false:true false :: false:true true :: false:true null_minus :: 0:s:null_minus:null_quot null_quot :: 0:s:null_minus:null_quot const :: a 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: 0 => 0 nil => 0 leaf => 0 false => 0 true => 1 null_minus => 0 null_quot => 0 const => 0 ---------------------------------------- (10) Obligation: Complexity RNTS consisting of the following rules: app(z', z'') -{ 1 }-> y :|: z'' = y, y >= 0, z' = 0 app(z', z'') -{ 1 }-> 1 + n + app(x, y) :|: n >= 0, z'' = y, z' = 1 + n + x, x >= 0, y >= 0 concat(z', z'') -{ 1 }-> y :|: z'' = y, y >= 0, z' = 0 concat(z', z'') -{ 1 }-> 1 + u + concat(v, y) :|: v >= 0, z' = 1 + u + v, z'' = y, y >= 0, u >= 0 less_leaves(z', z'') -{ 1 }-> less_leaves(concat(u, v), concat(w, z)) :|: v >= 0, z >= 0, z' = 1 + u + v, z'' = 1 + w + z, w >= 0, u >= 0 less_leaves(z', z'') -{ 1 }-> 1 :|: z >= 0, z'' = 1 + w + z, w >= 0, z' = 0 less_leaves(z', z'') -{ 1 }-> 0 :|: z'' = 0, z' = x, x >= 0 minus(z', z'') -{ 1 }-> x :|: z'' = 0, z' = x, x >= 0 minus(z', z'') -{ 1 }-> minus(x, y) :|: z' = 1 + x, x >= 0, y >= 0, z'' = 1 + y minus(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 quot(z', z'') -{ 1 }-> 0 :|: y >= 0, z'' = 1 + y, z' = 0 quot(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 quot(z', z'') -{ 1 }-> 1 + quot(minus(x, y), 1 + y) :|: z' = 1 + x, x >= 0, y >= 0, z'' = 1 + y reverse(z') -{ 1 }-> app(reverse(x), 1 + n + 0) :|: n >= 0, z' = 1 + n + x, x >= 0 reverse(z') -{ 1 }-> 0 :|: z' = 0 shuffle(z') -{ 1 }-> 0 :|: z' = 0 shuffle(z') -{ 1 }-> 1 + n + shuffle(reverse(x)) :|: n >= 0, z' = 1 + n + x, x >= 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(V, V1),0,[minus(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1),0,[quot(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1),0,[app(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1),0,[reverse(V, Out)],[V >= 0]). eq(start(V, V1),0,[shuffle(V, Out)],[V >= 0]). eq(start(V, V1),0,[concat(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1),0,[fun(V, V1, Out)],[V >= 0,V1 >= 0]). eq(minus(V, V1, Out),1,[],[Out = V2,V1 = 0,V = V2,V2 >= 0]). eq(minus(V, V1, Out),1,[minus(V3, V4, Ret)],[Out = Ret,V = 1 + V3,V3 >= 0,V4 >= 0,V1 = 1 + V4]). eq(quot(V, V1, Out),1,[],[Out = 0,V5 >= 0,V1 = 1 + V5,V = 0]). eq(quot(V, V1, Out),1,[minus(V7, V6, Ret10),quot(Ret10, 1 + V6, Ret1)],[Out = 1 + Ret1,V = 1 + V7,V7 >= 0,V6 >= 0,V1 = 1 + V6]). eq(app(V, V1, Out),1,[],[Out = V8,V1 = V8,V8 >= 0,V = 0]). eq(app(V, V1, Out),1,[app(V9, V10, Ret11)],[Out = 1 + Ret11 + V11,V11 >= 0,V1 = V10,V = 1 + V11 + V9,V9 >= 0,V10 >= 0]). eq(reverse(V, Out),1,[],[Out = 0,V = 0]). eq(reverse(V, Out),1,[reverse(V12, Ret0),app(Ret0, 1 + V13 + 0, Ret2)],[Out = Ret2,V13 >= 0,V = 1 + V12 + V13,V12 >= 0]). eq(shuffle(V, Out),1,[],[Out = 0,V = 0]). eq(shuffle(V, Out),1,[reverse(V14, Ret101),shuffle(Ret101, Ret12)],[Out = 1 + Ret12 + V15,V15 >= 0,V = 1 + V14 + V15,V14 >= 0]). eq(concat(V, V1, Out),1,[],[Out = V16,V1 = V16,V16 >= 0,V = 0]). eq(concat(V, V1, Out),1,[concat(V18, V19, Ret13)],[Out = 1 + Ret13 + V17,V18 >= 0,V = 1 + V17 + V18,V1 = V19,V19 >= 0,V17 >= 0]). eq(fun(V, V1, Out),1,[],[Out = 0,V1 = 0,V = V20,V20 >= 0]). eq(fun(V, V1, Out),1,[],[Out = 1,V22 >= 0,V1 = 1 + V21 + V22,V21 >= 0,V = 0]). eq(fun(V, V1, Out),1,[concat(V23, V24, Ret01),concat(V25, V26, Ret14),fun(Ret01, Ret14, Ret3)],[Out = Ret3,V24 >= 0,V26 >= 0,V = 1 + V23 + V24,V1 = 1 + V25 + V26,V25 >= 0,V23 >= 0]). eq(minus(V, V1, Out),0,[],[Out = 0,V28 >= 0,V27 >= 0,V1 = V27,V = V28]). eq(quot(V, V1, Out),0,[],[Out = 0,V30 >= 0,V29 >= 0,V1 = V29,V = V30]). input_output_vars(minus(V,V1,Out),[V,V1],[Out]). input_output_vars(quot(V,V1,Out),[V,V1],[Out]). input_output_vars(app(V,V1,Out),[V,V1],[Out]). input_output_vars(reverse(V,Out),[V],[Out]). input_output_vars(shuffle(V,Out),[V],[Out]). input_output_vars(concat(V,V1,Out),[V,V1],[Out]). input_output_vars(fun(V,V1,Out),[V,V1],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [app/3] 1. recursive : [concat/3] 2. recursive : [fun/3] 3. recursive : [minus/3] 4. recursive : [quot/3] 5. recursive [non_tail] : [reverse/2] 6. recursive : [shuffle/2] 7. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into app/3 1. SCC is partially evaluated into concat/3 2. SCC is partially evaluated into fun/3 3. SCC is partially evaluated into minus/3 4. SCC is partially evaluated into quot/3 5. SCC is partially evaluated into reverse/2 6. SCC is partially evaluated into shuffle/2 7. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations app/3 * CE 15 is refined into CE [25] * CE 14 is refined into CE [26] ### Cost equations --> "Loop" of app/3 * CEs [26] --> Loop 18 * CEs [25] --> Loop 19 ### Ranking functions of CR app(V,V1,Out) * RF of phase [19]: [V] #### Partial ranking functions of CR app(V,V1,Out) * Partial RF of phase [19]: - RF of loop [19:1]: V ### Specialization of cost equations concat/3 * CE 21 is refined into CE [27] * CE 20 is refined into CE [28] ### Cost equations --> "Loop" of concat/3 * CEs [28] --> Loop 20 * CEs [27] --> Loop 21 ### Ranking functions of CR concat(V,V1,Out) * RF of phase [21]: [V] #### Partial ranking functions of CR concat(V,V1,Out) * Partial RF of phase [21]: - RF of loop [21:1]: V ### Specialization of cost equations fun/3 * CE 24 is refined into CE [29,30,31,32] * CE 22 is refined into CE [33] * CE 23 is refined into CE [34] ### Cost equations --> "Loop" of fun/3 * CEs [33] --> Loop 22 * CEs [34] --> Loop 23 * CEs [29,30,31,32] --> Loop 24 ### Ranking functions of CR fun(V,V1,Out) * RF of phase [24]: [V,V1] #### Partial ranking functions of CR fun(V,V1,Out) * Partial RF of phase [24]: - RF of loop [24:1]: V V1 ### Specialization of cost equations minus/3 * CE 10 is refined into CE [35] * CE 8 is refined into CE [36] * CE 9 is refined into CE [37] ### Cost equations --> "Loop" of minus/3 * CEs [37] --> Loop 25 * CEs [35] --> Loop 26 * CEs [36] --> Loop 27 ### Ranking functions of CR minus(V,V1,Out) * RF of phase [25]: [V,V1] #### Partial ranking functions of CR minus(V,V1,Out) * Partial RF of phase [25]: - RF of loop [25:1]: V V1 ### Specialization of cost equations quot/3 * CE 11 is refined into CE [38] * CE 13 is refined into CE [39] * CE 12 is refined into CE [40,41,42] ### Cost equations --> "Loop" of quot/3 * CEs [42] --> Loop 28 * CEs [41] --> Loop 29 * CEs [40] --> Loop 30 * CEs [38,39] --> Loop 31 ### Ranking functions of CR quot(V,V1,Out) * RF of phase [28]: [V-1,V-V1+1] * RF of phase [30]: [V] #### Partial ranking functions of CR quot(V,V1,Out) * Partial RF of phase [28]: - RF of loop [28:1]: V-1 V-V1+1 * Partial RF of phase [30]: - RF of loop [30:1]: V ### Specialization of cost equations reverse/2 * CE 17 is refined into CE [43,44] * CE 16 is refined into CE [45] ### Cost equations --> "Loop" of reverse/2 * CEs [45] --> Loop 32 * CEs [44] --> Loop 33 * CEs [43] --> Loop 34 ### Ranking functions of CR reverse(V,Out) * RF of phase [33]: [V] #### Partial ranking functions of CR reverse(V,Out) * Partial RF of phase [33]: - RF of loop [33:1]: V ### Specialization of cost equations shuffle/2 * CE 19 is refined into CE [46,47] * CE 18 is refined into CE [48] ### Cost equations --> "Loop" of shuffle/2 * CEs [48] --> Loop 35 * CEs [47] --> Loop 36 * CEs [46] --> Loop 37 ### Ranking functions of CR shuffle(V,Out) * RF of phase [36]: [V-1] #### Partial ranking functions of CR shuffle(V,Out) * Partial RF of phase [36]: - RF of loop [36:1]: V-1 ### Specialization of cost equations start/2 * CE 1 is refined into CE [49,50,51] * CE 2 is refined into CE [52,53,54,55,56] * CE 3 is refined into CE [57,58] * CE 4 is refined into CE [59,60] * CE 5 is refined into CE [61,62] * CE 6 is refined into CE [63,64] * CE 7 is refined into CE [65,66,67,68] ### Cost equations --> "Loop" of start/2 * CEs [52,60,62] --> Loop 38 * CEs [49,50,51,53,54,55,56,58,64,66,67,68] --> Loop 39 * CEs [57,59,61,63,65] --> Loop 40 ### Ranking functions of CR start(V,V1) #### Partial ranking functions of CR start(V,V1) Computing Bounds ===================================== #### Cost of chains of app(V,V1,Out): * Chain [[19],18]: 1*it(19)+1 Such that:it(19) =< -V1+Out with precondition: [V+V1=Out,V>=1,V1>=0] * Chain [18]: 1 with precondition: [V=0,V1=Out,V1>=0] #### Cost of chains of concat(V,V1,Out): * Chain [[21],20]: 1*it(21)+1 Such that:it(21) =< -V1+Out with precondition: [V+V1=Out,V>=1,V1>=0] * Chain [20]: 1 with precondition: [V=0,V1=Out,V1>=0] #### Cost of chains of fun(V,V1,Out): * Chain [[24],23]: 3*it(24)+2*s(9)+2*s(10)+1 Such that:aux(6) =< V1 aux(7) =< V it(24) =< aux(7) it(24) =< aux(6) s(11) =< it(24)*aux(6) s(12) =< it(24)*aux(7) s(10) =< s(12) s(9) =< s(11) with precondition: [Out=1,V>=1,V1>=V+1] * Chain [[24],22]: 3*it(24)+2*s(9)+2*s(10)+1 Such that:aux(5) =< V aux(8) =< V1 it(24) =< aux(8) it(24) =< aux(5) s(11) =< it(24)*aux(8) s(12) =< it(24)*aux(5) s(10) =< s(12) s(9) =< s(11) with precondition: [Out=0,V1>=1,V>=V1] * Chain [23]: 1 with precondition: [V=0,Out=1,V1>=1] * Chain [22]: 1 with precondition: [V1=0,Out=0,V>=0] #### Cost of chains of minus(V,V1,Out): * Chain [[25],27]: 1*it(25)+1 Such that:it(25) =< V1 with precondition: [V=Out+V1,V1>=1,V>=V1] * Chain [[25],26]: 1*it(25)+0 Such that:it(25) =< V1 with precondition: [Out=0,V>=1,V1>=1] * Chain [27]: 1 with precondition: [V1=0,V=Out,V>=0] * Chain [26]: 0 with precondition: [Out=0,V>=0,V1>=0] #### Cost of chains of quot(V,V1,Out): * Chain [[30],31]: 2*it(30)+1 Such that:it(30) =< Out with precondition: [V1=1,Out>=1,V>=Out] * Chain [[30],29,31]: 2*it(30)+1*s(14)+2 Such that:s(14) =< 1 it(30) =< Out with precondition: [V1=1,Out>=2,V>=Out] * Chain [[28],31]: 2*it(28)+1*s(17)+1 Such that:it(28) =< V-V1+1 aux(11) =< V it(28) =< aux(11) s(17) =< aux(11) with precondition: [V1>=2,Out>=1,V+2>=2*Out+V1] * Chain [[28],29,31]: 2*it(28)+1*s(14)+1*s(17)+2 Such that:it(28) =< V-V1+1 s(14) =< V1 aux(12) =< V it(28) =< aux(12) s(17) =< aux(12) with precondition: [V1>=2,Out>=2,V+3>=2*Out+V1] * Chain [31]: 1 with precondition: [Out=0,V>=0,V1>=0] * Chain [29,31]: 1*s(14)+2 Such that:s(14) =< V1 with precondition: [Out=1,V>=1,V1>=1] #### Cost of chains of reverse(V,Out): * Chain [[33],34,32]: 2*it(33)+1*s(23)+3 Such that:aux(16) =< Out it(33) =< aux(16) s(23) =< it(33)*aux(16) with precondition: [Out=V,Out>=2] * Chain [34,32]: 3 with precondition: [V=Out,V>=1] * Chain [32]: 1 with precondition: [V=0,Out=0] #### Cost of chains of shuffle(V,Out): * Chain [[36],37,35]: 4*it(36)+2*s(33)+1*s(34)+3 Such that:aux(19) =< Out it(36) =< aux(19) aux(17) =< aux(19) s(35) =< it(36)*aux(17) s(33) =< s(35) s(34) =< s(33)*aux(19) with precondition: [V=Out,V>=2] * Chain [37,35]: 3 with precondition: [V=Out,V>=1] * Chain [35]: 1 with precondition: [V=0,Out=0] #### Cost of chains of start(V,V1): * Chain [40]: 1 with precondition: [V=0] * Chain [39]: 4*s(42)+4*s(45)+4*s(47)+6*s(56)+4*s(59)+4*s(60)+2 Such that:aux(20) =< V aux(21) =< V-V1+1 aux(22) =< V1 s(47) =< aux(20) s(45) =< aux(21) s(42) =< aux(22) s(45) =< aux(20) s(56) =< aux(22) s(56) =< aux(20) s(57) =< s(56)*aux(22) s(58) =< s(56)*aux(20) s(59) =< s(58) s(60) =< s(57) with precondition: [V>=0,V1>=0] * Chain [38]: 1*s(68)+10*s(70)+1*s(73)+2*s(78)+1*s(79)+3 Such that:s(68) =< 1 aux(23) =< V s(70) =< aux(23) s(73) =< s(70)*aux(23) s(76) =< aux(23) s(77) =< s(70)*s(76) s(78) =< s(77) s(79) =< s(78)*aux(23) with precondition: [V>=1] Closed-form bounds of start(V,V1): ------------------------------------- * Chain [40] with precondition: [V=0] - Upper bound: 1 - Complexity: constant * Chain [39] with precondition: [V>=0,V1>=0] - Upper bound: 4*V+2+4*V*V1+10*V1+4*V1*V1+nat(V-V1+1)*4 - Complexity: n^2 * Chain [38] with precondition: [V>=1] - Upper bound: 10*V+4+3*V*V+V*V*V - Complexity: n^3 ### Maximum cost of start(V,V1): 4*V+1+max([6*V+2+3*V*V+V*V*V,4*V*nat(V1)+nat(V1)*10+nat(V1)*4*nat(V1)+nat(V-V1+1)*4])+1 Asymptotic class: n^3 * Total analysis performed in 421 ms. ---------------------------------------- (12) BOUNDS(1, n^3) ---------------------------------------- (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^3, INF). The TRS R consists of the following rules: minus(x, 0') -> x minus(s(x), s(y)) -> minus(x, y) quot(0', s(y)) -> 0' quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(n, x), y) -> add(n, app(x, y)) reverse(nil) -> nil reverse(add(n, x)) -> app(reverse(x), add(n, nil)) shuffle(nil) -> nil shuffle(add(n, x)) -> add(n, shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) S is empty. Rewrite Strategy: FULL ---------------------------------------- (15) SlicingProof (LOWER BOUND(ID)) Sliced the following arguments: add/0 ---------------------------------------- (16) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^3, INF). The TRS R consists of the following rules: minus(x, 0') -> x minus(s(x), s(y)) -> minus(x, y) quot(0', s(y)) -> 0' quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(x), y) -> add(app(x, y)) reverse(nil) -> nil reverse(add(x)) -> app(reverse(x), add(nil)) shuffle(nil) -> nil shuffle(add(x)) -> add(shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) S is empty. Rewrite Strategy: FULL ---------------------------------------- (17) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (18) Obligation: TRS: Rules: minus(x, 0') -> x minus(s(x), s(y)) -> minus(x, y) quot(0', s(y)) -> 0' quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(x), y) -> add(app(x, y)) reverse(nil) -> nil reverse(add(x)) -> app(reverse(x), add(nil)) shuffle(nil) -> nil shuffle(add(x)) -> add(shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) Types: minus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s quot :: 0':s -> 0':s -> 0':s app :: nil:add -> nil:add -> nil:add nil :: nil:add add :: nil:add -> nil:add reverse :: nil:add -> nil:add shuffle :: nil:add -> nil:add concat :: leaf:cons -> leaf:cons -> leaf:cons leaf :: leaf:cons cons :: leaf:cons -> leaf:cons -> leaf:cons less_leaves :: leaf:cons -> leaf:cons -> false:true false :: false:true true :: false:true hole_0':s1_0 :: 0':s hole_nil:add2_0 :: nil:add hole_leaf:cons3_0 :: leaf:cons hole_false:true4_0 :: false:true gen_0':s5_0 :: Nat -> 0':s gen_nil:add6_0 :: Nat -> nil:add gen_leaf:cons7_0 :: Nat -> leaf:cons ---------------------------------------- (19) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: minus, quot, app, reverse, shuffle, concat, less_leaves They will be analysed ascendingly in the following order: minus < quot app < reverse reverse < shuffle concat < less_leaves ---------------------------------------- (20) Obligation: TRS: Rules: minus(x, 0') -> x minus(s(x), s(y)) -> minus(x, y) quot(0', s(y)) -> 0' quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(x), y) -> add(app(x, y)) reverse(nil) -> nil reverse(add(x)) -> app(reverse(x), add(nil)) shuffle(nil) -> nil shuffle(add(x)) -> add(shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) Types: minus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s quot :: 0':s -> 0':s -> 0':s app :: nil:add -> nil:add -> nil:add nil :: nil:add add :: nil:add -> nil:add reverse :: nil:add -> nil:add shuffle :: nil:add -> nil:add concat :: leaf:cons -> leaf:cons -> leaf:cons leaf :: leaf:cons cons :: leaf:cons -> leaf:cons -> leaf:cons less_leaves :: leaf:cons -> leaf:cons -> false:true false :: false:true true :: false:true hole_0':s1_0 :: 0':s hole_nil:add2_0 :: nil:add hole_leaf:cons3_0 :: leaf:cons hole_false:true4_0 :: false:true gen_0':s5_0 :: Nat -> 0':s gen_nil:add6_0 :: Nat -> nil:add gen_leaf:cons7_0 :: Nat -> leaf:cons Generator Equations: gen_0':s5_0(0) <=> 0' gen_0':s5_0(+(x, 1)) <=> s(gen_0':s5_0(x)) gen_nil:add6_0(0) <=> nil gen_nil:add6_0(+(x, 1)) <=> add(gen_nil:add6_0(x)) gen_leaf:cons7_0(0) <=> leaf gen_leaf:cons7_0(+(x, 1)) <=> cons(leaf, gen_leaf:cons7_0(x)) The following defined symbols remain to be analysed: minus, quot, app, reverse, shuffle, concat, less_leaves They will be analysed ascendingly in the following order: minus < quot app < reverse reverse < shuffle concat < less_leaves ---------------------------------------- (21) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: minus(gen_0':s5_0(n9_0), gen_0':s5_0(n9_0)) -> gen_0':s5_0(0), rt in Omega(1 + n9_0) Induction Base: minus(gen_0':s5_0(0), gen_0':s5_0(0)) ->_R^Omega(1) gen_0':s5_0(0) Induction Step: minus(gen_0':s5_0(+(n9_0, 1)), gen_0':s5_0(+(n9_0, 1))) ->_R^Omega(1) minus(gen_0':s5_0(n9_0), gen_0':s5_0(n9_0)) ->_IH gen_0':s5_0(0) 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: TRS: Rules: minus(x, 0') -> x minus(s(x), s(y)) -> minus(x, y) quot(0', s(y)) -> 0' quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(x), y) -> add(app(x, y)) reverse(nil) -> nil reverse(add(x)) -> app(reverse(x), add(nil)) shuffle(nil) -> nil shuffle(add(x)) -> add(shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) Types: minus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s quot :: 0':s -> 0':s -> 0':s app :: nil:add -> nil:add -> nil:add nil :: nil:add add :: nil:add -> nil:add reverse :: nil:add -> nil:add shuffle :: nil:add -> nil:add concat :: leaf:cons -> leaf:cons -> leaf:cons leaf :: leaf:cons cons :: leaf:cons -> leaf:cons -> leaf:cons less_leaves :: leaf:cons -> leaf:cons -> false:true false :: false:true true :: false:true hole_0':s1_0 :: 0':s hole_nil:add2_0 :: nil:add hole_leaf:cons3_0 :: leaf:cons hole_false:true4_0 :: false:true gen_0':s5_0 :: Nat -> 0':s gen_nil:add6_0 :: Nat -> nil:add gen_leaf:cons7_0 :: Nat -> leaf:cons Generator Equations: gen_0':s5_0(0) <=> 0' gen_0':s5_0(+(x, 1)) <=> s(gen_0':s5_0(x)) gen_nil:add6_0(0) <=> nil gen_nil:add6_0(+(x, 1)) <=> add(gen_nil:add6_0(x)) gen_leaf:cons7_0(0) <=> leaf gen_leaf:cons7_0(+(x, 1)) <=> cons(leaf, gen_leaf:cons7_0(x)) The following defined symbols remain to be analysed: minus, quot, app, reverse, shuffle, concat, less_leaves They will be analysed ascendingly in the following order: minus < quot app < reverse reverse < shuffle concat < less_leaves ---------------------------------------- (24) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (25) BOUNDS(n^1, INF) ---------------------------------------- (26) Obligation: TRS: Rules: minus(x, 0') -> x minus(s(x), s(y)) -> minus(x, y) quot(0', s(y)) -> 0' quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(x), y) -> add(app(x, y)) reverse(nil) -> nil reverse(add(x)) -> app(reverse(x), add(nil)) shuffle(nil) -> nil shuffle(add(x)) -> add(shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) Types: minus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s quot :: 0':s -> 0':s -> 0':s app :: nil:add -> nil:add -> nil:add nil :: nil:add add :: nil:add -> nil:add reverse :: nil:add -> nil:add shuffle :: nil:add -> nil:add concat :: leaf:cons -> leaf:cons -> leaf:cons leaf :: leaf:cons cons :: leaf:cons -> leaf:cons -> leaf:cons less_leaves :: leaf:cons -> leaf:cons -> false:true false :: false:true true :: false:true hole_0':s1_0 :: 0':s hole_nil:add2_0 :: nil:add hole_leaf:cons3_0 :: leaf:cons hole_false:true4_0 :: false:true gen_0':s5_0 :: Nat -> 0':s gen_nil:add6_0 :: Nat -> nil:add gen_leaf:cons7_0 :: Nat -> leaf:cons Lemmas: minus(gen_0':s5_0(n9_0), gen_0':s5_0(n9_0)) -> gen_0':s5_0(0), rt in Omega(1 + n9_0) Generator Equations: gen_0':s5_0(0) <=> 0' gen_0':s5_0(+(x, 1)) <=> s(gen_0':s5_0(x)) gen_nil:add6_0(0) <=> nil gen_nil:add6_0(+(x, 1)) <=> add(gen_nil:add6_0(x)) gen_leaf:cons7_0(0) <=> leaf gen_leaf:cons7_0(+(x, 1)) <=> cons(leaf, gen_leaf:cons7_0(x)) The following defined symbols remain to be analysed: quot, app, reverse, shuffle, concat, less_leaves They will be analysed ascendingly in the following order: app < reverse reverse < shuffle concat < less_leaves ---------------------------------------- (27) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: app(gen_nil:add6_0(n589_0), gen_nil:add6_0(b)) -> gen_nil:add6_0(+(n589_0, b)), rt in Omega(1 + n589_0) Induction Base: app(gen_nil:add6_0(0), gen_nil:add6_0(b)) ->_R^Omega(1) gen_nil:add6_0(b) Induction Step: app(gen_nil:add6_0(+(n589_0, 1)), gen_nil:add6_0(b)) ->_R^Omega(1) add(app(gen_nil:add6_0(n589_0), gen_nil:add6_0(b))) ->_IH add(gen_nil:add6_0(+(b, c590_0))) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (28) Obligation: TRS: Rules: minus(x, 0') -> x minus(s(x), s(y)) -> minus(x, y) quot(0', s(y)) -> 0' quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(x), y) -> add(app(x, y)) reverse(nil) -> nil reverse(add(x)) -> app(reverse(x), add(nil)) shuffle(nil) -> nil shuffle(add(x)) -> add(shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) Types: minus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s quot :: 0':s -> 0':s -> 0':s app :: nil:add -> nil:add -> nil:add nil :: nil:add add :: nil:add -> nil:add reverse :: nil:add -> nil:add shuffle :: nil:add -> nil:add concat :: leaf:cons -> leaf:cons -> leaf:cons leaf :: leaf:cons cons :: leaf:cons -> leaf:cons -> leaf:cons less_leaves :: leaf:cons -> leaf:cons -> false:true false :: false:true true :: false:true hole_0':s1_0 :: 0':s hole_nil:add2_0 :: nil:add hole_leaf:cons3_0 :: leaf:cons hole_false:true4_0 :: false:true gen_0':s5_0 :: Nat -> 0':s gen_nil:add6_0 :: Nat -> nil:add gen_leaf:cons7_0 :: Nat -> leaf:cons Lemmas: minus(gen_0':s5_0(n9_0), gen_0':s5_0(n9_0)) -> gen_0':s5_0(0), rt in Omega(1 + n9_0) app(gen_nil:add6_0(n589_0), gen_nil:add6_0(b)) -> gen_nil:add6_0(+(n589_0, b)), rt in Omega(1 + n589_0) Generator Equations: gen_0':s5_0(0) <=> 0' gen_0':s5_0(+(x, 1)) <=> s(gen_0':s5_0(x)) gen_nil:add6_0(0) <=> nil gen_nil:add6_0(+(x, 1)) <=> add(gen_nil:add6_0(x)) gen_leaf:cons7_0(0) <=> leaf gen_leaf:cons7_0(+(x, 1)) <=> cons(leaf, gen_leaf:cons7_0(x)) The following defined symbols remain to be analysed: reverse, shuffle, concat, less_leaves They will be analysed ascendingly in the following order: reverse < shuffle concat < less_leaves ---------------------------------------- (29) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: reverse(gen_nil:add6_0(n1508_0)) -> gen_nil:add6_0(n1508_0), rt in Omega(1 + n1508_0 + n1508_0^2) Induction Base: reverse(gen_nil:add6_0(0)) ->_R^Omega(1) nil Induction Step: reverse(gen_nil:add6_0(+(n1508_0, 1))) ->_R^Omega(1) app(reverse(gen_nil:add6_0(n1508_0)), add(nil)) ->_IH app(gen_nil:add6_0(c1509_0), add(nil)) ->_L^Omega(1 + n1508_0) gen_nil:add6_0(+(n1508_0, +(0, 1))) We have rt in Omega(n^2) and sz in O(n). Thus, we have irc_R in Omega(n^2). ---------------------------------------- (30) Complex Obligation (BEST) ---------------------------------------- (31) Obligation: Proved the lower bound n^2 for the following obligation: TRS: Rules: minus(x, 0') -> x minus(s(x), s(y)) -> minus(x, y) quot(0', s(y)) -> 0' quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(x), y) -> add(app(x, y)) reverse(nil) -> nil reverse(add(x)) -> app(reverse(x), add(nil)) shuffle(nil) -> nil shuffle(add(x)) -> add(shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) Types: minus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s quot :: 0':s -> 0':s -> 0':s app :: nil:add -> nil:add -> nil:add nil :: nil:add add :: nil:add -> nil:add reverse :: nil:add -> nil:add shuffle :: nil:add -> nil:add concat :: leaf:cons -> leaf:cons -> leaf:cons leaf :: leaf:cons cons :: leaf:cons -> leaf:cons -> leaf:cons less_leaves :: leaf:cons -> leaf:cons -> false:true false :: false:true true :: false:true hole_0':s1_0 :: 0':s hole_nil:add2_0 :: nil:add hole_leaf:cons3_0 :: leaf:cons hole_false:true4_0 :: false:true gen_0':s5_0 :: Nat -> 0':s gen_nil:add6_0 :: Nat -> nil:add gen_leaf:cons7_0 :: Nat -> leaf:cons Lemmas: minus(gen_0':s5_0(n9_0), gen_0':s5_0(n9_0)) -> gen_0':s5_0(0), rt in Omega(1 + n9_0) app(gen_nil:add6_0(n589_0), gen_nil:add6_0(b)) -> gen_nil:add6_0(+(n589_0, b)), rt in Omega(1 + n589_0) Generator Equations: gen_0':s5_0(0) <=> 0' gen_0':s5_0(+(x, 1)) <=> s(gen_0':s5_0(x)) gen_nil:add6_0(0) <=> nil gen_nil:add6_0(+(x, 1)) <=> add(gen_nil:add6_0(x)) gen_leaf:cons7_0(0) <=> leaf gen_leaf:cons7_0(+(x, 1)) <=> cons(leaf, gen_leaf:cons7_0(x)) The following defined symbols remain to be analysed: reverse, shuffle, concat, less_leaves They will be analysed ascendingly in the following order: reverse < shuffle concat < less_leaves ---------------------------------------- (32) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (33) BOUNDS(n^2, INF) ---------------------------------------- (34) Obligation: TRS: Rules: minus(x, 0') -> x minus(s(x), s(y)) -> minus(x, y) quot(0', s(y)) -> 0' quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(x), y) -> add(app(x, y)) reverse(nil) -> nil reverse(add(x)) -> app(reverse(x), add(nil)) shuffle(nil) -> nil shuffle(add(x)) -> add(shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) Types: minus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s quot :: 0':s -> 0':s -> 0':s app :: nil:add -> nil:add -> nil:add nil :: nil:add add :: nil:add -> nil:add reverse :: nil:add -> nil:add shuffle :: nil:add -> nil:add concat :: leaf:cons -> leaf:cons -> leaf:cons leaf :: leaf:cons cons :: leaf:cons -> leaf:cons -> leaf:cons less_leaves :: leaf:cons -> leaf:cons -> false:true false :: false:true true :: false:true hole_0':s1_0 :: 0':s hole_nil:add2_0 :: nil:add hole_leaf:cons3_0 :: leaf:cons hole_false:true4_0 :: false:true gen_0':s5_0 :: Nat -> 0':s gen_nil:add6_0 :: Nat -> nil:add gen_leaf:cons7_0 :: Nat -> leaf:cons Lemmas: minus(gen_0':s5_0(n9_0), gen_0':s5_0(n9_0)) -> gen_0':s5_0(0), rt in Omega(1 + n9_0) app(gen_nil:add6_0(n589_0), gen_nil:add6_0(b)) -> gen_nil:add6_0(+(n589_0, b)), rt in Omega(1 + n589_0) reverse(gen_nil:add6_0(n1508_0)) -> gen_nil:add6_0(n1508_0), rt in Omega(1 + n1508_0 + n1508_0^2) Generator Equations: gen_0':s5_0(0) <=> 0' gen_0':s5_0(+(x, 1)) <=> s(gen_0':s5_0(x)) gen_nil:add6_0(0) <=> nil gen_nil:add6_0(+(x, 1)) <=> add(gen_nil:add6_0(x)) gen_leaf:cons7_0(0) <=> leaf gen_leaf:cons7_0(+(x, 1)) <=> cons(leaf, gen_leaf:cons7_0(x)) The following defined symbols remain to be analysed: shuffle, concat, less_leaves They will be analysed ascendingly in the following order: concat < less_leaves ---------------------------------------- (35) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: shuffle(gen_nil:add6_0(n1776_0)) -> gen_nil:add6_0(n1776_0), rt in Omega(1 + n1776_0 + n1776_0^2 + n1776_0^3) Induction Base: shuffle(gen_nil:add6_0(0)) ->_R^Omega(1) nil Induction Step: shuffle(gen_nil:add6_0(+(n1776_0, 1))) ->_R^Omega(1) add(shuffle(reverse(gen_nil:add6_0(n1776_0)))) ->_L^Omega(1 + n1776_0 + n1776_0^2) add(shuffle(gen_nil:add6_0(n1776_0))) ->_IH add(gen_nil:add6_0(c1777_0)) We have rt in Omega(n^3) and sz in O(n). Thus, we have irc_R in Omega(n^3). ---------------------------------------- (36) Complex Obligation (BEST) ---------------------------------------- (37) Obligation: Proved the lower bound n^3 for the following obligation: TRS: Rules: minus(x, 0') -> x minus(s(x), s(y)) -> minus(x, y) quot(0', s(y)) -> 0' quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(x), y) -> add(app(x, y)) reverse(nil) -> nil reverse(add(x)) -> app(reverse(x), add(nil)) shuffle(nil) -> nil shuffle(add(x)) -> add(shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) Types: minus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s quot :: 0':s -> 0':s -> 0':s app :: nil:add -> nil:add -> nil:add nil :: nil:add add :: nil:add -> nil:add reverse :: nil:add -> nil:add shuffle :: nil:add -> nil:add concat :: leaf:cons -> leaf:cons -> leaf:cons leaf :: leaf:cons cons :: leaf:cons -> leaf:cons -> leaf:cons less_leaves :: leaf:cons -> leaf:cons -> false:true false :: false:true true :: false:true hole_0':s1_0 :: 0':s hole_nil:add2_0 :: nil:add hole_leaf:cons3_0 :: leaf:cons hole_false:true4_0 :: false:true gen_0':s5_0 :: Nat -> 0':s gen_nil:add6_0 :: Nat -> nil:add gen_leaf:cons7_0 :: Nat -> leaf:cons Lemmas: minus(gen_0':s5_0(n9_0), gen_0':s5_0(n9_0)) -> gen_0':s5_0(0), rt in Omega(1 + n9_0) app(gen_nil:add6_0(n589_0), gen_nil:add6_0(b)) -> gen_nil:add6_0(+(n589_0, b)), rt in Omega(1 + n589_0) reverse(gen_nil:add6_0(n1508_0)) -> gen_nil:add6_0(n1508_0), rt in Omega(1 + n1508_0 + n1508_0^2) Generator Equations: gen_0':s5_0(0) <=> 0' gen_0':s5_0(+(x, 1)) <=> s(gen_0':s5_0(x)) gen_nil:add6_0(0) <=> nil gen_nil:add6_0(+(x, 1)) <=> add(gen_nil:add6_0(x)) gen_leaf:cons7_0(0) <=> leaf gen_leaf:cons7_0(+(x, 1)) <=> cons(leaf, gen_leaf:cons7_0(x)) The following defined symbols remain to be analysed: shuffle, concat, less_leaves They will be analysed ascendingly in the following order: concat < less_leaves ---------------------------------------- (38) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (39) BOUNDS(n^3, INF) ---------------------------------------- (40) Obligation: TRS: Rules: minus(x, 0') -> x minus(s(x), s(y)) -> minus(x, y) quot(0', s(y)) -> 0' quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(x), y) -> add(app(x, y)) reverse(nil) -> nil reverse(add(x)) -> app(reverse(x), add(nil)) shuffle(nil) -> nil shuffle(add(x)) -> add(shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) Types: minus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s quot :: 0':s -> 0':s -> 0':s app :: nil:add -> nil:add -> nil:add nil :: nil:add add :: nil:add -> nil:add reverse :: nil:add -> nil:add shuffle :: nil:add -> nil:add concat :: leaf:cons -> leaf:cons -> leaf:cons leaf :: leaf:cons cons :: leaf:cons -> leaf:cons -> leaf:cons less_leaves :: leaf:cons -> leaf:cons -> false:true false :: false:true true :: false:true hole_0':s1_0 :: 0':s hole_nil:add2_0 :: nil:add hole_leaf:cons3_0 :: leaf:cons hole_false:true4_0 :: false:true gen_0':s5_0 :: Nat -> 0':s gen_nil:add6_0 :: Nat -> nil:add gen_leaf:cons7_0 :: Nat -> leaf:cons Lemmas: minus(gen_0':s5_0(n9_0), gen_0':s5_0(n9_0)) -> gen_0':s5_0(0), rt in Omega(1 + n9_0) app(gen_nil:add6_0(n589_0), gen_nil:add6_0(b)) -> gen_nil:add6_0(+(n589_0, b)), rt in Omega(1 + n589_0) reverse(gen_nil:add6_0(n1508_0)) -> gen_nil:add6_0(n1508_0), rt in Omega(1 + n1508_0 + n1508_0^2) shuffle(gen_nil:add6_0(n1776_0)) -> gen_nil:add6_0(n1776_0), rt in Omega(1 + n1776_0 + n1776_0^2 + n1776_0^3) Generator Equations: gen_0':s5_0(0) <=> 0' gen_0':s5_0(+(x, 1)) <=> s(gen_0':s5_0(x)) gen_nil:add6_0(0) <=> nil gen_nil:add6_0(+(x, 1)) <=> add(gen_nil:add6_0(x)) gen_leaf:cons7_0(0) <=> leaf gen_leaf:cons7_0(+(x, 1)) <=> cons(leaf, gen_leaf:cons7_0(x)) The following defined symbols remain to be analysed: concat, less_leaves They will be analysed ascendingly in the following order: concat < less_leaves ---------------------------------------- (41) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: concat(gen_leaf:cons7_0(n1977_0), gen_leaf:cons7_0(b)) -> gen_leaf:cons7_0(+(n1977_0, b)), rt in Omega(1 + n1977_0) Induction Base: concat(gen_leaf:cons7_0(0), gen_leaf:cons7_0(b)) ->_R^Omega(1) gen_leaf:cons7_0(b) Induction Step: concat(gen_leaf:cons7_0(+(n1977_0, 1)), gen_leaf:cons7_0(b)) ->_R^Omega(1) cons(leaf, concat(gen_leaf:cons7_0(n1977_0), gen_leaf:cons7_0(b))) ->_IH cons(leaf, gen_leaf:cons7_0(+(b, c1978_0))) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (42) Obligation: TRS: Rules: minus(x, 0') -> x minus(s(x), s(y)) -> minus(x, y) quot(0', s(y)) -> 0' quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(x), y) -> add(app(x, y)) reverse(nil) -> nil reverse(add(x)) -> app(reverse(x), add(nil)) shuffle(nil) -> nil shuffle(add(x)) -> add(shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) Types: minus :: 0':s -> 0':s -> 0':s 0' :: 0':s s :: 0':s -> 0':s quot :: 0':s -> 0':s -> 0':s app :: nil:add -> nil:add -> nil:add nil :: nil:add add :: nil:add -> nil:add reverse :: nil:add -> nil:add shuffle :: nil:add -> nil:add concat :: leaf:cons -> leaf:cons -> leaf:cons leaf :: leaf:cons cons :: leaf:cons -> leaf:cons -> leaf:cons less_leaves :: leaf:cons -> leaf:cons -> false:true false :: false:true true :: false:true hole_0':s1_0 :: 0':s hole_nil:add2_0 :: nil:add hole_leaf:cons3_0 :: leaf:cons hole_false:true4_0 :: false:true gen_0':s5_0 :: Nat -> 0':s gen_nil:add6_0 :: Nat -> nil:add gen_leaf:cons7_0 :: Nat -> leaf:cons Lemmas: minus(gen_0':s5_0(n9_0), gen_0':s5_0(n9_0)) -> gen_0':s5_0(0), rt in Omega(1 + n9_0) app(gen_nil:add6_0(n589_0), gen_nil:add6_0(b)) -> gen_nil:add6_0(+(n589_0, b)), rt in Omega(1 + n589_0) reverse(gen_nil:add6_0(n1508_0)) -> gen_nil:add6_0(n1508_0), rt in Omega(1 + n1508_0 + n1508_0^2) shuffle(gen_nil:add6_0(n1776_0)) -> gen_nil:add6_0(n1776_0), rt in Omega(1 + n1776_0 + n1776_0^2 + n1776_0^3) concat(gen_leaf:cons7_0(n1977_0), gen_leaf:cons7_0(b)) -> gen_leaf:cons7_0(+(n1977_0, b)), rt in Omega(1 + n1977_0) Generator Equations: gen_0':s5_0(0) <=> 0' gen_0':s5_0(+(x, 1)) <=> s(gen_0':s5_0(x)) gen_nil:add6_0(0) <=> nil gen_nil:add6_0(+(x, 1)) <=> add(gen_nil:add6_0(x)) gen_leaf:cons7_0(0) <=> leaf gen_leaf:cons7_0(+(x, 1)) <=> cons(leaf, gen_leaf:cons7_0(x)) The following defined symbols remain to be analysed: less_leaves ---------------------------------------- (43) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: less_leaves(gen_leaf:cons7_0(n3068_0), gen_leaf:cons7_0(n3068_0)) -> false, rt in Omega(1 + n3068_0) Induction Base: less_leaves(gen_leaf:cons7_0(0), gen_leaf:cons7_0(0)) ->_R^Omega(1) false Induction Step: less_leaves(gen_leaf:cons7_0(+(n3068_0, 1)), gen_leaf:cons7_0(+(n3068_0, 1))) ->_R^Omega(1) less_leaves(concat(leaf, gen_leaf:cons7_0(n3068_0)), concat(leaf, gen_leaf:cons7_0(n3068_0))) ->_L^Omega(1) less_leaves(gen_leaf:cons7_0(+(0, n3068_0)), concat(leaf, gen_leaf:cons7_0(n3068_0))) ->_L^Omega(1) less_leaves(gen_leaf:cons7_0(n3068_0), gen_leaf:cons7_0(+(0, n3068_0))) ->_IH false We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (44) BOUNDS(1, INF)