Fixing function for vl-select structures.
(vl-select-fix x) → new-x
Function:
(defun vl-select-fix$inline (x) (declare (xargs :guard (vl-select-p x))) (let ((__function__ 'vl-select-fix)) (declare (ignorable __function__)) (mbe :logic (common-lisp::case (vl-select-kind x) (:field (b* ((name (str-fix (cdr x)))) (cons :field name))) (:index (b* ((val (vl-expr-fix (cdr x)))) (cons :index val)))) :exec x)))
Theorem:
(defthm vl-select-p-of-vl-select-fix (b* ((new-x (vl-select-fix$inline x))) (vl-select-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-select-fix-when-vl-select-p (implies (vl-select-p x) (equal (vl-select-fix x) x)))
Function:
(defun vl-select-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (vl-select-p acl2::x) (vl-select-p acl2::y)))) (equal (vl-select-fix acl2::x) (vl-select-fix acl2::y)))
Theorem:
(defthm vl-select-equiv-is-an-equivalence (and (booleanp (vl-select-equiv x y)) (vl-select-equiv x x) (implies (vl-select-equiv x y) (vl-select-equiv y x)) (implies (and (vl-select-equiv x y) (vl-select-equiv y z)) (vl-select-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm vl-select-equiv-implies-equal-vl-select-fix-1 (implies (vl-select-equiv acl2::x x-equiv) (equal (vl-select-fix acl2::x) (vl-select-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm vl-select-fix-under-vl-select-equiv (vl-select-equiv (vl-select-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-vl-select-fix-1-forward-to-vl-select-equiv (implies (equal (vl-select-fix acl2::x) acl2::y) (vl-select-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-vl-select-fix-2-forward-to-vl-select-equiv (implies (equal acl2::x (vl-select-fix acl2::y)) (vl-select-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-select-equiv-of-vl-select-fix-1-forward (implies (vl-select-equiv (vl-select-fix acl2::x) acl2::y) (vl-select-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-select-equiv-of-vl-select-fix-2-forward (implies (vl-select-equiv acl2::x (vl-select-fix acl2::y)) (vl-select-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-select-kind$inline-of-vl-select-fix-x (equal (vl-select-kind$inline (vl-select-fix x)) (vl-select-kind$inline x)))
Theorem:
(defthm vl-select-kind$inline-vl-select-equiv-congruence-on-x (implies (vl-select-equiv x x-equiv) (equal (vl-select-kind$inline x) (vl-select-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-vl-select-fix (consp (vl-select-fix x)) :rule-classes :type-prescription)