title: Prolog shift or rotate elements left
body: <p>I need a relation in prolog to shift list left rotationally by one element such that</p>
  
  <pre><code>shift([a,b,c,d,e,f,g,h],3,Shifted).
  </code></pre>
  
  <p>should produce</p>
  
  <pre><code>Shifted = [d,e,f,g,h,a,b,c]
  </code></pre>
  
  <p>could you help me?</p>
  
  <p>this what I have </p>
  
  <pre><code>shift([], []).
  shift([H|T], L) :-
     append(T, [H], L).
  
  shift(0, L, L) :- !.
  shift(N, L1, L2) :-
     N1 is N-1,
     shift(L1, L),
     shift(N1, L, L2).
  </code></pre>