YES

We show the termination of the TRS R:

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

and R consists of:

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

The estimated dependency graph contains the following SCCs:

  {p18, p20}
  {p4, p6}
  {p10, p12, p14}
  {p16}
  {p8, p17}
  {p7, p15}


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

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. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        top#_A(x1) = ((0,1),(0,0)) x1
        ok_A(x1) = x1
        active_A(x1) = x1
        mark_A(x1) = ((0,1),(0,1)) x1 + (1,2)
        proper_A(x1) = ((1,1),(0,1)) x1 + (0,1)
        f_A(x1) = x1 + (4,3)
        h_A(x1) = ((1,1),(0,1)) x1 + (1,2)
        g_A(x1) = (0,1)
    
    2. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        top#_A(x1) = (0,0)
        ok_A(x1) = (1,1)
        active_A(x1) = x1
        mark_A(x1) = (3,1)
        proper_A(x1) = ((0,1),(1,0)) x1 + (1,1)
        f_A(x1) = ((1,1),(1,1)) x1 + (4,0)
        h_A(x1) = x1 + (2,1)
        g_A(x1) = (2,4)
    
    3. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        top#_A(x1) = (0,0)
        ok_A(x1) = (0,6)
        active_A(x1) = ((0,1),(0,0)) x1 + (0,6)
        mark_A(x1) = (1,6)
        proper_A(x1) = (3,6)
        f_A(x1) = (2,6)
        h_A(x1) = (4,5)
        g_A(x1) = (1,6)
    

The next rules are strictly ordered:

  p2

We remove them from the problem.

-- SCC decomposition.

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

p1: top#(ok(X)) -> top#(active(X))

and R consists of:

r1: active(f(X)) -> mark(g(h(f(X))))
r2: active(f(X)) -> f(active(X))
r3: active(h(X)) -> h(active(X))
r4: f(mark(X)) -> mark(f(X))
r5: h(mark(X)) -> mark(h(X))
r6: proper(f(X)) -> f(proper(X))
r7: proper(g(X)) -> g(proper(X))
r8: proper(h(X)) -> h(proper(X))
r9: f(ok(X)) -> ok(f(X))
r10: g(ok(X)) -> ok(g(X))
r11: h(ok(X)) -> ok(h(X))
r12: top(mark(X)) -> top(proper(X))
r13: 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: top#(ok(X)) -> top#(active(X))

and R consists of:

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

The set of usable rules consists of

  r1, r2, r3, r4, r5, r9, r10, r11

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        top#_A(x1) = x1
        ok_A(x1) = ((1,1),(1,1)) x1 + (3,3)
        active_A(x1) = ((1,1),(1,1)) x1
        f_A(x1) = ((1,1),(1,1)) x1 + (0,2)
        mark_A(x1) = (1,1)
        h_A(x1) = ((0,1),(1,0)) x1
        g_A(x1) = x1
    
    2. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        top#_A(x1) = x1
        ok_A(x1) = ((0,0),(1,0)) x1 + (3,0)
        active_A(x1) = ((1,1),(0,1)) x1 + (2,1)
        f_A(x1) = ((0,0),(1,0)) x1 + (5,1)
        mark_A(x1) = (9,1)
        h_A(x1) = (10,10)
        g_A(x1) = (4,4)
    
    3. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        top#_A(x1) = ((0,1),(0,0)) x1
        ok_A(x1) = (2,3)
        active_A(x1) = ((0,1),(0,0)) x1 + (0,1)
        f_A(x1) = (5,3)
        mark_A(x1) = (4,3)
        h_A(x1) = (1,2)
        g_A(x1) = (3,3)
    

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

and R consists of:

r1: active(f(X)) -> mark(g(h(f(X))))
r2: active(f(X)) -> f(active(X))
r3: active(h(X)) -> h(active(X))
r4: f(mark(X)) -> mark(f(X))
r5: h(mark(X)) -> mark(h(X))
r6: proper(f(X)) -> f(proper(X))
r7: proper(g(X)) -> g(proper(X))
r8: proper(h(X)) -> h(proper(X))
r9: f(ok(X)) -> ok(f(X))
r10: g(ok(X)) -> ok(g(X))
r11: h(ok(X)) -> ok(h(X))
r12: top(mark(X)) -> top(proper(X))
r13: 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. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        active#_A(x1) = ((1,1),(1,1)) x1
        h_A(x1) = ((1,1),(1,1)) x1 + (1,1)
        f_A(x1) = ((1,1),(1,1)) x1 + (1,1)
    
    2. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        active#_A(x1) = ((1,1),(1,1)) x1
        h_A(x1) = ((1,1),(1,1)) x1 + (1,1)
        f_A(x1) = ((1,1),(1,1)) x1 + (1,1)
    
    3. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        active#_A(x1) = ((1,1),(1,1)) x1
        h_A(x1) = ((1,1),(0,1)) x1 + (1,1)
        f_A(x1) = ((1,1),(1,1)) x1 + (1,1)
    

The next rules are strictly ordered:

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

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

and R consists of:

