• 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
    • Decoding-left-inverse

    Encode-injective

    Injectivity of encoding.

    Different valid instructions are encoded differently. This is a direct consequence of decodex-of-encode: if two different instructions were encoded in the same way, the decoder would be unable to restore both at the same time.

    Definitions and Theorems

    Theorem: encode-injective

    (defthm encode-injective
      (implies (and (instr-validp instr1 feat)
                    (instr-validp instr2 feat))
               (equal (equal (encode instr1 feat)
                             (encode instr2 feat))
                      (equal (instr-fix instr1)
                             (instr-fix instr2)))))