Sequence of anchors committed by a validator.
(committed-anchors vstate) → 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) (declare (xargs :guard (validator-statep vstate))) (declare (xargs :guard (and (evenp (validator-state->last vstate)) (or (equal (validator-state->last vstate) 0) (last-anchor vstate))))) (let ((__function__ 'committed-anchors)) (declare (ignorable __function__)) (b* (((validator-state vstate) vstate) ((when (equal vstate.last 0)) nil) (last-anchor (last-anchor vstate))) (collect-all-anchors last-anchor vstate.dag vstate.blockchain))))
Theorem:
(defthm certificate-listp-of-committed-anchors (b* ((anchors (committed-anchors vstate))) (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) nil)))
Theorem:
(defthm consp-of-committed-anchors-when-last-not-0 (implies (not (equal (validator-state->last vstate) 0)) (consp (committed-anchors vstate))) :rule-classes :type-prescription)
Theorem:
(defthm car-of-committed-anchors (implies (and (not (equal (validator-state->last vstate) 0)) (last-anchor vstate)) (equal (car (committed-anchors vstate)) (last-anchor vstate))))
Theorem:
(defthm certificates-dag-paths-p-of-committed-anchors (implies (or (equal (validator-state->last vstate) 0) (in (last-anchor vstate) (validator-state->dag vstate))) (b* ((?anchors (committed-anchors vstate))) (certificates-dag-paths-p anchors (validator-state->dag vstate)))))
Theorem:
(defthm committed-anchors-of-validator-state-fix-vstate (equal (committed-anchors (validator-state-fix vstate)) (committed-anchors vstate)))
Theorem:
(defthm committed-anchors-validator-state-equiv-congruence-on-vstate (implies (validator-state-equiv vstate vstate-equiv) (equal (committed-anchors vstate) (committed-anchors vstate-equiv))) :rule-classes :congruence)