Recognizes well-formed hierarchical identifier expressions.
(vl-hidexpr-p x) → bool
Examples:
foo foo.bar foo[1].bar foo[1][2][3].bar.baz
Note that a
foo.bar[3] <--- not a HIDEXPR. Instead, this is a :vl-index or :vl-bitselect operator with: arg1 == foo.bar (a hid) arg2 == 3
Function:
(defun vl-hidexpr-p (x) (declare (xargs :guard (vl-expr-p x))) (let ((__function__ 'vl-hidexpr-p)) (declare (ignorable __function__)) (b* (((when (vl-atom-p x)) (vl-hidname-p x)) ((vl-nonatom x) x)) (and (vl-op-equiv x.op :vl-hid-dot) (vl-hidindex-p (first x.args)) (vl-hidexpr-p (second x.args))))))
Theorem:
(defthm vl-hidexpr-p-of-vl-expr-fix-x (equal (vl-hidexpr-p (vl-expr-fix x)) (vl-hidexpr-p x)))
Theorem:
(defthm vl-hidexpr-p-vl-expr-equiv-congruence-on-x (implies (vl-expr-equiv x x-equiv) (equal (vl-hidexpr-p x) (vl-hidexpr-p x-equiv))) :rule-classes :congruence)
Theorem:
(defthm vl-hidpiece-p-of-when-vl-hidexpr-p (implies (and (vl-hidexpr-p x) (vl-atom-p x)) (vl-hidname-p x)))
Theorem:
(defthm vl-nonatom->op-when-vl-hidexpr-p-forward (implies (and (vl-hidexpr-p x) (not (vl-atom-p x))) (equal (vl-nonatom->op x) :vl-hid-dot)) :rule-classes :forward-chaining)
Theorem:
(defthm not-vl-hidexpr-p-by-op (implies (and (not (eq (vl-nonatom->op x) :vl-hid-dot)) (force (not (vl-atom-p x)))) (not (vl-hidexpr-p x))))
Theorem:
(defthm vl-op-arity-when-vl-hidexpr-p (implies (and (vl-hidexpr-p x) (force (not (vl-atom-p x)))) (equal (vl-op-arity (vl-nonatom->op x)) 2)))
Theorem:
(defthm len-of-vl-nonatom->args-when-vl-hidexpr-p (implies (and (vl-hidexpr-p x) (force (not (vl-atom-p x))) (force (vl-expr-p x))) (and (equal (len (vl-nonatom->args x)) 2) (consp (vl-nonatom->args x)) (consp (cdr (vl-nonatom->args x))))))
Theorem:
(defthm vl-hidindex-p-of-first-of-vl-nonatom->args-when-vl-hidexpr-p (implies (and (vl-hidexpr-p x) (force (not (vl-atom-p x)))) (vl-hidindex-p (first (vl-nonatom->args x)))))
Theorem:
(defthm vl-hidexpr-p-of-second-of-vl-nonatom->args-when-vl-hidexpr-p (implies (and (vl-hidexpr-p x) (force (not (vl-atom-p x)))) (vl-hidexpr-p (second (vl-nonatom->args x)))))
Theorem:
(defthm vl-hidexpr-p-of-vl-atom (equal (vl-hidexpr-p (make-vl-atom :guts guts :finalwidth finalwidth :finaltype finaltype)) (let ((guts (vl-atomguts-fix guts))) (or (vl-hidpiece-p guts) (vl-id-p guts)))))
Theorem:
(defthm vl-hidexpr-p-of-vl-nonatom-dot (implies (and (equal op :vl-hid-dot) (force (vl-hidindex-p (first args))) (force (vl-hidexpr-p (second args)))) (vl-hidexpr-p (make-vl-nonatom :op op :args args :atts atts :finalwidth finalwidth :finaltype finaltype))))
Theorem:
(defthm vl-hidexpr-p-when-id-atom (implies (and (equal (vl-expr-kind x) :atom) (vl-id-p (vl-atom->guts x))) (vl-hidexpr-p x)))