YES

We show the termination of the relative TRS R/S:

  R:
  le(|0|(),y) -> true()
  le(s(x),|0|()) -> false()
  le(s(x),s(y)) -> le(x,y)
  pred(s(x)) -> x
  minus(x,|0|()) -> x
  minus(x,s(y)) -> pred(minus(x,y))
  mod(|0|(),y) -> |0|()
  mod(s(x),|0|()) -> |0|()
  mod(s(x),s(y)) -> if_mod(le(y,x),s(x),s(y))
  if_mod(true(),s(x),s(y)) -> mod(minus(x,y),s(y))
  if_mod(false(),s(x),s(y)) -> s(x)

  S:
  rand(x) -> x
  rand(x) -> rand(s(x))

-- SCC decomposition.

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

p1: le#(s(x),s(y)) -> le#(x,y)
p2: minus#(x,s(y)) -> pred#(minus(x,y))
p3: minus#(x,s(y)) -> minus#(x,y)
p4: mod#(s(x),s(y)) -> if_mod#(le(y,x),s(x),s(y))
p5: mod#(s(x),s(y)) -> le#(y,x)
p6: if_mod#(true(),s(x),s(y)) -> mod#(minus(x,y),s(y))
p7: if_mod#(true(),s(x),s(y)) -> minus#(x,y)

and R consists of:

r1: le(|0|(),y) -> true()
r2: le(s(x),|0|()) -> false()
r3: le(s(x),s(y)) -> le(x,y)
r4: pred(s(x)) -> x
r5: minus(x,|0|()) -> x
r6: minus(x,s(y)) -> pred(minus(x,y))
r7: mod(|0|(),y) -> |0|()
r8: mod(s(x),|0|()) -> |0|()
r9: mod(s(x),s(y)) -> if_mod(le(y,x),s(x),s(y))
r10: if_mod(true(),s(x),s(y)) -> mod(minus(x,y),s(y))
r11: if_mod(false(),s(x),s(y)) -> s(x)
r12: rand(x) -> x
r13: rand(x) -> rand(s(x))

The estimated dependency graph contains the following SCCs:

  {p4, p6}
  {p1}
  {p3}


-- Reduction pair.

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

p1: if_mod#(true(),s(x),s(y)) -> mod#(minus(x,y),s(y))
p2: mod#(s(x),s(y)) -> if_mod#(le(y,x),s(x),s(y))

and R consists of:

r1: le(|0|(),y) -> true()
r2: le(s(x),|0|()) -> false()
r3: le(s(x),s(y)) -> le(x,y)
r4: pred(s(x)) -> x
r5: minus(x,|0|()) -> x
r6: minus(x,s(y)) -> pred(minus(x,y))
r7: mod(|0|(),y) -> |0|()
r8: mod(s(x),|0|()) -> |0|()
r9: mod(s(x),s(y)) -> if_mod(le(y,x),s(x),s(y))
r10: if_mod(true(),s(x),s(y)) -> mod(minus(x,y),s(y))
r11: if_mod(false(),s(x),s(y)) -> s(x)
r12: rand(x) -> x
r13: rand(x) -> rand(s(x))

The set of usable rules consists of

  r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        if_mod#_A(x1,x2,x3) = x2 + x3
        true_A() = 1
        s_A(x1) = x1
        mod#_A(x1,x2) = x1 + x2
        minus_A(x1,x2) = x1
        le_A(x1,x2) = x1 + 2
        |0|_A() = 1
        false_A() = 1
        pred_A(x1) = x1
        mod_A(x1,x2) = x1 + 2
        if_mod_A(x1,x2,x3) = x2 + 2
        rand_A(x1) = x1 + 1
    
    2. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        if_mod#_A(x1,x2,x3) = x2 + x3
        true_A() = 7
        s_A(x1) = x1 + 3
        mod#_A(x1,x2) = x1 + x2 + 1
        minus_A(x1,x2) = x1 + 1
        le_A(x1,x2) = x1 + 1
        |0|_A() = 5
        false_A() = 5
        pred_A(x1) = x1
        mod_A(x1,x2) = 4
        if_mod_A(x1,x2,x3) = 4
        rand_A(x1) = 0
    

