users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: discontinuous predicate warning from gnuprolog v1.3.0


From: Daniel Diaz
Subject: Re: discontinuous predicate warning from gnuprolog v1.3.0
Date: Tue, 17 Mar 2009 09:28:51 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Add to your prolog fial a directive

:- discontiguous(listensToMusic/1).

before the first clause.

Daniel

Bernardo Elayda a écrit :
Hello,
 
I'm trying to use this very simple Prolog testcase with Gnu Prolog v1.3.0:
 
     1 listensToMusic(mia).
     2 happy(yolanda).
     3 playsAirGuitar(mia) :- listensToMusic(mia).
     4 playsAirGuitar(yolanda) :- listensToMusic(yolanda).
     5 listensToMusic(yolanda):- happy(yolanda).
 
When the above code is loaded(w/o the line numbers), the interpreter says:
 
| ?- [kb2].
compiling /home/captain/Junk/kb2.pl for byte code...
/home/captain/Junk/kb2.pl:5: warning: discontiguous predicate listensToMusic/1 - clause ignored
/home/captain/Junk/kb2.pl compiled, 5 lines read - 729 bytes written, 6 ms
 
And if one runs the query playsAirGuitar(yolanda), the knowledge base did ignore clause number 5.  What is wrong with line number 5?
This same testcase with other versions of Prolog is processed correctly; clause number 5 isn't ignored.
 
tia,
Bernie
 

--
Ce message a été vérifié par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a été trouvé.

_______________________________________________ Users-prolog mailing list address@hidden http://lists.gnu.org/mailman/listinfo/users-prolog


--
Ce message a été vérifié par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a été trouvé.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]