YES

We show the termination of the TRS R:

  active(f(f(a()))) -> mark(f(g(f(a()))))
  active(f(X)) -> f(active(X))
  f(mark(X)) -> mark(f(X))
  proper(f(X)) -> f(proper(X))
  proper(a()) -> ok(a())
  proper(g(X)) -> g(proper(X))
  f(ok(X)) -> ok(f(X))
  g(ok(X)) -> ok(g(X))
  top(mark(X)) -> top(proper(X))
  top(ok(X)) -> top(active(X))

-- SCC decomposition.

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

p1: active#(f(f(a()))) -> f#(g(f(a())))
p2: active#(f(f(a()))) -> g#(f(a()))
p3: active#(f(X)) -> f#(active(X))
p4: active#(f(X)) -> active#(X)
p5: f#(mark(X)) -> f#(X)
p6: proper#(f(X)) -> f#(proper(X))
p7: proper#(f(X)) -> proper#(X)
p8: proper#(g(X)) -> g#(proper(X))
p9: proper#(g(X)) -> proper#(X)
p10: f#(ok(X)) -> f#(X)
p11: g#(ok(X)) -> g#(X)
p12: top#(mark(X)) -> top#(proper(X))
p13: top#(mark(X)) -> proper#(X)
p14: top#(ok(X)) -> top#(active(X))
p15: top#(ok(X)) -> active#(X)

and R consists of:

r1: active(f(f(a()))) -> mark(f(g(f(a()))))
r2: active(f(X)) -> f(active(X))
r3: f(mark(X)) -> mark(f(X))
r4: proper(f(X)) -> f(proper(X))
r5: proper(a()) -> ok(a())
r6: proper(g(X)) -> g(proper(X))
r7: f(ok(X)) -> ok(f(X))
r8: g(ok(X)) -> ok(g(X))
r9: top(mark(X)) -> top(proper(X))
r10: top(ok(X)) -> top(active(X))

The estimated dependency graph contains the following SCCs:

  {p12, p14}
  {p4}
  {p7, p9}
  {p5, p10}
  {p11}


-- Reduction pair.

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

p1: top#(ok(X)) -> top#(active(X))
p2: top#(mark(X)) -> top#(proper(X))

and R consists of:

r1: active(f(f(a()))) -> mark(f(g(f(a()))))
r2: active(f(X)) -> f(active(X))
r3: f(mark(X)) -> mark(f(X))
r4: proper(f(X)) -> f(proper(X))
r5: proper(a()) -> ok(a())
r6: proper(g(X)) -> g(proper(X))
r7: f(ok(X)) -> ok(f(X))
r8: g(ok(X)) -> ok(g(X))
r9: top(mark(X)) -> top(proper(X))
r10: top(ok(X)) -> top(active(X))

The set of usable rules consists of

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

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. lexicographic path order with precedence:
    
      precedence:
      
        g > f > mark > a > proper > top# > ok > active
      
      argument filter:
    
        pi(top#) = 1
        pi(ok) = 1
        pi(active) = 1
        pi(mark) = 1
        pi(proper) = 1
        pi(f) = 1
        pi(g) = 1
        pi(a) = []
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        a > g > ok > active > mark > proper > f > top#
      
      argument filter:
    
        pi(top#) = 1
        pi(ok) = 1
        pi(active) = 1
        pi(mark) = [1]
        pi(proper) = 1
        pi(f) = 1
        pi(g) = []
        pi(a) = []
    
    3. lexicographic path order with precedence:
    
      precedence:
      
        mark > a > proper > g > f > ok > active > top#
      
      argument filter:
    
        pi(top#) = [1]
        pi(ok) = []
        pi(active) = []
        pi(mark) = []
        pi(proper) = []
        pi(f) = 1
        pi(g) = []
        pi(a) = []
    

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: active#(f(X)) -> active#(X)

and R consists of:

r1: active(f(f(a()))) -> mark(f(g(f(a()))))
r2: active(f(X)) -> f(active(X))
r3: f(mark(X)) -> mark(f(X))
r4: proper(f(X)) -> f(proper(X))
r5: proper(a()) -> ok(a())
r6: proper(g(X)) -> g(proper(X))
r7: f(ok(X)) -> ok(f(X))
r8: g(ok(X)) -> ok(g(X))
r9: top(mark(X)) -> top(proper(X))
r10: top(ok(X)) -> top(active(X))

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

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

The next rules are strictly ordered:

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

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: proper#(g(X)) -> proper#(X)
p2: proper#(f(X)) -> proper#(X)

and R consists of:

r1: active(f(f(a()))) -> mark(f(g(f(a()))))
r2: active(f(X)) -> f(active(X))
r3: f(mark(X)) -> mark(f(X))
r4: proper(f(X)) -> f(proper(X))
r5: proper(a()) -> ok(a())
r6: proper(g(X)) -> g(proper(X))
r7: f(ok(X)) -> ok(f(X))
r8: g(ok(X)) -> ok(g(X))
r9: top(mark(X)) -> top(proper(X))
r10: top(ok(X)) -> top(active(X))

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

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

The next rules are strictly ordered:

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

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#(mark(X)) -> f#(X)
p2: f#(ok(X)) -> f#(X)

and R consists of:

r1: active(f(f(a()))) -> mark(f(g(f(a()))))
r2: active(f(X)) -> f(active(X))
r3: f(mark(X)) -> mark(f(X))
r4: proper(f(X)) -> f(proper(X))
r5: proper(a()) -> ok(a())
r6: proper(g(X)) -> g(proper(X))
r7: f(ok(X)) -> ok(f(X))
r8: g(ok(X)) -> ok(g(X))
r9: top(mark(X)) -> top(proper(X))
r10: top(ok(X)) -> top(active(X))

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

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

The next rules are strictly ordered:

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

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#(ok(X)) -> g#(X)

and R consists of:

r1: active(f(f(a()))) -> mark(f(g(f(a()))))
r2: active(f(X)) -> f(active(X))
r3: f(mark(X)) -> mark(f(X))
r4: proper(f(X)) -> f(proper(X))
r5: proper(a()) -> ok(a())
r6: proper(g(X)) -> g(proper(X))
r7: f(ok(X)) -> ok(f(X))
r8: g(ok(X)) -> ok(g(X))
r9: top(mark(X)) -> top(proper(X))
r10: top(ok(X)) -> top(active(X))

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

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

The next rules are strictly ordered:

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

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