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:

  matrix interpretations:
  
    carrier: N^2
    order: lexicographic order
    interpretations:
      top#_A(x1) = ((1,0),(1,1)) x1
      ok_A(x1) = x1 + (2,2)
      active_A(x1) = ((1,0),(1,1)) x1 + (1,1)
      mark_A(x1) = x1 + (2,2)
      proper_A(x1) = ((1,0),(1,0)) x1 + (1,2)
      f_A(x1,x2) = ((1,0),(1,0)) x1 + (1,1)
      g_A(x1) = x1 + (2,3)

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 monotone reduction pair:

  matrix interpretations:
  
    carrier: N^2
    order: lexicographic order
    interpretations:
      active#_A(x1) = ((1,0),(1,1)) x1
      g_A(x1) = ((1,0),(1,1)) x1 + (1,1)
      f_A(x1,x2) = ((1,0),(1,1)) x1 + x2 + (1,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: 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 monotone reduction pair:

  matrix interpretations:
  
    carrier: N^2
    order: lexicographic order
    interpretations:
      proper#_A(x1) = ((1,0),(1,1)) x1
      g_A(x1) = ((1,0),(1,1)) x1 + (1,1)
      f_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(1,1)) x2 + (1,1)

The next rules are strictly ordered:

  p1, p2, p3
  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 reduction pair:

  matrix interpretations:
  
    carrier: N^2
    order: lexicographic order
    interpretations:
      f#_A(x1,x2) = x1 + ((1,0),(1,1)) x2
      mark_A(x1) = ((1,0),(1,1)) x1 + (1,1)
      ok_A(x1) = ((1,0),(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: 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:

  matrix interpretations:
  
    carrier: N^2
    order: lexicographic order
    interpretations:
      g#_A(x1) = ((1,0),(1,1)) x1
      mark_A(x1) = ((1,0),(1,1)) x1 + (1,1)
      ok_A(x1) = ((1,0),(1,1)) x1 + (1,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.