YES We show the termination of the TRS R: 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))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: half#(s(s(x))) -> half#(x) p2: lastbit#(s(s(x))) -> lastbit#(x) p3: conv#(s(x)) -> conv#(half(s(x))) p4: conv#(s(x)) -> half#(s(x)) p5: conv#(s(x)) -> lastbit#(s(x)) and R consists of: r1: half(|0|()) -> |0|() r2: half(s(|0|())) -> |0|() r3: half(s(s(x))) -> s(half(x)) r4: lastbit(|0|()) -> |0|() r5: lastbit(s(|0|())) -> s(|0|()) r6: lastbit(s(s(x))) -> lastbit(x) r7: conv(|0|()) -> cons(nil(),|0|()) r8: conv(s(x)) -> cons(conv(half(s(x))),lastbit(s(x))) The estimated dependency graph contains the following SCCs: {p3} {p1} {p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: conv#(s(x)) -> conv#(half(s(x))) and R consists of: r1: half(|0|()) -> |0|() r2: half(s(|0|())) -> |0|() r3: half(s(s(x))) -> s(half(x)) r4: lastbit(|0|()) -> |0|() r5: lastbit(s(|0|())) -> s(|0|()) r6: lastbit(s(s(x))) -> lastbit(x) r7: conv(|0|()) -> cons(nil(),|0|()) r8: conv(s(x)) -> cons(conv(half(s(x))),lastbit(s(x))) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: conv#_A(x1) = max{1, x1 - 13} s_A(x1) = x1 + 27 half_A(x1) = max{10, x1 - 16} |0|_A = 8 lastbit_A(x1) = max{36, x1 - 55} conv_A(x1) = max{9, x1 - 91} cons_A(x1,x2) = max{7, x1 - 84, x2 - 37} nil_A = 0 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: conv#_A(x1) = max{0, x1 - 5} s_A(x1) = max{2, x1} half_A(x1) = max{4, x1 - 3} |0|_A = 1 lastbit_A(x1) = max{2, x1 - 3} conv_A(x1) = max{0, x1 - 5} cons_A(x1,x2) = max{0, x1 - 1, x2 - 3} nil_A = 0 conv#!_A(x1) = max{5, x1 - 5} s!_A(x1) = max{0, x1 - 8} half!_A(x1) = 4 |0|!_A = 1 lastbit!_A(x1) = max{2, x1 - 19} conv!_A(x1) = max{3, x1 - 16} cons!_A(x1,x2) = max{0, x1 - 9, x2 - 14} nil!_A = 0 partial status: pi(conv#) = [] pi(s) = [] pi(half) = [] pi(|0|) = [] pi(lastbit) = [] pi(conv) = [] pi(cons) = [] pi(nil) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: half#(s(s(x))) -> half#(x) and R consists of: r1: half(|0|()) -> |0|() r2: half(s(|0|())) -> |0|() r3: half(s(s(x))) -> s(half(x)) r4: lastbit(|0|()) -> |0|() r5: lastbit(s(|0|())) -> s(|0|()) r6: lastbit(s(s(x))) -> lastbit(x) r7: conv(|0|()) -> cons(nil(),|0|()) r8: conv(s(x)) -> cons(conv(half(s(x))),lastbit(s(x))) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: half#_A(x1) = max{4, x1 + 2} s_A(x1) = max{23, x1 + 3} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: half#_A(x1) = 0 s_A(x1) = max{14, x1 - 16} half#!_A(x1) = 0 s!_A(x1) = max{3, x1 - 49} partial status: pi(half#) = [1] pi(s) = [] The following rules are removed: p1 Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: lastbit#(s(s(x))) -> lastbit#(x) and R consists of: r1: half(|0|()) -> |0|() r2: half(s(|0|())) -> |0|() r3: half(s(s(x))) -> s(half(x)) r4: lastbit(|0|()) -> |0|() r5: lastbit(s(|0|())) -> s(|0|()) r6: lastbit(s(s(x))) -> lastbit(x) r7: conv(|0|()) -> cons(nil(),|0|()) r8: conv(s(x)) -> cons(conv(half(s(x))),lastbit(s(x))) The set of usable rules consists of r1, r2, r4 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: lastbit#_A(x1) = x1 + 3 s_A(x1) = x1 + 4 half_A(x1) = x1 + 7 |0|_A = 0 lastbit_A(x1) = max{5, x1} base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: lastbit#_A(x1) = 0 s_A(x1) = max{9, x1 - 14} half_A(x1) = max{13, x1 - 31} |0|_A = 0 lastbit_A(x1) = max{0, x1 - 24} lastbit#!_A(x1) = 0 s!_A(x1) = max{8, x1 + 7} half!_A(x1) = max{15, x1 - 8} |0|!_A = 32 lastbit!_A(x1) = 8 partial status: pi(lastbit#) = [1] pi(s) = [1] pi(half) = [1] pi(|0|) = [] pi(lastbit) = [1] The following rules are removed: p1 Then no dependency pair remains.