Fixing function for vl-genvar structures.
(vl-genvar-fix x) → new-x
Function:
(defun vl-genvar-fix$inline (x) (declare (xargs :guard (vl-genvar-p x))) (let ((__function__ 'vl-genvar-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((name (str-fix (cdr (std::da-nth 0 (cdr x))))) (atts (vl-atts-fix (cdr (std::da-nth 1 (cdr x))))) (loc (vl-location-fix (cdr (std::da-nth 2 (cdr x)))))) (cons :vl-genvar (list (cons 'name name) (cons 'atts atts) (cons 'loc loc)))) :exec x)))
Theorem:
(defthm vl-genvar-p-of-vl-genvar-fix (b* ((new-x (vl-genvar-fix$inline x))) (vl-genvar-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-genvar-fix-when-vl-genvar-p (implies (vl-genvar-p x) (equal (vl-genvar-fix x) x)))
Function:
(defun vl-genvar-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (vl-genvar-p acl2::x) (vl-genvar-p acl2::y)))) (equal (vl-genvar-fix acl2::x) (vl-genvar-fix acl2::y)))
Theorem:
(defthm vl-genvar-equiv-is-an-equivalence (and (booleanp (vl-genvar-equiv x y)) (vl-genvar-equiv x x) (implies (vl-genvar-equiv x y) (vl-genvar-equiv y x)) (implies (and (vl-genvar-equiv x y) (vl-genvar-equiv y z)) (vl-genvar-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm vl-genvar-equiv-implies-equal-vl-genvar-fix-1 (implies (vl-genvar-equiv acl2::x x-equiv) (equal (vl-genvar-fix acl2::x) (vl-genvar-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm vl-genvar-fix-under-vl-genvar-equiv (vl-genvar-equiv (vl-genvar-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-vl-genvar-fix-1-forward-to-vl-genvar-equiv (implies (equal (vl-genvar-fix acl2::x) acl2::y) (vl-genvar-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-vl-genvar-fix-2-forward-to-vl-genvar-equiv (implies (equal acl2::x (vl-genvar-fix acl2::y)) (vl-genvar-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-genvar-equiv-of-vl-genvar-fix-1-forward (implies (vl-genvar-equiv (vl-genvar-fix acl2::x) acl2::y) (vl-genvar-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-genvar-equiv-of-vl-genvar-fix-2-forward (implies (vl-genvar-equiv acl2::x (vl-genvar-fix acl2::y)) (vl-genvar-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)