YES We show the termination of the TRS R: plus(x,|0|()) -> x plus(x,s(y)) -> s(plus(x,y)) times(|0|(),y) -> |0|() times(x,|0|()) -> |0|() times(s(x),y) -> plus(times(x,y),y) p(s(s(x))) -> s(p(s(x))) p(s(|0|())) -> |0|() fac(s(x)) -> times(fac(p(s(x))),s(x)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: plus#(x,s(y)) -> plus#(x,y) p2: times#(s(x),y) -> plus#(times(x,y),y) p3: times#(s(x),y) -> times#(x,y) p4: p#(s(s(x))) -> p#(s(x)) p5: fac#(s(x)) -> times#(fac(p(s(x))),s(x)) p6: fac#(s(x)) -> fac#(p(s(x))) p7: fac#(s(x)) -> p#(s(x)) and R consists of: r1: plus(x,|0|()) -> x r2: plus(x,s(y)) -> s(plus(x,y)) r3: times(|0|(),y) -> |0|() r4: times(x,|0|()) -> |0|() r5: times(s(x),y) -> plus(times(x,y),y) r6: p(s(s(x))) -> s(p(s(x))) r7: p(s(|0|())) -> |0|() r8: fac(s(x)) -> times(fac(p(s(x))),s(x)) The estimated dependency graph contains the following SCCs: {p6} {p3} {p1} {p4} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: fac#(s(x)) -> fac#(p(s(x))) and R consists of: r1: plus(x,|0|()) -> x r2: plus(x,s(y)) -> s(plus(x,y)) r3: times(|0|(),y) -> |0|() r4: times(x,|0|()) -> |0|() r5: times(s(x),y) -> plus(times(x,y),y) r6: p(s(s(x))) -> s(p(s(x))) r7: p(s(|0|())) -> |0|() r8: fac(s(x)) -> times(fac(p(s(x))),s(x)) The set of usable rules consists of r4, r6, r7 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: fac#_A(x1) = max{7, x1 + 2} s_A(x1) = max{21, x1 + 11} p_A(x1) = max{4, x1 - 11} times_A(x1,x2) = max{2, x1 - 22, x2 - 22} |0|_A = 1 base order 2: precedence: fac# = p > s > times > |0| partial status: pi(fac#) = [1] pi(s) = [] pi(p) = [] pi(times) = [] pi(|0|) = [] 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: times#(s(x),y) -> times#(x,y) and R consists of: r1: plus(x,|0|()) -> x r2: plus(x,s(y)) -> s(plus(x,y)) r3: times(|0|(),y) -> |0|() r4: times(x,|0|()) -> |0|() r5: times(s(x),y) -> plus(times(x,y),y) r6: p(s(s(x))) -> s(p(s(x))) r7: p(s(|0|())) -> |0|() r8: fac(s(x)) -> times(fac(p(s(x))),s(x)) The set of usable rules consists of r4 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: times#_A(x1,x2) = max{x1 + 7, x2 + 8} s_A(x1) = max{28, x1 + 6} times_A(x1,x2) = max{2, x1 - 2, x2 - 29} |0|_A = 1 base order 2: precedence: times# > s > times > |0| partial status: pi(times#) = [1] pi(s) = [1] pi(times) = [] pi(|0|) = [] 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: plus#(x,s(y)) -> plus#(x,y) and R consists of: r1: plus(x,|0|()) -> x r2: plus(x,s(y)) -> s(plus(x,y)) r3: times(|0|(),y) -> |0|() r4: times(x,|0|()) -> |0|() r5: times(s(x),y) -> plus(times(x,y),y) r6: p(s(s(x))) -> s(p(s(x))) r7: p(s(|0|())) -> |0|() r8: fac(s(x)) -> times(fac(p(s(x))),s(x)) The set of usable rules consists of r4 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{x1 + 9, x2 + 4} s_A(x1) = max{22, x1 + 5} times_A(x1,x2) = max{1, x1 - 3, x2 - 25} |0|_A = 0 base order 2: precedence: plus# = |0| > s > times partial status: pi(plus#) = [2] pi(s) = [] pi(times) = [] pi(|0|) = [] 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: p#(s(s(x))) -> p#(s(x)) and R consists of: r1: plus(x,|0|()) -> x r2: plus(x,s(y)) -> s(plus(x,y)) r3: times(|0|(),y) -> |0|() r4: times(x,|0|()) -> |0|() r5: times(s(x),y) -> plus(times(x,y),y) r6: p(s(s(x))) -> s(p(s(x))) r7: p(s(|0|())) -> |0|() r8: fac(s(x)) -> times(fac(p(s(x))),s(x)) The set of usable rules consists of r4 Take the reduction pair: generalized weighted path order (>=MG, >MG) base order 1: max/plus interpretation on natural numbers: p#_A(x1) = max{1, x1 - 5} s_A(x1) = max{7, x1 + 4} times_A(x1,x2) = max{5, x1 - 9, x2 - 14} |0|_A = 4 base order 2: precedence: s > p# > times > |0| partial status: pi(p#) = [] pi(s) = [1] pi(times) = [] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains.