Add example program for prime number detection

This commit is contained in:
Patrick Lühne 2018-04-11 21:42:08 +02:00
parent 797660d6de
commit a01e78a467
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

4
examples/prime.lp Normal file
View File

@ -0,0 +1,4 @@
#show prime/1.
composite(I * J) :- I = 2..n, J = 2..n.
prime(N) :- N = 2..n, not composite(N).