title: Can I use variables with assert/1?
body: <p>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)</p>
  
  <pre><code>ifNotAdd(X,Y):-
      not(call(X,Y)),
      !,
      assert(X(Y)).
  </code></pre>
  
  <p>For example, let's say that this fact is in the DB</p>
  
  <pre><code>mammal(dolphin).
  </code></pre>
  
  <p>I ask 
      ifNotAdd(mammal, elephant).</p>
  
  <p>I want it to see that ? mammal(elephant). is false and then assert mammal(elephant).</p>
  
  <p>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.</p>
  
  <p><em>EDIT</em>
  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. </p>
  
  <p>In the vein of <a href="http://en.wikipedia.org/wiki/Reason_maintenance" rel="noreferrer">http://en.wikipedia.org/wiki/Reason_maintenance</a></p>
  
  <p>Cheers,</p>