Final step to extract the elements from an
Signature:
In the logic, this returns
In the pure ACL2 implementation, this function is very much like nrev-copy. The underlying representation of
In the optimized implementation, we have already constructed the list in
reverse order, so we can simply return it, saving all that consing. For this
to be sound, we must simultaneously clear out
Function:
(defun nrev$a-finish (nrev$a) (declare (xargs :guard t)) (let* ((elems (list-fix nrev$a))) (mv elems nil)))
Function:
(defun nrev$c-finish (nrev$c) (declare (xargs :stobjs nrev$c)) (let* ((elems (reverse (nrev$c-acc nrev$c))) (nrev$c (update-nrev$c-acc nil nrev$c))) (mv elems nrev$c)))