Function:
(defun s4vec-bitxor (x y) (declare (xargs :guard (and (s4vec-p x) (s4vec-p y)))) (let ((__function__ 's4vec-bitxor)) (declare (ignorable __function__)) (if (and (s2vec-p x) (s2vec-p y)) (s2vec (sparseint-bitxor (s2vec->val x) (s2vec->val y))) (b* (((s4vec x)) ((s4vec y)) (xmask (sparseint-bitor (sparseint-bitxor x.upper x.lower) (sparseint-bitxor y.upper y.lower)))) (s4vec (sparseint-bitor xmask (sparseint-bitxor x.upper y.upper)) (sparseint-bitandc1 xmask (sparseint-bitxor x.lower y.lower)))))))
Theorem:
(defthm s4vec-p-of-s4vec-bitxor (b* ((res (s4vec-bitxor x y))) (s4vec-p res)) :rule-classes :rewrite)
Theorem:
(defthm s4vec-bitxor-correct (b* ((?res (s4vec-bitxor x y))) (equal (s4vec->4vec res) (4vec-bitxor (s4vec->4vec x) (s4vec->4vec y)))))
Theorem:
(defthm s4vec-bitxor-of-s4vec-fix-x (equal (s4vec-bitxor (s4vec-fix x) y) (s4vec-bitxor x y)))
Theorem:
(defthm s4vec-bitxor-s4vec-equiv-congruence-on-x (implies (s4vec-equiv x x-equiv) (equal (s4vec-bitxor x y) (s4vec-bitxor x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm s4vec-bitxor-of-s4vec-fix-y (equal (s4vec-bitxor x (s4vec-fix y)) (s4vec-bitxor x y)))
Theorem:
(defthm s4vec-bitxor-s4vec-equiv-congruence-on-y (implies (s4vec-equiv y y-equiv) (equal (s4vec-bitxor x y) (s4vec-bitxor x y-equiv))) :rule-classes :congruence)