Given a hid and a suffix, such as
(vl-hid-prefix-for-subhid outer inner) → prefix-hid
Function:
(defun vl-hid-prefix-for-subhid (outer inner) (declare (xargs :guard (and (vl-hidexpr-p outer) (vl-hidexpr-p inner)))) (declare (xargs :guard (vl-subhid-p inner outer))) (let ((__function__ 'vl-hid-prefix-for-subhid)) (declare (ignorable __function__)) (vl-hidexpr-case outer :end (vl-hidexpr-fix outer) :dot (if (vl-hidexpr-equiv inner outer) (make-vl-hidexpr-end :name (vl-hidindex->name outer.first)) (make-vl-hidexpr-dot :first outer.first :rest (vl-hid-prefix-for-subhid outer.rest inner))))))
Theorem:
(defthm vl-hidexpr-p-of-vl-hid-prefix-for-subhid (b* ((prefix-hid (vl-hid-prefix-for-subhid outer inner))) (vl-hidexpr-p prefix-hid)) :rule-classes :rewrite)
Theorem:
(defthm vl-hid-prefix-for-subhid-of-vl-hidexpr-fix-outer (equal (vl-hid-prefix-for-subhid (vl-hidexpr-fix outer) inner) (vl-hid-prefix-for-subhid outer inner)))
Theorem:
(defthm vl-hid-prefix-for-subhid-vl-hidexpr-equiv-congruence-on-outer (implies (vl-hidexpr-equiv outer outer-equiv) (equal (vl-hid-prefix-for-subhid outer inner) (vl-hid-prefix-for-subhid outer-equiv inner))) :rule-classes :congruence)
Theorem:
(defthm vl-hid-prefix-for-subhid-of-vl-hidexpr-fix-inner (equal (vl-hid-prefix-for-subhid outer (vl-hidexpr-fix inner)) (vl-hid-prefix-for-subhid outer inner)))
Theorem:
(defthm vl-hid-prefix-for-subhid-vl-hidexpr-equiv-congruence-on-inner (implies (vl-hidexpr-equiv inner inner-equiv) (equal (vl-hid-prefix-for-subhid outer inner) (vl-hid-prefix-for-subhid outer inner-equiv))) :rule-classes :congruence)