diff --git a/pl/sort.yap b/pl/sort.yap index f273feeb3..d4e9607f3 100644 --- a/pl/sort.yap +++ b/pl/sort.yap @@ -38,6 +38,7 @@ length(L,M) :- '$$_length2'(M,L). L = [] ; L = [_|L1], + N > 0, N1 is N - 1, '$$_length2'(N1, L1) ).