Collect directories for ls-subdirs.
(ls-subdirs-aux path names state) → (mv error subdirs state)
Function:
(defun ls-subdirs-aux (path names state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (stringp path) (string-listp names)))) (let ((__function__ 'ls-subdirs-aux)) (declare (ignorable __function__)) (b* (((when (atom names)) (mv nil nil state)) (name1 (acl2::str-fix (car names))) (path1 (catpath path name1)) ((mv err1 directory-p state) (directory-p path1)) ((when err1) (mv err1 nil state)) ((unless directory-p) (ls-subdirs-aux path (cdr names) state)) ((mv err2 rest state) (ls-subdirs-aux path (cdr names) state)) ((when err2) (mv err2 nil state))) (mv nil (cons name1 rest) state))))
Theorem:
(defthm string-listp-of-ls-subdirs-aux.subdirs (b* (((mv common-lisp::?error ?subdirs acl2::?state) (ls-subdirs-aux path names state))) (string-listp subdirs)) :rule-classes :rewrite)
Theorem:
(defthm state-p1-of-ls-subdirs-aux.state (implies (force (state-p1 state)) (b* (((mv common-lisp::?error ?subdirs acl2::?state) (ls-subdirs-aux path names state))) (state-p1 state))) :rule-classes :rewrite)