users-prolog
[Top][All Lists]
Advanced

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

discontinuous predicate warning from gnuprolog v1.3.0


From: Bernardo Elayda
Subject: discontinuous predicate warning from gnuprolog v1.3.0
Date: Sun, 15 Mar 2009 18:07:42 -0700

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
 

reply via email to

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