Variable node constructor with basic reductions.
(mk-var1 var left right) → bed
Function:
(defun mk-var1 (var left right) (declare (xargs :guard t)) (let ((__function__ 'mk-var1)) (declare (ignorable __function__)) (b* (((when (hons-equal left right)) left) ((mv lvarp lvar la ?lb) (bed-match-var left)) ((mv rvarp rvar ?ra rb) (bed-match-var right)) (left (if (and lvarp (equal lvar var)) la left)) (right (if (and rvarp (equal rvar var)) rb right))) (mk-var-raw var left right))))
Theorem:
(defthm bed-eval-of-mk-var1 (equal (bed-eval (mk-var1 var left right) env) (if (bed-env-lookup var env) (bed-eval left env) (bed-eval right env))))