Last active
September 6, 2024 09:37
-
-
Save gterzian/1f297aa22393ea8604ad14ca6a5cfff6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------- MODULE RafDelivery ----------------------------- | |
EXTENDS FiniteSets, Naturals | |
VARIABLES raf_requested, tick_received | |
CONSTANT N | |
---------------------------------------------------------------------------- | |
Pipeline == 0..N | |
TypeOk == /\ raf_requested \in [Pipeline -> BOOLEAN] | |
/\ tick_received \in BOOLEAN | |
RafInSync == tick_received => \E p \in Pipeline: raf_requested[p] | |
---------------------------------------------------------------------------- | |
Init == /\ raf_requested = [p \in Pipeline |-> FALSE] | |
/\ tick_received = FALSE | |
RequestRaf(p) == /\ raf_requested' = [raf_requested EXCEPT ![p] = TRUE] | |
/\ UNCHANGED<<tick_received>> | |
ReceiveTick == /\ \E p \in Pipeline: raf_requested[p] | |
/\ tick_received' = TRUE | |
/\ UNCHANGED<<raf_requested>> | |
RunRaf == /\ tick_received = TRUE | |
/\ raf_requested' = [p \in Pipeline |-> FALSE] | |
/\ tick_received' = FALSE | |
Next == \E p \in Pipeline: \/ RequestRaf(p) | |
\/ ReceiveTick | |
\/ RunRaf | |
Spec == Init /\ [][Next]_<<raf_requested, tick_received>> | |
---------------------------------------------------------------------------- | |
THEOREM Spec => [](TypeOk /\ RafInSync) | |
============================================================================= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment