YES

We show the termination of the TRS R:

  active(f(g(X),Y)) -> mark(f(X,f(g(X),Y)))
  mark(f(X1,X2)) -> active(f(mark(X1),X2))
  mark(g(X)) -> active(g(mark(X)))
  f(mark(X1),X2) -> f(X1,X2)
  f(X1,mark(X2)) -> f(X1,X2)
  f(active(X1),X2) -> f(X1,X2)
  f(X1,active(X2)) -> f(X1,X2)
  g(mark(X)) -> g(X)
  g(active(X)) -> g(X)

-- SCC decomposition.

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

p1: active#(f(g(X),Y)) -> mark#(f(X,f(g(X),Y)))
p2: active#(f(g(X),Y)) -> f#(X,f(g(X),Y))
p3: mark#(f(X1,X2)) -> active#(f(mark(X1),X2))
p4: mark#(f(X1,X2)) -> f#(mark(X1),X2)
p5: mark#(f(X1,X2)) -> mark#(X1)
p6: mark#(g(X)) -> active#(g(mark(X)))
p7: mark#(g(X)) -> g#(mark(X))
p8: mark#(g(X)) -> mark#(X)
p9: f#(mark(X1),X2) -> f#(X1,X2)
p10: f#(X1,mark(X2)) -> f#(X1,X2)
p11: f#(active(X1),X2) -> f#(X1,X2)
p12: f#(X1,active(X2)) -> f#(X1,X2)
p13: g#(mark(X)) -> g#(X)
p14: g#(active(X)) -> g#(X)

and R consists of:

r1: active(f(g(X),Y)) -> mark(f(X,f(g(X),Y)))
r2: mark(f(X1,X2)) -> active(f(mark(X1),X2))
r3: mark(g(X)) -> active(g(mark(X)))
r4: f(mark(X1),X2) -> f(X1,X2)
r5: f(X1,mark(X2)) -> f(X1,X2)
r6: f(active(X1),X2) -> f(X1,X2)
r7: f(X1,active(X2)) -> f(X1,X2)
r8: g(mark(X)) -> g(X)
r9: g(active(X)) -> g(X)

The estimated dependency graph contains the following SCCs:

  {p1, p3, p5, p6, p8}
  {p9, p10, p11, p12}
  {p13, p14}


-- Reduction pair.

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

p1: active#(f(g(X),Y)) -> mark#(f(X,f(g(X),Y)))
p2: mark#(g(X)) -> mark#(X)
p3: mark#(g(X)) -> active#(g(mark(X)))
p4: mark#(f(X1,X2)) -> mark#(X1)
p5: mark#(f(X1,X2)) -> active#(f(mark(X1),X2))

and R consists of:

r1: active(f(g(X),Y)) -> mark(f(X,f(g(X),Y)))
r2: mark(f(X1,X2)) -> active(f(mark(X1),X2))
r3: mark(g(X)) -> active(g(mark(X)))
r4: f(mark(X1),X2) -> f(X1,X2)
r5: f(X1,mark(X2)) -> f(X1,X2)
r6: f(active(X1),X2) -> f(X1,X2)
r7: f(X1,active(X2)) -> f(X1,X2)
r8: g(mark(X)) -> g(X)
r9: g(active(X)) -> g(X)

The set of usable rules consists of

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

