Return true if the given translation directory (1) includes both model.sao and model.sao.ver files, and (2) the model is compatible with this version of VL.
(vl-looks-like-legitimate-tname-p x state) → (mv legitp state)
Function:
(defun vl-looks-like-legitimate-tname-p (x state) (declare (xargs :stobjs (state))) (declare (xargs :guard (vl-tname-p x))) (let ((__function__ 'vl-looks-like-legitimate-tname-p)) (declare (ignorable __function__)) (b* ((tdir (vl-tname-dir x)) ((mv err files state) (oslib::ls-files tdir)) ((when err) (cw "; NOTE: Error listing ~x0: ~@1~%" tdir err) (mv nil state)) ((unless (and (member-equal "model.sao" files) (member-equal "model.sao.ver" files))) (mv nil state)) (verfile (oslib::catpath tdir "model.sao.ver")) ((mv ver state) (acl2::read-file-as-string verfile state)) ((unless ver) (mv nil state)) (found (str::trim ver)) (expect (str::trim *vl-current-syntax-version*)) ((unless (equal found expect)) (mv nil state))) (mv t state))))
Theorem:
(defthm booleanp-of-vl-looks-like-legitimate-tname-p.legitp (b* (((mv ?legitp acl2::?state) (vl-looks-like-legitimate-tname-p x state))) (booleanp legitp)) :rule-classes :type-prescription)
Theorem:
(defthm state-p1-of-vl-looks-like-legitimate-tname-p.state (implies (force (state-p1 state)) (b* (((mv ?legitp acl2::?state) (vl-looks-like-legitimate-tname-p x state))) (state-p1 state))) :rule-classes :rewrite)