Pattern match simple kinds of latch statements.
(vl-match-latchbody x) → (mv test lhs rhs delay)
Function:
(defun vl-match-latchbody (x) (declare (xargs :guard (vl-stmt-p x))) (let ((__function__ 'vl-match-latchbody)) (declare (ignorable __function__)) (b* (((mv test lhs rhs delay) (vl-match-latchbody-form1 x)) ((when test) (mv test lhs rhs delay))) (vl-match-latchbody-form2 x))))
Theorem:
(defthm return-type-of-vl-match-latchbody.test (implies (and (force (vl-stmt-p x))) (b* (((mv ?test ?lhs ?rhs ?delay) (vl-match-latchbody x))) (equal (vl-expr-p test) (if test t nil)))) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-vl-match-latchbody.lhs (implies (and (force (vl-stmt-p x))) (b* (((mv ?test ?lhs ?rhs ?delay) (vl-match-latchbody 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.rhs (implies (and (force (vl-stmt-p x))) (b* (((mv ?test ?lhs ?rhs ?delay) (vl-match-latchbody 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.ticks (maybe-natp (mv-nth 3 (vl-match-latchbody x))) :rule-classes :type-prescription)