Term Rewriting System R:
[y, x, u, z]
minus(0, y) -> 0
minus(s(x), 0) -> s(x)
minus(s(x), s(y)) -> minus(x, y)
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
if(true, x, y) -> x
if(false, x, y) -> y
perfectp(0) -> false
perfectp(s(x)) -> f(x, s(0), s(x), s(x))
f(0, y, 0, u) -> true
f(0, y, s(z), u) -> false
f(s(x), 0, z, u) -> f(x, u, minus(z, s(x)), u)
f(s(x), s(y), z, u) -> if(le(x, y), f(s(x), minus(y, x), z, u), f(x, u, z, u))

Termination of R to be shown.

`   R`
`     ↳Dependency Pair Analysis`

R contains the following Dependency Pairs:

MINUS(s(x), s(y)) -> MINUS(x, y)
LE(s(x), s(y)) -> LE(x, y)
PERFECTP(s(x)) -> F(x, s(0), s(x), s(x))
F(s(x), 0, z, u) -> F(x, u, minus(z, s(x)), u)
F(s(x), 0, z, u) -> MINUS(z, s(x))
F(s(x), s(y), z, u) -> IF(le(x, y), f(s(x), minus(y, x), z, u), f(x, u, z, u))
F(s(x), s(y), z, u) -> LE(x, y)
F(s(x), s(y), z, u) -> F(s(x), minus(y, x), z, u)
F(s(x), s(y), z, u) -> MINUS(y, x)
F(s(x), s(y), z, u) -> F(x, u, z, u)

Furthermore, R contains three SCCs.

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

Dependency Pair:

MINUS(s(x), s(y)) -> MINUS(x, y)

Rules:

minus(0, y) -> 0
minus(s(x), 0) -> s(x)
minus(s(x), s(y)) -> minus(x, y)
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
if(true, x, y) -> x
if(false, x, y) -> y
perfectp(0) -> false
perfectp(s(x)) -> f(x, s(0), s(x), s(x))
f(0, y, 0, u) -> true
f(0, y, s(z), u) -> false
f(s(x), 0, z, u) -> f(x, u, minus(z, s(x)), u)
f(s(x), s(y), z, u) -> if(le(x, y), f(s(x), minus(y, x), z, u), f(x, u, z, u))

The following dependency pair can be strictly oriented:

MINUS(s(x), s(y)) -> MINUS(x, y)

