title: Swi-prolog breaks on order check
body: <p>I have the following code on Prolog</p>
  <pre><code>concat([], [], []).
  concat([], [H|T], [H|T2]) :- concat([], T, T2).
  concat([H|T], L2, [H|T2]) :- concat(T, L2, T2).
  
  is_ordered([]).
  is_ordered([_X]).
  is_ordered([X,Y|Tail]) :- X =&lt; Y, is_ordered([Y|Tail]).
  </code></pre>
  <p>and I try to get an example of <code>X</code> which fit <code>concat</code> and <code>is_ordered</code>.</p>
  <p>When I type</p>
  <pre><code>concat([1, 2, 3], [4, 4, 4], X)
  </code></pre>
  <p>I get result, but when I try to do the same with <code>is_ordered</code></p>
  <pre><code>is_ordered(X)
  </code></pre>
  <p>an error occurs after simple examples <code>[]</code> and <code>[_1784]</code></p>
  <pre><code>{
    &quot;code&quot;:500,
    &quot;message&quot;:&quot;Unknown error term: assertion_error(fail,pengines:event_term_to_json_data(error('583c29ce-fa49-4b06-971f-1c928260dcac',error(instantiation_error,context(prolog_stack([frame(2,call(system:(=&lt;)/2),_714=&lt;_716),frame(1,pred_line(\&quot;is_ordered/1\&quot;,'pengine://583c29ce-fa49-4b06-971f-1c928260dcac/src':31),is_ordered([_756,_762]))]),_676))),_656,'json-html'))&quot;
  }
  </code></pre>
  <p>Why could this happen?</p>