• 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
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Compilation-database
            • Printer
            • Output-files
            • Abstract-syntax-operations
            • Implementation-environments
            • Abstract-syntax
              • Abstract-syntax-trees
                • Expr
                  • Exprp
                  • Expr-case
                  • Expr-binary
                  • Expr-kind
                    • Expr-unary
                    • Expr-funcall
                    • Expr-equiv
                    • Expr-cond
                    • Expr-complit
                    • Expr-cast/sub-ambig
                    • Expr-cast/mul-ambig
                    • Expr-cast/logand-ambig
                    • Expr-cast/call-ambig
                    • Expr-cast/and-ambig
                    • Expr-cast/add-ambig
                    • Expr-arrsub
                    • Expr-ident
                    • Expr-alignof-ambig
                    • Expr-va-arg
                    • Expr-tycompat
                    • Expr-string
                    • Expr-offsetof
                    • Expr-memberp
                    • Expr-member
                    • Expr-gensel
                    • Expr-const
                    • Expr-comma
                    • Expr-cast
                    • Expr-alignof
                    • Expr-stmt
                    • Expr-sizeof-ambig
                    • Expr-sizeof
                    • Expr-paren
                    • Expr-label-addr
                    • Expr-extension
                    • Expr-fix
                    • Expr-count
                  • Type-spec
                  • Exprs/decls/stmts
                    • Expr
                      • Exprp
                      • Expr-case
                      • Expr-binary
                      • Expr-kind
                        • Expr-unary
                        • Expr-funcall
                        • Expr-equiv
                        • Expr-cond
                        • Expr-complit
                        • Expr-cast/sub-ambig
                        • Expr-cast/mul-ambig
                        • Expr-cast/logand-ambig
                        • Expr-cast/call-ambig
                        • Expr-cast/and-ambig
                        • Expr-cast/add-ambig
                        • Expr-arrsub
                        • Expr-ident
                        • Expr-alignof-ambig
                        • Expr-va-arg
                        • Expr-tycompat
                        • Expr-string
                        • Expr-offsetof
                        • Expr-memberp
                        • Expr-member
                        • Expr-gensel
                        • Expr-const
                        • Expr-comma
                        • Expr-cast
                        • Expr-alignof
                        • Expr-stmt
                        • Expr-sizeof-ambig
                        • Expr-sizeof
                        • Expr-paren
                        • Expr-label-addr
                        • Expr-extension
                        • Expr-fix
                        • Expr-count
                      • Type-spec
                      • Stmt
                      • Amb-expr/tyname
                      • Dirdeclor
                      • Asm-stmt
                      • Attrib
                      • Amb-decl/stmt
                      • Dirabsdeclor
                      • Decl-spec
                      • Struct-declon
                      • Amb-declor/absdeclor
                      • Struni-spec
                      • Param-declor
                      • Declor
                      • Initdeclor
                      • Absdeclor
                      • Tyname
                      • Label
                      • Align-spec
                      • Expr-option
                      • Spec/qual
                      • Desiniter
                      • Param-declon
                      • Dirabsdeclor-option
                      • Comp-stmt
                      • Const-expr-option
                      • Attrib-spec
                      • Struct-declor
                      • Decl
                      • Initer
                      • Absdeclor-option
                      • Statassert
                      • Member-designor
                      • Initer-option
                      • Enum-spec
                      • Declor-option
                      • Block-item
                      • Const-expr
                      • Genassoc
                      • Asm-output
                      • Asm-input
                      • Designor
                      • Enumer
                      • Typequal/attribspec
                      • Typequal/attribspec-list
                      • Decl-spec-list
                      • Spec/qual-list
                      • Desiniter-list
                      • Attrib-spec-list
                      • Param-declon-list
                      • Decl-list
                      • Typequal/attribspec-list-list
                      • Struct-declor-list
                      • Struct-declon-list
                      • Initdeclor-list
                      • Genassoc-list
                      • Block-item-list
                      • Enumer-list
                      • Expr-list
                      • Asm-output-list
                      • Asm-input-list
                      • Designor-list
                      • Attrib-list
                    • Binop
                    • Stmt
                    • Unop
                    • Amb-expr/tyname
                    • Dirdeclor
                    • Asm-stmt
                    • Dec/oct/hex-const
                    • Simple-escape
                    • Fsuffix
                    • Attrib
                    • Ident
                    • Amb-decl/stmt
                    • Dirabsdeclor
                    • Type-qual
                    • Decl-spec
                    • Fundef
                    • Struct-declon
                    • Asm-name-spec
                    • Amb-declor/absdeclor
                    • Struni-spec
                    • Param-declor
                    • Declor
                    • Stor-spec
                    • Transunit-ensemble
                    • Initdeclor
                    • Absdeclor
                    • Tyname
                    • Keyword-uscores
                    • Label
                    • Align-spec
                    • Expr-option
                    • Spec/qual
                    • Lsuffix
                    • Hex-frac-const
                    • Desiniter
                    • Param-declon
                    • Iconst
                    • Dirabsdeclor-option
                    • Dec-frac-const
                    • Dec-core-fconst
                    • Comp-stmt
                    • Extdecl
                    • Const-expr-option
                    • Amb?-declor/absdeclor
                    • Isuffix
                    • Hex-core-fconst
                    • Attrib-spec
                    • Struct-declor
                    • Escape
                    • Decl
                    • Amb?-expr/tyname
                    • Initer
                    • Ident-option
                    • Bin-expo
                    • Absdeclor-option
                    • Statassert
                    • Member-designor
                    • Initer-option
                    • Enum-spec
                    • Declor-option
                    • Const
                    • Block-item
                    • Hex-quad
                    • Eprefix
                    • Const-expr
                    • Oct-escape
                    • Inc/dec-op
                    • Fun-spec
                    • Dec-expo
                    • Cprefix-option
                    • Asm-name-spec-option
                    • Amb?-decl/stmt
                    • S-char
                    • Isuffix-option
                    • Genassoc
                    • Fsuffix-option
                    • Fconst
                    • Eprefix-option
                    • Dec-expo-option
                    • Cprefix
                    • C-char
                    • Type-spec-option
                    • Sign-option
                    • Sign
                    • Q-char
                    • Iconst-option
                    • H-char
                    • Fundef-option
                    • Asm-output
                    • Asm-input
                    • Designor
                    • Const-option
                    • Usuffix
                    • Univ-char-name
                    • Hprefix
                    • Enumer
                    • Attrib-name
                    • Transunit
                    • Asm-qual
                    • Typequal/attribspec
                    • Stringlit
                    • Dec-expo-prefix
                    • Bin-expo-prefix
                    • Header-name
                    • Cconst
                    • Expr/tyname
                    • Decl/stmt
                    • Declor/absdeclor
                    • Asm-clobber
                    • Typequal/attribspec-list
                    • Decl-spec-list
                    • Stringlit-list
                    • Spec/qual-list
                    • Inc/dec-op-list
                    • Desiniter-list
                    • Attrib-spec-list
                    • S-char-list
                    • Q-char-list
                    • Param-declon-list
                    • H-char-list
                    • Decl-list
                    • C-char-list
                    • Typequal/attribspec-list-list
                    • Struct-declor-list
                    • Struct-declon-list
                    • Initdeclor-list
                    • Genassoc-list
                    • Extdecl-list
                    • Block-item-list
                    • Enumer-list
                    • Ident-list
                    • Filepath-transunit-map
                    • Expr-list
                    • Asm-qual-list
                    • Asm-output-list
                    • Asm-input-list
                    • Asm-clobber-list
                    • Type-spec-list
                    • Stor-spec-list
                    • Ident-set
                    • Ident-option-set
                    • Ident-list-list
                    • Eprefix-option-list
                    • Designor-list
                    • Attrib-list
                  • Abstract-syntax-irrelevants
                  • Type-specifier-lists
                  • Ascii-identifiers
                  • Abstraction-mapping
                  • Standard
                  • Storage-specifier-lists
                  • Code-ensembles
                  • Purity
                  • Make-self-code-ensemble
                • Concrete-syntax
                • Disambiguation
                • Validation
                • Gcc-builtins
                • Preprocessing
                • Parsing
              • Atc
              • Transformation-tools
              • Language
              • 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
      • Expr

      Expr-kind

      Get the kind (tag) of a expr structure.

      Signature
      (expr-kind x) → kind
      Arguments
      x — Guard (exprp x).

      Definitions and Theorems

      Function: expr-kind$inline

      (defun expr-kind$inline (x)
        (declare (xargs :guard (exprp x)))
        (mbe :logic (cond ((or (atom x) (eq (car x) :ident))
                           :ident)
                          ((eq (car x) :const) :const)
                          ((eq (car x) :string) :string)
                          ((eq (car x) :paren) :paren)
                          ((eq (car x) :gensel) :gensel)
                          ((eq (car x) :arrsub) :arrsub)
                          ((eq (car x) :funcall) :funcall)
                          ((eq (car x) :member) :member)
                          ((eq (car x) :memberp) :memberp)
                          ((eq (car x) :complit) :complit)
                          ((eq (car x) :unary) :unary)
                          ((eq (car x) :label-addr) :label-addr)
                          ((eq (car x) :sizeof) :sizeof)
                          ((eq (car x) :sizeof-ambig)
                           :sizeof-ambig)
                          ((eq (car x) :alignof) :alignof)
                          ((eq (car x) :alignof-ambig)
                           :alignof-ambig)
                          ((eq (car x) :cast) :cast)
                          ((eq (car x) :binary) :binary)
                          ((eq (car x) :cond) :cond)
                          ((eq (car x) :comma) :comma)
                          ((eq (car x) :cast/call-ambig)
                           :cast/call-ambig)
                          ((eq (car x) :cast/mul-ambig)
                           :cast/mul-ambig)
                          ((eq (car x) :cast/add-ambig)
                           :cast/add-ambig)
                          ((eq (car x) :cast/sub-ambig)
                           :cast/sub-ambig)
                          ((eq (car x) :cast/and-ambig)
                           :cast/and-ambig)
                          ((eq (car x) :cast/logand-ambig)
                           :cast/logand-ambig)
                          ((eq (car x) :stmt) :stmt)
                          ((eq (car x) :tycompat) :tycompat)
                          ((eq (car x) :offsetof) :offsetof)
                          ((eq (car x) :va-arg) :va-arg)
                          (t :extension))
             :exec (car x)))

      Theorem: expr-kind-possibilities

      (defthm expr-kind-possibilities
       (or (equal (expr-kind x) :ident)
           (equal (expr-kind x) :const)
           (equal (expr-kind x) :string)
           (equal (expr-kind x) :paren)
           (equal (expr-kind x) :gensel)
           (equal (expr-kind x) :arrsub)
           (equal (expr-kind x) :funcall)
           (equal (expr-kind x) :member)
           (equal (expr-kind x) :memberp)
           (equal (expr-kind x) :complit)
           (equal (expr-kind x) :unary)
           (equal (expr-kind x) :label-addr)
           (equal (expr-kind x) :sizeof)
           (equal (expr-kind x) :sizeof-ambig)
           (equal (expr-kind x) :alignof)
           (equal (expr-kind x) :alignof-ambig)
           (equal (expr-kind x) :cast)
           (equal (expr-kind x) :binary)
           (equal (expr-kind x) :cond)
           (equal (expr-kind x) :comma)
           (equal (expr-kind x) :cast/call-ambig)
           (equal (expr-kind x) :cast/mul-ambig)
           (equal (expr-kind x) :cast/add-ambig)
           (equal (expr-kind x) :cast/sub-ambig)
           (equal (expr-kind x) :cast/and-ambig)
           (equal (expr-kind x) :cast/logand-ambig)
           (equal (expr-kind x) :stmt)
           (equal (expr-kind x) :tycompat)
           (equal (expr-kind x) :offsetof)
           (equal (expr-kind x) :va-arg)
           (equal (expr-kind x) :extension))
       :rule-classes ((:forward-chaining :trigger-terms ((expr-kind x)))))