Fixing function for modinst structures.
Function:
(defun modinst-fix$inline (x) (declare (xargs :guard (modinst-p x))) (let ((__function__ 'modinst-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((instname (name-fix (std::prod-car x))) (modname (modname-fix (std::prod-cdr x)))) (std::prod-cons instname modname)) :exec x)))
Theorem:
(defthm modinst-p-of-modinst-fix (b* ((new-x (modinst-fix$inline x))) (modinst-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm modinst-fix-when-modinst-p (implies (modinst-p x) (equal (modinst-fix x) x)))
Function:
(defun modinst-equiv$inline (x y) (declare (xargs :guard (and (modinst-p x) (modinst-p y)))) (equal (modinst-fix x) (modinst-fix y)))
Theorem:
(defthm modinst-equiv-is-an-equivalence (and (booleanp (modinst-equiv x y)) (modinst-equiv x x) (implies (modinst-equiv x y) (modinst-equiv y x)) (implies (and (modinst-equiv x y) (modinst-equiv y z)) (modinst-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm modinst-equiv-implies-equal-modinst-fix-1 (implies (modinst-equiv x x-equiv) (equal (modinst-fix x) (modinst-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm modinst-fix-under-modinst-equiv (modinst-equiv (modinst-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-modinst-fix-1-forward-to-modinst-equiv (implies (equal (modinst-fix x) y) (modinst-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-modinst-fix-2-forward-to-modinst-equiv (implies (equal x (modinst-fix y)) (modinst-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm modinst-equiv-of-modinst-fix-1-forward (implies (modinst-equiv (modinst-fix x) y) (modinst-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm modinst-equiv-of-modinst-fix-2-forward (implies (modinst-equiv x (modinst-fix y)) (modinst-equiv x y)) :rule-classes :forward-chaining)