title: How to create global variable in prolog
body: <p>I have a list that I create as follows:</p>
  
  <pre><code>tab([(top,left),(top,middle),(top,right),(center,left),(center,middle),
       (center,right),(bottom,left),(bottom,middle),(bottom,right)]).
  </code></pre>
  
  <p>I wish to create a global variable AllPosition that is a tab. So I did the following:</p>
  
  <pre><code>tab(AllPos).
  </code></pre>
  
  <p>Is this right? </p>
  
  <p>Then I have to follow problem:
  I have a function that receives one of the pair in tab. That I wish to remove. So I did this: </p>
  
  <pre><code>place(Line, Column, Tab) :-
  AllPos \== [_,_] /*while AllPos isn't empty - not sur if this is done this way*/ -&gt; (member((Line,Column), AllPos) -&gt; (erase(AllPos, (Line,Column), AllPos)).
  </code></pre>
  
  <p>where <code>erase(List, Element, NewList)</code> erases the element Element from List and creates a new list NewList equal to List but without Element. Both functions <code>member</code> and <code>erase</code> are working.</p>
  
  <p>The thing is... As you might have noticed I use <code>AllPos</code>everywhere. That's because I want to, I want to modify it so I can use it later (after having removed some elements from it), in another function. Is my logic right? Will I be able to use modified AllPos in another function? 
  Thanks</p>