Sequence of anchors committed by a validator.
(committed-anchors vstate vals) → anchors
If the last committed round is 0 (i.e. there is no last committed round),
no anchors have been committed, and we return
Function:
(defun committed-anchors (vstate vals) (declare (xargs :guard (and (validator-statep vstate) (address-setp vals)))) (declare (xargs :guard (and (not (emptyp vals)) (evenp (validator-state->last vstate)) (or (equal (validator-state->last vstate) 0) (last-anchor vstate vals))))) (let ((__function__ 'committed-anchors)) (declare (ignorable __function__)) (b* (((validator-state vstate) vstate) ((when (equal vstate.last 0)) nil) (last-anchor (last-anchor vstate vals))) (collect-all-anchors last-anchor vstate.dag vals))))
Theorem:
(defthm certificate-listp-of-committed-anchors (b* ((anchors (committed-anchors vstate vals))) (certificate-listp anchors)) :rule-classes :rewrite)
Theorem:
(defthm committed-anchors-when-last-is-0 (implies (equal (validator-state->last vstate) 0) (equal (committed-anchors vstate vals) nil)))
Theorem:
(defthm consp-of-committed-anchors-when-last-not-0 (implies (not (equal (validator-state->last vstate) 0)) (consp (committed-anchors vstate vals))) :rule-classes :type-prescription)
Theorem:
(defthm car-of-committed-anchors (implies (and (not (equal (validator-state->last vstate) 0)) (last-anchor vstate vals)) (equal (car (committed-anchors vstate vals)) (last-anchor vstate vals))))