Theorems about decodex applied to the encoding of different instructions.
Theorem:
(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:
(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:
(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:
(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:
(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:
(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:
(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:
(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:
(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:
(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:
(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:
(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:
(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:
(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))))