Re: Counting propositions

From: bart demoen <bmd_at_cs.kuleuven.ac.be>
Date: Tue, 22 Jun 2004 23:00:33 +0200
Message-ID: <1087937883.848321_at_seven.kulnet.kuleuven.ac.be>


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 - 23:00:33 CEST

Original text of this message