Less-than comparison of unsigned integer values.
Function:
(defun uint-lt (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 (< x y))))
Theorem:
(defthm boolp-of-uint-lt (b* ((result (uint-lt left right))) (boolp result)) :rule-classes :rewrite)
Theorem:
(defthm uint-lt-of-uint-fix-left (equal (uint-lt (uint-fix left) right) (uint-lt left right)))
Theorem:
(defthm uint-lt-uint-equiv-congruence-on-left (implies (uint-equiv left left-equiv) (equal (uint-lt left right) (uint-lt left-equiv right))) :rule-classes :congruence)
Theorem:
(defthm uint-lt-of-uint-fix-right (equal (uint-lt left (uint-fix right)) (uint-lt left right)))
Theorem:
(defthm uint-lt-uint-equiv-congruence-on-right (implies (uint-equiv right right-equiv) (equal (uint-lt left right) (uint-lt left right-equiv))) :rule-classes :congruence)