List resizer in support of stobjs
Function:
(defun resize-list-exec (lst n default-value acc) (declare (xargs :guard (true-listp acc))) (if (and (integerp n) (> n 0)) (resize-list-exec (if (atom lst) lst (cdr lst)) (1- n) default-value (cons (if (atom lst) default-value (car lst)) acc)) (reverse acc)))
Function:
(defun resize-list (lst n default-value) (declare (xargs :guard t)) (mbe :logic (if (and (integerp n) (> n 0)) (cons (if (atom lst) default-value (car lst)) (resize-list (if (atom lst) lst (cdr lst)) (1- n) default-value)) nil) :exec (resize-list-exec lst n default-value nil)))