I am wondering if perhaps someone would be willing to help me with a problem that I am having with some code that I have written in propositional Prolog. The program is as follows:
:- dynamic superman/0,ironman/0,greenlantern/0,ironmanflies/0,
supermanflies/0,greenlanternflies/0,superheronironman/0,superherosuperman/0,
superherogreenlantern/0,abnormalsuperman/0,abnormalgreenlantern/0,
abnormalironman/0,specialabnormalironman/0,usesIronmanSuit.
ironmanflies:- superheroironman, \+ abnormalironman.
supermanflies:- superherosuperman, \+ abnormalsuperman.
greenlanternflies:- superherogreenlantern, \+ abnormalgreenlantern.
\+ abnormalironman:- specialabnormalironman.
abnormalironman:- \+ specialabnormalironman.
specialabnormalironman:- usesIronmanSuit.
superheroironman:- ironman.
superherosuperman:- superman.
superherogreenlantern:- greenlantern.
superman.
When I attempt to compile it in SWI Prolog, I get the following error:
ERROR: /home/justin/COMP5307/Assignments/assig2/a2q1e1.pl:6:
No permission to modify static procedure `(\+)/1'
Defined at /usr/lib/swi-prolog/boot/init.pl:337
What I am aiming to do is to express the line
\+ abnormalironman:- specialabnormalironman.
in correct syntax. I have seen some examples of possible ways to introduce a negation operator in the consequent, but those were user-defined approaches, and I would feel more comfortable using a built in method. The Prolog documentation is rather vague on this topic, so I would appreciate any help that anyone might be willing to provide.
For those reading this question for the first time, it originally pertained to an insufficient instantiation error which was found to be the result of the first letter of the filename being uppercase. For those using SWI Prolog for the first time, file names should have their first letter in lower case to avoid this error.