Bitwise logical AND of 4vecs.
Function:
(defun 4vec-bitand (x y) (declare (xargs :guard (and (4vec-p x) (4vec-p y)))) (let ((__function__ '4vec-bitand)) (declare (ignorable __function__)) (3vec-bitand (3vec-fix x) (3vec-fix y))))
Theorem:
(defthm 3vec-p!-of-4vec-bitand (b* ((x&y (4vec-bitand x y))) (3vec-p! x&y)) :rule-classes :rewrite)
Main correctness theorem: each result bit is just the ACL2::4v-and of the corresponding input bits.
Theorem:
(defthm 4vec-bitand-bits (equal (4vec-idx->4v n (4vec-bitand x y)) (acl2::4v-and (4vec-idx->4v n x) (4vec-idx->4v n y))))
Theorem:
(defthm 4vec-bitand-of-3vec-fix-x (equal (4vec-bitand (3vec-fix x) y) (4vec-bitand x y)))
Theorem:
(defthm 4vec-bitand-3vec-equiv-congruence-on-x (implies (3vec-equiv x x-equiv) (equal (4vec-bitand x y) (4vec-bitand x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm 4vec-bitand-of-3vec-fix-y (equal (4vec-bitand x (3vec-fix y)) (4vec-bitand x y)))
Theorem:
(defthm 4vec-bitand-3vec-equiv-congruence-on-y (implies (3vec-equiv y y-equiv) (equal (4vec-bitand x y) (4vec-bitand x y-equiv))) :rule-classes :congruence)