Preservation of the invariant: if the invariant holds in a system state, it also holds in the next system state.
For each kind of event,
we first prove a theorem (or two in the case of
The definition of last-anchor depends on the DAG, blockchain, and last committed round of a validator. The proofs are based on how the events modify (or not) these components.
A
An
A
An
Theorem:
(defthm last-anchor-not-nil-of-create-next (implies (and (in val (correct-addresses systate)) (last-anchor (get-validator-state val systate))) (last-anchor (get-validator-state val (create-next cert systate)))))
Theorem:
(defthm last-anchor-present-p-of-create-next (implies (last-anchor-present-p systate) (last-anchor-present-p (create-next cert systate))))
Theorem:
(defthm last-anchor-not-nil-of-accept-next (implies (and (in val (correct-addresses systate)) (last-anchor (get-validator-state val systate)) (accept-possiblep msg systate)) (last-anchor (get-validator-state val (accept-next msg systate)))))
Theorem:
(defthm last-anchor-present-p-of-accept-next (implies (and (last-anchor-present-p systate) (accept-possiblep msg systate)) (last-anchor-present-p (accept-next msg systate))))
Theorem:
(defthm last-anchor-not-nil-of-advance-next (implies (and (in val1 (correct-addresses systate)) (last-anchor (get-validator-state val1 systate)) (advance-possiblep val systate)) (last-anchor (get-validator-state val1 (advance-next val systate)))))
Theorem:
(defthm last-anchor-present-p-of-advance-next (implies (and (last-anchor-present-p systate) (advance-possiblep msg systate)) (last-anchor-present-p (advance-next msg systate))))
Theorem:
(defthm last-anchor-not-nil-of-commit-next-diff (implies (and (in val1 (correct-addresses systate)) (not (equal (address-fix val1) (address-fix val))) (commit-possiblep val systate) (last-anchor (get-validator-state val1 systate))) (last-anchor (get-validator-state val1 (commit-next val systate)))))
Theorem:
(defthm last-anchor-not-nil-of-commit-next-same (implies (and (last-blockchain-round-p systate) (ordered-blockchain-p systate) (commit-possiblep val systate) (addressp val)) (last-anchor (get-validator-state val (commit-next val systate)))))
Theorem:
(defthm last-anchor-present-p-of-commit-next (implies (and (last-blockchain-round-p systate) (ordered-blockchain-p systate) (last-anchor-present-p systate) (commit-possiblep val systate) (addressp val)) (last-anchor-present-p (commit-next val systate))))
Theorem:
(defthm last-anchor-present-p-of-event-next (implies (and (last-blockchain-round-p systate) (ordered-blockchain-p systate) (last-anchor-present-p systate) (event-possiblep event systate)) (last-anchor-present-p (event-next event systate))))