Term Rewriting System R:
[ys, x, xs, f]
app(app(append, nil), ys) -> ys
app(app(append, app(app(cons, x), xs)), ys) -> app(app(cons, x), app(app(append, xs), ys))
app(app(flatwith, f), app(leaf, x)) -> app(app(cons, app(f, x)), nil)
app(app(flatwith, f), app(node, xs)) -> app(app(flatwithsub, f), xs)
app(app(flatwithsub, f), nil) -> nil
app(app(flatwithsub, f), app(app(cons, x), xs)) -> app(app(append, app(app(flatwith, f), x)), app(app(flatwithsub, f), xs))

Innermost Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

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)
APP(app(flatwith, f), app(leaf, x)) -> APP(app(cons, app(f, x)), nil)
APP(app(flatwith, f), app(leaf, x)) -> APP(cons, app(f, x))
APP(app(flatwith, f), app(leaf, x)) -> APP(f, x)
APP(app(flatwith, f), app(node, xs)) -> APP(app(flatwithsub, f), xs)
APP(app(flatwith, f), app(node, xs)) -> APP(flatwithsub, f)
APP(app(flatwithsub, f), app(app(cons, x), xs)) -> APP(app(append, app(app(flatwith, f), x)), app(app(flatwithsub, f), xs))
APP(app(flatwithsub, f), app(app(cons, x), xs)) -> APP(append, app(app(flatwith, f), x))
APP(app(flatwithsub, f), app(app(cons, x), xs)) -> APP(app(flatwith, f), x)
APP(app(flatwithsub, f), app(app(cons, x), xs)) -> APP(flatwith, f)
APP(app(flatwithsub, f), app(app(cons, x), xs)) -> APP(app(flatwithsub, f), xs)

Furthermore, R contains two SCCs.


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


Dependency Pair:

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


Rules:


app(app(append, nil), ys) -> ys
app(app(append, app(app(cons, x), xs)), ys) -> app(app(cons, x), app(app(append, xs), ys))
app(app(flatwith, f), app(leaf, x)) -> app(app(cons, app(f, x)), nil)
app(app(flatwith, f), app(node, xs)) -> app(app(flatwithsub, f), xs)
app(app(flatwithsub, f), nil) -> nil
app(app(flatwithsub, f), app(app(cons, x), xs)) -> app(app(append, app(app(flatwith, f), x)), app(app(flatwithsub, f), xs))


Strategy:

innermost




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


   R
DPs
       →DP Problem 1
UsableRules
           →DP Problem 3
A-Transformation
       →DP Problem 2
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
DPs
       →DP Problem 1
UsableRules
           →DP Problem 3
ATrans
             ...
               →DP Problem 4
Size-Change Principle
       →DP Problem 2
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
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
Usable Rules (Innermost)


Dependency Pairs:

APP(app(flatwithsub, f), app(app(cons, x), xs)) -> APP(app(flatwithsub, f), xs)
APP(app(flatwithsub, f), app(app(cons, x), xs)) -> APP(app(flatwith, f), x)
APP(app(flatwith, f), app(node, xs)) -> APP(app(flatwithsub, f), xs)
APP(app(flatwith, f), app(leaf, x)) -> APP(f, x)


Rules:


app(app(append, nil), ys) -> ys
app(app(append, app(app(cons, x), xs)), ys) -> app(app(cons, x), app(app(append, xs), ys))
app(app(flatwith, f), app(leaf, x)) -> app(app(cons, app(f, x)), nil)
app(app(flatwith, f), app(node, xs)) -> app(app(flatwithsub, f), xs)
app(app(flatwithsub, f), nil) -> nil
app(app(flatwithsub, f), app(app(cons, x), xs)) -> app(app(append, app(app(flatwith, f), x)), app(app(flatwithsub, f), xs))


Strategy:

innermost




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


   R
DPs
       →DP Problem 1
UsableRules
       →DP Problem 2
UsableRules
           →DP Problem 5
Size-Change Principle


Dependency Pairs:

APP(app(flatwithsub, f), app(app(cons, x), xs)) -> APP(app(flatwithsub, f), xs)
APP(app(flatwithsub, f), app(app(cons, x), xs)) -> APP(app(flatwith, f), x)
APP(app(flatwith, f), app(node, xs)) -> APP(app(flatwithsub, f), xs)
APP(app(flatwith, f), app(leaf, x)) -> APP(f, x)


Rule:

none


Strategy:

innermost




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

which lead(s) to this/these maximal multigraph(s):
{4} , {4}
1>1
2>2
{1} , {1}
1=1
2>2
{3} , {2}
2>2
{4} , {2}
2>2
{2} , {4}
2>2
{2} , {3}
2>2
{1} , {4}
2>2
{2} , {1}
2>2
{4} , {4}
2>2
{3} , {4}
2>2
{1} , {3}
2>2
{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:
app(x1, x2) -> app(x1, x2)

We obtain no new DP problems.

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