title: Change value in Prolog
body: <p>I am new to Prolog, and I want to change the value of a variable, which is extracted from a list. Initially, the variable is <code>n</code>, then on some occasions I would like to change it to <code>a</code>. But using <code>(is)/2</code> won't work because it only operates on numbers. </p>
  
  <p>Is there an easy way to do this? Suppose my code looks something like this:</p>
  
  <pre><code>change([H|T]) :- set H to a,change(T).
  change([]).
  </code></pre>
  
  <p>Notice <code>H</code> has already been set to <code>n</code>, so the goal <code>H = a</code> fails because <code>n</code> and <code>a</code> cannot be unified.</p>