• 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
          • 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
        • 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
  • Executable

Decoding-left-inverse

Executable decoding applied to encoding.

We show that the executable decoding is left inverse of encoding (i.e. that encoding is right inverse of the executable decoding) over valid instructions: encoding a valid instruction and then decoding it yields the original instruction. As a consequence, encoding is injective over valid instructions: if two different instructions were encoded in the same way, the decoder would have to restore both from the same encoding, which is impossible since decoding is a function.

See encoding-decoding-illustration for an illustration of encoding and decoding.

Subtopics

Decodex-of-encode-of-instr
Theorems about decodex applied to the encoding of different instructions.
Get-opcode-of-encode-of-instr
Theorems about get-opcode applied to the encoding of different instructions.
Get-funct3-of-encode-of-instr
Theorems about get-funct3 applied to the encoding of different instructions.
Get-rd-of-encode-of-instr
Theorems about get-rd applied to the encoding of different instructions.
Get-rs1-of-encode-of-instr
Theorems about get-rs1 applied to the encoding of different instructions.
Get-fields-itype-of-encode-of-instr
Theorems about get-fields-itype applied to the encoding of different instructions.
Get-imm-itype-of-encode-of-instr
Theorems about get-imm-itype applied to the encoding of different instructions.
Get-rs2-of-encode-of-instr
Theorems about get-rs2 applied to the encoding of different instructions.
Encode-injective
Injectivity of encoding.
Get-fields-rtype-of-encode-of-instr
Theorems about get-fields-rtype applied to the encoding of different instructions.
Get-funct7-of-encode-of-instr
Theorems about get-funct7 applied to the encoding of different instructions.
Get-fields-utype-of-encode-of-instr
Theorems about get-fields-utype applied to the encoding of different instructions.
Decodex-of-encode
Decoding the encoding of a valid instruction yields the original instruction.
Get-imm-utype-of-encode-of-instr
Theorems about get-imm-utype applied to the encoding of different instructions.
Get-fields-stype-of-encode-of-instr
Theorems about get-fields-stype applied to the encoding of different instructions.
Get-fields-btype-of-encode-of-instr
Theorems about get-fields-btype applied to the encoding of different instructions.
Get-imm-stype-of-encode-of-instr
Theorems about get-imm-stype applied to the encoding of different instructions.
Get-imm-jtype-of-encode-of-instr
Theorems about get-imm-jtype applied to the encoding of different instructions.
Get-imm-btype-of-encode-of-instr
Theorems about get-imm-btype applied to the encoding of different instructions.
Get-fields-jtype-of-encode-of-instr
Theorems about get-fields-utype applied to the encoding of different instructions.