(sparseint$-unary-bitop op x x.height) → (mv res height)
Function:
(defun sparseint$-unary-bitop (op x x.height) (declare (type (unsigned-byte 2) op)) (declare (xargs :guard (and (integerp op) (sparseint$-p x) (natp x.height)))) (declare (xargs :guard (and (sparseint$-height-correctp x) (equal x.height (sparseint$-height x))))) (let ((__function__ 'sparseint$-unary-bitop)) (declare (ignorable __function__)) (b* ((x.height (mbe :logic (sparseint$-height x) :exec x.height)) (op (mbe :logic (loghead 2 op) :exec op))) (case op (0 (mv (sparseint$-leaf 0) 0)) (1 (mv (sparseint$-bitnot x) x.height)) (2 (mv (sparseint$-fix x) x.height)) (t (mv (sparseint$-leaf -1) 0))))))
Theorem:
(defthm sparseint$-p-of-sparseint$-unary-bitop.res (b* (((mv ?res ?height) (sparseint$-unary-bitop op x x.height))) (sparseint$-p res)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-sparseint$-unary-bitop.height (b* (((mv ?res ?height) (sparseint$-unary-bitop op x x.height))) (equal height (sparseint$-height res))) :rule-classes :rewrite)
Theorem:
(defthm sparseint$-unary-bitop-height-correctp (b* (((mv ?res ?height) (sparseint$-unary-bitop op x x.height))) (implies (sparseint$-height-correctp x) (sparseint$-height-correctp res))))
Theorem:
(defthm sparseint$-unary-bitop-correct (b* (((mv ?res ?height) (sparseint$-unary-bitop op x x.height))) (equal (sparseint$-val res) (unary-bitop op (sparseint$-val x)))))
Theorem:
(defthm sparseint$-unary-bitop-of-ifix-op (equal (sparseint$-unary-bitop (ifix op) x x.height) (sparseint$-unary-bitop op x x.height)))
Theorem:
(defthm sparseint$-unary-bitop-int-equiv-congruence-on-op (implies (int-equiv op op-equiv) (equal (sparseint$-unary-bitop op x x.height) (sparseint$-unary-bitop op-equiv x x.height))) :rule-classes :congruence)
Theorem:
(defthm sparseint$-unary-bitop-of-sparseint$-fix-x (equal (sparseint$-unary-bitop op (sparseint$-fix x) x.height) (sparseint$-unary-bitop op x x.height)))
Theorem:
(defthm sparseint$-unary-bitop-sparseint$-equiv-congruence-on-x (implies (sparseint$-equiv x x-equiv) (equal (sparseint$-unary-bitop op x x.height) (sparseint$-unary-bitop op x-equiv x.height))) :rule-classes :congruence)
Theorem:
(defthm sparseint$-unary-bitop-of-nfix-x.height (equal (sparseint$-unary-bitop op x (nfix x.height)) (sparseint$-unary-bitop op x x.height)))
Theorem:
(defthm sparseint$-unary-bitop-nat-equiv-congruence-on-x.height (implies (nat-equiv x.height x.height-equiv) (equal (sparseint$-unary-bitop op x x.height) (sparseint$-unary-bitop op x x.height-equiv))) :rule-classes :congruence)