The next rules are strictly ordered:

  p1, p2

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

-- Reduction pair.

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

p1: le#(s(x),s(y)) -> le#(x,y)

and R consists of:

r1: le(|0|(),y) -> true()
r2: le(s(x),|0|()) -> false()
r3: le(s(x),s(y)) -> le(x,y)
r4: pred(s(x)) -> x
r5: minus(x,|0|()) -> x
r6: minus(x,s(y)) -> pred(minus(x,y))
r7: mod(|0|(),y) -> |0|()
r8: mod(s(x),|0|()) -> |0|()
r9: mod(s(x),s(y)) -> if_mod(le(y,x),s(x),s(y))
r10: if_mod(true(),s(x),s(y)) -> mod(minus(x,y),s(y))
r11: if_mod(false(),s(x),s(y)) -> s(x)
r12: rand(x) -> x
r13: rand(x) -> rand(s(x))

The set of usable rules consists of

  r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        le#_A(x1,x2) = x1
        s_A(x1) = x1
        le_A(x1,x2) = 2
        |0|_A() = 1
        true_A() = 1
        false_A() = 1
        pred_A(x1) = x1
        minus_A(x1,x2) = x1
        mod_A(x1,x2) = x1 + 2
        if_mod_A(x1,x2,x3) = x2 + 2
        rand_A(x1) = x1 + 1
    
    2. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        le#_A(x1,x2) = x1
        s_A(x1) = x1 + 3
        le_A(x1,x2) = 1
        |0|_A() = 6
        true_A() = 2
        false_A() = 2
        pred_A(x1) = x1
        minus_A(x1,x2) = x1 + 1
        mod_A(x1,x2) = x1 + 2
        if_mod_A(x1,x2,x3) = x2 + 1
        rand_A(x1) = 0
    

The next rules are strictly ordered:

  p1

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

-- Reduction pair.

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

p1: minus#(x,s(y)) -> minus#(x,y)

and R consists of:

r1: le(|0|(),y) -> true()
r2: le(s(x),|0|()) -> false()
r3: le(s(x),s(y)) -> le(x,y)
r4: pred(s(x)) -> x
r5: minus(x,|0|()) -> x
r6: minus(x,s(y)) -> pred(minus(x,y))
r7: mod(|0|(),y) -> |0|()
r8: mod(s(x),|0|()) -> |0|()
r9: mod(s(x),s(y)) -> if_mod(le(y,x),s(x),s(y))
r10: if_mod(true(),s(x),s(y)) -> mod(minus(x,y),s(y))
r11: if_mod(false(),s(x),s(y)) -> s(x)
r12: rand(x) -> x
r13: rand(x) -> rand(s(x))

The set of usable rules consists of

  r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        minus#_A(x1,x2) = x1 + x2
        s_A(x1) = x1
        le_A(x1,x2) = x2 + 2
        |0|_A() = 1
        true_A() = 1
        false_A() = 1
        pred_A(x1) = x1
        minus_A(x1,x2) = x1
        mod_A(x1,x2) = x1 + 2
        if_mod_A(x1,x2,x3) = x2 + 2
        rand_A(x1) = x1 + 1
    
    2. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        minus#_A(x1,x2) = x1 + x2
        s_A(x1) = x1 + 1
        le_A(x1,x2) = x2 + 2
        |0|_A() = 1
        true_A() = 1
        false_A() = 1
        pred_A(x1) = x1
        minus_A(x1,x2) = x1 + 1
        mod_A(x1,x2) = 0
        if_mod_A(x1,x2,x3) = 0
        rand_A(x1) = 0
    

The next rules are strictly ordered:

  p1

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