better implementation of list_si/1

Per discussion in https://github.com/mthom/scryer-prolog/pull/1589.
This commit is contained in:
Markus Triska
2022-08-23 21:21:17 +02:00
committed by Mark Thom
parent 6a455d2866
commit abca5fc405

View File

@@ -43,9 +43,15 @@ integer_si(I) :-
atomic_si(AC) :-
functor(AC,_,0).
list_si(L) :-
\+ \+ length(L, _),
sort(L, _).
% list_si(L) :-
% \+ \+ length(L, _),
% sort(L, _).
list_si(L0) :-
'$skip_max_list'(_,_, L0,L),
( nonvar(L) -> L = []
; throw(error(instantiation_error, list_si/1))
).
chars_si(Cs) :-
list_si(Cs),