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