• 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
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
        • Riscv
          • Specification
          • Executable
            • Decoding-left-inverse
              • Decodex-of-encode-of-instr
                • Get-opcode-of-encode-of-instr
                • Get-funct3-of-encode-of-instr
                • Get-rd-of-encode-of-instr
                • Get-rs1-of-encode-of-instr
                • Get-fields-itype-of-encode-of-instr
                • Get-imm-itype-of-encode-of-instr
                • Get-rs2-of-encode-of-instr
                • Encode-injective
                • Get-fields-rtype-of-encode-of-instr
                • Get-funct7-of-encode-of-instr
                • Get-fields-utype-of-encode-of-instr
                • Decodex-of-encode
                • Get-imm-utype-of-encode-of-instr
                • Get-fields-stype-of-encode-of-instr
                • Get-fields-btype-of-encode-of-instr
                • Get-imm-stype-of-encode-of-instr
                • Get-imm-jtype-of-encode-of-instr
                • Get-imm-btype-of-encode-of-instr
                • Get-fields-jtype-of-encode-of-instr
              • Decoding-executable
              • Decoding-right-inverse
              • Execution-executable
              • Decoding-correct
            • Specialized
            • Optimized
          • 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
    • Decoding-left-inverse

    Decodex-of-encode-of-instr

    Theorems about decodex applied to the encoding of different instructions.

    Definitions and Theorems

    Theorem: decodex-of-encode-of-instr-op-imm

    (defthm decodex-of-encode-of-instr-op-imm
      (implies (instr-validp (instr-op-imm funct rd rs1 imm)
                             feat)
               (equal (decodex (encode (instr-op-imm funct rd rs1 imm)
                                       feat)
                               feat)
                      (instr-op-imm funct rd rs1 imm))))

    Theorem: decodex-of-encode-of-instr-op-imms32

    (defthm decodex-of-encode-of-instr-op-imms32
     (implies (instr-validp (instr-op-imms32 funct rd rs1 imm)
                            feat)
              (equal (decodex (encode (instr-op-imms32 funct rd rs1 imm)
                                      feat)
                              feat)
                     (instr-op-imms32 funct rd rs1 imm))))

    Theorem: decodex-of-encode-of-instr-op-imms64

    (defthm decodex-of-encode-of-instr-op-imms64
     (implies (instr-validp (instr-op-imms64 funct rd rs1 imm)
                            feat)
              (equal (decodex (encode (instr-op-imms64 funct rd rs1 imm)
                                      feat)
                              feat)
                     (instr-op-imms64 funct rd rs1 imm))))

    Theorem: decodex-of-encode-of-instr-op-imm-32

    (defthm decodex-of-encode-of-instr-op-imm-32
     (implies (instr-validp (instr-op-imm-32 funct rd rs1 imm)
                            feat)
              (equal (decodex (encode (instr-op-imm-32 funct rd rs1 imm)
                                      feat)
                              feat)
                     (instr-op-imm-32 funct rd rs1 imm))))

    Theorem: decodex-of-encode-of-instr-op-imms-32

    (defthm decodex-of-encode-of-instr-op-imms-32
      (implies
           (instr-validp (instr-op-imms-32 funct rd rs1 imm)
                         feat)
           (equal (decodex (encode (instr-op-imms-32 funct rd rs1 imm)
                                   feat)
                           feat)
                  (instr-op-imms-32 funct rd rs1 imm))))

    Theorem: decodex-of-encode-of-instr-lui

    (defthm decodex-of-encode-of-instr-lui
      (implies (instr-validp (instr-lui rd imm) feat)
               (equal (decodex (encode (instr-lui rd imm) feat)
                               feat)
                      (instr-lui rd imm))))

    Theorem: decodex-of-encode-of-instr-auipc

    (defthm decodex-of-encode-of-instr-auipc
      (implies (instr-validp (instr-auipc rd imm) feat)
               (equal (decodex (encode (instr-auipc rd imm) feat)
                               feat)
                      (instr-auipc rd imm))))

    Theorem: decodex-of-encode-of-instr-op

    (defthm decodex-of-encode-of-instr-op
      (implies (instr-validp (instr-op funct rd rs1 rs2)
                             feat)
               (equal (decodex (encode (instr-op funct rd rs1 rs2)
                                       feat)
                               feat)
                      (instr-op funct rd rs1 rs2))))

    Theorem: decodex-of-encode-of-instr-op-32

    (defthm decodex-of-encode-of-instr-op-32
      (implies (instr-validp (instr-op-32 funct rd rs1 rs2)
                             feat)
               (equal (decodex (encode (instr-op-32 funct rd rs1 rs2)
                                       feat)
                               feat)
                      (instr-op-32 funct rd rs1 rs2))))

    Theorem: decodex-of-encode-of-instr-jal

    (defthm decodex-of-encode-of-instr-jal
      (implies (instr-validp (instr-jal rd imm) feat)
               (equal (decodex (encode (instr-jal rd imm) feat)
                               feat)
                      (instr-jal rd imm))))

    Theorem: decodex-of-encode-of-instr-jalr

    (defthm decodex-of-encode-of-instr-jalr
      (implies (instr-validp (instr-jalr rd rs1 imm)
                             feat)
               (equal (decodex (encode (instr-jalr rd rs1 imm) feat)
                               feat)
                      (instr-jalr rd rs1 imm))))

    Theorem: decodex-of-encode-of-instr-branch

    (defthm decodex-of-encode-of-instr-branch
      (implies (instr-validp (instr-branch funct rs1 rs2 imm)
                             feat)
               (equal (decodex (encode (instr-branch funct rs1 rs2 imm)
                                       feat)
                               feat)
                      (instr-branch funct rs1 rs2 imm))))

    Theorem: decodex-of-encode-of-instr-load

    (defthm decodex-of-encode-of-instr-load
      (implies (instr-validp (instr-load funct rd rs1 imm)
                             feat)
               (equal (decodex (encode (instr-load funct rd rs1 imm)
                                       feat)
                               feat)
                      (instr-load funct rd rs1 imm))))

    Theorem: decodex-of-encode-of-instr-store

    (defthm decodex-of-encode-of-instr-store
      (implies (instr-validp (instr-store funct rs1 rs2 imm)
                             feat)
               (equal (decodex (encode (instr-store funct rs1 rs2 imm)
                                       feat)
                               feat)
                      (instr-store funct rs1 rs2 imm))))