• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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
          • Transformations
          • Language
            • Abstract-syntax
              • Escape
              • Swcase-list->value-list
              • Hex-digit-list->chars
              • Fundef-list->name-list
              • Literal
              • Path
              • Hex-string-rest-element
              • Plain-string
              • String-element
              • Hex-string-content-option
              • Hex-string-content
              • Identifier
              • Funcall-option
              • Expression-option
              • Statement-option
              • Literal-option
              • Identifier-option
              • Hex-string
              • Hex-quad
              • Hex-digit
              • Hex-pair
              • Data-value
              • Data-item
              • Statements-to-fundefs
              • String-element-list-result
              • Identifier-identifier-map-result
              • Swcase-result
              • String-element-result
              • Statement-result
              • Literal-result
              • Identifier-set-result
              • Identifier-result
              • Identifier-list-result
              • Fundef-result
              • Funcall-result
              • Expression-result
              • Escape-result
              • Path-result
              • Block-result
              • Objects
              • Statements/blocks/cases/fundefs
                • Statement
                  • Statement-case
                  • Statementp
                  • Statement-for
                  • Statement-equiv
                  • Statement-switch
                  • Statement-variable-single
                  • Statement-variable-multi
                  • Statement-if
                  • Statement-assign-single
                  • Statement-assign-multi
                  • Statement-kind
                    • Statement-fundef
                    • Statement-funcall
                    • Statement-block
                    • Statement-leave
                    • Statement-continue
                    • Statement-break
                    • Statement-fix
                    • Statement-count
                  • Fundef
                  • Block-option
                  • Block
                  • Swcase
                  • Swcase-list
                  • Statement-list
                • Identifier-list
                • Identifier-set
                • Identifier-identifier-map
                • Identifier-identifier-alist
                • Hex-string-rest-element-list
                • String-element-list
                • Path-list
                • Hex-digit-list
                • Literal-list
                • Fundef-list
                • Expressions/funcalls
                • Abstract-syntax-induction-schemas
              • Dynamic-semantics
              • Concrete-syntax
              • Static-soundness
              • Static-semantics
              • Errors
            • Yul-json
          • Zcash
          • ACL2-programming-language
          • 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
    • Statement

    Statement-kind

    Get the kind (tag) of a statement structure.

    Signature
    (statement-kind x) → kind
    Arguments
    x — Guard (statementp x).

    Definitions and Theorems

    Function: statement-kind$inline

    (defun statement-kind$inline (x)
      (declare (xargs :guard (statementp x)))
      (let ((__function__ 'statement-kind))
        (declare (ignorable __function__))
        (mbe :logic (cond ((eq (car x) :block) :block)
                          ((or (atom x)
                               (eq (car x) :variable-single))
                           :variable-single)
                          ((eq (car x) :variable-multi)
                           :variable-multi)
                          ((eq (car x) :assign-single)
                           :assign-single)
                          ((eq (car x) :assign-multi)
                           :assign-multi)
                          ((eq (car x) :funcall) :funcall)
                          ((eq (car x) :if) :if)
                          ((eq (car x) :for) :for)
                          ((eq (car x) :switch) :switch)
                          ((eq (car x) :leave) :leave)
                          ((eq (car x) :break) :break)
                          ((eq (car x) :continue) :continue)
                          (t :fundef))
             :exec (car x))))

    Theorem: statement-kind-possibilities

    (defthm statement-kind-possibilities
      (or (equal (statement-kind x) :block)
          (equal (statement-kind x)
                 :variable-single)
          (equal (statement-kind x)
                 :variable-multi)
          (equal (statement-kind x)
                 :assign-single)
          (equal (statement-kind x) :assign-multi)
          (equal (statement-kind x) :funcall)
          (equal (statement-kind x) :if)
          (equal (statement-kind x) :for)
          (equal (statement-kind x) :switch)
          (equal (statement-kind x) :leave)
          (equal (statement-kind x) :break)
          (equal (statement-kind x) :continue)
          (equal (statement-kind x) :fundef))
      :rule-classes
      ((:forward-chaining :trigger-terms ((statement-kind x)))))