Apply unary
We promote the operand and then we apply the operation on the integer. 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 plus-arithmetic-value (val) (declare (xargs :guard (valuep val))) (declare (xargs :guard (value-arithmeticp val))) (let ((__function__ 'plus-arithmetic-value)) (declare (ignorable __function__)) (b* ((val (promote-value val))) (plus-integer-value val))))
Theorem:
(defthm valuep-of-plus-arithmetic-value (b* ((resval (plus-arithmetic-value val))) (valuep resval)) :rule-classes :rewrite)
Theorem:
(defthm type-of-value-of-plus-arithmetic-value (b* ((?resval (plus-arithmetic-value val))) (equal (type-of-value resval) (promote-type (type-of-value val)))))
Theorem:
(defthm plus-arithmetic-value-of-value-fix-val (equal (plus-arithmetic-value (value-fix val)) (plus-arithmetic-value val)))
Theorem:
(defthm plus-arithmetic-value-value-equiv-congruence-on-val (implies (value-equiv val val-equiv) (equal (plus-arithmetic-value val) (plus-arithmetic-value val-equiv))) :rule-classes :congruence)