title: How can I use assert in Prolog
body: <p>I want to use <code>assert</code> because in Prolog we cannot assign values to variable twice using <code>is</code>. So how can I do that? Below is what I want to implement-how can I add <code>assert</code> in that code?</p>
  
  <pre><code>main:-
    X1 is 3,
    X2 is 3,
    A is 1,
   ( X1=X2 -&gt; A is 2 , write(A)
   ; X1=X3 -&gt; A is 3 , write(A)
   ).
  </code></pre>
  
  <p>I want to update the value of A in the if clause.How can I do it using <code>assert</code>?</p>