Basic equivalence relation for maybe-expression structures.
Function:
(defun maybe-expression-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (maybe-expressionp acl2::x) (maybe-expressionp acl2::y)))) (equal (maybe-expression-fix acl2::x) (maybe-expression-fix acl2::y)))
Theorem:
(defthm maybe-expression-equiv-is-an-equivalence (and (booleanp (maybe-expression-equiv x y)) (maybe-expression-equiv x x) (implies (maybe-expression-equiv x y) (maybe-expression-equiv y x)) (implies (and (maybe-expression-equiv x y) (maybe-expression-equiv y z)) (maybe-expression-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm maybe-expression-equiv-implies-equal-maybe-expression-fix-1 (implies (maybe-expression-equiv acl2::x x-equiv) (equal (maybe-expression-fix acl2::x) (maybe-expression-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm maybe-expression-fix-under-maybe-expression-equiv (maybe-expression-equiv (maybe-expression-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-maybe-expression-fix-1-forward-to-maybe-expression-equiv (implies (equal (maybe-expression-fix acl2::x) acl2::y) (maybe-expression-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-maybe-expression-fix-2-forward-to-maybe-expression-equiv (implies (equal acl2::x (maybe-expression-fix acl2::y)) (maybe-expression-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm maybe-expression-equiv-of-maybe-expression-fix-1-forward (implies (maybe-expression-equiv (maybe-expression-fix acl2::x) acl2::y) (maybe-expression-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm maybe-expression-equiv-of-maybe-expression-fix-2-forward (implies (maybe-expression-equiv acl2::x (maybe-expression-fix acl2::y)) (maybe-expression-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)