Take the reduction pair:

  lexicographic path order with precedence:
  
    precedence:
    
      mark > mark# > active# > f > active > g
    
    argument filter:
  
      pi(active#) = 1
      pi(f) = [1]
      pi(g) = [1]
      pi(mark#) = 1
      pi(mark) = 1
      pi(active) = 1

The next rules are strictly ordered:

  p1, p2, p4

We remove them from the problem.

-- SCC decomposition.

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

p1: mark#(g(X)) -> active#(g(mark(X)))
p2: mark#(f(X1,X2)) -> active#(f(mark(X1),X2))

and R consists of:

r1: active(f(g(X),Y)) -> mark(f(X,f(g(X),Y)))
r2: mark(f(X1,X2)) -> active(f(mark(X1),X2))
r3: mark(g(X)) -> active(g(mark(X)))
r4: f(mark(X1),X2) -> f(X1,X2)
r5: f(X1,mark(X2)) -> f(X1,X2)
r6: f(active(X1),X2) -> f(X1,X2)
r7: f(X1,active(X2)) -> f(X1,X2)
r8: g(mark(X)) -> g(X)
r9: g(active(X)) -> g(X)

The estimated dependency graph contains the following SCCs:

  (no SCCs)

-- Reduction pair.

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

p1: f#(mark(X1),X2) -> f#(X1,X2)
p2: f#(X1,active(X2)) -> f#(X1,X2)
p3: f#(active(X1),X2) -> f#(X1,X2)
p4: f#(X1,mark(X2)) -> f#(X1,X2)

and R consists of:

r1: active(f(g(X),Y)) -> mark(f(X,f(g(X),Y)))
r2: mark(f(X1,X2)) -> active(f(mark(X1),X2))
r3: mark(g(X)) -> active(g(mark(X)))
r4: f(mark(X1),X2) -> f(X1,X2)
r5: f(X1,mark(X2)) -> f(X1,X2)
r6: f(active(X1),X2) -> f(X1,X2)
r7: f(X1,active(X2)) -> f(X1,X2)
r8: g(mark(X)) -> g(X)
r9: g(active(X)) -> g(X)

The set of usable rules consists of

  (no rules)

Take the reduction pair:

  lexicographic path order with precedence:
  
    precedence:
    
      f# > active > mark
    
    argument filter:
  
      pi(f#) = 2
      pi(mark) = [1]
      pi(active) = [1]

The next rules are strictly ordered:

  p2, p4

We remove them from the problem.

-- SCC decomposition.

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

p1: f#(mark(X1),X2) -> f#(X1,X2)
p2: f#(active(X1),X2) -> f#(X1,X2)

and R consists of:

r1: active(f(g(X),Y)) -> mark(f(X,f(g(X),Y)))
r2: mark(f(X1,X2)) -> active(f(mark(X1),X2))
r3: mark(g(X)) -> active(g(mark(X)))
r4: f(mark(X1),X2) -> f(X1,X2)
r5: f(X1,mark(X2)) -> f(X1,X2)
r6: f(active(X1),X2) -> f(X1,X2)
r7: f(X1,active(X2)) -> f(X1,X2)
r8: g(mark(X)) -> g(X)
r9: g(active(X)) -> g(X)

The estimated dependency graph contains the following SCCs:

  {p1, p2}


-- Reduction pair.

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

p1: f#(mark(X1),X2) -> f#(X1,X2)
p2: f#(active(X1),X2) -> f#(X1,X2)

and R consists of:

r1: active(f(g(X),Y)) -> mark(f(X,f(g(X),Y)))
r2: mark(f(X1,X2)) -> active(f(mark(X1),X2))
r3: mark(g(X)) -> active(g(mark(X)))
r4: f(mark(X1),X2) -> f(X1,X2)
r5: f(X1,mark(X2)) -> f(X1,X2)
r6: f(active(X1),X2) -> f(X1,X2)
r7: f(X1,active(X2)) -> f(X1,X2)
r8: g(mark(X)) -> g(X)
r9: g(active(X)) -> g(X)

The set of usable rules consists of

  (no rules)

Take the reduction pair:

  lexicographic path order with precedence:
  
    precedence:
    
      f# > active > mark
    
    argument filter:
  
      pi(f#) = 1
      pi(mark) = [1]
      pi(active) = [1]

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: g#(mark(X)) -> g#(X)
p2: g#(active(X)) -> g#(X)

and R consists of:

r1: active(f(g(X),Y)) -> mark(f(X,f(g(X),Y)))
r2: mark(f(X1,X2)) -> active(f(mark(X1),X2))
r3: mark(g(X)) -> active(g(mark(X)))
r4: f(mark(X1),X2) -> f(X1,X2)
r5: f(X1,mark(X2)) -> f(X1,X2)
r6: f(active(X1),X2) -> f(X1,X2)
r7: f(X1,active(X2)) -> f(X1,X2)
r8: g(mark(X)) -> g(X)
r9: g(active(X)) -> g(X)

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

  lexicographic path order with precedence:
  
    precedence:
    
      g# > active > mark
    
    argument filter:
  
      pi(g#) = 1
      pi(mark) = [1]
      pi(active) = [1]

The next rules are strictly ordered:

  p1, p2
  r1, r2, r3, r4, r5, r6, r7, r8, r9

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