title: Dynamic rule assertion in SWI-prolog
body: <p>I am trying to add a rule dynamically to the knowledge base using SWI-prolog where the body of the rule is unknown beforehand.</p>
  <p>The desired rule looks something like this:</p>
  <pre><code>rule(a) :- fact(1), fact(2).
  </code></pre>
  <p>Normally you would simply state</p>
  <pre><code>assert((rule(a):-fact(1),fact(2))).
  </code></pre>
  <p>but the problem is that the facts are decided at runtime (the number of facts is also unknown before the assertion).</p>
  <p>That's why I would like to know whether there is a possibility to assert a rule where the body consists of a list of facts such as <code>[fact(1), fact(2)]</code>.</p>