• 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
      • Riscv
        • Semantics
          • Exec-bgeu
          • Exec-bltu
          • Exec-blt
          • Exec-bge
          • Exec-jalr
          • Exec-bne
          • Exec-beq
          • Exec-sra
          • Exec-op-imms-32
          • Exec-srl
          • Exec-branch
          • Exec-sll
          • Exec-op-imms64
          • Exec-op-imms32
            • Exec-op-imm-32
            • Exec-op-32
            • Exec-op
            • Exec-srlw
            • Exec-srliw
            • Exec-sraw
            • Exec-sraiw
            • Exec-sltiu
            • Exec-remuw
            • Exec-op-imm
            • Exec-jal
            • Exec-store
            • Exec-srli64
            • Exec-srli32
            • Exec-srai64
            • Exec-srai32
            • Exec-sllw
            • Exec-remw
            • Exec-load
            • Exec-divuw
            • Exec-addiw
            • Exec-xori
            • Exec-slti
            • Exec-slliw
            • Exec-remu
            • Exec-rem
            • Exec-divw
            • Exec-sw
            • Exec-slli64
            • Exec-slli32
            • Exec-ori
            • Exec-mulhsu
            • Exec-divu
            • Exec-andi
            • Exec-addi
            • Exec-sltu
            • Exec-slt
            • Exec-mulhu
            • Exec-div
            • Exec-auipc
            • Exec-addw
            • Exec-xor
            • Exec-mulw
            • Exec-mulh
            • Exec-lwu
            • Exec-and
            • Exec-subw
            • Exec-sub
            • Exec-sh
            • Exec-sd
            • Exec-sb
            • Exec-or
            • Exec-lhu
            • Exec-lh
            • Exec-ld
            • Exec-lbu
            • Exec-lb
            • Exec-mul
            • Exec-add
            • Exec-lw
            • Exec-lui
            • Eff-addr
            • Exec-instr
          • Instructions
          • States
          • Decoding
          • Encoding
          • Features
          • Rv32im
          • Rv64im
          • Execution
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • 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
      • Community
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Semantics

    Exec-op-imms32

    Semantics of the shift instructions with the OP-IMM opcode [ISA:2.4.1] in 32-bit mode.

    Signature
    (exec-op-imms32 funct rd rs1 imm stat feat) → new-stat
    Arguments
    funct — Guard (op-imms-funct-p funct).
    rd — Guard (ubyte5p rd).
    rs1 — Guard (ubyte5p rs1).
    imm — Guard (ubyte5p imm).
    stat — Guard (statp stat).
    feat — Guard (featp feat).
    Returns
    new-stat — Type (statp new-stat).

    Definitions and Theorems

    Function: exec-op-imms32

    (defun exec-op-imms32 (funct rd rs1 imm stat feat)
      (declare (xargs :guard (and (op-imms-funct-p funct)
                                  (ubyte5p rd)
                                  (ubyte5p rs1)
                                  (ubyte5p imm)
                                  (statp stat)
                                  (featp feat))))
      (declare (xargs :guard (and (feat-32p feat)
                                  (stat-validp stat feat))))
      (let ((__function__ 'exec-op-imms32))
        (declare (ignorable __function__))
        (op-imms-funct-case funct
                            :slli (exec-slli32 rd rs1 imm stat feat)
                            :srli (exec-srli32 rd rs1 imm stat feat)
                            :srai (exec-srai32 rd rs1 imm stat feat))))

    Theorem: statp-of-exec-op-imms32

    (defthm statp-of-exec-op-imms32
      (b* ((new-stat (exec-op-imms32 funct rd rs1 imm stat feat)))
        (statp new-stat))
      :rule-classes :rewrite)

    Theorem: stat-validp-of-exec-op-imms32

    (defthm stat-validp-of-exec-op-imms32
      (implies
           (stat-validp stat feat)
           (b* ((?new-stat (exec-op-imms32 funct rd rs1 imm stat feat)))
             (stat-validp new-stat feat))))

    Theorem: exec-op-imms32-of-op-imms-funct-fix-funct

    (defthm exec-op-imms32-of-op-imms-funct-fix-funct
      (equal (exec-op-imms32 (op-imms-funct-fix funct)
                             rd rs1 imm stat feat)
             (exec-op-imms32 funct rd rs1 imm stat feat)))

    Theorem: exec-op-imms32-op-imms-funct-equiv-congruence-on-funct

    (defthm exec-op-imms32-op-imms-funct-equiv-congruence-on-funct
     (implies (op-imms-funct-equiv funct funct-equiv)
              (equal (exec-op-imms32 funct rd rs1 imm stat feat)
                     (exec-op-imms32 funct-equiv rd rs1 imm stat feat)))
     :rule-classes :congruence)

    Theorem: exec-op-imms32-of-ubyte5-fix-rd

    (defthm exec-op-imms32-of-ubyte5-fix-rd
      (equal (exec-op-imms32 funct (ubyte5-fix rd)
                             rs1 imm stat feat)
             (exec-op-imms32 funct rd rs1 imm stat feat)))

    Theorem: exec-op-imms32-ubyte5-equiv-congruence-on-rd

    (defthm exec-op-imms32-ubyte5-equiv-congruence-on-rd
     (implies (ubyte5-equiv rd rd-equiv)
              (equal (exec-op-imms32 funct rd rs1 imm stat feat)
                     (exec-op-imms32 funct rd-equiv rs1 imm stat feat)))
     :rule-classes :congruence)

    Theorem: exec-op-imms32-of-ubyte5-fix-rs1

    (defthm exec-op-imms32-of-ubyte5-fix-rs1
      (equal (exec-op-imms32 funct rd (ubyte5-fix rs1)
                             imm stat feat)
             (exec-op-imms32 funct rd rs1 imm stat feat)))

    Theorem: exec-op-imms32-ubyte5-equiv-congruence-on-rs1

    (defthm exec-op-imms32-ubyte5-equiv-congruence-on-rs1
     (implies (ubyte5-equiv rs1 rs1-equiv)
              (equal (exec-op-imms32 funct rd rs1 imm stat feat)
                     (exec-op-imms32 funct rd rs1-equiv imm stat feat)))
     :rule-classes :congruence)

    Theorem: exec-op-imms32-of-ubyte5-fix-imm

    (defthm exec-op-imms32-of-ubyte5-fix-imm
      (equal (exec-op-imms32 funct rd rs1 (ubyte5-fix imm)
                             stat feat)
             (exec-op-imms32 funct rd rs1 imm stat feat)))

    Theorem: exec-op-imms32-ubyte5-equiv-congruence-on-imm

    (defthm exec-op-imms32-ubyte5-equiv-congruence-on-imm
     (implies (ubyte5-equiv imm imm-equiv)
              (equal (exec-op-imms32 funct rd rs1 imm stat feat)
                     (exec-op-imms32 funct rd rs1 imm-equiv stat feat)))
     :rule-classes :congruence)

    Theorem: exec-op-imms32-of-stat-fix-stat

    (defthm exec-op-imms32-of-stat-fix-stat
      (equal (exec-op-imms32 funct rd rs1 imm (stat-fix stat)
                             feat)
             (exec-op-imms32 funct rd rs1 imm stat feat)))

    Theorem: exec-op-imms32-stat-equiv-congruence-on-stat

    (defthm exec-op-imms32-stat-equiv-congruence-on-stat
     (implies (stat-equiv stat stat-equiv)
              (equal (exec-op-imms32 funct rd rs1 imm stat feat)
                     (exec-op-imms32 funct rd rs1 imm stat-equiv feat)))
     :rule-classes :congruence)

    Theorem: exec-op-imms32-of-feat-fix-feat

    (defthm exec-op-imms32-of-feat-fix-feat
      (equal (exec-op-imms32 funct rd rs1 imm stat (feat-fix feat))
             (exec-op-imms32 funct rd rs1 imm stat feat)))

    Theorem: exec-op-imms32-feat-equiv-congruence-on-feat

    (defthm exec-op-imms32-feat-equiv-congruence-on-feat
     (implies (feat-equiv feat feat-equiv)
              (equal (exec-op-imms32 funct rd rs1 imm stat feat)
                     (exec-op-imms32 funct rd rs1 imm stat feat-equiv)))
     :rule-classes :congruence)