15.81/4.87 WORST_CASE(Omega(n^1), O(n^1)) 15.81/4.88 proof of /export/starexec/sandbox/benchmark/theBenchmark.xml 15.81/4.88 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 15.81/4.88 15.81/4.88 15.81/4.88 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 15.81/4.88 15.81/4.88 (0) CpxTRS 15.81/4.88 (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] 15.81/4.88 (2) CpxWeightedTrs 15.81/4.88 (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 15.81/4.88 (4) CpxTypedWeightedTrs 15.81/4.88 (5) CompletionProof [UPPER BOUND(ID), 0 ms] 15.81/4.88 (6) CpxTypedWeightedCompleteTrs 15.81/4.88 (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] 15.81/4.88 (8) CpxRNTS 15.81/4.88 (9) CompleteCoflocoProof [FINISHED, 243 ms] 15.81/4.88 (10) BOUNDS(1, n^1) 15.81/4.88 (11) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] 15.81/4.88 (12) CpxTRS 15.81/4.88 (13) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 15.81/4.88 (14) typed CpxTrs 15.81/4.88 (15) OrderProof [LOWER BOUND(ID), 0 ms] 15.81/4.88 (16) typed CpxTrs 15.81/4.88 (17) RewriteLemmaProof [LOWER BOUND(ID), 256 ms] 15.81/4.88 (18) proven lower bound 15.81/4.88 (19) LowerBoundPropagationProof [FINISHED, 0 ms] 15.81/4.88 (20) BOUNDS(n^1, INF) 15.81/4.88 15.81/4.88 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (0) 15.81/4.88 Obligation: 15.81/4.88 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 15.81/4.88 15.81/4.88 15.81/4.88 The TRS R consists of the following rules: 15.81/4.88 15.81/4.88 is_empty(nil) -> true 15.81/4.88 is_empty(cons(x, l)) -> false 15.81/4.88 hd(cons(x, l)) -> x 15.81/4.88 tl(cons(x, l)) -> l 15.81/4.88 append(l1, l2) -> ifappend(l1, l2, is_empty(l1)) 15.81/4.88 ifappend(l1, l2, true) -> l2 15.81/4.88 ifappend(l1, l2, false) -> cons(hd(l1), append(tl(l1), l2)) 15.81/4.88 15.81/4.88 S is empty. 15.81/4.88 Rewrite Strategy: INNERMOST 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) 15.81/4.88 Transformed relative TRS to weighted TRS 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (2) 15.81/4.88 Obligation: 15.81/4.88 The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1). 15.81/4.88 15.81/4.88 15.81/4.88 The TRS R consists of the following rules: 15.81/4.88 15.81/4.88 is_empty(nil) -> true [1] 15.81/4.88 is_empty(cons(x, l)) -> false [1] 15.81/4.88 hd(cons(x, l)) -> x [1] 15.81/4.88 tl(cons(x, l)) -> l [1] 15.81/4.88 append(l1, l2) -> ifappend(l1, l2, is_empty(l1)) [1] 15.81/4.88 ifappend(l1, l2, true) -> l2 [1] 15.81/4.88 ifappend(l1, l2, false) -> cons(hd(l1), append(tl(l1), l2)) [1] 15.81/4.88 15.81/4.88 Rewrite Strategy: INNERMOST 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 15.81/4.88 Infered types. 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (4) 15.81/4.88 Obligation: 15.81/4.88 Runtime Complexity Weighted TRS with Types. 15.81/4.88 The TRS R consists of the following rules: 15.81/4.88 15.81/4.88 is_empty(nil) -> true [1] 15.81/4.88 is_empty(cons(x, l)) -> false [1] 15.81/4.88 hd(cons(x, l)) -> x [1] 15.81/4.88 tl(cons(x, l)) -> l [1] 15.81/4.88 append(l1, l2) -> ifappend(l1, l2, is_empty(l1)) [1] 15.81/4.88 ifappend(l1, l2, true) -> l2 [1] 15.81/4.88 ifappend(l1, l2, false) -> cons(hd(l1), append(tl(l1), l2)) [1] 15.81/4.88 15.81/4.88 The TRS has the following type information: 15.81/4.88 is_empty :: nil:cons -> true:false 15.81/4.88 nil :: nil:cons 15.81/4.88 true :: true:false 15.81/4.88 cons :: hd -> nil:cons -> nil:cons 15.81/4.88 false :: true:false 15.81/4.88 hd :: nil:cons -> hd 15.81/4.88 tl :: nil:cons -> nil:cons 15.81/4.88 append :: nil:cons -> nil:cons -> nil:cons 15.81/4.88 ifappend :: nil:cons -> nil:cons -> true:false -> nil:cons 15.81/4.88 15.81/4.88 Rewrite Strategy: INNERMOST 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (5) CompletionProof (UPPER BOUND(ID)) 15.81/4.88 The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: 15.81/4.88 15.81/4.88 hd(v0) -> null_hd [0] 15.81/4.88 tl(v0) -> null_tl [0] 15.81/4.88 is_empty(v0) -> null_is_empty [0] 15.81/4.88 ifappend(v0, v1, v2) -> null_ifappend [0] 15.81/4.88 15.81/4.88 And the following fresh constants: null_hd, null_tl, null_is_empty, null_ifappend 15.81/4.88 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (6) 15.81/4.88 Obligation: 15.81/4.88 Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: 15.81/4.88 15.81/4.88 Runtime Complexity Weighted TRS with Types. 15.81/4.88 The TRS R consists of the following rules: 15.81/4.88 15.81/4.88 is_empty(nil) -> true [1] 15.81/4.88 is_empty(cons(x, l)) -> false [1] 15.81/4.88 hd(cons(x, l)) -> x [1] 15.81/4.88 tl(cons(x, l)) -> l [1] 15.81/4.88 append(l1, l2) -> ifappend(l1, l2, is_empty(l1)) [1] 15.81/4.88 ifappend(l1, l2, true) -> l2 [1] 15.81/4.88 ifappend(l1, l2, false) -> cons(hd(l1), append(tl(l1), l2)) [1] 15.81/4.88 hd(v0) -> null_hd [0] 15.81/4.88 tl(v0) -> null_tl [0] 15.81/4.88 is_empty(v0) -> null_is_empty [0] 15.81/4.88 ifappend(v0, v1, v2) -> null_ifappend [0] 15.81/4.88 15.81/4.88 The TRS has the following type information: 15.81/4.88 is_empty :: nil:cons:null_tl:null_ifappend -> true:false:null_is_empty 15.81/4.88 nil :: nil:cons:null_tl:null_ifappend 15.81/4.88 true :: true:false:null_is_empty 15.81/4.88 cons :: null_hd -> nil:cons:null_tl:null_ifappend -> nil:cons:null_tl:null_ifappend 15.81/4.88 false :: true:false:null_is_empty 15.81/4.88 hd :: nil:cons:null_tl:null_ifappend -> null_hd 15.81/4.88 tl :: nil:cons:null_tl:null_ifappend -> nil:cons:null_tl:null_ifappend 15.81/4.88 append :: nil:cons:null_tl:null_ifappend -> nil:cons:null_tl:null_ifappend -> nil:cons:null_tl:null_ifappend 15.81/4.88 ifappend :: nil:cons:null_tl:null_ifappend -> nil:cons:null_tl:null_ifappend -> true:false:null_is_empty -> nil:cons:null_tl:null_ifappend 15.81/4.88 null_hd :: null_hd 15.81/4.88 null_tl :: nil:cons:null_tl:null_ifappend 15.81/4.88 null_is_empty :: true:false:null_is_empty 15.81/4.88 null_ifappend :: nil:cons:null_tl:null_ifappend 15.81/4.88 15.81/4.88 Rewrite Strategy: INNERMOST 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) 15.81/4.88 Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. 15.81/4.88 The constant constructors are abstracted as follows: 15.81/4.88 15.81/4.88 nil => 0 15.81/4.88 true => 2 15.81/4.88 false => 1 15.81/4.88 null_hd => 0 15.81/4.88 null_tl => 0 15.81/4.88 null_is_empty => 0 15.81/4.88 null_ifappend => 0 15.81/4.88 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (8) 15.81/4.88 Obligation: 15.81/4.88 Complexity RNTS consisting of the following rules: 15.81/4.88 15.81/4.88 append(z, z') -{ 1 }-> ifappend(l1, l2, is_empty(l1)) :|: z = l1, z' = l2, l1 >= 0, l2 >= 0 15.81/4.88 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l 15.81/4.88 hd(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 15.81/4.88 ifappend(z, z', z'') -{ 1 }-> l2 :|: z = l1, z' = l2, z'' = 2, l1 >= 0, l2 >= 0 15.81/4.88 ifappend(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 15.81/4.88 ifappend(z, z', z'') -{ 1 }-> 1 + hd(l1) + append(tl(l1), l2) :|: z = l1, z' = l2, l1 >= 0, l2 >= 0, z'' = 1 15.81/4.88 is_empty(z) -{ 1 }-> 2 :|: z = 0 15.81/4.88 is_empty(z) -{ 1 }-> 1 :|: x >= 0, l >= 0, z = 1 + x + l 15.81/4.88 is_empty(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 15.81/4.88 tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l 15.81/4.88 tl(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 15.81/4.88 15.81/4.88 Only complete derivations are relevant for the runtime complexity. 15.81/4.88 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (9) CompleteCoflocoProof (FINISHED) 15.81/4.88 Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: 15.81/4.88 15.81/4.88 eq(start(V, V7, V10),0,[fun(V, Out)],[V >= 0]). 15.81/4.88 eq(start(V, V7, V10),0,[hd(V, Out)],[V >= 0]). 15.81/4.88 eq(start(V, V7, V10),0,[tl(V, Out)],[V >= 0]). 15.81/4.88 eq(start(V, V7, V10),0,[append(V, V7, Out)],[V >= 0,V7 >= 0]). 15.81/4.88 eq(start(V, V7, V10),0,[ifappend(V, V7, V10, Out)],[V >= 0,V7 >= 0,V10 >= 0]). 15.81/4.88 eq(fun(V, Out),1,[],[Out = 2,V = 0]). 15.81/4.88 eq(fun(V, Out),1,[],[Out = 1,V1 >= 0,V2 >= 0,V = 1 + V1 + V2]). 15.81/4.88 eq(hd(V, Out),1,[],[Out = V3,V3 >= 0,V4 >= 0,V = 1 + V3 + V4]). 15.81/4.88 eq(tl(V, Out),1,[],[Out = V6,V5 >= 0,V6 >= 0,V = 1 + V5 + V6]). 15.81/4.88 eq(append(V, V7, Out),1,[fun(V9, Ret2),ifappend(V9, V8, Ret2, Ret)],[Out = Ret,V = V9,V7 = V8,V9 >= 0,V8 >= 0]). 15.81/4.88 eq(ifappend(V, V7, V10, Out),1,[],[Out = V11,V = V12,V7 = V11,V10 = 2,V12 >= 0,V11 >= 0]). 15.81/4.88 eq(ifappend(V, V7, V10, Out),1,[hd(V13, Ret01),tl(V13, Ret10),append(Ret10, V14, Ret1)],[Out = 1 + Ret01 + Ret1,V = V13,V7 = V14,V13 >= 0,V14 >= 0,V10 = 1]). 15.81/4.88 eq(hd(V, Out),0,[],[Out = 0,V15 >= 0,V = V15]). 15.81/4.88 eq(tl(V, Out),0,[],[Out = 0,V16 >= 0,V = V16]). 15.81/4.88 eq(fun(V, Out),0,[],[Out = 0,V17 >= 0,V = V17]). 15.81/4.88 eq(ifappend(V, V7, V10, Out),0,[],[Out = 0,V18 >= 0,V10 = V20,V19 >= 0,V = V18,V7 = V19,V20 >= 0]). 15.81/4.88 input_output_vars(fun(V,Out),[V],[Out]). 15.81/4.88 input_output_vars(hd(V,Out),[V],[Out]). 15.81/4.88 input_output_vars(tl(V,Out),[V],[Out]). 15.81/4.88 input_output_vars(append(V,V7,Out),[V,V7],[Out]). 15.81/4.88 input_output_vars(ifappend(V,V7,V10,Out),[V,V7,V10],[Out]). 15.81/4.88 15.81/4.88 15.81/4.88 CoFloCo proof output: 15.81/4.88 Preprocessing Cost Relations 15.81/4.88 ===================================== 15.81/4.88 15.81/4.88 #### Computed strongly connected components 15.81/4.88 0. non_recursive : [fun/2] 15.81/4.88 1. non_recursive : [hd/2] 15.81/4.88 2. non_recursive : [tl/2] 15.81/4.88 3. recursive : [append/3,ifappend/4] 15.81/4.88 4. non_recursive : [start/3] 15.81/4.88 15.81/4.88 #### Obtained direct recursion through partial evaluation 15.81/4.88 0. SCC is partially evaluated into fun/2 15.81/4.88 1. SCC is partially evaluated into hd/2 15.81/4.88 2. SCC is partially evaluated into tl/2 15.81/4.88 3. SCC is partially evaluated into append/3 15.81/4.88 4. SCC is partially evaluated into start/3 15.81/4.88 15.81/4.88 Control-Flow Refinement of Cost Relations 15.81/4.88 ===================================== 15.81/4.88 15.81/4.88 ### Specialization of cost equations fun/2 15.81/4.88 * CE 16 is refined into CE [18] 15.81/4.88 * CE 17 is refined into CE [19] 15.81/4.88 * CE 15 is refined into CE [20] 15.81/4.88 15.81/4.88 15.81/4.88 ### Cost equations --> "Loop" of fun/2 15.81/4.88 * CEs [18] --> Loop 13 15.81/4.88 * CEs [19] --> Loop 14 15.81/4.88 * CEs [20] --> Loop 15 15.81/4.88 15.81/4.88 ### Ranking functions of CR fun(V,Out) 15.81/4.88 15.81/4.88 #### Partial ranking functions of CR fun(V,Out) 15.81/4.88 15.81/4.88 15.81/4.88 ### Specialization of cost equations hd/2 15.81/4.88 * CE 8 is refined into CE [21] 15.81/4.88 * CE 9 is refined into CE [22] 15.81/4.88 15.81/4.88 15.81/4.88 ### Cost equations --> "Loop" of hd/2 15.81/4.88 * CEs [21] --> Loop 16 15.81/4.88 * CEs [22] --> Loop 17 15.81/4.88 15.81/4.88 ### Ranking functions of CR hd(V,Out) 15.81/4.88 15.81/4.88 #### Partial ranking functions of CR hd(V,Out) 15.81/4.88 15.81/4.88 15.81/4.88 ### Specialization of cost equations tl/2 15.81/4.88 * CE 10 is refined into CE [23] 15.81/4.88 * CE 11 is refined into CE [24] 15.81/4.88 15.81/4.88 15.81/4.88 ### Cost equations --> "Loop" of tl/2 15.81/4.88 * CEs [23] --> Loop 18 15.81/4.88 * CEs [24] --> Loop 19 15.81/4.88 15.81/4.88 ### Ranking functions of CR tl(V,Out) 15.81/4.88 15.81/4.88 #### Partial ranking functions of CR tl(V,Out) 15.81/4.88 15.81/4.88 15.81/4.88 ### Specialization of cost equations append/3 15.81/4.88 * CE 14 is refined into CE [25] 15.81/4.88 * CE 12 is refined into CE [26,27,28] 15.81/4.88 * CE 13 is refined into CE [29,30,31,32] 15.81/4.88 15.81/4.88 15.81/4.88 ### Cost equations --> "Loop" of append/3 15.81/4.88 * CEs [30] --> Loop 20 15.81/4.88 * CEs [29,31,32] --> Loop 21 15.81/4.88 * CEs [25] --> Loop 22 15.81/4.88 * CEs [26,27,28] --> Loop 23 15.81/4.88 15.81/4.88 ### Ranking functions of CR append(V,V7,Out) 15.81/4.88 * RF of phase [20,21]: [V] 15.81/4.88 15.81/4.88 #### Partial ranking functions of CR append(V,V7,Out) 15.81/4.88 * Partial RF of phase [20,21]: 15.81/4.88 - RF of loop [20:1,21:1]: 15.81/4.88 V 15.81/4.88 15.81/4.88 15.81/4.88 ### Specialization of cost equations start/3 15.81/4.88 * CE 3 is refined into CE [33] 15.81/4.88 * CE 1 is refined into CE [34] 15.81/4.88 * CE 2 is refined into CE [35,36,37,38,39,40,41,42,43,44] 15.81/4.88 * CE 4 is refined into CE [45,46,47] 15.81/4.88 * CE 5 is refined into CE [48,49] 15.81/4.88 * CE 6 is refined into CE [50,51] 15.81/4.88 * CE 7 is refined into CE [52,53,54] 15.81/4.88 15.81/4.88 15.81/4.88 ### Cost equations --> "Loop" of start/3 15.81/4.88 * CEs [33] --> Loop 24 15.81/4.88 * CEs [35,36,37,38,39,40,41,42,43,44] --> Loop 25 15.81/4.88 * CEs [34,45,46,47,48,49,50,51,52,53,54] --> Loop 26 15.81/4.88 15.81/4.88 ### Ranking functions of CR start(V,V7,V10) 15.81/4.88 15.81/4.88 #### Partial ranking functions of CR start(V,V7,V10) 15.81/4.88 15.81/4.88 15.81/4.88 Computing Bounds 15.81/4.88 ===================================== 15.81/4.88 15.81/4.88 #### Cost of chains of fun(V,Out): 15.81/4.88 * Chain [15]: 1 15.81/4.88 with precondition: [V=0,Out=2] 15.81/4.88 15.81/4.88 * Chain [14]: 0 15.81/4.88 with precondition: [Out=0,V>=0] 15.81/4.88 15.81/4.88 * Chain [13]: 1 15.81/4.88 with precondition: [Out=1,V>=1] 15.81/4.88 15.81/4.88 15.81/4.88 #### Cost of chains of hd(V,Out): 15.81/4.88 * Chain [17]: 0 15.81/4.88 with precondition: [Out=0,V>=0] 15.81/4.88 15.81/4.88 * Chain [16]: 1 15.81/4.88 with precondition: [Out>=0,V>=Out+1] 15.81/4.88 15.81/4.88 15.81/4.88 #### Cost of chains of tl(V,Out): 15.81/4.88 * Chain [19]: 0 15.81/4.88 with precondition: [Out=0,V>=0] 15.81/4.88 15.81/4.88 * Chain [18]: 1 15.81/4.88 with precondition: [Out>=0,V>=Out+1] 15.81/4.88 15.81/4.88 15.81/4.88 #### Cost of chains of append(V,V7,Out): 15.81/4.88 * Chain [[20,21],23]: 9*it(20)+2 15.81/4.88 Such that:aux(3) =< V 15.81/4.88 it(20) =< aux(3) 15.81/4.88 15.81/4.88 with precondition: [V>=1,V7>=0,Out>=1] 15.81/4.88 15.81/4.88 * Chain [[20,21],22]: 9*it(20)+3 15.81/4.88 Such that:aux(4) =< V 15.81/4.88 it(20) =< aux(4) 15.81/4.88 15.81/4.88 with precondition: [V>=1,V7>=0,Out>=V7+1] 15.81/4.88 15.81/4.88 * Chain [23]: 2 15.81/4.88 with precondition: [Out=0,V>=0,V7>=0] 15.81/4.88 15.81/4.88 * Chain [22]: 3 15.81/4.88 with precondition: [V=0,V7=Out,V7>=0] 15.81/4.88 15.81/4.88 15.81/4.88 #### Cost of chains of start(V,V7,V10): 15.81/4.88 * Chain [26]: 18*s(6)+3 15.81/4.88 Such that:s(5) =< V 15.81/4.88 s(6) =< s(5) 15.81/4.88 15.81/4.88 with precondition: [V>=0] 15.81/4.88 15.81/4.88 * Chain [25]: 36*s(8)+6 15.81/4.88 Such that:aux(6) =< V 15.81/4.88 s(8) =< aux(6) 15.81/4.88 15.81/4.88 with precondition: [V10=1,V>=0,V7>=0] 15.81/4.88 15.81/4.88 * Chain [24]: 1 15.81/4.88 with precondition: [V10=2,V>=0,V7>=0] 15.81/4.88 15.81/4.88 15.81/4.88 Closed-form bounds of start(V,V7,V10): 15.81/4.88 ------------------------------------- 15.81/4.88 * Chain [26] with precondition: [V>=0] 15.81/4.88 - Upper bound: 18*V+3 15.81/4.88 - Complexity: n 15.81/4.88 * Chain [25] with precondition: [V10=1,V>=0,V7>=0] 15.81/4.88 - Upper bound: 36*V+6 15.81/4.88 - Complexity: n 15.81/4.88 * Chain [24] with precondition: [V10=2,V>=0,V7>=0] 15.81/4.88 - Upper bound: 1 15.81/4.88 - Complexity: constant 15.81/4.88 15.81/4.88 ### Maximum cost of start(V,V7,V10): 36*V+6 15.81/4.88 Asymptotic class: n 15.81/4.88 * Total analysis performed in 173 ms. 15.81/4.88 15.81/4.88 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (10) 15.81/4.88 BOUNDS(1, n^1) 15.81/4.88 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (11) RenamingProof (BOTH BOUNDS(ID, ID)) 15.81/4.88 Renamed function symbols to avoid clashes with predefined symbol. 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (12) 15.81/4.88 Obligation: 15.81/4.88 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). 15.81/4.88 15.81/4.88 15.81/4.88 The TRS R consists of the following rules: 15.81/4.88 15.81/4.88 is_empty(nil) -> true 15.81/4.88 is_empty(cons(x, l)) -> false 15.81/4.88 hd(cons(x, l)) -> x 15.81/4.88 tl(cons(x, l)) -> l 15.81/4.88 append(l1, l2) -> ifappend(l1, l2, is_empty(l1)) 15.81/4.88 ifappend(l1, l2, true) -> l2 15.81/4.88 ifappend(l1, l2, false) -> cons(hd(l1), append(tl(l1), l2)) 15.81/4.88 15.81/4.88 S is empty. 15.81/4.88 Rewrite Strategy: INNERMOST 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (13) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 15.81/4.88 Infered types. 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (14) 15.81/4.88 Obligation: 15.81/4.88 Innermost TRS: 15.81/4.88 Rules: 15.81/4.88 is_empty(nil) -> true 15.81/4.88 is_empty(cons(x, l)) -> false 15.81/4.88 hd(cons(x, l)) -> x 15.81/4.88 tl(cons(x, l)) -> l 15.81/4.88 append(l1, l2) -> ifappend(l1, l2, is_empty(l1)) 15.81/4.88 ifappend(l1, l2, true) -> l2 15.81/4.88 ifappend(l1, l2, false) -> cons(hd(l1), append(tl(l1), l2)) 15.81/4.88 15.81/4.88 Types: 15.81/4.88 is_empty :: nil:cons -> true:false 15.81/4.88 nil :: nil:cons 15.81/4.88 true :: true:false 15.81/4.88 cons :: hd -> nil:cons -> nil:cons 15.81/4.88 false :: true:false 15.81/4.88 hd :: nil:cons -> hd 15.81/4.88 tl :: nil:cons -> nil:cons 15.81/4.88 append :: nil:cons -> nil:cons -> nil:cons 15.81/4.88 ifappend :: nil:cons -> nil:cons -> true:false -> nil:cons 15.81/4.88 hole_true:false1_0 :: true:false 15.81/4.88 hole_nil:cons2_0 :: nil:cons 15.81/4.88 hole_hd3_0 :: hd 15.81/4.88 gen_nil:cons4_0 :: Nat -> nil:cons 15.81/4.88 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (15) OrderProof (LOWER BOUND(ID)) 15.81/4.88 Heuristically decided to analyse the following defined symbols: 15.81/4.88 append 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (16) 15.81/4.88 Obligation: 15.81/4.88 Innermost TRS: 15.81/4.88 Rules: 15.81/4.88 is_empty(nil) -> true 15.81/4.88 is_empty(cons(x, l)) -> false 15.81/4.88 hd(cons(x, l)) -> x 15.81/4.88 tl(cons(x, l)) -> l 15.81/4.88 append(l1, l2) -> ifappend(l1, l2, is_empty(l1)) 15.81/4.88 ifappend(l1, l2, true) -> l2 15.81/4.88 ifappend(l1, l2, false) -> cons(hd(l1), append(tl(l1), l2)) 15.81/4.88 15.81/4.88 Types: 15.81/4.88 is_empty :: nil:cons -> true:false 15.81/4.88 nil :: nil:cons 15.81/4.88 true :: true:false 15.81/4.88 cons :: hd -> nil:cons -> nil:cons 15.81/4.88 false :: true:false 15.81/4.88 hd :: nil:cons -> hd 15.81/4.88 tl :: nil:cons -> nil:cons 15.81/4.88 append :: nil:cons -> nil:cons -> nil:cons 15.81/4.88 ifappend :: nil:cons -> nil:cons -> true:false -> nil:cons 15.81/4.88 hole_true:false1_0 :: true:false 15.81/4.88 hole_nil:cons2_0 :: nil:cons 15.81/4.88 hole_hd3_0 :: hd 15.81/4.88 gen_nil:cons4_0 :: Nat -> nil:cons 15.81/4.88 15.81/4.88 15.81/4.88 Generator Equations: 15.81/4.88 gen_nil:cons4_0(0) <=> nil 15.81/4.88 gen_nil:cons4_0(+(x, 1)) <=> cons(hole_hd3_0, gen_nil:cons4_0(x)) 15.81/4.88 15.81/4.88 15.81/4.88 The following defined symbols remain to be analysed: 15.81/4.88 append 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (17) RewriteLemmaProof (LOWER BOUND(ID)) 15.81/4.88 Proved the following rewrite lemma: 15.81/4.88 append(gen_nil:cons4_0(n6_0), gen_nil:cons4_0(b)) -> gen_nil:cons4_0(+(n6_0, b)), rt in Omega(1 + n6_0) 15.81/4.88 15.81/4.88 Induction Base: 15.81/4.88 append(gen_nil:cons4_0(0), gen_nil:cons4_0(b)) ->_R^Omega(1) 15.81/4.88 ifappend(gen_nil:cons4_0(0), gen_nil:cons4_0(b), is_empty(gen_nil:cons4_0(0))) ->_R^Omega(1) 15.81/4.88 ifappend(gen_nil:cons4_0(0), gen_nil:cons4_0(b), true) ->_R^Omega(1) 15.81/4.88 gen_nil:cons4_0(b) 15.81/4.88 15.81/4.88 Induction Step: 15.81/4.88 append(gen_nil:cons4_0(+(n6_0, 1)), gen_nil:cons4_0(b)) ->_R^Omega(1) 15.81/4.88 ifappend(gen_nil:cons4_0(+(n6_0, 1)), gen_nil:cons4_0(b), is_empty(gen_nil:cons4_0(+(n6_0, 1)))) ->_R^Omega(1) 15.81/4.88 ifappend(gen_nil:cons4_0(+(1, n6_0)), gen_nil:cons4_0(b), false) ->_R^Omega(1) 15.81/4.88 cons(hd(gen_nil:cons4_0(+(1, n6_0))), append(tl(gen_nil:cons4_0(+(1, n6_0))), gen_nil:cons4_0(b))) ->_R^Omega(1) 15.81/4.88 cons(hole_hd3_0, append(tl(gen_nil:cons4_0(+(1, n6_0))), gen_nil:cons4_0(b))) ->_R^Omega(1) 15.81/4.88 cons(hole_hd3_0, append(gen_nil:cons4_0(n6_0), gen_nil:cons4_0(b))) ->_IH 15.81/4.88 cons(hole_hd3_0, gen_nil:cons4_0(+(b, c7_0))) 15.81/4.88 15.81/4.88 We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (18) 15.81/4.88 Obligation: 15.81/4.88 Proved the lower bound n^1 for the following obligation: 15.81/4.88 15.81/4.88 Innermost TRS: 15.81/4.88 Rules: 15.81/4.88 is_empty(nil) -> true 15.81/4.88 is_empty(cons(x, l)) -> false 15.81/4.88 hd(cons(x, l)) -> x 15.81/4.88 tl(cons(x, l)) -> l 15.81/4.88 append(l1, l2) -> ifappend(l1, l2, is_empty(l1)) 15.81/4.88 ifappend(l1, l2, true) -> l2 15.81/4.88 ifappend(l1, l2, false) -> cons(hd(l1), append(tl(l1), l2)) 15.81/4.88 15.81/4.88 Types: 15.81/4.88 is_empty :: nil:cons -> true:false 15.81/4.88 nil :: nil:cons 15.81/4.88 true :: true:false 15.81/4.88 cons :: hd -> nil:cons -> nil:cons 15.81/4.88 false :: true:false 15.81/4.88 hd :: nil:cons -> hd 15.81/4.88 tl :: nil:cons -> nil:cons 15.81/4.88 append :: nil:cons -> nil:cons -> nil:cons 15.81/4.88 ifappend :: nil:cons -> nil:cons -> true:false -> nil:cons 15.81/4.88 hole_true:false1_0 :: true:false 15.81/4.88 hole_nil:cons2_0 :: nil:cons 15.81/4.88 hole_hd3_0 :: hd 15.81/4.88 gen_nil:cons4_0 :: Nat -> nil:cons 15.81/4.88 15.81/4.88 15.81/4.88 Generator Equations: 15.81/4.88 gen_nil:cons4_0(0) <=> nil 15.81/4.88 gen_nil:cons4_0(+(x, 1)) <=> cons(hole_hd3_0, gen_nil:cons4_0(x)) 15.81/4.88 15.81/4.88 15.81/4.88 The following defined symbols remain to be analysed: 15.81/4.88 append 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (19) LowerBoundPropagationProof (FINISHED) 15.81/4.88 Propagated lower bound. 15.81/4.88 ---------------------------------------- 15.81/4.88 15.81/4.88 (20) 15.81/4.88 BOUNDS(n^1, INF) 15.81/4.92 EOF