This is a universal equivalence, introduced using def-universal-equiv.
Function:
(defun svex-envs-equivalent (x y) (declare (xargs :non-executable t)) (declare (xargs :guard t)) (declare (xargs :non-executable t)) (prog2$ (acl2::throw-nonexec-error 'svex-envs-equivalent (list x y)) (let ((k (svex-envs-equivalent-witness x y))) (and (equal (svex-env-lookup k x) (svex-env-lookup k y)) (iff (svex-env-boundp k x) (svex-env-boundp k y))))))
Theorem:
(defthm svex-envs-equivalent-necc (implies (not (and (equal (svex-env-lookup k x) (svex-env-lookup k y)) (iff (svex-env-boundp k x) (svex-env-boundp k y)))) (not (svex-envs-equivalent x y))))
Theorem:
(defthm svex-envs-equivalent-witnessing-witness-rule-correct (implies (not ((lambda (k y x) (not (if (equal (svex-env-lookup k x) (svex-env-lookup k y)) (iff (svex-env-boundp k x) (svex-env-boundp k y)) 'nil))) (svex-envs-equivalent-witness x y) y x)) (svex-envs-equivalent x y)) :rule-classes nil)
Theorem:
(defthm svex-envs-equivalent-instancing-instance-rule-correct (implies (not (if (equal (svex-env-lookup k x) (svex-env-lookup k y)) (iff (svex-env-boundp k x) (svex-env-boundp k y)) 'nil)) (not (svex-envs-equivalent x y))) :rule-classes nil)
Theorem:
(defthm svex-envs-equivalent-is-an-equivalence (and (booleanp (svex-envs-equivalent x y)) (svex-envs-equivalent x x) (implies (svex-envs-equivalent x y) (svex-envs-equivalent y x)) (implies (and (svex-envs-equivalent x y) (svex-envs-equivalent y z)) (svex-envs-equivalent x z))) :rule-classes (:equivalence))
Theorem:
(defthm svex-envs-equivalent-refines-svex-envs-similar (implies (svex-envs-equivalent x y) (svex-envs-similar x y)) :rule-classes (:refinement))
Theorem:
(defthm svex-envs-equivalent-implies-equal-svex-env-boundp-2 (implies (svex-envs-equivalent x x-equiv) (equal (svex-env-boundp k x) (svex-env-boundp k x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm set-equiv-implies-svex-envs-equivalent-svex-env-extract-1 (implies (set-equiv keys keys-equiv) (svex-envs-equivalent (svex-env-extract keys env) (svex-env-extract keys-equiv env))) :rule-classes (:congruence))
Theorem:
(defthm svex-envs-similar-implies-svex-envs-equivalent-svex-env-extract-2 (implies (svex-envs-similar env env-equiv) (svex-envs-equivalent (svex-env-extract keys env) (svex-env-extract keys env-equiv))) :rule-classes (:congruence))
Theorem:
(defthm svex-env-boundp-of-append (iff (svex-env-boundp k (append a b)) (or (svex-env-boundp k a) (svex-env-boundp k b))))
Theorem:
(defthm svex-env-lookup-of-append (equal (svex-env-lookup k (append a b)) (if (svex-env-boundp k a) (svex-env-lookup k a) (svex-env-lookup k b))))
Theorem:
(defthm svex-envs-equivalent-implies-svex-envs-equivalent-append-1 (implies (svex-envs-equivalent a a-equiv) (svex-envs-equivalent (append a b) (append a-equiv b))) :rule-classes (:congruence))
Theorem:
(defthm svex-envs-equivalent-implies-svex-envs-equivalent-append-2 (implies (svex-envs-equivalent b b-equiv) (svex-envs-equivalent (append a b) (append a b-equiv))) :rule-classes (:congruence))
Theorem:
(defthm svex-envs-similar-implies-svex-envs-similar-append-2 (implies (svex-envs-similar b b-equiv) (svex-envs-similar (append a b) (append a b-equiv))) :rule-classes (:congruence))
Theorem:
(defthm svex-env-equiv-refines-svex-envs-equivalent (implies (svex-env-equiv x y) (svex-envs-equivalent x y)) :rule-classes (:refinement))