Recognizer for modscope structures.
(modscope-p x) → *
Function:
(defun modscope-p (x) (declare (xargs :guard t)) (let ((__function__ 'modscope-p)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :top)) (and (b* ((modidx (cdr x))) (natp modidx)))) (t (and (eq (car x) :nested) (and (std::prod-consp (cdr x)) (std::prod-consp (std::prod-car (cdr x))) (std::prod-consp (std::prod-cdr (cdr x)))) (b* ((modidx (std::prod-car (std::prod-car (cdr x)))) (wireoffset (std::prod-cdr (std::prod-car (cdr x)))) (instoffset (std::prod-car (std::prod-cdr (cdr x)))) (upper (std::prod-cdr (std::prod-cdr (cdr x))))) (and (natp modidx) (natp wireoffset) (natp instoffset) (modscope-p upper)))))))))
Theorem:
(defthm consp-when-modscope-p (implies (modscope-p x) (consp x)) :rule-classes :compound-recognizer)