YES

We show the termination of the TRS R:

  active(f(g(X),Y)) -> mark(f(X,f(g(X),Y)))
  active(f(X1,X2)) -> f(active(X1),X2)
  active(g(X)) -> g(active(X))
  f(mark(X1),X2) -> mark(f(X1,X2))
  g(mark(X)) -> mark(g(X))
  proper(f(X1,X2)) -> f(proper(X1),proper(X2))
  proper(g(X)) -> g(proper(X))
  f(ok(X1),ok(X2)) -> ok(f(X1,X2))
  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(g(X),Y)) -> f#(X,f(g(X),Y))
p2: active#(f(X1,X2)) -> f#(active(X1),X2)
p3: active#(f(X1,X2)) -> active#(X1)
p4: active#(g(X)) -> g#(active(X))
p5: active#(g(X)) -> active#(X)
p6: f#(mark(X1),X2) -> f#(X1,X2)
p7: g#(mark(X)) -> g#(X)
p8: proper#(f(X1,X2)) -> f#(proper(X1),proper(X2))
p9: proper#(f(X1,X2)) -> proper#(X1)
p10: proper#(f(X1,X2)) -> proper#(X2)
p11: proper#(g(X)) -> g#(proper(X))
p12: proper#(g(X)) -> proper#(X)
p13: f#(ok(X1),ok(X2)) -> f#(X1,X2)
p14: g#(ok(X)) -> g#(X)
p15: top#(mark(X)) -> top#(proper(X))
p16: top#(mark(X)) -> proper#(X)
p17: top#(ok(X)) -> top#(active(X))
p18: top#(ok(X)) -> active#(X)

and R consists of:

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

The estimated dependency graph contains the following SCCs:

  {p15, p17}
  {p3, p5}
  {p9, p10, p12}
  {p6, p13}
  {p7, p14}


-- 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(g(X),Y)) -> mark(f(X,f(g(X),Y)))
r2: active(f(X1,X2)) -> f(active(X1),X2)
r3: active(g(X)) -> g(active(X))
r4: f(mark(X1),X2) -> mark(f(X1,X2))
r5: g(mark(X)) -> mark(g(X))
r6: proper(f(X1,X2)) -> f(proper(X1),proper(X2))
r7: proper(g(X)) -> g(proper(X))
r8: f(ok(X1),ok(X2)) -> ok(f(X1,X2))
r9: g(ok(X)) -> ok(g(X))
r10: top(mark(X)) -> top(proper(X))
r11: top(ok(X)) -> top(active(X))

The set of usable rules consists of

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

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. lexicographic path order with precedence:
    
      precedence:
      
        g > proper > f > top# > mark > active > ok
      
      argument filter:
    
        pi(top#) = 1
        pi(ok) = 1
        pi(active) = 1
        pi(mark) = 1
        pi(proper) = 1
        pi(f) = 1
        pi(g) = 1
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        g > f > proper > top# > ok > active > mark
      
      argument filter:
    
        pi(top#) = 1
        pi(ok) = [1]
        pi(active) = [1]
        pi(mark) = [1]
        pi(proper) = 1
        pi(f) = 1
        pi(g) = 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: active#(g(X)) -> active#(X)
p2: active#(f(X1,X2)) -> active#(X1)

and R consists of:

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

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:
      
        active# > f > g
      
      argument filter:
    
        pi(active#) = 1
        pi(g) = 1
        pi(f) = 1
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        active# > f > g
      
      argument filter:
    
        pi(active#) = 1
        pi(g) = [1]
        pi(f) = [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: proper#(g(X)) -> proper#(X)
p2: proper#(f(X1,X2)) -> proper#(X2)
p3: proper#(f(X1,X2)) -> proper#(X1)

and R consists of:

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

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:
      
        g > proper# > f
      
      argument filter:
    
        pi(proper#) = 1
        pi(g) = 1
        pi(f) = [1, 2]
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        proper# > f > g
      
      argument filter:
    
        pi(proper#) = []
        pi(g) = []
        pi(f) = []
    

The next rules are strictly ordered:

  p2, p3

We remove them from the problem.

-- SCC decomposition.

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

p1: proper#(g(X)) -> proper#(X)

and R consists of:

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

The estimated dependency graph contains the following SCCs:

  {p1}


-- Reduction pair.

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

p1: proper#(g(X)) -> proper#(X)

and R consists of:

r1: active(f(g(X),Y)) -> mark(f(X,f(g(X),Y)))
r2: active(f(X1,X2)) -> f(active(X1),X2)
r3: active(g(X)) -> g(active(X))
r4: f(mark(X1),X2) -> mark(f(X1,X2))
r5: g(mark(X)) -> mark(g(X))
r6: proper(f(X1,X2)) -> f(proper(X1),proper(X2))
r7: proper(g(X)) -> g(proper(X))
r8: f(ok(X1),ok(X2)) -> ok(f(X1,X2))
r9: g(ok(X)) -> ok(g(X))
r10: top(mark(X)) -> top(proper(X))
r11: 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:
      
        g > proper#
      
      argument filter:
    
        pi(proper#) = [1]
        pi(g) = 1
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        g > proper#
      
      argument filter:
    
        pi(proper#) = [1]
        pi(g) = [1]
    

The next rules are strictly ordered:

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

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(X1),X2) -> f#(X1,X2)
p2: f#(ok(X1),ok(X2)) -> f#(X1,X2)

and R consists of:

r1: active(f(g(X),Y)) -> mark(f(X,f(g(X),Y)))
r2: active(f(X1,X2)) -> f(active(X1),X2)
r3: active(g(X)) -> g(active(X))
r4: f(mark(X1),X2) -> mark(f(X1,X2))
r5: g(mark(X)) -> mark(g(X))
r6: proper(f(X1,X2)) -> f(proper(X1),proper(X2))
r7: proper(g(X)) -> g(proper(X))
r8: f(ok(X1),ok(X2)) -> ok(f(X1,X2))
r9: g(ok(X)) -> ok(g(X))
r10: top(mark(X)) -> top(proper(X))
r11: 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, 2]
        pi(mark) = 1
        pi(ok) = 1
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        f# > ok > mark
      
      argument filter:
    
        pi(f#) = [1, 2]
        pi(mark) = [1]
        pi(ok) = [1]
    

The next rules are strictly ordered:

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

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

and R consists of:

r1: active(f(g(X),Y)) -> mark(f(X,f(g(X),Y)))
r2: active(f(X1,X2)) -> f(active(X1),X2)
r3: active(g(X)) -> g(active(X))
r4: f(mark(X1),X2) -> mark(f(X1,X2))
r5: g(mark(X)) -> mark(g(X))
r6: proper(f(X1,X2)) -> f(proper(X1),proper(X2))
r7: proper(g(X)) -> g(proper(X))
r8: f(ok(X1),ok(X2)) -> ok(f(X1,X2))
r9: g(ok(X)) -> ok(g(X))
r10: top(mark(X)) -> top(proper(X))
r11: 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:
      
        g# > ok > mark
      
      argument filter:
    
        pi(g#) = 1
        pi(mark) = 1
        pi(ok) = 1
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        g# > ok > mark
      
      argument filter:
    
        pi(g#) = 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, r11

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