SurfacePlusCal, but with every goto explicit and at the end of a block — the output of
statement desugaring.
Statement/Block/Branches are indexed by a Bool tracking whether a statement/block is
"terminal" (ends in goto) at the type level: "every block ends in exactly one terminal
statement" is a structural invariant rather than a side condition to maintain by hand.
Process.threads : List (List (String × Block α β true)) pairs each atomic block with its
label (the outer list is SurfacePlusCal's parallel {...} {...} threads, the inner list the
sequence of labelled atomic blocks within one thread).
Process/Declarations/Algorithm share the same α/β as Statement/Block/Branches/
Multicast: α is the declared-type annotation at whatever stage of checking it's
currently at. Content that can't be expressed via this shared α (@mailbox's channel
name/index expressions, @parameter's presence-as-a-Bool) instead gets a concrete field
(Process.mailbox, Declarations.variables' isParameter).
A multicast's recipients and payload, after the desugarer has collapsed
SurfacePlusCal.MulticastFilter's bind list to a single binder.
The surface form [x₁ ⋈₁ e₁, …, xₙ ⋈ₙ eₙ ↦ v] names the components of a recipient tuple, not
a chain of lets: it reaches every c[y] for y in the Cartesian product of the components,
where an ∈-bind contributes its set and an =-bind the singleton containing its value. The
desugarer turns that product into one set (set) over one binder (recipient), rewriting each
original name in val to a projection of it — the same collapse a multi-binder function
literal [x ∈ A, y ∈ B ↦ e] already gets. So nothing downstream reconstructs which bind was
which, and n = 1 — the overwhelmingly common case — passes through untouched.
- recipient : String
- ann : α
The recipient's declared-type annotation slot, at whatever stage of checking this is: the channel's own domain type once checked, since the recipient is what indexes the channel.
- set : β
The set of recipients, always of the channel's domain type.
- val : β
Instances For
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.
Equations
- One or more equations did not get rendered due to their size.
SurfacePlusCal.Ref, but each bracket group's own index is unary: x[e₁, …, eₙ] (n > 1)
desugars to x[<<e₁, …, eₙ>>]. x[e₁][e₂] (two separate bracket groups) is unaffected —
args' outer list (one entry per path segment) doesn't change shape. .inl for a .field
segment, .inr for a (now-unary) bracket-index segment.
- name : String
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- CorePlusCal.instReprRef = { reprPrec := CorePlusCal.instReprRef.repr }
Equations
- One or more equations did not get rendered due to their size.
- goto {α β : Type} (label : String) : Statement α β true
- skip {α β : Type} : Statement α β false
- print {α β : Type} (e : β) : Statement α β false
- assign {α β : Type} : List (Ref β × β) → Statement α β false
- if {α β : Type} {b : Bool} (cond : β) (B₁ B₂ : Block α β b) : Statement α β b
- await {α β : Type} (e : β) : Statement α β false
- with {α β : Type} (var : String) (ann : α) («=|∈» : Bool) (val : β) (B : Block α β false) : Statement α β false
- assert {α β : Type} (e : β) : Statement α β false
- either {α β : Type} {b : Bool} (branches : Branches α β b) : Statement α β b
- while {α β : Type} {b : Bool} (cond : β) (B : Block α β b) : Statement α β false
- receive {α β : Type} (c r : Ref β) : Statement α β false
- send {α β : Type} (c : Ref β) (e : β) : Statement α β false
- multicast {α β : Type} (c : String) (filter : Multicast α β) : Statement α β false
Instances For
Equations
Equations
- CorePlusCal.instReprBlock = { reprPrec := CorePlusCal.instReprBlock.repr_2 }
Equations
Equations
Equations
Equations
- CorePlusCal.instBifunctorStatement = { bimap := fun {α α' β β' : Type} => CorePlusCal.Statement.bimap }
Equations
- CorePlusCal.instBifunctorBlock = { bimap := fun {α α' β β' : Type} => CorePlusCal.Block.bimap }
Equations
- CorePlusCal.instBifunctorBranches = { bimap := fun {α α' β β' : Type} => CorePlusCal.Branches.bimap }
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- CorePlusCal.instBitraversableBlock = { toBifunctor := CorePlusCal.instBifunctorBlock, bitraverse := fun {m : Type → Type} [Applicative m] {α α' β β' : Type} => CorePlusCal.Block.bitraverse }
Equations
- One or more equations did not get rendered due to their size.
The declarations at the top of an algorithm or process block — the annotation-carrying
counterpart is SurfacePlusCal.Declarations. Shares the same α as Statement/Block/
Branches/Multicast.
(name, declared-type annotation, isParameter, initializer);isParameteristrueonly on a@parameter-annotated,∈-initialized entry. The initializer'sBoolistruefor=,falsefor∈.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- CorePlusCal.instBifunctorDeclarations = { bimap := fun {α α' β β' : Type} => CorePlusCal.Declarations.bimap }
Equations
- One or more equations did not get rendered due to their size.
(channel name, filter/index args), from at most one@mailboxannotation;noneif the process has no mailbox.- isFair : Bool
- name : String
- =|∈ : Bool
truefor=,falsefor∈. - id : β
- localState : Declarations α β
One entry per parallel
{...}thread; each thread is a sequence of labelled atomic blocks, in program order.
Instances For
Equations
- CorePlusCal.instReprProcess = { reprPrec := CorePlusCal.instReprProcess.repr }
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.
Equations
- One or more equations did not get rendered due to their size.
- isFair : Bool
- name : String
- globalState : Declarations α β
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.