Re: Counting propositions
From: x <x-false_at_yahoo.com>
Date: Fri, 18 Jun 2004 15:57:46 +0300
Message-ID: <40d2e5cc$1_at_post.usenet.com>
Date: Fri, 18 Jun 2004 15:57:46 +0300
Message-ID: <40d2e5cc$1_at_post.usenet.com>
- Post for FREE via your newsreader at post.usenet.com ****
"Bart Demoen" <bmd_at_cs.kuleuven.ac.be> wrote in message news:1087559272.660474_at_seven.kulnet.kuleuven.ac.be...
> Is the following "pure" enough for you ?
No, It isn't.
> numberofs(N) :- alls(L,[]), length(L,N).
>
> alls(L,In) :-
> (p(X), not(member(X,In)) ->
> alls(L,[X|In])
> ;
> L = In
> ).
>
It is similar to:
p(1). p(2). p(3).
s(X):-r(X,[]).
r(R,L):-q(X,L),!,r(R,[X|L]).
r(L,L).
q(X,L):-p(X), not(member(X,L)).
member(X,[X|_]).
member(X,[_|L]):-member(X,L).
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Usenet.com - The #1 Usenet Newsgroup Service on The Planet! *** http://www.usenet.com Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=