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* ((value (std::da-nth 0 (cdr x)))) (booleanp value)))) ((eq (car x) :character) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((value (std::da-nth 0 (cdr x)))) (characterp value)))) ((eq (car x) :string) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((value (std::da-nth 0 (cdr x)))) (stringp value)))) (t (and (eq (car x) :integer) (and (true-listp (cdr x)) (eql (len (cdr x)) 1)) (b* ((value (std::da-nth 0 (cdr x)))) (natp value))))))))
Theorem:
(defthm consp-when-literalp (implies (literalp x) (consp x)) :rule-classes :compound-recognizer)