YES We show the termination of the TRS R: lt(|0|(),s(x)) -> true() lt(x,|0|()) -> false() lt(s(x),s(y)) -> lt(x,y) logarithm(x) -> ifa(lt(|0|(),x),x) ifa(true(),x) -> help(x,|1|()) ifa(false(),x) -> logZeroError() help(x,y) -> ifb(lt(y,x),x,y) ifb(true(),x,y) -> help(half(x),s(y)) ifb(false(),x,y) -> y half(|0|()) -> |0|() half(s(|0|())) -> |0|() half(s(s(x))) -> s(half(x)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: lt#(s(x),s(y)) -> lt#(x,y) p2: logarithm#(x) -> ifa#(lt(|0|(),x),x) p3: logarithm#(x) -> lt#(|0|(),x) p4: ifa#(true(),x) -> help#(x,|1|()) p5: help#(x,y) -> ifb#(lt(y,x),x,y) p6: help#(x,y) -> lt#(y,x) p7: ifb#(true(),x,y) -> help#(half(x),s(y)) p8: ifb#(true(),x,y) -> half#(x) p9: half#(s(s(x))) -> half#(x) and R consists of: r1: lt(|0|(),s(x)) -> true() r2: lt(x,|0|()) -> false() r3: lt(s(x),s(y)) -> lt(x,y) r4: logarithm(x) -> ifa(lt(|0|(),x),x) r5: ifa(true(),x) -> help(x,|1|()) r6: ifa(false(),x) -> logZeroError() r7: help(x,y) -> ifb(lt(y,x),x,y) r8: ifb(true(),x,y) -> help(half(x),s(y)) r9: ifb(false(),x,y) -> y r10: half(|0|()) -> |0|() r11: half(s(|0|())) -> |0|() r12: half(s(s(x))) -> s(half(x)) The estimated dependency graph contains the following SCCs: {p5, p7} {p1} {p9} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: ifb#(true(),x,y) -> help#(half(x),s(y)) p2: help#(x,y) -> ifb#(lt(y,x),x,y) and R consists of: r1: lt(|0|(),s(x)) -> true() r2: lt(x,|0|()) -> false() r3: lt(s(x),s(y)) -> lt(x,y) r4: logarithm(x) -> ifa(lt(|0|(),x),x) r5: ifa(true(),x) -> help(x,|1|()) r6: ifa(false(),x) -> logZeroError() r7: help(x,y) -> ifb(lt(y,x),x,y) r8: ifb(true(),x,y) -> help(half(x),s(y)) r9: ifb(false(),x,y) -> y r10: half(|0|()) -> |0|() r11: half(s(|0|())) -> |0|() r12: half(s(s(x))) -> s(half(x)) The set of usable rules consists of r1, r2, r3, r6, r10, r11, r12 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: ifb#_A(x1,x2,x3) = max{2, x1 - 2, x2} true_A = 13 help#_A(x1,x2) = x1 + 4 half_A(x1) = max{7, x1 - 5} s_A(x1) = x1 + 14 lt_A(x1,x2) = max{4, x2 + 1} |0|_A = 6 false_A = 5 ifa_A(x1,x2) = max{1, x1 - 22, x2 - 2} logZeroError_A = 0 base order 2: precedence: ifb# > half > true > help# > lt > s > |0| = ifa > false > logZeroError partial status: pi(ifb#) = [2] pi(true) = [] pi(help#) = [1] pi(half) = [] pi(s) = [1] pi(lt) = [] pi(|0|) = [] pi(false) = [] pi(ifa) = [] pi(logZeroError) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: help#(x,y) -> ifb#(lt(y,x),x,y) and R consists of: r1: lt(|0|(),s(x)) -> true() r2: lt(x,|0|()) -> false() r3: lt(s(x),s(y)) -> lt(x,y) r4: logarithm(x) -> ifa(lt(|0|(),x),x) r5: ifa(true(),x) -> help(x,|1|()) r6: ifa(false(),x) -> logZeroError() r7: help(x,y) -> ifb(lt(y,x),x,y) r8: ifb(true(),x,y) -> help(half(x),s(y)) r9: ifb(false(),x,y) -> y r10: half(|0|()) -> |0|() r11: half(s(|0|())) -> |0|() r12: half(s(s(x))) -> s(half(x)) The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: lt#(s(x),s(y)) -> lt#(x,y) and R consists of: r1: lt(|0|(),s(x)) -> true() r2: lt(x,|0|()) -> false() r3: lt(s(x),s(y)) -> lt(x,y) r4: logarithm(x) -> ifa(lt(|0|(),x),x) r5: ifa(true(),x) -> help(x,|1|()) r6: ifa(false(),x) -> logZeroError() r7: help(x,y) -> ifb(lt(y,x),x,y) r8: ifb(true(),x,y) -> help(half(x),s(y)) r9: ifb(false(),x,y) -> y r10: half(|0|()) -> |0|() r11: half(s(|0|())) -> |0|() r12: half(s(s(x))) -> s(half(x)) The set of usable rules consists of r2, r6, r10, r11 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: lt#_A(x1,x2) = max{x1 + 7, x2 + 9} s_A(x1) = x1 + 8 lt_A(x1,x2) = max{4, x1 - 10, x2 - 9} |0|_A = 6 false_A = 1 ifa_A(x1,x2) = max{8, x1 - 11, x2 - 1} logZeroError_A = 0 half_A(x1) = max{7, x1 - 17} base order 2: precedence: lt# = ifa > s = |0| > lt > false = half > logZeroError partial status: pi(lt#) = [2] pi(s) = [] pi(lt) = [] pi(|0|) = [] pi(false) = [] pi(ifa) = [] pi(logZeroError) = [] pi(half) = [] 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: lt(|0|(),s(x)) -> true() r2: lt(x,|0|()) -> false() r3: lt(s(x),s(y)) -> lt(x,y) r4: logarithm(x) -> ifa(lt(|0|(),x),x) r5: ifa(true(),x) -> help(x,|1|()) r6: ifa(false(),x) -> logZeroError() r7: help(x,y) -> ifb(lt(y,x),x,y) r8: ifb(true(),x,y) -> help(half(x),s(y)) r9: ifb(false(),x,y) -> y r10: half(|0|()) -> |0|() r11: half(s(|0|())) -> |0|() r12: half(s(s(x))) -> s(half(x)) The set of usable rules consists of r2, r6, r10, r11 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: half#_A(x1) = max{1, x1 - 1} s_A(x1) = x1 + 13 lt_A(x1,x2) = max{14, x1 - 17, x2 - 14} |0|_A = 5 false_A = 1 ifa_A(x1,x2) = max{16, x1 - 15, x2 - 6} logZeroError_A = 0 half_A(x1) = max{6, x1 - 19} base order 2: precedence: s = ifa > half# > half > lt = |0| > false > logZeroError partial status: pi(half#) = [] pi(s) = [1] pi(lt) = [] pi(|0|) = [] pi(false) = [] pi(ifa) = [] pi(logZeroError) = [] pi(half) = [] The following rules are removed: p1 Then no dependency pair remains.