Term Rewriting System R:
[k, l, x, y]
app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

APP(cons(x, l), k) -> APP(l, k)
SUM(cons(x, cons(y, l))) -> SUM(cons(plus(x, y), l))
SUM(cons(x, cons(y, l))) -> PLUS(x, y)
SUM(app(l, cons(x, cons(y, k)))) -> SUM(app(l, sum(cons(x, cons(y, k)))))
SUM(app(l, cons(x, cons(y, k)))) -> APP(l, sum(cons(x, cons(y, k))))
SUM(app(l, cons(x, cons(y, k)))) -> SUM(cons(x, cons(y, k)))
PLUS(s(x), y) -> PLUS(x, y)

Furthermore, R contains four SCCs.


   R
DPs
       →DP Problem 1
Polynomial Ordering
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Nar


Dependency Pair:

APP(cons(x, l), k) -> APP(l, k)


Rules:


app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))





The following dependency pair can be strictly oriented:

APP(cons(x, l), k) -> APP(l, k)


There are no usable rules w.r.t. to the implicit AFS that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(cons(x1, x2))=  1 + x2  
  POL(APP(x1, x2))=  x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 5
Dependency Graph
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Nar


Dependency Pair:


Rules:


app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polynomial Ordering
       →DP Problem 3
Polo
       →DP Problem 4
Nar


Dependency Pair:

PLUS(s(x), y) -> PLUS(x, y)


Rules:


app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))





The following dependency pair can be strictly oriented:

PLUS(s(x), y) -> PLUS(x, y)


There are no usable rules w.r.t. to the implicit AFS that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(PLUS(x1, x2))=  x1  
  POL(s(x1))=  1 + x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
           →DP Problem 6
Dependency Graph
       →DP Problem 3
Polo
       →DP Problem 4
Nar


Dependency Pair:


Rules:


app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polynomial Ordering
       →DP Problem 4
Nar


Dependency Pair:

SUM(cons(x, cons(y, l))) -> SUM(cons(plus(x, y), l))


Rules:


app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))





The following dependency pair can be strictly oriented:

SUM(cons(x, cons(y, l))) -> SUM(cons(plus(x, y), l))


There are no usable rules w.r.t. to the implicit AFS that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(plus(x1, x2))=  0  
  POL(0)=  0  
  POL(SUM(x1))=  x1  
  POL(cons(x1, x2))=  1 + x2  
  POL(s(x1))=  0  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polo
           →DP Problem 7
Dependency Graph
       →DP Problem 4
Nar


Dependency Pair:


Rules:


app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Narrowing Transformation


Dependency Pair:

SUM(app(l, cons(x, cons(y, k)))) -> SUM(app(l, sum(cons(x, cons(y, k)))))


Rules:


app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))





On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

SUM(app(l, cons(x, cons(y, k)))) -> SUM(app(l, sum(cons(x, cons(y, k)))))
three new Dependency Pairs are created:

SUM(app(nil, cons(x', cons(y', k'')))) -> SUM(sum(cons(x', cons(y', k''))))
SUM(app(cons(x'', l''), cons(x0, cons(y', k'')))) -> SUM(cons(x'', app(l'', sum(cons(x0, cons(y', k''))))))
SUM(app(l, cons(x'', cons(y'', k')))) -> SUM(app(l, sum(cons(plus(x'', y''), k'))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Nar
           →DP Problem 8
Narrowing Transformation


Dependency Pairs:

SUM(app(l, cons(x'', cons(y'', k')))) -> SUM(app(l, sum(cons(plus(x'', y''), k'))))
SUM(app(nil, cons(x', cons(y', k'')))) -> SUM(sum(cons(x', cons(y', k''))))


Rules:


app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))





On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

SUM(app(nil, cons(x', cons(y', k'')))) -> SUM(sum(cons(x', cons(y', k''))))
one new Dependency Pair is created:

SUM(app(nil, cons(x'', cons(y'', k''')))) -> SUM(sum(cons(plus(x'', y''), k''')))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Nar
           →DP Problem 8
Nar
             ...
               →DP Problem 9
Narrowing Transformation


Dependency Pairs:

SUM(app(nil, cons(x'', cons(y'', k''')))) -> SUM(sum(cons(plus(x'', y''), k''')))
SUM(app(l, cons(x'', cons(y'', k')))) -> SUM(app(l, sum(cons(plus(x'', y''), k'))))


Rules:


app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))





On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

SUM(app(l, cons(x'', cons(y'', k')))) -> SUM(app(l, sum(cons(plus(x'', y''), k'))))
six new Dependency Pairs are created:

