YES

We show the termination of the TRS R:

  active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y)
  active(from(X)) -> mark(cons(X,from(s(X))))
  active(|2nd|(X)) -> |2nd|(active(X))
  active(cons(X1,X2)) -> cons(active(X1),X2)
  active(from(X)) -> from(active(X))
  active(s(X)) -> s(active(X))
  |2nd|(mark(X)) -> mark(|2nd|(X))
  cons(mark(X1),X2) -> mark(cons(X1,X2))
  from(mark(X)) -> mark(from(X))
  s(mark(X)) -> mark(s(X))
  proper(|2nd|(X)) -> |2nd|(proper(X))
  proper(cons(X1,X2)) -> cons(proper(X1),proper(X2))
  proper(from(X)) -> from(proper(X))
  proper(s(X)) -> s(proper(X))
  |2nd|(ok(X)) -> ok(|2nd|(X))
  cons(ok(X1),ok(X2)) -> ok(cons(X1,X2))
  from(ok(X)) -> ok(from(X))
  s(ok(X)) -> ok(s(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#(from(X)) -> cons#(X,from(s(X)))
p2: active#(from(X)) -> from#(s(X))
p3: active#(from(X)) -> s#(X)
p4: active#(|2nd|(X)) -> |2nd|#(active(X))
p5: active#(|2nd|(X)) -> active#(X)
p6: active#(cons(X1,X2)) -> cons#(active(X1),X2)
p7: active#(cons(X1,X2)) -> active#(X1)
p8: active#(from(X)) -> from#(active(X))
p9: active#(from(X)) -> active#(X)
p10: active#(s(X)) -> s#(active(X))
p11: active#(s(X)) -> active#(X)
p12: |2nd|#(mark(X)) -> |2nd|#(X)
p13: cons#(mark(X1),X2) -> cons#(X1,X2)
p14: from#(mark(X)) -> from#(X)
p15: s#(mark(X)) -> s#(X)
p16: proper#(|2nd|(X)) -> |2nd|#(proper(X))
p17: proper#(|2nd|(X)) -> proper#(X)
p18: proper#(cons(X1,X2)) -> cons#(proper(X1),proper(X2))
p19: proper#(cons(X1,X2)) -> proper#(X1)
p20: proper#(cons(X1,X2)) -> proper#(X2)
p21: proper#(from(X)) -> from#(proper(X))
p22: proper#(from(X)) -> proper#(X)
p23: proper#(s(X)) -> s#(proper(X))
p24: proper#(s(X)) -> proper#(X)
p25: |2nd|#(ok(X)) -> |2nd|#(X)
p26: cons#(ok(X1),ok(X2)) -> cons#(X1,X2)
p27: from#(ok(X)) -> from#(X)
p28: s#(ok(X)) -> s#(X)
p29: top#(mark(X)) -> top#(proper(X))
p30: top#(mark(X)) -> proper#(X)
p31: top#(ok(X)) -> top#(active(X))
p32: top#(ok(X)) -> active#(X)

and R consists of:

r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y)
r2: active(from(X)) -> mark(cons(X,from(s(X))))
r3: active(|2nd|(X)) -> |2nd|(active(X))
r4: active(cons(X1,X2)) -> cons(active(X1),X2)
r5: active(from(X)) -> from(active(X))
r6: active(s(X)) -> s(active(X))
r7: |2nd|(mark(X)) -> mark(|2nd|(X))
r8: cons(mark(X1),X2) -> mark(cons(X1,X2))
r9: from(mark(X)) -> mark(from(X))
r10: s(mark(X)) -> mark(s(X))
r11: proper(|2nd|(X)) -> |2nd|(proper(X))
r12: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2))
r13: proper(from(X)) -> from(proper(X))
r14: proper(s(X)) -> s(proper(X))
r15: |2nd|(ok(X)) -> ok(|2nd|(X))
r16: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2))
r17: from(ok(X)) -> ok(from(X))
r18: s(ok(X)) -> ok(s(X))
r19: top(mark(X)) -> top(proper(X))
r20: top(ok(X)) -> top(active(X))

The estimated dependency graph contains the following SCCs:

  {p29, p31}
  {p5, p7, p9, p11}
  {p17, p19, p20, p22, p24}
  {p13, p26}
  {p14, p27}
  {p15, p28}
  {p12, p25}


