Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Counting propositions

Re: Counting propositions

From: x <x-false_at_yahoo.com>
Date: Fri, 18 Jun 2004 15:57:46 +0300
Message-ID: <40d2e5cc$1@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).

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Received on Fri Jun 18 2004 - 07:57:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US