Prolog


PART VII - Primes

<< Previous  Main  Next >>

Example #1: Primes

factor[X,Y]:-num[K]*eval[Y==X*K].
not_prime[X]:-num[Y]*factor[Y,X]*eval[(Y!=1)&&(Y!=X)].
prime[X]:-num[X]*~not_prime[X].
num[1].
num[2].
num[3].
num[4].
num[5].
num[6].

Resolution Trace for Example #1:

<Under Construction>

<< Previous  Main  Next >>

Next: EOF (aka no more)


Questions? Comments? Send them here. Or return to deXXed.