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