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