• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Error-checking
        • Apt
        • Abnf
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Prime-field-constraint-systems
        • Soft
        • Bv
        • Imp-language
        • Event-macros
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
          • Primitive-functions
          • Translated-terms
          • Values
            • Value
              • Valuep
                • Value-case
                • Value-fix
                • Value-equiv
                • Value-count
                • Value-cons
                • Value-symbol
                • Value-string
                • Value-number
                • Value-character
                • Value-kind
              • Symbol-value
              • Lower-symbol
              • Lift-symbol-list
              • Symbol-value-option
              • Value-option
              • Lift-value
              • Lift-symbol
              • Value-rational->get
              • Value-integer->get
              • Value-case-rational
              • Value-case-integer
              • Value-symbol-list
              • Value-list-of
              • Lower-value
              • Value-list
              • Symbol-value-list
              • Symbol-value-set
              • Value-nil
              • Value-t
            • Evaluation
            • Program-equivalence
            • Functions
            • Packages
            • Programs
            • Interpreter
            • Evaluation-states
          • Prime-fields
          • Java
          • C
          • Syntheto
          • Number-theory
          • Cryptography
          • Lists-light
          • File-io-light
          • Json
          • Built-ins
          • Solidity
          • Axe
          • Std-extensions
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • Value

    Valuep

    Recognizer for value structures.

    Signature
    (valuep x) → *

    Definitions and Theorems

    Function: valuep

    (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: consp-when-valuep

    (defthm consp-when-valuep
            (implies (valuep x) (consp x))
            :rule-classes :compound-recognizer)