• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Aleo
        • Aleobft
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
              • Dynamic-semantics
                • Execution
                • Values
                  • Int-valuep
                  • Value-option
                  • Type-of-value
                  • Value-option-result
                  • Value-list-result
                  • Name+value
                  • Value-result
                  • Make-int-value
                  • Type-map-of-value-map
                  • Name+type-of-name+value
                  • Int-value-bound-theorems
                  • Int-value-to-int
                  • Int-value-numbits
                  • Value/valuelist
                    • Value
                      • Valuep
                      • Value-case
                      • Value-equiv
                      • Value-struct
                      • Value-kind
                        • Value-u64
                        • Value-u32
                        • Value-u16
                        • Value-u128
                        • Value-tuple
                        • Value-string
                        • Value-i64
                        • Value-i32
                        • Value-i16
                        • Value-i128
                        • Value-bool
                        • Value-address
                        • Value-u8
                        • Value-scalar
                        • Value-i8
                        • Value-group
                        • Value-field
                        • Value-fix
                        • Value-count
                      • Value-list
                      • Value-map
                    • *most-positive-i8*
                    • *most-positive-i64*
                    • *most-positive-i32*
                    • *most-positive-i16*
                    • *most-positive-i128*
                    • *most-negative-i8*
                    • *most-negative-i64*
                    • *most-negative-i32*
                    • *most-negative-i16*
                    • *most-negative-i128*
                    • *greatest-u8*
                    • *greatest-u64*
                    • *greatest-u32*
                    • *greatest-u16*
                    • *greatest-u128*
                  • Dynamic-environments
                  • Arithmetic-operations
                  • Curve-parameterization
                  • Shift-operations
                  • Errors
                  • Value-expressions
                  • Locations
                  • Input-execution
                  • Edwards-bls12-generator
                  • Equality-operations
                  • Logical-operations
                  • Program-execution
                  • Ordering-operations
                  • Bitwise-operations
                  • Literal-evaluation
                  • Type-maps-for-struct-components
                  • Output-execution
                  • Tuple-operations
                  • Struct-operations
                • Compilation
                • Static-semantics
                • Concrete-syntax
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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) :bool)) :bool)
                          ((eq (car x) :u8) :u8)
                          ((eq (car x) :u16) :u16)
                          ((eq (car x) :u32) :u32)
                          ((eq (car x) :u64) :u64)
                          ((eq (car x) :u128) :u128)
                          ((eq (car x) :i8) :i8)
                          ((eq (car x) :i16) :i16)
                          ((eq (car x) :i32) :i32)
                          ((eq (car x) :i64) :i64)
                          ((eq (car x) :i128) :i128)
                          ((eq (car x) :field) :field)
                          ((eq (car x) :group) :group)
                          ((eq (car x) :scalar) :scalar)
                          ((eq (car x) :address) :address)
                          ((eq (car x) :string) :string)
                          ((eq (car x) :tuple) :tuple)
                          (t :struct))
             :exec (car x))))

    Theorem: value-kind-possibilities

    (defthm value-kind-possibilities
      (or (equal (value-kind x) :bool)
          (equal (value-kind x) :u8)
          (equal (value-kind x) :u16)
          (equal (value-kind x) :u32)
          (equal (value-kind x) :u64)
          (equal (value-kind x) :u128)
          (equal (value-kind x) :i8)
          (equal (value-kind x) :i16)
          (equal (value-kind x) :i32)
          (equal (value-kind x) :i64)
          (equal (value-kind x) :i128)
          (equal (value-kind x) :field)
          (equal (value-kind x) :group)
          (equal (value-kind x) :scalar)
          (equal (value-kind x) :address)
          (equal (value-kind x) :string)
          (equal (value-kind x) :tuple)
          (equal (value-kind x) :struct))
      :rule-classes
      ((:forward-chaining :trigger-terms ((value-kind x)))))