Collect all the anchors in a DAG, starting from a given anchor.
(collect-all-anchors last-anchor dag blockchain all-vals) → all-anchors
This is a specialization of collect-anchors that does not stop at the last committed rounds, but instead goes all the way to the start of the DAG.
The input
The guard requires that the active committee can be calculated
for the round of
The returned list of anchors satisfies certificates-dag-paths-p.
Function:
(defun collect-all-anchors (last-anchor dag blockchain all-vals) (declare (xargs :guard (and (certificatep last-anchor) (certificate-setp dag) (block-listp blockchain) (address-setp all-vals)))) (declare (xargs :guard (and (in last-anchor dag) (evenp (certificate->round last-anchor)) (active-committee-at-round (certificate->round last-anchor) blockchain all-vals)))) (let ((__function__ 'collect-all-anchors)) (declare (ignorable __function__)) (collect-anchors last-anchor (- (certificate->round last-anchor) 2) 0 dag blockchain all-vals)))
Theorem:
(defthm certificate-listp-of-collect-all-anchors (b* ((all-anchors (collect-all-anchors last-anchor dag blockchain all-vals))) (certificate-listp all-anchors)) :rule-classes :rewrite)
Theorem:
(defthm car-of-collect-all-anchors (b* ((?all-anchors (collect-all-anchors last-anchor dag blockchain all-vals))) (equal (car all-anchors) (certificate-fix last-anchor))))
Theorem:
(defthm certificates-dag-paths-p-of-collect-all-anchors (implies (and (certificate-setp dag) (in last-anchor dag)) (b* ((?all-anchors (collect-all-anchors last-anchor dag blockchain all-vals))) (certificates-dag-paths-p all-anchors dag))))