Term Rewriting System R:
[f, x, xs, ys]
app(app(map, f), nil) -> nil
app(app(map, f), app(app(cons, x), xs)) -> app(app(cons, app(f, x)), app(app(map, f), xs))
app(flatten, app(app(node, x), xs)) -> app(app(cons, x), app(concat, app(app(map, flatten), xs)))
app(concat, nil) -> nil
app(concat, app(app(cons, x), xs)) -> app(app(append, x), app(concat, xs))
app(app(append, nil), xs) -> xs
app(app(append, app(app(cons, x), xs)), ys) -> app(app(cons, x), app(app(append, xs), ys))

Termination of R to be shown.



   R
Overlay and local confluence Check



The TRS is overlay and locally confluent (all critical pairs are trivially joinable).Hence, we can switch to innermost.


   R
OC
       →TRS2
Dependency Pair Analysis



R contains the following Dependency Pairs:

APP(app(map, f), app(app(cons, x), xs)) -> APP(app(cons, app(f, x)), app(app(map, f), xs))
APP(app(map, f), app(app(cons, x), xs)) -> APP(cons, app(f, x))
APP(app(map, f), app(app(cons, x), xs)) -> APP(f, x)
APP(app(map, f), app(app(cons, x), xs)) -> APP(app(map, f), xs)
APP(flatten, app(app(node, x), xs)) -> APP(app(cons, x), app(concat, app(app(map, flatten), xs)))
APP(flatten, app(app(node, x), xs)) -> APP(cons, x)
APP(flatten, app(app(node, x), xs)) -> APP(concat, app(app(map, flatten), xs))
APP(flatten, app(app(node, x), xs)) -> APP(app(map, flatten), xs)
APP(flatten, app(app(node, x), xs)) -> APP(map, flatten)
APP(concat, app(app(cons, x), xs)) -> APP(app(append, x), app(concat, xs))
APP(concat, app(app(cons, x), xs)) -> APP(append, x)
APP(concat, app(app(cons, x), xs)) -> APP(concat, xs)
APP(app(append, app(app(cons, x), xs)), ys) -> APP(app(cons, x), app(app(append, xs), ys))
APP(app(append, app(app(cons, x), xs)), ys) -> APP(app(append, xs), ys)
APP(app(append, app(app(cons, x), xs)), ys) -> APP(append, xs)

Furthermore, R contains three SCCs.


   R
OC
       →TRS2
DPs
           →DP Problem 1
Usable Rules (Innermost)
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules


Dependency Pair:

APP(app(append, app(app(cons, x), xs)), ys) -> APP(app(append, xs), ys)


Rules:


app(app(map, f), nil) -> nil
app(app(map, f), app(app(cons, x), xs)) -> app(app(cons, app(f, x)), app(app(map, f), xs))
app(flatten, app(app(node, x), xs)) -> app(app(cons, x), app(concat, app(app(map, flatten), xs)))
app(concat, nil) -> nil
app(concat, app(app(cons, x), xs)) -> app(app(append, x), app(concat, xs))
app(app(append, nil), xs) -> xs
app(app(append, app(app(cons, x), xs)), ys) -> app(app(cons, x), app(app(append, xs), ys))


Strategy:

innermost




As we are in the innermost case, we can delete all 7 non-usable-rules.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
             ...
               →DP Problem 4
A-Transformation
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules


Dependency Pair:

APP(app(append, app(app(cons, x), xs)), ys) -> APP(app(append, xs), ys)


Rule:

none


Strategy:

innermost




We have an applicative DP problem with proper arity. Thus we can use the A-Transformation to obtain one new DP problem which consists of the A-transformed TRSs.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
             ...
               →DP Problem 5
Size-Change Principle
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules


Dependency Pair:

APPEND(cons(x, xs), ys) -> APPEND(xs, ys)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. APPEND(cons(x, xs), ys) -> APPEND(xs, ys)
and get the following Size-Change Graph(s):
{1} , {1}
1>1
2=2

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>1
2=2

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
cons(x1, x2) -> cons(x1, x2)

We obtain no new DP problems.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
Usable Rules (Innermost)
           →DP Problem 3
