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: Polynomial ordering with Polynomial interpretation:
 POL(EQ(x1, x2)) =  x1 + x2 POL(eq(x1, x2)) =  x1 + x2 POL(0) =  0 POL(false) =  0 POL(true) =  0 POL(nil) =  0 POL(ifrm(x1, x2)) =  x1 + x2 POL(s(x1)) =  1 + x1 POL(rm(x1, x2)) =  x1 + x2 POL(purge) =  0

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: Polynomial ordering with Polynomial interpretation:
 POL(IFRM(x1, x2, x3)) =  x1 + x2 + x3 POL(eq) =  0 POL(false) =  0 POL(true) =  0 POL(nil) =  0 POL(purge(x1)) =  x1 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
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: Polynomial ordering with Polynomial interpretation:
 POL(PURGE(x1)) =  x1 POL(eq(x1, x2)) =  x1 + x2 POL(0) =  0 POL(false) =  0 POL(nil) =  0 POL(true) =  0 POL(s(x1)) =  x1 POL(purge(x1)) =  x1 POL(add(x1, x2)) =  1 + x1 + x2

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)
purge(nil) -> nil

Using the Dependency Graph resulted in no new DP problems.

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