YES

We show the termination of the TRS R:

  active(g(X)) -> mark(h(X))
  active(c()) -> mark(d())
  active(h(d())) -> mark(g(c()))
  proper(g(X)) -> g(proper(X))
  proper(h(X)) -> h(proper(X))
  proper(c()) -> ok(c())
  proper(d()) -> ok(d())
  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#(g(X)) -> h#(X)
p2: active#(h(d())) -> g#(c())
p3: proper#(g(X)) -> g#(proper(X))
p4: proper#(g(X)) -> proper#(X)
p5: proper#(h(X)) -> h#(proper(X))
p6: proper#(h(X)) -> proper#(X)
p7: g#(ok(X)) -> g#(X)
p8: h#(ok(X)) -> h#(X)
p9: top#(mark(X)) -> top#(proper(X))
p10: top#(mark(X)) -> proper#(X)
p11: top#(ok(X)) -> top#(active(X))
p12: top#(ok(X)) -> active#(X)

and R consists of:

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

The estimated dependency graph contains the following SCCs:

  {p9, p11}
  {p4, p6}
  {p8}
  {p7}


-- 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(g(X)) -> mark(h(X))
r2: active(c()) -> mark(d())
r3: active(h(d())) -> mark(g(c()))
r4: proper(g(X)) -> g(proper(X))
r5: proper(h(X)) -> h(proper(X))
r6: proper(c()) -> ok(c())
r7: proper(d()) -> ok(d())
r8: g(ok(X)) -> ok(g(X))
r9: h(ok(X)) -> ok(h(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. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        top#_A(x1) = x1
        ok_A(x1) = x1 + (2,3)
        active_A(x1) = ((1,0),(1,1)) x1 + (1,1)
        mark_A(x1) = x1 + (5,7)
        proper_A(x1) = x1 + (4,3)
        g_A(x1) = ((0,1),(0,1)) x1 + (6,1)
        h_A(x1) = ((0,1),(0,1)) x1 + (1,1)
        c_A() = (5,1)
        d_A() = (0,11)
    
    2. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        top#_A(x1) = (0,0)
        ok_A(x1) = (1,2)
        active_A(x1) = x1 + (6,1)
        mark_A(x1) = x1 + (1,3)
        proper_A(x1) = (3,2)
        g_A(x1) = (2,1)
        h_A(x1) = (4,1)
        c_A() = (1,1)
        d_A() = (6,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#(h(X)) -> proper#(X)
p2: proper#(g(X)) -> proper#(X)

and R consists of:

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

and R consists of:

r1: active(g(X)) -> mark(h(X))
r2: active(c()) -> mark(d())
r3: active(h(d())) -> mark(g(c()))
r4: proper(g(X)) -> g(proper(X))
r5: proper(h(X)) -> h(proper(X))
r6: proper(c()) -> ok(c())
r7: proper(d()) -> ok(d())
r8: g(ok(X)) -> ok(g(X))
r9: h(ok(X)) -> ok(h(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. matrix interpretations:
    
      carrier: N^2
      order: standard order
      interpretations:
        h#_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:
        h#_A(x1) = ((0,1),(1,1)) x1
        ok_A(x1) = ((1,0),(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: g#(ok(X)) -> g#(X)

and R consists of:

r1: active(g(X)) -> mark(h(X))
r2: active(c()) -> mark(d())
r3: active(h(d())) -> mark(g(c()))
r4: proper(g(X)) -> g(proper(X))
r5: proper(h(X)) -> h(proper(X))
r6: proper(c()) -> ok(c())
r7: proper(d()) -> ok(d())
r8: g(ok(X)) -> ok(g(X))
r9: h(ok(X)) -> ok(h(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. 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) = ((0,1),(1,1)) x1
        ok_A(x1) = ((1,0),(1,1)) x1 + (1,1)
    

The next rules are strictly ordered:

  p1

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