The well-formedness pass's diagnostics: one named error variant per violation, plus the one
non-fatal finding — a @mailbox nothing receives on, which is dropped rather than rejected.
The well-formedness pass's errors.
- unknownLabel
(pos : SourceSpan)
(label : String)
: WellFormednessError
A
gototargets a label that doesn't exist anywhere in its process ("Done"always counts as existing). - redefinedDone
(pos : SourceSpan)
: WellFormednessError
"Done"used as a real, user-defined label. - duplicateName
(pos : SourceSpan)
(name : String)
: WellFormednessError
A name is declared more than once in a scope where every name must be fresh.
- shadowedName
(pos : SourceSpan)
(name : String)
: WellFormednessError
A name shadows an already-in-scope name, in a scope where shadowing isn't allowed.
- channelInExpression
(pos : SourceSpan)
(τ : TypedTLAPlus.Typ)
: WellFormednessError
A channel-shaped value appears inside an ordinary expression — only
send/receive's channel argument andmulticast's target may reference one. Nonamefield: the offending subexpression need not be a bare variable (e.g.IF b THEN ch1 ELSE ch2), soτ(the Channel-shaped type actually found) is the only thing always available, matchingTCError.notAChannelType's own shape. - channelTypedVariable
(pos : SourceSpan)
(name : String)
: WellFormednessError
A
variables/with-declared name (algorithm-level, process-level, orwith-bound) has a Channel-shaped type — thechannels/fifosforms are the only legitimate way to declare one. - nonEmptyLocalChannels
(pos : SourceSpan)
(process : String)
: WellFormednessError
A process's own
localState.channels/.fifosisn't empty — defense-in-depth; the parser already guarantees this today. - globalPlusCalVariable
(pos : SourceSpan)
(name : String)
: WellFormednessError
The PlusCal algorithm itself declares algorithm-level
variables(shared mutable state across all processes) — onlyfifosis allowed at that level. - globalTLAPlusVariable
(pos : SourceSpan)
(name definedIn : String)
: WellFormednessError
A reference inside the algorithm resolves to a TLA⁺ module-level
VARIABLE—definedInnames the module that actually declared it (own or, viaEXTENDS, a dependency's). - bareTemporalOrAction
(pos : SourceSpan)
(op : String)
(path : List String)
: WellFormednessError
A temporal formula or action operator (
[],<>,ENABLED,UNCHANGED,',^+,^*,^#) appears somewhere the algorithm's expressions reach — directly in a statement (path := []) or transitively, through an operator/function call chain (paththe sequence of operator names traversed to get there, innermost first). - unboundedQuantifier
(pos : SourceSpan)
(path : List String)
: WellFormednessError
An unbounded quantifier (
\A x : P/\E x : P/CHOOSE x : P, no domain) appears somewhere the algorithm's expressions reach — same direct-vs-transitivepathshape asbareTemporalOrAction. - receiveChannelMismatch
(pos : SourceSpan)
(process expected found : String)
(indicesDiffer : Bool)
: WellFormednessError
A process
receives from a channel other than the one it already listens on — its declared@mailboxif it has one, otherwise the channel its firstreceivenames.expected/foundare the two channels' names; they can be equal and the channels still differ, when the index expressions do (agt[self]vsagt[other]), whichindicesDifferdistinguishes. - mailboxNotIndexedBySelf
(pos : SourceSpan)
(process channel : String)
: WellFormednessError
A
∈-shaped process (a process set) receives from a channel whose index path does not mentionself, so every instance of the set would drain the same FIFO. - receiveWithoutMailbox
(pos : SourceSpan)
(process channel : String)
: WellFormednessError
A process
receives without declaring a@mailbox. The channel a process listens on is the one thingGuarded2Network's singleinboxper instance is indexed by, so it has to be written down rather than inferred from whicheverreceivethe walk happens to reach first. - duplicateProcessName
(pos : SourceSpan)
(name : String)
: WellFormednessError
Two processes of one algorithm carry the same name. Separate from
duplicateName, which is about a scope: process names are not in any declaration scope — a process and a variable may share a name — but they are what the semantics dispatches an instance on, so they must be distinct among themselves. - duplicateLabel
(pos : SourceSpan)
(label : String)
: WellFormednessError
Two blocks of one algorithm carry the same label. Separate from
duplicateName: labels are their own namespace (WellFormedness/Labelling.lean'sProcess.labels), not a declaration scope, and — matching the original PlusCal-to-TLA⁺ translator, whose labels each become their own top-level TLA⁺ definition — that namespace spans the whole algorithm, not just one process. Within one process it is additionally an operational hazard:Process.codeTabletreats a label as denoting the union of every block carrying it, so a duplicate isn't rejected there — it silently becomes a non-deterministic choice between the blocks, which is never what the source program meant when it wrote agototo that name.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- instReprWellFormednessError = { reprPrec := instReprWellFormednessError.repr }
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
The well-formedness pass's warnings.
- unusedMailbox
(pos : SourceSpan)
(process channel : String)
: WellFormednessWarning
A process declares a
@mailboxand contains noreceive. The declaration is dropped, so that a.somemailbox means exactly "this process receives, on this channel".
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- instBEqWellFormednessWarning.beq (WellFormednessWarning.unusedMailbox a a_1 a_2) (WellFormednessWarning.unusedMailbox b b_1 b_2) = (a == b && (a_1 == b_1 && a_2 == b_2))
- instBEqWellFormednessWarning.beq x✝¹ x✝ = false
Instances For
Equations
The -W<name> a given warning is filtered under.
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.