-- 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(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y)
r2: active(from(X)) -> mark(cons(X,from(s(X))))
r3: active(|2nd|(X)) -> |2nd|(active(X))
r4: active(cons(X1,X2)) -> cons(active(X1),X2)
r5: active(from(X)) -> from(active(X))
r6: active(s(X)) -> s(active(X))
r7: |2nd|(mark(X)) -> mark(|2nd|(X))
r8: cons(mark(X1),X2) -> mark(cons(X1,X2))
r9: from(mark(X)) -> mark(from(X))
r10: s(mark(X)) -> mark(s(X))
r11: proper(|2nd|(X)) -> |2nd|(proper(X))
r12: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2))
r13: proper(from(X)) -> from(proper(X))
r14: proper(s(X)) -> s(proper(X))
r15: |2nd|(ok(X)) -> ok(|2nd|(X))
r16: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2))
r17: from(ok(X)) -> ok(from(X))
r18: s(ok(X)) -> ok(s(X))
r19: top(mark(X)) -> top(proper(X))
r20: top(ok(X)) -> top(active(X))

The set of usable rules consists of

  r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18

Take the reduction pair:

  matrix interpretations:
  
    carrier: N^2
    order: lexicographic order
    interpretations:
      top#_A(x1) = x1
      ok_A(x1) = (1,4)
      active_A(x1) = (0,3)
      mark_A(x1) = (0,2)
      proper_A(x1) = (0,1)
      |2nd|_A(x1) = ((1,0),(1,1)) x1
      cons_A(x1,x2) = x1
      from_A(x1) = x1
      s_A(x1) = x1

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#(s(X)) -> active#(X)
p2: active#(from(X)) -> active#(X)
p3: active#(cons(X1,X2)) -> active#(X1)
p4: active#(|2nd|(X)) -> active#(X)

and R consists of:

r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y)
r2: active(from(X)) -> mark(cons(X,from(s(X))))
r3: active(|2nd|(X)) -> |2nd|(active(X))
r4: active(cons(X1,X2)) -> cons(active(X1),X2)
r5: active(from(X)) -> from(active(X))
r6: active(s(X)) -> s(active(X))
r7: |2nd|(mark(X)) -> mark(|2nd|(X))
r8: cons(mark(X1),X2) -> mark(cons(X1,X2))
r9: from(mark(X)) -> mark(from(X))
r10: s(mark(X)) -> mark(s(X))
r11: proper(|2nd|(X)) -> |2nd|(proper(X))
r12: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2))
r13: proper(from(X)) -> from(proper(X))
r14: proper(s(X)) -> s(proper(X))
r15: |2nd|(ok(X)) -> ok(|2nd|(X))
r16: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2))
r17: from(ok(X)) -> ok(from(X))
r18: s(ok(X)) -> ok(s(X))
r19: top(mark(X)) -> top(proper(X))
r20: 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
      s_A(x1) = ((1,0),(1,1)) x1 + (1,1)
      from_A(x1) = ((1,0),(1,1)) x1 + (1,1)
      cons_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(1,1)) x2 + (1,1)
      |2nd|_A(x1) = ((1,0),(1,1)) x1 + (1,1)

The next rules are strictly ordered:

  p1, p2, p3, p4
  r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20

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#(s(X)) -> proper#(X)
p2: proper#(from(X)) -> proper#(X)
p3: proper#(cons(X1,X2)) -> proper#(X2)
p4: proper#(cons(X1,X2)) -> proper#(X1)
p5: proper#(|2nd|(X)) -> proper#(X)

and R consists of:

r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y)
r2: active(from(X)) -> mark(cons(X,from(s(X))))
r3: active(|2nd|(X)) -> |2nd|(active(X))
r4: active(cons(X1,X2)) -> cons(active(X1),X2)
r5: active(from(X)) -> from(active(X))
r6: active(s(X)) -> s(active(X))
r7: |2nd|(mark(X)) -> mark(|2nd|(X))
r8: cons(mark(X1),X2) -> mark(cons(X1,X2))
r9: from(mark(X)) -> mark(from(X))
r10: s(mark(X)) -> mark(s(X))
r11: proper(|2nd|(X)) -> |2nd|(proper(X))
r12: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2))
r13: proper(from(X)) -> from(proper(X))
r14: proper(s(X)) -> s(proper(X))
r15: |2nd|(ok(X)) -> ok(|2nd|(X))
r16: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2))
r17: from(ok(X)) -> ok(from(X))
r18: s(ok(X)) -> ok(s(X))
r19: top(mark(X)) -> top(proper(X))
r20: 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:
      proper#_A(x1) = ((1,0),(1,0)) x1
      s_A(x1) = ((1,0),(1,1)) x1 + (1,1)
      from_A(x1) = ((1,0),(1,1)) x1 + (1,1)
      cons_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(1,1)) x2 + (1,1)
      |2nd|_A(x1) = ((1,0),(1,1)) x1 + (1,1)

The next rules are strictly ordered:

  p1, p2, p3, p4, p5

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

and R consists of:

