Function:
(defun env-update (var val env) (declare (xargs :guard (and (natp var) (booleanp val) (natp env)))) (let ((__function__ 'env-update)) (declare (ignorable __function__)) (install-bit var (bool->bit val) (lnfix env))))
Theorem:
(defthm natp-of-env-update (b* ((new-env (env-update var val env))) (natp new-env)) :rule-classes :type-prescription)
Theorem:
(defthm env-lookup-of-env-update-split (equal (env-lookup var (env-update var1 val env)) (if (equal (nfix var) (nfix var1)) (acl2::bool-fix val) (env-lookup var env))))
Theorem:
(defthm env-update-of-env-update (equal (env-update n x (env-update n y env)) (env-update n x env)))
Theorem:
(defthm env-update-swap (implies (not (nat-equiv var1 var2)) (equal (env-update var2 val2 (env-update var1 val1 env)) (env-update var1 val1 (env-update var2 val2 env)))))
Theorem:
(defthm env-update-redundant (implies (iff (env-lookup n env) val) (equal (env-update n val env) (nfix env))))
Theorem:
(defthm env-update-of-nfix-var (equal (env-update (nfix var) val env) (env-update var val env)))
Theorem:
(defthm env-update-nat-equiv-congruence-on-var (implies (nat-equiv var var-equiv) (equal (env-update var val env) (env-update var-equiv val env))) :rule-classes :congruence)
Theorem:
(defthm env-update-of-bool-fix-val (equal (env-update var (acl2::bool-fix val) env) (env-update var val env)))
Theorem:
(defthm env-update-iff-congruence-on-val (implies (iff val val-equiv) (equal (env-update var val env) (env-update var val-equiv env))) :rule-classes :congruence)
Theorem:
(defthm env-update-of-nfix-env (equal (env-update var val (nfix env)) (env-update var val env)))
Theorem:
(defthm env-update-nat-equiv-congruence-on-env (implies (nat-equiv env env-equiv) (equal (env-update var val env) (env-update var val env-equiv))) :rule-classes :congruence)