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