YES We show the termination of the TRS R: half(|0|()) -> |0|() half(s(|0|())) -> |0|() half(s(s(x))) -> s(half(x)) le(|0|(),y) -> true() le(s(x),|0|()) -> false() le(s(x),s(y)) -> le(x,y) inc(|0|()) -> |0|() inc(s(x)) -> s(inc(x)) log(x) -> log2(x,|0|()) log2(x,y) -> if(le(x,s(|0|())),x,inc(y)) if(true(),x,s(y)) -> y if(false(),x,y) -> log2(half(x),y) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: half#(s(s(x))) -> half#(x) p2: le#(s(x),s(y)) -> le#(x,y) p3: inc#(s(x)) -> inc#(x) p4: log#(x) -> log2#(x,|0|()) p5: log2#(x,y) -> if#(le(x,s(|0|())),x,inc(y)) p6: log2#(x,y) -> le#(x,s(|0|())) p7: log2#(x,y) -> inc#(y) p8: if#(false(),x,y) -> log2#(half(x),y) p9: if#(false(),x,y) -> half#(x) and R consists of: r1: half(|0|()) -> |0|() r2: half(s(|0|())) -> |0|() r3: half(s(s(x))) -> s(half(x)) r4: le(|0|(),y) -> true() r5: le(s(x),|0|()) -> false() r6: le(s(x),s(y)) -> le(x,y) r7: inc(|0|()) -> |0|() r8: inc(s(x)) -> s(inc(x)) r9: log(x) -> log2(x,|0|()) r10: log2(x,y) -> if(le(x,s(|0|())),x,inc(y)) r11: if(true(),x,s(y)) -> y r12: if(false(),x,y) -> log2(half(x),y) The estimated dependency graph contains the following SCCs: {p5, p8} {p1} {p2} {p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: log2#(x,y) -> if#(le(x,s(|0|())),x,inc(y)) p2: if#(false(),x,y) -> log2#(half(x),y) and R consists of: r1: half(|0|()) -> |0|() r2: half(s(|0|())) -> |0|() r3: half(s(s(x))) -> s(half(x)) r4: le(|0|(),y) -> true() r5: le(s(x),|0|()) -> false() r6: le(s(x),s(y)) -> le(x,y) r7: inc(|0|()) -> |0|() r8: inc(s(x)) -> s(inc(x)) r9: log(x) -> log2(x,|0|()) r10: log2(x,y) -> if(le(x,s(|0|())),x,inc(y)) r11: if(true(),x,s(y)) -> y r12: if(false(),x,y) -> log2(half(x),y) 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: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: log2#_A(x1,x2) = max{1, x1 - 6, x2 - 10} if#_A(x1,x2,x3) = max{1, x1 - 1, x3 - 5} le_A(x1,x2) = max{0, x1 - 10, x2 - 5} s_A(x1) = max{1, x1} |0|_A = 4 inc_A(x1) = max{4, x1 - 5} false_A = 0 half_A(x1) = 7 true_A = 0 log2#!_A(x1,x2) = max{2, x1 - 8, x2 - 26} if#!_A(x1,x2,x3) = max{x1 + 2, x3 - 21} le!_A(x1,x2) = max{7, x1 - 25, x2 - 10} s!_A(x1) = max{3, x1 - 25} |0|!_A = 1 inc!_A(x1) = max{3, x1 - 25} false!_A = 4 half!_A(x1) = max{5, x1 - 2} true!_A = 0 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: log2#_A(x1,x2) = max{1, x1 - 1} if#_A(x1,x2,x3) = max{1, x1 - 24, x2 - 2} le_A(x1,x2) = x1 + 16 s_A(x1) = x1 + 14 |0|_A = 0 inc_A(x1) = x1 + 11 false_A = 22 half_A(x1) = max{0, x1 - 4} true_A = 16 log2#!_A(x1,x2) = x1 + 3 if#!_A(x1,x2,x3) = max{3, x1 - 13, x2 + 1} le!_A(x1,x2) = max{16, x1 - 15, x2 - 12} s!_A(x1) = max{0, x1 - 13} |0|!_A = 14 inc!_A(x1) = max{14, x1 - 8} false!_A = 11 half!_A(x1) = 12 true!_A = 15 partial status: pi(log2#) = [] pi(if#) = [] pi(le) = [] pi(s) = [] pi(|0|) = [] pi(inc) = [] pi(false) = [] pi(half) = [] pi(true) = [] The following rules are removed: p2 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: log2#(x,y) -> if#(le(x,s(|0|())),x,inc(y)) and R consists of: r1: half(|0|()) -> |0|() r2: half(s(|0|())) -> |0|() r3: half(s(s(x))) -> s(half(x)) r4: le(|0|(),y) -> true() r5: le(s(x),|0|()) -> false() r6: le(s(x),s(y)) -> le(x,y) r7: inc(|0|()) -> |0|() r8: inc(s(x)) -> s(inc(x)) r9: log(x) -> log2(x,|0|()) r10: log2(x,y) -> if(le(x,s(|0|())),x,inc(y)) r11: if(true(),x,s(y)) -> y r12: if(false(),x,y) -> log2(half(x),y) The estimated dependency graph contains the following SCCs: (no SCCs) -- 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: le(|0|(),y) -> true() r5: le(s(x),|0|()) -> false() r6: le(s(x),s(y)) -> le(x,y) r7: inc(|0|()) -> |0|() r8: inc(s(x)) -> s(inc(x)) r9: log(x) -> log2(x,|0|()) r10: log2(x,y) -> if(le(x,s(|0|())),x,inc(y)) r11: if(true(),x,s(y)) -> y r12: if(false(),x,y) -> log2(half(x),y) The set of usable rules consists of r1, r2 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: half#_A(x1) = 0 s_A(x1) = max{9, x1 - 14} half_A(x1) = max{13, x1 - 11} |0|_A = 9 half#!_A(x1) = max{6, x1 - 14} s!_A(x1) = max{6, x1 - 14} half!_A(x1) = max{6, x1 - 28} |0|!_A = 2 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: half#_A(x1) = 0 s_A(x1) = max{9, x1 - 14} half_A(x1) = max{13, x1 - 11} |0|_A = 8 half#!_A(x1) = max{6, x1 - 24} s!_A(x1) = max{6, x1 - 24} half!_A(x1) = max{6, x1 - 38} |0|!_A = 2 partial status: pi(half#) = [1] pi(s) = [1] pi(half) = [] pi(|0|) = [] 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: le#(s(x),s(y)) -> le#(x,y) and R consists of: r1: half(|0|()) -> |0|() r2: half(s(|0|())) -> |0|() r3: half(s(s(x))) -> s(half(x)) r4: le(|0|(),y) -> true() r5: le(s(x),|0|()) -> false() r6: le(s(x),s(y)) -> le(x,y) r7: inc(|0|()) -> |0|() r8: inc(s(x)) -> s(inc(x)) r9: log(x) -> log2(x,|0|()) r10: log2(x,y) -> if(le(x,s(|0|())),x,inc(y)) r11: if(true(),x,s(y)) -> y r12: if(false(),x,y) -> log2(half(x),y) The set of usable rules consists of r1, r2 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: le#_A(x1,x2) = 0 s_A(x1) = max{8, x1 - 13} half_A(x1) = max{12, x1 - 10} |0|_A = 8 le#!_A(x1,x2) = max{0, x2 - 22} s!_A(x1) = max{0, x1 - 22} half!_A(x1) = max{2, x1 - 27} |0|!_A = 1 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: le#_A(x1,x2) = 0 s_A(x1) = max{8, x1 - 13} half_A(x1) = max{12, x1 - 13} |0|_A = 8 le#!_A(x1,x2) = max{0, x2 - 46} s!_A(x1) = max{0, x1 - 46} half!_A(x1) = max{4, x1 - 32} |0|!_A = 3 partial status: pi(le#) = [2] pi(s) = [1] pi(half) = [1] pi(|0|) = [] 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: inc#(s(x)) -> inc#(x) and R consists of: r1: half(|0|()) -> |0|() r2: half(s(|0|())) -> |0|() r3: half(s(s(x))) -> s(half(x)) r4: le(|0|(),y) -> true() r5: le(s(x),|0|()) -> false() r6: le(s(x),s(y)) -> le(x,y) r7: inc(|0|()) -> |0|() r8: inc(s(x)) -> s(inc(x)) r9: log(x) -> log2(x,|0|()) r10: log2(x,y) -> if(le(x,s(|0|())),x,inc(y)) r11: if(true(),x,s(y)) -> y r12: if(false(),x,y) -> log2(half(x),y) The set of usable rules consists of r1, r2 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: inc#_A(x1) = 0 s_A(x1) = max{8, x1 - 13} half_A(x1) = max{12, x1 - 40} |0|_A = 8 inc#!_A(x1) = 5 s!_A(x1) = max{5, x1 - 13} half!_A(x1) = max{5, x1 - 26} |0|!_A = 3 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: inc#_A(x1) = 0 s_A(x1) = max{8, x1 - 13} half_A(x1) = max{12, x1 - 14} |0|_A = 8 inc#!_A(x1) = max{6, x1 - 13} s!_A(x1) = max{6, x1 - 13} half!_A(x1) = 6 |0|!_A = 2 partial status: pi(inc#) = [1] pi(s) = [1] pi(half) = [1] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains.