Term Rewriting System R:
[X, Y, N, M]
eq(0, 0) -> true
eq(0, s(X)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
rm(N, nil) -> nil
ifrm(true, N, add(M, X)) -> rm(N, X)
purge(nil) -> nil

Termination of R to be shown.

`   R`
`     ↳Dependency Pair Analysis`

R contains the following Dependency Pairs:

EQ(s(X), s(Y)) -> EQ(X, Y)
RM(N, add(M, X)) -> EQ(N, M)
IFRM(true, N, add(M, X)) -> RM(N, X)
IFRM(false, N, add(M, X)) -> RM(N, X)

Furthermore, R contains three SCCs.

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

Dependency Pair:

EQ(s(X), s(Y)) -> EQ(X, Y)

Rules:

eq(0, 0) -> true
eq(0, s(X)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
rm(N, nil) -> nil
ifrm(true, N, add(M, X)) -> rm(N, X)
purge(nil) -> nil

The following dependency pair can be strictly oriented:

EQ(s(X), s(Y)) -> EQ(X, Y)

There are no usable rules w.r.t. to the AFS that need to be oriented.
Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(EQ(x1, x2)) =  x1 + x2 POL(s(x1)) =  1 + x1

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

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`           →DP Problem 4`
`             ↳Dependency Graph`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳AFS`

Dependency Pair:

Rules:

eq(0, 0) -> true
eq(0, s(X)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
rm(N, nil) -> nil
ifrm(true, N, add(M, X)) -> rm(N, X)
purge(nil) -> nil

Using the Dependency Graph resulted in no new DP problems.

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

Dependency Pairs:

IFRM(false, N, add(M, X)) -> RM(N, X)
IFRM(true, N, add(M, X)) -> RM(N, X)

Rules:

eq(0, 0) -> true
eq(0, s(X)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
rm(N, nil) -> nil
ifrm(true, N, add(M, X)) -> rm(N, X)
purge(nil) -> nil

The following dependency pairs can be strictly oriented:

IFRM(false, N, add(M, X)) -> RM(N, X)
IFRM(true, N, add(M, X)) -> RM(N, X)

The following usable rules w.r.t. to the AFS can be oriented:

eq(0, 0) -> true
eq(0, s(X)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)

Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(IFRM(x1, x2, x3)) =  x1 + x2 + x3 POL(eq) =  0 POL(false) =  0 POL(true) =  0 POL(RM(x1, x2)) =  x1 + x2 POL(add(x1, x2)) =  1 + x1 + x2

resulting in one new DP problem.
Used Argument Filtering System:
IFRM(x1, x2, x3) -> IFRM(x1, x2, x3)
RM(x1, x2) -> RM(x1, x2)
eq(x1, x2) -> eq

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳AFS`
`           →DP Problem 5`
`             ↳Dependency Graph`
`       →DP Problem 3`
`         ↳AFS`

Dependency Pair:

Rules:

eq(0, 0) -> true
eq(0, s(X)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
rm(N, nil) -> nil
ifrm(true, N, add(M, X)) -> rm(N, X)
purge(nil) -> nil

Using the Dependency Graph resulted in no new DP problems.

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

Dependency Pair:

Rules:

eq(0, 0) -> true
eq(0, s(X)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
rm(N, nil) -> nil
ifrm(true, N, add(M, X)) -> rm(N, X)
purge(nil) -> nil

The following dependency pair can be strictly oriented:

The following usable rules w.r.t. to the AFS can be oriented:

ifrm(true, N, add(M, X)) -> rm(N, X)
rm(N, nil) -> nil
eq(0, 0) -> true
eq(0, s(X)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)

Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(PURGE(x1)) =  1 + x1 POL(eq) =  0 POL(false) =  0 POL(ifrm(x1, x2, x3)) =  x1 + x2 + x3 POL(true) =  0 POL(nil) =  0 POL(rm(x1, x2)) =  x1 + x2 POL(add(x1, x2)) =  1 + x1 + x2

resulting in one new DP problem.
Used Argument Filtering System:
PURGE(x1) -> PURGE(x1)
rm(x1, x2) -> rm(x1, x2)
ifrm(x1, x2, x3) -> ifrm(x1, x2, x3)
eq(x1, x2) -> eq

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳AFS`
`           →DP Problem 6`
`             ↳Dependency Graph`

Dependency Pair:

Rules:

eq(0, 0) -> true
eq(0, s(X)) -> false
eq(s(X), 0) -> false
eq(s(X), s(Y)) -> eq(X, Y)
rm(N, nil) -> nil
ifrm(true, N, add(M, X)) -> rm(N, X)