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