• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • C
          • Syntax-for-tools
          • Atc
          • Transformation-tools
          • Language
            • Abstract-syntax
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Types
              • Type
                • Typep
                • Type-fix
                • Type-case
                • Type-count
                • Type-equiv
                • Type-array
                • Type-kind
                  • Type-struct
                  • Type-pointer
                  • Type-sint
                  • Type-uchar
                  • Type-void
                  • Type-ushort
                  • Type-ulong
                  • Type-ullong
                  • Type-uint
                  • Type-sshort
                  • Type-slong
                  • Type-sllong
                  • Type-schar
                  • Type-char
                • Type-name-list-to-type-list
                • Tyname-to-type
                • Member-type-list->name-list
                • Type-completep
                • Member-type
                • Member-type-add-first
                • Member-type-add-last
                • Init-type
                • Type-option
                • Member-type-lookup
                • Tyspecseq-to-type
                • Member-type-list-option
                • Type-promoted-arithmeticp
                • Type-list-result
                • Member-type-list-result
                • Integer-type-bits-nulfun
                • Init-type-result
                • Type-result
                • Type-nonchar-integerp
                • Type-nonchar-integer-listp
                • Type-arithmetic-listp
                • Type-integer-listp
                • Integer-type-xdoc-string
                • Type-unsigned-integerp
                • Type-signed-integerp
                • Integer-type-minbits
                • Integer-type-bits
                • Type-scalarp
                • Type-integerp
                • Type-arithmeticp
                • Type-realp
                • Type-list
                • *nonchar-integer-types*
                • Member-type-list
                • Ident-type-map
                • Type-set
                • Type-option-set
                • Symbol-type-alist
                • Type-option-list
              • Integer-formats-definitions
              • Computation-states
              • Portable-ascii-identifiers
              • Values
              • Integer-operations
              • Object-designators
              • Operations
              • Errors
              • Tag-environments
              • Function-environments
              • Character-sets
              • Flexible-array-member-removal
              • Arithmetic-operations
              • Pointer-operations
              • Real-operations
              • Array-operations
              • Scalar-operations
              • Structure-operations
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Type

    Type-kind

    Get the kind (tag) of a type structure.

    Signature
    (type-kind x) → kind
    Arguments
    x — Guard (typep x).

    Definitions and Theorems

    Function: type-kind$inline

    (defun type-kind$inline (x)
      (declare (xargs :guard (typep x)))
      (mbe :logic (cond ((or (atom x) (eq (car x) :void)) :void)
                        ((eq (car x) :char) :char)
                        ((eq (car x) :schar) :schar)
                        ((eq (car x) :uchar) :uchar)
                        ((eq (car x) :sshort) :sshort)
                        ((eq (car x) :ushort) :ushort)
                        ((eq (car x) :sint) :sint)
                        ((eq (car x) :uint) :uint)
                        ((eq (car x) :slong) :slong)
                        ((eq (car x) :ulong) :ulong)
                        ((eq (car x) :sllong) :sllong)
                        ((eq (car x) :ullong) :ullong)
                        ((eq (car x) :struct) :struct)
                        ((eq (car x) :pointer) :pointer)
                        (t :array))
           :exec (car x)))

    Theorem: type-kind-possibilities

    (defthm type-kind-possibilities
     (or (equal (type-kind x) :void)
         (equal (type-kind x) :char)
         (equal (type-kind x) :schar)
         (equal (type-kind x) :uchar)
         (equal (type-kind x) :sshort)
         (equal (type-kind x) :ushort)
         (equal (type-kind x) :sint)
         (equal (type-kind x) :uint)
         (equal (type-kind x) :slong)
         (equal (type-kind x) :ulong)
         (equal (type-kind x) :sllong)
         (equal (type-kind x) :ullong)
         (equal (type-kind x) :struct)
         (equal (type-kind x) :pointer)
         (equal (type-kind x) :array))
     :rule-classes ((:forward-chaining :trigger-terms ((type-kind x)))))