Set X[n] := ~X[n]
Function:
(defun notbit (n x) (declare (xargs :guard (and (natp n) (integerp x)))) (let ((__function__ 'notbit)) (declare (ignorable __function__)) (if (logbitp n x) (clearbit n x) (setbit n x))))
Theorem:
(defthm acl2::integerp-of-notbit (b* ((ans (notbit n x))) (integerp ans)) :rule-classes :type-prescription)
Theorem:
(defthm nat-equiv-implies-equal-notbit-1 (implies (nat-equiv n n-equiv) (equal (notbit n x) (notbit n-equiv x))) :rule-classes (:congruence))
Theorem:
(defthm int-equiv-implies-equal-notbit-2 (implies (int-equiv x x-equiv) (equal (notbit n x) (notbit n x-equiv))) :rule-classes (:congruence))