[Newbie Question] Engineer trying to get maths meaning

70 views
Skip to first unread message

Frank Eaves

unread,
Oct 2, 2020, 1:44:13 PM10/2/20
to tlaplus
Hi,

I'm trying to understand this part of the paxos specification. I'm not trying to understand how paxos works, I get that, I'm just trying to understand how to read and understand this part of the specification. 

01  /\ \E Q \in Quorum :
02        LET Q1b == {m \in msgs : /\ m.type = "1b"
03                                 /\ m.acc \in Q
04                                 /\ m.bal = b}
05            Q1bv == {m \in Q1b : m.mbal \geq 0}
06        IN  /\ \A a \in Q : \E m \in Q1b : m.acc = a 
07            /\ \/ Q1bv = {}
08               \/ \E m \in Q1bv : 
09                    /\ m.mval = v
10                    /\ \A mm \in Q1bv : m.mbal \geq mm.mbal 

On line 01 you define that Q is in set of Quorum and then lines 02-10 define what Q will be. My confusion is on Line 03 Q is referenced. How can you reference something that hasn't been assigned a value yet. 

I may very well be suffering from "... brain washing done by years of C programming".

Any help that I could get in understanding this would be greatly appreciated. Also, is there a place on the web were I can better familiarize my self with such concepts.

Thanks,

-Frank

Rodrick Chapman

unread,
Oct 2, 2020, 7:48:28 PM10/2/20
to tlaplus

It's just syntax. It happens to be syntax that's based on century-old mathematical notation, but at the end of the day, it's still just syntax.

The trouble you’re having is caused by your assumption that Q is defined on the left side of the colon ("\E Q \in Quorum"), and then used on the right side.

But, in fact, Q is actually defined on the right side of the colon and then used on the left. In other words, we define Q and then ask “is there any element in the set Quorum that meets the definition of Q?”

Stephan Merz

unread,
Oct 3, 2020, 2:24:38 AM10/3/20
to tla...@googlegroups.com
To follow up on this, Q is not really "defined" by this formula because a definition would have to be unambiguous. The formula checks for the existence of a quorum satisfying certain properties. The quantifier introduces (or "declares") a name Q for naming the value whose properties are being described in lines 2-10 and requires Q to belong to the set Quorum. The formula is true if some such value exists and false otherwise. Also, the scope of Q is restricted to the body of the formula, and Q has no meaning after the formula has been evaluated, in contrast to a definition that introduces a name that can be used later.

Stephan

-- 
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/f51dc912-3169-48d3-a108-7b86fcc2f3b1n%40googlegroups.com.

Igor Konnov

unread,
Oct 3, 2020, 4:58:58 AM10/3/20
to tla...@googlegroups.com, Igor Konnov
Hi Frank,

Would you have trouble understanding the following piece of code in a functional language (Scala)?

Set(Set(1, 2), Set(1, 3), Set(2, 3)).exists(Q =>
Q.contains(2)
) ///

Since the TLA+ code in lines 2-10 does not mention primed variables, you can think of it as a collection of set iterators (exists and forall) and set comprehensions (filter, map). The important differences are:

1. The order of set traversal is not fixed. You would not not expect a fixed order within hash sets in many languages either. Golang goes even further by randomizing iteration over maps.

2. The evaluation order of /\ and \/ is also arbitrary. Though TLC explores these expressions in a fixed top-down and left-to-right order.

3. As Rodrick mentioned, the rest is just mathematical syntax :-)


Igor
> To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/A72E8EDE-0DC2-408F-BB25-21087815B1E4%40gmail.com.

Frank Eaves

unread,
Oct 3, 2020, 6:09:27 AM10/3/20
to tla...@googlegroups.com
Thanks Rodrick, Stephan adn Igor,

This makes sense to me now. Changing my thinking and how to approach logical problems can be difficult, but on this issue I am no longer confused. 

Thanks all.

-Frank

You received this message because you are subscribed to a topic in the Google Groups "tlaplus" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tlaplus/NWaXjUZxW_c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tlaplus+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/A72E8EDE-0DC2-408F-BB25-21087815B1E4%40gmail.com.
Reply all
Reply to author
Forward
0 new messages