YES We show the termination of the TRS R: -(x,|0|()) -> x -(s(x),s(y)) -> -(x,y) *(x,|0|()) -> |0|() *(x,s(y)) -> +(*(x,y),x) if(true(),x,y) -> x if(false(),x,y) -> y odd(|0|()) -> false() odd(s(|0|())) -> true() odd(s(s(x))) -> odd(x) half(|0|()) -> |0|() half(s(|0|())) -> |0|() half(s(s(x))) -> s(half(x)) if(true(),x,y) -> true() if(false(),x,y) -> false() pow(x,y) -> f(x,y,s(|0|())) f(x,|0|(),z) -> z f(x,s(y),z) -> if(odd(s(y)),f(x,y,*(x,z)),f(*(x,x),half(s(y)),z)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: -#(s(x),s(y)) -> -#(x,y) p2: *#(x,s(y)) -> *#(x,y) p3: odd#(s(s(x))) -> odd#(x) p4: half#(s(s(x))) -> half#(x) p5: pow#(x,y) -> f#(x,y,s(|0|())) p6: f#(x,s(y),z) -> if#(odd(s(y)),f(x,y,*(x,z)),f(*(x,x),half(s(y)),z)) p7: f#(x,s(y),z) -> odd#(s(y)) p8: f#(x,s(y),z) -> f#(x,y,*(x,z)) p9: f#(x,s(y),z) -> *#(x,z) p10: f#(x,s(y),z) -> f#(*(x,x),half(s(y)),z) p11: f#(x,s(y),z) -> *#(x,x) p12: f#(x,s(y),z) -> half#(s(y)) and R consists of: r1: -(x,|0|()) -> x r2: -(s(x),s(y)) -> -(x,y) r3: *(x,|0|()) -> |0|() r4: *(x,s(y)) -> +(*(x,y),x) r5: if(true(),x,y) -> x r6: if(false(),x,y) -> y r7: odd(|0|()) -> false() r8: odd(s(|0|())) -> true() r9: odd(s(s(x))) -> odd(x) r10: half(|0|()) -> |0|() r11: half(s(|0|())) -> |0|() r12: half(s(s(x))) -> s(half(x)) r13: if(true(),x,y) -> true() r14: if(false(),x,y) -> false() r15: pow(x,y) -> f(x,y,s(|0|())) r16: f(x,|0|(),z) -> z r17: f(x,s(y),z) -> if(odd(s(y)),f(x,y,*(x,z)),f(*(x,x),half(s(y)),z)) The estimated dependency graph contains the following SCCs: {p1} {p8, p10} {p2} {p3} {p4} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: -#(s(x),s(y)) -> -#(x,y) and R consists of: r1: -(x,|0|()) -> x r2: -(s(x),s(y)) -> -(x,y) r3: *(x,|0|()) -> |0|() r4: *(x,s(y)) -> +(*(x,y),x) r5: if(true(),x,y) -> x r6: if(false(),x,y) -> y r7: odd(|0|()) -> false() r8: odd(s(|0|())) -> true() r9: odd(s(s(x))) -> odd(x) r10: half(|0|()) -> |0|() r11: half(s(|0|())) -> |0|() r12: half(s(s(x))) -> s(half(x)) r13: if(true(),x,y) -> true() r14: if(false(),x,y) -> false() r15: pow(x,y) -> f(x,y,s(|0|())) r16: f(x,|0|(),z) -> z r17: f(x,s(y),z) -> if(odd(s(y)),f(x,y,*(x,z)),f(*(x,x),half(s(y)),z)) The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: -#_A(x1,x2) = max{0, x1 - 2, x2 - 2} s_A(x1) = max{3, x1 + 1} precedence: -# = s partial status: pi(-#) = [] pi(s) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: f#(x,s(y),z) -> f#(*(x,x),half(s(y)),z) p2: f#(x,s(y),z) -> f#(x,y,*(x,z)) and R consists of: r1: -(x,|0|()) -> x r2: -(s(x),s(y)) -> -(x,y) r3: *(x,|0|()) -> |0|() r4: *(x,s(y)) -> +(*(x,y),x) r5: if(true(),x,y) -> x r6: if(false(),x,y) -> y r7: odd(|0|()) -> false() r8: odd(s(|0|())) -> true() r9: odd(s(s(x))) -> odd(x) r10: half(|0|()) -> |0|() r11: half(s(|0|())) -> |0|() r12: half(s(s(x))) -> s(half(x)) r13: if(true(),x,y) -> true() r14: if(false(),x,y) -> false() r15: pow(x,y) -> f(x,y,s(|0|())) r16: f(x,|0|(),z) -> z r17: f(x,s(y),z) -> if(odd(s(y)),f(x,y,*(x,z)),f(*(x,x),half(s(y)),z)) The set of usable rules consists of r3, r4, r10, r11, r12 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = max{x2 + 7, x3 + 4} s_A(x1) = x1 + 3 *_A(x1,x2) = max{3, x2 - 4} half_A(x1) = max{3, x1} |0|_A = 2 +_A(x1,x2) = max{2, x1 - 7} precedence: f# = s = * = half = |0| = + partial status: pi(f#) = [] pi(s) = [1] pi(*) = [] pi(half) = [1] pi(|0|) = [] pi(+) = [] The next rules are strictly ordered: p2 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: f#(x,s(y),z) -> f#(*(x,x),half(s(y)),z) and R consists of: r1: -(x,|0|()) -> x r2: -(s(x),s(y)) -> -(x,y) r3: *(x,|0|()) -> |0|() r4: *(x,s(y)) -> +(*(x,y),x) r5: if(true(),x,y) -> x r6: if(false(),x,y) -> y r7: odd(|0|()) -> false() r8: odd(s(|0|())) -> true() r9: odd(s(s(x))) -> odd(x) r10: half(|0|()) -> |0|() r11: half(s(|0|())) -> |0|() r12: half(s(s(x))) -> s(half(x)) r13: if(true(),x,y) -> true() r14: if(false(),x,y) -> false() r15: pow(x,y) -> f(x,y,s(|0|())) r16: f(x,|0|(),z) -> z r17: f(x,s(y),z) -> if(odd(s(y)),f(x,y,*(x,z)),f(*(x,x),half(s(y)),z)) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: f#(x,s(y),z) -> f#(*(x,x),half(s(y)),z) and R consists of: r1: -(x,|0|()) -> x r2: -(s(x),s(y)) -> -(x,y) r3: *(x,|0|()) -> |0|() r4: *(x,s(y)) -> +(*(x,y),x) r5: if(true(),x,y) -> x r6: if(false(),x,y) -> y r7: odd(|0|()) -> false() r8: odd(s(|0|())) -> true() r9: odd(s(s(x))) -> odd(x) r10: half(|0|()) -> |0|() r11: half(s(|0|())) -> |0|() r12: half(s(s(x))) -> s(half(x)) r13: if(true(),x,y) -> true() r14: if(false(),x,y) -> false() r15: pow(x,y) -> f(x,y,s(|0|())) r16: f(x,|0|(),z) -> z r17: f(x,s(y),z) -> if(odd(s(y)),f(x,y,*(x,z)),f(*(x,x),half(s(y)),z)) The set of usable rules consists of r3, r4, r10, r11, r12 Take the reduction pair: weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = max{9, x1 + 6, x2 + 7} s_A(x1) = x1 + 8 *_A(x1,x2) = max{2, x1, x2} half_A(x1) = max{5, x1 - 2} |0|_A = 4 +_A(x1,x2) = max{1, x1 - 3, x2 - 1} precedence: + > f# = s = * = half = |0| partial status: pi(f#) = [2] pi(s) = [1] pi(*) = [] pi(half) = [] pi(|0|) = [] pi(+) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: *#(x,s(y)) -> *#(x,y) and R consists of: r1: -(x,|0|()) -> x r2: -(s(x),s(y)) -> -(x,y) r3: *(x,|0|()) -> |0|() r4: *(x,s(y)) -> +(*(x,y),x) r5: if(true(),x,y) -> x r6: if(false(),x,y) -> y r7: odd(|0|()) -> false() r8: odd(s(|0|())) -> true() r9: odd(s(s(x))) -> odd(x) r10: half(|0|()) -> |0|() r11: half(s(|0|())) -> |0|() r12: half(s(s(x))) -> s(half(x)) r13: if(true(),x,y) -> true() r14: if(false(),x,y) -> false() r15: pow(x,y) -> f(x,y,s(|0|())) r16: f(x,|0|(),z) -> z r17: f(x,s(y),z) -> if(odd(s(y)),f(x,y,*(x,z)),f(*(x,x),half(s(y)),z)) The set of usable rules consists of (no rules) Take the monotone reduction pair: weighted path order base order: max/plus interpretations on natural numbers: *#_A(x1,x2) = max{1, x1, x2} s_A(x1) = x1 + 1 precedence: *# = s partial status: pi(*#) = [1, 2] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: odd#(s(s(x))) -> odd#(x) and R consists of: r1: -(x,|0|()) -> x r2: -(s(x),s(y)) -> -(x,y) r3: *(x,|0|()) -> |0|() r4: *(x,s(y)) -> +(*(x,y),x) r5: if(true(),x,y) -> x r6: if(false(),x,y) -> y r7: odd(|0|()) -> false() r8: odd(s(|0|())) -> true() r9: odd(s(s(x))) -> odd(x) r10: half(|0|()) -> |0|() r11: half(s(|0|())) -> |0|() r12: half(s(s(x))) -> s(half(x)) r13: if(true(),x,y) -> true() r14: if(false(),x,y) -> false() r15: pow(x,y) -> f(x,y,s(|0|())) r16: f(x,|0|(),z) -> z r17: f(x,s(y),z) -> if(odd(s(y)),f(x,y,*(x,z)),f(*(x,x),half(s(y)),z)) The set of usable rules consists of (no rules) Take the monotone reduction pair: weighted path order base order: max/plus interpretations on natural numbers: odd#_A(x1) = x1 + 5 s_A(x1) = x1 + 2 precedence: odd# = s partial status: pi(odd#) = [1] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. 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: -(x,|0|()) -> x r2: -(s(x),s(y)) -> -(x,y) r3: *(x,|0|()) -> |0|() r4: *(x,s(y)) -> +(*(x,y),x) r5: if(true(),x,y) -> x r6: if(false(),x,y) -> y r7: odd(|0|()) -> false() r8: odd(s(|0|())) -> true() r9: odd(s(s(x))) -> odd(x) r10: half(|0|()) -> |0|() r11: half(s(|0|())) -> |0|() r12: half(s(s(x))) -> s(half(x)) r13: if(true(),x,y) -> true() r14: if(false(),x,y) -> false() r15: pow(x,y) -> f(x,y,s(|0|())) r16: f(x,|0|(),z) -> z r17: f(x,s(y),z) -> if(odd(s(y)),f(x,y,*(x,z)),f(*(x,x),half(s(y)),z)) The set of usable rules consists of (no rules) Take the monotone reduction pair: weighted path order base order: max/plus interpretations on natural numbers: half#_A(x1) = x1 + 5 s_A(x1) = x1 + 2 precedence: half# = s partial status: pi(half#) = [1] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.