Semantics of the
We read two unsigned 64-bit integers from
Function:
(defun exec64-add (rd rs1 rs2 stat) (declare (xargs :guard (and (ubyte5p rd) (ubyte5p rs1) (ubyte5p rs2) (state64p stat)))) (let ((__function__ 'exec64-add)) (declare (ignorable __function__)) (b* ((rs1-operand (read64-xreg-signed rs1 stat)) (rs2-operand (read64-xreg-signed rs2 stat)) (result (+ rs1-operand rs2-operand)) (stat (write64-xreg rd result stat)) (stat (inc64-pc stat))) stat)))
Theorem:
(defthm state64p-of-exec64-add (b* ((new-stat (exec64-add rd rs1 rs2 stat))) (state64p new-stat)) :rule-classes :rewrite)
Theorem:
(defthm exec64-add-of-ubyte5-fix-rd (equal (exec64-add (ubyte5-fix rd) rs1 rs2 stat) (exec64-add rd rs1 rs2 stat)))
Theorem:
(defthm exec64-add-ubyte5-equiv-congruence-on-rd (implies (ubyte5-equiv rd rd-equiv) (equal (exec64-add rd rs1 rs2 stat) (exec64-add rd-equiv rs1 rs2 stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-add-of-ubyte5-fix-rs1 (equal (exec64-add rd (ubyte5-fix rs1) rs2 stat) (exec64-add rd rs1 rs2 stat)))
Theorem:
(defthm exec64-add-ubyte5-equiv-congruence-on-rs1 (implies (ubyte5-equiv rs1 rs1-equiv) (equal (exec64-add rd rs1 rs2 stat) (exec64-add rd rs1-equiv rs2 stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-add-of-ubyte5-fix-rs2 (equal (exec64-add rd rs1 (ubyte5-fix rs2) stat) (exec64-add rd rs1 rs2 stat)))
Theorem:
(defthm exec64-add-ubyte5-equiv-congruence-on-rs2 (implies (ubyte5-equiv rs2 rs2-equiv) (equal (exec64-add rd rs1 rs2 stat) (exec64-add rd rs1 rs2-equiv stat))) :rule-classes :congruence)
Theorem:
(defthm exec64-add-of-state64-fix-stat (equal (exec64-add rd rs1 rs2 (state64-fix stat)) (exec64-add rd rs1 rs2 stat)))
Theorem:
(defthm exec64-add-state64-equiv-congruence-on-stat (implies (state64-equiv stat stat-equiv) (equal (exec64-add rd rs1 rs2 stat) (exec64-add rd rs1 rs2 stat-equiv))) :rule-classes :congruence)