Match
(vl-match-latchbody-form2 x) → (mv test lhs rhs delay)
Function:
(defun vl-match-latchbody-form2 (x) (declare (xargs :guard (vl-stmt-p x))) (let ((__function__ 'vl-match-latchbody-form2)) (declare (ignorable __function__)) (b* (((unless (vl-ifstmt-p x)) (mv nil nil nil nil)) ((vl-ifstmt x) x) ((unless (and (vl-nullstmt-p x.falsebranch) (vl-assignstmt-p x.truebranch))) (mv nil nil nil nil)) ((vl-assignstmt ass) x.truebranch) ((unless (or (eq ass.type :vl-blocking) (eq ass.type :vl-nonblocking))) (mv nil nil nil nil)) ((unless (or (not ass.ctrl) (and (mbe :logic (vl-delaycontrol-p ass.ctrl) :exec (eq (tag ass.ctrl) :vl-delaycontrol)) (vl-simpledelaycontrol-p ass.ctrl)))) (mv nil nil nil nil)) (ticks (and ass.ctrl (vl-simpledelaycontrol->ticks ass.ctrl)))) (mv x.condition ass.lvalue ass.expr ticks))))
Theorem:
(defthm return-type-of-vl-match-latchbody-form2.test (implies (and (force (vl-stmt-p x))) (b* (((mv ?test ?lhs ?rhs ?delay) (vl-match-latchbody-form2 x))) (equal (vl-expr-p test) (if test t nil)))) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-vl-match-latchbody-form2.lhs (implies (and (force (vl-stmt-p x))) (b* (((mv ?test ?lhs ?rhs ?delay) (vl-match-latchbody-form2 x))) (and (equal (vl-expr-p lhs) (if test t nil)) (iff lhs test)))) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-vl-match-latchbody-form2.rhs (implies (and (force (vl-stmt-p x))) (b* (((mv ?test ?lhs ?rhs ?delay) (vl-match-latchbody-form2 x))) (and (equal (vl-expr-p rhs) (if test t nil)) (iff rhs test)))) :rule-classes :rewrite)
Theorem:
(defthm maybe-natp-of-vl-match-latchbody-form2.ticks (maybe-natp (mv-nth 3 (vl-match-latchbody-form2 x))) :rule-classes :type-prescription)