(vl-consteval-shiftop op aval bval awidth atype) → ans
Function:
(defun vl-consteval-shiftop (op aval bval awidth atype) (declare (xargs :guard (and (member op '(:vl-binary-shr :vl-binary-shl :vl-binary-ashr :vl-binary-ashl :vl-binary-power)) (natp aval) (natp bval) (posp awidth) (vl-exprtype-p atype)))) (let ((__function__ 'vl-consteval-shiftop)) (declare (ignorable __function__)) (b* ((aval (lnfix aval)) (bval (lnfix bval)) (awidth (lposfix awidth)) (ainterp (if (eq (vl-exprtype-fix atype) :vl-signed) (acl2::fast-logext awidth aval) aval))) (case op (:vl-binary-shr (ash aval (- bval))) (:vl-binary-shl (ash aval bval)) (:vl-binary-ashr (ash ainterp (- bval))) (:vl-binary-ashl (ash ainterp bval)) (:vl-binary-power (expt ainterp bval)) (otherwise (progn$ (impossible) 0))))))
Theorem:
(defthm integerp-of-vl-consteval-shiftop (b* ((ans (vl-consteval-shiftop op aval bval awidth atype))) (integerp ans)) :rule-classes :rewrite)
Theorem:
(defthm vl-consteval-shiftop-of-nfix-aval (equal (vl-consteval-shiftop op (nfix aval) bval awidth atype) (vl-consteval-shiftop op aval bval awidth atype)))
Theorem:
(defthm vl-consteval-shiftop-nat-equiv-congruence-on-aval (implies (acl2::nat-equiv aval aval-equiv) (equal (vl-consteval-shiftop op aval bval awidth atype) (vl-consteval-shiftop op aval-equiv bval awidth atype))) :rule-classes :congruence)
Theorem:
(defthm vl-consteval-shiftop-of-nfix-bval (equal (vl-consteval-shiftop op aval (nfix bval) awidth atype) (vl-consteval-shiftop op aval bval awidth atype)))
Theorem:
(defthm vl-consteval-shiftop-nat-equiv-congruence-on-bval (implies (acl2::nat-equiv bval bval-equiv) (equal (vl-consteval-shiftop op aval bval awidth atype) (vl-consteval-shiftop op aval bval-equiv awidth atype))) :rule-classes :congruence)
Theorem:
(defthm vl-consteval-shiftop-of-pos-fix-awidth (equal (vl-consteval-shiftop op aval bval (pos-fix awidth) atype) (vl-consteval-shiftop op aval bval awidth atype)))
Theorem:
(defthm vl-consteval-shiftop-pos-equiv-congruence-on-awidth (implies (acl2::pos-equiv awidth awidth-equiv) (equal (vl-consteval-shiftop op aval bval awidth atype) (vl-consteval-shiftop op aval bval awidth-equiv atype))) :rule-classes :congruence)
Theorem:
(defthm vl-consteval-shiftop-of-vl-exprtype-fix-atype (equal (vl-consteval-shiftop op aval bval awidth (vl-exprtype-fix atype)) (vl-consteval-shiftop op aval bval awidth atype)))
Theorem:
(defthm vl-consteval-shiftop-vl-exprtype-equiv-congruence-on-atype (implies (vl-exprtype-equiv atype atype-equiv) (equal (vl-consteval-shiftop op aval bval awidth atype) (vl-consteval-shiftop op aval bval awidth atype-equiv))) :rule-classes :congruence)