1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Sieve of eratosthenes to compute primes
4 %% thom fruehwirth 920218-20, 980311
5 %% christian holzbaur 980207 for Sicstus CHR
7 %% ported to hProlog by Tom Schrijvers
10 :- use_module(library(chr)).
12 :- constraints candidate/1.
13 :- constraints prime/1.
16 candidate(1) <=> true.
17 candidate(N) <=> primes:prime(N), N1 is N - 1, primes:candidate(N1).
19 absorb @ prime(Y) \ prime(X) <=> 0 is X mod Y | true.
29 statistics( runtime, [Tm,_]),