Recognizer for const structures.
(constp x) → *
Function:
(defun constp (x) (declare (xargs :guard t)) (let ((__function__ 'constp)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :int)) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((unwrap (std::da-nth 0 (cdr x)))) (iconstp unwrap)))) ((eq (car x) :float) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((unwrap (std::da-nth 0 (cdr x)))) (fconstp unwrap)))) ((eq (car x) :enum) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((unwrap (std::da-nth 0 (cdr x)))) (identp unwrap)))) (t (and (eq (car x) :char) (and (true-listp (cdr x)) (eql (len (cdr x)) 1)) (b* ((unwrap (std::da-nth 0 (cdr x)))) (cconstp unwrap))))))))
Theorem:
(defthm consp-when-constp (implies (constp x) (consp x)) :rule-classes :compound-recognizer)