YES Problem 1: (VAR v_NonEmpty:S b:S m:S n:S x:S y:S) (RULES empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue head(cons(n:S,x:S)) -> n:S if(ffalse,b:S,x:S) -> if2(b:S,x:S) if(ttrue,b:S,x:S) -> weight_undefined_error if2(ffalse,x:S) -> weight(sum(x:S,cons(0,tail(tail(x:S))))) if2(ttrue,x:S) -> head(x:S) sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil weight(x:S) -> if(empty(x:S),empty(tail(x:S)),x:S) ) Problem 1: Innermost Equivalent Processor: -> Rules: empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue head(cons(n:S,x:S)) -> n:S if(ffalse,b:S,x:S) -> if2(b:S,x:S) if(ttrue,b:S,x:S) -> weight_undefined_error if2(ffalse,x:S) -> weight(sum(x:S,cons(0,tail(tail(x:S))))) if2(ttrue,x:S) -> head(x:S) sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil weight(x:S) -> if(empty(x:S),empty(tail(x:S)),x:S) -> The term rewriting system is non-overlaping or locally confluent overlay system. Therefore, innermost termination implies termination. Problem 1: Dependency Pairs Processor: -> Pairs: IF(ffalse,b:S,x:S) -> IF2(b:S,x:S) IF2(ffalse,x:S) -> SUM(x:S,cons(0,tail(tail(x:S)))) IF2(ffalse,x:S) -> TAIL(tail(x:S)) IF2(ffalse,x:S) -> TAIL(x:S) IF2(ffalse,x:S) -> WEIGHT(sum(x:S,cons(0,tail(tail(x:S))))) IF2(ttrue,x:S) -> HEAD(x:S) SUM(cons(0,x:S),y:S) -> SUM(x:S,y:S) SUM(cons(s(n:S),x:S),cons(m:S,y:S)) -> SUM(cons(n:S,x:S),cons(s(m:S),y:S)) WEIGHT(x:S) -> EMPTY(tail(x:S)) WEIGHT(x:S) -> EMPTY(x:S) WEIGHT(x:S) -> IF(empty(x:S),empty(tail(x:S)),x:S) WEIGHT(x:S) -> TAIL(x:S) -> Rules: empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue head(cons(n:S,x:S)) -> n:S if(ffalse,b:S,x:S) -> if2(b:S,x:S) if(ttrue,b:S,x:S) -> weight_undefined_error if2(ffalse,x:S) -> weight(sum(x:S,cons(0,tail(tail(x:S))))) if2(ttrue,x:S) -> head(x:S) sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil weight(x:S) -> if(empty(x:S),empty(tail(x:S)),x:S) Problem 1: SCC Processor: -> Pairs: IF(ffalse,b:S,x:S) -> IF2(b:S,x:S) IF2(ffalse,x:S) -> SUM(x:S,cons(0,tail(tail(x:S)))) IF2(ffalse,x:S) -> TAIL(tail(x:S)) IF2(ffalse,x:S) -> TAIL(x:S) IF2(ffalse,x:S) -> WEIGHT(sum(x:S,cons(0,tail(tail(x:S))))) IF2(ttrue,x:S) -> HEAD(x:S) SUM(cons(0,x:S),y:S) -> SUM(x:S,y:S) SUM(cons(s(n:S),x:S),cons(m:S,y:S)) -> SUM(cons(n:S,x:S),cons(s(m:S),y:S)) WEIGHT(x:S) -> EMPTY(tail(x:S)) WEIGHT(x:S) -> EMPTY(x:S) WEIGHT(x:S) -> IF(empty(x:S),empty(tail(x:S)),x:S) WEIGHT(x:S) -> TAIL(x:S) -> Rules: empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue head(cons(n:S,x:S)) -> n:S if(ffalse,b:S,x:S) -> if2(b:S,x:S) if(ttrue,b:S,x:S) -> weight_undefined_error if2(ffalse,x:S) -> weight(sum(x:S,cons(0,tail(tail(x:S))))) if2(ttrue,x:S) -> head(x:S) sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil weight(x:S) -> if(empty(x:S),empty(tail(x:S)),x:S) ->Strongly Connected Components: ->->Cycle: ->->-> Pairs: SUM(cons(0,x:S),y:S) -> SUM(x:S,y:S) SUM(cons(s(n:S),x:S),cons(m:S,y:S)) -> SUM(cons(n:S,x:S),cons(s(m:S),y:S)) ->->-> Rules: empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue head(cons(n:S,x:S)) -> n:S if(ffalse,b:S,x:S) -> if2(b:S,x:S) if(ttrue,b:S,x:S) -> weight_undefined_error if2(ffalse,x:S) -> weight(sum(x:S,cons(0,tail(tail(x:S))))) if2(ttrue,x:S) -> head(x:S) sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil weight(x:S) -> if(empty(x:S),empty(tail(x:S)),x:S) ->->Cycle: ->->-> Pairs: IF(ffalse,b:S,x:S) -> IF2(b:S,x:S) IF2(ffalse,x:S) -> WEIGHT(sum(x:S,cons(0,tail(tail(x:S))))) WEIGHT(x:S) -> IF(empty(x:S),empty(tail(x:S)),x:S) ->->-> Rules: empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue head(cons(n:S,x:S)) -> n:S if(ffalse,b:S,x:S) -> if2(b:S,x:S) if(ttrue,b:S,x:S) -> weight_undefined_error if2(ffalse,x:S) -> weight(sum(x:S,cons(0,tail(tail(x:S))))) if2(ttrue,x:S) -> head(x:S) sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil weight(x:S) -> if(empty(x:S),empty(tail(x:S)),x:S) The problem is decomposed in 2 subproblems. Problem 1.1: Reduction Pairs Processor: -> Pairs: SUM(cons(0,x:S),y:S) -> SUM(x:S,y:S) SUM(cons(s(n:S),x:S),cons(m:S,y:S)) -> SUM(cons(n:S,x:S),cons(s(m:S),y:S)) -> Rules: empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue head(cons(n:S,x:S)) -> n:S if(ffalse,b:S,x:S) -> if2(b:S,x:S) if(ttrue,b:S,x:S) -> weight_undefined_error if2(ffalse,x:S) -> weight(sum(x:S,cons(0,tail(tail(x:S))))) if2(ttrue,x:S) -> head(x:S) sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil weight(x:S) -> if(empty(x:S),empty(tail(x:S)),x:S) -> Usable rules: Empty ->Interpretation type: Linear ->Coefficients: Natural Numbers ->Dimension: 1 ->Bound: 2 ->Interpretation: [empty](X) = 0 [head](X) = 0 [if](X1,X2,X3) = 0 [if2](X1,X2) = 0 [sum](X1,X2) = 0 [tail](X) = 0 [weight](X) = 0 [0] = 2 [cons](X1,X2) = 2.X1 + 2.X2 + 2 [fSNonEmpty] = 0 [false] = 0 [nil] = 0 [s](X) = 2.X [true] = 0 [weight_undefined_error] = 0 [EMPTY](X) = 0 [HEAD](X) = 0 [IF](X1,X2,X3) = 0 [IF2](X1,X2) = 0 [SUM](X1,X2) = 2.X1 [TAIL](X) = 0 [WEIGHT](X) = 0 Problem 1.1: SCC Processor: -> Pairs: SUM(cons(s(n:S),x:S),cons(m:S,y:S)) -> SUM(cons(n:S,x:S),cons(s(m:S),y:S)) -> Rules: empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue head(cons(n:S,x:S)) -> n:S if(ffalse,b:S,x:S) -> if2(b:S,x:S) if(ttrue,b:S,x:S) -> weight_undefined_error if2(ffalse,x:S) -> weight(sum(x:S,cons(0,tail(tail(x:S))))) if2(ttrue,x:S) -> head(x:S) sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil weight(x:S) -> if(empty(x:S),empty(tail(x:S)),x:S) ->Strongly Connected Components: ->->Cycle: ->->-> Pairs: SUM(cons(s(n:S),x:S),cons(m:S,y:S)) -> SUM(cons(n:S,x:S),cons(s(m:S),y:S)) ->->-> Rules: empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue head(cons(n:S,x:S)) -> n:S if(ffalse,b:S,x:S) -> if2(b:S,x:S) if(ttrue,b:S,x:S) -> weight_undefined_error if2(ffalse,x:S) -> weight(sum(x:S,cons(0,tail(tail(x:S))))) if2(ttrue,x:S) -> head(x:S) sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil weight(x:S) -> if(empty(x:S),empty(tail(x:S)),x:S) Problem 1.1: Reduction Pairs Processor: -> Pairs: SUM(cons(s(n:S),x:S),cons(m:S,y:S)) -> SUM(cons(n:S,x:S),cons(s(m:S),y:S)) -> Rules: empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue head(cons(n:S,x:S)) -> n:S if(ffalse,b:S,x:S) -> if2(b:S,x:S) if(ttrue,b:S,x:S) -> weight_undefined_error if2(ffalse,x:S) -> weight(sum(x:S,cons(0,tail(tail(x:S))))) if2(ttrue,x:S) -> head(x:S) sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil weight(x:S) -> if(empty(x:S),empty(tail(x:S)),x:S) -> Usable rules: Empty ->Interpretation type: Linear ->Coefficients: Natural Numbers ->Dimension: 1 ->Bound: 2 ->Interpretation: [empty](X) = 0 [head](X) = 0 [if](X1,X2,X3) = 0 [if2](X1,X2) = 0 [sum](X1,X2) = 0 [tail](X) = 0 [weight](X) = 0 [0] = 0 [cons](X1,X2) = 2.X1 [fSNonEmpty] = 0 [false] = 0 [nil] = 0 [s](X) = X + 2 [true] = 0 [weight_undefined_error] = 0 [EMPTY](X) = 0 [HEAD](X) = 0 [IF](X1,X2,X3) = 0 [IF2](X1,X2) = 0 [SUM](X1,X2) = 2.X1 + X2 [TAIL](X) = 0 [WEIGHT](X) = 0 Problem 1.1: SCC Processor: -> Pairs: Empty -> Rules: empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue head(cons(n:S,x:S)) -> n:S if(ffalse,b:S,x:S) -> if2(b:S,x:S) if(ttrue,b:S,x:S) -> weight_undefined_error if2(ffalse,x:S) -> weight(sum(x:S,cons(0,tail(tail(x:S))))) if2(ttrue,x:S) -> head(x:S) sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil weight(x:S) -> if(empty(x:S),empty(tail(x:S)),x:S) ->Strongly Connected Components: There is no strongly connected component The problem is finite. Problem 1.2: Reduction Pairs Processor: -> Pairs: IF(ffalse,b:S,x:S) -> IF2(b:S,x:S) IF2(ffalse,x:S) -> WEIGHT(sum(x:S,cons(0,tail(tail(x:S))))) WEIGHT(x:S) -> IF(empty(x:S),empty(tail(x:S)),x:S) -> Rules: empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue head(cons(n:S,x:S)) -> n:S if(ffalse,b:S,x:S) -> if2(b:S,x:S) if(ttrue,b:S,x:S) -> weight_undefined_error if2(ffalse,x:S) -> weight(sum(x:S,cons(0,tail(tail(x:S))))) if2(ttrue,x:S) -> head(x:S) sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil weight(x:S) -> if(empty(x:S),empty(tail(x:S)),x:S) -> Usable rules: empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil ->Interpretation type: Linear ->Coefficients: All rationals ->Dimension: 1 ->Bound: 4 ->Interpretation: [empty](X) = 2.X + 1/4 [head](X) = 0 [if](X1,X2,X3) = 0 [if2](X1,X2) = 0 [sum](X1,X2) = X2 [tail](X) = 1/4.X [weight](X) = 0 [0] = 1/2 [cons](X1,X2) = 4.X2 + 1/4 [fSNonEmpty] = 0 [false] = 3/4 [nil] = 0 [s](X) = 2/3.X + 1/4 [true] = 1/4 [weight_undefined_error] = 0 [EMPTY](X) = 0 [HEAD](X) = 0 [IF](X1,X2,X3) = 2/3.X2 + 1/4.X3 + 1/3 [IF2](X1,X2) = 2/3.X1 + 1/4.X2 + 1/4 [SUM](X1,X2) = 0 [TAIL](X) = 0 [WEIGHT](X) = X + 1/2 Problem 1.2: SCC Processor: -> Pairs: IF2(ffalse,x:S) -> WEIGHT(sum(x:S,cons(0,tail(tail(x:S))))) WEIGHT(x:S) -> IF(empty(x:S),empty(tail(x:S)),x:S) -> Rules: empty(cons(n:S,x:S)) -> ffalse empty(nil) -> ttrue head(cons(n:S,x:S)) -> n:S if(ffalse,b:S,x:S) -> if2(b:S,x:S) if(ttrue,b:S,x:S) -> weight_undefined_error if2(ffalse,x:S) -> weight(sum(x:S,cons(0,tail(tail(x:S))))) if2(ttrue,x:S) -> head(x:S) sum(cons(0,x:S),y:S) -> sum(x:S,y:S) sum(cons(s(n:S),x:S),cons(m:S,y:S)) -> sum(cons(n:S,x:S),cons(s(m:S),y:S)) sum(nil,y:S) -> y:S tail(cons(n:S,x:S)) -> x:S tail(nil) -> nil weight(x:S) -> if(empty(x:S),empty(tail(x:S)),x:S) ->Strongly Connected Components: There is no strongly connected component The problem is finite.