Ray Richards noticed that there are several different definitions of
firstn
in the distributed books:
books/bdd/bdd-primitives.lisp
books/data-structures/list-defuns.lisp
books/misc/csort.lisp
books/ordinals/ordinal-definitions.lisp
ACL2 will thus complain if you try to include two or more of the above books.
You can fix the problem by modifying the definition of firstn
in
each of these books to be as follows:
(defun firstn (n l)
"The sublist of L consisting of its first N elements."
(declare (xargs :guard (and (true-listp l)
(integerp n)
(<= 0 n))))
(cond ((endp l) nil)
((zp n) nil)
(t (cons (car l)
(firstn (1- n) (cdr l))))))