SUM(app(nil, cons(x''', cons(y''', k'')))) -> SUM(sum(cons(plus(x''', y'''), k'')))
SUM(app(cons(x', l''), cons(x''', cons(y''', k'')))) -> SUM(cons(x', app(l'', sum(cons(plus(x''', y'''), k'')))))
SUM(app(l, cons(x''', cons(y''', nil)))) -> SUM(app(l, cons(plus(x''', y'''), nil)))
SUM(app(l, cons(x''', cons(y''', cons(y', l''))))) -> SUM(app(l, sum(cons(plus(plus(x''', y'''), y'), l''))))
SUM(app(l, cons(0, cons(y''', k')))) -> SUM(app(l, sum(cons(y''', k'))))
SUM(app(l, cons(s(x'), cons(y''', k')))) -> SUM(app(l, sum(cons(s(plus(x', y''')), k'))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Nar
           →DP Problem 8
Nar
             ...
               →DP Problem 10
Polynomial Ordering


Dependency Pairs:

SUM(app(l, cons(s(x'), cons(y''', k')))) -> SUM(app(l, sum(cons(s(plus(x', y''')), k'))))
SUM(app(l, cons(0, cons(y''', k')))) -> SUM(app(l, sum(cons(y''', k'))))
SUM(app(l, cons(x''', cons(y''', cons(y', l''))))) -> SUM(app(l, sum(cons(plus(plus(x''', y'''), y'), l''))))
SUM(app(l, cons(x''', cons(y''', nil)))) -> SUM(app(l, cons(plus(x''', y'''), nil)))
SUM(app(nil, cons(x''', cons(y''', k'')))) -> SUM(sum(cons(plus(x''', y'''), k'')))
SUM(app(nil, cons(x'', cons(y'', k''')))) -> SUM(sum(cons(plus(x'', y''), k''')))


Rules:


app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))





The following dependency pairs can be strictly oriented:

SUM(app(nil, cons(x''', cons(y''', k'')))) -> SUM(sum(cons(plus(x''', y'''), k'')))
SUM(app(nil, cons(x'', cons(y'', k''')))) -> SUM(sum(cons(plus(x'', y''), k''')))


Additionally, the following usable rules w.r.t. to the implicit AFS can be oriented:

sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(plus(x1, x2))=  0  
  POL(0)=  0  
  POL(SUM(x1))=  1 + x1  
  POL(cons(x1, x2))=  0  
  POL(nil)=  1  
  POL(s(x1))=  0  
  POL(sum(x1))=  0  
  POL(app(x1, x2))=  x1 + x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Nar
           →DP Problem 8
Nar
             ...
               →DP Problem 11
Polynomial Ordering


Dependency Pairs:

SUM(app(l, cons(s(x'), cons(y''', k')))) -> SUM(app(l, sum(cons(s(plus(x', y''')), k'))))
SUM(app(l, cons(0, cons(y''', k')))) -> SUM(app(l, sum(cons(y''', k'))))
SUM(app(l, cons(x''', cons(y''', cons(y', l''))))) -> SUM(app(l, sum(cons(plus(plus(x''', y'''), y'), l''))))
SUM(app(l, cons(x''', cons(y''', nil)))) -> SUM(app(l, cons(plus(x''', y'''), nil)))


Rules:


app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))





The following dependency pair can be strictly oriented:

SUM(app(l, cons(0, cons(y''', k')))) -> SUM(app(l, sum(cons(y''', k'))))


Additionally, the following usable rules w.r.t. to the implicit AFS can be oriented:

plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(plus(x1, x2))=  x2  
  POL(0)=  1  
  POL(SUM(x1))=  1 + x1  
  POL(cons(x1, x2))=  x1 + x2  
  POL(nil)=  0  
  POL(s(x1))=  0  
  POL(sum(x1))=  x1  
  POL(app(x1, x2))=  x1 + x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Nar
           →DP Problem 8
Nar
             ...
               →DP Problem 12
Polynomial Ordering


Dependency Pairs:

SUM(app(l, cons(s(x'), cons(y''', k')))) -> SUM(app(l, sum(cons(s(plus(x', y''')), k'))))
SUM(app(l, cons(x''', cons(y''', cons(y', l''))))) -> SUM(app(l, sum(cons(plus(plus(x''', y'''), y'), l''))))
SUM(app(l, cons(x''', cons(y''', nil)))) -> SUM(app(l, cons(plus(x''', y'''), nil)))


Rules:


app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))





The following dependency pairs can be strictly oriented:

SUM(app(l, cons(s(x'), cons(y''', k')))) -> SUM(app(l, sum(cons(s(plus(x', y''')), k'))))
SUM(app(l, cons(x''', cons(y''', cons(y', l''))))) -> SUM(app(l, sum(cons(plus(plus(x''', y'''), y'), l''))))
SUM(app(l, cons(x''', cons(y''', nil)))) -> SUM(app(l, cons(plus(x''', y'''), nil)))


Additionally, the following usable rules w.r.t. to the implicit AFS can be oriented:

sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(plus(x1, x2))=  0  
  POL(0)=  1  
  POL(SUM(x1))=  x1  
  POL(cons(x1, x2))=  1 + x2  
  POL(nil)=  0  
  POL(s(x1))=  0  
  POL(sum(x1))=  1  
  POL(app(x1, x2))=  x1 + x2  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
       →DP Problem 2
Polo
       →DP Problem 3
Polo
       →DP Problem 4
Nar
           →DP Problem 8
Nar
             ...
               →DP Problem 13
Dependency Graph


Dependency Pair:


Rules:


app(nil, k) -> k
app(l, nil) -> l
app(cons(x, l), k) -> cons(x, app(l, k))
sum(cons(x, nil)) -> cons(x, nil)
sum(cons(x, cons(y, l))) -> sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) -> sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) -> y
plus(s(x), y) -> s(plus(x, y))





Using the Dependency Graph resulted in no new DP problems.

Termination of R successfully shown.
Duration:
0:01 minutes