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. lexicographic path order with precedence:
    
      precedence:
      
        p > fact# > s
      
      argument filter:
    
        pi(fact#) = [1]
        pi(s) = [1]
        pi(p) = 1
    
    2. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        fact#_A(x1) = x1
        s_A(x1) = x1 + 1
        p_A(x1) = 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: *#(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. lexicographic path order with precedence:
    
      precedence:
      
        s > *#
      
      argument filter:
    
        pi(*#) = 1
        pi(s) = [1]
    
    2. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        *#_A(x1,x2) = x1
        s_A(x1) = x1 + 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. lexicographic path order with precedence:
    
      precedence:
      
        s > +#
      
      argument filter:
    
        pi(+#) = 2
        pi(s) = [1]
    
    2. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        +#_A(x1,x2) = x2
        s_A(x1) = x1 + 1
    

The next rules are strictly ordered:

  p1

We remove them from the problem.  Then no dependency pair remains.