Patrick Lühne
2245e139b2
This is a reimplementation of the integer variable detection procedure. The idea is to iteratively assume variables to be noninteger, and to prove that this would lead to a false or erroneous result. If the proof is successful, the variable is integer as a consequence.
6 lines
121 B
Plaintext
6 lines
121 B
Plaintext
#show prime/1.
|
|
#external integer(n(0)).
|
|
|
|
composite(I * J) :- I = 2..n, J = 2..n.
|
|
prime(N) :- N = 2..n, not composite(N).
|