Re: Singleton variable in branch

Feliks Kluzniak <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On Dec 16, 2013, at 16:58, FERNANDO SAENZ PEREZ <[email protected]> wrote:

> p(A) :-
>        (   functor(A, _, B)
>        ->  (   foo(B)
>            ->  foo(B)
>            ;   foo(B)
>            )
>        ;   foo(B)
>        ).
> true.
> 
> %%%%%%%%%%%%%%%%%%%%%%
> 
> I do not understand the warning. I think that B is used in all branches,
> isn't it?


It seems to me that if the functor/3 fails, then the B in the last branch is indeed a singleton.  Am I missing something?

Regards,
— Feliks
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.