Recognizer for 3vecs (with a 4vec-p guard).
(3vec-p x) → bool
Function:
(defun 3vec-p (x) (declare (xargs :guard (4vec-p x))) (let ((__function__ '3vec-p)) (declare (ignorable __function__)) (mbe :logic (b* (((4vec x) x)) (eql (logand x.lower (lognot x.upper)) 0)) :exec (if (atom x) t (b* (((4vec x) x)) (eql (logandc2 x.lower x.upper) 0))))))
Theorem:
(defthm 3vec-p-implies-bits (and (implies (and (3vec-p x) (not (logbitp n (4vec->upper x)))) (not (logbitp n (4vec->lower x)))) (implies (and (3vec-p x) (logbitp n (4vec->lower x))) (logbitp n (4vec->upper x)))))