(vl-binaryop-to-svex op left right left-size right-size size signedness) → (mv err svex)
Function:
(defun vl-binaryop-to-svex (op left right left-size right-size size signedness) (declare (xargs :guard (and (vl-binaryop-p op) (sv::svex-p left) (sv::svex-p right) (natp left-size) (natp right-size) (natp size) (vl-exprsign-p signedness)))) (declare (ignorable right-size)) (let ((__function__ 'vl-binaryop-to-svex)) (declare (ignorable __function__)) (b* ((op (vl-binaryop-fix op)) (body (case op (:vl-binary-plus (sv::svcall + left right)) (:vl-binary-minus (sv::svcall sv::b- left right)) (:vl-binary-times (sv::svcall * left right)) (:vl-binary-div (sv::svcall / left right)) (:vl-binary-rem (sv::svcall sv::% left right)) (:vl-binary-eq (sv::svcall sv::== left right)) (:vl-binary-neq (sv::svcall sv::bitnot (sv::svcall sv::== left right))) (:vl-binary-ceq (sv::svcall sv::=== left right)) (:vl-binary-cne (sv::svcall sv::bitnot (sv::svcall sv::=== left right))) (:vl-binary-wildeq (sv::svcall sv::==? left right)) (:vl-binary-wildneq (sv::svcall sv::bitnot (sv::svcall sv::==? left right))) (:vl-binary-logand (sv::svcall sv::bitand (sv::svcall sv::uor left) (sv::svcall sv::uor right))) (:vl-binary-logor (sv::svcall sv::bitor (sv::svcall sv::uor left) (sv::svcall sv::uor right))) (:vl-binary-lt (sv::svcall < left right)) (:vl-binary-lte (sv::svcall sv::bitnot (sv::svcall < right left))) (:vl-binary-gt (sv::svcall < right left)) (:vl-binary-gte (sv::svcall sv::bitnot (sv::svcall < left right))) (:vl-binary-bitand (sv::svcall sv::bitand left right)) (:vl-binary-bitor (sv::svcall sv::bitor left right)) (:vl-binary-xor (sv::svcall sv::bitxor left right)) (:vl-binary-xnor (sv::svcall sv::bitnot (sv::svcall sv::bitxor left right))) (:vl-binary-power (sv::svcall sv::pow left right)) (:vl-binary-shr (sv::svcall sv::rsh (sv::svex-zerox right-size right) (sv::svex-zerox left-size left))) (:vl-binary-shl (sv::svcall sv::lsh (sv::svex-zerox right-size right) left)) (:vl-binary-ashr (sv::svcall sv::rsh (sv::svex-zerox right-size right) left)) (:vl-binary-ashl (sv::svcall sv::lsh (sv::svex-zerox right-size right) left)) (:vl-implies (sv::svcall sv::bitor (sv::svcall sv::bitnot (sv::svcall sv::uor left)) (sv::svcall sv::uor right))) (:vl-equiv (sv::svcall sv::bitnot (sv::svcall sv::bitxor (sv::svcall sv::uor left) (sv::svcall sv::uor right)))) (otherwise nil)))) (mv (and (not body) (vmsg "Operator not implemented: ~s0" (vl-binaryop-string op))) (if body (svex-extend signedness size body) (svex-x))))))
Theorem:
(defthm return-type-of-vl-binaryop-to-svex.err (b* (((mv ?err ?svex) (vl-binaryop-to-svex op left right left-size right-size size signedness))) (iff (vl-msg-p err) err)) :rule-classes :rewrite)
Theorem:
(defthm svex-p-of-vl-binaryop-to-svex.svex (b* (((mv ?err ?svex) (vl-binaryop-to-svex op left right left-size right-size size signedness))) (sv::svex-p svex)) :rule-classes :rewrite)
Theorem:
(defthm vars-of-vl-binaryop-to-svex (b* (((mv ?err ?svex) (vl-binaryop-to-svex op left right left-size right-size size signedness))) (implies (and (not (member v (sv::svex-vars left))) (not (member v (sv::svex-vars right)))) (not (member v (sv::svex-vars svex))))))
Theorem:
(defthm vl-binaryop-to-svex-of-vl-binaryop-fix-op (equal (vl-binaryop-to-svex (vl-binaryop-fix op) left right left-size right-size size signedness) (vl-binaryop-to-svex op left right left-size right-size size signedness)))
Theorem:
(defthm vl-binaryop-to-svex-vl-binaryop-equiv-congruence-on-op (implies (vl-binaryop-equiv op op-equiv) (equal (vl-binaryop-to-svex op left right left-size right-size size signedness) (vl-binaryop-to-svex op-equiv left right left-size right-size size signedness))) :rule-classes :congruence)
Theorem:
(defthm vl-binaryop-to-svex-of-svex-fix-left (equal (vl-binaryop-to-svex op (sv::svex-fix left) right left-size right-size size signedness) (vl-binaryop-to-svex op left right left-size right-size size signedness)))
Theorem:
(defthm vl-binaryop-to-svex-svex-equiv-congruence-on-left (implies (sv::svex-equiv left left-equiv) (equal (vl-binaryop-to-svex op left right left-size right-size size signedness) (vl-binaryop-to-svex op left-equiv right left-size right-size size signedness))) :rule-classes :congruence)
Theorem:
(defthm vl-binaryop-to-svex-of-svex-fix-right (equal (vl-binaryop-to-svex op left (sv::svex-fix right) left-size right-size size signedness) (vl-binaryop-to-svex op left right left-size right-size size signedness)))
Theorem:
(defthm vl-binaryop-to-svex-svex-equiv-congruence-on-right (implies (sv::svex-equiv right right-equiv) (equal (vl-binaryop-to-svex op left right left-size right-size size signedness) (vl-binaryop-to-svex op left right-equiv left-size right-size size signedness))) :rule-classes :congruence)
Theorem:
(defthm vl-binaryop-to-svex-of-nfix-left-size (equal (vl-binaryop-to-svex op left right (nfix left-size) right-size size signedness) (vl-binaryop-to-svex op left right left-size right-size size signedness)))
Theorem:
(defthm vl-binaryop-to-svex-nat-equiv-congruence-on-left-size (implies (acl2::nat-equiv left-size left-size-equiv) (equal (vl-binaryop-to-svex op left right left-size right-size size signedness) (vl-binaryop-to-svex op left right left-size-equiv right-size size signedness))) :rule-classes :congruence)
Theorem:
(defthm vl-binaryop-to-svex-of-nfix-right-size (equal (vl-binaryop-to-svex op left right left-size (nfix right-size) size signedness) (vl-binaryop-to-svex op left right left-size right-size size signedness)))
Theorem:
(defthm vl-binaryop-to-svex-nat-equiv-congruence-on-right-size (implies (acl2::nat-equiv right-size right-size-equiv) (equal (vl-binaryop-to-svex op left right left-size right-size size signedness) (vl-binaryop-to-svex op left right left-size right-size-equiv size signedness))) :rule-classes :congruence)
Theorem:
(defthm vl-binaryop-to-svex-of-nfix-size (equal (vl-binaryop-to-svex op left right left-size right-size (nfix size) signedness) (vl-binaryop-to-svex op left right left-size right-size size signedness)))
Theorem:
(defthm vl-binaryop-to-svex-nat-equiv-congruence-on-size (implies (acl2::nat-equiv size size-equiv) (equal (vl-binaryop-to-svex op left right left-size right-size size signedness) (vl-binaryop-to-svex op left right left-size right-size size-equiv signedness))) :rule-classes :congruence)
Theorem:
(defthm vl-binaryop-to-svex-of-vl-exprsign-fix-signedness (equal (vl-binaryop-to-svex op left right left-size right-size size (vl-exprsign-fix signedness)) (vl-binaryop-to-svex op left right left-size right-size size signedness)))
Theorem:
(defthm vl-binaryop-to-svex-vl-exprsign-equiv-congruence-on-signedness (implies (vl-exprsign-equiv signedness signedness-equiv) (equal (vl-binaryop-to-svex op left right left-size right-size size signedness) (vl-binaryop-to-svex op left right left-size right-size size signedness-equiv))) :rule-classes :congruence)