Bitwise multiple if-then-elses of 4vecs; doesn't unfloat then/else values; uses else branch bits for any test bits not equal to 1 (non-monotonic semantics in this respect).
We carry out an independent if-then-else for each bit of
This is used for conditionally overriding signals, as in:
(bit?! override-test override-val regular-val)
This way, if the override-test is left out of the environment (therefore its value is X), the regular value will go through.
Function:
(defun 4vec-bit?! (tests thens elses) (declare (xargs :guard (and (4vec-p tests) (4vec-p thens) (4vec-p elses)))) (let ((__function__ '4vec-bit?!)) (declare (ignorable __function__)) (4vec-bitmux (4vec-1mask tests) thens elses)))
Theorem:
(defthm 4vec-p-of-4vec-bit?! (b* ((choices (4vec-bit?! tests thens elses))) (4vec-p choices)) :rule-classes :rewrite)
Theorem:
(defthm 4vec-bit?!-of-4vec-fix-tests (equal (4vec-bit?! (4vec-fix tests) thens elses) (4vec-bit?! tests thens elses)))
Theorem:
(defthm 4vec-bit?!-4vec-equiv-congruence-on-tests (implies (4vec-equiv tests tests-equiv) (equal (4vec-bit?! tests thens elses) (4vec-bit?! tests-equiv thens elses))) :rule-classes :congruence)
Theorem:
(defthm 4vec-bit?!-of-4vec-fix-thens (equal (4vec-bit?! tests (4vec-fix thens) elses) (4vec-bit?! tests thens elses)))
Theorem:
(defthm 4vec-bit?!-4vec-equiv-congruence-on-thens (implies (4vec-equiv thens thens-equiv) (equal (4vec-bit?! tests thens elses) (4vec-bit?! tests thens-equiv elses))) :rule-classes :congruence)
Theorem:
(defthm 4vec-bit?!-of-4vec-fix-elses (equal (4vec-bit?! tests thens (4vec-fix elses)) (4vec-bit?! tests thens elses)))
Theorem:
(defthm 4vec-bit?!-4vec-equiv-congruence-on-elses (implies (4vec-equiv elses elses-equiv) (equal (4vec-bit?! tests thens elses) (4vec-bit?! tests thens elses-equiv))) :rule-classes :congruence)