Choreography #
A choreography defines the collective behaviour of a system of communicating participants (processes) [Mon23].
Limitations #
Some notable features not yet included:
- Recursion (only the syntax is implemented, but no semantics).
- General recursion (the current syntax supports only tail recursion).
- Choreographic choice (for barriers, first-come/first-served patterns, etc.).
- Asynchronous communication.
References #
Syntax of choreographies #
Expressions for local computation.
- var
{Var : Type u_1}
{Val : Type u_2}
{FunId : Type u_3}
(x : Var)
: Expr Var Val FunId
Read variable
x. - val
{Var : Type u_1}
{Val : Type u_2}
{FunId : Type u_3}
(v : Val)
: Expr Var Val FunId
Value
v. - call
{Var : Type u_1}
{Val : Type u_2}
{FunId : Type u_3}
(f : FunId)
(args : List (Expr Var Val FunId))
: Expr Var Val FunId
Call function
fwith argumentsargs.
Instances For
Utility instance to write variables directly as expressions.
Equations
- Cslib.Languages.Mech.instCoeExpr = { coe := fun (x : Var) => Cslib.Languages.Mech.Expr.var x }
Utility instance to write values directly as expressions.
Equations
- Cslib.Languages.Mech.instCoeExpr_1 = { coe := fun (v : Val) => Cslib.Languages.Mech.Expr.val v }
Choreographic prefix.
- assign
{Pid : Type u_1}
{Var : Type u_2}
{Val : Type u_3}
{FunId : Type u_4}
{SelLabel : Type u_5}
(p : Pid)
(x : Var)
(e : Expr Var Val FunId)
: Prefix Pid Var Val FunId SelLabel
passignsxthe value computed frome. - com
{Pid : Type u_1}
{Var : Type u_2}
{Val : Type u_3}
{FunId : Type u_4}
{SelLabel : Type u_5}
(p : Pid)
(e : Expr Var Val FunId)
(q : Pid)
(x : Var)
: Prefix Pid Var Val FunId SelLabel
pcommunicates the evaluation ofetoq, which stores it in its variablex. - sel
{Pid : Type u_1}
{Var : Type u_2}
{Val : Type u_3}
{FunId : Type u_4}
{SelLabel : Type u_5}
(p q : Pid)
(l : SelLabel)
: Prefix Pid Var Val FunId SelLabel
pcommunicates the selection label (a static tag used to denote a choice) toq.
Instances For
Choreographies.
- nil
{Pid : Type u_1}
{Var : Type u_2}
{Val : Type u_3}
{FunId : Type u_4}
{SelLabel : Type u_5}
{ProcName : Type u_6}
: Choreography Pid Var Val FunId SelLabel ProcName
The terminated choreography.
- pre
{Pid : Type u_1}
{Var : Type u_2}
{Val : Type u_3}
{FunId : Type u_4}
{SelLabel : Type u_5}
{ProcName : Type u_6}
(prf : Prefix Pid Var Val FunId SelLabel)
(c : Choreography Pid Var Val FunId SelLabel ProcName)
: Choreography Pid Var Val FunId SelLabel ProcName
Do
prfand continue asc. - cond
{Pid : Type u_1}
{Var : Type u_2}
{Val : Type u_3}
{FunId : Type u_4}
{SelLabel : Type u_5}
{ProcName : Type u_6}
(p : Pid)
(e : Expr Var Val FunId)
(c₁ c₂ : Choreography Pid Var Val FunId SelLabel ProcName)
: Choreography Pid Var Val FunId SelLabel ProcName
Conditional:
pevaluateseto choose betweenc₁andc₂. - call
{Pid : Type u_1}
{Var : Type u_2}
{Val : Type u_3}
{FunId : Type u_4}
{SelLabel : Type u_5}
{ProcName : Type u_6}
(proc : ProcName)
(ps : List Pid)
: Choreography Pid Var Val FunId SelLabel ProcName
Call the procedure
proc.
Instances For
Equations
Syntactic category for prefixes.
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
p assigns x the value computed from e.
Equations
- One or more equations did not get rendered due to their size.
Instances For
p communicates the evaluation of e to q, which stores it in its variable x.
Equations
- One or more equations did not get rendered due to their size.
Instances For
p communicates the selection label (a static tag used to denote a choice) to q.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Choreographic prefix.
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
Syntactic category for choreographies.
Equations
Instances For
The terminated choreography.
Equations
- Cslib.Languages.Mech.mechChor_ = Lean.ParserDescr.node `Cslib.Languages.Mech.mechChor_ 1022 (Lean.ParserDescr.const `num)
Instances For
Do prf and continue as c.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Conditional: p evaluates e to choose between c₁ and c₂.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Choreographies.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Process names in a prefix.
Equations
Instances For
Process names in a choreography.