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
rm(N, add(M, X)) -> ifrm(eq(N, M), N, add(M, X))
ifrm(true, N, add(M, X)) -> rm(N, X)
ifrm(false, N, add(M, X)) -> add(M, rm(N, X))
purge(nil) -> nil
purge(add(N, X)) -> add(N, purge(rm(N, X)))

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)) -> IFRM(eq(N, M), N, add(M, X))
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)
PURGE(add(N, X)) -> PURGE(rm(N, X))
PURGE(add(N, X)) -> RM(N, X)

Furthermore, R contains three SCCs.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Forward Instantiation Transformation`
`       →DP Problem 2`
`         ↳Polo`
`       →DP Problem 3`
`         ↳Nar`

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
rm(N, add(M, X)) -> ifrm(eq(N, M), N, add(M, X))
ifrm(true, N, add(M, X)) -> rm(N, X)
ifrm(false, N, add(M, X)) -> add(M, rm(N, X))
purge(nil) -> nil
purge(add(N, X)) -> add(N, purge(rm(N, X)))

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

EQ(s(X), s(Y)) -> EQ(X, Y)
one new Dependency Pair is created:

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

The transformation is resulting in one new DP problem:

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳FwdInst`
`           →DP Problem 4`
`             ↳Forward Instantiation Transformation`
`       →DP Problem 2`
`         ↳Polo`
`       →DP Problem 3`
`         ↳Nar`

Dependency Pair:

EQ(s(s(X'')), s(s(Y''))) -> EQ(s(X''), s(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
rm(N, add(M, X)) -> ifrm(eq(N, M), N, add(M, X))
ifrm(true, N, add(M, X)) -> rm(N, X)
ifrm(false, N, add(M, X)) -> add(M, rm(N, X))
purge(nil) -> nil
purge(add(N, X)) -> add(N, purge(rm(N, X)))

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

EQ(s(s(X'')), s(s(Y''))) -> EQ(s(X''), s(Y''))
one new Dependency Pair is created:

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

The transformation is resulting in one new DP problem:

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳FwdInst`
`           →DP Problem 4`
`             ↳FwdInst`
`             ...`
`               →DP Problem 5`
`                 ↳Polynomial Ordering`
`       →DP Problem 2`
`         ↳Polo`
`       →DP Problem 3`
`         ↳Nar`

Dependency Pair:

EQ(s(s(s(X''''))), s(s(s(Y'''')))) -> EQ(s(s(X'''')), s(s(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
rm(N, add(M, X)) -> ifrm(eq(N, M), N, add(M, X))
ifrm(true, N, add(M, X)) -> rm(N, X)
ifrm(false, N, add(M, X)) -> add(M, rm(N, X))
purge(nil) -> nil
purge(add(N, X)) -> add(N, purge(rm(N, X)))

The following dependency pair can be strictly oriented:

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

There are no usable rules w.r.t. to the implicit AFS that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(EQ(x1, x2)) =  1 + x1 POL(s(x1)) =  1 + x1

resulting in one new DP problem.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳FwdInst`
`           →DP Problem 4`
`             ↳FwdInst`
`             ...`
`               →DP Problem 6`
`                 ↳Dependency Graph`
`       →DP Problem 2`
`         ↳Polo`
`       →DP Problem 3`
`         ↳Nar`

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
rm(N, add(M, X)) -> ifrm(eq(N, M), N, add(M, X))
ifrm(true, N, add(M, X)) -> rm(N, X)
ifrm(false, N, add(M, X)) -> add(M, rm(N, X))
purge(nil) -> nil
purge(add(N, X)) -> add(N, purge(rm(N, X)))

Using the Dependency Graph resulted in no new DP problems.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳FwdInst`
`       →DP Problem 2`
`         ↳Polynomial Ordering`
`       →DP Problem 3`
`         ↳Nar`

Dependency Pairs:

IFRM(false, N, add(M, X)) -> RM(N, X)
IFRM(true, N, add(M, X)) -> RM(N, X)
RM(N, add(M, X)) -> IFRM(eq(N, M), N, add(M, 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
rm(N, add(M, X)) -> ifrm(eq(N, M), N, add(M, X))
ifrm(true, N, add(M, X)) -> rm(N, X)
ifrm(false, N, add(M, X)) -> add(M, rm(N, X))
purge(nil) -> nil
purge(add(N, X)) -> add(N, purge(rm(N, X)))

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)

There are no usable rules w.r.t. to the implicit AFS that need to be oriented.

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

resulting in one new DP problem.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳FwdInst`
`       →DP Problem 2`
`         ↳Polo`
`           →DP Problem 7`
`             ↳Dependency Graph`
`       →DP Problem 3`
`         ↳Nar`

Dependency Pair:

RM(N, add(M, X)) -> IFRM(eq(N, M), N, add(M, 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
rm(N, add(M, X)) -> ifrm(eq(N, M), N, add(M, X))
ifrm(true, N, add(M, X)) -> rm(N, X)
ifrm(false, N, add(M, X)) -> add(M, rm(N, X))
purge(nil) -> nil
purge(add(N, X)) -> add(N, purge(rm(N, X)))

Using the Dependency Graph resulted in no new DP problems.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳FwdInst`
`       →DP Problem 2`
`         ↳Polo`
`       →DP Problem 3`
`         ↳Narrowing Transformation`

Dependency Pair:

PURGE(add(N, X)) -> PURGE(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
rm(N, add(M, X)) -> ifrm(eq(N, M), N, add(M, X))
ifrm(true, N, add(M, X)) -> rm(N, X)
ifrm(false, N, add(M, X)) -> add(M, rm(N, X))
purge(nil) -> nil
purge(add(N, X)) -> add(N, purge(rm(N, X)))

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

PURGE(add(N, X)) -> PURGE(rm(N, X))
two new Dependency Pairs are created:

PURGE(add(N'', nil)) -> PURGE(nil)
PURGE(add(N'', add(M', X''))) -> PURGE(ifrm(eq(N'', M'), N'', add(M', X'')))

The transformation is resulting in one new DP problem:

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳FwdInst`
`       →DP Problem 2`
`         ↳Polo`
`       →DP Problem 3`
`         ↳Nar`
`           →DP Problem 8`
`             ↳Polynomial Ordering`

Dependency Pair:

PURGE(add(N'', add(M', X''))) -> PURGE(ifrm(eq(N'', M'), N'', add(M', 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
rm(N, add(M, X)) -> ifrm(eq(N, M), N, add(M, X))
ifrm(true, N, add(M, X)) -> rm(N, X)
ifrm(false, N, add(M, X)) -> add(M, rm(N, X))
purge(nil) -> nil
purge(add(N, X)) -> add(N, purge(rm(N, X)))

The following dependency pair can be strictly oriented:

PURGE(add(N'', add(M', X''))) -> PURGE(ifrm(eq(N'', M'), N'', add(M', X'')))

Additionally, the following usable rules w.r.t. to the implicit AFS can be oriented:

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

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

resulting in one new DP problem.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳FwdInst`
`       →DP Problem 2`
`         ↳Polo`
`       →DP Problem 3`
`         ↳Nar`
`           →DP Problem 8`
`             ↳Polo`
`             ...`
`               →DP Problem 9`
`                 ↳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
rm(N, add(M, X)) -> ifrm(eq(N, M), N, add(M, X))
ifrm(true, N, add(M, X)) -> rm(N, X)
ifrm(false, N, add(M, X)) -> add(M, rm(N, X))
purge(nil) -> nil
purge(add(N, X)) -> add(N, purge(rm(N, X)))

Using the Dependency Graph resulted in no new DP problems.

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