Error and warning messages from programming systems like SWI Prolog tell you that there is (or may be) a problem, but they can be a little cryptic in terms of telling you what the problem is. The following table is intended to demystify the messages.
|Usually infinite recursion. Look at your recursive rules and ensure that there is some provision to stop the recursion from going on for ever.|
Warning: (test.pl:1): Singleton variables: [Cihld]
|Means that in the program file |
In this case, you can get rid of the warning message by putting an underscore in front of the singleton variable:
Warning: (thing.pl:3:31): Redefined static procedure rich/1
|means that |
Warning: (/Users/billw/or.pl:6): Clauses of rich/1 are not together in the source-file
ERROR: /Users/billw/thing.pl:1: No permission to redefine built-in predicate `assert/1' Use :- redefine_system_predicate(+Head) if redefinition is intended
|This means that you have tried to redefine a system predicate.
It is usually a very bad idea to redefine a system predicate, as it
means that any other code that calls the system predicate may end
up using your definition, which might be entirely inappropriate.
It is usually better to think of another name for your predicate:
If you absolutely have to use the name reserved for the system predicate for some very good reason, you can do this by inserting the directive
:- redefine_system_predicate(assert/1).before the point where you begin to redefine the system predicate.
ERROR: /import/diskname/1/yourlogin/filename.pl:6: source_sink `nlp-basis.pro' does not exist Warning: /import/diskname/1/yourlogin/filename.pl:6: Goal (directive) failed: user:[nlp-basis.pro]
|This is telling you something like the following: you tried to use
a directive like |
ERROR: /import/kamen/1/billw/filename.pl:12:0: Syntax error: Unexpected end of file
|This says that, from the point of view of the Prolog system, your code stopped abruptly at line 12, without completing the rule or fact that it was half-way through. This might be exactly what has happened, or it might be that some syntax error in your code has caused Prolog to get confused about what you are trying to do.|
ERROR: /import/kamen/1/billw/filename.pl:92:0: Syntax error: Unexpected end of clause
|This says that, from the point of view of the Prolog system, your code stopped abruptly at line 92, partway through a clause. This is similar to the previous message, but Prolog had passed the start of a clause when the problem occurred.|
ERROR: /import/kamen/1/billw/filename.pl:41: Full stop in clause-body? Cannot redefine ,/2
|Likely to occur with other messages, e.g. singleton variable
warnings. Probably means you have a punctuation error in a rule,
something like this:
likes(Person1, Person2) :- friendly(Person1). shared_interests(Person1, Person2), pleasant(Person2).There should be a comma, not a full stop, at the end of the first line.
ERROR: predname/1: Arguments are not sufficiently instantiated
ERROR: predname/1: Type error: `character' expected, found `abc'
I plan to add to the table as I encounter more such messages. Suggestions welcome, please send a cut-and-paste of the message, the dialogue with SWI Prolog that generated it, and the Prolog code as an attachment. This is not a free debugging service, but I'll try to include such examples in this list.
Bill Wilson's contact info
UNSW's CRICOS Provider No. is 00098G