Bitwise logical AND of 3vecs.
Function:
(defun 3vec-bitand (x y) (declare (xargs :guard (and (4vec-p x) (4vec-p y)))) (let ((__function__ '3vec-bitand)) (declare (ignorable __function__)) (if-2vec-p (x y) (2vec (logand (2vec->val x) (2vec->val y))) (b* (((4vec x)) ((4vec y))) (4vec (logand x.upper y.upper) (logand x.lower y.lower))))))
Theorem:
(defthm 4vec-p-of-3vec-bitand (b* ((x&y (3vec-bitand x y))) (4vec-p x&y)) :rule-classes :rewrite)
Theorem:
(defthm 3vec-p-of-3vec-bitand (b* ((?x&y (3vec-bitand x y))) (implies (and (3vec-p x) (3vec-p y)) (3vec-p x&y))))
Theorem:
(defthm 3vec-bitand-bits (implies (and (3vec-p! x) (3vec-p! y)) (equal (4vec-idx->4v n (3vec-bitand x y)) (acl2::4v-and (4vec-idx->4v n (3vec-fix x)) (4vec-idx->4v n (3vec-fix y))))))
Theorem:
(defthm 3vec-bitand-of-4vec-fix-x (equal (3vec-bitand (4vec-fix x) y) (3vec-bitand x y)))
Theorem:
(defthm 3vec-bitand-4vec-equiv-congruence-on-x (implies (4vec-equiv x x-equiv) (equal (3vec-bitand x y) (3vec-bitand x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm 3vec-bitand-of-4vec-fix-y (equal (3vec-bitand x (4vec-fix y)) (3vec-bitand x y)))
Theorem:
(defthm 3vec-bitand-4vec-equiv-congruence-on-y (implies (4vec-equiv y y-equiv) (equal (3vec-bitand x y) (3vec-bitand x y-equiv))) :rule-classes :congruence)