Get a listing of the subdirectories of a directory.
(ls-subdirs path &key (state 'state)) → (mv error subdirs state)
The notion of regular file is governed by directory-p. It includes, for instance, symbolic links to directories.
Function:
(defun ls-subdirs-fn (path state) (declare (xargs :stobjs (state))) (declare (xargs :guard (stringp path))) (let ((__function__ 'ls-subdirs)) (declare (ignorable __function__)) (b* (((mv err all-files state) (ls path)) ((when err) (mv err nil state))) (ls-subdirs-aux path all-files state))))
Theorem:
(defthm string-listp-of-ls-subdirs.subdirs (b* (((mv common-lisp::?error ?subdirs acl2::?state) (ls-subdirs-fn path state))) (string-listp subdirs)) :rule-classes :rewrite)
Theorem:
(defthm state-p1-of-ls-subdirs.state (implies (force (state-p1 state)) (b* (((mv common-lisp::?error ?subdirs acl2::?state) (ls-subdirs-fn path state))) (state-p1 state))) :rule-classes :rewrite)