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