title: How to append list to a list in Prolog?
body: <p>I want to append a list to a list.</p>
  
  <pre><code>foo([a,b,c]).
  goo([d,e,f]).
  hi(X):-append(foo(X),goo(X)).
  </code></pre>
  
  <p>I want to get the result as shown below. But I realized I cannot execute <code>foo(X)</code> and <code>goo(X)</code>.</p>
  
  <pre><code>?- hi(X).
  |: [a,b,c,d,e,f].
  </code></pre>