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)

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

Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
{nil, purge}
{eq, true}
{rm, ifrm}
{s, false}

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

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

Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
{eq, true} > false

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

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 rules can be oriented:

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

Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
eq > true
0 > false

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

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)