r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y)
r2: active(from(X)) -> mark(cons(X,from(s(X))))
r3: active(|2nd|(X)) -> |2nd|(active(X))
r4: active(cons(X1,X2)) -> cons(active(X1),X2)
r5: active(from(X)) -> from(active(X))
r6: active(s(X)) -> s(active(X))
r7: |2nd|(mark(X)) -> mark(|2nd|(X))
r8: cons(mark(X1),X2) -> mark(cons(X1,X2))
r9: from(mark(X)) -> mark(from(X))
r10: s(mark(X)) -> mark(s(X))
r11: proper(|2nd|(X)) -> |2nd|(proper(X))
r12: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2))
r13: proper(from(X)) -> from(proper(X))
r14: proper(s(X)) -> s(proper(X))
r15: |2nd|(ok(X)) -> ok(|2nd|(X))
r16: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2))
r17: from(ok(X)) -> ok(from(X))
r18: s(ok(X)) -> ok(s(X))
r19: top(mark(X)) -> top(proper(X))
r20: 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:
      cons#_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: from#(mark(X)) -> from#(X)
p2: from#(ok(X)) -> from#(X)

and R consists of:

r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y)
r2: active(from(X)) -> mark(cons(X,from(s(X))))
r3: active(|2nd|(X)) -> |2nd|(active(X))
r4: active(cons(X1,X2)) -> cons(active(X1),X2)
r5: active(from(X)) -> from(active(X))
r6: active(s(X)) -> s(active(X))
r7: |2nd|(mark(X)) -> mark(|2nd|(X))
r8: cons(mark(X1),X2) -> mark(cons(X1,X2))
r9: from(mark(X)) -> mark(from(X))
r10: s(mark(X)) -> mark(s(X))
r11: proper(|2nd|(X)) -> |2nd|(proper(X))
r12: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2))
r13: proper(from(X)) -> from(proper(X))
r14: proper(s(X)) -> s(proper(X))
r15: |2nd|(ok(X)) -> ok(|2nd|(X))
r16: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2))
r17: from(ok(X)) -> ok(from(X))
r18: s(ok(X)) -> ok(s(X))
r19: top(mark(X)) -> top(proper(X))
r20: 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:
      from#_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, r12, r13, r14, r15, r16, r17, r18, r19, r20

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: s#(mark(X)) -> s#(X)
p2: s#(ok(X)) -> s#(X)

and R consists of:

r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y)
r2: active(from(X)) -> mark(cons(X,from(s(X))))
r3: active(|2nd|(X)) -> |2nd|(active(X))
r4: active(cons(X1,X2)) -> cons(active(X1),X2)
r5: active(from(X)) -> from(active(X))
r6: active(s(X)) -> s(active(X))
r7: |2nd|(mark(X)) -> mark(|2nd|(X))
r8: cons(mark(X1),X2) -> mark(cons(X1,X2))
r9: from(mark(X)) -> mark(from(X))
r10: s(mark(X)) -> mark(s(X))
r11: proper(|2nd|(X)) -> |2nd|(proper(X))
r12: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2))
r13: proper(from(X)) -> from(proper(X))
r14: proper(s(X)) -> s(proper(X))
r15: |2nd|(ok(X)) -> ok(|2nd|(X))
r16: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2))
r17: from(ok(X)) -> ok(from(X))
r18: s(ok(X)) -> ok(s(X))
r19: top(mark(X)) -> top(proper(X))
r20: 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:
      s#_A(x1) = ((1,0),(1,0)) 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

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: |2nd|#(mark(X)) -> |2nd|#(X)
p2: |2nd|#(ok(X)) -> |2nd|#(X)

and R consists of:

r1: active(|2nd|(cons(X,cons(Y,Z)))) -> mark(Y)
r2: active(from(X)) -> mark(cons(X,from(s(X))))
r3: active(|2nd|(X)) -> |2nd|(active(X))
r4: active(cons(X1,X2)) -> cons(active(X1),X2)
r5: active(from(X)) -> from(active(X))
r6: active(s(X)) -> s(active(X))
r7: |2nd|(mark(X)) -> mark(|2nd|(X))
r8: cons(mark(X1),X2) -> mark(cons(X1,X2))
r9: from(mark(X)) -> mark(from(X))
r10: s(mark(X)) -> mark(s(X))
r11: proper(|2nd|(X)) -> |2nd|(proper(X))
r12: proper(cons(X1,X2)) -> cons(proper(X1),proper(X2))
r13: proper(from(X)) -> from(proper(X))
r14: proper(s(X)) -> s(proper(X))
r15: |2nd|(ok(X)) -> ok(|2nd|(X))
r16: cons(ok(X1),ok(X2)) -> ok(cons(X1,X2))
r17: from(ok(X)) -> ok(from(X))
r18: s(ok(X)) -> ok(s(X))
r19: top(mark(X)) -> top(proper(X))
r20: 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:
      |2nd|#_A(x1) = 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

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