Count of 1 bits in a 4vec (X-monotonic).
Function:
(defun 4vec-countones (x) (declare (xargs :guard (4vec-p x))) (let ((__function__ '4vec-countones)) (declare (ignorable __function__)) (if (and (2vec-p x) (<= 0 (2vec->val x))) (b* ((x (2vec->val x))) (2vec (logcount x))) (4vec-x))))
Theorem:
(defthm 3vec-p!-of-4vec-countones (b* ((count (4vec-countones x))) (3vec-p! count)) :rule-classes :rewrite)
Theorem:
(defthm 4vec-countones-of-2vecx-fix-x (equal (4vec-countones (2vecx-fix x)) (4vec-countones x)))
Theorem:
(defthm 4vec-countones-2vecx-equiv-congruence-on-x (implies (2vecx-equiv x x-equiv) (equal (4vec-countones x) (4vec-countones x-equiv))) :rule-classes :congruence)