Closed shayanh closed 3 years ago
I see - thanks for the bug report.
The main underlying issue is that TLA+ does not support scope shadowing... at all. If you look at the generated code, it tries to define leader
twice in the same scope, which is rejected by TLC. This isn't strictly the MPCal code's fault, because there is no way to work around this in MPCal-land: there is one mapping macro definition with one name, and it can result in the "same code" being nested inside itself.
So, I'll need to be even more conservative re: renamings. The fix is to ensure that expanded mapping macros use fresh names in with-bindings.
When I try to compile the PlusCal output of the attached spec to TLA+, I got the following error:
attached spec: https://gist.github.com/shayanh/e15896c52216d67c3301ac88e8deffc0