YES

We show the termination of the TRS R:

  or(true(),y) -> true()
  or(x,true()) -> true()
  or(false(),false()) -> false()
  mem(x,nil()) -> false()
  mem(x,set(y)) -> =(x,y)
  mem(x,union(y,z)) -> or(mem(x,y),mem(x,z))

-- SCC decomposition.

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

p1: mem#(x,union(y,z)) -> or#(mem(x,y),mem(x,z))
p2: mem#(x,union(y,z)) -> mem#(x,y)
p3: mem#(x,union(y,z)) -> mem#(x,z)

and R consists of:

r1: or(true(),y) -> true()
r2: or(x,true()) -> true()
r3: or(false(),false()) -> false()
r4: mem(x,nil()) -> false()
r5: mem(x,set(y)) -> =(x,y)
r6: mem(x,union(y,z)) -> or(mem(x,y),mem(x,z))

The estimated dependency graph contains the following SCCs:

  {p2, p3}


-- Reduction pair.

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

p1: mem#(x,union(y,z)) -> mem#(x,y)
p2: mem#(x,union(y,z)) -> mem#(x,z)

and R consists of:

r1: or(true(),y) -> true()
r2: or(x,true()) -> true()
r3: or(false(),false()) -> false()
r4: mem(x,nil()) -> false()
r5: mem(x,set(y)) -> =(x,y)
r6: mem(x,union(y,z)) -> or(mem(x,y),mem(x,z))

The set of usable rules consists of

  (no rules)

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        mem#_A(x1,x2) = x2
        union_A(x1,x2) = x1 + x2 + 1
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        union > mem#
      
      argument filter:
    
        pi(mem#) = 2
        pi(union) = 2
    

The next rules are strictly ordered:

  p1, p2

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