Left shift of unsigned integer values.
We prove that
Function:
(defun uint-shl (left-operand right-operand) (declare (xargs :guard (and (uintp left-operand) (uintp right-operand)))) (b* ((size (uint->size left-operand)) (x (uint->value left-operand)) (y (uint->value right-operand))) (make-uint :size (uint->size left-operand) :value (loghead size (ash x y)))))
Theorem:
(defthm uintp-of-uint-shl (b* ((result (uint-shl left-operand right-operand))) (uintp result)) :rule-classes :rewrite)
Theorem:
(defthm uint-shl-of-uint-fix-left-operand (equal (uint-shl (uint-fix left-operand) right-operand) (uint-shl left-operand right-operand)))
Theorem:
(defthm uint-shl-uint-equiv-congruence-on-left-operand (implies (uint-equiv left-operand left-operand-equiv) (equal (uint-shl left-operand right-operand) (uint-shl left-operand-equiv right-operand))) :rule-classes :congruence)
Theorem:
(defthm uint-shl-of-uint-fix-right-operand (equal (uint-shl left-operand (uint-fix right-operand)) (uint-shl left-operand right-operand)))
Theorem:
(defthm uint-shl-uint-equiv-congruence-on-right-operand (implies (uint-equiv right-operand right-operand-equiv) (equal (uint-shl left-operand right-operand) (uint-shl left-operand right-operand-equiv))) :rule-classes :congruence)