Function:
(defun vl-consteval-wideunary (op aval) (declare (xargs :guard (and (member op '(:vl-unary-plus :vl-unary-minus :vl-unary-bitnot)) (natp aval)))) (let ((__function__ 'vl-consteval-wideunary)) (declare (ignorable __function__)) (b* ((aval (lnfix aval))) (case op (:vl-unary-plus aval) (:vl-unary-minus (- aval)) (:vl-unary-bitnot (lognot aval)) (otherwise (progn$ (impossible) 0))))))
Theorem:
(defthm integerp-of-vl-consteval-wideunary (b* ((ans (vl-consteval-wideunary op aval))) (integerp ans)) :rule-classes :type-prescription)
Theorem:
(defthm vl-consteval-wideunary-of-nfix-aval (equal (vl-consteval-wideunary op (nfix aval)) (vl-consteval-wideunary op aval)))
Theorem:
(defthm vl-consteval-wideunary-nat-equiv-congruence-on-aval (implies (acl2::nat-equiv aval aval-equiv) (equal (vl-consteval-wideunary op aval) (vl-consteval-wideunary op aval-equiv))) :rule-classes :congruence)