Function:
(defun 4vec-bitmux (test then else) (declare (xargs :guard (and (integerp test) (4vec-p then) (4vec-p else)))) (let ((__function__ '4vec-bitmux)) (declare (ignorable __function__)) (b* (((4vec then)) ((4vec else))) (mbe :logic (4vec (logite test then.upper else.upper) (logite test then.lower else.lower)) :exec (b* (((when (eql test -1)) then) ((when (eql test 0)) else)) (4vec (logite test then.upper else.upper) (logite test then.lower else.lower)))))))
Theorem:
(defthm 4vec-p-of-4vec-bitmux (b* ((mux (4vec-bitmux test then else))) (4vec-p mux)) :rule-classes :rewrite)
Theorem:
(defthm 4vec-bitmux-of-ifix-test (equal (4vec-bitmux (ifix test) then else) (4vec-bitmux test then else)))
Theorem:
(defthm 4vec-bitmux-int-equiv-congruence-on-test (implies (int-equiv test test-equiv) (equal (4vec-bitmux test then else) (4vec-bitmux test-equiv then else))) :rule-classes :congruence)
Theorem:
(defthm 4vec-bitmux-of-4vec-fix-then (equal (4vec-bitmux test (4vec-fix then) else) (4vec-bitmux test then else)))
Theorem:
(defthm 4vec-bitmux-4vec-equiv-congruence-on-then (implies (4vec-equiv then then-equiv) (equal (4vec-bitmux test then else) (4vec-bitmux test then-equiv else))) :rule-classes :congruence)
Theorem:
(defthm 4vec-bitmux-of-4vec-fix-else (equal (4vec-bitmux test then (4vec-fix else)) (4vec-bitmux test then else)))
Theorem:
(defthm 4vec-bitmux-4vec-equiv-congruence-on-else (implies (4vec-equiv else else-equiv) (equal (4vec-bitmux test then else) (4vec-bitmux test then else-equiv))) :rule-classes :congruence)