Apply
(eq-arithmetic-values val1 val2) → resval
We perform the usual arithmetic conversions and then we apply the operation on the integers. In our current formalization, integers are the only arithmetic values. This ACL2 function will be extended with more cases if/when we extend our model with non-integer arithmetic values.
Function:
(defun eq-arithmetic-values (val1 val2) (declare (xargs :guard (and (valuep val1) (valuep val2)))) (declare (xargs :guard (and (value-arithmeticp val1) (value-arithmeticp val2)))) (let ((__function__ 'eq-arithmetic-values)) (declare (ignorable __function__)) (b* (((mv val1 val2) (uaconvert-values val1 val2))) (eq-integer-values val1 val2))))
Theorem:
(defthm value-resultp-of-eq-arithmetic-values (b* ((resval (eq-arithmetic-values val1 val2))) (value-resultp resval)) :rule-classes :rewrite)
Theorem:
(defthm eq-arithmetic-values-of-value-fix-val1 (equal (eq-arithmetic-values (value-fix val1) val2) (eq-arithmetic-values val1 val2)))
Theorem:
(defthm eq-arithmetic-values-value-equiv-congruence-on-val1 (implies (value-equiv val1 val1-equiv) (equal (eq-arithmetic-values val1 val2) (eq-arithmetic-values val1-equiv val2))) :rule-classes :congruence)
Theorem:
(defthm eq-arithmetic-values-of-value-fix-val2 (equal (eq-arithmetic-values val1 (value-fix val2)) (eq-arithmetic-values val1 val2)))
Theorem:
(defthm eq-arithmetic-values-value-equiv-congruence-on-val2 (implies (value-equiv val2 val2-equiv) (equal (eq-arithmetic-values val1 val2) (eq-arithmetic-values val1 val2-equiv))) :rule-classes :congruence)