Function:
(defun s4vec-bit-extract (n x) (declare (xargs :guard (and (s4vec-p n) (s4vec-p x)))) (let ((__function__ 's4vec-bit-extract)) (declare (ignorable __function__)) (if (s4vec-index-p n) (s4vec-bit-index (sparseint-val (s4vec->upper n)) x) (s4vec-1x))))
Theorem:
(defthm s4vec-p-of-s4vec-bit-extract (b* ((bit (s4vec-bit-extract n x))) (s4vec-p bit)) :rule-classes :rewrite)
Theorem:
(defthm s4vec-bit-extract-correct (b* ((common-lisp::?bit (s4vec-bit-extract n x))) (equal (s4vec->4vec bit) (4vec-bit-extract (s4vec->4vec n) (s4vec->4vec x)))))
Theorem:
(defthm s4vec-bit-extract-of-s4vec-fix-n (equal (s4vec-bit-extract (s4vec-fix n) x) (s4vec-bit-extract n x)))
Theorem:
(defthm s4vec-bit-extract-s4vec-equiv-congruence-on-n (implies (s4vec-equiv n n-equiv) (equal (s4vec-bit-extract n x) (s4vec-bit-extract n-equiv x))) :rule-classes :congruence)
Theorem:
(defthm s4vec-bit-extract-of-s4vec-fix-x (equal (s4vec-bit-extract n (s4vec-fix x)) (s4vec-bit-extract n x)))
Theorem:
(defthm s4vec-bit-extract-s4vec-equiv-congruence-on-x (implies (s4vec-equiv x x-equiv) (equal (s4vec-bit-extract n x) (s4vec-bit-extract n x-equiv))) :rule-classes :congruence)