Get the leftmost vl-hidindex-p in a hid expression.
(vl-hidexpr->first x) → first
Examples:
foo --> foo foo.bar --> foo foo[3].bar --> foo[3] foo[3][4].bar --> foo[3][4]
Function:
(defun vl-hidexpr->first (x) (declare (xargs :guard (vl-expr-p x))) (declare (xargs :guard (vl-hidexpr-p x))) (let ((__function__ 'vl-hidexpr->first)) (declare (ignorable __function__)) (if (and (not (vl-atom-p x)) (eq (vl-nonatom->op x) :vl-hid-dot)) (first (vl-nonatom->args x)) (vl-expr-fix x))))
Theorem:
(defthm return-type-of-vl-hidexpr->first (b* ((first (vl-hidexpr->first x))) (and (vl-expr-p first) (implies (vl-hidexpr-p x) (vl-hidindex-p first)))) :rule-classes :rewrite)
Theorem:
(defthm vl-hidexpr->first-of-vl-expr-fix-x (equal (vl-hidexpr->first (vl-expr-fix x)) (vl-hidexpr->first x)))
Theorem:
(defthm vl-hidexpr->first-vl-expr-equiv-congruence-on-x (implies (vl-expr-equiv x x-equiv) (equal (vl-hidexpr->first x) (vl-hidexpr->first x-equiv))) :rule-classes :congruence)