feat(FLP): distributed algorithms for solving the consensus problem#556
Open
ctchou wants to merge 1 commit into
Open
feat(FLP): distributed algorithms for solving the consensus problem#556ctchou wants to merge 1 commit into
ctchou wants to merge 1 commit into
Conversation
Collaborator
Author
|
Rebased on the current |
| the reception of message `m` and `none` denotes a stuttering step. -/ | ||
| abbrev Action (P M : Type*) := Option (Message P M) | ||
|
|
||
| /-- `Dest ps x` means that if `x ≠ none`, then `x = some m` with `m.dest ∈ ps`. -/ |
Contributor
There was a problem hiding this comment.
Here you meant to write DestIn.
|
|
||
| /-- Given `inp : P → Bool`, the initial state of the algorithm `a` contains a single message | ||
| carrying the boolean value `inp p` to each process `p`, where the initial internal state is | ||
| `a.init p` and no decision has been made. The assumption `[Fintyep P]` is made because |
Contributor
There was a problem hiding this comment.
Fintyep -> Fintype.
| its `out` field, it is not allowed to "change its mind" later. -/ | ||
| def Algorithm.recvMsg (a : Algorithm P M S) (m : Message P M) (s : State P M S) : State P M S := | ||
| let p := m.dest | ||
| { msgs := s.msgs.erase m + a.send m (s.proc p) |
Contributor
There was a problem hiding this comment.
What if m wasn't contained in s.msgs to begin with? I see that is handled by Algorithm.LTS correctly, but a comment explaining this would be useful for future readers.
| /-- The global state of the distributed algorithm. -/ | ||
| structure State (P M S : Type*) where | ||
| /-- A multiset containing all messages that are in-flight (namely, they have been sent but | ||
| not yet received. Note that being a multiset implies that the messages are not ordered. -/ |
Contributor
There was a problem hiding this comment.
close parens here?
|
|
||
| /-- The stuttering step does not change the global state. -/ | ||
| theorem tr_none {s s' : State P M S} (h : a.LTS.Tr s none s') : s = s' := by | ||
| grind [Algorithm.LTS] |
Contributor
There was a problem hiding this comment.
I think the iff here might be nicer?
|
|
||
| namespace Cslib.FLP | ||
|
|
||
| open Function Set Sum Multiset |
Contributor
There was a problem hiding this comment.
Function is unused here.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the first PR of the formalization of Völzer's proof of the famous result in distributed computing, first proved by Fischer, Lynch and Paterson, that distributed consensus is impossible in the presence of even a single crash fault.
Algorithm.leandefines the "syntax" of a distributed algorithm for solving the consensus problem and proves some basic properties.Zulip discussion:
#CSLib > Impossibility of distributed consensus