Recognizer for plexeme structures.
(plexemep x) → *
Function:
(defun plexemep (x) (declare (xargs :guard t)) (and (consp x) (cond ((or (atom x) (eq (car x) :header)) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((name (std::da-nth 0 (cdr x)))) (header-namep name)))) ((eq (car x) :ident) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((ident (std::da-nth 0 (cdr x)))) (identp ident)))) ((eq (car x) :number) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((number (std::da-nth 0 (cdr x)))) (pnumberp number)))) ((eq (car x) :char) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((const (std::da-nth 0 (cdr x)))) (cconstp const)))) ((eq (car x) :string) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((literal (std::da-nth 0 (cdr x)))) (stringlitp literal)))) ((eq (car x) :punctuator) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((punctuator (std::da-nth 0 (cdr x)))) (stringp punctuator)))) ((eq (car x) :other) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((char (std::da-nth 0 (cdr x)))) (natp char)))) ((eq (car x) :block-comment) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((content (std::da-nth 0 (cdr x)))) (nat-listp content)))) ((eq (car x) :line-comment) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((content (std::da-nth 0 (cdr x)))) (nat-listp content)))) ((eq (car x) :newline) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((chars (std::da-nth 0 (cdr x)))) (newlinep chars)))) ((eq (car x) :spaces) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((count (std::da-nth 0 (cdr x)))) (posp count)))) ((eq (car x) :horizontal-tab) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) ((eq (car x) :vertical-tab) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) (t (and (eq (car x) :form-feed) (and (true-listp (cdr x)) (eql (len (cdr x)) 0)) (b* nil t))))))
Theorem:
(defthm consp-when-plexemep (implies (plexemep x) (consp x)) :rule-classes :compound-recognizer)