• 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
        • Syntax-for-tools
        • Atc
        • Language
          • Abstract-syntax
            • Tyspecseq
            • Expr
              • Exprp
              • Expr-case
              • Expr-binary
              • Expr-equiv
              • Expr-cond
              • Expr-unary
              • Expr-memberp
              • Expr-member
              • Expr-cast
              • Expr-call
              • Expr-arrsub
              • Expr-kind
                • Expr-preinc
                • Expr-predec
                • Expr-postinc
                • Expr-postdec
                • Expr-ident
                • Expr-const
                • Expr-fix
                • Expr-count
              • Binop
              • Fileset
              • Obj-declor
              • Ident
              • Iconst
              • Obj-adeclor
              • Const
              • Fundef
              • Unop
              • File
              • Tag-declon
              • Fun-declor
              • Obj-declon
              • Iconst-length
              • Abstract-syntax-operations
              • Label
              • Struct-declon
              • Initer
              • Ext-declon
              • Fun-adeclor
              • Expr-option
              • Iconst-base
              • Initer-option
              • Iconst-option
              • Tyspecseq-option
              • Stmt-option
              • Scspecseq
              • Param-declon
              • Obj-declon-option
              • File-option
              • Tyname
              • Transunit
              • Fun-declon
              • Transunit-result
              • Param-declon-list
              • Struct-declon-list
              • Expr-list
              • Tyspecseq-list
              • Ident-set
              • Ident-list
              • Ext-declon-list
              • Unop-list
              • Tyname-list
              • Fundef-list
              • Fun-declon-list
              • Binop-list
              • Stmt-fixtypes
              • Expr-fixtypes
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Integer-formats
            • Types
            • Portable-ascii-identifiers
            • Values
            • Integer-operations
            • Computation-states
            • Object-designators
            • Operations
            • Errors
            • Tag-environments
            • Function-environments
            • Character-sets
            • Flexible-array-member-removal
            • Arithmetic-operations
            • Pointer-operations
            • Bytes
            • Keywords
            • Real-operations
            • Array-operations
            • Scalar-operations
            • Structure-operations
          • Representation
          • Transformation-tools
          • Insertion-sort
          • Pack
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • 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
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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)))
      (let ((__function__ 'expr-kind))
        (declare (ignorable __function__))
        (mbe :logic (cond ((or (atom x) (eq (car x) :ident))
                           :ident)
                          ((eq (car x) :const) :const)
                          ((eq (car x) :arrsub) :arrsub)
                          ((eq (car x) :call) :call)
                          ((eq (car x) :member) :member)
                          ((eq (car x) :memberp) :memberp)
                          ((eq (car x) :postinc) :postinc)
                          ((eq (car x) :postdec) :postdec)
                          ((eq (car x) :preinc) :preinc)
                          ((eq (car x) :predec) :predec)
                          ((eq (car x) :unary) :unary)
                          ((eq (car x) :cast) :cast)
                          ((eq (car x) :binary) :binary)
                          (t :cond))
             :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) :arrsub)
         (equal (expr-kind x) :call)
         (equal (expr-kind x) :member)
         (equal (expr-kind x) :memberp)
         (equal (expr-kind x) :postinc)
         (equal (expr-kind x) :postdec)
         (equal (expr-kind x) :preinc)
         (equal (expr-kind x) :predec)
         (equal (expr-kind x) :unary)
         (equal (expr-kind x) :cast)
         (equal (expr-kind x) :binary)
         (equal (expr-kind x) :cond))
     :rule-classes ((:forward-chaining :trigger-terms ((expr-kind x)))))