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