Increment the program counter by 4.
In the normal instruction encodings, instructions take 32 bits each. Thus, it is common to increment the program counter by 4 (bytes), which this function provides a concise way to do.
We read the program counter, we add 4, and we write the result. Recall that write-pc wraps around if needed [ISA:1.4].
Function:
(defun inc4-pc (stat feat) (declare (xargs :guard (and (statp stat) (featp feat)))) (declare (xargs :guard (stat-validp stat feat))) (let ((__function__ 'inc4-pc)) (declare (ignorable __function__)) (write-pc (+ (read-pc stat feat) 4) stat feat)))
Theorem:
(defthm statp-of-inc4-pc (b* ((new-stat (inc4-pc stat feat))) (statp new-stat)) :rule-classes :rewrite)
Theorem:
(defthm stat-validp-of-inc4-pc (implies (stat-validp stat feat) (b* ((?new-stat (inc4-pc stat feat))) (stat-validp new-stat feat))))
Theorem:
(defthm inc4-pc-of-stat-fix-stat (equal (inc4-pc (stat-fix stat) feat) (inc4-pc stat feat)))
Theorem:
(defthm inc4-pc-stat-equiv-congruence-on-stat (implies (stat-equiv stat stat-equiv) (equal (inc4-pc stat feat) (inc4-pc stat-equiv feat))) :rule-classes :congruence)
Theorem:
(defthm inc4-pc-of-feat-fix-feat (equal (inc4-pc stat (feat-fix feat)) (inc4-pc stat feat)))
Theorem:
(defthm inc4-pc-feat-equiv-congruence-on-feat (implies (feat-equiv feat feat-equiv) (equal (inc4-pc stat feat) (inc4-pc stat feat-equiv))) :rule-classes :congruence)