Term Rewriting System R:
[x]
app(g, app(h, app(g, x))) -> app(g, x)
app(g, app(g, x)) -> app(g, app(h, app(g, x)))
app(h, app(h, x)) -> app(h, app(app(f, app(h, x)), x))

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

APP(g, app(g, x)) -> APP(g, app(h, app(g, x)))
APP(g, app(g, x)) -> APP(h, app(g, x))
APP(h, app(h, x)) -> APP(h, app(app(f, app(h, x)), x))
APP(h, app(h, x)) -> APP(app(f, app(h, x)), x)
APP(h, app(h, x)) -> APP(f, app(h, x))

Furthermore, R contains one SCC.


   R
DPs
       →DP Problem 1
Narrowing Transformation


Dependency Pairs:

APP(h, app(h, x)) -> APP(app(f, app(h, x)), x)
APP(h, app(h, x)) -> APP(h, app(app(f, app(h, x)), x))
APP(g, app(g, x)) -> APP(h, app(g, x))
APP(g, app(g, x)) -> APP(g, app(h, app(g, x)))


Rules:


app(g, app(h, app(g, x))) -> app(g, x)
app(g, app(g, x)) -> app(g, app(h, app(g, x)))
app(h, app(h, x)) -> app(h, app(app(f, app(h, x)), x))





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

APP(g, app(g, x)) -> APP(g, app(h, app(g, x)))
two new Dependency Pairs are created:

