Fixing function for rw-pair structures.
Function:
(defun rw-pair-fix$inline (x) (declare (xargs :guard (rw-pair-p x))) (let ((__function__ 'rw-pair-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((hyps (pseudo-term-list-fix (std::da-nth 0 x))) (concl (pseudo-term-fix (std::da-nth 1 x)))) (list hyps concl)) :exec x)))
Theorem:
(defthm rw-pair-p-of-rw-pair-fix (b* ((new-x (rw-pair-fix$inline x))) (rw-pair-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm rw-pair-fix-when-rw-pair-p (implies (rw-pair-p x) (equal (rw-pair-fix x) x)))
Function:
(defun rw-pair-equiv$inline (x y) (declare (xargs :guard (and (rw-pair-p x) (rw-pair-p y)))) (equal (rw-pair-fix x) (rw-pair-fix y)))
Theorem:
(defthm rw-pair-equiv-is-an-equivalence (and (booleanp (rw-pair-equiv x y)) (rw-pair-equiv x x) (implies (rw-pair-equiv x y) (rw-pair-equiv y x)) (implies (and (rw-pair-equiv x y) (rw-pair-equiv y z)) (rw-pair-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm rw-pair-equiv-implies-equal-rw-pair-fix-1 (implies (rw-pair-equiv x x-equiv) (equal (rw-pair-fix x) (rw-pair-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm rw-pair-fix-under-rw-pair-equiv (rw-pair-equiv (rw-pair-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-rw-pair-fix-1-forward-to-rw-pair-equiv (implies (equal (rw-pair-fix x) y) (rw-pair-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-rw-pair-fix-2-forward-to-rw-pair-equiv (implies (equal x (rw-pair-fix y)) (rw-pair-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm rw-pair-equiv-of-rw-pair-fix-1-forward (implies (rw-pair-equiv (rw-pair-fix x) y) (rw-pair-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm rw-pair-equiv-of-rw-pair-fix-2-forward (implies (rw-pair-equiv x (rw-pair-fix y)) (rw-pair-equiv x y)) :rule-classes :forward-chaining)