Update a variable in static storage in a canonical representation of computation states.
(update-static-var var val compst) → new-compst
This is analogous to update-var, but for variables in static storage. It is equivalent to write-static-var when the latter does not return an error.
Function:
(defun update-static-var (var val compst) (declare (xargs :guard (and (identp var) (valuep val) (compustatep compst)))) (let ((__function__ 'update-static-var)) (declare (ignorable __function__)) (b* ((static (compustate->static compst)) (new-static (omap::update (ident-fix var) (remove-flexible-array-member val) static)) (new-compst (change-compustate compst :static new-static))) new-compst)))
Theorem:
(defthm compustatep-of-update-static-var (b* ((new-compst (update-static-var var val compst))) (compustatep new-compst)) :rule-classes :rewrite)
Theorem:
(defthm update-static-var-of-ident-fix-var (equal (update-static-var (ident-fix var) val compst) (update-static-var var val compst)))
Theorem:
(defthm update-static-var-ident-equiv-congruence-on-var (implies (ident-equiv var var-equiv) (equal (update-static-var var val compst) (update-static-var var-equiv val compst))) :rule-classes :congruence)
Theorem:
(defthm update-static-var-of-value-fix-val (equal (update-static-var var (value-fix val) compst) (update-static-var var val compst)))
Theorem:
(defthm update-static-var-value-equiv-congruence-on-val (implies (value-equiv val val-equiv) (equal (update-static-var var val compst) (update-static-var var val-equiv compst))) :rule-classes :congruence)
Theorem:
(defthm update-static-var-of-compustate-fix-compst (equal (update-static-var var val (compustate-fix compst)) (update-static-var var val compst)))
Theorem:
(defthm update-static-var-compustate-equiv-congruence-on-compst (implies (compustate-equiv compst compst-equiv) (equal (update-static-var var val compst) (update-static-var var val compst-equiv))) :rule-classes :congruence)