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:

  lexicographic combination of reduction pairs:
  
    1. lexicographic path order with precedence:
    
      precedence:
      
        = > if > nil > remove > purge# > .
      
      argument filter:
    
        pi(purge#) = 1
        pi(.) = 2
        pi(remove) = 2
        pi(nil) = []
        pi(if) = 2
        pi(=) = [1, 2]
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        = > if > nil > . > remove > purge#
      
      argument filter:
    
        pi(purge#) = 1
        pi(.) = [2]
        pi(remove) = [2]
        pi(nil) = []
        pi(if) = 2
        pi(=) = [1, 2]
    
    3. lexicographic path order with precedence:
    
      precedence:
      
        = > if > nil > remove > . > purge#
      
      argument filter:
    
        pi(purge#) = []
        pi(.) = [2]
        pi(remove) = 2
        pi(nil) = []
        pi(if) = 2
        pi(=) = 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:

  lexicographic combination of reduction pairs:
  
    1. lexicographic path order with precedence:
    
      precedence:
      
        . > remove#
      
      argument filter:
    
        pi(remove#) = [2]
        pi(.) = [1, 2]
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        . > remove#
      
      argument filter:
    
        pi(remove#) = [2]
        pi(.) = [1, 2]
    
    3. lexicographic path order with precedence:
    
      precedence:
      
        . > remove#
      
      argument filter:
    
        pi(remove#) = [2]
        pi(.) = [1, 2]
    

The next rules are strictly ordered:

  p1

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