Fixing function for modscope structures.
(modscope-fix x) → new-x
Function:
(defun modscope-fix$inline (x) (declare (xargs :guard (modscope-p x))) (let ((__function__ 'modscope-fix)) (declare (ignorable __function__)) (mbe :logic (case (modscope-kind x) (:top (b* ((modidx (nfix (cdr x)))) (cons :top modidx))) (:nested (b* ((modidx (nfix (std::prod-car (std::prod-car (cdr x))))) (wireoffset (nfix (std::prod-cdr (std::prod-car (cdr x))))) (instoffset (nfix (std::prod-car (std::prod-cdr (cdr x))))) (upper (modscope-fix (std::prod-cdr (std::prod-cdr (cdr x)))))) (cons :nested (std::prod-cons (std::prod-cons modidx wireoffset) (std::prod-cons instoffset upper)))))) :exec x)))
Theorem:
(defthm modscope-p-of-modscope-fix (b* ((new-x (modscope-fix$inline x))) (modscope-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm modscope-fix-when-modscope-p (implies (modscope-p x) (equal (modscope-fix x) x)))
Function:
(defun modscope-equiv$inline (x y) (declare (xargs :guard (and (modscope-p x) (modscope-p y)))) (equal (modscope-fix x) (modscope-fix y)))
Theorem:
(defthm modscope-equiv-is-an-equivalence (and (booleanp (modscope-equiv x y)) (modscope-equiv x x) (implies (modscope-equiv x y) (modscope-equiv y x)) (implies (and (modscope-equiv x y) (modscope-equiv y z)) (modscope-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm modscope-equiv-implies-equal-modscope-fix-1 (implies (modscope-equiv x x-equiv) (equal (modscope-fix x) (modscope-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm modscope-fix-under-modscope-equiv (modscope-equiv (modscope-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-modscope-fix-1-forward-to-modscope-equiv (implies (equal (modscope-fix x) y) (modscope-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-modscope-fix-2-forward-to-modscope-equiv (implies (equal x (modscope-fix y)) (modscope-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm modscope-equiv-of-modscope-fix-1-forward (implies (modscope-equiv (modscope-fix x) y) (modscope-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm modscope-equiv-of-modscope-fix-2-forward (implies (modscope-equiv x (modscope-fix y)) (modscope-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm modscope-kind$inline-of-modscope-fix-x (equal (modscope-kind$inline (modscope-fix x)) (modscope-kind$inline x)))
Theorem:
(defthm modscope-kind$inline-modscope-equiv-congruence-on-x (implies (modscope-equiv x x-equiv) (equal (modscope-kind$inline x) (modscope-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-modscope-fix (consp (modscope-fix x)) :rule-classes :type-prescription)