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