Term Rewriting System R:
[x, y]
prime(0) -> false
prime(s(0)) -> false
prime(s(s(x))) -> prime1(s(s(x)), s(x))
prime1(x, 0) -> false
prime1(x, s(0)) -> true
prime1(x, s(s(y))) -> and(not(divp(s(s(y)), x)), prime1(x, s(y)))
divp(x, y) -> =(rem(x, y), 0)

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

PRIME(s(s(x))) -> PRIME1(s(s(x)), s(x))
PRIME1(x, s(s(y))) -> DIVP(s(s(y)), x)
PRIME1(x, s(s(y))) -> PRIME1(x, s(y))

Furthermore, R contains one SCC.


   R
DPs
       →DP Problem 1
Argument Filtering and Ordering


Dependency Pair:

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


Rules:


prime(0) -> false
prime(s(0)) -> false
prime(s(s(x))) -> prime1(s(s(x)), s(x))
prime1(x, 0) -> false
prime1(x, s(0)) -> true
prime1(x, s(s(y))) -> and(not(divp(s(s(y)), x)), prime1(x, s(y)))
divp(x, y) -> =(rem(x, y), 0)





The following dependency pair can be strictly oriented:

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


The following rules can be oriented:

prime(0) -> false
prime(s(0)) -> false
prime(s(s(x))) -> prime1(s(s(x)), s(x))
prime1(x, 0) -> false
prime1(x, s(0)) -> true
prime1(x, s(s(y))) -> and(not(divp(s(s(y)), x)), prime1(x, s(y)))
divp(x, y) -> =(rem(x, y), 0)


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(and(x1, x2))=  x1 + x2  
  POL(0)=  0  
  POL(false)=  0  
  POL(PRIME1(x1, x2))=  1 + x1 + x2  
  POL(=(x1, x2))=  x1 + x2  
  POL(divp)=  0  
  POL(true)=  0  
  POL(s(x1))=  1 + x1  
  POL(rem)=  0  
  POL(prime(x1))=  x1  
  POL(not(x1))=  x1  

resulting in one new DP problem.
Used Argument Filtering System:
PRIME1(x1, x2) -> PRIME1(x1, x2)
s(x1) -> s(x1)
prime(x1) -> prime(x1)
prime1(x1, x2) -> x1
and(x1, x2) -> and(x1, x2)
not(x1) -> not(x1)
divp(x1, x2) -> divp
=(x1, x2) -> =(x1, x2)
rem(x1, x2) -> rem


   R
DPs
       →DP Problem 1
AFS
           →DP Problem 2
Dependency Graph


Dependency Pair:


Rules:


prime(0) -> false
prime(s(0)) -> false
prime(s(s(x))) -> prime1(s(s(x)), s(x))
prime1(x, 0) -> false
prime1(x, s(0)) -> true
prime1(x, s(s(y))) -> and(not(divp(s(s(y)), x)), prime1(x, s(y)))
divp(x, y) -> =(rem(x, y), 0)





Using the Dependency Graph resulted in no new DP problems.

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