• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • 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
              • Lower-value
              • Value-list-of
              • Value-list
              • Symbol-value-list
              • Symbol-value-set
              • Value-t
              • Value-nil
            • Evaluation
            • Program-equivalence
            • Functions
            • Packages
            • Programs
            • Interpreter
            • Evaluation-states
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Value

    Value-kind

    Get the kind (tag) of a value structure.

    Signature
    (value-kind x) → kind
    Arguments
    x — Guard (valuep x).

    Definitions and Theorems

    Function: value-kind$inline

    (defun value-kind$inline (x)
      (declare (xargs :guard (valuep x)))
      (let ((__function__ 'value-kind))
        (declare (ignorable __function__))
        (mbe :logic (cond ((or (atom x) (eq (car x) :number))
                           :number)
                          ((eq (car x) :character) :character)
                          ((eq (car x) :string) :string)
                          ((eq (car x) :symbol) :symbol)
                          (t :cons))
             :exec (car x))))

    Theorem: value-kind-possibilities

    (defthm value-kind-possibilities
      (or (equal (value-kind x) :number)
          (equal (value-kind x) :character)
          (equal (value-kind x) :string)
          (equal (value-kind x) :symbol)
          (equal (value-kind x) :cons))
      :rule-classes
      ((:forward-chaining :trigger-terms ((value-kind x)))))