Recognizer for literal structures.
(literalp x) → *
Function:
(defun literalp (x) (declare (xargs :guard t)) (let ((__function__ 'literalp)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :boolean)) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((get (std::da-nth 0 (cdr x)))) (booleanp get)))) ((eq (car x) :dec-number) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((get (std::da-nth 0 (cdr x)))) (natp get)))) ((eq (car x) :hex-number) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((get (std::da-nth 0 (cdr x)))) (hex-digit-listp get)))) ((eq (car x) :plain-string) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((get (std::da-nth 0 (cdr x)))) (plain-stringp get)))) (t (and (eq (car x) :hex-string) (and (true-listp (cdr x)) (eql (len (cdr x)) 1)) (b* ((get (std::da-nth 0 (cdr x)))) (hex-stringp get))))))))
Theorem:
(defthm consp-when-literalp (implies (literalp x) (consp x)) :rule-classes :compound-recognizer)