What I have now checks that X(Y) is not an accepted fact in my small DB. Since X(Y) returns false it will attempt to assert it. (I realize this presents problems when X is a rule and not a fact)
ifNotAdd(X,Y):-
not(call(X,Y)),
!,
assert(X(Y)).
For example, let's say that this fact is in the DB
mammal(dolphin).
I ask ifNotAdd(mammal, elephant).
I want it to see that ? mammal(elephant). is false and then assert mammal(elephant).
Obviously the "assert(X(Y))." line is wrong but what do I replace it with? I'm trawling prolog documentation and forums for the answer but no luck so far. I'm also trying to write something that will do this on my own.
EDIT I need to edit the DB in order to have a dynamic database the user can interact with. I'm building an argument machine and I need to allow the user to tell the system that they "know the fact for sure" so that the system can deal with knowledge outside of it's domain.
In the vein of http://en.wikipedia.org/wiki/Reason_maintenance
Cheers,
=../2
so that solves that. I'll clarify program above. – Insistency