YES We show the termination of the TRS R: p(s(x)) -> x fact(|0|()) -> s(|0|()) fact(s(x)) -> *(s(x),fact(p(s(x)))) *(|0|(),y) -> |0|() *(s(x),y) -> +(*(x,y),y) +(x,|0|()) -> x +(x,s(y)) -> s(+(x,y)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: fact#(s(x)) -> *#(s(x),fact(p(s(x)))) p2: fact#(s(x)) -> fact#(p(s(x))) p3: fact#(s(x)) -> p#(s(x)) p4: *#(s(x),y) -> +#(*(x,y),y) p5: *#(s(x),y) -> *#(x,y) p6: +#(x,s(y)) -> +#(x,y) and R consists of: r1: p(s(x)) -> x r2: fact(|0|()) -> s(|0|()) r3: fact(s(x)) -> *(s(x),fact(p(s(x)))) r4: *(|0|(),y) -> |0|() r5: *(s(x),y) -> +(*(x,y),y) r6: +(x,|0|()) -> x r7: +(x,s(y)) -> s(+(x,y)) The estimated dependency graph contains the following SCCs: {p2} {p5} {p6} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: fact#(s(x)) -> fact#(p(s(x))) and R consists of: r1: p(s(x)) -> x r2: fact(|0|()) -> s(|0|()) r3: fact(s(x)) -> *(s(x),fact(p(s(x)))) r4: *(|0|(),y) -> |0|() r5: *(s(x),y) -> +(*(x,y),y) r6: +(x,|0|()) -> x r7: +(x,s(y)) -> s(+(x,y)) The set of usable rules consists of r1 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: fact#_A(x1) = max{0, x1 - 3} s_A(x1) = x1 + 4 p_A(x1) = max{2, x1 - 2} precedence: fact# = s = p partial status: pi(fact#) = [] pi(s) = [] pi(p) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: fact#_A(x1) = 10 s_A(x1) = max{7, x1 + 5} p_A(x1) = 11 precedence: fact# = s = p partial status: pi(fact#) = [] pi(s) = [1] pi(p) = [] 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: *#(s(x),y) -> *#(x,y) and R consists of: r1: p(s(x)) -> x r2: fact(|0|()) -> s(|0|()) r3: fact(s(x)) -> *(s(x),fact(p(s(x)))) r4: *(|0|(),y) -> |0|() r5: *(s(x),y) -> +(*(x,y),y) r6: +(x,|0|()) -> x r7: +(x,s(y)) -> s(+(x,y)) 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} 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 - 1, x2 + 1} s_A(x1) = 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: +#(x,s(y)) -> +#(x,y) and R consists of: r1: p(s(x)) -> x r2: fact(|0|()) -> s(|0|()) r3: fact(s(x)) -> *(s(x),fact(p(s(x)))) r4: *(|0|(),y) -> |0|() r5: *(s(x),y) -> +(*(x,y),y) r6: +(x,|0|()) -> x r7: +(x,s(y)) -> s(+(x,y)) 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.