Check if a certificate creation event is possible, from the point of view of all the certificate's endorsers.
(create-certificate-endorsers-possiblep cert systate) → yes/no
The input
An endorser may be correct or faulty. If it is correct, it must satisfy the conditions formalized in create-certificate-endorser-possiblep. If it is faulty, it is not bound by any condition.
Note that, if there are (as normal) multiple correct endorsers,
the conditions involving committees as viewed by the endorsers
imply at least some agreement among the blockchains of the validators,
enough to make consistent checks involving the committee.
As proved in same-committees,
it is a system invariant that
different validators agree on the committees they can both calculate,
because of the invariant that blockchains never fork.
Thus, in each state, which satisfies the invariant,
starting with an initial state,
the conditions on the possibility of a
Note that we instantiate the
Function:
(defun create-certificate-endorsers-possiblep-loop (cert endorsers systate) (declare (xargs :guard (and (certificatep cert) (address-setp endorsers) (system-statep systate)))) (let ((__function__ 'create-certificate-endorsers-possiblep-loop)) (declare (ignorable __function__)) (b* (((when (emptyp endorsers)) t) (endorser (head endorsers)) ((unless (in endorser (correct-addresses systate))) (create-certificate-endorsers-possiblep-loop cert (tail endorsers) systate)) ((unless (create-certificate-endorser-possiblep cert (get-validator-state endorser systate) (all-addresses systate))) nil)) (create-certificate-endorsers-possiblep-loop cert (tail endorsers) systate))))
Theorem:
(defthm booleanp-of-create-certificate-endorsers-possiblep-loop (b* ((yes/no (create-certificate-endorsers-possiblep-loop cert endorsers systate))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm create-certificate-endorsers-possiblep-loop-of-certificate-fix-cert (equal (create-certificate-endorsers-possiblep-loop (certificate-fix cert) endorsers systate) (create-certificate-endorsers-possiblep-loop cert endorsers systate)))
Theorem:
(defthm create-certificate-endorsers-possiblep-loop-certificate-equiv-congruence-on-cert (implies (certificate-equiv cert cert-equiv) (equal (create-certificate-endorsers-possiblep-loop cert endorsers systate) (create-certificate-endorsers-possiblep-loop cert-equiv endorsers systate))) :rule-classes :congruence)
Theorem:
(defthm create-certificate-endorsers-possiblep-loop-of-system-state-fix-systate (equal (create-certificate-endorsers-possiblep-loop cert endorsers (system-state-fix systate)) (create-certificate-endorsers-possiblep-loop cert endorsers systate)))
Theorem:
(defthm create-certificate-endorsers-possiblep-loop-system-state-equiv-congruence-on-systate (implies (system-state-equiv systate systate-equiv) (equal (create-certificate-endorsers-possiblep-loop cert endorsers systate) (create-certificate-endorsers-possiblep-loop cert endorsers systate-equiv))) :rule-classes :congruence)
Function:
(defun create-certificate-endorsers-possiblep (cert systate) (declare (xargs :guard (and (certificatep cert) (system-statep systate)))) (let ((__function__ 'create-certificate-endorsers-possiblep)) (declare (ignorable __function__)) (create-certificate-endorsers-possiblep-loop cert (certificate->endorsers cert) systate)))
Theorem:
(defthm booleanp-of-create-certificate-endorsers-possiblep (b* ((yes/no (create-certificate-endorsers-possiblep cert systate))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm create-certificate-endorsers-possiblep-of-certificate-fix-cert (equal (create-certificate-endorsers-possiblep (certificate-fix cert) systate) (create-certificate-endorsers-possiblep cert systate)))
Theorem:
(defthm create-certificate-endorsers-possiblep-certificate-equiv-congruence-on-cert (implies (certificate-equiv cert cert-equiv) (equal (create-certificate-endorsers-possiblep cert systate) (create-certificate-endorsers-possiblep cert-equiv systate))) :rule-classes :congruence)
Theorem:
(defthm create-certificate-endorsers-possiblep-of-system-state-fix-systate (equal (create-certificate-endorsers-possiblep cert (system-state-fix systate)) (create-certificate-endorsers-possiblep cert systate)))
Theorem:
(defthm create-certificate-endorsers-possiblep-system-state-equiv-congruence-on-systate (implies (system-state-equiv systate systate-equiv) (equal (create-certificate-endorsers-possiblep cert systate) (create-certificate-endorsers-possiblep cert systate-equiv))) :rule-classes :congruence)