Pattern match a variable ITE node.
(bed-match-var x) → (mv okp var left right)
Function:
(defun bed-match-var (x) (declare (xargs :guard t)) (let ((__function__ 'bed-match-var)) (declare (ignorable __function__)) (if (and (consp x) (not (integerp (cdr x)))) (mv t (car x) (car$ (cdr x)) (cdr$ (cdr x))) (mv nil nil nil nil))))
Theorem:
(defthm bed-match-var-correct (b* (((mv okp var left right) (bed-match-var x))) (implies okp (equal (bed-eval x env) (if (bed-env-lookup var env) (bed-eval left env) (bed-eval right env))))))