Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Counting propositions
x wrote:
> p(a).
> p(x).
> p(z).
> p(u).
>
>
> pset(0,[]).
> pset([s(0)],[X]):-p(X).
> pset([s(N),N|P],[X,Y|L]):-pset([N|P],[X|L]),pset([N|P],[Y|L]),not(X=Y).
>
>
> list(0,[]).
> list(s(N),[s(N)|L]):-list(N,L).
>
> lp(N,S):-list(N,L),pset(L,S).
>
>
> Why the lp(N,L) goal don't stop ?
Let's simplify your problem a bit:
Try understanding why the goal ?- list(N,S), N = blabla.
does not stop.
Or ?- list(N,S), S = blabla.
Once you get that, your original question will become easier for you.
Cheers
Bart Demoen Received on Tue Jun 22 2004 - 16:00:33 CDT