Recognizes well-formed index expressions into hierarchical identifier
pieces, e.g., the
(vl-hidindex-p x) → bool
Function:
(defun vl-hidindex-p (x) (declare (xargs :guard (vl-expr-p x))) (let ((__function__ 'vl-hidindex-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-index) (vl-hidindex-p (first x.args))))))
Theorem:
(defthm vl-hidname-p-when-vl-hidindex-p (implies (and (vl-hidindex-p x) (vl-atom-p x)) (vl-hidname-p x)))
Theorem:
(defthm vl-nonatom->op-when-vl-hidindex-p (implies (and (vl-hidindex-p x) (force (not (vl-atom-p x)))) (equal (vl-nonatom->op x) :vl-index)) :rule-classes ((:rewrite) (:forward-chaining)))
Theorem:
(defthm arity-when-vl-hidindex-p (implies (and (vl-hidindex-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-hidindex-p (implies (and (vl-hidindex-p x) (force (not (vl-atom-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-vl-expr-fix-x (equal (vl-hidindex-p (vl-expr-fix x)) (vl-hidindex-p x)))
Theorem:
(defthm vl-hidindex-p-vl-expr-equiv-congruence-on-x (implies (vl-expr-equiv x x-equiv) (equal (vl-hidindex-p x) (vl-hidindex-p x-equiv))) :rule-classes :congruence)
Theorem:
(defthm vl-hidindex-p-of-make-vl-atom (equal (vl-hidindex-p (make-vl-atom :guts guts :finalwidth finalwidth :finaltype finaltype)) (or (vl-hidpiece-p (vl-atomguts-fix guts)) (vl-id-p (vl-atomguts-fix guts)))))
Theorem:
(defthm vl-hidindex-p-of-make-vl-nonatom (implies (force (vl-hidindex-p (first args))) (vl-hidindex-p (make-vl-nonatom :op :vl-index :args args :atts atts :finalwidth finalwidth :finaltype finaltype))))
Theorem:
(defthm not-vl-hidindex-p-by-op (implies (and (not (eq (vl-nonatom->op x) :vl-index)) (force (not (vl-atom-p x)))) (not (vl-hidindex-p x))))
Theorem:
(defthm vl-hidindex-p-of-first-of-vl-nonatom->args-when-vl-hidindex-p (implies (and (vl-hidindex-p x) (force (not (vl-atom-p x)))) (vl-hidindex-p (first (vl-nonatom->args x)))))