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