Skip to content

Instantly share code, notes, and snippets.

Last active September 26, 2016 13:22
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save adizere/bf7423045e05aa53c4f3 to your computer and use it in GitHub Desktop.
Latex sample for algorithm implementation, as used in CS-451 Distributed Algorithms
UniformReliableBroadcast, \textbf{instance} \textit{urb}.
IdealPerfectPointToPointLinks, \textbf{instance} \textit{idealpl}.
\textbf{upon event} \textit{\(<\)urb, Init\(>\)} \textbf{do}
\textit{delivered} := \(\emptyset\);
\textbf{upon event} \textit{\(<\)urb, Broadcast \(|\) \textit{m}\(>\)} \textbf{do}
\textbf{trigger} \textit{\(<\)idealpl, Send \(|\) self, (DATA, self, m)\(>\)};
\textbf{upon event} \textit{\(<\)idealpl, Deliver \(|\) p, (DATA, s, m)\(>\)} \textbf{do}
\textbf{if} \textit{m} \(\not\in\) \textit{delivered} \textbf{then}
\textit{delivered} := \textit{delivered} \(\cup\) (\textit{m});
\textbf{forall} \textit{q} \(\in \Pi\)
\textbf{trigger} \textit{\(<\)idealpl, Send \(|\) q, (DATA, s, m)\(>\)};
\textbf{trigger} \textit{\(<\)urb, Deliver \(|\) s, m\(>\)};
Copy link

adizere commented Oct 28, 2015

Yields the following snippet:

screen shot 2015-10-28 at 12 58 01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment