Get a (full) directory listing.
(ls path &key (state 'state)) → (mv error val state)
In the logic this function reads from the ACL2 oracle. In the
execution we query the file system to obtain a listing of the files within the
given
The names returned are not complete paths. For instance, if
Function:
(defun ls-fn (path state) (declare (xargs :stobjs (state))) (declare (xargs :guard (stringp path))) (let ((__function__ 'ls)) (declare (ignorable __function__)) (b* ((- (raise "Raw Lisp definition not installed?")) ((mv ?err1 val1 state) (read-acl2-oracle state)) ((mv ?err2 val2 state) (read-acl2-oracle state)) ((when val1) (mv val1 nil state))) (mv nil (remove-nonstrings val2) state))))
Theorem:
(defthm string-listp-of-ls.val (b* (((mv common-lisp::?error ?val acl2::?state) (ls-fn path state))) (string-listp val)) :rule-classes :rewrite)
Theorem:
(defthm state-p1-of-ls.state (implies (force (state-p1 state)) (b* (((mv common-lisp::?error ?val acl2::?state) (ls-fn path state))) (state-p1 state))) :rule-classes :rewrite)