Atomic if-then-else of 4vecs. Has the property that when branches are equal, the result is equal to the branch, regardless of the test.
Function:
(defun 4vec-?* (test then else) (declare (xargs :guard (and (4vec-p test) (4vec-p then) (4vec-p else)))) (let ((__function__ '4vec-?*)) (declare (ignorable __function__)) (3vec-?* (3vec-fix test) then else)))
Theorem:
(defthm 4vec-p-of-4vec-?* (b* ((choice (4vec-?* test then else))) (4vec-p choice)) :rule-classes :rewrite)
Theorem:
(defthm 4vec-?*-of-3vec-fix-test (equal (4vec-?* (3vec-fix test) then else) (4vec-?* test then else)))
Theorem:
(defthm 4vec-?*-3vec-equiv-congruence-on-test (implies (3vec-equiv test test-equiv) (equal (4vec-?* test then else) (4vec-?* test-equiv then else))) :rule-classes :congruence)
Theorem:
(defthm 4vec-?*-of-4vec-fix-then (equal (4vec-?* test (4vec-fix then) else) (4vec-?* test then else)))
Theorem:
(defthm 4vec-?*-4vec-equiv-congruence-on-then (implies (4vec-equiv then then-equiv) (equal (4vec-?* test then else) (4vec-?* test then-equiv else))) :rule-classes :congruence)
Theorem:
(defthm 4vec-?*-of-4vec-fix-else (equal (4vec-?* test then (4vec-fix else)) (4vec-?* test then else)))
Theorem:
(defthm 4vec-?*-4vec-equiv-congruence-on-else (implies (4vec-equiv else else-equiv) (equal (4vec-?* test then else) (4vec-?* test then else-equiv))) :rule-classes :congruence)