r1: active(f(X)) -> mark(g(h(f(X))))
r2: active(f(X)) -> f(active(X))
r3: active(h(X)) -> h(active(X))
r4: f(mark(X)) -> mark(f(X))
r5: h(mark(X)) -> mark(h(X))
r6: proper(f(X)) -> f(proper(X))
r7: proper(g(X)) -> g(proper(X))
r8: proper(h(X)) -> h(proper(X))
r9: f(ok(X)) -> ok(f(X))
r10: g(ok(X)) -> ok(g(X))
r11: h(ok(X)) -> ok(h(X))
r12: top(mark(X)) -> top(proper(X))
r13: 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. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        proper#_A(x1) = ((1,1),(1,1)) x1
        h_A(x1) = ((1,1),(1,1)) x1 + (1,1)
        g_A(x1) = ((1,1),(1,1)) x1 + (1,1)
        f_A(x1) = ((1,1),(1,1)) x1 + (1,1)
    
    2. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        proper#_A(x1) = ((1,1),(1,1)) x1
        h_A(x1) = ((1,1),(1,1)) x1 + (1,1)
        g_A(x1) = ((1,1),(1,1)) x1 + (1,1)
        f_A(x1) = ((1,1),(1,1)) x1 + (1,1)
    
    3. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        proper#_A(x1) = ((1,1),(1,0)) x1
        h_A(x1) = x1 + (1,1)
        g_A(x1) = ((1,1),(1,1)) x1 + (1,1)
        f_A(x1) = ((1,1),(1,1)) x1 + (1,1)
    

The next rules are strictly ordered:

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

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(X)) -> mark(g(h(f(X))))
r2: active(f(X)) -> f(active(X))
r3: active(h(X)) -> h(active(X))
r4: f(mark(X)) -> mark(f(X))
r5: h(mark(X)) -> mark(h(X))
r6: proper(f(X)) -> f(proper(X))
r7: proper(g(X)) -> g(proper(X))
r8: proper(h(X)) -> h(proper(X))
r9: f(ok(X)) -> ok(f(X))
r10: g(ok(X)) -> ok(g(X))
r11: h(ok(X)) -> ok(h(X))
r12: top(mark(X)) -> top(proper(X))
r13: 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. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        g#_A(x1) = ((1,1),(1,1)) x1
        ok_A(x1) = ((1,1),(1,1)) x1 + (1,1)
    
    2. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        g#_A(x1) = x1
        ok_A(x1) = x1 + (1,1)
    
    3. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        g#_A(x1) = ((0,1),(1,1)) x1
        ok_A(x1) = ((0,1),(1,1)) x1 + (1,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: h#(mark(X)) -> h#(X)
p2: h#(ok(X)) -> h#(X)

and R consists of:

r1: active(f(X)) -> mark(g(h(f(X))))
r2: active(f(X)) -> f(active(X))
r3: active(h(X)) -> h(active(X))
r4: f(mark(X)) -> mark(f(X))
r5: h(mark(X)) -> mark(h(X))
r6: proper(f(X)) -> f(proper(X))
r7: proper(g(X)) -> g(proper(X))
r8: proper(h(X)) -> h(proper(X))
r9: f(ok(X)) -> ok(f(X))
r10: g(ok(X)) -> ok(g(X))
r11: h(ok(X)) -> ok(h(X))
r12: top(mark(X)) -> top(proper(X))
r13: 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. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        h#_A(x1) = ((1,1),(1,1)) x1
        mark_A(x1) = ((1,1),(1,1)) x1 + (1,1)
        ok_A(x1) = ((1,1),(1,1)) x1 + (1,1)
    
    2. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        h#_A(x1) = ((1,1),(1,1)) x1
        mark_A(x1) = ((1,1),(1,1)) x1 + (1,1)
        ok_A(x1) = ((1,1),(1,1)) x1 + (1,1)
    
    3. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        h#_A(x1) = ((1,1),(1,1)) x1
        mark_A(x1) = ((1,1),(1,1)) x1 + (1,1)
        ok_A(x1) = ((1,1),(1,1)) x1 + (1,1)
    

The next rules are strictly ordered:

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

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(X)) -> mark(g(h(f(X))))
r2: active(f(X)) -> f(active(X))
r3: active(h(X)) -> h(active(X))
r4: f(mark(X)) -> mark(f(X))
r5: h(mark(X)) -> mark(h(X))
r6: proper(f(X)) -> f(proper(X))
r7: proper(g(X)) -> g(proper(X))
r8: proper(h(X)) -> h(proper(X))
r9: f(ok(X)) -> ok(f(X))
r10: g(ok(X)) -> ok(g(X))
r11: h(ok(X)) -> ok(h(X))
r12: top(mark(X)) -> top(proper(X))
r13: 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. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        f#_A(x1) = ((1,1),(1,0)) x1
        mark_A(x1) = ((1,1),(1,1)) x1 + (1,1)
        ok_A(x1) = ((1,1),(1,1)) x1 + (1,1)
    
    2. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        f#_A(x1) = ((1,1),(1,0)) x1
        mark_A(x1) = ((1,1),(1,1)) x1 + (1,1)
        ok_A(x1) = ((1,1),(1,1)) x1 + (1,1)
    
    3. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        f#_A(x1) = ((1,1),(1,1)) x1
        mark_A(x1) = ((1,1),(0,1)) x1 + (1,1)
        ok_A(x1) = ((1,1),(1,1)) x1 + (1,1)
    

The next rules are strictly ordered:

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

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