Retrieve the state of a validator from the system.
(get-validator-state val systate) → vstate?
Function:
(defun get-validator-state (val systate) (declare (xargs :guard (and (addressp val) (system-statep systate)))) (declare (xargs :guard (in val (all-addresses systate)))) (let ((__function__ 'get-validator-state)) (declare (ignorable __function__)) (validator-state-option-fix (omap::lookup val (system-state->validators systate)))))
Theorem:
(defthm validator-state-optionp-of-get-validator-state (b* ((vstate? (get-validator-state val systate))) (validator-state-optionp vstate?)) :rule-classes :rewrite)
Theorem:
(defthm get-validator-state-of-system-state-fix-systate (equal (get-validator-state val (system-state-fix systate)) (get-validator-state val systate)))
Theorem:
(defthm get-validator-state-system-state-equiv-congruence-on-systate (implies (system-state-equiv systate systate-equiv) (equal (get-validator-state val systate) (get-validator-state val systate-equiv))) :rule-classes :congruence)
Theorem:
(defthm validator-statep-of-get-validator-state (implies (in val (correct-addresses systate)) (b* ((?vstate? (get-validator-state val systate))) (validator-statep vstate?))))
Theorem:
(defthm in-correct-validator-addresess-when-get-validator-state (implies (get-validator-state val systate) (in val (correct-addresses systate))))
Theorem:
(defthm get-validator-state-iff-in-correct-addresses (iff (get-validator-state val systate) (in val (correct-addresses systate))))