YES

We show the termination of the TRS R:

  prime(|0|()) -> false()
  prime(s(|0|())) -> false()
  prime(s(s(x))) -> prime1(s(s(x)),s(x))
  prime1(x,|0|()) -> false()
  prime1(x,s(|0|())) -> true()
  prime1(x,s(s(y))) -> and(not(divp(s(s(y)),x)),prime1(x,s(y)))
  divp(x,y) -> =(rem(x,y),|0|())

-- SCC decomposition.

Consider the dependency pair problem (P, R), where P consists of

p1: prime#(s(s(x))) -> prime1#(s(s(x)),s(x))
p2: prime1#(x,s(s(y))) -> divp#(s(s(y)),x)
p3: prime1#(x,s(s(y))) -> prime1#(x,s(y))

and R consists of:

r1: prime(|0|()) -> false()
r2: prime(s(|0|())) -> false()
r3: prime(s(s(x))) -> prime1(s(s(x)),s(x))
r4: prime1(x,|0|()) -> false()
r5: prime1(x,s(|0|())) -> true()
r6: prime1(x,s(s(y))) -> and(not(divp(s(s(y)),x)),prime1(x,s(y)))
r7: divp(x,y) -> =(rem(x,y),|0|())

The estimated dependency graph contains the following SCCs:

  {p3}


-- Reduction pair.

Consider the dependency pair problem (P, R), where P consists of

p1: prime1#(x,s(s(y))) -> prime1#(x,s(y))

and R consists of:

r1: prime(|0|()) -> false()
r2: prime(s(|0|())) -> false()
r3: prime(s(s(x))) -> prime1(s(s(x)),s(x))
r4: prime1(x,|0|()) -> false()
r5: prime1(x,s(|0|())) -> true()
r6: prime1(x,s(s(y))) -> and(not(divp(s(s(y)),x)),prime1(x,s(y)))
r7: divp(x,y) -> =(rem(x,y),|0|())

The set of usable rules consists of

  (no rules)

Take the reduction pair:

  matrix interpretations:
  
    carrier: N^2
    order: lexicographic order
    interpretations:
      prime1#_A(x1,x2) = ((1,0),(1,1)) x2
      s_A(x1) = ((1,0),(1,0)) x1 + (1,1)

The next rules are strictly ordered:

  p1

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