YES

We show the termination of the TRS R:

  f(x,|0|(),|0|()) -> s(x)
  f(|0|(),y,|0|()) -> s(y)
  f(|0|(),|0|(),z) -> s(z)
  f(s(|0|()),y,z) -> f(|0|(),s(y),s(z))
  f(s(x),s(y),|0|()) -> f(x,y,s(|0|()))
  f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z)
  f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|()))
  f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z))
  f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|()))
  f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z)
  f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(z)))

-- SCC decomposition.

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

p1: f#(s(|0|()),y,z) -> f#(|0|(),s(y),s(z))
p2: f#(s(x),s(y),|0|()) -> f#(x,y,s(|0|()))
p3: f#(s(x),|0|(),s(z)) -> f#(x,s(|0|()),z)
p4: f#(s(x),s(y),s(z)) -> f#(x,y,f(s(x),s(y),z))
p5: f#(s(x),s(y),s(z)) -> f#(s(x),s(y),z)
p6: f#(|0|(),s(s(y)),s(|0|())) -> f#(|0|(),y,s(|0|()))
p7: f#(|0|(),s(|0|()),s(s(z))) -> f#(|0|(),s(|0|()),z)
p8: f#(|0|(),s(s(y)),s(s(z))) -> f#(|0|(),y,f(|0|(),s(s(y)),s(z)))
p9: f#(|0|(),s(s(y)),s(s(z))) -> f#(|0|(),s(s(y)),s(z))

and R consists of:

r1: f(x,|0|(),|0|()) -> s(x)
r2: f(|0|(),y,|0|()) -> s(y)
r3: f(|0|(),|0|(),z) -> s(z)
r4: f(s(|0|()),y,z) -> f(|0|(),s(y),s(z))
r5: f(s(x),s(y),|0|()) -> f(x,y,s(|0|()))
r6: f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z)
r7: f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|()))
r8: f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z))
r9: f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|()))
r10: f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z)
r11: f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(z)))

The estimated dependency graph contains the following SCCs:

  {p2, p3, p4, p5}
  {p8, p9}
  {p6}
  {p7}


-- Reduction pair.

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

p1: f#(s(x),s(y),s(z)) -> f#(s(x),s(y),z)
p2: f#(s(x),s(y),s(z)) -> f#(x,y,f(s(x),s(y),z))
p3: f#(s(x),|0|(),s(z)) -> f#(x,s(|0|()),z)
p4: f#(s(x),s(y),|0|()) -> f#(x,y,s(|0|()))

and R consists of:

r1: f(x,|0|(),|0|()) -> s(x)
r2: f(|0|(),y,|0|()) -> s(y)
r3: f(|0|(),|0|(),z) -> s(z)
r4: f(s(|0|()),y,z) -> f(|0|(),s(y),s(z))
r5: f(s(x),s(y),|0|()) -> f(x,y,s(|0|()))
r6: f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z)
r7: f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|()))
r8: f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z))
r9: f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|()))
r10: f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z)
r11: f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(z)))

The set of usable rules consists of

  r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11

Take the reduction pair:

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

The next rules are strictly ordered:

  p1, p2, p3, p4

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: f#(|0|(),s(s(y)),s(s(z))) -> f#(|0|(),s(s(y)),s(z))
p2: f#(|0|(),s(s(y)),s(s(z))) -> f#(|0|(),y,f(|0|(),s(s(y)),s(z)))

and R consists of:

r1: f(x,|0|(),|0|()) -> s(x)
r2: f(|0|(),y,|0|()) -> s(y)
r3: f(|0|(),|0|(),z) -> s(z)
r4: f(s(|0|()),y,z) -> f(|0|(),s(y),s(z))
r5: f(s(x),s(y),|0|()) -> f(x,y,s(|0|()))
r6: f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z)
r7: f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|()))
r8: f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z))
r9: f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|()))
r10: f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z)
r11: f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(z)))

The set of usable rules consists of

  r1, r2, r3, r7, r9, r10, r11

Take the reduction pair:

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

The next rules are strictly ordered:

  p1, p2

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: f#(|0|(),s(s(y)),s(|0|())) -> f#(|0|(),y,s(|0|()))

and R consists of:

r1: f(x,|0|(),|0|()) -> s(x)
r2: f(|0|(),y,|0|()) -> s(y)
r3: f(|0|(),|0|(),z) -> s(z)
r4: f(s(|0|()),y,z) -> f(|0|(),s(y),s(z))
r5: f(s(x),s(y),|0|()) -> f(x,y,s(|0|()))
r6: f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z)
r7: f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|()))
r8: f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z))
r9: f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|()))
r10: f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z)
r11: f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(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:
      
        s > f# > |0|
      
      argument filter:
    
        pi(f#) = [1, 2, 3]
        pi(|0|) = []
        pi(s) = [1]
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        s > f# > |0|
      
      argument filter:
    
        pi(f#) = [1, 2, 3]
        pi(|0|) = []
        pi(s) = 1
    
    3. lexicographic path order with precedence:
    
      precedence:
      
        s > |0| > f#
      
      argument filter:
    
        pi(f#) = []
        pi(|0|) = []
        pi(s) = [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: f#(|0|(),s(|0|()),s(s(z))) -> f#(|0|(),s(|0|()),z)

and R consists of:

r1: f(x,|0|(),|0|()) -> s(x)
r2: f(|0|(),y,|0|()) -> s(y)
r3: f(|0|(),|0|(),z) -> s(z)
r4: f(s(|0|()),y,z) -> f(|0|(),s(y),s(z))
r5: f(s(x),s(y),|0|()) -> f(x,y,s(|0|()))
r6: f(s(x),|0|(),s(z)) -> f(x,s(|0|()),z)
r7: f(|0|(),s(|0|()),s(|0|())) -> s(s(|0|()))
r8: f(s(x),s(y),s(z)) -> f(x,y,f(s(x),s(y),z))
r9: f(|0|(),s(s(y)),s(|0|())) -> f(|0|(),y,s(|0|()))
r10: f(|0|(),s(|0|()),s(s(z))) -> f(|0|(),s(|0|()),z)
r11: f(|0|(),s(s(y)),s(s(z))) -> f(|0|(),y,f(|0|(),s(s(y)),s(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:
      
        |0| > s > f#
      
      argument filter:
    
        pi(f#) = 3
        pi(|0|) = []
        pi(s) = [1]
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        s > |0| > f#
      
      argument filter:
    
        pi(f#) = 3
        pi(|0|) = []
        pi(s) = [1]
    
    3. lexicographic path order with precedence:
    
      precedence:
      
        s > |0| > f#
      
      argument filter:
    
        pi(f#) = 3
        pi(|0|) = []
        pi(s) = [1]
    

The next rules are strictly ordered:

  p1

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