YES

We show the termination of the TRS R:

  app(app(map(),f),nil()) -> nil()
  app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs))
  app(app(le(),|0|()),y) -> true()
  app(app(le(),app(s(),x)),|0|()) -> false()
  app(app(le(),app(s(),x)),app(s(),y)) -> app(app(le(),x),y)
  app(app(maxlist(),x),app(app(cons(),y),ys)) -> app(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys))
  app(app(maxlist(),x),nil()) -> x
  app(height(),app(app(node(),x),xs)) -> app(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs)))

-- SCC decomposition.

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

p1: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(cons(),app(f,x)),app(app(map(),f),xs))
p2: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(cons(),app(f,x))
p3: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(f,x)
p4: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(map(),f),xs)
p5: app#(app(le(),app(s(),x)),app(s(),y)) -> app#(app(le(),x),y)
p6: app#(app(le(),app(s(),x)),app(s(),y)) -> app#(le(),x)
p7: app#(app(maxlist(),x),app(app(cons(),y),ys)) -> app#(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys))
p8: app#(app(maxlist(),x),app(app(cons(),y),ys)) -> app#(if(),app(app(le(),x),y))
p9: app#(app(maxlist(),x),app(app(cons(),y),ys)) -> app#(app(le(),x),y)
p10: app#(app(maxlist(),x),app(app(cons(),y),ys)) -> app#(le(),x)
p11: app#(app(maxlist(),x),app(app(cons(),y),ys)) -> app#(app(maxlist(),y),ys)
p12: app#(app(maxlist(),x),app(app(cons(),y),ys)) -> app#(maxlist(),y)
p13: app#(height(),app(app(node(),x),xs)) -> app#(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs)))
p14: app#(height(),app(app(node(),x),xs)) -> app#(app(maxlist(),|0|()),app(app(map(),height()),xs))
p15: app#(height(),app(app(node(),x),xs)) -> app#(maxlist(),|0|())
p16: app#(height(),app(app(node(),x),xs)) -> app#(app(map(),height()),xs)
p17: app#(height(),app(app(node(),x),xs)) -> app#(map(),height())

and R consists of:

r1: app(app(map(),f),nil()) -> nil()
r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs))
r3: app(app(le(),|0|()),y) -> true()
r4: app(app(le(),app(s(),x)),|0|()) -> false()
r5: app(app(le(),app(s(),x)),app(s(),y)) -> app(app(le(),x),y)
r6: app(app(maxlist(),x),app(app(cons(),y),ys)) -> app(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys))
r7: app(app(maxlist(),x),nil()) -> x
r8: app(height(),app(app(node(),x),xs)) -> app(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs)))

The estimated dependency graph contains the following SCCs:

  {p3, p4, p16}
  {p11}
  {p5}


-- Reduction pair.

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

p1: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(f,x)
p2: app#(height(),app(app(node(),x),xs)) -> app#(app(map(),height()),xs)
p3: app#(app(map(),f),app(app(cons(),x),xs)) -> app#(app(map(),f),xs)

and R consists of:

r1: app(app(map(),f),nil()) -> nil()
r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs))
r3: app(app(le(),|0|()),y) -> true()
r4: app(app(le(),app(s(),x)),|0|()) -> false()
r5: app(app(le(),app(s(),x)),app(s(),y)) -> app(app(le(),x),y)
r6: app(app(maxlist(),x),app(app(cons(),y),ys)) -> app(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys))
r7: app(app(maxlist(),x),nil()) -> x
r8: app(height(),app(app(node(),x),xs)) -> app(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs)))

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

  lexicographic path order with precedence:
  
    precedence:
    
      app > map > app# > node > height > cons
    
    argument filter:
  
      pi(app#) = [1, 2]
      pi(app) = [1, 2]
      pi(map) = []
      pi(cons) = []
      pi(height) = []
      pi(node) = []

The next rules are strictly ordered:

  p1, p2, p3
  r1, r2, r3, r4, r5, r6, r7, r8

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: app#(app(maxlist(),x),app(app(cons(),y),ys)) -> app#(app(maxlist(),y),ys)

and R consists of:

r1: app(app(map(),f),nil()) -> nil()
r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs))
r3: app(app(le(),|0|()),y) -> true()
r4: app(app(le(),app(s(),x)),|0|()) -> false()
r5: app(app(le(),app(s(),x)),app(s(),y)) -> app(app(le(),x),y)
r6: app(app(maxlist(),x),app(app(cons(),y),ys)) -> app(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys))
r7: app(app(maxlist(),x),nil()) -> x
r8: app(height(),app(app(node(),x),xs)) -> app(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs)))

The set of usable rules consists of

  (no rules)

Take the reduction pair:

  lexicographic path order with precedence:
  
    precedence:
    
      cons > maxlist > app > app#
    
    argument filter:
  
      pi(app#) = 2
      pi(app) = [1, 2]
      pi(maxlist) = []
      pi(cons) = []

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: app#(app(le(),app(s(),x)),app(s(),y)) -> app#(app(le(),x),y)

and R consists of:

r1: app(app(map(),f),nil()) -> nil()
r2: app(app(map(),f),app(app(cons(),x),xs)) -> app(app(cons(),app(f,x)),app(app(map(),f),xs))
r3: app(app(le(),|0|()),y) -> true()
r4: app(app(le(),app(s(),x)),|0|()) -> false()
r5: app(app(le(),app(s(),x)),app(s(),y)) -> app(app(le(),x),y)
r6: app(app(maxlist(),x),app(app(cons(),y),ys)) -> app(app(if(),app(app(le(),x),y)),app(app(maxlist(),y),ys))
r7: app(app(maxlist(),x),nil()) -> x
r8: app(height(),app(app(node(),x),xs)) -> app(s(),app(app(maxlist(),|0|()),app(app(map(),height()),xs)))

The set of usable rules consists of

  (no rules)

Take the reduction pair:

  lexicographic path order with precedence:
  
    precedence:
    
      s > le > app# > app
    
    argument filter:
  
      pi(app#) = 2
      pi(app) = [2]
      pi(le) = []
      pi(s) = []

The next rules are strictly ordered:

  p1

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