title: Prolog - first list is sublist of second list?
body: <p>For example:</p>
  
  <pre><code>isin([1,2,3], [1,0,1,2,3,0])
  </code></pre>
  
  <p>will yield true because <code>123</code> is inside of <code>101230</code></p>
  
  <p>I wrote the following code:</p>
  
  <pre><code>isin([AH|AT],[AH|AT]).
  
  isin([AH|AT],[BH|BT]):- AH = BH, isin(AT,BT),isin([AH|AT],BT).
  </code></pre>
  
  <p>seems not working. Try not use any built-in functions and BTW, Prolog has a built-in <code>sublist(L1,L2)</code> function.</p>
  
  <p>How do I write a query against a built-in function using SWI-Prolog? I tried to directly write</p>
  
  <pre><code>?- sublist([1],[2]).
  </code></pre>
  
  <p>but it gives me <code>underfined procedure</code> error.</p>
  
  <p>Is it possible to see how a built-in function is coded? How?</p>