Re: problem with anonymous variables



thank you for all your guys' reply. actually i wanted to distinguish a
non-anonymous variable, eg. A,B,..., from an anonymous variable,eg, _.
However i realized that it is unable to make it according to how prolog
works. i am trying to walk around this problem

Anders Lindén wrote:
> Ok, here is an attempt
>
> shrink([],[]).
> shrink([A|B],C):- var(A),!, shrink(B,C).
> shrink([A|B],[A|C]):- nonvar(A), shrink(B,C).
>
>
> | ?- shrink([4,5,B,d(r,e)],C).
> C = [4,5,d(r,e)] ? ;
> no

.