This is a universal equivalence, introduced using def-universal-equiv.
Function:
(defun 4v-sexpr-alist-equiv (x y) (declare (xargs :non-executable t)) (declare (xargs :guard t)) (declare (xargs :non-executable t)) (prog2$ (throw-nonexec-error '4v-sexpr-alist-equiv (list x y)) (let ((k (4v-sexpr-alist-equiv-witness x y))) (and (iff (hons-assoc-equal k x) (hons-assoc-equal k y)) (4v-sexpr-equiv (cdr (hons-assoc-equal k x)) (cdr (hons-assoc-equal k y)))))))
Theorem:
(defthm 4v-sexpr-alist-equiv-necc (implies (not (and (iff (hons-assoc-equal k x) (hons-assoc-equal k y)) (4v-sexpr-equiv (cdr (hons-assoc-equal k x)) (cdr (hons-assoc-equal k y))))) (not (4v-sexpr-alist-equiv x y))))
Theorem:
(defthm 4v-sexpr-alist-equiv-witnessing-witness-rule-correct (implies (not ((lambda (k y x) (not (if (iff (hons-assoc-equal k x) (hons-assoc-equal k y)) (4v-sexpr-equiv (cdr (hons-assoc-equal k x)) (cdr (hons-assoc-equal k y))) 'nil))) (4v-sexpr-alist-equiv-witness x y) y x)) (4v-sexpr-alist-equiv x y)) :rule-classes nil)
Theorem:
(defthm 4v-sexpr-alist-equiv-instancing-instance-rule-correct (implies (not (if (iff (hons-assoc-equal k x) (hons-assoc-equal k y)) (4v-sexpr-equiv (cdr (hons-assoc-equal k x)) (cdr (hons-assoc-equal k y))) 'nil)) (not (4v-sexpr-alist-equiv x y))) :rule-classes nil)
Theorem:
(defthm 4v-sexpr-alist-equiv-is-an-equivalence (and (booleanp (4v-sexpr-alist-equiv x y)) (4v-sexpr-alist-equiv x x) (implies (4v-sexpr-alist-equiv x y) (4v-sexpr-alist-equiv y x)) (implies (and (4v-sexpr-alist-equiv x y) (4v-sexpr-alist-equiv y z)) (4v-sexpr-alist-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm alist-equiv-refines-4v-sexpr-alist-equiv (implies (alist-equiv x y) (4v-sexpr-alist-equiv x y)) :rule-classes (:refinement))
Theorem:
(defthm 4v-sexpr-alist-equiv-refines-keys-equiv (implies (4v-sexpr-alist-equiv x y) (keys-equiv x y)) :rule-classes (:refinement))
Theorem:
(defthm 4v-sexpr-alist-pair-equiv-implies-4v-sexpr-alist-equiv-cons-1 (implies (4v-sexpr-alist-pair-equiv a a-equiv) (4v-sexpr-alist-equiv (cons a b) (cons a-equiv b))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-4v-sexpr-alist-pair-equiv-hons-assoc-equal-2 (implies (4v-sexpr-alist-equiv al al-equiv) (4v-sexpr-alist-pair-equiv (hons-assoc-equal x al) (hons-assoc-equal x al-equiv))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-equiv-cdr-hons-assoc-equal-when-4v-sexpr-alist-equiv (implies (and (4v-sexpr-alist-equiv a b) (syntaxp (and (term-order a b) (not (equal a b))))) (4v-sexpr-equiv (cdr (hons-assoc-equal k a)) (cdr (hons-assoc-equal k b)))))
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-iff-4v-sexpr-alist-<=-1 (implies (4v-sexpr-alist-equiv a a-equiv) (iff (4v-sexpr-alist-<= a b) (4v-sexpr-alist-<= a-equiv b))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-iff-4v-sexpr-alist-<=-2 (implies (4v-sexpr-alist-equiv b b-equiv) (iff (4v-sexpr-alist-<= a b) (4v-sexpr-alist-<= a b-equiv))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-equiv-implies-4v-sexpr-alist-equiv-acons-2 (implies (4v-sexpr-equiv b b-equiv) (4v-sexpr-alist-equiv (acons a b c) (acons a b-equiv c))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-4v-sexpr-alist-equiv-cons-2 (implies (4v-sexpr-alist-equiv b b-equiv) (4v-sexpr-alist-equiv (cons a b) (cons a b-equiv))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-4v-sexpr-alist-equiv-append-1 (implies (4v-sexpr-alist-equiv a a-equiv) (4v-sexpr-alist-equiv (append a b) (append a-equiv b))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-4v-sexpr-alist-equiv-append-2 (implies (4v-sexpr-alist-equiv b b-equiv) (4v-sexpr-alist-equiv (append a b) (append a b-equiv))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-4v-sexpr-equiv-4v-sexpr-restrict-2 (implies (4v-sexpr-alist-equiv al1 al2) (4v-sexpr-equiv (4v-sexpr-restrict x al1) (4v-sexpr-restrict x al2))) :rule-classes :congruence)
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-4v-sexpr-list-equiv-4v-sexpr-restrict-list-2 (implies (4v-sexpr-alist-equiv al1 al2) (4v-sexpr-list-equiv (4v-sexpr-restrict-list x al1) (4v-sexpr-restrict-list x al2))) :rule-classes :congruence)
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-4v-env-equiv-4v-sexpr-eval-alist-1 (implies (4v-sexpr-alist-equiv al al-equiv) (4v-env-equiv (4v-sexpr-eval-alist al env) (4v-sexpr-eval-alist al-equiv env))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-alist-equiv-4v-sexpr-eval-alist-1 (implies (4v-sexpr-alist-equiv al al-equiv) (alist-equiv (4v-sexpr-eval-alist al env) (4v-sexpr-eval-alist al-equiv env))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-4v-sexpr-alist-equiv-4v-sexpr-compose-alist-1 (implies (4v-sexpr-alist-equiv a a-equiv) (4v-sexpr-alist-equiv (4v-sexpr-compose-alist a b) (4v-sexpr-compose-alist a-equiv b))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-alist-equiv-alt-necc (implies (not (and (keys-equiv x y) (4v-env-equiv (4v-sexpr-eval-alist x env) (4v-sexpr-eval-alist y env)))) (not (4v-sexpr-alist-equiv-alt x y))))
Theorem:
(defthm 4v-sexpr-alist-equiv-alt-witnessing-witness-rule-correct (implies (not ((lambda (env y x) (not (if (keys-equiv x y) (4v-env-equiv (4v-sexpr-eval-alist x env) (4v-sexpr-eval-alist y env)) 'nil))) (4v-sexpr-alist-equiv-alt-witness x y) y x)) (4v-sexpr-alist-equiv-alt x y)) :rule-classes nil)
Theorem:
(defthm 4v-sexpr-alist-equiv-alt-instancing-instance-rule-correct (implies (not (if (keys-equiv x y) (4v-env-equiv (4v-sexpr-eval-alist x env) (4v-sexpr-eval-alist y env)) 'nil)) (not (4v-sexpr-alist-equiv-alt x y))) :rule-classes nil)
Theorem:
(defthm 4v-sexpr-alist-equiv-alt-is-an-equivalence (and (booleanp (4v-sexpr-alist-equiv-alt x y)) (4v-sexpr-alist-equiv-alt x x) (implies (4v-sexpr-alist-equiv-alt x y) (4v-sexpr-alist-equiv-alt y x)) (implies (and (4v-sexpr-alist-equiv-alt x y) (4v-sexpr-alist-equiv-alt y z)) (4v-sexpr-alist-equiv-alt x z))) :rule-classes (:equivalence))
Theorem:
(defthm 4v-sexpr-alist-equiv-is-alt (iff (4v-sexpr-alist-equiv a b) (4v-sexpr-alist-equiv-alt a b)))
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-4v-sexpr-alist-equiv-4v-sexpr-restrict-alist-1 (implies (4v-sexpr-alist-equiv a a-equiv) (4v-sexpr-alist-equiv (4v-sexpr-restrict-alist a b) (4v-sexpr-restrict-alist a-equiv b))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-4v-sexpr-alist-equiv-4v-sexpr-restrict-alist-2 (implies (4v-sexpr-alist-equiv b b-equiv) (4v-sexpr-alist-equiv (4v-sexpr-restrict-alist a b) (4v-sexpr-restrict-alist a b-equiv))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-alist-equiv-implies-4v-sexpr-alist-equiv-4v-sexpr-alist-extract-2 (implies (4v-sexpr-alist-equiv al al-equiv) (4v-sexpr-alist-equiv (4v-sexpr-alist-extract keys al) (4v-sexpr-alist-extract keys al-equiv))) :rule-classes (:congruence))