Term Rewriting System R:
[y, x, u, v, z]
merge(nil, y) -> y
merge(x, nil) -> x
merge(.(x, y), .(u, v)) -> if((x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) -> y
++(.(x, y), z) -> .(x, ++(y, z))
if(true, x, y) -> x
if(false, x, y) -> x

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

MERGE(.(x, y), .(u, v)) -> IF((x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
MERGE(.(x, y), .(u, v)) -> MERGE(y, .(u, v))
MERGE(.(x, y), .(u, v)) -> MERGE(.(x, y), v)
++'(.(x, y), z) -> ++'(y, z)

Furthermore, R contains two SCCs.


   R
DPs
       →DP Problem 1
Argument Filtering and Ordering
       →DP Problem 2
AFS


Dependency Pairs:

MERGE(.(x, y), .(u, v)) -> MERGE(.(x, y), v)
MERGE(.(x, y), .(u, v)) -> MERGE(y, .(u, v))


Rules:


merge(nil, y) -> y
merge(x, nil) -> x
merge(.(x, y), .(u, v)) -> if((x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) -> y
++(.(x, y), z) -> .(x, ++(y, z))
if(true, x, y) -> x
if(false, x, y) -> x





The following dependency pairs can be strictly oriented:

MERGE(.(x, y), .(u, v)) -> MERGE(.(x, y), v)
MERGE(.(x, y), .(u, v)) -> MERGE(y, .(u, v))


The following rules can be oriented:

merge(nil, y) -> y
merge(x, nil) -> x
merge(.(x, y), .(u, v)) -> if((x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) -> y
++(.(x, y), z) -> .(x, ++(y, z))
if(true, x, y) -> x
if(false, x, y) -> x


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(merge(x1, x2))=  x1 + x2  
  POL(++(x1, x2))=  x1 + x2  
  POL(nil)=  0  
  POL(.(x1, x2))=  1 + x1 + x2  
  POL(MERGE(x1, x2))=  1 + x1 + x2  

resulting in one new DP problem.
Used Argument Filtering System:
MERGE(x1, x2) -> MERGE(x1, x2)
.(x1, x2) -> .(x1, x2)
merge(x1, x2) -> merge(x1, x2)
if(x1, x2, x3) -> x2
++(x1, x2) -> ++(x1, x2)


   R
DPs
       →DP Problem 1
AFS
           →DP Problem 3
Dependency Graph
       →DP Problem 2
AFS


Dependency Pair:


Rules:


merge(nil, y) -> y
merge(x, nil) -> x
merge(.(x, y), .(u, v)) -> if((x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) -> y
++(.(x, y), z) -> .(x, ++(y, z))
if(true, x, y) -> x
if(false, x, y) -> x





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
Argument Filtering and Ordering


Dependency Pair:

++'(.(x, y), z) -> ++'(y, z)


Rules:


merge(nil, y) -> y
merge(x, nil) -> x
merge(.(x, y), .(u, v)) -> if((x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) -> y
++(.(x, y), z) -> .(x, ++(y, z))
if(true, x, y) -> x
if(false, x, y) -> x





The following dependency pair can be strictly oriented:

++'(.(x, y), z) -> ++'(y, z)


The following rules can be oriented:

merge(nil, y) -> y
merge(x, nil) -> x
merge(.(x, y), .(u, v)) -> if((x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) -> y
++(.(x, y), z) -> .(x, ++(y, z))
if(true, x, y) -> x
if(false, x, y) -> x


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(++'(x1, x2))=  1 + x1 + x2  
  POL(merge(x1, x2))=  x1 + x2  
  POL(++(x1, x2))=  x1 + x2  
  POL(nil)=  0  
  POL(.(x1, x2))=  1 + x1 + x2  

resulting in one new DP problem.
Used Argument Filtering System:
++'(x1, x2) -> ++'(x1, x2)
.(x1, x2) -> .(x1, x2)
merge(x1, x2) -> merge(x1, x2)
if(x1, x2, x3) -> x2
++(x1, x2) -> ++(x1, x2)


   R
DPs
       →DP Problem 1
AFS
       →DP Problem 2
AFS
           →DP Problem 4
Dependency Graph


Dependency Pair:


Rules:


merge(nil, y) -> y
merge(x, nil) -> x
merge(.(x, y), .(u, v)) -> if((x, u), .(x, merge(y, .(u, v))), .(u, merge(.(x, y), v)))
++(nil, y) -> y
++(.(x, y), z) -> .(x, ++(y, z))
if(true, x, y) -> x
if(false, x, y) -> x





Using the Dependency Graph resulted in no new DP problems.

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