Taking from an element in a list prolog
<p>Say I have a list</p>

<pre><code>[5,4,6,9]
</code></pre>

<p>And I want to take away from the head of the list but return the rest of the list</p>

<p>so: -3</p>

<pre><code>[2,4,6,9]
</code></pre>

<p>-2</p>

<pre><code>[3,4,6,9]
</code></pre>

<p>And then I want to move on to the next element so,</p>

<p>-3</p>

<pre><code>[5,1,6,9],
</code></pre>

<p>-2</p>

<pre><code>[5,2,6,9]
</code></pre>

<p>How could I produce a prolog predicate for this,</p>

<p>so far I have</p>

<pre><code> change([],[]).
change([Head|Tail], [Head1|Tail]):-
    process(Head, Head1).


process([],[]).
process(Head, Head1):-
    Head1 is Head-3,
    Head1 &gt;=0.

process(Head, Head1):-
    Head1 is Head-2,
    Head1 &gt;=0.
</code></pre>

<p>I'm unsure what I'd return in my recursive call,
any help would be great thank you</p>