Does a path, after following symlinks, refer to a directory?
(directory-p path &key (state 'state)) → (mv err ans new-state)
Function:
(defun directory-p-fn (path state) (declare (xargs :stobjs (state))) (declare (xargs :guard (stringp path))) (let ((__function__ 'directory-p)) (declare (ignorable __function__)) (b* (((mv err ans state) (file-kind path)) ((when err) (mv err nil state))) (mv err (eq ans :directory) state))))
Theorem:
(defthm booleanp-of-directory-p.ans (b* (((mv ?err ?ans ?new-state) (directory-p-fn path state))) (booleanp ans)) :rule-classes :type-prescription)
Theorem:
(defthm state-p1-of-directory-p.new-state (implies (force (state-p1 state)) (b* (((mv ?err ?ans ?new-state) (directory-p-fn path state))) (state-p1 new-state))) :rule-classes :rewrite)
Theorem:
(defthm w-state-of-directory-p (b* (((mv ?err ?ans ?new-state) (directory-p-fn path state))) (equal (w new-state) (w state))))