Construct a one-bit wide expression that is equivalent to
(vl-condition-neg condition) → rhs
We produce an expression that is equivalent to
For compatibility with oprewrite, the expression we actually generate is:
Function:
(defun vl-condition-neg (condition) (declare (xargs :guard (and (vl-expr-p condition) (posp (vl-expr->finalwidth condition)) (vl-expr->finaltype condition)))) (let ((__function__ 'vl-condition-neg)) (declare (ignorable __function__)) (if (and (eql (vl-expr->finalwidth condition) 1) (eq (vl-expr->finaltype condition) :vl-unsigned)) (make-vl-nonatom :op :vl-unary-bitnot :args (list condition) :finalwidth 1 :finaltype :vl-unsigned) (b* ((redux (make-vl-nonatom :op :vl-unary-bitor :args (list condition) :finalwidth 1 :finaltype :vl-unsigned))) (make-vl-nonatom :op :vl-unary-bitnot :args (list redux) :finalwidth 1 :finaltype :vl-unsigned)))))
Theorem:
(defthm return-type-of-vl-condition-neg (implies (and (force (vl-expr-p condition)) (force (posp (vl-expr->finalwidth$inline condition))) (force (vl-expr->finaltype$inline condition))) (b* ((rhs (vl-condition-neg condition))) (and (vl-expr-p rhs) (equal (vl-expr->finalwidth rhs) 1) (equal (vl-expr->finaltype rhs) :vl-unsigned)))) :rule-classes :rewrite)
Theorem:
(defthm vl-expr-welltyped-p-of-vl-condition-neg (implies (and (vl-expr-welltyped-p condition) (force (vl-expr-p condition)) (force (vl-expr->finaltype condition)) (force (posp (vl-expr->finalwidth condition)))) (vl-expr-welltyped-p (vl-condition-neg condition))))