UsableRules


Dependency Pair:

APP(concat, app(app(cons, x), xs)) -> APP(concat, xs)


Rules:


app(app(map, f), nil) -> nil
app(app(map, f), app(app(cons, x), xs)) -> app(app(cons, app(f, x)), app(app(map, f), xs))
app(flatten, app(app(node, x), xs)) -> app(app(cons, x), app(concat, app(app(map, flatten), xs)))
app(concat, nil) -> nil
app(concat, app(app(cons, x), xs)) -> app(app(append, x), app(concat, xs))
app(app(append, nil), xs) -> xs
app(app(append, app(app(cons, x), xs)), ys) -> app(app(cons, x), app(app(append, xs), ys))


Strategy:

innermost




As we are in the innermost case, we can delete all 7 non-usable-rules.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 6
A-Transformation
           →DP Problem 3
UsableRules


Dependency Pair:

APP(concat, app(app(cons, x), xs)) -> APP(concat, xs)


Rule:

none


Strategy:

innermost




We have an applicative DP problem with proper arity. Thus we can use the A-Transformation to obtain one new DP problem which consists of the A-transformed TRSs.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
             ...
               →DP Problem 7
Size-Change Principle
           →DP Problem 3
UsableRules


Dependency Pair:

CONCAT(cons(x, xs)) -> CONCAT(xs)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. CONCAT(cons(x, xs)) -> CONCAT(xs)
and get the following Size-Change Graph(s):
{1} , {1}
1>1

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>1

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
cons(x1, x2) -> cons(x1, x2)

We obtain no new DP problems.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
Usable Rules (Innermost)


Dependency Pairs:

APP(flatten, app(app(node, x), xs)) -> APP(app(map, flatten), xs)
APP(app(map, f), app(app(cons, x), xs)) -> APP(app(map, f), xs)
APP(app(map, f), app(app(cons, x), xs)) -> APP(f, x)


Rules:


app(app(map, f), nil) -> nil
app(app(map, f), app(app(cons, x), xs)) -> app(app(cons, app(f, x)), app(app(map, f), xs))
app(flatten, app(app(node, x), xs)) -> app(app(cons, x), app(concat, app(app(map, flatten), xs)))
app(concat, nil) -> nil
app(concat, app(app(cons, x), xs)) -> app(app(append, x), app(concat, xs))
app(app(append, nil), xs) -> xs
app(app(append, app(app(cons, x), xs)), ys) -> app(app(cons, x), app(app(append, xs), ys))


Strategy:

innermost




As we are in the innermost case, we can delete all 7 non-usable-rules.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
           →DP Problem 2
UsableRules
           →DP Problem 3
UsableRules
             ...
               →DP Problem 8
Size-Change Principle


Dependency Pairs:

APP(flatten, app(app(node, x), xs)) -> APP(app(map, flatten), xs)
APP(app(map, f), app(app(cons, x), xs)) -> APP(app(map, f), xs)
APP(app(map, f), app(app(cons, x), xs)) -> APP(f, x)


Rule:

none


Strategy:

innermost




We number the DPs as follows:
  1. APP(flatten, app(app(node, x), xs)) -> APP(app(map, flatten), xs)
  2. APP(app(map, f), app(app(cons, x), xs)) -> APP(app(map, f), xs)
  3. APP(app(map, f), app(app(cons, x), xs)) -> APP(f, x)
and get the following Size-Change Graph(s):
{1} , {1}
2>2
{2} , {2}
1=1
2>2
{3} , {3}
1>1
2>2

which lead(s) to this/these maximal multigraph(s):
{3} , {3}
1>1
2>2
{2} , {2}
1=1
2>2
{2} , {3}
1>1
2>2
{3} , {1}
2>2
{1} , {3}
2>2
{3} , {2}
1>1
2>2
{2} , {1}
2>2
{3} , {2}
2>2
{2} , {2}
1>1
2>2
{3} , {3}
2>2
{2} , {2}
2>2
{2} , {3}
2>2

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
app(x1, x2) -> app(x1, x2)

We obtain no new DP problems.

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