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 r3, r5, r6 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: fac#_A(x1,x2) = x1 s_A(x1) = 4 p_A(x1) = 4 times_A(x1,x2) = 2 |0|_A() = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: fac#_A(x1,x2) = max{0, x1 - 25} s_A(x1) = max{72, x1 + 42} p_A(x1) = max{27, x1 - 33} times_A(x1,x2) = max{0, x1 - 25, x2 - 16} |0|_A = 0 fac#!_A(x1,x2) = 13 s!_A(x1) = max{37, x1 - 28} p!_A(x1) = max{12, x1 - 71} times!_A(x1,x2) = max{39, x1 - 149, x2 - 75} |0|!_A = 37 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#(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, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: times#_A(x1,x2) = x1 s_A(x1) = 2 p_A(x1) = 2 |0|_A() = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: times#_A(x1,x2) = max{0, x1 - 2, x2 - 14} s_A(x1) = x1 + 13 p_A(x1) = max{1, x1 - 12} |0|_A = 2 times#!_A(x1,x2) = 2 s!_A(x1) = max{6, x1 + 1} p!_A(x1) = max{5, x1 - 19} |0|!_A = 4 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, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: plus#_A(x1,x2) = x2 + 7 s_A(x1) = 6 p_A(x1) = 8 |0|_A() = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: plus#_A(x1,x2) = max{0, x2 - 1} s_A(x1) = x1 + 27 p_A(x1) = max{17, x1 - 8} |0|_A = 18 plus#!_A(x1,x2) = max{2, x1 - 24} s!_A(x1) = max{17, x1 + 1} p!_A(x1) = max{79, x1 - 17} |0|!_A = 0 partial status: pi(plus#) = [2] 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, >G) base order 1: matrix interpretation with standard point-wise order: carrier: N^1 order: standard order interpretations: p#_A(x1) = x1 s_A(x1) = 4 times_A(x1,x2) = x1 + 3 |0|_A() = 1 base order 2: marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: p#_A(x1) = x1 s_A(x1) = max{25, x1 + 11} times_A(x1,x2) = max{51, x1 - 26, x2 - 72} |0|_A = 3 p#!_A(x1) = max{3, x1 - 18} s!_A(x1) = max{5, x1 - 5} times!_A(x1,x2) = max{1, x1 - 28, x2 - 67} |0|!_A = 0 partial status: pi(p#) = [1] pi(s) = [] pi(times) = [1] pi(|0|) = [] The following rules are removed: p1 Then no dependency pair remains.