Bitwise wired AND resolution of two 4vecs.
Resolves together two 4vecs as if they were both assigned to a
Function:
(defun 4vec-resand (a b) (declare (xargs :guard (and (4vec-p a) (4vec-p b)))) (let ((__function__ '4vec-resand)) (declare (ignorable __function__)) (b* (((4vec a)) ((4vec b))) (4vec (logand (logior a.upper a.lower) (logior b.upper b.lower) (logior a.upper b.upper)) (logand a.lower b.lower)))))
Theorem:
(defthm 4vec-p-of-4vec-resand (b* ((ans (4vec-resand a b))) (4vec-p ans)) :rule-classes :rewrite)
Main correctness theorem: each result bit just the ACL2::4v-wand of the corresponding input bits.
Theorem:
(defthm 4vec-resand-bits (equal (4vec-idx->4v n (4vec-resand x y)) (acl2::4v-wand (4vec-idx->4v n x) (4vec-idx->4v n y))))
Theorem:
(defthm 4vec-resand-of-4vec-fix-a (equal (4vec-resand (4vec-fix a) b) (4vec-resand a b)))
Theorem:
(defthm 4vec-resand-4vec-equiv-congruence-on-a (implies (4vec-equiv a a-equiv) (equal (4vec-resand a b) (4vec-resand a-equiv b))) :rule-classes :congruence)
Theorem:
(defthm 4vec-resand-of-4vec-fix-b (equal (4vec-resand a (4vec-fix b)) (4vec-resand a b)))
Theorem:
(defthm 4vec-resand-4vec-equiv-congruence-on-b (implies (4vec-equiv b b-equiv) (equal (4vec-resand a b) (4vec-resand a b-equiv))) :rule-classes :congruence)