Set of the certificates in a DAG that are precedessors of a certificate in a DAG.
(predecessors cert dag) → certs
These are the destination certificates of the edges in the DAG
that have the certificate
Here `precedessor' refers to the fact that
the return certificates are
in the (immediately) preceding round of
If the certificate is at round 1, we return the empty set.
Otherwise, we return the certificates at the previous round
that are authored by the previous authors in the certificate.
All the returned certificates are in the round just before
Function:
(defun predecessors (cert dag) (declare (xargs :guard (and (certificatep cert) (certificate-setp dag)))) (declare (xargs :guard (in cert dag))) (let ((__function__ 'predecessors)) (declare (ignorable __function__)) (if (equal (certificate->round cert) 1) nil (certificates-with-authors+round (certificate->previous cert) (1- (certificate->round cert)) dag))))
Theorem:
(defthm certificate-setp-of-predecessors (b* ((certs (predecessors cert dag))) (certificate-setp certs)) :rule-classes :rewrite)
Theorem:
(defthm predecessors-subset-of-dag (implies (certificate-setp dag) (b* ((?certs (predecessors cert dag))) (subset certs dag))))
Theorem:
(defthm predecessors-subset-of-previous-round (implies (certificate-setp dag) (b* ((?certs (predecessors cert dag))) (subset certs (certificates-with-round (1- (certificate->round cert)) dag)))))
Theorem:
(defthm certificate-set->round-set-of-predecessors (implies (certificate-setp dag) (equal (certificate-set->round-set (predecessors cert dag)) (if (emptyp (predecessors cert dag)) nil (insert (1- (certificate->round cert)) nil)))))
Theorem:
(defthm head-of-predecessors-in-predecessors (implies (not (emptyp (predecessors cert dag))) (in (head (predecessors cert dag)) (predecessors cert dag))))
Theorem:
(defthm head-of-predecessors-in-dag (implies (and (certificate-setp dag) (not (emptyp (predecessors cert dag)))) (in (head (predecessors cert dag)) dag)))
Theorem:
(defthm round-in-predecessors-is-one-less (implies (and (certificate-setp dag) (in cert1 (predecessors cert dag))) (equal (certificate->round cert1) (1- (certificate->round cert)))))
Theorem:
(defthm round-of-head-of-predecessors (implies (and (certificate-setp dag) (not (emptyp (predecessors cert dag)))) (equal (certificate->round (head (predecessors cert dag))) (1- (certificate->round cert)))))