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 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: log2#_A(x1,x2) = max{17, x1 + 8} if#_A(x1,x2,x3) = max{15, x1 - 3, x2 + 8} le_A(x1,x2) = max{20, x1 + 11, x2 + 4} s_A(x1) = max{16, x1 + 10} |0|_A = 6 inc_A(x1) = 1 false_A = 22 half_A(x1) = max{6, x1 - 9} true_A = 5 base order 2: precedence: false > log2# = if# > inc > s = half > le > |0| > true 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, r4, r5, r11 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: half#_A(x1) = max{7, x1 - 1} s_A(x1) = x1 + 10 half_A(x1) = max{8, x1 - 13} |0|_A = 2 le_A(x1,x2) = max{11, x1 - 11, x2 - 13} true_A = 0 false_A = 1 if_A(x1,x2,x3) = max{14, x1 - 12, x2 - 14, x3 - 9} base order 2: precedence: half > if > le > s > half# > |0| > true = false partial status: pi(half#) = [] pi(s) = [] pi(half) = [] pi(|0|) = [] pi(le) = [] pi(true) = [] pi(false) = [] pi(if) = [] 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, r4, r5, r11 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: le#_A(x1,x2) = max{x1 - 7, x2 + 10} s_A(x1) = max{20, x1 + 9} half_A(x1) = max{19, x1 - 30} |0|_A = 6 le_A(x1,x2) = max{3, x1 - 21, x2 - 36} true_A = 0 false_A = 1 if_A(x1,x2,x3) = max{20, x1 - 4, x2 - 8, x3 - 8} base order 2: precedence: le# = le = if > s = half > |0| > true = false partial status: pi(le#) = [2] pi(s) = [1] pi(half) = [] pi(|0|) = [] pi(le) = [] pi(true) = [] pi(false) = [] pi(if) = [] 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, r4, r5, r11 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: inc#_A(x1) = max{6, x1} s_A(x1) = x1 + 6 half_A(x1) = max{6, x1 - 13} |0|_A = 3 le_A(x1,x2) = max{7, x1 - 7, x2 - 10} true_A = 0 false_A = 1 if_A(x1,x2,x3) = max{7, x1 - 4, x2 - 6, x3 - 5} base order 2: precedence: s > inc# > le = if > half > |0| > true = false partial status: pi(inc#) = [1] pi(s) = [] pi(half) = [] pi(|0|) = [] pi(le) = [] pi(true) = [] pi(false) = [] pi(if) = [] The following rules are removed: p1 Then no dependency pair remains.