Strip non-directory suffixes from a list of file names.
(dirnames paths &key (state 'state)) → (mv err dirnames state)
This just calls dirname on every path in a list.
Function:
(defun dirnames-fn (paths state) (declare (xargs :stobjs (state))) (declare (xargs :guard (string-listp paths))) (let ((__function__ 'dirnames)) (declare (ignorable __function__)) (b* (((when (atom paths)) (mv nil nil state)) ((mv err name1 state) (dirname (car paths))) ((when err) (mv err nil state)) ((mv err names2 state) (dirnames (cdr paths))) ((when err) (mv err nil state))) (mv nil (cons name1 names2) state))))
Theorem:
(defthm string-listp-of-dirnames.dirnames (b* (((mv ?err ?dirnames acl2::?state) (dirnames-fn paths state))) (string-listp dirnames)) :rule-classes :rewrite)
Theorem:
(defthm state-p1-of-dirnames.state (implies (force (state-p1 state)) (b* (((mv ?err ?dirnames acl2::?state) (dirnames-fn paths state))) (state-p1 state))) :rule-classes :rewrite)