| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Counting propositions
"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).
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
![]() |
![]() |