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: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: -#_A(x1,x2) = max{2, x1 - 1, x2 + 1} s_A(x1) = max{1, x1} precedence: -# = s partial status: pi(-#) = [2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: -#_A(x1,x2) = 0 s_A(x1) = max{2, x1} precedence: -# = s partial status: pi(-#) = [] 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: 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: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = max{x1 + 9, x2 + 13} s_A(x1) = max{8, x1 + 5} *_A(x1,x2) = max{8, x2 - 1} half_A(x1) = max{6, x1 - 1} |0|_A = 1 +_A(x1,x2) = max{1, x1 - 5} precedence: * = |0| > f# > s = half = + partial status: pi(f#) = [1, 2] pi(s) = [1] pi(*) = [] pi(half) = [] pi(|0|) = [] pi(+) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: f#_A(x1,x2,x3) = max{x1 + 8, x2 + 12} s_A(x1) = x1 + 3 *_A(x1,x2) = 7 half_A(x1) = 3 |0|_A = 8 +_A(x1,x2) = 8 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, p2 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 reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: *#_A(x1,x2) = max{2, x1, x2 + 1} s_A(x1) = max{1, x1} precedence: *# = s partial status: pi(*#) = [1, 2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: *#_A(x1,x2) = max{x1, x2 - 1} s_A(x1) = x1 precedence: *# = s partial status: pi(*#) = [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: 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: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: odd#_A(x1) = max{2, x1 + 1} s_A(x1) = max{1, x1} precedence: odd# = s partial status: pi(odd#) = [1] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: odd#_A(x1) = x1 + 1 s_A(x1) = x1 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: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: half#_A(x1) = max{2, x1 + 1} s_A(x1) = max{1, x1} precedence: half# = s partial status: pi(half#) = [1] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: half#_A(x1) = x1 + 1 s_A(x1) = x1 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.