Re: problem with anonymous variables
- From: ouyang.jie@xxxxxxxxx
- Date: 31 May 2005 08:59:41 -0700
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
.
- References:
- problem with anonymous variables
- From: ouyang . jie
- Re: problem with anonymous variables
- From: Anders Lindén
- problem with anonymous variables
- Prev by Date: Re: Problem with SWI-Prolog
- Next by Date: Re: Problem with SWI-Prolog
- Previous by thread: Re: problem with anonymous variables
- Next by thread: Problem with SWI-Prolog
- Index(es):