Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receive() can receive dropped messages #2

Open
dricketts opened this issue Aug 1, 2016 · 3 comments
Open

Receive() can receive dropped messages #2

dricketts opened this issue Aug 1, 2016 · 3 comments

Comments

@dricketts
Copy link

I don't think that DropMessage is defined correctly. In particular, it does not actually remove messages from the variables messages. Instead, it decrements the counter for the given message, if it already exists in messages. This has two issues:

  • messages is not a function from Message to Nat, as the comment above message suggests. Instead, it is a function from Message to Int.
  • Receive only requires that the received message be in the domain of messages, which means that it can continue to receive messages that have been dropped (even if their count drops below zero).
@ongardie
Copy link
Owner

ongardie commented Aug 3, 2016

Hi @dricketts. I think you're right, and I vaguely remember this being a late change to the spec. Care to submit a PR?

@dricketts
Copy link
Author

@ongardie I'd be happy to submit a PR. The easiest option that I see is to use the Bags module, but the comment above messages says that Bags is not supported by TLAPS. In what sense is it not supported? I've tried some proofs using Bags, and you can definitely use the definitions and associated theorems from this module: https://tlaps.codeplex.com/SourceControl/latest#library/Bags.tla.

I ask about TLAPS because I'm trying to do the Raft safety proof using TLAPS. I know that it's already been done in Coq, but I'm curious to compare and contrast the proof in the two different formalisms.

@ongardie
Copy link
Owner

@dricketts, sorry for the delay. I don't remember why I wrote that comment before, but maybe I was wrong or maybe it's changed since. If it's working for you under TLAPS, that's good enough for me. Feel free to switch it to using Bags. Good luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants