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