YES

We show the termination of the TRS R:

  active(c()) -> mark(f(g(c())))
  active(f(g(X))) -> mark(g(X))
  proper(c()) -> ok(c())
  proper(f(X)) -> f(proper(X))
  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#(c()) -> f#(g(c()))
p2: active#(c()) -> g#(c())
p3: proper#(f(X)) -> f#(proper(X))
p4: proper#(f(X)) -> proper#(X)
p5: proper#(g(X)) -> g#(proper(X))
p6: proper#(g(X)) -> proper#(X)
p7: f#(ok(X)) -> f#(X)
p8: g#(ok(X)) -> g#(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(c()) -> mark(f(g(c())))
r2: active(f(g(X))) -> mark(g(X))
r3: proper(c()) -> ok(c())
r4: proper(f(X)) -> f(proper(X))
r5: proper(g(X)) -> g(proper(X))
r6: f(ok(X)) -> ok(f(X))
r7: g(ok(X)) -> ok(g(X))
r8: top(mark(X)) -> top(proper(X))
r9: top(ok(X)) -> top(active(X))

The estimated dependency graph contains the following SCCs:

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


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

The set of usable rules consists of

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

Take the reduction pair:

  matrix interpretations:
  
    carrier: N^3
    order: lexicographic order
    interpretations:
      top#_A(x1) = x1
      ok_A(x1) = ((1,0,0),(1,0,0),(0,0,0)) x1 + (0,0,2)
      active_A(x1) = ((1,0,0),(1,0,0),(0,0,0)) x1 + (0,0,1)
      mark_A(x1) = x1 + (2,8,2)
      proper_A(x1) = x1 + (1,7,1)
      f_A(x1) = ((0,0,0),(1,0,0),(0,0,0)) x1 + (4,5,3)
      g_A(x1) = (1,8,3)
      c_A() = (9,1,1)

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

The set of usable rules consists of

  r1, r2, r7

Take the reduction pair:

  matrix interpretations:
  
    carrier: N^3
    order: lexicographic order
    interpretations:
      top#_A(x1) = x1
      ok_A(x1) = ((0,0,0),(1,0,0),(0,1,0)) x1 + (2,0,3)
      active_A(x1) = (1,1,1)
      g_A(x1) = ((0,0,0),(0,0,0),(1,0,0)) x1 + (3,1,1)
      c_A() = (1,0,1)
      mark_A(x1) = (0,0,0)
      f_A(x1) = (1,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: proper#(g(X)) -> proper#(X)
p2: proper#(f(X)) -> proper#(X)

and R consists of:

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

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

  matrix interpretations:
  
    carrier: N^3
    order: lexicographic order
    interpretations:
      proper#_A(x1) = ((1,0,0),(1,1,0),(1,1,1)) x1
      g_A(x1) = ((1,0,0),(1,1,0),(1,1,1)) x1 + (1,1,1)
      f_A(x1) = ((1,0,0),(1,1,0),(1,1,1)) x1 + (1,1,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.

-- Reduction pair.

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

p1: f#(ok(X)) -> f#(X)

and R consists of:

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

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

  matrix interpretations:
  
    carrier: N^3
    order: lexicographic order
    interpretations:
      f#_A(x1) = ((1,0,0),(0,1,0),(1,1,1)) x1
      ok_A(x1) = ((1,0,0),(1,1,0),(1,1,1)) x1 + (1,1,1)

The next rules are strictly ordered:

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

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

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

  matrix interpretations:
  
    carrier: N^3
    order: lexicographic order
    interpretations:
      g#_A(x1) = ((1,0,0),(0,1,0),(1,1,1)) x1
      ok_A(x1) = ((1,0,0),(1,1,0),(1,1,1)) x1 + (1,1,1)

The next rules are strictly ordered:

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

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