Remainder
(long-rem operand-left operand-right) → result
Function:
(defun long-rem (operand-left operand-right) (declare (xargs :guard (and (long-valuep operand-left) (long-valuep operand-right)))) (declare (xargs :guard (not (equal (long-value->int operand-right) 0)))) (b* ((x (long-value->int operand-left)) (y (long-value->int operand-right))) (long-value (logext 64 (rem x y)))))
Theorem:
(defthm long-valuep-of-long-rem (b* ((result (long-rem operand-left operand-right))) (long-valuep result)) :rule-classes :rewrite)
Theorem:
(defthm long-rem-of-long-value-fix-operand-left (equal (long-rem (long-value-fix operand-left) operand-right) (long-rem operand-left operand-right)))
Theorem:
(defthm long-rem-long-value-equiv-congruence-on-operand-left (implies (long-value-equiv operand-left operand-left-equiv) (equal (long-rem operand-left operand-right) (long-rem operand-left-equiv operand-right))) :rule-classes :congruence)
Theorem:
(defthm long-rem-of-long-value-fix-operand-right (equal (long-rem operand-left (long-value-fix operand-right)) (long-rem operand-left operand-right)))
Theorem:
(defthm long-rem-long-value-equiv-congruence-on-operand-right (implies (long-value-equiv operand-right operand-right-equiv) (equal (long-rem operand-left operand-right) (long-rem operand-left operand-right-equiv))) :rule-classes :congruence)