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

  r6, r7

Take the reduction pair:

  matrix interpretations:
  
    carrier: N^2
    order: standard order
    interpretations:
      fac#_A(x1) = ((0,1),(1,0)) x1
      s_A(x1) = ((0,1),(0,1)) x1 + (0,1)
      p_A(x1) = ((1,0),(1,0)) x1
      |0|_A() = (0,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: 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

  (no rules)

Take the reduction pair:

  matrix interpretations:
  
    carrier: N^2
    order: standard order
    interpretations:
      times#_A(x1,x2) = ((1,0),(1,0)) x1
      s_A(x1) = ((1,1),(1,1)) x1 + (1,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: 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

  (no rules)

Take the reduction pair:

  matrix interpretations:
  
    carrier: N^2
    order: standard order
    interpretations:
      plus#_A(x1,x2) = ((1,0),(1,0)) x2
      s_A(x1) = ((1,1),(1,1)) x1 + (1,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: 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

  (no rules)

Take the monotone reduction pair:

  matrix interpretations:
  
    carrier: N^2
    order: standard order
    interpretations:
      p#_A(x1) = ((1,1),(1,1)) x1
      s_A(x1) = ((1,1),(1,1)) x1 + (1,0)

The next rules are strictly ordered:

  p1
  r1, r2, r3, r4, r5, r6, r7, r8

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