There are no usable rules using the Ce-refinement that need to be oriented.
Used ordering: Homeomorphic Embedding Order with EMB
resulting in one new DP problem.
Used Argument Filtering System:
MINUS(x1, x2) -> MINUS(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:

minus(0, y) -> 0
minus(s(x), 0) -> s(x)
minus(s(x), s(y)) -> minus(x, y)
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
if(true, x, y) -> x
if(false, x, y) -> y
perfectp(0) -> false
perfectp(s(x)) -> f(x, s(0), s(x), s(x))
f(0, y, 0, u) -> true
f(0, y, s(z), u) -> false
f(s(x), 0, z, u) -> f(x, u, minus(z, s(x)), u)
f(s(x), s(y), z, u) -> if(le(x, y), f(s(x), minus(y, x), z, u), f(x, u, z, u))

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 Pair:

LE(s(x), s(y)) -> LE(x, y)

Rules:

minus(0, y) -> 0
minus(s(x), 0) -> s(x)
minus(s(x), s(y)) -> minus(x, y)
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
if(true, x, y) -> x
if(false, x, y) -> y
perfectp(0) -> false
perfectp(s(x)) -> f(x, s(0), s(x), s(x))
f(0, y, 0, u) -> true
f(0, y, s(z), u) -> false
f(s(x), 0, z, u) -> f(x, u, minus(z, s(x)), u)
f(s(x), s(y), z, u) -> if(le(x, y), f(s(x), minus(y, x), z, u), f(x, u, z, u))

The following dependency pair can be strictly oriented:

LE(s(x), s(y)) -> LE(x, y)

There are no usable rules using the Ce-refinement that need to be oriented.
Used ordering: Homeomorphic Embedding Order with EMB
resulting in one new DP problem.
Used Argument Filtering System:
LE(x1, x2) -> LE(x1, x2)
s(x1) -> s(x1)

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

Dependency Pair:

Rules:

minus(0, y) -> 0
minus(s(x), 0) -> s(x)
minus(s(x), s(y)) -> minus(x, y)
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
if(true, x, y) -> x
if(false, x, y) -> y
perfectp(0) -> false
perfectp(s(x)) -> f(x, s(0), s(x), s(x))
f(0, y, 0, u) -> true
f(0, y, s(z), u) -> false
f(s(x), 0, z, u) -> f(x, u, minus(z, s(x)), u)
f(s(x), s(y), z, u) -> if(le(x, y), f(s(x), minus(y, x), z, u), f(x, u, z, u))

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 Pairs:

F(s(x), s(y), z, u) -> F(x, u, z, u)
F(s(x), 0, z, u) -> F(x, u, minus(z, s(x)), u)
F(s(x), s(y), z, u) -> F(s(x), minus(y, x), z, u)

Rules:

minus(0, y) -> 0
minus(s(x), 0) -> s(x)
minus(s(x), s(y)) -> minus(x, y)
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
if(true, x, y) -> x
if(false, x, y) -> y
perfectp(0) -> false
perfectp(s(x)) -> f(x, s(0), s(x), s(x))
f(0, y, 0, u) -> true
f(0, y, s(z), u) -> false
f(s(x), 0, z, u) -> f(x, u, minus(z, s(x)), u)
f(s(x), s(y), z, u) -> if(le(x, y), f(s(x), minus(y, x), z, u), f(x, u, z, u))

The following dependency pairs can be strictly oriented:

F(s(x), s(y), z, u) -> F(x, u, z, u)
F(s(x), 0, z, u) -> F(x, u, minus(z, s(x)), u)

The following usable rules using the Ce-refinement can be oriented:

minus(0, y) -> 0
minus(s(x), 0) -> s(x)
minus(s(x), s(y)) -> minus(x, y)

Used ordering: Homeomorphic Embedding Order with EMB
resulting in one new DP problem.
Used Argument Filtering System:
F(x1, x2, x3, x4) -> x1
s(x1) -> s(x1)
minus(x1, x2) -> minus(x1, x2)

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

Dependency Pair:

F(s(x), s(y), z, u) -> F(s(x), minus(y, x), z, u)

Rules:

minus(0, y) -> 0
minus(s(x), 0) -> s(x)
minus(s(x), s(y)) -> minus(x, y)
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
if(true, x, y) -> x
if(false, x, y) -> y
perfectp(0) -> false
perfectp(s(x)) -> f(x, s(0), s(x), s(x))
f(0, y, 0, u) -> true
f(0, y, s(z), u) -> false
f(s(x), 0, z, u) -> f(x, u, minus(z, s(x)), u)
f(s(x), s(y), z, u) -> if(le(x, y), f(s(x), minus(y, x), z, u), f(x, u, z, u))

The following dependency pair can be strictly oriented:

F(s(x), s(y), z, u) -> F(s(x), minus(y, x), z, u)

The following usable rules using the Ce-refinement can be oriented:

minus(0, y) -> 0
minus(s(x), 0) -> s(x)
minus(s(x), s(y)) -> minus(x, y)

Used ordering: Homeomorphic Embedding Order with EMB
resulting in one new DP problem.
Used Argument Filtering System:
F(x1, x2, x3, x4) -> F(x1, x2, x3, x4)
s(x1) -> s(x1)
minus(x1, x2) -> x1

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

Dependency Pair:

Rules:

minus(0, y) -> 0
minus(s(x), 0) -> s(x)
minus(s(x), s(y)) -> minus(x, y)
le(0, y) -> true
le(s(x), 0) -> false
le(s(x), s(y)) -> le(x, y)
if(true, x, y) -> x
if(false, x, y) -> y
perfectp(0) -> false
perfectp(s(x)) -> f(x, s(0), s(x), s(x))
f(0, y, 0, u) -> true
f(0, y, s(z), u) -> false
f(s(x), 0, z, u) -> f(x, u, minus(z, s(x)), u)
f(s(x), s(y), z, u) -> if(le(x, y), f(s(x), minus(y, x), z, u), f(x, u, z, u))

Using the Dependency Graph resulted in no new DP problems.

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