title: Splitting a list into two lists equal in length in Prolog
body: <p>I am writing a predicate in Prolog to divide a list into two equal in length lists. For example : </p>
  
  <pre><code>div([1,2,3,4] , X , Y).
  X = [1,2].
  Y = [3,4].
  </code></pre>
  
  <p>That's my code but it's not working :</p>
  
  <pre><code>div(L , L1 , L):- length(L) == length(L1).
  div([ H | T ] , [ H | T1] , L2):- div(T , T1 , L2).
  </code></pre>