• 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
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Riscv
          • Specification
            • Semantics
            • Features
            • Instructions
              • Instr
                • Instrp
                • Instr-fix
                • Instr-case
                • Instr-store
                • Instr-op-imms64
                • Instr-op-imms32
                • Instr-op-imms-32
                • Instr-op-imm-32
                • Instr-op-imm
                • Instr-op-32
                • Instr-op
                • Instr-load
                • Instr-branch
                • Instr-equiv
                • Instr-jalr
                • Instr-lui
                • Instr-jal
                • Instr-auipc
                • Instr-kind
                • Op-funct
                • Op-32-funct
                • Op-imm-funct
                • Load-funct
                • Instr-validp
                • Branch-funct
                • Op-imms-funct
                • Store-funct
                • Op-imms-32-funct
                • Instr-option
                • Op-imm-32-funct
              • Encoding
              • States
              • Reads-over-writes
              • Semantics-equivalences
              • Decoding
              • Execution
            • Executable
            • Specialized
            • Optimized
          • Bitcoin
          • Ethereum
          • Yul
          • 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
    • Instr

    Instr-kind

    Get the kind (tag) of a instr structure.

    Signature
    (instr-kind x) → kind
    Arguments
    x — Guard (instrp x).

    Definitions and Theorems

    Function: instr-kind$inline

    (defun instr-kind$inline (x)
      (declare (xargs :guard (instrp x)))
      (let ((__function__ 'instr-kind))
        (declare (ignorable __function__))
        (mbe :logic (cond ((or (atom x) (eq (car x) :op-imm))
                           :op-imm)
                          ((eq (car x) :op-imms32) :op-imms32)
                          ((eq (car x) :op-imms64) :op-imms64)
                          ((eq (car x) :op-imm-32) :op-imm-32)
                          ((eq (car x) :op-imms-32) :op-imms-32)
                          ((eq (car x) :lui) :lui)
                          ((eq (car x) :auipc) :auipc)
                          ((eq (car x) :op) :op)
                          ((eq (car x) :op-32) :op-32)
                          ((eq (car x) :jal) :jal)
                          ((eq (car x) :jalr) :jalr)
                          ((eq (car x) :branch) :branch)
                          ((eq (car x) :load) :load)
                          (t :store))
             :exec (car x))))

    Theorem: instr-kind-possibilities

    (defthm instr-kind-possibilities
      (or (equal (instr-kind x) :op-imm)
          (equal (instr-kind x) :op-imms32)
          (equal (instr-kind x) :op-imms64)
          (equal (instr-kind x) :op-imm-32)
          (equal (instr-kind x) :op-imms-32)
          (equal (instr-kind x) :lui)
          (equal (instr-kind x) :auipc)
          (equal (instr-kind x) :op)
          (equal (instr-kind x) :op-32)
          (equal (instr-kind x) :jal)
          (equal (instr-kind x) :jalr)
          (equal (instr-kind x) :branch)
          (equal (instr-kind x) :load)
          (equal (instr-kind x) :store))
      :rule-classes
      ((:forward-chaining :trigger-terms ((instr-kind x)))))