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