Bitwise multiple if-then-elses of 4vecs, with a 3vec test vector; doesn't unfloat then/else values.
See 4vec-bit?. This is identical except that we assume
Function:
(defun 3vec-bit? (tests thens elses) (declare (xargs :guard (and (4vec-p tests) (4vec-p thens) (4vec-p elses)))) (let ((__function__ '3vec-bit?)) (declare (ignorable __function__)) (b* (((4vec tests)) ((4vec thens)) ((4vec elses)) (test-x (logand tests.upper (lognot tests.lower)))) (4vec (logior (logand (lognot tests.upper) elses.upper) (logand tests.lower thens.upper) (logand test-x (logior (logior thens.upper thens.lower) (logior elses.upper elses.lower)))) (logior (logand (lognot tests.upper) elses.lower) (logand tests.lower thens.lower) (logand test-x (logand thens.upper thens.lower) (logand elses.upper elses.lower)))))))
Theorem:
(defthm 4vec-p-of-3vec-bit? (b* ((choices (3vec-bit? tests thens elses))) (4vec-p choices)) :rule-classes :rewrite)
Theorem:
(defthm 3vec-?-in-terms-of-3vec-bit? (implies (3vec-p tests) (equal (3vec-bit? (4vec-sign-ext 1 (3vec-reduction-or tests)) thens elses) (3vec-? tests thens elses))))
Theorem:
(defthm 3vec-bit?-of-4vec-fix-tests (equal (3vec-bit? (4vec-fix tests) thens elses) (3vec-bit? tests thens elses)))
Theorem:
(defthm 3vec-bit?-4vec-equiv-congruence-on-tests (implies (4vec-equiv tests tests-equiv) (equal (3vec-bit? tests thens elses) (3vec-bit? tests-equiv thens elses))) :rule-classes :congruence)
Theorem:
(defthm 3vec-bit?-of-4vec-fix-thens (equal (3vec-bit? tests (4vec-fix thens) elses) (3vec-bit? tests thens elses)))
Theorem:
(defthm 3vec-bit?-4vec-equiv-congruence-on-thens (implies (4vec-equiv thens thens-equiv) (equal (3vec-bit? tests thens elses) (3vec-bit? tests thens-equiv elses))) :rule-classes :congruence)
Theorem:
(defthm 3vec-bit?-of-4vec-fix-elses (equal (3vec-bit? tests thens (4vec-fix elses)) (3vec-bit? tests thens elses)))
Theorem:
(defthm 3vec-bit?-4vec-equiv-congruence-on-elses (implies (4vec-equiv elses elses-equiv) (equal (3vec-bit? tests thens elses) (3vec-bit? tests thens elses-equiv))) :rule-classes :congruence)