Like logbit for 4vecs; the bit position may be a 4vec.
We extract the
Here
When
Function:
(defun 4vec-bit-extract (n x) (declare (xargs :guard (and (4vec-p n) (4vec-p x)))) (let ((__function__ '4vec-bit-extract)) (declare (ignorable __function__)) (if (and (2vec-p n) (<= 0 (2vec->val n))) (4vec-bit-index (2vec->val n) x) (4vec-1x))))
Theorem:
(defthm 4vec-p-of-4vec-bit-extract (b* ((res (4vec-bit-extract n x))) (4vec-p res)) :rule-classes :rewrite)
Theorem:
(defthm 4vec-bit-extract-of-4vec-fix-n (equal (4vec-bit-extract (4vec-fix n) x) (4vec-bit-extract n x)))
Theorem:
(defthm 4vec-bit-extract-4vec-equiv-congruence-on-n (implies (4vec-equiv n n-equiv) (equal (4vec-bit-extract n x) (4vec-bit-extract n-equiv x))) :rule-classes :congruence)
Theorem:
(defthm 4vec-bit-extract-of-4vec-fix-x (equal (4vec-bit-extract n (4vec-fix x)) (4vec-bit-extract n x)))
Theorem:
(defthm 4vec-bit-extract-4vec-equiv-congruence-on-x (implies (4vec-equiv x x-equiv) (equal (4vec-bit-extract n x) (4vec-bit-extract n x-equiv))) :rule-classes :congruence)