Corrected a bug in the definition of predicate length/2 when the second argument is a negative number.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1710 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
9c506b2a2c
commit
297d94b096
@ -38,6 +38,7 @@ length(L,M) :- '$$_length2'(M,L).
|
||||
L = []
|
||||
;
|
||||
L = [_|L1],
|
||||
N > 0,
|
||||
N1 is N - 1,
|
||||
'$$_length2'(N1, L1)
|
||||
).
|
||||
|
Reference in New Issue
Block a user