Recognizer for value structures.
(valuep x) → *
Function:
(defun valuep (x) (declare (xargs :guard t)) (let ((__function__ 'valuep)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :number)) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((get (std::da-nth 0 (cdr x)))) (acl2-numberp get)))) ((eq (car x) :character) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((get (std::da-nth 0 (cdr x)))) (characterp get)))) ((eq (car x) :string) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((get (std::da-nth 0 (cdr x)))) (stringp get)))) ((eq (car x) :symbol) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((get (std::da-nth 0 (cdr x)))) (symbol-valuep get)))) (t (and (eq (car x) :cons) (and (true-listp (cdr x)) (eql (len (cdr x)) 2)) (b* ((car (std::da-nth 0 (cdr x))) (cdr (std::da-nth 1 (cdr x)))) (and (valuep car) (valuep cdr)))))))))
Theorem:
(defthm consp-when-valuep (implies (valuep x) (consp x)) :rule-classes :compound-recognizer)