title: Prolog - add to each lists element
body: <p>I'm learning swi Prolog and I wanted to create predicate that adds +2 for each element.</p>
  
  <p>So I wrote something like this:</p>
  
  <pre><code>addUp([],_).
  addUp([H|T],R):-addUp(T,R),is_list(R)-&gt;append([H+2],R,R);R=[H+2|[]].
  
  addUp([1,2],X).
  </code></pre>
  
  <p>But it always returns false. Why?</p>