APP(g, app(g, app(h, app(g, x'')))) -> APP(g, app(h, app(g, x'')))
APP(g, app(g, app(g, x''))) -> APP(g, app(h, app(g, app(h, app(g, x'')))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Narrowing Transformation


Dependency Pairs:

APP(g, app(g, app(g, x''))) -> APP(g, app(h, app(g, app(h, app(g, x'')))))
APP(g, app(g, app(h, app(g, x'')))) -> APP(g, app(h, app(g, x'')))
APP(h, app(h, x)) -> APP(h, app(app(f, app(h, x)), x))
APP(g, app(g, x)) -> APP(h, app(g, x))
APP(h, app(h, x)) -> APP(app(f, app(h, x)), x)


Rules:


app(g, app(h, app(g, x))) -> app(g, x)
app(g, app(g, x)) -> app(g, app(h, app(g, x)))
app(h, app(h, x)) -> app(h, app(app(f, app(h, x)), x))





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

APP(g, app(g, x)) -> APP(h, app(g, x))
two new Dependency Pairs are created:

APP(g, app(g, app(h, app(g, x'')))) -> APP(h, app(g, x''))
APP(g, app(g, app(g, x''))) -> APP(h, app(g, app(h, app(g, x''))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 3
Narrowing Transformation


Dependency Pairs:

APP(g, app(g, app(g, x''))) -> APP(h, app(g, app(h, app(g, x''))))
APP(h, app(h, x)) -> APP(app(f, app(h, x)), x)
APP(h, app(h, x)) -> APP(h, app(app(f, app(h, x)), x))
APP(g, app(g, app(h, app(g, x'')))) -> APP(h, app(g, x''))
APP(g, app(g, app(h, app(g, x'')))) -> APP(g, app(h, app(g, x'')))
APP(g, app(g, app(g, x''))) -> APP(g, app(h, app(g, app(h, app(g, x'')))))


Rules:


app(g, app(h, app(g, x))) -> app(g, x)
app(g, app(g, x)) -> app(g, app(h, app(g, x)))
app(h, app(h, x)) -> app(h, app(app(f, app(h, x)), x))





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

APP(g, app(g, app(h, app(g, x'')))) -> APP(g, app(h, app(g, x'')))
two new Dependency Pairs are created:

APP(g, app(g, app(h, app(g, app(h, app(g, x')))))) -> APP(g, app(h, app(g, x')))
APP(g, app(g, app(h, app(g, app(g, x'))))) -> APP(g, app(h, app(g, app(h, app(g, x')))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 4
Narrowing Transformation


Dependency Pairs:

APP(g, app(g, app(h, app(g, app(g, x'))))) -> APP(g, app(h, app(g, app(h, app(g, x')))))
APP(g, app(g, app(h, app(g, app(h, app(g, x')))))) -> APP(g, app(h, app(g, x')))
APP(g, app(g, app(h, app(g, x'')))) -> APP(h, app(g, x''))
APP(g, app(g, app(g, x''))) -> APP(g, app(h, app(g, app(h, app(g, x'')))))
APP(h, app(h, x)) -> APP(app(f, app(h, x)), x)
APP(h, app(h, x)) -> APP(h, app(app(f, app(h, x)), x))
APP(g, app(g, app(g, x''))) -> APP(h, app(g, app(h, app(g, x''))))


Rules:


app(g, app(h, app(g, x))) -> app(g, x)
app(g, app(g, x)) -> app(g, app(h, app(g, x)))
app(h, app(h, x)) -> app(h, app(app(f, app(h, x)), x))





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

APP(g, app(g, app(g, x''))) -> APP(g, app(h, app(g, app(h, app(g, x'')))))
three new Dependency Pairs are created:

APP(g, app(g, app(g, x'''))) -> APP(g, app(h, app(g, x''')))
APP(g, app(g, app(g, app(h, app(g, x'))))) -> APP(g, app(h, app(g, app(h, app(g, x')))))
APP(g, app(g, app(g, app(g, x')))) -> APP(g, app(h, app(g, app(h, app(g, app(h, app(g, x')))))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 5
Narrowing Transformation


Dependency Pairs:

APP(g, app(g, app(g, app(g, x')))) -> APP(g, app(h, app(g, app(h, app(g, app(h, app(g, x')))))))
APP(g, app(g, app(g, app(h, app(g, x'))))) -> APP(g, app(h, app(g, app(h, app(g, x')))))
APP(g, app(g, app(g, x'''))) -> APP(g, app(h, app(g, x''')))
APP(g, app(g, app(h, app(g, app(h, app(g, x')))))) -> APP(g, app(h, app(g, x')))
APP(g, app(g, app(g, x''))) -> APP(h, app(g, app(h, app(g, x''))))
APP(h, app(h, x)) -> APP(app(f, app(h, x)), x)
APP(h, app(h, x)) -> APP(h, app(app(f, app(h, x)), x))
APP(g, app(g, app(h, app(g, x'')))) -> APP(h, app(g, x''))
APP(g, app(g, app(h, app(g, app(g, x'))))) -> APP(g, app(h, app(g, app(h, app(g, x')))))


Rules:


app(g, app(h, app(g, x))) -> app(g, x)
app(g, app(g, x)) -> app(g, app(h, app(g, x)))
app(h, app(h, x)) -> app(h, app(app(f, app(h, x)), x))





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

APP(g, app(g, app(h, app(g, x'')))) -> APP(h, app(g, x''))
two new Dependency Pairs are created:

APP(g, app(g, app(h, app(g, app(h, app(g, x')))))) -> APP(h, app(g, x'))
APP(g, app(g, app(h, app(g, app(g, x'))))) -> APP(h, app(g, app(h, app(g, x'))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 6
Narrowing Transformation


Dependency Pairs:

APP(g, app(g, app(h, app(g, app(g, x'))))) -> APP(h, app(g, app(h, app(g, x'))))
APP(g, app(g, app(h, app(g, app(h, app(g, x')))))) -> APP(h, app(g, x'))
APP(g, app(g, app(g, app(h, app(g, x'))))) -> APP(g, app(h, app(g, app(h, app(g, x')))))
APP(g, app(g, app(g, x'''))) -> APP(g, app(h, app(g, x''')))
APP(g, app(g, app(h, app(g, app(g, x'))))) -> APP(g, app(h, app(g, app(h, app(g, x')))))
APP(g, app(g, app(h, app(g, app(h, app(g, x')))))) -> APP(g, app(h, app(g, x')))
APP(h, app(h, x)) -> APP(app(f, app(h, x)), x)
APP(h, app(h, x)) -> APP(h, app(app(f, app(h, x)), x))
APP(g, app(g, app(g, x''))) -> APP(h, app(g, app(h, app(g, x''))))
APP(g, app(g, app(g, app(g, x')))) -> APP(g, app(h, app(g, app(h, app(g, app(h, app(g, x')))))))


Rules:


app(g, app(h, app(g, x))) -> app(g, x)
app(g, app(g, x)) -> app(g, app(h, app(g, x)))
app(h, app(h, x)) -> app(h, app(app(f, app(h, x)), x))





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

APP(g, app(g, app(g, x''))) -> APP(h, app(g, app(h, app(g, x''))))
three new Dependency Pairs are created:

APP(g, app(g, app(g, x'''))) -> APP(h, app(g, x'''))
APP(g, app(g, app(g, app(h, app(g, x'))))) -> APP(h, app(g, app(h, app(g, x'))))
APP(g, app(g, app(g, app(g, x')))) -> APP(h, app(g, app(h, app(g, app(h, app(g, x'))))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 7
Forward Instantiation Transformation


Dependency Pairs:

APP(g, app(g, app(g, app(g, x')))) -> APP(h, app(g, app(h, app(g, app(h, app(g, x'))))))
APP(g, app(g, app(g, app(h, app(g, x'))))) -> APP(h, app(g, app(h, app(g, x'))))
APP(g, app(g, app(g, x'''))) -> APP(h, app(g, x'''))
APP(g, app(g, app(h, app(g, app(h, app(g, x')))))) -> APP(h, app(g, x'))
APP(g, app(g, app(g, app(g, x')))) -> APP(g, app(h, app(g, app(h, app(g, app(h, app(g, x')))))))
APP(g, app(g, app(g, app(h, app(g, x'))))) -> APP(g, app(h, app(g, app(h, app(g, x')))))
APP(g, app(g, app(g, x'''))) -> APP(g, app(h, app(g, x''')))
APP(g, app(g, app(h, app(g, app(g, x'))))) -> APP(g, app(h, app(g, app(h, app(g, x')))))
APP(g, app(g, app(h, app(g, app(h, app(g, x')))))) -> APP(g, app(h, app(g, x')))
APP(h, app(h, x)) -> APP(app(f, app(h, x)), x)
APP(h, app(h, x)) -> APP(h, app(app(f, app(h, x)), x))
APP(g, app(g, app(h, app(g, app(g, x'))))) -> APP(h, app(g, app(h, app(g, x'))))


Rules:


app(g, app(h, app(g, x))) -> app(g, x)
app(g, app(g, x)) -> app(g, app(h, app(g, x)))
app(h, app(h, x)) -> app(h, app(app(f, app(h, x)), x))





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

APP(h, app(h, x)) -> APP(app(f, app(h, x)), x)
no new Dependency Pairs are created.
The transformation is resulting in two new DP problems:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 8
Argument Filtering and Ordering


Dependency Pair:

APP(h, app(h, x)) -> APP(h, app(app(f, app(h, x)), x))


Rules:


app(g, app(h, app(g, x))) -> app(g, x)
app(g, app(g, x)) -> app(g, app(h, app(g, x)))
app(h, app(h, x)) -> app(h, app(app(f, app(h, x)), x))





The following dependency pair can be strictly oriented:

APP(h, app(h, x)) -> APP(h, app(app(f, app(h, x)), x))


The following rules can be oriented:

app(g, app(h, app(g, x))) -> app(g, x)
app(g, app(g, x)) -> app(g, app(h, app(g, x)))
app(h, app(h, x)) -> app(h, app(app(f, app(h, x)), x))


Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
h > f

resulting in one new DP problem.
Used Argument Filtering System:
APP(x1, x2) -> APP(x1, x2)
app(x1, x2) -> x1


   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 10
Dependency Graph


Dependency Pair:


Rules:


app(g, app(h, app(g, x))) -> app(g, x)
app(g, app(g, x)) -> app(g, app(h, app(g, x)))
app(h, app(h, x)) -> app(h, app(app(f, app(h, x)), x))





Using the Dependency Graph resulted in no new DP problems.


   R
DPs
       →DP Problem 1
Nar
           →DP Problem 2
Nar
             ...
               →DP Problem 9
Argument Filtering and Ordering


Dependency Pairs:

APP(g, app(g, app(g, app(h, app(g, x'))))) -> APP(g, app(h, app(g, app(h, app(g, x')))))
APP(g, app(g, app(g, x'''))) -> APP(g, app(h, app(g, x''')))
APP(g, app(g, app(h, app(g, app(g, x'))))) -> APP(g, app(h, app(g, app(h, app(g, x')))))
APP(g, app(g, app(h, app(g, app(h, app(g, x')))))) -> APP(g, app(h, app(g, x')))
APP(g, app(g, app(g, app(g, x')))) -> APP(g, app(h, app(g, app(h, app(g, app(h, app(g, x')))))))


Rules:


app(g, app(h, app(g, x))) -> app(g, x)
app(g, app(g, x)) -> app(g, app(h, app(g, x)))
app(h, app(h, x)) -> app(h, app(app(f, app(h, x)), x))





The following dependency pairs can be strictly oriented:

APP(g, app(g, app(g, app(h, app(g, x'))))) -> APP(g, app(h, app(g, app(h, app(g, x')))))
APP(g, app(g, app(g, x'''))) -> APP(g, app(h, app(g, x''')))
APP(g, app(g, app(h, app(g, app(g, x'))))) -> APP(g, app(h, app(g, app(h, app(g, x')))))
APP(g, app(g, app(h, app(g, app(h, app(g, x')))))) -> APP(g, app(h, app(g, x')))
APP(g, app(g, app(g, app(g, x')))) -> APP(g, app(h, app(g, app(h, app(g, app(h, app(g, x')))))))


The following rules can be oriented:

app(g, app(h, app(g, x))) -> app(g, x)
app(g, app(g, x)) -> app(g, app(h, app(g, x)))
app(h, app(h, x)) -> app(h, app(app(f, app(h, x)), x))


Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
g > h

resulting in one new DP problem.
Used Argument Filtering System:
APP(x1, x2) -> APP(x1, x2)
app(x1, x2) -> x1

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