Recognizer for svex-select structures.
(svex-select-p x) → *
Function:
(defun svex-select-p (x) (declare (xargs :guard t)) (let ((__function__ 'svex-select-p)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :var)) (and (std::prod-consp (cdr x)) (b* ((name (std::prod-car (cdr x))) (width (std::prod-cdr (cdr x)))) (and (svar-p name) (natp width))))) (t (and (eq (car x) :part) (and (std::prod-consp (cdr x)) (std::prod-consp (std::prod-cdr (cdr x)))) (b* ((lsb (std::prod-car (cdr x))) (width (std::prod-car (std::prod-cdr (cdr x)))) (subexp (std::prod-cdr (std::prod-cdr (cdr x))))) (and (svex-p lsb) (natp width) (svex-select-p subexp)))))))))
Theorem:
(defthm consp-when-svex-select-p (implies (svex-select-p x) (consp x)) :rule-classes :compound-recognizer)