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