Arithmetic negation of signed integer values.
Function:
(defun int-minus (operand) (declare (xargs :guard (intp operand))) (b* ((size (int->size operand)) (x (int->value operand))) (make-int :size (int->size operand) :value (logext size (- x)))))
Theorem:
(defthm intp-of-int-minus (b* ((result (int-minus operand))) (intp result)) :rule-classes :rewrite)
Theorem:
(defthm int-minus-of-int-fix-operand (equal (int-minus (int-fix operand)) (int-minus operand)))
Theorem:
(defthm int-minus-int-equiv-congruence-on-operand (implies (int-equiv operand operand-equiv) (equal (int-minus operand) (int-minus operand-equiv))) :rule-classes :congruence)