Check if all the system states in an execution from a system state via a sequence of events are fault-tolerant.
(all-system-committees-fault-tolerant-p systate events) → yes/no
When talking about properties of executions,
i.e. sequences of states from a starting state
through a serie of states that result from a sequence of events,
we need to make the hypothesis that
all the committees along the way are fault-tolerant.
This predicate expresses that:
For this predicate to hold, first the starting state must be fault-tolerant. If there are no events, there is no other requirement. Otherwise, we execute the event and we recursively call this predicate with the resulting state: this covers all the states in the execution.
We show that this predicate holds if the final state is fault-tolerant and the initial state satisfies two invariants about blockchain rounds.
Function:
(defun all-system-committees-fault-tolerant-p (systate events) (declare (xargs :guard (and (system-statep systate) (event-listp events)))) (declare (xargs :guard (events-possiblep events systate))) (let ((__function__ 'all-system-committees-fault-tolerant-p)) (declare (ignorable __function__)) (b* (((unless (system-committees-fault-tolerant-p systate)) nil) ((when (endp events)) t)) (all-system-committees-fault-tolerant-p (event-next (car events) systate) (cdr events)))))
Theorem:
(defthm booleanp-of-all-system-committees-fault-tolerant-p (b* ((yes/no (all-system-committees-fault-tolerant-p systate events))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm all-system-committees-fault-tolerant-p-when-final (implies (and (last-blockchain-round-p systate) (ordered-blockchain-p systate) (events-possiblep events systate)) (b* ((new-systate (events-next events systate))) (implies (system-committees-fault-tolerant-p new-systate) (all-system-committees-fault-tolerant-p systate events)))))
Theorem:
(defthm all-system-committees-fault-tolerant-p-of-system-state-fix-systate (equal (all-system-committees-fault-tolerant-p (system-state-fix systate) events) (all-system-committees-fault-tolerant-p systate events)))
Theorem:
(defthm all-system-committees-fault-tolerant-p-system-state-equiv-congruence-on-systate (implies (system-state-equiv systate systate-equiv) (equal (all-system-committees-fault-tolerant-p systate events) (all-system-committees-fault-tolerant-p systate-equiv events))) :rule-classes :congruence)
Theorem:
(defthm all-system-committees-fault-tolerant-p-of-event-list-fix-events (equal (all-system-committees-fault-tolerant-p systate (event-list-fix events)) (all-system-committees-fault-tolerant-p systate events)))
Theorem:
(defthm all-system-committees-fault-tolerant-p-event-list-equiv-congruence-on-events (implies (event-list-equiv events events-equiv) (equal (all-system-committees-fault-tolerant-p systate events) (all-system-committees-fault-tolerant-p systate events-equiv))) :rule-classes :congruence)