(Slow) Look up a variable's value in an svex-env.
(svex-env-lookup var env) → val
We treat any unbound variables as being bound to infinite Xes.
Function:
(defun svex-env-lookup (var env) (declare (xargs :guard (and (svar-p var) (svex-env-p env)))) (let ((__function__ 'svex-env-lookup)) (declare (ignorable __function__)) (mbe :logic (4vec-fix (cdr (hons-get (svar-fix var) env))) :exec (let ((look (hons-get var env))) (if look (cdr look) (4vec-x))))))
Theorem:
(defthm 4vec-p-of-svex-env-lookup (b* ((val (svex-env-lookup var env))) (4vec-p val)) :rule-classes :rewrite)
Theorem:
(defthm svex-env-lookup-of-svar-fix-var (equal (svex-env-lookup (svar-fix var) env) (svex-env-lookup var env)))
Theorem:
(defthm svex-env-lookup-svar-equiv-congruence-on-var (implies (svar-equiv var var-equiv) (equal (svex-env-lookup var env) (svex-env-lookup var-equiv env))) :rule-classes :congruence)
Theorem:
(defthm svex-env-lookup-of-svex-env-fix-env (equal (svex-env-lookup var (svex-env-fix env)) (svex-env-lookup var env)))
Theorem:
(defthm svex-env-lookup-svex-env-equiv-congruence-on-env (implies (svex-env-equiv env env-equiv) (equal (svex-env-lookup var env) (svex-env-lookup var env-equiv))) :rule-classes :congruence)
Theorem:
(defthm svex-env-lookup-in-empty (equal (svex-env-lookup var nil) (4vec-x)))
Theorem:
(defthm svex-env-lookup-in-svex-env-acons (equal (svex-env-lookup var1 (svex-env-acons var2 val env)) (if (svar-equiv var1 var2) (4vec-fix val) (svex-env-lookup var1 env))))