• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
        • Instructions
        • States
        • Decoding
        • Encoding
          • Encode
          • Encode-load-funct
          • Encode-store-funct
          • Encode-op-imms-32-funct
          • Encode-op-funct
          • Encode-op-32-funct
          • Encode-op-imms64-funct
          • Encode-op-imms32-funct
          • Encode-op-imm-funct
          • Encode-op-imm-32-funct
          • Encode-branch-funct
          • Features
          • Semantics
          • Execution
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Encoding

    Encode-branch-funct

    Encode the name of an instruction with the BRANCH opcode into the funct3 field [ISA:2.5.2] [ISA:34].

    Signature
    (encode-branch-funct funct) → funct3
    Arguments
    funct — Guard (branch-funct-p funct).
    Returns
    funct3 — Type (ubyte3p funct3).

    Definitions and Theorems

    Function: encode-branch-funct

    (defun encode-branch-funct (funct)
      (declare (xargs :guard (branch-funct-p funct)))
      (let ((__function__ 'encode-branch-funct))
        (declare (ignorable __function__))
        (branch-funct-case funct
                           :beq 0
                           :bne 1
                           :blt 4
                           :bge 5
                           :bltu 6
                           :bgeu 7)))

    Theorem: ubyte3p-of-encode-branch-funct

    (defthm ubyte3p-of-encode-branch-funct
      (b* ((funct3 (encode-branch-funct funct)))
        (ubyte3p funct3))
      :rule-classes :rewrite)

    Theorem: encode-branch-funct-of-branch-funct-fix-funct

    (defthm encode-branch-funct-of-branch-funct-fix-funct
      (equal (encode-branch-funct (branch-funct-fix funct))
             (encode-branch-funct funct)))

    Theorem: encode-branch-funct-branch-funct-equiv-congruence-on-funct

    (defthm encode-branch-funct-branch-funct-equiv-congruence-on-funct
      (implies (branch-funct-equiv funct funct-equiv)
               (equal (encode-branch-funct funct)
                      (encode-branch-funct funct-equiv)))
      :rule-classes :congruence)