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