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, r10, r11, r12 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: ifb#_A(x1,x2,x3) = max{30, x1 + 15, x2 + 1} true_A = 17 help#_A(x1,x2) = max{31, x1 + 10} half_A(x1) = max{19, x1 - 19} s_A(x1) = max{39, x1 + 27} lt_A(x1,x2) = max{9, x2 - 16} |0|_A = 18 false_A = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: ifb#_A(x1,x2,x3) = max{8, x1 - 19, x3 - 19} true_A = 13 help#_A(x1,x2) = max{8, x1 - 1, x2 - 1} half_A(x1) = 9 s_A(x1) = max{3, x1 - 18} lt_A(x1,x2) = 17 |0|_A = 0 false_A = 17 ifb#!_A(x1,x2,x3) = max{0, x1 - 18} true!_A = 1 help#!_A(x1,x2) = max{2, x1 - 15} half!_A(x1) = max{2, x1 - 23} s!_A(x1) = max{4, x1 - 4} lt!_A(x1,x2) = 0 |0|!_A = 3 false!_A = 1 partial status: pi(ifb#) = [] pi(true) = [] pi(help#) = [] pi(half) = [] pi(s) = [1] pi(lt) = [] pi(|0|) = [] pi(false) = [] The following rules are removed: p1, p2 Then no dependency pair remains. -- 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 r1 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: max/plus interpretation on natural numbers: lt#_A(x1,x2) = max{x1 + 12, x2 - 1} s_A(x1) = x1 + 11 lt_A(x1,x2) = max{13, x1 - 13, x2 - 12} |0|_A = 4 true_A = 2 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: lt#_A(x1,x2) = 0 s_A(x1) = max{22, x1 - 2} lt_A(x1,x2) = max{5, x1 - 19, x2 - 23} |0|_A = 18 true_A = 0 lt#!_A(x1,x2) = x2 + 8 s!_A(x1) = max{4, x1 - 19} lt!_A(x1,x2) = max{5, x1 - 24, x2 - 23} |0|!_A = 5 true!_A = 1 partial status: pi(lt#) = [] pi(s) = [1] pi(lt) = [] pi(|0|) = [] pi(true) = [] 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 (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{38, x1} s_A(x1) = x1 + 19 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: half#_A(x1) = 0 s_A(x1) = max{9, x1 - 4} half#!_A(x1) = 1 s!_A(x1) = max{4, x1 - 11} partial status: pi(half#) = [1] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.