Integer negation of a 4vec.
If the input has X or Z bits, the result is all X bits. Otherwise, we return the signed negation of the input.
Function:
(defun 4vec-uminus (x) (declare (xargs :guard (4vec-p x))) (let ((__function__ '4vec-uminus)) (declare (ignorable __function__)) (if (2vec-p x) (2vec (- (the integer (2vec->val x)))) (4vec-x))))
Theorem:
(defthm 4vec-p-of-4vec-uminus (b* ((-x (4vec-uminus x))) (4vec-p -x)) :rule-classes :rewrite)
Theorem:
(defthm 4vec-uminus-of-2vecx-fix-x (equal (4vec-uminus (2vecx-fix x)) (4vec-uminus x)))
Theorem:
(defthm 4vec-uminus-2vecx-equiv-congruence-on-x (implies (2vecx-equiv x x-equiv) (equal (4vec-uminus x) (4vec-uminus x-equiv))) :rule-classes :congruence)