YES

We show the termination of the TRS R:

  even(|0|()) -> true()
  even(s(|0|())) -> false()
  even(s(s(x))) -> even(x)
  half(|0|()) -> |0|()
  half(s(s(x))) -> s(half(x))
  plus(|0|(),y) -> y
  plus(s(x),y) -> s(plus(x,y))
  times(|0|(),y) -> |0|()
  times(s(x),y) -> if_times(even(s(x)),s(x),y)
  if_times(true(),s(x),y) -> plus(times(half(s(x)),y),times(half(s(x)),y))
  if_times(false(),s(x),y) -> plus(y,times(x,y))

-- SCC decomposition.

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

p1: even#(s(s(x))) -> even#(x)
p2: half#(s(s(x))) -> half#(x)
p3: plus#(s(x),y) -> plus#(x,y)
p4: times#(s(x),y) -> if_times#(even(s(x)),s(x),y)
p5: times#(s(x),y) -> even#(s(x))
p6: if_times#(true(),s(x),y) -> plus#(times(half(s(x)),y),times(half(s(x)),y))
p7: if_times#(true(),s(x),y) -> times#(half(s(x)),y)
p8: if_times#(true(),s(x),y) -> half#(s(x))
p9: if_times#(false(),s(x),y) -> plus#(y,times(x,y))
p10: if_times#(false(),s(x),y) -> times#(x,y)

and R consists of:

r1: even(|0|()) -> true()
r2: even(s(|0|())) -> false()
r3: even(s(s(x))) -> even(x)
r4: half(|0|()) -> |0|()
r5: half(s(s(x))) -> s(half(x))
r6: plus(|0|(),y) -> y
r7: plus(s(x),y) -> s(plus(x,y))
r8: times(|0|(),y) -> |0|()
r9: times(s(x),y) -> if_times(even(s(x)),s(x),y)
r10: if_times(true(),s(x),y) -> plus(times(half(s(x)),y),times(half(s(x)),y))
r11: if_times(false(),s(x),y) -> plus(y,times(x,y))

The estimated dependency graph contains the following SCCs:

  {p4, p7, p10}
  {p1}
  {p2}
  {p3}


-- Reduction pair.

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

p1: if_times#(false(),s(x),y) -> times#(x,y)
p2: times#(s(x),y) -> if_times#(even(s(x)),s(x),y)
p3: if_times#(true(),s(x),y) -> times#(half(s(x)),y)

and R consists of:

r1: even(|0|()) -> true()
r2: even(s(|0|())) -> false()
r3: even(s(s(x))) -> even(x)
r4: half(|0|()) -> |0|()
r5: half(s(s(x))) -> s(half(x))
r6: plus(|0|(),y) -> y
r7: plus(s(x),y) -> s(plus(x,y))
r8: times(|0|(),y) -> |0|()
r9: times(s(x),y) -> if_times(even(s(x)),s(x),y)
r10: if_times(true(),s(x),y) -> plus(times(half(s(x)),y),times(half(s(x)),y))
r11: if_times(false(),s(x),y) -> plus(y,times(x,y))

The set of usable rules consists of

  r1, r2, r3, r4, r5

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. lexicographic path order with precedence:
    
      precedence:
      
        if_times# > times# > s > even > true > false > |0| > half
      
      argument filter:
    
        pi(if_times#) = 2
        pi(false) = []
        pi(s) = [1]
        pi(times#) = 1
        pi(even) = []
        pi(true) = []
        pi(half) = 1
        pi(|0|) = []
    
    2. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        if_times#_A(x1,x2,x3) = 3
        false_A() = 1
        s_A(x1) = 4
        times#_A(x1,x2) = x1
        even_A(x1) = 1
        true_A() = 1
        half_A(x1) = 2
        |0|_A() = 1
    

The next rules are strictly ordered:

  p1, p2, p3

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: even#(s(s(x))) -> even#(x)

and R consists of:

r1: even(|0|()) -> true()
r2: even(s(|0|())) -> false()
r3: even(s(s(x))) -> even(x)
r4: half(|0|()) -> |0|()
r5: half(s(s(x))) -> s(half(x))
r6: plus(|0|(),y) -> y
r7: plus(s(x),y) -> s(plus(x,y))
r8: times(|0|(),y) -> |0|()
r9: times(s(x),y) -> if_times(even(s(x)),s(x),y)
r10: if_times(true(),s(x),y) -> plus(times(half(s(x)),y),times(half(s(x)),y))
r11: if_times(false(),s(x),y) -> plus(y,times(x,y))

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

  lexicographic combination of reduction pairs:
  
    1. lexicographic path order with precedence:
    
      precedence:
      
        s > even#
      
      argument filter:
    
        pi(even#) = 1
        pi(s) = 1
    
    2. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        even#_A(x1) = x1
        s_A(x1) = x1 + 1
    

The next rules are strictly ordered:

  p1
  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: half#(s(s(x))) -> half#(x)

and R consists of:

r1: even(|0|()) -> true()
r2: even(s(|0|())) -> false()
r3: even(s(s(x))) -> even(x)
r4: half(|0|()) -> |0|()
r5: half(s(s(x))) -> s(half(x))
r6: plus(|0|(),y) -> y
r7: plus(s(x),y) -> s(plus(x,y))
r8: times(|0|(),y) -> |0|()
r9: times(s(x),y) -> if_times(even(s(x)),s(x),y)
r10: if_times(true(),s(x),y) -> plus(times(half(s(x)),y),times(half(s(x)),y))
r11: if_times(false(),s(x),y) -> plus(y,times(x,y))

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

  lexicographic combination of reduction pairs:
  
    1. lexicographic path order with precedence:
    
      precedence:
      
        s > half#
      
      argument filter:
    
        pi(half#) = 1
        pi(s) = 1
    
    2. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        half#_A(x1) = x1
        s_A(x1) = x1 + 1
    

The next rules are strictly ordered:

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

and R consists of:

r1: even(|0|()) -> true()
r2: even(s(|0|())) -> false()
r3: even(s(s(x))) -> even(x)
r4: half(|0|()) -> |0|()
r5: half(s(s(x))) -> s(half(x))
r6: plus(|0|(),y) -> y
r7: plus(s(x),y) -> s(plus(x,y))
r8: times(|0|(),y) -> |0|()
r9: times(s(x),y) -> if_times(even(s(x)),s(x),y)
r10: if_times(true(),s(x),y) -> plus(times(half(s(x)),y),times(half(s(x)),y))
r11: if_times(false(),s(x),y) -> plus(y,times(x,y))

The set of usable rules consists of

  (no rules)

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. lexicographic path order with precedence:
    
      precedence:
      
        s > plus#
      
      argument filter:
    
        pi(plus#) = 1
        pi(s) = [1]
    
    2. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        plus#_A(x1,x2) = x1
        s_A(x1) = x1 + 1
    

The next rules are strictly ordered:

  p1

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