improve '$skip_max_list'/4 and length/2 (#1023, #110)

This commit is contained in:
Mark Thom
2022-01-29 00:57:39 -07:00
parent b3006f6fd8
commit 0d653a2ce6
9 changed files with 146 additions and 121 deletions

View File

@@ -80,7 +80,7 @@ character(C) :-
atom_length(C, 1).
ilist(Ls) :-
'$skip_max_list'(_, -1, Ls, Rs),
'$skip_max_list'(_, _, Ls, Rs),
( var(Rs) ->
instantiation_error(must_be/2)
; Rs == []
@@ -124,7 +124,7 @@ can_(list, Term) :- list_or_partial_list(Term).
can_(boolean, Term) :- boolean(Term).
list_or_partial_list(Ls) :-
'$skip_max_list'(_, -1, Ls, Rs),
'$skip_max_list'(_, _, Ls, Rs),
( var(Rs) -> true
; Rs == []
).