Check if a list of zero or more certificates are all in a DAG and are connected by paths.
(certificates-dag-paths-p certs dag) → yes/no
That is, if the list is
Function:
(defun certificates-dag-paths-p (certs dag) (declare (xargs :guard (and (certificate-listp certs) (certificate-setp dag)))) (let ((__function__ 'certificates-dag-paths-p)) (declare (ignorable __function__)) (b* (((when (endp certs)) t) (cert (car certs)) ((unless (in cert dag)) nil) ((when (endp (cdr certs))) t) (cert1 (cadr certs)) ((unless (<= (certificate->round cert1) (certificate->round cert))) nil) ((unless (equal (path-to-author+round cert (certificate->author cert1) (certificate->round cert1) dag) cert1)) nil)) (certificates-dag-paths-p (cdr certs) dag))))
Theorem:
(defthm booleanp-of-certificates-dag-paths-p (b* ((yes/no (certificates-dag-paths-p certs dag))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm certificates-dag-paths-p-of-nil (certificates-dag-paths-p nil dag))
Theorem:
(defthm certificates-dag-paths-p-member-in-dag (implies (and (certificates-dag-paths-p certs dag) (member-equal cert certs)) (in cert dag)))
Theorem:
(defthm list-in-when-certificates-dag-paths-p (implies (certificates-dag-paths-p certs dag) (set::list-in certs dag)))