YES

We show the termination of the TRS R:

  purge(nil()) -> nil()
  purge(.(x,y)) -> .(x,purge(remove(x,y)))
  remove(x,nil()) -> nil()
  remove(x,.(y,z)) -> if(=(x,y),remove(x,z),.(y,remove(x,z)))

-- SCC decomposition.

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

p1: purge#(.(x,y)) -> purge#(remove(x,y))
p2: purge#(.(x,y)) -> remove#(x,y)
p3: remove#(x,.(y,z)) -> remove#(x,z)

and R consists of:

r1: purge(nil()) -> nil()
r2: purge(.(x,y)) -> .(x,purge(remove(x,y)))
r3: remove(x,nil()) -> nil()
r4: remove(x,.(y,z)) -> if(=(x,y),remove(x,z),.(y,remove(x,z)))

The estimated dependency graph contains the following SCCs:

  {p1}
  {p3}


-- Reduction pair.

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

p1: purge#(.(x,y)) -> purge#(remove(x,y))

and R consists of:

r1: purge(nil()) -> nil()
r2: purge(.(x,y)) -> .(x,purge(remove(x,y)))
r3: remove(x,nil()) -> nil()
r4: remove(x,.(y,z)) -> if(=(x,y),remove(x,z),.(y,remove(x,z)))

The set of usable rules consists of

  r3, r4

Take the reduction pair:

  matrix interpretations:
  
    carrier: N^4
    order: lexicographic order
    interpretations:
      purge#_A(x1) = ((1,0,0,0),(0,0,0,0),(0,1,0,0),(0,1,0,0)) x1
      ._A(x1,x2) = ((1,0,0,0),(1,0,0,0),(0,0,0,0),(1,1,0,0)) x1 + ((1,0,0,0),(0,0,0,0),(0,1,0,0),(0,0,0,0)) x2 + (2,1,1,1)
      remove_A(x1,x2) = ((0,0,0,0),(1,0,0,0),(0,0,0,0),(0,1,0,0)) x1 + ((1,0,0,0),(1,1,0,0),(0,0,0,0),(0,0,0,0)) x2 + (1,2,2,1)
      nil_A() = (1,1,1,2)
      if_A(x1,x2,x3) = ((0,0,0,0),(1,0,0,0),(0,1,0,0),(0,0,0,0)) x1 + ((0,0,0,0),(1,0,0,0),(0,1,0,0),(0,0,0,0)) x2 + ((1,0,0,0),(0,0,0,0),(1,0,0,0),(0,1,0,0)) x3 + (0,0,0,1)
      =_A(x1,x2) = ((0,0,0,0),(1,0,0,0),(0,1,0,0),(1,1,1,0)) x1 + ((1,0,0,0),(1,1,0,0),(0,0,0,0),(1,1,1,0)) x2 + (1,1,1,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: remove#(x,.(y,z)) -> remove#(x,z)

and R consists of:

r1: purge(nil()) -> nil()
r2: purge(.(x,y)) -> .(x,purge(remove(x,y)))
r3: remove(x,nil()) -> nil()
r4: remove(x,.(y,z)) -> if(=(x,y),remove(x,z),.(y,remove(x,z)))

The set of usable rules consists of

  (no rules)

Take the reduction pair:

  matrix interpretations:
  
    carrier: N^4
    order: lexicographic order
    interpretations:
      remove#_A(x1,x2) = ((0,0,0,0),(1,0,0,0),(0,1,0,0),(0,1,1,0)) x1 + ((1,0,0,0),(0,1,0,0),(0,0,1,0),(1,1,1,1)) x2
      ._A(x1,x2) = ((1,0,0,0),(0,1,0,0),(1,1,1,0),(1,1,1,1)) x1 + ((1,0,0,0),(1,1,0,0),(1,1,1,0),(1,1,1,1)) x2 + (1,1,1,1)

The next rules are strictly ordered:

  p1

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