WORST_CASE(Omega(n^1),O(n^1)) proof of input_i3fat5ys7a.trs # AProVE Commit ID: aff8ecad908e01718a4c36e68d2e55d5e0f16e15 fuhs 20220216 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, 611 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), 14 ms] (20) typed CpxTrs (21) RewriteLemmaProof [LOWER BOUND(ID), 351 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), 95 ms] (28) typed CpxTrs (29) RewriteLemmaProof [LOWER BOUND(ID), 76 ms] (30) typed CpxTrs (31) RewriteLemmaProof [LOWER BOUND(ID), 82 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) zero(0) -> true zero(s(x)) -> false conv(x) -> conviter(x, cons(0, nil)) conviter(x, l) -> if(zero(x), x, l) if(true, x, l) -> l if(false, x, l) -> conviter(half(x), cons(lastbit(x), l)) 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] zero(0) -> true [1] zero(s(x)) -> false [1] conv(x) -> conviter(x, cons(0, nil)) [1] conviter(x, l) -> if(zero(x), x, l) [1] if(true, x, l) -> l [1] if(false, x, l) -> conviter(half(x), cons(lastbit(x), l)) [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] zero(0) -> true [1] zero(s(x)) -> false [1] conv(x) -> conviter(x, cons(0, nil)) [1] conviter(x, l) -> if(zero(x), x, l) [1] if(true, x, l) -> l [1] if(false, x, l) -> conviter(half(x), cons(lastbit(x), l)) [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 zero :: 0:s -> true:false true :: true:false false :: true:false conv :: 0:s -> nil:cons conviter :: 0:s -> nil:cons -> nil:cons cons :: 0:s -> nil:cons -> nil:cons nil :: nil:cons if :: true:false -> 0:s -> nil:cons -> 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] zero(0) -> true [1] zero(s(x)) -> false [1] conv(x) -> conviter(x, cons(0, nil)) [1] conviter(x, l) -> if(zero(x), x, l) [1] if(true, x, l) -> l [1] if(false, x, l) -> conviter(half(x), cons(lastbit(x), l)) [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 zero :: 0:s -> true:false true :: true:false false :: true:false conv :: 0:s -> nil:cons conviter :: 0:s -> nil:cons -> nil:cons cons :: 0:s -> nil:cons -> nil:cons nil :: nil:cons if :: true:false -> 0:s -> nil:cons -> 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 true => 1 false => 0 nil => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: conv(z) -{ 1 }-> conviter(x, 1 + 0 + 0) :|: x >= 0, z = x conviter(z, z') -{ 1 }-> if(zero(x), x, l) :|: z' = l, x >= 0, l >= 0, z = x 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) if(z, z', z'') -{ 1 }-> l :|: z' = x, z = 1, x >= 0, l >= 0, z'' = l if(z, z', z'') -{ 1 }-> conviter(half(x), 1 + lastbit(x) + l) :|: z' = x, x >= 0, l >= 0, z = 0, z'' = l 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 zero(z) -{ 1 }-> 1 :|: z = 0 zero(z) -{ 1 }-> 0 :|: x >= 0, z = 1 + x 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, V5, V8),0,[half(V, Out)],[V >= 0]). eq(start(V, V5, V8),0,[lastbit(V, Out)],[V >= 0]). eq(start(V, V5, V8),0,[zero(V, Out)],[V >= 0]). eq(start(V, V5, V8),0,[conv(V, Out)],[V >= 0]). eq(start(V, V5, V8),0,[conviter(V, V5, Out)],[V >= 0,V5 >= 0]). eq(start(V, V5, V8),0,[if(V, V5, V8, Out)],[V >= 0,V5 >= 0,V8 >= 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(zero(V, Out),1,[],[Out = 1,V = 0]). eq(zero(V, Out),1,[],[Out = 0,V3 >= 0,V = 1 + V3]). eq(conv(V, Out),1,[conviter(V4, 1 + 0 + 0, Ret2)],[Out = Ret2,V4 >= 0,V = V4]). eq(conviter(V, V5, Out),1,[zero(V6, Ret0),if(Ret0, V6, V7, Ret3)],[Out = Ret3,V5 = V7,V6 >= 0,V7 >= 0,V = V6]). eq(if(V, V5, V8, Out),1,[],[Out = V10,V5 = V9,V = 1,V9 >= 0,V10 >= 0,V8 = V10]). eq(if(V, V5, V8, Out),1,[half(V11, Ret01),lastbit(V11, Ret101),conviter(Ret01, 1 + Ret101 + V12, Ret4)],[Out = Ret4,V5 = V11,V11 >= 0,V12 >= 0,V = 0,V8 = V12]). input_output_vars(half(V,Out),[V],[Out]). input_output_vars(lastbit(V,Out),[V],[Out]). input_output_vars(zero(V,Out),[V],[Out]). input_output_vars(conv(V,Out),[V],[Out]). input_output_vars(conviter(V,V5,Out),[V,V5],[Out]). input_output_vars(if(V,V5,V8,Out),[V,V5,V8],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [half/2] 1. recursive : [lastbit/2] 2. non_recursive : [zero/2] 3. recursive : [conviter/3,if/4] 4. non_recursive : [conv/2] 5. non_recursive : [start/3] #### 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 zero/2 3. SCC is partially evaluated into conviter/3 4. SCC is completely evaluated into other SCCs 5. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations half/2 * CE 10 is refined into CE [18] * CE 9 is refined into CE [19] * CE 8 is refined into CE [20] ### Cost equations --> "Loop" of half/2 * CEs [19] --> Loop 13 * CEs [20] --> Loop 14 * CEs [18] --> Loop 15 ### Ranking functions of CR half(V,Out) * RF of phase [15]: [V-1] #### Partial ranking functions of CR half(V,Out) * Partial RF of phase [15]: - RF of loop [15:1]: V-1 ### Specialization of cost equations lastbit/2 * CE 13 is refined into CE [21] * CE 12 is refined into CE [22] * CE 11 is refined into CE [23] ### Cost equations --> "Loop" of lastbit/2 * CEs [22] --> Loop 16 * CEs [23] --> Loop 17 * CEs [21] --> Loop 18 ### Ranking functions of CR lastbit(V,Out) * RF of phase [18]: [V-1] #### Partial ranking functions of CR lastbit(V,Out) * Partial RF of phase [18]: - RF of loop [18:1]: V-1 ### Specialization of cost equations zero/2 * CE 17 is refined into CE [24] * CE 16 is refined into CE [25] ### Cost equations --> "Loop" of zero/2 * CEs [24] --> Loop 19 * CEs [25] --> Loop 20 ### Ranking functions of CR zero(V,Out) #### Partial ranking functions of CR zero(V,Out) ### Specialization of cost equations conviter/3 * CE 15 is refined into CE [26] * CE 14 is refined into CE [27,28,29,30,31] ### Cost equations --> "Loop" of conviter/3 * CEs [30] --> Loop 21 * CEs [31] --> Loop 22 * CEs [28] --> Loop 23 * CEs [29] --> Loop 24 * CEs [27] --> Loop 25 * CEs [26] --> Loop 26 ### Ranking functions of CR conviter(V,V5,Out) * RF of phase [21,22,23,24]: [V-1,2*V+V5-3] #### Partial ranking functions of CR conviter(V,V5,Out) * Partial RF of phase [21,22,23,24]: - RF of loop [21:1,22:1]: V/2-1 - RF of loop [23:1]: V-1 - RF of loop [24:1]: 2/3*V-5/3 ### Specialization of cost equations start/3 * CE 2 is refined into CE [32] * CE 1 is refined into CE [33,34,35,36,37,38,39,40,41] * CE 3 is refined into CE [42,43,44,45] * CE 4 is refined into CE [46,47,48,49] * CE 5 is refined into CE [50,51] * CE 6 is refined into CE [52,53,54] * CE 7 is refined into CE [55,56,57] ### Cost equations --> "Loop" of start/3 * CEs [32,43,44,45,47,48,49,51,53,54,56,57] --> Loop 27 * CEs [33,34,35,36,37,38,39,40,41,42,46,50,52,55] --> Loop 28 ### Ranking functions of CR start(V,V5,V8) #### Partial ranking functions of CR start(V,V5,V8) Computing Bounds ===================================== #### Cost of chains of half(V,Out): * Chain [[15],14]: 1*it(15)+1 Such that:it(15) =< 2*Out with precondition: [V=2*Out,V>=2] * Chain [[15],13]: 1*it(15)+1 Such that:it(15) =< 2*Out with precondition: [V=2*Out+1,V>=3] * Chain [14]: 1 with precondition: [V=0,Out=0] * Chain [13]: 1 with precondition: [V=1,Out=0] #### Cost of chains of lastbit(V,Out): * Chain [[18],17]: 1*it(18)+1 Such that:it(18) =< V with precondition: [Out=0,V>=2] * Chain [[18],16]: 1*it(18)+1 Such that:it(18) =< V with precondition: [Out=1,V>=3] * Chain [17]: 1 with precondition: [V=0,Out=0] * Chain [16]: 1 with precondition: [V=1,Out=1] #### Cost of chains of zero(V,Out): * Chain [20]: 1 with precondition: [V=0,Out=1] * Chain [19]: 1 with precondition: [Out=0,V>=1] #### Cost of chains of conviter(V,V5,Out): * Chain [[21,22,23,24],25,26]: 5*it(21)+5*it(22)+5*it(23)+5*it(24)+2*s(17)+2*s(18)+4*s(21)+8 Such that:aux(6) =< 2*V+V5 aux(7) =< 2*V+V5-Out aux(10) =< 3*V aux(9) =< 3*V+6 aux(12) =< 4*V aux(11) =< 4*V+8 it(24) =< 2/3*V aux(15) =< V aux(16) =< 2*V aux(17) =< V/2 it(21) =< aux(15) it(22) =< aux(15) it(23) =< aux(15) it(24) =< aux(15) it(24) =< aux(16) it(21) =< aux(6) it(22) =< aux(6) it(23) =< aux(6) it(24) =< aux(6) it(21) =< aux(7) it(22) =< aux(7) it(23) =< aux(7) it(24) =< aux(7) it(22) =< aux(9) it(23) =< aux(9) it(24) =< aux(9) s(18) =< aux(9) it(22) =< aux(10) it(23) =< aux(10) it(24) =< aux(10) s(18) =< aux(10) it(22) =< aux(11) it(23) =< aux(11) it(24) =< aux(11) s(17) =< aux(11) it(22) =< aux(12) it(23) =< aux(12) it(24) =< aux(12) s(17) =< aux(12) it(21) =< aux(17) it(22) =< aux(17) s(21) =< aux(16) with precondition: [V5>=0,Out>=V5+3,V+2*V5+6>=2*Out,V+V5+1>=Out] * Chain [26]: 3 with precondition: [V=0,V5=Out,V5>=0] * Chain [25,26]: 8 with precondition: [V=1,Out=V5+2,Out>=2] #### Cost of chains of start(V,V5,V8): * Chain [28]: 4*s(25)+24*s(27)+5*s(35)+10*s(39)+5*s(40)+5*s(41)+4*s(42)+4*s(43)+5*s(53)+5*s(57)+5*s(58)+5*s(59)+2*s(64)+5*s(73)+5*s(77)+5*s(78)+5*s(79)+4*s(80)+4*s(81)+5*s(93)+5*s(98)+5*s(99)+11 Such that:s(67) =< V5+V8 s(47) =< V5+V8+2 aux(23) =< 2 aux(24) =< 3 aux(25) =< V5 aux(26) =< V5+V8+1 aux(27) =< 2*V5 aux(28) =< 2*V5+6 aux(29) =< 2*V5+8 aux(30) =< V5/2 aux(31) =< V5/3 aux(32) =< V5/4 aux(33) =< 3/2*V5 aux(34) =< 3/2*V5+6 aux(35) =< 3/2*V5+9/2 s(25) =< aux(23) s(64) =< aux(24) s(35) =< aux(31) s(53) =< aux(31) s(73) =< aux(31) s(93) =< aux(31) s(27) =< aux(25) s(77) =< aux(30) s(78) =< aux(30) s(79) =< aux(30) s(73) =< aux(30) s(73) =< aux(25) s(77) =< s(67) s(78) =< s(67) s(79) =< s(67) s(73) =< s(67) s(77) =< aux(25) s(78) =< aux(25) s(79) =< aux(25) s(78) =< aux(35) s(79) =< aux(35) s(73) =< aux(35) s(80) =< aux(35) s(78) =< aux(33) s(79) =< aux(33) s(73) =< aux(33) s(80) =< aux(33) s(78) =< aux(28) s(79) =< aux(28) s(73) =< aux(28) s(81) =< aux(28) s(78) =< aux(27) s(79) =< aux(27) s(73) =< aux(27) s(81) =< aux(27) s(77) =< aux(32) s(78) =< aux(32) s(39) =< aux(30) s(40) =< aux(30) s(41) =< aux(30) s(35) =< aux(30) s(35) =< aux(25) s(39) =< aux(26) s(40) =< aux(26) s(41) =< aux(26) s(35) =< aux(26) s(39) =< aux(25) s(40) =< aux(25) s(41) =< aux(25) s(40) =< aux(34) s(41) =< aux(34) s(35) =< aux(34) s(42) =< aux(34) s(40) =< aux(33) s(41) =< aux(33) s(35) =< aux(33) s(42) =< aux(33) s(40) =< aux(29) s(41) =< aux(29) s(35) =< aux(29) s(43) =< aux(29) s(40) =< aux(27) s(41) =< aux(27) s(35) =< aux(27) s(43) =< aux(27) s(39) =< aux(32) s(40) =< aux(32) s(98) =< aux(30) s(99) =< aux(30) s(93) =< aux(30) s(93) =< aux(25) s(98) =< aux(26) s(99) =< aux(26) s(93) =< aux(26) s(98) =< aux(25) s(99) =< aux(25) s(98) =< aux(35) s(99) =< aux(35) s(93) =< aux(35) s(98) =< aux(33) s(99) =< aux(33) s(93) =< aux(33) s(98) =< aux(28) s(99) =< aux(28) s(93) =< aux(28) s(98) =< aux(27) s(99) =< aux(27) s(93) =< aux(27) s(98) =< aux(32) s(57) =< aux(30) s(58) =< aux(30) s(59) =< aux(30) s(53) =< aux(30) s(53) =< aux(25) s(57) =< s(47) s(58) =< s(47) s(59) =< s(47) s(53) =< s(47) s(57) =< aux(25) s(58) =< aux(25) s(59) =< aux(25) s(58) =< aux(34) s(59) =< aux(34) s(53) =< aux(34) s(58) =< aux(33) s(59) =< aux(33) s(53) =< aux(33) s(58) =< aux(29) s(59) =< aux(29) s(53) =< aux(29) s(58) =< aux(27) s(59) =< aux(27) s(53) =< aux(27) s(57) =< aux(32) s(58) =< aux(32) with precondition: [V=0] * Chain [27]: 4*s(103)+5*s(113)+5*s(117)+5*s(118)+5*s(119)+4*s(120)+4*s(121)+8*s(122)+5*s(129)+5*s(133)+5*s(134)+5*s(135)+9 Such that:s(107) =< 2*V+1 s(123) =< 2*V+V5 aux(38) =< V aux(39) =< 2*V aux(40) =< 3*V aux(41) =< 3*V+6 aux(42) =< 4*V aux(43) =< 4*V+8 aux(44) =< V/2 aux(45) =< 2/3*V s(103) =< aux(38) s(113) =< aux(45) s(129) =< aux(45) s(117) =< aux(38) s(118) =< aux(38) s(119) =< aux(38) s(113) =< aux(38) s(113) =< aux(39) s(117) =< s(107) s(118) =< s(107) s(119) =< s(107) s(113) =< s(107) s(117) =< aux(39) s(118) =< aux(39) s(119) =< aux(39) s(118) =< aux(41) s(119) =< aux(41) s(113) =< aux(41) s(120) =< aux(41) s(118) =< aux(40) s(119) =< aux(40) s(113) =< aux(40) s(120) =< aux(40) s(118) =< aux(43) s(119) =< aux(43) s(113) =< aux(43) s(121) =< aux(43) s(118) =< aux(42) s(119) =< aux(42) s(113) =< aux(42) s(121) =< aux(42) s(117) =< aux(44) s(118) =< aux(44) s(122) =< aux(39) s(133) =< aux(38) s(134) =< aux(38) s(135) =< aux(38) s(129) =< aux(38) s(129) =< aux(39) s(133) =< s(123) s(134) =< s(123) s(135) =< s(123) s(129) =< s(123) s(133) =< aux(39) s(134) =< aux(39) s(135) =< aux(39) s(134) =< aux(41) s(135) =< aux(41) s(129) =< aux(41) s(134) =< aux(40) s(135) =< aux(40) s(129) =< aux(40) s(134) =< aux(43) s(135) =< aux(43) s(129) =< aux(43) s(134) =< aux(42) s(135) =< aux(42) s(129) =< aux(42) s(133) =< aux(44) s(134) =< aux(44) with precondition: [V>=1] Closed-form bounds of start(V,V5,V8): ------------------------------------- * Chain [28] with precondition: [V=0] - Upper bound: nat(V5)*24+25+nat(2*V5+6)*4+nat(2*V5+8)*4+nat(3/2*V5+6)*4+nat(3/2*V5+9/2)*4+nat(V5/2)*60+nat(V5/3)*20 - Complexity: n * Chain [27] with precondition: [V>=1] - Upper bound: 254/3*V+65 - Complexity: n ### Maximum cost of start(V,V5,V8): max([254/3*V+56,nat(V5)*24+16+nat(2*V5+6)*4+nat(2*V5+8)*4+nat(3/2*V5+6)*4+nat(3/2*V5+9/2)*4+nat(V5/2)*60+nat(V5/3)*20])+9 Asymptotic class: n * Total analysis performed in 529 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) zero(0) -> true zero(s(z0)) -> false conv(z0) -> conviter(z0, cons(0, nil)) conviter(z0, z1) -> if(zero(z0), z0, z1) if(true, z0, z1) -> z1 if(false, z0, z1) -> conviter(half(z0), cons(lastbit(z0), z1)) 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)) ZERO(0) -> c6 ZERO(s(z0)) -> c7 CONV(z0) -> c8(CONVITER(z0, cons(0, nil))) CONVITER(z0, z1) -> c9(IF(zero(z0), z0, z1), ZERO(z0)) IF(true, z0, z1) -> c10 IF(false, z0, z1) -> c11(CONVITER(half(z0), cons(lastbit(z0), z1)), HALF(z0)) IF(false, z0, z1) -> c12(CONVITER(half(z0), cons(lastbit(z0), z1)), LASTBIT(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)) ZERO(0) -> c6 ZERO(s(z0)) -> c7 CONV(z0) -> c8(CONVITER(z0, cons(0, nil))) CONVITER(z0, z1) -> c9(IF(zero(z0), z0, z1), ZERO(z0)) IF(true, z0, z1) -> c10 IF(false, z0, z1) -> c11(CONVITER(half(z0), cons(lastbit(z0), z1)), HALF(z0)) IF(false, z0, z1) -> c12(CONVITER(half(z0), cons(lastbit(z0), z1)), LASTBIT(z0)) K tuples:none Defined Rule Symbols: half_1, lastbit_1, zero_1, conv_1, conviter_2, if_3 Defined Pair Symbols: HALF_1, LASTBIT_1, ZERO_1, CONV_1, CONVITER_2, IF_3 Compound Symbols: c, c1, c2_1, c3, c4, c5_1, c6, c7, c8_1, c9_2, c10, c11_2, c12_2 ---------------------------------------- (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)) ZERO(0) -> c6 ZERO(s(z0)) -> c7 CONV(z0) -> c8(CONVITER(z0, cons(0, nil))) CONVITER(z0, z1) -> c9(IF(zero(z0), z0, z1), ZERO(z0)) IF(true, z0, z1) -> c10 IF(false, z0, z1) -> c11(CONVITER(half(z0), cons(lastbit(z0), z1)), HALF(z0)) IF(false, z0, z1) -> c12(CONVITER(half(z0), cons(lastbit(z0), z1)), LASTBIT(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) zero(0) -> true zero(s(z0)) -> false conv(z0) -> conviter(z0, cons(0, nil)) conviter(z0, z1) -> if(zero(z0), z0, z1) if(true, z0, z1) -> z1 if(false, z0, z1) -> conviter(half(z0), cons(lastbit(z0), z1)) 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)) ZERO(0') -> c6 ZERO(s(z0)) -> c7 CONV(z0) -> c8(CONVITER(z0, cons(0', nil))) CONVITER(z0, z1) -> c9(IF(zero(z0), z0, z1), ZERO(z0)) IF(true, z0, z1) -> c10 IF(false, z0, z1) -> c11(CONVITER(half(z0), cons(lastbit(z0), z1)), HALF(z0)) IF(false, z0, z1) -> c12(CONVITER(half(z0), cons(lastbit(z0), z1)), LASTBIT(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) zero(0') -> true zero(s(z0)) -> false conv(z0) -> conviter(z0, cons(0', nil)) conviter(z0, z1) -> if(zero(z0), z0, z1) if(true, z0, z1) -> z1 if(false, z0, z1) -> conviter(half(z0), cons(lastbit(z0), z1)) 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)) ZERO(0') -> c6 ZERO(s(z0)) -> c7 CONV(z0) -> c8(CONVITER(z0, cons(0', nil))) CONVITER(z0, z1) -> c9(IF(zero(z0), z0, z1), ZERO(z0)) IF(true, z0, z1) -> c10 IF(false, z0, z1) -> c11(CONVITER(half(z0), cons(lastbit(z0), z1)), HALF(z0)) IF(false, z0, z1) -> c12(CONVITER(half(z0), cons(lastbit(z0), z1)), LASTBIT(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) zero(0') -> true zero(s(z0)) -> false conv(z0) -> conviter(z0, cons(0', nil)) conviter(z0, z1) -> if(zero(z0), z0, z1) if(true, z0, z1) -> z1 if(false, z0, z1) -> conviter(half(z0), cons(lastbit(z0), z1)) 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 ZERO :: 0':s -> c6:c7 c6 :: c6:c7 c7 :: c6:c7 CONV :: 0':s -> c8 c8 :: c9 -> c8 CONVITER :: 0':s -> nil:cons -> c9 cons :: 0':s -> nil:cons -> nil:cons nil :: nil:cons c9 :: c10:c11:c12 -> c6:c7 -> c9 IF :: true:false -> 0':s -> nil:cons -> c10:c11:c12 zero :: 0':s -> true:false true :: true:false c10 :: c10:c11:c12 false :: true:false c11 :: c9 -> c:c1:c2 -> c10:c11:c12 half :: 0':s -> 0':s lastbit :: 0':s -> 0':s c12 :: c9 -> c3:c4:c5 -> c10:c11:c12 conv :: 0':s -> nil:cons conviter :: 0':s -> nil:cons -> nil:cons if :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_13 :: c:c1:c2 hole_0':s2_13 :: 0':s hole_c3:c4:c53_13 :: c3:c4:c5 hole_c6:c74_13 :: c6:c7 hole_c85_13 :: c8 hole_c96_13 :: c9 hole_nil:cons7_13 :: nil:cons hole_c10:c11:c128_13 :: c10:c11:c12 hole_true:false9_13 :: true:false gen_c:c1:c210_13 :: Nat -> c:c1:c2 gen_0':s11_13 :: Nat -> 0':s gen_c3:c4:c512_13 :: Nat -> c3:c4:c5 gen_nil:cons13_13 :: Nat -> nil:cons ---------------------------------------- (19) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: HALF, LASTBIT, CONVITER, half, lastbit, conviter They will be analysed ascendingly in the following order: HALF < CONVITER LASTBIT < CONVITER half < CONVITER lastbit < CONVITER half < conviter lastbit < conviter ---------------------------------------- (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)) ZERO(0') -> c6 ZERO(s(z0)) -> c7 CONV(z0) -> c8(CONVITER(z0, cons(0', nil))) CONVITER(z0, z1) -> c9(IF(zero(z0), z0, z1), ZERO(z0)) IF(true, z0, z1) -> c10 IF(false, z0, z1) -> c11(CONVITER(half(z0), cons(lastbit(z0), z1)), HALF(z0)) IF(false, z0, z1) -> c12(CONVITER(half(z0), cons(lastbit(z0), z1)), LASTBIT(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) zero(0') -> true zero(s(z0)) -> false conv(z0) -> conviter(z0, cons(0', nil)) conviter(z0, z1) -> if(zero(z0), z0, z1) if(true, z0, z1) -> z1 if(false, z0, z1) -> conviter(half(z0), cons(lastbit(z0), z1)) 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 ZERO :: 0':s -> c6:c7 c6 :: c6:c7 c7 :: c6:c7 CONV :: 0':s -> c8 c8 :: c9 -> c8 CONVITER :: 0':s -> nil:cons -> c9 cons :: 0':s -> nil:cons -> nil:cons nil :: nil:cons c9 :: c10:c11:c12 -> c6:c7 -> c9 IF :: true:false -> 0':s -> nil:cons -> c10:c11:c12 zero :: 0':s -> true:false true :: true:false c10 :: c10:c11:c12 false :: true:false c11 :: c9 -> c:c1:c2 -> c10:c11:c12 half :: 0':s -> 0':s lastbit :: 0':s -> 0':s c12 :: c9 -> c3:c4:c5 -> c10:c11:c12 conv :: 0':s -> nil:cons conviter :: 0':s -> nil:cons -> nil:cons if :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_13 :: c:c1:c2 hole_0':s2_13 :: 0':s hole_c3:c4:c53_13 :: c3:c4:c5 hole_c6:c74_13 :: c6:c7 hole_c85_13 :: c8 hole_c96_13 :: c9 hole_nil:cons7_13 :: nil:cons hole_c10:c11:c128_13 :: c10:c11:c12 hole_true:false9_13 :: true:false gen_c:c1:c210_13 :: Nat -> c:c1:c2 gen_0':s11_13 :: Nat -> 0':s gen_c3:c4:c512_13 :: Nat -> c3:c4:c5 gen_nil:cons13_13 :: Nat -> nil:cons Generator Equations: gen_c:c1:c210_13(0) <=> c gen_c:c1:c210_13(+(x, 1)) <=> c2(gen_c:c1:c210_13(x)) gen_0':s11_13(0) <=> 0' gen_0':s11_13(+(x, 1)) <=> s(gen_0':s11_13(x)) gen_c3:c4:c512_13(0) <=> c3 gen_c3:c4:c512_13(+(x, 1)) <=> c5(gen_c3:c4:c512_13(x)) gen_nil:cons13_13(0) <=> nil gen_nil:cons13_13(+(x, 1)) <=> cons(0', gen_nil:cons13_13(x)) The following defined symbols remain to be analysed: HALF, LASTBIT, CONVITER, half, lastbit, conviter They will be analysed ascendingly in the following order: HALF < CONVITER LASTBIT < CONVITER half < CONVITER lastbit < CONVITER half < conviter lastbit < conviter ---------------------------------------- (21) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: HALF(gen_0':s11_13(*(2, n15_13))) -> gen_c:c1:c210_13(n15_13), rt in Omega(1 + n15_13) Induction Base: HALF(gen_0':s11_13(*(2, 0))) ->_R^Omega(1) c Induction Step: HALF(gen_0':s11_13(*(2, +(n15_13, 1)))) ->_R^Omega(1) c2(HALF(gen_0':s11_13(*(2, n15_13)))) ->_IH c2(gen_c:c1:c210_13(c16_13)) 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)) ZERO(0') -> c6 ZERO(s(z0)) -> c7 CONV(z0) -> c8(CONVITER(z0, cons(0', nil))) CONVITER(z0, z1) -> c9(IF(zero(z0), z0, z1), ZERO(z0)) IF(true, z0, z1) -> c10 IF(false, z0, z1) -> c11(CONVITER(half(z0), cons(lastbit(z0), z1)), HALF(z0)) IF(false, z0, z1) -> c12(CONVITER(half(z0), cons(lastbit(z0), z1)), LASTBIT(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) zero(0') -> true zero(s(z0)) -> false conv(z0) -> conviter(z0, cons(0', nil)) conviter(z0, z1) -> if(zero(z0), z0, z1) if(true, z0, z1) -> z1 if(false, z0, z1) -> conviter(half(z0), cons(lastbit(z0), z1)) 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 ZERO :: 0':s -> c6:c7 c6 :: c6:c7 c7 :: c6:c7 CONV :: 0':s -> c8 c8 :: c9 -> c8 CONVITER :: 0':s -> nil:cons -> c9 cons :: 0':s -> nil:cons -> nil:cons nil :: nil:cons c9 :: c10:c11:c12 -> c6:c7 -> c9 IF :: true:false -> 0':s -> nil:cons -> c10:c11:c12 zero :: 0':s -> true:false true :: true:false c10 :: c10:c11:c12 false :: true:false c11 :: c9 -> c:c1:c2 -> c10:c11:c12 half :: 0':s -> 0':s lastbit :: 0':s -> 0':s c12 :: c9 -> c3:c4:c5 -> c10:c11:c12 conv :: 0':s -> nil:cons conviter :: 0':s -> nil:cons -> nil:cons if :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_13 :: c:c1:c2 hole_0':s2_13 :: 0':s hole_c3:c4:c53_13 :: c3:c4:c5 hole_c6:c74_13 :: c6:c7 hole_c85_13 :: c8 hole_c96_13 :: c9 hole_nil:cons7_13 :: nil:cons hole_c10:c11:c128_13 :: c10:c11:c12 hole_true:false9_13 :: true:false gen_c:c1:c210_13 :: Nat -> c:c1:c2 gen_0':s11_13 :: Nat -> 0':s gen_c3:c4:c512_13 :: Nat -> c3:c4:c5 gen_nil:cons13_13 :: Nat -> nil:cons Generator Equations: gen_c:c1:c210_13(0) <=> c gen_c:c1:c210_13(+(x, 1)) <=> c2(gen_c:c1:c210_13(x)) gen_0':s11_13(0) <=> 0' gen_0':s11_13(+(x, 1)) <=> s(gen_0':s11_13(x)) gen_c3:c4:c512_13(0) <=> c3 gen_c3:c4:c512_13(+(x, 1)) <=> c5(gen_c3:c4:c512_13(x)) gen_nil:cons13_13(0) <=> nil gen_nil:cons13_13(+(x, 1)) <=> cons(0', gen_nil:cons13_13(x)) The following defined symbols remain to be analysed: HALF, LASTBIT, CONVITER, half, lastbit, conviter They will be analysed ascendingly in the following order: HALF < CONVITER LASTBIT < CONVITER half < CONVITER lastbit < CONVITER half < conviter lastbit < conviter ---------------------------------------- (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)) ZERO(0') -> c6 ZERO(s(z0)) -> c7 CONV(z0) -> c8(CONVITER(z0, cons(0', nil))) CONVITER(z0, z1) -> c9(IF(zero(z0), z0, z1), ZERO(z0)) IF(true, z0, z1) -> c10 IF(false, z0, z1) -> c11(CONVITER(half(z0), cons(lastbit(z0), z1)), HALF(z0)) IF(false, z0, z1) -> c12(CONVITER(half(z0), cons(lastbit(z0), z1)), LASTBIT(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) zero(0') -> true zero(s(z0)) -> false conv(z0) -> conviter(z0, cons(0', nil)) conviter(z0, z1) -> if(zero(z0), z0, z1) if(true, z0, z1) -> z1 if(false, z0, z1) -> conviter(half(z0), cons(lastbit(z0), z1)) 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 ZERO :: 0':s -> c6:c7 c6 :: c6:c7 c7 :: c6:c7 CONV :: 0':s -> c8 c8 :: c9 -> c8 CONVITER :: 0':s -> nil:cons -> c9 cons :: 0':s -> nil:cons -> nil:cons nil :: nil:cons c9 :: c10:c11:c12 -> c6:c7 -> c9 IF :: true:false -> 0':s -> nil:cons -> c10:c11:c12 zero :: 0':s -> true:false true :: true:false c10 :: c10:c11:c12 false :: true:false c11 :: c9 -> c:c1:c2 -> c10:c11:c12 half :: 0':s -> 0':s lastbit :: 0':s -> 0':s c12 :: c9 -> c3:c4:c5 -> c10:c11:c12 conv :: 0':s -> nil:cons conviter :: 0':s -> nil:cons -> nil:cons if :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_13 :: c:c1:c2 hole_0':s2_13 :: 0':s hole_c3:c4:c53_13 :: c3:c4:c5 hole_c6:c74_13 :: c6:c7 hole_c85_13 :: c8 hole_c96_13 :: c9 hole_nil:cons7_13 :: nil:cons hole_c10:c11:c128_13 :: c10:c11:c12 hole_true:false9_13 :: true:false gen_c:c1:c210_13 :: Nat -> c:c1:c2 gen_0':s11_13 :: Nat -> 0':s gen_c3:c4:c512_13 :: Nat -> c3:c4:c5 gen_nil:cons13_13 :: Nat -> nil:cons Lemmas: HALF(gen_0':s11_13(*(2, n15_13))) -> gen_c:c1:c210_13(n15_13), rt in Omega(1 + n15_13) Generator Equations: gen_c:c1:c210_13(0) <=> c gen_c:c1:c210_13(+(x, 1)) <=> c2(gen_c:c1:c210_13(x)) gen_0':s11_13(0) <=> 0' gen_0':s11_13(+(x, 1)) <=> s(gen_0':s11_13(x)) gen_c3:c4:c512_13(0) <=> c3 gen_c3:c4:c512_13(+(x, 1)) <=> c5(gen_c3:c4:c512_13(x)) gen_nil:cons13_13(0) <=> nil gen_nil:cons13_13(+(x, 1)) <=> cons(0', gen_nil:cons13_13(x)) The following defined symbols remain to be analysed: LASTBIT, CONVITER, half, lastbit, conviter They will be analysed ascendingly in the following order: LASTBIT < CONVITER half < CONVITER lastbit < CONVITER half < conviter lastbit < conviter ---------------------------------------- (27) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: LASTBIT(gen_0':s11_13(*(2, n457_13))) -> gen_c3:c4:c512_13(n457_13), rt in Omega(1 + n457_13) Induction Base: LASTBIT(gen_0':s11_13(*(2, 0))) ->_R^Omega(1) c3 Induction Step: LASTBIT(gen_0':s11_13(*(2, +(n457_13, 1)))) ->_R^Omega(1) c5(LASTBIT(gen_0':s11_13(*(2, n457_13)))) ->_IH c5(gen_c3:c4:c512_13(c458_13)) 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)) ZERO(0') -> c6 ZERO(s(z0)) -> c7 CONV(z0) -> c8(CONVITER(z0, cons(0', nil))) CONVITER(z0, z1) -> c9(IF(zero(z0), z0, z1), ZERO(z0)) IF(true, z0, z1) -> c10 IF(false, z0, z1) -> c11(CONVITER(half(z0), cons(lastbit(z0), z1)), HALF(z0)) IF(false, z0, z1) -> c12(CONVITER(half(z0), cons(lastbit(z0), z1)), LASTBIT(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) zero(0') -> true zero(s(z0)) -> false conv(z0) -> conviter(z0, cons(0', nil)) conviter(z0, z1) -> if(zero(z0), z0, z1) if(true, z0, z1) -> z1 if(false, z0, z1) -> conviter(half(z0), cons(lastbit(z0), z1)) 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 ZERO :: 0':s -> c6:c7 c6 :: c6:c7 c7 :: c6:c7 CONV :: 0':s -> c8 c8 :: c9 -> c8 CONVITER :: 0':s -> nil:cons -> c9 cons :: 0':s -> nil:cons -> nil:cons nil :: nil:cons c9 :: c10:c11:c12 -> c6:c7 -> c9 IF :: true:false -> 0':s -> nil:cons -> c10:c11:c12 zero :: 0':s -> true:false true :: true:false c10 :: c10:c11:c12 false :: true:false c11 :: c9 -> c:c1:c2 -> c10:c11:c12 half :: 0':s -> 0':s lastbit :: 0':s -> 0':s c12 :: c9 -> c3:c4:c5 -> c10:c11:c12 conv :: 0':s -> nil:cons conviter :: 0':s -> nil:cons -> nil:cons if :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_13 :: c:c1:c2 hole_0':s2_13 :: 0':s hole_c3:c4:c53_13 :: c3:c4:c5 hole_c6:c74_13 :: c6:c7 hole_c85_13 :: c8 hole_c96_13 :: c9 hole_nil:cons7_13 :: nil:cons hole_c10:c11:c128_13 :: c10:c11:c12 hole_true:false9_13 :: true:false gen_c:c1:c210_13 :: Nat -> c:c1:c2 gen_0':s11_13 :: Nat -> 0':s gen_c3:c4:c512_13 :: Nat -> c3:c4:c5 gen_nil:cons13_13 :: Nat -> nil:cons Lemmas: HALF(gen_0':s11_13(*(2, n15_13))) -> gen_c:c1:c210_13(n15_13), rt in Omega(1 + n15_13) LASTBIT(gen_0':s11_13(*(2, n457_13))) -> gen_c3:c4:c512_13(n457_13), rt in Omega(1 + n457_13) Generator Equations: gen_c:c1:c210_13(0) <=> c gen_c:c1:c210_13(+(x, 1)) <=> c2(gen_c:c1:c210_13(x)) gen_0':s11_13(0) <=> 0' gen_0':s11_13(+(x, 1)) <=> s(gen_0':s11_13(x)) gen_c3:c4:c512_13(0) <=> c3 gen_c3:c4:c512_13(+(x, 1)) <=> c5(gen_c3:c4:c512_13(x)) gen_nil:cons13_13(0) <=> nil gen_nil:cons13_13(+(x, 1)) <=> cons(0', gen_nil:cons13_13(x)) The following defined symbols remain to be analysed: half, CONVITER, lastbit, conviter They will be analysed ascendingly in the following order: half < CONVITER lastbit < CONVITER half < conviter lastbit < conviter ---------------------------------------- (29) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: half(gen_0':s11_13(*(2, n971_13))) -> gen_0':s11_13(n971_13), rt in Omega(0) Induction Base: half(gen_0':s11_13(*(2, 0))) ->_R^Omega(0) 0' Induction Step: half(gen_0':s11_13(*(2, +(n971_13, 1)))) ->_R^Omega(0) s(half(gen_0':s11_13(*(2, n971_13)))) ->_IH s(gen_0':s11_13(c972_13)) 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)) ZERO(0') -> c6 ZERO(s(z0)) -> c7 CONV(z0) -> c8(CONVITER(z0, cons(0', nil))) CONVITER(z0, z1) -> c9(IF(zero(z0), z0, z1), ZERO(z0)) IF(true, z0, z1) -> c10 IF(false, z0, z1) -> c11(CONVITER(half(z0), cons(lastbit(z0), z1)), HALF(z0)) IF(false, z0, z1) -> c12(CONVITER(half(z0), cons(lastbit(z0), z1)), LASTBIT(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) zero(0') -> true zero(s(z0)) -> false conv(z0) -> conviter(z0, cons(0', nil)) conviter(z0, z1) -> if(zero(z0), z0, z1) if(true, z0, z1) -> z1 if(false, z0, z1) -> conviter(half(z0), cons(lastbit(z0), z1)) 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 ZERO :: 0':s -> c6:c7 c6 :: c6:c7 c7 :: c6:c7 CONV :: 0':s -> c8 c8 :: c9 -> c8 CONVITER :: 0':s -> nil:cons -> c9 cons :: 0':s -> nil:cons -> nil:cons nil :: nil:cons c9 :: c10:c11:c12 -> c6:c7 -> c9 IF :: true:false -> 0':s -> nil:cons -> c10:c11:c12 zero :: 0':s -> true:false true :: true:false c10 :: c10:c11:c12 false :: true:false c11 :: c9 -> c:c1:c2 -> c10:c11:c12 half :: 0':s -> 0':s lastbit :: 0':s -> 0':s c12 :: c9 -> c3:c4:c5 -> c10:c11:c12 conv :: 0':s -> nil:cons conviter :: 0':s -> nil:cons -> nil:cons if :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_13 :: c:c1:c2 hole_0':s2_13 :: 0':s hole_c3:c4:c53_13 :: c3:c4:c5 hole_c6:c74_13 :: c6:c7 hole_c85_13 :: c8 hole_c96_13 :: c9 hole_nil:cons7_13 :: nil:cons hole_c10:c11:c128_13 :: c10:c11:c12 hole_true:false9_13 :: true:false gen_c:c1:c210_13 :: Nat -> c:c1:c2 gen_0':s11_13 :: Nat -> 0':s gen_c3:c4:c512_13 :: Nat -> c3:c4:c5 gen_nil:cons13_13 :: Nat -> nil:cons Lemmas: HALF(gen_0':s11_13(*(2, n15_13))) -> gen_c:c1:c210_13(n15_13), rt in Omega(1 + n15_13) LASTBIT(gen_0':s11_13(*(2, n457_13))) -> gen_c3:c4:c512_13(n457_13), rt in Omega(1 + n457_13) half(gen_0':s11_13(*(2, n971_13))) -> gen_0':s11_13(n971_13), rt in Omega(0) Generator Equations: gen_c:c1:c210_13(0) <=> c gen_c:c1:c210_13(+(x, 1)) <=> c2(gen_c:c1:c210_13(x)) gen_0':s11_13(0) <=> 0' gen_0':s11_13(+(x, 1)) <=> s(gen_0':s11_13(x)) gen_c3:c4:c512_13(0) <=> c3 gen_c3:c4:c512_13(+(x, 1)) <=> c5(gen_c3:c4:c512_13(x)) gen_nil:cons13_13(0) <=> nil gen_nil:cons13_13(+(x, 1)) <=> cons(0', gen_nil:cons13_13(x)) The following defined symbols remain to be analysed: lastbit, CONVITER, conviter They will be analysed ascendingly in the following order: lastbit < CONVITER lastbit < conviter ---------------------------------------- (31) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: lastbit(gen_0':s11_13(*(2, n1431_13))) -> gen_0':s11_13(0), rt in Omega(0) Induction Base: lastbit(gen_0':s11_13(*(2, 0))) ->_R^Omega(0) 0' Induction Step: lastbit(gen_0':s11_13(*(2, +(n1431_13, 1)))) ->_R^Omega(0) lastbit(gen_0':s11_13(*(2, n1431_13))) ->_IH gen_0':s11_13(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)) ZERO(0') -> c6 ZERO(s(z0)) -> c7 CONV(z0) -> c8(CONVITER(z0, cons(0', nil))) CONVITER(z0, z1) -> c9(IF(zero(z0), z0, z1), ZERO(z0)) IF(true, z0, z1) -> c10 IF(false, z0, z1) -> c11(CONVITER(half(z0), cons(lastbit(z0), z1)), HALF(z0)) IF(false, z0, z1) -> c12(CONVITER(half(z0), cons(lastbit(z0), z1)), LASTBIT(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) zero(0') -> true zero(s(z0)) -> false conv(z0) -> conviter(z0, cons(0', nil)) conviter(z0, z1) -> if(zero(z0), z0, z1) if(true, z0, z1) -> z1 if(false, z0, z1) -> conviter(half(z0), cons(lastbit(z0), z1)) 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 ZERO :: 0':s -> c6:c7 c6 :: c6:c7 c7 :: c6:c7 CONV :: 0':s -> c8 c8 :: c9 -> c8 CONVITER :: 0':s -> nil:cons -> c9 cons :: 0':s -> nil:cons -> nil:cons nil :: nil:cons c9 :: c10:c11:c12 -> c6:c7 -> c9 IF :: true:false -> 0':s -> nil:cons -> c10:c11:c12 zero :: 0':s -> true:false true :: true:false c10 :: c10:c11:c12 false :: true:false c11 :: c9 -> c:c1:c2 -> c10:c11:c12 half :: 0':s -> 0':s lastbit :: 0':s -> 0':s c12 :: c9 -> c3:c4:c5 -> c10:c11:c12 conv :: 0':s -> nil:cons conviter :: 0':s -> nil:cons -> nil:cons if :: true:false -> 0':s -> nil:cons -> nil:cons hole_c:c1:c21_13 :: c:c1:c2 hole_0':s2_13 :: 0':s hole_c3:c4:c53_13 :: c3:c4:c5 hole_c6:c74_13 :: c6:c7 hole_c85_13 :: c8 hole_c96_13 :: c9 hole_nil:cons7_13 :: nil:cons hole_c10:c11:c128_13 :: c10:c11:c12 hole_true:false9_13 :: true:false gen_c:c1:c210_13 :: Nat -> c:c1:c2 gen_0':s11_13 :: Nat -> 0':s gen_c3:c4:c512_13 :: Nat -> c3:c4:c5 gen_nil:cons13_13 :: Nat -> nil:cons Lemmas: HALF(gen_0':s11_13(*(2, n15_13))) -> gen_c:c1:c210_13(n15_13), rt in Omega(1 + n15_13) LASTBIT(gen_0':s11_13(*(2, n457_13))) -> gen_c3:c4:c512_13(n457_13), rt in Omega(1 + n457_13) half(gen_0':s11_13(*(2, n971_13))) -> gen_0':s11_13(n971_13), rt in Omega(0) lastbit(gen_0':s11_13(*(2, n1431_13))) -> gen_0':s11_13(0), rt in Omega(0) Generator Equations: gen_c:c1:c210_13(0) <=> c gen_c:c1:c210_13(+(x, 1)) <=> c2(gen_c:c1:c210_13(x)) gen_0':s11_13(0) <=> 0' gen_0':s11_13(+(x, 1)) <=> s(gen_0':s11_13(x)) gen_c3:c4:c512_13(0) <=> c3 gen_c3:c4:c512_13(+(x, 1)) <=> c5(gen_c3:c4:c512_13(x)) gen_nil:cons13_13(0) <=> nil gen_nil:cons13_13(+(x, 1)) <=> cons(0', gen_nil:cons13_13(x)) The following defined symbols remain to be analysed: CONVITER, conviter