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) :unsigned) (and (true-listp (cdr x)) (eql (len (cdr x)) 2) (b* ((value (std::da-nth 0 (cdr x))) (size (std::da-nth 1 (cdr x)))) (and (integerp value) (leo-early::bitsizep size))))) ((eq (car x) :signed) (and (true-listp (cdr x)) (eql (len (cdr x)) 2) (b* ((value (std::da-nth 0 (cdr x))) (size (std::da-nth 1 (cdr x)))) (and (integerp value) (leo-early::bitsizep size))))) ((eq (car x) :field) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((value (std::da-nth 0 (cdr x)))) (integerp value)))) ((eq (car x) :group) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((value (std::da-nth 0 (cdr x)))) (integerp value)))) ((eq (car x) :scalar) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((value (std::da-nth 0 (cdr x)))) (integerp value)))) ((eq (car x) :address) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((value (std::da-nth 0 (cdr x)))) (leo-early::addressp value)))) (t (and (eq (car x) :string) (and (true-listp (cdr x)) (eql (len (cdr x)) 1)) (b* ((value (std::da-nth 0 (cdr x)))) (leo-early::char-listp value))))))))
Theorem:
(defthm consp-when-literalp (implies (literalp x) (consp x)) :rule-classes :compound-recognizer)