Singleton variable in branch
FERNANDO SAENZ PEREZ <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <CAMDa7mv1kgTb9kZUM4x9CyXJBvD70XWKWL0tueGvQxp+EdxtPA@mail.gmail.com> |
Hello,
Given the following system session in SWI-Prolog 6.6.1 (Windows, stable
version):
%%%%%%%%%%%%%%%%%%%%%%
Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 6.6.1)
Copyright (c) 1990-2013 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.
For help, use ?- help(Topic). or ?- apropos(Word).
1 ?- [p].
Warning: c:/fernan/research/bddeduc/des/des3.3.3/p.dl:1:
Singleton variable in branch: B
% p.dl compiled 0.00 sec, 2 clauses
true.
2 ?- listing.
:- thread_local thread_message_hook/3.
:- dynamic thread_message_hook/3.
:- volatile thread_message_hook/3.
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?
In addition, it is said that 2 clauses have been compiled. Is it so? The
source file includes the very same clause as listed.
All the best,
Fernando
-------------- next part --------------
HTML attachment scrubbed and removed