hwayne / learntla-v2

Learn TLA+ for free! No prior experience necessary!
https://www.learntla.com
Other
198 stars 41 forks source link

Typo in example or guard semantics unclear? #11

Closed asolove closed 2 years ago

asolove commented 2 years ago

The conceptual overview starts with pseudocode:

image

and naively I read this as python-ish code, where the if is controlling whether the other two lines run, in which case I think the guard expression is backwards (from.balance should be greater than or equal to the amount for it to work?)

(but perhaps some other pseudo-code format is intended, in which case I just got confused? or perhaps the typo is intentional and a later section will describe how model-checking interacts with things like unit tests or other ways to check for typos in the non-model real code? or perhaps I am doing the logic wrong myself?)

hwayne commented 2 years ago

Nope, it's a bug. Someone else pushed a fix, so should be clear now!