Walk through a clock expression, eliminating double negations.
(vl-edgesynth-classify-iftest-aux condition) → (mv type guts)
Function:
(defun vl-edgesynth-classify-iftest-aux (condition) (declare (xargs :guard (vl-expr-p condition))) (let ((__function__ 'vl-edgesynth-classify-iftest-aux)) (declare (ignorable __function__)) (b* (((when (vl-fast-atom-p condition)) (if (and (vl-idexpr-p condition) (eql (vl-expr->finalwidth condition) 1) (vl-expr->finaltype condition)) (mv :clock condition) (mv :error condition))) (op (vl-nonatom->op condition)) (args (vl-nonatom->args condition)) ((when (or (eq op :vl-unary-bitor) (and (eq op :vl-concat) (eql (len args) 1)))) (b* (((mv type guts) (vl-edgesynth-classify-iftest-aux (first args)))) (if (or (eq type :clock) (eq type :nclock)) (mv type guts) (mv type condition)))) ((when (member op '(:vl-unary-lognot :vl-unary-bitnot))) (b* (((mv type exp) (vl-edgesynth-classify-iftest-aux (first args))) ((when (eq type :clock)) (mv :nclock exp)) ((when (eq type :nclock)) (mv :clock exp))) (mv :error condition)))) (mv :error condition))))
Theorem:
(defthm vl-edgesynth-iftype-p-of-vl-edgesynth-classify-iftest-aux.type (b* (((mv common-lisp::?type ?guts) (vl-edgesynth-classify-iftest-aux condition))) (vl-edgesynth-iftype-p type)) :rule-classes :rewrite)
Theorem:
(defthm vl-expr-p-of-vl-edgesynth-classify-iftest-aux.guts (implies (and (force (vl-expr-p condition))) (b* (((mv common-lisp::?type ?guts) (vl-edgesynth-classify-iftest-aux condition))) (vl-expr-p guts))) :rule-classes :rewrite)
Theorem:
(defthm vl-idexpr-p-of-vl-edgesynth-classify-iftest-aux (b* (((mv type guts) (vl-edgesynth-classify-iftest-aux condition))) (implies (or (equal type :clock) (equal type :nclock)) (and (vl-idexpr-p guts) (equal (vl-expr->finalwidth guts) 1) (vl-expr->finaltype guts)))))
Theorem:
(defthm name-bound-for-vl-edgesynth-classify-iftest-aux (b* (((mv type guts) (vl-edgesynth-classify-iftest-aux condition))) (implies (and (vl-expr-p condition) (or (equal type :clock) (equal type :nclock))) (member (vl-idexpr->name guts) (vl-expr-names condition)))))