Check if a certificate storage event is possible.
(store-certificate-possiblep val cert systate) → yes/no
The
When a certificate is received,
the (correct) validator puts it into the buffer.
From there, it is moved to the DAG
when the DAG contains all the certificates
referenced in the
The address
Function:
(defun store-certificate-possiblep (val cert systate) (declare (xargs :guard (and (addressp val) (certificatep cert) (system-statep systate)))) (let ((__function__ 'store-certificate-possiblep)) (declare (ignorable __function__)) (b* (((certificate cert) cert) ((unless (in (address-fix val) (correct-addresses systate))) nil) ((validator-state vstate) (get-validator-state val systate)) ((unless (in (certificate-fix cert) vstate.buffer)) nil) ((when (equal cert.round 1)) t) (all-previous-round-certs (certificates-with-round (1- cert.round) vstate.dag)) (all-previous-round-authors (certificate-set->author-set all-previous-round-certs)) ((unless (subset cert.previous all-previous-round-authors)) nil)) t)))
Theorem:
(defthm booleanp-of-store-certificate-possiblep (b* ((yes/no (store-certificate-possiblep val cert systate))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm store-certificate-possiblep-of-address-fix-val (equal (store-certificate-possiblep (address-fix val) cert systate) (store-certificate-possiblep val cert systate)))
Theorem:
(defthm store-certificate-possiblep-address-equiv-congruence-on-val (implies (address-equiv val val-equiv) (equal (store-certificate-possiblep val cert systate) (store-certificate-possiblep val-equiv cert systate))) :rule-classes :congruence)
Theorem:
(defthm store-certificate-possiblep-of-certificate-fix-cert (equal (store-certificate-possiblep val (certificate-fix cert) systate) (store-certificate-possiblep val cert systate)))
Theorem:
(defthm store-certificate-possiblep-certificate-equiv-congruence-on-cert (implies (certificate-equiv cert cert-equiv) (equal (store-certificate-possiblep val cert systate) (store-certificate-possiblep val cert-equiv systate))) :rule-classes :congruence)
Theorem:
(defthm store-certificate-possiblep-of-system-state-fix-systate (equal (store-certificate-possiblep val cert (system-state-fix systate)) (store-certificate-possiblep val cert systate)))
Theorem:
(defthm store-certificate-possiblep-system-state-equiv-congruence-on-systate (implies (system-state-equiv systate systate-equiv) (equal (store-certificate-possiblep val cert systate) (store-certificate-possiblep val cert systate-equiv))) :rule-classes :congruence)