Term Rewriting System R:
[x, l, l1, l2]
isempty(nil) -> true
isempty(cons(x, l)) -> false
hd(cons(x, l)) -> x
tl(cons(x, l)) -> l
append(l1, l2) -> ifappend(l1, l2, isempty(l1))
ifappend(l1, l2, true) -> l2
ifappend(l1, l2, false) -> cons(hd(l1), append(tl(l1), l2))

Innermost Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

APPEND(l1, l2) -> IFAPPEND(l1, l2, isempty(l1))
APPEND(l1, l2) -> ISEMPTY(l1)
IFAPPEND(l1, l2, false) -> HD(l1)
IFAPPEND(l1, l2, false) -> APPEND(tl(l1), l2)
IFAPPEND(l1, l2, false) -> TL(l1)

Furthermore, R contains one SCC.


   R
DPs
       →DP Problem 1
Narrowing Transformation


Dependency Pairs:

IFAPPEND(l1, l2, false) -> APPEND(tl(l1), l2)
APPEND(l1, l2) -> IFAPPEND(l1, l2, isempty(l1))


Rules:


isempty(nil) -> true
isempty(cons(x, l)) -> false
hd(cons(x, l)) -> x
tl(cons(x, l)) -> l
append(l1, l2) -> ifappend(l1, l2, isempty(l1))
ifappend(l1, l2, true) -> l2
ifappend(l1, l2, false) -> cons(hd(l1), append(tl(l1), l2))


Strategy:

innermost




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

APPEND(l1, l2) -> IFAPPEND(l1, l2, isempty(l1))
two new Dependency Pairs are created:

APPEND(nil, l2) -> IFAPPEND(nil, l2, true)
APPEND(cons(x', l'), l2) -> IFAPPEND(cons(x', l'), l2, false)

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

APPEND(cons(x', l'), l2) -> IFAPPEND(cons(x', l'), l2, false)
IFAPPEND(l1, l2, false) -> APPEND(tl(l1), l2)


Rules:


isempty(nil) -> true
isempty(cons(x, l)) -> false
hd(cons(x, l)) -> x
tl(cons(x, l)) -> l
append(l1, l2) -> ifappend(l1, l2, isempty(l1))
ifappend(l1, l2, true) -> l2
ifappend(l1, l2, false) -> cons(hd(l1), append(tl(l1), l2))


Strategy:

innermost




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

IFAPPEND(l1, l2, false) -> APPEND(tl(l1), l2)
one new Dependency Pair is created:

IFAPPEND(cons(x', l'), l2, false) -> APPEND(l', l2)

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

IFAPPEND(cons(x', l'), l2, false) -> APPEND(l', l2)
APPEND(cons(x', l'), l2) -> IFAPPEND(cons(x', l'), l2, false)


Rules:


isempty(nil) -> true
isempty(cons(x, l)) -> false
hd(cons(x, l)) -> x
tl(cons(x, l)) -> l
append(l1, l2) -> ifappend(l1, l2, isempty(l1))
ifappend(l1, l2, true) -> l2
ifappend(l1, l2, false) -> cons(hd(l1), append(tl(l1), l2))


Strategy:

innermost




The following dependency pair can be strictly oriented:

IFAPPEND(cons(x', l'), l2, false) -> APPEND(l', l2)


There are no usable rules for innermost that need to be oriented.
Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
{APPEND, IFAPPEND}

resulting in one new DP problem.
Used Argument Filtering System:
APPEND(x1, x2) -> APPEND(x1, x2)
IFAPPEND(x1, x2, x3) -> IFAPPEND(x1, x2)
cons(x1, x2) -> cons(x1, x2)


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


Dependency Pair:

APPEND(cons(x', l'), l2) -> IFAPPEND(cons(x', l'), l2, false)


Rules:


isempty(nil) -> true
isempty(cons(x, l)) -> false
hd(cons(x, l)) -> x
tl(cons(x, l)) -> l
append(l1, l2) -> ifappend(l1, l2, isempty(l1))
ifappend(l1, l2, true) -> l2
ifappend(l1, l2, false) -> cons(hd(l1), append(tl(l1), l2))


Strategy:

innermost




Using the Dependency Graph resulted in no new DP problems.

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