Symmetric wildcard equality: true if for every pair of corresponding bits of a and b, either they are equal or the bit from either a or b is Z.
Function:
(defun 4vec-symwildeq (a b) (declare (xargs :guard (and (4vec-p a) (4vec-p b)))) (let ((__function__ '4vec-symwildeq)) (declare (ignorable __function__)) (b* ((eq (3vec-bitnot (4vec-bitxor a b))) ((4vec a)) ((4vec b)) (zmask (logior (logand (lognot b.upper) b.lower) (logand (lognot a.upper) a.lower)))) (3vec-reduction-and (3vec-bitor eq (2vec zmask))))))
Theorem:
(defthm 4vec-p-of-4vec-symwildeq (b* ((res (4vec-symwildeq a b))) (4vec-p res)) :rule-classes :rewrite)
Theorem:
(defthm 4vec-symwildeq-of-4vec-fix-a (equal (4vec-symwildeq (4vec-fix a) b) (4vec-symwildeq a b)))
Theorem:
(defthm 4vec-symwildeq-4vec-equiv-congruence-on-a (implies (4vec-equiv a a-equiv) (equal (4vec-symwildeq a b) (4vec-symwildeq a-equiv b))) :rule-classes :congruence)
Theorem:
(defthm 4vec-symwildeq-of-4vec-fix-b (equal (4vec-symwildeq a (4vec-fix b)) (4vec-symwildeq a b)))
Theorem:
(defthm 4vec-symwildeq-4vec-equiv-congruence-on-b (implies (4vec-equiv b b-equiv) (equal (4vec-symwildeq a b) (4vec-symwildeq a b-equiv))) :rule-classes :congruence)