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