process local invariant in PlusCal

67 views Asked by At
process(Server \in Servers)
variable x;
{
    ...
}

I want to have an invariant of x > 0 for all processes. Is there any way other than making x global?

I tried

define {
  Inv == \A s \in Servers: x[s] > 0
}

But in translated TLA+ code, Inv is defined before variable x

1

There are 1 answers

0
Hovercouch On BEST ANSWER

Place the invariant after the \* END TRANSLATION line and it won't get clobbered by the PlusCal translator.