Fixing function for vl-rhs structures.
Function:
(defun vl-rhs-fix$inline (x) (declare (xargs :guard (vl-rhs-p x))) (let ((__function__ 'vl-rhs-fix)) (declare (ignorable __function__)) (mbe :logic (common-lisp::case (vl-rhs-kind x) (:vl-rhsexpr (b* ((guts (vl-expr-fix (std::da-nth 0 (cdr x))))) (cons :vl-rhsexpr (list guts)))) (:vl-rhsnew (b* ((arrsize (vl-maybe-expr-fix (std::da-nth 0 (cdr x)))) (args (vl-exprlist-fix (std::da-nth 1 (cdr x))))) (cons :vl-rhsnew (list arrsize args))))) :exec x)))
Theorem:
(defthm vl-rhs-p-of-vl-rhs-fix (b* ((new-x (vl-rhs-fix$inline x))) (vl-rhs-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-rhs-fix-when-vl-rhs-p (implies (vl-rhs-p x) (equal (vl-rhs-fix x) x)))
Function:
(defun vl-rhs-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (vl-rhs-p acl2::x) (vl-rhs-p acl2::y)))) (equal (vl-rhs-fix acl2::x) (vl-rhs-fix acl2::y)))
Theorem:
(defthm vl-rhs-equiv-is-an-equivalence (and (booleanp (vl-rhs-equiv x y)) (vl-rhs-equiv x x) (implies (vl-rhs-equiv x y) (vl-rhs-equiv y x)) (implies (and (vl-rhs-equiv x y) (vl-rhs-equiv y z)) (vl-rhs-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm vl-rhs-equiv-implies-equal-vl-rhs-fix-1 (implies (vl-rhs-equiv acl2::x x-equiv) (equal (vl-rhs-fix acl2::x) (vl-rhs-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm vl-rhs-fix-under-vl-rhs-equiv (vl-rhs-equiv (vl-rhs-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-vl-rhs-fix-1-forward-to-vl-rhs-equiv (implies (equal (vl-rhs-fix acl2::x) acl2::y) (vl-rhs-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-vl-rhs-fix-2-forward-to-vl-rhs-equiv (implies (equal acl2::x (vl-rhs-fix acl2::y)) (vl-rhs-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-rhs-equiv-of-vl-rhs-fix-1-forward (implies (vl-rhs-equiv (vl-rhs-fix acl2::x) acl2::y) (vl-rhs-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-rhs-equiv-of-vl-rhs-fix-2-forward (implies (vl-rhs-equiv acl2::x (vl-rhs-fix acl2::y)) (vl-rhs-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-rhs-kind$inline-of-vl-rhs-fix-x (equal (vl-rhs-kind$inline (vl-rhs-fix x)) (vl-rhs-kind$inline x)))
Theorem:
(defthm vl-rhs-kind$inline-vl-rhs-equiv-congruence-on-x (implies (vl-rhs-equiv x x-equiv) (equal (vl-rhs-kind$inline x) (vl-rhs-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-vl-rhs-fix (consp (vl-rhs-fix x)) :rule-classes :type-prescription)