YES

We show the termination of the TRS R:

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

-- SCC decomposition.

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

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

and R consists of:

r1: g(|0|(),f(x,x)) -> x
r2: g(x,s(y)) -> g(f(x,y),|0|())
r3: g(s(x),y) -> g(f(x,y),|0|())
r4: g(f(x,y),|0|()) -> f(g(x,|0|()),g(y,|0|()))

The estimated dependency graph contains the following SCCs:

  {p2, p3, p4}


-- Reduction pair.

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

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

and R consists of:

r1: g(|0|(),f(x,x)) -> x
r2: g(x,s(y)) -> g(f(x,y),|0|())
r3: g(s(x),y) -> g(f(x,y),|0|())
r4: g(f(x,y),|0|()) -> f(g(x,|0|()),g(y,|0|()))

The set of usable rules consists of

  (no rules)

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        g#_A(x1,x2) = ((0,1),(1,0)) x1 + ((0,1),(1,0)) x2
        f_A(x1,x2) = ((1,1),(1,1)) x1 + x2 + (1,1)
        |0|_A() = (1,1)
        s_A(x1) = ((1,1),(1,1)) x1 + (2,3)
    
    2. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        g#_A(x1,x2) = (0,0)
        f_A(x1,x2) = (1,1)
        |0|_A() = (1,1)
        s_A(x1) = (1,1)
    

The next rules are strictly ordered:

  p1, p2, p3

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