(negate-slice8 x) computes the 8-bit two's complement negation of
(negate-slice8 x) → ~x
For example,
We leave this enabled; we would usually not expect to try to reason about it.
Function:
(defun acl2::negate-slice8$inline (x) (declare (type (unsigned-byte 8) x)) (let ((__function__ 'negate-slice8)) (declare (ignorable __function__)) (mbe :logic (logand (+ 1 (lognot (nfix x))) (1- (expt 2 8))) :exec (the (unsigned-byte 8) (logand (the (signed-byte 9) (+ 1 (the (signed-byte 9) (lognot x)))) 255)))))
Theorem:
(defthm acl2::natp-of-negate-slice8 (b* ((~x (acl2::negate-slice8$inline x))) (natp ~x)) :rule-classes :type-prescription)
Theorem:
(defthm nat-equiv-implies-equal-negate-slice8-1 (implies (nat-equiv x x-equiv) (equal (negate-slice8 x) (negate-slice8 x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm unsigned-byte-p-8-of-negate-slice8 (unsigned-byte-p 8 (negate-slice8 x)))