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