Semantics of the
We read an unsigned 64-bit integer from
Function:
(defun exec64-jalr (rd rs1 imm pc stat) (declare (xargs :guard (and (ubyte5p rd) (ubyte5p rs1) (ubyte12p imm) (ubyte64p pc) (state64p stat)))) (let ((__function__ 'exec64-jalr)) (declare (ignorable __function__)) (b* ((base (read64-xreg-unsigned rs1 stat)) (offset (loghead 64 (logext 12 (ubyte12-fix imm)))) (target-pc (logand 18446744073709551614 (+ base offset))) (next-pc (+ (ubyte64-fix pc) 4)) (stat (write64-xreg rd next-pc stat)) (stat (write64-pc target-pc stat))) stat)))
Theorem:
(defthm state64p-of-exec64-jalr (b* ((new-stat (exec64-jalr rd rs1 imm pc stat))) (state64p new-stat)) :rule-classes :rewrite)
Theorem:
(defthm exec64-jalr-of-ubyte5-fix-rd (equal (exec64-jalr (ubyte5-fix rd) rs1 imm pc stat) (exec64-jalr rd rs1 imm pc stat)))
Theorem:
(defthm exec64-jalr-ubyte5-equiv-congruence-on-rd (implies (ubyte5-equiv rd rd-equiv) (equal (exec64-jalr rd rs1 imm pc stat) (exec64-jalr rd-equiv rs1 imm pc stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-jalr-of-ubyte5-fix-rs1 (equal (exec64-jalr rd (ubyte5-fix rs1) imm pc stat) (exec64-jalr rd rs1 imm pc stat)))
Theorem:
(defthm exec64-jalr-ubyte5-equiv-congruence-on-rs1 (implies (ubyte5-equiv rs1 rs1-equiv) (equal (exec64-jalr rd rs1 imm pc stat) (exec64-jalr rd rs1-equiv imm pc stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-jalr-of-ubyte12-fix-imm (equal (exec64-jalr rd rs1 (ubyte12-fix imm) pc stat) (exec64-jalr rd rs1 imm pc stat)))
Theorem:
(defthm exec64-jalr-ubyte12-equiv-congruence-on-imm (implies (acl2::ubyte12-equiv imm imm-equiv) (equal (exec64-jalr rd rs1 imm pc stat) (exec64-jalr rd rs1 imm-equiv pc stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-jalr-of-ubyte64-fix-pc (equal (exec64-jalr rd rs1 imm (ubyte64-fix pc) stat) (exec64-jalr rd rs1 imm pc stat)))
Theorem:
(defthm exec64-jalr-ubyte64-equiv-congruence-on-pc (implies (acl2::ubyte64-equiv pc pc-equiv) (equal (exec64-jalr rd rs1 imm pc stat) (exec64-jalr rd rs1 imm pc-equiv stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-jalr-of-state64-fix-stat (equal (exec64-jalr rd rs1 imm pc (state64-fix stat)) (exec64-jalr rd rs1 imm pc stat)))
Theorem:
(defthm exec64-jalr-state64-equiv-congruence-on-stat (implies (state64-equiv stat stat-equiv) (equal (exec64-jalr rd rs1 imm pc stat) (exec64-jalr rd rs1 imm pc stat-equiv))) :rule-classes :congruence)