Equality comparison of unsigned integer values.
Function:
(defun uint-eq (left right) (declare (xargs :guard (and (uintp left) (uintp right)))) (declare (xargs :guard (= (uint->size left) (uint->size right)))) (b* ((x (uint->value left)) (y (uint->value right))) (bool (equal x y))))
Theorem:
(defthm boolp-of-uint-eq (b* ((result (uint-eq left right))) (boolp result)) :rule-classes :rewrite)
Theorem:
(defthm uint-eq-of-uint-fix-left (equal (uint-eq (uint-fix left) right) (uint-eq left right)))
Theorem:
(defthm uint-eq-uint-equiv-congruence-on-left (implies (uint-equiv left left-equiv) (equal (uint-eq left right) (uint-eq left-equiv right))) :rule-classes :congruence)
Theorem:
(defthm uint-eq-of-uint-fix-right (equal (uint-eq left (uint-fix right)) (uint-eq left right)))
Theorem:
(defthm uint-eq-uint-equiv-congruence-on-right (implies (uint-equiv right right-equiv) (equal (uint-eq left right) (uint-eq left right-equiv))) :rule-classes :congruence)