(s4vec-bitmux test then else) → mux
Function:
(defun s4vec-bitmux (test then else) (declare (xargs :guard (and (sparseint-p test) (s4vec-p then) (s4vec-p else)))) (let ((__function__ 's4vec-bitmux)) (declare (ignorable __function__)) (b* (((s4vec then)) ((s4vec else)) ((when (sparseint-equal test -1)) (s4vec-fix then)) ((when (sparseint-equal test 0)) (s4vec-fix else))) (s4vec (bitops::sparseint-bitite test then.upper else.upper) (bitops::sparseint-bitite test then.lower else.lower)))))
Theorem:
(defthm s4vec-p-of-s4vec-bitmux (b* ((mux (s4vec-bitmux test then else))) (s4vec-p mux)) :rule-classes :rewrite)
Theorem:
(defthm s4vec-bitmux-correct (b* ((?mux (s4vec-bitmux test then else))) (equal (s4vec->4vec mux) (4vec-bitmux (sparseint-val test) (s4vec->4vec then) (s4vec->4vec else)))))
Theorem:
(defthm s4vec-bitmux-of-sparseint-fix-test (equal (s4vec-bitmux (sparseint-fix test) then else) (s4vec-bitmux test then else)))
Theorem:
(defthm s4vec-bitmux-sparseint-equiv-congruence-on-test (implies (sparseint-equiv test test-equiv) (equal (s4vec-bitmux test then else) (s4vec-bitmux test-equiv then else))) :rule-classes :congruence)
Theorem:
(defthm s4vec-bitmux-of-s4vec-fix-then (equal (s4vec-bitmux test (s4vec-fix then) else) (s4vec-bitmux test then else)))
Theorem:
(defthm s4vec-bitmux-s4vec-equiv-congruence-on-then (implies (s4vec-equiv then then-equiv) (equal (s4vec-bitmux test then else) (s4vec-bitmux test then-equiv else))) :rule-classes :congruence)
Theorem:
(defthm s4vec-bitmux-of-s4vec-fix-else (equal (s4vec-bitmux test then (s4vec-fix else)) (s4vec-bitmux test then else)))
Theorem:
(defthm s4vec-bitmux-s4vec-equiv-congruence-on-else (implies (s4vec-equiv else else-equiv) (equal (s4vec-bitmux test then else) (s4vec-bitmux test then else-equiv))) :rule-classes :congruence)