Negation, except Z bits become 0.
The closest monotonic approximation of the offset of each of the bits of the input. It differs from the actual offset in that the 4vec-offset of an X bit is X.
Function:
(defun 4vec-offset (x) (declare (xargs :guard (4vec-p x))) (let ((__function__ '4vec-offset)) (declare (ignorable __function__)) (b* (((4vec x))) (4vec (lognot x.lower) (lognot (logior x.upper x.lower))))))
Theorem:
(defthm 4vec-p-of-4vec-offset (b* ((res (4vec-offset x))) (4vec-p res)) :rule-classes :rewrite)
Theorem:
(defthm 4vec-offset-bits (equal (4vec-idx->4v n (4vec-offset x)) (let ((in (4vec-idx->4v n x))) (if (eq 'z in) 'f (acl2::4v-not in)))))
Theorem:
(defthm 4vec-offset-of-4vec-fix-x (equal (4vec-offset (4vec-fix x)) (4vec-offset x)))
Theorem:
(defthm 4vec-offset-4vec-equiv-congruence-on-x (implies (4vec-equiv x x-equiv) (equal (4vec-offset x) (4vec-offset x-equiv))) :rule-classes :congruence)