• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • 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
                • Make-instr-op
                • Instr-op->funct
                • Instr-op->rs2
                • Instr-op->rs1
                • Instr-op->rd
                  • Change-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
              • Branch-funct
              • Op-imms-funct
              • Instr-validp
              • Store-funct
              • Op-imms-32-funct
              • Instr-option
              • Op-imm-32-funct
            • Encoding
            • States
            • Reads-over-writes
            • Semantics-equivalences
            • Decoding
            • Execution
          • Executable
          • Specialized
          • Optimized
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Instr-op

    Instr-op->rd

    Get the rd field from a instr-op.

    Signature
    (instr-op->rd x) → rd
    Arguments
    x — Guard (instrp x).
    Returns
    rd — Type (ubyte5p rd).

    This is an ordinary field accessor created by fty::defprod.

    Definitions and Theorems

    Function: instr-op->rd$inline

    (defun instr-op->rd$inline (x)
      (declare (xargs :guard (instrp x)))
      (declare (xargs :guard (equal (instr-kind x) :op)))
      (mbe :logic
           (b* ((x (and (equal (instr-kind x) :op) x)))
             (ubyte5-fix (std::da-nth 1 (cdr x))))
           :exec (std::da-nth 1 (cdr x))))

    Theorem: ubyte5p-of-instr-op->rd

    (defthm ubyte5p-of-instr-op->rd
      (b* ((rd (instr-op->rd$inline x)))
        (ubyte5p rd))
      :rule-classes :rewrite)

    Theorem: instr-op->rd$inline-of-instr-fix-x

    (defthm instr-op->rd$inline-of-instr-fix-x
      (equal (instr-op->rd$inline (instr-fix x))
             (instr-op->rd$inline x)))

    Theorem: instr-op->rd$inline-instr-equiv-congruence-on-x

    (defthm instr-op->rd$inline-instr-equiv-congruence-on-x
      (implies (instr-equiv x x-equiv)
               (equal (instr-op->rd$inline x)
                      (instr-op->rd$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: instr-op->rd-when-wrong-kind

    (defthm instr-op->rd-when-wrong-kind
      (implies (not (equal (instr-kind x) :op))
               (equal (instr-op->rd x)
                      (ubyte5-fix nil))))