WORST_CASE(Omega(n^1),O(n^1)) proof of input_PXgMnGPuHT.trs # AProVE Commit ID: 5b976082cb74a395683ed8cc7acf94bd611ab29f fuhs 20230524 unpublished The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxTRS (1) RelTrsToWeightedTrsProof [UPPER BOUND(ID), 0 ms] (2) CpxWeightedTrs (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxTypedWeightedTrs (5) CompletionProof [UPPER BOUND(ID), 0 ms] (6) CpxTypedWeightedCompleteTrs (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (8) CpxRNTS (9) CompleteCoflocoProof [FINISHED, 342 ms] (10) BOUNDS(1, n^1) (11) CpxTrsToCdtProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CdtProblem (13) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxRelTRS (15) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (16) CpxRelTRS (17) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (18) typed CpxTrs (19) OrderProof [LOWER BOUND(ID), 5 ms] (20) typed CpxTrs (21) RewriteLemmaProof [LOWER BOUND(ID), 357 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), 67 ms] (28) typed CpxTrs (29) RewriteLemmaProof [LOWER BOUND(ID), 45 ms] (30) typed CpxTrs (31) RewriteLemmaProof [LOWER BOUND(ID), 865 ms] (32) typed CpxTrs ---------------------------------------- (0) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: half(0) -> 0 half(s(0)) -> 0 half(s(s(x))) -> s(half(x)) lastbit(0) -> 0 lastbit(s(0)) -> s(0) lastbit(s(s(x))) -> lastbit(x) conv(0) -> cons(nil, 0) conv(s(x)) -> cons(conv(half(s(x))), lastbit(s(x))) S is empty. Rewrite Strategy: PARALLEL_INNERMOST ---------------------------------------- (1) RelTrsToWeightedTrsProof (UPPER BOUND(ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: half(0) -> 0 [1] half(s(0)) -> 0 [1] half(s(s(x))) -> s(half(x)) [1] lastbit(0) -> 0 [1] lastbit(s(0)) -> s(0) [1] lastbit(s(s(x))) -> lastbit(x) [1] conv(0) -> cons(nil, 0) [1] conv(s(x)) -> cons(conv(half(s(x))), lastbit(s(x))) [1] Rewrite Strategy: INNERMOST ---------------------------------------- (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (4) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: half(0) -> 0 [1] half(s(0)) -> 0 [1] half(s(s(x))) -> s(half(x)) [1] lastbit(0) -> 0 [1] lastbit(s(0)) -> s(0) [1] lastbit(s(s(x))) -> lastbit(x) [1] conv(0) -> cons(nil, 0) [1] conv(s(x)) -> cons(conv(half(s(x))), lastbit(s(x))) [1] The TRS has the following type information: half :: 0:s -> 0:s 0 :: 0:s s :: 0:s -> 0:s lastbit :: 0:s -> 0:s conv :: 0:s -> nil:cons cons :: nil:cons -> 0:s -> nil:cons nil :: nil:cons Rewrite Strategy: INNERMOST ---------------------------------------- (5) CompletionProof (UPPER BOUND(ID)) The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: none And the following fresh constants: none ---------------------------------------- (6) 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: half(0) -> 0 [1] half(s(0)) -> 0 [1] half(s(s(x))) -> s(half(x)) [1] lastbit(0) -> 0 [1] lastbit(s(0)) -> s(0) [1] lastbit(s(s(x))) -> lastbit(x) [1] conv(0) -> cons(nil, 0) [1] conv(s(x)) -> cons(conv(half(s(x))), lastbit(s(x))) [1] The TRS has the following type information: half :: 0:s -> 0:s 0 :: 0:s s :: 0:s -> 0:s lastbit :: 0:s -> 0:s conv :: 0:s -> nil:cons cons :: nil:cons -> 0:s -> nil:cons nil :: nil:cons Rewrite Strategy: INNERMOST ---------------------------------------- (7) 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 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: conv(z) -{ 1 }-> 1 + conv(half(1 + x)) + lastbit(1 + x) :|: x >= 0, z = 1 + x conv(z) -{ 1 }-> 1 + 0 + 0 :|: z = 0 half(z) -{ 1 }-> 0 :|: z = 0 half(z) -{ 1 }-> 0 :|: z = 1 + 0 half(z) -{ 1 }-> 1 + half(x) :|: x >= 0, z = 1 + (1 + x) lastbit(z) -{ 1 }-> lastbit(x) :|: x >= 0, z = 1 + (1 + x) lastbit(z) -{ 1 }-> 0 :|: z = 0 lastbit(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (9) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V),0,[half(V, Out)],[V >= 0]). eq(start(V),0,[lastbit(V, Out)],[V >= 0]). eq(start(V),0,[conv(V, Out)],[V >= 0]). eq(half(V, Out),1,[],[Out = 0,V = 0]). eq(half(V, Out),1,[],[Out = 0,V = 1]). eq(half(V, Out),1,[half(V1, Ret1)],[Out = 1 + Ret1,V1 >= 0,V = 2 + V1]). eq(lastbit(V, Out),1,[],[Out = 0,V = 0]). eq(lastbit(V, Out),1,[],[Out = 1,V = 1]). eq(lastbit(V, Out),1,[lastbit(V2, Ret)],[Out = Ret,V2 >= 0,V = 2 + V2]). eq(conv(V, Out),1,[],[Out = 1,V = 0]). eq(conv(V, Out),1,[half(1 + V3, Ret010),conv(Ret010, Ret01),lastbit(1 + V3, Ret11)],[Out = 1 + Ret01 + Ret11,V3 >= 0,V = 1 + V3]). input_output_vars(half(V,Out),[V],[Out]). input_output_vars(lastbit(V,Out),[V],[Out]). input_output_vars(conv(V,Out),[V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [half/2] 1. recursive : [lastbit/2] 2. recursive [non_tail] : [conv/2] 3. non_recursive : [start/1] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into half/2 1. SCC is partially evaluated into lastbit/2 2. SCC is partially evaluated into conv/2 3. SCC is partially evaluated into start/1 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations half/2 * CE 6 is refined into CE [12] * CE 5 is refined into CE [13] * CE 4 is refined into CE [14] ### Cost equations --> "Loop" of half/2 * CEs [13] --> Loop 10 * CEs [14] --> Loop 11 * CEs [12] --> Loop 12 ### Ranking functions of CR half(V,Out) * RF of phase [12]: [V-1] #### Partial ranking functions of CR half(V,Out) * Partial RF of phase [12]: - RF of loop [12:1]: V-1 ### Specialization of cost equations lastbit/2 * CE 9 is refined into CE [15] * CE 8 is refined into CE [16] * CE 7 is refined into CE [17] ### Cost equations --> "Loop" of lastbit/2 * CEs [16] --> Loop 13 * CEs [17] --> Loop 14 * CEs [15] --> Loop 15 ### Ranking functions of CR lastbit(V,Out) * RF of phase [15]: [V-1] #### Partial ranking functions of CR lastbit(V,Out) * Partial RF of phase [15]: - RF of loop [15:1]: V-1 ### Specialization of cost equations conv/2 * CE 11 is refined into CE [18,19,20,21,22] * CE 10 is refined into CE [23] ### Cost equations --> "Loop" of conv/2 * CEs [23] --> Loop 16 * CEs [22] --> Loop 17 * CEs [21] --> Loop 18 * CEs [20] --> Loop 19 * CEs [19] --> Loop 20 * CEs [18] --> Loop 21 ### Ranking functions of CR conv(V,Out) * RF of phase [17,18,19,20]: [V-1] #### Partial ranking functions of CR conv(V,Out) * Partial RF of phase [17,18,19,20]: - RF of loop [17:1,18:1]: V/2-1 - RF of loop [19:1]: 2*V-5 - RF of loop [20:1]: V-1 ### Specialization of cost equations start/1 * CE 1 is refined into CE [24,25,26,27] * CE 2 is refined into CE [28,29,30,31] * CE 3 is refined into CE [32,33,34] ### Cost equations --> "Loop" of start/1 * CEs [26,27,30,31,34] --> Loop 22 * CEs [25,29,33] --> Loop 23 * CEs [24,28,32] --> Loop 24 ### Ranking functions of CR start(V) #### Partial ranking functions of CR start(V) Computing Bounds ===================================== #### Cost of chains of half(V,Out): * Chain [[12],11]: 1*it(12)+1 Such that:it(12) =< 2*Out with precondition: [V=2*Out,V>=2] * Chain [[12],10]: 1*it(12)+1 Such that:it(12) =< 2*Out with precondition: [V=2*Out+1,V>=3] * Chain [11]: 1 with precondition: [V=0,Out=0] * Chain [10]: 1 with precondition: [V=1,Out=0] #### Cost of chains of lastbit(V,Out): * Chain [[15],14]: 1*it(15)+1 Such that:it(15) =< V with precondition: [Out=0,V>=2] * Chain [[15],13]: 1*it(15)+1 Such that:it(15) =< V with precondition: [Out=1,V>=3] * Chain [14]: 1 with precondition: [V=0,Out=0] * Chain [13]: 1 with precondition: [V=1,Out=1] #### Cost of chains of conv(V,Out): * Chain [[17,18,19,20],21,16]: 3*it(17)+3*it(18)+3*it(19)+3*it(20)+2*s(17)+2*s(18)+4*s(21)+4 Such that:aux(5) =< 2*V+4 aux(13) =< V aux(14) =< 2*V aux(15) =< 3*V aux(16) =< 4*V aux(17) =< V/2 it(19) =< aux(14) it(17) =< aux(13) it(18) =< aux(13) it(19) =< aux(13) it(20) =< aux(13) it(20) =< aux(5) s(22) =< aux(5) it(20) =< aux(14) s(22) =< aux(14) it(18) =< aux(15) it(19) =< aux(15) s(18) =< aux(15) it(20) =< aux(15) it(18) =< aux(16) it(19) =< aux(16) s(17) =< aux(16) it(20) =< aux(16) it(17) =< aux(17) it(18) =< aux(17) s(21) =< s(22) with precondition: [Out>=4,V+8>=2*Out,V+2>=Out] * Chain [21,16]: 4 with precondition: [V=1,Out=3] * Chain [16]: 1 with precondition: [V=0,Out=1] #### Cost of chains of start(V): * Chain [24]: 1 with precondition: [V=0] * Chain [23]: 4 with precondition: [V=1] * Chain [22]: 4*s(25)+3*s(35)+3*s(36)+3*s(37)+3*s(38)+2*s(40)+2*s(41)+4*s(42)+4 Such that:s(31) =< 2*V s(29) =< 2*V+4 s(32) =< 3*V s(33) =< 4*V s(34) =< V/2 aux(18) =< V s(25) =< aux(18) s(35) =< s(31) s(36) =< aux(18) s(37) =< aux(18) s(35) =< aux(18) s(38) =< aux(18) s(38) =< s(29) s(39) =< s(29) s(38) =< s(31) s(39) =< s(31) s(37) =< s(32) s(35) =< s(32) s(40) =< s(32) s(38) =< s(32) s(37) =< s(33) s(35) =< s(33) s(41) =< s(33) s(38) =< s(33) s(36) =< s(34) s(37) =< s(34) s(42) =< s(39) with precondition: [V>=2] Closed-form bounds of start(V): ------------------------------------- * Chain [24] with precondition: [V=0] - Upper bound: 1 - Complexity: constant * Chain [23] with precondition: [V=1] - Upper bound: 4 - Complexity: constant * Chain [22] with precondition: [V>=2] - Upper bound: 41*V+20 - Complexity: n ### Maximum cost of start(V): 41*V+20 Asymptotic class: n * Total analysis performed in 233 ms. ---------------------------------------- (10) BOUNDS(1, n^1) ---------------------------------------- (11) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (12) Obligation: Complexity Dependency Tuples Problem Rules: half(0) -> 0 half(s(0)) -> 0 half(s(s(z0))) -> s(half(z0)) lastbit(0) -> 0 lastbit(s(0)) -> s(0) lastbit(s(s(z0))) -> lastbit(z0) conv(0) -> cons(nil, 0) conv(s(z0)) -> cons(conv(half(s(z0))), lastbit(s(z0))) Tuples: HALF(0) -> c HALF(s(0)) -> c1 HALF(s(s(z0))) -> c2(HALF(z0)) LASTBIT(0) -> c3 LASTBIT(s(0)) -> c4 LASTBIT(s(s(z0))) -> c5(LASTBIT(z0)) CONV(0) -> c6 CONV(s(z0)) -> c7(CONV(half(s(z0))), HALF(s(z0))) CONV(s(z0)) -> c8(LASTBIT(s(z0))) S tuples: HALF(0) -> c HALF(s(0)) -> c1 HALF(s(s(z0))) -> c2(HALF(z0)) LASTBIT(0) -> c3 LASTBIT(s(0)) -> c4 LASTBIT(s(s(z0))) -> c5(LASTBIT(z0)) CONV(0) -> c6 CONV(s(z0)) -> c7(CONV(half(s(z0))), HALF(s(z0))) CONV(s(z0)) -> c8(LASTBIT(s(z0))) K tuples:none Defined Rule Symbols: half_1, lastbit_1, conv_1 Defined Pair Symbols: HALF_1, LASTBIT_1, CONV_1 Compound Symbols: c, c1, c2_1, c3, c4, c5_1, c6, c7_2, c8_1 ---------------------------------------- (13) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (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: HALF(0) -> c HALF(s(0)) -> c1 HALF(s(s(z0))) -> c2(HALF(z0)) LASTBIT(0) -> c3 LASTBIT(s(0)) -> c4 LASTBIT(s(s(z0))) -> c5(LASTBIT(z0)) CONV(0) -> c6 CONV(s(z0)) -> c7(CONV(half(s(z0))), HALF(s(z0))) CONV(s(z0)) -> c8(LASTBIT(s(z0))) The (relative) TRS S consists of the following rules: half(0) -> 0 half(s(0)) -> 0 half(s(s(z0))) -> s(half(z0)) lastbit(0) -> 0 lastbit(s(0)) -> s(0) lastbit(s(s(z0))) -> lastbit(z0) conv(0) -> cons(nil, 0) conv(s(z0)) -> cons(conv(half(s(z0))), lastbit(s(z0))) Rewrite Strategy: INNERMOST ---------------------------------------- (15) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (16) 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: HALF(0') -> c HALF(s(0')) -> c1 HALF(s(s(z0))) -> c2(HALF(z0)) LASTBIT(0') -> c3 LASTBIT(s(0')) -> c4 LASTBIT(s(s(z0))) -> c5(LASTBIT(z0)) CONV(0') -> c6 CONV(s(z0)) -> c7(CONV(half(s(z0))), HALF(s(z0))) CONV(s(z0)) -> c8(LASTBIT(s(z0))) The (relative) TRS S consists of the following rules: half(0') -> 0' half(s(0')) -> 0' half(s(s(z0))) -> s(half(z0)) lastbit(0') -> 0' lastbit(s(0')) -> s(0') lastbit(s(s(z0))) -> lastbit(z0) conv(0') -> cons(nil, 0') conv(s(z0)) -> cons(conv(half(s(z0))), lastbit(s(z0))) Rewrite Strategy: INNERMOST ---------------------------------------- (17) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (18) Obligation: Innermost TRS: Rules: HALF(0') -> c HALF(s(0')) -> c1 HALF(s(s(z0))) -> c2(HALF(z0)) LASTBIT(0') -> c3 LASTBIT(s(0')) -> c4 LASTBIT(s(s(z0))) -> c5(LASTBIT(z0)) CONV(0') -> c6 CONV(s(z0)) -> c7(CONV(half(s(z0))), HALF(s(z0))) CONV(s(z0)) -> c8(LASTBIT(s(z0))) half(0') -> 0' half(s(0')) -> 0' half(s(s(z0))) -> s(half(z0)) lastbit(0') -> 0' lastbit(s(0')) -> s(0') lastbit(s(s(z0))) -> lastbit(z0) conv(0') -> cons(nil, 0') conv(s(z0)) -> cons(conv(half(s(z0))), lastbit(s(z0))) Types: HALF :: 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 LASTBIT :: 0':s -> c3:c4:c5 c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 CONV :: 0':s -> c6:c7:c8 c6 :: c6:c7:c8 c7 :: c6:c7:c8 -> c:c1:c2 -> c6:c7:c8 half :: 0':s -> 0':s c8 :: c3:c4:c5 -> c6:c7:c8 lastbit :: 0':s -> 0':s conv :: 0':s -> nil:cons cons :: nil:cons -> 0':s -> nil:cons nil :: nil:cons hole_c:c1:c21_9 :: c:c1:c2 hole_0':s2_9 :: 0':s hole_c3:c4:c53_9 :: c3:c4:c5 hole_c6:c7:c84_9 :: c6:c7:c8 hole_nil:cons5_9 :: nil:cons gen_c:c1:c26_9 :: Nat -> c:c1:c2 gen_0':s7_9 :: Nat -> 0':s gen_c3:c4:c58_9 :: Nat -> c3:c4:c5 gen_c6:c7:c89_9 :: Nat -> c6:c7:c8 gen_nil:cons10_9 :: Nat -> nil:cons ---------------------------------------- (19) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: HALF, LASTBIT, CONV, half, lastbit, conv They will be analysed ascendingly in the following order: HALF < CONV LASTBIT < CONV half < CONV half < conv lastbit < conv ---------------------------------------- (20) Obligation: Innermost TRS: Rules: HALF(0') -> c HALF(s(0')) -> c1 HALF(s(s(z0))) -> c2(HALF(z0)) LASTBIT(0') -> c3 LASTBIT(s(0')) -> c4 LASTBIT(s(s(z0))) -> c5(LASTBIT(z0)) CONV(0') -> c6 CONV(s(z0)) -> c7(CONV(half(s(z0))), HALF(s(z0))) CONV(s(z0)) -> c8(LASTBIT(s(z0))) half(0') -> 0' half(s(0')) -> 0' half(s(s(z0))) -> s(half(z0)) lastbit(0') -> 0' lastbit(s(0')) -> s(0') lastbit(s(s(z0))) -> lastbit(z0) conv(0') -> cons(nil, 0') conv(s(z0)) -> cons(conv(half(s(z0))), lastbit(s(z0))) Types: HALF :: 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 LASTBIT :: 0':s -> c3:c4:c5 c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 CONV :: 0':s -> c6:c7:c8 c6 :: c6:c7:c8 c7 :: c6:c7:c8 -> c:c1:c2 -> c6:c7:c8 half :: 0':s -> 0':s c8 :: c3:c4:c5 -> c6:c7:c8 lastbit :: 0':s -> 0':s conv :: 0':s -> nil:cons cons :: nil:cons -> 0':s -> nil:cons nil :: nil:cons hole_c:c1:c21_9 :: c:c1:c2 hole_0':s2_9 :: 0':s hole_c3:c4:c53_9 :: c3:c4:c5 hole_c6:c7:c84_9 :: c6:c7:c8 hole_nil:cons5_9 :: nil:cons gen_c:c1:c26_9 :: Nat -> c:c1:c2 gen_0':s7_9 :: Nat -> 0':s gen_c3:c4:c58_9 :: Nat -> c3:c4:c5 gen_c6:c7:c89_9 :: Nat -> c6:c7:c8 gen_nil:cons10_9 :: Nat -> nil:cons Generator Equations: gen_c:c1:c26_9(0) <=> c gen_c:c1:c26_9(+(x, 1)) <=> c2(gen_c:c1:c26_9(x)) gen_0':s7_9(0) <=> 0' gen_0':s7_9(+(x, 1)) <=> s(gen_0':s7_9(x)) gen_c3:c4:c58_9(0) <=> c3 gen_c3:c4:c58_9(+(x, 1)) <=> c5(gen_c3:c4:c58_9(x)) gen_c6:c7:c89_9(0) <=> c6 gen_c6:c7:c89_9(+(x, 1)) <=> c7(gen_c6:c7:c89_9(x), c) gen_nil:cons10_9(0) <=> nil gen_nil:cons10_9(+(x, 1)) <=> cons(gen_nil:cons10_9(x), 0') The following defined symbols remain to be analysed: HALF, LASTBIT, CONV, half, lastbit, conv They will be analysed ascendingly in the following order: HALF < CONV LASTBIT < CONV half < CONV half < conv lastbit < conv ---------------------------------------- (21) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: HALF(gen_0':s7_9(*(2, n12_9))) -> gen_c:c1:c26_9(n12_9), rt in Omega(1 + n12_9) Induction Base: HALF(gen_0':s7_9(*(2, 0))) ->_R^Omega(1) c Induction Step: HALF(gen_0':s7_9(*(2, +(n12_9, 1)))) ->_R^Omega(1) c2(HALF(gen_0':s7_9(*(2, n12_9)))) ->_IH c2(gen_c:c1:c26_9(c13_9)) 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: HALF(0') -> c HALF(s(0')) -> c1 HALF(s(s(z0))) -> c2(HALF(z0)) LASTBIT(0') -> c3 LASTBIT(s(0')) -> c4 LASTBIT(s(s(z0))) -> c5(LASTBIT(z0)) CONV(0') -> c6 CONV(s(z0)) -> c7(CONV(half(s(z0))), HALF(s(z0))) CONV(s(z0)) -> c8(LASTBIT(s(z0))) half(0') -> 0' half(s(0')) -> 0' half(s(s(z0))) -> s(half(z0)) lastbit(0') -> 0' lastbit(s(0')) -> s(0') lastbit(s(s(z0))) -> lastbit(z0) conv(0') -> cons(nil, 0') conv(s(z0)) -> cons(conv(half(s(z0))), lastbit(s(z0))) Types: HALF :: 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 LASTBIT :: 0':s -> c3:c4:c5 c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 CONV :: 0':s -> c6:c7:c8 c6 :: c6:c7:c8 c7 :: c6:c7:c8 -> c:c1:c2 -> c6:c7:c8 half :: 0':s -> 0':s c8 :: c3:c4:c5 -> c6:c7:c8 lastbit :: 0':s -> 0':s conv :: 0':s -> nil:cons cons :: nil:cons -> 0':s -> nil:cons nil :: nil:cons hole_c:c1:c21_9 :: c:c1:c2 hole_0':s2_9 :: 0':s hole_c3:c4:c53_9 :: c3:c4:c5 hole_c6:c7:c84_9 :: c6:c7:c8 hole_nil:cons5_9 :: nil:cons gen_c:c1:c26_9 :: Nat -> c:c1:c2 gen_0':s7_9 :: Nat -> 0':s gen_c3:c4:c58_9 :: Nat -> c3:c4:c5 gen_c6:c7:c89_9 :: Nat -> c6:c7:c8 gen_nil:cons10_9 :: Nat -> nil:cons Generator Equations: gen_c:c1:c26_9(0) <=> c gen_c:c1:c26_9(+(x, 1)) <=> c2(gen_c:c1:c26_9(x)) gen_0':s7_9(0) <=> 0' gen_0':s7_9(+(x, 1)) <=> s(gen_0':s7_9(x)) gen_c3:c4:c58_9(0) <=> c3 gen_c3:c4:c58_9(+(x, 1)) <=> c5(gen_c3:c4:c58_9(x)) gen_c6:c7:c89_9(0) <=> c6 gen_c6:c7:c89_9(+(x, 1)) <=> c7(gen_c6:c7:c89_9(x), c) gen_nil:cons10_9(0) <=> nil gen_nil:cons10_9(+(x, 1)) <=> cons(gen_nil:cons10_9(x), 0') The following defined symbols remain to be analysed: HALF, LASTBIT, CONV, half, lastbit, conv They will be analysed ascendingly in the following order: HALF < CONV LASTBIT < CONV half < CONV half < conv lastbit < conv ---------------------------------------- (24) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (25) BOUNDS(n^1, INF) ---------------------------------------- (26) Obligation: Innermost TRS: Rules: HALF(0') -> c HALF(s(0')) -> c1 HALF(s(s(z0))) -> c2(HALF(z0)) LASTBIT(0') -> c3 LASTBIT(s(0')) -> c4 LASTBIT(s(s(z0))) -> c5(LASTBIT(z0)) CONV(0') -> c6 CONV(s(z0)) -> c7(CONV(half(s(z0))), HALF(s(z0))) CONV(s(z0)) -> c8(LASTBIT(s(z0))) half(0') -> 0' half(s(0')) -> 0' half(s(s(z0))) -> s(half(z0)) lastbit(0') -> 0' lastbit(s(0')) -> s(0') lastbit(s(s(z0))) -> lastbit(z0) conv(0') -> cons(nil, 0') conv(s(z0)) -> cons(conv(half(s(z0))), lastbit(s(z0))) Types: HALF :: 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 LASTBIT :: 0':s -> c3:c4:c5 c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 CONV :: 0':s -> c6:c7:c8 c6 :: c6:c7:c8 c7 :: c6:c7:c8 -> c:c1:c2 -> c6:c7:c8 half :: 0':s -> 0':s c8 :: c3:c4:c5 -> c6:c7:c8 lastbit :: 0':s -> 0':s conv :: 0':s -> nil:cons cons :: nil:cons -> 0':s -> nil:cons nil :: nil:cons hole_c:c1:c21_9 :: c:c1:c2 hole_0':s2_9 :: 0':s hole_c3:c4:c53_9 :: c3:c4:c5 hole_c6:c7:c84_9 :: c6:c7:c8 hole_nil:cons5_9 :: nil:cons gen_c:c1:c26_9 :: Nat -> c:c1:c2 gen_0':s7_9 :: Nat -> 0':s gen_c3:c4:c58_9 :: Nat -> c3:c4:c5 gen_c6:c7:c89_9 :: Nat -> c6:c7:c8 gen_nil:cons10_9 :: Nat -> nil:cons Lemmas: HALF(gen_0':s7_9(*(2, n12_9))) -> gen_c:c1:c26_9(n12_9), rt in Omega(1 + n12_9) Generator Equations: gen_c:c1:c26_9(0) <=> c gen_c:c1:c26_9(+(x, 1)) <=> c2(gen_c:c1:c26_9(x)) gen_0':s7_9(0) <=> 0' gen_0':s7_9(+(x, 1)) <=> s(gen_0':s7_9(x)) gen_c3:c4:c58_9(0) <=> c3 gen_c3:c4:c58_9(+(x, 1)) <=> c5(gen_c3:c4:c58_9(x)) gen_c6:c7:c89_9(0) <=> c6 gen_c6:c7:c89_9(+(x, 1)) <=> c7(gen_c6:c7:c89_9(x), c) gen_nil:cons10_9(0) <=> nil gen_nil:cons10_9(+(x, 1)) <=> cons(gen_nil:cons10_9(x), 0') The following defined symbols remain to be analysed: LASTBIT, CONV, half, lastbit, conv They will be analysed ascendingly in the following order: LASTBIT < CONV half < CONV half < conv lastbit < conv ---------------------------------------- (27) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: LASTBIT(gen_0':s7_9(*(2, n430_9))) -> gen_c3:c4:c58_9(n430_9), rt in Omega(1 + n430_9) Induction Base: LASTBIT(gen_0':s7_9(*(2, 0))) ->_R^Omega(1) c3 Induction Step: LASTBIT(gen_0':s7_9(*(2, +(n430_9, 1)))) ->_R^Omega(1) c5(LASTBIT(gen_0':s7_9(*(2, n430_9)))) ->_IH c5(gen_c3:c4:c58_9(c431_9)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (28) Obligation: Innermost TRS: Rules: HALF(0') -> c HALF(s(0')) -> c1 HALF(s(s(z0))) -> c2(HALF(z0)) LASTBIT(0') -> c3 LASTBIT(s(0')) -> c4 LASTBIT(s(s(z0))) -> c5(LASTBIT(z0)) CONV(0') -> c6 CONV(s(z0)) -> c7(CONV(half(s(z0))), HALF(s(z0))) CONV(s(z0)) -> c8(LASTBIT(s(z0))) half(0') -> 0' half(s(0')) -> 0' half(s(s(z0))) -> s(half(z0)) lastbit(0') -> 0' lastbit(s(0')) -> s(0') lastbit(s(s(z0))) -> lastbit(z0) conv(0') -> cons(nil, 0') conv(s(z0)) -> cons(conv(half(s(z0))), lastbit(s(z0))) Types: HALF :: 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 LASTBIT :: 0':s -> c3:c4:c5 c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 CONV :: 0':s -> c6:c7:c8 c6 :: c6:c7:c8 c7 :: c6:c7:c8 -> c:c1:c2 -> c6:c7:c8 half :: 0':s -> 0':s c8 :: c3:c4:c5 -> c6:c7:c8 lastbit :: 0':s -> 0':s conv :: 0':s -> nil:cons cons :: nil:cons -> 0':s -> nil:cons nil :: nil:cons hole_c:c1:c21_9 :: c:c1:c2 hole_0':s2_9 :: 0':s hole_c3:c4:c53_9 :: c3:c4:c5 hole_c6:c7:c84_9 :: c6:c7:c8 hole_nil:cons5_9 :: nil:cons gen_c:c1:c26_9 :: Nat -> c:c1:c2 gen_0':s7_9 :: Nat -> 0':s gen_c3:c4:c58_9 :: Nat -> c3:c4:c5 gen_c6:c7:c89_9 :: Nat -> c6:c7:c8 gen_nil:cons10_9 :: Nat -> nil:cons Lemmas: HALF(gen_0':s7_9(*(2, n12_9))) -> gen_c:c1:c26_9(n12_9), rt in Omega(1 + n12_9) LASTBIT(gen_0':s7_9(*(2, n430_9))) -> gen_c3:c4:c58_9(n430_9), rt in Omega(1 + n430_9) Generator Equations: gen_c:c1:c26_9(0) <=> c gen_c:c1:c26_9(+(x, 1)) <=> c2(gen_c:c1:c26_9(x)) gen_0':s7_9(0) <=> 0' gen_0':s7_9(+(x, 1)) <=> s(gen_0':s7_9(x)) gen_c3:c4:c58_9(0) <=> c3 gen_c3:c4:c58_9(+(x, 1)) <=> c5(gen_c3:c4:c58_9(x)) gen_c6:c7:c89_9(0) <=> c6 gen_c6:c7:c89_9(+(x, 1)) <=> c7(gen_c6:c7:c89_9(x), c) gen_nil:cons10_9(0) <=> nil gen_nil:cons10_9(+(x, 1)) <=> cons(gen_nil:cons10_9(x), 0') The following defined symbols remain to be analysed: half, CONV, lastbit, conv They will be analysed ascendingly in the following order: half < CONV half < conv lastbit < conv ---------------------------------------- (29) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: half(gen_0':s7_9(*(2, n920_9))) -> gen_0':s7_9(n920_9), rt in Omega(0) Induction Base: half(gen_0':s7_9(*(2, 0))) ->_R^Omega(0) 0' Induction Step: half(gen_0':s7_9(*(2, +(n920_9, 1)))) ->_R^Omega(0) s(half(gen_0':s7_9(*(2, n920_9)))) ->_IH s(gen_0':s7_9(c921_9)) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (30) Obligation: Innermost TRS: Rules: HALF(0') -> c HALF(s(0')) -> c1 HALF(s(s(z0))) -> c2(HALF(z0)) LASTBIT(0') -> c3 LASTBIT(s(0')) -> c4 LASTBIT(s(s(z0))) -> c5(LASTBIT(z0)) CONV(0') -> c6 CONV(s(z0)) -> c7(CONV(half(s(z0))), HALF(s(z0))) CONV(s(z0)) -> c8(LASTBIT(s(z0))) half(0') -> 0' half(s(0')) -> 0' half(s(s(z0))) -> s(half(z0)) lastbit(0') -> 0' lastbit(s(0')) -> s(0') lastbit(s(s(z0))) -> lastbit(z0) conv(0') -> cons(nil, 0') conv(s(z0)) -> cons(conv(half(s(z0))), lastbit(s(z0))) Types: HALF :: 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 LASTBIT :: 0':s -> c3:c4:c5 c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 CONV :: 0':s -> c6:c7:c8 c6 :: c6:c7:c8 c7 :: c6:c7:c8 -> c:c1:c2 -> c6:c7:c8 half :: 0':s -> 0':s c8 :: c3:c4:c5 -> c6:c7:c8 lastbit :: 0':s -> 0':s conv :: 0':s -> nil:cons cons :: nil:cons -> 0':s -> nil:cons nil :: nil:cons hole_c:c1:c21_9 :: c:c1:c2 hole_0':s2_9 :: 0':s hole_c3:c4:c53_9 :: c3:c4:c5 hole_c6:c7:c84_9 :: c6:c7:c8 hole_nil:cons5_9 :: nil:cons gen_c:c1:c26_9 :: Nat -> c:c1:c2 gen_0':s7_9 :: Nat -> 0':s gen_c3:c4:c58_9 :: Nat -> c3:c4:c5 gen_c6:c7:c89_9 :: Nat -> c6:c7:c8 gen_nil:cons10_9 :: Nat -> nil:cons Lemmas: HALF(gen_0':s7_9(*(2, n12_9))) -> gen_c:c1:c26_9(n12_9), rt in Omega(1 + n12_9) LASTBIT(gen_0':s7_9(*(2, n430_9))) -> gen_c3:c4:c58_9(n430_9), rt in Omega(1 + n430_9) half(gen_0':s7_9(*(2, n920_9))) -> gen_0':s7_9(n920_9), rt in Omega(0) Generator Equations: gen_c:c1:c26_9(0) <=> c gen_c:c1:c26_9(+(x, 1)) <=> c2(gen_c:c1:c26_9(x)) gen_0':s7_9(0) <=> 0' gen_0':s7_9(+(x, 1)) <=> s(gen_0':s7_9(x)) gen_c3:c4:c58_9(0) <=> c3 gen_c3:c4:c58_9(+(x, 1)) <=> c5(gen_c3:c4:c58_9(x)) gen_c6:c7:c89_9(0) <=> c6 gen_c6:c7:c89_9(+(x, 1)) <=> c7(gen_c6:c7:c89_9(x), c) gen_nil:cons10_9(0) <=> nil gen_nil:cons10_9(+(x, 1)) <=> cons(gen_nil:cons10_9(x), 0') The following defined symbols remain to be analysed: CONV, lastbit, conv They will be analysed ascendingly in the following order: lastbit < conv ---------------------------------------- (31) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: lastbit(gen_0':s7_9(*(2, n4811_9))) -> gen_0':s7_9(0), rt in Omega(0) Induction Base: lastbit(gen_0':s7_9(*(2, 0))) ->_R^Omega(0) 0' Induction Step: lastbit(gen_0':s7_9(*(2, +(n4811_9, 1)))) ->_R^Omega(0) lastbit(gen_0':s7_9(*(2, n4811_9))) ->_IH gen_0':s7_9(0) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (32) Obligation: Innermost TRS: Rules: HALF(0') -> c HALF(s(0')) -> c1 HALF(s(s(z0))) -> c2(HALF(z0)) LASTBIT(0') -> c3 LASTBIT(s(0')) -> c4 LASTBIT(s(s(z0))) -> c5(LASTBIT(z0)) CONV(0') -> c6 CONV(s(z0)) -> c7(CONV(half(s(z0))), HALF(s(z0))) CONV(s(z0)) -> c8(LASTBIT(s(z0))) half(0') -> 0' half(s(0')) -> 0' half(s(s(z0))) -> s(half(z0)) lastbit(0') -> 0' lastbit(s(0')) -> s(0') lastbit(s(s(z0))) -> lastbit(z0) conv(0') -> cons(nil, 0') conv(s(z0)) -> cons(conv(half(s(z0))), lastbit(s(z0))) Types: HALF :: 0':s -> c:c1:c2 0' :: 0':s c :: c:c1:c2 s :: 0':s -> 0':s c1 :: c:c1:c2 c2 :: c:c1:c2 -> c:c1:c2 LASTBIT :: 0':s -> c3:c4:c5 c3 :: c3:c4:c5 c4 :: c3:c4:c5 c5 :: c3:c4:c5 -> c3:c4:c5 CONV :: 0':s -> c6:c7:c8 c6 :: c6:c7:c8 c7 :: c6:c7:c8 -> c:c1:c2 -> c6:c7:c8 half :: 0':s -> 0':s c8 :: c3:c4:c5 -> c6:c7:c8 lastbit :: 0':s -> 0':s conv :: 0':s -> nil:cons cons :: nil:cons -> 0':s -> nil:cons nil :: nil:cons hole_c:c1:c21_9 :: c:c1:c2 hole_0':s2_9 :: 0':s hole_c3:c4:c53_9 :: c3:c4:c5 hole_c6:c7:c84_9 :: c6:c7:c8 hole_nil:cons5_9 :: nil:cons gen_c:c1:c26_9 :: Nat -> c:c1:c2 gen_0':s7_9 :: Nat -> 0':s gen_c3:c4:c58_9 :: Nat -> c3:c4:c5 gen_c6:c7:c89_9 :: Nat -> c6:c7:c8 gen_nil:cons10_9 :: Nat -> nil:cons Lemmas: HALF(gen_0':s7_9(*(2, n12_9))) -> gen_c:c1:c26_9(n12_9), rt in Omega(1 + n12_9) LASTBIT(gen_0':s7_9(*(2, n430_9))) -> gen_c3:c4:c58_9(n430_9), rt in Omega(1 + n430_9) half(gen_0':s7_9(*(2, n920_9))) -> gen_0':s7_9(n920_9), rt in Omega(0) lastbit(gen_0':s7_9(*(2, n4811_9))) -> gen_0':s7_9(0), rt in Omega(0) Generator Equations: gen_c:c1:c26_9(0) <=> c gen_c:c1:c26_9(+(x, 1)) <=> c2(gen_c:c1:c26_9(x)) gen_0':s7_9(0) <=> 0' gen_0':s7_9(+(x, 1)) <=> s(gen_0':s7_9(x)) gen_c3:c4:c58_9(0) <=> c3 gen_c3:c4:c58_9(+(x, 1)) <=> c5(gen_c3:c4:c58_9(x)) gen_c6:c7:c89_9(0) <=> c6 gen_c6:c7:c89_9(+(x, 1)) <=> c7(gen_c6:c7:c89_9(x), c) gen_nil:cons10_9(0) <=> nil gen_nil:cons10_9(+(x, 1)) <=> cons(gen_nil:cons10_9(x), 0') The following defined symbols remain to be analysed: conv